Move Pagination

This commit is contained in:
Tanish Manku committed 2025-05-27 01:14:44 -07:00
1 parent a43b34c1d9
commit f0dbeca36a
27 files changed
+233 -100

No files matched your search

@@ -1,16 +0,0 @@
import { Canvas, Meta } from '@storybook/blocks';
import * as PaginationStories from './Pagination.stories';
<Meta of={PaginationStories} />
# Controls for pagination.
Here is what it looks like when empty
<Canvas of={PaginationStories.Empty} />
First Page
<Canvas of={PaginationStories.FirstPage} />
Middle
<Canvas of={PaginationStories.Middle} />
Last Page
<Canvas of={PaginationStories.LastPage} />
@@ -1,69 +0,0 @@
import type { Meta, StoryObj } from "@storybook/react";
import { Pagination } from "./Pagination";
import { withActions } from "@storybook/addon-actions/decorator";
const meta: Meta<typeof Pagination> = {
component: Pagination,
parameters: {
actions: {
handles: ["pageChange"],
},
},
decorators: [withActions],
};
type Story = StoryObj<typeof Pagination>;
export const Empty: Story = {
render: () => (
<div className="w-[300px] bg-brand-secondary-200">
<Pagination
className=""
currentPage={0}
totalPages={0}
onPageChange={() => {}}
/>
</div>
),
};
export const FirstPage: Story = {
render: () => (
<div className="w-[300px] bg-brand-secondary-200">
<Pagination
className=""
currentPage={0}
totalPages={5}
onPageChange={() => {}}
/>
</div>
),
};
export const Middle: Story = {
render: () => (
<div className="w-[300px] bg-brand-secondary-200">
<Pagination
className=""
currentPage={2}
totalPages={5}
onPageChange={() => {}}
/>
</div>
),
};
export const LastPage: Story = {
render: () => (
<div className="w-[300px] bg-brand-secondary-200">
<Pagination
className=""
currentPage={4}
totalPages={5}
onPageChange={() => {}}
/>
</div>
),
};
export default meta;
@@ -1 +0,0 @@
export * from "./Pagination";
@@ -1,4 +1,3 @@
export * from "./Pagination";
export * from "./SearchFilter";
export * from "./UploadModal";
export * from "./UploadModal3D";
@@ -8,10 +8,10 @@ import {
MediaFileAnimationType,
} from "~/enums";
import {
Pagination,
SearchFilter,
UploadModal,
} from "~/components";
import { Pagination } from "@storyteller/ui-pagination";
import { Button, FilterButtons } from "@storyteller/ui-button";
import { ItemElements } from "~/pages/PageEnigma/comps/SidePanelTabs/sharedComps";
import { isAnyStatusFetching } from "../../utilities";
@@ -10,10 +10,10 @@ import {
} from "~/enums";
import { MediaItem } from "~/pages/PageEnigma/models";
import {
Pagination,
SearchFilter,
UploadModal,
} from "~/components";
import { Pagination } from "@storyteller/ui-pagination";
import { Button, FilterButtons } from "@storyteller/ui-button";
import { ItemElements } from "~/pages/PageEnigma/comps/SidePanelTabs/sharedComps";
import { isAnyStatusFetching } from "../../utilities";
@@ -6,10 +6,10 @@ import {
MediaFileAnimationType,
} from "~/enums";
import {
Pagination,
SearchFilter,
UploadModal,
} from "~/components";
import { Pagination } from "@storyteller/ui-pagination";
import { Button, FilterButtons } from "@storyteller/ui-button";
import { ItemElements } from "~/pages/PageEnigma/comps/SidePanelTabs/sharedComps";
import { isAnyStatusFetching } from "../../utilities";
@@ -14,9 +14,9 @@ import {
} from "~/pages/PageEnigma/comps/SidePanelTabs/sharedComps";
import {
SearchFilter,
Pagination,
UploadModal3D,
} from "~/components";
import { Pagination } from "@storyteller/ui-pagination";
import { Button, FilterButtons } from "@storyteller/ui-button"
@@ -15,9 +15,9 @@ import {
} from "~/pages/PageEnigma/comps/SidePanelTabs/sharedComps";
import {
SearchFilter,
Pagination,
UploadModal3D,
} from "~/components";
import { Pagination } from "@storyteller/ui-pagination";
import { Button, FilterButtons } from "@storyteller/ui-button"
import { isAnyStatusFetching } from "../utilities";
import {
@@ -6,11 +6,11 @@ import {
IMAGEPLANE_FILE_TYPE,
} from "~/enums";
import {
Button,
Pagination,
SearchFilter,
UploadModalMedia,
} from "~/components";
import { Button } from "@storyteller/ui-button";
import { Pagination } from "@storyteller/ui-pagination";
import { ItemElements } from "~/pages/PageEnigma/comps/SidePanelTabs/sharedComps";
import { isAnyStatusFetching } from "../../utilities";
import { useUserObjects, useSearchUserObjects } from "../../hooks";
@@ -6,11 +6,11 @@ import {
VIDEOPLANE_FILE_TYPE,
} from "~/enums";
import {
Button,
Pagination,
SearchFilter,
UploadModalMedia,
} from "~/components";
import { Button } from "@storyteller/ui-button";
import { Pagination } from "@storyteller/ui-pagination";
import { ItemElements } from "~/pages/PageEnigma/comps/SidePanelTabs/sharedComps";
import { isAnyStatusFetching } from "../../utilities";
import { useUserObjects, useSearchUserObjects } from "../../hooks";
+13 -4
View File
@@ -34,6 +34,9 @@
{
"path": "../../libs/components/lightbox-modal"
},
{
"path": "../../libs/components/loading-spinner"
},
{
"path": "../../libs/components/button-icon-select"
},
@@ -49,9 +52,6 @@
{
"path": "../../libs/components/login-modal"
},
{
"path": "../../libs/components/popover"
},
{
"path": "../../libs/soundboard"
},
@@ -61,6 +61,9 @@
{
"path": "../../libs/components/toaster"
},
{
"path": "../../libs/components/popover"
},
{
"path": "../../libs/components/promptbox"
},
@@ -103,17 +106,23 @@
{
"path": "../../libs/components/file-uploader"
},
{
"path": "../../libs/components/list-dropdown"
},
{
"path": "../../libs/components/tooltip"
},
{
"path": "../../libs/components/button"
},
{
"path": "../../libs/components/input"
},
{
"path": "../../libs/components/button-icon"
},
{
"path": "../../libs/components/input"
"path": "../../libs/components/pagination"
},
{
"path": "../../libs/tauri-utils"
@@ -2,6 +2,9 @@
"files": [],
"include": [],
"references": [
{
"path": "../../common"
},
{
"path": "./tsconfig.lib.json"
},
@@ -41,5 +41,10 @@
"src/**/*.jsx",
"src/**/*.ts",
"src/**/*.tsx"
],
"references": [
{
"path": "../../common/tsconfig.lib.json"
}
]
}
@@ -5,6 +5,9 @@
{
"path": "../label"
},
{
"path": "../../common"
},
{
"path": "./tsconfig.lib.json"
},
@@ -45,6 +45,9 @@
"references": [
{
"path": "../label/tsconfig.lib.json"
},
{
"path": "../../common/tsconfig.lib.json"
}
]
}
@@ -0,0 +1,12 @@
{
"presets": [
[
"@nx/react/babel",
{
"runtime": "automatic",
"useBuiltIns": "usage"
}
]
],
"plugins": []
}
@@ -0,0 +1,7 @@
# @storyteller/ui-pagination
This library was generated with [Nx](https://nx.dev).
## Running unit tests
Run `nx test @storyteller/ui-pagination` to execute the unit tests via [Vitest](https://vitest.dev/).
@@ -0,0 +1,17 @@
{
"name": "@storyteller/ui-pagination",
"version": "0.0.1",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"development": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
}
}
}
@@ -0,0 +1 @@
export * from './lib/pagination';
@@ -0,0 +1,16 @@
{
"files": [],
"include": [],
"references": [
{
"path": "../button-icon"
},
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
],
"extends": "../../../tsconfig.base.json"
}
@@ -0,0 +1,50 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "dist",
"types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts",
"vite/client"
],
"rootDir": "src",
"jsx": "react-jsx",
"tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo"
},
"exclude": [
"out-tsc",
"dist",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.test.tsx",
"**/*.spec.js",
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx",
"vite.config.ts",
"vite.config.mts",
"vitest.config.ts",
"vitest.config.mts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx"
],
"include": [
"src/**/*.js",
"src/**/*.jsx",
"src/**/*.ts",
"src/**/*.tsx"
],
"references": [
{
"path": "../button-icon/tsconfig.lib.json"
}
]
}
@@ -0,0 +1,34 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out-tsc/vitest",
"types": [
"vitest/globals",
"vitest/importMeta",
"vite/client",
"node",
"vitest"
],
"jsx": "react-jsx"
},
"include": [
"vite.config.ts",
"vite.config.mts",
"vitest.config.ts",
"vitest.config.mts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx",
"src/**/*.d.ts"
],
"references": [
{
"path": "./tsconfig.lib.json"
}
]
}
@@ -0,0 +1,49 @@
/// <reference types='vitest' />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import * as path from 'path';
export default defineConfig(() => ({
root: __dirname,
cacheDir: '../../../node_modules/.vite/libs/components/pagination',
plugins: [react(), dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json') })],
// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
// },
// Configuration for building your library.
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
outDir: './dist',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
},
lib: {
// Could also be a dictionary or array of multiple entry points.
entry: 'src/index.ts',
name: '@storyteller/ui-pagination',
fileName: 'index',
// Change this to the formats you want to support.
// Don't forget to update your package.json as well.
formats: ['es' as const]
},
rollupOptions: {
// External packages that should not be bundled into your library.
external: ['react','react-dom','react/jsx-runtime']
},
},
test: {
watch: false,
globals: true,
environment: 'jsdom',
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
reporters: ['default'],
coverage: {
reportsDirectory: './test-output/vitest/coverage',
provider: 'v8' as const,
}
},
}));
+8
View File
@@ -1381,6 +1381,10 @@
"name": "@storyteller/ui-modal",
"version": "0.0.1"
},
"libs/components/pagination": {
"name": "@storyteller/ui-pagination",
"version": "0.0.1"
},
"libs/components/popover": {
"name": "@storyteller/ui-popover",
"version": "0.0.1"
@@ -9243,6 +9247,10 @@
"resolved": "libs/components/modal",
"link": true
},
"node_modules/@storyteller/ui-pagination": {
"resolved": "libs/components/pagination",
"link": true
},
"node_modules/@storyteller/ui-popover": {
"resolved": "libs/components/popover",
"link": true
+3
View File
@@ -119,6 +119,9 @@
},
{
"path": "./libs/components/list-dropdown"
},
{
"path": "./libs/components/pagination"
}
]
}