@tanishraj/ui-kit 1.0.7 → 1.0.9
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/index.d.ts +256 -0
- package/package.json +10 -8
- package/readme.md +162 -170
- package/dist/.storybook/StorybookThemeProvider.d.ts +0 -6
- package/dist/.storybook/main.d.ts +0 -3
- package/dist/.storybook/preview.d.ts +0 -3
- package/dist/eslint.config.d.mts +0 -2
- package/dist/setupTests.d.ts +0 -0
- package/dist/src/components/Alert/Alert.d.ts +0 -11
- package/dist/src/components/Alert/Alert.stories.d.ts +0 -10
- package/dist/src/components/Alert/Alert.styles.d.ts +0 -35
- package/dist/src/components/Alert/Alert.test.d.ts +0 -1
- package/dist/src/components/Alert/index.d.ts +0 -2
- package/dist/src/components/Alert/types.d.ts +0 -6
- package/dist/src/components/Avatar/Avatar.d.ts +0 -17
- package/dist/src/components/Avatar/Avatar.stories.d.ts +0 -11
- package/dist/src/components/Avatar/Avatar.styles.d.ts +0 -23
- package/dist/src/components/Avatar/Avatar.test.d.ts +0 -1
- package/dist/src/components/Avatar/index.d.ts +0 -2
- package/dist/src/components/Avatar/types.d.ts +0 -14
- package/dist/src/components/AvatarGroup/AvatarGroup.d.ts +0 -3
- package/dist/src/components/AvatarGroup/AvatarGroup.stories.d.ts +0 -9
- package/dist/src/components/AvatarGroup/AvatarGroup.styles.d.ts +0 -8
- package/dist/src/components/AvatarGroup/AvatarGroup.test.d.ts +0 -1
- package/dist/src/components/AvatarGroup/index.d.ts +0 -2
- package/dist/src/components/AvatarGroup/types.d.ts +0 -17
- package/dist/src/components/Badge/Badge.d.ts +0 -7
- package/dist/src/components/Badge/Badge.stories.d.ts +0 -10
- package/dist/src/components/Badge/Badge.styles.d.ts +0 -14
- package/dist/src/components/Badge/Badge.test.d.ts +0 -1
- package/dist/src/components/Badge/index.d.ts +0 -2
- package/dist/src/components/Badge/types.d.ts +0 -7
- package/dist/src/components/Button/Button.d.ts +0 -10
- package/dist/src/components/Button/Button.stories.d.ts +0 -12
- package/dist/src/components/Button/Button.styles.d.ts +0 -15
- package/dist/src/components/Button/Button.test.d.ts +0 -1
- package/dist/src/components/Button/index.d.ts +0 -2
- package/dist/src/components/Button/types.d.ts +0 -6
- package/dist/src/components/ButtonGroup/ButtonGroup.d.ts +0 -3
- package/dist/src/components/ButtonGroup/ButtonGroup.stories.d.ts +0 -12
- package/dist/src/components/ButtonGroup/ButtonGroup.styles.d.ts +0 -11
- package/dist/src/components/ButtonGroup/ButtonGroup.test.d.ts +0 -1
- package/dist/src/components/ButtonGroup/index.d.ts +0 -2
- package/dist/src/components/ButtonGroup/types.d.ts +0 -15
- package/dist/src/components/OrganizationChart/OrganizationChart.d.ts +0 -2
- package/dist/src/components/OrganizationChart/OrganizationChart.stories.d.ts +0 -7
- package/dist/src/components/OrganizationChart/OrganizationChart.styles.d.ts +0 -5
- package/dist/src/components/OrganizationChart/OrganizationChart.test.d.ts +0 -1
- package/dist/src/components/OrganizationChart/index.d.ts +0 -2
- package/dist/src/components/OrganizationChart/mockData.d.ts +0 -4
- package/dist/src/components/OrganizationChart/types.d.ts +0 -62
- package/dist/src/components/OrganizationChart/utils.d.ts +0 -10
- package/dist/src/components/OrganizationChart/utils.test.d.ts +0 -1
- package/dist/src/components/index.d.ts +0 -7
- package/dist/src/hooks/index.d.ts +0 -2
- package/dist/src/hooks/useTheme.d.ts +0 -5
- package/dist/src/hooks/useToggle.d.ts +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/providers/index.d.ts +0 -1
- package/dist/src/providers/theme/ThemeProvider.d.ts +0 -11
- package/dist/src/providers/theme/context.d.ts +0 -6
- package/dist/src/providers/theme/index.d.ts +0 -3
- package/dist/src/providers/theme/types.d.ts +0 -4
- package/dist/src/utils/classNames.d.ts +0 -2
- package/dist/src/utils/index.d.ts +0 -2
- package/dist/src/utils/types.d.ts +0 -3
- package/dist/vite.config.d.mts +0 -2
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import { ClassValue } from 'clsx';
|
|
3
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
4
|
+
import { ComponentPropsWithRef } from 'react';
|
|
5
|
+
import { FC } from 'react';
|
|
6
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
7
|
+
import { HTMLAttributes } from 'react';
|
|
8
|
+
import { ReactNode } from 'react';
|
|
9
|
+
import { RefAttributes } from 'react';
|
|
10
|
+
import { RemoveNull as RemoveNull_2 } from '../../../utils';
|
|
11
|
+
import { SVGProps } from 'react';
|
|
12
|
+
import { VariantProps } from 'class-variance-authority';
|
|
13
|
+
|
|
14
|
+
export declare const Alert: FC<AlertProps>;
|
|
15
|
+
|
|
16
|
+
export declare type AlertAppearances = RemoveNull_2<VariantProps<typeof alertWrapperStyles>>['appearance'];
|
|
17
|
+
|
|
18
|
+
export declare interface AlertProps extends RemoveNull_2<VariantProps<typeof alertWrapperStyles>> {
|
|
19
|
+
title?: string;
|
|
20
|
+
icon?: FC<SVGProps<SVGSVGElement>>;
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
onClose?: () => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export declare type AlertSizes = RemoveNull_2<VariantProps<typeof alertWrapperStyles>>['size'];
|
|
26
|
+
|
|
27
|
+
export declare type AlertVariants = RemoveNull_2<VariantProps<typeof alertWrapperStyles>>['variant'];
|
|
28
|
+
|
|
29
|
+
declare const alertWrapperStyles: (props?: ({
|
|
30
|
+
appearance?: "filled" | "outline" | "dashed" | null | undefined;
|
|
31
|
+
variant?: "default" | "primary" | "info" | "success" | "warning" | "danger" | null | undefined;
|
|
32
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
33
|
+
inverted?: boolean | null | undefined;
|
|
34
|
+
} & ClassProp) | undefined) => string;
|
|
35
|
+
|
|
36
|
+
export declare const Avatar: FC<AvatarProps>;
|
|
37
|
+
|
|
38
|
+
declare const avatarContainerStyles: (props?: ({
|
|
39
|
+
size?: "sm" | "md" | "lg" | "xs" | null | undefined;
|
|
40
|
+
variant?: "default" | "primary" | "info" | "success" | "warning" | "danger" | null | undefined;
|
|
41
|
+
shape?: "circle" | "square" | null | undefined;
|
|
42
|
+
inverted?: boolean | null | undefined;
|
|
43
|
+
stroke?: boolean | null | undefined;
|
|
44
|
+
} & ClassProp) | undefined) => string;
|
|
45
|
+
|
|
46
|
+
export declare const AvatarGroup: FC<AvatarGroupProps>;
|
|
47
|
+
|
|
48
|
+
export declare type AvatarGroupItem = Omit<AvatarProps, 'size' | 'shape' | 'inverted' | 'stroke' | 'className'>;
|
|
49
|
+
|
|
50
|
+
export declare interface AvatarGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
51
|
+
items?: AvatarGroupItem[];
|
|
52
|
+
size?: AvatarGroupSizes;
|
|
53
|
+
variant?: AvatarVariants;
|
|
54
|
+
shape?: AvatarGroupShapes;
|
|
55
|
+
max?: number;
|
|
56
|
+
inverted?: boolean;
|
|
57
|
+
stroke?: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export declare type AvatarGroupShapes = RemoveNull_2<VariantProps<typeof avatarContainerStyles>>['shape'];
|
|
61
|
+
|
|
62
|
+
export declare type AvatarGroupSizes = RemoveNull_2<VariantProps<typeof avatarContainerStyles>>['size'];
|
|
63
|
+
|
|
64
|
+
export declare type AvatarIcon = FC<SVGProps<SVGSVGElement>>;
|
|
65
|
+
|
|
66
|
+
export declare type AvatarImage = {
|
|
67
|
+
src: string;
|
|
68
|
+
alt: string;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export declare interface AvatarProps extends HTMLAttributes<HTMLSpanElement>, Omit<VariantProps<typeof avatarContainerStyles>, 'stroke'> {
|
|
72
|
+
icon?: AvatarIcon;
|
|
73
|
+
img?: AvatarImage;
|
|
74
|
+
initials?: string;
|
|
75
|
+
status?: AvatarStatus;
|
|
76
|
+
statusPosition?: AvatarStatusPosition;
|
|
77
|
+
size?: AvatarSizes;
|
|
78
|
+
shape?: AvatarShapes;
|
|
79
|
+
variant?: AvatarVariants;
|
|
80
|
+
inverted?: boolean;
|
|
81
|
+
stroke?: boolean;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export declare type AvatarShapes = RemoveNull_2<VariantProps<typeof avatarContainerStyles>>['shape'];
|
|
85
|
+
|
|
86
|
+
export declare type AvatarSizes = RemoveNull_2<VariantProps<typeof avatarContainerStyles>>['size'];
|
|
87
|
+
|
|
88
|
+
export declare type AvatarStatus = RemoveNull_2<VariantProps<typeof avatarStatusStyles>['status']>;
|
|
89
|
+
|
|
90
|
+
export declare type AvatarStatusPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
91
|
+
|
|
92
|
+
declare const avatarStatusStyles: (props?: ({
|
|
93
|
+
status?: "primary" | "info" | "success" | "warning" | "danger" | null | undefined;
|
|
94
|
+
shape?: "circle" | "square" | null | undefined;
|
|
95
|
+
position?: "top-right" | "top-left" | "bottom-right" | "bottom-left" | null | undefined;
|
|
96
|
+
size?: "sm" | "md" | "lg" | "xs" | null | undefined;
|
|
97
|
+
} & ClassProp) | undefined) => string;
|
|
98
|
+
|
|
99
|
+
export declare type AvatarVariants = RemoveNull_2<VariantProps<typeof avatarContainerStyles>>['variant'];
|
|
100
|
+
|
|
101
|
+
export declare const Badge: FC<BadgeProps>;
|
|
102
|
+
|
|
103
|
+
export declare type BadgeAppearances = RemoveNull_2<VariantProps<typeof badgeVariants>>['appearance'];
|
|
104
|
+
|
|
105
|
+
export declare interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, Omit<VariantProps<typeof badgeVariants>, 'appearance'> {
|
|
106
|
+
icon?: FC<SVGProps<SVGSVGElement>>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export declare type BadgeShapes = RemoveNull_2<VariantProps<typeof badgeVariants>>['shape'];
|
|
110
|
+
|
|
111
|
+
export declare type BadgeSizes = RemoveNull_2<VariantProps<typeof badgeVariants>>['size'];
|
|
112
|
+
|
|
113
|
+
export declare type BadgeVariants = RemoveNull_2<VariantProps<typeof badgeVariants>>['variant'];
|
|
114
|
+
|
|
115
|
+
declare const badgeVariants: (props?: ({
|
|
116
|
+
variant?: "default" | "primary" | "info" | "success" | "warning" | "danger" | null | undefined;
|
|
117
|
+
appearance?: "icon" | "dots" | "text" | null | undefined;
|
|
118
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
119
|
+
shape?: "circle" | "square" | null | undefined;
|
|
120
|
+
inverted?: boolean | null | undefined;
|
|
121
|
+
hasIcon?: boolean | null | undefined;
|
|
122
|
+
} & ClassProp) | undefined) => string;
|
|
123
|
+
|
|
124
|
+
export declare const Button: FC<ButtonProps>;
|
|
125
|
+
|
|
126
|
+
export declare type ButtonAppearances = RemoveNull_2<VariantProps<typeof buttonStyles>>['appearance'];
|
|
127
|
+
|
|
128
|
+
export declare const ButtonGroup: FC<ButtonGroupProps>;
|
|
129
|
+
|
|
130
|
+
export declare interface ButtonGroupItem extends Omit<ButtonProps, 'children' | 'ref' | 'className'> {
|
|
131
|
+
children?: ReactNode;
|
|
132
|
+
id?: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export declare type ButtonGroupOrientation = 'horizontal' | 'vertical';
|
|
136
|
+
|
|
137
|
+
export declare interface ButtonGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className'> {
|
|
138
|
+
buttons?: ButtonGroupItem[];
|
|
139
|
+
orientation?: ButtonGroupOrientation;
|
|
140
|
+
size?: ButtonGroupSizes;
|
|
141
|
+
inverted?: boolean;
|
|
142
|
+
role?: 'group' | string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export declare type ButtonGroupSizes = ButtonSizes;
|
|
146
|
+
|
|
147
|
+
export declare interface ButtonProps extends ComponentPropsWithRef<'button'>, RemoveNull<Omit<VariantProps<typeof buttonStyles>, 'disabled'>> {
|
|
148
|
+
children: ReactNode;
|
|
149
|
+
leadingIcon?: FC<SVGProps<SVGSVGElement>>;
|
|
150
|
+
trailingIcon?: FC<SVGProps<SVGSVGElement>>;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export declare type ButtonSizes = RemoveNull_2<VariantProps<typeof buttonStyles>>['size'];
|
|
154
|
+
|
|
155
|
+
declare const buttonStyles: (props?: ({
|
|
156
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
157
|
+
variant?: "default" | "primary" | "info" | "success" | "warning" | "danger" | null | undefined;
|
|
158
|
+
appearance?: "filled" | "outline" | "dashed" | "ghost" | null | undefined;
|
|
159
|
+
disabled?: boolean | null | undefined;
|
|
160
|
+
loading?: boolean | null | undefined;
|
|
161
|
+
fullWidth?: boolean | null | undefined;
|
|
162
|
+
inverted?: boolean | null | undefined;
|
|
163
|
+
} & ClassProp) | undefined) => string;
|
|
164
|
+
|
|
165
|
+
export declare type ButtonVariants = RemoveNull_2<VariantProps<typeof buttonStyles>>['variant'];
|
|
166
|
+
|
|
167
|
+
export declare const cn: (...inputs: ClassValue[]) => string;
|
|
168
|
+
|
|
169
|
+
declare enum EThemeOptions {
|
|
170
|
+
LIGHT = "light",
|
|
171
|
+
DARK = "dark"
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export declare const OrganizationChart: ForwardRefExoticComponent<OrgChartComponentProps & RefAttributes<OrgChartRef>>;
|
|
175
|
+
|
|
176
|
+
export declare interface OrgChartApiNodeData {
|
|
177
|
+
id: string;
|
|
178
|
+
companyId?: string;
|
|
179
|
+
securityPosition?: string | null;
|
|
180
|
+
entityName: string;
|
|
181
|
+
country?: OrgChartCountryData | null;
|
|
182
|
+
entityType?: string | null;
|
|
183
|
+
parent?: {
|
|
184
|
+
id: string;
|
|
185
|
+
} | null;
|
|
186
|
+
role?: string | null;
|
|
187
|
+
revenue?: number | null;
|
|
188
|
+
revenueAllocPct?: number | null;
|
|
189
|
+
__typename?: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export declare interface OrgChartComponentProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onClick'> {
|
|
193
|
+
data: Array<OrgChartNodeData | OrgChartApiNodeData>;
|
|
194
|
+
orientation?: OrgChartOrientation;
|
|
195
|
+
initialDepth?: number;
|
|
196
|
+
imageName?: string;
|
|
197
|
+
onNodeClick?: (nodeId: string) => void;
|
|
198
|
+
onZoomChange?: (zoomPercent: number) => void;
|
|
199
|
+
emptyMessage?: string;
|
|
200
|
+
showZoomBadge?: boolean;
|
|
201
|
+
dataTestId?: string;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export declare interface OrgChartCountryData {
|
|
205
|
+
id?: string | null;
|
|
206
|
+
name?: string | null;
|
|
207
|
+
country_code?: string | null;
|
|
208
|
+
__typename?: string;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export declare type OrgChartNodeAccent = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
|
|
212
|
+
|
|
213
|
+
export declare interface OrgChartNodeData {
|
|
214
|
+
id: string;
|
|
215
|
+
parentId: string | null;
|
|
216
|
+
name: string;
|
|
217
|
+
position: string;
|
|
218
|
+
countryCode?: string | null;
|
|
219
|
+
countryName?: string | null;
|
|
220
|
+
entityType?: string | null;
|
|
221
|
+
role?: string | null;
|
|
222
|
+
revenue?: number | null;
|
|
223
|
+
revenueShare?: number | null;
|
|
224
|
+
securityPosition?: string | null;
|
|
225
|
+
companyCode?: string;
|
|
226
|
+
location?: string;
|
|
227
|
+
headcount?: string;
|
|
228
|
+
accent?: OrgChartNodeAccent;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export declare type OrgChartOrientation = 'top' | 'left' | 'bottom' | 'right';
|
|
232
|
+
|
|
233
|
+
export declare interface OrgChartRef {
|
|
234
|
+
zoomIn: () => void;
|
|
235
|
+
zoomOut: () => void;
|
|
236
|
+
resetZoom: () => void;
|
|
237
|
+
resetLevel: () => void;
|
|
238
|
+
exportImg: () => void;
|
|
239
|
+
exportSvg: () => void;
|
|
240
|
+
expandAll: () => void;
|
|
241
|
+
collapseAll: () => void;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export declare type RemoveNull<T> = {
|
|
245
|
+
[K in keyof T]: Exclude<T[K], null>;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export declare const useTheme: () => {
|
|
249
|
+
theme: EThemeOptions;
|
|
250
|
+
isDark: boolean;
|
|
251
|
+
setTheme: (theme: EThemeOptions) => void;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export declare const useToggle: () => readonly [boolean, () => void];
|
|
255
|
+
|
|
256
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanishraj/ui-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "A production-ready React component library with modern tooling, Storybook docs, and TypeScript support.",
|
|
5
5
|
"author": "Tanishraj",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,19 +12,19 @@
|
|
|
12
12
|
"url": "https://github.com/tanishraj/ui-kit/issues"
|
|
13
13
|
},
|
|
14
14
|
"homepage": "https://github.com/tanishraj/ui-kit#readme",
|
|
15
|
-
"main": "dist/index.cjs",
|
|
16
|
-
"module": "dist/index.js",
|
|
15
|
+
"main": "dist/index.cjs.js",
|
|
16
|
+
"module": "dist/index.es.js",
|
|
17
17
|
"types": "dist/index.d.ts",
|
|
18
18
|
"type": "module",
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
|
-
"import": "./dist/index.js",
|
|
23
|
-
"require": "./dist/index.cjs"
|
|
22
|
+
"import": "./dist/index.es.js",
|
|
23
|
+
"require": "./dist/index.cjs.js"
|
|
24
24
|
},
|
|
25
25
|
"./globals.css": {
|
|
26
|
-
"import": "./dist/
|
|
27
|
-
"require": "./dist/
|
|
26
|
+
"import": "./dist/themes/primary.css",
|
|
27
|
+
"require": "./dist/themes/primary.css",
|
|
28
28
|
"default": "./dist/themes/primary.css"
|
|
29
29
|
},
|
|
30
30
|
"./theme-primary.css": {
|
|
@@ -44,12 +44,13 @@
|
|
|
44
44
|
"dist"
|
|
45
45
|
],
|
|
46
46
|
"scripts": {
|
|
47
|
-
"build": "rm -rf dist && vite build && npm run copy:theme",
|
|
47
|
+
"build": "rm -rf dist && vite build && npm run copy:theme && rm -rf dist/src",
|
|
48
48
|
"copy:theme": "mkdir -p dist/themes && cp src/themes/primary.css dist/themes/primary.css && cp src/themes/secondary.css dist/themes/secondary.css",
|
|
49
49
|
"prepublishOnly": "npm run build",
|
|
50
50
|
"test": "vitest",
|
|
51
51
|
"test:watch": "vitest --watch",
|
|
52
52
|
"test:coverage": "vitest --coverage",
|
|
53
|
+
"release:check": "npm run lint && npm run type-check && npm run test -- --run && npm run build",
|
|
53
54
|
"lint": "eslint .",
|
|
54
55
|
"lint:fix": "eslint . --fix && prettier --write .",
|
|
55
56
|
"format": "prettier --write .",
|
|
@@ -72,6 +73,7 @@
|
|
|
72
73
|
"devDependencies": {
|
|
73
74
|
"@chromatic-com/storybook": "^5.2.1",
|
|
74
75
|
"@eslint/js": "^9.14.0",
|
|
76
|
+
"@microsoft/api-extractor": "^7.58.9",
|
|
75
77
|
"@storybook/addon-docs": "^10.4.2",
|
|
76
78
|
"@storybook/addon-onboarding": "^10.4.2",
|
|
77
79
|
"@storybook/addon-vitest": "10.4.2",
|