@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.
Files changed (223) hide show
  1. package/.jest/setup-tests.js +24 -0
  2. package/CHANGELOG.md +20 -0
  3. package/README.md +195 -0
  4. package/index.ts +148 -0
  5. package/jest.config.js +41 -0
  6. package/package.json +98 -0
  7. package/public/images/alameda-logo-white.svg +1 -0
  8. package/public/images/arrow-down.png +0 -0
  9. package/public/images/arrow-down.svg +1 -0
  10. package/public/images/check.png +0 -0
  11. package/public/images/check.svg +11 -0
  12. package/public/images/eho-logo-white.svg +1 -0
  13. package/public/images/eho-logo.svg +1 -0
  14. package/public/images/logo_glyph.svg +11 -0
  15. package/src/actions/Button.scss +157 -0
  16. package/src/actions/Button.tsx +80 -0
  17. package/src/actions/ExpandableContent.tsx +29 -0
  18. package/src/actions/ExpandableText.scss +18 -0
  19. package/src/actions/ExpandableText.tsx +52 -0
  20. package/src/actions/LinkButton.tsx +30 -0
  21. package/src/actions/LocalizedLink.tsx +11 -0
  22. package/src/authentication/AuthContext.ts +327 -0
  23. package/src/authentication/RequireLogin.tsx +62 -0
  24. package/src/authentication/index.ts +5 -0
  25. package/src/authentication/timeout.tsx +127 -0
  26. package/src/authentication/token.ts +17 -0
  27. package/src/authentication/useRequireLoggedInUser.ts +19 -0
  28. package/src/blocks/ActionBlock.scss +108 -0
  29. package/src/blocks/ActionBlock.tsx +51 -0
  30. package/src/blocks/AppStatusItem.scss +140 -0
  31. package/src/blocks/AppStatusItem.tsx +75 -0
  32. package/src/blocks/DashBlock.tsx +42 -0
  33. package/src/blocks/DashBlocks.scss +56 -0
  34. package/src/blocks/DashBlocks.tsx +7 -0
  35. package/src/blocks/FormCard.scss +201 -0
  36. package/src/blocks/FormCard.tsx +29 -0
  37. package/src/blocks/HousingCounselor.tsx +51 -0
  38. package/src/blocks/ImageCard.scss +91 -0
  39. package/src/blocks/ImageCard.tsx +77 -0
  40. package/src/blocks/InfoCard.scss +42 -0
  41. package/src/blocks/InfoCard.tsx +44 -0
  42. package/src/blocks/StatusBar.scss +30 -0
  43. package/src/blocks/StatusBar.tsx +31 -0
  44. package/src/blocks/ViewItem.scss +59 -0
  45. package/src/blocks/ViewItem.tsx +32 -0
  46. package/src/config/ConfigContext.tsx +36 -0
  47. package/src/config/NavigationContext.tsx +54 -0
  48. package/src/config/index.ts +2 -0
  49. package/src/footers/ExygyFooter.tsx +12 -0
  50. package/src/footers/SiteFooter.scss +28 -0
  51. package/src/footers/SiteFooter.tsx +10 -0
  52. package/src/forms/CloudinaryUpload.ts +50 -0
  53. package/src/forms/DOBField.tsx +132 -0
  54. package/src/forms/DateField.tsx +120 -0
  55. package/src/forms/Dropzone.scss +17 -0
  56. package/src/forms/Dropzone.tsx +67 -0
  57. package/src/forms/Field.tsx +115 -0
  58. package/src/forms/FieldGroup.tsx +82 -0
  59. package/src/forms/Form.tsx +22 -0
  60. package/src/forms/HouseholdMemberForm.tsx +41 -0
  61. package/src/forms/HouseholdSizeField.tsx +74 -0
  62. package/src/forms/PhoneField.tsx +69 -0
  63. package/src/forms/PhoneMask.tsx +24 -0
  64. package/src/forms/Select.tsx +80 -0
  65. package/src/forms/Textarea.scss +40 -0
  66. package/src/forms/Textarea.tsx +64 -0
  67. package/src/forms/TimeField.tsx +176 -0
  68. package/src/global/AppearanceTypes.ts +46 -0
  69. package/src/global/ApplicationStatusType.ts +6 -0
  70. package/src/global/accordion.scss +4 -0
  71. package/src/global/blocks.scss +137 -0
  72. package/src/global/custom_counter.scss +50 -0
  73. package/src/global/forms.scss +362 -0
  74. package/src/global/headers.scss +89 -0
  75. package/src/global/homepage.scss +8 -0
  76. package/src/global/index.scss +72 -0
  77. package/src/global/lists.scss +21 -0
  78. package/src/global/markdown.scss +33 -0
  79. package/src/global/mixins.scss +175 -0
  80. package/src/global/navbar.scss +280 -0
  81. package/src/global/print.scss +59 -0
  82. package/src/global/tables.scss +197 -0
  83. package/src/global/text.scss +141 -0
  84. package/src/global/vendor/AgPagination.tsx +133 -0
  85. package/src/global/vendor/_setup_bulma.scss +31 -0
  86. package/src/global/vendor/ag_grid.scss +140 -0
  87. package/src/headers/Hero.scss +56 -0
  88. package/src/headers/Hero.tsx +76 -0
  89. package/src/headers/PageHeader.scss +31 -0
  90. package/src/headers/PageHeader.tsx +39 -0
  91. package/src/headers/SiteHeader.tsx +136 -0
  92. package/src/helpers/address.tsx +46 -0
  93. package/src/helpers/blankApplication.ts +108 -0
  94. package/src/helpers/capitalize.tsx +7 -0
  95. package/src/helpers/dateToString.ts +11 -0
  96. package/src/helpers/debounce.ts +12 -0
  97. package/src/helpers/formOptions.tsx +229 -0
  98. package/src/helpers/formatYesNoLabel.ts +9 -0
  99. package/src/helpers/getTranslationWithArguments.ts +14 -0
  100. package/src/helpers/links.ts +7 -0
  101. package/src/helpers/localeRoute.tsx +13 -0
  102. package/src/helpers/mergeDeep.ts +12 -0
  103. package/src/helpers/nextjs.ts +7 -0
  104. package/src/helpers/numberOrdinal.ts +17 -0
  105. package/src/helpers/occupancyFormatting.tsx +46 -0
  106. package/src/helpers/pdfs.ts +19 -0
  107. package/src/helpers/photos.ts +19 -0
  108. package/src/helpers/preferences.tsx +426 -0
  109. package/src/helpers/resolveObject.ts +5 -0
  110. package/src/helpers/state.tsx +7 -0
  111. package/src/helpers/tableSummaries.tsx +80 -0
  112. package/src/helpers/translator.tsx +37 -0
  113. package/src/helpers/useKeyPress.ts +17 -0
  114. package/src/helpers/useMutate.ts +40 -0
  115. package/src/helpers/useOutsideClick.ts +25 -0
  116. package/src/helpers/validators.ts +3 -0
  117. package/src/icons/HeaderBadge.scss +29 -0
  118. package/src/icons/HeaderBadge.tsx +38 -0
  119. package/src/icons/Icon.scss +76 -0
  120. package/src/icons/Icon.tsx +145 -0
  121. package/src/icons/Icons.tsx +556 -0
  122. package/src/lists/PreferencesList.scss +72 -0
  123. package/src/lists/PreferencesList.tsx +60 -0
  124. package/src/locales/es.json +745 -0
  125. package/src/locales/general.json +1307 -0
  126. package/src/locales/general_OLD.json +868 -0
  127. package/src/locales/vi.json +745 -0
  128. package/src/locales/zh.json +745 -0
  129. package/src/navigation/Breadcrumbs.scss +25 -0
  130. package/src/navigation/Breadcrumbs.tsx +27 -0
  131. package/src/navigation/FooterNav.scss +47 -0
  132. package/src/navigation/FooterNav.tsx +19 -0
  133. package/src/navigation/LanguageNav.scss +32 -0
  134. package/src/navigation/LanguageNav.tsx +53 -0
  135. package/src/navigation/ProgressNav.scss +102 -0
  136. package/src/navigation/ProgressNav.tsx +50 -0
  137. package/src/navigation/TabNav.scss +38 -0
  138. package/src/navigation/TabNav.tsx +69 -0
  139. package/src/navigation/Tabs.scss +65 -0
  140. package/src/navigation/Tabs.tsx +93 -0
  141. package/src/navigation/UserNav.tsx +37 -0
  142. package/src/notifications/AlertBox.scss +78 -0
  143. package/src/notifications/AlertBox.tsx +79 -0
  144. package/src/notifications/AlertNotice.scss +58 -0
  145. package/src/notifications/AlertNotice.tsx +37 -0
  146. package/src/notifications/ApplicationStatus.scss +10 -0
  147. package/src/notifications/ApplicationStatus.tsx +64 -0
  148. package/src/notifications/ErrorMessage.tsx +15 -0
  149. package/src/notifications/SiteAlert.tsx +54 -0
  150. package/src/notifications/StatusAside.scss +11 -0
  151. package/src/notifications/StatusAside.tsx +25 -0
  152. package/src/notifications/StatusMessage.scss +25 -0
  153. package/src/notifications/StatusMessage.tsx +59 -0
  154. package/src/notifications/alertTypes.ts +7 -0
  155. package/src/notifications/index.ts +4 -0
  156. package/src/overlays/Drawer.scss +105 -0
  157. package/src/overlays/Drawer.tsx +51 -0
  158. package/src/overlays/LoadingOverlay.scss +25 -0
  159. package/src/overlays/LoadingOverlay.tsx +29 -0
  160. package/src/overlays/Modal.scss +55 -0
  161. package/src/overlays/Modal.tsx +61 -0
  162. package/src/overlays/Overlay.scss +50 -0
  163. package/src/overlays/Overlay.tsx +100 -0
  164. package/src/page_components/listing/AdditionalFees.tsx +56 -0
  165. package/src/page_components/listing/ListingCard.scss +47 -0
  166. package/src/page_components/listing/ListingCard.tsx +34 -0
  167. package/src/page_components/listing/ListingDetailHeader.tsx +25 -0
  168. package/src/page_components/listing/ListingDetails.tsx +29 -0
  169. package/src/page_components/listing/ListingMap.scss +36 -0
  170. package/src/page_components/listing/ListingMap.tsx +138 -0
  171. package/src/page_components/listing/ListingsGroup.scss +65 -0
  172. package/src/page_components/listing/ListingsGroup.tsx +49 -0
  173. package/src/page_components/listing/UnitTables.tsx +111 -0
  174. package/src/page_components/listing/listing_sidebar/ApplicationSection.tsx +49 -0
  175. package/src/page_components/listing/listing_sidebar/Apply.tsx +225 -0
  176. package/src/page_components/listing/listing_sidebar/LeasingAgent.tsx +77 -0
  177. package/src/page_components/listing/listing_sidebar/ListingUpdated.tsx +20 -0
  178. package/src/page_components/listing/listing_sidebar/ReferralApplication.tsx +28 -0
  179. package/src/page_components/listing/listing_sidebar/SidebarAddress.tsx +56 -0
  180. package/src/page_components/listing/listing_sidebar/Waitlist.tsx +94 -0
  181. package/src/page_components/listing/listing_sidebar/WhatToExpect.tsx +22 -0
  182. package/src/page_components/listing/listing_sidebar/events/DownloadLotteryResults.tsx +34 -0
  183. package/src/page_components/listing/listing_sidebar/events/EventDateSection.tsx +24 -0
  184. package/src/page_components/listing/listing_sidebar/events/LotteryResultsEvent.tsx +26 -0
  185. package/src/page_components/listing/listing_sidebar/events/OpenHouseEvent.tsx +27 -0
  186. package/src/page_components/listing/listing_sidebar/events/PublicLotteryEvent.tsx +22 -0
  187. package/src/prototypes/AppCard.scss +64 -0
  188. package/src/prototypes/Back.scss +19 -0
  189. package/src/prototypes/ButtonGroup.scss +6 -0
  190. package/src/prototypes/ButtonPager.scss +22 -0
  191. package/src/prototypes/FieldSection.scss +35 -0
  192. package/src/prototypes/FieldSection.tsx +31 -0
  193. package/src/prototypes/GridItem.tsx +15 -0
  194. package/src/prototypes/SideNav.scss +32 -0
  195. package/src/prototypes/SideNav.tsx +14 -0
  196. package/src/prototypes/SummaryCard.scss +34 -0
  197. package/src/sections/ContentSection.scss +15 -0
  198. package/src/sections/ContentSection.tsx +25 -0
  199. package/src/sections/FooterSection.scss +6 -0
  200. package/src/sections/FooterSection.tsx +16 -0
  201. package/src/sections/GridSection.scss +72 -0
  202. package/src/sections/GridSection.tsx +82 -0
  203. package/src/sections/InfoCardGrid.scss +45 -0
  204. package/src/sections/InfoCardGrid.tsx +20 -0
  205. package/src/sections/ListSection.scss +7 -0
  206. package/src/sections/ListSection.tsx +23 -0
  207. package/src/sections/MarkdownSection.scss +13 -0
  208. package/src/sections/MarkdownSection.tsx +21 -0
  209. package/src/sections/ResponsiveContentList.tsx +67 -0
  210. package/src/sections/ResponsiveWrappers.tsx +23 -0
  211. package/src/tables/GroupedTable.tsx +86 -0
  212. package/src/tables/MinimalTable.tsx +32 -0
  213. package/src/tables/ResponsiveTable.tsx +24 -0
  214. package/src/tables/StandardTable.tsx +229 -0
  215. package/src/text/Description.scss +52 -0
  216. package/src/text/Description.tsx +24 -0
  217. package/src/text/Message.scss +16 -0
  218. package/src/text/Message.tsx +16 -0
  219. package/src/text/Tag.scss +94 -0
  220. package/src/text/Tag.tsx +22 -0
  221. package/tailwind.config.js +128 -0
  222. package/tailwind.tosass.js +29 -0
  223. package/tsconfig.json +31 -0
