@docubook/ui-react 2.0.0-alpha.0 → 2.0.0-alpha.2

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.
@@ -0,0 +1,92 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk2DFF5NELcjs = require('./chunk-2DFF5NEL.cjs');
4
+
5
+ // src/base/pagination.tsx
6
+ var _jsxruntime = require('react/jsx-runtime');
7
+ function PaginationDocs({
8
+ prev,
9
+ next,
10
+ className,
11
+ prevIcon,
12
+ nextIcon,
13
+ linkClassName
14
+ }) {
15
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
16
+ "nav",
17
+ {
18
+ id: "pagination",
19
+ "aria-label": "Pagination",
20
+ className: _chunk2DFF5NELcjs.cn.call(void 0, "bg-base-200/50 flex w-full gap-1 rounded-2xl p-1", className),
21
+ children: [
22
+ prev && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
23
+ "a",
24
+ {
25
+ href: prev.href,
26
+ rel: "prev",
27
+ "data-component-part": "pagination-prev",
28
+ className: _chunk2DFF5NELcjs.cn.call(void 0,
29
+ "group text-muted-foreground hover:bg-base-200/60 hover:text-base-content flex items-center justify-start gap-1.5 rounded-xl px-3 py-3 text-sm no-underline transition-colors",
30
+ // 30/70 split with next; calc subtracts half the gap so the two
31
+ // cards plus gap-1 fill the pill exactly. No min-w-0: the card
32
+ // floors at its content width, so a narrow screen never crushes
33
+ // the icon/text into the next card.
34
+ next && "w-[calc(30%-2px)]",
35
+ linkClassName
36
+ ),
37
+ children: [
38
+ prevIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex shrink-0 items-center", children: prevIcon }),
39
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-component-part": "pagination-label", children: "Previous" })
40
+ ]
41
+ }
42
+ ),
43
+ next && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
44
+ "a",
45
+ {
46
+ href: next.href,
47
+ rel: "next",
48
+ "data-component-part": "pagination-next",
49
+ className: _chunk2DFF5NELcjs.cn.call(void 0,
50
+ "group min-w-0 rounded-xl no-underline",
51
+ // Next-only (e.g. docs index): full width on mobile, half the
52
+ // container above 640px — pushed right like a forward button.
53
+ // With prev: calc-based 70% (minus half the gap) so the pair
54
+ // always fills the pill without overlapping.
55
+ prev ? "w-[calc(70%-2px)]" : "w-full sm:ml-auto sm:w-1/2",
56
+ linkClassName
57
+ ),
58
+ children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-primary/15 hover:bg-primary/20 hover:ring-primary/30 flex h-16 flex-1 items-center justify-end rounded-xl transition-shadow hover:ring-1", children: [
59
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 flex-col items-end justify-center px-5", children: [
60
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
61
+ "div",
62
+ {
63
+ "data-component-part": "pagination-title",
64
+ className: "text-primary w-full truncate text-right text-sm font-semibold",
65
+ children: next.title
66
+ }
67
+ ),
68
+ next.description && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
69
+ "span",
70
+ {
71
+ "data-component-part": "pagination-description",
72
+ className: "text-primary/75 hidden w-full max-w-72 truncate text-right text-xs sm:block",
73
+ children: next.description
74
+ }
75
+ )
76
+ ] }),
77
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-primary/20 h-8 w-px" }),
78
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-primary/75 flex items-center gap-1.5 pr-3 pl-5 text-sm", children: [
79
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-component-part": "pagination-label", children: "Next" }),
80
+ nextIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex shrink-0 items-center", children: nextIcon })
81
+ ] })
82
+ ] })
83
+ }
84
+ )
85
+ ]
86
+ }
87
+ );
88
+ }
89
+
90
+
91
+
92
+ exports.PaginationDocs = PaginationDocs;
@@ -0,0 +1,92 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-GRADTONK.js";
4
+
5
+ // src/base/pagination.tsx
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ function PaginationDocs({
8
+ prev,
9
+ next,
10
+ className,
11
+ prevIcon,
12
+ nextIcon,
13
+ linkClassName
14
+ }) {
15
+ return /* @__PURE__ */ jsxs(
16
+ "nav",
17
+ {
18
+ id: "pagination",
19
+ "aria-label": "Pagination",
20
+ className: cn("bg-base-200/50 flex w-full gap-1 rounded-2xl p-1", className),
21
+ children: [
22
+ prev && /* @__PURE__ */ jsxs(
23
+ "a",
24
+ {
25
+ href: prev.href,
26
+ rel: "prev",
27
+ "data-component-part": "pagination-prev",
28
+ className: cn(
29
+ "group text-muted-foreground hover:bg-base-200/60 hover:text-base-content flex items-center justify-start gap-1.5 rounded-xl px-3 py-3 text-sm no-underline transition-colors",
30
+ // 30/70 split with next; calc subtracts half the gap so the two
31
+ // cards plus gap-1 fill the pill exactly. No min-w-0: the card
32
+ // floors at its content width, so a narrow screen never crushes
33
+ // the icon/text into the next card.
34
+ next && "w-[calc(30%-2px)]",
35
+ linkClassName
36
+ ),
37
+ children: [
38
+ prevIcon && /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", children: prevIcon }),
39
+ /* @__PURE__ */ jsx("span", { "data-component-part": "pagination-label", children: "Previous" })
40
+ ]
41
+ }
42
+ ),
43
+ next && /* @__PURE__ */ jsx(
44
+ "a",
45
+ {
46
+ href: next.href,
47
+ rel: "next",
48
+ "data-component-part": "pagination-next",
49
+ className: cn(
50
+ "group min-w-0 rounded-xl no-underline",
51
+ // Next-only (e.g. docs index): full width on mobile, half the
52
+ // container above 640px — pushed right like a forward button.
53
+ // With prev: calc-based 70% (minus half the gap) so the pair
54
+ // always fills the pill without overlapping.
55
+ prev ? "w-[calc(70%-2px)]" : "w-full sm:ml-auto sm:w-1/2",
56
+ linkClassName
57
+ ),
58
+ children: /* @__PURE__ */ jsxs("div", { className: "bg-primary/15 hover:bg-primary/20 hover:ring-primary/30 flex h-16 flex-1 items-center justify-end rounded-xl transition-shadow hover:ring-1", children: [
59
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col items-end justify-center px-5", children: [
60
+ /* @__PURE__ */ jsx(
61
+ "div",
62
+ {
63
+ "data-component-part": "pagination-title",
64
+ className: "text-primary w-full truncate text-right text-sm font-semibold",
65
+ children: next.title
66
+ }
67
+ ),
68
+ next.description && /* @__PURE__ */ jsx(
69
+ "span",
70
+ {
71
+ "data-component-part": "pagination-description",
72
+ className: "text-primary/75 hidden w-full max-w-72 truncate text-right text-xs sm:block",
73
+ children: next.description
74
+ }
75
+ )
76
+ ] }),
77
+ /* @__PURE__ */ jsx("div", { className: "bg-primary/20 h-8 w-px" }),
78
+ /* @__PURE__ */ jsxs("div", { className: "text-primary/75 flex items-center gap-1.5 pr-3 pl-5 text-sm", children: [
79
+ /* @__PURE__ */ jsx("span", { "data-component-part": "pagination-label", children: "Next" }),
80
+ nextIcon && /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", children: nextIcon })
81
+ ] })
82
+ ] })
83
+ }
84
+ )
85
+ ]
86
+ }
87
+ );
88
+ }
89
+
90
+ export {
91
+ PaginationDocs
92
+ };
package/dist/index.cjs CHANGED
@@ -10,7 +10,7 @@ var _chunkHTH2UTCLcjs = require('./chunk-HTH2UTCL.cjs');
10
10
  var _chunk6B7U7IWTcjs = require('./chunk-6B7U7IWT.cjs');
