@bbki.ng/components 1.4.3 → 1.4.7

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.
package/dist/index.css CHANGED
File without changes
package/dist/index.d.ts CHANGED
@@ -1,89 +1,89 @@
1
1
  import React, { EventHandler } from 'react';
2
2
  import { LinkProps as LinkProps$1 } from 'react-router-dom';
3
3
 
4
- declare type ArticleProps = {
5
- title: string;
6
- className?: string;
7
- content?: any;
8
- children: any;
9
- };
4
+ declare type ArticleProps = {
5
+ title: string;
6
+ className?: string;
7
+ content?: any;
8
+ children: any;
9
+ };
10
10
  declare const Article: (props: ArticleProps) => JSX.Element;
11
11
 
12
- declare enum ButtonType {
13
- DANGER = "danger",
14
- PRIMARY = "primary",
15
- NORMAL = "normal",
16
- DISABLED = "disabled"
17
- }
18
- interface ButtonProps {
19
- className?: string;
20
- children: React.ReactNode;
21
- type?: ButtonType;
22
- onClick: EventHandler<React.MouseEvent<HTMLButtonElement>>;
23
- }
24
- declare function Button(props: ButtonProps): JSX.Element;
25
- declare namespace Button {
26
- var displayName: string;
12
+ declare enum ButtonType {
13
+ DANGER = "danger",
14
+ PRIMARY = "primary",
15
+ NORMAL = "normal",
16
+ DISABLED = "disabled"
17
+ }
18
+ interface ButtonProps {
19
+ className?: string;
20
+ children: React.ReactNode;
21
+ type?: ButtonType;
22
+ onClick: EventHandler<React.MouseEvent<HTMLButtonElement>>;
23
+ }
24
+ declare function Button(props: ButtonProps): JSX.Element;
25
+ declare namespace Button {
26
+ var displayName: string;
27
27
  }
28
28
 
29
- declare type LogoProps = {
30
- className?: string;
31
- };
29
+ declare type LogoProps = {
30
+ className?: string;
31
+ };
32
32
  declare const Logo: (props: LogoProps) => JSX.Element;
33
33
 
34
- declare type PathObj = {
35
- path?: string;
36
- name: string;
37
- };
38
- declare type BreadcrumbProps = {
39
- paths: PathObj[];
40
- };
34
+ declare type PathObj = {
35
+ path?: string;
36
+ name: string;
37
+ };
38
+ declare type BreadcrumbProps = {
39
+ paths: PathObj[];
40
+ };
41
41
  declare const Breadcrumb: (props: BreadcrumbProps) => JSX.Element;
42
42
 
43
- declare type NavProps = {
44
- paths: PathObj[];
45
- className?: string;
46
- };
43
+ declare type NavProps = {
44
+ paths: PathObj[];
45
+ className?: string;
46
+ };
47
47
  declare const Nav: (props: NavProps) => JSX.Element;
48
48
 
49
- declare enum LinkColor {
50
- BLUE = "blue",
51
- RED = "red",
52
- GRAY = "gray"
53
- }
54
- interface LinkProps extends LinkProps$1 {
55
- color?: LinkColor;
56
- className?: string;
57
- external?: boolean;
58
- to: string;
59
- children: any;
60
- }
49
+ declare enum LinkColor {
50
+ BLUE = "blue",
51
+ RED = "red",
52
+ GRAY = "gray"
53
+ }
54
+ interface LinkProps extends LinkProps$1 {
55
+ color?: LinkColor;
56
+ className?: string;
57
+ external?: boolean;
58
+ to: string;
59
+ children: any;
60
+ }
61
61
  declare const Link: (props: LinkProps) => JSX.Element;
62
62
 
63
- interface TagProps extends Pick<LinkProps, "to" | "children" | "className"> {
64
- name?: string;
65
- }
66
- declare const Tag: (props: TagProps) => JSX.Element;
67
- declare const Tags: (props: {
68
- tags: TagProps[];
69
- className?: string;
63
+ interface TagProps extends Pick<LinkProps, "to" | "children" | "className"> {
64
+ name?: string;
65
+ }
66
+ declare const Tag: (props: TagProps) => JSX.Element;
67
+ declare const Tags: (props: {
68
+ tags: TagProps[];
69
+ className?: string;
70
70
  }) => JSX.Element;
71
71
 
72
- declare type PanelProps = {
73
- width?: number;
74
- children: any;
75
- className?: string;
76
- };
72
+ declare type PanelProps = {
73
+ width?: number;
74
+ children: any;
75
+ className?: string;
76
+ };
77
77
  declare const Panel: (props: PanelProps) => JSX.Element;
78
78
 
79
- declare type PopConfirmProps = {
80
- onOk?: EventHandler<React.MouseEvent<HTMLButtonElement>>;
81
- onCancel?: EventHandler<React.MouseEvent<HTMLButtonElement>>;
82
- className?: string;
83
- content?: any;
84
- children?: any;
85
- width?: number;
86
- };
79
+ declare type PopConfirmProps = {
80
+ onOk?: EventHandler<React.MouseEvent<HTMLButtonElement>>;
81
+ onCancel?: EventHandler<React.MouseEvent<HTMLButtonElement>>;
82
+ className?: string;
83
+ content?: any;
84
+ children?: any;
85
+ width?: number;
86
+ };
87
87
  declare const PopConfirm: (props: PopConfirmProps) => JSX.Element;
88
88
 
89
89
  export { Article, ArticleProps, Breadcrumb, BreadcrumbProps, Button, ButtonProps, ButtonType, Link, LinkColor, LinkProps, Logo, LogoProps, Nav, NavProps, Panel, PanelProps, PathObj, PopConfirm, PopConfirmProps, Tag, TagProps, Tags };
package/dist/index.js CHANGED
@@ -150,6 +150,7 @@ var import_react5 = __toESM(require("react"));
150
150
 
151
151
  // src/breadcrumb/Breadcrumb.tsx
152
152
  var import_react4 = __toESM(require("react"));
153
+ var import_classnames3 = __toESM(require("classnames"));
153
154
 
154
155
  // src/link/Link.tsx
155
156
  var import_classnames2 = __toESM(require("classnames"));
@@ -204,10 +205,12 @@ var Breadcrumb = (props) => {
204
205
  const slash = index === 0 ? null : /* @__PURE__ */ import_react4.default.createElement("span", {
205
206
  className: "text-gray-400"
206
207
  }, "/");
208
+ const isNonEnName = !/^[a-zA-Z~]+$/.test(name);
209
+ const offsetCls = (0, import_classnames3.default)({ "relative top-[2px]": isNonEnName });
207
210
  const link = path ? /* @__PURE__ */ import_react4.default.createElement(Link, {
208
211
  to: path
209
212
  }, name) : /* @__PURE__ */ import_react4.default.createElement("span", {
210
- className: "text-gray-400"
213
+ className: (0, import_classnames3.default)("text-gray-400", offsetCls)
211
214
  }, name);
212
215
  return /* @__PURE__ */ import_react4.default.createElement("span", {
213
216
  key: path || name
@@ -230,7 +233,7 @@ var Nav = (props) => {
230
233
  };
231
234
 
232
235
  // src/tag/Tag.tsx
233
- var import_classnames3 = __toESM(require("classnames"));
236
+ var import_classnames4 = __toESM(require("classnames"));
234
237
  var import_react6 = __toESM(require("react"));
235
238
  var Tag = (props) => {
236
239
  return /* @__PURE__ */ import_react6.default.createElement(Link, __spreadProps(__spreadValues({}, props), {
@@ -240,12 +243,12 @@ var Tag = (props) => {
240
243
  var Tags = (props) => {
241
244
  const { tags, className } = props;
242
245
  return /* @__PURE__ */ import_react6.default.createElement("div", {
243
- className: (0, import_classnames3.default)(className, "inline-block")
246
+ className: (0, import_classnames4.default)(className, "inline-block")
244
247
  }, tags.map((tag, index) => {
245
248
  const isLast = index === tags.length - 1;
246
249
  return /* @__PURE__ */ import_react6.default.createElement(Tag, __spreadProps(__spreadValues({}, tag), {
247
250
  key: tag.to,
248
- className: (0, import_classnames3.default)({ "mr-8": !isLast })
251
+ className: (0, import_classnames4.default)({ "mr-8": !isLast })
249
252
  }));
250
253
  }));
251
254
  };
package/dist/index.mjs CHANGED
@@ -108,6 +108,7 @@ import React6 from "react";
108
108
 
109
109
  // src/breadcrumb/Breadcrumb.tsx
110
110
  import React5 from "react";
111
+ import classNames3 from "classnames";
111
112
 
112
113
  // src/link/Link.tsx
113
114
  import classNames2 from "classnames";
@@ -162,10 +163,12 @@ var Breadcrumb = (props) => {
162
163
  const slash = index === 0 ? null : /* @__PURE__ */ React5.createElement("span", {
163
164
  className: "text-gray-400"
164
165
  }, "/");
166
+ const isNonEnName = !/^[a-zA-Z~]+$/.test(name);
167
+ const offsetCls = classNames3({ "relative top-[2px]": isNonEnName });
165
168
  const link = path ? /* @__PURE__ */ React5.createElement(Link, {
166
169
  to: path
167
170
  }, name) : /* @__PURE__ */ React5.createElement("span", {
168
- className: "text-gray-400"
171
+ className: classNames3("text-gray-400", offsetCls)
169
172
  }, name);
170
173
  return /* @__PURE__ */ React5.createElement("span", {
171
174
  key: path || name
@@ -188,7 +191,7 @@ var Nav = (props) => {
188
191
  };
189
192
 
190
193
  // src/tag/Tag.tsx
191
- import classNames3 from "classnames";
194
+ import classNames4 from "classnames";
192
195
  import React7 from "react";
193
196
  var Tag = (props) => {
194
197
  return /* @__PURE__ */ React7.createElement(Link, __spreadProps(__spreadValues({}, props), {
@@ -198,12 +201,12 @@ var Tag = (props) => {
198
201
  var Tags = (props) => {
199
202
  const { tags, className } = props;
200
203
  return /* @__PURE__ */ React7.createElement("div", {
201
- className: classNames3(className, "inline-block")
204
+ className: classNames4(className, "inline-block")
202
205
  }, tags.map((tag, index) => {
203
206
  const isLast = index === tags.length - 1;
204
207
  return /* @__PURE__ */ React7.createElement(Tag, __spreadProps(__spreadValues({}, tag), {
205
208
  key: tag.to,
206
- className: classNames3({ "mr-8": !isLast })
209
+ className: classNames4({ "mr-8": !isLast })
207
210
  }));
208
211
  }));
209
212
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/components",
3
- "version": "1.4.3",
3
+ "version": "1.4.7",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -32,7 +32,7 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "dependencies": {
35
+ "peerDependencies": {
36
36
  "classnames": "^2.3.1",
37
37
  "react-router-dom": "5.3.0"
38
38
  }
package/CHANGELOG.md DELETED
@@ -1,15 +0,0 @@
1
- # @bbki.ng/components
2
-
3
- ## 1.4.3
4
-
5
- ## 1.4.2
6
-
7
- ## 1.4.1
8
-
9
- ## 1.4.0
10
-
11
- ## 1.3.1
12
-
13
- ## 1.3.0
14
-
15
- ## 1.2.0