@12-apps/ui 1.4.1 → 1.5.1

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 (229) hide show
  1. package/package.json +17 -8
  2. package/src/button/index.ts +1 -0
  3. package/src/social-login-button/index.ts +1 -0
  4. package/src/{social-login-button.tsx → social-login-button/social-login-button.tsx} +5 -5
  5. package/src/user-avatar/index.ts +1 -0
  6. package/src/{user-avatar.tsx → user-avatar/user-avatar.tsx} +4 -4
  7. package/eslint.config.js +0 -77
  8. package/src/__tests__/data-grid.test.tsx +0 -125
  9. package/src/__tests__/package-wiring.test.ts +0 -41
  10. package/src/__tests__/setup.ts +0 -1
  11. package/src/__tests__/social-login-button.test.tsx +0 -186
  12. package/src/__tests__/user-avatar.test.tsx +0 -195
  13. package/src/__tests__/viewport.test.ts +0 -50
  14. package/src/components/command/__tests__/command.test.tsx +0 -112
  15. package/src/components/data-display/Alert/Alert.stories.tsx +0 -559
  16. package/src/components/data-display/Alert/Alert.test.stories.tsx +0 -707
  17. package/src/components/data-display/AlertDialog/AlertDialog.stories.tsx +0 -362
  18. package/src/components/data-display/AlertDialog/AlertDialog.test.stories.tsx +0 -753
  19. package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.stories.tsx +0 -230
  20. package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.test.stories.tsx +0 -270
  21. package/src/components/data-display/Avatar/Avatar.stories.tsx +0 -721
  22. package/src/components/data-display/Avatar/Avatar.test.stories.tsx +0 -822
  23. package/src/components/data-display/Badge/Badge.stories.tsx +0 -1134
  24. package/src/components/data-display/Badge/Badge.test.stories.tsx +0 -1194
  25. package/src/components/data-display/Banner/Banner.stories.tsx +0 -528
  26. package/src/components/data-display/Banner/Banner.test.stories.tsx +0 -503
  27. package/src/components/data-display/Carousel/Carousel.stories.tsx +0 -607
  28. package/src/components/data-display/Carousel/Carousel.test.stories.tsx +0 -691
  29. package/src/components/data-display/Chart/Chart.stories.tsx +0 -568
  30. package/src/components/data-display/Chart/Chart.test.stories.tsx +0 -174
  31. package/src/components/data-display/Chart/SpecChart.stories.tsx +0 -150
  32. package/src/components/data-display/Chart/SpecChart.test.stories.tsx +0 -56
  33. package/src/components/data-display/Chart/__tests__/SpecChart.test.tsx +0 -60
  34. package/src/components/data-display/Chart/__tests__/chart-format.test.ts +0 -43
  35. package/src/components/data-display/Chart/__tests__/chart-spec.test.ts +0 -119
  36. package/src/components/data-display/Chip/Chip.stories.tsx +0 -252
  37. package/src/components/data-display/Chip/Chip.test.stories.tsx +0 -266
  38. package/src/components/data-display/DataGrid/DataGrid.stories.tsx +0 -515
  39. package/src/components/data-display/DataGrid/DataGrid.test.stories.tsx +0 -653
  40. package/src/components/data-display/DataViews/__tests__/DataViewsGrid.test.tsx +0 -271
  41. package/src/components/data-display/DataViews/__tests__/DataViewsTableBase.test.tsx +0 -134
  42. package/src/components/data-display/DataViews/__tests__/SaveViewModal.test.tsx +0 -83
  43. package/src/components/data-display/DataViews/__tests__/data-views-filter.test.ts +0 -115
  44. package/src/components/data-display/DataViews/__tests__/data-views-preview.test.ts +0 -53
  45. package/src/components/data-display/DataViews/__tests__/range-pill.test.tsx +0 -114
  46. package/src/components/data-display/DataViews/base-card.stories.tsx +0 -136
  47. package/src/components/data-display/DescriptionItem/DescriptionItem.stories.tsx +0 -254
  48. package/src/components/data-display/EmptyState/EmptyState.stories.tsx +0 -282
  49. package/src/components/data-display/EmptyState/EmptyState.test.stories.tsx +0 -441
  50. package/src/components/data-display/ErrorState/ErrorState.stories.tsx +0 -110
  51. package/src/components/data-display/ErrorState/ErrorState.test.stories.tsx +0 -133
  52. package/src/components/data-display/HoverCard/HoverCard.stories.tsx +0 -650
  53. package/src/components/data-display/HoverCard/HoverCard.test.stories.tsx +0 -929
  54. package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.stories.tsx +0 -411
  55. package/src/components/data-display/LazyImage/LazyImage.stories.tsx +0 -387
  56. package/src/components/data-display/Lightbox/Lightbox.stories.tsx +0 -315
  57. package/src/components/data-display/Lightbox/Lightbox.test.stories.tsx +0 -598
  58. package/src/components/data-display/LoadingState/LoadingState.stories.tsx +0 -124
  59. package/src/components/data-display/LoadingState/LoadingState.test.stories.tsx +0 -99
  60. package/src/components/data-display/MapPreview/MapPreview.stories.tsx +0 -458
  61. package/src/components/data-display/MapPreview/MapPreview.test.stories.tsx +0 -394
  62. package/src/components/data-display/Popover/Popover.stories.tsx +0 -295
  63. package/src/components/data-display/Popover/Popover.test.stories.tsx +0 -1162
  64. package/src/components/data-display/Progress/Progress.stories.tsx +0 -481
  65. package/src/components/data-display/Progress/Progress.test.stories.tsx +0 -2070
  66. package/src/components/data-display/SectionOnboarding/SectionOnboarding.stories.tsx +0 -160
  67. package/src/components/data-display/SectionOnboarding/SectionOnboarding.test.stories.tsx +0 -190
  68. package/src/components/data-display/Sheet/Sheet.stories.tsx +0 -883
  69. package/src/components/data-display/Sheet/Sheet.test.stories.tsx +0 -1101
  70. package/src/components/data-display/StatCard/StatCard.stories.tsx +0 -167
  71. package/src/components/data-display/StatCard/StatCard.test.stories.tsx +0 -240
  72. package/src/components/data-display/Stepper/Stepper.stories.tsx +0 -540
  73. package/src/components/data-display/Stepper/Stepper.test.stories.tsx +0 -600
  74. package/src/components/data-display/Table/Table.stories.tsx +0 -803
  75. package/src/components/data-display/Table/Table.test.stories.tsx +0 -369
  76. package/src/components/data-display/Timeline/Timeline.stories.tsx +0 -442
  77. package/src/components/data-display/Timeline/Timeline.test.stories.tsx +0 -930
  78. package/src/components/data-display/TimingDiagram/TimingDiagram.stories.tsx +0 -475
  79. package/src/components/data-display/TimingDiagram/TimingDiagram.test.stories.tsx +0 -734
  80. package/src/components/data-display/Tooltip/Tooltip.stories.tsx +0 -468
  81. package/src/components/data-display/Tooltip/Tooltip.test.stories.tsx +0 -1154
  82. package/src/components/feedback/ConfirmAction/ConfirmAction.stories.tsx +0 -146
  83. package/src/components/feedback/ConfirmAction/ConfirmAction.test.stories.tsx +0 -114
  84. package/src/components/feedback/ConfirmAction/__tests__/confirm-action.test.tsx +0 -288
  85. package/src/components/feedback/Dialog/Dialog.stories.tsx +0 -833
  86. package/src/components/feedback/Dialog/Dialog.test.stories.tsx +0 -955
  87. package/src/components/feedback/Dialog/__tests__/dialog-content-spacing.test.tsx +0 -66
  88. package/src/components/feedback/Modal/Modal.stories.tsx +0 -765
  89. package/src/components/feedback/Modal/Modal.test.stories.tsx +0 -251
  90. package/src/components/feedback/Sonner/Sonner.stories.tsx +0 -698
  91. package/src/components/feedback/Sonner/Sonner.test.stories.tsx +0 -896
  92. package/src/components/feedback/StackedModal/StackedModal.stories.tsx +0 -1783
  93. package/src/components/feedback/StackedModal/StackedModal.test.stories.tsx +0 -975
  94. package/src/components/feedback/StackedModal/__tests__/stacked-modal-viewport.test.tsx +0 -104
  95. package/src/components/feedback/Toast/Toast.stories.tsx +0 -548
  96. package/src/components/feedback/Toast/Toast.test.stories.tsx +0 -834
  97. package/src/components/feedback/TutorialOverlay/TutorialOverlay.stories.tsx +0 -691
  98. package/src/components/feedback/TutorialOverlay/TutorialOverlay.test.stories.tsx +0 -634
  99. package/src/components/form/AddressAutocomplete/AddressAutocomplete.stories.tsx +0 -665
  100. package/src/components/form/AddressAutocomplete/AddressAutocomplete.test.stories.tsx +0 -727
  101. package/src/components/form/Autocomplete/Autocomplete.stories.tsx +0 -715
  102. package/src/components/form/Autocomplete/Autocomplete.test.stories.tsx +0 -825
  103. package/src/components/form/Button/Button.stories.tsx +0 -365
  104. package/src/components/form/Button/Button.test.stories.tsx +0 -607
  105. package/src/components/form/Calendar/Calendar.stories.tsx +0 -349
  106. package/src/components/form/Calendar/Calendar.test.stories.tsx +0 -464
  107. package/src/components/form/CepField/CepField.stories.tsx +0 -138
  108. package/src/components/form/CepField/CepField.test.stories.tsx +0 -281
  109. package/src/components/form/Checkbox/Checkbox.stories.tsx +0 -265
  110. package/src/components/form/Checkbox/Checkbox.test.stories.tsx +0 -181
  111. package/src/components/form/CodeEditor/CodeEditor.stories.tsx +0 -871
  112. package/src/components/form/CodeEditor/CodeEditor.test.stories.tsx +0 -574
  113. package/src/components/form/Command/Command.stories.tsx +0 -580
  114. package/src/components/form/Command/Command.test.stories.tsx +0 -215
  115. package/src/components/form/CreatableSelect/CreatableSelect.stories.tsx +0 -112
  116. package/src/components/form/CreatableSelect/CreatableSelect.test.stories.tsx +0 -134
  117. package/src/components/form/Form/Form.stories.tsx +0 -687
  118. package/src/components/form/Form/Form.test.stories.tsx +0 -601
  119. package/src/components/form/Input/Input.stories.tsx +0 -260
  120. package/src/components/form/Input/Input.test.stories.tsx +0 -1191
  121. package/src/components/form/InputOTP/InputOTP.stories.tsx +0 -774
  122. package/src/components/form/InputOTP/InputOTP.test.stories.tsx +0 -588
  123. package/src/components/form/Label/Label.stories.tsx +0 -473
  124. package/src/components/form/Label/Label.test.stories.tsx +0 -909
  125. package/src/components/form/Menubar/Menubar.stories.tsx +0 -472
  126. package/src/components/form/Menubar/Menubar.test.stories.tsx +0 -584
  127. package/src/components/form/PasswordStrength/PasswordStrength.stories.tsx +0 -562
  128. package/src/components/form/PasswordStrength/PasswordStrength.test.stories.tsx +0 -327
  129. package/src/components/form/PhoneInput/PhoneInput.stories.tsx +0 -495
  130. package/src/components/form/PhoneInput/PhoneInput.test.stories.tsx +0 -666
  131. package/src/components/form/RadioGroup/RadioGroup.stories.tsx +0 -518
  132. package/src/components/form/RadioGroup/RadioGroup.test.stories.tsx +0 -685
  133. package/src/components/form/RichTextEditor/RichTextEditor.stories.tsx +0 -261
  134. package/src/components/form/RichTextEditor/RichTextEditor.test.stories.tsx +0 -491
  135. package/src/components/form/SearchPalette/SearchPalette.stories.tsx +0 -135
  136. package/src/components/form/Select/Select.stories.tsx +0 -364
  137. package/src/components/form/Select/Select.test.stories.tsx +0 -985
  138. package/src/components/form/Slider/Slider.stories.tsx +0 -418
  139. package/src/components/form/Slider/Slider.test.stories.tsx +0 -1042
  140. package/src/components/form/Switch/Switch.stories.tsx +0 -697
  141. package/src/components/form/Switch/Switch.test.stories.tsx +0 -597
  142. package/src/components/form/Textarea/Textarea.stories.tsx +0 -473
  143. package/src/components/form/Textarea/Textarea.test.stories.tsx +0 -702
  144. package/src/components/form/Toggle/Toggle.stories.tsx +0 -638
  145. package/src/components/form/Toggle/Toggle.test.stories.tsx +0 -1159
  146. package/src/components/form/ToggleGroup/ToggleGroup.stories.tsx +0 -617
  147. package/src/components/form/ToggleGroup/ToggleGroup.test.stories.tsx +0 -918
  148. package/src/components/form/UploadButton/UploadButton.stories.tsx +0 -367
  149. package/src/components/form/UploadButton/UploadButton.test.stories.tsx +0 -573
  150. package/src/components/form/total-form/total-form.test.tsx +0 -214
  151. package/src/components/layout/Accordion/Accordion.stories.tsx +0 -694
  152. package/src/components/layout/Accordion/Accordion.test.stories.tsx +0 -1344
  153. package/src/components/layout/Card/Card.stories.tsx +0 -591
  154. package/src/components/layout/Card/Card.test.stories.tsx +0 -1134
  155. package/src/components/layout/CardGrid/__tests__/CardGrid.test.tsx +0 -92
  156. package/src/components/layout/Collapsible/Collapsible.stories.tsx +0 -180
  157. package/src/components/layout/Collapsible/Collapsible.test.stories.tsx +0 -308
  158. package/src/components/layout/Container/Container.stories.tsx +0 -557
  159. package/src/components/layout/Container/Container.test.stories.tsx +0 -745
  160. package/src/components/layout/ContentToolbar/ContentToolbar.stories.tsx +0 -129
  161. package/src/components/layout/ContentToolbar/ContentToolbar.test.stories.tsx +0 -251
  162. package/src/components/layout/ContentToolbar/__tests__/ColumnsMenu.test.tsx +0 -39
  163. package/src/components/layout/ContentToolbar/__tests__/MultiSelectDropdown.test.tsx +0 -131
  164. package/src/components/layout/ContentToolbar/__tests__/SavedViewsMenu.test.tsx +0 -99
  165. package/src/components/layout/Dashboard/Dashboard.stories.tsx +0 -104
  166. package/src/components/layout/Dashboard/Dashboard.test.stories.tsx +0 -190
  167. package/src/components/layout/Drawer/Drawer.stories.tsx +0 -658
  168. package/src/components/layout/Drawer/Drawer.test.stories.tsx +0 -1343
  169. package/src/components/layout/Resizable/Resizable.stories.tsx +0 -1039
  170. package/src/components/layout/Resizable/Resizable.test.stories.tsx +0 -750
  171. package/src/components/layout/ScrollArea/ScrollArea.stories.tsx +0 -651
  172. package/src/components/layout/ScrollArea/ScrollArea.test.stories.tsx +0 -619
  173. package/src/components/layout/Separator/Separator.stories.tsx +0 -563
  174. package/src/components/layout/Separator/Separator.test.stories.tsx +0 -518
  175. package/src/components/layout/SettingsLayout/SettingsLayout.stories.tsx +0 -192
  176. package/src/components/layout/SettingsLayout/SettingsLayout.test.stories.tsx +0 -175
  177. package/src/components/layout/Sidebar/Sidebar.stories.tsx +0 -609
  178. package/src/components/layout/Sidebar/Sidebar.test.stories.tsx +0 -1324
  179. package/src/components/layout/Skeleton/Skeleton.stories.tsx +0 -689
  180. package/src/components/layout/Skeleton/Skeleton.test.stories.tsx +0 -521
  181. package/src/components/layout/Spacer/Spacer.stories.tsx +0 -502
  182. package/src/components/layout/Spacer/Spacer.test.stories.tsx +0 -472
  183. package/src/components/layout/TableFilter/TableFilter.stories.tsx +0 -82
  184. package/src/components/layout/TableFilter/TableFilter.test.stories.tsx +0 -87
  185. package/src/components/navigation/Breadcrumbs/Breadcrumbs.stories.tsx +0 -638
  186. package/src/components/navigation/Breadcrumbs/Breadcrumbs.test.stories.tsx +0 -1008
  187. package/src/components/navigation/CommandPalette/CommandPalette.stories.tsx +0 -386
  188. package/src/components/navigation/CommandPalette/CommandPalette.test.stories.tsx +0 -435
  189. package/src/components/navigation/ContextMenu/ContextMenu.stories.tsx +0 -614
  190. package/src/components/navigation/ContextMenu/ContextMenu.test.stories.tsx +0 -845
  191. package/src/components/navigation/DropdownMenu/DropdownMenu.stories.tsx +0 -578
  192. package/src/components/navigation/DropdownMenu/DropdownMenu.test.stories.tsx +0 -660
  193. package/src/components/navigation/NavigationMenu/stories/NavigationMenu.stories.tsx +0 -516
  194. package/src/components/navigation/NavigationMenu/stories/NavigationMenu.test.stories.tsx +0 -935
  195. package/src/components/navigation/NavigationMenu/stories/NavigationMenuHorizontal.stories.tsx +0 -501
  196. package/src/components/navigation/NavigationMenu/stories/NavigationMenuVertical.stories.tsx +0 -453
  197. package/src/components/navigation/Pagination/Pagination.stories.tsx +0 -602
  198. package/src/components/navigation/Pagination/Pagination.test.stories.tsx +0 -520
  199. package/src/components/navigation/Tabs/Tabs.stories.tsx +0 -1004
  200. package/src/components/navigation/Tabs/Tabs.test.stories.tsx +0 -1225
  201. package/src/components/typography/Blockquote/Blockquote.stories.tsx +0 -359
  202. package/src/components/typography/Blockquote/Blockquote.test.stories.tsx +0 -432
  203. package/src/components/typography/Code/Code.stories.tsx +0 -686
  204. package/src/components/typography/Code/Code.test.stories.tsx +0 -703
  205. package/src/components/typography/Heading/Heading.stories.tsx +0 -451
  206. package/src/components/typography/Heading/Heading.test.stories.tsx +0 -830
  207. package/src/components/typography/Paragraph/Paragraph.stories.tsx +0 -280
  208. package/src/components/typography/Paragraph/Paragraph.test.stories.tsx +0 -231
  209. package/src/components/typography/Text/Text.stories.tsx +0 -359
  210. package/src/components/typography/Text/Text.test.stories.tsx +0 -762
  211. package/src/components/utility/AnimatedIcon/AnimatedIcon.stories.tsx +0 -945
  212. package/src/components/utility/AnimatedIcon/AnimatedIcon.test.stories.tsx +0 -603
  213. package/src/components/utility/AspectRatio/AspectRatio.stories.tsx +0 -414
  214. package/src/components/utility/AspectRatio/AspectRatio.test.stories.tsx +0 -859
  215. package/src/components/utility/InfiniteScroll/InfiniteScroll.stories.tsx +0 -620
  216. package/src/components/utility/InfiniteScroll/InfiniteScroll.test.stories.tsx +0 -361
  217. package/src/components/utility/InstallPrompt/InstallPrompt.stories.tsx +0 -118
  218. package/src/components/utility/InstallPrompt/InstallPrompt.test.stories.tsx +0 -83
  219. package/src/components/utility/InstallPrompt/__tests__/InstallPrompt.ios.test.tsx +0 -65
  220. package/src/components/utility/InstallPrompt/__tests__/usePwaInstall.test.tsx +0 -271
  221. package/src/components/utility/Portal/Portal.stories.tsx +0 -340
  222. package/src/components/utility/Portal/Portal.test.stories.tsx +0 -2086
  223. package/src/components/utility/Transition/Transition.stories.tsx +0 -493
  224. package/src/components/utility/Transition/Transition.test.stories.tsx +0 -854
  225. package/src/components/utility/VirtualList/VirtualList.stories.tsx +0 -1073
  226. package/src/components/utility/VirtualList/VirtualList.test.stories.tsx +0 -1085
  227. package/src/components/utility/WorkflowStep/WorkflowStep.stories.tsx +0 -431
  228. package/src/components/utility/WorkflowStep/WorkflowStep.test.stories.tsx +0 -364
  229. /package/src/{button.tsx → button/button.tsx} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@12-apps/ui",
