@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.
- package/assets/cable.jpg +0 -0
- package/assets/card-1.jpg +0 -0
- package/assets/cat-logo.png +0 -0
- package/assets/item.jpg +0 -0
- package/assets/map.png +0 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +953 -0
- package/coverage/coverage-final.json +74 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +551 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/coverage/toga-blox-npm/index.html +131 -0
- package/coverage/toga-blox-npm/postcss.config.js.html +103 -0
- package/coverage/toga-blox-npm/src/components/Badge/Badge.stories.tsx.html +793 -0
- package/coverage/toga-blox-npm/src/components/Badge/Badge.tsx.html +247 -0
- package/coverage/toga-blox-npm/src/components/Badge/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/Card/Card.stories.tsx.html +787 -0
- package/coverage/toga-blox-npm/src/components/Card/Card.tsx.html +163 -0
- package/coverage/toga-blox-npm/src/components/Card/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/Card/templates/CategoryCardTemplate.tsx.html +343 -0
- package/coverage/toga-blox-npm/src/components/Card/templates/CompassCardTemplate.tsx.html +259 -0
- package/coverage/toga-blox-npm/src/components/Card/templates/CounterContentCardTemplate.tsx.html +685 -0
- package/coverage/toga-blox-npm/src/components/Card/templates/HorizontalCardTemplate.tsx.html +637 -0
- package/coverage/toga-blox-npm/src/components/Card/templates/ItemCardTemplate.tsx.html +550 -0
- package/coverage/toga-blox-npm/src/components/Card/templates/KitContentCardTemplate.tsx.html +469 -0
- package/coverage/toga-blox-npm/src/components/Card/templates/ShippingAddressCardTemplate.tsx.html +418 -0
- package/coverage/toga-blox-npm/src/components/Card/templates/VerticalCardTemplate.tsx.html +592 -0
- package/coverage/toga-blox-npm/src/components/Card/templates/index.html +221 -0
- package/coverage/toga-blox-npm/src/components/CounterButton/CounterButton.stories.tsx.html +358 -0
- package/coverage/toga-blox-npm/src/components/CounterButton/CounterButton.tsx.html +385 -0
- package/coverage/toga-blox-npm/src/components/CounterButton/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/Description/Description.stories.tsx.html +286 -0
- package/coverage/toga-blox-npm/src/components/Description/Description.tsx.html +124 -0
- package/coverage/toga-blox-npm/src/components/Description/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/DropDownIconButton/DropDownIconButton.stories.tsx.html +676 -0
- package/coverage/toga-blox-npm/src/components/DropDownIconButton/DropDownIconButton.tsx.html +346 -0
- package/coverage/toga-blox-npm/src/components/DropDownIconButton/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/Footer/ContactInfoItem.tsx.html +139 -0
- package/coverage/toga-blox-npm/src/components/Footer/Footer.stories.tsx.html +934 -0
- package/coverage/toga-blox-npm/src/components/Footer/Footer.tsx.html +373 -0
- package/coverage/toga-blox-npm/src/components/Footer/index.html +146 -0
- package/coverage/toga-blox-npm/src/components/FormButton/FormButton.stories.tsx.html +952 -0
- package/coverage/toga-blox-npm/src/components/FormButton/FormButton.tsx.html +343 -0
- package/coverage/toga-blox-npm/src/components/FormButton/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/GenericList/GenericList.stories.tsx.html +376 -0
- package/coverage/toga-blox-npm/src/components/GenericList/GenericList.tsx.html +520 -0
- package/coverage/toga-blox-npm/src/components/GenericList/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/GenericList/templates/DummyDataList.tsx.html +154 -0
- package/coverage/toga-blox-npm/src/components/GenericList/templates/DynamicIconList.tsx.html +250 -0
- package/coverage/toga-blox-npm/src/components/GenericList/templates/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/GetSupport/GetSupport.stories.tsx.html +325 -0
- package/coverage/toga-blox-npm/src/components/GetSupport/GetSupport.tsx.html +262 -0
- package/coverage/toga-blox-npm/src/components/GetSupport/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/HamburgerButton/Hamburger.stories.tsx.html +760 -0
- package/coverage/toga-blox-npm/src/components/HamburgerButton/HamburgerButton.tsx.html +232 -0
- package/coverage/toga-blox-npm/src/components/HamburgerButton/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/Header/Header.stories.tsx.html +1633 -0
- package/coverage/toga-blox-npm/src/components/Header/Header.tsx.html +814 -0
- package/coverage/toga-blox-npm/src/components/Header/headerContext.tsx.html +460 -0
- package/coverage/toga-blox-npm/src/components/Header/index.html +146 -0
- package/coverage/toga-blox-npm/src/components/Hero/Hero.stories.tsx.html +289 -0
- package/coverage/toga-blox-npm/src/components/Hero/Hero.tsx.html +259 -0
- package/coverage/toga-blox-npm/src/components/Hero/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/IconButton/IconButton.stories.tsx.html +673 -0
- package/coverage/toga-blox-npm/src/components/IconButton/IconButton.tsx.html +313 -0
- package/coverage/toga-blox-npm/src/components/IconButton/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/Image/Image.stories.tsx.html +322 -0
- package/coverage/toga-blox-npm/src/components/Image/Image.tsx.html +226 -0
- package/coverage/toga-blox-npm/src/components/Image/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/Input/Input.stories.tsx.html +1621 -0
- package/coverage/toga-blox-npm/src/components/Input/Input.tsx.html +568 -0
- package/coverage/toga-blox-npm/src/components/Input/InputMemoTypes.tsx.html +181 -0
- package/coverage/toga-blox-npm/src/components/Input/index.html +146 -0
- package/coverage/toga-blox-npm/src/components/MobileMenu/MobileMenu.tsx.html +208 -0
- package/coverage/toga-blox-npm/src/components/MobileMenu/index.html +116 -0
- package/coverage/toga-blox-npm/src/components/Nav/Nav.stories.tsx.html +628 -0
- package/coverage/toga-blox-npm/src/components/Nav/Nav.tsx.html +622 -0
- package/coverage/toga-blox-npm/src/components/Nav/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/Page/TableDataDummy.tsx.html +733 -0
- package/coverage/toga-blox-npm/src/components/Page/ViewPageTemplate.stories.tsx.html +1714 -0
- package/coverage/toga-blox-npm/src/components/Page/ViewPageTemplate.tsx.html +115 -0
- package/coverage/toga-blox-npm/src/components/Page/index.html +146 -0
- package/coverage/toga-blox-npm/src/components/PageSection/PageSection.stories.tsx.html +433 -0
- package/coverage/toga-blox-npm/src/components/PageSection/PageSection.tsx.html +121 -0
- package/coverage/toga-blox-npm/src/components/PageSection/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/SearchInput/SearchInput.stories.tsx.html +517 -0
- package/coverage/toga-blox-npm/src/components/SearchInput/SearchInput.tsx.html +325 -0
- package/coverage/toga-blox-npm/src/components/SearchInput/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/Slider/Slider.stories.tsx.html +349 -0
- package/coverage/toga-blox-npm/src/components/Slider/Slider.tsx.html +502 -0
- package/coverage/toga-blox-npm/src/components/Slider/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/Submenus/AdminSubmenu.tsx.html +136 -0
- package/coverage/toga-blox-npm/src/components/Submenus/AlertSubmenu.tsx.html +253 -0
- package/coverage/toga-blox-npm/src/components/Submenus/AlertSubmenuItem.tsx.html +202 -0
- package/coverage/toga-blox-npm/src/components/Submenus/index.html +146 -0
- package/coverage/toga-blox-npm/src/components/Text/Text.stories.tsx.html +235 -0
- package/coverage/toga-blox-npm/src/components/Text/Text.tsx.html +172 -0
- package/coverage/toga-blox-npm/src/components/Text/index.html +131 -0
- package/coverage/toga-blox-npm/src/components/Toaster/Toaster.stories.tsx.html +445 -0
- package/coverage/toga-blox-npm/src/components/Toaster/Toaster.tsx.html +301 -0
- package/coverage/toga-blox-npm/src/components/Toaster/index.html +131 -0
- package/coverage/toga-blox-npm/src/hoc/styling/index.html +116 -0
- package/coverage/toga-blox-npm/src/hoc/styling/withStoryBook.tsx.html +142 -0
- package/coverage/toga-blox-npm/src/userHoc/index.html +116 -0
- package/coverage/toga-blox-npm/src/userHoc/withMemo.tsx.html +145 -0
- package/coverage/toga-blox-npm/src/utils/assertTagName.tsx.html +106 -0
- package/coverage/toga-blox-npm/src/utils/generateAccordionItem.tsx.html +373 -0
- package/coverage/toga-blox-npm/src/utils/generateFooterContacts.tsx.html +295 -0
- package/coverage/toga-blox-npm/src/utils/generateNavMenu.tsx.html +247 -0
- package/coverage/toga-blox-npm/src/utils/generateSocialList.tsx.html +187 -0
- package/coverage/toga-blox-npm/src/utils/getFontAwesomeIcon.tsx.html +145 -0
- package/coverage/toga-blox-npm/src/utils/index.html +206 -0
- package/coverage/toga-blox-npm/src/utils/inputValidation.tsx.html +163 -0
- package/coverage/toga-blox-npm/tailwind.config.js.html +205 -0
- package/declarations.d.ts +1 -1
- package/package.json +5 -6
- package/src/components/Badge/Badge.stories.tsx +110 -207
- package/src/components/Badge/Badge.test.tsx +40 -41
- package/src/components/Badge/Badge.tsx +29 -99
- package/src/components/Badge/Badge.types.tsx +12 -23
- package/src/components/Card/Card.stories.tsx +166 -22
- package/src/components/Card/Card.test.tsx +3 -3
- package/src/components/Card/Card.tsx +12 -16
- package/src/components/Card/DUMMYPRODUCTDATA.json +381 -225
- package/src/components/Card/templates/CategoryCardTemplate.tsx +86 -0
- package/src/components/Card/templates/CompassCardTemplate.tsx +1 -1
- package/src/components/Card/templates/CounterContentCardTemplate.tsx +200 -0
- package/src/components/Card/templates/ItemCardTemplate.tsx +155 -0
- package/src/components/Card/templates/KitContentCardTemplate.tsx +128 -0
- package/src/components/Card/templates/ShippingAddressCardTemplate.tsx +111 -0
- package/src/components/Card/templates/VerticalCardTemplate.tsx +100 -85
- package/src/components/CounterButton/CounterButton.tsx +1 -1
- package/src/components/Description/Description.stories.tsx +67 -0
- package/src/components/Description/Description.tsx +13 -0
- package/src/components/Description/Description.types.ts +9 -0
- package/src/components/DropDownIconButton/DropDownIconButton.stories.tsx +197 -0
- package/src/components/DropDownIconButton/DropDownIconButton.test.tsx +90 -0
- package/src/components/DropDownIconButton/DropDownIconButton.tsx +87 -0
- package/src/components/DropDownIconButton/DropDownIconButton.types.ts +21 -0
- package/src/components/DropDownIconButton/index.ts +2 -0
- package/src/components/Footer/ContactInfoItem.tsx +8 -10
- package/src/components/Footer/Footer.stories.tsx +13 -22
- package/src/components/Footer/Footer.tsx +25 -88
- package/src/components/Footer/Footer.types.tsx +2 -2
- package/src/components/FormButton/FormButton.stories.tsx +101 -226
- package/src/components/FormButton/FormButton.test.tsx +1 -1
- package/src/components/FormButton/FormButton.tsx +34 -42
- package/src/components/FormButton/FormButton.types.ts +7 -13
- package/src/components/GenericList/GenericList.stories.tsx +5 -12
- package/src/components/GenericList/GenericList.tsx +91 -92
- package/src/components/GenericList/templates/DynamicIconList.tsx +45 -64
- package/src/components/GetSupport/GetSupport.stories.tsx +80 -0
- package/src/components/GetSupport/GetSupport.test.tsx +62 -0
- package/src/components/GetSupport/GetSupport.tsx +59 -0
- package/src/components/GetSupport/GetSupport.types.ts +11 -0
- package/src/components/HamburgerButton/Hamburger.stories.tsx +225 -0
- package/src/components/HamburgerButton/HamburgerButton.tsx +37 -56
- package/src/components/HamburgerButton/HamburgerButton.types.tsx +2 -1
- package/src/components/Header/Header.stories.tsx +3 -5
- package/src/components/Header/Header.tsx +37 -83
- package/src/components/Hero/Hero.stories.tsx +1 -2
- package/src/components/IconButton/IconButton.stories.tsx +196 -0
- package/src/components/{Icon/Icon.test.tsx → IconButton/IconButton.test.tsx} +3 -4
- package/src/components/IconButton/IconButton.tsx +76 -0
- package/src/components/IconButton/IconButton.types.ts +28 -0
- package/src/components/IconButton/index.ts +2 -0
- package/src/components/Image/Image.tsx +1 -1
- package/src/components/Input/Input.stories.tsx +10 -12
- package/src/components/Input/Input.test.tsx +2 -3
- package/src/components/Input/Input.tsx +41 -104
- package/src/components/MobileMenu/MobileMenu.types.tsx +0 -2
- package/src/components/Nav/DUMMYNAVDATA.json +4 -4
- package/src/components/Nav/Nav.tsx +49 -112
- package/src/components/Nav/Nav.types.tsx +14 -2
- package/src/components/Page/ViewPageTemplate.stories.tsx +2 -2
- package/src/components/Page/ViewPageTemplate.test.tsx +1 -1
- package/src/components/Page/ViewPageTemplate.types.ts +1 -1
- package/src/components/PageSection/PageSection.stories.tsx +3 -1
- package/src/components/PageSection/PageSections.test.tsx +2 -1
- package/src/components/SearchInput/SearchInput.stories.tsx +144 -0
- package/src/components/SearchInput/SearchInput.tsx +81 -0
- package/src/components/SearchInput/SearchInput.types.ts +28 -0
- package/src/components/Slider/Slider.stories.tsx +88 -0
- package/src/components/Slider/Slider.tsx +139 -0
- package/src/components/Slider/Slider.types.ts +21 -0
- package/src/components/Submenus/AdminSubmenu.tsx +17 -0
- package/src/components/Submenus/AlertSubmenu.tsx +56 -0
- package/src/components/Submenus/AlertSubmenuItem.tsx +39 -0
- package/src/components/Submenus/types.tsx +32 -0
- package/src/components/Toaster/Toaster.stories.tsx +4 -6
- package/src/components/Toaster/Toaster.test.tsx +3 -4
- package/src/components/Toaster/Toaster.tsx +9 -17
- package/src/components/Toaster/Toaster.types.ts +2 -2
- package/src/utils/assertTagName.tsx +1 -1
- package/src/utils/generateAccordionItem.tsx +7 -13
- package/src/utils/generateFooterContacts.tsx +4 -9
- package/src/utils/getFontAwesomeIcon.tsx +8 -13
- package/tailwind.config.js +11 -3
- package/src/components/Badge/badgeClassNames.tsx +0 -173
- package/src/components/Card/cardClassNames.ts +0 -49
- package/src/components/Footer/footerClassNames.tsx +0 -57
- package/src/components/FormButton/formButtonClassNames.tsx +0 -153
- package/src/components/GenericList/genericListClassNames.tsx +0 -8
- package/src/components/Header/headerClassNames.tsx +0 -50
- package/src/components/Icon/Icon.stories.tsx +0 -227
- package/src/components/Icon/Icon.tsx +0 -208
- package/src/components/Icon/Icon.types.ts +0 -24
- package/src/components/Icon/iconClassNames.ts +0 -79
- package/src/components/Icon/index.ts +0 -2
- package/src/components/Input/inputClassNames.tsx +0 -169
- 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
|
-
|