11
11
 
12
12
 
13
- var _chunkK22HSWMWcjs = require('./chunk-K22HSWMW.cjs');
13
+ var _chunkREZ4W4BZcjs = require('./chunk-REZ4W4BZ.cjs');
14
14
 
15
15
 
16
16
  var _chunk5SA5UPFQcjs = require('./chunk-5SA5UPFQ.cjs');
@@ -81,4 +81,4 @@ var _chunk2DFF5NELcjs = require('./chunk-2DFF5NEL.cjs');
81
81
 
82
82
 
83
83
 
84
- exports.Accordion = _chunkSV4L2FGTcjs.Accordion; exports.Breadcrumb = _chunkRDRDPR67cjs.Breadcrumb; exports.BreadcrumbItem = _chunkRDRDPR67cjs.BreadcrumbItem; exports.BreadcrumbList = _chunkRDRDPR67cjs.BreadcrumbList; exports.BreadcrumbPage = _chunkRDRDPR67cjs.BreadcrumbPage; exports.Collapse = _chunkSV4L2FGTcjs.Collapse; exports.Drawer = _chunkBHHZBMD4cjs.Drawer; exports.DrawerContent = _chunkBHHZBMD4cjs.DrawerContent; exports.DrawerSidePanel = _chunkBHHZBMD4cjs.DrawerSidePanel; exports.DrawerTrigger = _chunkBHHZBMD4cjs.DrawerTrigger; exports.Dropdown = _chunkCK4TY6B7cjs.Dropdown; exports.DropdownItem = _chunkCK4TY6B7cjs.DropdownItem; exports.DropdownLink = _chunkCK4TY6B7cjs.DropdownLink; exports.FnKey = _chunkTDFVUBGOcjs.FnKey; exports.Input = _chunkMWJV72OMcjs.Input; exports.InputGroup = _chunkMWJV72OMcjs.InputGroup; exports.Kbd = _chunkTDFVUBGOcjs.Kbd; exports.Logo = _chunk6B7U7IWTcjs.Logo; exports.Modal = _chunkHTH2UTCLcjs.Modal; exports.NavMenu = _chunk6B7U7IWTcjs.NavMenu; exports.NavMenuLink = _chunk6B7U7IWTcjs.NavMenuLink; exports.Navbar = _chunk6B7U7IWTcjs.Navbar; exports.PaginationDocs = _chunkK22HSWMWcjs.PaginationDocs; exports.ThemeControllerToggle = _chunk5SA5UPFQcjs.ThemeControllerToggle; exports.Toggle = _chunkOO3HHTPVcjs.Toggle; exports.ToggleGroup = _chunkOO3HHTPVcjs.ToggleGroup; exports.cn = _chunk2DFF5NELcjs.cn; exports.useDrawerState = _chunkBHHZBMD4cjs.useDrawerState; exports.useModal = _chunkHTH2UTCLcjs.useModal;
84
+ exports.Accordion = _chunkSV4L2FGTcjs.Accordion; exports.Breadcrumb = _chunkRDRDPR67cjs.Breadcrumb; exports.BreadcrumbItem = _chunkRDRDPR67cjs.BreadcrumbItem; exports.BreadcrumbList = _chunkRDRDPR67cjs.BreadcrumbList; exports.BreadcrumbPage = _chunkRDRDPR67cjs.BreadcrumbPage; exports.Collapse = _chunkSV4L2FGTcjs.Collapse; exports.Drawer = _chunkBHHZBMD4cjs.Drawer; exports.DrawerContent = _chunkBHHZBMD4cjs.DrawerContent; exports.DrawerSidePanel = _chunkBHHZBMD4cjs.DrawerSidePanel; exports.DrawerTrigger = _chunkBHHZBMD4cjs.DrawerTrigger; exports.Dropdown = _chunkCK4TY6B7cjs.Dropdown; exports.DropdownItem = _chunkCK4TY6B7cjs.DropdownItem; exports.DropdownLink = _chunkCK4TY6B7cjs.DropdownLink; exports.FnKey = _chunkTDFVUBGOcjs.FnKey; exports.Input = _chunkMWJV72OMcjs.Input; exports.InputGroup = _chunkMWJV72OMcjs.InputGroup; exports.Kbd = _chunkTDFVUBGOcjs.Kbd; exports.Logo = _chunk6B7U7IWTcjs.Logo; exports.Modal = _chunkHTH2UTCLcjs.Modal; exports.NavMenu = _chunk6B7U7IWTcjs.NavMenu; exports.NavMenuLink = _chunk6B7U7IWTcjs.NavMenuLink; exports.Navbar = _chunk6B7U7IWTcjs.Navbar; exports.PaginationDocs = _chunkREZ4W4BZcjs.PaginationDocs; exports.ThemeControllerToggle = _chunk5SA5UPFQcjs.ThemeControllerToggle; exports.Toggle = _chunkOO3HHTPVcjs.Toggle; exports.ToggleGroup = _chunkOO3HHTPVcjs.ToggleGroup; exports.cn = _chunk2DFF5NELcjs.cn; exports.useDrawerState = _chunkBHHZBMD4cjs.useDrawerState; exports.useModal = _chunkHTH2UTCLcjs.useModal;
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-RXFYKKNI.js";
11
11
  import {
12
12
  PaginationDocs
13
- } from "./chunk-4QUABBES.js";
13
+ } from "./chunk-WY6GLRTT.js";
14
14
  import {
15
15
  ThemeControllerToggle
16
16
  } from "./chunk-PFRBA5BH.js";
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkK22HSWMWcjs = require('./chunk-K22HSWMW.cjs');
3
+ var _chunkREZ4W4BZcjs = require('./chunk-REZ4W4BZ.cjs');
4
4
  require('./chunk-2DFF5NEL.cjs');
