@akinon/ui-layout 0.5.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 (91) 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 +56 -0
  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 +135 -0
  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 +29 -0
  13. package/dist/cjs/Layout/Footer/index.css +3 -0
  14. package/dist/cjs/Layout/Footer/index.d.ts +5 -0
  15. package/dist/cjs/Layout/Footer/index.d.ts.map +1 -1
  16. package/dist/cjs/Layout/Footer/index.js +5 -0
  17. package/dist/cjs/Layout/Footer/types.d.ts +43 -0
  18. package/dist/cjs/Layout/Header/index.css +12 -0
  19. package/dist/cjs/Layout/Header/index.d.ts +7 -0
  20. package/dist/cjs/Layout/Header/index.d.ts.map +1 -1
  21. package/dist/cjs/Layout/Header/index.js +7 -0
  22. package/dist/cjs/Layout/Header/types.d.ts +38 -0
  23. package/dist/cjs/Layout/Sider/index.css +34 -0
  24. package/dist/cjs/Layout/Sider/index.d.ts +24 -1
  25. package/dist/cjs/Layout/Sider/index.d.ts.map +1 -1
  26. package/dist/cjs/Layout/Sider/index.js +36 -6
  27. package/dist/cjs/Layout/Sider/types.d.ts +134 -0
  28. package/dist/cjs/Layout/index.d.ts +6 -0
  29. package/dist/cjs/Layout/index.d.ts.map +1 -1
  30. package/dist/cjs/Layout/index.js +6 -0
  31. package/dist/cjs/Layout/types.d.ts +32 -0
  32. package/dist/cjs/NavCard/index.css +30 -30
  33. package/dist/cjs/NavCard/index.d.ts +24 -0
  34. package/dist/cjs/NavCard/index.d.ts.map +1 -1
  35. package/dist/cjs/NavCard/index.js +24 -0
  36. package/dist/cjs/NavCard/types.d.ts +36 -0
  37. package/dist/cjs/PageContent/index.d.ts +4 -2
  38. package/dist/cjs/PageContent/index.d.ts.map +1 -1
  39. package/dist/cjs/PageContent/index.js +5 -4
  40. package/dist/cjs/PageContent/types.d.ts +11 -0
  41. package/dist/cjs/PageHeading/index.d.ts +5 -2
  42. package/dist/cjs/PageHeading/index.d.ts.map +1 -1
  43. package/dist/cjs/PageHeading/index.js +13 -7
  44. package/dist/cjs/PageHeading/types.d.ts +21 -0
  45. package/dist/cjs/types.d.ts +12 -0
  46. package/dist/esm/Flex/index.d.ts +12 -1
  47. package/dist/esm/Flex/index.d.ts.map +1 -1
  48. package/dist/esm/Flex/index.js +11 -0
  49. package/dist/esm/Flex/types.d.ts +56 -0
  50. package/dist/esm/Grid/index.d.ts +23 -0
  51. package/dist/esm/Grid/index.d.ts.map +1 -1
  52. package/dist/esm/Grid/index.js +23 -0
  53. package/dist/esm/Grid/types.d.ts +135 -0
  54. package/dist/esm/Layout/Content/index.d.ts +8 -0
  55. package/dist/esm/Layout/Content/index.d.ts.map +1 -1
  56. package/dist/esm/Layout/Content/index.js +8 -0
  57. package/dist/esm/Layout/Content/types.d.ts +29 -0
  58. package/dist/esm/Layout/Footer/index.css +3 -0
  59. package/dist/esm/Layout/Footer/index.d.ts +5 -0
  60. package/dist/esm/Layout/Footer/index.d.ts.map +1 -1
  61. package/dist/esm/Layout/Footer/index.js +5 -0
  62. package/dist/esm/Layout/Footer/types.d.ts +43 -0
  63. package/dist/esm/Layout/Header/index.css +12 -0
  64. package/dist/esm/Layout/Header/index.d.ts +7 -0
  65. package/dist/esm/Layout/Header/index.d.ts.map +1 -1
  66. package/dist/esm/Layout/Header/index.js +7 -0
  67. package/dist/esm/Layout/Header/types.d.ts +38 -0
  68. package/dist/esm/Layout/Sider/index.css +34 -0
  69. package/dist/esm/Layout/Sider/index.d.ts +24 -1
  70. package/dist/esm/Layout/Sider/index.d.ts.map +1 -1
  71. package/dist/esm/Layout/Sider/index.js +36 -6
  72. package/dist/esm/Layout/Sider/types.d.ts +134 -0
  73. package/dist/esm/Layout/index.d.ts +6 -0
  74. package/dist/esm/Layout/index.d.ts.map +1 -1
  75. package/dist/esm/Layout/index.js +6 -0
  76. package/dist/esm/Layout/types.d.ts +32 -0
  77. package/dist/esm/NavCard/index.css +30 -30
  78. package/dist/esm/NavCard/index.d.ts +24 -0
  79. package/dist/esm/NavCard/index.d.ts.map +1 -1
  80. package/dist/esm/NavCard/index.js +24 -0
  81. package/dist/esm/NavCard/types.d.ts +36 -0
  82. package/dist/esm/PageContent/index.d.ts +4 -2
  83. package/dist/esm/PageContent/index.d.ts.map +1 -1
  84. package/dist/esm/PageContent/index.js +5 -4
  85. package/dist/esm/PageContent/types.d.ts +11 -0
  86. package/dist/esm/PageHeading/index.d.ts +5 -2
  87. package/dist/esm/PageHeading/index.d.ts.map +1 -1
  88. package/dist/esm/PageHeading/index.js +13 -7
  89. package/dist/esm/PageHeading/types.d.ts +21 -0
  90. package/dist/esm/types.d.ts +12 -0
  91. package/package.json +6 -6