3
- "version": "1.4.1",
3
+ "version": "1.5.1",
4
4
  "license": "MIT",
5
5
  "packageManager": "pnpm@9.0.0",
6
6
  "type": "module",
@@ -15,10 +15,10 @@
15
15
  "types": "./dist/index.d.ts",
16
16
  "exports": {
17
17
  ".": "./src/index.ts",
18
- "./button": "./src/button.tsx",
18
+ "./button": "./src/button/index.ts",
19
19
  "./charts": "./src/charts/index.ts",
20
- "./social-login-button": "./src/social-login-button.tsx",
21
- "./user-avatar": "./src/user-avatar.tsx",
20
+ "./social-login-button": "./src/social-login-button/index.ts",
21
+ "./user-avatar": "./src/user-avatar/index.ts",
22
22
  "./utils": "./src/utils/index.ts",
23
23
  "./mui/Box": "./src/mui/Box.ts",
24
24
  "./mui/Link": "./src/mui/Link.ts",
@@ -194,7 +194,7 @@
194
194
  "react-dom": "^18.0.0 || ^19.0.0"
195
195
  },
196
196
  "dependencies": {
197
- "@12-apps/forms-core": "^1.3.1",
197
+ "@12-apps/forms-core": "^1.4.1",
198
198
  "@emotion/react": "^11.14.0",
199
199
  "@emotion/styled": "^11.14.0",
200
200
  "@monaco-editor/react": "^4.7.0",
@@ -209,8 +209,8 @@
209
209
  "recharts": "^3.5.1"
210
210
  },