5
5
 
6
6
 
7
- exports.PaginationDocs = _chunkK22HSWMWcjs.PaginationDocs;
7
+ exports.PaginationDocs = _chunkREZ4W4BZcjs.PaginationDocs;
@@ -9,6 +9,7 @@ interface PaginationDocsProps {
9
9
  next?: {
10
10
  href: string;
11
11
  title: string;
12
+ description?: string;
12
13
  };
13
14
  className?: string;
14
15
  prevIcon?: ReactNode;
@@ -9,6 +9,7 @@ interface PaginationDocsProps {
9
9
  next?: {
10
10
  href: string;
11
11
  title: string;
12
+ description?: string;
12
13
  };
13
14
  className?: string;
14
15
  prevIcon?: ReactNode;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PaginationDocs
3
- } from "./chunk-4QUABBES.js";
3
+ } from "./chunk-WY6GLRTT.js";
4
4
  import "./chunk-GRADTONK.js";
5
5
  export {
6
6
  PaginationDocs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docubook/ui-react",
3
- "version": "2.0.0-alpha.0",
3
+ "version": "2.0.0-alpha.2",
4
4
  "description": "React + DaisyUI component library for documentation sites",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -136,11 +136,13 @@
136
136
  "types": "./dist/pagination.d.cts",
137
137
  "default": "./dist/pagination.cjs"
138
138
  }
