@js-empire/emperor-ui 1.1.0 → 1.2.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/.storybook/vitest.setup.ts +3 -3
- package/.vscode/extensions.json +1 -3
- package/README.md +0 -21
- package/dist/emperor-ui.js +71 -0
- package/dist/emperor-ui.umd.cjs +49 -0
- package/dist/features-animation-D_Ss-HYx.js +1938 -0
- package/dist/globals.css +1 -0
- package/dist/icons/emperor-ui-logo.ico +0 -0
- package/dist/images/avatar-female.jpg +0 -0
- package/dist/images/avatar-male.jpg +0 -0
- package/dist/images/emperor-ui-logo.png +0 -0
- package/dist/index-C3mfrNCk.js +1630 -0
- package/dist/index-CZpTSGZs.js +5 -0
- package/dist/index-SRvFgjzo.js +26257 -0
- package/dist/index.d.ts +706 -0
- package/dist/src-UW24ZMRV-Ducut0ty.js +5 -0
- package/eslint.config.js +5 -14
- package/package.json +4 -4
- package/src/components/atoms/brand/brand.stories.tsx +3 -3
- package/src/components/atoms/brand/brand.tsx +3 -3
- package/src/components/atoms/column/column.stories.tsx +5 -4
- package/src/components/atoms/column/column.tsx +2 -2
- package/src/components/atoms/container/column.stories.tsx +5 -4
- package/src/components/atoms/container/container.tsx +2 -2
- package/src/components/atoms/portal/portal.stories.tsx +4 -4
- package/src/components/atoms/portal/portal.tsx +4 -2
- package/src/components/atoms/row/row.stories.tsx +5 -4
- package/src/components/atoms/row/row.tsx +2 -2
- package/src/components/atoms/uploader/avatar-label.tsx +2 -2
- package/src/components/atoms/uploader/stories/uploader.stories.tsx +127 -8
- package/src/components/atoms/uploader/upload-file-error-box.tsx +1 -1
- package/src/components/atoms/uploader/upload-file-input.tsx +2 -2
- package/src/components/atoms/uploader/upload-file-label.tsx +1 -1
- package/src/components/atoms/uploader/upload-file-listing.tsx +6 -4
- package/src/components/atoms/uploader/uploader.tsx +4 -4
- package/src/components/atoms/uploader/view-image-modal.tsx +6 -5
- package/src/components/molecules/filter/filter.tsx +2 -2
- package/src/components/molecules/item-card/item-card.tsx +2 -2
- package/src/components/molecules/nav-bar/nav-bar-item.tsx +3 -3
- package/src/components/molecules/nav-bar/nav-bar.tsx +4 -4
- package/src/components/molecules/nav-bar/stories/hover-effect/nav-bar-hover-effect.stories.tsx +4 -4
- package/src/components/molecules/nav-bar/stories/nav-bar.stories.tsx +4 -4
- package/src/components/molecules/nav-bar/styles/styles.ts +2 -1
- package/src/components/molecules/nav-bar/sub-items-box.tsx +2 -2
- package/src/components/molecules/scaffold/scaffold.stories.tsx +3 -3
- package/src/components/molecules/scaffold/scaffold.tsx +4 -4
- package/src/components/molecules/side-bar/compact-side-bar.tsx +5 -3
- package/src/components/molecules/side-bar/side-bar-drawer.tsx +3 -3
- package/src/components/molecules/side-bar/side-bar.stories.tsx +9 -8
- package/src/components/molecules/side-bar/side-bar.tsx +2 -2
- package/src/components/molecules/side-bar/styles/styles.ts +1 -1
- package/src/components/organisms/footer/copy-rights-box.tsx +27 -0
- package/src/components/organisms/footer/footer.tsx +69 -14
- package/src/components/organisms/footer/index.ts +4 -0
- package/src/components/organisms/footer/policies-box.tsx +26 -0
- package/src/components/organisms/footer/quick-links-box.tsx +45 -0
- package/src/components/organisms/footer/social-links-box.tsx +32 -0
- package/src/components/organisms/footer/stories/footer.stories.tsx +61 -0
- package/src/components/organisms/footer/styles/classes.ts +58 -2
- package/src/components/organisms/footer/styles/styles.ts +2 -5
- package/src/components/organisms/header/header.tsx +5 -5
- package/src/components/organisms/header/segmented-header-content.tsx +3 -3
- package/src/components/organisms/header/stories/header.stories.tsx +8 -7
- package/src/components/organisms/header/styles/styles.ts +1 -1
- package/src/components/organisms/index.ts +1 -1
- package/src/components/organisms/item-details/item-details.tsx +2 -2
- package/src/components/organisms/listings/listings.tsx +2 -2
- package/src/components/templates/landing-page/landing-page.stories.tsx +3 -3
- package/src/components/templates/landing-page/landing-page.tsx +5 -5
- package/src/constants/defaults.ts +1 -1
- package/src/constants/fake.ts +3 -0
- package/src/constants/footer.tsx +157 -0
- package/src/constants/index.ts +1 -0
- package/src/context/emperor-ui-context.ts +1 -1
- package/src/context/navigation-context.ts +1 -1
- package/src/context/uploader-context.ts +1 -1
- package/src/hooks/use-emperor-ui.ts +1 -1
- package/src/hooks/use-navigation.ts +1 -1
- package/src/hooks/use-uploader-context.ts +1 -1
- package/src/hooks/use-uploader.tsx +42 -106
- package/src/main.tsx +1 -1
- package/src/mocks/header.tsx +1 -1
- package/src/providers/config-provider.tsx +4 -4
- package/src/providers/emperor-ui-provider.tsx +2 -2
- package/src/providers/navigation-provider.tsx +3 -3
- package/src/providers/uploader-provider.tsx +2 -2
- package/src/types/components/atoms/brand.ts +1 -1
- package/src/types/components/atoms/column.ts +1 -1
- package/src/types/components/atoms/container.ts +1 -1
- package/src/types/components/atoms/portal.ts +1 -1
- package/src/types/components/atoms/row.ts +1 -1
- package/src/types/components/atoms/uploader.ts +4 -11
- package/src/types/components/molecules/filter/filter.ts +1 -1
- package/src/types/components/molecules/footer/footer.ts +60 -1
- package/src/types/components/molecules/header/header.ts +1 -1
- package/src/types/components/molecules/item-card/item-card.ts +1 -1
- package/src/types/components/molecules/item-details/item-details.ts +1 -1
- package/src/types/components/molecules/listings/listings.ts +1 -1
- package/src/types/components/molecules/nav-bar/nav-bar.ts +2 -1
- package/src/types/components/molecules/scaffold/scaffold.ts +1 -1
- package/src/types/components/molecules/side-bar/side-bar.ts +1 -1
- package/src/types/components/templates/landing-page.ts +1 -1
- package/src/types/context/navigation.ts +1 -1
- package/src/utils/compress-images.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/storybook.tsx +3 -3
- package/src/utils/uploader.ts +148 -0
- package/tsconfig.app.json +1 -10
- package/vite.config.ts +1 -10
- package/vitest.shims.d.ts +1 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,706 @@
|
|
|
1
|
+
import { ButtonProps } from '@heroui/react';
|
|
2
|
+
import { ButtonProps as ButtonProps_2 } from '@heroui/button';
|
|
3
|
+
import { ClassAttributes } from 'react';
|
|
4
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
5
|
+
import { ClassValue } from 'clsx';
|
|
6
|
+
import { Context } from 'react';
|
|
7
|
+
import { Dispatch } from 'react';
|
|
8
|
+
import { ElementType } from 'react';
|
|
9
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
10
|
+
import { HeroUIProviderProps } from '@heroui/react';
|
|
11
|
+
import { HTMLAttributes } from 'react';
|
|
12
|
+
import { JSX } from 'react/jsx-runtime';
|
|
13
|
+
import { LiHTMLAttributes } from 'react';
|
|
14
|
+
import { ModalProps } from '@heroui/react';
|
|
15
|
+
import { ReactNode } from 'react';
|
|
16
|
+
import { ReactPortal } from 'react';
|
|
17
|
+
import { RefAttributes } from 'react';
|
|
18
|
+
import { SetStateAction } from 'react';
|
|
19
|
+
import { VariantProps } from 'class-variance-authority';
|
|
20
|
+
|
|
21
|
+
export declare type Address = {
|
|
22
|
+
country?: string;
|
|
23
|
+
street?: string;
|
|
24
|
+
city?: string;
|
|
25
|
+
state?: string;
|
|
26
|
+
zip?: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export declare const ALLOWED_DOC_TYPES: string[];
|
|
30
|
+
|
|
31
|
+
export declare const ALLOWED_IMAGES_TYPES: string[];
|
|
32
|
+
|
|
33
|
+
export declare const ALLOWED_PDF_TYPES: string[];
|
|
34
|
+
|
|
35
|
+
export declare type AppDirection = "ltr" | "rtl";
|
|
36
|
+
|
|
37
|
+
export declare function AvatarLabel(): JSX.Element;
|
|
38
|
+
|
|
39
|
+
export declare const Brand: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
40
|
+
variant?: null | undefined;
|
|
41
|
+
} & ClassProp) | undefined) => string> & SharedComponentProps & {
|
|
42
|
+
src?: string;
|
|
43
|
+
alt?: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
isIconOnly?: boolean;
|
|
46
|
+
classNames?: {
|
|
47
|
+
base?: string;
|
|
48
|
+
logo?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
};
|
|
51
|
+
}, "ref"> & RefAttributes<HTMLElement>>;
|
|
52
|
+
|
|
53
|
+
export declare type BrandProps = SharedComponentProps & {
|
|
54
|
+
src?: string;
|
|
55
|
+
alt?: string;
|
|
56
|
+
name?: string;
|
|
57
|
+
isIconOnly?: boolean;
|
|
58
|
+
classNames?: {
|
|
59
|
+
base?: string;
|
|
60
|
+
logo?: string;
|
|
61
|
+
name?: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export declare function cn(...classes: ClassValue[]): string;
|
|
66
|
+
|
|
67
|
+
export declare type ColorMode = "light" | "dark";
|
|
68
|
+
|
|
69
|
+
export declare type ColorsPalette = {
|
|
70
|
+
primary: string;
|
|
71
|
+
secondary: string;
|
|
72
|
+
success: string;
|
|
73
|
+
danger: string;
|
|
74
|
+
warning: string;
|
|
75
|
+
info: string;
|
|
76
|
+
background: string;
|
|
77
|
+
foreground: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export declare const Column: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLElement> & HTMLAttributes<HTMLElement> & VariantProps<(props?: ({} & ClassProp) | undefined) => string> & SharedComponentProps, "ref"> & RefAttributes<HTMLElement>>;
|
|
81
|
+
|
|
82
|
+
export declare type ColumnProps = SharedComponentProps & {};
|
|
83
|
+
|
|
84
|
+
export declare type CompactSideBarProps = SideBarProps & {};
|
|
85
|
+
|
|
86
|
+
export declare type ComponentRadius = "none" | "sm" | "md" | "lg" | "full";
|
|
87
|
+
|
|
88
|
+
export declare type ComponentSize = "xs" | "sm" | "base" | "md" | "lg" | "xl";
|
|
89
|
+
|
|
90
|
+
export declare function compressImage(fileObject: FileObject, maxSizeMB?: number): Promise<FileObject | null>;
|
|
91
|
+
|
|
92
|
+
export declare type ConfigContextState = {
|
|
93
|
+
config: EmperorUIConfig;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export declare function ConfigProvider({ children, config, }: ConfigProviderProps): JSX.Element;
|
|
97
|
+
|
|
98
|
+
export declare type ConfigProviderProps = {
|
|
99
|
+
children: ReactNode;
|
|
100
|
+
config?: EmperorUIConfig;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export declare type Contacts = {
|
|
104
|
+
mobile?: string;
|
|
105
|
+
email?: string;
|
|
106
|
+
addresses?: Address[];
|
|
107
|
+
website?: string;
|
|
108
|
+
workingHours?: string;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export declare const contacts: Contacts;
|
|
112
|
+
|
|
113
|
+
export declare const Container: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLElement> & HTMLAttributes<HTMLElement> & VariantProps<(props?: ({} & ClassProp) | undefined) => string> & SharedComponentProps, "ref"> & RefAttributes<HTMLElement>>;
|
|
114
|
+
|
|
115
|
+
export declare type ContainerProps = SharedComponentProps & {};
|
|
116
|
+
|
|
117
|
+
export declare type CopyRights = {
|
|
118
|
+
year: number;
|
|
119
|
+
text: string;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export declare const copyRights: CopyRights;
|
|
123
|
+
|
|
124
|
+
export declare function CopyRightsBox({ copyRights, classNames }: FooterProps): JSX.Element;
|
|
125
|
+
|
|
126
|
+
export declare const defaultColorsPalette: ColorsPalette;
|
|
127
|
+
|
|
128
|
+
export declare const defaultEmperorUIConfig: EmperorUIConfig;
|
|
129
|
+
|
|
130
|
+
export declare type EmperorUIConfig = {
|
|
131
|
+
theme?: Partial<EmperorUITheme>;
|
|
132
|
+
layout?: Partial<EmperorUILayout>;
|
|
133
|
+
interLocalization?: Partial<EmperorUIInterLocalization>;
|
|
134
|
+
toast?: HeroUIProviderProps;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export declare const EmperorUIContext: Context<ConfigContextState | undefined>;
|
|
138
|
+
|
|
139
|
+
export declare type EmperorUIInterLocalization = {
|
|
140
|
+
lang?: EmperorUILang;
|
|
141
|
+
languages?: EmperorUILang[];
|
|
142
|
+
defaultLanguage?: EmperorUILang;
|
|
143
|
+
isMultiLingual?: boolean;
|
|
144
|
+
dir?: AppDirection;
|
|
145
|
+
locales?: EmperorUILocales;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export declare type EmperorUILang = "en" | "ar";
|
|
149
|
+
|
|
150
|
+
export declare type EmperorUILayout = {
|
|
151
|
+
withScaffold: boolean;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export declare type EmperorUILocales = Record<EmperorUILang, Record<string, string>>;
|
|
155
|
+
|
|
156
|
+
export declare function EmperorUIProvider({ children, ...props }: EmperorUIProviderProps): JSX.Element;
|
|
157
|
+
|
|
158
|
+
declare type EmperorUIProviderProps = ConfigProviderProps & {};
|
|
159
|
+
|
|
160
|
+
export declare type EmperorUITheme = {
|
|
161
|
+
mode: ColorMode;
|
|
162
|
+
colors: Partial<ColorsPalette>;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export declare const FAKE_PARAGRAPH = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc,";
|
|
166
|
+
|
|
167
|
+
export declare const FAKE_SENTENCE = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.";
|
|
168
|
+
|
|
169
|
+
export declare type FileObject = {
|
|
170
|
+
view?: string;
|
|
171
|
+
type?: FileType;
|
|
172
|
+
file?: File;
|
|
173
|
+
url?: string;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export declare type FileType = "image" | "doc" | "pdf" | "video" | "sheet";
|
|
177
|
+
|
|
178
|
+
export declare const fileTypesMapping: {
|
|
179
|
+
[key: string]: string[];
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export declare function Filter({ className }: FilterProps): JSX.Element;
|
|
183
|
+
|
|
184
|
+
export declare type FilterClassnames = {
|
|
185
|
+
base?: string;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export declare type FilterProps = SharedComponentProps & {
|
|
189
|
+
classNames?: FilterClassnames;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export declare const Footer: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLElement> & HTMLAttributes<HTMLElement> & VariantProps<(props?: ({
|
|
193
|
+
variant?: "default" | null | undefined;
|
|
194
|
+
} & ClassProp) | undefined) => string> & SharedComponentProps & {
|
|
195
|
+
classNames?: FooterClassnames;
|
|
196
|
+
policies?: QuickLink[];
|
|
197
|
+
quickLinks?: QuickLinkCollection[];
|
|
198
|
+
socialLinks?: SocialLink[];
|
|
199
|
+
copyRights?: CopyRights;
|
|
200
|
+
contacts?: Contacts;
|
|
201
|
+
}, "ref"> & RefAttributes<HTMLElement>>;
|
|
202
|
+
|
|
203
|
+
export declare type FooterClassnames = {
|
|
204
|
+
base?: string;
|
|
205
|
+
content?: string;
|
|
206
|
+
policiesWrapper?: string;
|
|
207
|
+
policy?: string;
|
|
208
|
+
quickLinksWrapper?: string;
|
|
209
|
+
quickLinksTitle?: string;
|
|
210
|
+
quickLinksList?: string;
|
|
211
|
+
quickLinksItem?: string;
|
|
212
|
+
quickLinksLink?: string;
|
|
213
|
+
socialLinksWrapper?: string;
|
|
214
|
+
socialLink?: string;
|
|
215
|
+
copyRightsWrapper?: string;
|
|
216
|
+
copyRightsText?: string;
|
|
217
|
+
contactsWrapper?: string;
|
|
218
|
+
contact?: string;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export declare type FooterProps = SharedComponentProps & {
|
|
222
|
+
classNames?: FooterClassnames;
|
|
223
|
+
policies?: QuickLink[];
|
|
224
|
+
quickLinks?: QuickLinkCollection[];
|
|
225
|
+
socialLinks?: SocialLink[];
|
|
226
|
+
copyRights?: CopyRights;
|
|
227
|
+
contacts?: Contacts;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export declare const getAllowedTypes: (fileTypes: FileType[]) => string[];
|
|
231
|
+
|
|
232
|
+
export declare const getStorybookDecorators: ({ config, }: {
|
|
233
|
+
config?: EmperorUIConfig;
|
|
234
|
+
}) => ((Story: any) => JSX.Element)[];
|
|
235
|
+
|
|
236
|
+
export declare const Header: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLElement> & HTMLAttributes<HTMLElement> & VariantProps<(props?: ({
|
|
237
|
+
variant?: "default" | "floating" | "light" | "segmented-floating" | null | undefined;
|
|
238
|
+
} & ClassProp) | undefined) => string> & SharedComponentProps & {
|
|
239
|
+
variant?: HeaderVariant;
|
|
240
|
+
classNames?: HeaderClassnames;
|
|
241
|
+
glassEffect?: HeaderGlassEffect;
|
|
242
|
+
}, "ref"> & RefAttributes<HTMLElement>>;
|
|
243
|
+
|
|
244
|
+
export declare type HeaderActivations = {
|
|
245
|
+
hideLog?: boolean;
|
|
246
|
+
hideNavbar?: boolean;
|
|
247
|
+
hideUserDropdown?: boolean;
|
|
248
|
+
hideSideMenu?: boolean;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
export declare type HeaderClassnames = {
|
|
252
|
+
base?: string;
|
|
253
|
+
logo?: string;
|
|
254
|
+
navbar?: string;
|
|
255
|
+
userDropdown?: string;
|
|
256
|
+
sideMenu?: string;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export declare type HeaderDropdownProps = SharedComponentProps & {};
|
|
260
|
+
|
|
261
|
+
export declare type HeaderGlassEffect = {
|
|
262
|
+
enabled?: boolean;
|
|
263
|
+
blur?: number;
|
|
264
|
+
backgroundColor?: string;
|
|
265
|
+
foregroundColor?: string;
|
|
266
|
+
opacity?: number;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
export declare type HeaderProps = SharedComponentProps & {
|
|
270
|
+
variant?: HeaderVariant;
|
|
271
|
+
classNames?: HeaderClassnames;
|
|
272
|
+
glassEffect?: HeaderGlassEffect;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
export declare type HeaderStylesProps = {
|
|
276
|
+
primaryColor?: string;
|
|
277
|
+
foregroundColor?: string;
|
|
278
|
+
variant?: HeaderVariant;
|
|
279
|
+
glassEffect?: HeaderGlassEffect;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
export declare type HeaderVariant = "default" | "floating" | "light" | "segmented-floating";
|
|
283
|
+
|
|
284
|
+
export declare const isFileDuplicated: ({ files, fileName, }: {
|
|
285
|
+
files: FileObject[];
|
|
286
|
+
fileName: string;
|
|
287
|
+
}) => boolean;
|
|
288
|
+
|
|
289
|
+
export declare const isMaxFileSizeExceeded: ({ fileSize, maxFileSize, }: {
|
|
290
|
+
fileSize: number;
|
|
291
|
+
maxFileSize: number;
|
|
292
|
+
}) => boolean;
|
|
293
|
+
|
|
294
|
+
export declare function ItemCard({ className }: ItemCardProps): JSX.Element;
|
|
295
|
+
|
|
296
|
+
export declare type ItemCardClassnames = {
|
|
297
|
+
base?: string;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
export declare type ItemCardProps = SharedComponentProps & {
|
|
301
|
+
classNames?: ItemCardClassnames;
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
export declare function ItemDetails({ className }: ItemDetailsProps): JSX.Element;
|
|
305
|
+
|
|
306
|
+
export declare type ItemDetailsClassnames = {
|
|
307
|
+
base?: string;
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
export declare type ItemDetailsProps = SharedComponentProps & {
|
|
311
|
+
classNames?: ItemDetailsClassnames;
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* This component is not for general use nor it is reusable, it is intended to be used as a demo page.
|
|
316
|
+
*/
|
|
317
|
+
export declare const LandingPage: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLElement> & HTMLAttributes<HTMLElement> & VariantProps<(props?: ({
|
|
318
|
+
variant?: "default" | null | undefined;
|
|
319
|
+
} & ClassProp) | undefined) => string> & SharedComponentProps & {
|
|
320
|
+
classNames?: LandingPageClassnames;
|
|
321
|
+
variant?: "default";
|
|
322
|
+
}, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
323
|
+
|
|
324
|
+
export declare type LandingPageClassnames = {
|
|
325
|
+
base?: string;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
export declare type LandingPageProps = SharedComponentProps & {
|
|
329
|
+
classNames?: LandingPageClassnames;
|
|
330
|
+
variant?: "default";
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
export declare function Listings({ className }: ListingsProps): JSX.Element;
|
|
334
|
+
|
|
335
|
+
export declare type ListingsClassnames = {
|
|
336
|
+
base?: string;
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
export declare type ListingsProps = SharedComponentProps & {
|
|
340
|
+
classNames?: ListingsClassnames;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
export declare const mapFileType: (fileType: string) => FileType | null;
|
|
344
|
+
|
|
345
|
+
export declare const MOCK_HEADER_ACTIONS: SideBarAction[];
|
|
346
|
+
|
|
347
|
+
export declare const MOCK_HEADER_ITEMS: NavigationItem[];
|
|
348
|
+
|
|
349
|
+
export declare const MOCK_HEADER_ITEMS_WITH_SUB_ITEMS: NavigationItem[];
|
|
350
|
+
|
|
351
|
+
export declare const MOCK_HEADER_SUB_ITEMS: NavigationItem[];
|
|
352
|
+
|
|
353
|
+
export declare const NavBar: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLElement> & HTMLAttributes<HTMLElement> & VariantProps<(props?: ({
|
|
354
|
+
hoverEffect?: "default" | "underline" | "solid" | "ghost" | "bordered" | "none" | null | undefined;
|
|
355
|
+
variant?: "default" | "solid" | "bordered" | null | undefined;
|
|
356
|
+
} & ClassProp) | undefined) => string> & SharedComponentProps & {
|
|
357
|
+
items: NavigationItem[];
|
|
358
|
+
classNames?: NavBarClassnames;
|
|
359
|
+
hoverEffect?: NavBarHoverEffect;
|
|
360
|
+
radius?: ComponentRadius;
|
|
361
|
+
size?: ComponentSize;
|
|
362
|
+
variant?: NavBarVariant;
|
|
363
|
+
subItemsColumns?: number;
|
|
364
|
+
}, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
365
|
+
|
|
366
|
+
export declare type NavBarClassnames = {
|
|
367
|
+
base?: string;
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
export declare type NavBarHoverEffect = "default" | "underline" | "solid" | "ghost" | "bordered" | "none";
|
|
371
|
+
|
|
372
|
+
export declare const NavBarItem: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLLIElement> & LiHTMLAttributes<HTMLLIElement> & VariantProps<(props?: ({
|
|
373
|
+
hoverEffect?: "default" | "underline" | "solid" | "ghost" | "bordered" | "none" | null | undefined;
|
|
374
|
+
variant?: "default" | "solid" | "bordered" | null | undefined;
|
|
375
|
+
} & ClassProp) | undefined) => string> & NavBarItemProps, "ref"> & RefAttributes<HTMLLIElement>>;
|
|
376
|
+
|
|
377
|
+
export declare type NavBarItemProps = {
|
|
378
|
+
item: NavigationItem;
|
|
379
|
+
variant: NavBarVariant;
|
|
380
|
+
hoverEffect: NavBarHoverEffect;
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
export declare type NavBarItemStylesProps = {
|
|
384
|
+
foregroundColor?: string;
|
|
385
|
+
primaryColor?: string;
|
|
386
|
+
hoverEffect: NavBarHoverEffect;
|
|
387
|
+
isHovered?: boolean;
|
|
388
|
+
variant?: NavBarVariant;
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
export declare type NavBarMenuStylesProps = {};
|
|
392
|
+
|
|
393
|
+
export declare type NavBarProps = SharedComponentProps & {
|
|
394
|
+
items: NavigationItem[];
|
|
395
|
+
classNames?: NavBarClassnames;
|
|
396
|
+
hoverEffect?: NavBarHoverEffect;
|
|
397
|
+
radius?: ComponentRadius;
|
|
398
|
+
size?: ComponentSize;
|
|
399
|
+
variant?: NavBarVariant;
|
|
400
|
+
subItemsColumns?: number;
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
export declare type NavBarStylesProps = {
|
|
404
|
+
primaryColor?: string;
|
|
405
|
+
foregroundColor?: string;
|
|
406
|
+
variant?: NavBarVariant;
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
export declare type NavBarVariant = "default" | "solid" | "bordered";
|
|
410
|
+
|
|
411
|
+
export declare const NavigationContext: Context<NavigationContextState | undefined>;
|
|
412
|
+
|
|
413
|
+
export declare type NavigationContextState = {
|
|
414
|
+
hoveredItemId: string | null;
|
|
415
|
+
subItems: NavigationItem[];
|
|
416
|
+
isSubItemsBoxOpen: boolean;
|
|
417
|
+
subItemsBoxIsHovered: boolean;
|
|
418
|
+
setHoveredItemId: (id: string | null) => void;
|
|
419
|
+
setSubItems: (items: NavigationItem[]) => void;
|
|
420
|
+
setIsSubItemsBoxOpen: (isOpen: boolean) => void;
|
|
421
|
+
setSubItemsBoxIsHovered: (isHovered: boolean) => void;
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
export declare type NavigationItem = {
|
|
425
|
+
id: string;
|
|
426
|
+
label?: string;
|
|
427
|
+
href?: string;
|
|
428
|
+
subItems?: NavigationItem[];
|
|
429
|
+
onClick?: () => void;
|
|
430
|
+
Icon?: ElementType;
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
export declare function NavigationProvider({ children }: NavigationProviderProps): JSX.Element;
|
|
434
|
+
|
|
435
|
+
export declare type NavigationProviderProps = {
|
|
436
|
+
children: ReactNode;
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
export declare const ONE_MEGABYTE = 1024;
|
|
440
|
+
|
|
441
|
+
export declare enum Placeholders {
|
|
442
|
+
PLACEHOLDER_MALE_AVATAR = "/images/placeholder-male-avatar.png",
|
|
443
|
+
PLACEHOLDER_FEMALE_AVATAR = "/images/placeholder-female-avatar.png"
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export declare const policies: QuickLink[];
|
|
447
|
+
|
|
448
|
+
export declare function PoliciesBox({ policies, classNames }: FooterProps): JSX.Element;
|
|
449
|
+
|
|
450
|
+
export declare function Portal({ children, containerId, isVisible, }: PortalProps): ReactPortal | null;
|
|
451
|
+
|
|
452
|
+
export declare type PortalProps = SharedComponentProps & {
|
|
453
|
+
containerId: string;
|
|
454
|
+
isVisible?: boolean;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
export declare enum PreservedKeys {
|
|
458
|
+
COMPACT_SIDEBAR_ID = "emperor-compact-sidebar"
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
export declare type QuickLink = {
|
|
462
|
+
label: string;
|
|
463
|
+
href: string;
|
|
464
|
+
isExternal?: boolean;
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
export declare type QuickLinkCollection = {
|
|
468
|
+
title?: string;
|
|
469
|
+
links: QuickLink[];
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
export declare const quickLinks: QuickLinkCollection[];
|
|
473
|
+
|
|
474
|
+
export declare function QuickLinksBox({ quickLinks, classNames }: FooterProps): JSX.Element;
|
|
475
|
+
|
|
476
|
+
export declare function refineUploadedFiles({ uploadedFiles, locale, allowedTypes, isMulti, setFiles, }: {
|
|
477
|
+
uploadedFiles: (File | undefined)[];
|
|
478
|
+
locale?: Record<string, string> | undefined;
|
|
479
|
+
allowedTypes: string[];
|
|
480
|
+
isMulti: boolean;
|
|
481
|
+
setFiles: Dispatch<SetStateAction<FileObject[]>>;
|
|
482
|
+
}): Promise<void[]>;
|
|
483
|
+
|
|
484
|
+
export declare const Row: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLElement> & HTMLAttributes<HTMLElement> & VariantProps<(props?: ({} & ClassProp) | undefined) => string> & SharedComponentProps, "ref"> & RefAttributes<HTMLElement>>;
|
|
485
|
+
|
|
486
|
+
export declare type RowProps = SharedComponentProps & {};
|
|
487
|
+
|
|
488
|
+
export declare const Scaffold: ForwardRefExoticComponent<SharedComponentProps & {
|
|
489
|
+
classNames?: ScaffoldClassnames;
|
|
490
|
+
} & RefAttributes<HTMLDivElement>>;
|
|
491
|
+
|
|
492
|
+
export declare type ScaffoldClassnames = {
|
|
493
|
+
base?: string;
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
export declare type ScaffoldProps = SharedComponentProps & {
|
|
497
|
+
classNames?: ScaffoldClassnames;
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
export declare type SegmentedHeaderContentProps = SharedComponentProps & {
|
|
501
|
+
glassEffect?: HeaderGlassEffect;
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
export declare type SharedComponentProps = {
|
|
505
|
+
className?: string;
|
|
506
|
+
children?: ReactNode;
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
export declare type SharedFilesType = FileObject[];
|
|
510
|
+
|
|
511
|
+
export declare type SharedLabelIdType = string;
|
|
512
|
+
|
|
513
|
+
export declare type SharedOnInputChangeType = (event: React.ChangeEvent<HTMLInputElement> & React.DragEvent<HTMLLabelElement>) => Promise<void>;
|
|
514
|
+
|
|
515
|
+
export declare const SideBar: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
516
|
+
variant?: "default" | "compact" | null | undefined;
|
|
517
|
+
} & ClassProp) | undefined) => string> & SharedComponentProps & {
|
|
518
|
+
classNames?: SideBarClassnames;
|
|
519
|
+
variant?: SideBarVariant;
|
|
520
|
+
items: NavigationItem[];
|
|
521
|
+
actions?: SideBarAction[];
|
|
522
|
+
triggerProps?: Omit<ButtonProps_2, "content"> & {
|
|
523
|
+
content?: ReactNode;
|
|
524
|
+
};
|
|
525
|
+
isOpen?: boolean;
|
|
526
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
527
|
+
header?: ReactNode;
|
|
528
|
+
}, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
529
|
+
|
|
530
|
+
export declare type SideBarAction = ButtonProps & {
|
|
531
|
+
key: string;
|
|
532
|
+
label?: string;
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
export declare type SideBarClassnames = {
|
|
536
|
+
base?: string;
|
|
537
|
+
trigger?: string;
|
|
538
|
+
title?: string;
|
|
539
|
+
menu?: string;
|
|
540
|
+
menuItem?: string;
|
|
541
|
+
actionsWrapper?: string;
|
|
542
|
+
actionItem?: string;
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
export declare type SideBarItemStylesProps = {
|
|
546
|
+
foregroundColor?: string;
|
|
547
|
+
primaryColor?: string;
|
|
548
|
+
isHovered?: boolean;
|
|
549
|
+
variant?: SideBarVariant;
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
export declare type SideBarProps = SharedComponentProps & {
|
|
553
|
+
classNames?: SideBarClassnames;
|
|
554
|
+
variant?: SideBarVariant;
|
|
555
|
+
items: NavigationItem[];
|
|
556
|
+
actions?: SideBarAction[];
|
|
557
|
+
triggerProps?: Omit<ButtonProps, "content"> & {
|
|
558
|
+
content?: ReactNode;
|
|
559
|
+
};
|
|
560
|
+
isOpen?: boolean;
|
|
561
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
562
|
+
header?: ReactNode;
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
export declare type SideBarVariant = "default" | "compact";
|
|
566
|
+
|
|
567
|
+
export declare type SocialLink = {
|
|
568
|
+
label?: string;
|
|
569
|
+
href: string;
|
|
570
|
+
icon?: ReactNode;
|
|
571
|
+
isExternal?: boolean;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
export declare const socialLinks: SocialLink[];
|
|
575
|
+
|
|
576
|
+
export declare function SocialLinksBox({ socialLinks, classNames }: FooterProps): JSX.Element;
|
|
577
|
+
|
|
578
|
+
export declare const SubItemsBox: ({ subItemsColumns }: SubItemsBoxProps) => JSX.Element;
|
|
579
|
+
|
|
580
|
+
export declare type SubItemsBoxProps = {
|
|
581
|
+
subItemsColumns?: number;
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* @usage
|
|
586
|
+
* ```
|
|
587
|
+
* const uploadProps = useUpload({
|
|
588
|
+
labelId: "uploaded-file",
|
|
589
|
+
fileTypes: ["image", "pdf"],
|
|
590
|
+
isRequired: true,
|
|
591
|
+
isMulti: true,
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
<Uploader {...uploadProps} />
|
|
595
|
+
* ```
|
|
596
|
+
*/
|
|
597
|
+
export declare const Uploader: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({} & ClassProp) | undefined) => string> & SharedComponentProps & UploaderContextState & {
|
|
598
|
+
className?: string;
|
|
599
|
+
hideListing?: boolean;
|
|
600
|
+
isAvatar?: boolean;
|
|
601
|
+
}, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
602
|
+
|
|
603
|
+
export declare const UploaderContext: Context<UploaderContextState | undefined>;
|
|
604
|
+
|
|
605
|
+
export declare type UploaderContextState = {
|
|
606
|
+
selectedFile?: FileObject | null;
|
|
607
|
+
setSelectedFile?: (file: FileObject | null) => void;
|
|
608
|
+
labelId: SharedLabelIdType;
|
|
609
|
+
labelContent?: ReactNode;
|
|
610
|
+
avatarLabelContent?: ReactNode;
|
|
611
|
+
isFileViewable?: boolean;
|
|
612
|
+
isRequired?: boolean;
|
|
613
|
+
isDraggable?: boolean;
|
|
614
|
+
isLoading: boolean;
|
|
615
|
+
hideErrorMessage?: boolean;
|
|
616
|
+
isMulti: boolean;
|
|
617
|
+
placeholderImage?: string;
|
|
618
|
+
files: SharedFilesType;
|
|
619
|
+
fileTypes: FileType[];
|
|
620
|
+
onInputChange: SharedOnInputChangeType;
|
|
621
|
+
handleClearFile: (fileName?: string) => void;
|
|
622
|
+
modal?: Omit<ModalProps, "children"> & {
|
|
623
|
+
onOpen?: () => void;
|
|
624
|
+
};
|
|
625
|
+
classNames?: {
|
|
626
|
+
label?: string;
|
|
627
|
+
avatar?: string;
|
|
628
|
+
listing?: string;
|
|
629
|
+
error?: string;
|
|
630
|
+
input?: string;
|
|
631
|
+
};
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
export declare type UploaderProps = SharedComponentProps & UploaderContextState & {
|
|
635
|
+
className?: string;
|
|
636
|
+
hideListing?: boolean;
|
|
637
|
+
isAvatar?: boolean;
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
export declare function UploaderProvider({ children, ...props }: UploaderProviderProps): JSX.Element;
|
|
641
|
+
|
|
642
|
+
export declare type UploaderProviderProps = UploaderContextState & {
|
|
643
|
+
children: ReactNode;
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
export declare function UploadFileErrorBox(): JSX.Element | null;
|
|
647
|
+
|
|
648
|
+
export declare function UploadFileInput(): JSX.Element;
|
|
649
|
+
|
|
650
|
+
export declare function UploadFileLabel(): JSX.Element;
|
|
651
|
+
|
|
652
|
+
export declare function UploadFileListing(): (JSX.Element | null)[];
|
|
653
|
+
|
|
654
|
+
export declare function useEmperorUI(): ConfigContextState;
|
|
655
|
+
|
|
656
|
+
export declare function useNavigation(): NavigationContextState;
|
|
657
|
+
|
|
658
|
+
export declare type UserDropdownProps = SharedComponentProps & {};
|
|
659
|
+
|
|
660
|
+
export declare const useUploader: ({ labelContent, labelId, fileTypes, isRequired, isDraggable, isMulti, preventDuplicates, maxCount, maxFileSize, compressFiles, onChange, }: UseUploadFileProps) => UseUploadFileReturn;
|
|
661
|
+
|
|
662
|
+
export declare function useUploaderContext(): UploaderContextState;
|
|
663
|
+
|
|
664
|
+
export declare type UseUploadFileProps = {
|
|
665
|
+
labelId: string;
|
|
666
|
+
fileTypes: FileType[];
|
|
667
|
+
labelContent?: ReactNode;
|
|
668
|
+
isRequired?: boolean;
|
|
669
|
+
isMulti?: boolean;
|
|
670
|
+
isDraggable?: boolean;
|
|
671
|
+
maxCount?: number;
|
|
672
|
+
maxFileSize?: number;
|
|
673
|
+
compressFiles?: boolean;
|
|
674
|
+
preventDuplicates?: boolean;
|
|
675
|
+
onChange?: () => void;
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
export declare type UseUploadFileReturn = {
|
|
679
|
+
files: FileObject[];
|
|
680
|
+
fileTypes: FileType[];
|
|
681
|
+
labelId: string;
|
|
682
|
+
isRequired: boolean;
|
|
683
|
+
labelContent: ReactNode;
|
|
684
|
+
isDraggable: boolean;
|
|
685
|
+
isMulti: boolean;
|
|
686
|
+
isLoading: boolean;
|
|
687
|
+
setFiles: Dispatch<SetStateAction<FileObject[]>>;
|
|
688
|
+
handleClearFile: (fileName?: string) => void;
|
|
689
|
+
onInputChange: (event: React.ChangeEvent<HTMLInputElement> & React.DragEvent<HTMLLabelElement>) => Promise<void | string | null>;
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
export declare function validateUploadedFiles({ uploadedFiles, maxFileSize, compressFiles, locale, preventDuplicates, files, }: {
|
|
693
|
+
uploadedFiles: File[];
|
|
694
|
+
maxFileSize?: number;
|
|
695
|
+
compressFiles?: boolean;
|
|
696
|
+
locale?: Record<string, string> | undefined;
|
|
697
|
+
preventDuplicates?: boolean;
|
|
698
|
+
files: FileObject[];
|
|
699
|
+
}): Promise<{
|
|
700
|
+
compressedFiles: (File | undefined)[];
|
|
701
|
+
isInValid: boolean;
|
|
702
|
+
}>;
|
|
703
|
+
|
|
704
|
+
export declare function ViewImageModal(): JSX.Element | null;
|
|
705
|
+
|
|
706
|
+
export { }
|