@js-empire/emperor-ui 1.3.6 → 1.3.8
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/emperor-ui.js +4157 -158
- package/dist/index.d.ts +3 -2
- package/package.json +56 -10
- package/.cursor/rules/code-conventions.mdc +0 -50
- package/.husky/pre-commit +0 -4
- package/.prettierrc +0 -10
- package/.storybook/main.ts +0 -24
- package/.storybook/preview.ts +0 -19
- package/.storybook/vitest.setup.ts +0 -7
- package/.vscode/extensions.json +0 -1
- package/dist/emperor-ui.umd.cjs +0 -77
- 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-ABKcY4tX.js +0 -60607
- package/dist/index-CWu5fG3N.js +0 -6
- package/dist/index-DpemL3iQ.js +0 -291
- package/dist/src-UW24ZMRV-I8bMqcTI.js +0 -6
- package/eslint.config.js +0 -34
- package/index.html +0 -13
- package/public/icons/emperor-ui-logo.ico +0 -0
- package/public/images/avatar-female.jpg +0 -0
- package/public/images/avatar-male.jpg +0 -0
- package/public/images/emperor-ui-logo.png +0 -0
- package/src/animations/blink.ts +0 -26
- package/src/animations/floating.ts +0 -12
- package/src/animations/index.ts +0 -2
- package/src/components/atoms/brand/brand.stories.tsx +0 -27
- package/src/components/atoms/brand/brand.tsx +0 -56
- package/src/components/atoms/brand/index.ts +0 -1
- package/src/components/atoms/brand/styles/classes.ts +0 -9
- package/src/components/atoms/brand/styles/index.ts +0 -2
- package/src/components/atoms/brand/styles/styles.ts +0 -0
- package/src/components/atoms/color-picker/color-picker.tsx +0 -12
- package/src/components/atoms/color-picker/free-color-picker.tsx +0 -58
- package/src/components/atoms/color-picker/index.ts +0 -3
- package/src/components/atoms/color-picker/preset-color-picker.tsx +0 -66
- package/src/components/atoms/color-picker/stories/color-picker.stories.tsx +0 -63
- package/src/components/atoms/column/column.stories.tsx +0 -37
- package/src/components/atoms/column/column.tsx +0 -21
- package/src/components/atoms/column/index.ts +0 -1
- package/src/components/atoms/container/column.stories.tsx +0 -37
- package/src/components/atoms/container/container.tsx +0 -28
- package/src/components/atoms/container/index.ts +0 -1
- package/src/components/atoms/copy-button/copy-button.tsx +0 -73
- package/src/components/atoms/copy-button/index.ts +0 -1
- package/src/components/atoms/copy-button/stories/copy-button.stories.tsx +0 -21
- package/src/components/atoms/field/field.tsx +0 -81
- package/src/components/atoms/field/index.ts +0 -3
- package/src/components/atoms/field/styles/classes.ts +0 -9
- package/src/components/atoms/field/styles/index.ts +0 -1
- package/src/components/atoms/field/units/autocomplete-field.tsx +0 -49
- package/src/components/atoms/field/units/checkbox-field.tsx +0 -35
- package/src/components/atoms/field/units/index.ts +0 -7
- package/src/components/atoms/field/units/input-field.tsx +0 -35
- package/src/components/atoms/field/units/radio-field.tsx +0 -43
- package/src/components/atoms/field/units/select-field.tsx +0 -50
- package/src/components/atoms/field/units/switch-field.tsx +0 -35
- package/src/components/atoms/field/units/textarea-field.tsx +0 -37
- package/src/components/atoms/filter/filter.tsx +0 -93
- package/src/components/atoms/filter/index.ts +0 -3
- package/src/components/atoms/filter/stories/filter.stories.tsx +0 -238
- package/src/components/atoms/filter/styles/classes.ts +0 -20
- package/src/components/atoms/filter/styles/index.ts +0 -1
- package/src/components/atoms/filter/units/autocomplete-filter.tsx +0 -66
- package/src/components/atoms/filter/units/checkbox-filter.tsx +0 -42
- package/src/components/atoms/filter/units/checkbox-group-filter.tsx +0 -68
- package/src/components/atoms/filter/units/date-filter.tsx +0 -46
- package/src/components/atoms/filter/units/index.ts +0 -9
- package/src/components/atoms/filter/units/numeric-filter.tsx +0 -41
- package/src/components/atoms/filter/units/range-filter.tsx +0 -65
- package/src/components/atoms/filter/units/search-filter.tsx +0 -53
- package/src/components/atoms/filter/units/select-filter.tsx +0 -57
- package/src/components/atoms/filter/units/switch-filter.tsx +0 -35
- package/src/components/atoms/index.ts +0 -11
- package/src/components/atoms/portal/index.ts +0 -1
- package/src/components/atoms/portal/portal.stories.tsx +0 -43
- package/src/components/atoms/portal/portal.tsx +0 -25
- package/src/components/atoms/row/index.ts +0 -1
- package/src/components/atoms/row/row.stories.tsx +0 -37
- package/src/components/atoms/row/row.tsx +0 -26
- package/src/components/atoms/theme-switch/index.ts +0 -1
- package/src/components/atoms/theme-switch/styles/classes.ts +0 -16
- package/src/components/atoms/theme-switch/styles/index.ts +0 -1
- package/src/components/atoms/theme-switch/theme-switch.stories.tsx +0 -26
- package/src/components/atoms/theme-switch/theme-switch.tsx +0 -54
- package/src/components/atoms/uploader/components/avatar-label.tsx +0 -102
- package/src/components/atoms/uploader/components/index.ts +0 -8
- package/src/components/atoms/uploader/components/upload-file-error-box.tsx +0 -40
- package/src/components/atoms/uploader/components/upload-file-input.tsx +0 -36
- package/src/components/atoms/uploader/components/upload-file-label.tsx +0 -92
- package/src/components/atoms/uploader/components/upload-file-listing.tsx +0 -64
- package/src/components/atoms/uploader/components/uploader-title.tsx +0 -21
- package/src/components/atoms/uploader/components/uploader.tsx +0 -89
- package/src/components/atoms/uploader/components/view-image-modal.tsx +0 -41
- package/src/components/atoms/uploader/index.ts +0 -1
- package/src/components/atoms/uploader/stories/uploader.stories.tsx +0 -202
- package/src/components/index.ts +0 -4
- package/src/components/molecules/index.ts +0 -4
- package/src/components/molecules/item-card/components/actions/index.ts +0 -3
- package/src/components/molecules/item-card/components/actions/item-actions-buttons.tsx +0 -43
- package/src/components/molecules/item-card/components/actions/item-actions-dropdown.tsx +0 -57
- package/src/components/molecules/item-card/components/actions/item-actions-overlay.tsx +0 -50
- package/src/components/molecules/item-card/components/additions/index.ts +0 -2
- package/src/components/molecules/item-card/components/additions/item-banner.tsx +0 -22
- package/src/components/molecules/item-card/components/additions/loading-item.tsx +0 -88
- package/src/components/molecules/item-card/components/card/index.ts +0 -4
- package/src/components/molecules/item-card/components/card/item-card-body.tsx +0 -74
- package/src/components/molecules/item-card/components/card/item-card-footer.tsx +0 -79
- package/src/components/molecules/item-card/components/card/item-card-header.tsx +0 -69
- package/src/components/molecules/item-card/components/card/item-card.tsx +0 -123
- package/src/components/molecules/item-card/components/index.ts +0 -3
- package/src/components/molecules/item-card/index.ts +0 -2
- package/src/components/molecules/item-card/stories/item-card.stories.tsx +0 -218
- package/src/components/molecules/item-card/styles/classes.ts +0 -141
- package/src/components/molecules/item-card/styles/index.ts +0 -1
- package/src/components/molecules/nav-bar/index.ts +0 -3
- package/src/components/molecules/nav-bar/nav-bar-item.tsx +0 -64
- package/src/components/molecules/nav-bar/nav-bar.tsx +0 -57
- package/src/components/molecules/nav-bar/stories/hover-effect/nav-bar-hover-effect.stories.tsx +0 -52
- package/src/components/molecules/nav-bar/stories/nav-bar.stories.tsx +0 -50
- package/src/components/molecules/nav-bar/styles/classes.ts +0 -68
- package/src/components/molecules/nav-bar/styles/index.ts +0 -2
- package/src/components/molecules/nav-bar/styles/styles.ts +0 -85
- package/src/components/molecules/nav-bar/sub-items-box.tsx +0 -58
- package/src/components/molecules/scaffold/index.ts +0 -2
- package/src/components/molecules/scaffold/scaffold.stories.tsx +0 -21
- package/src/components/molecules/scaffold/scaffold.tsx +0 -23
- package/src/components/molecules/scaffold/styles/index.ts +0 -1
- package/src/components/molecules/scaffold/styles/scaffold-classes.ts +0 -10
- package/src/components/molecules/side-bar/compact-side-bar.tsx +0 -77
- package/src/components/molecules/side-bar/index.ts +0 -1
- package/src/components/molecules/side-bar/side-bar-drawer.tsx +0 -113
- package/src/components/molecules/side-bar/side-bar.stories.tsx +0 -111
- package/src/components/molecules/side-bar/side-bar.tsx +0 -31
- package/src/components/molecules/side-bar/styles/classes.ts +0 -28
- package/src/components/molecules/side-bar/styles/index.ts +0 -2
- package/src/components/molecules/side-bar/styles/styles.ts +0 -13
- package/src/components/organisms/deletion-confirmor/deletion-confirmor.tsx +0 -110
- package/src/components/organisms/deletion-confirmor/index.ts +0 -3
- package/src/components/organisms/deletion-confirmor/stories/components.tsx +0 -25
- package/src/components/organisms/deletion-confirmor/stories/deletion-confirmor.stories.tsx +0 -78
- package/src/components/organisms/deletion-confirmor/styles/classes.ts +0 -28
- package/src/components/organisms/deletion-confirmor/styles/index.ts +0 -2
- package/src/components/organisms/deletion-confirmor/styles/styles.ts +0 -4
- package/src/components/organisms/footer/copy-rights-box.tsx +0 -27
- package/src/components/organisms/footer/footer.tsx +0 -75
- package/src/components/organisms/footer/index.ts +0 -5
- package/src/components/organisms/footer/policies-box.tsx +0 -27
- package/src/components/organisms/footer/quick-links-box.tsx +0 -46
- package/src/components/organisms/footer/social-links-box.tsx +0 -33
- package/src/components/organisms/footer/stories/footer.stories.tsx +0 -61
- package/src/components/organisms/footer/styles/classes.ts +0 -71
- package/src/components/organisms/footer/styles/index.ts +0 -2
- package/src/components/organisms/footer/styles/styles.ts +0 -6
- package/src/components/organisms/form-builder/form-builder.stories.tsx +0 -144
- package/src/components/organisms/form-builder/form-builder.tsx +0 -75
- package/src/components/organisms/form-builder/index.ts +0 -1
- package/src/components/organisms/header/header.tsx +0 -87
- package/src/components/organisms/header/index.ts +0 -1
- package/src/components/organisms/header/segmented-header-content.tsx +0 -29
- package/src/components/organisms/header/stories/header.stories.tsx +0 -144
- package/src/components/organisms/header/styles/classes.ts +0 -22
- package/src/components/organisms/header/styles/index.ts +0 -2
- package/src/components/organisms/header/styles/styles.ts +0 -39
- package/src/components/organisms/index.ts +0 -6
- package/src/components/organisms/item-details/index.ts +0 -1
- package/src/components/organisms/item-details/item-details.tsx +0 -6
- package/src/components/organisms/listings/empty-listings.tsx +0 -80
- package/src/components/organisms/listings/index.ts +0 -3
- package/src/components/organisms/listings/listings.tsx +0 -96
- package/src/components/organisms/listings/stories/grid-listings.stories.tsx +0 -153
- package/src/components/organisms/listings/stories/list-listings.stories.tsx +0 -171
- package/src/components/organisms/listings/styles/classes.ts +0 -49
- package/src/components/organisms/listings/styles/index.ts +0 -2
- package/src/components/organisms/listings/styles/styles.ts +0 -6
- package/src/components/templates/index.ts +0 -1
- package/src/components/templates/landing-page/index.ts +0 -1
- package/src/components/templates/landing-page/landing-page.stories.tsx +0 -21
- package/src/components/templates/landing-page/landing-page.tsx +0 -57
- package/src/components/templates/landing-page/styles/classes.ts +0 -11
- package/src/components/templates/landing-page/styles/index.ts +0 -1
- package/src/constants/animations.ts +0 -14
- package/src/constants/card.tsx +0 -42
- package/src/constants/defaults.ts +0 -59
- package/src/constants/fake.ts +0 -5
- package/src/constants/footer.tsx +0 -157
- package/src/constants/index.ts +0 -6
- package/src/constants/uploader.ts +0 -33
- package/src/context/emperor-ui-context.ts +0 -6
- package/src/context/form-builder-context.tsx +0 -8
- package/src/context/index.ts +0 -4
- package/src/context/navigation-context.ts +0 -6
- package/src/context/uploader-context.ts +0 -6
- package/src/enums/index.ts +0 -2
- package/src/enums/placeholders.ts +0 -4
- package/src/enums/preserved-keys.ts +0 -3
- package/src/examples/index.ts +0 -1
- package/src/hooks/index.ts +0 -8
- package/src/hooks/use-emperor-ui.ts +0 -12
- package/src/hooks/use-filters.ts +0 -20
- package/src/hooks/use-form-builder-context.ts +0 -16
- package/src/hooks/use-navigation.ts +0 -12
- package/src/hooks/use-search-params-handler.tsx +0 -186
- package/src/hooks/use-uploader-context.ts +0 -14
- package/src/hooks/use-uploader.tsx +0 -164
- package/src/hooks/use-window-size.tsx +0 -53
- package/src/i18n/configs/i18n.ts +0 -7
- package/src/i18n/configs/index.ts +0 -1
- package/src/i18n/constants/index.ts +0 -1
- package/src/i18n/constants/locales.ts +0 -4
- package/src/i18n/index.ts +0 -5
- package/src/i18n/locales/ar.ts +0 -15
- package/src/i18n/locales/atoms/ar.ts +0 -18
- package/src/i18n/locales/atoms/en.ts +0 -18
- package/src/i18n/locales/atoms/index.ts +0 -2
- package/src/i18n/locales/common/ar.ts +0 -1
- package/src/i18n/locales/common/en.ts +0 -1
- package/src/i18n/locales/common/index.ts +0 -2
- package/src/i18n/locales/en.ts +0 -15
- package/src/i18n/locales/index.ts +0 -4
- package/src/i18n/locales/molecules/ar.ts +0 -1
- package/src/i18n/locales/molecules/en.ts +0 -1
- package/src/i18n/locales/molecules/index.ts +0 -2
- package/src/i18n/locales/organisms/ar.ts +0 -11
- package/src/i18n/locales/organisms/en.ts +0 -11
- package/src/i18n/locales/organisms/index.ts +0 -2
- package/src/i18n/locales/templates/ar.ts +0 -1
- package/src/i18n/locales/templates/en.ts +0 -1
- package/src/i18n/locales/templates/index.ts +0 -2
- package/src/i18n/locales/toasts/ar.ts +0 -1
- package/src/i18n/locales/toasts/en.ts +0 -1
- package/src/i18n/locales/toasts/index.ts +0 -2
- package/src/i18n/types/index.ts +0 -2
- package/src/i18n/types/locale.ts +0 -5
- package/src/i18n/types/toasts.ts +0 -3
- package/src/i18n/utils/get-locales.ts +0 -4
- package/src/i18n/utils/index.ts +0 -2
- package/src/i18n/utils/localize.ts +0 -15
- package/src/index.ts +0 -14
- package/src/mocks/constants.ts +0 -103
- package/src/mocks/deletion-confirmor.ts +0 -16
- package/src/mocks/header.tsx +0 -118
- package/src/mocks/index.ts +0 -6
- package/src/mocks/listings.tsx +0 -154
- package/src/mocks/locales/index.ts +0 -1
- package/src/mocks/locales/uploader.ts +0 -33
- package/src/mocks/types.ts +0 -64
- package/src/providers/config-provider.tsx +0 -72
- package/src/providers/emperor-ui-provider.tsx +0 -35
- package/src/providers/form-builder-provider-context.tsx +0 -18
- package/src/providers/index.ts +0 -6
- package/src/providers/navigation-provider.tsx +0 -42
- package/src/providers/theme-provider.tsx +0 -16
- package/src/providers/uploader-provider.tsx +0 -53
- package/src/styles/globals.css +0 -38
- package/src/styles/hero.ts +0 -3
- package/src/styles/index.css +0 -18
- package/src/types/components/atoms/brand.ts +0 -13
- package/src/types/components/atoms/color-picker/color-picker.ts +0 -21
- package/src/types/components/atoms/color-picker/index.ts +0 -1
- package/src/types/components/atoms/column.ts +0 -3
- package/src/types/components/atoms/container.ts +0 -3
- package/src/types/components/atoms/field/field.ts +0 -61
- package/src/types/components/atoms/field/index.ts +0 -1
- package/src/types/components/atoms/filter/filter.ts +0 -52
- package/src/types/components/atoms/filter/index.ts +0 -2
- package/src/types/components/atoms/filter/select-filter.ts +0 -8
- package/src/types/components/atoms/index.ts +0 -9
- package/src/types/components/atoms/portal.ts +0 -6
- package/src/types/components/atoms/row.ts +0 -3
- package/src/types/components/atoms/uploader.ts +0 -103
- package/src/types/components/index.ts +0 -4
- package/src/types/components/molecules/footer/footer.ts +0 -68
- package/src/types/components/molecules/footer/index.ts +0 -1
- package/src/types/components/molecules/header/header.ts +0 -51
- package/src/types/components/molecules/header/index.ts +0 -1
- package/src/types/components/molecules/index.ts +0 -9
- package/src/types/components/molecules/item-card/index.ts +0 -1
- package/src/types/components/molecules/item-card/item-card.ts +0 -69
- package/src/types/components/molecules/item-details/index.ts +0 -1
- package/src/types/components/molecules/item-details/item-details.ts +0 -9
- package/src/types/components/molecules/listings/index.ts +0 -1
- package/src/types/components/molecules/listings/listings.ts +0 -29
- package/src/types/components/molecules/nav-bar/index.ts +0 -1
- package/src/types/components/molecules/nav-bar/nav-bar.ts +0 -66
- package/src/types/components/molecules/scaffold/index.ts +0 -1
- package/src/types/components/molecules/scaffold/scaffold.ts +0 -9
- package/src/types/components/molecules/side-bar/index.ts +0 -1
- package/src/types/components/molecules/side-bar/side-bar.ts +0 -40
- package/src/types/components/molecules/theme-switch/index.ts +0 -1
- package/src/types/components/molecules/theme-switch/theme-switch.ts +0 -9
- package/src/types/components/organisms/deletion-confirmor/deletion-confirmor.ts +0 -22
- package/src/types/components/organisms/deletion-confirmor/index.ts +0 -1
- package/src/types/components/organisms/filters/filters.ts +0 -11
- package/src/types/components/organisms/filters/index.ts +0 -1
- package/src/types/components/organisms/form-builder/context.ts +0 -6
- package/src/types/components/organisms/form-builder/form-builder.ts +0 -39
- package/src/types/components/organisms/form-builder/index.ts +0 -2
- package/src/types/components/organisms/index.ts +0 -3
- package/src/types/components/templates/index.ts +0 -1
- package/src/types/components/templates/landing-page.ts +0 -10
- package/src/types/context/config.ts +0 -24
- package/src/types/context/index.ts +0 -4
- package/src/types/context/localization.ts +0 -24
- package/src/types/context/navigation.ts +0 -17
- package/src/types/context/theme.ts +0 -33
- package/src/types/index.ts +0 -3
- package/src/types/shared/components.ts +0 -13
- package/src/types/shared/index.ts +0 -1
- package/src/utils/cn.ts +0 -6
- package/src/utils/compress-images.ts +0 -36
- package/src/utils/index.ts +0 -5
- package/src/utils/locales.ts +0 -54
- package/src/utils/storybook.tsx +0 -15
- package/src/utils/uploader.ts +0 -170
- package/tsconfig.app.json +0 -37
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -25
- package/vite.config.ts +0 -47
- package/vitest.shims.d.ts +0 -1
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { Listings } from "@/components";
|
|
3
|
-
import { getStorybookDecorators } from "@/utils";
|
|
4
|
-
import { getListings, MOCK_LISTINGS } from "@/mocks";
|
|
5
|
-
import type { MockItemType } from "@/mocks";
|
|
6
|
-
import { useMemo, useState } from "react";
|
|
7
|
-
import { useEffect } from "react";
|
|
8
|
-
import { ListingsProps } from "@/types";
|
|
9
|
-
import { usePagination } from "@heroui/pagination";
|
|
10
|
-
|
|
11
|
-
const meta: Meta<typeof Listings> = {
|
|
12
|
-
title: "Organisms/Listings/List",
|
|
13
|
-
component: Listings,
|
|
14
|
-
parameters: {
|
|
15
|
-
layout: "centered",
|
|
16
|
-
},
|
|
17
|
-
tags: ["autodocs"],
|
|
18
|
-
decorators: getStorybookDecorators({
|
|
19
|
-
config: {
|
|
20
|
-
layout: {
|
|
21
|
-
withScaffold: false,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
}),
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default meta;
|
|
28
|
-
|
|
29
|
-
type Story = StoryObj<typeof meta>;
|
|
30
|
-
|
|
31
|
-
export const Default: Story = {
|
|
32
|
-
args: {
|
|
33
|
-
layout: "list",
|
|
34
|
-
},
|
|
35
|
-
render: (args: ListingsProps) => {
|
|
36
|
-
return (
|
|
37
|
-
<main className="w-screen container mx-auto p-5">
|
|
38
|
-
<Listings
|
|
39
|
-
{...args}
|
|
40
|
-
items={MOCK_LISTINGS.map((item) => ({
|
|
41
|
-
item: {
|
|
42
|
-
key: String(item.id),
|
|
43
|
-
title: item?.title,
|
|
44
|
-
description: item.description,
|
|
45
|
-
image: { src: item?.image, alt: item?.title },
|
|
46
|
-
},
|
|
47
|
-
}))}
|
|
48
|
-
/>
|
|
49
|
-
</main>
|
|
50
|
-
);
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const WithLoading: Story = {
|
|
55
|
-
args: {
|
|
56
|
-
layout: "list",
|
|
57
|
-
},
|
|
58
|
-
render: (args: ListingsProps) => {
|
|
59
|
-
const [items, setItems] = useState<MockItemType[]>([]);
|
|
60
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
61
|
-
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
(async () => {
|
|
64
|
-
const { items } = await getListings({});
|
|
65
|
-
|
|
66
|
-
setItems(items);
|
|
67
|
-
setIsLoading(false);
|
|
68
|
-
})();
|
|
69
|
-
}, []);
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<Listings
|
|
73
|
-
{...args}
|
|
74
|
-
isLoading={isLoading}
|
|
75
|
-
items={items.map((item) => ({
|
|
76
|
-
item: {
|
|
77
|
-
key: String(item.id),
|
|
78
|
-
title: item?.title,
|
|
79
|
-
description: item.description,
|
|
80
|
-
image: { src: item?.image, alt: item?.title },
|
|
81
|
-
},
|
|
82
|
-
}))}
|
|
83
|
-
/>
|
|
84
|
-
);
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const WithActions: Story = {
|
|
89
|
-
args: {
|
|
90
|
-
layout: "list",
|
|
91
|
-
items: MOCK_LISTINGS.map((item) => ({
|
|
92
|
-
item: {
|
|
93
|
-
key: String(item.id),
|
|
94
|
-
title: item?.title,
|
|
95
|
-
description: item.description,
|
|
96
|
-
image: { src: item?.image, alt: item?.title },
|
|
97
|
-
},
|
|
98
|
-
actions: [
|
|
99
|
-
{ key: "view", label: "View details" },
|
|
100
|
-
{ key: "edit", label: "Edit" },
|
|
101
|
-
{ key: "delete", label: "Delete" },
|
|
102
|
-
],
|
|
103
|
-
})),
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export const WithPagination: Story = {
|
|
108
|
-
args: {
|
|
109
|
-
layout: "list",
|
|
110
|
-
},
|
|
111
|
-
render: (args: ListingsProps) => {
|
|
112
|
-
const [items, setItems] = useState<MockItemType[]>([]);
|
|
113
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
114
|
-
|
|
115
|
-
const pageSize = 6;
|
|
116
|
-
const totalItemsCount = MOCK_LISTINGS.length;
|
|
117
|
-
const pagesCount = useMemo(
|
|
118
|
-
() => Math.ceil(totalItemsCount / pageSize),
|
|
119
|
-
[totalItemsCount, pageSize],
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
const { activePage: page, setPage } = usePagination({
|
|
123
|
-
total: pagesCount,
|
|
124
|
-
initialPage: 1,
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
(async () => {
|
|
129
|
-
setIsLoading(true);
|
|
130
|
-
|
|
131
|
-
const { items } = await getListings({
|
|
132
|
-
page,
|
|
133
|
-
pageSize,
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
setItems(items);
|
|
137
|
-
setIsLoading(false);
|
|
138
|
-
})();
|
|
139
|
-
}, [page]);
|
|
140
|
-
|
|
141
|
-
return (
|
|
142
|
-
<Listings
|
|
143
|
-
{...args}
|
|
144
|
-
isLoading={isLoading}
|
|
145
|
-
items={items.map((item) => ({
|
|
146
|
-
item: {
|
|
147
|
-
key: String(item.id),
|
|
148
|
-
title: item?.title,
|
|
149
|
-
description: item.description,
|
|
150
|
-
image: { src: item?.image, alt: item?.title },
|
|
151
|
-
banner: item?.isBestSeller ? "Best Seller" : undefined,
|
|
152
|
-
chips: item?.categories || [],
|
|
153
|
-
},
|
|
154
|
-
}))}
|
|
155
|
-
pagination={{
|
|
156
|
-
page,
|
|
157
|
-
setPage,
|
|
158
|
-
pageSize,
|
|
159
|
-
totalItemsCount,
|
|
160
|
-
pagesCount,
|
|
161
|
-
}}
|
|
162
|
-
/>
|
|
163
|
-
);
|
|
164
|
-
},
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export const EmptyListings: Story = {
|
|
168
|
-
args: {
|
|
169
|
-
items: [],
|
|
170
|
-
},
|
|
171
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { cva } from "class-variance-authority";
|
|
2
|
-
|
|
3
|
-
export const listingsClasses = cva(["w-full p-4 gap-4 relative"], {
|
|
4
|
-
variants: {
|
|
5
|
-
layout: {
|
|
6
|
-
grid: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
7
|
-
list: "flex flex-col gap-4",
|
|
8
|
-
carousel: "flex flex-col gap-4",
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
|
-
defaultVariants: {},
|
|
12
|
-
compoundVariants: [],
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export const listingsItemClasses = cva([""], {
|
|
16
|
-
variants: {
|
|
17
|
-
layout: {
|
|
18
|
-
grid: "size-full",
|
|
19
|
-
list: "w-full h-fit",
|
|
20
|
-
carousel: "",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
defaultVariants: {},
|
|
24
|
-
compoundVariants: [],
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export const listingsPaginationClasses = cva(["mx-auto my-5 col-span-full"], {
|
|
28
|
-
variants: {
|
|
29
|
-
layout: {
|
|
30
|
-
grid: "",
|
|
31
|
-
list: "",
|
|
32
|
-
carousel: "",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
defaultVariants: {},
|
|
36
|
-
compoundVariants: [],
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export const emptyListingsClasses = cva(
|
|
40
|
-
[
|
|
41
|
-
"flex flex-col items-center justify-center min-h-[280px] w-full py-12 px-4",
|
|
42
|
-
"text-center",
|
|
43
|
-
],
|
|
44
|
-
{
|
|
45
|
-
variants: {},
|
|
46
|
-
defaultVariants: {},
|
|
47
|
-
compoundVariants: [],
|
|
48
|
-
},
|
|
49
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./landing-page";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./landing-page";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { LandingPage } from "@/components";
|
|
3
|
-
import { getStorybookDecorators } from "@/utils";
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof LandingPage> = {
|
|
6
|
-
title: "Templates/LandingPage",
|
|
7
|
-
component: LandingPage,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: "fullscreen",
|
|
10
|
-
},
|
|
11
|
-
tags: ["autodocs"],
|
|
12
|
-
decorators: getStorybookDecorators({}),
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default meta;
|
|
16
|
-
|
|
17
|
-
type Story = StoryObj<typeof meta>;
|
|
18
|
-
|
|
19
|
-
export const Default: Story = {
|
|
20
|
-
args: {},
|
|
21
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { forwardRef, ComponentProps } from "react";
|
|
2
|
-
import { VariantProps } from "class-variance-authority";
|
|
3
|
-
import { cn } from "@/utils";
|
|
4
|
-
import { LandingPageProps } from "@/types";
|
|
5
|
-
import { landingPageClasses } from "./styles";
|
|
6
|
-
import { Brand, Header, NavBar } from "@/components";
|
|
7
|
-
import { MOCK_HEADER_ITEMS_WITH_SUB_ITEMS } from "@/mocks";
|
|
8
|
-
import { FAKE_PARAGRAPH } from "@/constants";
|
|
9
|
-
|
|
10
|
-
const GLASS_EFFECT_CONFIG = {
|
|
11
|
-
enabled: true,
|
|
12
|
-
blur: 10,
|
|
13
|
-
backgroundColor: "#006fed",
|
|
14
|
-
foregroundColor: "#fff",
|
|
15
|
-
opacity: 40,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* This component is not for general use nor it is reusable, it is intended to be used as a demo page.
|
|
20
|
-
*/
|
|
21
|
-
export const LandingPage = forwardRef<
|
|
22
|
-
HTMLDivElement,
|
|
23
|
-
ComponentProps<"main"> &
|
|
24
|
-
VariantProps<typeof landingPageClasses> &
|
|
25
|
-
LandingPageProps
|
|
26
|
-
>(({ className, variant = "default", children, ...props }, ref) => {
|
|
27
|
-
return (
|
|
28
|
-
<main
|
|
29
|
-
ref={ref}
|
|
30
|
-
data-slot="emperor-landing-page"
|
|
31
|
-
className={cn(landingPageClasses({ className }))}
|
|
32
|
-
{...props}
|
|
33
|
-
>
|
|
34
|
-
<Header variant="floating" glassEffect={GLASS_EFFECT_CONFIG}>
|
|
35
|
-
<Brand />
|
|
36
|
-
|
|
37
|
-
<NavBar
|
|
38
|
-
items={MOCK_HEADER_ITEMS_WITH_SUB_ITEMS}
|
|
39
|
-
hoverEffect="none"
|
|
40
|
-
variant="default"
|
|
41
|
-
className="hidden md:flex"
|
|
42
|
-
subItemsColumns={4}
|
|
43
|
-
/>
|
|
44
|
-
</Header>
|
|
45
|
-
|
|
46
|
-
<main className="w-full container mx-auto p-5 pt-24 flex flex-col gap-6">
|
|
47
|
-
<p>{FAKE_PARAGRAPH}</p>
|
|
48
|
-
<p>{FAKE_PARAGRAPH}</p>
|
|
49
|
-
<p>{FAKE_PARAGRAPH}</p>
|
|
50
|
-
<p>{FAKE_PARAGRAPH}</p>
|
|
51
|
-
<p>{FAKE_PARAGRAPH}</p>
|
|
52
|
-
</main>
|
|
53
|
-
|
|
54
|
-
{children}
|
|
55
|
-
</main>
|
|
56
|
-
);
|
|
57
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./classes";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-empty-pattern */
|
|
2
|
-
import { ItemCardHoverEffect } from "@/types";
|
|
3
|
-
import { MotionProps } from "framer-motion";
|
|
4
|
-
|
|
5
|
-
export const getCardMotion = ({}: {
|
|
6
|
-
hoverEffect: ItemCardHoverEffect;
|
|
7
|
-
}): MotionProps => ({
|
|
8
|
-
initial: { opacity: 0, y: 12 },
|
|
9
|
-
animate: { opacity: 1, y: 0 },
|
|
10
|
-
transition: { duration: 0.3, ease: "easeOut" as const },
|
|
11
|
-
whileHover: {
|
|
12
|
-
y: -4,
|
|
13
|
-
},
|
|
14
|
-
});
|
package/src/constants/card.tsx
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react-refresh/only-export-components */
|
|
2
|
-
import { Eye, Pencil, Trash2 } from "lucide-react";
|
|
3
|
-
import { ItemCardAction } from "@/types";
|
|
4
|
-
|
|
5
|
-
export const ITEM_CARD_ACTIONS: ItemCardAction[] = [
|
|
6
|
-
{
|
|
7
|
-
key: "view",
|
|
8
|
-
label: "View details",
|
|
9
|
-
color: "primary",
|
|
10
|
-
variant: "flat",
|
|
11
|
-
size: "sm",
|
|
12
|
-
startContent: <Eye className="size-4" />,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
key: "edit",
|
|
16
|
-
label: "Edit",
|
|
17
|
-
color: "secondary",
|
|
18
|
-
variant: "flat",
|
|
19
|
-
size: "sm",
|
|
20
|
-
startContent: <Pencil className="size-4" />,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
key: "delete",
|
|
24
|
-
label: "Delete",
|
|
25
|
-
color: "danger",
|
|
26
|
-
variant: "flat",
|
|
27
|
-
size: "sm",
|
|
28
|
-
startContent: <Trash2 className="size-4" />,
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
export const ITEM_CARD_ACTIONS_OVERLAY: ItemCardAction[] =
|
|
33
|
-
ITEM_CARD_ACTIONS.map((action) => ({
|
|
34
|
-
...action,
|
|
35
|
-
variant: "solid",
|
|
36
|
-
size: "lg",
|
|
37
|
-
startContent: {
|
|
38
|
-
view: <Eye className="size-5" />,
|
|
39
|
-
edit: <Pencil className="size-5" />,
|
|
40
|
-
delete: <Trash2 className="size-5" />,
|
|
41
|
-
}[action?.key],
|
|
42
|
-
}));
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { en, ar } from "@/i18n";
|
|
2
|
-
import type { EmperorUIConfig } from "@/types";
|
|
3
|
-
|
|
4
|
-
export const defaultEmperorUIConfig: EmperorUIConfig = {
|
|
5
|
-
layout: {
|
|
6
|
-
withScaffold: true,
|
|
7
|
-
},
|
|
8
|
-
interLocalization: {
|
|
9
|
-
lang: "en",
|
|
10
|
-
languages: ["en", "ar"],
|
|
11
|
-
defaultLanguage: "en",
|
|
12
|
-
dir: "ltr",
|
|
13
|
-
isMultiLingual: false,
|
|
14
|
-
locales: {
|
|
15
|
-
en,
|
|
16
|
-
ar,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
theme: {
|
|
20
|
-
components: {
|
|
21
|
-
input: {
|
|
22
|
-
variant: "faded",
|
|
23
|
-
labelPlacement: "outside",
|
|
24
|
-
size: "sm",
|
|
25
|
-
},
|
|
26
|
-
textarea: {
|
|
27
|
-
variant: "faded",
|
|
28
|
-
labelPlacement: "outside",
|
|
29
|
-
size: "sm",
|
|
30
|
-
},
|
|
31
|
-
button: {
|
|
32
|
-
variant: "faded",
|
|
33
|
-
size: "sm",
|
|
34
|
-
},
|
|
35
|
-
select: {
|
|
36
|
-
variant: "faded",
|
|
37
|
-
labelPlacement: "outside",
|
|
38
|
-
placeholder: "Select an option",
|
|
39
|
-
size: "sm",
|
|
40
|
-
},
|
|
41
|
-
selectItem: {
|
|
42
|
-
variant: "faded",
|
|
43
|
-
},
|
|
44
|
-
autocomplete: {
|
|
45
|
-
variant: "faded",
|
|
46
|
-
labelPlacement: "outside",
|
|
47
|
-
size: "sm",
|
|
48
|
-
},
|
|
49
|
-
autocompleteItem: {
|
|
50
|
-
variant: "faded",
|
|
51
|
-
},
|
|
52
|
-
datePicker: {
|
|
53
|
-
variant: "faded",
|
|
54
|
-
labelPlacement: "outside",
|
|
55
|
-
size: "sm",
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
};
|
package/src/constants/fake.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export const FAKE_SENTENCE =
|
|
2
|
-
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.";
|
|
3
|
-
|
|
4
|
-
export const FAKE_PARAGRAPH =
|
|
5
|
-
"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,";
|
package/src/constants/footer.tsx
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CopyRights,
|
|
3
|
-
Contacts,
|
|
4
|
-
QuickLink,
|
|
5
|
-
QuickLinkCollection,
|
|
6
|
-
SocialLink,
|
|
7
|
-
} from "@/types";
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
FacebookIcon,
|
|
11
|
-
InstagramIcon,
|
|
12
|
-
LinkedinIcon,
|
|
13
|
-
TwitterIcon,
|
|
14
|
-
YoutubeIcon,
|
|
15
|
-
} from "lucide-react";
|
|
16
|
-
|
|
17
|
-
export const quickLinks: QuickLinkCollection[] = [
|
|
18
|
-
{
|
|
19
|
-
title: "Products",
|
|
20
|
-
links: [
|
|
21
|
-
{
|
|
22
|
-
label: "Product 1",
|
|
23
|
-
href: "/product-1",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
label: "Product 2",
|
|
27
|
-
href: "/product-2",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
label: "Product 3",
|
|
31
|
-
href: "/product-3",
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
title: "Services",
|
|
37
|
-
links: [
|
|
38
|
-
{
|
|
39
|
-
label: "Service 1",
|
|
40
|
-
href: "/service-1",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
label: "Service 2",
|
|
44
|
-
href: "/service-2",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: "Service 3",
|
|
48
|
-
href: "/service-3",
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
label: "Service 4",
|
|
52
|
-
href: "/service-4",
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
title: "Resources",
|
|
58
|
-
links: [
|
|
59
|
-
{
|
|
60
|
-
label: "Resource 1",
|
|
61
|
-
href: "/resource-1",
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
title: "Company",
|
|
67
|
-
links: [
|
|
68
|
-
{
|
|
69
|
-
label: "About Us",
|
|
70
|
-
href: "/about-us",
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
label: "Careers",
|
|
74
|
-
href: "/careers",
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
label: "Blog",
|
|
78
|
-
href: "/blog",
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
title: "Support",
|
|
84
|
-
links: [
|
|
85
|
-
{
|
|
86
|
-
label: "Contact Us",
|
|
87
|
-
href: "/contact-us",
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
];
|
|
92
|
-
|
|
93
|
-
export const policies: QuickLink[] = [
|
|
94
|
-
{
|
|
95
|
-
label: "Privacy Policy",
|
|
96
|
-
href: "/privacy-policy",
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
label: "Terms of Service",
|
|
100
|
-
href: "/terms-of-service",
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
label: "Cookie Policy",
|
|
104
|
-
href: "/cookie-policy",
|
|
105
|
-
},
|
|
106
|
-
];
|
|
107
|
-
|
|
108
|
-
export const copyRights: CopyRights = {
|
|
109
|
-
year: 2026,
|
|
110
|
-
text: "All rights reserved - Emperor UI",
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export const contacts: Contacts = {
|
|
114
|
-
mobile: "+964 770 000 0000",
|
|
115
|
-
email: "contact@emperorui.com",
|
|
116
|
-
website: "https://jsempire.com",
|
|
117
|
-
workingHours: "Monday - Friday: 9:00 AM - 5:00 PM",
|
|
118
|
-
addresses: [
|
|
119
|
-
{
|
|
120
|
-
country: "Jordan",
|
|
121
|
-
street: "Amman, Jordan",
|
|
122
|
-
city: "Amman",
|
|
123
|
-
state: "Amman",
|
|
124
|
-
zip: "11111",
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
country: "Saudi Arabia",
|
|
128
|
-
street: "Riyadh, Saudi Arabia",
|
|
129
|
-
city: "Riyadh",
|
|
130
|
-
state: "Riyadh",
|
|
131
|
-
zip: "11111",
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export const socialLinks: SocialLink[] = [
|
|
137
|
-
{
|
|
138
|
-
href: "https://facebook.com",
|
|
139
|
-
icon: <FacebookIcon />,
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
href: "https://twitter.com",
|
|
143
|
-
icon: <TwitterIcon />,
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
href: "https://instagram.com",
|
|
147
|
-
icon: <InstagramIcon />,
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
href: "https://linkedin.com",
|
|
151
|
-
icon: <LinkedinIcon />,
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
href: "https://youtube.com",
|
|
155
|
-
icon: <YoutubeIcon />,
|
|
156
|
-
},
|
|
157
|
-
];
|
package/src/constants/index.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export const ALLOWED_IMAGES_TYPES = [
|
|
2
|
-
"image/jpeg",
|
|
3
|
-
"image/jpg",
|
|
4
|
-
"image/png",
|
|
5
|
-
"image/webp",
|
|
6
|
-
"image/gif",
|
|
7
|
-
"image/bmp",
|
|
8
|
-
"image/svg+xml",
|
|
9
|
-
"image/tiff",
|
|
10
|
-
"image/x-icon",
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
export const ALLOWED_PDF_TYPES = ["application/pdf"];
|
|
14
|
-
|
|
15
|
-
export const ALLOWED_DOC_TYPES = [
|
|
16
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
export const ALLOWED_SHEET_TYPES = [
|
|
20
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
21
|
-
"application/vnd.ms-excel",
|
|
22
|
-
"text/csv",
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
export const ONE_MEGABYTE = 1024;
|
|
26
|
-
|
|
27
|
-
export const fileTypesMapping: { [key: string]: string[] } = {
|
|
28
|
-
image: [".jpg", ".jpeg", ".png"],
|
|
29
|
-
doc: [".doc", ".docx"],
|
|
30
|
-
pdf: [".pdf"],
|
|
31
|
-
video: [".mp4"],
|
|
32
|
-
sheet: [".xlsx", ".xlx", ".xls", ".csv"],
|
|
33
|
-
};
|
package/src/context/index.ts
DELETED