@bbki.ng/components 1.4.5 → 1.4.9

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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React, { EventHandler } from 'react';
1
+ import React, { EventHandler, ReactElement } from 'react';
2
2
  import { LinkProps as LinkProps$1 } from 'react-router-dom';
3
3
 
4
4
  declare type ArticleProps = {
@@ -76,6 +76,13 @@ declare type PanelProps = {
76
76
  };
77
77
  declare const Panel: (props: PanelProps) => JSX.Element;
78
78
 
79
+ declare type PageProps = {
80
+ nav: ReactElement;
81
+ main: ReactElement;
82
+ footer: ReactElement;
83
+ };
84
+ declare const Page: (props: PageProps) => JSX.Element;
85
+
79
86
  declare type PopConfirmProps = {
80
87
  onOk?: EventHandler<React.MouseEvent<HTMLButtonElement>>;
81
88
  onCancel?: EventHandler<React.MouseEvent<HTMLButtonElement>>;
@@ -86,4 +93,4 @@ declare type PopConfirmProps = {
86
93
  };
87
94
  declare const PopConfirm: (props: PopConfirmProps) => JSX.Element;
88
95
 
89
- export { Article, ArticleProps, Breadcrumb, BreadcrumbProps, Button, ButtonProps, ButtonType, Link, LinkColor, LinkProps, Logo, LogoProps, Nav, NavProps, Panel, PanelProps, PathObj, PopConfirm, PopConfirmProps, Tag, TagProps, Tags };
96
+ export { Article, ArticleProps, Breadcrumb, BreadcrumbProps, Button, ButtonProps, ButtonType, Link, LinkColor, LinkProps, Logo, LogoProps, Nav, NavProps, Page, Panel, PanelProps, PathObj, PopConfirm, PopConfirmProps, Tag, TagProps, Tags };
package/dist/index.js CHANGED
@@ -66,6 +66,7 @@ __export(src_exports, {
66
66
  LinkColor: () => LinkColor,
67
67
  Logo: () => Logo,
68
68
  Nav: () => Nav,
69
+ Page: () => Page,
69
70
  Panel: () => Panel,
70
71
  PopConfirm: () => PopConfirm,
71
72
  Tag: () => Tag,
@@ -80,7 +81,7 @@ var Article = (props) => {
80
81
  return /* @__PURE__ */ import_react.default.createElement("div", {
81
82
  className: (0, import_classnames.default)("article", className)
82
83
  }, /* @__PURE__ */ import_react.default.createElement("div", {
83
- className: "text-[2.25rem]"
84
+ className: "text-[2.25rem] leading-none"
84
85
  }, title), /* @__PURE__ */ import_react.default.createElement("hr", {
85
86
  className: "my-64 border-gray-200"
86
87
  }), /* @__PURE__ */ import_react.default.createElement("div", {
@@ -172,6 +173,11 @@ var HOVER_COLOR_MAPPING = {
172
173
  ["red" /* RED */]: "hover:bg-red-100",
173
174
  ["gray" /* GRAY */]: "hover:bg-gray-100"
174
175
  };
176
+ var FOCUS_BG_COLOR_MAPPING = {
177
+ ["blue" /* BLUE */]: "focus:bg-blue-600",
178
+ ["red" /* RED */]: "focus:bg-red-500",
179
+ ["gray" /* GRAY */]: "focus:bg-gray-400"
180
+ };
175
181
  var Link = (props) => {
176
182
  const _a = props, {
177
183
  color = "blue" /* BLUE */,
@@ -184,7 +190,7 @@ var Link = (props) => {
184
190
  "className",
185
191
  "children"
186
192
  ]);
187
- const linkCls = (0, import_classnames2.default)(COLOR_MAPPING[color], className, "rounded", "no-underline", "transition-colors", HOVER_COLOR_MAPPING[color]);
193
+ const linkCls = (0, import_classnames2.default)(className, "rounded", "no-underline", "transition-colors", "focus:text-white", COLOR_MAPPING[color], HOVER_COLOR_MAPPING[color], FOCUS_BG_COLOR_MAPPING[color]);
188
194
  if (external) {
189
195
  return /* @__PURE__ */ import_react3.default.createElement("a", {
190
196
  href: props.to,
@@ -205,7 +211,7 @@ var Breadcrumb = (props) => {
205
211
  const slash = index === 0 ? null : /* @__PURE__ */ import_react4.default.createElement("span", {
206
212
  className: "text-gray-400"
207
213
  }, "/");
208
- const isNonEnName = !/^[a-zA-Z]+$/.test(name);
214
+ const isNonEnName = !/^[a-zA-Z~]+$/.test(name);
209
215
  const offsetCls = (0, import_classnames3.default)({ "relative top-[2px]": isNonEnName });
210
216
  const link = path ? /* @__PURE__ */ import_react4.default.createElement(Link, {
211
217
  to: path
@@ -266,20 +272,35 @@ var Panel = (props) => {
266
272
  }, children);
267
273
  };
268
274
 
269
- // src/pop-confirm/PopConfirm.tsx
275
+ // src/page/Page.tsx
270
276
  var import_react8 = __toESM(require("react"));
277
+ var Page = (props) => {
278
+ const { nav, main, footer } = props;
279
+ return /* @__PURE__ */ import_react8.default.createElement("main", {
280
+ className: "flex flex-col h-full"
281
+ }, /* @__PURE__ */ import_react8.default.createElement("div", {
282
+ className: `flx-grow-0 w-full sticky top-0 z-50`
283
+ }, nav), /* @__PURE__ */ import_react8.default.createElement("section", {
284
+ className: "flex-grow flex-shrink-0 px-6"
285
+ }, main), footer && /* @__PURE__ */ import_react8.default.createElement("footer", {
286
+ className: "flex-grow-0 flex-shrink-0 flex items-center justify-center h-64"
287
+ }, footer));
288
+ };
289
+
290
+ // src/pop-confirm/PopConfirm.tsx
291
+ var import_react9 = __toESM(require("react"));
271
292
  var PopConfirm = (props) => {
272
293
  const { onOk, onCancel, children, content, className } = props;
273
- return /* @__PURE__ */ import_react8.default.createElement(Panel, {
294
+ return /* @__PURE__ */ import_react9.default.createElement(Panel, {
274
295
  className
275
- }, /* @__PURE__ */ import_react8.default.createElement("div", {
296
+ }, /* @__PURE__ */ import_react9.default.createElement("div", {
276
297
  className: "mb-32"
277
- }, children || content), /* @__PURE__ */ import_react8.default.createElement("div", {
298
+ }, children || content), /* @__PURE__ */ import_react9.default.createElement("div", {
278
299
  className: "flex justify-end"
279
- }, onCancel && /* @__PURE__ */ import_react8.default.createElement(Button, {
300
+ }, onCancel && /* @__PURE__ */ import_react9.default.createElement(Button, {
280
301
  onClick: onCancel,
281
302
  type: "normal" /* NORMAL */
282
- }, "Cancel"), onOk && /* @__PURE__ */ import_react8.default.createElement(Button, {
303
+ }, "Cancel"), onOk && /* @__PURE__ */ import_react9.default.createElement(Button, {
283
304
  onClick: onOk,
284
305
  className: "ml-16",
285
306
  type: "primary" /* PRIMARY */
@@ -296,6 +317,7 @@ module.exports = __toCommonJS(src_exports);
296
317
  LinkColor,
297
318
  Logo,
298
319
  Nav,
320
+ Page,
299
321
  Panel,
300
322
  PopConfirm,
301
323
  Tag,
package/dist/index.mjs CHANGED
@@ -38,7 +38,7 @@ var Article = (props) => {
38
38
  return /* @__PURE__ */ React.createElement("div", {
39
39
  className: classNames("article", className)
40
40
  }, /* @__PURE__ */ React.createElement("div", {
41
- className: "text-[2.25rem]"
41
+ className: "text-[2.25rem] leading-none"
42
42
  }, title), /* @__PURE__ */ React.createElement("hr", {
43
43
  className: "my-64 border-gray-200"
44
44
  }), /* @__PURE__ */ React.createElement("div", {
@@ -130,6 +130,11 @@ var HOVER_COLOR_MAPPING = {
130
130
  ["red" /* RED */]: "hover:bg-red-100",
131
131
  ["gray" /* GRAY */]: "hover:bg-gray-100"
132
132
  };
133
+ var FOCUS_BG_COLOR_MAPPING = {
134
+ ["blue" /* BLUE */]: "focus:bg-blue-600",
135
+ ["red" /* RED */]: "focus:bg-red-500",
136
+ ["gray" /* GRAY */]: "focus:bg-gray-400"
137
+ };
133
138
  var Link = (props) => {
134
139
  const _a = props, {
135
140
  color = "blue" /* BLUE */,
@@ -142,7 +147,7 @@ var Link = (props) => {
142
147
  "className",
143
148
  "children"
144
149
  ]);
145
- const linkCls = classNames2(COLOR_MAPPING[color], className, "rounded", "no-underline", "transition-colors", HOVER_COLOR_MAPPING[color]);
150
+ const linkCls = classNames2(className, "rounded", "no-underline", "transition-colors", "focus:text-white", COLOR_MAPPING[color], HOVER_COLOR_MAPPING[color], FOCUS_BG_COLOR_MAPPING[color]);
146
151
  if (external) {
147
152
  return /* @__PURE__ */ React4.createElement("a", {
148
153
  href: props.to,
@@ -163,7 +168,7 @@ var Breadcrumb = (props) => {
163
168
  const slash = index === 0 ? null : /* @__PURE__ */ React5.createElement("span", {
164
169
  className: "text-gray-400"
165
170
  }, "/");
166
- const isNonEnName = !/^[a-zA-Z]+$/.test(name);
171
+ const isNonEnName = !/^[a-zA-Z~]+$/.test(name);
167
172
  const offsetCls = classNames3({ "relative top-[2px]": isNonEnName });
168
173
  const link = path ? /* @__PURE__ */ React5.createElement(Link, {
169
174
  to: path
@@ -224,20 +229,35 @@ var Panel = (props) => {
224
229
  }, children);
225
230
  };
226
231
 
227
- // src/pop-confirm/PopConfirm.tsx
232
+ // src/page/Page.tsx
228
233
  import React9 from "react";
234
+ var Page = (props) => {
235
+ const { nav, main, footer } = props;
236
+ return /* @__PURE__ */ React9.createElement("main", {
237
+ className: "flex flex-col h-full"
238
+ }, /* @__PURE__ */ React9.createElement("div", {
239
+ className: `flx-grow-0 w-full sticky top-0 z-50`
240
+ }, nav), /* @__PURE__ */ React9.createElement("section", {
241
+ className: "flex-grow flex-shrink-0 px-6"
242
+ }, main), footer && /* @__PURE__ */ React9.createElement("footer", {
243
+ className: "flex-grow-0 flex-shrink-0 flex items-center justify-center h-64"
244
+ }, footer));
245
+ };
246
+
247
+ // src/pop-confirm/PopConfirm.tsx
248
+ import React10 from "react";
229
249
  var PopConfirm = (props) => {
230
250
  const { onOk, onCancel, children, content, className } = props;
231
- return /* @__PURE__ */ React9.createElement(Panel, {
251
+ return /* @__PURE__ */ React10.createElement(Panel, {
232
252
  className
233
- }, /* @__PURE__ */ React9.createElement("div", {
253
+ }, /* @__PURE__ */ React10.createElement("div", {
234
254
  className: "mb-32"
235
- }, children || content), /* @__PURE__ */ React9.createElement("div", {
255
+ }, children || content), /* @__PURE__ */ React10.createElement("div", {
236
256
  className: "flex justify-end"
237
- }, onCancel && /* @__PURE__ */ React9.createElement(Button, {
257
+ }, onCancel && /* @__PURE__ */ React10.createElement(Button, {
238
258
  onClick: onCancel,
239
259
  type: "normal" /* NORMAL */
240
- }, "Cancel"), onOk && /* @__PURE__ */ React9.createElement(Button, {
260
+ }, "Cancel"), onOk && /* @__PURE__ */ React10.createElement(Button, {
241
261
  onClick: onOk,
242
262
  className: "ml-16",
243
263
  type: "primary" /* PRIMARY */
@@ -252,6 +272,7 @@ export {
252
272
  LinkColor,
253
273
  Logo,
254
274
  Nav,
275
+ Page,
255
276
  Panel,
256
277
  PopConfirm,
257
278
  Tag,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/components",
3
- "version": "1.4.5",
3
+ "version": "1.4.9",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",