@epicbagel/saas-kit 1.35.0 → 1.36.0

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.
@@ -2,9 +2,6 @@
2
2
  import {
3
3
  Button
4
4
  } from "./chunk-W326GKML.js";
5
- import {
6
- cn
7
- } from "./chunk-G6SRSWXB.js";
8
5
  import {
9
6
  useCopyToClipboard
10
7
  } from "./chunk-ZWZAAGQF.js";
@@ -13,6 +10,15 @@ import {
13
10
  import { forwardRef } from "react";
14
11
  import { Check, Copy } from "lucide-react";
15
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
+ var ICON_SIZES = /* @__PURE__ */ new Set([
14
+ "icon",
15
+ "icon-lg",
16
+ "icon-sm",
17
+ "icon-md",
18
+ "icon-xs",
19
+ "icon-compact",
20
+ "icon-micro"
21
+ ]);
16
22
  var CopyButton = forwardRef(
17
23
  function CopyButton2({
18
24
  text,
@@ -27,7 +33,7 @@ var CopyButton = forwardRef(
27
33
  }, ref) {
28
34
  const { copied, copy } = useCopyToClipboard({ resetAfter });
29
35
  const iconOnly = label == null;
30
- const resolvedSize = size ?? (iconOnly ? "icon" : "sm");
36
+ const resolvedSize = iconOnly ? size != null && ICON_SIZES.has(size) ? size : "icon-compact" : size ?? "sm";
31
37
  return /* @__PURE__ */ jsxs(
32
38
  Button,
33
39
  {
@@ -35,7 +41,7 @@ var CopyButton = forwardRef(
35
41
  type: "button",
36
42
  variant,
37
43
  size: resolvedSize,
38
- className: cn(iconOnly ? "h-7 w-7" : void 0, className),
44
+ className,
39
45
  onClick: async (e) => {
40
46
  e.stopPropagation();
41
47
  const ok = await copy(text);
@@ -44,7 +50,7 @@ var CopyButton = forwardRef(
44
50
  "aria-label": iconOnly ? "Copy" : void 0,
45
51
  ...rest,
46
52
  children: [
47
- copied ? /* @__PURE__ */ jsx(Check, { className: cn("h-4 w-4", !iconOnly && "mr-1.5") }) : /* @__PURE__ */ jsx(Copy, { className: cn("h-4 w-4", !iconOnly && "mr-1.5") }),
53
+ copied ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Copy, {}),
48
54
  !iconOnly && (copied ? copiedLabel ?? label : label)
49
55
  ]
50
56
  }
@@ -4,15 +4,21 @@
4
4
  var _chunkJDEXZGIYcjs = require('./chunk-JDEXZGIY.cjs');
5
5
 
6
6
 
7
- var _chunkKWLSBTB2cjs = require('./chunk-KWLSBTB2.cjs');
8
-
9
-
10
7
  var _chunk4LXN6GLZcjs = require('./chunk-4LXN6GLZ.cjs');
11
8
 
12
9
  // src/primitives/copy-button.tsx
13
10
  var _react = require('react');
14
11
  var _lucidereact = require('lucide-react');
15
12
  var _jsxruntime = require('react/jsx-runtime');
13
+ var ICON_SIZES = /* @__PURE__ */ new Set([
14
+ "icon",
15
+ "icon-lg",
16
+ "icon-sm",
17
+ "icon-md",
18
+ "icon-xs",
19
+ "icon-compact",
20
+ "icon-micro"
21
+ ]);
16
22
  var CopyButton = _react.forwardRef.call(void 0,
17
23
  function CopyButton2({
18
24
  text,
@@ -27,7 +33,7 @@ var CopyButton = _react.forwardRef.call(void 0,
27
33
  }, ref) {
28
34
  const { copied, copy } = _chunk4LXN6GLZcjs.useCopyToClipboard.call(void 0, { resetAfter });
29
35
  const iconOnly = label == null;
30
- const resolvedSize = _nullishCoalesce(size, () => ( (iconOnly ? "icon" : "sm")));
36
+ const resolvedSize = iconOnly ? size != null && ICON_SIZES.has(size) ? size : "icon-compact" : _nullishCoalesce(size, () => ( "sm"));
31
37
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
32
38
  _chunkJDEXZGIYcjs.Button,
33
39
  {
@@ -35,7 +41,7 @@ var CopyButton = _react.forwardRef.call(void 0,
35
41
  type: "button",
36
42
  variant,
37
43
  size: resolvedSize,
38
- className: _chunkKWLSBTB2cjs.cn.call(void 0, iconOnly ? "h-7 w-7" : void 0, className),
44
+ className,
39
45
  onClick: async (e) => {
40
46
  e.stopPropagation();
41
47
  const ok = await copy(text);
@@ -44,7 +50,7 @@ var CopyButton = _react.forwardRef.call(void 0,
44
50
  "aria-label": iconOnly ? "Copy" : void 0,
45
51
  ...rest,
46
52
  children: [
47
- copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Check, { className: _chunkKWLSBTB2cjs.cn.call(void 0, "h-4 w-4", !iconOnly && "mr-1.5") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Copy, { className: _chunkKWLSBTB2cjs.cn.call(void 0, "h-4 w-4", !iconOnly && "mr-1.5") }),
53
+ copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Check, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Copy, {}),
48
54
  !iconOnly && (copied ? _nullishCoalesce(copiedLabel, () => ( label)) : label)
49
55
  ]
50
56
  }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  CopyButton
4
- } from "./chunk-DILYV4FI.js";
4
+ } from "./chunk-AL3FBR36.js";
5
5
  import {
6
6
  cn
7
7
  } from "./chunk-G6SRSWXB.js";
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _chunkFARCLWLUcjs = require('./chunk-FARCLWLU.cjs');
4
+ var _chunkAYH5TTLDcjs = require('./chunk-AYH5TTLD.cjs');
5
5
 
6
6
 
7
7
  var _chunkKWLSBTB2cjs = require('./chunk-KWLSBTB2.cjs');
@@ -38,7 +38,7 @@ function CodeBlock({
38
38
  }
39
39
  ),
40
40
  copy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
41
- _chunkFARCLWLUcjs.CopyButton,
41
+ _chunkAYH5TTLDcjs.CopyButton,
42
42
  {
43
43
  text: copyText,
44
44
  label: copyLabel,
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _chunkBGCNGYPLcjs = require('../chunk-BGCNGYPL.cjs');
5
- require('../chunk-FARCLWLU.cjs');
4
+ var _chunkI6IFBKCLcjs = require('../chunk-I6IFBKCL.cjs');
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 = _chunkBGCNGYPLcjs.CodeBlock;
11
+ exports.CodeBlock = _chunkI6IFBKCLcjs.CodeBlock;
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  CodeBlock
4
- } from "../chunk-HTPPNW74.js";
5
- import "../chunk-DILYV4FI.js";
4
+ } from "../chunk-DMX7LQ6D.js";
5
+ import "../chunk-AL3FBR36.js";
6
6
  import "../chunk-W326GKML.js";
7
7
  import "../chunk-G6SRSWXB.js";
8
8
  import "../chunk-ZWZAAGQF.js";
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _chunkFARCLWLUcjs = require('../chunk-FARCLWLU.cjs');
4
+ var _chunkAYH5TTLDcjs = require('../chunk-AYH5TTLD.cjs');
5
5
  require('../chunk-JDEXZGIY.cjs');
6
6
  require('../chunk-KWLSBTB2.cjs');
7
7
  require('../chunk-4LXN6GLZ.cjs');
8
8
 
9
9
 
10
- exports.CopyButton = _chunkFARCLWLUcjs.CopyButton;
10
+ exports.CopyButton = _chunkAYH5TTLDcjs.CopyButton;
@@ -9,6 +9,15 @@ interface CopyButtonProps extends Omit<ButtonProps, "onClick" | "children"> {
9
9
  text: string;
10
10
  /** Optional label shown next to the icon. Omit for an icon-only button. */
11
11
  label?: ReactNode;
12
+ /**
13
+ * The Button size. With a `label` it is a text button, `sm` by default.
14
+ * With no label it is an icon button: `icon-compact` (28px) by default,
15
+ * and any of the Button's icon sizes as given, so beside other icon
16
+ * buttons it takes theirs (`size="icon"`) and shares their centre line. A
17
+ * text size on a button with no text means nothing, and is read as the
18
+ * default.
19
+ */
20
+ size?: ButtonProps["size"];
12
21
  /** Label shown after a successful copy. Defaults to `label`. */
13
22
  copiedLabel?: ReactNode;
14
23
  /** ms before the success state reverts. Defaults to 2000. */
@@ -9,6 +9,15 @@ interface CopyButtonProps extends Omit<ButtonProps, "onClick" | "children"> {
9
9
  text: string;
10
10
  /** Optional label shown next to the icon. Omit for an icon-only button. */
11
11
  label?: ReactNode;
12
+ /**
13
+ * The Button size. With a `label` it is a text button, `sm` by default.
14
+ * With no label it is an icon button: `icon-compact` (28px) by default,
15
+ * and any of the Button's icon sizes as given, so beside other icon
16
+ * buttons it takes theirs (`size="icon"`) and shares their centre line. A
17
+ * text size on a button with no text means nothing, and is read as the
18
+ * default.
19
+ */
20
+ size?: ButtonProps["size"];
12
21
  /** Label shown after a successful copy. Defaults to `label`. */
13
22
  copiedLabel?: ReactNode;
14
23
  /** ms before the success state reverts. Defaults to 2000. */
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  CopyButton
4
- } from "../chunk-DILYV4FI.js";
4
+ } from "../chunk-AL3FBR36.js";
5
5
  import "../chunk-W326GKML.js";
6
6
  import "../chunk-G6SRSWXB.js";
7
7
  import "../chunk-ZWZAAGQF.js";
@@ -17,8 +17,8 @@ require('../chunk-ELPV44S6.cjs');
17
17
  require('../chunk-2BHI5ZWJ.cjs');
18
18
 
19
19
 
20
- var _chunkBGCNGYPLcjs = require('../chunk-BGCNGYPL.cjs');
21
- require('../chunk-FARCLWLU.cjs');
20
+ var _chunkI6IFBKCLcjs = require('../chunk-I6IFBKCL.cjs');
21
+ require('../chunk-AYH5TTLD.cjs');
22
22
  require('../chunk-WDXEJDMO.cjs');
23
23
 
24
24
 
@@ -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, _chunkBGCNGYPLcjs.CodeBlock, { wrap: true, className: "[&>pre]:leading-5", children: text.text })
284
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI6IFBKCLcjs.CodeBlock, { wrap: true, className: "[&>pre]:leading-5", children: text.text })
285
285
  )
286
286
  ] });
287
287
  }
@@ -17,8 +17,8 @@ import "../chunk-INNGGLMZ.js";
17
17
  import "../chunk-4HWCNRK4.js";
18
18
  import {
19
19
  CodeBlock
20
- } from "../chunk-HTPPNW74.js";
21
- import "../chunk-DILYV4FI.js";
20
+ } from "../chunk-DMX7LQ6D.js";
21
+ import "../chunk-AL3FBR36.js";
22
22
  import "../chunk-3QT5VYZ3.js";
23
23
  import {
24
24
  Text
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epicbagel/saas-kit",
3
- "version": "1.35.0",
3
+ "version": "1.36.0",
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": [