@phsa.tec/design-system-react 0.1.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/.eslintrc.json +7 -0
- package/.storybook/main.ts +16 -0
- package/.storybook/preview.ts +15 -0
- package/README.md +36 -0
- package/components.json +21 -0
- package/jest.config.ts +25 -0
- package/next.config.ts +7 -0
- package/package.json +88 -0
- package/postcss.config.mjs +8 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/next.svg +1 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
- package/src/app/columns.tsx +178 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/fonts/GeistMonoVF.woff +0 -0
- package/src/app/fonts/GeistVF.woff +0 -0
- package/src/app/globals.css +94 -0
- package/src/app/layout.tsx +35 -0
- package/src/app/page.tsx +7 -0
- package/src/components/actions/AlertDialog/AlertDialog.tsx +45 -0
- package/src/components/actions/AlertDialog/alert-dialog.stories.tsx +21 -0
- package/src/components/actions/AlertDialog/index.ts +1 -0
- package/src/components/actions/Button/Button.stories.ts +38 -0
- package/src/components/actions/Button/Button.tsx +23 -0
- package/src/components/actions/Button/index.ts +1 -0
- package/src/components/actions/Collapsible/index.ts +1 -0
- package/src/components/actions/Dialog/Dialog.stories.tsx +70 -0
- package/src/components/actions/Dialog/Dialog.tsx +87 -0
- package/src/components/actions/Dialog/components/DialogWithActions/index.tsx +40 -0
- package/src/components/actions/Dialog/index.ts +1 -0
- package/src/components/actions/Steps/Steps.stories.tsx +25 -0
- package/src/components/actions/Steps/Steps.tsx +51 -0
- package/src/components/actions/Steps/index.ts +1 -0
- package/src/components/actions/index.ts +5 -0
- package/src/components/dataDisplay/Avatar/Avatar.stories.tsx +22 -0
- package/src/components/dataDisplay/Avatar/Avatar.tsx +21 -0
- package/src/components/dataDisplay/Avatar/index.ts +2 -0
- package/src/components/dataDisplay/Badge/Badge.stories.tsx +36 -0
- package/src/components/dataDisplay/Badge/index.ts +1 -0
- package/src/components/dataDisplay/Card/Card.stories.tsx +24 -0
- package/src/components/dataDisplay/Card/Card.tsx +34 -0
- package/src/components/dataDisplay/Card/index.ts +1 -0
- package/src/components/dataDisplay/DataPairList/DataPairList.tsx +56 -0
- package/src/components/dataDisplay/DataPairList/data-pair-list.stories.tsx +87 -0
- package/src/components/dataDisplay/DataPairList/index.ts +2 -0
- package/src/components/dataDisplay/DataPairList/types.ts +10 -0
- package/src/components/dataDisplay/DropDownMenu/index.ts +1 -0
- package/src/components/dataDisplay/ErrorMessage/ErrorMessage.tsx +6 -0
- package/src/components/dataDisplay/ErrorMessage/index.ts +1 -0
- package/src/components/dataDisplay/Icon/Icon.stories.tsx +21 -0
- package/src/components/dataDisplay/Icon/Icon.tsx +47 -0
- package/src/components/dataDisplay/Icon/index.ts +1 -0
- package/src/components/dataDisplay/Icon/types.ts +6 -0
- package/src/components/dataDisplay/Label/Label.stories.tsx +21 -0
- package/src/components/dataDisplay/Label/Label.tsx +10 -0
- package/src/components/dataDisplay/Label/index.ts +1 -0
- package/src/components/dataDisplay/Table/Table.tsx +173 -0
- package/src/components/dataDisplay/Table/columns.tsx +223 -0
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table-column-header.tsx +72 -0
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table-pagination.tsx +91 -0
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table-toolbar.tsx +17 -0
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table-view-options.tsx +58 -0
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table.stories.tsx +118 -0
- package/src/components/dataDisplay/Table/components/DynamicTable/index.tsx +136 -0
- package/src/components/dataDisplay/Table/components/DynamicTable/types.ts +43 -0
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-column-header.tsx +71 -0
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-faceted-filter.tsx +147 -0
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-pagination.tsx +97 -0
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-row-actions.tsx +78 -0
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-toolbar.tsx +60 -0
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-view-options.tsx +59 -0
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table.tsx +145 -0
- package/src/components/dataDisplay/Table/custom/CustomTable/data.ts +71 -0
- package/src/components/dataDisplay/Table/custom/CustomTable/index.tsx +34 -0
- package/src/components/dataDisplay/Table/custom/CustomTable/schema.ts +11 -0
- package/src/components/dataDisplay/Table/index.ts +2 -0
- package/src/components/dataDisplay/Table/table.stories.tsx +147 -0
- package/src/components/dataDisplay/Table/types.ts +15 -0
- package/src/components/dataDisplay/Tabs/Tabs.stories.tsx +34 -0
- package/src/components/dataDisplay/Tabs/Tabs.tsx +53 -0
- package/src/components/dataDisplay/Tabs/index.ts +1 -0
- package/src/components/dataDisplay/Text/Text.stories.tsx +66 -0
- package/src/components/dataDisplay/Text/Text.tsx +56 -0
- package/src/components/dataDisplay/Text/index.ts +1 -0
- package/src/components/dataDisplay/index.ts +8 -0
- package/src/components/dataInput/Input/components/Input/Input.stories.tsx +99 -0
- package/src/components/dataInput/Input/components/Input/InputBase.tsx +50 -0
- package/src/components/dataInput/Input/components/Input/__tests__/Input.test.tsx +100 -0
- package/src/components/dataInput/Input/components/Input/index.tsx +257 -0
- package/src/components/dataInput/Input/components/InputBase/__tests__/InputBase.test.tsx +120 -0
- package/src/components/dataInput/Input/components/InputBase/index.tsx +89 -0
- package/src/components/dataInput/Input/components/MaskInput/__tests__/mask-input.test.tsx +67 -0
- package/src/components/dataInput/Input/components/MaskInput/index.ts +1 -0
- package/src/components/dataInput/Input/components/MaskInput/mask-input.stories.tsx +59 -0
- package/src/components/dataInput/Input/components/MaskInput/mask-input.tsx +43 -0
- package/src/components/dataInput/Input/components/MultipleInput/MultipleInput.tsx +36 -0
- package/src/components/dataInput/Input/components/MultipleInput/MultipleInputBase.tsx +100 -0
- package/src/components/dataInput/Input/components/MultipleInput/MultipleMaskInput.tsx +35 -0
- package/src/components/dataInput/Input/components/MultipleInput/MultipleNumberInput.tsx +35 -0
- package/src/components/dataInput/Input/components/MultipleInput/index.ts +2 -0
- package/src/components/dataInput/Input/components/MultipleInput/multiple-input.stories.tsx +71 -0
- package/src/components/dataInput/Input/components/NumberInput/__tests__/number-input.test.tsx +95 -0
- package/src/components/dataInput/Input/components/NumberInput/index.ts +1 -0
- package/src/components/dataInput/Input/components/NumberInput/number-input.stories.tsx +76 -0
- package/src/components/dataInput/Input/components/NumberInput/number-input.tsx +68 -0
- package/src/components/dataInput/Input/index.ts +4 -0
- package/src/components/dataInput/Select/MultiSelect/MultiSelect.stories.tsx +119 -0
- package/src/components/dataInput/Select/MultiSelect/MultiSelectBase.tsx +135 -0
- package/src/components/dataInput/Select/MultiSelect/index.tsx +75 -0
- package/src/components/dataInput/Select/Select.stories.tsx +61 -0
- package/src/components/dataInput/Select/Select.tsx +73 -0
- package/src/components/dataInput/Select/SelectBase.tsx +58 -0
- package/src/components/dataInput/Select/index.ts +2 -0
- package/src/components/dataInput/Switch/Switch.stories.tsx +75 -0
- package/src/components/dataInput/Switch/Switch.tsx +52 -0
- package/src/components/dataInput/Switch/index.ts +1 -0
- package/src/components/dataInput/checkbox/Checkbox.tsx +57 -0
- package/src/components/dataInput/checkbox/Checkbox_old.tsx +58 -0
- package/src/components/dataInput/checkbox/Checkout.stories.tsx +62 -0
- package/src/components/dataInput/checkbox/index.ts +1 -0
- package/src/components/dataInput/form/Form.tsx +47 -0
- package/src/components/dataInput/form/index.ts +3 -0
- package/src/components/dataInput/index.ts +5 -0
- package/src/components/feedback/Spinner/index.ts +1 -0
- package/src/components/feedback/Toast/Toast.stories.tsx +45 -0
- package/src/components/feedback/Toast/index.ts +2 -0
- package/src/components/feedback/index.ts +2 -0
- package/src/components/index.ts +6 -0
- package/src/components/layout/Crud/components/Table/index.tsx +183 -0
- package/src/components/layout/Crud/components/Table/types.ts +15 -0
- package/src/components/layout/Crud/crud.stories.tsx +317 -0
- package/src/components/layout/Crud/hook/useCrudLayout/index.tsx +94 -0
- package/src/components/layout/Crud/hook/useRequest/index.tsx +156 -0
- package/src/components/layout/Crud/index.tsx +295 -0
- package/src/components/layout/Crud/store/CrudLayoutStore.ts +75 -0
- package/src/components/layout/Crud/types.ts +14 -0
- package/src/components/layout/Drawer/CustomDrawer/index.tsx +33 -0
- package/src/components/layout/Drawer/Drawer.stories.tsx +80 -0
- package/src/components/layout/Drawer/index.ts +2 -0
- package/src/components/layout/PageLayout/PageLayout.stories.tsx +42 -0
- package/src/components/layout/PageLayout/index.tsx +28 -0
- package/src/components/layout/Separator/index.ts +1 -0
- package/src/components/layout/Sheet/Sheet.stories.tsx +28 -0
- package/src/components/layout/Sheet/Sheet.tsx +22 -0
- package/src/components/layout/Sheet/index.ts +1 -0
- package/src/components/layout/Sidebar/Sidebar.stories.tsx +116 -0
- package/src/components/layout/Sidebar/Sidebar.tsx +50 -0
- package/src/components/layout/Sidebar/components/app-sidebar.tsx +203 -0
- package/src/components/layout/Sidebar/components/footer-sidebar.tsx +17 -0
- package/src/components/layout/Sidebar/components/header-sidebar.tsx +90 -0
- package/src/components/layout/Sidebar/components/menus.tsx +55 -0
- package/src/components/layout/Sidebar/components/nav-projects.tsx +88 -0
- package/src/components/layout/Sidebar/components/nav-user.tsx +114 -0
- package/src/components/layout/Sidebar/components/team-switcher.tsx +85 -0
- package/src/components/layout/Sidebar/index.ts +2 -0
- package/src/components/layout/Sidebar/provider/index.tsx +51 -0
- package/src/components/layout/Tabs/Tabs.tsx +51 -0
- package/src/components/layout/Tabs/index.ts +1 -0
- package/src/components/layout/Tabs/tabs.stories.tsx +57 -0
- package/src/components/layout/index.ts +6 -0
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.tsx +66 -0
- package/src/components/navigation/Breadcrumbs/index.ts +2 -0
- package/src/components/navigation/index.ts +1 -0
- package/src/components/ui/alert-dialog.tsx +141 -0
- package/src/components/ui/alert.tsx +59 -0
- package/src/components/ui/avatar.tsx +50 -0
- package/src/components/ui/badge.tsx +40 -0
- package/src/components/ui/breadcrumb.tsx +115 -0
- package/src/components/ui/button.tsx +57 -0
- package/src/components/ui/card.tsx +83 -0
- package/src/components/ui/checkbox.tsx +34 -0
- package/src/components/ui/collapsible.tsx +11 -0
- package/src/components/ui/command.tsx +153 -0
- package/src/components/ui/dialog.tsx +124 -0
- package/src/components/ui/drawer.tsx +117 -0
- package/src/components/ui/dropdown-menu.tsx +201 -0
- package/src/components/ui/form.tsx +179 -0
- package/src/components/ui/input.tsx +24 -0
- package/src/components/ui/label.tsx +30 -0
- package/src/components/ui/popover.tsx +33 -0
- package/src/components/ui/select.tsx +161 -0
- package/src/components/ui/separator.tsx +31 -0
- package/src/components/ui/sheet.tsx +140 -0
- package/src/components/ui/sidebar.tsx +763 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/sonner.tsx +31 -0
- package/src/components/ui/spinner.tsx +54 -0
- package/src/components/ui/switch.tsx +33 -0
- package/src/components/ui/table.tsx +120 -0
- package/src/components/ui/tabs.tsx +55 -0
- package/src/components/ui/toast.tsx +130 -0
- package/src/components/ui/toaster.tsx +35 -0
- package/src/components/ui/tooltip.tsx +32 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/hooks/use-toast.ts +191 -0
- package/src/index.ts +1 -0
- package/src/lib/utils.ts +6 -0
- package/tailwind.config.ts +83 -0
- package/tsconfig.json +27 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { StorybookConfig } from "@storybook/nextjs";
|
|
2
|
+
|
|
3
|
+
const config: StorybookConfig = {
|
|
4
|
+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
|
5
|
+
addons: [
|
|
6
|
+
"@storybook/addon-onboarding",
|
|
7
|
+
"@chromatic-com/storybook",
|
|
8
|
+
"@storybook/addon-docs"
|
|
9
|
+
],
|
|
10
|
+
framework: {
|
|
11
|
+
name: "@storybook/nextjs",
|
|
12
|
+
options: {},
|
|
13
|
+
},
|
|
14
|
+
staticDirs: ["../public"],
|
|
15
|
+
};
|
|
16
|
+
export default config;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Preview } from "@storybook/nextjs";
|
|
2
|
+
import "../src/app/globals.css";
|
|
3
|
+
|
|
4
|
+
const preview: Preview = {
|
|
5
|
+
parameters: {
|
|
6
|
+
controls: {
|
|
7
|
+
matchers: {
|
|
8
|
+
color: /(background|color)$/i,
|
|
9
|
+
date: /Date$/i,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default preview;
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
|
2
|
+
|
|
3
|
+
## Getting Started
|
|
4
|
+
|
|
5
|
+
First, run the development server:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run dev
|
|
9
|
+
# or
|
|
10
|
+
yarn dev
|
|
11
|
+
# or
|
|
12
|
+
pnpm dev
|
|
13
|
+
# or
|
|
14
|
+
bun dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
18
|
+
|
|
19
|
+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
|
20
|
+
|
|
21
|
+
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
|
22
|
+
|
|
23
|
+
## Learn More
|
|
24
|
+
|
|
25
|
+
To learn more about Next.js, take a look at the following resources:
|
|
26
|
+
|
|
27
|
+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
|
28
|
+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
29
|
+
|
|
30
|
+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
|
31
|
+
|
|
32
|
+
## Deploy on Vercel
|
|
33
|
+
|
|
34
|
+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
|
35
|
+
|
|
36
|
+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
package/components.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "tailwind.config.ts",
|
|
8
|
+
"css": "src/app/globals.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@/components",
|
|
15
|
+
"utils": "@/lib/utils",
|
|
16
|
+
"ui": "@/components/ui",
|
|
17
|
+
"lib": "@/lib",
|
|
18
|
+
"hooks": "@/hooks"
|
|
19
|
+
},
|
|
20
|
+
"iconLibrary": "lucide"
|
|
21
|
+
}
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Config } from "jest";
|
|
2
|
+
import nextJest from "next/jest.js";
|
|
3
|
+
|
|
4
|
+
const createJestConfig = nextJest({
|
|
5
|
+
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
|
|
6
|
+
dir: "./",
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// Add any custom config to be passed to Jest
|
|
10
|
+
const config: Config = {
|
|
11
|
+
coverageProvider: "v8",
|
|
12
|
+
testEnvironment: "jsdom",
|
|
13
|
+
// Add more setup options before each test is run
|
|
14
|
+
// setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
|
|
15
|
+
testMatch: [
|
|
16
|
+
"<rootDir>/**/__tests__/**/*.test.[jt]s?(x)",
|
|
17
|
+
"<rootDir>/**/?(*.)+(spec|test).[jt]s?(x)",
|
|
18
|
+
],
|
|
19
|
+
moduleNameMapper: {
|
|
20
|
+
"^rehype-raw$": "<rootDir>/__mocks__/rehype-raw.js",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
|
|
25
|
+
export default createJestConfig(config);
|
package/next.config.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@phsa.tec/design-system-react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "./src/index.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "next dev",
|
|
8
|
+
"build": "next build",
|
|
9
|
+
"start": "next start",
|
|
10
|
+
"lint": "next lint",
|
|
11
|
+
"storybook": "storybook dev -p 6006",
|
|
12
|
+
"build-storybook": "storybook build",
|
|
13
|
+
"test": "jest"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@hookform/resolvers": "^3.9.1",
|
|
17
|
+
"@radix-ui/react-alert-dialog": "^1.1.6",
|
|
18
|
+
"@radix-ui/react-avatar": "^1.1.1",
|
|
19
|
+
"@radix-ui/react-checkbox": "^1.1.2",
|
|
20
|
+
"@radix-ui/react-collapsible": "^1.1.1",
|
|
21
|
+
"@radix-ui/react-dialog": "^1.1.2",
|
|
22
|
+
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
|
23
|
+
"@radix-ui/react-icons": "^1.3.1",
|
|
24
|
+
"@radix-ui/react-label": "^2.1.0",
|
|
25
|
+
"@radix-ui/react-popover": "^1.1.2",
|
|
26
|
+
"@radix-ui/react-select": "^2.1.2",
|
|
27
|
+
"@radix-ui/react-separator": "^1.1.0",
|
|
28
|
+
"@radix-ui/react-slot": "^1.1.2",
|
|
29
|
+
"@radix-ui/react-switch": "^1.1.3",
|
|
30
|
+
"@radix-ui/react-tabs": "^1.1.3",
|
|
31
|
+
"@radix-ui/react-toast": "^1.2.2",
|
|
32
|
+
"@radix-ui/react-tooltip": "^1.1.4",
|
|
33
|
+
"@tanstack/react-query": "^5.81.5",
|
|
34
|
+
"@tanstack/react-table": "^8.20.5",
|
|
35
|
+
"class-variance-authority": "^0.7.0",
|
|
36
|
+
"clsx": "^2.1.1",
|
|
37
|
+
"cmdk": "1.0.0",
|
|
38
|
+
"imask": "^7.6.1",
|
|
39
|
+
"lodash": "^4.17.21",
|
|
40
|
+
"lucide-react": "^0.460.0",
|
|
41
|
+
"next": "15.0.3",
|
|
42
|
+
"next-themes": "^0.4.6",
|
|
43
|
+
"react": "19.0.0-rc-66855b96-20241106",
|
|
44
|
+
"react-dom": "19.0.0-rc-66855b96-20241106",
|
|
45
|
+
"react-hook-form": "^7.53.2",
|
|
46
|
+
"react-icons": "^5.3.0",
|
|
47
|
+
"react-imask": "^7.6.1",
|
|
48
|
+
"react-input-mask": "^2.0.4",
|
|
49
|
+
"react-number-format": "^5.4.2",
|
|
50
|
+
"remask": "^1.2.2",
|
|
51
|
+
"sonner": "^2.0.6",
|
|
52
|
+
"tailwind-merge": "^2.5.4",
|
|
53
|
+
"tailwindcss-animate": "^1.0.7",
|
|
54
|
+
"vaul": "^1.1.1",
|
|
55
|
+
"zod": "^3.23.8",
|
|
56
|
+
"zustand": "^5.0.6"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@babel/preset-env": "^7.26.9",
|
|
60
|
+
"@babel/preset-react": "^7.26.3",
|
|
61
|
+
"@chromatic-com/storybook": "^4.0.1",
|
|
62
|
+
"@storybook/addon-docs": "^9.0.15",
|
|
63
|
+
"@storybook/addon-onboarding": "^9.0.15",
|
|
64
|
+
"@storybook/nextjs": "^9.0.15",
|
|
65
|
+
"@testing-library/react": "^16.2.0",
|
|
66
|
+
"@types/jest": "^29.5.14",
|
|
67
|
+
"@types/lodash": "^4.17.15",
|
|
68
|
+
"@types/node": "^20",
|
|
69
|
+
"@types/react": "^18",
|
|
70
|
+
"@types/react-dom": "^18",
|
|
71
|
+
"@types/react-input-mask": "^3.0.6",
|
|
72
|
+
"babel-jest": "^29.7.0",
|
|
73
|
+
"eslint": "^8",
|
|
74
|
+
"eslint-config-next": "15.0.3",
|
|
75
|
+
"eslint-plugin-storybook": "^9.0.15",
|
|
76
|
+
"jest": "^29.7.0",
|
|
77
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
78
|
+
"postcss": "^8",
|
|
79
|
+
"react-test-renderer": "^19.0.0",
|
|
80
|
+
"storybook": "^9.0.15",
|
|
81
|
+
"tailwindcss": "^3.4.1",
|
|
82
|
+
"ts-node": "^10.9.2",
|
|
83
|
+
"typescript": "^5"
|
|
84
|
+
},
|
|
85
|
+
"publishConfig": {
|
|
86
|
+
"access": "public"
|
|
87
|
+
}
|
|
88
|
+
}
|
package/public/file.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
|
package/public/globe.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
package/public/next.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ColumnDef } from "@tanstack/react-table";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import {
|
|
6
|
+
ArrowDownIcon,
|
|
7
|
+
ArrowRightIcon,
|
|
8
|
+
ArrowUpIcon,
|
|
9
|
+
CheckCircledIcon,
|
|
10
|
+
CircleIcon,
|
|
11
|
+
CrossCircledIcon,
|
|
12
|
+
QuestionMarkCircledIcon,
|
|
13
|
+
StopwatchIcon,
|
|
14
|
+
} from "@radix-ui/react-icons";
|
|
15
|
+
import {
|
|
16
|
+
Badge,
|
|
17
|
+
DataTableColumnHeader,
|
|
18
|
+
DataTableRowActions,
|
|
19
|
+
} from "@/components";
|
|
20
|
+
|
|
21
|
+
export const labels = [
|
|
22
|
+
{
|
|
23
|
+
value: "bug",
|
|
24
|
+
label: "Bug",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: "feature",
|
|
28
|
+
label: "Feature",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: "documentation",
|
|
32
|
+
label: "Documentation",
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
export const statuses = [
|
|
37
|
+
{
|
|
38
|
+
value: "backlog",
|
|
39
|
+
label: "Backlog",
|
|
40
|
+
icon: QuestionMarkCircledIcon,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
value: "todo",
|
|
44
|
+
label: "Todo",
|
|
45
|
+
icon: CircleIcon,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
value: "in progress",
|
|
49
|
+
label: "In Progress",
|
|
50
|
+
icon: StopwatchIcon,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
value: "done",
|
|
54
|
+
label: "Done",
|
|
55
|
+
icon: CheckCircledIcon,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
value: "canceled",
|
|
59
|
+
label: "Canceled",
|
|
60
|
+
icon: CrossCircledIcon,
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
export const priorities = [
|
|
65
|
+
{
|
|
66
|
+
label: "Low",
|
|
67
|
+
value: "low",
|
|
68
|
+
icon: ArrowDownIcon,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: "Medium",
|
|
72
|
+
value: "medium",
|
|
73
|
+
icon: ArrowRightIcon,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: "High",
|
|
77
|
+
value: "high",
|
|
78
|
+
icon: ArrowUpIcon,
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
export const taskSchema = z.object({
|
|
83
|
+
id: z.string(),
|
|
84
|
+
title: z.string(),
|
|
85
|
+
status: z.string(),
|
|
86
|
+
label: z.string(),
|
|
87
|
+
priority: z.string(),
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export type Task = z.infer<typeof taskSchema>;
|
|
91
|
+
|
|
92
|
+
export const columns: ColumnDef<Task>[] = [
|
|
93
|
+
{
|
|
94
|
+
accessorKey: "id",
|
|
95
|
+
header: ({ column }) => (
|
|
96
|
+
<DataTableColumnHeader column={column} title="Task" />
|
|
97
|
+
),
|
|
98
|
+
cell: ({ row }) => <div className="w-[80px]">{row.getValue("id")}</div>,
|
|
99
|
+
enableSorting: false,
|
|
100
|
+
enableHiding: false,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
accessorKey: "title",
|
|
104
|
+
header: ({ column }) => (
|
|
105
|
+
<DataTableColumnHeader column={column} title="Title" />
|
|
106
|
+
),
|
|
107
|
+
cell: ({ row }) => {
|
|
108
|
+
const label = labels.find((label) => label.value === row.original.label);
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<div className="flex space-x-2">
|
|
112
|
+
{label && <Badge variant="outline">{label.label}</Badge>}
|
|
113
|
+
<span className="max-w-[500px] truncate font-medium">
|
|
114
|
+
{row.getValue("title")}
|
|
115
|
+
</span>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
accessorKey: "status",
|
|
122
|
+
header: ({ column }) => (
|
|
123
|
+
<DataTableColumnHeader column={column} title="Status" />
|
|
124
|
+
),
|
|
125
|
+
cell: ({ row }) => {
|
|
126
|
+
const status = statuses.find(
|
|
127
|
+
(status) => status.value === row.getValue("status")
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
if (!status) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
<div className="flex w-[100px] items-center">
|
|
136
|
+
{status.icon && (
|
|
137
|
+
<status.icon className="mr-2 h-4 w-4 text-muted-foreground" />
|
|
138
|
+
)}
|
|
139
|
+
<span>{status.label}</span>
|
|
140
|
+
</div>
|
|
141
|
+
);
|
|
142
|
+
},
|
|
143
|
+
filterFn: (row, id, value) => {
|
|
144
|
+
return value.includes(row.getValue(id));
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
accessorKey: "priority",
|
|
149
|
+
header: ({ column }) => (
|
|
150
|
+
<DataTableColumnHeader column={column} title="Priority" />
|
|
151
|
+
),
|
|
152
|
+
cell: ({ row }) => {
|
|
153
|
+
const priority = priorities.find(
|
|
154
|
+
(priority) => priority.value === row.getValue("priority")
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
if (!priority) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<div className="flex items-center">
|
|
163
|
+
{priority.icon && (
|
|
164
|
+
<priority.icon className="mr-2 h-4 w-4 text-muted-foreground" />
|
|
165
|
+
)}
|
|
166
|
+
<span>{priority.label}</span>
|
|
167
|
+
</div>
|
|
168
|
+
);
|
|
169
|
+
},
|
|
170
|
+
filterFn: (row, id, value) => {
|
|
171
|
+
return value.includes(row.getValue(id));
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: "actions",
|
|
176
|
+
cell: ({ row }) => <DataTableRowActions row={row} />,
|
|
177
|
+
},
|
|
178
|
+
];
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap");
|
|
2
|
+
|
|
3
|
+
@tailwind base;
|
|
4
|
+
@tailwind components;
|
|
5
|
+
@tailwind utilities;
|
|
6
|
+
|
|
7
|
+
body {
|
|
8
|
+
font-family: "Roboto", Arial, Helvetica, sans-serif; /* Adicionando a fonte Roboto */
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@layer base {
|
|
12
|
+
:root {
|
|
13
|
+
--background: 0 0% 100%;
|
|
14
|
+
--foreground: 150 6% 25%;
|
|
15
|
+
--card: 0 0% 100%;
|
|
16
|
+
--card-foreground: 150 6% 25%;
|
|
17
|
+
--popover: 0 0% 100%;
|
|
18
|
+
--popover-foreground: 150 6% 25%;
|
|
19
|
+
--primary: 145 63% 42%;
|
|
20
|
+
--primary-foreground: 0 0% 98%;
|
|
21
|
+
--secondary: 150 10% 96%;
|
|
22
|
+
--secondary-foreground: 150 6% 25%;
|
|
23
|
+
--muted: 150 10% 96%;
|
|
24
|
+
--muted-foreground: 150 6% 45%;
|
|
25
|
+
--accent: 150 10% 96%;
|
|
26
|
+
--accent-foreground: 150 6% 25%;
|
|
27
|
+
--success: 145 63% 42%;
|
|
28
|
+
--success-foreground: 0 0% 98%;
|
|
29
|
+
--warning: 48 89% 50%;
|
|
30
|
+
--destructive: 0 84.2% 60.2%;
|
|
31
|
+
--destructive-foreground: 0 0% 98%;
|
|
32
|
+
--border: 150 12% 88%;
|
|
33
|
+
--input: 150 12% 88%;
|
|
34
|
+
--ring: 145 63% 42%;
|
|
35
|
+
--chart-1: 12 76% 61%;
|
|
36
|
+
--chart-2: 173 58% 39%;
|
|
37
|
+
--chart-3: 197 37% 24%;
|
|
38
|
+
--chart-4: 43 74% 66%;
|
|
39
|
+
--chart-5: 27 87% 67%;
|
|
40
|
+
--radius: 0.5rem;
|
|
41
|
+
--sidebar-background: 150 15% 98%;
|
|
42
|
+
--sidebar-foreground: 150 6% 30%;
|
|
43
|
+
--sidebar-primary: 145 63% 42%;
|
|
44
|
+
--sidebar-primary-foreground: 0 0% 98%;
|
|
45
|
+
--sidebar-accent: 150 15% 95%;
|
|
46
|
+
--sidebar-accent-foreground: 150 6% 25%;
|
|
47
|
+
--sidebar-border: 150 15% 90%;
|
|
48
|
+
--sidebar-ring: 145 63% 42%;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.dark {
|
|
52
|
+
--background: 150 15% 4%;
|
|
53
|
+
--foreground: 150 10% 95%;
|
|
54
|
+
--card: 150 15% 4%;
|
|
55
|
+
--card-foreground: 150 10% 95%;
|
|
56
|
+
--popover: 150 15% 4%;
|
|
57
|
+
--popover-foreground: 150 10% 95%;
|
|
58
|
+
--primary: 145 63% 48%;
|
|
59
|
+
--primary-foreground: 150 15% 8%;
|
|
60
|
+
--secondary: 150 12% 12%;
|
|
61
|
+
--secondary-foreground: 150 10% 95%;
|
|
62
|
+
--muted: 150 12% 12%;
|
|
63
|
+
--muted-foreground: 150 8% 60%;
|
|
64
|
+
--accent: 150 12% 12%;
|
|
65
|
+
--accent-foreground: 150 10% 95%;
|
|
66
|
+
--destructive: 0 62.8% 30.6%;
|
|
67
|
+
--destructive-foreground: 0 0% 98%;
|
|
68
|
+
--border: 150 12% 18%;
|
|
69
|
+
--input: 150 12% 18%;
|
|
70
|
+
--ring: 145 63% 48%;
|
|
71
|
+
--chart-1: 220 70% 50%;
|
|
72
|
+
--chart-2: 160 60% 45%;
|
|
73
|
+
--chart-3: 30 80% 55%;
|
|
74
|
+
--chart-4: 280 65% 60%;
|
|
75
|
+
--chart-5: 340 75% 55%;
|
|
76
|
+
--sidebar-background: 150 15% 8%;
|
|
77
|
+
--sidebar-foreground: 150 10% 90%;
|
|
78
|
+
--sidebar-primary: 145 63% 48%;
|
|
79
|
+
--sidebar-primary-foreground: 150 15% 8%;
|
|
80
|
+
--sidebar-accent: 150 12% 15%;
|
|
81
|
+
--sidebar-accent-foreground: 150 10% 90%;
|
|
82
|
+
--sidebar-border: 150 12% 15%;
|
|
83
|
+
--sidebar-ring: 145 63% 48%;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@layer base {
|
|
88
|
+
* {
|
|
89
|
+
@apply border-border;
|
|
90
|
+
}
|
|
91
|
+
body {
|
|
92
|
+
@apply bg-background text-foreground;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Metadata } from "next";
|
|
2
|
+
import localFont from "next/font/local";
|
|
3
|
+
import "./globals.css";
|
|
4
|
+
|
|
5
|
+
const geistSans = localFont({
|
|
6
|
+
src: "./fonts/GeistVF.woff",
|
|
7
|
+
variable: "--font-geist-sans",
|
|
8
|
+
weight: "100 900",
|
|
9
|
+
});
|
|
10
|
+
const geistMono = localFont({
|
|
11
|
+
src: "./fonts/GeistMonoVF.woff",
|
|
12
|
+
variable: "--font-geist-mono",
|
|
13
|
+
weight: "100 900",
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const metadata: Metadata = {
|
|
17
|
+
title: "Create Next App",
|
|
18
|
+
description: "Generated by create next app",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default function RootLayout({
|
|
22
|
+
children,
|
|
23
|
+
}: Readonly<{
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}>) {
|
|
26
|
+
return (
|
|
27
|
+
<html lang="en">
|
|
28
|
+
<body
|
|
29
|
+
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
|
30
|
+
>
|
|
31
|
+
{children}
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
|
34
|
+
);
|
|
35
|
+
}
|
package/src/app/page.tsx
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AlertDialog as AlertDialogUI,
|
|
3
|
+
AlertDialogAction,
|
|
4
|
+
AlertDialogCancel,
|
|
5
|
+
AlertDialogContent,
|
|
6
|
+
AlertDialogDescription,
|
|
7
|
+
AlertDialogFooter,
|
|
8
|
+
AlertDialogHeader,
|
|
9
|
+
AlertDialogTitle,
|
|
10
|
+
AlertDialogTrigger,
|
|
11
|
+
} from "../../ui/alert-dialog";
|
|
12
|
+
|
|
13
|
+
export type AlertDialogProps = {
|
|
14
|
+
title: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
onConfirm?: () => void;
|
|
18
|
+
onCancel?: () => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const AlertDialog = ({
|
|
22
|
+
title,
|
|
23
|
+
description,
|
|
24
|
+
children,
|
|
25
|
+
onConfirm,
|
|
26
|
+
onCancel,
|
|
27
|
+
}: AlertDialogProps) => {
|
|
28
|
+
return (
|
|
29
|
+
<AlertDialogUI>
|
|
30
|
+
<AlertDialogTrigger asChild>{children}</AlertDialogTrigger>
|
|
31
|
+
<AlertDialogContent>
|
|
32
|
+
<AlertDialogHeader>
|
|
33
|
+
<AlertDialogTitle>{title}</AlertDialogTitle>
|
|
34
|
+
{description && (
|
|
35
|
+
<AlertDialogDescription>{description}</AlertDialogDescription>
|
|
36
|
+
)}
|
|
37
|
+
</AlertDialogHeader>
|
|
38
|
+
<AlertDialogFooter>
|
|
39
|
+
<AlertDialogCancel onClick={onCancel}>Cancel</AlertDialogCancel>
|
|
40
|
+
<AlertDialogAction onClick={onConfirm}>Continue</AlertDialogAction>
|
|
41
|
+
</AlertDialogFooter>
|
|
42
|
+
</AlertDialogContent>
|
|
43
|
+
</AlertDialogUI>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/nextjs";
|
|
2
|
+
import { AlertDialog } from "./AlertDialog";
|
|
3
|
+
import { Button } from "../../ui/button";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof AlertDialog> = {
|
|
6
|
+
title: "Action/AlertDialog",
|
|
7
|
+
component: AlertDialog,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof AlertDialog>;
|
|
13
|
+
|
|
14
|
+
export const Default: Story = {
|
|
15
|
+
args: {
|
|
16
|
+
title: "Are you absolutely sure?",
|
|
17
|
+
description:
|
|
18
|
+
"This action cannot be undone. This will permanently delete your account and remove your data from our servers.",
|
|
19
|
+
children: <Button variant="destructive">Delete Account</Button>,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AlertDialog";
|