@akinon/ui-layout 0.6.0 → 1.0.1

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 +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/__tests__/navcard.test.d.ts +2 -0
  31. package/dist/cjs/NavCard/__tests__/navcard.test.d.ts.map +1 -0
  32. package/dist/cjs/NavCard/__tests__/navcard.test.js +40 -0
  33. package/dist/cjs/NavCard/__tests__/navcard.test.tsx +92 -0
  34. package/dist/cjs/NavCard/index.d.ts +20 -3
  35. package/dist/cjs/NavCard/index.d.ts.map +1 -1
  36. package/dist/cjs/NavCard/index.js +79 -8
  37. package/dist/cjs/NavCard/types.d.ts +19 -11
  38. package/dist/cjs/PageContent/index.d.ts +4 -2
  39. package/dist/cjs/PageContent/index.d.ts.map +1 -1
  40. package/dist/cjs/PageContent/index.js +5 -4
  41. package/dist/cjs/PageContent/types.d.ts +9 -1
  42. package/dist/cjs/PageHeading/index.d.ts +5 -2
  43. package/dist/cjs/PageHeading/index.d.ts.map +1 -1
  44. package/dist/cjs/PageHeading/index.js +13 -7
  45. package/dist/cjs/PageHeading/types.d.ts +4 -1
  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 +12 -3
  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 +14 -2
  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 +15 -0
  58. package/dist/esm/Layout/Footer/index.d.ts +5 -0
  59. package/dist/esm/Layout/Footer/index.d.ts.map +1 -1
  60. package/dist/esm/Layout/Footer/index.js +5 -0
  61. package/dist/esm/Layout/Footer/types.d.ts +28 -0
  62. package/dist/esm/Layout/Header/index.d.ts +7 -0
  63. package/dist/esm/Layout/Header/index.d.ts.map +1 -1
  64. package/dist/esm/Layout/Header/index.js +7 -0
  65. package/dist/esm/Layout/Header/types.d.ts +23 -0
  66. package/dist/esm/Layout/Sider/index.css +8 -2
  67. package/dist/esm/Layout/Sider/index.d.ts +24 -1
  68. package/dist/esm/Layout/Sider/index.d.ts.map +1 -1
  69. package/dist/esm/Layout/Sider/index.js +36 -6
  70. package/dist/esm/Layout/Sider/types.d.ts +61 -1
  71. package/dist/esm/Layout/index.d.ts +6 -0
  72. package/dist/esm/Layout/index.d.ts.map +1 -1
  73. package/dist/esm/Layout/index.js +6 -0
  74. package/dist/esm/Layout/types.d.ts +14 -4
  75. package/dist/esm/NavCard/__tests__/navcard.test.d.ts +2 -0
  76. package/dist/esm/NavCard/__tests__/navcard.test.d.ts.map +1 -0
  77. package/dist/esm/NavCard/__tests__/navcard.test.js +38 -0
  78. package/dist/esm/NavCard/__tests__/navcard.test.tsx +92 -0
  79. package/dist/esm/NavCard/index.d.ts +20 -3
  80. package/dist/esm/NavCard/index.d.ts.map +1 -1
  81. package/dist/esm/NavCard/index.js +79 -8
  82. package/dist/esm/NavCard/types.d.ts +19 -11
  83. package/dist/esm/PageContent/index.d.ts +4 -2
  84. package/dist/esm/PageContent/index.d.ts.map +1 -1
  85. package/dist/esm/PageContent/index.js +5 -4
  86. package/dist/esm/PageContent/types.d.ts +9 -1
  87. package/dist/esm/PageHeading/index.d.ts +5 -2
  88. package/dist/esm/PageHeading/index.d.ts.map +1 -1
  89. package/dist/esm/PageHeading/index.js +13 -7
  90. package/dist/esm/PageHeading/types.d.ts +4 -1
  91. package/package.json +8 -5
@@ -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"}
@@ -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);
@@ -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
  }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=navcard.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navcard.test.d.ts","sourceRoot":"","sources":["../../../../src/NavCard/__tests__/navcard.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@akinon/utils");