211
211
  "devDependencies": {
212
- "@12-apps/eslint-config": "^1.4.1",
213
- "@12-apps/typescript-config": "^1.4.1",
212
+ "@12-apps/eslint-config": "^1.5.1",
213
+ "@12-apps/typescript-config": "^1.5.1",
214
214
  "@playwright/test": "^1.55.0",
215
215
  "@storybook/addon-docs": "^9.1.10",
216
216
  "@storybook/addon-links": "^9.1.10",
@@ -226,6 +226,7 @@
226
226
  "concurrently": "^9.2.1",
227
227
  "eslint-import-resolver-typescript": "^4.4.4",
228
228
  "eslint-plugin-storybook": "9.1.10",
229
+ "eslint-plugin-test-flakiness": "^1.4.0",
229
230
  "glob": "^13.0.0",
230
231
  "globals": "^16.5.0",
231
232
  "http-server": "^14.1.1",
@@ -257,6 +258,14 @@
257
258
  "prisma",
258
259
  "*.js",
259
260
  "*.mjs",
260
- "*.md"
261
+ "*.md",
262
+ "!eslint.config.js",
263
+ "!**/__tests__/**",
264
+ "!**/tests/**",
265
+ "!**/*.test.*",
266
+ "!**/*.spec.*",
267
+ "!**/*.stories.*",
268
+ "!**/*.test-story.*",
269
+ "!**/test-helpers.*"
261
270
  ]