@@ -18,21 +18,51 @@ const cssinjs_1 = require("@ant-design/cssinjs");
18
18
  const antd_1 = require("antd");
19
19
  const React = require("react");
20
20
  const { Sider: AntSider } = antd_1.Layout;
21
+ /**
22
+ * Sider component for building collapsible sidebars in user interfaces.
23
+ *
24
+ * The Sider component is designed to provide a flexible and customizable sidebar
25
+ * that integrates seamlessly with layouts, menus, and responsive designs.
26
+ *
27
+ * Features:
28
+ * - **Collapsible**: Option to collapse the sidebar manually or automatically.
29
+ * - **Custom Triggers**: Supports custom triggers or hiding the trigger altogether.
30
+ * - **Width Options**: Configure both default and collapsed widths.
31
+ * - **Responsive Breakpoints**: Adjusts behavior based on predefined screen sizes.
32
+ * - **Theming**: Offers `light` and `dark` themes to match application aesthetics.
33
+ * - **Callbacks**:
34
+ * - `onCollapse`: Triggered when the sidebar is collapsed or expanded.
35
+ * - `onBreakpoint`: Triggered when responsive breakpoints are reached.
36
+ * - **Custom Styling**:
37
+ * - `className` for additional styling.
38
+ * - `zeroWidthTriggerStyle` for styling triggers when the collapsed width is zero.
39
+ * - `brandImageUrl` and `iconUrl` for branding and visual customization.
40
+ *
41
+ * Ideal for dashboards, navigation menus, and applications requiring collapsible or responsive side navigation.
42
+ *
43
+ */
21
44
  const Sider = (_a) => {
22
- var { children, collapsed, iconUrl, brandImageUrl } = _a, restSiderProps = __rest(_a, ["children", "collapsed", "iconUrl", "brandImageUrl"]);
45
+ var { children, collapsed, iconUrl, brandImageUrl, position = 'left' } = _a, restSiderProps = __rest(_a, ["children", "collapsed", "iconUrl", "brandImageUrl", "position"]);
23
46
  const { getPrefixCls, theme } = React.useContext(antd_1.ConfigProvider.ConfigContext);
24
47
  const { token, hashId } = (0, ui_theme_1.useToken)();
25
- //const layoutToken = (token as GlobalToken).Layout;
48
+ const layoutToken = token.Layout;
26
49
  const useStyle = (0, cssinjs_1.useStyleRegister)({
27
50
  token: token,
28
51
  path: ['Sider'],
29
52
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
53
  theme: theme
31
54
  }, () => {
32
- const prefixCls = `:where(.${hashId}).${getPrefixCls()}-sider`;
33
- const prefixClsWithoutHash = `.${getPrefixCls()}-sider`;
55
+ const prefixCls = `:where(.${hashId}).${getPrefixCls()}-layout-sider`;
56
+ const prefixClsWithoutHash = `.${getPrefixCls()}-layout-sider`;
34
57
  return {
35
- [prefixCls]: {},
58
+ [prefixCls]: {
59
+ '&-left': {
60
+ borderInlineEnd: layoutToken.mainBorder
61
+ },
62
+ '&-right': {
63
+ borderInlineStart: layoutToken.mainBorder
64
+ }
65
+ },
36
66
  [prefixClsWithoutHash]: {}
37
67
  };
38
68
  });
@@ -42,7 +72,7 @@ const Sider = (_a) => {
42
72
  React.createElement("img", { className: "logo", src: iconUrl, alt: "icon", width: 20, height: 20 }),
43
73
  React.createElement("img", { className: "brand-image", src: brandImageUrl, alt: "brand-image", height: 20 })));
