@agilant/toga-blox 1.0.5
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/Dockerfile +9 -0
- package/README.md +69 -0
- package/assets/Logo.png +0 -0
- package/assets/compass-card-image-2.png +0 -0
- package/assets/compass-card-image-3.png +0 -0
- package/assets/compass-card-image-4.png +0 -0
- package/assets/compass-card-image.png +0 -0
- package/assets/compass-logo.png +0 -0
- package/assets/compass-tech-hero-bg.png +0 -0
- package/assets/contact-image.png +0 -0
- package/assets/green-laptop.png +0 -0
- package/assets/heroImage.png +0 -0
- package/assets/placeholder-no-image-available.png +0 -0
- package/assets/team.png +0 -0
- package/declarations.d.ts +4 -0
- package/docker-compose.yml +22 -0
- package/global.css +4 -0
- package/index.js +4 -0
- package/nodemon.json +5 -0
- package/package.json +70 -0
- package/postcss.config.js +6 -0
- package/src/components/Badge/Badge.stories.tsx +284 -0
- package/src/components/Badge/Badge.test.tsx +185 -0
- package/src/components/Badge/Badge.tsx +137 -0
- package/src/components/Badge/Badge.types.tsx +28 -0
- package/src/components/Badge/badgeClassNames.tsx +152 -0
- package/src/components/Badge/index.ts +2 -0
- package/src/components/Card/Card.stories.tsx +91 -0
- package/src/components/Card/Card.test.tsx +53 -0
- package/src/components/Card/Card.tsx +30 -0
- package/src/components/Card/Card.types.ts +11 -0
- package/src/components/Card/DUMMYPRODUCTDATA.json +670 -0
- package/src/components/Card/cardClassNames.ts +49 -0
- package/src/components/Card/index.ts +3 -0
- package/src/components/Card/templates/CompassCardTemplate.tsx +58 -0
- package/src/components/Card/templates/HorizontalCardTemplate.tsx +184 -0
- package/src/components/Card/templates/VerticalCardTemplate.tsx +154 -0
- package/src/components/Footer/ContactInfoItem.tsx +20 -0
- package/src/components/Footer/DUMMYFOOTERDATA.json +132 -0
- package/src/components/Footer/Footer.stories.tsx +292 -0
- package/src/components/Footer/Footer.test.tsx +90 -0
- package/src/components/Footer/Footer.tsx +159 -0
- package/src/components/Footer/Footer.types.tsx +61 -0
- package/src/components/Footer/footerClassNames.tsx +57 -0
- package/src/components/FormButton/FormButton.stories.tsx +199 -0
- package/src/components/FormButton/FormButton.test.tsx +73 -0
- package/src/components/FormButton/FormButton.tsx +116 -0
- package/src/components/FormButton/FormButton.types.ts +32 -0
- package/src/components/FormButton/formButtonClassNames.tsx +153 -0
- package/src/components/FormButton/index.ts +2 -0
- package/src/components/GenericList/DUMMYLISTDATA.json +560 -0
- package/src/components/GenericList/GenericList.stories.tsx +104 -0
- package/src/components/GenericList/GenericList.test.tsx +29 -0
- package/src/components/GenericList/GenericList.tsx +146 -0
- package/src/components/GenericList/genericListClassNames.tsx +8 -0
- package/src/components/GenericList/templates/DummyDataList.tsx +23 -0
- package/src/components/GenericList/templates/DynamicIconList.tsx +74 -0
- package/src/components/HamburgerButton/HamburgerButton.tsx +68 -0
- package/src/components/HamburgerButton/HamburgerButton.types.tsx +6 -0
- package/src/components/HamburgerButton/index.ts +2 -0
- package/src/components/Header/DUMMYICONDATA.json +136 -0
- package/src/components/Header/Header.stories.tsx +521 -0
- package/src/components/Header/Header.test.tsx +323 -0
- package/src/components/Header/Header.tsx +289 -0
- package/src/components/Header/Header.types.ts +52 -0
- package/src/components/Header/headerClassNames.tsx +50 -0
- package/src/components/Header/headerContext.tsx +125 -0
- package/src/components/Header/index.ts +2 -0
- package/src/components/Hero/Hero.stories.tsx +69 -0
- package/src/components/Hero/Hero.test.tsx +109 -0
- package/src/components/Hero/Hero.tsx +58 -0
- package/src/components/Hero/Hero.types.ts +9 -0
- package/src/components/Hero/index.ts +2 -0
- package/src/components/Icon/Icon.stories.tsx +227 -0
- package/src/components/Icon/Icon.test.tsx +53 -0
- package/src/components/Icon/Icon.tsx +208 -0
- package/src/components/Icon/Icon.types.ts +24 -0
- package/src/components/Icon/iconClassNames.ts +79 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/Image/Image.stories.tsx +79 -0
- package/src/components/Image/Image.test.tsx +87 -0
- package/src/components/Image/Image.tsx +49 -0
- package/src/components/Image/Image.types.ts +11 -0
- package/src/components/Image/index.ts +2 -0
- package/src/components/Input/Input.stories.tsx +651 -0
- package/src/components/Input/Input.test.tsx +90 -0
- package/src/components/Input/Input.tsx +226 -0
- package/src/components/Input/Input.types.ts +52 -0
- package/src/components/Input/InputMemoTypes.tsx +32 -0
- package/src/components/Input/index.ts +2 -0
- package/src/components/Input/inputClassNames.tsx +169 -0
- package/src/components/MobileMenu/MobileMenu.tsx +41 -0
- package/src/components/MobileMenu/MobileMenu.types.tsx +30 -0
- package/src/components/MobileMenu/index.ts +2 -0
- package/src/components/Nav/DUMMYNAVDATA.json +234 -0
- package/src/components/Nav/Nav.stories.tsx +181 -0
- package/src/components/Nav/Nav.test.tsx +89 -0
- package/src/components/Nav/Nav.tsx +242 -0
- package/src/components/Nav/Nav.types.tsx +35 -0
- package/src/components/Nav/index.ts +2 -0
- package/src/components/Nav/navClassNames.tsx +192 -0
- package/src/components/Page/TableDataDummy.tsx +216 -0
- package/src/components/Page/ViewPageTemplate.stories.tsx +546 -0
- package/src/components/Page/ViewPageTemplate.test.tsx +361 -0
- package/src/components/Page/ViewPageTemplate.tsx +10 -0
- package/src/components/Page/ViewPageTemplate.types.ts +6 -0
- package/src/components/Page/index.ts +2 -0
- package/src/components/PageSection/PageSection.stories.tsx +114 -0
- package/src/components/PageSection/PageSection.tsx +12 -0
- package/src/components/PageSection/PageSection.types.ts +6 -0
- package/src/components/PageSection/PageSections.test.tsx +88 -0
- package/src/components/PageSection/index.ts +2 -0
- package/src/components/Text/Text.stories.tsx +60 -0
- package/src/components/Text/Text.test.tsx +52 -0
- package/src/components/Text/Text.tsx +80 -0
- package/src/components/Text/Text.types.ts +12 -0
- package/src/components/Text/index.ts +2 -0
- package/src/components/Toaster/Toaster.stories.tsx +122 -0
- package/src/components/Toaster/Toaster.test.tsx +61 -0
- package/src/components/Toaster/Toaster.tsx +80 -0
- package/src/components/Toaster/Toaster.types.ts +12 -0
- package/src/components/Toaster/index.ts +2 -0
- package/src/hoc/index.ts +2 -0
- package/src/hoc/styling/withStoryBook.tsx +19 -0
- package/src/main.css +3 -0
- package/src/setupTests.ts +1 -0
- package/src/userHoc/index.ts +1 -0
- package/src/userHoc/withMemo.tsx +20 -0
- package/src/utils/assertTagName.tsx +7 -0
- package/src/utils/generateAccordionItem.tsx +102 -0
- package/src/utils/generateFooterContacts.tsx +75 -0
- package/src/utils/generateNavMenu.tsx +54 -0
- package/src/utils/generateSocialList.tsx +34 -0
- package/src/utils/getFontAwesomeIcon.tsx +25 -0
- package/src/utils/inputValidation.tsx +26 -0
- package/tailwind.config.js +32 -0
- package/tsconfig.json +25 -0
- package/vite.config.ts +33 -0
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
import { Input, InputTypes } from ".";
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
3
|
+
import Text from "../Text/Text";
|
|
4
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
5
|
+
import {
|
|
6
|
+
faMagnifyingGlass,
|
|
7
|
+
faCircleArrowRight,
|
|
8
|
+
faEnvelope,
|
|
9
|
+
} from "@fortawesome/free-solid-svg-icons";
|
|
10
|
+
import { minCharactersRegex } from "../../utils/inputValidation";
|
|
11
|
+
import { withMemo } from "../../userHoc";
|
|
12
|
+
import { arePropsEqual } from "./InputMemoTypes";
|
|
13
|
+
import FormButton from "../FormButton/FormButton";
|
|
14
|
+
import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
|
|
15
|
+
|
|
16
|
+
const MemoizedInput = withMemo(Input, arePropsEqual);
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
title: "Components/Input",
|
|
20
|
+
component: MemoizedInput,
|
|
21
|
+
argTypes: {
|
|
22
|
+
validateInput: {
|
|
23
|
+
table: {
|
|
24
|
+
disable: true,
|
|
25
|
+
},
|
|
26
|
+
description: "The function that validates the input.",
|
|
27
|
+
},
|
|
28
|
+
hasValidation: {
|
|
29
|
+
control: "none",
|
|
30
|
+
description: "Whether the input has validation styles turned on.",
|
|
31
|
+
},
|
|
32
|
+
errorMessage: {
|
|
33
|
+
table: {
|
|
34
|
+
disable: true,
|
|
35
|
+
},
|
|
36
|
+
description: "The error message if the input validation fails.",
|
|
37
|
+
},
|
|
38
|
+
regex: {
|
|
39
|
+
table: {
|
|
40
|
+
disable: true,
|
|
41
|
+
},
|
|
42
|
+
description: "The regex used to validate the input.",
|
|
43
|
+
},
|
|
44
|
+
inputType: {
|
|
45
|
+
table: {
|
|
46
|
+
disable: true,
|
|
47
|
+
},
|
|
48
|
+
description: "The type of input.",
|
|
49
|
+
},
|
|
50
|
+
inputWidth: {
|
|
51
|
+
control: "none",
|
|
52
|
+
description: "The width of the input.",
|
|
53
|
+
},
|
|
54
|
+
inputTextSize: {
|
|
55
|
+
control: "select",
|
|
56
|
+
options: ["small", "medium", "large"],
|
|
57
|
+
description: "The size of the text in the input.",
|
|
58
|
+
},
|
|
59
|
+
hasPlaceholder: {
|
|
60
|
+
control: "boolean",
|
|
61
|
+
description: "Whether the input has a placeholder.",
|
|
62
|
+
},
|
|
63
|
+
placeholder: {
|
|
64
|
+
control: "text",
|
|
65
|
+
description: "The text that appears in the input field.",
|
|
66
|
+
},
|
|
67
|
+
hasLeftIcon: {
|
|
68
|
+
control: "boolean",
|
|
69
|
+
description: "If the input has an icon on the left.",
|
|
70
|
+
},
|
|
71
|
+
leftIcon: {
|
|
72
|
+
table: {
|
|
73
|
+
disable: true,
|
|
74
|
+
},
|
|
75
|
+
description: "If the input has an icon on the left.",
|
|
76
|
+
},
|
|
77
|
+
hasRightIcon: {
|
|
78
|
+
control: "boolean",
|
|
79
|
+
description:
|
|
80
|
+
"If the input has an icon on the right. IF the input has a button the right icon will need to be set to false",
|
|
81
|
+
},
|
|
82
|
+
rightIcon: {
|
|
83
|
+
table: {
|
|
84
|
+
disable: true,
|
|
85
|
+
},
|
|
86
|
+
description: "If the input has an icon on the left.",
|
|
87
|
+
},
|
|
88
|
+
iconColor: {
|
|
89
|
+
control: "select",
|
|
90
|
+
options: ["green", "blue", "black", "white"],
|
|
91
|
+
description: "If the icons have a background color.",
|
|
92
|
+
},
|
|
93
|
+
iconBackgroundColor: {
|
|
94
|
+
control: "select",
|
|
95
|
+
options: ["green", "blue", "grey", "black", "none"],
|
|
96
|
+
description: "If the icons have a background color.",
|
|
97
|
+
},
|
|
98
|
+
inputShape: {
|
|
99
|
+
control: "select",
|
|
100
|
+
options: ["cornered", "semiRounded", "rounded"],
|
|
101
|
+
description: "If the input has rounded corners.",
|
|
102
|
+
},
|
|
103
|
+
borderColor: {
|
|
104
|
+
control: "select",
|
|
105
|
+
options: ["green", "blue", "grey", "black", "none"],
|
|
106
|
+
description: "The border color of the input.",
|
|
107
|
+
},
|
|
108
|
+
successBorder: {
|
|
109
|
+
control: "select",
|
|
110
|
+
options: ["green", "blue", "grey", "black"],
|
|
111
|
+
description:
|
|
112
|
+
"The border color when the input validation results in success.",
|
|
113
|
+
},
|
|
114
|
+
errorBorder: {
|
|
115
|
+
control: "select",
|
|
116
|
+
options: ["red", "orange", "black"],
|
|
117
|
+
description:
|
|
118
|
+
"The border color when the input validation results in error.",
|
|
119
|
+
},
|
|
120
|
+
backgroundColor: {
|
|
121
|
+
control: "select",
|
|
122
|
+
options: ["white", "blue", "grey", "none"],
|
|
123
|
+
description: "The background color of the input.",
|
|
124
|
+
},
|
|
125
|
+
hasButton: {
|
|
126
|
+
control: "boolean",
|
|
127
|
+
description:
|
|
128
|
+
"If the input has a button. IF the in input has a button the inputShape should be set to cornered",
|
|
129
|
+
},
|
|
130
|
+
button: {
|
|
131
|
+
table: {
|
|
132
|
+
disable: true,
|
|
133
|
+
},
|
|
134
|
+
description: "The button that is displayed on the input.",
|
|
135
|
+
},
|
|
136
|
+
onClick: {
|
|
137
|
+
table: {
|
|
138
|
+
disable: true,
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
label: {
|
|
142
|
+
table: {
|
|
143
|
+
disable: true,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
labelVisible: {
|
|
147
|
+
control: "boolean",
|
|
148
|
+
description:
|
|
149
|
+
"If the input label is visible to all or just screen readers.",
|
|
150
|
+
},
|
|
151
|
+
labelPlacement: {
|
|
152
|
+
control: "select",
|
|
153
|
+
options: ["left", "top"],
|
|
154
|
+
description:
|
|
155
|
+
"Where the label is placed in relation to the input field.",
|
|
156
|
+
},
|
|
157
|
+
value: {
|
|
158
|
+
table: {
|
|
159
|
+
disable: true,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
inputName: {
|
|
163
|
+
table: {
|
|
164
|
+
disable: true,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
onChange: {
|
|
168
|
+
table: {
|
|
169
|
+
disable: true,
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
onButtonClick: {
|
|
173
|
+
table: {
|
|
174
|
+
disable: true,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
additionalClasses: {
|
|
178
|
+
table: {
|
|
179
|
+
disable: true,
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
tags: ["autodocs"],
|
|
184
|
+
parameters: {
|
|
185
|
+
layout: "centered",
|
|
186
|
+
},
|
|
187
|
+
} as Meta;
|
|
188
|
+
|
|
189
|
+
const Template: StoryFn<InputTypes> = (args) => <MemoizedInput {...args} />;
|
|
190
|
+
|
|
191
|
+
export const NoIcons = Template.bind({});
|
|
192
|
+
NoIcons.args = {
|
|
193
|
+
// INPUT DETAILS
|
|
194
|
+
inputType: "search",
|
|
195
|
+
inputName: "search",
|
|
196
|
+
|
|
197
|
+
// FUNCTIONALITY
|
|
198
|
+
hasValidation: false,
|
|
199
|
+
|
|
200
|
+
// PLACEHOLDER
|
|
201
|
+
hasPlaceholder: true,
|
|
202
|
+
placeholder: "Search",
|
|
203
|
+
|
|
204
|
+
// LABEL DETAILS
|
|
205
|
+
labelVisible: false,
|
|
206
|
+
label: (
|
|
207
|
+
<Text
|
|
208
|
+
size="md"
|
|
209
|
+
color="primary"
|
|
210
|
+
fontFamily="serif"
|
|
211
|
+
text="Search"
|
|
212
|
+
tag="h2"
|
|
213
|
+
additionalClasses="mb-0 pb-0 pr-2"
|
|
214
|
+
/>
|
|
215
|
+
),
|
|
216
|
+
|
|
217
|
+
// ICONS
|
|
218
|
+
hasLeftIcon: false,
|
|
219
|
+
hasRightIcon: false,
|
|
220
|
+
leftIcon: <FontAwesomeIcon icon={faMagnifyingGlass} />,
|
|
221
|
+
rightIcon: <FontAwesomeIcon icon={faCircleArrowRight} />,
|
|
222
|
+
|
|
223
|
+
// BUTTON
|
|
224
|
+
hasButton: true,
|
|
225
|
+
button: (
|
|
226
|
+
<FormButton
|
|
227
|
+
text=""
|
|
228
|
+
size="lg"
|
|
229
|
+
as="button"
|
|
230
|
+
hoverBackground="green"
|
|
231
|
+
color="green"
|
|
232
|
+
icon={getFontAwesomeIcon("search")}
|
|
233
|
+
fontColor="white"
|
|
234
|
+
additionalClasses="items-center px-2 h-full"
|
|
235
|
+
borderColor="none"
|
|
236
|
+
hoverFontColor="black"
|
|
237
|
+
shape="cornered"
|
|
238
|
+
onClick={() => alert("Button clicked!")}
|
|
239
|
+
/>
|
|
240
|
+
),
|
|
241
|
+
|
|
242
|
+
// INPUT STYLES
|
|
243
|
+
inputTextSize: "md",
|
|
244
|
+
inputWidth: "w-96",
|
|
245
|
+
inputShape: "rounded",
|
|
246
|
+
backgroundColor: "white",
|
|
247
|
+
borderColor: "green",
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
export const LeftIcon = Template.bind({});
|
|
251
|
+
LeftIcon.args = {
|
|
252
|
+
// INPUT DETAILS
|
|
253
|
+
inputType: "text",
|
|
254
|
+
inputName: "search",
|
|
255
|
+
|
|
256
|
+
// FUNCTIONALITY
|
|
257
|
+
hasValidation: false,
|
|
258
|
+
|
|
259
|
+
// INPUT STYLES
|
|
260
|
+
inputWidth: "w-96",
|
|
261
|
+
inputShape: "cornered",
|
|
262
|
+
backgroundColor: "white",
|
|
263
|
+
borderColor: "green",
|
|
264
|
+
|
|
265
|
+
// PLACEHOLDER
|
|
266
|
+
hasPlaceholder: true,
|
|
267
|
+
placeholder: "Search",
|
|
268
|
+
|
|
269
|
+
// LABEL DETAILS
|
|
270
|
+
labelVisible: false,
|
|
271
|
+
label: (
|
|
272
|
+
<Text
|
|
273
|
+
size="md"
|
|
274
|
+
color="primary"
|
|
275
|
+
fontFamily="serif"
|
|
276
|
+
text="Search:"
|
|
277
|
+
tag="h2"
|
|
278
|
+
additionalClasses="mb-0 pb-0 pr-2"
|
|
279
|
+
/>
|
|
280
|
+
),
|
|
281
|
+
|
|
282
|
+
// ICONS
|
|
283
|
+
hasLeftIcon: true,
|
|
284
|
+
leftIcon: <FontAwesomeIcon icon={faMagnifyingGlass} />,
|
|
285
|
+
iconBackgroundColor: "none",
|
|
286
|
+
hasRightIcon: false,
|
|
287
|
+
iconColor: "green",
|
|
288
|
+
|
|
289
|
+
// BUTTON
|
|
290
|
+
hasButton: false,
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
export const RightIcon = Template.bind({});
|
|
294
|
+
RightIcon.args = {
|
|
295
|
+
// INPUT DETAILS
|
|
296
|
+
inputType: "text",
|
|
297
|
+
inputName: "search",
|
|
298
|
+
|
|
299
|
+
// FUNCTIONALITY
|
|
300
|
+
hasValidation: false,
|
|
301
|
+
|
|
302
|
+
// INPUT STYLES
|
|
303
|
+
inputWidth: "w-96",
|
|
304
|
+
inputShape: "rounded",
|
|
305
|
+
backgroundColor: "grey",
|
|
306
|
+
borderColor: "green",
|
|
307
|
+
|
|
308
|
+
// PLACEHOLDER
|
|
309
|
+
hasPlaceholder: true,
|
|
310
|
+
placeholder: "Search",
|
|
311
|
+
|
|
312
|
+
// LABEL DETAILS
|
|
313
|
+
labelVisible: false,
|
|
314
|
+
label: (
|
|
315
|
+
<Text
|
|
316
|
+
size="md"
|
|
317
|
+
color="primary"
|
|
318
|
+
fontFamily="serif"
|
|
319
|
+
text="Search:"
|
|
320
|
+
tag="h2"
|
|
321
|
+
additionalClasses="mb-0 pb-0 pr-2"
|
|
322
|
+
/>
|
|
323
|
+
),
|
|
324
|
+
|
|
325
|
+
// ICONS
|
|
326
|
+
hasLeftIcon: false,
|
|
327
|
+
hasRightIcon: true,
|
|
328
|
+
rightIcon: <FontAwesomeIcon icon={faCircleArrowRight} />,
|
|
329
|
+
iconBackgroundColor: "none",
|
|
330
|
+
|
|
331
|
+
// BUTTON
|
|
332
|
+
hasButton: false,
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
export const DualIcons = Template.bind({});
|
|
336
|
+
DualIcons.args = {
|
|
337
|
+
// INPUT DETAILS
|
|
338
|
+
inputType: "text",
|
|
339
|
+
inputName: "search",
|
|
340
|
+
|
|
341
|
+
// FUNCTIONALITY
|
|
342
|
+
hasValidation: false,
|
|
343
|
+
|
|
344
|
+
// INPUT STYLES
|
|
345
|
+
inputWidth: "w-[40rem]",
|
|
346
|
+
inputShape: "rounded",
|
|
347
|
+
backgroundColor: "white",
|
|
348
|
+
borderColor: "green",
|
|
349
|
+
|
|
350
|
+
// PLACEHOLDER
|
|
351
|
+
placeholder: "Search",
|
|
352
|
+
|
|
353
|
+
// BUTTON
|
|
354
|
+
hasButton: false,
|
|
355
|
+
|
|
356
|
+
// LABEL DETAILS
|
|
357
|
+
labelVisible: false,
|
|
358
|
+
label: (
|
|
359
|
+
<Text
|
|
360
|
+
size="md"
|
|
361
|
+
color="primary"
|
|
362
|
+
fontFamily="serif"
|
|
363
|
+
text="Search:"
|
|
364
|
+
tag="h2"
|
|
365
|
+
additionalClasses="mb-0 pb-0 pr-2"
|
|
366
|
+
/>
|
|
367
|
+
),
|
|
368
|
+
|
|
369
|
+
// ICONS
|
|
370
|
+
hasRightIcon: true,
|
|
371
|
+
hasLeftIcon: true,
|
|
372
|
+
rightIcon: <FontAwesomeIcon icon={faCircleArrowRight} />,
|
|
373
|
+
leftIcon: <FontAwesomeIcon icon={faMagnifyingGlass} />,
|
|
374
|
+
iconBackgroundColor: "none",
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
export const ButtonWithValidation = Template.bind({});
|
|
378
|
+
ButtonWithValidation.args = {
|
|
379
|
+
// INPUT DETAILS
|
|
380
|
+
inputType: "search",
|
|
381
|
+
inputName: "search",
|
|
382
|
+
|
|
383
|
+
// FUNCTIONALITY
|
|
384
|
+
hasValidation: true,
|
|
385
|
+
regex: minCharactersRegex,
|
|
386
|
+
errorMessage: "Input must be at least three characters",
|
|
387
|
+
|
|
388
|
+
// INPUT STYLES
|
|
389
|
+
inputWidth: "w-[40rem]",
|
|
390
|
+
inputShape: "cornered",
|
|
391
|
+
backgroundColor: "white",
|
|
392
|
+
borderColor: "green",
|
|
393
|
+
errorBorder: "red",
|
|
394
|
+
successBorder: "green",
|
|
395
|
+
|
|
396
|
+
// PLACEHOLDER
|
|
397
|
+
placeholder: "Enter input here...",
|
|
398
|
+
|
|
399
|
+
// LABEL DETAILS
|
|
400
|
+
labelVisible: false,
|
|
401
|
+
label: (
|
|
402
|
+
<Text
|
|
403
|
+
size="md"
|
|
404
|
+
color="primary"
|
|
405
|
+
fontFamily="serif"
|
|
406
|
+
text="Search:"
|
|
407
|
+
tag="h2"
|
|
408
|
+
additionalClasses="mb-0 pb-0 pr-2"
|
|
409
|
+
/>
|
|
410
|
+
),
|
|
411
|
+
|
|
412
|
+
// ICONS
|
|
413
|
+
hasRightIcon: false,
|
|
414
|
+
hasLeftIcon: false,
|
|
415
|
+
|
|
416
|
+
// BUTTON
|
|
417
|
+
hasButton: true,
|
|
418
|
+
button: (
|
|
419
|
+
<FormButton
|
|
420
|
+
text=""
|
|
421
|
+
size="lg"
|
|
422
|
+
as="button"
|
|
423
|
+
hoverBackground="green"
|
|
424
|
+
color="green"
|
|
425
|
+
icon={<FontAwesomeIcon icon={faCircleArrowRight} />}
|
|
426
|
+
fontColor="white"
|
|
427
|
+
additionalClasses="items-center px-2 h-full"
|
|
428
|
+
borderColor="none"
|
|
429
|
+
hoverFontColor="black"
|
|
430
|
+
shape="cornered"
|
|
431
|
+
onClick={() => alert("Button clicked!")}
|
|
432
|
+
/>
|
|
433
|
+
),
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
export const ButtonWithLeftIcon = Template.bind({});
|
|
437
|
+
ButtonWithLeftIcon.args = {
|
|
438
|
+
// INPUT DETAILS
|
|
439
|
+
inputType: "text",
|
|
440
|
+
inputName: "search",
|
|
441
|
+
|
|
442
|
+
// FUNCTIONALITY
|
|
443
|
+
hasValidation: false,
|
|
444
|
+
|
|
445
|
+
// INPUT STYLES
|
|
446
|
+
inputWidth: "w-[40rem]",
|
|
447
|
+
inputShape: "cornered",
|
|
448
|
+
backgroundColor: "white",
|
|
449
|
+
borderColor: "green",
|
|
450
|
+
|
|
451
|
+
// PLACEHOLDER
|
|
452
|
+
placeholder: "Search",
|
|
453
|
+
|
|
454
|
+
// LABEL DETAILS
|
|
455
|
+
labelVisible: false,
|
|
456
|
+
label: (
|
|
457
|
+
<Text
|
|
458
|
+
size="md"
|
|
459
|
+
color="primary"
|
|
460
|
+
fontFamily="serif"
|
|
461
|
+
text="Search:"
|
|
462
|
+
tag="h2"
|
|
463
|
+
additionalClasses="mb-0 pb-2 pl-2"
|
|
464
|
+
/>
|
|
465
|
+
),
|
|
466
|
+
|
|
467
|
+
// ICONS
|
|
468
|
+
hasRightIcon: false,
|
|
469
|
+
hasLeftIcon: true,
|
|
470
|
+
leftIcon: <FontAwesomeIcon icon={faMagnifyingGlass} />,
|
|
471
|
+
iconBackgroundColor: "none",
|
|
472
|
+
|
|
473
|
+
// BUTTON
|
|
474
|
+
hasButton: true,
|
|
475
|
+
button: (
|
|
476
|
+
<FormButton
|
|
477
|
+
text=""
|
|
478
|
+
size="lg"
|
|
479
|
+
as="button"
|
|
480
|
+
hoverBackground="green"
|
|
481
|
+
color="green"
|
|
482
|
+
icon={<FontAwesomeIcon icon={faCircleArrowRight} />}
|
|
483
|
+
fontColor="white"
|
|
484
|
+
additionalClasses="items-center px-2 h-full"
|
|
485
|
+
borderColor="none"
|
|
486
|
+
hoverFontColor="black"
|
|
487
|
+
shape="cornered"
|
|
488
|
+
onClick={() => alert("Button clicked!")}
|
|
489
|
+
/>
|
|
490
|
+
),
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
export const DateInput = Template.bind({});
|
|
494
|
+
DateInput.args = {
|
|
495
|
+
// INPUT DETAILS
|
|
496
|
+
inputType: "date",
|
|
497
|
+
inputName: "birthday",
|
|
498
|
+
|
|
499
|
+
// FUNCTIONALITY
|
|
500
|
+
hasValidation: true,
|
|
501
|
+
|
|
502
|
+
// INPUT STYLES
|
|
503
|
+
inputWidth: "w-48",
|
|
504
|
+
inputShape: "rounded",
|
|
505
|
+
backgroundColor: "white",
|
|
506
|
+
borderColor: "green",
|
|
507
|
+
|
|
508
|
+
// PLACEHOLDER
|
|
509
|
+
hasPlaceholder: false,
|
|
510
|
+
|
|
511
|
+
// LABEL DETAILS
|
|
512
|
+
labelVisible: true,
|
|
513
|
+
label: (
|
|
514
|
+
<Text
|
|
515
|
+
size="md"
|
|
516
|
+
color="primary"
|
|
517
|
+
fontFamily="serif"
|
|
518
|
+
text="Date of Birth:"
|
|
519
|
+
tag="h2"
|
|
520
|
+
additionalClasses="mb-0 pb-1 pl-2"
|
|
521
|
+
/>
|
|
522
|
+
),
|
|
523
|
+
|
|
524
|
+
// ICONS
|
|
525
|
+
hasRightIcon: false,
|
|
526
|
+
hasLeftIcon: false,
|
|
527
|
+
rightIcon: false,
|
|
528
|
+
leftIcon: false,
|
|
529
|
+
|
|
530
|
+
// BUTTON
|
|
531
|
+
hasButton: false,
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
export const EmailInput = Template.bind({});
|
|
535
|
+
EmailInput.args = {
|
|
536
|
+
// INPUT DETAILS
|
|
537
|
+
inputType: "email",
|
|
538
|
+
inputName: "email",
|
|
539
|
+
|
|
540
|
+
// FUNCTIONALITY
|
|
541
|
+
hasValidation: false,
|
|
542
|
+
|
|
543
|
+
// INPUT STYLES
|
|
544
|
+
inputWidth: "w-72",
|
|
545
|
+
inputShape: "rounded",
|
|
546
|
+
backgroundColor: "white",
|
|
547
|
+
borderColor: "green",
|
|
548
|
+
|
|
549
|
+
// PLACEHOLDER
|
|
550
|
+
hasPlaceholder: false,
|
|
551
|
+
|
|
552
|
+
// LABEL DETAILS
|
|
553
|
+
labelVisible: true,
|
|
554
|
+
label: (
|
|
555
|
+
<Text
|
|
556
|
+
size="md"
|
|
557
|
+
color="primary"
|
|
558
|
+
fontFamily="serif"
|
|
559
|
+
text="Email:"
|
|
560
|
+
tag="h2"
|
|
561
|
+
additionalClasses="mb-0 pb-1 pl-2"
|
|
562
|
+
/>
|
|
563
|
+
),
|
|
564
|
+
|
|
565
|
+
// ICONS
|
|
566
|
+
hasRightIcon: false,
|
|
567
|
+
hasLeftIcon: true,
|
|
568
|
+
leftIcon: <FontAwesomeIcon icon={faEnvelope} />,
|
|
569
|
+
|
|
570
|
+
// BUTTON
|
|
571
|
+
hasButton: false,
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
export const NumberInput = Template.bind({});
|
|
575
|
+
NumberInput.args = {
|
|
576
|
+
// INPUT DETAILS
|
|
577
|
+
inputType: "number",
|
|
578
|
+
inputName: "number",
|
|
579
|
+
|
|
580
|
+
// FUNCTIONALITY
|
|
581
|
+
hasValidation: false,
|
|
582
|
+
|
|
583
|
+
// INPUT STYLES
|
|
584
|
+
inputWidth: "w-36",
|
|
585
|
+
inputShape: "semiRounded",
|
|
586
|
+
backgroundColor: "white",
|
|
587
|
+
borderColor: "green",
|
|
588
|
+
|
|
589
|
+
// PLACEHOLDER
|
|
590
|
+
hasPlaceholder: false,
|
|
591
|
+
|
|
592
|
+
// LABEL DETAILS
|
|
593
|
+
labelVisible: true,
|
|
594
|
+
labelPlacement: "left",
|
|
595
|
+
label: (
|
|
596
|
+
<Text
|
|
597
|
+
size="md"
|
|
598
|
+
color="primary"
|
|
599
|
+
fontFamily="serif"
|
|
600
|
+
text="Enter Your Age:"
|
|
601
|
+
tag="h2"
|
|
602
|
+
additionalClasses="mb-0 pb-0 pr-3"
|
|
603
|
+
/>
|
|
604
|
+
),
|
|
605
|
+
|
|
606
|
+
// ICONS
|
|
607
|
+
hasRightIcon: false,
|
|
608
|
+
hasLeftIcon: false,
|
|
609
|
+
|
|
610
|
+
// BUTTON
|
|
611
|
+
hasButton: false,
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
export const RangeInput = Template.bind({});
|
|
615
|
+
RangeInput.args = {
|
|
616
|
+
// INPUT DETAILS
|
|
617
|
+
inputType: "range",
|
|
618
|
+
inputName: "number",
|
|
619
|
+
|
|
620
|
+
// FUNCTIONALITY
|
|
621
|
+
hasValidation: false,
|
|
622
|
+
|
|
623
|
+
// INPUT STYLES
|
|
624
|
+
inputWidth: "w-36",
|
|
625
|
+
backgroundColor: "white",
|
|
626
|
+
borderColor: "none",
|
|
627
|
+
|
|
628
|
+
// PLACEHOLDER
|
|
629
|
+
hasPlaceholder: false,
|
|
630
|
+
|
|
631
|
+
// LABEL DETAILS
|
|
632
|
+
labelVisible: true,
|
|
633
|
+
labelPlacement: "left",
|
|
634
|
+
label: (
|
|
635
|
+
<Text
|
|
636
|
+
size="md"
|
|
637
|
+
color="primary"
|
|
638
|
+
fontFamily="serif"
|
|
639
|
+
text="Select:"
|
|
640
|
+
tag="h2"
|
|
641
|
+
additionalClasses="mb-0 pb-0 pr-4"
|
|
642
|
+
/>
|
|
643
|
+
),
|
|
644
|
+
|
|
645
|
+
// ICONS
|
|
646
|
+
hasRightIcon: false,
|
|
647
|
+
hasLeftIcon: false,
|
|
648
|
+
|
|
649
|
+
// BUTTON
|
|
650
|
+
hasButton: false,
|
|
651
|
+
};
|