@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
@@ -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"}
@@ -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);
@@ -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"}
@@ -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) },
@@ -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"}
@@ -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
  };
@@ -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,10 +1,16 @@
1
- import './index.css';
2
- import clsx from 'clsx';
1
+ import { Flex, Space, Typography } from 'antd';
3
2
  import * as React from 'react';
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
+ */
4
7
  export const PageHeading = ({ title, description, actions, className }) => {
5
- return (React.createElement("div", { className: clsx('akinon-page-heading', className) },
6
- React.createElement("div", { className: "akinon-page-heading__content" },
7
- React.createElement("h1", { className: "akinon-page-heading__title" }, title),
8
- description && (React.createElement("p", { className: "akinon-page-heading__description" }, description))),
9
- actions && React.createElement("div", { className: "akinon-page-heading__actions" }, actions)));
8
+ return (React.createElement(Flex, { justify: "space-between", align: "flex-start", className: className, style: {
9
+ padding: '18px 30px',
10
+ borderBlockEnd: 'solid 1px var(--color-gray-900)'
11
+ } },
12
+ React.createElement(Space, { direction: "vertical", size: 4 },
13
+ React.createElement(Typography.Title, { level: 4, style: { margin: 0 } }, title),
14
+ description && (React.createElement(Typography.Paragraph, { type: "secondary", style: { margin: 0, fontSize: 10 } }, description))),
15
+ actions && React.createElement(Space, null, actions)));
10
16
  };
@@ -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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/ui-layout",
3
- "version": "0.5.0",
3
+ "version": "1.0.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",
@@ -9,16 +9,16 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "antd": "5.17.0",
12
+ "antd": "5.22.6",
13
13
  "clsx": "^2.0.0"
14
14
  },
15
15
  "devDependencies": {
16
16
  "clean-package": "2.2.0",
17
17
  "copyfiles": "^2.4.1",
18
18
  "rimraf": "^5.0.5",
19
- "typescript": "^5.2.2",
20
- "@akinon/typescript-config": "0.3.0",
21
- "@akinon/ui-theme": "0.6.0"
19
+ "typescript": "*",
20
+ "@akinon/typescript-config": "1.0.0",
21
+ "@akinon/ui-theme": "1.0.0"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=18",
@@ -38,7 +38,7 @@
38
38
  "build": "pnpm run build:esm && pnpm run build:commonjs && pnpm run copy:files",
39
39
  "build:esm": "tsc --outDir dist/esm",
40
40
  "build:commonjs": "tsc --module commonjs --outDir dist/cjs",
41
- "copy:files": "copyfiles -u 1 src/**/*.css dist/esm && copyfiles -u 1 src/**/*.css dist/cjs",
41
+ "copy:files": "copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/esm && copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/cjs",
42
42
  "clean": "rimraf dist/",
43
43
  "typecheck": "tsc --noEmit"
44
44
  }