fox-ui-kit 0.1.0 → 0.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/README.md +19 -1
- package/dist/index.d.ts +0 -2
- package/dist/input/AutocompleteInput/index.js +1 -3
- package/dist/input/TagInput/index.js +3 -2
- package/dist/modal/DetailsModal/index.js +3 -7
- package/dist/modal/FormModal/index.js +3 -7
- package/dist/router/GuestRoute/index.d.ts +3 -10
- package/dist/router/GuestRoute/index.js +15 -25
- package/dist/router/PrivateRoute/index.d.ts +3 -10
- package/dist/router/PrivateRoute/index.js +15 -26
- package/dist/router/__tests__/route-guards.test.d.ts +1 -0
- package/dist/router/__tests__/route-guards.test.js +69 -0
- package/dist/showcase/Button.d.ts +29 -29
- package/dist/showcase/Header.d.ts +10 -10
- package/dist/showcase/Page.d.ts +10 -10
- package/dist/table/CTable/index.js +3 -6
- package/package.json +21 -39
- package/dist/showcase/Button.d.js +0 -6
- package/dist/showcase/Header.d.js +0 -6
- package/dist/showcase/Page.d.js +0 -6
- package/dist/types.d.js +0 -1
package/README.md
CHANGED
|
@@ -149,7 +149,25 @@ npm run storybook # открыть Storybook
|
|
|
149
149
|
npm run build-storybook # собрать Storybook
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
Для опубликованных компонентов React и
|
|
152
|
+
Для опубликованных компонентов React, Ant Design и React Router объявлены как `peerDependencies`: приложение, подключающее пакет, должно установить эти зависимости. `PrivateRoute` и `GuestRoute` совместимы с React Router 7 и используются как layout routes внутри `Routes`:
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
import { BrowserRouter, Route, Routes } from 'react-router-dom';
|
|
156
|
+
import { GuestRoute, PrivateRoute } from 'fox-ui-kit';
|
|
157
|
+
|
|
158
|
+
<BrowserRouter>
|
|
159
|
+
<Routes>
|
|
160
|
+
<Route element={<PrivateRoute authenticated={isAuthenticated} />}>
|
|
161
|
+
<Route path="/dashboard" element={<Dashboard />} />
|
|
162
|
+
</Route>
|
|
163
|
+
<Route element={<GuestRoute authenticated={isAuthenticated} />}>
|
|
164
|
+
<Route path="/login" element={<Login />} />
|
|
165
|
+
</Route>
|
|
166
|
+
</Routes>
|
|
167
|
+
</BrowserRouter>;
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Для маршрутов без вложенных `Route` guard-компоненты также принимают `children`. Свойство `redirectUrl` задаёт путь перенаправления; по умолчанию закрытый маршрут ведёт на `/login`, а гостевой — на `/`.
|
|
153
171
|
|
|
154
172
|
## Документация и публикация
|
|
155
173
|
|
package/dist/index.d.ts
CHANGED
|
@@ -10,9 +10,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
const SAutocomplete = (0, _styledComponents.default)(_antd.AutoComplete)`
|
|
12
12
|
.ant-select-selector {
|
|
13
|
-
|
|
14
|
-
"borderStyle": "none"
|
|
15
|
-
}}
|
|
13
|
+
border: none;
|
|
16
14
|
}
|
|
17
15
|
`;
|
|
18
16
|
const AutocompleteInput = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
@@ -61,16 +61,17 @@ const TagInputValidators = exports.TagInputValidators = {
|
|
|
61
61
|
* Value tag component
|
|
62
62
|
* @param props properties
|
|
63
63
|
*/
|
|
64
|
-
const ValueTag = props => {
|
|
64
|
+
const ValueTag = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
65
65
|
const {
|
|
66
66
|
children,
|
|
67
67
|
className,
|
|
68
68
|
...restProps
|
|
69
69
|
} = props;
|
|
70
70
|
return /*#__PURE__*/_react.default.createElement(_antd.Tag, _extends({
|
|
71
|
+
ref: ref,
|
|
71
72
|
className: (0, _clsx.default)([className, "inline-flex items-center cursor-pointer"])
|
|
72
73
|
}, restProps), children);
|
|
73
|
-
};
|
|
74
|
+
});
|
|
74
75
|
const TagInput = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
75
76
|
// load global props
|
|
76
77
|
const {
|
|
@@ -12,16 +12,12 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
12
12
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
13
|
const SModal = (0, _styledComponents.default)(_antd.Modal)`
|
|
14
14
|
.ant-modal-content {
|
|
15
|
-
|
|
16
|
-
"borderRadius": "0.5rem !important"
|
|
17
|
-
}}
|
|
15
|
+
border-radius: 0.5rem !important;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
.ant-modal-content .ant-modal-header {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"borderTopRightRadius": "0.5rem !important"
|
|
24
|
-
}}
|
|
19
|
+
border-top-left-radius: 0.5rem !important;
|
|
20
|
+
border-top-right-radius: 0.5rem !important;
|
|
25
21
|
}
|
|
26
22
|
`;
|
|
27
23
|
const DetailsModal = props => {
|
|
@@ -12,16 +12,12 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
12
12
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
13
|
const SModal = (0, _styledComponents.default)(_antd.Modal)`
|
|
14
14
|
.ant-modal-content {
|
|
15
|
-
|
|
16
|
-
"borderRadius": "0.5rem !important"
|
|
17
|
-
}}
|
|
15
|
+
border-radius: 0.5rem !important;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
.ant-modal-content .ant-modal-header {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"borderTopRightRadius": "0.5rem !important"
|
|
24
|
-
}}
|
|
19
|
+
border-top-left-radius: 0.5rem !important;
|
|
20
|
+
border-top-right-radius: 0.5rem !important;
|
|
25
21
|
}
|
|
26
22
|
`;
|
|
27
23
|
const FormModal = props => {
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export declare type GuestRouteProps = RouteProps & {
|
|
4
|
-
component: React.ComponentType<RouteComponentProps<any>> | React.ComponentType<any>;
|
|
2
|
+
export type GuestRouteProps = {
|
|
5
3
|
authenticated: boolean;
|
|
6
4
|
redirectUrl?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
7
6
|
};
|
|
8
|
-
declare const GuestRoute: React.
|
|
9
|
-
[x: string]: string | undefined;
|
|
10
|
-
}> & {
|
|
11
|
-
component: React.ComponentType<RouteComponentProps<any>> | React.ComponentType<any>;
|
|
12
|
-
authenticated: boolean;
|
|
13
|
-
redirectUrl?: string;
|
|
14
|
-
} & React.RefAttributes<Route<{}, string>>>;
|
|
7
|
+
declare const GuestRoute: ({ authenticated, redirectUrl, children }: GuestRouteProps) => React.JSX.Element;
|
|
15
8
|
export default GuestRoute;
|
|
@@ -4,30 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactRouterDom = require("react-router-dom");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
(
|
|
22
|
-
|
|
23
|
-
// eslint-disable-next-line
|
|
24
|
-
}, [props.authenticated]);
|
|
25
|
-
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, _extends({
|
|
26
|
-
ref: ref
|
|
27
|
-
}, rest, {
|
|
28
|
-
render: routeProps => connected ? /*#__PURE__*/_react.default.createElement(_reactRouterDom.Redirect, {
|
|
29
|
-
to: redirectUrl ?? '/'
|
|
30
|
-
}) : /*#__PURE__*/_react.default.createElement(Component, routeProps)
|
|
31
|
-
}));
|
|
32
|
-
});
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const GuestRoute = ({
|
|
11
|
+
authenticated,
|
|
12
|
+
redirectUrl = '/',
|
|
13
|
+
children
|
|
14
|
+
}) => {
|
|
15
|
+
if (authenticated) {
|
|
16
|
+
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Navigate, {
|
|
17
|
+
to: redirectUrl,
|
|
18
|
+
replace: true
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children ?? /*#__PURE__*/_react.default.createElement(_reactRouterDom.Outlet, null));
|
|
22
|
+
};
|
|
33
23
|
var _default = exports.default = GuestRoute;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export declare type PrivateRouteProps = RouteProps & {
|
|
4
|
-
component: React.ComponentType<RouteComponentProps<any>> | React.ComponentType<any>;
|
|
2
|
+
export type PrivateRouteProps = {
|
|
5
3
|
authenticated: boolean;
|
|
6
4
|
redirectUrl?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
7
6
|
};
|
|
8
|
-
declare const PrivateRoute: React.
|
|
9
|
-
[x: string]: string | undefined;
|
|
10
|
-
}> & {
|
|
11
|
-
component: React.ComponentType<RouteComponentProps<any>> | React.ComponentType<any>;
|
|
12
|
-
authenticated: boolean;
|
|
13
|
-
redirectUrl?: string;
|
|
14
|
-
} & React.RefAttributes<Route<{}, string>>>;
|
|
7
|
+
declare const PrivateRoute: ({ authenticated, redirectUrl, children }: PrivateRouteProps) => React.JSX.Element;
|
|
15
8
|
export default PrivateRoute;
|
|
@@ -4,31 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactRouterDom = require("react-router-dom");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
setConnected(props.authenticated);
|
|
24
|
-
// eslint-disable-next-line
|
|
25
|
-
}, [props.authenticated]);
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, _extends({
|
|
27
|
-
ref: ref
|
|
28
|
-
}, rest, {
|
|
29
|
-
render: routeProps => connected ? /*#__PURE__*/_react.default.createElement(Component, routeProps) : /*#__PURE__*/_react.default.createElement(_reactRouterDom.Redirect, {
|
|
30
|
-
to: redirectUrl ?? '/login'
|
|
31
|
-
})
|
|
32
|
-
}));
|
|
33
|
-
});
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const PrivateRoute = ({
|
|
11
|
+
authenticated,
|
|
12
|
+
redirectUrl = '/login',
|
|
13
|
+
children
|
|
14
|
+
}) => {
|
|
15
|
+
if (!authenticated) {
|
|
16
|
+
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Navigate, {
|
|
17
|
+
to: redirectUrl,
|
|
18
|
+
replace: true
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children ?? /*#__PURE__*/_react.default.createElement(_reactRouterDom.Outlet, null));
|
|
22
|
+
};
|
|
34
23
|
var _default = exports.default = PrivateRoute;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = require("@testing-library/react");
|
|
4
|
+
var _reactRouterDom = require("react-router-dom");
|
|
5
|
+
var _GuestRoute = _interopRequireDefault(require("../GuestRoute"));
|
|
6
|
+
var _PrivateRoute = _interopRequireDefault(require("../PrivateRoute"));
|
|
7
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
describe('route guards', () => {
|
|
9
|
+
it('renders nested private routes when authenticated', () => {
|
|
10
|
+
(0, _react.render)(/*#__PURE__*/React.createElement(_reactRouterDom.MemoryRouter, {
|
|
11
|
+
initialEntries: ['/private']
|
|
12
|
+
}, /*#__PURE__*/React.createElement(_reactRouterDom.Routes, null, /*#__PURE__*/React.createElement(_reactRouterDom.Route, {
|
|
13
|
+
element: /*#__PURE__*/React.createElement(_PrivateRoute.default, {
|
|
14
|
+
authenticated: true
|
|
15
|
+
})
|
|
16
|
+
}, /*#__PURE__*/React.createElement(_reactRouterDom.Route, {
|
|
17
|
+
path: "/private",
|
|
18
|
+
element: /*#__PURE__*/React.createElement("p", null, "Private page")
|
|
19
|
+
})))));
|
|
20
|
+
expect(_react.screen.getByText('Private page')).toBeTruthy();
|
|
21
|
+
});
|
|
22
|
+
it('redirects unauthenticated users from private routes', () => {
|
|
23
|
+
(0, _react.render)(/*#__PURE__*/React.createElement(_reactRouterDom.MemoryRouter, {
|
|
24
|
+
initialEntries: ['/private']
|
|
25
|
+
}, /*#__PURE__*/React.createElement(_reactRouterDom.Routes, null, /*#__PURE__*/React.createElement(_reactRouterDom.Route, {
|
|
26
|
+
element: /*#__PURE__*/React.createElement(_PrivateRoute.default, {
|
|
27
|
+
authenticated: false,
|
|
28
|
+
redirectUrl: "/login"
|
|
29
|
+
})
|
|
30
|
+
}, /*#__PURE__*/React.createElement(_reactRouterDom.Route, {
|
|
31
|
+
path: "/private",
|
|
32
|
+
element: /*#__PURE__*/React.createElement("p", null, "Private page")
|
|
33
|
+
})), /*#__PURE__*/React.createElement(_reactRouterDom.Route, {
|
|
34
|
+
path: "/login",
|
|
35
|
+
element: /*#__PURE__*/React.createElement("p", null, "Login page")
|
|
36
|
+
}))));
|
|
37
|
+
expect(_react.screen.getByText('Login page')).toBeTruthy();
|
|
38
|
+
});
|
|
39
|
+
it('renders nested guest routes when unauthenticated', () => {
|
|
40
|
+
(0, _react.render)(/*#__PURE__*/React.createElement(_reactRouterDom.MemoryRouter, {
|
|
41
|
+
initialEntries: ['/login']
|
|
42
|
+
}, /*#__PURE__*/React.createElement(_reactRouterDom.Routes, null, /*#__PURE__*/React.createElement(_reactRouterDom.Route, {
|
|
43
|
+
element: /*#__PURE__*/React.createElement(_GuestRoute.default, {
|
|
44
|
+
authenticated: false
|
|
45
|
+
})
|
|
46
|
+
}, /*#__PURE__*/React.createElement(_reactRouterDom.Route, {
|
|
47
|
+
path: "/login",
|
|
48
|
+
element: /*#__PURE__*/React.createElement("p", null, "Login page")
|
|
49
|
+
})))));
|
|
50
|
+
expect(_react.screen.getByText('Login page')).toBeTruthy();
|
|
51
|
+
});
|
|
52
|
+
it('redirects authenticated users away from guest routes', () => {
|
|
53
|
+
(0, _react.render)(/*#__PURE__*/React.createElement(_reactRouterDom.MemoryRouter, {
|
|
54
|
+
initialEntries: ['/login']
|
|
55
|
+
}, /*#__PURE__*/React.createElement(_reactRouterDom.Routes, null, /*#__PURE__*/React.createElement(_reactRouterDom.Route, {
|
|
56
|
+
element: /*#__PURE__*/React.createElement(_GuestRoute.default, {
|
|
57
|
+
authenticated: true,
|
|
58
|
+
redirectUrl: "/dashboard"
|
|
59
|
+
})
|
|
60
|
+
}, /*#__PURE__*/React.createElement(_reactRouterDom.Route, {
|
|
61
|
+
path: "/login",
|
|
62
|
+
element: /*#__PURE__*/React.createElement("p", null, "Login page")
|
|
63
|
+
})), /*#__PURE__*/React.createElement(_reactRouterDom.Route, {
|
|
64
|
+
path: "/dashboard",
|
|
65
|
+
element: /*#__PURE__*/React.createElement("p", null, "Dashboard")
|
|
66
|
+
}))));
|
|
67
|
+
expect(_react.screen.getByText('Dashboard')).toBeTruthy();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
import './button.css';
|
|
3
|
-
interface ButtonProps {
|
|
4
|
-
/**
|
|
5
|
-
* Is this the principal call to action on the page?
|
|
6
|
-
*/
|
|
7
|
-
primary?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* What background color to use
|
|
10
|
-
*/
|
|
11
|
-
backgroundColor?: string;
|
|
12
|
-
/**
|
|
13
|
-
* How large should the button be?
|
|
14
|
-
*/
|
|
15
|
-
size?: 'small' | 'medium' | 'large';
|
|
16
|
-
/**
|
|
17
|
-
* Button contents
|
|
18
|
-
*/
|
|
19
|
-
label: string;
|
|
20
|
-
/**
|
|
21
|
-
* Optional click handler
|
|
22
|
-
*/
|
|
23
|
-
onClick?: () => void;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Primary UI component for user interaction
|
|
27
|
-
*/
|
|
28
|
-
export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) =>
|
|
29
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './button.css';
|
|
3
|
+
interface ButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Is this the principal call to action on the page?
|
|
6
|
+
*/
|
|
7
|
+
primary?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* What background color to use
|
|
10
|
+
*/
|
|
11
|
+
backgroundColor?: string;
|
|
12
|
+
/**
|
|
13
|
+
* How large should the button be?
|
|
14
|
+
*/
|
|
15
|
+
size?: 'small' | 'medium' | 'large';
|
|
16
|
+
/**
|
|
17
|
+
* Button contents
|
|
18
|
+
*/
|
|
19
|
+
label: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional click handler
|
|
22
|
+
*/
|
|
23
|
+
onClick?: () => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Primary UI component for user interaction
|
|
27
|
+
*/
|
|
28
|
+
export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import './header.css';
|
|
3
|
-
interface HeaderProps {
|
|
4
|
-
user?: {};
|
|
5
|
-
onLogin: () => void;
|
|
6
|
-
onLogout: () => void;
|
|
7
|
-
onCreateAccount: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const Header: ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) =>
|
|
10
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './header.css';
|
|
3
|
+
interface HeaderProps {
|
|
4
|
+
user?: {};
|
|
5
|
+
onLogin: () => void;
|
|
6
|
+
onLogout: () => void;
|
|
7
|
+
onCreateAccount: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Header: ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => JSX.Element;
|
|
10
|
+
export {};
|
package/dist/showcase/Page.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import './page.css';
|
|
3
|
-
interface PageProps {
|
|
4
|
-
user?: {};
|
|
5
|
-
onLogin: () => void;
|
|
6
|
-
onLogout: () => void;
|
|
7
|
-
onCreateAccount: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const Page: ({ user, onLogin, onLogout, onCreateAccount }: PageProps) =>
|
|
10
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './page.css';
|
|
3
|
+
interface PageProps {
|
|
4
|
+
user?: {};
|
|
5
|
+
onLogin: () => void;
|
|
6
|
+
onLogout: () => void;
|
|
7
|
+
onCreateAccount: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Page: ({ user, onLogin, onLogout, onCreateAccount }: PageProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -12,12 +12,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
12
12
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
13
|
const STable = (0, _styledComponents.default)(_antd.Table)`
|
|
14
14
|
.ant-table-thead > tr > th {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"borderColor": "rgb(243 244 246 / var(--tw-border-opacity, 1))",
|
|
19
|
-
"backgroundColor": "transparent"
|
|
20
|
-
}}
|
|
15
|
+
background-color: transparent;
|
|
16
|
+
border-color: #f3f4f6;
|
|
17
|
+
border-bottom-width: 4px;
|
|
21
18
|
}
|
|
22
19
|
`;
|
|
23
20
|
const CTable = props => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fox-ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"funding": {
|
|
5
5
|
"type": "boosty",
|
|
6
6
|
"url": "https://boosty.to/fox_ui_kit/donate"
|
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
"description": "Fox UI Kit: React components and design utilities built on Ant Design and Tailwind CSS.",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"react",
|
|
13
|
+
"ui",
|
|
14
|
+
"component-library",
|
|
15
|
+
"antd",
|
|
16
|
+
"ant-design",
|
|
17
|
+
"tailwindcss",
|
|
18
|
+
"design-system",
|
|
19
|
+
"typescript"
|
|
20
|
+
],
|
|
11
21
|
"license": "MIT",
|
|
12
22
|
"private": false,
|
|
13
23
|
"files": [
|
|
@@ -30,34 +40,9 @@
|
|
|
30
40
|
"storybook": "storybook dev -p 6006",
|
|
31
41
|
"build-storybook": "storybook build",
|
|
32
42
|
"clean": "rimraf dist",
|
|
33
|
-
"compile": "npm run clean && tsc && cross-env NODE_ENV=production babel src/components --out-dir dist --copy-files --extensions '.ts,.tsx' --ignore __tests__,spec.js,test.js,stories.js,__snapshots__",
|
|
43
|
+
"compile": "npm run clean && tsc && cross-env NODE_ENV=production babel src/components --out-dir dist --copy-files --extensions '.ts,.tsx' --ignore '**/*.d.ts',__tests__,spec.js,test.js,stories.js,__snapshots__",
|
|
34
44
|
"prepack": "npm run compile"
|
|
35
45
|
},
|
|
36
|
-
"eslintConfig": {
|
|
37
|
-
"extends": [
|
|
38
|
-
"react-app",
|
|
39
|
-
"react-app/jest",
|
|
40
|
-
"plugin:storybook/recommended"
|
|
41
|
-
],
|
|
42
|
-
"overrides": [
|
|
43
|
-
{
|
|
44
|
-
"files": [
|
|
45
|
-
"**/*.stories.*"
|
|
46
|
-
],
|
|
47
|
-
"rules": {
|
|
48
|
-
"import/no-anonymous-default-export": "off"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"files": [
|
|
53
|
-
"**/*.stories.*"
|
|
54
|
-
],
|
|
55
|
-
"rules": {
|
|
56
|
-
"import/no-anonymous-default-export": "off"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
46
|
"browserslist": {
|
|
62
47
|
"production": [
|
|
63
48
|
">0.2%",
|
|
@@ -72,6 +57,7 @@
|
|
|
72
57
|
},
|
|
73
58
|
"dependencies": {
|
|
74
59
|
"moment": "^2.30.1",
|
|
60
|
+
"prop-types": "^15.8.1",
|
|
75
61
|
"react-is": "^18.3.1"
|
|
76
62
|
},
|
|
77
63
|
"peerDependencies": {
|
|
@@ -83,7 +69,7 @@
|
|
|
83
69
|
"clsx": ">= 1.1.1",
|
|
84
70
|
"react": "^18.3.1",
|
|
85
71
|
"react-dom": "^18.3.1",
|
|
86
|
-
"react-router-dom": "^
|
|
72
|
+
"react-router-dom": "^7.0.0",
|
|
87
73
|
"styled-components": ">= 5.3.3"
|
|
88
74
|
},
|
|
89
75
|
"devDependencies": {
|
|
@@ -107,31 +93,27 @@
|
|
|
107
93
|
"@types/react": "^18.3.1",
|
|
108
94
|
"@types/react-dom": "^18.3.1",
|
|
109
95
|
"@types/react-is": "^18.3.1",
|
|
110
|
-
"@types/react-router-dom": "^5.3.3",
|
|
111
96
|
"@vitejs/plugin-react": "^6.3.0",
|
|
97
|
+
"@vitest/browser-playwright": "^5.1.2",
|
|
112
98
|
"antd": "^5.22.0",
|
|
113
99
|
"autoprefixer": "^10.7.1",
|
|
114
100
|
"axios": "^1.21.1",
|
|
115
101
|
"backend-gateway": "^0.0.3",
|
|
116
|
-
"babel-plugin-macros": "^3.1.0",
|
|
117
102
|
"clsx": "^2.1.1",
|
|
118
103
|
"cross-env": "^10.1.0",
|
|
119
|
-
"
|
|
104
|
+
"eslint-plugin-storybook": "^10.6.9",
|
|
120
105
|
"jsdom": "^26.1.0",
|
|
106
|
+
"playwright": "^1.65.1",
|
|
107
|
+
"postcss": "^8.5.34",
|
|
121
108
|
"react": "^18.3.1",
|
|
122
109
|
"react-dom": "^18.3.1",
|
|
123
|
-
"react-router-dom": "^
|
|
110
|
+
"react-router-dom": "^7.18.7",
|
|
124
111
|
"rimraf": "^6.1.4",
|
|
112
|
+
"storybook": "^10.6.9",
|
|
125
113
|
"styled-components": "^6.7.0",
|
|
126
114
|
"tailwindcss": "^3.4.15",
|
|
127
|
-
"twin.macro": "^3.4.1",
|
|
128
115
|
"typescript": "^7.0.2",
|
|
129
|
-
"vitest": "^5.1.2",
|
|
130
116
|
"vite": "^8.4.0",
|
|
131
|
-
"
|
|
132
|
-
"eslint-plugin-storybook": "^10.6.9",
|
|
133
|
-
"@vitest/browser-playwright": "^5.1.2",
|
|
134
|
-
"playwright": "^1.65.1",
|
|
135
|
-
"web-vitals": "^6.2.3"
|
|
117
|
+
"vitest": "^5.1.2"
|
|
136
118
|
}
|
|
137
119
|
}
|
package/dist/showcase/Page.d.js
DELETED
package/dist/types.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|