4
+ const React = require("react");
5
+ const vitest_1 = require("vitest");
6
+ const __1 = require("..");
7
+ (0, vitest_1.describe)('NavCard', () => {
8
+ (0, vitest_1.it)('renders with required props', () => {
9
+ (0, utils_1.render)(React.createElement(__1.NavCard, { title: "Test Title", description: "Test Description", icon: "search" }));
10
+ (0, vitest_1.expect)(utils_1.screen.getByText('Test Title')).toBeInTheDocument();
11
+ (0, vitest_1.expect)(utils_1.screen.getByText('Test Description')).toBeInTheDocument();
12
+ });
13
+ (0, vitest_1.it)('renders with default variant', () => {
14
+ (0, utils_1.render)(React.createElement(__1.NavCard, { title: "Test Title", description: "Test Description", icon: "search", variant: "default" }));
15
+ const iconContainer = utils_1.screen.getByTestId('icon-container');
16
+ (0, vitest_1.expect)(iconContainer).toHaveClass('akinon-navcard-icon-default');
17
+ });
18
+ (0, vitest_1.it)('renders with akinon variant', () => {
19
+ (0, utils_1.render)(React.createElement(__1.NavCard, { title: "Test Title", description: "Test Description", icon: "search", variant: "akinon" }));
20
+ const iconContainer = utils_1.screen.getByTestId('icon-container');
21
+ (0, vitest_1.expect)(iconContainer).toHaveClass('akinon-navcard-icon-akinon');
22
+ });
23
+ (0, vitest_1.it)('applies custom background color', () => {
24
+ const customBackground = '#ff0000';
25
+ (0, utils_1.render)(React.createElement(__1.NavCard, { title: "Test Title", description: "Test Description", icon: "search", background: customBackground }));
26
+ const iconContainer = utils_1.screen.getByTestId('icon-container');
27
+ (0, vitest_1.expect)(iconContainer).toHaveStyle({ background: customBackground });
28
+ });
29
+ (0, vitest_1.it)('applies custom icon color', () => {
30
+ (0, utils_1.render)(React.createElement(__1.NavCard, { title: "Test Title", description: "Test Description", icon: "search", iconColor: "red" }));
31
+ const icon = utils_1.screen.getByTestId('icon');
32
+ (0, vitest_1.expect)(icon).toHaveStyle({ fill: 'red' });
33
+ });
34
+ (0, vitest_1.it)('applies custom className', () => {
35
+ const customClass = 'custom-nav-card';
36
+ (0, utils_1.render)(React.createElement(__1.NavCard, { title: "Test Title", description: "Test Description", icon: "search", className: customClass }));
37
+ const navCard = utils_1.screen.getByTestId('nav-card');
38
+ (0, vitest_1.expect)(navCard).toHaveClass(customClass);
39
+ });
40
+ });
@@ -0,0 +1,92 @@
1
+ import { render, screen } from '@akinon/utils';
2
+ import * as React from 'react';
3
+ import { describe, expect, it } from 'vitest';
4
+
5
+ import { NavCard } from '..';
6
+
7
+ describe('NavCard', () => {
8
+ it('renders with required props', () => {
9
+ render(
10
+ <NavCard
11
+ title="Test Title"
12
+ description="Test Description"
13
+ icon="search"
14
+ />
15
+ );
16
+
17
+ expect(screen.getByText('Test Title')).toBeInTheDocument();
18
+ expect(screen.getByText('Test Description')).toBeInTheDocument();
19
+ });
20
+
21
+ it('renders with default variant', () => {
22
+ render(
23
+ <NavCard
24
+ title="Test Title"
25
+ description="Test Description"
26
+ icon="search"
27
+ variant="default"
28
+ />
29
+ );
30
+
31
+ const iconContainer = screen.getByTestId('icon-container');
32
+ expect(iconContainer).toHaveClass('akinon-navcard-icon-default');
33
+ });
34
+
35
+ it('renders with akinon variant', () => {
36
+ render(
37
+ <NavCard
38
+ title="Test Title"
39
+ description="Test Description"
40
+ icon="search"
41
+ variant="akinon"
42
+ />
43
+ );
44
+
45
+ const iconContainer = screen.getByTestId('icon-container');
46
+ expect(iconContainer).toHaveClass('akinon-navcard-icon-akinon');
47
+ });
48
+
49
+ it('applies custom background color', () => {
50
+ const customBackground = '#ff0000';
51
+ render(
52
+ <NavCard
53
+ title="Test Title"
54
+ description="Test Description"
55
+ icon="search"
56
+ background={customBackground}
57
+ />
58
+ );
59
+
60
+ const iconContainer = screen.getByTestId('icon-container');
61
+ expect(iconContainer).toHaveStyle({ background: customBackground });
62
+ });
63
+
64
+ it('applies custom icon color', () => {
65
+ render(
66
+ <NavCard
67
+ title="Test Title"
68
+ description="Test Description"
69
+ icon="search"
70
+ iconColor="red"
71
+ />
72
+ );
73
+
74
+ const icon = screen.getByTestId('icon');
75
+ expect(icon).toHaveStyle({ fill: 'red' });
76
+ });
77
+
78
+ it('applies custom className', () => {
79
+ const customClass = 'custom-nav-card';
80
+ render(
81
+ <NavCard
82
+ title="Test Title"
83
+ description="Test Description"
84
+ icon="search"
85
+ className={customClass}
86
+ />
87
+ );
88
+
89
+ const navCard = screen.getByTestId('nav-card');
90
+ expect(navCard).toHaveClass(customClass);
91
+ });
92
+ });
@@ -1,6 +1,23 @@
1
- import './index.css';
2
1
  import * as React from 'react';
