@agilant/toga-blox 1.0.8 → 1.0.9

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 (215) hide show
  1. package/assets/cable.jpg +0 -0
  2. package/assets/card-1.jpg +0 -0
  3. package/assets/cat-logo.png +0 -0
  4. package/assets/item.jpg +0 -0
  5. package/assets/map.png +0 -0
  6. package/coverage/base.css +224 -0
  7. package/coverage/block-navigation.js +87 -0
  8. package/coverage/clover.xml +953 -0
  9. package/coverage/coverage-final.json +74 -0
  10. package/coverage/favicon.png +0 -0
  11. package/coverage/index.html +551 -0
  12. package/coverage/prettify.css +1 -0
  13. package/coverage/prettify.js +2 -0
  14. package/coverage/sort-arrow-sprite.png +0 -0
  15. package/coverage/sorter.js +196 -0
  16. package/coverage/toga-blox-npm/index.html +131 -0
  17. package/coverage/toga-blox-npm/postcss.config.js.html +103 -0
  18. package/coverage/toga-blox-npm/src/components/Badge/Badge.stories.tsx.html +793 -0
  19. package/coverage/toga-blox-npm/src/components/Badge/Badge.tsx.html +247 -0
  20. package/coverage/toga-blox-npm/src/components/Badge/index.html +131 -0
  21. package/coverage/toga-blox-npm/src/components/Card/Card.stories.tsx.html +787 -0
  22. package/coverage/toga-blox-npm/src/components/Card/Card.tsx.html +163 -0
  23. package/coverage/toga-blox-npm/src/components/Card/index.html +131 -0
  24. package/coverage/toga-blox-npm/src/components/Card/templates/CategoryCardTemplate.tsx.html +343 -0
  25. package/coverage/toga-blox-npm/src/components/Card/templates/CompassCardTemplate.tsx.html +259 -0
  26. package/coverage/toga-blox-npm/src/components/Card/templates/CounterContentCardTemplate.tsx.html +685 -0
  27. package/coverage/toga-blox-npm/src/components/Card/templates/HorizontalCardTemplate.tsx.html +637 -0
  28. package/coverage/toga-blox-npm/src/components/Card/templates/ItemCardTemplate.tsx.html +550 -0
  29. package/coverage/toga-blox-npm/src/components/Card/templates/KitContentCardTemplate.tsx.html +469 -0
  30. package/coverage/toga-blox-npm/src/components/Card/templates/ShippingAddressCardTemplate.tsx.html +418 -0
  31. package/coverage/toga-blox-npm/src/components/Card/templates/VerticalCardTemplate.tsx.html +592 -0
  32. package/coverage/toga-blox-npm/src/components/Card/templates/index.html +221 -0
  33. package/coverage/toga-blox-npm/src/components/CounterButton/CounterButton.stories.tsx.html +358 -0
  34. package/coverage/toga-blox-npm/src/components/CounterButton/CounterButton.tsx.html +385 -0
  35. package/coverage/toga-blox-npm/src/components/CounterButton/index.html +131 -0
  36. package/coverage/toga-blox-npm/src/components/Description/Description.stories.tsx.html +286 -0
  37. package/coverage/toga-blox-npm/src/components/Description/Description.tsx.html +124 -0
  38. package/coverage/toga-blox-npm/src/components/Description/index.html +131 -0
  39. package/coverage/toga-blox-npm/src/components/DropDownIconButton/DropDownIconButton.stories.tsx.html +676 -0
  40. package/coverage/toga-blox-npm/src/components/DropDownIconButton/DropDownIconButton.tsx.html +346 -0
  41. package/coverage/toga-blox-npm/src/components/DropDownIconButton/index.html +131 -0
  42. package/coverage/toga-blox-npm/src/components/Footer/ContactInfoItem.tsx.html +139 -0
  43. package/coverage/toga-blox-npm/src/components/Footer/Footer.stories.tsx.html +934 -0
  44. package/coverage/toga-blox-npm/src/components/Footer/Footer.tsx.html +373 -0
  45. package/coverage/toga-blox-npm/src/components/Footer/index.html +146 -0
  46. package/coverage/toga-blox-npm/src/components/FormButton/FormButton.stories.tsx.html +952 -0
  47. package/coverage/toga-blox-npm/src/components/FormButton/FormButton.tsx.html +343 -0
  48. package/coverage/toga-blox-npm/src/components/FormButton/index.html +131 -0
  49. package/coverage/toga-blox-npm/src/components/GenericList/GenericList.stories.tsx.html +376 -0
  50. package/coverage/toga-blox-npm/src/components/GenericList/GenericList.tsx.html +520 -0
  51. package/coverage/toga-blox-npm/src/components/GenericList/index.html +131 -0
  52. package/coverage/toga-blox-npm/src/components/GenericList/templates/DummyDataList.tsx.html +154 -0
  53. package/coverage/toga-blox-npm/src/components/GenericList/templates/DynamicIconList.tsx.html +250 -0
  54. package/coverage/toga-blox-npm/src/components/GenericList/templates/index.html +131 -0
  55. package/coverage/toga-blox-npm/src/components/GetSupport/GetSupport.stories.tsx.html +325 -0
  56. package/coverage/toga-blox-npm/src/components/GetSupport/GetSupport.tsx.html +262 -0
  57. package/coverage/toga-blox-npm/src/components/GetSupport/index.html +131 -0
  58. package/coverage/toga-blox-npm/src/components/HamburgerButton/Hamburger.stories.tsx.html +760 -0
  59. package/coverage/toga-blox-npm/src/components/HamburgerButton/HamburgerButton.tsx.html +232 -0
  60. package/coverage/toga-blox-npm/src/components/HamburgerButton/index.html +131 -0
  61. package/coverage/toga-blox-npm/src/components/Header/Header.stories.tsx.html +1633 -0
  62. package/coverage/toga-blox-npm/src/components/Header/Header.tsx.html +814 -0
  63. package/coverage/toga-blox-npm/src/components/Header/headerContext.tsx.html +460 -0
  64. package/coverage/toga-blox-npm/src/components/Header/index.html +146 -0
  65. package/coverage/toga-blox-npm/src/components/Hero/Hero.stories.tsx.html +289 -0
  66. package/coverage/toga-blox-npm/src/components/Hero/Hero.tsx.html +259 -0
  67. package/coverage/toga-blox-npm/src/components/Hero/index.html +131 -0
  68. package/coverage/toga-blox-npm/src/components/IconButton/IconButton.stories.tsx.html +673 -0
  69. package/coverage/toga-blox-npm/src/components/IconButton/IconButton.tsx.html +313 -0
  70. package/coverage/toga-blox-npm/src/components/IconButton/index.html +131 -0
  71. package/coverage/toga-blox-npm/src/components/Image/Image.stories.tsx.html +322 -0
  72. package/coverage/toga-blox-npm/src/components/Image/Image.tsx.html +226 -0
  73. package/coverage/toga-blox-npm/src/components/Image/index.html +131 -0
  74. package/coverage/toga-blox-npm/src/components/Input/Input.stories.tsx.html +1621 -0
  75. package/coverage/toga-blox-npm/src/components/Input/Input.tsx.html +568 -0
  76. package/coverage/toga-blox-npm/src/components/Input/InputMemoTypes.tsx.html +181 -0
  77. package/coverage/toga-blox-npm/src/components/Input/index.html +146 -0
  78. package/coverage/toga-blox-npm/src/components/MobileMenu/MobileMenu.tsx.html +208 -0
  79. package/coverage/toga-blox-npm/src/components/MobileMenu/index.html +116 -0
  80. package/coverage/toga-blox-npm/src/components/Nav/Nav.stories.tsx.html +628 -0
  81. package/coverage/toga-blox-npm/src/components/Nav/Nav.tsx.html +622 -0
  82. package/coverage/toga-blox-npm/src/components/Nav/index.html +131 -0
  83. package/coverage/toga-blox-npm/src/components/Page/TableDataDummy.tsx.html +733 -0
  84. package/coverage/toga-blox-npm/src/components/Page/ViewPageTemplate.stories.tsx.html +1714 -0
  85. package/coverage/toga-blox-npm/src/components/Page/ViewPageTemplate.tsx.html +115 -0
  86. package/coverage/toga-blox-npm/src/components/Page/index.html +146 -0
  87. package/coverage/toga-blox-npm/src/components/PageSection/PageSection.stories.tsx.html +433 -0
  88. package/coverage/toga-blox-npm/src/components/PageSection/PageSection.tsx.html +121 -0
  89. package/coverage/toga-blox-npm/src/components/PageSection/index.html +131 -0
  90. package/coverage/toga-blox-npm/src/components/SearchInput/SearchInput.stories.tsx.html +517 -0
  91. package/coverage/toga-blox-npm/src/components/SearchInput/SearchInput.tsx.html +325 -0
  92. package/coverage/toga-blox-npm/src/components/SearchInput/index.html +131 -0
  93. package/coverage/toga-blox-npm/src/components/Slider/Slider.stories.tsx.html +349 -0
  94. package/coverage/toga-blox-npm/src/components/Slider/Slider.tsx.html +502 -0
  95. package/coverage/toga-blox-npm/src/components/Slider/index.html +131 -0
  96. package/coverage/toga-blox-npm/src/components/Submenus/AdminSubmenu.tsx.html +136 -0
  97. package/coverage/toga-blox-npm/src/components/Submenus/AlertSubmenu.tsx.html +253 -0
  98. package/coverage/toga-blox-npm/src/components/Submenus/AlertSubmenuItem.tsx.html +202 -0
  99. package/coverage/toga-blox-npm/src/components/Submenus/index.html +146 -0
  100. package/coverage/toga-blox-npm/src/components/Text/Text.stories.tsx.html +235 -0
  101. package/coverage/toga-blox-npm/src/components/Text/Text.tsx.html +172 -0
  102. package/coverage/toga-blox-npm/src/components/Text/index.html +131 -0
  103. package/coverage/toga-blox-npm/src/components/Toaster/Toaster.stories.tsx.html +445 -0
  104. package/coverage/toga-blox-npm/src/components/Toaster/Toaster.tsx.html +301 -0
  105. package/coverage/toga-blox-npm/src/components/Toaster/index.html +131 -0
  106. package/coverage/toga-blox-npm/src/hoc/styling/index.html +116 -0
  107. package/coverage/toga-blox-npm/src/hoc/styling/withStoryBook.tsx.html +142 -0
  108. package/coverage/toga-blox-npm/src/userHoc/index.html +116 -0
  109. package/coverage/toga-blox-npm/src/userHoc/withMemo.tsx.html +145 -0
  110. package/coverage/toga-blox-npm/src/utils/assertTagName.tsx.html +106 -0
  111. package/coverage/toga-blox-npm/src/utils/generateAccordionItem.tsx.html +373 -0
  112. package/coverage/toga-blox-npm/src/utils/generateFooterContacts.tsx.html +295 -0
  113. package/coverage/toga-blox-npm/src/utils/generateNavMenu.tsx.html +247 -0
  114. package/coverage/toga-blox-npm/src/utils/generateSocialList.tsx.html +187 -0
  115. package/coverage/toga-blox-npm/src/utils/getFontAwesomeIcon.tsx.html +145 -0
  116. package/coverage/toga-blox-npm/src/utils/index.html +206 -0
  117. package/coverage/toga-blox-npm/src/utils/inputValidation.tsx.html +163 -0
  118. package/coverage/toga-blox-npm/tailwind.config.js.html +205 -0
  119. package/declarations.d.ts +1 -1
  120. package/package.json +5 -6
  121. package/src/components/Badge/Badge.stories.tsx +110 -207
  122. package/src/components/Badge/Badge.test.tsx +40 -41
  123. package/src/components/Badge/Badge.tsx +29 -99
  124. package/src/components/Badge/Badge.types.tsx +12 -23
  125. package/src/components/Card/Card.stories.tsx +166 -22
  126. package/src/components/Card/Card.test.tsx +3 -3
  127. package/src/components/Card/Card.tsx +12 -16
  128. package/src/components/Card/DUMMYPRODUCTDATA.json +381 -225
  129. package/src/components/Card/templates/CategoryCardTemplate.tsx +86 -0
  130. package/src/components/Card/templates/CompassCardTemplate.tsx +1 -1
  131. package/src/components/Card/templates/CounterContentCardTemplate.tsx +200 -0
  132. package/src/components/Card/templates/ItemCardTemplate.tsx +155 -0
  133. package/src/components/Card/templates/KitContentCardTemplate.tsx +128 -0
  134. package/src/components/Card/templates/ShippingAddressCardTemplate.tsx +111 -0
  135. package/src/components/Card/templates/VerticalCardTemplate.tsx +100 -85
  136. package/src/components/CounterButton/CounterButton.tsx +1 -1
  137. package/src/components/Description/Description.stories.tsx +67 -0
  138. package/src/components/Description/Description.tsx +13 -0
  139. package/src/components/Description/Description.types.ts +9 -0
  140. package/src/components/DropDownIconButton/DropDownIconButton.stories.tsx +197 -0
  141. package/src/components/DropDownIconButton/DropDownIconButton.test.tsx +90 -0
  142. package/src/components/DropDownIconButton/DropDownIconButton.tsx +87 -0
  143. package/src/components/DropDownIconButton/DropDownIconButton.types.ts +21 -0
  144. package/src/components/DropDownIconButton/index.ts +2 -0
  145. package/src/components/Footer/ContactInfoItem.tsx +8 -10
  146. package/src/components/Footer/Footer.stories.tsx +13 -22
  147. package/src/components/Footer/Footer.tsx +25 -88
  148. package/src/components/Footer/Footer.types.tsx +2 -2
  149. package/src/components/FormButton/FormButton.stories.tsx +101 -226
  150. package/src/components/FormButton/FormButton.test.tsx +1 -1
  151. package/src/components/FormButton/FormButton.tsx +34 -42
  152. package/src/components/FormButton/FormButton.types.ts +7 -13
  153. package/src/components/GenericList/GenericList.stories.tsx +5 -12
  154. package/src/components/GenericList/GenericList.tsx +91 -92
  155. package/src/components/GenericList/templates/DynamicIconList.tsx +45 -64
  156. package/src/components/GetSupport/GetSupport.stories.tsx +80 -0
  157. package/src/components/GetSupport/GetSupport.test.tsx +62 -0
  158. package/src/components/GetSupport/GetSupport.tsx +59 -0
  159. package/src/components/GetSupport/GetSupport.types.ts +11 -0
  160. package/src/components/HamburgerButton/Hamburger.stories.tsx +225 -0
  161. package/src/components/HamburgerButton/HamburgerButton.tsx +37 -56
  162. package/src/components/HamburgerButton/HamburgerButton.types.tsx +2 -1
  163. package/src/components/Header/Header.stories.tsx +3 -5
  164. package/src/components/Header/Header.tsx +37 -83
  165. package/src/components/Hero/Hero.stories.tsx +1 -2
  166. package/src/components/IconButton/IconButton.stories.tsx +196 -0
  167. package/src/components/{Icon/Icon.test.tsx → IconButton/IconButton.test.tsx} +3 -4
  168. package/src/components/IconButton/IconButton.tsx +76 -0
  169. package/src/components/IconButton/IconButton.types.ts +28 -0
  170. package/src/components/IconButton/index.ts +2 -0
  171. package/src/components/Image/Image.tsx +1 -1
  172. package/src/components/Input/Input.stories.tsx +10 -12
  173. package/src/components/Input/Input.test.tsx +2 -3
  174. package/src/components/Input/Input.tsx +41 -104
  175. package/src/components/MobileMenu/MobileMenu.types.tsx +0 -2
  176. package/src/components/Nav/DUMMYNAVDATA.json +4 -4
  177. package/src/components/Nav/Nav.tsx +49 -112
  178. package/src/components/Nav/Nav.types.tsx +14 -2
  179. package/src/components/Page/ViewPageTemplate.stories.tsx +2 -2
  180. package/src/components/Page/ViewPageTemplate.test.tsx +1 -1
  181. package/src/components/Page/ViewPageTemplate.types.ts +1 -1
  182. package/src/components/PageSection/PageSection.stories.tsx +3 -1
  183. package/src/components/PageSection/PageSections.test.tsx +2 -1
  184. package/src/components/SearchInput/SearchInput.stories.tsx +144 -0
  185. package/src/components/SearchInput/SearchInput.tsx +81 -0
  186. package/src/components/SearchInput/SearchInput.types.ts +28 -0
  187. package/src/components/Slider/Slider.stories.tsx +88 -0
  188. package/src/components/Slider/Slider.tsx +139 -0
  189. package/src/components/Slider/Slider.types.ts +21 -0
  190. package/src/components/Submenus/AdminSubmenu.tsx +17 -0
  191. package/src/components/Submenus/AlertSubmenu.tsx +56 -0
  192. package/src/components/Submenus/AlertSubmenuItem.tsx +39 -0
  193. package/src/components/Submenus/types.tsx +32 -0
  194. package/src/components/Toaster/Toaster.stories.tsx +4 -6
  195. package/src/components/Toaster/Toaster.test.tsx +3 -4
  196. package/src/components/Toaster/Toaster.tsx +9 -17
  197. package/src/components/Toaster/Toaster.types.ts +2 -2
  198. package/src/utils/assertTagName.tsx +1 -1
  199. package/src/utils/generateAccordionItem.tsx +7 -13
  200. package/src/utils/generateFooterContacts.tsx +4 -9
  201. package/src/utils/getFontAwesomeIcon.tsx +8 -13
  202. package/tailwind.config.js +11 -3
  203. package/src/components/Badge/badgeClassNames.tsx +0 -173
  204. package/src/components/Card/cardClassNames.ts +0 -49
  205. package/src/components/Footer/footerClassNames.tsx +0 -57
  206. package/src/components/FormButton/formButtonClassNames.tsx +0 -153
  207. package/src/components/GenericList/genericListClassNames.tsx +0 -8
  208. package/src/components/Header/headerClassNames.tsx +0 -50
  209. package/src/components/Icon/Icon.stories.tsx +0 -227
  210. package/src/components/Icon/Icon.tsx +0 -208
  211. package/src/components/Icon/Icon.types.ts +0 -24
  212. package/src/components/Icon/iconClassNames.ts +0 -79
  213. package/src/components/Icon/index.ts +0 -2
  214. package/src/components/Input/inputClassNames.tsx +0 -169
  215. package/src/components/Nav/navClassNames.tsx +0 -192
