@majapisoftwares/ui 4.3.16 → 5.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/AGENTS.md +17 -0
- package/README.md +71 -0
- package/THIRD_PARTY_NOTICES.md +15 -0
- package/components.json +25 -0
- package/docs/MIGRATION-0.2.md +20 -0
- package/docs/NEXT-STARTER-VALIDATION.md +14 -0
- package/docs/STANDARDS.md +36 -0
- package/docs/VALIDATION.md +11 -0
- package/package.json +69 -2
- package/scripts/check-standards.mjs +39 -0
- package/src/components/ui/alert.tsx +77 -0
- package/src/components/ui/badge.tsx +55 -0
- package/src/components/ui/button.tsx +63 -0
- package/src/components/ui/empty.tsx +105 -0
- package/src/components/ui/field.tsx +238 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +19 -0
- package/src/components/ui/native-select.tsx +66 -0
- package/src/components/ui/separator.tsx +24 -0
- package/src/components/ui/sheet.tsx +137 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/table.tsx +115 -0
- package/src/components/ui/tabs.tsx +81 -0
- package/src/lib/utils.ts +1 -0
- package/src/patterns/app-shell.tsx +70 -0
- package/src/patterns/data-table.tsx +225 -0
- package/src/patterns/details-sheet.tsx +51 -0
- package/src/patterns/page-header.tsx +40 -0
- package/src/patterns/status-badge.tsx +23 -0
- package/src/styles.css +465 -0
- package/src/templates/admin-dashboard.tsx +63 -0
- package/src/templates/auth-layout.tsx +36 -0
- package/src/templates/login-form.tsx +97 -0
- package/src/templates/signup-form.tsx +137 -0
- package/src/vite-env.d.ts +1 -0
- package/base.css +0 -360
- package/bootstrap/AppProps.d.ts +0 -9
- package/bootstrap/AppProps.js +0 -1
- package/bootstrap/index.d.ts +0 -1
- package/bootstrap/index.js +0 -1
- package/bootstrap/modeScript.d.ts +0 -2
- package/bootstrap/modeScript.js +0 -35
- package/bootstrap/nprogress.d.ts +0 -1
- package/bootstrap/nprogress.js +0 -19
- package/bootstrap/scrolledScript.d.ts +0 -2
- package/bootstrap/scrolledScript.js +0 -27
- package/bootstrap/setupFocusManager.d.ts +0 -1
- package/bootstrap/setupFocusManager.js +0 -13
- package/bootstrap/suppressConsoleLog.d.ts +0 -1
- package/bootstrap/suppressConsoleLog.js +0 -8
- package/components/Accordion/Accordion.d.ts +0 -16
- package/components/Accordion/Accordion.jsx +0 -27
- package/components/Accordion/index.d.ts +0 -3
- package/components/Accordion/index.jsx +0 -3
- package/components/Alert/Alert.d.ts +0 -31
- package/components/Alert/Alert.jsx +0 -53
- package/components/Alert/index.d.ts +0 -3
- package/components/Alert/index.jsx +0 -3
- package/components/AntiClickjacking/AntiClickjacking.d.ts +0 -1
- package/components/AntiClickjacking/AntiClickjacking.jsx +0 -17
- package/components/AntiClickjacking/index.d.ts +0 -2
- package/components/AntiClickjacking/index.jsx +0 -2
- package/components/Aurora/Aurora.d.ts +0 -10
- package/components/Aurora/Aurora.jsx +0 -189
- package/components/Aurora/index.d.ts +0 -3
- package/components/Aurora/index.jsx +0 -3
- package/components/Autocomplete/Autocomplete.d.ts +0 -7
- package/components/Autocomplete/Autocomplete.jsx +0 -23
- package/components/Autocomplete/UnstyledAutocomplete.d.ts +0 -36
- package/components/Autocomplete/UnstyledAutocomplete.jsx +0 -72
- package/components/Autocomplete/index.d.ts +0 -5
- package/components/Autocomplete/index.jsx +0 -5
- package/components/BackgroundEffects/BottomBlurryPoint.d.ts +0 -3
- package/components/BackgroundEffects/BottomBlurryPoint.jsx +0 -14
- package/components/BackgroundEffects/TopBlurryPoint.d.ts +0 -3
- package/components/BackgroundEffects/TopBlurryPoint.jsx +0 -14
- package/components/Badge/Badge.d.ts +0 -42
- package/components/Badge/Badge.jsx +0 -51
- package/components/Badge/index.d.ts +0 -3
- package/components/Badge/index.jsx +0 -3
- package/components/Breadcrumbs/Breadcrumbs.d.ts +0 -20
- package/components/Breadcrumbs/Breadcrumbs.jsx +0 -42
- package/components/Breadcrumbs/index.d.ts +0 -3
- package/components/Breadcrumbs/index.jsx +0 -3
- package/components/Button/Button.d.ts +0 -111
- package/components/Button/Button.jsx +0 -129
- package/components/Button/UnstyledButton.d.ts +0 -10
- package/components/Button/UnstyledButton.jsx +0 -13
- package/components/Button/index.d.ts +0 -3
- package/components/Button/index.jsx +0 -3
- package/components/Carousel/Carousel.d.ts +0 -19
- package/components/Carousel/Carousel.jsx +0 -55
- package/components/Carousel/index.d.ts +0 -3
- package/components/Carousel/index.jsx +0 -3
- package/components/Checkbox/Checkbox.d.ts +0 -14
- package/components/Checkbox/Checkbox.jsx +0 -45
- package/components/Checkbox/index.d.ts +0 -3
- package/components/Checkbox/index.js +0 -3
- package/components/Code/Code.d.ts +0 -12
- package/components/Code/Code.jsx +0 -25
- package/components/Code/Json.d.ts +0 -5
- package/components/Code/Json.jsx +0 -7
- package/components/Code/index.d.ts +0 -4
- package/components/Code/index.jsx +0 -4
- package/components/ConfirmationButton/ConfirmationButton.d.ts +0 -17
- package/components/ConfirmationButton/ConfirmationButton.jsx +0 -13
- package/components/ConfirmationButton/index.d.ts +0 -3
- package/components/ConfirmationButton/index.jsx +0 -3
- package/components/ContextMenu/ContextMenu.d.ts +0 -28
- package/components/ContextMenu/ContextMenu.jsx +0 -70
- package/components/ContextMenu/index.d.ts +0 -3
- package/components/ContextMenu/index.jsx +0 -3
- package/components/CopyButton/CopyButton.d.ts +0 -7
- package/components/CopyButton/CopyButton.jsx +0 -29
- package/components/CopyButton/index.d.ts +0 -3
- package/components/CopyButton/index.jsx +0 -3
- package/components/DateInput/DateInput.d.ts +0 -6
- package/components/DateInput/DateInput.jsx +0 -19
- package/components/DateInput/DateTimeInput.d.ts +0 -3
- package/components/DateInput/DateTimeInput.jsx +0 -8
- package/components/DateInput/index.d.ts +0 -4
- package/components/DateInput/index.jsx +0 -4
- package/components/DateInput/useRefValue.d.ts +0 -5
- package/components/DateInput/useRefValue.js +0 -48
- package/components/DatePicker/DatePicker.d.ts +0 -19
- package/components/DatePicker/DatePicker.jsx +0 -55
- package/components/DatePicker/index.d.ts +0 -3
- package/components/DatePicker/index.jsx +0 -3
- package/components/DateRangePicker/DateRangePicker.d.ts +0 -16
- package/components/DateRangePicker/DateRangePicker.jsx +0 -56
- package/components/DateRangePicker/index.d.ts +0 -3
- package/components/DateRangePicker/index.jsx +0 -3
- package/components/Dialog/Dialog.d.ts +0 -25
- package/components/Dialog/Dialog.jsx +0 -35
- package/components/Dialog/Dialogs.d.ts +0 -1
- package/components/Dialog/Dialogs.jsx +0 -21
- package/components/Dialog/dialogs.state.d.ts +0 -21
- package/components/Dialog/dialogs.state.js +0 -40
- package/components/Dialog/index.d.ts +0 -6
- package/components/Dialog/index.jsx +0 -7
- package/components/Drawer/Drawer.d.ts +0 -15
- package/components/Drawer/Drawer.jsx +0 -72
- package/components/Drawer/index.d.ts +0 -3
- package/components/Drawer/index.jsx +0 -3
- package/components/DropdownMenu/DropdownMenu.d.ts +0 -33
- package/components/DropdownMenu/DropdownMenu.jsx +0 -74
- package/components/DropdownMenu/index.d.ts +0 -3
- package/components/DropdownMenu/index.jsx +0 -3
- package/components/ErrorBoundary/ErrorBoundary.d.ts +0 -18
- package/components/ErrorBoundary/ErrorBoundary.jsx +0 -32
- package/components/ErrorBoundary/index.d.ts +0 -3
- package/components/ErrorBoundary/index.jsx +0 -3
- package/components/ErrorPage/Error404Page.d.ts +0 -1
- package/components/ErrorPage/Error404Page.jsx +0 -4
- package/components/ErrorPage/Error500Page.d.ts +0 -1
- package/components/ErrorPage/Error500Page.jsx +0 -4
- package/components/ErrorPage/ErrorPage.d.ts +0 -11
- package/components/ErrorPage/ErrorPage.jsx +0 -23
- package/components/FileInput/FileInput.d.ts +0 -53
- package/components/FileInput/FileInput.jsx +0 -141
- package/components/FileInput/PreviewFile.d.ts +0 -18
- package/components/FileInput/PreviewFile.jsx +0 -54
- package/components/FileInput/index.d.ts +0 -3
- package/components/FileInput/index.jsx +0 -3
- package/components/FileInput/isImage.d.ts +0 -1
- package/components/FileInput/isImage.js +0 -10
- package/components/FileInput/isVideo.d.ts +0 -1
- package/components/FileInput/isVideo.js +0 -10
- package/components/FileSelect/FileSelect.d.ts +0 -31
- package/components/FileSelect/FileSelect.jsx +0 -146
- package/components/FileSelect/index.d.ts +0 -3
- package/components/FileSelect/index.jsx +0 -3
- package/components/Footer/Footer.d.ts +0 -19
- package/components/Footer/Footer.jsx +0 -30
- package/components/Footer/index.d.ts +0 -3
- package/components/Footer/index.jsx +0 -3
- package/components/GridPattern/GridPattern.d.ts +0 -2
- package/components/GridPattern/GridPattern.jsx +0 -12
- package/components/GridPattern/index.d.ts +0 -3
- package/components/GridPattern/index.jsx +0 -3
- package/components/Group/Group.d.ts +0 -5
- package/components/Group/Group.jsx +0 -6
- package/components/Group/index.d.ts +0 -3
- package/components/Group/index.jsx +0 -3
- package/components/Header/Header.d.ts +0 -5
- package/components/Header/Header.jsx +0 -19
- package/components/Header/index.d.ts +0 -3
- package/components/Header/index.jsx +0 -3
- package/components/ImageInput/ImageInput.d.ts +0 -4
- package/components/ImageInput/ImageInput.jsx +0 -8
- package/components/ImageInput/index.d.ts +0 -3
- package/components/ImageInput/index.jsx +0 -3
- package/components/Input/Input.d.ts +0 -14
- package/components/Input/Input.jsx +0 -57
- package/components/Input/InputIcon.d.ts +0 -9
- package/components/Input/InputIcon.jsx +0 -7
- package/components/Input/MultiSelectInput.d.ts +0 -16
- package/components/Input/MultiSelectInput.jsx +0 -48
- package/components/Input/NumericInput.d.ts +0 -6
- package/components/Input/NumericInput.jsx +0 -6
- package/components/Input/PatternInput.d.ts +0 -6
- package/components/Input/PatternInput.jsx +0 -6
- package/components/Input/SelectInput.d.ts +0 -12
- package/components/Input/SelectInput.jsx +0 -25
- package/components/Input/UnstyledInput.d.ts +0 -22
- package/components/Input/UnstyledInput.jsx +0 -28
- package/components/Input/index.d.ts +0 -6
- package/components/Input/index.jsx +0 -6
- package/components/Input/useInputRefValue.d.ts +0 -11
- package/components/Input/useInputRefValue.jsx +0 -51
- package/components/Input2/InputWrapper.d.ts +0 -11
- package/components/Input2/InputWrapper.jsx +0 -11
- package/components/Link/Link.d.ts +0 -3
- package/components/Link/Link.jsx +0 -9
- package/components/Link/index.d.ts +0 -3
- package/components/Link/index.jsx +0 -3
- package/components/Loading/Loading.d.ts +0 -5
- package/components/Loading/Loading.jsx +0 -15
- package/components/Loading/index.d.ts +0 -3
- package/components/Loading/index.jsx +0 -3
- package/components/Magnet/Magnet.d.ts +0 -13
- package/components/Magnet/Magnet.jsx +0 -50
- package/components/Magnet/index.d.ts +0 -3
- package/components/Magnet/index.jsx +0 -3
- package/components/Markdown/Markdown.d.ts +0 -8
- package/components/Markdown/Markdown.jsx +0 -11
- package/components/Markdown/index.d.ts +0 -3
- package/components/Markdown/index.jsx +0 -3
- package/components/Menu/Menu.d.ts +0 -28
- package/components/Menu/Menu.jsx +0 -54
- package/components/Modal/Modal.d.ts +0 -45
- package/components/Modal/Modal.jsx +0 -65
- package/components/Modal/index.d.ts +0 -4
- package/components/Modal/index.jsx +0 -4
- package/components/Modal/useModalState.d.ts +0 -6
- package/components/Modal/useModalState.js +0 -16
- package/components/ModeToggle/ModeToggle.d.ts +0 -9
- package/components/ModeToggle/ModeToggle.jsx +0 -12
- package/components/ModeToggle/index.d.ts +0 -4
- package/components/ModeToggle/index.jsx +0 -5
- package/components/ModeToggle/useModeToggle.d.ts +0 -1
- package/components/ModeToggle/useModeToggle.js +0 -21
- package/components/MultiSelect/MultiSelect.d.ts +0 -28
- package/components/MultiSelect/MultiSelect.jsx +0 -116
- package/components/MultiSelect/MultiSelectInput.d.ts +0 -12
- package/components/MultiSelect/MultiSelectInput.jsx +0 -27
- package/components/MultiSelect/index.d.ts +0 -5
- package/components/MultiSelect/index.jsx +0 -5
- package/components/MultiText/MultiText.d.ts +0 -23
- package/components/MultiText/MultiText.jsx +0 -118
- package/components/MultiText/index.d.ts +0 -3
- package/components/MultiText/index.jsx +0 -3
- package/components/NavigationDrawer/NavigationDrawer.d.ts +0 -9
- package/components/NavigationDrawer/NavigationDrawer.jsx +0 -29
- package/components/NavigationDrawer/NavigationItem.d.ts +0 -13
- package/components/NavigationDrawer/NavigationItem.jsx +0 -24
- package/components/NavigationDrawer/index.d.ts +0 -6
- package/components/NavigationDrawer/index.jsx +0 -6
- package/components/NavigationDrawer/navigationDrawer.state.d.ts +0 -9
- package/components/NavigationDrawer/navigationDrawer.state.js +0 -19
- package/components/NoSsr/NoSsr.d.ts +0 -4
- package/components/NoSsr/NoSsr.jsx +0 -8
- package/components/NoSsr/index.d.ts +0 -3
- package/components/NoSsr/index.jsx +0 -3
- package/components/Noise/Noise.d.ts +0 -11
- package/components/Noise/Noise.jsx +0 -69
- package/components/Noise/index.d.ts +0 -3
- package/components/Noise/index.jsx +0 -3
- package/components/Notifications/Notifications.d.ts +0 -3
- package/components/Notifications/Notifications.jsx +0 -60
- package/components/Notifications/index.d.ts +0 -5
- package/components/Notifications/index.jsx +0 -6
- package/components/Notifications/notifications.state.d.ts +0 -24
- package/components/Notifications/notifications.state.js +0 -41
- package/components/Orb/Orb.d.ts +0 -8
- package/components/Orb/Orb.jsx +0 -258
- package/components/Orb/index.d.ts +0 -3
- package/components/Orb/index.jsx +0 -3
- package/components/Pagination/Pagination.d.ts +0 -13
- package/components/Pagination/Pagination.jsx +0 -64
- package/components/Pagination/index.d.ts +0 -3
- package/components/Pagination/index.jsx +0 -3
- package/components/Particles/Particles.d.ts +0 -18
- package/components/Particles/Particles.jsx +0 -205
- package/components/Particles/index.d.ts +0 -3
- package/components/Particles/index.jsx +0 -3
- package/components/PictureCropInput/PictureCropInput.d.ts +0 -20
- package/components/PictureCropInput/PictureCropInput.jsx +0 -174
- package/components/PictureCropInput/canvasPreview.d.ts +0 -2
- package/components/PictureCropInput/canvasPreview.js +0 -37
- package/components/PictureCropInput/index.d.ts +0 -3
- package/components/PictureCropInput/index.js +0 -3
- package/components/Popover/Popover.d.ts +0 -13
- package/components/Popover/Popover.jsx +0 -22
- package/components/Popover/index.d.ts +0 -3
- package/components/Popover/index.jsx +0 -3
- package/components/Resizable/Resizable.d.ts +0 -12
- package/components/Resizable/Resizable.jsx +0 -54
- package/components/Resizable/index.d.ts +0 -3
- package/components/Resizable/index.jsx +0 -3
- package/components/ScrollArea/ScrollArea.d.ts +0 -9
- package/components/ScrollArea/ScrollArea.jsx +0 -16
- package/components/ScrollArea/index.d.ts +0 -3
- package/components/ScrollArea/index.jsx +0 -3
- package/components/Select/Select.d.ts +0 -25
- package/components/Select/Select.jsx +0 -55
- package/components/Select/index.d.ts +0 -3
- package/components/Select/index.jsx +0 -3
- package/components/Skeleton/Skeleton.d.ts +0 -2
- package/components/Skeleton/Skeleton.jsx +0 -8
- package/components/Skeleton/index.d.ts +0 -3
- package/components/Skeleton/index.jsx +0 -3
- package/components/Slider/Slider.d.ts +0 -10
- package/components/Slider/Slider.jsx +0 -21
- package/components/Slider/index.d.ts +0 -3
- package/components/Slider/index.jsx +0 -3
- package/components/Spotlight/Spotlight.d.ts +0 -30
- package/components/Spotlight/Spotlight.jsx +0 -86
- package/components/Spotlight/index.d.ts +0 -3
- package/components/Spotlight/index.jsx +0 -3
- package/components/SpotlightCard/SpotlightCard.d.ts +0 -7
- package/components/SpotlightCard/SpotlightCard.jsx +0 -35
- package/components/SpotlightCard/index.d.ts +0 -3
- package/components/SpotlightCard/index.jsx +0 -3
- package/components/Stack/Stack.d.ts +0 -4
- package/components/Stack/Stack.jsx +0 -5
- package/components/Stack/index.d.ts +0 -3
- package/components/Stack/index.jsx +0 -3
- package/components/StarBorder/StarBorder.d.ts +0 -10
- package/components/StarBorder/StarBorder.jsx +0 -19
- package/components/StarBorder/index.d.ts +0 -3
- package/components/StarBorder/index.jsx +0 -3
- package/components/Switch/Switch.d.ts +0 -16
- package/components/Switch/Switch.jsx +0 -24
- package/components/Switch/index.d.ts +0 -3
- package/components/Switch/index.jsx +0 -3
- package/components/Table/DataTable.d.ts +0 -57
- package/components/Table/DataTable.jsx +0 -155
- package/components/Table/Table.d.ts +0 -27
- package/components/Table/Table.jsx +0 -31
- package/components/Table/TableActionButton.d.ts +0 -6
- package/components/Table/TableActionButton.jsx +0 -20
- package/components/Table/TableBody.d.ts +0 -6
- package/components/Table/TableBody.jsx +0 -10
- package/components/Table/TableCell.d.ts +0 -9
- package/components/Table/TableCell.jsx +0 -18
- package/components/Table/TableFooter.d.ts +0 -5
- package/components/Table/TableFooter.jsx +0 -5
- package/components/Table/TableFooterWithPagination.d.ts +0 -13
- package/components/Table/TableFooterWithPagination.jsx +0 -57
- package/components/Table/TableHead.d.ts +0 -5
- package/components/Table/TableHead.jsx +0 -9
- package/components/Table/TableHeadContext.d.ts +0 -4
- package/components/Table/TableHeadContext.jsx +0 -3
- package/components/Table/TableHeader.d.ts +0 -7
- package/components/Table/TableHeader.jsx +0 -15
- package/components/Table/TableRow.d.ts +0 -8
- package/components/Table/TableRow.jsx +0 -9
- package/components/Table/index.d.ts +0 -3
- package/components/Table/index.jsx +0 -3
- package/components/Tabs/Tabs.d.ts +0 -9
- package/components/Tabs/Tabs.jsx +0 -13
- package/components/Tabs/index.d.ts +0 -3
- package/components/Tabs/index.jsx +0 -3
- package/components/TabsSwitcher/Tab.d.ts +0 -15
- package/components/TabsSwitcher/Tab.jsx +0 -18
- package/components/TabsSwitcher/TabsSwitcher.d.ts +0 -22
- package/components/TabsSwitcher/TabsSwitcher.jsx +0 -31
- package/components/TabsSwitcher/index.d.ts +0 -4
- package/components/TabsSwitcher/index.jsx +0 -4
- package/components/Text/Text.d.ts +0 -24
- package/components/Text/Text.jsx +0 -29
- package/components/Text/index.d.ts +0 -3
- package/components/Text/index.jsx +0 -3
- package/components/Textarea/Textarea.d.ts +0 -5
- package/components/Textarea/Textarea.jsx +0 -6
- package/components/Textarea/index.d.ts +0 -3
- package/components/Textarea/index.js +0 -3
- package/components/Threads/Threads.d.ts +0 -9
- package/components/Threads/Threads.jsx +0 -203
- package/components/Threads/index.d.ts +0 -3
- package/components/Threads/index.jsx +0 -3
- package/components/Tooltip/Tooltip.d.ts +0 -11
- package/components/Tooltip/Tooltip.jsx +0 -21
- package/components/Tooltip/index.d.ts +0 -3
- package/components/Tooltip/index.jsx +0 -3
- package/components/VisibilityActivatedButton/VisibilityActivatedButton.d.ts +0 -7
- package/components/VisibilityActivatedButton/VisibilityActivatedButton.jsx +0 -18
- package/components/VisibilityActivatedButton/index.d.ts +0 -3
- package/components/VisibilityActivatedButton/index.jsx +0 -3
- package/form.d.ts +0 -82
- package/form.js +0 -113
- package/form2.d.ts +0 -15
- package/form2.jsx +0 -30
- package/hooks/useBeforeUnload.d.ts +0 -1
- package/hooks/useBeforeUnload.js +0 -17
- package/hooks/useDebounceEffect.d.ts +0 -2
- package/hooks/useDebounceEffect.js +0 -14
- package/hooks/useDebouncedValue.d.ts +0 -2
- package/hooks/useDebouncedValue.js +0 -14
- package/hooks/useLagRadar.d.ts +0 -1
- package/hooks/useLagRadar.jsx +0 -124
- package/hooks/useMediaQuery.d.ts +0 -1
- package/hooks/useMediaQuery.js +0 -37
- package/hooks/useMutationWindowCloseProtection.d.ts +0 -2
- package/hooks/useMutationWindowCloseProtection.js +0 -13
- package/hooks/useScroll.d.ts +0 -3
- package/hooks/useScroll.js +0 -47
- package/hooks/useTranslation.d.ts +0 -4
- package/hooks/useTranslation.js +0 -11
- package/hooks/useWhyDidYouUpdate.d.ts +0 -3
- package/hooks/useWhyDidYouUpdate.js +0 -44
- package/imgur.d.ts +0 -1
- package/imgur.js +0 -13
- package/styles/DayPicker.classNames.d.ts +0 -29
- package/styles/DayPicker.classNames.js +0 -30
- package/styles/DayPicker.classNames.ts +0 -81
- package/styles/Dropdown.classNames.d.ts +0 -6
- package/styles/Dropdown.classNames.js +0 -7
- package/styles/Dropdown.classNames.ts +0 -38
- package/styles/Input.css +0 -23
- package/styles/Modal.classNames.d.ts +0 -2
- package/styles/Modal.classNames.js +0 -3
- package/styles/Modal.classNames.ts +0 -15
- package/styles/MultiText.css +0 -40
- package/styles/Pagination.css +0 -19
- package/styles/Tabs.css +0 -23
- package/tsconfig.tsbuildinfo +0 -1
- package/types.d.ts +0 -6
- package/types.js +0 -1
- package/utils/UseState.d.ts +0 -2
- package/utils/UseState.js +0 -1
- package/utils/blobToText.d.ts +0 -1
- package/utils/blobToText.js +0 -13
- package/utils/capitalize.d.ts +0 -1
- package/utils/capitalize.js +0 -6
- package/utils/clsx.d.ts +0 -2
- package/utils/clsx.js +0 -5
- package/utils/copy2DToClipboard.d.ts +0 -1
- package/utils/copy2DToClipboard.js +0 -44
- package/utils/cpfCpnjUtils.d.ts +0 -3
- package/utils/cpfCpnjUtils.js +0 -43
- package/utils/createLocalStorageStateHydration.d.ts +0 -1
- package/utils/createLocalStorageStateHydration.js +0 -18
- package/utils/createStateHydration.d.ts +0 -3
- package/utils/createStateHydration.js +0 -49
- package/utils/csvBlobToJson.d.ts +0 -2
- package/utils/csvBlobToJson.js +0 -59
- package/utils/downloadArrayAsCSV.d.ts +0 -1
- package/utils/downloadArrayAsCSV.js +0 -34
- package/utils/emailRegExp.d.ts +0 -2
- package/utils/emailRegExp.js +0 -2
- package/utils/fakeArray.d.ts +0 -1
- package/utils/fakeArray.js +0 -3
- package/utils/filterBoolean.d.ts +0 -1
- package/utils/filterBoolean.js +0 -3
- package/utils/formatClock.d.ts +0 -1
- package/utils/formatClock.js +0 -21
- package/utils/getInitials.d.ts +0 -4
- package/utils/getInitials.js +0 -22
- package/utils/isBrowser.d.ts +0 -12
- package/utils/isBrowser.js +0 -26
- package/utils/ms.d.ts +0 -6
- package/utils/ms.js +0 -31
- package/utils/preventDefault.d.ts +0 -2
- package/utils/preventDefault.js +0 -3
- package/utils/recursiveChildrenMap.d.ts +0 -2
- package/utils/recursiveChildrenMap.js +0 -16
- package/utils/setSelectionRange.d.ts +0 -1
- package/utils/setSelectionRange.js +0 -55
- package/utils/smoothScrollToHref.d.ts +0 -2
- package/utils/smoothScrollToHref.js +0 -14
- package/utils/stopPropagation.d.ts +0 -2
- package/utils/stopPropagation.js +0 -3
- package/utils/stripHtml.d.ts +0 -1
- package/utils/stripHtml.js +0 -4
- package/utils/stripLineBreak.d.ts +0 -1
- package/utils/stripLineBreak.js +0 -4
- package/utils/stripMarkdown.d.ts +0 -1
- package/utils/stripMarkdown.js +0 -28
- package/utils/xlsxBlobToJson.d.ts +0 -2
- package/utils/xlsxBlobToJson.js +0 -62
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
5
|
+
import { cn } from "cn";
|
|
6
|
+
|
|
7
|
+
function Tabs({
|
|
8
|
+
className,
|
|
9
|
+
orientation = "horizontal",
|
|
10
|
+
...props
|
|
11
|
+
}: TabsPrimitive.Root.Props) {
|
|
12
|
+
return (
|
|
13
|
+
<TabsPrimitive.Root
|
|
14
|
+
data-slot="tabs"
|
|
15
|
+
data-orientation={orientation}
|
|
16
|
+
className={cn(
|
|
17
|
+
"group/tabs flex gap-2 data-horizontal:flex-col",
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const tabsListVariants = cva(
|
|
26
|
+
"group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",
|
|
27
|
+
{
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
default: "bg-muted",
|
|
31
|
+
line: "gap-1 bg-transparent",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
variant: "default",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
function TabsList({
|
|
41
|
+
className,
|
|
42
|
+
variant = "default",
|
|
43
|
+
...props
|
|
44
|
+
}: TabsPrimitive.List.Props & VariantProps<typeof tabsListVariants>) {
|
|
45
|
+
return (
|
|
46
|
+
<TabsPrimitive.List
|
|
47
|
+
data-slot="tabs-list"
|
|
48
|
+
data-variant={variant}
|
|
49
|
+
className={cn(tabsListVariants({ variant }), className)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {
|
|
56
|
+
return (
|
|
57
|
+
<TabsPrimitive.Tab
|
|
58
|
+
data-slot="tabs-trigger"
|
|
59
|
+
className={cn(
|
|
60
|
+
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
61
|
+
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
62
|
+
"data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
|
|
63
|
+
"after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
64
|
+
className,
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function TabsContent({ className, ...props }: TabsPrimitive.Panel.Props) {
|
|
72
|
+
return (
|
|
73
|
+
<TabsPrimitive.Panel
|
|
74
|
+
data-slot="tabs-content"
|
|
75
|
+
className={cn("flex-1 text-sm outline-none", className)}
|
|
76
|
+
{...props}
|
|
77
|
+
/>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
package/src/lib/utils.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cn } from "cn";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { Button } from "../components/ui/button";
|
|
5
|
+
|
|
6
|
+
export interface NavigationItem {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
count?: number;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export function AppShell({
|
|
13
|
+
title,
|
|
14
|
+
context,
|
|
15
|
+
navigation,
|
|
16
|
+
activeId,
|
|
17
|
+
onNavigate,
|
|
18
|
+
children,
|
|
19
|
+
footer = "Workspace local",
|
|
20
|
+
brand = "workbench",
|
|
21
|
+
brandMark = "w.",
|
|
22
|
+
}: {
|
|
23
|
+
title: string;
|
|
24
|
+
context?: ReactNode;
|
|
25
|
+
navigation: NavigationItem[];
|
|
26
|
+
activeId: string;
|
|
27
|
+
onNavigate: (id: string) => void;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
footer?: ReactNode;
|
|
30
|
+
brand?: string;
|
|
31
|
+
brandMark?: ReactNode;
|
|
32
|
+
}) {
|
|
33
|
+
return (
|
|
34
|
+
<div className="wb-shell">
|
|
35
|
+
<aside className="wb-sidebar">
|
|
36
|
+
<div className="wb-brand">
|
|
37
|
+
<span>{brandMark}</span>
|
|
38
|
+
{brand}
|
|
39
|
+
</div>
|
|
40
|
+
<nav aria-label="Navegação principal">
|
|
41
|
+
{navigation.map((item) => (
|
|
42
|
+
<Button
|
|
43
|
+
key={item.id}
|
|
44
|
+
variant="navigation"
|
|
45
|
+
data-active={activeId === item.id}
|
|
46
|
+
aria-current={activeId === item.id ? "page" : undefined}
|
|
47
|
+
onClick={() => onNavigate(item.id)}
|
|
48
|
+
>
|
|
49
|
+
{item.icon}
|
|
50
|
+
{item.label}
|
|
51
|
+
{item.count !== undefined ? (
|
|
52
|
+
<span className="ml-auto">{item.count}</span>
|
|
53
|
+
) : null}
|
|
54
|
+
</Button>
|
|
55
|
+
))}
|
|
56
|
+
</nav>
|
|
57
|
+
<div className="wb-sidebar-footer">{footer}</div>
|
|
58
|
+
</aside>
|
|
59
|
+
<div className="min-w-0">
|
|
60
|
+
<header className="wb-topbar">
|
|
61
|
+
<span>
|
|
62
|
+
{brand} / {title}
|
|
63
|
+
</span>
|
|
64
|
+
{context}
|
|
65
|
+
</header>
|
|
66
|
+
<main className="wb-main">{children}</main>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState, type ReactNode } from "react";
|
|
4
|
+
import {
|
|
5
|
+
ArrowDown,
|
|
6
|
+
ArrowUp,
|
|
7
|
+
ArrowUpRight,
|
|
8
|
+
ChevronLeft,
|
|
9
|
+
ChevronRight,
|
|
10
|
+
} from "lucide-react";
|
|
11
|
+
import { Button } from "../components/ui/button";
|
|
12
|
+
import { Input } from "../components/ui/input";
|
|
13
|
+
import {
|
|
14
|
+
Table,
|
|
15
|
+
TableBody,
|
|
16
|
+
TableCell,
|
|
17
|
+
TableHead,
|
|
18
|
+
TableHeader,
|
|
19
|
+
TableRow,
|
|
20
|
+
} from "../components/ui/table";
|
|
21
|
+
import {
|
|
22
|
+
Empty,
|
|
23
|
+
EmptyDescription,
|
|
24
|
+
EmptyHeader,
|
|
25
|
+
EmptyTitle,
|
|
26
|
+
} from "../components/ui/empty";
|
|
27
|
+
import { Skeleton } from "../components/ui/skeleton";
|
|
28
|
+
|
|
29
|
+
export interface DataColumn<T> {
|
|
30
|
+
id: string;
|
|
31
|
+
header: string;
|
|
32
|
+
cell: (row: T) => ReactNode;
|
|
33
|
+
sortValue?: (row: T) => string | number;
|
|
34
|
+
}
|
|
35
|
+
export interface DataTableProps<T> {
|
|
36
|
+
rows: T[];
|
|
37
|
+
columns: DataColumn<T>[];
|
|
38
|
+
getRowId: (row: T) => string;
|
|
39
|
+
searchValue: (row: T) => string;
|
|
40
|
+
searchLabel?: string;
|
|
41
|
+
filters?: ReactNode;
|
|
42
|
+
loading?: boolean;
|
|
43
|
+
onOpen?: (row: T) => void;
|
|
44
|
+
rowLabel?: (row: T) => string;
|
|
45
|
+
pageSize?: number;
|
|
46
|
+
}
|
|
47
|
+
export function DataTable<T>({
|
|
48
|
+
rows,
|
|
49
|
+
columns,
|
|
50
|
+
getRowId,
|
|
51
|
+
searchValue,
|
|
52
|
+
searchLabel = "Buscar registros",
|
|
53
|
+
filters,
|
|
54
|
+
loading = false,
|
|
55
|
+
onOpen,
|
|
56
|
+
rowLabel,
|
|
57
|
+
pageSize = 10,
|
|
58
|
+
}: DataTableProps<T>) {
|
|
59
|
+
const [query, setQuery] = useState("");
|
|
60
|
+
const [sort, setSort] = useState<{ id: string; desc: boolean } | null>(null);
|
|
61
|
+
const [page, setPage] = useState(0);
|
|
62
|
+
const selected = rows.filter((row) =>
|
|
63
|
+
searchValue(row).toLocaleLowerCase().includes(query.toLocaleLowerCase()),
|
|
64
|
+
);
|
|
65
|
+
const sortedColumn = columns.find((column) => column.id === sort?.id);
|
|
66
|
+
if (sortedColumn?.sortValue)
|
|
67
|
+
selected.sort((a, b) => {
|
|
68
|
+
const x = sortedColumn.sortValue!(a),
|
|
69
|
+
y = sortedColumn.sortValue!(b);
|
|
70
|
+
return (
|
|
71
|
+
(typeof x === "number" && typeof y === "number"
|
|
72
|
+
? x - y
|
|
73
|
+
: String(x).localeCompare(String(y), "pt-BR")) * (sort?.desc ? -1 : 1)
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
const safeSize = Math.max(1, pageSize),
|
|
77
|
+
lastPage = Math.max(0, Math.ceil(selected.length / safeSize) - 1),
|
|
78
|
+
currentPage = Math.min(page, lastPage);
|
|
79
|
+
const visible = selected.slice(
|
|
80
|
+
currentPage * safeSize,
|
|
81
|
+
(currentPage + 1) * safeSize,
|
|
82
|
+
);
|
|
83
|
+
return (
|
|
84
|
+
<section aria-label="Tabela de dados" aria-busy={loading}>
|
|
85
|
+
<div className="wb-table-toolbar">
|
|
86
|
+
<Input
|
|
87
|
+
className="basis-full md:basis-0"
|
|
88
|
+
aria-label={searchLabel}
|
|
89
|
+
placeholder={searchLabel}
|
|
90
|
+
value={query}
|
|
91
|
+
onChange={(event) => {
|
|
92
|
+
setQuery(event.target.value);
|
|
93
|
+
setPage(0);
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
{filters}
|
|
97
|
+
</div>
|
|
98
|
+
<Table>
|
|
99
|
+
<TableHeader>
|
|
100
|
+
<TableRow>
|
|
101
|
+
{columns.map((column) => (
|
|
102
|
+
<TableHead
|
|
103
|
+
key={column.id}
|
|
104
|
+
aria-sort={
|
|
105
|
+
sort?.id === column.id
|
|
106
|
+
? sort.desc
|
|
107
|
+
? "descending"
|
|
108
|
+
: "ascending"
|
|
109
|
+
: undefined
|
|
110
|
+
}
|
|
111
|
+
>
|
|
112
|
+
{column.sortValue ? (
|
|
113
|
+
<Button
|
|
114
|
+
variant="ghost"
|
|
115
|
+
onClick={() =>
|
|
116
|
+
setSort({
|
|
117
|
+
id: column.id,
|
|
118
|
+
desc: sort?.id === column.id ? !sort.desc : false,
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
>
|
|
122
|
+
{column.header}
|
|
123
|
+
{sort?.id === column.id ? (
|
|
124
|
+
sort.desc ? (
|
|
125
|
+
<ArrowDown data-icon="inline-end" />
|
|
126
|
+
) : (
|
|
127
|
+
<ArrowUp data-icon="inline-end" />
|
|
128
|
+
)
|
|
129
|
+
) : null}
|
|
130
|
+
</Button>
|
|
131
|
+
) : (
|
|
132
|
+
column.header
|
|
133
|
+
)}
|
|
134
|
+
</TableHead>
|
|
135
|
+
))}
|
|
136
|
+
{onOpen ? (
|
|
137
|
+
<TableHead>
|
|
138
|
+
<span className="sr-only">Detalhes</span>
|
|
139
|
+
</TableHead>
|
|
140
|
+
) : null}
|
|
141
|
+
</TableRow>
|
|
142
|
+
</TableHeader>
|
|
143
|
+
<TableBody>
|
|
144
|
+
{loading ? (
|
|
145
|
+
[0, 1, 2].map((index) => (
|
|
146
|
+
<TableRow key={index}>
|
|
147
|
+
{columns.map((column) => (
|
|
148
|
+
<TableCell key={column.id}>
|
|
149
|
+
<Skeleton className="h-5 w-full" />
|
|
150
|
+
</TableCell>
|
|
151
|
+
))}
|
|
152
|
+
{onOpen ? (
|
|
153
|
+
<TableCell>
|
|
154
|
+
<Skeleton className="size-5" />
|
|
155
|
+
</TableCell>
|
|
156
|
+
) : null}
|
|
157
|
+
</TableRow>
|
|
158
|
+
))
|
|
159
|
+
) : visible.length ? (
|
|
160
|
+
visible.map((row) => (
|
|
161
|
+
<TableRow key={getRowId(row)}>
|
|
162
|
+
{columns.map((column) => (
|
|
163
|
+
<TableCell key={column.id}>{column.cell(row)}</TableCell>
|
|
164
|
+
))}
|
|
165
|
+
{onOpen ? (
|
|
166
|
+
<TableCell>
|
|
167
|
+
<Button
|
|
168
|
+
variant="ghost"
|
|
169
|
+
size="icon"
|
|
170
|
+
aria-label={`Ver detalhes de ${rowLabel?.(row) ?? getRowId(row)}`}
|
|
171
|
+
onClick={() => onOpen(row)}
|
|
172
|
+
>
|
|
173
|
+
<ArrowUpRight />
|
|
174
|
+
</Button>
|
|
175
|
+
</TableCell>
|
|
176
|
+
) : null}
|
|
177
|
+
</TableRow>
|
|
178
|
+
))
|
|
179
|
+
) : (
|
|
180
|
+
<TableRow>
|
|
181
|
+
<TableCell colSpan={columns.length + (onOpen ? 1 : 0)}>
|
|
182
|
+
<Empty>
|
|
183
|
+
<EmptyHeader>
|
|
184
|
+
<EmptyTitle>Nenhum resultado</EmptyTitle>
|
|
185
|
+
<EmptyDescription>
|
|
186
|
+
Ajuste a busca ou os filtros para encontrar registros.
|
|
187
|
+
</EmptyDescription>
|
|
188
|
+
</EmptyHeader>
|
|
189
|
+
</Empty>
|
|
190
|
+
</TableCell>
|
|
191
|
+
</TableRow>
|
|
192
|
+
)}
|
|
193
|
+
</TableBody>
|
|
194
|
+
</Table>
|
|
195
|
+
<div className="wb-table-footer">
|
|
196
|
+
<span>
|
|
197
|
+
{selected.length} registros · página {currentPage + 1} de{" "}
|
|
198
|
+
{lastPage + 1}
|
|
199
|
+
</span>
|
|
200
|
+
<div className="flex gap-2">
|
|
201
|
+
<Button
|
|
202
|
+
variant="outline"
|
|
203
|
+
size="sm"
|
|
204
|
+
aria-label="Página anterior"
|
|
205
|
+
disabled={currentPage === 0 || loading}
|
|
206
|
+
onClick={() => setPage(currentPage - 1)}
|
|
207
|
+
>
|
|
208
|
+
<ChevronLeft />
|
|
209
|
+
Anterior
|
|
210
|
+
</Button>
|
|
211
|
+
<Button
|
|
212
|
+
variant="outline"
|
|
213
|
+
size="sm"
|
|
214
|
+
aria-label="Próxima página"
|
|
215
|
+
disabled={currentPage === lastPage || loading}
|
|
216
|
+
onClick={() => setPage(currentPage + 1)}
|
|
217
|
+
>
|
|
218
|
+
Próxima
|
|
219
|
+
<ChevronRight />
|
|
220
|
+
</Button>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
</section>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import {
|
|
5
|
+
Sheet,
|
|
6
|
+
SheetContent,
|
|
7
|
+
SheetHeader,
|
|
8
|
+
SheetTitle,
|
|
9
|
+
SheetDescription,
|
|
10
|
+
} from "../components/ui/sheet";
|
|
11
|
+
export function DetailsSheet({
|
|
12
|
+
open,
|
|
13
|
+
onOpenChange,
|
|
14
|
+
title,
|
|
15
|
+
description,
|
|
16
|
+
children,
|
|
17
|
+
}: {
|
|
18
|
+
open: boolean;
|
|
19
|
+
onOpenChange: (open: boolean) => void;
|
|
20
|
+
title: string;
|
|
21
|
+
description: string;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}) {
|
|
24
|
+
return (
|
|
25
|
+
<Sheet open={open} onOpenChange={onOpenChange}>
|
|
26
|
+
<SheetContent className="overflow-y-auto">
|
|
27
|
+
<SheetHeader>
|
|
28
|
+
<SheetTitle>{title}</SheetTitle>
|
|
29
|
+
<SheetDescription>{description}</SheetDescription>
|
|
30
|
+
</SheetHeader>
|
|
31
|
+
<div className="px-4 pb-8">{children}</div>
|
|
32
|
+
</SheetContent>
|
|
33
|
+
</Sheet>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
export function DetailList({
|
|
37
|
+
items,
|
|
38
|
+
}: {
|
|
39
|
+
items: { label: string; value: ReactNode }[];
|
|
40
|
+
}) {
|
|
41
|
+
return (
|
|
42
|
+
<dl className="wb-details">
|
|
43
|
+
{items.map((item) => (
|
|
44
|
+
<div key={item.label}>
|
|
45
|
+
<dt>{item.label}</dt>
|
|
46
|
+
<dd>{item.value}</dd>
|
|
47
|
+
</div>
|
|
48
|
+
))}
|
|
49
|
+
</dl>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export function PageHeader({
|
|
3
|
+
title,
|
|
4
|
+
description,
|
|
5
|
+
eyebrow,
|
|
6
|
+
actions,
|
|
7
|
+
}: {
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
eyebrow?: string;
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
}) {
|
|
13
|
+
return (
|
|
14
|
+
<section className="wb-page-header">
|
|
15
|
+
<div>
|
|
16
|
+
{eyebrow ? <div className="wb-eyebrow">{eyebrow}</div> : null}
|
|
17
|
+
<h1>{title}</h1>
|
|
18
|
+
<p>{description}</p>
|
|
19
|
+
</div>
|
|
20
|
+
{actions}
|
|
21
|
+
</section>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export function MetricStrip({
|
|
25
|
+
items,
|
|
26
|
+
}: {
|
|
27
|
+
items: { label: string; value: ReactNode; note?: string }[];
|
|
28
|
+
}) {
|
|
29
|
+
return (
|
|
30
|
+
<section className="wb-metrics" aria-label="Resumo">
|
|
31
|
+
{items.map((item) => (
|
|
32
|
+
<div key={item.label}>
|
|
33
|
+
<div className="wb-metric-label">{item.label}</div>
|
|
34
|
+
<div className="wb-metric-value">{item.value}</div>
|
|
35
|
+
{item.note ? <div className="wb-metric-note">{item.note}</div> : null}
|
|
36
|
+
</div>
|
|
37
|
+
))}
|
|
38
|
+
</section>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Badge } from "../components/ui/badge";
|
|
2
|
+
export function StatusBadge({
|
|
3
|
+
children,
|
|
4
|
+
tone = "neutral",
|
|
5
|
+
}: {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
tone?: "neutral" | "success" | "warning" | "danger";
|
|
8
|
+
}) {
|
|
9
|
+
return (
|
|
10
|
+
<Badge
|
|
11
|
+
variant={
|
|
12
|
+
tone === "danger"
|
|
13
|
+
? "destructive"
|
|
14
|
+
: tone === "neutral"
|
|
15
|
+
? "secondary"
|
|
16
|
+
: tone
|
|
17
|
+
}
|
|
18
|
+
>
|
|
19
|
+
<span className="wb-status-dot" aria-hidden="true" />
|
|
20
|
+
{children}
|
|
21
|
+
</Badge>
|
|
22
|
+
);
|
|
23
|
+
}
|