44
74
  }
45
- return useStyle(React.createElement(AntSider, Object.assign({ collapsible: true, collapsed: collapsed, trigger: null, width: 250 }, restSiderProps),
75
+ return useStyle(React.createElement(AntSider, Object.assign({ className: `${getPrefixCls()}-layout-sider-${position}`, collapsible: true, collapsed: collapsed, trigger: null, width: 250, collapsedWidth: 56 }, restSiderProps),
46
76
  LogoContainer,
47
77
  children));
48
78
  };
@@ -0,0 +1,134 @@
1
+ // TODO integrate with antd menu types
2
+ /**
3
+ * Interface for items within the left sider.
4
+ */
5
+ export type LeftSiderItem = {
6
+ /**
7
+ * Unique key for the menu item.
8
+ */
9
+ key: string;
10
+
11
+ /**
12
+ * Display label for the menu item.
13
+ */
14
+ label: string;
15
+
16
+ /**
17
+ * Optional icon for the menu item.
18
+ */
19
+ icon?: React.ReactNode;
20
+
21
+ /**
22
+ * Additional CSS class for the menu item.
23
+ */
24
+ className?: string;
25
+
26
+ /**
27
+ * Callback function triggered when the menu item is clicked.
28
+ */
29
+ onClick?: () => void;
30
+
31
+ /**
32
+ * Nested children items for creating submenus.
33
+ */
34
+ children?: LeftSiderItem[];
35
+
36
+ /**
37
+ * Whether the menu item is disabled.
38
+ */
39
+ disabled?: boolean;
40
+ };
41
+
42
+ export type SiderProps = Omit<AntSiderProps, 'prefixCls' | 'style' | 'styles'>;
43
+
44
+ export interface AntSiderProps extends React.HTMLAttributes<HTMLDivElement> {
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
+
54
+ /**
55
+ * Whether can be collapsed
56
+ */
57
+ collapsible?: boolean;
58
+
59
+ /**
60
+ * To set the current status
61
+ */
62
+ collapsed?: boolean;
63
+
64
+ /**
65
+ * To set the initial status
66
+ */
67
+ defaultCollapsed?: boolean;
68
+
69
+ /**
70
+ * Reverse direction of arrow, for a sider that expands from the right
71
+ */
72
+ reverseArrow?: boolean;
73
+
74
+ /**
75
+ * The callback function, executed by clicking the trigger or activating the responsive layout
76
+ */
77
+ onCollapse?: (collapsed: boolean, type: CollapseType) => void;
78
+
79
+ /**
80
+ * To customize the styles of the special trigger that appears when <code>collapsedWidth</code> is 0
81
+ */
82
+ zeroWidthTriggerStyle?: React.CSSProperties;
83
+
84
+ /**
85
+ * Specify the customized trigger, set to null to hide the trigger
86
+ */
87
+ trigger?: React.ReactNode;
88
+
89
+ /**
90
+ * Width of the sidebar
91
+ */
92
+ width?: number | string;
93
+
94
+ /**
95
+ * Width of the collapsed sidebar, by setting to 0 a special trigger will appear
96
+ */
97
+ collapsedWidth?: number | string;
98
+
99
+ /**
100
+ * Breakpoints of the responsive layout
101
+ */
102
+ breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
103
+
104
+ /**
105
+ * Color theme of the sidebar
106
+ */
107
+ theme?: SiderTheme;
108
+
109
+ /**
110
+ * The callback function, executed when breakpoints changed
111
+ */
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
+ */
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
+ */
124
+ brandImageUrl?: string;
125
+
126
+ /**
127
+ * The additional css class
128
+ */
129
+ className?: string;
130
+ }
131
+
132
+ type SiderTheme = 'light' | 'dark';
133
+
134
+ type CollapseType = 'clickTrigger' | 'responsive';
@@ -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"}
@@ -16,6 +16,12 @@ const ui_theme_1 = require("@akinon/ui-theme");
16
16
  const cssinjs_1 = require("@ant-design/cssinjs");
17
17
  const antd_1 = require("antd");
18
18
  const React = require("react");
19
+ /**
20
+ * Layout component, which acts as the container for building structured page layouts.
21
+ * It provides a framework to integrate Sider, Header, Footer, and Content components cohesively.
22
+ *
23
+ * This component is commonly used in applications to establish a consistent and flexible layout structure.
24
+ */
19
25
  const Layout = (_a) => {
20
26
  var { children } = _a, restLayoutProps = __rest(_a, ["children"]);
21
27
  const { getPrefixCls, theme } = React.useContext(antd_1.ConfigProvider.ConfigContext);
@@ -0,0 +1,32 @@
1
+ export type LayoutProps = Omit<
2
+ AntLayoutProps,
3
+ 'prefixCls' | 'suffixCls' | 'style' | 'styles'
4
+ >;
5
+
6
+ export interface AntLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
7
+ /**
8
+ * Suffix class for custom styling.
9
+ */
10
+ suffixCls?: string;
11
+
12
+ /**
13
+ * ClassName on the root element.
14
+ */
15
+ rootClassName?: string;
16
+
17
+ /**
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.
20
+ */
21
+ hasSider?: boolean;
22
+
23
+ /**
24
+ * The children elements to render within the layout.
25
+ */
26
+ children: React.ReactNode;
27
+
28
+ /**
29
+ * The additional CSS class for styling.
30
+ */
31
+ className?: string;
32
+ }
@@ -13,45 +13,45 @@
13
13
  align-items: center;
14
14
  justify-content: center;
15
15
  width: 180px;
16
+ }
16
17
 