262
271
  }
@@ -0,0 +1 @@
1
+ export * from './button';
@@ -0,0 +1 @@
1
+ export * from './social-login-button';
@@ -2,11 +2,11 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import { Box, Stack } from '@mui/material';
5
- import { Button } from './components/form/Button';
6
- import { Card, CardContent } from './components/layout/Card';
7
- import { Heading } from './components/typography/Heading';
8
- import { Text } from './components/typography/Text';
9
- import { Separator } from './components/layout/Separator';
5
+ import { Button } from '../components/form/Button';
6
+ import { Card, CardContent } from '../components/layout/Card';
7
+ import { Heading } from '../components/typography/Heading';
8
+ import { Text } from '../components/typography/Text';
9
+ import { Separator } from '../components/layout/Separator';
10
10
 
11
11
  export type SocialProvider = 'google' | 'facebook' | 'apple';
12
12
 
@@ -0,0 +1 @@
1
+ export * from './user-avatar';
@@ -2,10 +2,10 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import { Box, Stack } from '@mui/material';
5
- import { Avatar } from './components/data-display/Avatar';
6
- import { Button } from './components/form/Button';
7
- import { Text } from './components/typography/Text';
8
- import { Card } from './components/layout/Card';
5
+ import { Avatar } from '../components/data-display/Avatar';
6
+ import { Button } from '../components/form/Button';
7
+ import { Text } from '../components/typography/Text';
8
+ import { Card } from '../components/layout/Card';
9
9
 
