@bloom-housing/ui-components 2.0.0-pre-tailwind
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/.jest/setup-tests.js +24 -0
- package/CHANGELOG.md +20 -0
- package/README.md +195 -0
- package/index.ts +148 -0
- package/jest.config.js +41 -0
- package/package.json +98 -0
- package/public/images/alameda-logo-white.svg +1 -0
- package/public/images/arrow-down.png +0 -0
- package/public/images/arrow-down.svg +1 -0
- package/public/images/check.png +0 -0
- package/public/images/check.svg +11 -0
- package/public/images/eho-logo-white.svg +1 -0
- package/public/images/eho-logo.svg +1 -0
- package/public/images/logo_glyph.svg +11 -0
- package/src/actions/Button.scss +157 -0
- package/src/actions/Button.tsx +80 -0
- package/src/actions/ExpandableContent.tsx +29 -0
- package/src/actions/ExpandableText.scss +18 -0
- package/src/actions/ExpandableText.tsx +52 -0
- package/src/actions/LinkButton.tsx +30 -0
- package/src/actions/LocalizedLink.tsx +11 -0
- package/src/authentication/AuthContext.ts +327 -0
- package/src/authentication/RequireLogin.tsx +62 -0
- package/src/authentication/index.ts +5 -0
- package/src/authentication/timeout.tsx +127 -0
- package/src/authentication/token.ts +17 -0
- package/src/authentication/useRequireLoggedInUser.ts +19 -0
- package/src/blocks/ActionBlock.scss +108 -0
- package/src/blocks/ActionBlock.tsx +51 -0
- package/src/blocks/AppStatusItem.scss +140 -0
- package/src/blocks/AppStatusItem.tsx +75 -0
- package/src/blocks/DashBlock.tsx +42 -0
- package/src/blocks/DashBlocks.scss +56 -0
- package/src/blocks/DashBlocks.tsx +7 -0
- package/src/blocks/FormCard.scss +201 -0
- package/src/blocks/FormCard.tsx +29 -0
- package/src/blocks/HousingCounselor.tsx +51 -0
- package/src/blocks/ImageCard.scss +91 -0
- package/src/blocks/ImageCard.tsx +77 -0
- package/src/blocks/InfoCard.scss +42 -0
- package/src/blocks/InfoCard.tsx +44 -0
- package/src/blocks/StatusBar.scss +30 -0
- package/src/blocks/StatusBar.tsx +31 -0
- package/src/blocks/ViewItem.scss +59 -0
- package/src/blocks/ViewItem.tsx +32 -0
- package/src/config/ConfigContext.tsx +36 -0
- package/src/config/NavigationContext.tsx +54 -0
- package/src/config/index.ts +2 -0
- package/src/footers/ExygyFooter.tsx +12 -0
- package/src/footers/SiteFooter.scss +28 -0
- package/src/footers/SiteFooter.tsx +10 -0
- package/src/forms/CloudinaryUpload.ts +50 -0
- package/src/forms/DOBField.tsx +132 -0
- package/src/forms/DateField.tsx +120 -0
- package/src/forms/Dropzone.scss +17 -0
- package/src/forms/Dropzone.tsx +67 -0
- package/src/forms/Field.tsx +115 -0
- package/src/forms/FieldGroup.tsx +82 -0
- package/src/forms/Form.tsx +22 -0
- package/src/forms/HouseholdMemberForm.tsx +41 -0
- package/src/forms/HouseholdSizeField.tsx +74 -0
- package/src/forms/PhoneField.tsx +69 -0
- package/src/forms/PhoneMask.tsx +24 -0
- package/src/forms/Select.tsx +80 -0
- package/src/forms/Textarea.scss +40 -0
- package/src/forms/Textarea.tsx +64 -0
- package/src/forms/TimeField.tsx +176 -0
- package/src/global/AppearanceTypes.ts +46 -0
- package/src/global/ApplicationStatusType.ts +6 -0
- package/src/global/accordion.scss +4 -0
- package/src/global/blocks.scss +137 -0
- package/src/global/custom_counter.scss +50 -0
- package/src/global/forms.scss +362 -0
- package/src/global/headers.scss +89 -0
- package/src/global/homepage.scss +8 -0
- package/src/global/index.scss +72 -0
- package/src/global/lists.scss +21 -0
- package/src/global/markdown.scss +33 -0
- package/src/global/mixins.scss +175 -0
- package/src/global/navbar.scss +280 -0
- package/src/global/print.scss +59 -0
- package/src/global/tables.scss +197 -0
- package/src/global/text.scss +141 -0
- package/src/global/vendor/AgPagination.tsx +133 -0
- package/src/global/vendor/_setup_bulma.scss +31 -0
- package/src/global/vendor/ag_grid.scss +140 -0
- package/src/headers/Hero.scss +56 -0
- package/src/headers/Hero.tsx +76 -0
- package/src/headers/PageHeader.scss +31 -0
- package/src/headers/PageHeader.tsx +39 -0
- package/src/headers/SiteHeader.tsx +136 -0
- package/src/helpers/address.tsx +46 -0
- package/src/helpers/blankApplication.ts +108 -0
- package/src/helpers/capitalize.tsx +7 -0
- package/src/helpers/dateToString.ts +11 -0
- package/src/helpers/debounce.ts +12 -0
- package/src/helpers/formOptions.tsx +229 -0
- package/src/helpers/formatYesNoLabel.ts +9 -0
- package/src/helpers/getTranslationWithArguments.ts +14 -0
- package/src/helpers/links.ts +7 -0
- package/src/helpers/localeRoute.tsx +13 -0
- package/src/helpers/mergeDeep.ts +12 -0
- package/src/helpers/nextjs.ts +7 -0
- package/src/helpers/numberOrdinal.ts +17 -0
- package/src/helpers/occupancyFormatting.tsx +46 -0
- package/src/helpers/pdfs.ts +19 -0
- package/src/helpers/photos.ts +19 -0
- package/src/helpers/preferences.tsx +426 -0
- package/src/helpers/resolveObject.ts +5 -0
- package/src/helpers/state.tsx +7 -0
- package/src/helpers/tableSummaries.tsx +80 -0
- package/src/helpers/translator.tsx +37 -0
- package/src/helpers/useKeyPress.ts +17 -0
- package/src/helpers/useMutate.ts +40 -0
- package/src/helpers/useOutsideClick.ts +25 -0
- package/src/helpers/validators.ts +3 -0
- package/src/icons/HeaderBadge.scss +29 -0
- package/src/icons/HeaderBadge.tsx +38 -0
- package/src/icons/Icon.scss +76 -0
- package/src/icons/Icon.tsx +145 -0
- package/src/icons/Icons.tsx +556 -0
- package/src/lists/PreferencesList.scss +72 -0
- package/src/lists/PreferencesList.tsx +60 -0
- package/src/locales/es.json +745 -0
- package/src/locales/general.json +1307 -0
- package/src/locales/general_OLD.json +868 -0
- package/src/locales/vi.json +745 -0
- package/src/locales/zh.json +745 -0
- package/src/navigation/Breadcrumbs.scss +25 -0
- package/src/navigation/Breadcrumbs.tsx +27 -0
- package/src/navigation/FooterNav.scss +47 -0
- package/src/navigation/FooterNav.tsx +19 -0
- package/src/navigation/LanguageNav.scss +32 -0
- package/src/navigation/LanguageNav.tsx +53 -0
- package/src/navigation/ProgressNav.scss +102 -0
- package/src/navigation/ProgressNav.tsx +50 -0
- package/src/navigation/TabNav.scss +38 -0
- package/src/navigation/TabNav.tsx +69 -0
- package/src/navigation/Tabs.scss +65 -0
- package/src/navigation/Tabs.tsx +93 -0
- package/src/navigation/UserNav.tsx +37 -0
- package/src/notifications/AlertBox.scss +78 -0
- package/src/notifications/AlertBox.tsx +79 -0
- package/src/notifications/AlertNotice.scss +58 -0
- package/src/notifications/AlertNotice.tsx +37 -0
- package/src/notifications/ApplicationStatus.scss +10 -0
- package/src/notifications/ApplicationStatus.tsx +64 -0
- package/src/notifications/ErrorMessage.tsx +15 -0
- package/src/notifications/SiteAlert.tsx +54 -0
- package/src/notifications/StatusAside.scss +11 -0
- package/src/notifications/StatusAside.tsx +25 -0
- package/src/notifications/StatusMessage.scss +25 -0
- package/src/notifications/StatusMessage.tsx +59 -0
- package/src/notifications/alertTypes.ts +7 -0
- package/src/notifications/index.ts +4 -0
- package/src/overlays/Drawer.scss +105 -0
- package/src/overlays/Drawer.tsx +51 -0
- package/src/overlays/LoadingOverlay.scss +25 -0
- package/src/overlays/LoadingOverlay.tsx +29 -0
- package/src/overlays/Modal.scss +55 -0
- package/src/overlays/Modal.tsx +61 -0
- package/src/overlays/Overlay.scss +50 -0
- package/src/overlays/Overlay.tsx +100 -0
- package/src/page_components/listing/AdditionalFees.tsx +56 -0
- package/src/page_components/listing/ListingCard.scss +47 -0
- package/src/page_components/listing/ListingCard.tsx +34 -0
- package/src/page_components/listing/ListingDetailHeader.tsx +25 -0
- package/src/page_components/listing/ListingDetails.tsx +29 -0
- package/src/page_components/listing/ListingMap.scss +36 -0
- package/src/page_components/listing/ListingMap.tsx +138 -0
- package/src/page_components/listing/ListingsGroup.scss +65 -0
- package/src/page_components/listing/ListingsGroup.tsx +49 -0
- package/src/page_components/listing/UnitTables.tsx +111 -0
- package/src/page_components/listing/listing_sidebar/ApplicationSection.tsx +49 -0
- package/src/page_components/listing/listing_sidebar/Apply.tsx +225 -0
- package/src/page_components/listing/listing_sidebar/LeasingAgent.tsx +77 -0
- package/src/page_components/listing/listing_sidebar/ListingUpdated.tsx +20 -0
- package/src/page_components/listing/listing_sidebar/ReferralApplication.tsx +28 -0
- package/src/page_components/listing/listing_sidebar/SidebarAddress.tsx +56 -0
- package/src/page_components/listing/listing_sidebar/Waitlist.tsx +94 -0
- package/src/page_components/listing/listing_sidebar/WhatToExpect.tsx +22 -0
- package/src/page_components/listing/listing_sidebar/events/DownloadLotteryResults.tsx +34 -0
- package/src/page_components/listing/listing_sidebar/events/EventDateSection.tsx +24 -0
- package/src/page_components/listing/listing_sidebar/events/LotteryResultsEvent.tsx +26 -0
- package/src/page_components/listing/listing_sidebar/events/OpenHouseEvent.tsx +27 -0
- package/src/page_components/listing/listing_sidebar/events/PublicLotteryEvent.tsx +22 -0
- package/src/prototypes/AppCard.scss +64 -0
- package/src/prototypes/Back.scss +19 -0
- package/src/prototypes/ButtonGroup.scss +6 -0
- package/src/prototypes/ButtonPager.scss +22 -0
- package/src/prototypes/FieldSection.scss +35 -0
- package/src/prototypes/FieldSection.tsx +31 -0
- package/src/prototypes/GridItem.tsx +15 -0
- package/src/prototypes/SideNav.scss +32 -0
- package/src/prototypes/SideNav.tsx +14 -0
- package/src/prototypes/SummaryCard.scss +34 -0
- package/src/sections/ContentSection.scss +15 -0
- package/src/sections/ContentSection.tsx +25 -0
- package/src/sections/FooterSection.scss +6 -0
- package/src/sections/FooterSection.tsx +16 -0
- package/src/sections/GridSection.scss +72 -0
- package/src/sections/GridSection.tsx +82 -0
- package/src/sections/InfoCardGrid.scss +45 -0
- package/src/sections/InfoCardGrid.tsx +20 -0
- package/src/sections/ListSection.scss +7 -0
- package/src/sections/ListSection.tsx +23 -0
- package/src/sections/MarkdownSection.scss +13 -0
- package/src/sections/MarkdownSection.tsx +21 -0
- package/src/sections/ResponsiveContentList.tsx +67 -0
- package/src/sections/ResponsiveWrappers.tsx +23 -0
- package/src/tables/GroupedTable.tsx +86 -0
- package/src/tables/MinimalTable.tsx +32 -0
- package/src/tables/ResponsiveTable.tsx +24 -0
- package/src/tables/StandardTable.tsx +229 -0
- package/src/text/Description.scss +52 -0
- package/src/text/Description.tsx +24 -0
- package/src/text/Message.scss +16 -0
- package/src/text/Message.tsx +16 -0
- package/src/text/Tag.scss +94 -0
- package/src/text/Tag.tsx +22 -0
- package/tailwind.config.js +128 -0
- package/tailwind.tosass.js +29 -0
- package/tsconfig.json +31 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@import "../global/mixins.scss";
|
|
2
|
+
|
|
3
|
+
.textarea {
|
|
4
|
+
@apply border;
|
|
5
|
+
@apply border-gray-500;
|
|
6
|
+
@apply p-2;
|
|
7
|
+
@apply text-gray-900;
|
|
8
|
+
@apply bg-gray-200;
|
|
9
|
+
font-size: 1rem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.textarea-resize-off {
|
|
13
|
+
resize: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.textarea-disabled {
|
|
17
|
+
@apply bg-gray-400;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.textarea-error {
|
|
21
|
+
@apply border;
|
|
22
|
+
@apply border-alert;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.textarea-error-message {
|
|
26
|
+
@apply text-xs;
|
|
27
|
+
@apply text-alert;
|
|
28
|
+
@apply block;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.textarea-label {
|
|
32
|
+
@apply block;
|
|
33
|
+
@apply pb-2;
|
|
34
|
+
@apply text-tiny;
|
|
35
|
+
@apply text-gray-800;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.textarea-label-error {
|
|
39
|
+
@apply text-alert;
|
|
40
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./Textarea.scss"
|
|
3
|
+
import { t } from "../helpers/translator"
|
|
4
|
+
import { UseFormMethods } from "react-hook-form"
|
|
5
|
+
|
|
6
|
+
type WrapOptions = "soft" | "hard"
|
|
7
|
+
|
|
8
|
+
export interface TextareaProps {
|
|
9
|
+
cols?: number
|
|
10
|
+
defaultValue?: string
|
|
11
|
+
disabled?: boolean
|
|
12
|
+
errorMessage?: string
|
|
13
|
+
fullWidth?: boolean
|
|
14
|
+
id?: string
|
|
15
|
+
label: string
|
|
16
|
+
maxLength?: number
|
|
17
|
+
name: string
|
|
18
|
+
note?: string
|
|
19
|
+
placeholder?: string
|
|
20
|
+
register?: UseFormMethods["register"]
|
|
21
|
+
resize?: boolean
|
|
22
|
+
rows?: number
|
|
23
|
+
wrap?: WrapOptions
|
|
24
|
+
readerOnly?: boolean
|
|
25
|
+
inputProps?: Record<string, unknown>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const Textarea = (props: TextareaProps) => {
|
|
29
|
+
const textareaClassnames = ["textarea"]
|
|
30
|
+
if (props.disabled) textareaClassnames.push("textarea-disabled")
|
|
31
|
+
if (props.errorMessage) textareaClassnames.push("textarea-error")
|
|
32
|
+
if (props.resize === false) textareaClassnames.push("textarea-resize-off")
|
|
33
|
+
if (props.fullWidth) textareaClassnames.push("w-full")
|
|
34
|
+
const labelClassnames = ["textarea-label"]
|
|
35
|
+
if (props.errorMessage) labelClassnames.push("textarea-label-error")
|
|
36
|
+
if (props.readerOnly) labelClassnames.push("sr-only")
|
|
37
|
+
|
|
38
|
+
const inputProps = { ...props.inputProps }
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div>
|
|
42
|
+
<label className={labelClassnames.join(" ")} htmlFor={props.id ?? props.name}>
|
|
43
|
+
{props.label}
|
|
44
|
+
</label>
|
|
45
|
+
<textarea
|
|
46
|
+
className={textareaClassnames.join(" ")}
|
|
47
|
+
cols={props.cols ?? 40}
|
|
48
|
+
disabled={props.disabled}
|
|
49
|
+
defaultValue={props.defaultValue}
|
|
50
|
+
id={props.id ?? props.name}
|
|
51
|
+
maxLength={props.maxLength ?? 150}
|
|
52
|
+
name={props.name}
|
|
53
|
+
placeholder={props.placeholder ?? t("t.description")}
|
|
54
|
+
ref={props.register}
|
|
55
|
+
rows={props.rows ?? 4}
|
|
56
|
+
wrap={props.wrap ?? "soft"}
|
|
57
|
+
title={props.label}
|
|
58
|
+
{...inputProps}
|
|
59
|
+
/>
|
|
60
|
+
{props.note && <p className="field-note font-normal mb-2">{props.note}</p>}
|
|
61
|
+
{props.errorMessage && <span className="textarea-error-message">{props.errorMessage}</span>}
|
|
62
|
+
</div>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import React, { useState, useEffect } from "react"
|
|
2
|
+
import moment from "moment"
|
|
3
|
+
import { t } from "../helpers/translator"
|
|
4
|
+
import { ErrorMessage } from "../notifications/ErrorMessage"
|
|
5
|
+
import { Field } from "./Field"
|
|
6
|
+
import { Select } from "../forms/Select"
|
|
7
|
+
import { UseFormMethods } from "react-hook-form"
|
|
8
|
+
|
|
9
|
+
export type TimeFieldPeriod = "am" | "pm"
|
|
10
|
+
|
|
11
|
+
export type TimeFieldValues = {
|
|
12
|
+
hours: string
|
|
13
|
+
minutes: string
|
|
14
|
+
seconds: string
|
|
15
|
+
period: TimeFieldPeriod
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type TimeFieldProps = {
|
|
19
|
+
defaultValues?: TimeFieldValues
|
|
20
|
+
disabled?: boolean
|
|
21
|
+
error?: boolean
|
|
22
|
+
id?: string
|
|
23
|
+
label: string
|
|
24
|
+
labelClass?: string
|
|
25
|
+
name?: string
|
|
26
|
+
readerOnly?: boolean
|
|
27
|
+
register: UseFormMethods["register"]
|
|
28
|
+
required?: boolean
|
|
29
|
+
watch: UseFormMethods["watch"]
|
|
30
|
+
seconds?: boolean
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const formatDateToTimeField = (date: Date) => {
|
|
34
|
+
const dateObj = moment(date)
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
hours: dateObj.format("hh"),
|
|
38
|
+
minutes: dateObj.format("mm"),
|
|
39
|
+
seconds: dateObj.format("ss"),
|
|
40
|
+
period: new Date(date).getHours() >= 12 ? "pm" : "am",
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const TimeField = ({
|
|
45
|
+
required = false,
|
|
46
|
+
error,
|
|
47
|
+
register,
|
|
48
|
+
watch,
|
|
49
|
+
name,
|
|
50
|
+
id,
|
|
51
|
+
label,
|
|
52
|
+
labelClass,
|
|
53
|
+
readerOnly,
|
|
54
|
+
seconds,
|
|
55
|
+
defaultValues,
|
|
56
|
+
disabled,
|
|
57
|
+
}: TimeFieldProps) => {
|
|
58
|
+
const fieldName = (baseName: string) => {
|
|
59
|
+
return [name, baseName].filter((item) => item).join(".")
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// it prevents partial fill, all fields should be filled or nothing
|
|
63
|
+
const [innerRequiredRule, setInnerRequiredRule] = useState(false)
|
|
64
|
+
|
|
65
|
+
const hoursField = watch(fieldName("hours"))
|
|
66
|
+
const minutesField = watch(fieldName("minutes"))
|
|
67
|
+
const secondsField = watch(fieldName("seconds"))
|
|
68
|
+
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
const someFieldsFilled = hoursField || minutesField || secondsField
|
|
71
|
+
setInnerRequiredRule(someFieldsFilled)
|
|
72
|
+
}, [hoursField, minutesField, secondsField])
|
|
73
|
+
|
|
74
|
+
const labelClasses = ["field-label", labelClass]
|
|
75
|
+
if (readerOnly) labelClasses.push("sr-only")
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<fieldset id={id}>
|
|
79
|
+
<legend className={labelClasses.join(" ")}>{label}</legend>
|
|
80
|
+
<div className="field-group--date">
|
|
81
|
+
<Field
|
|
82
|
+
name={fieldName("hours")}
|
|
83
|
+
label={t("t.hour")}
|
|
84
|
+
defaultValue={defaultValues?.hours ?? ""}
|
|
85
|
+
readerOnly={true}
|
|
86
|
+
placeholder="HH"
|
|
87
|
+
error={error}
|
|
88
|
+
validation={{
|
|
89
|
+
required: required || innerRequiredRule,
|
|
90
|
+
validate: {
|
|
91
|
+
hourRange: (value: string) => {
|
|
92
|
+
if (!required && !value?.length) return true
|
|
93
|
+
|
|
94
|
+
return parseInt(value) > 0 && parseInt(value) <= 12
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
}}
|
|
98
|
+
inputProps={{ maxLength: 2 }}
|
|
99
|
+
register={register}
|
|
100
|
+
describedBy={`${id}-error`}
|
|
101
|
+
disabled={disabled}
|
|
102
|
+
/>
|
|
103
|
+
|
|
104
|
+
<Field
|
|
105
|
+
name={fieldName("minutes")}
|
|
106
|
+
label={t("t.minutes")}
|
|
107
|
+
defaultValue={defaultValues?.minutes ?? ""}
|
|
108
|
+
readerOnly={true}
|
|
109
|
+
placeholder="MM"
|
|
110
|
+
error={error}
|
|
111
|
+
validation={{
|
|
112
|
+
required: required || innerRequiredRule,
|
|
113
|
+
validate: {
|
|
114
|
+
minutesRange: (value: string) => {
|
|
115
|
+
if (!required && !value?.length) return true
|
|
116
|
+
|
|
117
|
+
return parseInt(value) >= 0 && parseInt(value) <= 59
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
}}
|
|
121
|
+
inputProps={{ maxLength: 2 }}
|
|
122
|
+
register={register}
|
|
123
|
+
describedBy={`${id}-error`}
|
|
124
|
+
disabled={disabled}
|
|
125
|
+
/>
|
|
126
|
+
|
|
127
|
+
{seconds && (
|
|
128
|
+
<Field
|
|
129
|
+
label={t("t.seconds")}
|
|
130
|
+
defaultValue={defaultValues?.seconds ?? ""}
|
|
131
|
+
name={fieldName("seconds")}
|
|
132
|
+
readerOnly={true}
|
|
133
|
+
placeholder="SS"
|
|
134
|
+
error={error}
|
|
135
|
+
validation={{
|
|
136
|
+
required: required || innerRequiredRule,
|
|
137
|
+
validate: {
|
|
138
|
+
secondsRange: (value: string) => {
|
|
139
|
+
if (!required && !value?.length) return true
|
|
140
|
+
|
|
141
|
+
return parseInt(value) >= 0 && parseInt(value) <= 59
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
}}
|
|
145
|
+
inputProps={{ maxLength: 2 }}
|
|
146
|
+
register={register}
|
|
147
|
+
describedBy={`${id}-error`}
|
|
148
|
+
disabled={disabled}
|
|
149
|
+
/>
|
|
150
|
+
)}
|
|
151
|
+
|
|
152
|
+
<Select
|
|
153
|
+
name={fieldName("period")}
|
|
154
|
+
id={fieldName("period")}
|
|
155
|
+
labelClassName="sr-only"
|
|
156
|
+
label={t("t.time")}
|
|
157
|
+
register={register}
|
|
158
|
+
options={["am", "pm"]}
|
|
159
|
+
keyPrefix="t"
|
|
160
|
+
defaultValue={defaultValues?.period || ""}
|
|
161
|
+
error={error}
|
|
162
|
+
describedBy={`${id}-error`}
|
|
163
|
+
disabled={disabled}
|
|
164
|
+
/>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<div id={`${id}-error`} className="field error">
|
|
168
|
+
<ErrorMessage id={"time-field-error"} error={error}>
|
|
169
|
+
{t("errors.timeError")}
|
|
170
|
+
</ErrorMessage>
|
|
171
|
+
</div>
|
|
172
|
+
</fieldset>
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export { TimeField as default, TimeField }
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export enum AppearanceStyleType {
|
|
2
|
+
primary = "is-primary",
|
|
3
|
+
secondary = "is-secondary",
|
|
4
|
+
success = "is-success",
|
|
5
|
+
alert = "is-alert",
|
|
6
|
+
warning = "is-warning",
|
|
7
|
+
info = "is-info",
|
|
8
|
+
accentCool = "is-accent-cool",
|
|
9
|
+
accentWarm = "is-accent-warm",
|
|
10
|
+
closed = "is-closed",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export enum AppearanceSizeType {
|
|
14
|
+
small = "is-small",
|
|
15
|
+
normal = "is-normal",
|
|
16
|
+
big = "is-big",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export enum AppearanceBorderType {
|
|
20
|
+
borderless = "is-borderless",
|
|
21
|
+
normal = "",
|
|
22
|
+
outlined = "is-outlined",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export enum AppearanceShadeType {
|
|
26
|
+
light = "is-light-mode",
|
|
27
|
+
dark = "is-dark-mode",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface AppearanceProps {
|
|
31
|
+
styleType?: AppearanceStyleType
|
|
32
|
+
border?: AppearanceBorderType
|
|
33
|
+
size?: AppearanceSizeType
|
|
34
|
+
shade?: AppearanceShadeType
|
|
35
|
+
normalCase?: boolean
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const classNamesForAppearanceTypes = (props: AppearanceProps) => {
|
|
39
|
+
const classNames = []
|
|
40
|
+
if (props.styleType) classNames.push(props.styleType)
|
|
41
|
+
if (props.border) classNames.push(props.border)
|
|
42
|
+
if (props.size) classNames.push(props.size)
|
|
43
|
+
if (props.shade) classNames.push(props.shade)
|
|
44
|
+
if (props.normalCase) classNames.push("is-normal-case")
|
|
45
|
+
return classNames
|
|
46
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Box
|
|
2
|
+
.box,
|
|
3
|
+
.block {
|
|
4
|
+
@apply text-sm;
|
|
5
|
+
@apply text-gray-700;
|
|
6
|
+
@apply rounded;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
details.disclosure {
|
|
10
|
+
@apply relative;
|
|
11
|
+
min-height: 3em;
|
|
12
|
+
|
|
13
|
+
&[open] {
|
|
14
|
+
@apply mb-16;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
& > summary {
|
|
18
|
+
@apply text-primary;
|
|
19
|
+
@apply absolute;
|
|
20
|
+
@apply list-none;
|
|
21
|
+
@apply outline-none;
|
|
22
|
+
@apply cursor-pointer;
|
|
23
|
+
@apply bottom-0;
|
|
24
|
+
@apply pr-1;
|
|
25
|
+
@apply pb-2;
|
|
26
|
+
@include has-toggle;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&[open] > summary {
|
|
30
|
+
bottom: -3em;
|
|
31
|
+
|
|
32
|
+
&:after {
|
|
33
|
+
transform: rotate(0deg) translateY(2px);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
& > summary::-webkit-details-marker {
|
|
38
|
+
@apply hidden;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
p {
|
|
42
|
+
@apply my-4;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.listing-detail-panel {
|
|
47
|
+
@screen md {
|
|
48
|
+
@apply ml-16;
|
|
49
|
+
@apply p-8;
|
|
50
|
+
@apply pt-0;
|
|
51
|
+
@apply pl-0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.aside-block {
|
|
56
|
+
@apply border-gray-400;
|
|
57
|
+
@apply p-5;
|
|
58
|
+
@apply pb-2;
|
|
59
|
+
@apply -mx-4;
|
|
60
|
+
|
|
61
|
+
&.is-tinted {
|
|
62
|
+
@apply bg-primary-lighter;
|
|
63
|
+
@apply border-t;
|
|
64
|
+
}
|
|
65
|
+
&:not(.is-tinted) + &.is-tinted {
|
|
66
|
+
@apply mt-3;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.is-tinted,
|
|
70
|
+
&:last-of-type {
|
|
71
|
+
@apply pb-5;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@screen md {
|
|
75
|
+
@apply border-b;
|
|
76
|
+
@apply pb-5;
|
|
77
|
+
@apply mx-0;
|
|
78
|
+
|
|
79
|
+
&.is-tinted {
|
|
80
|
+
@apply mt-0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&:not(.is-tinted) + &.is-tinted {
|
|
84
|
+
@apply border-t-0;
|
|
85
|
+
@apply mt-0;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.aside-block__divider {
|
|
91
|
+
@apply -mx-5;
|
|
92
|
+
@apply mt-6;
|
|
93
|
+
@apply mb-2;
|
|
94
|
+
@apply border-t;
|
|
95
|
+
@apply border-gray-400;
|
|
96
|
+
@apply text-center;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.aside-block__conjunction {
|
|
100
|
+
@apply relative;
|
|
101
|
+
@apply -top;
|
|
102
|
+
@apply px-1;
|
|
103
|
+
@apply uppercase;
|
|
104
|
+
@apply text-primary-dark;
|
|
105
|
+
@apply font-semibold;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.notice-block {
|
|
109
|
+
@apply flex;
|
|
110
|
+
@apply flex-row;
|
|
111
|
+
@apply flex-wrap;
|
|
112
|
+
@apply max-w-5xl;
|
|
113
|
+
@apply m-auto;
|
|
114
|
+
@apply mt-5;
|
|
115
|
+
@apply mb-12;
|
|
116
|
+
@apply text-center;
|
|
117
|
+
@apply p-4;
|
|
118
|
+
@apply bg-primary-lighter;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
$shadow-left-slight: -3px 0px 3px -1px rgba(0, 0, 0, 0.1);
|
|
122
|
+
|
|
123
|
+
.shadow-left {
|
|
124
|
+
box-shadow: $shadow-left-slight;
|
|
125
|
+
}
|
|
126
|
+
.md\:shadow-left {
|
|
127
|
+
@screen md {
|
|
128
|
+
box-shadow: $shadow-left-slight;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// temp global style until status bar component
|
|
133
|
+
.status-bar__status {
|
|
134
|
+
.tag.is-pill {
|
|
135
|
+
@apply block;
|
|
136
|
+
}
|
|
137
|
+
}
|