@bbki.ng/components 1.5.6 → 1.5.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,13 +1,14 @@
1
- import React, { EventHandler, ReactElement, CSSProperties, Ref, ReactNode, FunctionComponent } from 'react';
1
+ import React, { FunctionComponent, EventHandler, ReactElement, CSSProperties, Ref, ReactNode } from 'react';
2
2
  import { LinkProps as LinkProps$1 } from 'react-router-dom';
3
3
 
4
4
  declare type ArticleProps = {
5
- title: string;
5
+ title: any;
6
6
  className?: string;
7
7
  content?: any;
8
8
  children: any;
9
+ description?: any;
9
10
  };
10
- declare const Article: (props: ArticleProps) => JSX.Element;
11
+ declare const Article: FunctionComponent<ArticleProps>;
11
12
 
12
13
  declare enum ButtonType {
13
14
  DANGER = "danger",
@@ -55,8 +56,9 @@ interface LinkProps extends LinkProps$1 {
55
56
  color?: LinkColor;
56
57
  className?: string;
57
58
  external?: boolean;
59
+ name?: any;
60
+ children?: any;
58
61
  to: string;
59
- children: any;
60
62
  }
61
63
  declare const Link: (props: LinkProps) => JSX.Element;
62
64
 
@@ -153,4 +155,31 @@ declare type BLinkDotProps = {
153
155
  };
154
156
  declare const BlinkDot: (props: BLinkDotProps) => JSX.Element;
155
157
 
156
- export { Article, ArticleProps, BLinkDotProps, BlinkDot, Breadcrumb, BreadcrumbProps, Button, ButtonProps, ButtonType, DropImage, ImageDropProps, ImagePreviewerProps, Link, LinkColor, LinkProps, Logo, LogoProps, Nav, NavProps, Page, Panel, PanelProps, PathObj, PopConfirm, PopConfirmProps, Skeleton, SkeletonColor, SkeletonProps, Table, TableProps, Tag, TagProps, Tags };
158
+ declare type threeColLayoutProps = {
159
+ leftRenderer?: () => ReactElement | null;
160
+ rightRenderer?: () => ReactElement | null;
161
+ middleRenderer?: () => ReactElement | null;
162
+ };
163
+ declare const ThreeColLayout: (props: threeColLayoutProps) => JSX.Element;
164
+
165
+ interface listProps {
166
+ className?: string;
167
+ compact?: boolean;
168
+ items: any[];
169
+ itemRenderer: (itemProps: any, index: number) => ReactElement;
170
+ horizontal?: boolean;
171
+ }
172
+ declare const List: FunctionComponent<listProps>;
173
+ interface TitledListProps extends listProps {
174
+ title?: any;
175
+ description?: any;
176
+ }
177
+ declare const TitledList: FunctionComponent<TitledListProps>;
178
+ interface LinkListProps extends Omit<listProps, "itemRenderer" | "items"> {
179
+ title?: string;
180
+ description?: any;
181
+ links: LinkProps[];
182
+ }
183
+ declare const LinkList: (props: LinkListProps) => JSX.Element;
184
+
185
+ export { Article, ArticleProps, BLinkDotProps, BlinkDot, Breadcrumb, BreadcrumbProps, Button, ButtonProps, ButtonType, DropImage, ImageDropProps, ImagePreviewerProps, Link, LinkColor, LinkList, LinkListProps, LinkProps, List, Logo, LogoProps, Nav, NavProps, Page, Panel, PanelProps, PathObj, PopConfirm, PopConfirmProps, Skeleton, SkeletonColor, SkeletonProps, Table, TableProps, Tag, TagProps, Tags, ThreeColLayout, TitledList, TitledListProps, listProps, threeColLayoutProps };
package/dist/index.js CHANGED
@@ -66,6 +66,8 @@ __export(src_exports, {
66
66
  DropImage: () => DropImage,
67
67
  Link: () => Link,
68
68
  LinkColor: () => LinkColor,
69
+ LinkList: () => LinkList,
70
+ List: () => List,
69
71
  Logo: () => Logo,
70
72
  Nav: () => Nav,
71
73
  Page: () => Page,
@@ -75,21 +77,25 @@ __export(src_exports, {
75
77
  SkeletonColor: () => SkeletonColor,
76
78
  Table: () => Table,
77
79
  Tag: () => Tag,
78
- Tags: () => Tags
80
+ Tags: () => Tags,
81
+ ThreeColLayout: () => ThreeColLayout,
82
+ TitledList: () => TitledList
79
83
  });
80
84
 
81
85
  // src/article/Article.tsx
82
86
  var import_classnames = __toESM(require("classnames"));
83
87
  var import_react = __toESM(require("react"));
84
88
  var Article = (props) => {
85
- const { title, content, children, className } = props;
89
+ const { title, content, children, className, description } = props;
86
90
  return /* @__PURE__ */ import_react.default.createElement("div", {
87
91
  className: (0, import_classnames.default)("article", className)
88
92
  }, /* @__PURE__ */ import_react.default.createElement("div", {
89
93
  className: "text-[2.25rem] leading-none"
90
94
  }, title), /* @__PURE__ */ import_react.default.createElement("hr", {
91
95
  className: "my-64 border-gray-200"
92
- }), /* @__PURE__ */ import_react.default.createElement("div", {
96
+ }), description && /* @__PURE__ */ import_react.default.createElement("div", {
97
+ className: "mb-128"
98
+ }, description), /* @__PURE__ */ import_react.default.createElement("div", {
93
99
  className: "text-gray-700"
94
100
  }, children || content));
95
101
  };
@@ -623,11 +629,74 @@ var import_react15 = __toESM(require("react"));
623
629
  var BlinkDot = (props) => {
624
630
  const { className } = props;
625
631
  return /* @__PURE__ */ import_react15.default.createElement("span", {
626
- className: (0, import_classnames7.default)("inline-flex h-2 w-2 justify-center items-center relative", className)
632
+ className: (0, import_classnames7.default)("inline-flex h-1 w-1 justify-center items-center relative", className)
627
633
  }, /* @__PURE__ */ import_react15.default.createElement("span", {
628
634
  className: "animate-ping-fast absolute inline-flex h-full w-full rounded-full bg-red-600"
629
635
  }));
630
636
  };
637
+
638
+ // src/layout/layout.tsx
639
+ var import_classnames8 = __toESM(require("classnames"));
640
+ var import_react16 = __toESM(require("react"));
641
+ var ThreeColLayout = (props) => {
642
+ const { leftRenderer, middleRenderer, rightRenderer } = props;
643
+ const colCls = (0, import_classnames8.default)("max-h-full overflow-auto md:block py-64");
644
+ return /* @__PURE__ */ import_react16.default.createElement("div", {
645
+ className: "grid grid-cols-1 xl:grid-cols-3 gap-4 h-full w-full"
646
+ }, /* @__PURE__ */ import_react16.default.createElement("div", {
647
+ className: (0, import_classnames8.default)("hidden", colCls)
648
+ }, leftRenderer && leftRenderer()), /* @__PURE__ */ import_react16.default.createElement("div", {
649
+ className: (0, import_classnames8.default)(colCls, "sm:px-128 xl:px-0 no-scrollbar", "relative", {
650
+ hidden: !middleRenderer
651
+ })
652
+ }, middleRenderer && middleRenderer()), /* @__PURE__ */ import_react16.default.createElement("div", {
653
+ className: (0, import_classnames8.default)("hidden", colCls)
654
+ }, rightRenderer && rightRenderer()));
655
+ };
656
+
657
+ // src/list/list.tsx
658
+ var import_classnames9 = __toESM(require("classnames"));
659
+ var import_react17 = __toESM(require("react"));
660
+ var List = (props) => {
661
+ const { items, itemRenderer, className, horizontal, compact } = props;
662
+ const spaceCls = compact ? "" : horizontal ? "mr-3" : "mb-4";
663
+ return /* @__PURE__ */ import_react17.default.createElement("ul", {
664
+ className: (0, import_classnames9.default)(className, "list-style-none", {
665
+ flex: horizontal,
666
+ "align-center": horizontal
667
+ })
668
+ }, items.map((item, index) => {
669
+ return /* @__PURE__ */ import_react17.default.createElement("li", {
670
+ key: item.id || index,
671
+ className: (0, import_classnames9.default)(spaceCls, "flex-shrink-0")
672
+ }, itemRenderer(item, index));
673
+ }));
674
+ };
675
+ var TitledList = (props) => {
676
+ const _a = props, { title, description } = _a, rest = __objRest(_a, ["title", "description"]);
677
+ if (!title) {
678
+ return /* @__PURE__ */ import_react17.default.createElement(List, __spreadValues({}, rest));
679
+ }
680
+ return /* @__PURE__ */ import_react17.default.createElement(Article, {
681
+ title,
682
+ description
683
+ }, /* @__PURE__ */ import_react17.default.createElement(List, __spreadValues({}, rest)));
684
+ };
685
+ var LinkList = (props) => {
686
+ const _a = props, { title, description, links } = _a, rest = __objRest(_a, ["title", "description", "links"]);
687
+ const renderLink = ({ name, to }) => {
688
+ return /* @__PURE__ */ import_react17.default.createElement(Link, {
689
+ to,
690
+ key: name
691
+ }, name);
692
+ };
693
+ return /* @__PURE__ */ import_react17.default.createElement(TitledList, __spreadValues({
694
+ title,
695
+ description,
696
+ items: links,
697
+ itemRenderer: renderLink
698
+ }, rest));
699
+ };
631
700
  module.exports = __toCommonJS(src_exports);
632
701
  // Annotate the CommonJS export names for ESM import in node:
633
702
  0 && (module.exports = {
@@ -639,6 +708,8 @@ module.exports = __toCommonJS(src_exports);
639
708
  DropImage,
640
709
  Link,
641
710
  LinkColor,
711
+ LinkList,
712
+ List,
642
713
  Logo,
643
714
  Nav,
644
715
  Page,
@@ -648,5 +719,7 @@ module.exports = __toCommonJS(src_exports);
648
719
  SkeletonColor,
649
720
  Table,
650
721
  Tag,
651
- Tags
722
+ Tags,
723
+ ThreeColLayout,
724
+ TitledList
652
725
  });
package/dist/index.mjs CHANGED
@@ -34,14 +34,16 @@ var __objRest = (source, exclude) => {
34
34
  import classNames from "classnames";
35
35
  import React from "react";
36
36
  var Article = (props) => {
37
- const { title, content, children, className } = props;
37
+ const { title, content, children, className, description } = props;
38
38
  return /* @__PURE__ */ React.createElement("div", {
39
39
  className: classNames("article", className)
40
40
  }, /* @__PURE__ */ React.createElement("div", {
41
41
  className: "text-[2.25rem] leading-none"
42
42
  }, title), /* @__PURE__ */ React.createElement("hr", {
43
43
  className: "my-64 border-gray-200"
44
- }), /* @__PURE__ */ React.createElement("div", {
44
+ }), description && /* @__PURE__ */ React.createElement("div", {
45
+ className: "mb-128"
46
+ }, description), /* @__PURE__ */ React.createElement("div", {
45
47
  className: "text-gray-700"
46
48
  }, children || content));
47
49
  };
@@ -578,11 +580,74 @@ import React14 from "react";
578
580
  var BlinkDot = (props) => {
579
581
  const { className } = props;
580
582
  return /* @__PURE__ */ React14.createElement("span", {
581
- className: classNames6("inline-flex h-2 w-2 justify-center items-center relative", className)
583
+ className: classNames6("inline-flex h-1 w-1 justify-center items-center relative", className)
582
584
  }, /* @__PURE__ */ React14.createElement("span", {
583
585
  className: "animate-ping-fast absolute inline-flex h-full w-full rounded-full bg-red-600"
584
586
  }));
585
587
  };
588
+
589
+ // src/layout/layout.tsx
590
+ import cls2 from "classnames";
591
+ import React15 from "react";
592
+ var ThreeColLayout = (props) => {
593
+ const { leftRenderer, middleRenderer, rightRenderer } = props;
594
+ const colCls = cls2("max-h-full overflow-auto md:block py-64");
595
+ return /* @__PURE__ */ React15.createElement("div", {
596
+ className: "grid grid-cols-1 xl:grid-cols-3 gap-4 h-full w-full"
597
+ }, /* @__PURE__ */ React15.createElement("div", {
598
+ className: cls2("hidden", colCls)
599
+ }, leftRenderer && leftRenderer()), /* @__PURE__ */ React15.createElement("div", {
600
+ className: cls2(colCls, "sm:px-128 xl:px-0 no-scrollbar", "relative", {
601
+ hidden: !middleRenderer
602
+ })
603
+ }, middleRenderer && middleRenderer()), /* @__PURE__ */ React15.createElement("div", {
604
+ className: cls2("hidden", colCls)
605
+ }, rightRenderer && rightRenderer()));
606
+ };
607
+
608
+ // src/list/list.tsx
609
+ import cls3 from "classnames";
610
+ import React16 from "react";
611
+ var List = (props) => {
612
+ const { items, itemRenderer, className, horizontal, compact } = props;
613
+ const spaceCls = compact ? "" : horizontal ? "mr-3" : "mb-4";
614
+ return /* @__PURE__ */ React16.createElement("ul", {
615
+ className: cls3(className, "list-style-none", {
616
+ flex: horizontal,
617
+ "align-center": horizontal
618
+ })
619
+ }, items.map((item, index) => {
620
+ return /* @__PURE__ */ React16.createElement("li", {
621
+ key: item.id || index,
622
+ className: cls3(spaceCls, "flex-shrink-0")
623
+ }, itemRenderer(item, index));
624
+ }));
625
+ };
626
+ var TitledList = (props) => {
627
+ const _a = props, { title, description } = _a, rest = __objRest(_a, ["title", "description"]);
628
+ if (!title) {
629
+ return /* @__PURE__ */ React16.createElement(List, __spreadValues({}, rest));
630
+ }
631
+ return /* @__PURE__ */ React16.createElement(Article, {
632
+ title,
633
+ description
634
+ }, /* @__PURE__ */ React16.createElement(List, __spreadValues({}, rest)));
635
+ };
636
+ var LinkList = (props) => {
637
+ const _a = props, { title, description, links } = _a, rest = __objRest(_a, ["title", "description", "links"]);
638
+ const renderLink = ({ name, to }) => {
639
+ return /* @__PURE__ */ React16.createElement(Link, {
640
+ to,
641
+ key: name
642
+ }, name);
643
+ };
644
+ return /* @__PURE__ */ React16.createElement(TitledList, __spreadValues({
645
+ title,
646
+ description,
647
+ items: links,
648
+ itemRenderer: renderLink
649
+ }, rest));
650
+ };
586
651
  export {
587
652
  Article,
588
653
  BlinkDot,
@@ -592,6 +657,8 @@ export {
592
657
  DropImage,
593
658
  Link,
594
659
  LinkColor,
660
+ LinkList,
661
+ List,
595
662
  Logo,
596
663
  Nav,
597
664
  Page,
@@ -601,5 +668,7 @@ export {
601
668
  SkeletonColor,
602
669
  Table,
603
670
  Tag,
604
- Tags
671
+ Tags,
672
+ ThreeColLayout,
673
+ TitledList
605
674
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/components",
3
- "version": "1.5.6",
3
+ "version": "1.5.9",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
package/dist/index.css DELETED
@@ -1,226 +0,0 @@
1
- /* src/main.css */
2
- *,
3
- ::before,
4
- ::after {
5
- box-sizing: border-box;
6
- border-width: 0;
7
- border-style: solid;
8
- border-color: currentColor;
9
- }
10
- ::before,
11
- ::after {
12
- --tw-content: "";
13
- }
14
- html {
15
- line-height: 1.5;
16
- -webkit-text-size-adjust: 100%;
17
- -moz-tab-size: 4;
18
- -o-tab-size: 4;
19
- tab-size: 4;
20
- font-family:
21
- pt-sans,
22
- ui-sans-serif,
23
- system-ui,
24
- -apple-system,
25
- BlinkMacSystemFont,
26
- Segoe UI,
27
- Roboto,
28
- Helvetica Neue,
29
- Arial,
30
- Noto Sans,
31
- sans-serif,
32
- Apple Color Emoji,
33
- Segoe UI Emoji,
34
- Segoe UI Symbol,
35
- Noto Color Emoji;
36
- }
37
- body {
38
- margin: 0;
39
- line-height: inherit;
40
- }
41
- hr {
42
- height: 0;
43
- color: inherit;
44
- border-top-width: 1px;
45
- }
46
- abbr[title] {
47
- -webkit-text-decoration: underline dotted;
48
- text-decoration: underline dotted;
49
- }
50
- h1,
51
- h2,
52
- h3,
53
- h4,
54
- h5,
55
- h6 {
56
- font-size: inherit;
57
- font-weight: inherit;
58
- }
59
- a {
60
- color: inherit;
61
- text-decoration: inherit;
62
- }
63
- b,
64
- strong {
65
- font-weight: bolder;
66
- }
67
- code,
68
- kbd,
69
- samp,
70
- pre {
71
- font-family:
72
- ui-monospace,
73
- SFMono-Regular,
74
- Menlo,
75
- Monaco,
76
- Consolas,
77
- Liberation Mono,
78
- Courier New,
79
- monospace;
80
- font-size: 1em;
81
- }
82
- small {
83
- font-size: 80%;
84
- }
85
- sub,
86
- sup {
87
- font-size: 75%;
88
- line-height: 0;
89
- position: relative;
90
- vertical-align: baseline;
91
- }
92
- sub {
93
- bottom: -0.25em;
94
- }
95
- sup {
96
- top: -0.5em;
97
- }
98
- table {
99
- text-indent: 0;
100
- border-color: inherit;
101
- border-collapse: collapse;
102
- }
103
- button,
104
- input,
105
- optgroup,
106
- select,
107
- textarea {
108
- font-family: inherit;
109
- font-size: 100%;
110
- line-height: inherit;
111
- color: inherit;
112
- margin: 0;
113
- padding: 0;
114
- }
115
- button,
116
- select {
117
- text-transform: none;
118
- }
119
- button,
120
- [type=button],
121
- [type=reset],
122
- [type=submit] {
123
- -webkit-appearance: button;
124
- background-color: transparent;
125
- background-image: none;
126
- }
127
- :-moz-focusring {
128
- outline: auto;
129
- }
130
- :-moz-ui-invalid {
131
- box-shadow: none;
132
- }
133
- progress {
134
- vertical-align: baseline;
135
- }
136
- ::-webkit-inner-spin-button,
137
- ::-webkit-outer-spin-button {
138
- height: auto;
139
- }
140
- [type=search] {
141
- -webkit-appearance: textfield;
142
- outline-offset: -2px;
143
- }
144
- ::-webkit-search-decoration {
145
- -webkit-appearance: none;
146
- }
147
- ::-webkit-file-upload-button {
148
- -webkit-appearance: button;
149
- font: inherit;
150
- }
151
- summary {
152
- display: list-item;
153
- }
154
- blockquote,
155
- dl,
156
- dd,
157
- h1,
158
- h2,
159
- h3,
160
- h4,
161
- h5,
162
- h6,
163
- hr,
164
- figure,
165
- p,
166
- pre {
167
- margin: 0;
168
- }
169
- fieldset {
170
- margin: 0;
171
- padding: 0;
172
- }
173
- legend {
174
- padding: 0;
175
- }
176
- ol,
177
- ul,
178
- menu {
179
- list-style: none;
180
- margin: 0;
181
- padding: 0;
182
- }
183
- textarea {
184
- resize: vertical;
185
- }
186
- input::-moz-placeholder,
187
- textarea::-moz-placeholder {
188
- opacity: 1;
189
- color: #9CA3AF;
190
- }
191
- input:-ms-input-placeholder,
192
- textarea:-ms-input-placeholder {
193
- opacity: 1;
194
- color: #9CA3AF;
195
- }
196
- input::placeholder,
197
- textarea::placeholder {
198
- opacity: 1;
199
- color: #9CA3AF;
200
- }
201
- button,
202
- [role=button] {
203
- cursor: pointer;
204
- }
205
- :disabled {
206
- cursor: default;
207
- }
208
- img,
209
- svg,
210
- video,
211
- canvas,
212
- audio,
213
- iframe,
214
- embed,
215
- object {
216
- display: block;
217
- vertical-align: middle;
218
- }
219
- img,
220
- video {
221
- max-width: 100%;
222
- height: auto;
223
- }
224
- [hidden] {
225
- display: none;
226
- }