@akinon/ui-layout 0.4.0 → 0.6.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/dist/cjs/Flex/index.d.ts +5 -0
- package/dist/cjs/Flex/index.d.ts.map +1 -0
- package/dist/cjs/Flex/index.js +39 -0
- package/dist/cjs/Flex/types.d.ts +47 -0
- package/dist/cjs/Grid/index.d.ts +6 -0
- package/dist/cjs/Grid/index.d.ts.map +1 -0
- package/dist/cjs/Grid/index.js +62 -0
- package/dist/cjs/Grid/types.d.ts +123 -0
- package/dist/cjs/Layout/Content/index.d.ts +5 -0
- package/dist/cjs/Layout/Content/index.d.ts.map +1 -0
- package/dist/cjs/Layout/Content/index.js +40 -0
- package/dist/cjs/Layout/Content/types.d.ts +14 -0
- package/dist/cjs/Layout/Footer/index.css +3 -0
- package/dist/cjs/Layout/Footer/index.d.ts +6 -0
- package/dist/cjs/Layout/Footer/index.d.ts.map +1 -0
- package/dist/cjs/Layout/Footer/index.js +41 -0
- package/dist/cjs/Layout/Footer/types.d.ts +15 -0
- package/dist/cjs/Layout/Header/index.css +12 -0
- package/dist/cjs/Layout/Header/index.d.ts +6 -0
- package/dist/cjs/Layout/Header/index.d.ts.map +1 -0
- package/dist/cjs/Layout/Header/index.js +41 -0
- package/dist/cjs/Layout/Header/types.d.ts +15 -0
- package/dist/cjs/Layout/Sider/index.css +28 -0
- package/dist/cjs/Layout/Sider/index.d.ts +6 -0
- package/dist/cjs/Layout/Sider/index.d.ts.map +1 -0
- package/dist/cjs/Layout/Sider/index.js +49 -0
- package/dist/cjs/Layout/Sider/types.d.ts +74 -0
- package/dist/cjs/Layout/index.d.ts +5 -0
- package/dist/cjs/Layout/index.d.ts.map +1 -0
- package/dist/cjs/Layout/index.js +39 -0
- package/dist/cjs/Layout/types.d.ts +22 -0
- package/dist/cjs/NavCard/index.css +83 -0
- package/dist/cjs/NavCard/index.d.ts +6 -0
- package/dist/cjs/NavCard/index.d.ts.map +1 -0
- package/dist/cjs/NavCard/index.js +15 -0
- package/dist/cjs/NavCard/types.d.ts +32 -0
- package/dist/cjs/{page-content.css → PageContent/index.css} +1 -1
- package/dist/cjs/PageContent/index.d.ts +6 -0
- package/dist/cjs/PageContent/index.d.ts.map +1 -0
- package/dist/cjs/{page-content.js → PageContent/index.js} +5 -4
- package/dist/cjs/PageContent/types.d.ts +3 -0
- package/dist/cjs/{page-heading.css → PageHeading/index.css} +2 -2
- package/dist/cjs/PageHeading/index.d.ts +6 -0
- package/dist/cjs/PageHeading/index.d.ts.map +1 -0
- package/dist/cjs/PageHeading/index.js +14 -0
- package/dist/cjs/PageHeading/types.d.ts +18 -0
- package/dist/cjs/index.d.ts +11 -26
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +7 -10
- package/dist/cjs/types.d.ts +12 -0
- package/dist/esm/Flex/index.d.ts +5 -0
- package/dist/esm/Flex/index.d.ts.map +1 -0
- package/dist/esm/Flex/index.js +35 -0
- package/dist/esm/Flex/types.d.ts +47 -0
- package/dist/esm/Grid/index.d.ts +6 -0
- package/dist/esm/Grid/index.d.ts.map +1 -0
- package/dist/esm/Grid/index.js +57 -0
- package/dist/esm/Grid/types.d.ts +123 -0
- package/dist/esm/Layout/Content/index.d.ts +5 -0
- package/dist/esm/Layout/Content/index.d.ts.map +1 -0
- package/dist/esm/Layout/Content/index.js +36 -0
- package/dist/esm/Layout/Content/types.d.ts +14 -0
- package/dist/esm/Layout/Footer/index.css +3 -0
- package/dist/esm/Layout/Footer/index.d.ts +6 -0
- package/dist/esm/Layout/Footer/index.d.ts.map +1 -0
- package/dist/esm/Layout/Footer/index.js +37 -0
- package/dist/esm/Layout/Footer/types.d.ts +15 -0
- package/dist/esm/Layout/Header/index.css +12 -0
- package/dist/esm/Layout/Header/index.d.ts +6 -0
- package/dist/esm/Layout/Header/index.d.ts.map +1 -0
- package/dist/esm/Layout/Header/index.js +37 -0
- package/dist/esm/Layout/Header/types.d.ts +15 -0
- package/dist/esm/Layout/Sider/index.css +28 -0
- package/dist/esm/Layout/Sider/index.d.ts +6 -0
- package/dist/esm/Layout/Sider/index.d.ts.map +1 -0
- package/dist/esm/Layout/Sider/index.js +45 -0
- package/dist/esm/Layout/Sider/types.d.ts +74 -0
- package/dist/esm/Layout/index.d.ts +5 -0
- package/dist/esm/Layout/index.d.ts.map +1 -0
- package/dist/esm/Layout/index.js +35 -0
- package/dist/esm/Layout/types.d.ts +22 -0
- package/dist/esm/NavCard/index.css +83 -0
- package/dist/esm/NavCard/index.d.ts +6 -0
- package/dist/esm/NavCard/index.d.ts.map +1 -0
- package/dist/esm/{nav-card.js → NavCard/index.js} +2 -2
- package/dist/esm/NavCard/types.d.ts +32 -0
- package/dist/esm/{page-content.css → PageContent/index.css} +1 -1
- package/dist/esm/PageContent/index.d.ts +6 -0
- package/dist/esm/PageContent/index.d.ts.map +1 -0
- package/dist/esm/{page-content.js → PageContent/index.js} +5 -4
- package/dist/esm/PageContent/types.d.ts +3 -0
- package/dist/esm/{page-heading.css → PageHeading/index.css} +2 -2
- package/dist/esm/PageHeading/index.d.ts +6 -0
- package/dist/esm/PageHeading/index.d.ts.map +1 -0
- package/dist/esm/{page-heading.js → PageHeading/index.js} +5 -4
- package/dist/esm/PageHeading/types.d.ts +18 -0
- package/dist/esm/index.d.ts +11 -26
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +7 -10
- package/dist/esm/types.d.ts +12 -0
- package/package.json +6 -10
- package/dist/cjs/Content.d.ts +0 -6
- package/dist/cjs/Content.d.ts.map +0 -1
- package/dist/cjs/Content.js +0 -9
- package/dist/cjs/Flex.d.ts +0 -4
- package/dist/cjs/Flex.d.ts.map +0 -1
- package/dist/cjs/Flex.js +0 -5
- package/dist/cjs/Footer.d.ts +0 -6
- package/dist/cjs/Footer.d.ts.map +0 -1
- package/dist/cjs/Footer.js +0 -9
- package/dist/cjs/Grid.d.ts +0 -4
- package/dist/cjs/Grid.d.ts.map +0 -1
- package/dist/cjs/Grid.js +0 -6
- package/dist/cjs/Header.d.ts +0 -6
- package/dist/cjs/Header.d.ts.map +0 -1
- package/dist/cjs/Header.js +0 -9
- package/dist/cjs/Layout.d.ts +0 -6
- package/dist/cjs/Layout.d.ts.map +0 -1
- package/dist/cjs/Layout.js +0 -9
- package/dist/cjs/Sider.d.ts +0 -12
- package/dist/cjs/Sider.d.ts.map +0 -1
- package/dist/cjs/Sider.js +0 -18
- package/dist/cjs/index.css +0 -49
- package/dist/cjs/nav-card.css +0 -83
- package/dist/cjs/nav-card.d.ts +0 -12
- package/dist/cjs/nav-card.d.ts.map +0 -1
- package/dist/cjs/nav-card.js +0 -15
- package/dist/cjs/page-content.d.ts +0 -7
- package/dist/cjs/page-content.d.ts.map +0 -1
- package/dist/cjs/page-heading.d.ts +0 -9
- package/dist/cjs/page-heading.d.ts.map +0 -1
- package/dist/cjs/page-heading.js +0 -13
- package/dist/esm/Content.d.ts +0 -6
- package/dist/esm/Content.d.ts.map +0 -1
- package/dist/esm/Content.js +0 -5
- package/dist/esm/Flex.d.ts +0 -4
- package/dist/esm/Flex.d.ts.map +0 -1
- package/dist/esm/Flex.js +0 -2
- package/dist/esm/Footer.d.ts +0 -6
- package/dist/esm/Footer.d.ts.map +0 -1
- package/dist/esm/Footer.js +0 -5
- package/dist/esm/Grid.d.ts +0 -4
- package/dist/esm/Grid.d.ts.map +0 -1
- package/dist/esm/Grid.js +0 -2
- package/dist/esm/Header.d.ts +0 -6
- package/dist/esm/Header.d.ts.map +0 -1
- package/dist/esm/Header.js +0 -5
- package/dist/esm/Layout.d.ts +0 -6
- package/dist/esm/Layout.d.ts.map +0 -1
- package/dist/esm/Layout.js +0 -5
- package/dist/esm/Sider.d.ts +0 -12
- package/dist/esm/Sider.d.ts.map +0 -1
- package/dist/esm/Sider.js +0 -14
- package/dist/esm/index.css +0 -49
- package/dist/esm/nav-card.css +0 -83
- package/dist/esm/nav-card.d.ts +0 -12
- package/dist/esm/nav-card.d.ts.map +0 -1
- package/dist/esm/page-content.d.ts +0 -7
- package/dist/esm/page-content.d.ts.map +0 -1
- package/dist/esm/page-heading.d.ts +0 -9
- package/dist/esm/page-heading.d.ts.map +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// TODO integrate with antd menu types
|
|
2
|
+
export type LeftSiderItem = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
children?: LeftSiderItem[];
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type SiderProps = Omit<AntSiderProps, 'prefixCls' | 'style' | 'styles'>;
|
|
13
|
+
|
|
14
|
+
export interface AntSiderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
prefixCls?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether can be collapsed
|
|
18
|
+
*/
|
|
19
|
+
collapsible?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* To set the current status
|
|
22
|
+
*/
|
|
23
|
+
collapsed?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* To set the initial status
|
|
26
|
+
*/
|
|
27
|
+
defaultCollapsed?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Reverse direction of arrow, for a sider that expands from the right
|
|
30
|
+
*/
|
|
31
|
+
reverseArrow?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The callback function, executed by clicking the trigger or activating the responsive layout
|
|
34
|
+
*/
|
|
35
|
+
onCollapse?: (collapsed: boolean, type: CollapseType) => void;
|
|
36
|
+
/**
|
|
37
|
+
* To customize the styles of the special trigger that appears when <code>collapsedWidth</code> is 0
|
|
38
|
+
*/
|
|
39
|
+
zeroWidthTriggerStyle?: React.CSSProperties;
|
|
40
|
+
/**
|
|
41
|
+
* Specify the customized trigger, set to null to hide the trigger
|
|
42
|
+
*/
|
|
43
|
+
trigger?: React.ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* Width of the sidebar
|
|
46
|
+
*/
|
|
47
|
+
width?: number | string;
|
|
48
|
+
/**
|
|
49
|
+
* Width of the collapsed sidebar, by setting to 0 a special trigger will appear
|
|
50
|
+
*/
|
|
51
|
+
collapsedWidth?: number | string;
|
|
52
|
+
/**
|
|
53
|
+
* Breakpoints of the responsive layout
|
|
54
|
+
*/
|
|
55
|
+
breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
56
|
+
/**
|
|
57
|
+
* Color theme of the sidebar
|
|
58
|
+
*/
|
|
59
|
+
theme?: SiderTheme;
|
|
60
|
+
/**
|
|
61
|
+
* The callback function, executed when breakpoints changed
|
|
62
|
+
*/
|
|
63
|
+
onBreakpoint?: (broken: boolean) => void;
|
|
64
|
+
iconUrl?: string;
|
|
65
|
+
brandImageUrl?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The additional css class
|
|
68
|
+
*/
|
|
69
|
+
className?: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
type SiderTheme = 'light' | 'dark';
|
|
73
|
+
|
|
74
|
+
type CollapseType = 'clickTrigger' | 'responsive';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Layout/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,MAAM,qCAAsC,WAAW,sBA4BnE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.Layout = void 0;
|
|
15
|
+
const ui_theme_1 = require("@akinon/ui-theme");
|
|
16
|
+
const cssinjs_1 = require("@ant-design/cssinjs");
|
|
17
|
+
const antd_1 = require("antd");
|
|
18
|
+
const React = require("react");
|
|
19
|
+
const Layout = (_a) => {
|
|
20
|
+
var { children } = _a, restLayoutProps = __rest(_a, ["children"]);
|
|
21
|
+
const { getPrefixCls, theme } = React.useContext(antd_1.ConfigProvider.ConfigContext);
|
|
22
|
+
const { token, hashId } = (0, ui_theme_1.useToken)();
|
|
23
|
+
//const layoutToken = (token as GlobalToken).Layout;
|
|
24
|
+
const useStyle = (0, cssinjs_1.useStyleRegister)({
|
|
25
|
+
token: token,
|
|
26
|
+
path: ['Layout'],
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
theme: theme
|
|
29
|
+
}, () => {
|
|
30
|
+
const prefixCls = `:where(.${hashId}).${getPrefixCls()}-layout`;
|
|
31
|
+
const prefixClsWithoutHash = `.${getPrefixCls()}-layout`;
|
|
32
|
+
return {
|
|
33
|
+
[prefixCls]: {},
|
|
34
|
+
[prefixClsWithoutHash]: {}
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
return useStyle(React.createElement(antd_1.Layout, Object.assign({}, restLayoutProps), children));
|
|
38
|
+
};
|
|
39
|
+
exports.Layout = Layout;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type LayoutProps = Omit<
|
|
2
|
+
AntLayoutProps,
|
|
3
|
+
'prefixCls' | 'suffixCls' | 'style' | 'styles'
|
|
4
|
+
>;
|
|
5
|
+
|
|
6
|
+
export interface AntLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
prefixCls?: string;
|
|
8
|
+
suffixCls?: string;
|
|
9
|
+
/**
|
|
10
|
+
* ClassName on the root element
|
|
11
|
+
*/
|
|
12
|
+
rootClassName?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering
|
|
15
|
+
*/
|
|
16
|
+
hasSider?: boolean;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* The additional css class
|
|
20
|
+
*/
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
.nav-card {
|
|
2
|
+
background-color: var(--color-neutral-50);
|
|
3
|
+
border-radius: 5.6px;
|
|
4
|
+
display: flex;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.nav-card__icon {
|
|
8
|
+
background-color: var(--color-gray-500);
|
|
9
|
+
border-bottom-left-radius: 4px;
|
|
10
|
+
border-top-left-radius: 4px;
|
|
11
|
+
color: var(--color-neutral-50);
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
width: 180px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Overriding SVG so you will not have to pass size prop to Icon component. */
|
|
19
|
+
.nav-card__icon svg {
|
|
20
|
+
width: 28px !important;
|
|
21
|
+
height: 28px !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Change bg color based on the class set on .nav-card */
|
|
25
|
+
.nav-card-akinon .nav-card__icon {
|
|
26
|
+
background-color: var(--color-akinon-500);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.nav-card-azure .nav-card__icon {
|
|
30
|
+
background-color: var(--color-azure-500);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.nav-card-blue .nav-card__icon {
|
|
34
|
+
background-color: var(--color-blue-500);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.nav-card-orange .nav-card__icon {
|
|
38
|
+
background-color: var(--color-orange-500);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.nav-card-red .nav-card__icon {
|
|
42
|
+
background-color: var(--color-red-500);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.nav-card-green .nav-card__icon {
|
|
46
|
+
background-color: var(--color-green-500);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.nav-card-pink .nav-card__icon {
|
|
50
|
+
background-color: var(--color-pink-500);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.nav-card-purple .nav-card__icon {
|
|
54
|
+
background-color: var(--color-purple-500);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.nav-card__content {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
align-items: flex-start;
|
|
62
|
+
padding: 24px 16px;
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.nav-card__title {
|
|
67
|
+
color: var(--color-ebonyClay-900);
|
|
68
|
+
font-size: calc(var(--token-fontSize) * 1.28571428571px);
|
|
69
|
+
font-weight: 500;
|
|
70
|
+
margin: 0;
|
|
71
|
+
padding: 0;
|
|
72
|
+
line-height: 1;
|
|
73
|
+
text-decoration: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.nav-card__description {
|
|
77
|
+
color: var(--color-gray-400);
|
|
78
|
+
font-weight: 400;
|
|
79
|
+
margin: 8px 0 0;
|
|
80
|
+
padding: 0;
|
|
81
|
+
line-height: 1.3;
|
|
82
|
+
text-decoration: none;
|
|
83
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import type { NavCardProps } from './types';
|
|
4
|
+
export type { NavCardProps } from './types';
|
|
5
|
+
export declare const NavCard: ({ title, description, icon, variant, className }: NavCardProps) => React.JSX.Element;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/NavCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,OAAO,qDAMjB,YAAY,sBAad,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavCard = void 0;
|
|
4
|
+
require("./index.css");
|
|
5
|
+
const clsx_1 = require("clsx");
|
|
6
|
+
const React = require("react");
|
|
7
|
+
const NavCard = ({ title, description, icon, variant, className }) => {
|
|
8
|
+
const variantClass = variant ? `nav-card-${variant}` : '';
|
|
9
|
+
return (React.createElement("div", { className: (0, clsx_1.default)('nav-card', variantClass, className) },
|
|
10
|
+
icon && React.createElement("div", { className: "nav-card__icon" }, icon),
|
|
11
|
+
React.createElement("div", { className: "nav-card__content" },
|
|
12
|
+
React.createElement("h2", { className: "nav-card__title" }, title),
|
|
13
|
+
React.createElement("div", { className: "nav-card__description" }, description))));
|
|
14
|
+
};
|
|
15
|
+
exports.NavCard = NavCard;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type NavCardColorVariant =
|
|
2
|
+
| 'akinon'
|
|
3
|
+
| 'azure'
|
|
4
|
+
| 'blue'
|
|
5
|
+
| 'orange'
|
|
6
|
+
| 'red'
|
|
7
|
+
| 'green'
|
|
8
|
+
| 'pink'
|
|
9
|
+
| 'purple';
|
|
10
|
+
|
|
11
|
+
export interface NavCardProps {
|
|
12
|
+
/**
|
|
13
|
+
* The title of the NavCard.
|
|
14
|
+
*/
|
|
15
|
+
title: string;
|
|
16
|
+
/**
|
|
17
|
+
* The description of the NavCard.
|
|
18
|
+
*/
|
|
19
|
+
description: string;
|
|
20
|
+
/**
|
|
21
|
+
* The icon of the NavCard.
|
|
22
|
+
*/
|
|
23
|
+
icon?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* The color variant of the NavCard.
|
|
26
|
+
*/
|
|
27
|
+
variant?: NavCardColorVariant;
|
|
28
|
+
/**
|
|
29
|
+
* The additional css class
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import type { PageContentProps } from './types';
|
|
4
|
+
export type { PageContentProps } from './types';
|
|
5
|
+
export declare const PageContent: ({ children, className, ...restProps }: PageContentProps) => React.JSX.Element;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/PageContent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,WAAW,0CAIrB,gBAAgB,sBAIlB,CAAC"}
|
|
@@ -12,10 +12,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.PageContent = void 0;
|
|
15
|
-
require("./
|
|
16
|
-
const
|
|
15
|
+
require("./index.css");
|
|
16
|
+
const clsx_1 = require("clsx");
|
|
17
|
+
const React = require("react");
|
|
17
18
|
const PageContent = (_a) => {
|
|
18
|
-
var { children } = _a,
|
|
19
|
-
return (
|
|
19
|
+
var { children, className } = _a, restProps = __rest(_a, ["children", "className"]);
|
|
20
|
+
return (React.createElement("div", Object.assign({ className: (0, clsx_1.default)('akinon-page-content', className) }, restProps), children));
|
|
20
21
|
};
|
|
21
22
|
exports.PageContent = PageContent;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: space-between;
|
|
5
5
|
align-items: center;
|
|
6
|
-
padding:
|
|
6
|
+
padding: 24px;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.akinon-page-heading__content {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
.akinon-page-heading__title {
|
|
14
14
|
color: var(--color-neutral-50);
|
|
15
|
-
font-size: 1.
|
|
15
|
+
font-size: calc(var(--token-fontSize) * 1.42857142857px);
|
|
16
16
|
font-weight: 700;
|
|
17
17
|
margin: 0;
|
|
18
18
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import type { PageHeadingProps } from './types';
|
|
4
|
+
export type { PageHeadingProps } from './types';
|
|
5
|
+
export declare const PageHeading: ({ title, description, actions, className }: PageHeadingProps) => React.JSX.Element;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/PageHeading/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,WAAW,+CAKrB,gBAAgB,sBAalB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageHeading = void 0;
|
|
4
|
+
require("./index.css");
|
|
5
|
+
const clsx_1 = require("clsx");
|
|
6
|
+
const React = require("react");
|
|
7
|
+
const PageHeading = ({ title, description, actions, className }) => {
|
|
8
|
+
return (React.createElement("div", { className: (0, clsx_1.default)('akinon-page-heading', className) },
|
|
9
|
+
React.createElement("div", { className: "akinon-page-heading__content" },
|
|
10
|
+
React.createElement("h1", { className: "akinon-page-heading__title" }, title),
|
|
11
|
+
description && (React.createElement("p", { className: "akinon-page-heading__description" }, description))),
|
|
12
|
+
actions && React.createElement("div", { className: "akinon-page-heading__actions" }, actions)));
|
|
13
|
+
};
|
|
14
|
+
exports.PageHeading = PageHeading;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface PageHeadingProps {
|
|
2
|
+
/**
|
|
3
|
+
* The title of the PageHeading.
|
|
4
|
+
*/
|
|
5
|
+
title: string;
|
|
6
|
+
/**
|
|
7
|
+
* The description of the PageHeading.
|
|
8
|
+
*/
|
|
9
|
+
description?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The action items of the PageHeading.
|
|
12
|
+
*/
|
|
13
|
+
actions?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* The additional css class
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Header: typeof Header;
|
|
10
|
-
Footer: typeof Footer;
|
|
11
|
-
Content: typeof Content;
|
|
12
|
-
Sider: typeof Sider;
|
|
13
|
-
};
|
|
14
|
-
declare const Layout: CompoundedComponent;
|
|
15
|
-
export type LeftSiderItem = {
|
|
16
|
-
key: string;
|
|
17
|
-
label: string;
|
|
18
|
-
icon?: React.ReactNode;
|
|
19
|
-
className?: string;
|
|
20
|
-
onClick?: () => void;
|
|
21
|
-
children?: LeftSiderItem[];
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
};
|
|
1
|
+
import type { LayoutType } from './types';
|
|
2
|
+
export type { ContentProps } from './Layout/Content/types';
|
|
3
|
+
export type { FooterProps } from './Layout/Footer/types';
|
|
4
|
+
export type { HeaderProps } from './Layout/Header/types';
|
|
5
|
+
export type { LeftSiderItem, SiderProps } from './Layout/Sider/types';
|
|
6
|
+
export type { LayoutProps } from './Layout/types';
|
|
7
|
+
export type { LayoutType } from './types';
|
|
8
|
+
declare const Layout: LayoutType;
|
|
24
9
|
export { Layout };
|
|
25
10
|
export * from './Flex';
|
|
26
11
|
export * from './Grid';
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './
|
|
12
|
+
export * from './NavCard';
|
|
13
|
+
export * from './PageContent';
|
|
14
|
+
export * from './PageHeading';
|
|
30
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,QAAA,MAAM,MAAM,EAAE,UAKZ,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -15,12 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.Layout = void 0;
|
|
18
|
-
require("./index.css");
|
|
19
|
-
const Content_1 = require("./Content");
|
|
20
|
-
const Footer_1 = require("./Footer");
|
|
21
|
-
const Header_1 = require("./Header");
|
|
22
18
|
const Layout_1 = require("./Layout");
|
|
23
|
-
const
|
|
19
|
+
const Content_1 = require("./Layout/Content");
|
|
20
|
+
const Footer_1 = require("./Layout/Footer");
|
|
21
|
+
const Header_1 = require("./Layout/Header");
|
|
22
|
+
const Sider_1 = require("./Layout/Sider");
|
|
24
23
|
const Layout = Object.assign(Layout_1.Layout, {
|
|
25
24
|
Header: Header_1.Header,
|
|
26
25
|
Footer: Footer_1.Footer,
|
|
@@ -28,10 +27,8 @@ const Layout = Object.assign(Layout_1.Layout, {
|
|
|
28
27
|
Sider: Sider_1.Sider
|
|
29
28
|
});
|
|
30
29
|
exports.Layout = Layout;
|
|
31
|
-
// TODO: Rename these files to be lowercase.
|
|
32
|
-
// TODO: Add our file naming conventions to documentation.
|
|
33
30
|
__exportStar(require("./Flex"), exports);
|
|
34
31
|
__exportStar(require("./Grid"), exports);
|
|
35
|
-
__exportStar(require("./
|
|
36
|
-
__exportStar(require("./
|
|
37
|
-
__exportStar(require("./
|
|
32
|
+
__exportStar(require("./NavCard"), exports);
|
|
33
|
+
__exportStar(require("./PageContent"), exports);
|
|
34
|
+
__exportStar(require("./PageHeading"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Layout } from './Layout';
|
|
2
|
+
import { Content } from './Layout/Content';
|
|
3
|
+
import { Footer } from './Layout/Footer';
|
|
4
|
+
import { Header } from './Layout/Header';
|
|
5
|
+
import { Sider } from './Layout/Sider';
|
|
6
|
+
|
|
7
|
+
export type LayoutType = typeof Layout & {
|
|
8
|
+
Header: typeof Header;
|
|
9
|
+
Footer: typeof Footer;
|
|
10
|
+
Content: typeof Content;
|
|
11
|
+
Sider: typeof Sider;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Flex/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,IAAI,mCAAoC,SAAS,sBA4B7D,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { useToken } from '@akinon/ui-theme';
|
|
13
|
+
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
14
|
+
import { ConfigProvider, Flex as AntFlex } from 'antd';
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
export const Flex = (_a) => {
|
|
17
|
+
var { children } = _a, restFlexProps = __rest(_a, ["children"]);
|
|
18
|
+
const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
|
|
19
|
+
const { token, hashId } = useToken();
|
|
20
|
+
//const flexToken = (token as GlobalToken).Flex;
|
|
21
|
+
const useStyle = useStyleRegister({
|
|
22
|
+
token: token,
|
|
23
|
+
path: ['Flex'],
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
theme: theme
|
|
26
|
+
}, () => {
|
|
27
|
+
const prefixCls = `:where(.${hashId}).${getPrefixCls()}-flex`;
|
|
28
|
+
const prefixClsWithoutHash = `.${getPrefixCls()}-flex`;
|
|
29
|
+
return {
|
|
30
|
+
[prefixCls]: {},
|
|
31
|
+
[prefixClsWithoutHash]: {}
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
return useStyle(React.createElement(AntFlex, Object.assign({}, restFlexProps), children));
|
|
35
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type FlexProps = Omit<AntFlexProps, 'prefixCls' | 'style' | 'styles'>;
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
+
export interface AntFlexProps<P = Record<PropertyKey, any>>
|
|
5
|
+
extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
+
prefixCls?: string;
|
|
7
|
+
/**
|
|
8
|
+
* ClassName on the root element
|
|
9
|
+
*/
|
|
10
|
+
rootClassName?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Is direction of the flex vertical, use <code>flex-direction: column</code>
|
|
13
|
+
*/
|
|
14
|
+
vertical?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Set whether the element is displayed in a single line or in multiple lines
|
|
17
|
+
*/
|
|
18
|
+
wrap?: boolean | React.CSSProperties['flexWrap'];
|
|
19
|
+
/**
|
|
20
|
+
* Sets the alignment of elements in the direction of the main axis
|
|
21
|
+
*/
|
|
22
|
+
justify?: React.CSSProperties['justifyContent'];
|
|
23
|
+
/**
|
|
24
|
+
* Sets the alignment of elements in the direction of the cross axis
|
|
25
|
+
*/
|
|
26
|
+
align?: React.CSSProperties['alignItems'];
|
|
27
|
+
/**
|
|
28
|
+
* Flex CSS shorthand properties
|
|
29
|
+
*/
|
|
30
|
+
flex?: React.CSSProperties['flex'];
|
|
31
|
+
/**
|
|
32
|
+
* Sets the gap between grids
|
|
33
|
+
*/
|
|
34
|
+
gap?: React.CSSProperties['gap'] | SizeType;
|
|
35
|
+
children: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Custom element type
|
|
38
|
+
*/
|
|
39
|
+
component?: CustomComponent<P>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
type SizeType = 'small' | 'middle' | 'large' | undefined;
|
|
43
|
+
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
+
type CustomComponent<P = Record<PropertyKey, any>> =
|
|
46
|
+
| React.ComponentType<P>
|
|
47
|
+
| string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ColProps, RowProps } from './types';
|
|
3
|
+
export type { ColProps, RowProps } from './types';
|
|
4
|
+
export declare const Row: ({ children, ...restRowProps }: RowProps) => React.JSX.Element;
|
|
5
|
+
export declare const Col: ({ children, ...restColProps }: ColProps) => React.JSX.Element;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Grid/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAElD,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,GAAG,kCAAmC,QAAQ,sBAkC1D,CAAC;AAEF,eAAO,MAAM,GAAG,kCAAmC,QAAQ,sBA4B1D,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { useToken } from '@akinon/ui-theme';
|
|
13
|
+
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
14
|
+
import { Col as AntCol, ConfigProvider, Row as AntRow } from 'antd';
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
export const Row = (_a) => {
|
|
17
|
+
var { children } = _a, restRowProps = __rest(_a, ["children"]);
|
|
18
|
+
const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
|
|
19
|
+
const { token, hashId } = useToken();
|
|
20
|
+
const gridToken = token.Grid;
|
|
21
|
+
const useStyle = useStyleRegister({
|
|
22
|
+
token: token,
|
|
23
|
+
path: ['Row'],
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
theme: theme
|
|
26
|
+
}, () => {
|
|
27
|
+
const prefixCls = `:where(.${hashId}).${getPrefixCls()}-row`;
|
|
28
|
+
const prefixClsWithoutHash = `.${getPrefixCls()}-row`;
|
|
29
|
+
return {
|
|
30
|
+
[prefixCls]: {
|
|
31
|
+
maxWidth: gridToken === null || gridToken === void 0 ? void 0 : gridToken.rowMaxWidth
|
|
32
|
+
},
|
|
33
|
+
[prefixClsWithoutHash]: {}
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
return useStyle(React.createElement(AntRow, Object.assign({ gutter: [gridToken === null || gridToken === void 0 ? void 0 : gridToken.gutter, gridToken === null || gridToken === void 0 ? void 0 : gridToken.gutter] }, restRowProps), children));
|
|
37
|
+
};
|
|
38
|
+
export const Col = (_a) => {
|
|
39
|
+
var { children } = _a, restColProps = __rest(_a, ["children"]);
|
|
40
|
+
const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
|
|
41
|
+
const { token, hashId } = useToken();
|
|
42
|
+
//const colToken = (token as GlobalToken).Col;
|
|
43
|
+
const useStyle = useStyleRegister({
|
|
44
|
+
token: token,
|
|
45
|
+
path: ['Col'],
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
+
theme: theme
|
|
48
|
+
}, () => {
|
|
49
|
+
const prefixCls = `:where(.${hashId}).${getPrefixCls()}-col`;
|
|
50
|
+
const prefixClsWithoutHash = `.${getPrefixCls()}-col`;
|
|
51
|
+
return {
|
|
52
|
+
[prefixCls]: {},
|
|
53
|
+
[prefixClsWithoutHash]: {}
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
return useStyle(React.createElement(AntCol, Object.assign({}, restColProps), children));
|
|
57
|
+
};
|