@bbki.ng/components 1.4.7 → 1.4.8
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 +9 -2
- package/dist/index.js +29 -7
- package/dist/index.mjs +28 -7
- package/package.json +1 -1
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,
|
|
@@ -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)(
|
|
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,
|
|
@@ -266,20 +272,35 @@ var Panel = (props) => {
|
|
|
266
272
|
}, children);
|
|
267
273
|
};
|
|
268
274
|
|
|
269
|
-
// src/
|
|
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__ */
|
|
294
|
+
return /* @__PURE__ */ import_react9.default.createElement(Panel, {
|
|
274
295
|
className
|
|
275
|
-
}, /* @__PURE__ */
|
|
296
|
+
}, /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
276
297
|
className: "mb-32"
|
|
277
|
-
}, children || content), /* @__PURE__ */
|
|
298
|
+
}, children || content), /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
278
299
|
className: "flex justify-end"
|
|
279
|
-
}, onCancel && /* @__PURE__ */
|
|
300
|
+
}, onCancel && /* @__PURE__ */ import_react9.default.createElement(Button, {
|
|
280
301
|
onClick: onCancel,
|
|
281
302
|
type: "normal" /* NORMAL */
|
|
282
|
-
}, "Cancel"), onOk && /* @__PURE__ */
|
|
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
|
@@ -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(
|
|
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,
|
|
@@ -224,20 +229,35 @@ var Panel = (props) => {
|
|
|
224
229
|
}, children);
|
|
225
230
|
};
|
|
226
231
|
|
|
227
|
-
// src/
|
|
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__ */
|
|
251
|
+
return /* @__PURE__ */ React10.createElement(Panel, {
|
|
232
252
|
className
|
|
233
|
-
}, /* @__PURE__ */
|
|
253
|
+
}, /* @__PURE__ */ React10.createElement("div", {
|
|
234
254
|
className: "mb-32"
|
|
235
|
-
}, children || content), /* @__PURE__ */
|
|
255
|
+
}, children || content), /* @__PURE__ */ React10.createElement("div", {
|
|
236
256
|
className: "flex justify-end"
|
|
237
|
-
}, onCancel && /* @__PURE__ */
|
|
257
|
+
}, onCancel && /* @__PURE__ */ React10.createElement(Button, {
|
|
238
258
|
onClick: onCancel,
|
|
239
259
|
type: "normal" /* NORMAL */
|
|
240
|
-
}, "Cancel"), onOk && /* @__PURE__ */
|
|
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,
|