@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.
Files changed (161) hide show
  1. package/dist/cjs/Flex/index.d.ts +5 -0
  2. package/dist/cjs/Flex/index.d.ts.map +1 -0
  3. package/dist/cjs/Flex/index.js +39 -0
  4. package/dist/cjs/Flex/types.d.ts +47 -0
  5. package/dist/cjs/Grid/index.d.ts +6 -0
  6. package/dist/cjs/Grid/index.d.ts.map +1 -0
  7. package/dist/cjs/Grid/index.js +62 -0
  8. package/dist/cjs/Grid/types.d.ts +123 -0
  9. package/dist/cjs/Layout/Content/index.d.ts +5 -0
  10. package/dist/cjs/Layout/Content/index.d.ts.map +1 -0
  11. package/dist/cjs/Layout/Content/index.js +40 -0
  12. package/dist/cjs/Layout/Content/types.d.ts +14 -0
  13. package/dist/cjs/Layout/Footer/index.css +3 -0
  14. package/dist/cjs/Layout/Footer/index.d.ts +6 -0
  15. package/dist/cjs/Layout/Footer/index.d.ts.map +1 -0
  16. package/dist/cjs/Layout/Footer/index.js +41 -0
  17. package/dist/cjs/Layout/Footer/types.d.ts +15 -0
  18. package/dist/cjs/Layout/Header/index.css +12 -0
  19. package/dist/cjs/Layout/Header/index.d.ts +6 -0
  20. package/dist/cjs/Layout/Header/index.d.ts.map +1 -0
  21. package/dist/cjs/Layout/Header/index.js +41 -0
  22. package/dist/cjs/Layout/Header/types.d.ts +15 -0
  23. package/dist/cjs/Layout/Sider/index.css +28 -0
  24. package/dist/cjs/Layout/Sider/index.d.ts +6 -0
  25. package/dist/cjs/Layout/Sider/index.d.ts.map +1 -0
  26. package/dist/cjs/Layout/Sider/index.js +49 -0
  27. package/dist/cjs/Layout/Sider/types.d.ts +74 -0
  28. package/dist/cjs/Layout/index.d.ts +5 -0
  29. package/dist/cjs/Layout/index.d.ts.map +1 -0
  30. package/dist/cjs/Layout/index.js +39 -0
  31. package/dist/cjs/Layout/types.d.ts +22 -0
  32. package/dist/cjs/NavCard/index.css +83 -0
  33. package/dist/cjs/NavCard/index.d.ts +6 -0
  34. package/dist/cjs/NavCard/index.d.ts.map +1 -0
  35. package/dist/cjs/NavCard/index.js +15 -0
  36. package/dist/cjs/NavCard/types.d.ts +32 -0
  37. package/dist/cjs/{page-content.css → PageContent/index.css} +1 -1
  38. package/dist/cjs/PageContent/index.d.ts +6 -0
  39. package/dist/cjs/PageContent/index.d.ts.map +1 -0
  40. package/dist/cjs/{page-content.js → PageContent/index.js} +5 -4
  41. package/dist/cjs/PageContent/types.d.ts +3 -0
  42. package/dist/cjs/{page-heading.css → PageHeading/index.css} +2 -2
  43. package/dist/cjs/PageHeading/index.d.ts +6 -0
  44. package/dist/cjs/PageHeading/index.d.ts.map +1 -0
  45. package/dist/cjs/PageHeading/index.js +14 -0
  46. package/dist/cjs/PageHeading/types.d.ts +18 -0
  47. package/dist/cjs/index.d.ts +11 -26
  48. package/dist/cjs/index.d.ts.map +1 -1
  49. package/dist/cjs/index.js +7 -10
  50. package/dist/cjs/types.d.ts +12 -0
  51. package/dist/esm/Flex/index.d.ts +5 -0
  52. package/dist/esm/Flex/index.d.ts.map +1 -0
  53. package/dist/esm/Flex/index.js +35 -0
  54. package/dist/esm/Flex/types.d.ts +47 -0
  55. package/dist/esm/Grid/index.d.ts +6 -0
  56. package/dist/esm/Grid/index.d.ts.map +1 -0
  57. package/dist/esm/Grid/index.js +57 -0
  58. package/dist/esm/Grid/types.d.ts +123 -0
  59. package/dist/esm/Layout/Content/index.d.ts +5 -0
  60. package/dist/esm/Layout/Content/index.d.ts.map +1 -0
  61. package/dist/esm/Layout/Content/index.js +36 -0
  62. package/dist/esm/Layout/Content/types.d.ts +14 -0
  63. package/dist/esm/Layout/Footer/index.css +3 -0
  64. package/dist/esm/Layout/Footer/index.d.ts +6 -0
  65. package/dist/esm/Layout/Footer/index.d.ts.map +1 -0
  66. package/dist/esm/Layout/Footer/index.js +37 -0
  67. package/dist/esm/Layout/Footer/types.d.ts +15 -0
  68. package/dist/esm/Layout/Header/index.css +12 -0
  69. package/dist/esm/Layout/Header/index.d.ts +6 -0
  70. package/dist/esm/Layout/Header/index.d.ts.map +1 -0
  71. package/dist/esm/Layout/Header/index.js +37 -0
  72. package/dist/esm/Layout/Header/types.d.ts +15 -0
  73. package/dist/esm/Layout/Sider/index.css +28 -0
  74. package/dist/esm/Layout/Sider/index.d.ts +6 -0
  75. package/dist/esm/Layout/Sider/index.d.ts.map +1 -0
  76. package/dist/esm/Layout/Sider/index.js +45 -0
  77. package/dist/esm/Layout/Sider/types.d.ts +74 -0
  78. package/dist/esm/Layout/index.d.ts +5 -0
  79. package/dist/esm/Layout/index.d.ts.map +1 -0
  80. package/dist/esm/Layout/index.js +35 -0
  81. package/dist/esm/Layout/types.d.ts +22 -0
  82. package/dist/esm/NavCard/index.css +83 -0
  83. package/dist/esm/NavCard/index.d.ts +6 -0
  84. package/dist/esm/NavCard/index.d.ts.map +1 -0
  85. package/dist/esm/{nav-card.js → NavCard/index.js} +2 -2
  86. package/dist/esm/NavCard/types.d.ts +32 -0
  87. package/dist/esm/{page-content.css → PageContent/index.css} +1 -1
  88. package/dist/esm/PageContent/index.d.ts +6 -0
  89. package/dist/esm/PageContent/index.d.ts.map +1 -0
  90. package/dist/esm/{page-content.js → PageContent/index.js} +5 -4
  91. package/dist/esm/PageContent/types.d.ts +3 -0
  92. package/dist/esm/{page-heading.css → PageHeading/index.css} +2 -2
  93. package/dist/esm/PageHeading/index.d.ts +6 -0
  94. package/dist/esm/PageHeading/index.d.ts.map +1 -0
  95. package/dist/esm/{page-heading.js → PageHeading/index.js} +5 -4
  96. package/dist/esm/PageHeading/types.d.ts +18 -0
  97. package/dist/esm/index.d.ts +11 -26
  98. package/dist/esm/index.d.ts.map +1 -1
  99. package/dist/esm/index.js +7 -10
  100. package/dist/esm/types.d.ts +12 -0
  101. package/package.json +6 -10
  102. package/dist/cjs/Content.d.ts +0 -6
  103. package/dist/cjs/Content.d.ts.map +0 -1
  104. package/dist/cjs/Content.js +0 -9
  105. package/dist/cjs/Flex.d.ts +0 -4
  106. package/dist/cjs/Flex.d.ts.map +0 -1
  107. package/dist/cjs/Flex.js +0 -5
  108. package/dist/cjs/Footer.d.ts +0 -6
  109. package/dist/cjs/Footer.d.ts.map +0 -1
  110. package/dist/cjs/Footer.js +0 -9
  111. package/dist/cjs/Grid.d.ts +0 -4
  112. package/dist/cjs/Grid.d.ts.map +0 -1
  113. package/dist/cjs/Grid.js +0 -6
  114. package/dist/cjs/Header.d.ts +0 -6
  115. package/dist/cjs/Header.d.ts.map +0 -1
  116. package/dist/cjs/Header.js +0 -9
  117. package/dist/cjs/Layout.d.ts +0 -6
  118. package/dist/cjs/Layout.d.ts.map +0 -1
  119. package/dist/cjs/Layout.js +0 -9
  120. package/dist/cjs/Sider.d.ts +0 -12
  121. package/dist/cjs/Sider.d.ts.map +0 -1
  122. package/dist/cjs/Sider.js +0 -18
  123. package/dist/cjs/index.css +0 -49
  124. package/dist/cjs/nav-card.css +0 -83
  125. package/dist/cjs/nav-card.d.ts +0 -12
  126. package/dist/cjs/nav-card.d.ts.map +0 -1
  127. package/dist/cjs/nav-card.js +0 -15
  128. package/dist/cjs/page-content.d.ts +0 -7
  129. package/dist/cjs/page-content.d.ts.map +0 -1
  130. package/dist/cjs/page-heading.d.ts +0 -9
  131. package/dist/cjs/page-heading.d.ts.map +0 -1
  132. package/dist/cjs/page-heading.js +0 -13
  133. package/dist/esm/Content.d.ts +0 -6
  134. package/dist/esm/Content.d.ts.map +0 -1
  135. package/dist/esm/Content.js +0 -5
  136. package/dist/esm/Flex.d.ts +0 -4
  137. package/dist/esm/Flex.d.ts.map +0 -1
  138. package/dist/esm/Flex.js +0 -2
  139. package/dist/esm/Footer.d.ts +0 -6
  140. package/dist/esm/Footer.d.ts.map +0 -1
  141. package/dist/esm/Footer.js +0 -5
  142. package/dist/esm/Grid.d.ts +0 -4
  143. package/dist/esm/Grid.d.ts.map +0 -1
  144. package/dist/esm/Grid.js +0 -2
  145. package/dist/esm/Header.d.ts +0 -6
  146. package/dist/esm/Header.d.ts.map +0 -1
  147. package/dist/esm/Header.js +0 -5
  148. package/dist/esm/Layout.d.ts +0 -6
  149. package/dist/esm/Layout.d.ts.map +0 -1
  150. package/dist/esm/Layout.js +0 -5
  151. package/dist/esm/Sider.d.ts +0 -12
  152. package/dist/esm/Sider.d.ts.map +0 -1
  153. package/dist/esm/Sider.js +0 -14
  154. package/dist/esm/index.css +0 -49
  155. package/dist/esm/nav-card.css +0 -83
  156. package/dist/esm/nav-card.d.ts +0 -12
  157. package/dist/esm/nav-card.d.ts.map +0 -1
  158. package/dist/esm/page-content.d.ts +0 -7
  159. package/dist/esm/page-content.d.ts.map +0 -1
  160. package/dist/esm/page-heading.d.ts +0 -9
  161. package/dist/esm/page-heading.d.ts.map +0 -1
