@mbao01/common 0.0.1 → 0.0.3
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/dist/types/components/Badge/Badge.d.ts +2 -0
- package/dist/types/components/Badge/constants.d.ts +5 -0
- package/dist/types/components/Badge/index.d.ts +1 -0
- package/dist/types/components/Badge/types.d.ts +7 -0
- package/dist/types/components/Button/Button.d.ts +2 -0
- package/dist/types/components/Button/constants.d.ts +8 -0
- package/dist/types/components/Button/index.d.ts +1 -0
- package/dist/types/components/Button/types.d.ts +12 -0
- package/dist/types/components/Card/Card.d.ts +8 -0
- package/dist/types/components/Card/index.d.ts +1 -0
- package/dist/types/components/Card/types.d.ts +24 -0
- package/dist/types/components/Detail/Detail.d.ts +2 -0
- package/dist/types/components/Detail/index.d.ts +1 -0
- package/dist/types/components/Detail/types.d.ts +5 -0
- package/dist/types/components/Text/Text.d.ts +4 -0
- package/dist/types/components/Text/constants.d.ts +5 -0
- package/dist/types/components/Text/index.d.ts +1 -0
- package/dist/types/components/Text/types.d.ts +10 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +2 -0
- package/dist/types/components/Tooltip/constants.d.ts +5 -0
- package/dist/types/components/Tooltip/index.d.ts +1 -0
- package/dist/types/components/Tooltip/types.d.ts +10 -0
- package/dist/types/index.d.ts +6 -0
- package/package.json +28 -21
- package/plugin.d.ts +1 -1
- package/.eslintrc.cjs +0 -34
- package/postcss.config.js +0 -6
- package/tailwind.config.ts +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Badge } from './Badge';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type BadgeSize = "xs" | "sm" | "md" | "lg";
|
|
2
|
+
export type BadgeVariant = "neutral" | "primary" | "secondary" | "accent" | "ghost" | "info" | "success" | "warning" | "error";
|
|
3
|
+
export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
4
|
+
size?: BadgeSize;
|
|
5
|
+
outline?: boolean;
|
|
6
|
+
variant?: BadgeVariant;
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ButtonSize, ButtonVariant } from './types';
|
|
2
|
+
export declare const getButtonClasses: ({ size, wide, loading, outline, variant, }: {
|
|
3
|
+
size?: ButtonSize | undefined;
|
|
4
|
+
wide?: boolean | undefined;
|
|
5
|
+
loading?: boolean | undefined;
|
|
6
|
+
outline?: boolean | undefined;
|
|
7
|
+
variant?: ButtonVariant | undefined;
|
|
8
|
+
}) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from "./Button";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
3
|
+
export type ButtonVariant = 'default' | 'neutral' | 'primary' | 'secondary' | 'accent' | 'ghost' | 'link' | 'info' | 'success' | 'warning' | 'error';
|
|
4
|
+
export type ButtonProps = {
|
|
5
|
+
size?: ButtonSize;
|
|
6
|
+
wide?: boolean;
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
outline?: boolean;
|
|
10
|
+
variant?: ButtonVariant;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardImageProps, CardProps } from "./types";
|
|
2
|
+
declare const Card: ({ compact, bordered, horizontal, overlay, className, ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const CardHeader: ({ className, ...props }: CardHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const CardDescription: ({ className, ...props }: CardDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const CardContent: ({ className, ...props }: CardContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const CardImage: ({ className, src, alt, ...props }: CardImageProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const CardFooter: ({ className, ...props }: CardFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { Card, CardHeader, CardFooter, CardDescription, CardContent, CardImage, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Card";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type CardProps = {
|
|
3
|
+
/**
|
|
4
|
+
* applies smaller padding to the card.
|
|
5
|
+
*/
|
|
6
|
+
compact?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* applies border to the card.
|
|
9
|
+
*/
|
|
10
|
+
bordered?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* shows the card horizontally with image to the right or left of it.
|
|
13
|
+
*/
|
|
14
|
+
horizontal?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* overlay is used to make the image full width with the content on top.
|
|
17
|
+
*/
|
|
18
|
+
overlay?: boolean;
|
|
19
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
20
|
+
export type CardContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
21
|
+
export type CardImageProps = React.ImgHTMLAttributes<HTMLImageElement>;
|
|
22
|
+
export type CardHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
23
|
+
export type CardFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
24
|
+
export type CardDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Detail } from './Detail';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Text } from './Text';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type TextSize = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl';
|
|
2
|
+
export type TextTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'p' | 'span';
|
|
3
|
+
export type TextVariant = 'info' | 'error' | 'success' | 'warning' | 'primary' | 'secondary' | 'accent' | 'neutral';
|
|
4
|
+
export type TextProps = {
|
|
5
|
+
as?: TextTag;
|
|
6
|
+
size?: TextSize;
|
|
7
|
+
variant?: TextVariant;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tooltip } from './Tooltip';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
3
|
+
export type TooltipVariant = 'default' | 'neutral' | 'primary' | 'secondary' | 'accent' | 'ghost' | 'link' | 'info' | 'success' | 'warning' | 'error';
|
|
4
|
+
export type TooltipProps = {
|
|
5
|
+
tip: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
variant?: TooltipVariant;
|
|
8
|
+
position?: TooltipPosition;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mbao01/common",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Ayomide Bakare",
|
|
7
7
|
"license": "MIT",
|
|
@@ -13,23 +13,30 @@
|
|
|
13
13
|
"common",
|
|
14
14
|
"library"
|
|
15
15
|
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": {
|
|
19
|
+
"types": "./dist/types/index.d.ts",
|
|
20
|
+
"default": "./src/index.ts"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"./plugin": "./plugin.js",
|
|
24
|
+
"./vitest/setup": "./vitest-setup.ts",
|
|
25
|
+
"./vitest/config": "./vitest.config.ts",
|
|
26
|
+
"./styles": "./src/stylesheets/index.css"
|
|
27
|
+
},
|
|
16
28
|
"main": "./src/index.ts",
|
|
29
|
+
"types": "dist/types/index.d.ts",
|
|
17
30
|
"files": [
|
|
18
31
|
"src",
|
|
32
|
+
"dist/types",
|
|
19
33
|
"plugin.js",
|
|
20
34
|
"plugin.d.ts",
|
|
21
|
-
".eslintrc.cjs",
|
|
22
|
-
"postcss.config.js",
|
|
23
|
-
"tailwind.config.ts",
|
|
24
35
|
"tsconfig.node.json",
|
|
25
36
|
"tsconfig.shared.json",
|
|
26
37
|
"vitest-setup.ts",
|
|
27
38
|
"vitest.config.ts"
|
|
28
39
|
],
|
|
29
|
-
"exports": {
|
|
30
|
-
"./plugin": "./plugin.js",
|
|
31
|
-
"./styles": "./src/stylesheets/index.css"
|
|
32
|
-
},
|
|
33
40
|
"bugs": "https://github.com/mbao01/mbao01/issues",
|
|
34
41
|
"homepage": "https://shared.ayomidebakare.site",
|
|
35
42
|
"repository": {
|
|
@@ -39,12 +46,22 @@
|
|
|
39
46
|
"sideEffects": [
|
|
40
47
|
"*.css"
|
|
41
48
|
],
|
|
49
|
+
"scripts": {
|
|
50
|
+
"dev": "storybook dev -p 6006",
|
|
51
|
+
"build": "tsc && vite build",
|
|
52
|
+
"build-storybook": "storybook build -o ../../docs/storybook/common",
|
|
53
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
54
|
+
"preview": "vite preview",
|
|
55
|
+
"test": "vitest run",
|
|
56
|
+
"test:ui": "vitest --ui",
|
|
57
|
+
"test:watch": "vitest",
|
|
58
|
+
"test:coverage": "vitest run --coverage"
|
|
59
|
+
},
|
|
42
60
|
"dependencies": {
|
|
43
61
|
"clsx": "^2.1.0",
|
|
44
62
|
"daisyui": "^4.6.2"
|
|
45
63
|
},
|
|
46
64
|
"devDependencies": {
|
|
47
|
-
"@heroicons/react": "^2.1.1",
|
|
48
65
|
"@storybook/addon-essentials": "^7.6.14",
|
|
49
66
|
"@storybook/addon-interactions": "^7.6.14",
|
|
50
67
|
"@storybook/addon-links": "^7.6.14",
|
|
@@ -90,15 +107,5 @@
|
|
|
90
107
|
"react-dom": "^18.2.0",
|
|
91
108
|
"typescript": "^5.2.2"
|
|
92
109
|
},
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
"build": "tsc && vite build",
|
|
96
|
-
"build-storybook": "storybook build",
|
|
97
|
-
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
98
|
-
"preview": "vite preview",
|
|
99
|
-
"test": "vitest run",
|
|
100
|
-
"test:ui": "vitest --ui",
|
|
101
|
-
"test:watch": "vitest",
|
|
102
|
-
"test:coverage": "vitest run --coverage"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
110
|
+
"gitHead": "fb1542aac0eb979dd16d8d4448e4380726e4e330"
|
|
111
|
+
}
|
package/plugin.d.ts
CHANGED
package/.eslintrc.cjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: { browser: true, es2020: true },
|
|
4
|
-
extends: [
|
|
5
|
-
"eslint:recommended",
|
|
6
|
-
"plugin:@typescript-eslint/recommended-type-checked",
|
|
7
|
-
"plugin:@typescript-eslint/stylistic-type-checked",
|
|
8
|
-
"plugin:react-hooks/recommended",
|
|
9
|
-
"plugin:storybook/recommended",
|
|
10
|
-
"plugin:react/recommended",
|
|
11
|
-
"plugin:react/jsx-runtime",
|
|
12
|
-
],
|
|
13
|
-
ignorePatterns: ["dist", ".eslintrc.cjs", "storybook-static"],
|
|
14
|
-
parser: "@typescript-eslint/parser",
|
|
15
|
-
plugins: ["react-refresh"],
|
|
16
|
-
parserOptions: {
|
|
17
|
-
ecmaVersion: "latest",
|
|
18
|
-
sourceType: "module",
|
|
19
|
-
project: ["./tsconfig.json", "./tsconfig.node.json"],
|
|
20
|
-
tsconfigRootDir: __dirname,
|
|
21
|
-
},
|
|
22
|
-
rules: {
|
|
23
|
-
"react-refresh/only-export-components": [
|
|
24
|
-
"warn",
|
|
25
|
-
{ allowConstantExport: true },
|
|
26
|
-
],
|
|
27
|
-
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
28
|
-
},
|
|
29
|
-
settings: {
|
|
30
|
-
react: {
|
|
31
|
-
version: "detect",
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
};
|
package/postcss.config.js
DELETED
package/tailwind.config.ts
DELETED