139
- }
139
+ },
140
+ "./styles.css": "./styles.css"
140
141
  },
141
142
  "files": [
142
143
  "dist",
143
- "README.md"
144
+ "README.md",
145
+ "styles.css"
144
146
  ],
145
147
  "sideEffects": false,
146
148
  "peerDependencies": {
package/styles.css ADDED
@@ -0,0 +1,4 @@
1
+ /* Tailwind source root for ui-react components — @source is resolved relative
2
+ to this file, so consumers can import this stylesheet from any install
3
+ layout and the component classes are still scanned. */
4
+ @source "./src";
@@ -1,43 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-GRADTONK.js";
4
-
5
- // src/base/pagination.tsx
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- function PaginationDocs({
8
- prev,
9
- next,
10
- className,
11
- prevIcon,
12
- nextIcon,
13
- linkClassName
14
- }) {
15
- const linkBase = "flex flex-col no-underline rounded-lg border border-base-300 bg-base-100 transition-colors hover:bg-base-200 hover:border-base-300";
16
- return /* @__PURE__ */ jsxs("div", { className: cn("grid grow grid-cols-1 gap-4 py-8 sm:grid-cols-2", className), children: [
17
- /* @__PURE__ */ jsx("div", { children: prev && /* @__PURE__ */ jsxs("a", { href: prev.href, className: cn(linkBase, "items-start px-4 py-4", linkClassName), children: [
18
- /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground flex items-center justify-start text-xs", children: [
19
- prevIcon && /* @__PURE__ */ jsx("span", { className: "mr-1", children: prevIcon }),
20
- "Previous"
21
- ] }),
22
- /* @__PURE__ */ jsx("span", { className: "text-base-content mt-1 text-sm font-medium", children: prev.title })
23
- ] }) }),
24
- /* @__PURE__ */ jsx("div", { children: next && /* @__PURE__ */ jsxs(
25
- "a",
26
- {
27
- href: next.href,
28
- className: cn(linkBase, "items-end px-4 py-4 text-right", linkClassName),
29
- children: [
30
- /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground flex items-center justify-end text-xs", children: [
31
- "Next",
32
- nextIcon && /* @__PURE__ */ jsx("span", { className: "ml-1", children: nextIcon })
33
- ] }),
34
- /* @__PURE__ */ jsx("span", { className: "text-base-content mt-1 text-sm font-medium", children: next.title })
35
- ]
36
- }
37
- ) })
38
- ] });
39
- }
40
-
41
- export {
42
- PaginationDocs
43
- };
@@ -1,43 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunk2DFF5NELcjs = require('./chunk-2DFF5NEL.cjs');
4
-
5
- // src/base/pagination.tsx
6
- var _jsxruntime = require('react/jsx-runtime');
7
- function PaginationDocs({
8
- prev,
9
- next,
10
- className,
11
- prevIcon,
12
- nextIcon,
13
- linkClassName
14
- }) {
15
- const linkBase = "flex flex-col no-underline rounded-lg border border-base-300 bg-base-100 transition-colors hover:bg-base-200 hover:border-base-300";
16
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk2DFF5NELcjs.cn.call(void 0, "grid grow grid-cols-1 gap-4 py-8 sm:grid-cols-2", className), children: [
17
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: prev && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "a", { href: prev.href, className: _chunk2DFF5NELcjs.cn.call(void 0, linkBase, "items-start px-4 py-4", linkClassName), children: [
18
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-muted-foreground flex items-center justify-start text-xs", children: [
19
- prevIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mr-1", children: prevIcon }),
20
- "Previous"
21
- ] }),
22
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-base-content mt-1 text-sm font-medium", children: prev.title })
23
- ] }) }),
24
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: next && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
25
- "a",
26
- {
27
- href: next.href,
28
- className: _chunk2DFF5NELcjs.cn.call(void 0, linkBase, "items-end px-4 py-4 text-right", linkClassName),
29
- children: [
30
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-muted-foreground flex items-center justify-end text-xs", children: [
31
- "Next",
32
- nextIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "ml-1", children: nextIcon })
33
- ] }),
34
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-base-content mt-1 text-sm font-medium", children: next.title })
35
- ]
36
- }
37
- ) })
38
- ] });
39
- }
40
-
41
-
42
-
43
- exports.PaginationDocs = PaginationDocs;