@epicbagel/saas-kit 1.36.0 → 1.36.1

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,70 @@
1
+ "use client";
2
+ import {
3
+ CopyButton
4
+ } from "./chunk-AL3FBR36.js";
5
+ import {
6
+ cn
7
+ } from "./chunk-G6SRSWXB.js";
8
+
9
+ // src/primitives/code-block.tsx
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ var CODE_TYPE = "font-mono text-xs leading-relaxed";
12
+ var HEIGHTS = {
13
+ none: "",
14
+ sm: "max-h-40 overflow-y-auto",
15
+ md: "max-h-64 overflow-y-auto",
16
+ lg: "max-h-96 overflow-y-auto",
17
+ viewport: "min-h-[55vh] max-h-[65vh] overflow-y-auto"
18
+ };
19
+ function CodeBlock({
20
+ children,
21
+ copy,
22
+ copyLabel,
23
+ wrap = false,
24
+ maxHeight = "none",
25
+ className
26
+ }) {
27
+ const copyText = typeof copy === "string" ? copy : children;
28
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
29
+ /* @__PURE__ */ jsx(
30
+ "pre",
31
+ {
32
+ className: cn(
33
+ "rounded-md border border-border bg-muted/40 p-3",
34
+ CODE_TYPE,
35
+ wrap ? "whitespace-pre-wrap break-words" : "overflow-x-auto",
36
+ HEIGHTS[maxHeight],
37
+ copy ? "pr-12" : void 0
38
+ ),
39
+ children
40
+ }
41
+ ),
42
+ copy ? (
43
+ // The copy button sits on the first line of code: this box is that
44
+ // line (the block's border and padding down from the top, one line
45
+ // of the block's own type high), and the button is centred in it.
46
+ // So its glyph shares the first line's centre whatever the button's
47
+ // size, the type's or the viewport's, with no offset to keep in step.
48
+ /* @__PURE__ */ jsx(
49
+ "div",
50
+ {
51
+ "data-slot": "code-block-copy",
52
+ className: cn(CODE_TYPE, "pointer-events-none absolute right-1.5 top-3 mt-px flex h-[1lh] items-center"),
53
+ children: /* @__PURE__ */ jsx(
54
+ CopyButton,
55
+ {
56
+ text: copyText,
57
+ label: copyLabel,
58
+ variant: "ghost",
59
+ className: "pointer-events-auto"
60
+ }
61
+ )
62
+ }
63
+ )
64
+ ) : null
65
+ ] });
66
+ }
67
+
68
+ export {
69
+ CodeBlock
70
+ };
@@ -8,6 +8,7 @@ var _chunkKWLSBTB2cjs = require('./chunk-KWLSBTB2.cjs');
8
8
 
9
9
  // src/primitives/code-block.tsx
10
10
  var _jsxruntime = require('react/jsx-runtime');
11
+ var CODE_TYPE = "font-mono text-xs leading-relaxed";
11
12
  var HEIGHTS = {
12
13
  none: "",
13
14
  sm: "max-h-40 overflow-y-auto",
@@ -29,7 +30,8 @@ function CodeBlock({
29
30
  "pre",
30
31
  {
31
32
  className: _chunkKWLSBTB2cjs.cn.call(void 0,
32
- "rounded-md border border-border bg-muted/40 p-3 font-mono text-xs leading-relaxed",
33
+ "rounded-md border border-border bg-muted/40 p-3",
34
+ CODE_TYPE,
33
35
  wrap ? "whitespace-pre-wrap break-words" : "overflow-x-auto",
34
36
  HEIGHTS[maxHeight],
35
37
  copy ? "pr-12" : void 0
@@ -37,15 +39,28 @@ function CodeBlock({
37
39
  children
38
40
  }
39
41
  ),
40
- copy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
41
- _chunkAYH5TTLDcjs.CopyButton,
42
- {
43
- text: copyText,
44
- label: copyLabel,
45
- size: "sm",
46
- variant: "ghost",
47
- className: "absolute right-1.5 top-1.5"
48
- }
42
+ copy ? (
43
+ // The copy button sits on the first line of code: this box is that
44
+ // line (the block's border and padding down from the top, one line
45
+ // of the block's own type high), and the button is centred in it.
46
+ // So its glyph shares the first line's centre whatever the button's
47
+ // size, the type's or the viewport's, with no offset to keep in step.
48
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
49
+ "div",
50
+ {
51
+ "data-slot": "code-block-copy",
52
+ className: _chunkKWLSBTB2cjs.cn.call(void 0, CODE_TYPE, "pointer-events-none absolute right-1.5 top-3 mt-px flex h-[1lh] items-center"),
53
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
54
+ _chunkAYH5TTLDcjs.CopyButton,
55
+ {
56
+ text: copyText,
57
+ label: copyLabel,
58
+ variant: "ghost",
59
+ className: "pointer-events-auto"
60
+ }
61
+ )
62
+ }
63
+ )
49
64
  ) : null
50
65
  ] });
