@12-apps/ui 1.5.0 → 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.
- package/package.json +16 -8
- package/src/button/index.ts +1 -0
- package/src/social-login-button/index.ts +1 -0
- package/src/{social-login-button.tsx → social-login-button/social-login-button.tsx} +5 -5
- package/src/user-avatar/index.ts +1 -0
- package/src/{user-avatar.tsx → user-avatar/user-avatar.tsx} +4 -4
- package/eslint.config.js +0 -89
- package/src/__tests__/data-grid.test.tsx +0 -125
- package/src/__tests__/package-wiring.test.ts +0 -41
- package/src/__tests__/setup.ts +0 -1
- package/src/__tests__/social-login-button.test.tsx +0 -186
- package/src/__tests__/user-avatar.test.tsx +0 -195
- package/src/__tests__/viewport.test.ts +0 -50
- package/src/components/command/__tests__/command.test.tsx +0 -112
- package/src/components/data-display/Alert/Alert.stories.tsx +0 -559
- package/src/components/data-display/Alert/Alert.test.stories.tsx +0 -707
- package/src/components/data-display/AlertDialog/AlertDialog.stories.tsx +0 -362
- package/src/components/data-display/AlertDialog/AlertDialog.test.stories.tsx +0 -763
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.stories.tsx +0 -230
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.test.stories.tsx +0 -270
- package/src/components/data-display/Avatar/Avatar.stories.tsx +0 -721
- package/src/components/data-display/Avatar/Avatar.test.stories.tsx +0 -822
- package/src/components/data-display/Badge/Badge.stories.tsx +0 -1134
- package/src/components/data-display/Badge/Badge.test.stories.tsx +0 -1194
- package/src/components/data-display/Banner/Banner.stories.tsx +0 -528
- package/src/components/data-display/Banner/Banner.test.stories.tsx +0 -511
- package/src/components/data-display/Carousel/Carousel.stories.tsx +0 -607
- package/src/components/data-display/Carousel/Carousel.test.stories.tsx +0 -701
- package/src/components/data-display/Chart/Chart.stories.tsx +0 -568
- package/src/components/data-display/Chart/Chart.test.stories.tsx +0 -174
- package/src/components/data-display/Chart/SpecChart.stories.tsx +0 -150
- package/src/components/data-display/Chart/SpecChart.test.stories.tsx +0 -56
- package/src/components/data-display/Chart/__tests__/SpecChart.test.tsx +0 -60
- package/src/components/data-display/Chart/__tests__/chart-format.test.ts +0 -43
- package/src/components/data-display/Chart/__tests__/chart-spec.test.ts +0 -119
- package/src/components/data-display/Chip/Chip.stories.tsx +0 -252
- package/src/components/data-display/Chip/Chip.test.stories.tsx +0 -266
- package/src/components/data-display/DataGrid/DataGrid.stories.tsx +0 -515
- package/src/components/data-display/DataGrid/DataGrid.test.stories.tsx +0 -653
- package/src/components/data-display/DataViews/__tests__/DataViewsGrid.test.tsx +0 -271
- package/src/components/data-display/DataViews/__tests__/DataViewsTableBase.test.tsx +0 -134
- package/src/components/data-display/DataViews/__tests__/SaveViewModal.test.tsx +0 -83
- package/src/components/data-display/DataViews/__tests__/data-views-filter.test.ts +0 -115
- package/src/components/data-display/DataViews/__tests__/data-views-preview.test.ts +0 -53
- package/src/components/data-display/DataViews/__tests__/range-pill.test.tsx +0 -114
- package/src/components/data-display/DataViews/base-card.stories.tsx +0 -136
- package/src/components/data-display/DescriptionItem/DescriptionItem.stories.tsx +0 -254
- package/src/components/data-display/EmptyState/EmptyState.stories.tsx +0 -282
- package/src/components/data-display/EmptyState/EmptyState.test.stories.tsx +0 -441
- package/src/components/data-display/ErrorState/ErrorState.stories.tsx +0 -110
- package/src/components/data-display/ErrorState/ErrorState.test.stories.tsx +0 -133
- package/src/components/data-display/HoverCard/HoverCard.stories.tsx +0 -650
- package/src/components/data-display/HoverCard/HoverCard.test.stories.tsx +0 -929
- package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.stories.tsx +0 -411
- package/src/components/data-display/LazyImage/LazyImage.stories.tsx +0 -387
- package/src/components/data-display/Lightbox/Lightbox.stories.tsx +0 -315
- package/src/components/data-display/Lightbox/Lightbox.test.stories.tsx +0 -598
- package/src/components/data-display/LoadingState/LoadingState.stories.tsx +0 -124
- package/src/components/data-display/LoadingState/LoadingState.test.stories.tsx +0 -99
- package/src/components/data-display/MapPreview/MapPreview.stories.tsx +0 -458
- package/src/components/data-display/MapPreview/MapPreview.test.stories.tsx +0 -394
- package/src/components/data-display/Popover/Popover.stories.tsx +0 -295
- package/src/components/data-display/Popover/Popover.test.stories.tsx +0 -1162
- package/src/components/data-display/Progress/Progress.stories.tsx +0 -481
- package/src/components/data-display/Progress/Progress.test.stories.tsx +0 -2070
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.stories.tsx +0 -160
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.test.stories.tsx +0 -190
- package/src/components/data-display/Sheet/Sheet.stories.tsx +0 -883
- package/src/components/data-display/Sheet/Sheet.test.stories.tsx +0 -1105
- package/src/components/data-display/StatCard/StatCard.stories.tsx +0 -167
- package/src/components/data-display/StatCard/StatCard.test.stories.tsx +0 -240
- package/src/components/data-display/Stepper/Stepper.stories.tsx +0 -540
- package/src/components/data-display/Stepper/Stepper.test.stories.tsx +0 -600
- package/src/components/data-display/Table/Table.stories.tsx +0 -803
- package/src/components/data-display/Table/Table.test.stories.tsx +0 -369
- package/src/components/data-display/Timeline/Timeline.stories.tsx +0 -442
- package/src/components/data-display/Timeline/Timeline.test.stories.tsx +0 -930
- package/src/components/data-display/TimingDiagram/TimingDiagram.stories.tsx +0 -475
- package/src/components/data-display/TimingDiagram/TimingDiagram.test.stories.tsx +0 -734
- package/src/components/data-display/Tooltip/Tooltip.stories.tsx +0 -468
- package/src/components/data-display/Tooltip/Tooltip.test.stories.tsx +0 -1154
- package/src/components/feedback/ConfirmAction/ConfirmAction.stories.tsx +0 -146
- package/src/components/feedback/ConfirmAction/ConfirmAction.test.stories.tsx +0 -114
- package/src/components/feedback/ConfirmAction/__tests__/confirm-action.test.tsx +0 -288
- package/src/components/feedback/Dialog/Dialog.stories.tsx +0 -833
- package/src/components/feedback/Dialog/Dialog.test.stories.tsx +0 -964
- package/src/components/feedback/Dialog/__tests__/dialog-content-spacing.test.tsx +0 -66
- package/src/components/feedback/Modal/Modal.stories.tsx +0 -765
- package/src/components/feedback/Modal/Modal.test.stories.tsx +0 -251
- package/src/components/feedback/Sonner/Sonner.stories.tsx +0 -698
- package/src/components/feedback/Sonner/Sonner.test.stories.tsx +0 -896
- package/src/components/feedback/StackedModal/StackedModal.stories.tsx +0 -1783
- package/src/components/feedback/StackedModal/StackedModal.test.stories.tsx +0 -973
- package/src/components/feedback/StackedModal/__tests__/stacked-modal-viewport.test.tsx +0 -104
- package/src/components/feedback/Toast/Toast.stories.tsx +0 -548
- package/src/components/feedback/Toast/Toast.test.stories.tsx +0 -834
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.stories.tsx +0 -691
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.test.stories.tsx +0 -634
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.stories.tsx +0 -665
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.test.stories.tsx +0 -727
- package/src/components/form/Autocomplete/Autocomplete.stories.tsx +0 -715
- package/src/components/form/Autocomplete/Autocomplete.test.stories.tsx +0 -825
- package/src/components/form/Button/Button.stories.tsx +0 -365
- package/src/components/form/Button/Button.test.stories.tsx +0 -607
- package/src/components/form/Calendar/Calendar.stories.tsx +0 -349
- package/src/components/form/Calendar/Calendar.test.stories.tsx +0 -464
- package/src/components/form/CepField/CepField.stories.tsx +0 -138
- package/src/components/form/CepField/CepField.test.stories.tsx +0 -281
- package/src/components/form/Checkbox/Checkbox.stories.tsx +0 -265
- package/src/components/form/Checkbox/Checkbox.test.stories.tsx +0 -181
- package/src/components/form/CodeEditor/CodeEditor.stories.tsx +0 -871
- package/src/components/form/CodeEditor/CodeEditor.test.stories.tsx +0 -574
- package/src/components/form/Command/Command.stories.tsx +0 -580
- package/src/components/form/Command/Command.test.stories.tsx +0 -215
- package/src/components/form/CreatableSelect/CreatableSelect.stories.tsx +0 -112
- package/src/components/form/CreatableSelect/CreatableSelect.test.stories.tsx +0 -134
- package/src/components/form/Form/Form.stories.tsx +0 -687
- package/src/components/form/Form/Form.test.stories.tsx +0 -601
- package/src/components/form/Input/Input.stories.tsx +0 -260
- package/src/components/form/Input/Input.test.stories.tsx +0 -1191
- package/src/components/form/InputOTP/InputOTP.stories.tsx +0 -774
- package/src/components/form/InputOTP/InputOTP.test.stories.tsx +0 -588
- package/src/components/form/Label/Label.stories.tsx +0 -473
- package/src/components/form/Label/Label.test.stories.tsx +0 -915
- package/src/components/form/Menubar/Menubar.stories.tsx +0 -472
- package/src/components/form/Menubar/Menubar.test.stories.tsx +0 -584
- package/src/components/form/PasswordStrength/PasswordStrength.stories.tsx +0 -562
- package/src/components/form/PasswordStrength/PasswordStrength.test.stories.tsx +0 -327
- package/src/components/form/PhoneInput/PhoneInput.stories.tsx +0 -495
- package/src/components/form/PhoneInput/PhoneInput.test.stories.tsx +0 -666
- package/src/components/form/RadioGroup/RadioGroup.stories.tsx +0 -518
- package/src/components/form/RadioGroup/RadioGroup.test.stories.tsx +0 -685
- package/src/components/form/RichTextEditor/RichTextEditor.stories.tsx +0 -261
- package/src/components/form/RichTextEditor/RichTextEditor.test.stories.tsx +0 -491
- package/src/components/form/SearchPalette/SearchPalette.stories.tsx +0 -135
- package/src/components/form/Select/Select.stories.tsx +0 -364
- package/src/components/form/Select/Select.test.stories.tsx +0 -985
- package/src/components/form/Slider/Slider.stories.tsx +0 -418
- package/src/components/form/Slider/Slider.test.stories.tsx +0 -1042
- package/src/components/form/Switch/Switch.stories.tsx +0 -697
- package/src/components/form/Switch/Switch.test.stories.tsx +0 -597
- package/src/components/form/Textarea/Textarea.stories.tsx +0 -473
- package/src/components/form/Textarea/Textarea.test.stories.tsx +0 -702
- package/src/components/form/Toggle/Toggle.stories.tsx +0 -638
- package/src/components/form/Toggle/Toggle.test.stories.tsx +0 -1159
- package/src/components/form/ToggleGroup/ToggleGroup.stories.tsx +0 -617
- package/src/components/form/ToggleGroup/ToggleGroup.test.stories.tsx +0 -915
- package/src/components/form/UploadButton/UploadButton.stories.tsx +0 -367
- package/src/components/form/UploadButton/UploadButton.test.stories.tsx +0 -573
- package/src/components/form/total-form/total-form.test.tsx +0 -214
- package/src/components/layout/Accordion/Accordion.stories.tsx +0 -694
- package/src/components/layout/Accordion/Accordion.test.stories.tsx +0 -1344
- package/src/components/layout/Card/Card.stories.tsx +0 -591
- package/src/components/layout/Card/Card.test.stories.tsx +0 -1134
- package/src/components/layout/CardGrid/__tests__/CardGrid.test.tsx +0 -92
- package/src/components/layout/Collapsible/Collapsible.stories.tsx +0 -180
- package/src/components/layout/Collapsible/Collapsible.test.stories.tsx +0 -308
- package/src/components/layout/Container/Container.stories.tsx +0 -557
- package/src/components/layout/Container/Container.test.stories.tsx +0 -745
- package/src/components/layout/ContentToolbar/ContentToolbar.stories.tsx +0 -129
- package/src/components/layout/ContentToolbar/ContentToolbar.test.stories.tsx +0 -251
- package/src/components/layout/ContentToolbar/__tests__/ColumnsMenu.test.tsx +0 -39
- package/src/components/layout/ContentToolbar/__tests__/MultiSelectDropdown.test.tsx +0 -131
- package/src/components/layout/ContentToolbar/__tests__/SavedViewsMenu.test.tsx +0 -99
- package/src/components/layout/Dashboard/Dashboard.stories.tsx +0 -104
- package/src/components/layout/Dashboard/Dashboard.test.stories.tsx +0 -190
- package/src/components/layout/Drawer/Drawer.stories.tsx +0 -658
- package/src/components/layout/Drawer/Drawer.test.stories.tsx +0 -1343
- package/src/components/layout/Resizable/Resizable.stories.tsx +0 -1039
- package/src/components/layout/Resizable/Resizable.test.stories.tsx +0 -754
- package/src/components/layout/ScrollArea/ScrollArea.stories.tsx +0 -651
- package/src/components/layout/ScrollArea/ScrollArea.test.stories.tsx +0 -619
- package/src/components/layout/Separator/Separator.stories.tsx +0 -563
- package/src/components/layout/Separator/Separator.test.stories.tsx +0 -518
- package/src/components/layout/SettingsLayout/SettingsLayout.stories.tsx +0 -192
- package/src/components/layout/SettingsLayout/SettingsLayout.test.stories.tsx +0 -175
- package/src/components/layout/Sidebar/Sidebar.stories.tsx +0 -609
- package/src/components/layout/Sidebar/Sidebar.test.stories.tsx +0 -1324
- package/src/components/layout/Skeleton/Skeleton.stories.tsx +0 -689
- package/src/components/layout/Skeleton/Skeleton.test.stories.tsx +0 -521
- package/src/components/layout/Spacer/Spacer.stories.tsx +0 -502
- package/src/components/layout/Spacer/Spacer.test.stories.tsx +0 -474
- package/src/components/layout/TableFilter/TableFilter.stories.tsx +0 -82
- package/src/components/layout/TableFilter/TableFilter.test.stories.tsx +0 -87
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.stories.tsx +0 -638
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.test.stories.tsx +0 -1008
- package/src/components/navigation/CommandPalette/CommandPalette.stories.tsx +0 -386
- package/src/components/navigation/CommandPalette/CommandPalette.test.stories.tsx +0 -435
- package/src/components/navigation/ContextMenu/ContextMenu.stories.tsx +0 -614
- package/src/components/navigation/ContextMenu/ContextMenu.test.stories.tsx +0 -845
- package/src/components/navigation/DropdownMenu/DropdownMenu.stories.tsx +0 -578
- package/src/components/navigation/DropdownMenu/DropdownMenu.test.stories.tsx +0 -660
- package/src/components/navigation/NavigationMenu/stories/NavigationMenu.stories.tsx +0 -516
- package/src/components/navigation/NavigationMenu/stories/NavigationMenu.test.stories.tsx +0 -935
- package/src/components/navigation/NavigationMenu/stories/NavigationMenuHorizontal.stories.tsx +0 -501
- package/src/components/navigation/NavigationMenu/stories/NavigationMenuVertical.stories.tsx +0 -453
- package/src/components/navigation/Pagination/Pagination.stories.tsx +0 -602
- package/src/components/navigation/Pagination/Pagination.test.stories.tsx +0 -520
- package/src/components/navigation/Tabs/Tabs.stories.tsx +0 -1004
- package/src/components/navigation/Tabs/Tabs.test.stories.tsx +0 -1225
- package/src/components/typography/Blockquote/Blockquote.stories.tsx +0 -359
- package/src/components/typography/Blockquote/Blockquote.test.stories.tsx +0 -432
- package/src/components/typography/Code/Code.stories.tsx +0 -686
- package/src/components/typography/Code/Code.test.stories.tsx +0 -703
- package/src/components/typography/Heading/Heading.stories.tsx +0 -451
- package/src/components/typography/Heading/Heading.test.stories.tsx +0 -830
- package/src/components/typography/Paragraph/Paragraph.stories.tsx +0 -280
- package/src/components/typography/Paragraph/Paragraph.test.stories.tsx +0 -231
- package/src/components/typography/Text/Text.stories.tsx +0 -359
- package/src/components/typography/Text/Text.test.stories.tsx +0 -759
- package/src/components/utility/AnimatedIcon/AnimatedIcon.stories.tsx +0 -945
- package/src/components/utility/AnimatedIcon/AnimatedIcon.test.stories.tsx +0 -603
- package/src/components/utility/AspectRatio/AspectRatio.stories.tsx +0 -414
- package/src/components/utility/AspectRatio/AspectRatio.test.stories.tsx +0 -859
- package/src/components/utility/InfiniteScroll/InfiniteScroll.stories.tsx +0 -620
- package/src/components/utility/InfiniteScroll/InfiniteScroll.test.stories.tsx +0 -361
- package/src/components/utility/InstallPrompt/InstallPrompt.stories.tsx +0 -118
- package/src/components/utility/InstallPrompt/InstallPrompt.test.stories.tsx +0 -83
- package/src/components/utility/InstallPrompt/__tests__/InstallPrompt.ios.test.tsx +0 -65
- package/src/components/utility/InstallPrompt/__tests__/usePwaInstall.test.tsx +0 -271
- package/src/components/utility/Portal/Portal.stories.tsx +0 -340
- package/src/components/utility/Portal/Portal.test.stories.tsx +0 -2086
- package/src/components/utility/Transition/Transition.stories.tsx +0 -493
- package/src/components/utility/Transition/Transition.test.stories.tsx +0 -854
- package/src/components/utility/VirtualList/VirtualList.stories.tsx +0 -1073
- package/src/components/utility/VirtualList/VirtualList.test.stories.tsx +0 -1085
- package/src/components/utility/WorkflowStep/WorkflowStep.stories.tsx +0 -431
- package/src/components/utility/WorkflowStep/WorkflowStep.test.stories.tsx +0 -364
- /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.5.
|
|
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.
|
|
18
|
+
"./button": "./src/button/index.ts",
|
|
19
19
|
"./charts": "./src/charts/index.ts",
|
|
20
|
-
"./social-login-button": "./src/social-login-button.
|
|
21
|
-
"./user-avatar": "./src/user-avatar.
|
|
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.4.
|
|
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.5.
|
|
213
|
-
"@12-apps/typescript-config": "^1.5.
|
|
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",
|
|
@@ -258,6 +258,14 @@
|
|
|
258
258
|
"prisma",
|
|
259
259
|
"*.js",
|
|
260
260
|
"*.mjs",
|
|
261
|
-
"*.md"
|
|
261
|
+
"*.md",
|
|
262
|
+
"!eslint.config.js",
|
|
263
|
+
"!**/__tests__/**",
|
|
264
|
+
"!**/tests/**",
|
|
265
|
+
"!**/*.test.*",
|
|
266
|
+
"!**/*.spec.*",
|
|
267
|
+
"!**/*.stories.*",
|
|
268
|
+
"!**/*.test-story.*",
|
|
269
|
+
"!**/test-helpers.*"
|
|
262
270
|
]
|
|
263
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 '
|
|
6
|
-
import { Card, CardContent } from '
|
|
7
|
-
import { Heading } from '
|
|
8
|
-
import { Text } from '
|
|
9
|
-
import { Separator } from '
|
|
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 '
|
|
6
|
-
import { Button } from '
|
|
7
|
-
import { Text } from '
|
|
8
|
-
import { Card } from '
|
|
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,89 +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 testFlakiness from 'eslint-plugin-test-flakiness';
|
|
5
|
-
import globals from 'globals';
|
|
6
|
-
|
|
7
|
-
import { config } from "@12-apps/eslint-config/base";
|
|
8
|
-
|
|
9
|
-
export default [
|
|
10
|
-
{
|
|
11
|
-
ignores: [
|
|
12
|
-
'packages/ui/scripts/check-component.js',
|
|
13
|
-
'packages/ui/tsup.config.ts',
|
|
14
|
-
'node_modules/**',
|
|
15
|
-
'dist/**',
|
|
16
|
-
'build/**',
|
|
17
|
-
'storybook-static/**',
|
|
18
|
-
'packages/ui/scripts/**',
|
|
19
|
-
'packages/ui/scripts/**/*',
|
|
20
|
-
'scripts/**',
|
|
21
|
-
'scripts/**/*',
|
|
22
|
-
'tsup.config.ts',
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
...config,
|
|
26
|
-
...storybook.configs["flat/recommended"],
|
|
27
|
-
|
|
28
|
-
// The flakiness gate is a separate lane (eslint.flakiness.config.mjs), so its
|
|
29
|
-
// rules are not enabled here. Test files still carry inline disables for the
|
|
30
|
-
// few findings that are deliberate, and without the plugin registered those
|
|
31
|
-
// directives fail to resolve — "definition for rule ... was not found" — which
|
|
32
|
-
// this everyday lint run counts as a warning under --max-warnings 0.
|
|
33
|
-
// Registering the plugin with no rules turned on makes them resolve.
|
|
34
|
-
{
|
|
35
|
-
plugins: { 'test-flakiness': testFlakiness },
|
|
36
|
-
linterOptions: { reportUnusedDisableDirectives: 'off' },
|
|
37
|
-
},
|
|
38
|
-
// Override parser for all TypeScript files after storybook config
|
|
39
|
-
{
|
|
40
|
-
files: ['**/*.ts', '**/*.tsx'],
|
|
41
|
-
languageOptions: {
|
|
42
|
-
parser: tsParser,
|
|
43
|
-
ecmaVersion: 'latest',
|
|
44
|
-
sourceType: 'module',
|
|
45
|
-
parserOptions: {
|
|
46
|
-
ecmaVersion: 'latest',
|
|
47
|
-
sourceType: 'module',
|
|
48
|
-
ecmaFeatures: {
|
|
49
|
-
jsx: true,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
globals: {
|
|
53
|
-
...globals.browser,
|
|
54
|
-
...globals.es2021,
|
|
55
|
-
React: 'readonly',
|
|
56
|
-
google: 'readonly',
|
|
57
|
-
// Node-specific globals needed for build tools
|
|
58
|
-
process: 'readonly',
|
|
59
|
-
__dirname: 'readonly',
|
|
60
|
-
__filename: 'readonly',
|
|
61
|
-
module: 'readonly',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
rules: {
|
|
65
|
-
// Use TypeScript's unused vars instead of base rule
|
|
66
|
-
'no-unused-vars': 'off',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
// UI-specific rules
|
|
70
|
-
{
|
|
71
|
-
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
72
|
-
rules: {
|
|
73
|
-
'no-console': 'error',
|
|
74
|
-
'react/prop-types': 'off',
|
|
75
|
-
'react/no-unescaped-entities': 'off',
|
|
76
|
-
// Turbo env vars not relevant for UI lib
|
|
77
|
-
'turbo/no-undeclared-env-vars': 'off',
|
|
78
|
-
// Allow underscore-prefixed unused vars (intentionally unused params)
|
|
79
|
-
'@typescript-eslint/no-unused-vars': ['warn', {
|
|
80
|
-
argsIgnorePattern: '^_',
|
|
81
|
-
varsIgnorePattern: '^_',
|
|
82
|
-
caughtErrorsIgnorePattern: '^_',
|
|
83
|
-
}],
|
|
84
|
-
},
|
|
85
|
-
settings: {
|
|
86
|
-
'import/resolver': { typescript: { project: './tsconfig.json' } },
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
];
|
|
@@ -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
|
-
});
|
package/src/__tests__/setup.ts
DELETED
|
@@ -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
|
-
});
|