17
- /* Overriding SVG so you will not have to pass size prop to Icon component. */
18
- svg {
19
- width: 28px !important;
20
- height: 28px !important;
21
- }
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
+ }
22
23
 
23
- /* Change bg color based on the class set on .nav-card */
24
- &:is(.nav-card-akinon *) {
25
- background-color: var(--color-akinon-500);
26
- }
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
+ }
27
28
 
28
- &:is(.nav-card-azure *) {
29
- background-color: var(--color-azure-500);
30
- }
29
+ .nav-card-azure .nav-card__icon {
30
+ background-color: var(--color-azure-500);
31
+ }
31
32
 
32
- &:is(.nav-card-blue *) {
33
- background-color: var(--color-blue-500);
34
- }
33
+ .nav-card-blue .nav-card__icon {
34
+ background-color: var(--color-blue-500);
35
+ }
35
36
 
36
- &:is(.nav-card-orange *) {
37
- background-color: var(--color-orange-500);
38
- }
37
+ .nav-card-orange .nav-card__icon {
38
+ background-color: var(--color-orange-500);
39
+ }
39
40
 
40
- &:is(.nav-card-red *) {
41
- background-color: var(--color-red-500);
42
- }
41
+ .nav-card-red .nav-card__icon {
42
+ background-color: var(--color-red-500);
43
+ }
43
44
 