51
66
  }
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _chunkI6IFBKCLcjs = require('../chunk-I6IFBKCL.cjs');
4
+ var _chunkVWMNAIDXcjs = require('../chunk-VWMNAIDX.cjs');
5
5
  require('../chunk-AYH5TTLD.cjs');
6
6
  require('../chunk-JDEXZGIY.cjs');
7
7
  require('../chunk-KWLSBTB2.cjs');
8
8
  require('../chunk-4LXN6GLZ.cjs');
9
9
 
10
10
 
11
- exports.CodeBlock = _chunkI6IFBKCLcjs.CodeBlock;
11
+ exports.CodeBlock = _chunkVWMNAIDXcjs.CodeBlock;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  CodeBlock
4
- } from "../chunk-DMX7LQ6D.js";
4
+ } from "../chunk-OABDSR7G.js";
5
5
  import "../chunk-AL3FBR36.js";
6
6
  import "../chunk-W326GKML.js";
7
7
  import "../chunk-G6SRSWXB.js";
@@ -17,7 +17,7 @@ require('../chunk-ELPV44S6.cjs');
17
17
  require('../chunk-2BHI5ZWJ.cjs');
18
18
 
19
19
 
20
- var _chunkI6IFBKCLcjs = require('../chunk-I6IFBKCL.cjs');
20
+ var _chunkVWMNAIDXcjs = require('../chunk-VWMNAIDX.cjs');
21
21
  require('../chunk-AYH5TTLD.cjs');
22
22
  require('../chunk-WDXEJDMO.cjs');
23
23
 
@@ -281,7 +281,7 @@ function FilePreviewBody({
281
281
  kind === "markdown" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKENBU3NVcjs.LazyMarkdown, { components: { a: NewTabLink, ...markdownComponents }, children: text.text }) : (
282
282
  // The theme's relaxed leading is a fixed 1.8rem, which spaces a
283
283
  // file's small monospace lines apart; read it at 20px lines.
284
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI6IFBKCLcjs.CodeBlock, { wrap: true, className: "[&>pre]:leading-5", children: text.text })
284
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVWMNAIDXcjs.CodeBlock, { wrap: true, className: "[&>pre]:leading-5", children: text.text })
285
285
  )
286
286
  ] });
287
287
  }
@@ -17,7 +17,7 @@ import "../chunk-INNGGLMZ.js";
17
17
  import "../chunk-4HWCNRK4.js";
18
18
  import {
19
19
  CodeBlock
20
- } from "../chunk-DMX7LQ6D.js";
20
+ } from "../chunk-OABDSR7G.js";
21
21
  import "../chunk-AL3FBR36.js";
22
22
  import "../chunk-3QT5VYZ3.js";
23
23
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epicbagel/saas-kit",
3
- "version": "1.36.0",
3
+ "version": "1.36.1",
4
4
  "description": "Accessible React primitives, layout components and design tokens for SaaS apps, built on Radix UI and Tailwind CSS v4.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -1,55 +0,0 @@
1
- "use client";
2
- import {
3
- CopyButton
4
- } from "./chunk-AL3FBR36.js";
5
- import {
6
- cn
7
- } from "./chunk-G6SRSWXB.js";
8
-
9
- // src/primitives/code-block.tsx
10
- import { jsx, jsxs } from "react/jsx-runtime";
11
- var HEIGHTS = {
12
- none: "",
13
- sm: "max-h-40 overflow-y-auto",
14
- md: "max-h-64 overflow-y-auto",
15
- lg: "max-h-96 overflow-y-auto",
16
- viewport: "min-h-[55vh] max-h-[65vh] overflow-y-auto"
17
- };
18
- function CodeBlock({
19
- children,
20
- copy,
21
- copyLabel,
22
- wrap = false,
23
- maxHeight = "none",
24
- className
25
- }) {
26
- const copyText = typeof copy === "string" ? copy : children;
27
- return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
28
- /* @__PURE__ */ jsx(
29
- "pre",
30
- {
31
- className: cn(
32
- "rounded-md border border-border bg-muted/40 p-3 font-mono text-xs leading-relaxed",
33
- wrap ? "whitespace-pre-wrap break-words" : "overflow-x-auto",
34
- HEIGHTS[maxHeight],
35
- copy ? "pr-12" : void 0
36
- ),
37
- children
38
- }
39
- ),
40
- copy ? /* @__PURE__ */ jsx(
41
- CopyButton,
42
- {
43
- text: copyText,
44
- label: copyLabel,
45
- size: "sm",
46
- variant: "ghost",
47
- className: "absolute right-1.5 top-1.5"
48
- }
49
- ) : null
50
- ] });
51
- }
52
-
53
- export {
54
- CodeBlock
55
- };