@@ -0,0 +1,123 @@
1
+ export type RowProps = Omit<AntRowProps, 'prefixCls' | 'style' | 'styles'>;
2
+
3
+ export type ColProps = Omit<AntColProps, 'prefixCls' | 'style' | 'styles'>;
4
+
5
+ type ColSpanType = number | string;
6
+
7
+ type FlexType = number | LiteralUnion<'none' | 'auto'>;
8
+
9
+ type LiteralUnion<T extends string> = T | (string & {});
10
+
11
+ export interface ColSize {
12
+ flex?: FlexType;
13
+ span?: number | string;
14
+ order?: number | string;
15
+ offset?: number | string;
16
+ push?: number | string;
17
+ pull?: number | string;
18
+ }
19
+
20
+ export interface AntColProps extends React.HTMLAttributes<HTMLDivElement> {
21
+ /**
22
+ * Flex layout style
23
+ */
24
+ flex?: FlexType;
25
+ /**
26
+ * Raster number of cells to occupy, 0 corresponds to display: none
27
+ */
28
+ span?: number | string;
29
+ /**
30
+ * Raster order
31
+ */
32
+ order?: number | string;
33
+ /**
34
+ * The number of cells to offset Col from the left
35
+ */
36
+ offset?: number | string;
37
+ /**
38
+ * The number of cells that raster is moved to the right
39
+ */
40
+ push?: number | string;
41
+ /**
42
+ * The number of cells that raster is moved to the left
43
+ */
44
+ pull?: number | string;
45
+ /**
46
+ * screen < 576px and also default setting, could be a span value or an object containing above props
47
+ */
48
+ xs?: number | string | ColSize;
49
+ /**
50
+ * screen ≥ 576px, could be a span value or an object containing above props
51
+ */
52
+ sm?: number | string | ColSize;
53
+ /**
54
+ * screen ≥ 768px, could be a span value or an object containing above props
55
+ */
56
+ md?: number | string | ColSize;
57
+ /**
58
+ * screen ≥ 992px, could be a span value or an object containing above props
59
+ */
60
+ lg?: number | string | ColSize;
61
+ /**
62
+ * screen ≥ 1200px, could be a span value or an object containing above props
63
+ */
64
+ xl?: number | string | ColSize;
65
+ /**
66
+ * screen ≥ 1600px, could be a span value or an object containing above props
67
+ */
68
+ xxl?: number | string | ColSize;
69
+ prefixCls?: string;
70
+ }
71
+
72
+ export declare const Col: React.ForwardRefExoticComponent<
73
+ ColProps & React.RefAttributes<HTMLDivElement>
74
+ >;
75
+
76
+ type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
77
+
78
+ declare const RowAligns: readonly ['top', 'middle', 'bottom', 'stretch'];
79
+
80
+ declare const RowJustify: readonly [
81
+ 'start',
82
+ 'end',
83
+ 'center',
84
+ 'space-around',
85
+ 'space-between',
86
+ 'space-evenly'
87
+ ];
88
+
89
+ type Responsive = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
90
+
91
+ type ResponsiveLike<T> = {
92
+ [key in Responsive]?: T;
93
+ };
94
+
95
+ export type Gutter = number | undefined | Partial<Record<Breakpoint, number>>;
96
+
97
+ type ResponsiveAligns = ResponsiveLike<(typeof RowAligns)[number]>;
98
+
99
+ type ResponsiveJustify = ResponsiveLike<(typeof RowJustify)[number]>;
100
+
101
+ export interface AntRowProps extends React.HTMLAttributes<HTMLDivElement> {
102
+ /**
103
+ * Spacing between grids, could be a number or a object like { xs: 8, sm: 16, md: 24}. Or you can use array to make horizontal and vertical spacing work at the same time <code>[horizontal, vertical]</code>
104
+ */
105
+ gutter?: Gutter | [Gutter, Gutter];
106
+ /**
107
+ * Vertical alignment
108
+ */
109
+ align?: 'top' | 'middle' | 'bottom' | 'stretch' | ResponsiveAligns;
110
+ /**
111
+ * Horizontal arrangement
112
+ */
113
+ justify?: (typeof RowJustify)[number] | ResponsiveJustify;
114
+ prefixCls?: string;
115
+ /**
116
+ * Auto wrap line
117
+ */
118
+ wrap?: boolean;
119
+ }
120
+
121
+ export declare const Row: React.ForwardRefExoticComponent<
122
+ RowProps & React.RefAttributes<HTMLDivElement>
123
+ >;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import type { ContentProps } from './types';
3
+ export type { ContentProps } from './types';
4
+ export declare const Content: ({ children, ...restContentProps }: ContentProps) => React.JSX.Element;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Layout/Content/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,eAAO,MAAM,OAAO,sCAAuC,YAAY,sBA4BtE,CAAC"}
@@ -0,0 +1,36 @@
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, Layout as AntLayout } from 'antd';
15
+ import * as React from 'react';
16
+ const { Content: AntContent } = AntLayout;
17
+ export const Content = (_a) => {
18
+ var { children } = _a, restContentProps = __rest(_a, ["children"]);
19
+ const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
20
+ const { token, hashId } = useToken();
21
+ //const layoutToken = (token as GlobalToken).Layout;
22
+ const useStyle = useStyleRegister({
23
+ token: token,
24
+ path: ['Content'],
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
+ theme: theme
27
+ }, () => {
28
+ const prefixCls = `:where(.${hashId}).${getPrefixCls()}-content`;
29
+ const prefixClsWithoutHash = `.${getPrefixCls()}-content`;
30
+ return {
31
+ [prefixCls]: {},
32
+ [prefixClsWithoutHash]: {}
33
+ };
34
+ });
35
+ return useStyle(React.createElement(AntContent, Object.assign({}, restContentProps), children));
36
+ };
@@ -0,0 +1,14 @@
1
+ export type ContentProps = Omit<
2
+ AntContentProps,
3
+ 'prefixCls' | 'suffixCls' | 'style' | 'styles'
4
+ >;
5
+
6
+ export type AntContentProps = AntContentBasicProps &
7
+ React.RefAttributes<HTMLElement>;
8
+
9
+ interface AntContentBasicProps extends React.HTMLAttributes<HTMLDivElement> {
10
+ prefixCls?: string;
11
+ suffixCls?: string;
12
+ rootClassName?: string;
13
+ hasSider?: boolean;
14
+ }
@@ -0,0 +1,3 @@
1
+ .akinon-layout-footer {
2
+ text-align: center;
3
+ }
@@ -0,0 +1,6 @@
1
+ import './index.css';
2
+ import * as React from 'react';
3
+ import type { FooterProps } from './types';
4
+ export type { FooterProps } from './types';
5
+ export declare const Footer: ({ children, ...restFooterProps }: FooterProps) => React.JSX.Element;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Layout/Footer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAKrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAI3C,eAAO,MAAM,MAAM,qCAAsC,WAAW,sBA4BnE,CAAC"}
@@ -0,0 +1,37 @@
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 './index.css';
13
+ import { useToken } from '@akinon/ui-theme';
14
+ import { useStyleRegister } from '@ant-design/cssinjs';
15
+ import { ConfigProvider, Layout as AntLayout } from 'antd';
16
+ import * as React from 'react';
17
+ const { Footer: AntFooter } = AntLayout;
18
+ export const Footer = (_a) => {
19
+ var { children } = _a, restFooterProps = __rest(_a, ["children"]);
20
+ const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
21
+ const { token, hashId } = useToken();
22
+ //const layoutToken = (token as GlobalToken).Layout;
23
+ const useStyle = useStyleRegister({
24
+ token: token,
25
+ path: ['Footer'],
26
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
+ theme: theme
28
+ }, () => {
29
+ const prefixCls = `:where(.${hashId}).${getPrefixCls()}-footer`;
30
+ const prefixClsWithoutHash = `.${getPrefixCls()}-footer`;
31
+ return {
32
+ [prefixCls]: {},
33
+ [prefixClsWithoutHash]: {}
34
+ };
35
+ });
36
+ return useStyle(React.createElement(AntFooter, Object.assign({}, restFooterProps), children));
37
+ };
@@ -0,0 +1,15 @@
1
+ export type FooterProps = Omit<
2
+ AntFooterProps,
3
+ 'prefixCls' | 'suffixCls' | 'style' | 'styles'
4
+ >;
5
+
6
+ export type AntFooterProps = AntFooterBasicProps &
7
+ React.RefAttributes<HTMLElement>;
8
+
9
+ interface AntFooterBasicProps extends React.HTMLAttributes<HTMLDivElement> {
10
+ prefixCls?: string;
11
+ suffixCls?: string;
12
+ rootClassName?: string;
13
+ hasSider?: boolean;
14
+ children: React.ReactNode;
15
+ }
@@ -0,0 +1,12 @@
1
+ .akinon-layout-header {
2
+ padding-inline: 1rem;
3
+ height: 3.5rem;
4
+ border-bottom: 1px solid var(--color-gray-900);
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: space-between;
8
+ line-height: unset;
9
+ position: sticky;
10
+ top: 0;
11
+ z-index: 999;
12
+ }
@@ -0,0 +1,6 @@
1
+ import './index.css';
2
+ import * as React from 'react';
3
+ import type { HeaderProps } from './types';
4
+ export type { HeaderProps } from './types';
5
+ export declare const Header: ({ children, ...restHeaderProps }: HeaderProps) => React.JSX.Element;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Layout/Header/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAKrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAI3C,eAAO,MAAM,MAAM,qCAAsC,WAAW,sBA4BnE,CAAC"}
@@ -0,0 +1,37 @@
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 './index.css';
13
+ import { useToken } from '@akinon/ui-theme';
14
+ import { useStyleRegister } from '@ant-design/cssinjs';
15
+ import { ConfigProvider, Layout as AntLayout } from 'antd';
16
+ import * as React from 'react';
17
+ const { Header: AntHeader } = AntLayout;
18
+ export const Header = (_a) => {
19
+ var { children } = _a, restHeaderProps = __rest(_a, ["children"]);
20
+ const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
21
+ const { token, hashId } = useToken();
22
+ //const layoutToken = (token as GlobalToken).Layout;
23
+ const useStyle = useStyleRegister({
24
+ token: token,
25
+ path: ['Header'],
26
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
+ theme: theme
28
+ }, () => {
29
+ const prefixCls = `:where(.${hashId}).${getPrefixCls()}-header`;
30
+ const prefixClsWithoutHash = `.${getPrefixCls()}-header`;
31
+ return {
32
+ [prefixCls]: {},
33
+ [prefixClsWithoutHash]: {}
34
+ };
35
+ });
36
+ return useStyle(React.createElement(AntHeader, Object.assign({}, restHeaderProps), children));
37
+ };
@@ -0,0 +1,15 @@
1
+ export type HeaderProps = Omit<
2
+ AntHeaderProps,
3
+ 'prefixCls' | 'suffixCls' | 'style' | 'styles'
4
+ >;
5
+
6
+ export type AntHeaderProps = AntHeaderBasicProps &
7
+ React.RefAttributes<HTMLElement>;
8
+
9
+ interface AntHeaderBasicProps extends React.HTMLAttributes<HTMLDivElement> {
10
+ prefixCls?: string;
11
+ suffixCls?: string;
12
+ rootClassName?: string;
13
+ hasSider?: boolean;
14
+ children: React.ReactNode;
15
+ }
@@ -0,0 +1,28 @@
1
+ .akinon-layout-sider {
2
+ position: sticky;
3
+ top: 0;
4
+ height: 100vh;
5
+ overflow-y: auto;
6
+ }
7
+
8
+ .akinon-layout-sider.left {
9
+ inset-inline-start: 0;
10
+ }
11
+
12
+ .akinon-layout-sider.right {
13
+ inset-inline-end: 0;
14
+ }
15
+
16
+ .akinon-layout-sider .logo-container {
17
+ display: flex;
18
+ flex-direction: row;
19
+ justify-content: center;
20
+ align-items: center;
21
+ height: 3.5rem;
22
+ gap: 0.8rem;
23
+ /* border-bottom: 1px solid var(--color-gray-900); */
24
+ }
25
+
26
+ .akinon-layout-sider .logo-container.collapsed .brand-image {
27
+ display: none;
28
+ }
@@ -0,0 +1,6 @@
1
+ import './index.css';
2
+ import * as React from 'react';
3
+ import type { SiderProps } from './types';
4
+ export type { LeftSiderItem, SiderProps } from './types';
5
+ export declare const Sider: ({ children, collapsed, iconUrl, brandImageUrl, ...restSiderProps }: SiderProps) => React.JSX.Element;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Layout/Sider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAKrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIzD,eAAO,MAAM,KAAK,uEAMf,UAAU,sBAuDZ,CAAC"}
@@ -0,0 +1,45 @@
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 './index.css';
13
+ import { useToken } from '@akinon/ui-theme';
14
+ import { useStyleRegister } from '@ant-design/cssinjs';
15
+ import { ConfigProvider, Layout as AntLayout } from 'antd';
16
+ import * as React from 'react';
17
+ const { Sider: AntSider } = AntLayout;
18
+ export const Sider = (_a) => {
19
+ var { children, collapsed, iconUrl, brandImageUrl } = _a, restSiderProps = __rest(_a, ["children", "collapsed", "iconUrl", "brandImageUrl"]);
20
+ const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
21
+ const { token, hashId } = useToken();
22
+ //const layoutToken = (token as GlobalToken).Layout;
23
+ const useStyle = useStyleRegister({
24
+ token: token,
25
+ path: ['Sider'],
26
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
+ theme: theme
28
+ }, () => {
29
+ const prefixCls = `:where(.${hashId}).${getPrefixCls()}-sider`;
30
+ const prefixClsWithoutHash = `.${getPrefixCls()}-sider`;
31
+ return {
32
+ [prefixCls]: {},
33
+ [prefixClsWithoutHash]: {}
34
+ };
35
+ });
36
+ let LogoContainer;
37
+ if (iconUrl && brandImageUrl) {
38
+ LogoContainer = (React.createElement("div", { className: `logo-container ${collapsed ? 'collapsed' : ''}` },
39
+ React.createElement("img", { className: "logo", src: iconUrl, alt: "icon", width: 20, height: 20 }),
40
+ React.createElement("img", { className: "brand-image", src: brandImageUrl, alt: "brand-image", height: 20 })));
41
+ }
42
+ return useStyle(React.createElement(AntSider, Object.assign({ collapsible: true, collapsed: collapsed, trigger: null, width: 250 }, restSiderProps),
43
+ LogoContainer,
44
+ children));
45
+ };
@@ -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,5 @@
1
+ import * as React from 'react';
2
+ import type { LayoutProps } from './types';
3
+ export type { LayoutProps } from './types';
4
+ export declare const Layout: ({ children, ...restLayoutProps }: LayoutProps) => React.JSX.Element;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -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,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, Layout as AntLayout } from 'antd';
15
+ import * as React from 'react';
16
+ export const Layout = (_a) => {
17
+ var { children } = _a, restLayoutProps = __rest(_a, ["children"]);
18
+ const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
19
+ const { token, hashId } = useToken();
20
+ //const layoutToken = (token as GlobalToken).Layout;
21
+ const useStyle = useStyleRegister({
22
+ token: token,
23
+ path: ['Layout'],
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ theme: theme
26
+ }, () => {
27
+ const prefixCls = `:where(.${hashId}).${getPrefixCls()}-layout`;
28
+ const prefixClsWithoutHash = `.${getPrefixCls()}-layout`;
29
+ return {
30
+ [prefixCls]: {},
31
+ [prefixClsWithoutHash]: {}
32
+ };
33
+ });
34
+ return useStyle(React.createElement(AntLayout, Object.assign({}, restLayoutProps), children));
35
+ };
@@ -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"}
@@ -1,6 +1,6 @@
1
- import './nav-card.css';
1
+ import './index.css';
2
2
  import clsx from 'clsx';
3
- import React from 'react';
3
+ import * as React from 'react';
4
4
  export const NavCard = ({ title, description, icon, variant, className }) => {
5
5
  const variantClass = variant ? `nav-card-${variant}` : '';
6
6
  return (React.createElement("div", { className: clsx('nav-card', variantClass, className) },