44
- &:is(.nav-card-green *) {
45
- background-color: var(--color-green-500);
46
- }
45
+ .nav-card-green .nav-card__icon {
46
+ background-color: var(--color-green-500);
47
+ }
47
48
 
48
- &:is(.nav-card-pink *) {
49
- background-color: var(--color-pink-500);
50
- }
49
+ .nav-card-pink .nav-card__icon {
50
+ background-color: var(--color-pink-500);
51
+ }
51
52
 
52
- &:is(.nav-card-purple *) {
53
- background-color: var(--color-purple-500);
54
- }
53
+ .nav-card-purple .nav-card__icon {
54
+ background-color: var(--color-purple-500);
55
55
  }
56
56
 
57
57
  .nav-card__content {
@@ -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"}
@@ -4,6 +4,30 @@ exports.NavCard = void 0;
4
4
  require("./index.css");
5
5
  const clsx_1 = require("clsx");
6
6
  const React = require("react");
7
+ /**
8
+ * NavCard component for navigation or highlighting sections in the interface.
9
+ *
10
+ * The NavCard component is designed to provide a visually engaging and functional card
11
+ * that serves as a navigation element or as a callout section in a user interface.
12
+ *
13
+ * Features:
14
+ * - **Title**: A required title to provide the primary context for the NavCard.
15
+ * - **Description**: A short description to elaborate on the title or purpose of the card.
16
+ * - **Icon**: Optionally display an icon to visually represent the NavCard's content or functionality.
17
+ * - **Color Variants**: Offers a range of predefined color options for theming, including:
18
+ * - `akinon`
19
+ * - `azure`
20
+ * - `blue`
21
+ * - `orange`
22
+ * - `red`
23
+ * - `green`
24
+ * - `pink`
25
+ * - `purple`
26
+ * - **Custom Styling**: Allows additional customizations via the `className` prop.
27
+ *
28
+ * Ideal for use in dashboards, navigation menus, or any scenario where visually distinct
29
+ * and thematically consistent navigation elements are required.
30
+ */
7
31
  const NavCard = ({ title, description, icon, variant, className }) => {
8
32
  const variantClass = variant ? `nav-card-${variant}` : '';
9
33
  return (React.createElement("div", { className: (0, clsx_1.default)('nav-card', variantClass, className) },
@@ -0,0 +1,36 @@
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
+ /**
18
+ * The description of the NavCard.
19
+ */
20
+ description: string;
21
+
22
+ /**
23
+ * The icon of the NavCard.
24
+ */
25
+ icon?: React.ReactNode;
26
+
27
+ /**
28
+ * The color variant of the NavCard.
29
+ */
30
+ variant?: NavCardColorVariant;
31
+
32
+ /**
33
+ * The additional css class
34
+ */
35
+ className?: string;
36
+ }
@@ -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"}
@@ -12,11 +12,12 @@ 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("./index.css");
16
- const clsx_1 = require("clsx");
17
15
  const React = require("react");
16
+ /**
17
+ * It is used to generate content for a standard page.
18
+ */
18
19
  const PageContent = (_a) => {
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
+ var { children, className = '' } = _a, restProps = __rest(_a, ["children", "className"]);
21
+ return (React.createElement("div", Object.assign({ className: className, style: { padding: '30px' } }, restProps), children));
21
22
  };
22
23
  exports.PageContent = PageContent;
@@ -0,0 +1,11 @@
1
+ export interface PageContentProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ /**
3
+ * The content of the page.
4
+ */
5
+ children: React.ReactNode;
6
+
7
+ /**
8
+ * The additional css class.
9
+ */
10
+ className?: string;
11
+ }
@@ -1,6 +1,9 @@
1
- import './index.css';
2
1
  import * as React from 'react';
3
2
  import type { PageHeadingProps } from './types';
4
- export type { PageHeadingProps } from './types';
3
+ /**
4
+ * It is used to generate title, description and actions for a standard page.
5
+ * See the [PageContent](/docs/layout-pagecontent--docs) component for more information.
6
+ */
5
7
  export declare const PageHeading: ({ title, description, actions, className }: PageHeadingProps) => React.JSX.Element;
8
+ export type * from './types';
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/PageHeading/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;GAGG;AAEH,eAAO,MAAM,WAAW,+CAKrB,gBAAgB,sBA4BlB,CAAC;AAEF,mBAAmB,SAAS,CAAC"}
@@ -1,14 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PageHeading = void 0;
4
- require("./index.css");
5
- const clsx_1 = require("clsx");
4
+ const antd_1 = require("antd");
6
5
  const React = require("react");
6
+ /**
7
+ * It is used to generate title, description and actions for a standard page.
8
+ * See the [PageContent](/docs/layout-pagecontent--docs) component for more information.
9
+ */
7
10
  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)));
