@12-apps/ui 1.0.0 → 1.3.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/components-catalog.md +14 -0
- package/package.json +42 -27
- package/src/__tests__/data-grid.test.tsx +125 -0
- package/src/__tests__/package-wiring.test.ts +12 -8
- package/src/__tests__/social-login-button.test.tsx +5 -5
- package/src/__tests__/viewport.test.ts +50 -0
- package/src/charts/index.ts +8 -0
- package/src/components/data-display/Alert/Alert.md +1 -1
- package/src/components/data-display/Alert/Alert.stories.tsx +5 -7
- package/src/components/data-display/Alert/Alert.styles.tsx +255 -0
- package/src/components/data-display/Alert/Alert.test.stories.tsx +11 -13
- package/src/components/data-display/Alert/Alert.tsx +135 -328
- package/src/components/data-display/AlertDialog/AlertDialog.stories.tsx +3 -1
- package/src/components/data-display/AlertDialog/AlertDialog.tsx +191 -78
- package/src/components/data-display/AlertDialog/AlertDialog.types.ts +8 -1
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.test.stories.tsx +5 -5
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.tsx +44 -35
- package/src/components/data-display/Avatar/Avatar.stories.tsx +4 -1
- package/src/components/data-display/Avatar/Avatar.test.stories.tsx +5 -3
- package/src/components/data-display/Avatar/Avatar.tsx +154 -450
- package/src/components/data-display/Avatar/Avatar.view.tsx +396 -0
- package/src/components/data-display/Badge/Badge.animations.ts +67 -0
- package/src/components/data-display/Badge/Badge.helpers.ts +74 -0
- package/src/components/data-display/Badge/Badge.stories.tsx +14 -16
- package/src/components/data-display/Badge/Badge.styles.ts +261 -0
- package/src/components/data-display/Badge/Badge.test.stories.tsx +32 -31
- package/src/components/data-display/Badge/Badge.tsx +151 -557
- package/src/components/data-display/Badge/Badge.variants.ts +106 -0
- package/src/components/data-display/Badge/BadgeContent.tsx +107 -0
- package/src/components/data-display/Banner/Banner.stories.tsx +5 -1
- package/src/components/data-display/Banner/Banner.styles.ts +120 -0
- package/src/components/data-display/Banner/Banner.tsx +179 -224
- package/src/components/data-display/Chart/Chart.md +48 -1
- package/src/components/data-display/Chart/Chart.tsx +82 -500
- package/src/components/data-display/Chart/Chart.types.ts +2 -0
- package/src/components/data-display/Chart/ChartComposables.tsx +121 -0
- package/src/components/data-display/Chart/ChartSpec.types.ts +70 -0
- package/src/components/data-display/Chart/SpecChart.stories.tsx +150 -0
- package/src/components/data-display/Chart/SpecChart.test.stories.tsx +56 -0
- package/src/components/data-display/Chart/SpecChart.tsx +53 -0
- package/src/components/data-display/Chart/__tests__/SpecChart.test.tsx +60 -0
- package/src/components/data-display/Chart/__tests__/chart-format.test.ts +43 -0
- package/src/components/data-display/Chart/__tests__/chart-spec.test.ts +119 -0
- package/src/components/data-display/Chart/chart-format.ts +26 -0
- package/src/components/data-display/Chart/chart-internals.ts +148 -0
- package/src/components/data-display/Chart/chart-renderers.tsx +338 -0
- package/src/components/data-display/Chart/chart-spec-registry.ts +74 -0
- package/src/components/data-display/Chart/chart-spec.ts +171 -0
- package/src/components/data-display/Chart/index.ts +30 -0
- package/src/components/data-display/Chip/Chip.helpers.tsx +131 -0
- package/src/components/data-display/Chip/Chip.stories.tsx +2 -1
- package/src/components/data-display/Chip/Chip.test.stories.tsx +11 -8
- package/src/components/data-display/Chip/Chip.tsx +31 -94
- package/src/components/data-display/DataGrid/DataGrid.body.tsx +141 -0
- package/src/components/data-display/DataGrid/DataGrid.cells.tsx +238 -0
- package/src/components/data-display/DataGrid/DataGrid.model.ts +315 -0
- package/src/components/data-display/DataGrid/DataGrid.rows.ts +112 -0
- package/src/components/data-display/DataGrid/DataGrid.states.tsx +102 -0
- package/src/components/data-display/DataGrid/DataGrid.test.stories.tsx +6 -12
- package/src/components/data-display/DataGrid/DataGrid.tsx +129 -725
- package/src/components/data-display/DataViews/DataViewsGrid.tsx +187 -0
- package/src/components/data-display/DataViews/DataViewsTableBase.tsx +400 -0
- package/src/components/data-display/DataViews/ManageViewsDialog.tsx +140 -0
- package/src/components/data-display/DataViews/SaveViewModal.tsx +289 -0
- package/src/components/data-display/DataViews/__tests__/DataViewsGrid.test.tsx +271 -0
- package/src/components/data-display/DataViews/__tests__/DataViewsTableBase.test.tsx +134 -0
- package/src/components/data-display/DataViews/__tests__/SaveViewModal.test.tsx +83 -0
- package/src/components/data-display/DataViews/__tests__/data-views-filter.test.ts +115 -0
- package/src/components/data-display/DataViews/__tests__/data-views-preview.test.ts +53 -0
- package/src/components/data-display/DataViews/__tests__/range-pill.test.tsx +114 -0
- package/src/components/data-display/DataViews/base-card.stories.tsx +136 -0
- package/src/components/data-display/DataViews/base-card.tsx +278 -0
- package/src/components/data-display/DataViews/data-views-filter-panel.tsx +184 -0
- package/src/components/data-display/DataViews/data-views-filter.ts +138 -0
- package/src/components/data-display/DataViews/data-views-grid-helpers.tsx +248 -0
- package/src/components/data-display/DataViews/data-views-grid-parts.tsx +400 -0
- package/src/components/data-display/DataViews/data-views-inline-bar.tsx +257 -0
- package/src/components/data-display/DataViews/data-views-layout-context.tsx +176 -0
- package/src/components/data-display/DataViews/data-views-pagination.tsx +31 -0
- package/src/components/data-display/DataViews/data-views-preview.ts +53 -0
- package/src/components/data-display/DataViews/data-views-range-pill.tsx +277 -0
- package/src/components/data-display/DataViews/data-views-table-parts.tsx +150 -0
- package/src/components/data-display/DataViews/data-views-toolbar.tsx +149 -0
- package/src/components/data-display/DataViews/data-views-types.ts +312 -0
- package/src/components/data-display/DataViews/data-views-view-mutations.ts +68 -0
- package/src/components/data-display/DataViews/index.ts +33 -0
- package/src/components/data-display/DataViews/use-data-views-state.ts +349 -0
- package/src/components/data-display/DateTimeDisplay/DateTimeDisplay.hooks.ts +104 -0
- package/src/components/data-display/DateTimeDisplay/DateTimeDisplay.tsx +68 -118
- package/src/components/data-display/DescriptionItem/DescriptionItem.stories.tsx +1 -1
- package/src/components/data-display/DescriptionItem/DescriptionItem.tsx +52 -34
- package/src/components/data-display/EmptyState/EmptyState.test.stories.tsx +6 -6
- package/src/components/data-display/EmptyState/EmptyState.tsx +218 -135
- package/src/components/data-display/ErrorState/ErrorState.test.stories.tsx +2 -2
- package/src/components/data-display/ErrorState/ErrorState.tsx +83 -55
- package/src/components/data-display/HoverCard/HoverCard.stories.tsx +3 -1
- package/src/components/data-display/HoverCard/HoverCard.test.stories.tsx +5 -5
- package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.hooks.ts +99 -0
- package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.styles.ts +87 -0
- package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.tsx +28 -155
- package/src/components/data-display/LazyImage/LazyImage.hooks.ts +203 -0
- package/src/components/data-display/LazyImage/LazyImage.md +1 -1
- package/src/components/data-display/LazyImage/LazyImage.stories.tsx +3 -3
- package/src/components/data-display/LazyImage/LazyImage.tsx +144 -243
- package/src/components/data-display/Lightbox/Lightbox.constants.ts +53 -0
- package/src/components/data-display/Lightbox/Lightbox.helpers.ts +39 -0
- package/src/components/data-display/Lightbox/Lightbox.hooks.ts +259 -0
- package/src/components/data-display/Lightbox/Lightbox.test.stories.tsx +28 -35
- package/src/components/data-display/Lightbox/Lightbox.tsx +98 -658
- package/src/components/data-display/Lightbox/LightboxControls.tsx +152 -0
- package/src/components/data-display/Lightbox/LightboxCurrentMedia.tsx +50 -0
- package/src/components/data-display/Lightbox/LightboxMedia.tsx +76 -0
- package/src/components/data-display/Lightbox/LightboxOverlay.tsx +83 -0
- package/src/components/data-display/Lightbox/LightboxStage.tsx +97 -0
- package/src/components/data-display/Lightbox/LightboxThumbnails.tsx +83 -0
- package/src/components/data-display/Lightbox/useLightbox.ts +80 -0
- package/src/components/data-display/LoadingState/LoadingState.helpers.ts +52 -0
- package/src/components/data-display/LoadingState/LoadingState.tsx +117 -87
- package/src/components/data-display/MapPreview/MapControlBar.tsx +116 -0
- package/src/components/data-display/MapPreview/MapDecorations.tsx +155 -0
- package/src/components/data-display/MapPreview/MapLayers.tsx +70 -0
- package/src/components/data-display/MapPreview/MapMarkers.tsx +84 -0
- package/src/components/data-display/MapPreview/MapOverlays.tsx +68 -0
- package/src/components/data-display/MapPreview/MapPreview.constants.ts +19 -0
- package/src/components/data-display/MapPreview/MapPreview.helpers.ts +63 -0
- package/src/components/data-display/MapPreview/MapPreview.hooks.ts +265 -0
- package/src/components/data-display/MapPreview/MapPreview.test.stories.tsx +14 -10
- package/src/components/data-display/MapPreview/MapPreview.tsx +52 -882
- package/src/components/data-display/MapPreview/MapPreview.types.ts +8 -1
- package/src/components/data-display/MapPreview/MapSearchBar.tsx +64 -0
- package/src/components/data-display/MapPreview/MapTiles.tsx +70 -0
- package/src/components/data-display/MapPreview/StaticMapView.tsx +63 -0
- package/src/components/data-display/MapPreview/mapProjection.ts +52 -0
- package/src/components/data-display/MapPreview/mapSurface.ts +37 -0
- package/src/components/data-display/MapPreview/useMapPreview.ts +62 -0
- package/src/components/data-display/Popover/Popover.test.stories.tsx +13 -19
- package/src/components/data-display/Progress/Progress.helpers.ts +37 -0
- package/src/components/data-display/Progress/Progress.styles.ts +101 -0
- package/src/components/data-display/Progress/Progress.tsx +185 -213
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.stories.tsx +1 -1
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.tsx +1 -1
- package/src/components/data-display/StatCard/StatCard.md +117 -0
- package/src/components/data-display/StatCard/StatCard.stories.tsx +167 -0
- package/src/components/data-display/StatCard/StatCard.test.stories.tsx +240 -0
- package/src/components/data-display/StatCard/StatCard.tsx +236 -0
- package/src/components/data-display/StatCard/StatCard.types.ts +62 -0
- package/src/components/data-display/StatCard/index.ts +7 -0
- package/src/components/data-display/Stepper/Stepper.test.stories.tsx +12 -19
- package/src/components/data-display/Stepper/Stepper.tsx +1 -1
- package/src/components/data-display/Table/Table.helpers.ts +31 -0
- package/src/components/data-display/Table/Table.hooks.ts +161 -0
- package/src/components/data-display/Table/Table.stories.tsx +3 -1
- package/src/components/data-display/Table/Table.styles.ts +223 -0
- package/src/components/data-display/Table/Table.test.stories.tsx +4 -4
- package/src/components/data-display/Table/Table.tsx +291 -748
- package/src/components/data-display/Table/TableParts.hooks.tsx +112 -0
- package/src/components/data-display/Table/TableParts.tsx +298 -0
- package/src/components/data-display/Table/TableStates.tsx +21 -0
- package/src/components/data-display/Timeline/Timeline.stories.tsx +10 -12
- package/src/components/data-display/Timeline/Timeline.test.stories.tsx +30 -44
- package/src/components/data-display/Timeline/Timeline.tsx +23 -284
- package/src/components/data-display/Timeline/TimelineRow.tsx +346 -0
- package/src/components/data-display/TimingDiagram/TimingDiagram.tsx +38 -311
- package/src/components/data-display/TimingDiagram/TimingDiagram.views.tsx +346 -0
- package/src/components/data-display/Tooltip/Tooltip.stories.tsx +4 -1
- package/src/components/data-display/Tooltip/Tooltip.test.stories.tsx +44 -58
- package/src/components/data-display/Tooltip/Tooltip.tsx +67 -62
- package/src/components/data-display/index.ts +1 -0
- package/src/components/feedback/ConfirmAction/ConfirmAction.hooks.ts +96 -0
- package/src/components/feedback/ConfirmAction/ConfirmAction.md +140 -0
- package/src/components/feedback/ConfirmAction/ConfirmAction.parts.tsx +154 -0
- package/src/components/feedback/ConfirmAction/ConfirmAction.stories.tsx +146 -0
- package/src/components/feedback/ConfirmAction/ConfirmAction.test.stories.tsx +114 -0
- package/src/components/feedback/ConfirmAction/ConfirmAction.tsx +46 -0
- package/src/components/feedback/ConfirmAction/ConfirmAction.types.ts +111 -0
- package/src/components/feedback/ConfirmAction/ConfirmButton.tsx +18 -0
- package/src/components/feedback/ConfirmAction/__tests__/confirm-action.test.tsx +288 -0
- package/src/components/feedback/ConfirmAction/index.ts +16 -0
- package/src/components/feedback/ConfirmAction/with-confirmation.tsx +112 -0
- package/src/components/feedback/Dialog/Dialog.styles.ts +4 -2
- package/src/components/feedback/Dialog/Dialog.tsx +26 -1
- package/src/components/feedback/Dialog/__tests__/dialog-content-spacing.test.tsx +66 -0
- package/src/components/feedback/Modal/Modal.md +1 -1
- package/src/components/feedback/Modal/Modal.stories.tsx +2 -2
- package/src/components/feedback/Sonner/Sonner.tsx +104 -288
- package/src/components/feedback/Sonner/Sonner.types.ts +7 -0
- package/src/components/feedback/Sonner/SonnerToast.tsx +216 -0
- package/src/components/feedback/StackedModal/StackedModal.hooks.ts +226 -0
- package/src/components/feedback/StackedModal/StackedModal.parts.tsx +311 -0
- package/src/components/feedback/StackedModal/StackedModal.stories.tsx +13 -15
- package/src/components/feedback/StackedModal/StackedModal.styles.ts +193 -0
- package/src/components/feedback/StackedModal/StackedModal.tsx +100 -619
- package/src/components/feedback/StackedModal/StackedModal.types.ts +17 -3
- package/src/components/feedback/StackedModal/__tests__/stacked-modal-viewport.test.tsx +104 -0
- package/src/components/feedback/StackedModal/modal-stack.tsx +119 -0
- package/src/components/feedback/Toast/Toast.tsx +92 -81
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.geometry.ts +65 -0
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.hooks.ts +185 -0
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.test.stories.tsx +2 -2
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.tsx +156 -414
- package/src/components/feedback/TutorialOverlay/TutorialStepBody.tsx +255 -0
- package/src/components/feedback/index.ts +1 -0
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.helpers.ts +58 -0
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.hooks.ts +93 -0
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.mapper.ts +57 -0
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.stories.tsx +4 -2
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.test.stories.tsx +20 -16
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.tsx +26 -829
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.types.ts +11 -0
- package/src/components/form/AddressAutocomplete/AddressAutocompleteField.tsx +86 -0
- package/src/components/form/AddressAutocomplete/AddressFallbackField.tsx +64 -0
- package/src/components/form/AddressAutocomplete/AddressInputField.tsx +80 -0
- package/src/components/form/AddressAutocomplete/AddressOption.tsx +83 -0
- package/src/components/form/AddressAutocomplete/AddressSuggestionsPaper.tsx +24 -0
- package/src/components/form/AddressAutocomplete/AddressTextField.tsx +43 -0
- package/src/components/form/AddressAutocomplete/mockPlaces.ts +208 -0
- package/src/components/form/AddressAutocomplete/useAddressPredictions.ts +136 -0
- package/src/components/form/AddressAutocomplete/useAddressSelection.ts +113 -0
- package/src/components/form/AddressAutocomplete/useCurrentLocation.ts +116 -0
- package/src/components/form/AddressAutocomplete/useGoogleMapsAPI.ts +75 -0
- package/src/components/form/Button/Button.helpers.ts +36 -0
- package/src/components/form/Button/Button.stories.tsx +4 -1
- package/src/components/form/Button/Button.styles.ts +225 -0
- package/src/components/form/Button/Button.test.stories.tsx +25 -21
- package/src/components/form/Button/Button.tsx +45 -252
- package/src/components/form/Calendar/Calendar.dates.ts +100 -0
- package/src/components/form/Calendar/Calendar.helpers.ts +32 -0
- package/src/components/form/Calendar/Calendar.hooks.ts +278 -0
- package/src/components/form/Calendar/Calendar.keyboard.ts +32 -0
- package/src/components/form/Calendar/Calendar.selection.ts +156 -0
- package/src/components/form/Calendar/Calendar.test.stories.tsx +33 -34
- package/src/components/form/Calendar/Calendar.tsx +63 -551
- package/src/components/form/Calendar/Calendar.types.ts +16 -0
- package/src/components/form/Calendar/CalendarDay.tsx +127 -0
- package/src/components/form/Calendar/CalendarDayCell.tsx +52 -0
- package/src/components/form/Calendar/CalendarMonth.tsx +128 -0
- package/src/components/form/CepField/CepField.md +138 -0
- package/src/components/form/CepField/CepField.stories.tsx +138 -0
- package/src/components/form/CepField/CepField.test.stories.tsx +281 -0
- package/src/components/form/CepField/CepField.tsx +211 -0
- package/src/components/form/CepField/CepField.types.ts +73 -0
- package/src/components/form/CepField/index.ts +2 -0
- package/src/components/form/Checkbox/Checkbox.helpers.ts +28 -0
- package/src/components/form/Checkbox/Checkbox.tsx +19 -16
- package/src/components/form/CodeEditor/CodeEditor.helpers.ts +45 -0
- package/src/components/form/CodeEditor/CodeEditor.hooks.ts +104 -0
- package/src/components/form/CodeEditor/CodeEditor.monaco.ts +109 -0
- package/src/components/form/CodeEditor/CodeEditor.test.stories.tsx +17 -18
- package/src/components/form/CodeEditor/CodeEditor.tsx +81 -330
- package/src/components/form/CodeEditor/CodeEditorToolbar.tsx +168 -0
- package/src/components/form/Command/Command.hooks.ts +207 -0
- package/src/components/form/Command/Command.parts.tsx +58 -0
- package/src/components/form/Command/Command.styles.ts +83 -0
- package/src/components/form/Command/Command.tsx +61 -270
- package/src/components/form/CreatableSelect/CreatableSelect.md +1 -1
- package/src/components/form/CreatableSelect/CreatableSelect.test.stories.tsx +1 -1
- package/src/components/form/CreatableSelect/CreatableSelect.tsx +152 -71
- package/src/components/form/CreatableSelect/CreatableSelect.types.ts +13 -0
- package/src/components/form/HeaderButton/HeaderButton.tsx +80 -0
- package/src/components/form/HeaderButton/index.ts +2 -0
- package/src/components/form/Input/Input.stories.tsx +5 -1
- package/src/components/form/Input/Input.styles.ts +176 -0
- package/src/components/form/Input/Input.test.stories.tsx +30 -23
- package/src/components/form/Input/Input.tsx +71 -211
- package/src/components/form/Input/Input.types.ts +11 -0
- package/src/components/form/InputOTP/InputOTP.test.stories.tsx +9 -17
- package/src/components/form/Menubar/Menubar.test.stories.tsx +4 -8
- package/src/components/form/PasswordStrength/PasswordStrength.helpers.tsx +117 -0
- package/src/components/form/PasswordStrength/PasswordStrength.test.stories.tsx +3 -3
- package/src/components/form/PasswordStrength/PasswordStrength.tsx +202 -255
- package/src/components/form/PhoneInput/PhoneInput.hooks.ts +134 -0
- package/src/components/form/PhoneInput/PhoneInput.test.stories.tsx +4 -4
- package/src/components/form/PhoneInput/PhoneInput.tsx +279 -292
- package/src/components/form/PhoneInput/countries.ts +54 -0
- package/src/components/form/PhoneInput/phone.ts +47 -0
- package/src/components/form/RadioGroup/RadioGroup.test.stories.tsx +9 -9
- package/src/components/form/RichTextEditor/RichTextEditor.dom.ts +124 -0
- package/src/components/form/RichTextEditor/RichTextEditor.format.ts +61 -0
- package/src/components/form/RichTextEditor/RichTextEditor.hooks.ts +142 -0
- package/src/components/form/RichTextEditor/RichTextEditor.test.stories.tsx +5 -12
- package/src/components/form/RichTextEditor/RichTextEditor.tsx +98 -410
- package/src/components/form/RichTextEditor/RichTextEditorToolbar.tsx +187 -0
- package/src/components/form/SearchPalette/SearchPalette.parts.tsx +22 -0
- package/src/components/form/SearchPalette/SearchPalette.tsx +13 -9
- package/src/components/form/Select/Select.test.stories.tsx +35 -27
- package/src/components/form/Slider/Slider.test.stories.tsx +9 -11
- package/src/components/form/Switch/Switch.md +2 -1
- package/src/components/form/Switch/Switch.test.stories.tsx +6 -6
- package/src/components/form/Textarea/Textarea.styles.ts +143 -0
- package/src/components/form/Textarea/Textarea.test.stories.tsx +20 -26
- package/src/components/form/Textarea/Textarea.tsx +114 -535
- package/src/components/form/Textarea/TextareaRichEditor.tsx +377 -0
- package/src/components/form/Toggle/Toggle.styles.ts +211 -0
- package/src/components/form/Toggle/Toggle.test.stories.tsx +19 -27
- package/src/components/form/Toggle/Toggle.tsx +10 -185
- package/src/components/form/UploadButton/UploadButton.hooks.ts +323 -0
- package/src/components/form/UploadButton/UploadButton.parts.tsx +210 -0
- package/src/components/form/UploadButton/UploadButton.stories.tsx +2 -1
- package/src/components/form/UploadButton/UploadButton.test.stories.tsx +123 -4
- package/src/components/form/UploadButton/UploadButton.tsx +76 -305
- package/src/components/form/UploadButton/UploadButton.types.ts +16 -0
- package/src/components/form/index.ts +1 -0
- package/src/components/form/total-form/Fields/CepField.tsx +143 -0
- package/src/components/form/total-form/Fields/ToggleField.tsx +61 -0
- package/src/components/form/total-form/Fields/index.ts +4 -0
- package/src/components/form/total-form/FormContainer.tsx +3 -3
- package/src/components/form/total-form/SubmitButton.tsx +25 -2
- package/src/components/form/total-form/total-form.test.tsx +118 -1
- package/src/components/layout/Accordion/Accordion.md +1 -1
- package/src/components/layout/Accordion/Accordion.stories.tsx +5 -1
- package/src/components/layout/Accordion/Accordion.styles.ts +80 -0
- package/src/components/layout/Accordion/Accordion.test.stories.tsx +32 -50
- package/src/components/layout/Accordion/Accordion.tsx +2 -75
- package/src/components/layout/Card/Card.helpers.ts +30 -0
- package/src/components/layout/Card/Card.stories.tsx +9 -11
- package/src/components/layout/Card/Card.styles.ts +182 -0
- package/src/components/layout/Card/Card.test.stories.tsx +46 -46
- package/src/components/layout/Card/Card.tsx +24 -241
- package/src/components/layout/CardGrid/CardGrid.md +96 -0
- package/src/components/layout/CardGrid/CardGrid.tsx +140 -0
- package/src/components/layout/CardGrid/__tests__/CardGrid.test.tsx +92 -0
- package/src/components/layout/CardGrid/index.ts +2 -0
- package/src/components/layout/Collapsible/Collapsible.helpers.ts +83 -0
- package/src/components/layout/Collapsible/Collapsible.test.stories.tsx +7 -3
- package/src/components/layout/Collapsible/Collapsible.tsx +111 -107
- package/src/components/layout/Container/Container.test.stories.tsx +11 -16
- package/src/components/layout/ContentToolbar/ColumnsMenu.tsx +1 -1
- package/src/components/layout/ContentToolbar/ContentToolbar.tsx +120 -44
- package/src/components/layout/ContentToolbar/ContentToolbar.types.ts +9 -0
- package/src/components/layout/ContentToolbar/FilterTrigger.tsx +1 -1
- package/src/components/layout/ContentToolbar/MultiSelectDropdown.tsx +58 -43
- package/src/components/layout/ContentToolbar/MultiSelectTriggers.tsx +139 -0
- package/src/components/layout/ContentToolbar/SavedViewsMenu.tsx +10 -3
- package/src/components/layout/ContentToolbar/SortByDropdown.tsx +35 -11
- package/src/components/layout/ContentToolbar/ViewSelector.tsx +5 -6
- package/src/components/layout/ContentToolbar/__tests__/MultiSelectDropdown.test.tsx +21 -0
- package/src/components/layout/Dashboard/Dashboard.test.stories.tsx +27 -1
- package/src/components/layout/Dashboard/Dashboard.tsx +27 -8
- package/src/components/layout/Dashboard/DashboardParts.tsx +12 -19
- package/src/components/layout/Dashboard/index.ts +2 -1
- package/src/components/layout/Drawer/Drawer.stories.tsx +8 -10
- package/src/components/layout/Drawer/Drawer.test.stories.tsx +18 -14
- package/src/components/layout/Drawer/Drawer.tsx +67 -53
- package/src/components/layout/Resizable/Resizable.helpers.ts +133 -0
- package/src/components/layout/Resizable/Resizable.hooks.ts +68 -0
- package/src/components/layout/Resizable/Resizable.tsx +38 -153
- package/src/components/layout/ScrollArea/ScrollArea.helpers.ts +51 -0
- package/src/components/layout/ScrollArea/ScrollArea.styles.ts +248 -0
- package/src/components/layout/ScrollArea/ScrollArea.tsx +183 -374
- package/src/components/layout/ScrollArea/ScrollAreaContent.tsx +70 -0
- package/src/components/layout/ScrollArea/ScrollViewport.tsx +90 -0
- package/src/components/layout/Separator/Separator.styles.ts +128 -0
- package/src/components/layout/Separator/Separator.test.stories.tsx +3 -12
- package/src/components/layout/Separator/Separator.tsx +6 -132
- package/src/components/layout/SettingsLayout/SettingsLayout.parts.tsx +2 -1
- package/src/components/layout/SettingsLayout/SettingsLayout.stories.tsx +6 -8
- package/src/components/layout/Sidebar/Sidebar.stories.tsx +10 -12
- package/src/components/layout/Sidebar/Sidebar.test.stories.tsx +35 -37
- package/src/components/layout/Skeleton/Skeleton.helpers.ts +33 -0
- package/src/components/layout/Skeleton/Skeleton.styles.ts +114 -0
- package/src/components/layout/Skeleton/Skeleton.test.stories.tsx +3 -3
- package/src/components/layout/Skeleton/Skeleton.tsx +67 -155
- package/src/components/layout/TableFilter/TableFilter.tsx +2 -1
- package/src/components/navigation/Breadcrumbs/BreadcrumbEntry.tsx +305 -0
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.md +2 -1
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.stories.tsx +12 -14
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.styles.tsx +212 -0
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.test.stories.tsx +62 -61
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.tsx +116 -429
- package/src/components/navigation/CommandPalette/CommandPalette.helpers.ts +82 -0
- package/src/components/navigation/CommandPalette/CommandPalette.hooks.ts +202 -0
- package/src/components/navigation/CommandPalette/CommandPalette.stories.tsx +3 -1
- package/src/components/navigation/CommandPalette/CommandPalette.test.stories.tsx +3 -5
- package/src/components/navigation/CommandPalette/CommandPalette.tsx +108 -341
- package/src/components/navigation/CommandPalette/CommandPaletteResults.tsx +182 -0
- package/src/components/navigation/CommandPalette/ShortcutChip.tsx +18 -0
- package/src/components/navigation/ContextMenu/ContextMenu.md +3 -1
- package/src/components/navigation/ContextMenu/ContextMenu.stories.tsx +4 -1
- package/src/components/navigation/ContextMenu/ContextMenu.test.stories.tsx +19 -24
- package/src/components/navigation/ContextMenu/ContextMenu.tsx +70 -54
- package/src/components/navigation/DropdownMenu/DropdownMenu.md +3 -1
- package/src/components/navigation/DropdownMenu/DropdownMenu.stories.tsx +17 -19
- package/src/components/navigation/DropdownMenu/DropdownMenu.test.stories.tsx +26 -26
- package/src/components/navigation/DropdownMenu/DropdownMenu.tsx +189 -111
- package/src/components/navigation/NavigationMenu/NavigationMegaSection.tsx +66 -0
- package/src/components/navigation/NavigationMenu/NavigationMenu.md +7 -2
- package/src/components/navigation/NavigationMenu/NavigationMenu.shell.tsx +218 -0
- package/src/components/navigation/NavigationMenu/NavigationMenu.styles.ts +223 -0
- package/src/components/navigation/NavigationMenu/NavigationMenu.tsx +119 -808
- package/src/components/navigation/NavigationMenu/NavigationMenuItem.hooks.ts +126 -0
- package/src/components/navigation/NavigationMenu/NavigationMenuItem.tsx +352 -0
- package/src/components/navigation/NavigationMenu/NavigationStandardBody.tsx +148 -0
- package/src/components/navigation/NavigationMenu/stories/NavigationMenu.stories.tsx +15 -17
- package/src/components/navigation/NavigationMenu/stories/NavigationMenu.test.stories.tsx +27 -23
- package/src/components/navigation/NavigationMenu/stories/NavigationMenuHorizontal.stories.tsx +11 -13
- package/src/components/navigation/NavigationMenu/stories/NavigationMenuVertical.stories.tsx +9 -11
- package/src/components/navigation/Pagination/Pagination.helpers.tsx +85 -0
- package/src/components/navigation/Pagination/Pagination.md +2 -1
- package/src/components/navigation/Pagination/Pagination.stories.tsx +4 -6
- package/src/components/navigation/Pagination/Pagination.styles.ts +135 -0
- package/src/components/navigation/Pagination/Pagination.tsx +178 -313
- package/src/components/navigation/Pagination/PaginationParts.tsx +81 -0
- package/src/components/navigation/Tabs/Tabs.md +3 -1
- package/src/components/navigation/Tabs/Tabs.stories.tsx +21 -23
- package/src/components/navigation/Tabs/Tabs.styles.ts +163 -0
- package/src/components/navigation/Tabs/Tabs.test.stories.tsx +37 -37
- package/src/components/navigation/Tabs/Tabs.tsx +192 -361
- package/src/components/navigation/Tabs/TabsPanel.tsx +100 -0
- package/src/components/typography/Blockquote/Blockquote.tsx +1 -1
- package/src/components/typography/Code/Code.test.stories.tsx +5 -5
- package/src/components/typography/Code/Code.tsx +74 -49
- package/src/components/typography/Heading/Heading.test.stories.tsx +8 -8
- package/src/components/typography/Paragraph/Paragraph.test.stories.tsx +5 -12
- package/src/components/typography/Text/Text.tsx +84 -77
- package/src/components/utility/AnimatedIcon/AnimatedIcon.md +4 -4
- package/src/components/utility/AnimatedIcon/AnimatedIcon.stories.tsx +19 -21
- package/src/components/utility/AnimatedIcon/AnimatedIcon.test.stories.tsx +19 -12
- package/src/components/utility/AspectRatio/AspectRatio.test.stories.tsx +9 -9
- package/src/components/utility/InfiniteScroll/InfiniteScroll.hooks.ts +118 -0
- package/src/components/utility/InfiniteScroll/InfiniteScroll.parts.tsx +54 -0
- package/src/components/utility/InfiniteScroll/InfiniteScroll.test.stories.tsx +12 -9
- package/src/components/utility/InfiniteScroll/InfiniteScroll.tsx +29 -148
- package/src/components/utility/InstallPrompt/InstallPrompt.helpers.ts +124 -0
- package/src/components/utility/InstallPrompt/InstallPrompt.md +113 -0
- package/src/components/utility/InstallPrompt/InstallPrompt.stories.tsx +118 -0
- package/src/components/utility/InstallPrompt/InstallPrompt.styles.ts +50 -0
- package/src/components/utility/InstallPrompt/InstallPrompt.test.stories.tsx +83 -0
- package/src/components/utility/InstallPrompt/InstallPrompt.tsx +192 -0
- package/src/components/utility/InstallPrompt/InstallPrompt.types.ts +78 -0
- package/src/components/utility/InstallPrompt/__tests__/InstallPrompt.ios.test.tsx +65 -0
- package/src/components/utility/InstallPrompt/__tests__/usePwaInstall.test.tsx +271 -0
- package/src/components/utility/InstallPrompt/index.ts +10 -0
- package/src/components/utility/InstallPrompt/usePwaInstall.ts +171 -0
- package/src/components/utility/Transition/Transition.helpers.ts +40 -0
- package/src/components/utility/Transition/Transition.tsx +17 -68
- package/src/components/utility/VirtualList/VirtualList.hooks.ts +319 -0
- package/src/components/utility/VirtualList/VirtualList.test.stories.tsx +49 -38
- package/src/components/utility/VirtualList/VirtualList.tsx +110 -315
- package/src/components/utility/WorkflowStep/WorkflowStep.helpers.ts +151 -0
- package/src/components/utility/WorkflowStep/WorkflowStep.parts.tsx +371 -0
- package/src/components/utility/WorkflowStep/WorkflowStep.stories.tsx +9 -11
- package/src/components/utility/WorkflowStep/WorkflowStep.test.stories.tsx +7 -7
- package/src/components/utility/WorkflowStep/WorkflowStep.tsx +51 -449
- package/src/components/utility/WorkflowStep/WorkflowStepRow.tsx +96 -0
- package/src/components/utility/index.ts +1 -0
- package/src/mui/Link.ts +2 -0
- package/src/utils/index.ts +2 -1
- package/src/utils/viewport.ts +65 -0
package/components-catalog.md
CHANGED
|
@@ -186,6 +186,13 @@ Components for displaying data, visualizations, and information to users.
|
|
|
186
186
|
**Location**: `src/components/data-display/Sheet`
|
|
187
187
|
**Docs**: `src/components/data-display/Sheet/Sheet.md`
|
|
188
188
|
|
|
189
|
+
### StatCard
|
|
190
|
+
**Purpose**: Display one KPI figure with its period-over-period change
|
|
191
|
+
**Use Cases**: Dashboard KPI rows, summary bands above a table, report headers
|
|
192
|
+
**Features**: Pre-formatted label/value, optional delta with independent arrow direction and semantic tone (so rising cost reads negative), optional icon + hint, loading skeletons, `role="group"` with a localizable screen-reader sentence
|
|
193
|
+
**Location**: `src/components/data-display/StatCard`
|
|
194
|
+
**Docs**: `src/components/data-display/StatCard/StatCard.md`
|
|
195
|
+
|
|
189
196
|
### Stepper
|
|
190
197
|
**Purpose**: Display progress through multi-step processes
|
|
191
198
|
**Use Cases**: Wizards, checkout flows, onboarding processes
|
|
@@ -682,6 +689,13 @@ General-purpose utility components.
|
|
|
682
689
|
**Location**: `src/components/utility/InfiniteScroll`
|
|
683
690
|
**Docs**: `src/components/utility/InfiniteScroll/InfiniteScroll.md`
|
|
684
691
|
|
|
692
|
+
### InstallPrompt
|
|
693
|
+
**Purpose**: Invite the user to install the app as a PWA
|
|
694
|
+
**Use Cases**: Storefronts, customer-facing apps, anything installable to a home screen
|
|
695
|
+
**Features**: Captures `beforeinstallprompt`, iOS Add to Home Screen fallback, dismissal memory, headless `usePwaInstall` hook
|
|
696
|
+
**Location**: `src/components/utility/InstallPrompt`
|
|
697
|
+
**Docs**: `src/components/utility/InstallPrompt/InstallPrompt.md`
|
|
698
|
+
|
|
685
699
|
### Portal
|
|
686
700
|
**Purpose**: Render children outside parent DOM hierarchy
|
|
687
701
|
**Use Cases**: Modals, popovers, tooltips
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@12-apps/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"packageManager": "pnpm@9.0.0",
|
|
4
6
|
"type": "module",
|
|
5
7
|
"engines": {
|
|
6
8
|
"node": ">=18.0.0",
|
|
@@ -14,10 +16,12 @@
|
|
|
14
16
|
"exports": {
|
|
15
17
|
".": "./src/index.ts",
|
|
16
18
|
"./button": "./src/button.tsx",
|
|
19
|
+
"./charts": "./src/charts/index.ts",
|
|
17
20
|
"./social-login-button": "./src/social-login-button.tsx",
|
|
18
21
|
"./user-avatar": "./src/user-avatar.tsx",
|
|
19
22
|
"./utils": "./src/utils/index.ts",
|
|
20
23
|
"./mui/Box": "./src/mui/Box.ts",
|
|
24
|
+
"./mui/Link": "./src/mui/Link.ts",
|
|
21
25
|
"./mui/Stack": "./src/mui/Stack.ts",
|
|
22
26
|
"./mui/AppBar": "./src/mui/AppBar.ts",
|
|
23
27
|
"./mui/Toolbar": "./src/mui/Toolbar.ts",
|
|
@@ -42,9 +46,11 @@
|
|
|
42
46
|
"./data-display/Chart": "./src/components/data-display/Chart/index.ts",
|
|
43
47
|
"./data-display/Chip": "./src/components/data-display/Chip/index.ts",
|
|
44
48
|
"./data-display/DataGrid": "./src/components/data-display/DataGrid/index.ts",
|
|
49
|
+
"./data-display/DataViews": "./src/components/data-display/DataViews/index.ts",
|
|
45
50
|
"./data-display/DescriptionItem": "./src/components/data-display/DescriptionItem/index.ts",
|
|
46
51
|
"./data-display/EmptyState": "./src/components/data-display/EmptyState/index.ts",
|
|
47
52
|
"./data-display/SectionOnboarding": "./src/components/data-display/SectionOnboarding/index.ts",
|
|
53
|
+
"./data-display/StatCard": "./src/components/data-display/StatCard/index.ts",
|
|
48
54
|
"./data-display/HoverCard": "./src/components/data-display/HoverCard/index.ts",
|
|
49
55
|
"./data-display/InteractiveTooltip": "./src/components/data-display/InteractiveTooltip/index.ts",
|
|
50
56
|
"./data-display/LazyImage": "./src/components/data-display/LazyImage/index.ts",
|
|
@@ -61,6 +67,7 @@
|
|
|
61
67
|
"./data-display/AsyncStateContainer": "./src/components/data-display/AsyncStateContainer/index.ts",
|
|
62
68
|
"./data-display/ErrorState": "./src/components/data-display/ErrorState/index.ts",
|
|
63
69
|
"./data-display/LoadingState": "./src/components/data-display/LoadingState/index.ts",
|
|
70
|
+
"./feedback/ConfirmAction": "./src/components/feedback/ConfirmAction/index.ts",
|
|
64
71
|
"./feedback/Dialog": "./src/components/feedback/Dialog/index.ts",
|
|
65
72
|
"./feedback/Modal": "./src/components/feedback/Modal/index.ts",
|
|
66
73
|
"./feedback/Sonner": "./src/components/feedback/Sonner/index.ts",
|
|
@@ -71,11 +78,13 @@
|
|
|
71
78
|
"./form/Autocomplete": "./src/components/form/Autocomplete/index.ts",
|
|
72
79
|
"./form/Button": "./src/components/form/Button/index.ts",
|
|
73
80
|
"./form/Calendar": "./src/components/form/Calendar/index.ts",
|
|
81
|
+
"./form/CepField": "./src/components/form/CepField/index.ts",
|
|
74
82
|
"./form/Checkbox": "./src/components/form/Checkbox/index.ts",
|
|
75
83
|
"./form/CodeEditor": "./src/components/form/CodeEditor/index.ts",
|
|
76
84
|
"./form/Command": "./src/components/form/Command/index.ts",
|
|
77
85
|
"./form/CreatableSelect": "./src/components/form/CreatableSelect/index.ts",
|
|
78
86
|
"./form/Form": "./src/components/form/Form/index.ts",
|
|
87
|
+
"./form/HeaderButton": "./src/components/form/HeaderButton/index.ts",
|
|
79
88
|
"./form/total-form": "./src/components/form/total-form/index.ts",
|
|
80
89
|
"./form/Input": "./src/components/form/Input/index.ts",
|
|
81
90
|
"./form/InputOTP": "./src/components/form/InputOTP/index.ts",
|
|
@@ -95,6 +104,7 @@
|
|
|
95
104
|
"./form/UploadButton": "./src/components/form/UploadButton/index.ts",
|
|
96
105
|
"./layout/Accordion": "./src/components/layout/Accordion/index.ts",
|
|
97
106
|
"./layout/Card": "./src/components/layout/Card/index.ts",
|
|
107
|
+
"./layout/CardGrid": "./src/components/layout/CardGrid/index.ts",
|
|
98
108
|
"./layout/Collapsible": "./src/components/layout/Collapsible/index.ts",
|
|
99
109
|
"./layout/Container": "./src/components/layout/Container/index.ts",
|
|
100
110
|
"./layout/ContentToolbar": "./src/components/layout/ContentToolbar/index.ts",
|
|
@@ -123,6 +133,7 @@
|
|
|
123
133
|
"./utility/AnimatedIcon": "./src/components/utility/AnimatedIcon/index.ts",
|
|
124
134
|
"./utility/AspectRatio": "./src/components/utility/AspectRatio/index.ts",
|
|
125
135
|
"./utility/InfiniteScroll": "./src/components/utility/InfiniteScroll/index.ts",
|
|
136
|
+
"./utility/InstallPrompt": "./src/components/utility/InstallPrompt/index.ts",
|
|
126
137
|
"./utility/Portal": "./src/components/utility/Portal/index.ts",
|
|
127
138
|
"./utility/Transition": "./src/components/utility/Transition/index.ts",
|
|
128
139
|
"./utility/VirtualList": "./src/components/utility/VirtualList/index.ts",
|
|
@@ -130,6 +141,9 @@
|
|
|
130
141
|
},
|
|
131
142
|
"typesVersions": {
|
|
132
143
|
"*": {
|
|
144
|
+
"charts": [
|
|
145
|
+
"./src/charts/index.d.ts"
|
|
146
|
+
],
|
|
133
147
|
"mui/*": [
|
|
134
148
|
"./src/mui/*.ts"
|
|
135
149
|
],
|
|
@@ -156,11 +170,31 @@
|
|
|
156
170
|
]
|
|
157
171
|
}
|
|
158
172
|
},
|
|
173
|
+
"scripts": {
|
|
174
|
+
"preinstall": "npx only-allow pnpm",
|
|
175
|
+
"dev": "storybook dev -p 6006",
|
|
176
|
+
"build": "tsup",
|
|
177
|
+
"clean": "rm -rf dist storybook-static",
|
|
178
|
+
"storybook:build": "storybook build",
|
|
179
|
+
"storybook:serve": "http-server storybook-static -p 6008 --silent",
|
|
180
|
+
"storybook:test": "test-storybook --maxWorkers=4 --url http://localhost:6008",
|
|
181
|
+
"test": "node ../../scripts/vitest-with-teardown.mjs run",
|
|
182
|
+
"test:watch": "vitest",
|
|
183
|
+
"test:coverage": "node ../../scripts/vitest-with-teardown.mjs run --coverage",
|
|
184
|
+
"test:storybook": "start-server-and-test 'storybook dev -p 6006' http://localhost:6006 'test-storybook --url http://localhost:6006 --json --outputFile test-results.json'",
|
|
185
|
+
"test:ci": "pnpm storybook:build && (concurrently -k -s first -n 'serve,test' -c 'bgBlue.bold,bgGreen.bold' 'pnpm storybook:serve' 'pnpm storybook:test')",
|
|
186
|
+
"lint:files": "bash -c 'eslint \"${@:-.}\" --max-warnings 0' _",
|
|
187
|
+
"lint": "pnpm run lint:files .",
|
|
188
|
+
"lint:fix": "bash -c 'eslint \"${@:-.}\" --max-warnings 0 --fix' _",
|
|
189
|
+
"typecheck": "tsc --noEmit",
|
|
190
|
+
"check-types": "tsc --noEmit"
|
|
191
|
+
},
|
|
159
192
|
"peerDependencies": {
|
|
160
193
|
"react": "^18.0.0 || ^19.0.0",
|
|
161
194
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
162
195
|
},
|
|
163
196
|
"dependencies": {
|
|
197
|
+
"@12-apps/forms-core": "^1.2.1",
|
|
164
198
|
"@emotion/react": "^11.14.0",
|
|
165
199
|
"@emotion/styled": "^11.14.0",
|
|
166
200
|
"@monaco-editor/react": "^4.7.0",
|
|
@@ -172,10 +206,11 @@
|
|
|
172
206
|
"fuse.js": "^7.1.0",
|
|
173
207
|
"libphonenumber-js": "^1.12.31",
|
|
174
208
|
"monaco-editor": "^0.53.0",
|
|
175
|
-
"recharts": "^3.5.1"
|
|
176
|
-
"@12-apps/shared-helpers": "1.0.0"
|
|
209
|
+
"recharts": "^3.5.1"
|
|
177
210
|
},
|
|
178
211
|
"devDependencies": {
|
|
212
|
+
"@12-apps/eslint-config": "^1.3.1",
|
|
213
|
+
"@12-apps/typescript-config": "^1.3.1",
|
|
179
214
|
"@playwright/test": "^1.55.0",
|
|
180
215
|
"@storybook/addon-docs": "^9.1.10",
|
|
181
216
|
"@storybook/addon-links": "^9.1.10",
|
|
@@ -205,13 +240,11 @@
|
|
|
205
240
|
"typescript": "^5.8.2",
|
|
206
241
|
"vite": "^6.4.1",
|
|
207
242
|
"vite-plugin-istanbul": "^7.2.1",
|
|
208
|
-
"vitest": "^3.2.4"
|
|
209
|
-
"@12-apps/eslint-config": "0.0.0",
|
|
210
|
-
"@12-apps/typescript-config": "0.0.0"
|
|
243
|
+
"vitest": "^3.2.4"
|
|
211
244
|
},
|
|
212
245
|
"publishConfig": {
|
|
213
246
|
"registry": "https://registry.npmjs.org",
|
|
214
|
-
"access": "
|
|
247
|
+
"access": "public"
|
|
215
248
|
},
|
|
216
249
|
"repository": {
|
|
217
250
|
"type": "git",
|
|
@@ -225,23 +258,5 @@
|
|
|
225
258
|
"*.js",
|
|
226
259
|
"*.mjs",
|
|
227
260
|
"*.md"
|
|
228
|
-
]
|
|
229
|
-
|
|
230
|
-
"preinstall": "npx only-allow pnpm",
|
|
231
|
-
"dev": "storybook dev -p 6006",
|
|
232
|
-
"build": "tsup",
|
|
233
|
-
"clean": "rm -rf dist storybook-static",
|
|
234
|
-
"storybook:build": "storybook build",
|
|
235
|
-
"storybook:serve": "http-server storybook-static -p 6008 --silent",
|
|
236
|
-
"storybook:test": "test-storybook --maxWorkers=4 --url http://localhost:6008",
|
|
237
|
-
"test": "node ../../scripts/vitest-with-teardown.mjs run",
|
|
238
|
-
"test:watch": "vitest",
|
|
239
|
-
"test:coverage": "node ../../scripts/vitest-with-teardown.mjs run --coverage",
|
|
240
|
-
"test:storybook": "start-server-and-test 'storybook dev -p 6006' http://localhost:6006 'test-storybook --url http://localhost:6006 --json --outputFile test-results.json'",
|
|
241
|
-
"test:ci": "pnpm storybook:build && (concurrently -k -s first -n 'serve,test' -c 'bgBlue.bold,bgGreen.bold' 'pnpm storybook:serve' 'pnpm storybook:test')",
|
|
242
|
-
"lint:files": "bash -c 'eslint \"${@:-.}\" --max-warnings 0' _",
|
|
243
|
-
"lint": "pnpm run lint:files .",
|
|
244
|
-
"lint:fix": "bash -c 'eslint \"${@:-.}\" --max-warnings 0 --fix' _",
|
|
245
|
-
"typecheck": "tsc --noEmit"
|
|
246
|
-
}
|
|
247
|
-
}
|
|
261
|
+
]
|
|
262
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
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,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { dirname, resolve } from "node:path";
|
|
1
|
+
import { createRequire } from "node:module";
|
|
4
2
|
import { describe, expect, it } from "vitest";
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
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
8
|
|
|
9
9
|
interface UiPackageJson {
|
|
10
10
|
dependencies?: Record<string, string>;
|
|
@@ -13,13 +13,17 @@ interface UiPackageJson {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function readPkg(): UiPackageJson {
|
|
16
|
-
return
|
|
16
|
+
return requireJson("../../package.json") as UiPackageJson;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
describe("@12-apps/ui package wiring (Task 5)", () => {
|
|
20
|
-
it("
|
|
20
|
+
it("depends on the leaf @12-apps/forms-core, not the heavy @12-apps/shared-helpers", () => {
|
|
21
21
|
const pkg = readPkg();
|
|
22
|
-
|
|
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();
|
|
23
27
|
});
|
|
24
28
|
|
|
25
29
|
it("exposes the ./form/total-form package export", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from "vitest";
|
|
2
|
-
import { render, screen, fireEvent } from "@testing-library/react";
|
|
2
|
+
import { render, screen, fireEvent, waitFor } from "@testing-library/react";
|
|
3
3
|
import {
|
|
4
4
|
SocialLoginButton,
|
|
5
5
|
SocialLoginContainer,
|
|
@@ -130,14 +130,14 @@ describe("SocialLoginContainer", () => {
|
|
|
130
130
|
expect(screen.getByText("Welcome Back")).toBeInTheDocument();
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
it("should not render title when title is empty", () => {
|
|
133
|
+
it("should not render title when title is empty", async () => {
|
|
134
134
|
render(
|
|
135
135
|
<SocialLoginContainer title="">
|
|
136
136
|
<span>Content</span>
|
|
137
137
|
</SocialLoginContainer>
|
|
138
138
|
);
|
|
139
139
|
|
|
140
|
-
expect(screen.queryByRole("heading")).not.toBeInTheDocument();
|
|
140
|
+
await waitFor(() => expect(screen.queryByRole("heading")).not.toBeInTheDocument());
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
it("should render divider when showDivider is true", () => {
|
|
@@ -150,14 +150,14 @@ describe("SocialLoginContainer", () => {
|
|
|
150
150
|
expect(screen.getByText("or")).toBeInTheDocument();
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
-
it("should not render divider by default", () => {
|
|
153
|
+
it("should not render divider by default", async () => {
|
|
154
154
|
render(
|
|
155
155
|
<SocialLoginContainer>
|
|
156
156
|
<span>Content</span>
|
|
157
157
|
</SocialLoginContainer>
|
|
158
158
|
);
|
|
159
159
|
|
|
160
|
-
expect(screen.queryByText("or")).not.toBeInTheDocument();
|
|
160
|
+
await waitFor(() => expect(screen.queryByText("or")).not.toBeInTheDocument());
|
|
161
161
|
});
|
|
162
162
|
|
|
163
163
|
it("should render custom divider text", () => {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Viewport helpers: full-height surfaces must be pinned to the DYNAMIC viewport,
|
|
3
|
+
* because iOS resolves `100vh` against the large viewport and parks the bottom of
|
|
4
|
+
* a fixed panel (the submit row) underneath the browser toolbar.
|
|
5
|
+
*/
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
DYNAMIC_VIEWPORT_HEIGHT,
|
|
10
|
+
VIEWPORT_HEIGHT_FALLBACK,
|
|
11
|
+
dynamicViewportHeight,
|
|
12
|
+
safeAreaBottom,
|
|
13
|
+
} from "../utils/viewport";
|
|
14
|
+
|
|
15
|
+
const SUPPORTS_DVH = `@supports (height: ${DYNAMIC_VIEWPORT_HEIGHT})`;
|
|
16
|
+
|
|
17
|
+
describe("dynamicViewportHeight", () => {
|
|
18
|
+
it("emits the vh fallback up front and upgrades to dvh under @supports", () => {
|
|
19
|
+
const styles = dynamicViewportHeight("height");
|
|
20
|
+
|
|
21
|
+
expect(styles.height).toBe(VIEWPORT_HEIGHT_FALLBACK);
|
|
22
|
+
expect(styles[SUPPORTS_DVH]).toEqual({ height: DYNAMIC_VIEWPORT_HEIGHT });
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("pins every requested property, so maxHeight can't re-clamp to 100vh", () => {
|
|
26
|
+
const styles = dynamicViewportHeight("height", "maxHeight");
|
|
27
|
+
|
|
28
|
+
expect(styles.height).toBe(VIEWPORT_HEIGHT_FALLBACK);
|
|
29
|
+
expect(styles.maxHeight).toBe(VIEWPORT_HEIGHT_FALLBACK);
|
|
30
|
+
expect(styles[SUPPORTS_DVH]).toEqual({
|
|
31
|
+
height: DYNAMIC_VIEWPORT_HEIGHT,
|
|
32
|
+
maxHeight: DYNAMIC_VIEWPORT_HEIGHT,
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("defaults to `height` when called with no properties", () => {
|
|
37
|
+
expect(dynamicViewportHeight()).toEqual(dynamicViewportHeight("height"));
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe("safeAreaBottom", () => {
|
|
42
|
+
it("keeps the base padding as the fallback and adds the inset on top", () => {
|
|
43
|
+
const styles = safeAreaBottom(16);
|
|
44
|
+
|
|
45
|
+
expect(styles.paddingBottom).toBe("16px");
|
|
46
|
+
expect(styles["@supports (padding: max(0px))"]).toEqual({
|
|
47
|
+
paddingBottom: "max(16px, calc(16px + env(safe-area-inset-bottom)))",
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@12-apps/ui/charts` — the raw chart library entry point (FUT-129), the
|
|
3
|
+
* sanctioned consumption path for the report builder and other spec-driven
|
|
4
|
+
* consumers. Re-exports only the chart surface (spec types, renderer
|
|
5
|
+
* registry, composables, formatters) so bundlers never drag the rest of the
|
|
6
|
+
* UI kit in through this seam.
|
|
7
|
+
*/
|
|
8
|
+
export * from '../components/data-display/Chart';
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Warning as MuiWarning,
|
|
7
|
-
} from '@mui/icons-material';
|
|
1
|
+
import CheckCircle from '@mui/icons-material/CheckCircle';
|
|
2
|
+
import Notifications from '@mui/icons-material/Notifications';
|
|
3
|
+
import Security from '@mui/icons-material/Security';
|
|
4
|
+
import Star from '@mui/icons-material/Star';
|
|
5
|
+
import MuiWarning from '@mui/icons-material/Warning';
|
|
8
6
|
import { Box, Button,Stack, Typography } from '@mui/material';
|
|
9
7
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
10
8
|
import React from 'react';
|