@niledatabase/react 3.0.0-alpha.2 → 3.0.0-alpha.21
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.mts +63 -0
- package/dist/index.d.ts +62 -10
- package/dist/index.js +2992 -5
- package/dist/index.mjs +2956 -0
- package/package.json +37 -24
- package/dist/GoogleLoginButton/GoogleLoginButton.d.ts +0 -10
- package/dist/GoogleLoginButton/GoogleLoginButton.stories.d.ts +0 -11
- package/dist/GoogleLoginButton/index.d.ts +0 -1
- package/dist/SignInForm/SignInForm.d.ts +0 -3
- package/dist/SignInForm/UserLoginForm.stories.d.ts +0 -5
- package/dist/SignInForm/index.d.ts +0 -1
- package/dist/SignInForm/types.d.ts +0 -15
- package/dist/SignUpForm/NewUserSignUp.stories.d.ts +0 -5
- package/dist/SignUpForm/SignUpForm.d.ts +0 -3
- package/dist/SignUpForm/index.d.ts +0 -1
- package/dist/SignUpForm/types.d.ts +0 -13
- package/dist/UserTenantList/CreateUser.d.ts +0 -8
- package/dist/UserTenantList/UserList.d.ts +0 -17
- package/dist/UserTenantList/UserList.stories.d.ts +0 -5
- package/dist/UserTenantList/UserModal.d.ts +0 -7
- package/dist/UserTenantList/index.d.ts +0 -1
- package/dist/UserTenantList/useDataParser.d.ts +0 -4
- package/dist/context/index.d.ts +0 -9
- package/dist/context/theme.d.ts +0 -7
- package/dist/context/types.d.ts +0 -22
- package/dist/hooks/useResults.d.ts +0 -22
- package/dist/hooks/useTextSizer.d.ts +0 -1
- package/dist/lib/SimpleForm/CheckGroup/index.d.ts +0 -10
- package/dist/lib/SimpleForm/index.d.ts +0 -11
- package/dist/lib/SimpleForm/types.d.ts +0 -37
- package/dist/react.cjs.development.js +0 -938
- package/dist/react.cjs.development.js.map +0 -1
- package/dist/react.cjs.production.min.js +0 -2
- package/dist/react.cjs.production.min.js.map +0 -1
- package/dist/react.esm.d.ts +0 -11
- package/dist/react.esm.js +0 -906
- package/dist/react.esm.js.map +0 -1
- package/dist/utils/getColumnSize.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niledatabase/react",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.21",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
|
-
"module": "./dist/
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
10
|
"require": "./dist/index.js",
|
|
10
|
-
"import": "./dist/
|
|
11
|
+
"import": "./dist/index.mjs"
|
|
11
12
|
}
|
|
12
13
|
},
|
|
13
14
|
"files": [
|
|
@@ -17,18 +18,20 @@
|
|
|
17
18
|
"node": ">=18.0"
|
|
18
19
|
},
|
|
19
20
|
"scripts": {
|
|
20
|
-
"
|
|
21
|
-
"build": "
|
|
22
|
-
"build:
|
|
23
|
-
"
|
|
21
|
+
"analyze": "size-limit --why",
|
|
22
|
+
"build:storybook": "yarn build:tailwind && storybook build",
|
|
23
|
+
"build:tailwind": "npx tailwindcss -i ./.storybook/globals.css -o ./.storybook/output.css",
|
|
24
|
+
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
25
|
+
"dev:tailwind": "npx tailwindcss -i ./.storybook/globals.css -o ./.storybook/output.css --watch",
|
|
26
|
+
"dev": "storybook dev",
|
|
24
27
|
"lint": "eslint src",
|
|
25
28
|
"size": "size-limit",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"build-storybook": "storybook build"
|
|
29
|
+
"storybook": "yarn build:tailwind && CACHE_DIR=$PWD/.yarn/cache storybook dev -p 6006",
|
|
30
|
+
"test": "yarn jest"
|
|
29
31
|
},
|
|
30
32
|
"peerDependencies": {
|
|
31
33
|
"@tanstack/react-query": "^4.23.0",
|
|
34
|
+
"next-auth": "^4.24.7",
|
|
32
35
|
"react": "^18.0.0",
|
|
33
36
|
"react-dom": "^18.0.0"
|
|
34
37
|
},
|
|
@@ -62,16 +65,19 @@
|
|
|
62
65
|
"@babel/preset-env": "^7.23.3",
|
|
63
66
|
"@babel/preset-react": "^7.23.3",
|
|
64
67
|
"@babel/preset-typescript": "^7.23.3",
|
|
68
|
+
"@chromatic-com/storybook": "^1.9.0",
|
|
65
69
|
"@rollup/plugin-babel": "^6.0.4",
|
|
66
70
|
"@size-limit/preset-small-lib": "^8.2.6",
|
|
67
71
|
"@storybook/addon-essentials": "^8.0.0",
|
|
68
72
|
"@storybook/addon-interactions": "^8.0.0",
|
|
69
73
|
"@storybook/addon-links": "^8.0.0",
|
|
70
74
|
"@storybook/addon-onboarding": "8.0.4",
|
|
75
|
+
"@storybook/addon-styling-webpack": "^1.0.0",
|
|
71
76
|
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
|
|
77
|
+
"@storybook/addon-webpack5-compiler-swc": "^1.0.5",
|
|
72
78
|
"@storybook/blocks": "^8.0.0",
|
|
73
79
|
"@storybook/react": "^8.0.0",
|
|
74
|
-
"@storybook/react-webpack5": "^8.
|
|
80
|
+
"@storybook/react-webpack5": "^8.3.4",
|
|
75
81
|
"@storybook/test": "^8.0.0",
|
|
76
82
|
"@storybook/theming": "^8.0.4",
|
|
77
83
|
"@svgr/rollup": "^8.1.0",
|
|
@@ -82,8 +88,11 @@
|
|
|
82
88
|
"@types/react": "18.2.38",
|
|
83
89
|
"@types/react-dom": "18.2.16",
|
|
84
90
|
"@typescript-eslint/parser": "^6.12.0",
|
|
91
|
+
"autoprefixer": "^10.4.20",
|
|
85
92
|
"babel-jest": "29.7.0",
|
|
86
93
|
"babel-loader": "^9.1.3",
|
|
94
|
+
"class-variance-authority": "^0.7.0",
|
|
95
|
+
"clsx": "^2.1.1",
|
|
87
96
|
"dts-cli": "^2.0.3",
|
|
88
97
|
"eslint": "^8.54.0",
|
|
89
98
|
"eslint-config-prettier": "^9.0.0",
|
|
@@ -93,28 +102,32 @@
|
|
|
93
102
|
"husky": "^8.0.3",
|
|
94
103
|
"jest": "^29.7.0",
|
|
95
104
|
"jest-environment-jsdom": "^29.7.0",
|
|
105
|
+
"postcss": "^8.4.47",
|
|
96
106
|
"prop-types": "^15.8.1",
|
|
97
107
|
"rollup-plugin-terser": "^7.0.2",
|
|
98
108
|
"size-limit": "^8.2.6",
|
|
99
109
|
"storybook": "^8.0.0",
|
|
110
|
+
"tailwind": "^4.0.0",
|
|
111
|
+
"tailwind-merge": "^2.5.2",
|
|
112
|
+
"tailwindcss": "^3.4.13",
|
|
113
|
+
"tailwindcss-animate": "^1.0.7",
|
|
100
114
|
"ts-jest": "^29.1.1",
|
|
101
115
|
"tslib": "^2.6.2",
|
|
102
|
-
"
|
|
116
|
+
"tsup": "^8.3.0",
|
|
117
|
+
"typescript": "^5.3.2",
|
|
118
|
+
"zod": "^3.23.8"
|
|
103
119
|
},
|
|
104
120
|
"dependencies": {
|
|
105
|
-
"@
|
|
106
|
-
"@
|
|
107
|
-
"@
|
|
108
|
-
"@
|
|
109
|
-
"@
|
|
110
|
-
"@mui/x-data-grid": "^7.0.0",
|
|
111
|
-
"@niledatabase/browser": "^3.0.0-alpha.2",
|
|
112
|
-
"@tanstack/react-query": "^4.36.1",
|
|
121
|
+
"@hookform/resolvers": "^3.9.0",
|
|
122
|
+
"@niledatabase/browser": "^3.0.0-alpha.21",
|
|
123
|
+
"@radix-ui/react-label": "^2.1.0",
|
|
124
|
+
"@radix-ui/react-slot": "^1.1.0",
|
|
125
|
+
"@tanstack/react-query": "^5.23.0",
|
|
113
126
|
"next-auth": "^4.24.7",
|
|
114
|
-
"react": "^18.
|
|
115
|
-
"react-dom": "^18.
|
|
116
|
-
"react-hook-form": "^7.
|
|
127
|
+
"react": "^18.0.0",
|
|
128
|
+
"react-dom": "^18.0.0",
|
|
129
|
+
"react-hook-form": "^7.53.0",
|
|
117
130
|
"react-is": "^18.2.0"
|
|
118
131
|
},
|
|
119
|
-
"gitHead": "
|
|
132
|
+
"gitHead": "e7fed252032085c4f2e81769374c0688284ad5fe"
|
|
120
133
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* A component for a Google login button, according to their design language.
|
|
4
|
-
* This works when an identity provider is configured in the admin dashboard.
|
|
5
|
-
* @param props href: a string to override the URL provided by the context
|
|
6
|
-
* @returns a JSX.Element to render
|
|
7
|
-
*/
|
|
8
|
-
export default function GoogleSSOButton(props: {
|
|
9
|
-
callbackUrl?: string;
|
|
10
|
-
}): React.JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import GoogleLoginButton from './GoogleLoginButton';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: typeof GoogleLoginButton;
|
|
6
|
-
tags: string[];
|
|
7
|
-
};
|
|
8
|
-
export default meta;
|
|
9
|
-
export declare function Basic(): React.JSX.Element;
|
|
10
|
-
export declare function AlphaVersionWithOutProvider(): React.JSX.Element;
|
|
11
|
-
export declare function AlphaVersionWithProvider(): React.JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './GoogleLoginButton';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './SignInForm';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Attribute } from '../lib/SimpleForm/types';
|
|
2
|
-
export type AllowedAny = any;
|
|
3
|
-
export type LoginInfo = {
|
|
4
|
-
email: string;
|
|
5
|
-
password: string;
|
|
6
|
-
};
|
|
7
|
-
type LoginSuccess = (response: AllowedAny, formValues: LoginInfo, ...args: AllowedAny) => void;
|
|
8
|
-
export interface Props {
|
|
9
|
-
beforeMutate?: (data: AllowedAny) => AllowedAny;
|
|
10
|
-
onSuccess: LoginSuccess;
|
|
11
|
-
onError?: (error: Error, data: AllowedAny) => void;
|
|
12
|
-
attributes?: Attribute[];
|
|
13
|
-
disableSSO?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './SignUpForm';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CreateBasicUserRequest, User } from '@niledatabase/browser';
|
|
2
|
-
import { Attribute } from '../lib/SimpleForm/types';
|
|
3
|
-
export type SignUpInfo = CreateBasicUserRequest;
|
|
4
|
-
type SignInSuccess = (response: void | User, formValues: SignUpInfo) => void;
|
|
5
|
-
export type AllowedAny = any;
|
|
6
|
-
export interface Props {
|
|
7
|
-
onSuccess: SignInSuccess;
|
|
8
|
-
onError?: (e: Error, info: SignUpInfo) => void;
|
|
9
|
-
beforeMutate?: (data: AllowedAny) => AllowedAny;
|
|
10
|
-
attributes?: Attribute[];
|
|
11
|
-
buttonText?: string;
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SxProps } from '@mui/system/styleFunctionSx/styleFunctionSx';
|
|
3
|
-
import { Theme } from '@mui/system/createTheme';
|
|
4
|
-
import { User } from '@niledatabase/browser';
|
|
5
|
-
type ColumnNames = string;
|
|
6
|
-
type Props = {
|
|
7
|
-
data: void | User[];
|
|
8
|
-
allowCreation?: boolean;
|
|
9
|
-
buttonText?: string;
|
|
10
|
-
onUserCreateSuccess?: (user: any) => void;
|
|
11
|
-
slots?: {
|
|
12
|
-
dataGrid?: SxProps<Theme>;
|
|
13
|
-
};
|
|
14
|
-
include?: ColumnNames[];
|
|
15
|
-
};
|
|
16
|
-
export default function UserList(props: Props): React.JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './UserList';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { GridColDef, GridRowsProp } from '@mui/x-data-grid';
|
|
2
|
-
import { User } from '@niledatabase/browser';
|
|
3
|
-
export declare const internalRowId = "_nile_data_grid_identifier";
|
|
4
|
-
export default function useDataParser(data: void | User[], include: string[]): [GridColDef[], GridRowsProp];
|
package/dist/context/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Browser from '@niledatabase/browser';
|
|
3
|
-
import { NileProviderProps, NileReactConfig } from './types';
|
|
4
|
-
export declare const BaseQueryProvider: ({ children, }: {
|
|
5
|
-
children: JSX.Element;
|
|
6
|
-
}) => JSX.Element;
|
|
7
|
-
export declare const NileProvider: (props: NileProviderProps) => React.JSX.Element;
|
|
8
|
-
export declare const useNileConfig: () => NileReactConfig;
|
|
9
|
-
export declare const useApi: () => Browser;
|
package/dist/context/theme.d.ts
DELETED
package/dist/context/types.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import Browser from '@niledatabase/browser';
|
|
2
|
-
import { Theme } from '@mui/joy/styles';
|
|
3
|
-
export interface NileReactConfig {
|
|
4
|
-
tenantId?: string;
|
|
5
|
-
apiUrl?: string;
|
|
6
|
-
appUrl?: string;
|
|
7
|
-
}
|
|
8
|
-
export type NileContext = NileReactConfig & {
|
|
9
|
-
api: Browser;
|
|
10
|
-
theme?: Theme;
|
|
11
|
-
};
|
|
12
|
-
export type NileProviderProps = NileReactConfig & {
|
|
13
|
-
children: JSX.Element | JSX.Element[];
|
|
14
|
-
theme?: Theme;
|
|
15
|
-
slotProps?: {
|
|
16
|
-
provider?: Record<string, string>;
|
|
17
|
-
};
|
|
18
|
-
QueryProvider?: (props: {
|
|
19
|
-
children: JSX.Element;
|
|
20
|
-
}) => JSX.Element;
|
|
21
|
-
api?: Browser;
|
|
22
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { GridColDef, GridRowsProp } from '@mui/x-data-grid';
|
|
2
|
-
export declare const internalRowId = "_nile_data_grid_identifier";
|
|
3
|
-
declare enum Commands {
|
|
4
|
-
insert = "INSERT",
|
|
5
|
-
update = "UPDATE",
|
|
6
|
-
delete = "DELETE",
|
|
7
|
-
create = "CREATE",
|
|
8
|
-
drop = "DROP",
|
|
9
|
-
alter = "ALTER"
|
|
10
|
-
}
|
|
11
|
-
type Any = any;
|
|
12
|
-
type ResultSet = null | Record<string, never> | {
|
|
13
|
-
command: Commands;
|
|
14
|
-
rowCount: number;
|
|
15
|
-
oid: number;
|
|
16
|
-
rows: Any[];
|
|
17
|
-
fields: Any[];
|
|
18
|
-
RowCtor: null;
|
|
19
|
-
rowAsArray: boolean;
|
|
20
|
-
};
|
|
21
|
-
export default function useResults(resultSet: null | ResultSet): [GridColDef[], GridRowsProp];
|
|
22
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useTextSizer(): CanvasRenderingContext2D | undefined;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Attribute, DisplayProps, Options } from '../types';
|
|
3
|
-
type Props = {
|
|
4
|
-
attribute: Attribute;
|
|
5
|
-
display: DisplayProps;
|
|
6
|
-
options: Options;
|
|
7
|
-
helperText: string;
|
|
8
|
-
};
|
|
9
|
-
export default function CheckGroup(props: Props): React.JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Attribute } from './types';
|
|
3
|
-
export declare const getAttributeDefault: (attribute: Attribute) => string | number | boolean | string[] | number[];
|
|
4
|
-
export default function SimpleForm(props: {
|
|
5
|
-
buttonText: string;
|
|
6
|
-
cancelButton?: React.ReactNode;
|
|
7
|
-
attributes: Attribute[];
|
|
8
|
-
mutation: any;
|
|
9
|
-
loading?: boolean;
|
|
10
|
-
successMessage?: JSX.Element;
|
|
11
|
-
}): React.JSX.Element;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export declare enum AttributeType {
|
|
2
|
-
Text = "text",
|
|
3
|
-
Email = "email",
|
|
4
|
-
Password = "password",
|
|
5
|
-
Select = "select",
|
|
6
|
-
Number = "number",
|
|
7
|
-
Float = "float",
|
|
8
|
-
Checkbox = "checkbox",
|
|
9
|
-
Switch = "switch"
|
|
10
|
-
}
|
|
11
|
-
type SimplePrimitive = number | string | boolean;
|
|
12
|
-
export type Options = {
|
|
13
|
-
label: string;
|
|
14
|
-
value?: SimplePrimitive;
|
|
15
|
-
}[];
|
|
16
|
-
export type Attribute = {
|
|
17
|
-
name: string;
|
|
18
|
-
type?: AttributeType;
|
|
19
|
-
defaultValue?: SimplePrimitive;
|
|
20
|
-
options?: Options;
|
|
21
|
-
allowMultiple?: boolean;
|
|
22
|
-
label?: string;
|
|
23
|
-
required?: boolean;
|
|
24
|
-
placeholder?: string;
|
|
25
|
-
helpText?: string;
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
};
|
|
28
|
-
export type DisplayProps = {
|
|
29
|
-
key: string;
|
|
30
|
-
id: string;
|
|
31
|
-
label: string;
|
|
32
|
-
placeholder: string;
|
|
33
|
-
error?: boolean;
|
|
34
|
-
color?: 'danger';
|
|
35
|
-
disabled?: boolean;
|
|
36
|
-
};
|
|
37
|
-
export {};
|