11
+ return (React.createElement(antd_1.Flex, { justify: "space-between", align: "flex-start", className: className, style: {
12
+ padding: '18px 30px',
13
+ borderBlockEnd: 'solid 1px var(--color-gray-900)'
14
+ } },
15
+ React.createElement(antd_1.Space, { direction: "vertical", size: 4 },
16
+ React.createElement(antd_1.Typography.Title, { level: 4, style: { margin: 0 } }, title),
17
+ description && (React.createElement(antd_1.Typography.Paragraph, { type: "secondary", style: { margin: 0, fontSize: 10 } }, description))),
18
+ actions && React.createElement(antd_1.Space, null, actions)));
13
19
  };
14
20
  exports.PageHeading = PageHeading;
@@ -0,0 +1,21 @@
1
+ export interface PageHeadingProps {
2
+ /**
3
+ * The title of the PageHeading.
4
+ */
5
+ title: string;
6
+
7
+ /**
8
+ * The description of the PageHeading.
9
+ */
10
+ description?: string;
11
+
12
+ /**
13
+ * The action items of the PageHeading.
14
+ */
15
+ actions?: React.ReactNode;
16
+
17
+ /**
18
+ * The additional css class
19
+ */
20
+ className?: string;
21
+ }
@@ -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
+ };
@@ -1,5 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import type { FlexProps } from './types';
3
- export type { FlexProps } from './types';
3
+ export type * from './types';
4
+ /**
5
+ * The `Flex` component is a wrapper for creating flexible layouts using the flexbox model.
6
+ * It provides a clean and simple API to manage alignment, spacing, and direction
7
+ * of child elements, ensuring responsive and adaptable designs.
8
+ *
9
+ * Features include:
10
+ * - Vertical and horizontal layouts with optional wrapping.
11
+ * - Customizable alignment for both main and cross axes.
12
+ * - Support for predefined or custom gap sizes between child elements.
13
+ * - Flexibility to use any custom HTML element or React component as the container.
14
+ */
4
15
  export declare const Flex: ({ children, ...restFlexProps }: FlexProps) => React.JSX.Element;
5
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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,mBAAmB,SAAS,CAAC;AAE7B;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,IAAI,mCAAoC,SAAS,sBA4B7D,CAAC"}
@@ -13,6 +13,17 @@ import { useToken } from '@akinon/ui-theme';
13
13
  import { useStyleRegister } from '@ant-design/cssinjs';
14
14
  import { ConfigProvider, Flex as AntFlex } from 'antd';
15
15
  import * as React from 'react';
16
+ /**
17
+ * The `Flex` component is a wrapper for creating flexible layouts using the flexbox model.
18
+ * It provides a clean and simple API to manage alignment, spacing, and direction
19
+ * of child elements, ensuring responsive and adaptable designs.
20
+ *
21
+ * Features include:
22
+ * - Vertical and horizontal layouts with optional wrapping.
23
+ * - Customizable alignment for both main and cross axes.
24
+ * - Support for predefined or custom gap sizes between child elements.
25
+ * - Flexibility to use any custom HTML element or React component as the container.
26
+ */
16
27
  export const Flex = (_a) => {
17
28
  var { children } = _a, restFlexProps = __rest(_a, ["children"]);
18
29
  const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);