@12-apps/ui 1.0.0
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 +806 -0
- package/components-guidelines.md +347 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/eslint.config.js +77 -0
- package/package.json +247 -0
- package/src/__tests__/package-wiring.test.ts +37 -0
- package/src/__tests__/setup.ts +1 -0
- package/src/__tests__/social-login-button.test.tsx +186 -0
- package/src/__tests__/user-avatar.test.tsx +195 -0
- package/src/button.tsx +22 -0
- package/src/components/command/__tests__/command.test.tsx +112 -0
- package/src/components/data-display/Alert/Alert.md +209 -0
- package/src/components/data-display/Alert/Alert.stories.tsx +561 -0
- package/src/components/data-display/Alert/Alert.test.stories.tsx +709 -0
- package/src/components/data-display/Alert/Alert.tsx +449 -0
- package/src/components/data-display/Alert/Alert.types.ts +79 -0
- package/src/components/data-display/Alert/index.ts +2 -0
- package/src/components/data-display/AlertDialog/AlertDialog.md +408 -0
- package/src/components/data-display/AlertDialog/AlertDialog.stories.tsx +360 -0
- package/src/components/data-display/AlertDialog/AlertDialog.test.stories.tsx +753 -0
- package/src/components/data-display/AlertDialog/AlertDialog.tsx +273 -0
- package/src/components/data-display/AlertDialog/AlertDialog.types.ts +74 -0
- package/src/components/data-display/AlertDialog/index.ts +2 -0
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.stories.tsx +230 -0
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.test.stories.tsx +270 -0
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.tsx +116 -0
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.types.ts +70 -0
- package/src/components/data-display/AsyncStateContainer/index.ts +2 -0
- package/src/components/data-display/Avatar/Avatar.md +568 -0
- package/src/components/data-display/Avatar/Avatar.stories.tsx +718 -0
- package/src/components/data-display/Avatar/Avatar.test.stories.tsx +820 -0
- package/src/components/data-display/Avatar/Avatar.tsx +507 -0
- package/src/components/data-display/Avatar/Avatar.types.ts +88 -0
- package/src/components/data-display/Avatar/index.ts +2 -0
- package/src/components/data-display/Badge/Badge.md +469 -0
- package/src/components/data-display/Badge/Badge.stories.tsx +1136 -0
- package/src/components/data-display/Badge/Badge.test.stories.tsx +1193 -0
- package/src/components/data-display/Badge/Badge.tsx +606 -0
- package/src/components/data-display/Badge/Badge.types.ts +118 -0
- package/src/components/data-display/Badge/index.ts +2 -0
- package/src/components/data-display/Banner/Banner.stories.tsx +524 -0
- package/src/components/data-display/Banner/Banner.test.stories.tsx +503 -0
- package/src/components/data-display/Banner/Banner.tsx +350 -0
- package/src/components/data-display/Banner/Banner.types.ts +41 -0
- package/src/components/data-display/Banner/banner.md +141 -0
- package/src/components/data-display/Banner/index.ts +2 -0
- package/src/components/data-display/Carousel/Carousel.md +815 -0
- package/src/components/data-display/Carousel/Carousel.stories.tsx +607 -0
- package/src/components/data-display/Carousel/Carousel.test.stories.tsx +691 -0
- package/src/components/data-display/Carousel/Carousel.tsx +765 -0
- package/src/components/data-display/Carousel/Carousel.types.ts +79 -0
- package/src/components/data-display/Carousel/index.ts +8 -0
- package/src/components/data-display/Chart/Chart.md +352 -0
- package/src/components/data-display/Chart/Chart.stories.tsx +568 -0
- package/src/components/data-display/Chart/Chart.test.stories.tsx +174 -0
- package/src/components/data-display/Chart/Chart.tsx +520 -0
- package/src/components/data-display/Chart/Chart.types.ts +65 -0
- package/src/components/data-display/Chart/index.ts +2 -0
- package/src/components/data-display/Chip/Chip.stories.tsx +251 -0
- package/src/components/data-display/Chip/Chip.test.stories.tsx +263 -0
- package/src/components/data-display/Chip/Chip.tsx +134 -0
- package/src/components/data-display/Chip/Chip.types.ts +51 -0
- package/src/components/data-display/Chip/chip.md +395 -0
- package/src/components/data-display/Chip/index.ts +2 -0
- package/src/components/data-display/DataGrid/DataGrid.md +602 -0
- package/src/components/data-display/DataGrid/DataGrid.stories.tsx +515 -0
- package/src/components/data-display/DataGrid/DataGrid.test.stories.tsx +659 -0
- package/src/components/data-display/DataGrid/DataGrid.tsx +743 -0
- package/src/components/data-display/DataGrid/DataGrid.types.ts +171 -0
- package/src/components/data-display/DataGrid/index.ts +21 -0
- package/src/components/data-display/DateTimeDisplay/DateTimeDisplay.tsx +197 -0
- package/src/components/data-display/DateTimeDisplay/DateTimeDisplay.types.ts +46 -0
- package/src/components/data-display/DateTimeDisplay/index.ts +2 -0
- package/src/components/data-display/DescriptionItem/DescriptionItem.md +226 -0
- package/src/components/data-display/DescriptionItem/DescriptionItem.stories.tsx +254 -0
- package/src/components/data-display/DescriptionItem/DescriptionItem.tsx +100 -0
- package/src/components/data-display/DescriptionItem/DescriptionItem.types.ts +1 -0
- package/src/components/data-display/DescriptionItem/index.ts +2 -0
- package/src/components/data-display/EmptyState/EmptyState.md +265 -0
- package/src/components/data-display/EmptyState/EmptyState.stories.tsx +282 -0
- package/src/components/data-display/EmptyState/EmptyState.test.stories.tsx +441 -0
- package/src/components/data-display/EmptyState/EmptyState.tsx +180 -0
- package/src/components/data-display/EmptyState/EmptyState.types.ts +31 -0
- package/src/components/data-display/EmptyState/index.ts +2 -0
- package/src/components/data-display/ErrorState/ErrorState.stories.tsx +110 -0
- package/src/components/data-display/ErrorState/ErrorState.test.stories.tsx +133 -0
- package/src/components/data-display/ErrorState/ErrorState.tsx +118 -0
- package/src/components/data-display/ErrorState/ErrorState.types.ts +45 -0
- package/src/components/data-display/ErrorState/index.ts +2 -0
- package/src/components/data-display/HoverCard/HoverCard.md +389 -0
- package/src/components/data-display/HoverCard/HoverCard.stories.tsx +648 -0
- package/src/components/data-display/HoverCard/HoverCard.test.stories.tsx +929 -0
- package/src/components/data-display/HoverCard/HoverCard.tsx +657 -0
- package/src/components/data-display/HoverCard/HoverCard.types.ts +116 -0
- package/src/components/data-display/HoverCard/index.ts +2 -0
- package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.md +532 -0
- package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.stories.tsx +411 -0
- package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.tsx +245 -0
- package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.types.ts +64 -0
- package/src/components/data-display/InteractiveTooltip/index.ts +2 -0
- package/src/components/data-display/LazyImage/LazyImage.md +356 -0
- package/src/components/data-display/LazyImage/LazyImage.stories.tsx +387 -0
- package/src/components/data-display/LazyImage/LazyImage.tsx +323 -0
- package/src/components/data-display/LazyImage/LazyImage.types.ts +205 -0
- package/src/components/data-display/LazyImage/index.ts +2 -0
- package/src/components/data-display/Lightbox/Lightbox.stories.tsx +315 -0
- package/src/components/data-display/Lightbox/Lightbox.test.stories.tsx +605 -0
- package/src/components/data-display/Lightbox/Lightbox.tsx +666 -0
- package/src/components/data-display/Lightbox/Lightbox.types.ts +49 -0
- package/src/components/data-display/Lightbox/index.ts +2 -0
- package/src/components/data-display/Lightbox/lightbox.md +298 -0
- package/src/components/data-display/LoadingState/LoadingState.stories.tsx +124 -0
- package/src/components/data-display/LoadingState/LoadingState.test.stories.tsx +99 -0
- package/src/components/data-display/LoadingState/LoadingState.tsx +103 -0
- package/src/components/data-display/LoadingState/LoadingState.types.ts +37 -0
- package/src/components/data-display/LoadingState/index.ts +2 -0
- package/src/components/data-display/MapPreview/MapPreview.md +154 -0
- package/src/components/data-display/MapPreview/MapPreview.stories.tsx +458 -0
- package/src/components/data-display/MapPreview/MapPreview.test.stories.tsx +390 -0
- package/src/components/data-display/MapPreview/MapPreview.tsx +922 -0
- package/src/components/data-display/MapPreview/MapPreview.types.ts +56 -0
- package/src/components/data-display/MapPreview/index.ts +2 -0
- package/src/components/data-display/Popover/Popover.md +245 -0
- package/src/components/data-display/Popover/Popover.stories.tsx +295 -0
- package/src/components/data-display/Popover/Popover.test.stories.tsx +1168 -0
- package/src/components/data-display/Popover/Popover.tsx +132 -0
- package/src/components/data-display/Popover/Popover.types.ts +33 -0
- package/src/components/data-display/Popover/index.ts +2 -0
- package/src/components/data-display/Progress/Progress.md +450 -0
- package/src/components/data-display/Progress/Progress.stories.tsx +481 -0
- package/src/components/data-display/Progress/Progress.test.stories.tsx +2070 -0
- package/src/components/data-display/Progress/Progress.tsx +332 -0
- package/src/components/data-display/Progress/Progress.types.ts +61 -0
- package/src/components/data-display/Progress/index.ts +2 -0
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.md +108 -0
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.stories.tsx +160 -0
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.test.stories.tsx +190 -0
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.tsx +224 -0
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.types.ts +101 -0
- package/src/components/data-display/SectionOnboarding/index.ts +7 -0
- package/src/components/data-display/Sheet/Sheet.md +475 -0
- package/src/components/data-display/Sheet/Sheet.stories.tsx +883 -0
- package/src/components/data-display/Sheet/Sheet.test.stories.tsx +1101 -0
- package/src/components/data-display/Sheet/Sheet.tsx +978 -0
- package/src/components/data-display/Sheet/Sheet.types.ts +93 -0
- package/src/components/data-display/Sheet/index.ts +8 -0
- package/src/components/data-display/Stepper/Stepper.md +542 -0
- package/src/components/data-display/Stepper/Stepper.stories.tsx +540 -0
- package/src/components/data-display/Stepper/Stepper.test.stories.tsx +607 -0
- package/src/components/data-display/Stepper/Stepper.tsx +328 -0
- package/src/components/data-display/Stepper/Stepper.types.ts +97 -0
- package/src/components/data-display/Stepper/index.ts +2 -0
- package/src/components/data-display/Table/Table.md +243 -0
- package/src/components/data-display/Table/Table.stories.tsx +801 -0
- package/src/components/data-display/Table/Table.test.stories.tsx +369 -0
- package/src/components/data-display/Table/Table.tsx +831 -0
- package/src/components/data-display/Table/Table.types.ts +335 -0
- package/src/components/data-display/Table/index.ts +2 -0
- package/src/components/data-display/Timeline/Timeline.md +201 -0
- package/src/components/data-display/Timeline/Timeline.stories.tsx +444 -0
- package/src/components/data-display/Timeline/Timeline.test.stories.tsx +944 -0
- package/src/components/data-display/Timeline/Timeline.tsx +348 -0
- package/src/components/data-display/Timeline/Timeline.types.ts +26 -0
- package/src/components/data-display/Timeline/index.ts +2 -0
- package/src/components/data-display/TimingDiagram/TimingDiagram.md +162 -0
- package/src/components/data-display/TimingDiagram/TimingDiagram.stories.tsx +475 -0
- package/src/components/data-display/TimingDiagram/TimingDiagram.test.stories.tsx +734 -0
- package/src/components/data-display/TimingDiagram/TimingDiagram.tsx +399 -0
- package/src/components/data-display/TimingDiagram/TimingDiagram.types.ts +19 -0
- package/src/components/data-display/TimingDiagram/index.ts +2 -0
- package/src/components/data-display/Tooltip/Tooltip.md +397 -0
- package/src/components/data-display/Tooltip/Tooltip.stories.tsx +465 -0
- package/src/components/data-display/Tooltip/Tooltip.test.stories.tsx +1168 -0
- package/src/components/data-display/Tooltip/Tooltip.tsx +161 -0
- package/src/components/data-display/Tooltip/Tooltip.types.ts +33 -0
- package/src/components/data-display/Tooltip/index.ts +2 -0
- package/src/components/data-display/index.ts +29 -0
- package/src/components/feedback/Dialog/Dialog.md +527 -0
- package/src/components/feedback/Dialog/Dialog.stories.tsx +833 -0
- package/src/components/feedback/Dialog/Dialog.styles.ts +171 -0
- package/src/components/feedback/Dialog/Dialog.test.stories.tsx +955 -0
- package/src/components/feedback/Dialog/Dialog.tsx +256 -0
- package/src/components/feedback/Dialog/Dialog.types.ts +46 -0
- package/src/components/feedback/Dialog/index.ts +9 -0
- package/src/components/feedback/Modal/Modal.md +629 -0
- package/src/components/feedback/Modal/Modal.stories.tsx +765 -0
- package/src/components/feedback/Modal/Modal.test.stories.tsx +251 -0
- package/src/components/feedback/Modal/Modal.tsx +279 -0
- package/src/components/feedback/Modal/Modal.types.ts +26 -0
- package/src/components/feedback/Modal/index.ts +7 -0
- package/src/components/feedback/Sonner/Sonner.stories.tsx +698 -0
- package/src/components/feedback/Sonner/Sonner.test.stories.tsx +896 -0
- package/src/components/feedback/Sonner/Sonner.tsx +493 -0
- package/src/components/feedback/Sonner/Sonner.types.ts +65 -0
- package/src/components/feedback/Sonner/index.ts +8 -0
- package/src/components/feedback/StackedModal/StackedModal.md +273 -0
- package/src/components/feedback/StackedModal/StackedModal.stories.tsx +1785 -0
- package/src/components/feedback/StackedModal/StackedModal.test.stories.tsx +975 -0
- package/src/components/feedback/StackedModal/StackedModal.tsx +664 -0
- package/src/components/feedback/StackedModal/StackedModal.types.ts +70 -0
- package/src/components/feedback/StackedModal/index.ts +11 -0
- package/src/components/feedback/Toast/Toast.md +547 -0
- package/src/components/feedback/Toast/Toast.stories.tsx +548 -0
- package/src/components/feedback/Toast/Toast.test.stories.tsx +834 -0
- package/src/components/feedback/Toast/Toast.tsx +279 -0
- package/src/components/feedback/Toast/Toast.types.ts +59 -0
- package/src/components/feedback/Toast/index.ts +8 -0
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.md +610 -0
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.stories.tsx +691 -0
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.test.stories.tsx +634 -0
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.tsx +554 -0
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.types.ts +30 -0
- package/src/components/feedback/TutorialOverlay/index.ts +2 -0
- package/src/components/feedback/index.ts +6 -0
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.md +633 -0
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.stories.tsx +663 -0
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.test.stories.tsx +723 -0
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.tsx +836 -0
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.types.ts +37 -0
- package/src/components/form/AddressAutocomplete/index.ts +2 -0
- package/src/components/form/Autocomplete/Autocomplete.helpers.ts +115 -0
- package/src/components/form/Autocomplete/Autocomplete.keys.ts +134 -0
- package/src/components/form/Autocomplete/Autocomplete.parts.tsx +337 -0
- package/src/components/form/Autocomplete/Autocomplete.stories.tsx +715 -0
- package/src/components/form/Autocomplete/Autocomplete.test.stories.tsx +825 -0
- package/src/components/form/Autocomplete/Autocomplete.tsx +166 -0
- package/src/components/form/Autocomplete/Autocomplete.types.ts +116 -0
- package/src/components/form/Autocomplete/autocomplete.md +789 -0
- package/src/components/form/Autocomplete/index.ts +8 -0
- package/src/components/form/Autocomplete/useAutocomplete.ts +311 -0
- package/src/components/form/Button/Button.md +411 -0
- package/src/components/form/Button/Button.stories.tsx +362 -0
- package/src/components/form/Button/Button.test.stories.tsx +603 -0
- package/src/components/form/Button/Button.tsx +326 -0
- package/src/components/form/Button/Button.types.ts +74 -0
- package/src/components/form/Button/index.ts +2 -0
- package/src/components/form/Calendar/Calendar.md +807 -0
- package/src/components/form/Calendar/Calendar.stories.tsx +349 -0
- package/src/components/form/Calendar/Calendar.test.stories.tsx +465 -0
- package/src/components/form/Calendar/Calendar.tsx +571 -0
- package/src/components/form/Calendar/Calendar.types.ts +81 -0
- package/src/components/form/Calendar/index.ts +11 -0
- package/src/components/form/Checkbox/Checkbox.md +200 -0
- package/src/components/form/Checkbox/Checkbox.stories.tsx +265 -0
- package/src/components/form/Checkbox/Checkbox.test.stories.tsx +181 -0
- package/src/components/form/Checkbox/Checkbox.tsx +170 -0
- package/src/components/form/Checkbox/Checkbox.types.ts +20 -0
- package/src/components/form/Checkbox/index.ts +2 -0
- package/src/components/form/CodeEditor/CodeEditor.md +350 -0
- package/src/components/form/CodeEditor/CodeEditor.stories.tsx +871 -0
- package/src/components/form/CodeEditor/CodeEditor.test.stories.tsx +575 -0
- package/src/components/form/CodeEditor/CodeEditor.tsx +415 -0
- package/src/components/form/CodeEditor/CodeEditor.types.ts +38 -0
- package/src/components/form/CodeEditor/index.ts +2 -0
- package/src/components/form/Command/Command.md +468 -0
- package/src/components/form/Command/Command.stories.tsx +580 -0
- package/src/components/form/Command/Command.test.stories.tsx +215 -0
- package/src/components/form/Command/Command.tsx +545 -0
- package/src/components/form/Command/Command.types.ts +116 -0
- package/src/components/form/Command/index.ts +12 -0
- package/src/components/form/CreatableSelect/CreatableSelect.md +114 -0
- package/src/components/form/CreatableSelect/CreatableSelect.stories.tsx +112 -0
- package/src/components/form/CreatableSelect/CreatableSelect.test.stories.tsx +134 -0
- package/src/components/form/CreatableSelect/CreatableSelect.tsx +149 -0
- package/src/components/form/CreatableSelect/CreatableSelect.types.ts +37 -0
- package/src/components/form/CreatableSelect/index.ts +2 -0
- package/src/components/form/Form/Form.md +325 -0
- package/src/components/form/Form/Form.stories.tsx +687 -0
- package/src/components/form/Form/Form.test.stories.tsx +601 -0
- package/src/components/form/Form/Form.tsx +136 -0
- package/src/components/form/Form/Form.types.ts +42 -0
- package/src/components/form/Form/index.ts +8 -0
- package/src/components/form/Input/Input.md +252 -0
- package/src/components/form/Input/Input.stories.tsx +256 -0
- package/src/components/form/Input/Input.test.stories.tsx +1184 -0
- package/src/components/form/Input/Input.tsx +263 -0
- package/src/components/form/Input/Input.types.ts +24 -0
- package/src/components/form/Input/index.ts +2 -0
- package/src/components/form/InputOTP/InputOTP.md +419 -0
- package/src/components/form/InputOTP/InputOTP.stories.tsx +774 -0
- package/src/components/form/InputOTP/InputOTP.test.stories.tsx +596 -0
- package/src/components/form/InputOTP/InputOTP.tsx +231 -0
- package/src/components/form/InputOTP/InputOTP.types.ts +68 -0
- package/src/components/form/InputOTP/index.ts +2 -0
- package/src/components/form/Label/Label.md +426 -0
- package/src/components/form/Label/Label.stories.tsx +473 -0
- package/src/components/form/Label/Label.test.stories.tsx +909 -0
- package/src/components/form/Label/Label.tsx +367 -0
- package/src/components/form/Label/Label.types.ts +35 -0
- package/src/components/form/Label/index.ts +2 -0
- package/src/components/form/Menubar/Menubar.md +275 -0
- package/src/components/form/Menubar/Menubar.stories.tsx +472 -0
- package/src/components/form/Menubar/Menubar.test.stories.tsx +588 -0
- package/src/components/form/Menubar/Menubar.tsx +467 -0
- package/src/components/form/Menubar/Menubar.types.ts +71 -0
- package/src/components/form/Menubar/index.ts +8 -0
- package/src/components/form/PasswordStrength/PasswordStrength.md +139 -0
- package/src/components/form/PasswordStrength/PasswordStrength.stories.tsx +562 -0
- package/src/components/form/PasswordStrength/PasswordStrength.test.stories.tsx +327 -0
- package/src/components/form/PasswordStrength/PasswordStrength.tsx +419 -0
- package/src/components/form/PasswordStrength/PasswordStrength.types.ts +18 -0
- package/src/components/form/PasswordStrength/index.ts +2 -0
- package/src/components/form/PhoneInput/PhoneInput.md +578 -0
- package/src/components/form/PhoneInput/PhoneInput.stories.tsx +495 -0
- package/src/components/form/PhoneInput/PhoneInput.test.stories.tsx +666 -0
- package/src/components/form/PhoneInput/PhoneInput.tsx +376 -0
- package/src/components/form/PhoneInput/PhoneInput.types.ts +25 -0
- package/src/components/form/PhoneInput/index.ts +2 -0
- package/src/components/form/RadioGroup/RadioGroup.md +477 -0
- package/src/components/form/RadioGroup/RadioGroup.stories.tsx +518 -0
- package/src/components/form/RadioGroup/RadioGroup.test.stories.tsx +685 -0
- package/src/components/form/RadioGroup/RadioGroup.tsx +664 -0
- package/src/components/form/RadioGroup/RadioGroup.types.ts +82 -0
- package/src/components/form/RadioGroup/index.ts +2 -0
- package/src/components/form/RichTextEditor/RichTextEditor.md +710 -0
- package/src/components/form/RichTextEditor/RichTextEditor.stories.tsx +261 -0
- package/src/components/form/RichTextEditor/RichTextEditor.test.stories.tsx +498 -0
- package/src/components/form/RichTextEditor/RichTextEditor.tsx +468 -0
- package/src/components/form/RichTextEditor/RichTextEditor.types.ts +72 -0
- package/src/components/form/RichTextEditor/index.ts +2 -0
- package/src/components/form/SearchPalette/SearchPalette.md +69 -0
- package/src/components/form/SearchPalette/SearchPalette.parts.tsx +358 -0
- package/src/components/form/SearchPalette/SearchPalette.stories.tsx +135 -0
- package/src/components/form/SearchPalette/SearchPalette.tsx +141 -0
- package/src/components/form/SearchPalette/SearchPalette.types.ts +82 -0
- package/src/components/form/SearchPalette/index.ts +7 -0
- package/src/components/form/Select/Select.md +254 -0
- package/src/components/form/Select/Select.stories.tsx +364 -0
- package/src/components/form/Select/Select.test.stories.tsx +977 -0
- package/src/components/form/Select/Select.tsx +239 -0
- package/src/components/form/Select/Select.types.ts +57 -0
- package/src/components/form/Select/index.ts +2 -0
- package/src/components/form/Slider/Slider.md +326 -0
- package/src/components/form/Slider/Slider.stories.tsx +418 -0
- package/src/components/form/Slider/Slider.test.stories.tsx +1044 -0
- package/src/components/form/Slider/Slider.tsx +374 -0
- package/src/components/form/Slider/Slider.types.ts +113 -0
- package/src/components/form/Slider/index.ts +2 -0
- package/src/components/form/Switch/Switch.md +565 -0
- package/src/components/form/Switch/Switch.stories.tsx +697 -0
- package/src/components/form/Switch/Switch.test.stories.tsx +597 -0
- package/src/components/form/Switch/Switch.tsx +578 -0
- package/src/components/form/Switch/Switch.types.ts +130 -0
- package/src/components/form/Switch/index.ts +2 -0
- package/src/components/form/Textarea/Textarea.stories.tsx +473 -0
- package/src/components/form/Textarea/Textarea.test.stories.tsx +708 -0
- package/src/components/form/Textarea/Textarea.tsx +678 -0
- package/src/components/form/Textarea/Textarea.types.ts +84 -0
- package/src/components/form/Textarea/index.ts +2 -0
- package/src/components/form/Toggle/Toggle.md +234 -0
- package/src/components/form/Toggle/Toggle.stories.tsx +638 -0
- package/src/components/form/Toggle/Toggle.test.stories.tsx +1167 -0
- package/src/components/form/Toggle/Toggle.tsx +265 -0
- package/src/components/form/Toggle/Toggle.types.ts +79 -0
- package/src/components/form/Toggle/index.ts +2 -0
- package/src/components/form/ToggleGroup/ToggleGroup.md +329 -0
- package/src/components/form/ToggleGroup/ToggleGroup.stories.tsx +617 -0
- package/src/components/form/ToggleGroup/ToggleGroup.test.stories.tsx +918 -0
- package/src/components/form/ToggleGroup/ToggleGroup.tsx +129 -0
- package/src/components/form/ToggleGroup/ToggleGroup.types.ts +53 -0
- package/src/components/form/ToggleGroup/index.ts +2 -0
- package/src/components/form/UploadButton/UploadButton.md +44 -0
- package/src/components/form/UploadButton/UploadButton.stories.tsx +366 -0
- package/src/components/form/UploadButton/UploadButton.test.stories.tsx +454 -0
- package/src/components/form/UploadButton/UploadButton.tsx +312 -0
- package/src/components/form/UploadButton/UploadButton.types.ts +58 -0
- package/src/components/form/UploadButton/index.ts +2 -0
- package/src/components/form/index.ts +25 -0
- package/src/components/form/total-form/Fields/SelectField.tsx +57 -0
- package/src/components/form/total-form/Fields/TextField.tsx +58 -0
- package/src/components/form/total-form/Fields/index.ts +4 -0
- package/src/components/form/total-form/FormContainer.tsx +104 -0
- package/src/components/form/total-form/FormContext.tsx +38 -0
- package/src/components/form/total-form/FormErrorSnackbar.tsx +35 -0
- package/src/components/form/total-form/SubmitButton.tsx +27 -0
- package/src/components/form/total-form/index.ts +12 -0
- package/src/components/form/total-form/total-form.test.tsx +97 -0
- package/src/components/index.ts +7 -0
- package/src/components/layout/Accordion/Accordion.md +725 -0
- package/src/components/layout/Accordion/Accordion.stories.tsx +690 -0
- package/src/components/layout/Accordion/Accordion.test.stories.tsx +1362 -0
- package/src/components/layout/Accordion/Accordion.tsx +242 -0
- package/src/components/layout/Accordion/Accordion.types.ts +32 -0
- package/src/components/layout/Accordion/index.ts +8 -0
- package/src/components/layout/Card/Card.md +533 -0
- package/src/components/layout/Card/Card.stories.tsx +593 -0
- package/src/components/layout/Card/Card.test.stories.tsx +1134 -0
- package/src/components/layout/Card/Card.tsx +404 -0
- package/src/components/layout/Card/Card.types.ts +57 -0
- package/src/components/layout/Card/index.ts +8 -0
- package/src/components/layout/Collapsible/Collapsible.md +135 -0
- package/src/components/layout/Collapsible/Collapsible.stories.tsx +180 -0
- package/src/components/layout/Collapsible/Collapsible.test.stories.tsx +304 -0
- package/src/components/layout/Collapsible/Collapsible.tsx +198 -0
- package/src/components/layout/Collapsible/Collapsible.types.ts +35 -0
- package/src/components/layout/Collapsible/index.ts +6 -0
- package/src/components/layout/Container/Container.md +420 -0
- package/src/components/layout/Container/Container.stories.tsx +557 -0
- package/src/components/layout/Container/Container.test.stories.tsx +750 -0
- package/src/components/layout/Container/Container.tsx +72 -0
- package/src/components/layout/Container/Container.types.ts +11 -0
- package/src/components/layout/Container/index.ts +2 -0
- package/src/components/layout/ContentToolbar/ColumnsMenu.tsx +99 -0
- package/src/components/layout/ContentToolbar/ContentToolbar.md +75 -0
- package/src/components/layout/ContentToolbar/ContentToolbar.stories.tsx +129 -0
- package/src/components/layout/ContentToolbar/ContentToolbar.test.stories.tsx +251 -0
- package/src/components/layout/ContentToolbar/ContentToolbar.tsx +108 -0
- package/src/components/layout/ContentToolbar/ContentToolbar.types.ts +229 -0
- package/src/components/layout/ContentToolbar/FilterTrigger.tsx +71 -0
- package/src/components/layout/ContentToolbar/MultiSelectDropdown.tsx +297 -0
- package/src/components/layout/ContentToolbar/SavedViewsMenu.tsx +334 -0
- package/src/components/layout/ContentToolbar/SortByDropdown.tsx +213 -0
- package/src/components/layout/ContentToolbar/ViewSelector.tsx +98 -0
- package/src/components/layout/ContentToolbar/__tests__/ColumnsMenu.test.tsx +39 -0
- package/src/components/layout/ContentToolbar/__tests__/MultiSelectDropdown.test.tsx +110 -0
- package/src/components/layout/ContentToolbar/__tests__/SavedViewsMenu.test.tsx +99 -0
- package/src/components/layout/ContentToolbar/index.ts +24 -0
- package/src/components/layout/ContentToolbar/tests.md +42 -0
- package/src/components/layout/ContentToolbar/track.md +41 -0
- package/src/components/layout/Dashboard/Dashboard.md +71 -0
- package/src/components/layout/Dashboard/Dashboard.stories.tsx +104 -0
- package/src/components/layout/Dashboard/Dashboard.test.stories.tsx +164 -0
- package/src/components/layout/Dashboard/Dashboard.tsx +297 -0
- package/src/components/layout/Dashboard/Dashboard.types.ts +157 -0
- package/src/components/layout/Dashboard/DashboardContext.tsx +47 -0
- package/src/components/layout/Dashboard/DashboardParts.tsx +216 -0
- package/src/components/layout/Dashboard/index.ts +18 -0
- package/src/components/layout/Dashboard/tests.md +46 -0
- package/src/components/layout/Dashboard/track.md +50 -0
- package/src/components/layout/Drawer/Drawer.md +479 -0
- package/src/components/layout/Drawer/Drawer.stories.tsx +660 -0
- package/src/components/layout/Drawer/Drawer.test.stories.tsx +1339 -0
- package/src/components/layout/Drawer/Drawer.tsx +150 -0
- package/src/components/layout/Drawer/Drawer.types.ts +34 -0
- package/src/components/layout/Drawer/index.ts +2 -0
- package/src/components/layout/Resizable/Resizable.md +308 -0
- package/src/components/layout/Resizable/Resizable.stories.tsx +1039 -0
- package/src/components/layout/Resizable/Resizable.test.stories.tsx +750 -0
- package/src/components/layout/Resizable/Resizable.tsx +190 -0
- package/src/components/layout/Resizable/Resizable.types.ts +34 -0
- package/src/components/layout/Resizable/index.ts +2 -0
- package/src/components/layout/ScrollArea/ScrollArea.md +122 -0
- package/src/components/layout/ScrollArea/ScrollArea.stories.tsx +651 -0
- package/src/components/layout/ScrollArea/ScrollArea.test.stories.tsx +619 -0
- package/src/components/layout/ScrollArea/ScrollArea.tsx +449 -0
- package/src/components/layout/ScrollArea/ScrollArea.types.ts +80 -0
- package/src/components/layout/ScrollArea/index.ts +7 -0
- package/src/components/layout/Separator/Separator.stories.tsx +563 -0
- package/src/components/layout/Separator/Separator.test.stories.tsx +527 -0
- package/src/components/layout/Separator/Separator.tsx +187 -0
- package/src/components/layout/Separator/Separator.types.ts +17 -0
- package/src/components/layout/Separator/index.ts +2 -0
- package/src/components/layout/SettingsLayout/SettingsLayout.md +139 -0
- package/src/components/layout/SettingsLayout/SettingsLayout.parts.tsx +357 -0
- package/src/components/layout/SettingsLayout/SettingsLayout.stories.tsx +194 -0
- package/src/components/layout/SettingsLayout/SettingsLayout.test.stories.tsx +175 -0
- package/src/components/layout/SettingsLayout/SettingsLayout.tsx +69 -0
- package/src/components/layout/SettingsLayout/SettingsLayout.types.ts +61 -0
- package/src/components/layout/SettingsLayout/index.ts +6 -0
- package/src/components/layout/Sidebar/Sidebar.md +367 -0
- package/src/components/layout/Sidebar/Sidebar.stories.tsx +611 -0
- package/src/components/layout/Sidebar/Sidebar.test.stories.tsx +1326 -0
- package/src/components/layout/Sidebar/Sidebar.tsx +131 -0
- package/src/components/layout/Sidebar/Sidebar.types.ts +30 -0
- package/src/components/layout/Sidebar/index.ts +7 -0
- package/src/components/layout/Skeleton/Skeleton.md +240 -0
- package/src/components/layout/Skeleton/Skeleton.stories.tsx +689 -0
- package/src/components/layout/Skeleton/Skeleton.test.stories.tsx +521 -0
- package/src/components/layout/Skeleton/Skeleton.tsx +166 -0
- package/src/components/layout/Skeleton/Skeleton.types.ts +19 -0
- package/src/components/layout/Skeleton/index.ts +2 -0
- package/src/components/layout/Spacer/Spacer.md +84 -0
- package/src/components/layout/Spacer/Spacer.stories.tsx +502 -0
- package/src/components/layout/Spacer/Spacer.test.stories.tsx +472 -0
- package/src/components/layout/Spacer/Spacer.tsx +68 -0
- package/src/components/layout/Spacer/Spacer.types.ts +12 -0
- package/src/components/layout/Spacer/index.ts +2 -0
- package/src/components/layout/TableFilter/TableFilter.md +55 -0
- package/src/components/layout/TableFilter/TableFilter.stories.tsx +82 -0
- package/src/components/layout/TableFilter/TableFilter.test.stories.tsx +87 -0
- package/src/components/layout/TableFilter/TableFilter.tsx +383 -0
- package/src/components/layout/TableFilter/TableFilter.types.ts +87 -0
- package/src/components/layout/TableFilter/TableFilterContext.tsx +29 -0
- package/src/components/layout/TableFilter/index.ts +15 -0
- package/src/components/layout/TableFilter/tests.md +37 -0
- package/src/components/layout/TableFilter/track.md +36 -0
- package/src/components/layout/index.ts +14 -0
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.md +558 -0
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.stories.tsx +640 -0
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.test.stories.tsx +1007 -0
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.tsx +516 -0
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.types.ts +132 -0
- package/src/components/navigation/Breadcrumbs/index.ts +2 -0
- package/src/components/navigation/CommandPalette/CommandPalette.md +201 -0
- package/src/components/navigation/CommandPalette/CommandPalette.stories.tsx +384 -0
- package/src/components/navigation/CommandPalette/CommandPalette.test.stories.tsx +437 -0
- package/src/components/navigation/CommandPalette/CommandPalette.tsx +434 -0
- package/src/components/navigation/CommandPalette/CommandPalette.types.ts +25 -0
- package/src/components/navigation/CommandPalette/index.ts +2 -0
- package/src/components/navigation/ContextMenu/ContextMenu.md +535 -0
- package/src/components/navigation/ContextMenu/ContextMenu.stories.tsx +611 -0
- package/src/components/navigation/ContextMenu/ContextMenu.test.stories.tsx +850 -0
- package/src/components/navigation/ContextMenu/ContextMenu.tsx +254 -0
- package/src/components/navigation/ContextMenu/ContextMenu.types.ts +96 -0
- package/src/components/navigation/ContextMenu/index.ts +2 -0
- package/src/components/navigation/DropdownMenu/DropdownMenu.md +514 -0
- package/src/components/navigation/DropdownMenu/DropdownMenu.stories.tsx +580 -0
- package/src/components/navigation/DropdownMenu/DropdownMenu.test.stories.tsx +660 -0
- package/src/components/navigation/DropdownMenu/DropdownMenu.tsx +305 -0
- package/src/components/navigation/DropdownMenu/DropdownMenu.types.ts +116 -0
- package/src/components/navigation/DropdownMenu/index.ts +2 -0
- package/src/components/navigation/NavigationMenu/NavigationMenu.md +580 -0
- package/src/components/navigation/NavigationMenu/NavigationMenu.tsx +874 -0
- package/src/components/navigation/NavigationMenu/NavigationMenu.types.ts +135 -0
- package/src/components/navigation/NavigationMenu/index.ts +2 -0
- package/src/components/navigation/NavigationMenu/stories/NavigationMenu.stories.tsx +518 -0
- package/src/components/navigation/NavigationMenu/stories/NavigationMenu.test.stories.tsx +931 -0
- package/src/components/navigation/NavigationMenu/stories/NavigationMenuHorizontal.stories.tsx +503 -0
- package/src/components/navigation/NavigationMenu/stories/NavigationMenuVertical.stories.tsx +455 -0
- package/src/components/navigation/Pagination/Pagination.md +699 -0
- package/src/components/navigation/Pagination/Pagination.stories.tsx +604 -0
- package/src/components/navigation/Pagination/Pagination.test.stories.tsx +520 -0
- package/src/components/navigation/Pagination/Pagination.tsx +356 -0
- package/src/components/navigation/Pagination/Pagination.types.ts +129 -0
- package/src/components/navigation/Pagination/index.ts +2 -0
- package/src/components/navigation/Tabs/Tabs.md +774 -0
- package/src/components/navigation/Tabs/Tabs.stories.tsx +1006 -0
- package/src/components/navigation/Tabs/Tabs.test.stories.tsx +1225 -0
- package/src/components/navigation/Tabs/Tabs.tsx +433 -0
- package/src/components/navigation/Tabs/Tabs.types.ts +239 -0
- package/src/components/navigation/Tabs/index.ts +2 -0
- package/src/components/navigation/index.ts +7 -0
- package/src/components/typography/Blockquote/Blockquote.md +130 -0
- package/src/components/typography/Blockquote/Blockquote.stories.tsx +359 -0
- package/src/components/typography/Blockquote/Blockquote.test.stories.tsx +432 -0
- package/src/components/typography/Blockquote/Blockquote.tsx +166 -0
- package/src/components/typography/Blockquote/Blockquote.types.ts +11 -0
- package/src/components/typography/Blockquote/index.ts +2 -0
- package/src/components/typography/Code/Code.md +182 -0
- package/src/components/typography/Code/Code.stories.tsx +686 -0
- package/src/components/typography/Code/Code.test.stories.tsx +703 -0
- package/src/components/typography/Code/Code.tsx +228 -0
- package/src/components/typography/Code/Code.types.ts +12 -0
- package/src/components/typography/Code/index.ts +2 -0
- package/src/components/typography/Heading/Heading.md +143 -0
- package/src/components/typography/Heading/Heading.stories.tsx +451 -0
- package/src/components/typography/Heading/Heading.test.stories.tsx +830 -0
- package/src/components/typography/Heading/Heading.tsx +178 -0
- package/src/components/typography/Heading/Heading.types.ts +11 -0
- package/src/components/typography/Heading/index.ts +2 -0
- package/src/components/typography/Paragraph/Paragraph.md +80 -0
- package/src/components/typography/Paragraph/Paragraph.stories.tsx +280 -0
- package/src/components/typography/Paragraph/Paragraph.test.stories.tsx +238 -0
- package/src/components/typography/Paragraph/Paragraph.tsx +99 -0
- package/src/components/typography/Paragraph/Paragraph.types.ts +10 -0
- package/src/components/typography/Paragraph/index.ts +2 -0
- package/src/components/typography/Text/Text.md +129 -0
- package/src/components/typography/Text/Text.stories.tsx +359 -0
- package/src/components/typography/Text/Text.test.stories.tsx +762 -0
- package/src/components/typography/Text/Text.tsx +159 -0
- package/src/components/typography/Text/Text.types.ts +15 -0
- package/src/components/typography/Text/index.ts +2 -0
- package/src/components/typography/index.ts +5 -0
- package/src/components/utility/AnimatedIcon/AnimatedIcon.md +359 -0
- package/src/components/utility/AnimatedIcon/AnimatedIcon.stories.tsx +947 -0
- package/src/components/utility/AnimatedIcon/AnimatedIcon.test.stories.tsx +596 -0
- package/src/components/utility/AnimatedIcon/AnimatedIcon.tsx +595 -0
- package/src/components/utility/AnimatedIcon/AnimatedIcon.types.ts +98 -0
- package/src/components/utility/AnimatedIcon/index.ts +2 -0
- package/src/components/utility/AspectRatio/AspectRatio.md +200 -0
- package/src/components/utility/AspectRatio/AspectRatio.stories.tsx +414 -0
- package/src/components/utility/AspectRatio/AspectRatio.test.stories.tsx +859 -0
- package/src/components/utility/AspectRatio/AspectRatio.tsx +76 -0
- package/src/components/utility/AspectRatio/AspectRatio.types.ts +13 -0
- package/src/components/utility/AspectRatio/index.ts +2 -0
- package/src/components/utility/InfiniteScroll/InfiniteScroll.md +531 -0
- package/src/components/utility/InfiniteScroll/InfiniteScroll.stories.tsx +620 -0
- package/src/components/utility/InfiniteScroll/InfiniteScroll.test.stories.tsx +358 -0
- package/src/components/utility/InfiniteScroll/InfiniteScroll.tsx +204 -0
- package/src/components/utility/InfiniteScroll/InfiniteScroll.types.ts +39 -0
- package/src/components/utility/InfiniteScroll/index.ts +6 -0
- package/src/components/utility/Portal/Portal.button-container.example.tsx +99 -0
- package/src/components/utility/Portal/Portal.md +593 -0
- package/src/components/utility/Portal/Portal.stories.tsx +340 -0
- package/src/components/utility/Portal/Portal.test.stories.tsx +2086 -0
- package/src/components/utility/Portal/Portal.tsx +39 -0
- package/src/components/utility/Portal/Portal.types.ts +7 -0
- package/src/components/utility/Portal/index.ts +2 -0
- package/src/components/utility/Transition/Transition.md +684 -0
- package/src/components/utility/Transition/Transition.stories.tsx +493 -0
- package/src/components/utility/Transition/Transition.test.stories.tsx +854 -0
- package/src/components/utility/Transition/Transition.tsx +140 -0
- package/src/components/utility/Transition/Transition.types.ts +14 -0
- package/src/components/utility/Transition/index.ts +6 -0
- package/src/components/utility/VirtualList/VirtualList.md +520 -0
- package/src/components/utility/VirtualList/VirtualList.stories.tsx +1073 -0
- package/src/components/utility/VirtualList/VirtualList.test.stories.tsx +1074 -0
- package/src/components/utility/VirtualList/VirtualList.tsx +369 -0
- package/src/components/utility/VirtualList/VirtualList.types.ts +56 -0
- package/src/components/utility/VirtualList/index.ts +7 -0
- package/src/components/utility/WorkflowStep/WorkflowStep.md +187 -0
- package/src/components/utility/WorkflowStep/WorkflowStep.stories.tsx +433 -0
- package/src/components/utility/WorkflowStep/WorkflowStep.test.stories.tsx +364 -0
- package/src/components/utility/WorkflowStep/WorkflowStep.tsx +506 -0
- package/src/components/utility/WorkflowStep/WorkflowStep.types.ts +133 -0
- package/src/components/utility/WorkflowStep/index.ts +13 -0
- package/src/components/utility/index.ts +7 -0
- package/src/index.ts +17 -0
- package/src/mui/AppBar.ts +2 -0
- package/src/mui/Box.ts +2 -0
- package/src/mui/CssBaseline.ts +2 -0
- package/src/mui/FormControl.ts +2 -0
- package/src/mui/FormControlLabel.ts +2 -0
- package/src/mui/Grid2.ts +2 -0
- package/src/mui/InputLabel.ts +2 -0
- package/src/mui/List.ts +2 -0
- package/src/mui/ListItem.ts +2 -0
- package/src/mui/ListItemButton.ts +2 -0
- package/src/mui/ListItemText.ts +2 -0
- package/src/mui/Stack.ts +2 -0
- package/src/mui/SvgIcon.ts +2 -0
- package/src/mui/Toolbar.ts +2 -0
- package/src/mui/styles.ts +2 -0
- package/src/mui/useMediaQuery.ts +1 -0
- package/src/social-login-button.tsx +199 -0
- package/src/user-avatar.tsx +102 -0
- package/src/utils/cn.ts +9 -0
- package/src/utils/index.ts +1 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { CheckCircle } from '@mui/icons-material';
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Button,
|
|
5
|
+
styled,
|
|
6
|
+
Typography,
|
|
7
|
+
} from '@mui/material';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
import type { Step, StepItemProps, StepperProps } from './Stepper.types';
|
|
11
|
+
|
|
12
|
+
const StepperRoot = styled(Box, {
|
|
13
|
+
shouldForwardProp: (prop) => prop !== 'orientation',
|
|
14
|
+
})<{ orientation: 'horizontal' | 'vertical'; component?: React.ElementType }>(({ orientation }) => ({
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: orientation === 'horizontal' ? 'row' : 'column',
|
|
17
|
+
// Use flex-start to align all step circles at the same vertical position
|
|
18
|
+
alignItems: 'flex-start',
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
const StepItem = styled(Box, {
|
|
22
|
+
shouldForwardProp: (prop) => !['orientation', 'isLast'].includes(prop as string),
|
|
23
|
+
})<{ orientation: 'horizontal' | 'vertical'; isLast: boolean }>(({ orientation, isLast }) => ({
|
|
24
|
+
display: 'flex',
|
|
25
|
+
// For horizontal: row layout so connector appears beside step content
|
|
26
|
+
// For vertical: column layout so connector appears below step content
|
|
27
|
+
flexDirection: orientation === 'horizontal' ? 'row' : 'column',
|
|
28
|
+
// For horizontal: flex-start to keep circles aligned at top
|
|
29
|
+
// For vertical: center to align connector with centered circle
|
|
30
|
+
alignItems: orientation === 'horizontal' ? 'flex-start' : 'center',
|
|
31
|
+
flex: orientation === 'horizontal' && !isLast ? 1 : 'none',
|
|
32
|
+
position: 'relative',
|
|
33
|
+
// For vertical: ensure consistent width for proper centering
|
|
34
|
+
...(orientation === 'vertical' && {
|
|
35
|
+
width: '100%',
|
|
36
|
+
}),
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
/** Circle diameter per size. */
|
|
40
|
+
const CIRCLE_SIZE = { sm: 32, md: 48 } as const;
|
|
41
|
+
|
|
42
|
+
const StepButton = styled(Button, {
|
|
43
|
+
shouldForwardProp: (prop) =>
|
|
44
|
+
!['isActive', 'isCompleted', 'clickable', 'stepSize'].includes(prop as string),
|
|
45
|
+
})<{ isActive: boolean; isCompleted: boolean; clickable: boolean; stepSize: 'sm' | 'md' }>(
|
|
46
|
+
({ theme, isActive, isCompleted, clickable, stepSize }) => ({
|
|
47
|
+
minWidth: CIRCLE_SIZE[stepSize],
|
|
48
|
+
width: CIRCLE_SIZE[stepSize],
|
|
49
|
+
height: CIRCLE_SIZE[stepSize],
|
|
50
|
+
borderRadius: '50%',
|
|
51
|
+
padding: 0,
|
|
52
|
+
backgroundColor: isCompleted
|
|
53
|
+
? theme.palette.primary.main
|
|
54
|
+
: isActive
|
|
55
|
+
? theme.palette.primary.main
|
|
56
|
+
: theme.palette.grey[300],
|
|
57
|
+
color: isCompleted || isActive ? theme.palette.primary.contrastText : theme.palette.text.primary,
|
|
58
|
+
cursor: clickable ? 'pointer' : 'default',
|
|
59
|
+
pointerEvents: clickable ? 'auto' : 'none',
|
|
60
|
+
transition: theme.transitions.create(['background-color', 'transform'], {
|
|
61
|
+
duration: theme.transitions.duration.short,
|
|
62
|
+
}),
|
|
63
|
+
'&:hover': clickable
|
|
64
|
+
? {
|
|
65
|
+
backgroundColor: isCompleted
|
|
66
|
+
? theme.palette.primary.dark
|
|
67
|
+
: isActive
|
|
68
|
+
? theme.palette.primary.dark
|
|
69
|
+
: theme.palette.grey[400],
|
|
70
|
+
transform: 'scale(1.05)',
|
|
71
|
+
}
|
|
72
|
+
: {},
|
|
73
|
+
'&:disabled': {
|
|
74
|
+
backgroundColor: theme.palette.grey[300],
|
|
75
|
+
color: theme.palette.text.disabled,
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const StepConnector = styled(Box, {
|
|
81
|
+
shouldForwardProp: (prop) =>
|
|
82
|
+
!['orientation', 'isCompleted', 'size'].includes(prop as string),
|
|
83
|
+
})<{ orientation: 'horizontal' | 'vertical'; isCompleted: boolean; size: 'sm' | 'md' }>(
|
|
84
|
+
({ theme, orientation, isCompleted, size }) => ({
|
|
85
|
+
backgroundColor: isCompleted ? theme.palette.primary.main : theme.palette.grey[300],
|
|
86
|
+
transition: theme.transitions.create('background-color', {
|
|
87
|
+
duration: theme.transitions.duration.short,
|
|
88
|
+
}),
|
|
89
|
+
...(orientation === 'horizontal'
|
|
90
|
+
? {
|
|
91
|
+
flex: 1,
|
|
92
|
+
height: 2,
|
|
93
|
+
// Vertically centered on the circle (circle/2 - 1 for the 2px line).
|
|
94
|
+
marginTop: CIRCLE_SIZE[size] / 2 - 1,
|
|
95
|
+
marginLeft: 8,
|
|
96
|
+
marginRight: 8,
|
|
97
|
+
minWidth: 24,
|
|
98
|
+
}
|
|
99
|
+
: {
|
|
100
|
+
width: 2,
|
|
101
|
+
height: 32,
|
|
102
|
+
marginTop: 8,
|
|
103
|
+
marginBottom: 8,
|
|
104
|
+
// Use margin auto to center horizontally
|
|
105
|
+
marginLeft: 'auto',
|
|
106
|
+
marginRight: 'auto',
|
|
107
|
+
}),
|
|
108
|
+
}),
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
const StepLabel = styled(Box, {
|
|
112
|
+
shouldForwardProp: (prop) => prop !== 'orientation',
|
|
113
|
+
})<{ orientation: 'horizontal' | 'vertical' }>(({ orientation }) => ({
|
|
114
|
+
textAlign: 'center',
|
|
115
|
+
marginTop: orientation === 'horizontal' ? 8 : 0,
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
type StepSize = 'sm' | 'md';
|
|
119
|
+
type LabelVariant = 'caption' | 'body2';
|
|
120
|
+
|
|
121
|
+
/** Space-joined state classes for a step (active / completed / optional). */
|
|
122
|
+
function stepClasses(isActive: boolean, isCompleted: boolean, optional?: boolean): string {
|
|
123
|
+
return [
|
|
124
|
+
isActive && 'stepper-step-active',
|
|
125
|
+
isCompleted && 'stepper-step-completed',
|
|
126
|
+
optional && 'stepper-step-optional',
|
|
127
|
+
]
|
|
128
|
+
.filter(Boolean)
|
|
129
|
+
.join(' ');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** The circle content-column width per orientation/size. */
|
|
133
|
+
function contentSx(orientation: 'horizontal' | 'vertical', size: StepSize) {
|
|
134
|
+
return orientation === 'horizontal'
|
|
135
|
+
? { minWidth: size === 'sm' ? 56 : 80, maxWidth: 150, flex: '0 1 auto' }
|
|
136
|
+
: { flexShrink: 0 };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface StepPartProps {
|
|
140
|
+
step: Step;
|
|
141
|
+
index: number;
|
|
142
|
+
isActive: boolean;
|
|
143
|
+
size: StepSize;
|
|
144
|
+
labelVariant: LabelVariant;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** The step circle: a check when completed, otherwise the 1-based index. */
|
|
148
|
+
const StepCircle: React.FC<
|
|
149
|
+
StepPartProps & { isCompleted: boolean; isClickable: boolean; onClick: () => void }
|
|
150
|
+
> = ({ step, index, isActive, isCompleted, isClickable, size, labelVariant, onClick }) => {
|
|
151
|
+
const state = isCompleted ? ' (completed)' : isActive ? ' (current)' : '';
|
|
152
|
+
return (
|
|
153
|
+
<StepButton
|
|
154
|
+
isActive={isActive}
|
|
155
|
+
isCompleted={isCompleted}
|
|
156
|
+
clickable={isClickable}
|
|
157
|
+
stepSize={size}
|
|
158
|
+
onClick={onClick}
|
|
159
|
+
disabled={step.disabled}
|
|
160
|
+
aria-current={isActive ? 'step' : undefined}
|
|
161
|
+
aria-label={`Step ${index + 1}: ${step.label}${step.optional ? ' (optional)' : ''}${state}`}
|
|
162
|
+
data-testid={`stepper-step-icon-${index}`}
|
|
163
|
+
>
|
|
164
|
+
{isCompleted ? (
|
|
165
|
+
<CheckCircle sx={{ fontSize: size === 'sm' ? 18 : 24 }} />
|
|
166
|
+
) : (
|
|
167
|
+
<Typography variant={labelVariant} fontWeight="bold">
|
|
168
|
+
{index + 1}
|
|
169
|
+
</Typography>
|
|
170
|
+
)}
|
|
171
|
+
</StepButton>
|
|
172
|
+
);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/** The step label block: title, optional marker, and description. */
|
|
176
|
+
const StepLabelBlock: React.FC<StepPartProps & { orientation: 'horizontal' | 'vertical' }> = ({
|
|
177
|
+
step,
|
|
178
|
+
index,
|
|
179
|
+
isActive,
|
|
180
|
+
orientation,
|
|
181
|
+
size,
|
|
182
|
+
labelVariant,
|
|
183
|
+
}) => (
|
|
184
|
+
<StepLabel
|
|
185
|
+
orientation={orientation}
|
|
186
|
+
data-testid={`stepper-step-label-${index}`}
|
|
187
|
+
sx={size === 'sm' && orientation === 'horizontal' ? { mt: '2px' } : undefined}
|
|
188
|
+
>
|
|
189
|
+
<Typography
|
|
190
|
+
variant={labelVariant}
|
|
191
|
+
fontWeight={isActive ? 'bold' : 'normal'}
|
|
192
|
+
color={isActive ? 'primary' : 'textPrimary'}
|
|
193
|
+
>
|
|
194
|
+
{step.label}
|
|
195
|
+
{step.optional && (
|
|
196
|
+
<Typography component="span" variant="caption" color="textSecondary" sx={{ ml: 1 }}>
|
|
197
|
+
(optional)
|
|
198
|
+
</Typography>
|
|
199
|
+
)}
|
|
200
|
+
</Typography>
|
|
201
|
+
{step.description && (
|
|
202
|
+
<Typography variant="caption" color="textSecondary" display="block">
|
|
203
|
+
{step.description}
|
|
204
|
+
</Typography>
|
|
205
|
+
)}
|
|
206
|
+
</StepLabel>
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
const StepperItem: React.FC<StepItemProps> = ({
|
|
210
|
+
step,
|
|
211
|
+
index,
|
|
212
|
+
isActive,
|
|
213
|
+
isCompleted,
|
|
214
|
+
isLast,
|
|
215
|
+
orientation,
|
|
216
|
+
size,
|
|
217
|
+
variant,
|
|
218
|
+
clickable,
|
|
219
|
+
onStepClick,
|
|
220
|
+
renderConnector,
|
|
221
|
+
nextStep,
|
|
222
|
+
}) => {
|
|
223
|
+
const labelVariant: LabelVariant = size === 'sm' ? 'caption' : 'body2';
|
|
224
|
+
const isClickable = Boolean(clickable) && !step.disabled && (variant === 'non-linear' || !isActive);
|
|
225
|
+
const handleStepClick = () => {
|
|
226
|
+
if (isClickable && onStepClick) onStepClick(step.id);
|
|
227
|
+
};
|
|
228
|
+
const connector =
|
|
229
|
+
renderConnector && nextStep ? (
|
|
230
|
+
renderConnector(step, nextStep, { completed: isCompleted, active: isActive })
|
|
231
|
+
) : (
|
|
232
|
+
<StepConnector orientation={orientation} isCompleted={isCompleted} size={size} data-testid={`stepper-connector-${index}`} />
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
return (
|
|
236
|
+
<StepItem
|
|
237
|
+
orientation={orientation}
|
|
238
|
+
isLast={isLast}
|
|
239
|
+
role="listitem"
|
|
240
|
+
data-testid={`stepper-step-${index}`}
|
|
241
|
+
className={stepClasses(isActive, isCompleted, step.optional)}
|
|
242
|
+
>
|
|
243
|
+
<Box
|
|
244
|
+
display="flex"
|
|
245
|
+
flexDirection="column"
|
|
246
|
+
alignItems="center"
|
|
247
|
+
data-testid={`stepper-step-content-${index}`}
|
|
248
|
+
sx={contentSx(orientation, size)}
|
|
249
|
+
>
|
|
250
|
+
<StepCircle
|
|
251
|
+
step={step}
|
|
252
|
+
index={index}
|
|
253
|
+
isActive={isActive}
|
|
254
|
+
isCompleted={isCompleted}
|
|
255
|
+
isClickable={isClickable}
|
|
256
|
+
size={size}
|
|
257
|
+
labelVariant={labelVariant}
|
|
258
|
+
onClick={handleStepClick}
|
|
259
|
+
/>
|
|
260
|
+
<StepLabelBlock
|
|
261
|
+
step={step}
|
|
262
|
+
index={index}
|
|
263
|
+
isActive={isActive}
|
|
264
|
+
orientation={orientation}
|
|
265
|
+
size={size}
|
|
266
|
+
labelVariant={labelVariant}
|
|
267
|
+
/>
|
|
268
|
+
</Box>
|
|
269
|
+
{!isLast && connector}
|
|
270
|
+
</StepItem>
|
|
271
|
+
);
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
export const Stepper: React.FC<StepperProps> = ({
|
|
275
|
+
steps,
|
|
276
|
+
activeId,
|
|
277
|
+
completed = new Set(),
|
|
278
|
+
orientation = 'horizontal',
|
|
279
|
+
size = 'md',
|
|
280
|
+
variant = 'linear',
|
|
281
|
+
onStepChange,
|
|
282
|
+
clickable,
|
|
283
|
+
renderConnector,
|
|
284
|
+
className,
|
|
285
|
+
'data-testid': dataTestId,
|
|
286
|
+
}) => {
|
|
287
|
+
// Determine clickable behavior
|
|
288
|
+
const isClickable = clickable ?? variant === 'non-linear';
|
|
289
|
+
|
|
290
|
+
return (
|
|
291
|
+
<StepperRoot
|
|
292
|
+
component="ol"
|
|
293
|
+
orientation={orientation}
|
|
294
|
+
className={className}
|
|
295
|
+
data-testid={dataTestId || 'stepper-container'}
|
|
296
|
+
sx={{
|
|
297
|
+
listStyle: 'none',
|
|
298
|
+
padding: 0,
|
|
299
|
+
margin: 0,
|
|
300
|
+
}}
|
|
301
|
+
>
|
|
302
|
+
{steps.map((step, index) => {
|
|
303
|
+
const isActive = step.id === activeId;
|
|
304
|
+
const isCompleted = completed.has(step.id);
|
|
305
|
+
const isLast = index === steps.length - 1;
|
|
306
|
+
const nextStep = !isLast ? steps[index + 1] : undefined;
|
|
307
|
+
|
|
308
|
+
return (
|
|
309
|
+
<StepperItem
|
|
310
|
+
key={step.id}
|
|
311
|
+
step={step}
|
|
312
|
+
index={index}
|
|
313
|
+
isActive={isActive}
|
|
314
|
+
isCompleted={isCompleted}
|
|
315
|
+
isLast={isLast}
|
|
316
|
+
orientation={orientation}
|
|
317
|
+
size={size}
|
|
318
|
+
variant={variant}
|
|
319
|
+
clickable={isClickable}
|
|
320
|
+
onStepClick={onStepChange}
|
|
321
|
+
renderConnector={renderConnector}
|
|
322
|
+
nextStep={nextStep}
|
|
323
|
+
/>
|
|
324
|
+
);
|
|
325
|
+
})}
|
|
326
|
+
</StepperRoot>
|
|
327
|
+
);
|
|
328
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface Step {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
optional?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ConnectorState {
|
|
12
|
+
completed: boolean;
|
|
13
|
+
active: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface StepperProps {
|
|
17
|
+
/**
|
|
18
|
+
* Array of step configurations defining the stepper flow
|
|
19
|
+
*/
|
|
20
|
+
steps: Step[];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* ID of the currently active step
|
|
24
|
+
*/
|
|
25
|
+
activeId: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Set of step IDs that have been completed
|
|
29
|
+
*/
|
|
30
|
+
completed?: Set<string>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Display orientation of the stepper
|
|
34
|
+
* @default 'horizontal'
|
|
35
|
+
*/
|
|
36
|
+
orientation?: 'horizontal' | 'vertical';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Visual size of the step circles + labels. `'sm'` is a compact variant that
|
|
40
|
+
* takes far less vertical space — useful above the fold on mobile checkouts.
|
|
41
|
+
* @default 'md'
|
|
42
|
+
*/
|
|
43
|
+
size?: 'sm' | 'md';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Navigation variant controlling step access
|
|
47
|
+
* - 'linear': Users can only progress to next step after completing current
|
|
48
|
+
* - 'non-linear': Users can jump to any enabled step
|
|
49
|
+
* @default 'linear'
|
|
50
|
+
*/
|
|
51
|
+
variant?: 'linear' | 'non-linear';
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Callback fired when a step is clicked or navigated to
|
|
55
|
+
*/
|
|
56
|
+
onStepChange?: (id: string) => void;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Whether steps are clickable for navigation
|
|
60
|
+
* @default false for linear, true for non-linear
|
|
61
|
+
*/
|
|
62
|
+
clickable?: boolean;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Custom connector renderer between steps
|
|
66
|
+
*/
|
|
67
|
+
renderConnector?: (
|
|
68
|
+
from: Step,
|
|
69
|
+
to: Step,
|
|
70
|
+
state: ConnectorState,
|
|
71
|
+
) => ReactNode;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Additional CSS class name
|
|
75
|
+
*/
|
|
76
|
+
className?: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Test identifier
|
|
80
|
+
*/
|
|
81
|
+
'data-testid'?: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface StepItemProps {
|
|
85
|
+
step: Step;
|
|
86
|
+
index: number;
|
|
87
|
+
isActive: boolean;
|
|
88
|
+
isCompleted: boolean;
|
|
89
|
+
isLast: boolean;
|
|
90
|
+
orientation: 'horizontal' | 'vertical';
|
|
91
|
+
size: 'sm' | 'md';
|
|
92
|
+
variant: 'linear' | 'non-linear';
|
|
93
|
+
clickable: boolean;
|
|
94
|
+
onStepClick?: (id: string) => void;
|
|
95
|
+
renderConnector?: StepperProps['renderConnector'];
|
|
96
|
+
nextStep?: Step;
|
|
97
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# Table Component
|
|
2
|
+
|
|
3
|
+
A comprehensive data table component with advanced features including sorting, filtering, pagination, row selection, virtual scrolling, and responsive design.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Table } from '@procurement/ui';
|
|
9
|
+
|
|
10
|
+
// Basic usage with columns and data
|
|
11
|
+
<Table
|
|
12
|
+
columns={columns}
|
|
13
|
+
data={data}
|
|
14
|
+
sortable
|
|
15
|
+
selectable
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
// With MUI TableContainer (backward compatible)
|
|
19
|
+
<TableContainer component={Paper}>
|
|
20
|
+
<Table>
|
|
21
|
+
<TableHead>
|
|
22
|
+
<TableRow>
|
|
23
|
+
<TableCell>Name</TableCell>
|
|
24
|
+
<TableCell>Email</TableCell>
|
|
25
|
+
</TableRow>
|
|
26
|
+
</TableHead>
|
|
27
|
+
<TableBody>
|
|
28
|
+
{data.map(row => (
|
|
29
|
+
<TableRow key={row.id}>
|
|
30
|
+
<TableCell>{row.name}</TableCell>
|
|
31
|
+
<TableCell>{row.email}</TableCell>
|
|
32
|
+
</TableRow>
|
|
33
|
+
))}
|
|
34
|
+
</TableBody>
|
|
35
|
+
</Table>
|
|
36
|
+
</TableContainer>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Props
|
|
40
|
+
|
|
41
|
+
### Core Props
|
|
42
|
+
|
|
43
|
+
- **columns** `ColumnConfig[]` - Column definitions for the table
|
|
44
|
+
- **data** `any[]` - Array of data objects to display
|
|
45
|
+
- **variant** `'default' | 'striped' | 'glass' | 'minimal' | 'gradient'` - Visual style variant
|
|
46
|
+
- **density** `'compact' | 'normal' | 'comfortable'` - Row height/padding density
|
|
47
|
+
|
|
48
|
+
### Features
|
|
49
|
+
|
|
50
|
+
- **sortable** `boolean` - Enable column sorting functionality
|
|
51
|
+
- **sortConfig** `SortConfig` - Current sort configuration
|
|
52
|
+
- **onSortChange** `(key: string, direction: 'asc' | 'desc') => void` - Sort change handler
|
|
53
|
+
- **selectable** `boolean` - Enable row selection
|
|
54
|
+
- **selectedRows** `(string | number)[]` - Currently selected row IDs
|
|
55
|
+
- **onSelectionChange** `(rows: (string | number)[]) => void` - Selection change handler
|
|
56
|
+
- **stickyHeader** `boolean` - Keep header fixed when scrolling
|
|
57
|
+
- **responsive** `boolean` - Enable responsive column hiding
|
|
58
|
+
- **virtualScrolling** `boolean` - Enable virtual scrolling for large datasets
|
|
59
|
+
- **loading** `boolean` - Show loading state
|
|
60
|
+
- **hoverable** `boolean` - Enable row hover effects
|
|
61
|
+
|
|
62
|
+
### Visual Effects
|
|
63
|
+
|
|
64
|
+
- **glow** `boolean` - Add glow effect to the table
|
|
65
|
+
- **pulse** `boolean` - Add pulse animation effect
|
|
66
|
+
- **glass** `boolean` - Apply glassmorphism effect
|
|
67
|
+
|
|
68
|
+
### Container Props
|
|
69
|
+
|
|
70
|
+
- **containerHeight** `number` - Fixed height for scrollable container
|
|
71
|
+
- **rowHeight** `number` - Height per row (for virtual scrolling)
|
|
72
|
+
- **overscan** `number` - Number of rows to render outside viewport
|
|
73
|
+
|
|
74
|
+
### Column Configuration
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
interface ColumnConfig {
|
|
78
|
+
key: string;
|
|
79
|
+
label: string;
|
|
80
|
+
sortable?: boolean;
|
|
81
|
+
width?: number | string;
|
|
82
|
+
align?: 'left' | 'center' | 'right';
|
|
83
|
+
priority?: number; // For responsive hiding
|
|
84
|
+
render?: (value: any, rowData: any) => React.ReactNode;
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Features
|
|
89
|
+
|
|
90
|
+
### Sorting
|
|
91
|
+
Enable sortable columns with click-to-sort functionality:
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<Table
|
|
95
|
+
columns={columns}
|
|
96
|
+
data={data}
|
|
97
|
+
sortable
|
|
98
|
+
sortConfig={sortConfig}
|
|
99
|
+
onSortChange={(key, direction) => handleSort(key, direction)}
|
|
100
|
+
/>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Row Selection
|
|
104
|
+
Support single or multiple row selection:
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
<Table
|
|
108
|
+
columns={columns}
|
|
109
|
+
data={data}
|
|
110
|
+
selectable
|
|
111
|
+
selectedRows={selectedRows}
|
|
112
|
+
onSelectionChange={setSelectedRows}
|
|
113
|
+
/>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Virtual Scrolling
|
|
117
|
+
Handle large datasets efficiently:
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
<Table
|
|
121
|
+
columns={columns}
|
|
122
|
+
data={largeDataset} // 10,000+ rows
|
|
123
|
+
virtualScrolling
|
|
124
|
+
rowHeight={52}
|
|
125
|
+
containerHeight={400}
|
|
126
|
+
overscan={10}
|
|
127
|
+
/>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Responsive Design
|
|
131
|
+
Automatically hide/show columns based on viewport:
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
<Table
|
|
135
|
+
columns={columns}
|
|
136
|
+
data={data}
|
|
137
|
+
responsive
|
|
138
|
+
columnPriorities={[1, 2, 3, 4, 5]}
|
|
139
|
+
showColumnToggle
|
|
140
|
+
/>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Custom Cell Rendering
|
|
144
|
+
Customize how cells are rendered:
|
|
145
|
+
|
|
146
|
+
```tsx
|
|
147
|
+
const columns = [
|
|
148
|
+
{
|
|
149
|
+
key: 'status',
|
|
150
|
+
label: 'Status',
|
|
151
|
+
render: (value) => (
|
|
152
|
+
<Chip
|
|
153
|
+
label={value}
|
|
154
|
+
color={value === 'Active' ? 'success' : 'default'}
|
|
155
|
+
/>
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
];
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Variants
|
|
162
|
+
|
|
163
|
+
- **default** - Standard table appearance
|
|
164
|
+
- **striped** - Alternating row backgrounds
|
|
165
|
+
- **glass** - Glassmorphism effect with transparency
|
|
166
|
+
- **minimal** - Clean, minimal borders
|
|
167
|
+
- **gradient** - Gradient background effect
|
|
168
|
+
|
|
169
|
+
## Density Options
|
|
170
|
+
|
|
171
|
+
- **compact** - Reduced padding for more data density
|
|
172
|
+
- **normal** - Standard padding (default)
|
|
173
|
+
- **comfortable** - Extra padding for improved readability
|
|
174
|
+
|
|
175
|
+
## Accessibility
|
|
176
|
+
|
|
177
|
+
- Proper `role="table"` attributes
|
|
178
|
+
- `aria-sort` for sortable columns
|
|
179
|
+
- `aria-selected` for selectable rows
|
|
180
|
+
- Keyboard navigation support (Tab, Arrow keys)
|
|
181
|
+
- Screen reader announcements for interactions
|
|
182
|
+
- Focus management for interactive elements
|
|
183
|
+
|
|
184
|
+
## Best Practices
|
|
185
|
+
|
|
186
|
+
1. **Large Datasets**: Use virtual scrolling for datasets over 100 rows
|
|
187
|
+
2. **Responsive Tables**: Set column priorities based on importance
|
|
188
|
+
3. **Custom Rendering**: Use render functions for complex cell content
|
|
189
|
+
4. **Performance**: Enable `virtualScrolling` for large datasets
|
|
190
|
+
5. **Accessibility**: Always provide column labels and proper ARIA attributes
|
|
191
|
+
6. **Loading States**: Show loading indicator during data fetching
|
|
192
|
+
7. **Empty States**: Provide meaningful empty state messages
|
|
193
|
+
|
|
194
|
+
## Examples
|
|
195
|
+
|
|
196
|
+
### Complete Feature Set
|
|
197
|
+
```tsx
|
|
198
|
+
<Table
|
|
199
|
+
columns={columns}
|
|
200
|
+
data={data}
|
|
201
|
+
|
|
202
|
+
// Features
|
|
203
|
+
sortable
|
|
204
|
+
selectable
|
|
205
|
+
stickyHeader
|
|
206
|
+
responsive
|
|
207
|
+
virtualScrolling
|
|
208
|
+
|
|
209
|
+
// Visual
|
|
210
|
+
variant="gradient"
|
|
211
|
+
density="comfortable"
|
|
212
|
+
glow
|
|
213
|
+
hoverable
|
|
214
|
+
|
|
215
|
+
// Handlers
|
|
216
|
+
onSortChange={handleSort}
|
|
217
|
+
onSelectionChange={handleSelection}
|
|
218
|
+
onRowClick={handleRowClick}
|
|
219
|
+
|
|
220
|
+
// Container
|
|
221
|
+
containerHeight={400}
|
|
222
|
+
/>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Backward Compatible Usage
|
|
226
|
+
```tsx
|
|
227
|
+
<TableContainer>
|
|
228
|
+
<Table variant="striped" hoverable>
|
|
229
|
+
<TableHead>
|
|
230
|
+
<TableRow>
|
|
231
|
+
<TableCell>Header 1</TableCell>
|
|
232
|
+
<TableCell>Header 2</TableCell>
|
|
233
|
+
</TableRow>
|
|
234
|
+
</TableHead>
|
|
235
|
+
<TableBody>
|
|
236
|
+
<TableRow>
|
|
237
|
+
<TableCell>Data 1</TableCell>
|
|
238
|
+
<TableCell>Data 2</TableCell>
|
|
239
|
+
</TableRow>
|
|
240
|
+
</TableBody>
|
|
241
|
+
</Table>
|
|
242
|
+
</TableContainer>
|
|
243
|
+
```
|