@akinon/ui-layout 0.6.0 → 1.0.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 (83) hide show
  1. package/dist/cjs/Flex/index.d.ts +12 -1
  2. package/dist/cjs/Flex/index.d.ts.map +1 -1
  3. package/dist/cjs/Flex/index.js +11 -0
  4. package/dist/cjs/Flex/types.d.ts +12 -3
  5. package/dist/cjs/Grid/index.d.ts +23 -0
  6. package/dist/cjs/Grid/index.d.ts.map +1 -1
  7. package/dist/cjs/Grid/index.js +23 -0
  8. package/dist/cjs/Grid/types.d.ts +14 -2
  9. package/dist/cjs/Layout/Content/index.d.ts +8 -0
  10. package/dist/cjs/Layout/Content/index.d.ts.map +1 -1
  11. package/dist/cjs/Layout/Content/index.js +8 -0
  12. package/dist/cjs/Layout/Content/types.d.ts +15 -0
  13. package/dist/cjs/Layout/Footer/index.d.ts +5 -0
  14. package/dist/cjs/Layout/Footer/index.d.ts.map +1 -1
  15. package/dist/cjs/Layout/Footer/index.js +5 -0
  16. package/dist/cjs/Layout/Footer/types.d.ts +28 -0
  17. package/dist/cjs/Layout/Header/index.d.ts +7 -0
  18. package/dist/cjs/Layout/Header/index.d.ts.map +1 -1
  19. package/dist/cjs/Layout/Header/index.js +7 -0
  20. package/dist/cjs/Layout/Header/types.d.ts +23 -0
  21. package/dist/cjs/Layout/Sider/index.css +8 -2
  22. package/dist/cjs/Layout/Sider/index.d.ts +24 -1
  23. package/dist/cjs/Layout/Sider/index.d.ts.map +1 -1
  24. package/dist/cjs/Layout/Sider/index.js +36 -6
  25. package/dist/cjs/Layout/Sider/types.d.ts +61 -1
  26. package/dist/cjs/Layout/index.d.ts +6 -0
  27. package/dist/cjs/Layout/index.d.ts.map +1 -1
  28. package/dist/cjs/Layout/index.js +6 -0
  29. package/dist/cjs/Layout/types.d.ts +14 -4
  30. package/dist/cjs/NavCard/index.d.ts +24 -0
  31. package/dist/cjs/NavCard/index.d.ts.map +1 -1
  32. package/dist/cjs/NavCard/index.js +24 -0
  33. package/dist/cjs/NavCard/types.d.ts +4 -0
  34. package/dist/cjs/PageContent/index.d.ts +4 -2
  35. package/dist/cjs/PageContent/index.d.ts.map +1 -1
  36. package/dist/cjs/PageContent/index.js +5 -4
  37. package/dist/cjs/PageContent/types.d.ts +9 -1
  38. package/dist/cjs/PageHeading/index.d.ts +5 -2
  39. package/dist/cjs/PageHeading/index.d.ts.map +1 -1
  40. package/dist/cjs/PageHeading/index.js +13 -7
  41. package/dist/cjs/PageHeading/types.d.ts +4 -1
  42. package/dist/esm/Flex/index.d.ts +12 -1
  43. package/dist/esm/Flex/index.d.ts.map +1 -1
  44. package/dist/esm/Flex/index.js +11 -0
  45. package/dist/esm/Flex/types.d.ts +12 -3
  46. package/dist/esm/Grid/index.d.ts +23 -0
  47. package/dist/esm/Grid/index.d.ts.map +1 -1
  48. package/dist/esm/Grid/index.js +23 -0
  49. package/dist/esm/Grid/types.d.ts +14 -2
  50. package/dist/esm/Layout/Content/index.d.ts +8 -0
  51. package/dist/esm/Layout/Content/index.d.ts.map +1 -1
  52. package/dist/esm/Layout/Content/index.js +8 -0
  53. package/dist/esm/Layout/Content/types.d.ts +15 -0
  54. package/dist/esm/Layout/Footer/index.d.ts +5 -0
  55. package/dist/esm/Layout/Footer/index.d.ts.map +1 -1
  56. package/dist/esm/Layout/Footer/index.js +5 -0
  57. package/dist/esm/Layout/Footer/types.d.ts +28 -0
  58. package/dist/esm/Layout/Header/index.d.ts +7 -0
  59. package/dist/esm/Layout/Header/index.d.ts.map +1 -1
  60. package/dist/esm/Layout/Header/index.js +7 -0
  61. package/dist/esm/Layout/Header/types.d.ts +23 -0
  62. package/dist/esm/Layout/Sider/index.css +8 -2
  63. package/dist/esm/Layout/Sider/index.d.ts +24 -1
  64. package/dist/esm/Layout/Sider/index.d.ts.map +1 -1
  65. package/dist/esm/Layout/Sider/index.js +36 -6
  66. package/dist/esm/Layout/Sider/types.d.ts +61 -1
  67. package/dist/esm/Layout/index.d.ts +6 -0
  68. package/dist/esm/Layout/index.d.ts.map +1 -1
  69. package/dist/esm/Layout/index.js +6 -0
  70. package/dist/esm/Layout/types.d.ts +14 -4
  71. package/dist/esm/NavCard/index.d.ts +24 -0
  72. package/dist/esm/NavCard/index.d.ts.map +1 -1
  73. package/dist/esm/NavCard/index.js +24 -0
  74. package/dist/esm/NavCard/types.d.ts +4 -0
  75. package/dist/esm/PageContent/index.d.ts +4 -2
  76. package/dist/esm/PageContent/index.d.ts.map +1 -1
  77. package/dist/esm/PageContent/index.js +5 -4
  78. package/dist/esm/PageContent/types.d.ts +9 -1
  79. package/dist/esm/PageHeading/index.d.ts +5 -2
  80. package/dist/esm/PageHeading/index.d.ts.map +1 -1
  81. package/dist/esm/PageHeading/index.js +13 -7
  82. package/dist/esm/PageHeading/types.d.ts +4 -1
  83. package/package.json +5 -5
