kdpa-components 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "kdpa-components",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "main": "./dist",
6
6
  "types": "./dist",
7
7
  "exports": {
8
- ".": "./dist"
8
+ ".": "./dist/*"
9
9
  },
10
10
  "scripts": {
11
11
  "dev": "vite",
package/.eslintrc.cjs DELETED
@@ -1,16 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es2020: true
5
- },
6
- extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:react-hooks/recommended", "plugin:storybook/recommended"],
7
- parser: '@typescript-eslint/parser',
8
- parserOptions: {
9
- ecmaVersion: 'latest',
10
- sourceType: 'module'
11
- },
12
- plugins: ['react-refresh'],
13
- rules: {
14
- 'react-refresh/only-export-components': 'warn'
15
- }
16
- };
@@ -1,17 +0,0 @@
1
- import type { StorybookConfig } from "@storybook/react-vite";
2
- const config: StorybookConfig = {
3
- stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
4
- addons: [
5
- "@storybook/addon-links",
6
- "@storybook/addon-essentials",
7
- "@storybook/addon-interactions",
8
- ],
9
- framework: {
10
- name: "@storybook/react-vite",
11
- options: {},
12
- },
13
- docs: {
14
- autodocs: "tag",
15
- },
16
- };
17
- export default config;
@@ -1,15 +0,0 @@
1
- import type { Preview } from "@storybook/react";
2
-
3
- const preview: Preview = {
4
- parameters: {
5
- actions: { argTypesRegex: "^on[A-Z].*" },
6
- controls: {
7
- matchers: {
8
- color: /(background|color)$/i,
9
- date: /Date$/,
10
- },
11
- },
12
- },
13
- };
14
-
15
- export default preview;
package/index.html DELETED
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite + React + TS</title>
8
- </head>
9
- <body>
10
- <div id="root"></div>
11
- <script type="module" src="/src/main.tsx"></script>
12
- </body>
13
- </html>
package/src/App.tsx DELETED
@@ -1,34 +0,0 @@
1
- import { useState } from "react";
2
- // import reactLogo from "./assets/react.svg";
3
- // import viteLogo from "/vite.svg";
4
-
5
- function App() {
6
- const [count, setCount] = useState(0);
7
-
8
- return (
9
- <>
10
- <div>
11
- <a href="https://vitejs.dev" target="_blank">
12
- {/* <img src={viteLogo} className="logo" alt="Vite logo" /> */}
13
- </a>
14
- <a href="https://react.dev" target="_blank">
15
- {/* <img src={reactLogo} className="logo react" alt="React logo" /> */}
16
- </a>
17
- </div>
18
- <h1>Vite + React</h1>
19
- <div className="card">
20
- <button onClick={() => setCount((count) => count + 1)}>
21
- count is {count}
22
- </button>
23
- <p>
24
- Edit <code>src/App.tsx</code> and save to test HMR
25
- </p>
26
- </div>
27
- <p className="read-the-docs">
28
- Click on the Vite and React logos to learn more
29
- </p>
30
- </>
31
- );
32
- }
33
-
34
- export default App;
@@ -1,30 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import {
3
- KdpaAccordion,
4
- KdpaAccordionDetails,
5
- KdpaAccordionSummary,
6
- } from "./KdpaAccordions";
7
-
8
- const meta: Meta<typeof KdpaAccordion> = {
9
- title: "@Kdpa/KdpaAccordion",
10
- component: KdpaAccordion,
11
- tags: ["autodocs"],
12
- };
13
-
14
- export default meta;
15
- type Story = StoryObj<typeof KdpaAccordion>;
16
-
17
- export const Primary: Story = {
18
- args: {
19
- children: (
20
- <KdpaAccordion>
21
- <KdpaAccordionSummary>تست موضوع</KdpaAccordionSummary>
22
- <KdpaAccordionDetails>این موضوع تست میشود</KdpaAccordionDetails>
23
- </KdpaAccordion>
24
- ),
25
- },
26
- parameters: {
27
- componentSubtitle:
28
- "This link is for viewing the main component : https://mui.com/material-ui/react-accordion/",
29
- },
30
- };
@@ -1,36 +0,0 @@
1
- import React from "react";
2
- import Accordion, { AccordionProps } from "@mui/material/Accordion";
3
- import AccordionSummary, {
4
- AccordionSummaryProps,
5
- } from "@mui/material/AccordionSummary";
6
- import AccordionDetails, {
7
- AccordionDetailsProps,
8
- } from "@mui/material/AccordionDetails";
9
-
10
- export type KdpaAccordionProps = AccordionProps;
11
- export type KdpaAccordionSummaryProps = AccordionSummaryProps;
12
- export type KdpaAccordionDetailsProps = AccordionDetailsProps;
13
-
14
- const KdpaAccordion = ({ children, ...props }: KdpaAccordionProps) => {
15
- return <Accordion {...props}>{children}</Accordion>;
16
- };
17
-
18
- const KdpaAccordionSummary = ({
19
- children,
20
- ...props
21
- }: KdpaAccordionSummaryProps) => {
22
- return (
23
- <AccordionSummary aria-controls="panel1a-content" {...props}>
24
- {children}
25
- </AccordionSummary>
26
- );
27
- };
28
-
29
- const KdpaAccordionDetails = ({
30
- children,
31
- ...props
32
- }: KdpaAccordionDetailsProps) => {
33
- return <AccordionDetails {...props}>{children}</AccordionDetails>;
34
- };
35
-
36
- export { KdpaAccordion, KdpaAccordionSummary, KdpaAccordionDetails };
@@ -1,11 +0,0 @@
1
- export {
2
- KdpaAccordion,
3
- KdpaAccordionDetails,
4
- KdpaAccordionSummary,
5
- } from "./KdpaAccordions";
6
-
7
- export type {
8
- KdpaAccordionProps,
9
- KdpaAccordionDetailsProps,
10
- KdpaAccordionSummaryProps,
11
- } from "./KdpaAccordions";
@@ -1,25 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import KdpaAlert from "./KdpaAlert";
3
- import KdpaAlertTitle from "./KdpaAlertTitle";
4
-
5
- const meta: Meta<typeof KdpaAlert> = {
6
- title: "@Kdpa/KdpaAlert",
7
- component: KdpaAlert,
8
- tags: ["autodocs"],
9
- };
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof KdpaAlert>;
13
-
14
- export const Primary: Story = {
15
- args: {
16
- severity: "warning",
17
- className: "my-1",
18
- children: (
19
- <>
20
- <KdpaAlertTitle>توجه!</KdpaAlertTitle>
21
- <p>ارتباط برقرار نشد</p>
22
- </>
23
- ),
24
- },
25
- };
@@ -1,29 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import { Alert, AlertProps } from "@mui/material";
3
-
4
- export type KdpaAlertProps = AlertProps;
5
-
6
- const KdpaAlert = forwardRef<HTMLDivElement, KdpaAlertProps>(function KdpaAlert(
7
- props: KdpaAlertProps,
8
- ref
9
- ) {
10
- const color = {
11
- success: "bg-light-success",
12
- info: "bg-light-info",
13
- warning: "bg-light-warning",
14
- error: "bg-light-danger",
15
- }[props.severity ?? "info"];
16
-
17
- const className = props.className ?? "d-flex align-items-center mb-50";
18
- return (
19
- <Alert
20
- ref={ref}
21
- severity={props.severity}
22
- className={`${className} ${color}`}
23
- >
24
- {props.children}
25
- </Alert>
26
- );
27
- });
28
-
29
- export default KdpaAlert;
@@ -1,11 +0,0 @@
1
- import { AlertTitle, AlertTitleProps } from "@mui/material";
2
-
3
- export type KdpaAlertTitleProps = AlertTitleProps;
4
-
5
- function KdpaAlertTitle(props: KdpaAlertTitleProps) {
6
- return (
7
- <AlertTitle className={props.className ?? ""}>{props.children}</AlertTitle>
8
- );
9
- }
10
-
11
- export default KdpaAlertTitle;
package/src/main.tsx DELETED
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- import ReactDOM from "react-dom/client";
3
- import App from "./App";
4
-
5
- ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
6
- <React.StrictMode>
7
- <App />
8
- </React.StrictMode>
9
- );
package/src/vite-env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
File without changes