@akinon/ui-divider 0.5.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.
@@ -1,4 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import type { DividerProps } from './types';
3
+ export type * from './types';
4
+ /**
5
+ * The `Divider` component provides a way to visually separate content within a layout.
6
+ * It supports both horizontal and vertical orientations and can include optional text or content within the divider.
7
+ * Additional customization options like dashed lines and alignment make it versatile for various design needs.
8
+ */
3
9
  export declare const Divider: ({ children, plainOffset, ...antdProps }: DividerProps) => React.JSX.Element;
4
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,OAAO,4CAIjB,YAAY,sBA6Cd,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,mBAAmB,SAAS,CAAC;AAE7B;;;;GAIG;AAEH,eAAO,MAAM,OAAO,4CAIjB,YAAY,sBA8Cd,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -16,6 +16,11 @@ 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
+ * The `Divider` component provides a way to visually separate content within a layout.
21
+ * It supports both horizontal and vertical orientations and can include optional text or content within the divider.
22
+ * Additional customization options like dashed lines and alignment make it versatile for various design needs.
23
+ */
19
24
  const Divider = (_a) => {
20
25
  var { children, plainOffset } = _a, antdProps = __rest(_a, ["children", "plainOffset"]);
21
26
  const { getPrefixCls, theme } = React.useContext(antd_1.ConfigProvider.ConfigContext);
@@ -29,18 +34,19 @@ const Divider = (_a) => {
29
34
  }, () => {
30
35
  const prefixClsWithoutHash = `.${getPrefixCls()}-divider`;
31
36
  const prefixCls = `:where(.${hashId})${prefixClsWithoutHash}`;
37
+ const customTokens = theme.CustomTokens || {};
32
38
  return {
33
39
  [`${prefixCls}-plain`]: {
34
40
  [`&${prefixCls}-horizontal${prefixClsWithoutHash}-with-text-left`]: {
35
41
  '&:before': {
36
42
  width: plainOffset
37
43
  ? `${plainOffset - dividerToken.textPaddingInline}px`
38
- : 'auto',
44
+ : customTokens.sizing.valueAuto,
39
45
  marginInlineStart: plainOffset ? `-${plainOffset}px` : '-40px'
40
46
  },
41
47
  '&:after': {
42
- width: '100%',
43
- marginInlineStart: 0,
48
+ width: customTokens.sizing.valueFull,
49
+ marginInlineStart: customTokens.sizing.valueZero,
44
50
  marginInlineEnd: plainOffset ? `-${plainOffset}px` : '-40px'
45
51
  }
46
52
  },
@@ -6,43 +6,53 @@ export type DividerProps = {
6
6
  * @default 'horizontal'
7
7
  */
8
8
  type?: 'horizontal' | 'vertical';
9
+
9
10
  /**
10
11
  * Select the orientation of divider.
11
12
  * @default 'left'
12
13
  */
13
14
  orientation?: 'left' | 'right' | 'center';
15
+
14
16
  /**
15
17
  * The margin of divider relative to orientation.
16
18
  */
17
19
  orientationMargin?: string | number;
20
+
18
21
  /**
19
22
  * Whether the divider is plain.
20
23
  * @default false
21
24
  */
22
25
  plain?: boolean;
26
+
23
27
  /**
24
28
  * Whether the divider is dashed.
25
29
  * @default false
26
30
  */
27
31
  dashed?: boolean;
32
+
28
33
  /**
29
34
  * The negative offset of plain divider.
30
35
  * Use this prop to set the negative inline margin of plain divider.
31
36
  */
32
37
  plainOffset?: number;
38
+
33
39
  /**
34
40
  * The class name of the divider.
35
41
  */
36
42
  className?: string;
43
+
37
44
  /**
38
45
  * The root class name of the divider.
39
46
  */
40
47
  rootClassName?: string;
48
+
41
49
  /**
42
50
  * The children of the divider.
43
51
  */
44
52
  children?: React.ReactNode;
53
+
45
54
  /**
55
+ * Internal styling property restricted by the Akinon design system.
46
56
  * @ignore
47
57
  */
48
58
  style?: DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE;
@@ -1,4 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import type { DividerProps } from './types';
3
+ export type * from './types';
4
+ /**
5
+ * The `Divider` component provides a way to visually separate content within a layout.
6
+ * It supports both horizontal and vertical orientations and can include optional text or content within the divider.
7
+ * Additional customization options like dashed lines and alignment make it versatile for various design needs.
8
+ */
3
9
  export declare const Divider: ({ children, plainOffset, ...antdProps }: DividerProps) => React.JSX.Element;
4
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,OAAO,4CAIjB,YAAY,sBA6Cd,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,mBAAmB,SAAS,CAAC;AAE7B;;;;GAIG;AAEH,eAAO,MAAM,OAAO,4CAIjB,YAAY,sBA8Cd,CAAC"}
package/dist/esm/index.js CHANGED
@@ -13,6 +13,11 @@ import { useToken } from '@akinon/ui-theme';
13
13
  import { useStyleRegister } from '@ant-design/cssinjs';
14
14
  import { ConfigProvider, Divider as AntDivider } from 'antd';
15
15
  import * as React from 'react';
16
+ /**
17
+ * The `Divider` component provides a way to visually separate content within a layout.
18
+ * It supports both horizontal and vertical orientations and can include optional text or content within the divider.
19
+ * Additional customization options like dashed lines and alignment make it versatile for various design needs.
20
+ */
16
21
  export const Divider = (_a) => {
17
22
  var { children, plainOffset } = _a, antdProps = __rest(_a, ["children", "plainOffset"]);
18
23
  const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
@@ -26,18 +31,19 @@ export const Divider = (_a) => {
26
31
  }, () => {
27
32
  const prefixClsWithoutHash = `.${getPrefixCls()}-divider`;
28
33
  const prefixCls = `:where(.${hashId})${prefixClsWithoutHash}`;
34
+ const customTokens = theme.CustomTokens || {};
29
35
  return {
30
36
  [`${prefixCls}-plain`]: {
31
37
  [`&${prefixCls}-horizontal${prefixClsWithoutHash}-with-text-left`]: {
32
38
  '&:before': {
33
39
  width: plainOffset
34
40
  ? `${plainOffset - dividerToken.textPaddingInline}px`
35
- : 'auto',
41
+ : customTokens.sizing.valueAuto,
36
42
  marginInlineStart: plainOffset ? `-${plainOffset}px` : '-40px'
37
43
  },
38
44
  '&:after': {
39
- width: '100%',
40
- marginInlineStart: 0,
45
+ width: customTokens.sizing.valueFull,
46
+ marginInlineStart: customTokens.sizing.valueZero,
41
47
  marginInlineEnd: plainOffset ? `-${plainOffset}px` : '-40px'
42
48
  }
43
49
  },
@@ -6,43 +6,53 @@ export type DividerProps = {
6
6
  * @default 'horizontal'
7
7
  */
8
8
  type?: 'horizontal' | 'vertical';
9
+
9
10
  /**
10
11
  * Select the orientation of divider.
11
12
  * @default 'left'
12
13
  */
13
14
  orientation?: 'left' | 'right' | 'center';
15
+
14
16
  /**
15
17
  * The margin of divider relative to orientation.
16
18
  */
17
19
  orientationMargin?: string | number;
20
+
18
21
  /**
19
22
  * Whether the divider is plain.
20
23
  * @default false
21
24
  */
22
25
  plain?: boolean;
26
+
23
27
  /**
24
28
  * Whether the divider is dashed.
25
29
  * @default false
26
30
  */
27
31
  dashed?: boolean;
32
+
28
33
  /**
29
34
  * The negative offset of plain divider.
30
35
  * Use this prop to set the negative inline margin of plain divider.
31
36
  */
32
37
  plainOffset?: number;
38
+
33
39
  /**
34
40
  * The class name of the divider.
35
41
  */
36
42
  className?: string;
43
+
37
44
  /**
38
45
  * The root class name of the divider.
39
46
  */
40
47
  rootClassName?: string;
48
+
41
49
  /**
42
50
  * The children of the divider.
43
51
  */
44
52
  children?: React.ReactNode;
53
+
45
54
  /**
55
+ * Internal styling property restricted by the Akinon design system.
46
56
  * @ignore
47
57
  */
48
58
  style?: DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/ui-divider",
3
- "version": "0.5.0",
3
+ "version": "1.0.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",
@@ -9,15 +9,15 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "antd": "5.17.0"
12
+ "antd": "5.22.6"
13
13
  },
14
14
  "devDependencies": {
15
15
  "clean-package": "2.2.0",
16
16
  "copyfiles": "^2.4.1",
17
17
  "rimraf": "^5.0.5",
18
- "typescript": "^5.2.2",
19
- "@akinon/ui-theme": "0.7.0",
20
- "@akinon/typescript-config": "0.4.0"
18
+ "typescript": "*",
19
+ "@akinon/ui-theme": "1.0.1",
20
+ "@akinon/typescript-config": "1.0.1"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": ">=18",