3
2
  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;
3
+ export type * from './types';
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
+ * - `default`
16
+ * - `akinon`
17
+ * - **Custom Styling**: Allows additional customizations via the `className` prop.
18
+ *
19
+ * Ideal for use in dashboards, navigation menus, or any scenario where visually distinct
20
+ * and thematically consistent navigation elements are required.
21
+ */
22
+ export declare const NavCard: ({ title, description, icon, variant, className, background, iconColor }: NavCardProps) => React.JSX.Element;
6
23
  //# 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":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,mBAAmB,SAAS,CAAC;AAE7B;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,OAAO,4EAQjB,YAAY,sBAwFd,CAAC"}
@@ -1,15 +1,86 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NavCard = void 0;
4
- require("./index.css");
4
+ const icons_1 = require("@akinon/icons");
5
+ const ui_theme_1 = require("@akinon/ui-theme");
6
+ const ui_typography_1 = require("@akinon/ui-typography");
7
+ const cssinjs_1 = require("@ant-design/cssinjs");
8
+ const antd_1 = require("antd");
5
9
  const clsx_1 = require("clsx");
6
10
  const React = require("react");
7
- const NavCard = ({ title, description, icon, variant, className }) => {
8
- const variantClass = variant ? `nav-card-${variant}` : '';
9
- return (React.createElement("div", { className: (0, clsx_1.default)('nav-card', variantClass, className) },
10
- icon && React.createElement("div", { className: "nav-card__icon" }, icon),
11
- React.createElement("div", { className: "nav-card__content" },
12
- React.createElement("h2", { className: "nav-card__title" }, title),
13
- React.createElement("div", { className: "nav-card__description" }, description))));
11
+ const Flex_1 = require("../Flex");
12
+ /**
13
+ * NavCard component for navigation or highlighting sections in the interface.
14
+ *
15
+ * The NavCard component is designed to provide a visually engaging and functional card
16
+ * that serves as a navigation element or as a callout section in a user interface.
17
+ *
18
+ * Features:
19
+ * - **Title**: A required title to provide the primary context for the NavCard.
20
+ * - **Description**: A short description to elaborate on the title or purpose of the card.
21
+ * - **Icon**: Optionally display an icon to visually represent the NavCard's content or functionality.
22
+ * - **Color Variants**: Offers a range of predefined color options for theming, including:
23
+ * - `default`
24
+ * - `akinon`
25
+ * - **Custom Styling**: Allows additional customizations via the `className` prop.
26
+ *
27
+ * Ideal for use in dashboards, navigation menus, or any scenario where visually distinct
28
+ * and thematically consistent navigation elements are required.
29
+ */
30
+ const NavCard = ({ title, description, icon, variant = 'default', className, background, iconColor = 'white' }) => {
31
+ const { getPrefixCls, theme } = React.useContext(antd_1.ConfigProvider.ConfigContext);
32
+ const { token, hashId } = (0, ui_theme_1.useToken)();
33
+ const navCardToken = theme.NavCardTokens;
34
+ const customTokens = theme.CustomTokens || {};
35
+ const prefixClsWithoutHash = `.${getPrefixCls()}-navcard`;
36
+ const prefixCls = `:where(.${hashId})${prefixClsWithoutHash}`;
37
+ (0, cssinjs_1.useStyleRegister)({
38
+ token: token,
39
+ path: ['NavCard'],
40
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ theme: theme
42
+ }, () => {
43
+ return {
44
+ [prefixCls]: {
45
+ overflow: customTokens.overflow.overflowHidden,
46
+ borderRadius: customTokens.border.borderRadiusSm,
47
+ boxShadow: navCardToken.shadow,
48
+ background: 'white',
49
+ [`${prefixClsWithoutHash}-icon`]: {
50
+ padding: '1.5rem',
51
+ display: customTokens.layout.displayFlex,
52
+ justifyContent: customTokens.layout.flexCenter,
53
+ alignItems: customTokens.layout.flexCenter,
54
+ [`&${prefixClsWithoutHash}-icon-default`]: {
55
+ background: 'var(--color-gray-500)'
56
+ },
57
+ [`&${prefixClsWithoutHash}-icon-akinon`]: {
58
+ background: 'var(--color-akinon-500)'
59
+ }
60
+ },
61
+ [`${prefixClsWithoutHash}-content`]: {
62
+ padding: '1.5rem'
63
+ },
64
+ [`${prefixClsWithoutHash}-title`]: {
65
+ color: 'var(--color-blue-955)',
66
+ margin: 0
67
+ },
68
+ [`${prefixClsWithoutHash}-description`]: {
69
+ color: 'var(--color-blue-955)'
70
+ }
71
+ }
72
+ };
73
+ });
74
+ return (React.createElement(React.Fragment, null,
75
+ React.createElement(Flex_1.Flex, { className: (0, clsx_1.default)(`${getPrefixCls()}-navcard`, className), "data-testid": "nav-card" },
76
+ React.createElement("div", { className: (0, clsx_1.default)(`${getPrefixCls()}-navcard-icon`, {
77
+ [`${getPrefixCls()}-navcard-icon-${variant}`]: variant
78
+ }), style: {
79
+ background
80
+ }, "data-testid": "icon-container" },
81
+ React.createElement(icons_1.Icon, { icon: icon, size: "28", color: iconColor, "data-testid": "icon" })),
82
+ React.createElement("div", { className: (0, clsx_1.default)(`${getPrefixCls()}-navcard-content`) },
83
+ React.createElement(ui_typography_1.Title, { level: 3, className: `${getPrefixCls()}-navcard-title` }, title),
84
+ React.createElement("div", { className: `${getPrefixCls()}-navcard-description` }, description)))));
14
85
  };
15
86
  exports.NavCard = NavCard;
@@ -1,30 +1,38 @@
1
- export type NavCardColorVariant =
2
- | 'akinon'
3
- | 'azure'
4
- | 'blue'
5
- | 'orange'
6
- | 'red'
7
- | 'green'
8
- | 'pink'
9
- | 'purple';
1
+ import { IconName } from '@akinon/icons';
2
+
3
+ export type NavCardColorVariant = 'akinon' | 'default';
10
4
 
11
5
  export interface NavCardProps {
12
6
  /**
13
7
  * The title of the NavCard.
14
8
  */
15
9
  title: string;
10
+
16
11
  /**
17
12
  * The description of the NavCard.
18
13
  */
19
- description: string;
14
+ description: React.ReactNode;
15
+
20
16
  /**
21
17
  * The icon of the NavCard.
22
18
  */
23
- icon?: React.ReactNode;
19
+ icon: IconName;
20
+
24
21
  /**
25
22
  * The color variant of the NavCard.
26
23
  */
27
24
  variant?: NavCardColorVariant;
25
+
26
+ /**
27
+ * Custom background for the NavCard.
28
+ */
29
+ background?: React.CSSProperties['background'];
30
+
31
+ /**
32
+ * Custom icon color for the NavCard.
33
+ */
34
+ iconColor?: React.CSSProperties['color'];
35
+
28
36
  /**
29
37
  * The additional css class
30
38
  */
@@ -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;
@@ -1,3 +1,11 @@
1
1
  export interface PageContentProps extends React.HTMLAttributes<HTMLDivElement> {
2
- children: ReactNode;
2
+ /**
3
+ * The content of the page.
4
+ */
5
+ children: React.ReactNode;
6
+
7
+ /**
8
+ * The additional css class.
9
+ */
10
+ className?: string;
3
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;
@@ -3,14 +3,17 @@ export interface PageHeadingProps {
3
3
  * The title of the PageHeading.
4
4
  */
5
5
  title: string;
6
+
6
7
  /**
7
8
  * The description of the PageHeading.
8
9
  */
9
10
  description?: string;
11
+
10
12
  /**
11
13
  * The action items of the PageHeading.
12
14
  */
13
- actions?: ReactNode;
15
+ actions?: React.ReactNode;
16
+
14
17
  /**
15
18
  * The additional css class
16
19
  */
@@ -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"}