@@ -0,0 +1,24 @@
1
+ import "@testing-library/jest-dom/extend-expect"
2
+
3
+ import { configure } from "enzyme"
4
+ import Adapter from "enzyme-adapter-react-16"
5
+ import { addTranslation } from "../src/helpers/translator"
6
+ import general from "../src/locales/general.json"
7
+
8
+ configure({ adapter: new Adapter() })
9
+
10
+ // see: https://jestjs.io/docs/en/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
11
+ window.matchMedia = jest.fn().mockImplementation((query) => {
12
+ return {
13
+ matches: false,
14
+ media: query,
15
+ onchange: null,
16
+ addListener: jest.fn(), // deprecated
17
+ removeListener: jest.fn(), // deprecated
18
+ addEventListener: jest.fn(),
19
+ removeEventListener: jest.fn(),
20
+ dispatchEvent: jest.fn(),
21
+ }
22
+ })
23
+
24
+ addTranslation(general)
package/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [0.2.5](https://github.com/bloom-housing/bloom/compare/v0.2.3...v0.2.5) (2020-06-30)
7
+
8
+ **Note:** Version bump only for package @bloom-housing/ui-components
9
+
10
+ ## [0.2.2](https://github.com/bloom-housing/bloom/compare/v0.2.1...v0.2.2) (2020-06-05)
11
+
12
+ **Note:** Version bump only for package @bloom-housing/ui-components
13
+
14
+ ## [0.2.1](https://github.com/bloom-housing/bloom/compare/v0.2.0...v0.2.1) (2020-06-05)
15
+
16
+ **Note:** Version bump only for package @bloom-housing/ui-components
17
+
18
+ ## [0.0.9](https://github.com/bloom-housing/bloom/compare/v0.0.2...v0.0.9) (2020-04-21)
19
+
20
+ **Note:** Version bump only for package @bloom-housing/ui-components
package/README.md ADDED
@@ -0,0 +1,195 @@
1
+ # Bloom UI Components
2
+
3
+ This package is the home of the core UI components for the Bloom affordable housing system, meant to be imported from one or more applications that provide the end-user interface.
4
+
5
+ ## Types of Components
6
+
7
+ Bloom components have been design with the principles of [Atomic Design](http://atomicdesign.bradfrost.com/) in mind, and some of the directory structure and naming conventions are based on that.
8
+
9
+ There are also Page Components as a distinct class, which represent larger combinations of components (atomic: organisms) that are meant to be directly imported into specific pages in the system (e.g. a home page).
10
+
11
+ ## Locales/Translations
12
+
13
+ Look in `src/locales` for JSON files containing translated keys for UI elements and copy across all monorepo sites.
14
+
15
+ ## Storybook
16
+
17
+ The UI components package includes [Storybook](https://storybook.js.org/) for easy browsing of the component tree, and is the best way to get started understand what's available.
18
+
19
+ ## CLI
20
+
21
+ To spin up Storybook locally, run:
22
+
23
+ ```
24
+ yarn start
25
+ ```
26
+
27
+ To run the test suite which is a combination of storyshots and tests via Jest and Enzyme, run:
28
+
29
+ ```
30
+ yarn test
31
+
32
+ # or
33
+
34
+ yarn test -u # updates storyshots based on latest code
35
+ ```
36
+
37
+ ## Style Organization and Best Practices
38
+
39
+ ### Style Frameworks
40
+
41
+ - [Tailwind](https://v1.tailwindcss.com) v1: Low-level utility library that styles components based on custom settings.
42
+
43
+ ### Sass Architecture
44
+
45
+ - /ui-components: Components and styles are accessible by multiple apps
46
+ - /global: Styles are accessible by any component
47
+ - index: import frameworks, fonts, components, utilities
48
+ - /elements (no associated markup pattern, if more than 300 lines we break this into a folder with files)
49
+ - mixins
50
+ - utilities
51
+ - typography
52
+ - print
53
+ - /vendors
54
+ - Components: Styles are isolated per component
55
+ - /actions
56
+ - /footers
57
+ - /headers
58
+ - /icons
59
+ - /forms
60
+ - /layouts
61
+ - /lists
62
+ - /navigations
63
+ - /notifications
64
+ - /overlays
65
+ - /sections
66
+ - /structure
67
+ - /tables
68
+ - /text
69
+ - Settings
70
+ - tailwind.config
71
+ - Apps: Components and styles that are accessible to a single app
72
+ - Reference
73
+ - Reference components (temp/prototype)
74
+
75
+ Vendor Plugins
76
+
77
+ - [AG Grid](https://www.ag-grid.com)
78
+ - [Bulma](https://bulma.io/documentation/components/navbar/) (for the navbar)
79
+
80
+ ### Naming Conventions
81
+
82
+ - **BEM**
83
+
84
+ - Structures CSS such that every entity is composed of blocks, elements and modifiers
85
+ - Avoid using Sass nesting to build class names
86
+ - Bad
87
+ - .accordion
88
+ - &-item
89
+ - Good
90
+ - .accordion
91
+ - .accordion-item
92
+
93
+ - Suggested custom methodology: Our recommendation for a naming methodology is a modified version of BEM. It still uses blocks, sections within blocks and modifiers, but with a subclass syntax for modifiers.
94
+
95
+ - BEM
96
+
97
+ - .accordion
98
+ - .accordion-item
99
+ - .accordion-item\_\_label
100
+
101
+ - Sub Class Modifiers: Name modifiers and state-based rules with adjectives
102
+ - is-, has-
103
+ - .accordion-item\_\_label.is-open
104
+
105
+ - Component naming
106
+ - Name things clearly
107
+ - Be wary of naming components based on content, as this limits the use of the class
108
+ - Avoid presentation- or location-specific naming
109
+ - Use capitals for React component names
110
+ - SelectButton instead of selectbutton, or Menu instead of menu
111
+ - Tokenize prop values
112
+ - Avoid presentation-specific words in prop values, as it will change with theming
113
+
114
+ ### Utilities & Custom Class Names
115
+
116
+ - Use Tailwind utilities to prototype components before writing a custom styles sheet or creating custom classes.
117
+ - Create custom component classes once you understand the component structure and variants.
118
+ - Use Tailwind utilities at the app level when creating layout and page level objects.
119
+ - Create custom layout classes once you identify a repeatable layout pattern.
120
+
121
+ ### CSS Formatting
122
+
123
+ - File declaration order
124
+ 1. Local variables
125
+ 2. Tailwind utilities
126
+ 3. Media queries
127
+ 4. Pseudo states
128
+ 5. Nested classes
129
+ 6. Nested elements
130
+
131
+ ### Specificity
132
+
133
+ - IDs should be reserved for JavaScript. Don’t use IDs for styles.
134
+ - Don’t nest more than 3 layers deep.
135
+ - Don’t fix problems with !important. Use !important purposefully.
136
+ - Refrain from using overqualified selectors; div.container can simply be stated as .container.
137
+
138
+ ### Spacing Units
139
+
140
+ - Base 16 using Tailwind Tokens for padding and margins
141
+
142
+ ### Layout
143
+
144
+ - Use flex instead of float
145
+ - Use grid utilities for uniform grids
146
+
147
+ ### Style Customization
148
+
149
+ - Tailwind Configuration
150
+
151
+ ### Accessibility
152
+
153
+ - Storybook AXE panel
154
+ - Keyboard accessibility
155
+ - Roles
156
+ - Focus state
157
+ - Color contrast
158
+ - AA
159
+ - Accessible forms
160
+ - Labels for each input
161
+ - Screen reader labels for inputs with no label
162
+ - Fieldsets for groups
163
+ - Required
164
+ - Accessible data tables
165
+ - Alt tags for images
166
+ - Errors and alert messages
167
+ - Overlay focus
168
+ - Screen reader utilities
169
+
170
+ ### Build Process
171
+
172
+ ### Upstream vs Downstream
173
+
174
+ ## React Best Practices
175
+
176
+ ### Calculate Style Based on Props
177
+
178
+ - a `warning={true}` prop might turn into an `is-warning` className applied
179
+
180
+ ### Nesting
181
+
182
+ ### Naming Conventions
183
+
184
+ - CamelCase to css
185
+
186
+ ### Storybook: Creating Stories
187
+
188
+ - Include a default story for base component
189
+ - Include stories for each state
190
+
191
+ ### Accessibility
192
+
193
+ - Use accessibility tab for QA
194
+
195
+ ### Storybook Knobs
package/index.ts ADDED
@@ -0,0 +1,148 @@
1
+ /* Actions */
2
+ export * from "./src/actions/Button"
3
+ export * from "./src/actions/ExpandableText"
4
+ export * from "./src/actions/LinkButton"
5
+ export * from "./src/actions/LocalizedLink"
6
+ export * from "./src/actions/ExpandableContent"
7
+
8
+ /* Blocks */
9
+ export * from "./src/blocks/ActionBlock"
10
+ export * from "./src/blocks/AppStatusItem"
11
+ export * from "./src/blocks/DashBlock"
12
+ export * from "./src/blocks/DashBlocks"
13
+ export * from "./src/blocks/FormCard"
14
+ export * from "./src/blocks/HousingCounselor"
15
+ export * from "./src/blocks/ImageCard"
16
+ export * from "./src/blocks/InfoCard"
17
+ export * from "./src/blocks/StatusBar"
18
+ export * from "./src/blocks/ViewItem"
19
+
20
+ /* Contexts */
21
+ export * from "./src/authentication"
22
+ export * from "./src/config"
23
+
24
+ /* Footers */
25
+ export * from "./src/footers/ExygyFooter"
26
+ export * from "./src/footers/SiteFooter"
27
+
28
+ /* Forms */
29
+ export * from "./src/forms/DateField"
30
+ export * from "./src/forms/DOBField"
31
+ export * from "./src/forms/CloudinaryUpload"
32
+ export * from "./src/forms/Dropzone"
33
+ export * from "./src/forms/Field"
34
+ export * from "./src/forms/PhoneField"
35
+ export * from "./src/forms/PhoneMask"
36
+ export * from "./src/forms/HouseholdMemberForm"
37
+ export * from "./src/forms/HouseholdSizeField"
38
+ export * from "./src/forms/FieldGroup"
39
+ export * from "./src/forms/Select"
40
+ export * from "./src/forms/Form"
41
+ export * from "./src/forms/Textarea"
42
+ export * from "./src/forms/TimeField"
43
+ /* Global */
44
+ export * from "./src/global/AppearanceTypes"
45
+ export * from "./src/global/ApplicationStatusType"
46
+ export * from "./src/global/vendor/AgPagination"
47
+
48
+ /* Headers */
49
+ export * from "./src/headers/Hero"
50
+ export * from "./src/headers/PageHeader"
51
+ export * from "./src/headers/SiteHeader"
52
+
53
+ /* Helpers */
54
+ export * from "./src/helpers/address"
55
+ export * from "./src/helpers/capitalize"
56
+ export * from "./src/helpers/dateToString"
57
+ export * from "./src/helpers/formOptions"
58
+ export * from "./src/helpers/links"
59
+ export * from "./src/helpers/mergeDeep"
60
+ export * from "./src/helpers/localeRoute"
61
+ export * from "./src/helpers/nextjs"
62
+ export * from "./src/helpers/numberOrdinal"
63
+ export * from "./src/helpers/occupancyFormatting"
64
+ export * from "./src/helpers/photos"
65
+ export * from "./src/helpers/pdfs"
66
+ export * from "./src/helpers/state"
67
+ export * from "./src/helpers/tableSummaries"
68
+ export * from "./src/helpers/translator"
69
+ export * from "./src/helpers/debounce"
70
+ export * from "./src/helpers/validators"
71
+ export * from "./src/helpers/blankApplication"
72
+ export * from "./src/helpers/formatYesNoLabel"
73
+ export * from "./src/helpers/getTranslationWithArguments"
74
+ export * from "./src/helpers/preferences"
75
+ export * from "./src/helpers/resolveObject"
76
+ export * from "./src/helpers/useMutate"
77
+
78
+ /* Icons */
79
+ export * from "./src/icons/HeaderBadge"
80
+ export * from "./src/icons/Icon"
81
+
82
+ /* Lists */
83
+ export * from "./src/lists/PreferencesList"
84
+
85
+ /* Navigation */
86
+ export * from "./src/navigation/FooterNav"
87
+ export * from "./src/navigation/LanguageNav"
88
+ export * from "./src/navigation/ProgressNav"
89
+ export * from "./src/navigation/TabNav"
90
+ export * from "./src/navigation/Tabs"
91
+ export * from "./src/navigation/UserNav"
92
+
93
+ /* Notifications */
94
+ export * from "./src/notifications/ApplicationStatus"
95
+ export * from "./src/notifications/ErrorMessage"
96
+ export * from "./src/notifications/StatusAside"
97
+ export * from "./src/notifications/StatusMessage"
98
+ export * from "./src/notifications"
99
+
100
+ /* Overlays */
101
+ export * from "./src/overlays/Overlay"
102
+ export * from "./src/overlays/Modal"
103
+ export * from "./src/overlays/Drawer"
104
+ export * from "./src/overlays/LoadingOverlay"
105
+
106
+ /* Page Components */
107
+ export * from "./src/page_components/listing/AdditionalFees"
108
+ export * from "./src/page_components/listing/ListingCard"
109
+ export * from "./src/page_components/listing/ListingDetailHeader"
110
+ export * from "./src/page_components/listing/ListingDetails"
111
+ export * from "./src/page_components/listing/ListingMap"
112
+ export * from "./src/page_components/listing/ListingsGroup"
113
+ export * from "./src/page_components/listing/UnitTables"
114
+ export * from "./src/page_components/listing/listing_sidebar/ApplicationSection"
115
+ export * from "./src/page_components/listing/listing_sidebar/Apply"
116
+ export * from "./src/page_components/listing/listing_sidebar/LeasingAgent"
117
+ export * from "./src/page_components/listing/listing_sidebar/ListingUpdated"
118
+ export * from "./src/page_components/listing/listing_sidebar/ReferralApplication"
119
+ export * from "./src/page_components/listing/listing_sidebar/SidebarAddress"
120
+ export * from "./src/page_components/listing/listing_sidebar/Waitlist"
121
+ export * from "./src/page_components/listing/listing_sidebar/WhatToExpect"
122
+ export * from "./src/page_components/listing/listing_sidebar/events/DownloadLotteryResults"
123
+ export * from "./src/page_components/listing/listing_sidebar/events/OpenHouseEvent"
124
+ export * from "./src/page_components/listing/listing_sidebar/events/LotteryResultsEvent"
125
+ export * from "./src/page_components/listing/listing_sidebar/events/PublicLotteryEvent"
126
+ export * from "./src/page_components/listing/listing_sidebar/events/EventDateSection"
127
+
128
+ /* Responsive Wrappers */
129
+ export * from "./src/sections/ResponsiveWrappers"
130
+
131
+ /* Sections */
132
+ export * from "./src/sections/ContentSection"
133
+ export * from "./src/sections/FooterSection"
134
+ export * from "./src/sections/InfoCardGrid"
135
+ export * from "./src/sections/ListSection"
136
+ export * from "./src/sections/MarkdownSection"
137
+ export * from "./src/sections/ResponsiveContentList"
138
+ export * from "./src/sections/GridSection"
139
+
140
+ /* Tables */
141
+ export * from "./src/tables/StandardTable"
142
+ export * from "./src/tables/GroupedTable"
143
+ export * from "./src/tables/MinimalTable"
144
+
145
+ /* Text */
146
+ export * from "./src/text/Description"
147
+ export * from "./src/text/Message"
148
+ export * from "./src/text/Tag"
package/jest.config.js ADDED
@@ -0,0 +1,41 @@
1
+ /*eslint no-undef: "error"*/
2
+ /*eslint-env node*/
3
+
4
+ process.env.TZ = "UTC"
5
+
6
+ module.exports = {
7
+ testRegex: ["/*.test.tsx$", "/*.test.ts$"],
8
+ collectCoverageFrom: [
9
+ "**/*.tsx",
10
+ "!**/*.stories.tsx",
11
+ "<rootDir>/ui-components/src/helpers/*.ts",
12
+ "!<rootDir>/ui-components/src/helpers/blankApplication.ts",
13
+ ],
14
+ coverageReporters: ["lcov", "text"],
15
+ coverageDirectory: "test-coverage",
16
+ coverageThreshold: {
17
+ global: {
18
+ branches: 0,
19
+ functions: 0,
20
+ lines: 0,
21
+ statements: 0,
22
+ },
23
+ },
24
+ preset: "ts-jest",
25
+ globals: {
26
+ "ts-jest": {
27
+ tsConfig: "tsconfig.json",
28
+ },
29
+ },
30
+ rootDir: "..",
31
+ roots: ["<rootDir>/ui-components"],
32
+ transform: {
33
+ "^.+\\.[t|j]sx?$": "ts-jest",
34
+ },
35
+ setupFiles: ["dotenv/config"],
36
+ setupFilesAfterEnv: ["<rootDir>/ui-components/.jest/setup-tests.js"],
37
+ moduleNameMapper: {
38
+ "\\.(scss|css|less)$": "identity-obj-proxy",
39
+ },
40
+ testPathIgnorePatterns: ["storyshots.d.ts"],
41
+ }
package/package.json ADDED
@@ -0,0 +1,98 @@
1
+ {
2
+ "name": "@bloom-housing/ui-components",
3
+ "version": "2.0.0-pre-tailwind",
4
+ "description": "Shared user interface components for Bloom affordable housing system",
5
+ "homepage": "https://github.com/bloom-housing/bloom/tree/master/shared/ui-components",
6
+ "main": "index.js",
7
+ "license": "Apache-2.0",
8
+ "private": false,
9
+ "scripts": {
10
+ "build-storybook": "build-storybook -c .storybook -s ./public",
11
+ "start": "start-storybook -s ./public",
12
+ "test": "jest -w 1",
13
+ "test:coverage": "jest -w 1 --coverage --watchAll=false",
14
+ "prettier": "prettier --write \"**/*.tsx\"",
15
+ "test:a11y": "build-storybook -o ./storybook-static && jest storyshot --testRegex=storyshots.spec.ts"
16
+ },
17
+ "devDependencies": {
18
+ "@babel/core": "^7.11.6",
19
+ "@emotion/core": "^10.0.35",
20
+ "@emotion/styled": "^10.0.27",
21
+ "@storybook/addon-a11y": "^6.0.26",
22
+ "@storybook/addon-actions": "^6.1.17",
23
+ "@storybook/addon-docs": "^6.0.26",
24
+ "@storybook/addon-knobs": "^6.1.1",
25
+ "@storybook/addon-storyshots": "^6.3.2",
26
+ "@storybook/addon-storyshots-puppeteer": "^6.0.26",
27
+ "@storybook/addon-viewport": "^6.0.26",
28
+ "@storybook/react": "^6.0.26",
29
+ "@testing-library/jest-dom": "^5.11.9",
30
+ "@testing-library/react": "^11.2.5",
31
+ "@types/enzyme": "^3.10.7",
32
+ "@types/enzyme-adapter-react-16": "^1.0.6",
33
+ "@types/jest": "^26.0.14",
34
+ "@types/jwt-decode": "^2.2.1",
35
+ "@types/react-map-gl": "^5.2.10",
36
+ "@types/react-tabs": "^2.3.2",
37
+ "@types/react-test-renderer": "^16.9.3",
38
+ "@types/webpack": "^4.41.22",
39
+ "babel-loader": "^8.1.0",
40
+ "babel-plugin-require-context-hook": "^1.0.0",
41
+ "dotenv": "^8.2.0",
42
+ "enzyme": "^3.11.0",
43
+ "enzyme-adapter-react-16": "^1.15.5",
44
+ "enzyme-to-json": "^3.4.4",
45
+ "identity-obj-proxy": "^3.0.0",
46
+ "jest": "^26.5.3",
47
+ "mockdate": "^3.0.2",
48
+ "node-sass": "^4.14.1",
49
+ "postcss-loader": "^3.0.0",
50
+ "preact": "^10.5.14",
51
+ "puppeteer": "^10.1.0",
52
+ "react": "^16.13.1",
53
+ "react-dom": "^16.13.1",
54
+ "react-is": "^16.13.1",
55
+ "react-test-renderer": "^16.13.1",
56
+ "regenerator-runtime": "^0.13.7",
57
+ "sass-loader": "^10.0.3",
58
+ "style-loader": "^1.1.3",
59
+ "ts-jest": "^26.4.1",
60
+ "ts-loader": "^8.0.4",
61
+ "typescript": "^3.9.7",
62
+ "webpack": "^4.44.2"
63
+ },
64
+ "dependencies": {
65
+ "@bloom-housing/backend-core": "2.0.0-pre-tailwind",
66
+ "@mapbox/mapbox-sdk": "^0.13.0",
67
+ "@types/body-scroll-lock": "^2.6.1",
68
+ "@types/jwt-decode": "^2.2.1",
69
+ "@types/markdown-to-jsx": "^6.11.2",
70
+ "@types/node": "^12.12.67",
71
+ "@types/node-polyglot": "^2.4.1",
72
+ "@types/react-beautiful-dnd": "^13.1.1",
73
+ "@types/react-dom": "^16.9.5",
74
+ "@types/react-text-mask": "^5.4.6",
75
+ "@types/react-transition-group": "^4.4.0",
76
+ "axios": "^0.21.1",
77
+ "body-scroll-lock": "^3.1.5",
78
+ "bulma": "^0.9.1",
79
+ "jwt-decode": "^2.2.0",
80
+ "markdown-to-jsx": "^6.11.4",
81
+ "moment": "^2.29.1",
82
+ "nanoid": "^3.1.12",
83
+ "react": "^16.13.1",
84
+ "react-accessible-accordion": "^3.3.3",
85
+ "react-beautiful-dnd": "^13.1.0",
86
+ "react-dom": "^16.13.1",
87
+ "react-dropzone": "^11.3.2",
88
+ "react-focus-lock": "^2.4.1",
89
+ "react-map-gl": "^6.1.16",
90
+ "react-media": "^1.10.0",
91
+ "react-tabs": "^3.2.2",
92
+ "react-text-mask": "^5.4.3",
93
+ "react-transition-group": "^4.4.1",
94
+ "tailwindcss": "^1.8.12",
95
+ "typesafe-actions": "^5.1.0"
96
+ },
97
+ "gitHead": "5f7694e3f2baff2a1a7a22e0676e487dda781a3e"
98
+ }