10
10
  /**
11
11
  * Generate initials from a name
package/eslint.config.js DELETED
@@ -1,77 +0,0 @@
1
- // For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2
- import tsParser from '@typescript-eslint/parser';
3
- import storybook from "eslint-plugin-storybook";
4
- import globals from 'globals';
5
-
6
- import { config } from "@12-apps/eslint-config/base";
7
-
8
- export default [
9
- {
10
- ignores: [
11
- 'packages/ui/scripts/check-component.js',
12
- 'packages/ui/tsup.config.ts',
13
- 'node_modules/**',
14
- 'dist/**',
15
- 'build/**',
16
- 'storybook-static/**',
17
- 'packages/ui/scripts/**',
18
- 'packages/ui/scripts/**/*',
19
- 'scripts/**',
20
- 'scripts/**/*',
21
- 'tsup.config.ts',
22
- ],
23
- },
24
- ...config,
25
- ...storybook.configs["flat/recommended"],
26
- // Override parser for all TypeScript files after storybook config
27
- {
28
- files: ['**/*.ts', '**/*.tsx'],
29
- languageOptions: {
30
- parser: tsParser,
31
- ecmaVersion: 'latest',
32
- sourceType: 'module',
33
- parserOptions: {
34
- ecmaVersion: 'latest',
35
- sourceType: 'module',
36
- ecmaFeatures: {
37
- jsx: true,
38
- },
39
- },
40
- globals: {
41
- ...globals.browser,
42
- ...globals.es2021,
43
- React: 'readonly',
44
- google: 'readonly',
45
- // Node-specific globals needed for build tools
46
- process: 'readonly',
47
- __dirname: 'readonly',
48
- __filename: 'readonly',
49
- module: 'readonly',
50
- },
51
- },
52
- rules: {
53
- // Use TypeScript's unused vars instead of base rule
54
- 'no-unused-vars': 'off',
55
- },
56
- },
57
- // UI-specific rules
58
- {
59
- files: ['**/*.{js,jsx,ts,tsx}'],
60
- rules: {
61
- 'no-console': 'error',
62
- 'react/prop-types': 'off',
63
- 'react/no-unescaped-entities': 'off',
64
- // Turbo env vars not relevant for UI lib
65
- 'turbo/no-undeclared-env-vars': 'off',
66
- // Allow underscore-prefixed unused vars (intentionally unused params)
67
- '@typescript-eslint/no-unused-vars': ['warn', {
68
- argsIgnorePattern: '^_',
69
- varsIgnorePattern: '^_',
70
- caughtErrorsIgnorePattern: '^_',
71
- }],
72
- },
73
- settings: {
74
- 'import/resolver': { typescript: { project: './tsconfig.json' } },
75
- },
76
- },
77
- ];
@@ -1,125 +0,0 @@
1
- /**
2
- * `DataGrid` — the identity of the grid element, in every state it can paint.
3
- *
4
- * The regression this file exists for: `data-testid` is destructured out of the
5
- * props, and used to be re-applied ONLY on the populated render. A grid whose
6
- * first paint was loading, error or empty therefore had no test id at all — it
7
- * had mounted perfectly and could not be found, so every spec landing on a
8
- * screen with no rows yet waited out its whole budget on an element that would
9
- * appear only once somebody created a row.
10
- *
11
- * Each case asserts the id AND the state flag, because the id alone would pass
12
- * with all four states collapsed into one.
13
- */
14
- import { render, screen } from '@testing-library/react';
15
- import { describe, expect, it } from 'vitest';
16
-
17
- import { DataGrid } from '../components/data-display/DataGrid';
18
- import type { GridColumn } from '../components/data-display/DataGrid/DataGrid.types';
19
-
20
- interface Row extends Record<string, unknown> {
21
- id: string;
22
- name: string;
23
- qty: number;
24
- }
25
-
26
- const columns: GridColumn<Row>[] = [
27
- { id: 'name', header: 'Nome' },
28
- { id: 'qty', header: 'Qtd' },
29
- ];
30
-
31
- const rows: Row[] = [
32
- { id: 'a', name: 'Alface', qty: 3 },
33
- { id: 'b', name: 'Beterraba', qty: 1 },
34
- ];
35
-
36
- describe('DataGrid — the grid is findable in every state', () => {
37
- it('names the grid while it is LOADING', () => {
38
- render(<DataGrid data-testid="things-grid" rows={[]} columns={columns} loading />);
39
- const grid = screen.getByTestId('things-grid');
40
- expect(grid).toHaveAttribute('data-loading', 'true');
41
- // Still announced as a grid, so assistive tech is not told the region
42
- // vanished and came back.
43
- expect(grid).toHaveAttribute('role', 'grid');
44
- });
45
-
46
- it('names the grid while it is showing an ERROR', () => {
47
- render(
48
- <DataGrid data-testid="things-grid" rows={rows} columns={columns} error="Deu ruim" />,
49
- );
50
- const grid = screen.getByTestId('things-grid');
51
- expect(grid).toHaveAttribute('data-error', 'true');
52
- expect(grid).toHaveTextContent('Deu ruim');
53
- });
54
-
55
- it('names the grid while it is EMPTY — the case every spec tripped over', () => {
56
- render(<DataGrid data-testid="things-grid" rows={[]} columns={columns} />);
57
- const grid = screen.getByTestId('things-grid');
58
- expect(grid).toHaveAttribute('data-empty', 'true');
59
- expect(grid).toHaveTextContent('No data available');
60
- });
61
-
62
- it('renders the caller’s own empty state inside that same named grid', () => {
63
- render(
64
- <DataGrid
65
- data-testid="things-grid"
66
- rows={[]}
67
- columns={columns}
68
- emptyState={<span>Nada por aqui</span>}
69
- />,
70
- );
71
- expect(screen.getByTestId('things-grid')).toHaveTextContent('Nada por aqui');
72
- });
73
-
74
- it('names the grid once it HAS rows, and renders them', () => {
75
- render(<DataGrid data-testid="things-grid" rows={rows} columns={columns} />);
76
- const grid = screen.getByTestId('things-grid');
77
- // The populated render is the one that always worked; it is asserted so the
78
- // four cases above cannot all pass by the id being applied unconditionally
79
- // to a single collapsed placeholder.
80
- expect(grid).toHaveAttribute('data-ui', 'datagrid');
81
- expect(grid).not.toHaveAttribute('data-empty');
82
- expect(screen.getByText('Alface')).toBeInTheDocument();
83
- expect(screen.getByText('Beterraba')).toBeInTheDocument();
84
- });
85
-
86
- it('keeps grid-only props off the DOM element', () => {
87
- render(<DataGrid data-testid="things-grid" rows={rows} columns={columns} />);
88
- const grid = screen.getByTestId('things-grid');
89
- // `DataGridProps` extends HTMLAttributes, so the rest-spread would otherwise
90
- // serialize the whole dataset into an attribute.
91
- expect(grid).not.toHaveAttribute('rows');
92
- expect(grid).not.toHaveAttribute('columns');
93
- });
94
- });
95
-
96
- describe('DataGrid — client-mode rows', () => {
97
- it('sorts on a header press when sorting is client-mode', () => {
98
- render(
99
- <DataGrid
100
- data-testid="things-grid"
101
- rows={rows}
102
- columns={columns}
103
- sorting={{ mode: 'client', defaultSortBy: [{ id: 'name', dir: 'desc' }] }}
104
- />,
105
- );
106
- const cells = screen.getAllByRole('gridcell').map((cell) => cell.textContent);
107
- // Descending by name: Beterraba before Alface. A comparator that stringified
108
- // its way to a stable-but-wrong order would fail here.
109
- expect(cells[0]).toBe('Beterraba');
110
- });
111
-
112
- it('filters client-side and falls through to the empty state when nothing matches', () => {
113
- render(
114
- <DataGrid
115
- data-testid="things-grid"
116
- rows={rows}
117
- columns={columns}
118
- filtering={{ mode: 'client', defaultFilters: [{ id: 'name', value: 'zzz' }] }}
119
- />,
120
- );
121
- // The filter emptied the grid — and the grid is STILL findable, which is the
122
- // whole point: an empty result is a state, not a disappearance.
123
- expect(screen.getByTestId('things-grid')).toHaveAttribute('data-empty', 'true');
124
- });
125
- });
@@ -1,41 +0,0 @@
1
- import { createRequire } from "node:module";
2
- import { describe, expect, it } from "vitest";
3
-
4
- // Load the package's OWN manifest via require (no fs.readFileSync — so this
5
- // asserts real dependency wiring without tripping the anti-flake fs rule; the
6
- // manifest is a deterministic, package-local file).
7
- const requireJson = createRequire(import.meta.url);
8
-
9
- interface UiPackageJson {
10
- dependencies?: Record<string, string>;
11
- exports?: Record<string, unknown>;
12
- typesVersions?: Record<string, Record<string, string[]>>;
13
- }
14
-
15
- function readPkg(): UiPackageJson {
16
- return requireJson("../../package.json") as UiPackageJson;
17
- }
18
-
19
- describe("@12-apps/ui package wiring (Task 5)", () => {
20
- it("depends on the leaf @12-apps/forms-core, not the heavy @12-apps/shared-helpers", () => {
21
- const pkg = readPkg();
22
- // @12-apps/ui must stay self-contained: it uses the zero-dependency
23
- // @12-apps/forms-core for form validation and must NOT pull in the
24
- // Prisma/AWS-laden @12-apps/shared-helpers.
25
- expect(pkg.dependencies?.["@12-apps/forms-core"]).toBe("workspace:*");
26
- expect(pkg.dependencies?.["@12-apps/shared-helpers"]).toBeUndefined();
27
- });
28
-
29
- it("exposes the ./form/total-form package export", () => {
30
- const pkg = readPkg();
31
- expect(pkg.exports?.["./form/total-form"]).toBe(
32
- "./src/components/form/total-form/index.ts",
33
- );
34
- });
35
-
36
- it("registers a form/* typesVersions entry covering total-form", () => {
37
- const pkg = readPkg();
38
- const formTypes = pkg.typesVersions?.["*"]?.["form/*"];
39
- expect(formTypes).toContain("./src/components/form/*/index.d.ts");
40
- });
41
- });
@@ -1 +0,0 @@
1
- import "@testing-library/jest-dom/vitest";
@@ -1,186 +0,0 @@
1
- import { describe, it, expect, vi } from "vitest";
2
- import { render, screen, fireEvent, waitFor } from "@testing-library/react";
3
- import {
4
- SocialLoginButton,
5
- SocialLoginContainer,
6
- type SocialProvider,
7
- } from "../social-login-button";
8
-
9
- describe("SocialLoginButton", () => {
10
- const providers: SocialProvider[] = ["google", "facebook", "apple"];
11
-
12
- describe.each(providers)("%s provider", (provider) => {
13
- it(`should render ${provider} button with correct text`, () => {
14
- render(<SocialLoginButton provider={provider} />);
15
-
16
- const expectedTexts: Record<SocialProvider, string> = {
17
- google: "Continue with Google",
18
- facebook: "Continue with Facebook",
19
- apple: "Continue with Apple",
20
- };
21
-
22
- expect(screen.getByText(expectedTexts[provider])).toBeInTheDocument();
23
- });
24
-
25
- it(`should call onClick when ${provider} button is clicked`, () => {
26
- const handleClick = vi.fn();
27
- render(<SocialLoginButton provider={provider} onClick={handleClick} />);
28
-
29
- const button = screen.getByRole("button");
30
- fireEvent.click(button);
31
-
32
- expect(handleClick).toHaveBeenCalledTimes(1);
33
- });
34
-
35
- it(`should show loading state for ${provider}`, () => {
36
- const { container } = render(<SocialLoginButton provider={provider} loading />);
37
-
38
- // When loading, Button shows CircularProgress spinner
39
- expect(container.querySelector('.MuiCircularProgress-root')).toBeInTheDocument();
40
- });
41
-
42
- it(`should be disabled when loading for ${provider}`, () => {
43
- render(<SocialLoginButton provider={provider} loading />);
44
-
45
- const button = screen.getByRole("button");
46
- expect(button).toBeDisabled();
47
- });
48
-
49
- it(`should be disabled when disabled prop is true for ${provider}`, () => {
50
- render(<SocialLoginButton provider={provider} disabled />);
51
-
52
- const button = screen.getByRole("button");
53
- expect(button).toBeDisabled();
54
- });
55
- });
56
-
57
- it("should apply fullWidth style by default", () => {
58
- render(<SocialLoginButton provider="google" />);
59
-
60
- const button = screen.getByRole("button");
61
- // MUI Button with fullWidth prop applies width: 100%
62
- expect(button).toHaveClass('MuiButton-fullWidth');
63
- });
64
-
65
- it("should not have fullWidth class when fullWidth is false", () => {
66
- render(<SocialLoginButton provider="google" fullWidth={false} />);
67
-
68
- const button = screen.getByRole("button");
69
- expect(button).not.toHaveClass('MuiButton-fullWidth');
70
- });
71
-
72
- it("should not call onClick when disabled", () => {
73
- const handleClick = vi.fn();
74
- render(
75
- <SocialLoginButton provider="google" onClick={handleClick} disabled />
76
- );
77
-
78
- const button = screen.getByRole("button");
79
- fireEvent.click(button);
80
-
81
- expect(handleClick).not.toHaveBeenCalled();
82
- });
83
-
84
- it("should render correct SVG icon for each provider", () => {
85
- const { container: googleContainer } = render(
86
- <SocialLoginButton provider="google" />
87
- );
88
- expect(googleContainer.querySelector("svg")).toBeInTheDocument();
89
-
90
- const { container: facebookContainer } = render(
91
- <SocialLoginButton provider="facebook" />
92
- );
93
- expect(facebookContainer.querySelector("svg")).toBeInTheDocument();
94
-
95
- const { container: appleContainer } = render(
96
- <SocialLoginButton provider="apple" />
97
- );
98
- expect(appleContainer.querySelector("svg")).toBeInTheDocument();
99
- });
100
- });
101
-
102
- describe("SocialLoginContainer", () => {
103
- it("should render children", () => {
104
- render(
105
- <SocialLoginContainer>
106
- <span>Child content</span>
107
- </SocialLoginContainer>
108
- );
109
-
110
- expect(screen.getByText("Child content")).toBeInTheDocument();
111
- });
112
-
113
- it("should render default title", () => {
114
- render(
115
- <SocialLoginContainer>
116
- <span>Content</span>
117
- </SocialLoginContainer>
118
- );
119
-
120
- expect(screen.getByText("Sign in to continue")).toBeInTheDocument();
121
- });
122
-
123
- it("should render custom title", () => {
124
- render(
125
- <SocialLoginContainer title="Welcome Back">
126
- <span>Content</span>
127
- </SocialLoginContainer>
128
- );
129
-
130
- expect(screen.getByText("Welcome Back")).toBeInTheDocument();
131
- });
132
-
133
- it("should not render title when title is empty", async () => {
134
- render(
135
- <SocialLoginContainer title="">
136
- <span>Content</span>
137
- </SocialLoginContainer>
138
- );
139
-
140
- await waitFor(() => expect(screen.queryByRole("heading")).not.toBeInTheDocument());
141
- });
142
-
143
- it("should render divider when showDivider is true", () => {
144
- render(
145
- <SocialLoginContainer showDivider>
146
- <span>Content</span>
147
- </SocialLoginContainer>
148
- );
149
-
150
- expect(screen.getByText("or")).toBeInTheDocument();
151
- });
152
-
153
- it("should not render divider by default", async () => {
154
- render(
155
- <SocialLoginContainer>
156
- <span>Content</span>
157
- </SocialLoginContainer>
158
- );
159
-
160
- await waitFor(() => expect(screen.queryByText("or")).not.toBeInTheDocument());
161
- });
162
-
163
- it("should render custom divider text", () => {
164
- render(
165
- <SocialLoginContainer showDivider dividerText="or continue with email">
166
- <span>Content</span>
167
- </SocialLoginContainer>
168
- );
169
-
170
- expect(screen.getByText("or continue with email")).toBeInTheDocument();
171
- });
172
-
173
- it("should render multiple buttons", () => {
174
- render(
175
- <SocialLoginContainer>
176
- <SocialLoginButton provider="google" />
177
- <SocialLoginButton provider="facebook" />
178
- <SocialLoginButton provider="apple" />
179
- </SocialLoginContainer>
180
- );
181
-
182
- expect(screen.getByText("Continue with Google")).toBeInTheDocument();
183
- expect(screen.getByText("Continue with Facebook")).toBeInTheDocument();
184
- expect(screen.getByText("Continue with Apple")).toBeInTheDocument();
185
- });
186
- });