@@ -1,5 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import type { ContentProps } from './types';
3
3
  export type { ContentProps } from './types';
4
+ /**
5
+ * `Content` is a layout component designed for the main content area of an application or page.
6
+ *
7
+ * ### Features:
8
+ * - **Custom Styling:** Easily apply custom styles using `prefixCls`, `suffixCls`, or `rootClassName`.
9
+ * - **Responsive Design:** Automatically adjusts based on the presence of a `Sider`.
10
+ * - **Structure:** Works seamlessly with other layout components such as `Header`, `Footer`, and `Sider`.
11
+ */
4
12
  export declare const Content: ({ children, ...restContentProps }: ContentProps) => React.JSX.Element;
5
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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;;;;;;;GAOG;AAEH,eAAO,MAAM,OAAO,sCAAuC,YAAY,sBA4BtE,CAAC"}
@@ -14,6 +14,14 @@ import { useStyleRegister } from '@ant-design/cssinjs';
14
14
  import { ConfigProvider, Layout as AntLayout } from 'antd';
15
15
  import * as React from 'react';
16
16
  const { Content: AntContent } = AntLayout;
17
+ /**
18
+ * `Content` is a layout component designed for the main content area of an application or page.
19
+ *
20
+ * ### Features:
21
+ * - **Custom Styling:** Easily apply custom styles using `prefixCls`, `suffixCls`, or `rootClassName`.
22
+ * - **Responsive Design:** Automatically adjusts based on the presence of a `Sider`.
23
+ * - **Structure:** Works seamlessly with other layout components such as `Header`, `Footer`, and `Sider`.
24
+ */
17
25
  export const Content = (_a) => {
18
26
  var { children } = _a, restContentProps = __rest(_a, ["children"]);
19
27
  const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
@@ -7,8 +7,23 @@ export type AntContentProps = AntContentBasicProps &
7
7
  React.RefAttributes<HTMLElement>;
8
8
 
9
9
  interface AntContentBasicProps extends React.HTMLAttributes<HTMLDivElement> {
10
+ /**
11
+ * Prefix class for custom styling.
12
+ */
10
13
  prefixCls?: string;
14
+
15
+ /**
16
+ * Suffix class for custom styling.
17
+ */
11
18
  suffixCls?: string;
19
+
20
+ /**
21
+ * Class name for the root element.
22
+ */
12
23
  rootClassName?: string;
24
+
25
+ /**
26
+ * Indicates if the layout contains a sider.
27
+ */
13
28
  hasSider?: boolean;
14
29
  }
@@ -2,5 +2,10 @@ import './index.css';
2
2
  import * as React from 'react';
3
3
  import type { FooterProps } from './types';
4
4
  export type { FooterProps } from './types';
5
+ /**
6
+ * Footer component, which serves as the bottom section of a layout.
7
+ * It provides a consistent structure for displaying additional
8
+ * information, links, or branding at the end of the page.
9
+ */
5
10
  export declare const Footer: ({ children, ...restFooterProps }: FooterProps) => React.JSX.Element;
6
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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;;;;GAIG;AAEH,eAAO,MAAM,MAAM,qCAAsC,WAAW,sBA4BnE,CAAC"}
@@ -15,6 +15,11 @@ import { useStyleRegister } from '@ant-design/cssinjs';
15
15
  import { ConfigProvider, Layout as AntLayout } from 'antd';
16
16
  import * as React from 'react';
17
17
  const { Footer: AntFooter } = AntLayout;
18
+ /**
19
+ * Footer component, which serves as the bottom section of a layout.
20
+ * It provides a consistent structure for displaying additional
21
+ * information, links, or branding at the end of the page.
22
+ */
18
23
  export const Footer = (_a) => {
19
24
  var { children } = _a, restFooterProps = __rest(_a, ["children"]);
20
25
  const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
@@ -1,15 +1,43 @@
1
+ /**
2
+ * Props for the Footer component, excluding specific attributes from AntFooterProps.
3
+ */
1
4
  export type FooterProps = Omit<
2
5
  AntFooterProps,
3
6
  'prefixCls' | 'suffixCls' | 'style' | 'styles'
4
7
  >;
5
8
 
9
+ /**
10
+ * Combined type for Footer props with React reference attributes.
11
+ */
6
12
  export type AntFooterProps = AntFooterBasicProps &
7
13
  React.RefAttributes<HTMLElement>;
8
14
 
15
+ /**
16
+ * Basic props for the Footer component.
17
+ */
9
18
  interface AntFooterBasicProps extends React.HTMLAttributes<HTMLDivElement> {
19
+ /**
20
+ * Prefix class for custom styling.
21
+ */
10
22
  prefixCls?: string;
23
+
24
+ /**
25
+ * Suffix class for additional customization.
26
+ */
11
27
  suffixCls?: string;
28
+
29
+ /**
30
+ * Root class name for the Footer component.
31
+ */
12
32
  rootClassName?: string;
33
+
34
+ /**
35
+ * Indicates whether the layout contains a Sider component.
36
+ */
13
37
  hasSider?: boolean;
38
+
39
+ /**
40
+ * Content to be displayed inside the Footer.
41
+ */
14
42
  children: React.ReactNode;
15
43
  }
@@ -2,5 +2,12 @@ import './index.css';
2
2
  import * as React from 'react';
3
3
  import type { HeaderProps } from './types';
4
4
  export type { HeaderProps } from './types';
5
+ /**
6
+ * Header component, which serves as the top section of a layout.
7
+ * It provides a consistent structure for navigation, branding, or additional controls at the top of the page.
8
+ *
9
+ * This component is part of the Layout system and is typically used alongside other Layout components
10
+ * such as Footer, Sider, and Content to build a structured page layout.
11
+ */
5
12
  export declare const Header: ({ children, ...restHeaderProps }: HeaderProps) => React.JSX.Element;
6
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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;;;;;;GAMG;AAEH,eAAO,MAAM,MAAM,qCAAsC,WAAW,sBA4BnE,CAAC"}
@@ -15,6 +15,13 @@ import { useStyleRegister } from '@ant-design/cssinjs';
15
15
  import { ConfigProvider, Layout as AntLayout } from 'antd';
16
16
  import * as React from 'react';
17
17
  const { Header: AntHeader } = AntLayout;
18
+ /**
19
+ * Header component, which serves as the top section of a layout.
20
+ * It provides a consistent structure for navigation, branding, or additional controls at the top of the page.
21
+ *
22
+ * This component is part of the Layout system and is typically used alongside other Layout components
23
+ * such as Footer, Sider, and Content to build a structured page layout.
24
+ */
18
25
  export const Header = (_a) => {
19
26
  var { children } = _a, restHeaderProps = __rest(_a, ["children"]);
20
27
  const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Header component, which serves as the top section of a layout.
3
+ * It provides a consistent structure for navigation, branding, or additional controls at the top of the page.
4
+ */
1
5
  export type HeaderProps = Omit<
2
6
  AntHeaderProps,
3
7
  'prefixCls' | 'suffixCls' | 'style' | 'styles'
@@ -7,9 +11,28 @@ export type AntHeaderProps = AntHeaderBasicProps &
7
11
  React.RefAttributes<HTMLElement>;
8
12
 
9
13
  interface AntHeaderBasicProps extends React.HTMLAttributes<HTMLDivElement> {
14
+ /**
15
+ * Prefix class for custom styling.
16
+ */
10
17
  prefixCls?: string;
18
+
19
+ /**
20
+ * Suffix class for custom styling.
21
+ */
11
22
  suffixCls?: string;
23
+
24
+ /**
25
+ * Root class name for the component.
26
+ */
12
27
  rootClassName?: string;
28
+
29
+ /**
30
+ * Indicates if the layout has a sider.
31
+ */
13
32
  hasSider?: boolean;
33
+
34
+ /**
35
+ * The children elements to render within the header.
36
+ */
14
37
  children: React.ReactNode;
15
38
  }
@@ -1,7 +1,7 @@
1
1
  .akinon-layout-sider {
2
2
  position: sticky;
3
3
  top: 0;
4
- height: 100vh;
4
+ height: 100svh;
5
5
  overflow-y: auto;
6
6
  }
7
7
 
@@ -16,13 +16,19 @@
16
16
  .akinon-layout-sider .logo-container {
17
17
  display: flex;
18
18
  flex-direction: row;
19
- justify-content: center;
20
19
  align-items: center;
21
20
  height: 3.5rem;
22
21
  gap: 0.8rem;
22
+ background-color: var(--color-ebonyClay-600);
23
+ padding-inline: 1.5rem;
23
24
  /* border-bottom: 1px solid var(--color-gray-900); */
24
25
  }
25
26
 
27
+ .akinon-layout-sider .logo-container.collapsed {
28
+ justify-content: center;
29
+ padding-inline: 1rem;
30
+ }
31
+
26
32
  .akinon-layout-sider .logo-container.collapsed .brand-image {
27
33
  display: none;
28
34
  }
@@ -2,5 +2,28 @@ import './index.css';
2
2
  import * as React from 'react';
3
3
  import type { SiderProps } from './types';
4
4
  export type { LeftSiderItem, SiderProps } from './types';
5
- export declare const Sider: ({ children, collapsed, iconUrl, brandImageUrl, ...restSiderProps }: SiderProps) => React.JSX.Element;
5
+ /**
6
+ * Sider component for building collapsible sidebars in user interfaces.
7
+ *
8
+ * The Sider component is designed to provide a flexible and customizable sidebar
9
+ * that integrates seamlessly with layouts, menus, and responsive designs.
10
+ *
11
+ * Features:
12
+ * - **Collapsible**: Option to collapse the sidebar manually or automatically.
13
+ * - **Custom Triggers**: Supports custom triggers or hiding the trigger altogether.
14
+ * - **Width Options**: Configure both default and collapsed widths.
15
+ * - **Responsive Breakpoints**: Adjusts behavior based on predefined screen sizes.
16
+ * - **Theming**: Offers `light` and `dark` themes to match application aesthetics.
17
+ * - **Callbacks**:
18
+ * - `onCollapse`: Triggered when the sidebar is collapsed or expanded.
19
+ * - `onBreakpoint`: Triggered when responsive breakpoints are reached.
20
+ * - **Custom Styling**:
21
+ * - `className` for additional styling.
22
+ * - `zeroWidthTriggerStyle` for styling triggers when the collapsed width is zero.
23
+ * - `brandImageUrl` and `iconUrl` for branding and visual customization.
24
+ *
25
+ * Ideal for dashboards, navigation menus, and applications requiring collapsible or responsive side navigation.
26
+ *
27
+ */
28
+ export declare const Sider: ({ children, collapsed, iconUrl, brandImageUrl, position, ...restSiderProps }: SiderProps) => React.JSX.Element;
6
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,eAAO,MAAM,KAAK,iFAOf,UAAU,sBAgEZ,CAAC"}
@@ -15,21 +15,51 @@ import { useStyleRegister } from '@ant-design/cssinjs';
15
15
  import { ConfigProvider, Layout as AntLayout } from 'antd';
16
16
  import * as React from 'react';
17
17
  const { Sider: AntSider } = AntLayout;
18
+ /**
19
+ * Sider component for building collapsible sidebars in user interfaces.
20
+ *
21
+ * The Sider component is designed to provide a flexible and customizable sidebar
22
+ * that integrates seamlessly with layouts, menus, and responsive designs.
23
+ *
24
+ * Features:
25
+ * - **Collapsible**: Option to collapse the sidebar manually or automatically.
26
+ * - **Custom Triggers**: Supports custom triggers or hiding the trigger altogether.
27
+ * - **Width Options**: Configure both default and collapsed widths.
28
+ * - **Responsive Breakpoints**: Adjusts behavior based on predefined screen sizes.
29
+ * - **Theming**: Offers `light` and `dark` themes to match application aesthetics.
30
+ * - **Callbacks**:
31
+ * - `onCollapse`: Triggered when the sidebar is collapsed or expanded.
32
+ * - `onBreakpoint`: Triggered when responsive breakpoints are reached.
33
+ * - **Custom Styling**:
34
+ * - `className` for additional styling.
35
+ * - `zeroWidthTriggerStyle` for styling triggers when the collapsed width is zero.
36
+ * - `brandImageUrl` and `iconUrl` for branding and visual customization.
37
+ *
38
+ * Ideal for dashboards, navigation menus, and applications requiring collapsible or responsive side navigation.
39
+ *
40
+ */
18
41
  export const Sider = (_a) => {
19
- var { children, collapsed, iconUrl, brandImageUrl } = _a, restSiderProps = __rest(_a, ["children", "collapsed", "iconUrl", "brandImageUrl"]);
42
+ var { children, collapsed, iconUrl, brandImageUrl, position = 'left' } = _a, restSiderProps = __rest(_a, ["children", "collapsed", "iconUrl", "brandImageUrl", "position"]);
20
43
  const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
21
44
  const { token, hashId } = useToken();
22
- //const layoutToken = (token as GlobalToken).Layout;
45
+ const layoutToken = token.Layout;
23
46
  const useStyle = useStyleRegister({
24
47
  token: token,
25
48
  path: ['Sider'],
26
49
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
50
  theme: theme
28
51
  }, () => {
29
- const prefixCls = `:where(.${hashId}).${getPrefixCls()}-sider`;
30
- const prefixClsWithoutHash = `.${getPrefixCls()}-sider`;
52
+ const prefixCls = `:where(.${hashId}).${getPrefixCls()}-layout-sider`;
53
+ const prefixClsWithoutHash = `.${getPrefixCls()}-layout-sider`;
31
54
  return {
32
- [prefixCls]: {},
55
+ [prefixCls]: {
56
+ '&-left': {
57
+ borderInlineEnd: layoutToken.mainBorder
58
+ },
59
+ '&-right': {
60
+ borderInlineStart: layoutToken.mainBorder
61
+ }
62
+ },
33
63
  [prefixClsWithoutHash]: {}
34
64
  };
35
65
  });
@@ -39,7 +69,7 @@ export const Sider = (_a) => {
39
69
  React.createElement("img", { className: "logo", src: iconUrl, alt: "icon", width: 20, height: 20 }),
40
70
  React.createElement("img", { className: "brand-image", src: brandImageUrl, alt: "brand-image", height: 20 })));
41
71
  }
42
- return useStyle(React.createElement(AntSider, Object.assign({ collapsible: true, collapsed: collapsed, trigger: null, width: 250 }, restSiderProps),
72
+ return useStyle(React.createElement(AntSider, Object.assign({ className: `${getPrefixCls()}-layout-sider-${position}`, collapsible: true, collapsed: collapsed, trigger: null, width: 250, collapsedWidth: 56 }, restSiderProps),
43
73
  LogoContainer,
44
74
  children));
45
75
  };
@@ -1,68 +1,128 @@
1
1
  // TODO integrate with antd menu types
2
+ /**
3
+ * Interface for items within the left sider.
4
+ */
2
5
  export type LeftSiderItem = {
6
+ /**
7
+ * Unique key for the menu item.
8
+ */
3
9
  key: string;
10
+
11
+ /**
12
+ * Display label for the menu item.
13
+ */
4
14
  label: string;
15
+
16
+ /**
17
+ * Optional icon for the menu item.
18
+ */
5
19
  icon?: React.ReactNode;
20
+
21
+ /**
22
+ * Additional CSS class for the menu item.
23
+ */
6
24
  className?: string;
25
+
26
+ /**
27
+ * Callback function triggered when the menu item is clicked.
28
+ */
7
29
  onClick?: () => void;
30
+
31
+ /**
32
+ * Nested children items for creating submenus.
33
+ */
8
34
  children?: LeftSiderItem[];
35
+
36
+ /**
37
+ * Whether the menu item is disabled.
38
+ */
9
39
  disabled?: boolean;
10
40
  };
11
41
 
12
42
  export type SiderProps = Omit<AntSiderProps, 'prefixCls' | 'style' | 'styles'>;
13
43
 
14
44
  export interface AntSiderProps extends React.HTMLAttributes<HTMLDivElement> {
15
- prefixCls?: string;
45
+ /**
46
+ * Sider position for border position.
47
+ * If it is left, the border will be on the right side.
48
+ * Other is other side.
49
+ *
50
+ * @default left
51
+ */
52
+ position?: 'left' | 'right';
53
+
16
54
  /**
17
55
  * Whether can be collapsed
18
56
  */
19
57
  collapsible?: boolean;
58
+
20
59
  /**
21
60
  * To set the current status
22
61
  */
23
62
  collapsed?: boolean;
63
+
24
64
  /**
25
65
  * To set the initial status
26
66
  */
27
67
  defaultCollapsed?: boolean;
68
+
28
69
  /**
29
70
  * Reverse direction of arrow, for a sider that expands from the right
30
71
  */
31
72
  reverseArrow?: boolean;
73
+
32
74
  /**
33
75
  * The callback function, executed by clicking the trigger or activating the responsive layout
34
76
  */
35
77
  onCollapse?: (collapsed: boolean, type: CollapseType) => void;
78
+
36
79
  /**
37
80
  * To customize the styles of the special trigger that appears when <code>collapsedWidth</code> is 0
38
81
  */
39
82
  zeroWidthTriggerStyle?: React.CSSProperties;
83
+
40
84
  /**
41
85
  * Specify the customized trigger, set to null to hide the trigger
42
86
  */
43
87
  trigger?: React.ReactNode;
88
+
44
89
  /**
45
90
  * Width of the sidebar
46
91
  */
47
92
  width?: number | string;
93
+
48
94
  /**
49
95
  * Width of the collapsed sidebar, by setting to 0 a special trigger will appear
50
96
  */
51
97
  collapsedWidth?: number | string;
98
+
52
99
  /**
53
100
  * Breakpoints of the responsive layout
54
101
  */
55
102
  breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
103
+
56
104
  /**
57
105
  * Color theme of the sidebar
58
106
  */
59
107
  theme?: SiderTheme;
108
+
60
109
  /**
61
110
  * The callback function, executed when breakpoints changed
62
111
  */
63
112
  onBreakpoint?: (broken: boolean) => void;
113
+
114
+ /**
115
+ * URL for the sidebar's custom icon. This can be used for branding or visual enhancement.
116
+ * If provided, the icon will be displayed in the sidebar header or a designated area.
117
+ */
64
118
  iconUrl?: string;
119
+
120
+ /**
121
+ * URL for the sidebar's brand image. Typically used to display a logo or branding element in the sidebar.
122
+ * This can enhance the sidebar's appearance and provide a visual identity for the application.
123
+ */
65
124
  brandImageUrl?: string;
125
+
66
126
  /**
67
127
  * The additional css class
68
128
  */
@@ -1,5 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import type { LayoutProps } from './types';
3
3
  export type { LayoutProps } from './types';
4
+ /**
5
+ * Layout component, which acts as the container for building structured page layouts.
6
+ * It provides a framework to integrate Sider, Header, Footer, and Content components cohesively.
7
+ *
8
+ * This component is commonly used in applications to establish a consistent and flexible layout structure.
9
+ */
4
10
  export declare const Layout: ({ children, ...restLayoutProps }: LayoutProps) => React.JSX.Element;
5
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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;;;;;GAKG;AAEH,eAAO,MAAM,MAAM,qCAAsC,WAAW,sBA4BnE,CAAC"}
@@ -13,6 +13,12 @@ import { useToken } from '@akinon/ui-theme';
13
13
  import { useStyleRegister } from '@ant-design/cssinjs';
14
14
  import { ConfigProvider, Layout as AntLayout } from 'antd';
15
15
  import * as React from 'react';
16
+ /**
17
+ * Layout component, which acts as the container for building structured page layouts.
18
+ * It provides a framework to integrate Sider, Header, Footer, and Content components cohesively.
19
+ *
20
+ * This component is commonly used in applications to establish a consistent and flexible layout structure.
21
+ */
16
22
  export const Layout = (_a) => {
17
23
  var { children } = _a, restLayoutProps = __rest(_a, ["children"]);
18
24
  const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
@@ -4,19 +4,29 @@ export type LayoutProps = Omit<
4
4
  >;
5
5
 
6
6
  export interface AntLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
7
- prefixCls?: string;
7
+ /**
8
+ * Suffix class for custom styling.
9
+ */
8
10
  suffixCls?: string;
11
+
9
12
  /**
10
- * ClassName on the root element
13
+ * ClassName on the root element.
11
14
  */
12
15
  rootClassName?: string;
16
+
13
17
  /**
14
- * Whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering
18
+ * Indicates whether the layout contains a Sider component.
19
+ * This property is usually inferred automatically but can be explicitly set to avoid style flickering in SSR scenarios.
15
20
  */
16
21
  hasSider?: boolean;
22
+
23
+ /**
24
+ * The children elements to render within the layout.
25
+ */
17
26
  children: React.ReactNode;
27
+
18
28
  /**
19
- * The additional css class
29
+ * The additional CSS class for styling.
20
30
  */
21
31
  className?: string;
22
32
  }
@@ -2,5 +2,29 @@ import './index.css';
2
2
  import * as React from 'react';
3
3
  import type { NavCardProps } from './types';
4
4
  export type { NavCardProps } from './types';
5
+ /**
6
+ * NavCard component for navigation or highlighting sections in the interface.
7
+ *
8
+ * The NavCard component is designed to provide a visually engaging and functional card
9
+ * that serves as a navigation element or as a callout section in a user interface.
10
+ *
11
+ * Features:
12
+ * - **Title**: A required title to provide the primary context for the NavCard.
13
+ * - **Description**: A short description to elaborate on the title or purpose of the card.
14
+ * - **Icon**: Optionally display an icon to visually represent the NavCard's content or functionality.
15
+ * - **Color Variants**: Offers a range of predefined color options for theming, including:
16
+ * - `akinon`
17
+ * - `azure`
18
+ * - `blue`
19
+ * - `orange`
20
+ * - `red`
21
+ * - `green`
22
+ * - `pink`
23
+ * - `purple`
24
+ * - **Custom Styling**: Allows additional customizations via the `className` prop.
25
+ *
26
+ * Ideal for use in dashboards, navigation menus, or any scenario where visually distinct
27
+ * and thematically consistent navigation elements are required.
28
+ */
5
29
  export declare const NavCard: ({ title, description, icon, variant, className }: NavCardProps) => React.JSX.Element;
6
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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
+ {"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;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,eAAO,MAAM,OAAO,qDAMjB,YAAY,sBAad,CAAC"}
@@ -1,6 +1,30 @@
1
1
  import './index.css';
2
2
  import clsx from 'clsx';
3
3
  import * as React from 'react';
4
+ /**
5
+ * NavCard component for navigation or highlighting sections in the interface.
6
+ *
7
+ * The NavCard component is designed to provide a visually engaging and functional card
8
+ * that serves as a navigation element or as a callout section in a user interface.
9
+ *
10
+ * Features:
11
+ * - **Title**: A required title to provide the primary context for the NavCard.
12
+ * - **Description**: A short description to elaborate on the title or purpose of the card.
13
+ * - **Icon**: Optionally display an icon to visually represent the NavCard's content or functionality.
14
+ * - **Color Variants**: Offers a range of predefined color options for theming, including:
15
+ * - `akinon`
16
+ * - `azure`
17
+ * - `blue`
18
+ * - `orange`
19
+ * - `red`
20
+ * - `green`
21
+ * - `pink`
22
+ * - `purple`
23
+ * - **Custom Styling**: Allows additional customizations via the `className` prop.
24
+ *
25
+ * Ideal for use in dashboards, navigation menus, or any scenario where visually distinct
26
+ * and thematically consistent navigation elements are required.
27
+ */
4
28
  export const NavCard = ({ title, description, icon, variant, className }) => {
5
29
  const variantClass = variant ? `nav-card-${variant}` : '';
6
30
  return (React.createElement("div", { className: clsx('nav-card', variantClass, className) },
@@ -13,18 +13,22 @@ export interface NavCardProps {
13
13
  * The title of the NavCard.
14
14
  */
15
15
  title: string;
16
+
16
17
  /**
17
18
  * The description of the NavCard.
18
19
  */
19
20
  description: string;
21
+
20
22
  /**
21
23
  * The icon of the NavCard.
22
24
  */
23
25
  icon?: React.ReactNode;
26
+
24
27
  /**
25
28
  * The color variant of the NavCard.
26
29
  */
27
30
  variant?: NavCardColorVariant;
31
+
28
32
  /**
29
33
  * The additional css class
30
34
  */
@@ -1,6 +1,8 @@
1
- import './index.css';
2
1
  import * as React from 'react';
3
2
  import type { PageContentProps } from './types';
4
- export type { PageContentProps } from './types';
3
+ /**
4
+ * It is used to generate content for a standard page.
5
+ */
5
6
  export declare const PageContent: ({ children, className, ...restProps }: PageContentProps) => React.JSX.Element;
7
+ export type * from './types';
6
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/PageContent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;GAEG;AAEH,eAAO,MAAM,WAAW,0CAIrB,gBAAgB,sBAMlB,CAAC;AAEF,mBAAmB,SAAS,CAAC"}
@@ -9,10 +9,11 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import './index.css';
13
- import clsx from 'clsx';
14
12
  import * as React from 'react';
13
+ /**
14
+ * It is used to generate content for a standard page.
15
+ */
15
16
  export const PageContent = (_a) => {
16
- var { children, className } = _a, restProps = __rest(_a, ["children", "className"]);
17
- return (React.createElement("div", Object.assign({ className: clsx('akinon-page-content', className) }, restProps), children));
17
+ var { children, className = '' } = _a, restProps = __rest(_a, ["children", "className"]);
18
+ return (React.createElement("div", Object.assign({ className: className, style: { padding: '30px' } }, restProps), children));
18
19
  };