@@ -1,169 +0,0 @@
1
- import classNames from "classNames";
2
-
3
- // edits the input container border color & focus outline color
4
- export const getInputBorderClassNames = (borderColor: string | undefined) =>
5
- classNames({
6
- "border-teal-500 focus-within:outline-teal-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-1":
7
- borderColor === "green",
8
- "border-blue-500 focus-within:outline-blue-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-1":
9
- borderColor === "blue",
10
- "border-slate-400 focus-within:outline-slate-400 focus-within:outline focus-within:outline-2 focus-within:outline-offset-1":
11
- borderColor === "grey",
12
- "border-black focus-within:outline-black focus-within:outline focus-within:outline-2 focus-within:outline-offset-1":
13
- borderColor === "black",
14
- "border-transparent focus-within:outline-transparent focus-within:outline focus-within:outline-2 focus-within:outline-offset-1":
15
- borderColor === "none",
16
- [`border-${borderColor} focus-within:outline-${borderColor} focus-within:outline focus-within:outline-2 focus-within:outline-offset-1`]:
17
- borderColor !== undefined,
18
- });
19
-
20
- export const getSuccessColorClasses = (successBorder: string | undefined) =>
21
- classNames({
22
- "focus-within:outline-green-500 border-green-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-1":
23
- successBorder === "green",
24
- "focus-within:outline-blue-500 border-blue-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-1":
25
- successBorder === "blue",
26
- "focus-within:outline-grey-500 border-grey-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-1":
27
- successBorder === "grey",
28
- "focus-within:outline-black border-black focus-within:outline focus-within:outline-2 focus-within:outline-offset-1":
29
- successBorder === "black",
30
- [`focus-within:outline-${successBorder} border-${successBorder} focus-within:outline focus-within:outline-2 focus-within:outline-offset-1`]:
31
- successBorder !== undefined,
32
- });
33
-
34
- export const getErrorColorClasses = (errorBorder: string | undefined) =>
35
- classNames({
36
- "focus-within:outline-red-500 border-red-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-1":
37
- errorBorder === "red",
38
- "focus-within:outline-orange-500 border-orange-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-1":
39
- errorBorder === "orange",
40
- "focus-within:outline-black border-black focus-within:outline focus-within:outline-2 focus-within:outline-offset-1":
41
- errorBorder === "black",
42
- [`focus-within:outline-${errorBorder} border-${errorBorder} focus-within:outline focus-within:outline-2 focus-within:outline-offset-1`]:
43
- errorBorder !== undefined,
44
- });
45
-
46
- export const getInputPaddingClassNames = (
47
- hasButton: boolean | undefined,
48
- hasLeftIcon: boolean | undefined,
49
- hasRightIcon: boolean | undefined
50
- ) =>
51
- classNames({
52
- // NO ICONS OR BUTTON
53
- "py-2 px-3":
54
- hasButton === false &&
55
- hasLeftIcon === false &&
56
- hasRightIcon === false,
57
-
58
- // LEFT ICON AND BUTTON
59
- "py-3 pl-14":
60
- hasButton === true &&
61
- hasLeftIcon === true &&
62
- hasRightIcon === false,
63
-
64
- // BUTTON ONLY
65
- "py-3 px-3":
66
- hasButton === true &&
67
- hasLeftIcon === false &&
68
- hasRightIcon === false,
69
-
70
- // LEFT ICON ONLY
71
- "pl-12 py-2":
72
- hasLeftIcon === true &&
73
- hasRightIcon === false &&
74
- hasButton === false,
75
-
76
- // RIGHT ICON ONLY
77
- "pr-10 py-2 pl-3":
78
- hasRightIcon === true &&
79
- hasLeftIcon === false &&
80
- hasButton === false,
81
-
82
- // DUAL ICONS ONLY
83
- "py-2 pl-12":
84
- hasRightIcon === true &&
85
- hasLeftIcon === true &&
86
- hasButton === false,
87
- });
88
-
89
- // edits the background color of the input element
90
- export const getInputBackgroundClassNames = (
91
- backgroundColor: string | undefined
92
- ) =>
93
- classNames({
94
- "bg-white": backgroundColor === "white",
95
- "bg-blue-100": backgroundColor === "blue",
96
- "bg-slate-100": backgroundColor === "grey",
97
- "bg-transparent": backgroundColor === "none",
98
- [`bg-${backgroundColor}`]: backgroundColor !== undefined,
99
- });
100
-
101
- // edits text styles of the input element
102
- export const getInputTextClasses = (inputTextSize: string | undefined) => {
103
- return classNames({
104
- "text-sm": inputTextSize === "small",
105
- "text-md": inputTextSize === "medium",
106
- "text-lg": inputTextSize === "large",
107
- [`text-${inputTextSize}`]: inputTextSize !== undefined,
108
- });
109
- };
110
-
111
- // manages the border radius of the input
112
- export const getInputShape = (inputShape: string | undefined) =>
113
- classNames({
114
- "rounded-none": inputShape === "cornered",
115
- "rounded-md": inputShape === "semiRounded",
116
- "rounded-full": inputShape === "rounded",
117
- });
118
-
119
- // manages the border radius of the input when the input has a button with it
120
- export const inputButtonWithClasses = (inputShape: string | undefined) =>
121
- classNames({
122
- "rounded-tl-none rounded-bl-none": true,
123
- "rounded-tr-none rounded-br-none": inputShape === "cornered",
124
- "rounded-tr-md rounded-br-md": inputShape === "semiRounded",
125
- "rounded-tr-full rounded-br-full": inputShape === "rounded",
126
- });
127
-
128
- // manages the placement of the label
129
- export const getLabelPlacement = (labelPlacement: string | undefined) =>
130
- classNames({
131
- "flex items-center pr-3": labelPlacement === "left",
132
- "": labelPlacement === "top",
133
- });
134
-
135
- // toggles whether label is visible or not
136
- export const getLabelVisibility = (labelVisible: boolean | undefined) =>
137
- classNames({
138
- "sr-only": labelVisible === false,
139
- "": labelVisible === true,
140
- });
141
-
142
- export const getIconClasses = (
143
- iconColor: string | undefined,
144
- iconBackgroundColor: string | undefined,
145
- inputShape: string | undefined
146
- ) => {
147
- return classNames(
148
- {
149
- "text-blue-500": iconColor === "blue",
150
- "text-teal-500": iconColor === "green",
151
- "text-black": iconColor === "black",
152
- "text-white": iconColor === "white",
153
- [`text-${iconColor}`]: iconColor !== undefined,
154
- },
155
- {
156
- "bg-blue-200": iconBackgroundColor === "blue",
157
- "bg-slate-200": iconBackgroundColor === "grey",
158
- "bg-teal-100": iconBackgroundColor === "green",
159
- "bg-black": iconBackgroundColor === "black",
160
- "bg-transparent": iconBackgroundColor === "none",
161
- [`bg-${iconBackgroundColor}`]: iconBackgroundColor !== undefined,
162
- },
163
- {
164
- "rounded-none": inputShape === "cornered",
165
- "rounded-md": inputShape === "semiRounded",
166
- "rounded-full": inputShape === "rounded",
167
- }
168
- );
169
- };
@@ -1,192 +0,0 @@
1
- import classNames from "classNames";
2
-
3
- export const getNavBackgroundColor = (navBackgroundColor: string | undefined) => {
4
- return classNames(
5
- {
6
- "bg-blue-500": navBackgroundColor === "blue",
7
- "bg-teal-800": navBackgroundColor === "green",
8
- ":bg-gray-500": navBackgroundColor === "grey",
9
- ":bg-transparent": navBackgroundColor === "none",
10
- })
11
- };
12
-
13
- export const getParentHoverClassNames = (
14
- parentHoverBackground: string | undefined,
15
- parentHoverBorderColor: string | undefined,
16
- ) => {
17
- return classNames(
18
- {
19
- "hover:bg-blue-800": parentHoverBackground === "blue",
20
- "hover:bg-teal-800": parentHoverBackground === "green",
21
- "hover:bg-gray-800": parentHoverBackground === "grey",
22
- "hover:bg-white": parentHoverBackground === "white",
23
- "hover:bg-transparent text-black": parentHoverBackground === "none",
24
- },
25
- {
26
- "hover:border-blue-300": parentHoverBorderColor === "blue",
27
- "hover:border-teal-300": parentHoverBorderColor === "green",
28
- "hover:border-gray-300": parentHoverBorderColor === "grey",
29
- "hover:border-black": parentHoverBorderColor === "black",
30
- "hover:border-transparent": parentHoverBorderColor === "none",
31
- },
32
-
33
- );
34
- };
35
-
36
-
37
- export const getParentHoverTextClassNames = (
38
- parentHoverFontColor: string | undefined,
39
- parentHoverUnderline: boolean | undefined
40
- ) => {
41
- return classNames(
42
- {
43
- "hover:text-blue-800": parentHoverFontColor === "blue",
44
- "hover:text-teal-800": parentHoverFontColor === "green",
45
- "hover:text-slate-100": parentHoverFontColor === "white",
46
- "hover:text-slate-950": parentHoverFontColor === "black",
47
- },
48
- {
49
- "hover:underline hover:underline-offset-4":
50
- parentHoverUnderline === true,
51
- "": parentHoverUnderline === false,
52
- }
53
- );
54
- };
55
-
56
- export const getParentStyleClasses = (
57
- parentBackground: string | undefined,
58
- parentBorderColor: string | undefined,
59
- parentShape: string | undefined,
60
- ) => {
61
- return classNames(
62
- {
63
- "bg-blue-800": parentBackground === "blue",
64
- "bg-teal-800": parentBackground === "green",
65
- "bg-gray-800": parentBackground === "grey",
66
- "bg-black": parentBackground === "black",
67
- "bg-white": parentBackground === "white",
68
- "bg-transparent": parentBackground === "none",
69
- },
70
- {
71
- "border-blue-300": parentBorderColor === "blue",
72
- "border-teal-300": parentBorderColor === "green",
73
- "border-gray-300": parentBorderColor === "grey",
74
- "border-black": parentBorderColor === "black",
75
- "border-transparent": parentBorderColor === "none",
76
- },
77
- {
78
- "rounded-none": parentShape === "cornered",
79
- "rounded-md": parentShape === "semiRounded",
80
- "rounded-full": parentShape === "rounded",
81
- }
82
- );
83
- };
84
-
85
-
86
- export const getParentTextSizeClasses = (parentTextSize: string | undefined) => {
87
- return classNames({
88
- "text-xs": parentTextSize === "xs",
89
- "text-sm": parentTextSize === "sm",
90
- "text-md": parentTextSize === "md",
91
- "text-lg": parentTextSize === "lg",
92
- });
93
- }
94
-
95
- export const getParentTextColorClasses = (parentTextColor: string | undefined) => {
96
- return classNames({
97
- "text-slate-100": parentTextColor === "white",
98
- "text-slate-950": parentTextColor === "black",
99
- });
100
- }
101
-
102
- export const getSubmenuTextSizeClasses = (
103
- parentTextSize: string | undefined
104
- ) => {
105
- return classNames({
106
- "text-xs": parentTextSize === "xs",
107
- "text-sm": parentTextSize === "sm",
108
- "text-md": parentTextSize === "md",
109
- "text-lg": parentTextSize === "lg",
110
- });
111
- };
112
-
113
- export const getSubmenuTextColorClasses = (submenuTextColor: string | undefined) => {
114
- return classNames({
115
- "text-slate-100": submenuTextColor === "white",
116
- "text-slate-950": submenuTextColor === "black",
117
- });
118
- };
119
-
120
- export const getSubmenuClasses = (
121
- submenuBackgroundColor: string | undefined
122
- ) => {
123
- return classNames(
124
- {
125
- "bg-blue-100": submenuBackgroundColor === "blue",
126
- "bg-teal-100": submenuBackgroundColor === "green",
127
- "bg-gray-100": submenuBackgroundColor === "grey",
128
- "bg-white": submenuBackgroundColor === "white",
129
- "bg-transparent": submenuBackgroundColor === "none",
130
- },
131
- );
132
- };
133
-
134
- export const getSubmenuHoverClasses = (
135
- submenuHoverBackground: string | undefined,
136
- submenuHoverTextColor: string | undefined,
137
- submenuHoverBorderStyle: string | undefined,
138
- submenuHoverBorderColor: string | undefined
139
-
140
- ) => {
141
-
142
- return classNames(
143
- {
144
- "hover:bg-blue-50": submenuHoverBackground === "blue",
145
- "hover:bg-teal-50": submenuHoverBackground === "green",
146
- "hover:bg-gray-50": submenuHoverBackground === "grey",
147
- "hover:bg-white": submenuHoverBackground === "white",
148
- "hover:bg-transparent": submenuHoverBackground === "none",
149
- },
150
- {
151
- "hover:text-slate-100": submenuHoverTextColor === "white",
152
- "hover:text-slate-950": submenuHoverTextColor === "black",
153
- },
154
- {
155
- "hover:border-y-1 border-x-0": submenuHoverBorderStyle === "top-bottom",
156
- "hover:border-x-1 border-y-0": submenuHoverBorderStyle === "right-left",
157
- "hover:border-b-1 border-t-0 border-x-0":
158
- submenuHoverBorderStyle === "bottom",
159
- "hover:border-transparent": submenuHoverBorderStyle === "none",
160
- },
161
- {
162
- "hover:border-blue-600": submenuHoverBorderColor === "blue",
163
- "hover:border-teal-600 ": submenuHoverBorderColor === "green",
164
- "hover:border-black": submenuHoverBorderColor === "black",
165
- "hover:border-transparent ": submenuHoverBorderColor === "none",
166
- }
167
- );
168
- };
169
-
170
- export const getMobileHiddenBreakpoint = (mobileBreakpoint: string | undefined) => {
171
- return classNames({
172
- "max-sm:hidden": mobileBreakpoint === "small",
173
- "max-md:hidden": mobileBreakpoint === "medium",
174
- "max-lg:hidden": mobileBreakpoint === "large",
175
- "max-xl:hidden": mobileBreakpoint === "extraLarge",
176
- });
177
- };
178
-
179
- export const getMobileFlexBreakpoint = (
180
- mobileBreakpoint: string | undefined
181
- ) => {
182
- return classNames({
183
- "max-sm:flex max-sm:flex-col": mobileBreakpoint === "small",
184
- "max-md:flex max-md:flex-col": mobileBreakpoint === "medium",
185
- "max-lg:flex max-lg:flex-col": mobileBreakpoint === "large",
186
- "max-xl:flex max-xl:flex-col": mobileBreakpoint === "extraLarge",
187
- });
188
- };
189
-
190
-
191
-
192
-