@ngrok/mantle 0.1.7 → 0.1.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/assets/mantle.css +5 -0
- package/package.json +9 -10
- package/dist/alert.cjs +0 -2
- package/dist/alert.cjs.map +0 -1
- package/dist/alert.d.cts +0 -26
- package/dist/anchor.cjs +0 -2
- package/dist/anchor.cjs.map +0 -1
- package/dist/anchor.d.cts +0 -87
- package/dist/as-child-BjnPZ1DU.d.cts +0 -22
- package/dist/button.cjs +0 -2
- package/dist/button.cjs.map +0 -1
- package/dist/button.d.cts +0 -92
- package/dist/card.cjs +0 -2
- package/dist/card.cjs.map +0 -1
- package/dist/card.d.cts +0 -29
- package/dist/checkbox.cjs +0 -2
- package/dist/checkbox.cjs.map +0 -1
- package/dist/checkbox.d.cts +0 -6
- package/dist/chunk-D3F6KERE.cjs +0 -2
- package/dist/chunk-D3F6KERE.cjs.map +0 -1
- package/dist/chunk-IN6SIXF2.cjs +0 -2
- package/dist/chunk-IN6SIXF2.cjs.map +0 -1
- package/dist/chunk-JGNAMNKZ.cjs +0 -2
- package/dist/chunk-JGNAMNKZ.cjs.map +0 -1
- package/dist/chunk-K4UKFOMI.cjs +0 -2
- package/dist/chunk-K4UKFOMI.cjs.map +0 -1
- package/dist/chunk-ROHPZJ5N.cjs +0 -2
- package/dist/chunk-ROHPZJ5N.cjs.map +0 -1
- package/dist/code-block.cjs +0 -4
- package/dist/code-block.cjs.map +0 -1
- package/dist/code-block.d.cts +0 -108
- package/dist/cx.cjs +0 -2
- package/dist/cx.cjs.map +0 -1
- package/dist/cx.d.cts +0 -10
- package/dist/deep-non-nullable-SmpSvoSd.d.cts +0 -8
- package/dist/dialog.cjs +0 -2
- package/dist/dialog.cjs.map +0 -1
- package/dist/dialog.d.cts +0 -26
- package/dist/dropdown-menu.cjs +0 -2
- package/dist/dropdown-menu.cjs.map +0 -1
- package/dist/dropdown-menu.d.cts +0 -37
- package/dist/hooks.cjs +0 -2
- package/dist/hooks.cjs.map +0 -1
- package/dist/hooks.d.cts +0 -15
- package/dist/icon.cjs +0 -2
- package/dist/icon.cjs.map +0 -1
- package/dist/icon.d.cts +0 -23
- package/dist/inline-code.cjs +0 -2
- package/dist/inline-code.cjs.map +0 -1
- package/dist/inline-code.d.cts +0 -9
- package/dist/input.cjs +0 -2
- package/dist/input.cjs.map +0 -1
- package/dist/input.d.cts +0 -75
- package/dist/media-object.cjs +0 -2
- package/dist/media-object.cjs.map +0 -1
- package/dist/media-object.d.cts +0 -26
- package/dist/popover.cjs +0 -2
- package/dist/popover.cjs.map +0 -1
- package/dist/popover.d.cts +0 -8
- package/dist/select.cjs +0 -2
- package/dist/select.cjs.map +0 -1
- package/dist/select.d.cts +0 -19
- package/dist/separator.cjs +0 -2
- package/dist/separator.cjs.map +0 -1
- package/dist/separator.d.cts +0 -9
- package/dist/sheet.cjs +0 -2
- package/dist/sheet.cjs.map +0 -1
- package/dist/sheet.d.cts +0 -22
- package/dist/skeleton.cjs +0 -2
- package/dist/skeleton.cjs.map +0 -1
- package/dist/skeleton.d.cts +0 -14
- package/dist/table.cjs +0 -2
- package/dist/table.cjs.map +0 -1
- package/dist/table.d.cts +0 -13
- package/dist/tailwind-preset.d.cts +0 -475
- package/dist/tailwind-preset.d.ts +0 -475
- package/dist/text-area.cjs +0 -2
- package/dist/text-area.cjs.map +0 -1
- package/dist/text-area.d.cts +0 -19
- package/dist/theme-provider.cjs +0 -29
- package/dist/theme-provider.cjs.map +0 -1
- package/dist/theme-provider.d.cts +0 -75
- package/dist/tooltip.cjs +0 -2
- package/dist/tooltip.cjs.map +0 -1
- package/dist/tooltip.d.cts +0 -15
- package/dist/types.cjs +0 -1
- package/dist/types.cjs.map +0 -1
- package/dist/types.d.cts +0 -6
- package/dist/variant-props-DnYnbC7s.d.cts +0 -11
- package/dist/with-style-props-VnLWm0Yd.d.cts +0 -27
package/assets/mantle.css
CHANGED
|
@@ -1405,6 +1405,11 @@
|
|
|
1405
1405
|
--shadow-second: 100%;
|
|
1406
1406
|
}
|
|
1407
1407
|
|
|
1408
|
+
::selection {
|
|
1409
|
+
color: #fff;
|
|
1410
|
+
background: hsl(var(--blue-600));
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1408
1413
|
/**
|
|
1409
1414
|
* prism.js default theme for JavaScript, CSS and HTML
|
|
1410
1415
|
* Based on dabblet (http://dabblet.com)
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "mantle is ngrok's UI library and design system.",
|
|
4
4
|
"author": "ngrok",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.9",
|
|
7
7
|
"homepage": "https://mantle.ngrok.com",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
"@types/bun": "latest",
|
|
58
58
|
"@types/node": "20.12.7",
|
|
59
59
|
"@types/prismjs": "1.26.3",
|
|
60
|
-
"@types/react": "18.2.
|
|
61
|
-
"@types/react-dom": "18.2.
|
|
62
|
-
"@typescript-eslint/eslint-plugin": "7.
|
|
63
|
-
"@typescript-eslint/parser": "7.
|
|
60
|
+
"@types/react": "18.2.79",
|
|
61
|
+
"@types/react-dom": "18.2.25",
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "7.7.0",
|
|
63
|
+
"@typescript-eslint/parser": "7.7.0",
|
|
64
64
|
"@vitejs/plugin-react": "4.2.1",
|
|
65
|
-
"@vitest/ui": "1.
|
|
65
|
+
"@vitest/ui": "1.5.0",
|
|
66
66
|
"autoprefixer": "10.4.19",
|
|
67
67
|
"browserslist": "4.23.0",
|
|
68
68
|
"commander": "12.0.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"jsdom": "24.0.0",
|
|
75
75
|
"postcss": "8.4.38",
|
|
76
76
|
"prettier": "3.2.5",
|
|
77
|
-
"prettier-plugin-tailwindcss": "0.5.
|
|
77
|
+
"prettier-plugin-tailwindcss": "0.5.14",
|
|
78
78
|
"react": "18.2.0",
|
|
79
79
|
"react-dom": "18.2.0",
|
|
80
80
|
"react-router-dom": "6.22.3",
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"tsup": "8.0.2",
|
|
83
83
|
"tsx": "4.7.2",
|
|
84
84
|
"typescript": "5.4.5",
|
|
85
|
-
"vite": "5.2.
|
|
85
|
+
"vite": "5.2.9",
|
|
86
86
|
"vite-tsconfig-paths": "4.3.2",
|
|
87
|
-
"vitest": "1.
|
|
87
|
+
"vitest": "1.5.0",
|
|
88
88
|
"vitest-dom": "0.1.1",
|
|
89
89
|
"zod": "3.22.4"
|
|
90
90
|
},
|
|
@@ -224,7 +224,6 @@
|
|
|
224
224
|
"types": "./dist/types.d.ts"
|
|
225
225
|
}
|
|
226
226
|
},
|
|
227
|
-
"module": "index.ts",
|
|
228
227
|
"scripts": {
|
|
229
228
|
"build": "rm -rf dist && tsup",
|
|
230
229
|
"docs:build": "remix build",
|
package/dist/alert.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _classvarianceauthority = require('class-variance-authority');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var d=_classvarianceauthority.cva.call(void 0, "relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm",{variants:{priority:{danger:"border-danger-500/50 bg-danger-500/10 text-danger-700",default:"border-neutral-500/50 bg-neutral-500/10 text-neutral-700",info:"border-accent-500/50 bg-accent-500/10 text-accent-700",success:"border-success-500/50 bg-success-500/10 text-success-700",warning:"border-warning-500/50 bg-warning-500/10 text-warning-700"}},defaultVariants:{priority:"default"}}),l= exports.Alert =_react.forwardRef.call(void 0, ({className:e,priority:t="default",...r},c)=>_jsxruntime.jsx.call(void 0, "div",{ref:c,className:_chunkD3F6KEREcjs.a.call(void 0, d({priority:t}),e),...r}));l.displayName="Alert";var s=_react.forwardRef.call(void 0, ({className:e,...t},r)=>_jsxruntime.jsx.call(void 0, "div",{ref:r,className:_chunkD3F6KEREcjs.a.call(void 0, "min-w-0 flex-1",e),...t}));s.displayName="AlertContent";var o=_react.forwardRef.call(void 0, ({className:e,...t},r)=>_jsxruntime.jsx.call(void 0, "h5",{ref:r,className:_chunkD3F6KEREcjs.a.call(void 0, "font-medium",e),...t}));o.displayName="AlertTitle";var m=_react.forwardRef.call(void 0, ({className:e,...t},r)=>_jsxruntime.jsx.call(void 0, "div",{ref:r,className:_chunkD3F6KEREcjs.a.call(void 0, "text-sm",e),...t}));m.displayName="AlertDescription";exports.Alert = l; exports.AlertContent = s; exports.AlertDescription = m; exports.AlertTitle = o;
|
|
2
|
-
//# sourceMappingURL=alert.cjs.map
|
package/dist/alert.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/alert/src/alert.tsx"],"names":["cva","forwardRef","jsx","alertVariants","Alert","className","priority","props","ref","cx","AlertContent","AlertTitle","AlertDescription"],"mappings":"oCAAA,OAAS,OAAAA,MAAW,2BACpB,OAAS,cAAAC,MAAkB,QAgCzB,cAAAC,MAAA,oBA3BF,IAAMC,EAAgBH,EAAI,+DAAgE,CACzF,SAAU,CAMT,SAAU,CACT,OAAQ,wDACR,QAAS,2DACT,KAAM,wDACN,QAAS,2DACT,QAAS,0DACV,CACD,EACA,gBAAiB,CAChB,SAAU,SACX,CACD,CAAC,EAOKI,EAAQH,EACb,CAAC,CAAE,UAAAI,EAAW,SAAAC,EAAW,UAAW,GAAGC,CAAM,EAAGC,IAC/CN,EAAC,OAAI,IAAKM,EAAK,UAAWC,EAAGN,EAAc,CAAE,SAAAG,CAAS,CAAC,EAAGD,CAAS,EAAI,GAAGE,EAAO,CAEnF,EACAH,EAAM,YAAc,QAKpB,IAAMM,EAAeT,EAA2D,CAAC,CAAE,UAAAI,EAAW,GAAGE,CAAM,EAAGC,IACzGN,EAAC,OAAI,IAAKM,EAAK,UAAWC,EAAG,iBAAkBJ,CAAS,EAAI,GAAGE,EAAO,CACtE,EACDG,EAAa,YAAc,eAK3B,IAAMC,EAAaV,EAClB,CAAC,CAAE,UAAAI,EAAW,GAAGE,CAAM,EAAGC,IAAQN,EAAC,MAAG,IAAKM,EAAK,UAAWC,EAAG,cAAeJ,CAAS,EAAI,GAAGE,EAAO,CACrG,EACAI,EAAW,YAAc,aAKzB,IAAMC,EAAmBX,EACxB,CAAC,CAAE,UAAAI,EAAW,GAAGE,CAAM,EAAGC,IAAQN,EAAC,OAAI,IAAKM,EAAK,UAAWC,EAAG,UAAWJ,CAAS,EAAI,GAAGE,EAAO,CAClG,EACAK,EAAiB,YAAc","sourcesContent":["import { cva } from \"class-variance-authority\";\nimport { forwardRef } from \"react\";\nimport type { HTMLAttributes } from \"react\";\nimport { cx } from \"../../cx\";\nimport type { VariantProps } from \"../../types\";\n\nconst alertVariants = cva(\"relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm\", {\n\tvariants: {\n\t\t/**\n\t\t * The priority of the Alert. Indicates the importance or impact level of the Alert,\n\t\t * affecting its color and styling to communicate its purpose to the user.\n\t\t * @default \"default\"\n\t\t */\n\t\tpriority: {\n\t\t\tdanger: \"border-danger-500/50 bg-danger-500/10 text-danger-700\",\n\t\t\tdefault: \"border-neutral-500/50 bg-neutral-500/10 text-neutral-700\",\n\t\t\tinfo: \"border-accent-500/50 bg-accent-500/10 text-accent-700\",\n\t\t\tsuccess: \"border-success-500/50 bg-success-500/10 text-success-700\",\n\t\t\twarning: \"border-warning-500/50 bg-warning-500/10 text-warning-700\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tpriority: \"default\",\n\t},\n});\n\ntype AlertVariants = VariantProps<typeof alertVariants>;\n\n/**\n * Displays a callout for user attention.\n */\nconst Alert = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement> & AlertVariants>(\n\t({ className, priority = \"default\", ...props }, ref) => (\n\t\t<div ref={ref} className={cx(alertVariants({ priority }), className)} {...props} />\n\t),\n);\nAlert.displayName = \"Alert\";\n\n/**\n * The container for the content slot of an alert. Place the title and description as direct children.\n */\nconst AlertContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (\n\t<div ref={ref} className={cx(\"min-w-0 flex-1\", className)} {...props} />\n));\nAlertContent.displayName = \"AlertContent\";\n\n/**\n * The title of an alert.\n */\nconst AlertTitle = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLHeadingElement>>(\n\t({ className, ...props }, ref) => <h5 ref={ref} className={cx(\"font-medium\", className)} {...props} />,\n);\nAlertTitle.displayName = \"AlertTitle\";\n\n/**\n * The description of an alert.\n */\nconst AlertDescription = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement>>(\n\t({ className, ...props }, ref) => <div ref={ref} className={cx(\"text-sm\", className)} {...props} />,\n);\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, AlertContent, AlertTitle, AlertDescription };\n"]}
|
package/dist/alert.d.cts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { HTMLAttributes } from 'react';
|
|
3
|
-
import * as class_variance_authority from 'class-variance-authority';
|
|
4
|
-
import { D as DeepNonNullable } from './deep-non-nullable-SmpSvoSd.cjs';
|
|
5
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Displays a callout for user attention.
|
|
9
|
-
*/
|
|
10
|
-
declare const Alert: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & Partial<DeepNonNullable<class_variance_authority.VariantProps<(props?: ({
|
|
11
|
-
priority?: "danger" | "default" | "info" | "success" | "warning" | null | undefined;
|
|
12
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string>>> & react.RefAttributes<HTMLDivElement>>;
|
|
13
|
-
/**
|
|
14
|
-
* The container for the content slot of an alert. Place the title and description as direct children.
|
|
15
|
-
*/
|
|
16
|
-
declare const AlertContent: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
/**
|
|
18
|
-
* The title of an alert.
|
|
19
|
-
*/
|
|
20
|
-
declare const AlertTitle: react.ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & react.RefAttributes<HTMLParagraphElement>>;
|
|
21
|
-
/**
|
|
22
|
-
* The description of an alert.
|
|
23
|
-
*/
|
|
24
|
-
declare const AlertDescription: react.ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & react.RefAttributes<HTMLParagraphElement>>;
|
|
25
|
-
|
|
26
|
-
export { Alert, AlertContent, AlertDescription, AlertTitle };
|
package/dist/anchor.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _reactslot = require('@radix-ui/react-slot');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var s=e=>_chunkD3F6KEREcjs.a.call(void 0, "cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-none focus-visible:ring focus-visible:ring-focus-accent",e),i= exports.Anchor =_react.forwardRef.call(void 0, ({asChild:e,className:n,rel:t,...r},c)=>{let u=e?_reactslot.Slot:"a",f=l(t);return _jsxruntime.jsx.call(void 0, u,{className:s(n),ref:c,rel:f,...r})});i.displayName="Anchor";function l(e){return Array.isArray(e)?[...new Set(e)].map(r=>_optionalChain([r, 'optionalAccess', _ => _.trim, 'call', _2 => _2()])).filter(Boolean).sort().join(" ")||void 0:_optionalChain([e, 'optionalAccess', _3 => _3.trim, 'call', _4 => _4()])||void 0}exports.Anchor = i; exports.anchorClassNames = s; exports.resolveRel = l;
|
|
2
|
-
//# sourceMappingURL=anchor.cjs.map
|
package/dist/anchor.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/anchor/src/anchor.tsx"],"names":["Slot","forwardRef","jsx","anchorClassNames","className","cx","Anchor","asChild","propRel","props","ref","Component","rel","resolveRel","item"],"mappings":"yCAAA,OAAS,QAAAA,MAAY,uBACrB,OAA+B,cAAAC,MAAkB,QAoDzC,cAAAC,MAAA,oBA5CR,IAAMC,EAAoBC,GACzBC,EACC,8IACAD,CACD,EAoCKE,EAASL,EAA2C,CAAC,CAAE,QAAAM,EAAS,UAAAH,EAAW,IAAKI,EAAS,GAAGC,CAAM,EAAGC,IAAQ,CAClH,IAAMC,EAAYJ,EAAUP,EAAO,IAC7BY,EAAMC,EAAWL,CAAO,EAE9B,OAAON,EAACS,EAAA,CAAU,UAAWR,EAAiBC,CAAS,EAAG,IAAKM,EAAK,IAAKE,EAAM,GAAGH,EAAO,CAC1F,CAAC,EACDH,EAAO,YAAc,SAOrB,SAASO,EAAWD,EAA0F,CAC7G,OAAI,MAAM,QAAQA,CAAG,EAEL,CAAC,GADE,IAAI,IAAIA,CAAG,CACD,EAC1B,IAAKE,GAASA,GAAM,KAAK,CAAC,EAC1B,OAAO,OAAO,EACd,KAAK,EACL,KAAK,GAAG,GACO,OAIXF,GAAK,KAAK,GAAK,MACvB","sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport { AnchorHTMLAttributes, forwardRef } from \"react\";\nimport { cx } from \"../../cx\";\nimport { WithAsChild } from \"../../types/src/as-child\";\nimport type { Rel, Target } from \"./types\";\n\n/**\n * The class names for the `Anchor` component which define the styles for the component.\n */\nconst anchorClassNames = (className: string | undefined) =>\n\tcx(\n\t\t\"cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-none focus-visible:ring focus-visible:ring-focus-accent\",\n\t\tclassName,\n\t);\n\n/**\n * The props for the `Anchor` component.\n */\ntype AnchorProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"rel\" | \"target\"> &\n\tWithAsChild & {\n\t\t/**\n\t\t * The rel attribute defines the relationship between a linked resource and the current document.\n\t\t *\n\t\t * Every keyword within a space-separated value should be unique within that value.\n\t\t *\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel\n\t\t */\n\t\trel?: Rel | (string & {}) | undefined | (Rel | (string & {}) | undefined | null)[];\n\t\t/**\n\t\t * Where to display the linked URL, as the name for a browsing context (a tab, window, or <iframe>).\n\t\t *\n\t\t * Note: Setting `target=\"_blank\"` on <a> elements implicitly provides the same rel behavior as setting `rel=\"noopener\"` which does not set `window.opener`.\n\t\t *\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target\n\t\t *\n\t\t * @default \"_self\"\n\t\t */\n\t\ttarget?: Target | undefined;\n\t};\n\n/**\n * Fundamental component for rendering links to external addresses.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a\n *\n * @note If you need to link to an internal application route, prefer using the\n * [`react-router-dom` `<Link>`](https://reactrouter.com/en/main/components/link) or the\n * [`@remix-run/react` `<Link>`](https://remix.run/docs/en/main/components/link).\n */\nconst Anchor = forwardRef<HTMLAnchorElement, AnchorProps>(({ asChild, className, rel: propRel, ...props }, ref) => {\n\tconst Component = asChild ? Slot : \"a\";\n\tconst rel = resolveRel(propRel);\n\n\treturn <Component className={anchorClassNames(className)} ref={ref} rel={rel} {...props} />;\n});\nAnchor.displayName = \"Anchor\";\n\n/**\n * Resolves the `rel` attribute to a string.\n *\n * If the value is an array, it will be filtered for empty values, ensure uniqueness, sorted, and joined with a space.\n */\nfunction resolveRel(rel: Rel | (string & {}) | undefined | null | (Rel | (string & {}) | undefined | null)[]) {\n\tif (Array.isArray(rel)) {\n\t\tconst uniqueRel = new Set(rel);\n\t\tconst result = [...uniqueRel]\n\t\t\t.map((item) => item?.trim())\n\t\t\t.filter(Boolean)\n\t\t\t.sort()\n\t\t\t.join(\" \");\n\t\treturn result || undefined;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n\treturn rel?.trim() || undefined;\n}\n\nexport { Anchor, anchorClassNames, resolveRel };\nexport type { AnchorProps };\n"]}
|
package/dist/anchor.d.cts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { HTMLAttributeAnchorTarget, AnchorHTMLAttributes } from 'react';
|
|
3
|
-
import { W as WithAsChild } from './as-child-BjnPZ1DU.cjs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The rel attribute defines the relationship between a linked resource and the current document. Valid on <link>, <a>, <area>, and <form>, the supported values depend on the element on which the attribute is found.
|
|
7
|
-
*
|
|
8
|
-
* Every keyword within a space-separated value should be unique within that value.
|
|
9
|
-
*
|
|
10
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel
|
|
11
|
-
*/
|
|
12
|
-
type Rel = "alternate" | "author" | "bookmark" | "canonical" | "dns-prefetch" | "external" | "help" | "icon" | "license" | "manifest" | "me" | "modulepreload" | "next" | "nofollow" | "noopener" | "noreferrer" | "opener" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "prev" | "privacy-policy" | "search" | "stylesheet" | "tag" | "terms-of-service";
|
|
13
|
-
/**
|
|
14
|
-
* Where to display the linked URL, as the name for a browsing context (a tab, window, or <iframe>).
|
|
15
|
-
*
|
|
16
|
-
* Note: Setting target="_blank" on <a> elements implicitly provides the same rel behavior as setting rel="noopener" which does not set window.opener.
|
|
17
|
-
*
|
|
18
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target
|
|
19
|
-
*
|
|
20
|
-
* @default "_self"
|
|
21
|
-
*/
|
|
22
|
-
type Target = (HTMLAttributeAnchorTarget & "_self") | "_blank" | "_parent" | "_top" | "_unfencedTop";
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* The class names for the `Anchor` component which define the styles for the component.
|
|
26
|
-
*/
|
|
27
|
-
declare const anchorClassNames: (className: string | undefined) => string;
|
|
28
|
-
/**
|
|
29
|
-
* The props for the `Anchor` component.
|
|
30
|
-
*/
|
|
31
|
-
type AnchorProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "rel" | "target"> & WithAsChild & {
|
|
32
|
-
/**
|
|
33
|
-
* The rel attribute defines the relationship between a linked resource and the current document.
|
|
34
|
-
*
|
|
35
|
-
* Every keyword within a space-separated value should be unique within that value.
|
|
36
|
-
*
|
|
37
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel
|
|
38
|
-
*/
|
|
39
|
-
rel?: Rel | (string & {}) | undefined | (Rel | (string & {}) | undefined | null)[];
|
|
40
|
-
/**
|
|
41
|
-
* Where to display the linked URL, as the name for a browsing context (a tab, window, or <iframe>).
|
|
42
|
-
*
|
|
43
|
-
* Note: Setting `target="_blank"` on <a> elements implicitly provides the same rel behavior as setting `rel="noopener"` which does not set `window.opener`.
|
|
44
|
-
*
|
|
45
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target
|
|
46
|
-
*
|
|
47
|
-
* @default "_self"
|
|
48
|
-
*/
|
|
49
|
-
target?: Target | undefined;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Fundamental component for rendering links to external addresses.
|
|
53
|
-
*
|
|
54
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
|
|
55
|
-
*
|
|
56
|
-
* @note If you need to link to an internal application route, prefer using the
|
|
57
|
-
* [`react-router-dom` `<Link>`](https://reactrouter.com/en/main/components/link) or the
|
|
58
|
-
* [`@remix-run/react` `<Link>`](https://remix.run/docs/en/main/components/link).
|
|
59
|
-
*/
|
|
60
|
-
declare const Anchor: react.ForwardRefExoticComponent<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "rel" | "target"> & WithAsChild & {
|
|
61
|
-
/**
|
|
62
|
-
* The rel attribute defines the relationship between a linked resource and the current document.
|
|
63
|
-
*
|
|
64
|
-
* Every keyword within a space-separated value should be unique within that value.
|
|
65
|
-
*
|
|
66
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel
|
|
67
|
-
*/
|
|
68
|
-
rel?: Rel | (string & {}) | undefined | (Rel | (string & {}) | undefined | null)[];
|
|
69
|
-
/**
|
|
70
|
-
* Where to display the linked URL, as the name for a browsing context (a tab, window, or <iframe>).
|
|
71
|
-
*
|
|
72
|
-
* Note: Setting `target="_blank"` on <a> elements implicitly provides the same rel behavior as setting `rel="noopener"` which does not set `window.opener`.
|
|
73
|
-
*
|
|
74
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target
|
|
75
|
-
*
|
|
76
|
-
* @default "_self"
|
|
77
|
-
*/
|
|
78
|
-
target?: Target | undefined;
|
|
79
|
-
} & react.RefAttributes<HTMLAnchorElement>>;
|
|
80
|
-
/**
|
|
81
|
-
* Resolves the `rel` attribute to a string.
|
|
82
|
-
*
|
|
83
|
-
* If the value is an array, it will be filtered for empty values, ensure uniqueness, sorted, and joined with a space.
|
|
84
|
-
*/
|
|
85
|
-
declare function resolveRel(rel: Rel | (string & {}) | undefined | null | (Rel | (string & {}) | undefined | null)[]): string | undefined;
|
|
86
|
-
|
|
87
|
-
export { Anchor, type AnchorProps, type Rel, type Target, anchorClassNames, resolveRel };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility type for adding the `asChild` boolean prop to a component.
|
|
3
|
-
*/
|
|
4
|
-
type WithAsChild = {
|
|
5
|
-
/**
|
|
6
|
-
* Use the `asChild` prop to compose Radix's functionality onto alternative
|
|
7
|
-
* element types or your own React components.
|
|
8
|
-
*
|
|
9
|
-
* All Radix primitive parts that render a DOM element accept an `asChild`
|
|
10
|
-
* prop. When `asChild` is set to `true`, Radix will not render a default DOM
|
|
11
|
-
* element, instead cloning the part's child and passing it the props and
|
|
12
|
-
* behavior required to make it functional.
|
|
13
|
-
*
|
|
14
|
-
* asChild can be used as deeply as you need to. This means it is a great way
|
|
15
|
-
* to compose multiple primitive's behavior together.
|
|
16
|
-
*
|
|
17
|
-
* @see https://www.radix-ui.com/docs/primitives/guides/composition#composition
|
|
18
|
-
*/
|
|
19
|
-
asChild?: boolean;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type { WithAsChild as W };
|
package/dist/button.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkK4UKFOMIcjs = require('./chunk-K4UKFOMI.cjs');require('./chunk-JGNAMNKZ.cjs');require('./chunk-D3F6KERE.cjs');exports.Button = _chunkK4UKFOMIcjs.a; exports.IconButton = _chunkK4UKFOMIcjs.b;
|
|
2
|
-
//# sourceMappingURL=button.cjs.map
|
package/dist/button.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/button.d.cts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
3
|
-
import { W as WithAsChild } from './as-child-BjnPZ1DU.cjs';
|
|
4
|
-
import { V as VariantProps } from './variant-props-DnYnbC7s.cjs';
|
|
5
|
-
import { D as DeepNonNullable } from './deep-non-nullable-SmpSvoSd.cjs';
|
|
6
|
-
import * as class_variance_authority from 'class-variance-authority';
|
|
7
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
8
|
-
|
|
9
|
-
declare const buttonVariants: (props?: ({
|
|
10
|
-
appearance?: "link" | "filled" | "ghost" | "outlined" | null | undefined;
|
|
11
|
-
iconPlacement?: "end" | "start" | null | undefined;
|
|
12
|
-
isLoading?: boolean | null | undefined;
|
|
13
|
-
priority?: "default" | "danger" | "neutral" | null | undefined;
|
|
14
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
|
-
type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
16
|
-
/**
|
|
17
|
-
* The props for the `Button` component.
|
|
18
|
-
*/
|
|
19
|
-
type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & WithAsChild & ButtonVariants & {
|
|
20
|
-
/**
|
|
21
|
-
* An icon to render inside the button. If the `state` is `"pending"`, then
|
|
22
|
-
* the icon will automatically be replaced with a spinner.
|
|
23
|
-
*/
|
|
24
|
-
icon?: ReactNode;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Renders a button or a component that looks like a button, an interactive
|
|
28
|
-
* element activated by a user with a mouse, keyboard, finger, voice command, or
|
|
29
|
-
* other assistive technology. Once activated, it then performs an action, such
|
|
30
|
-
* as submitting a form or opening a dialog.
|
|
31
|
-
*
|
|
32
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button
|
|
33
|
-
*/
|
|
34
|
-
declare const Button: react.ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & WithAsChild & Partial<DeepNonNullable<class_variance_authority.VariantProps<(props?: ({
|
|
35
|
-
appearance?: "link" | "filled" | "ghost" | "outlined" | null | undefined;
|
|
36
|
-
iconPlacement?: "end" | "start" | null | undefined;
|
|
37
|
-
isLoading?: boolean | null | undefined;
|
|
38
|
-
priority?: "default" | "danger" | "neutral" | null | undefined;
|
|
39
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string>>> & {
|
|
40
|
-
/**
|
|
41
|
-
* An icon to render inside the button. If the `state` is `"pending"`, then
|
|
42
|
-
* the icon will automatically be replaced with a spinner.
|
|
43
|
-
*/
|
|
44
|
-
icon?: ReactNode;
|
|
45
|
-
} & react.RefAttributes<HTMLButtonElement>>;
|
|
46
|
-
|
|
47
|
-
declare const iconButtonVariants: (props?: ({
|
|
48
|
-
appearance?: "ghost" | "outlined" | null | undefined;
|
|
49
|
-
isLoading?: boolean | null | undefined;
|
|
50
|
-
size?: "xs" | "sm" | "md" | null | undefined;
|
|
51
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
52
|
-
type IconButtonVariants = VariantProps<typeof iconButtonVariants>;
|
|
53
|
-
/**
|
|
54
|
-
* The props for the `Button` component.
|
|
55
|
-
*/
|
|
56
|
-
type IconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & WithAsChild & IconButtonVariants & {
|
|
57
|
-
/**
|
|
58
|
-
* The accessible label for the icon. This label will be visually hidden but announced to screen reader users, similar to alt text for img tags.
|
|
59
|
-
*/
|
|
60
|
-
label: string;
|
|
61
|
-
/**
|
|
62
|
-
* An icon to render inside the button. If the `state` is `"pending"`, then
|
|
63
|
-
* the icon will automatically be replaced with a spinner.
|
|
64
|
-
*/
|
|
65
|
-
icon: ReactNode;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Renders a button or a component that looks like a button, an interactive
|
|
69
|
-
* element activated by a user with a mouse, keyboard, finger, voice command, or
|
|
70
|
-
* other assistive technology. Once activated, it then performs an action, such
|
|
71
|
-
* as submitting a form or opening a dialog.
|
|
72
|
-
* Renders only a single icon as children with an accessible, screen-reader-only label.
|
|
73
|
-
*
|
|
74
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button
|
|
75
|
-
*/
|
|
76
|
-
declare const IconButton: react.ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & WithAsChild & Partial<DeepNonNullable<class_variance_authority.VariantProps<(props?: ({
|
|
77
|
-
appearance?: "ghost" | "outlined" | null | undefined;
|
|
78
|
-
isLoading?: boolean | null | undefined;
|
|
79
|
-
size?: "xs" | "sm" | "md" | null | undefined;
|
|
80
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string>>> & {
|
|
81
|
-
/**
|
|
82
|
-
* The accessible label for the icon. This label will be visually hidden but announced to screen reader users, similar to alt text for img tags.
|
|
83
|
-
*/
|
|
84
|
-
label: string;
|
|
85
|
-
/**
|
|
86
|
-
* An icon to render inside the button. If the `state` is `"pending"`, then
|
|
87
|
-
* the icon will automatically be replaced with a spinner.
|
|
88
|
-
*/
|
|
89
|
-
icon: ReactNode;
|
|
90
|
-
} & react.RefAttributes<HTMLButtonElement>>;
|
|
91
|
-
|
|
92
|
-
export { Button, type ButtonProps, IconButton, type IconButtonProps };
|
package/dist/card.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _reactslot = require('@radix-ui/react-slot');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var p=_react.forwardRef.call(void 0, ({className:r,children:e,...d},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkD3F6KEREcjs.a.call(void 0, "relative divide-y divide-card-muted rounded-md border border-card bg-card",r),...d,children:e}));p.displayName="Card";var s=_react.forwardRef.call(void 0, ({className:r,children:e,...d},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkD3F6KEREcjs.a.call(void 0, "p-6",r),...d,children:e}));s.displayName="CardBody";var m=_react.forwardRef.call(void 0, ({className:r,children:e,...d},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkD3F6KEREcjs.a.call(void 0, "px-6 py-3",r),...d,children:e}));m.displayName="CardFooter";var l=_react.forwardRef.call(void 0, ({className:r,children:e,...d},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkD3F6KEREcjs.a.call(void 0, "px-6 py-3",r),...d,children:e}));l.displayName="CardHeader";var C=_react.forwardRef.call(void 0, ({className:r,asChild:e,...d},a)=>_jsxruntime.jsx.call(void 0, e?_reactslot.Slot:"h3",{ref:a,className:_chunkD3F6KEREcjs.a.call(void 0, "font-semibold leading-none tracking-tight",r),...d}));C.displayName="CardTitle";exports.Card = p; exports.CardBody = s; exports.CardFooter = m; exports.CardHeader = l; exports.CardTitle = C;
|
|
2
|
-
//# sourceMappingURL=card.cjs.map
|
package/dist/card.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/card/src/card.tsx"],"names":["Slot","forwardRef","jsx","Card","className","children","rest","ref","cx","CardBody","CardFooter","CardHeader","CardTitle","asChild","props"],"mappings":"yCAAA,OAAS,QAAAA,MAAY,uBAErB,OAAS,cAAAC,MAAkB,QAW1B,cAAAC,MAAA,oBADM,IAAMC,EAAOF,EAAsC,CAAC,CAAE,UAAAG,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAC5FL,EAAC,OACA,IAAKK,EACL,UAAWC,EAAG,4EAA6EJ,CAAS,EACnG,GAAGE,EAEH,SAAAD,EACF,CACA,EACDF,EAAK,YAAc,OAKZ,IAAMM,EAAWR,EAAsC,CAAC,CAAE,UAAAG,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAChGL,EAAC,OAAI,IAAKK,EAAK,UAAWC,EAAG,MAAOJ,CAAS,EAAI,GAAGE,EAClD,SAAAD,EACF,CACA,EACDI,EAAS,YAAc,WAKhB,IAAMC,EAAaT,EAAsC,CAAC,CAAE,UAAAG,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAClGL,EAAC,OAAI,IAAKK,EAAK,UAAWC,EAAG,YAAaJ,CAAS,EAAI,GAAGE,EACxD,SAAAD,EACF,CACA,EACDK,EAAW,YAAc,aAKlB,IAAMC,EAAaV,EAAsC,CAAC,CAAE,UAAAG,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAClGL,EAAC,OAAI,IAAKK,EAAK,UAAWC,EAAG,YAAaJ,CAAS,EAAI,GAAGE,EACxD,SAAAD,EACF,CACA,EACDM,EAAW,YAAc,aAOlB,IAAMC,EAAYX,EAAiD,CAAC,CAAE,UAAAG,EAAW,QAAAS,EAAS,GAAGC,CAAM,EAAGP,IAErGL,EADMW,EAAUb,EAAO,KACtB,CAAK,IAAKO,EAAK,UAAWC,EAAG,4CAA6CJ,CAAS,EAAI,GAAGU,EAAO,CACzG,EACDF,EAAU,YAAc","sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef } from \"react\";\nimport { cx } from \"../../cx\";\nimport type { WithAsChild } from \"../../types/src/as-child\";\n\nexport type CardProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * A container that can be used to display content in a box resembling a playing\n * card.\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>(({ className, children, ...rest }, ref) => (\n\t<div\n\t\tref={ref}\n\t\tclassName={cx(\"relative divide-y divide-card-muted rounded-md border border-card bg-card\", className)}\n\t\t{...rest}\n\t>\n\t\t{children}\n\t</div>\n));\nCard.displayName = \"Card\";\n\n/**\n * The main content of a card. Usually composed as a direct child of a `Card` component.\n */\nexport const CardBody = forwardRef<HTMLDivElement, CardProps>(({ className, children, ...rest }, ref) => (\n\t<div ref={ref} className={cx(\"p-6\", className)} {...rest}>\n\t\t{children}\n\t</div>\n));\nCardBody.displayName = \"CardBody\";\n\n/**\n * The footer container of a card. Usually composed as a direct child of a `Card` component.\n */\nexport const CardFooter = forwardRef<HTMLDivElement, CardProps>(({ className, children, ...rest }, ref) => (\n\t<div ref={ref} className={cx(\"px-6 py-3\", className)} {...rest}>\n\t\t{children}\n\t</div>\n));\nCardFooter.displayName = \"CardFooter\";\n\n/**\n * The header container of a card. Usually composed as a direct child of a `Card` component.\n */\nexport const CardHeader = forwardRef<HTMLDivElement, CardProps>(({ className, children, ...rest }, ref) => (\n\t<div ref={ref} className={cx(\"px-6 py-3\", className)} {...rest}>\n\t\t{children}\n\t</div>\n));\nCardHeader.displayName = \"CardHeader\";\n\nexport type CardTitleProps = HTMLAttributes<HTMLHeadingElement> & WithAsChild;\n\n/**\n * The title of a card. Usually composed as a direct child of a `CardHeader` component.\n */\nexport const CardTitle = forwardRef<HTMLParagraphElement, CardTitleProps>(({ className, asChild, ...props }, ref) => {\n\tconst Comp = asChild ? Slot : \"h3\";\n\treturn <Comp ref={ref} className={cx(\"font-semibold leading-none tracking-tight\", className)} {...props} />;\n});\nCardTitle.displayName = \"CardTitle\";\n"]}
|
package/dist/card.d.cts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { HTMLAttributes } from 'react';
|
|
3
|
-
import { W as WithAsChild } from './as-child-BjnPZ1DU.cjs';
|
|
4
|
-
|
|
5
|
-
type CardProps = HTMLAttributes<HTMLDivElement>;
|
|
6
|
-
/**
|
|
7
|
-
* A container that can be used to display content in a box resembling a playing
|
|
8
|
-
* card.
|
|
9
|
-
*/
|
|
10
|
-
declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
/**
|
|
12
|
-
* The main content of a card. Usually composed as a direct child of a `Card` component.
|
|
13
|
-
*/
|
|
14
|
-
declare const CardBody: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
|
|
15
|
-
/**
|
|
16
|
-
* The footer container of a card. Usually composed as a direct child of a `Card` component.
|
|
17
|
-
*/
|
|
18
|
-
declare const CardFooter: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
|
|
19
|
-
/**
|
|
20
|
-
* The header container of a card. Usually composed as a direct child of a `Card` component.
|
|
21
|
-
*/
|
|
22
|
-
declare const CardHeader: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
|
|
23
|
-
type CardTitleProps = HTMLAttributes<HTMLHeadingElement> & WithAsChild;
|
|
24
|
-
/**
|
|
25
|
-
* The title of a card. Usually composed as a direct child of a `CardHeader` component.
|
|
26
|
-
*/
|
|
27
|
-
declare const CardTitle: react.ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & WithAsChild & react.RefAttributes<HTMLParagraphElement>>;
|
|
28
|
-
|
|
29
|
-
export { Card, CardBody, CardFooter, CardHeader, type CardProps, CardTitle, type CardTitleProps };
|
package/dist/checkbox.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _reactcheckbox = require('@radix-ui/react-checkbox'); var t = _interopRequireWildcard(_reactcheckbox);var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var a=_react.forwardRef.call(void 0, ({className:o,...i},s)=>_jsxruntime.jsxs.call(void 0, t.Root,{ref:s,className:_chunkD3F6KEREcjs.a.call(void 0, "size-4 shrink-0 appearance-none rounded border border-form bg-form focus:border-accent-600 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-focus-accent disabled:cursor-not-allowed disabled:opacity-50 data-state-checked:border-transparent data-state-checked:bg-filled-accent data-state-indeterminate:border-transparent data-state-indeterminate:bg-filled-accent",o),...i,children:[_jsxruntime.jsx.call(void 0, t.Indicator,{className:"hidden items-center justify-center leading-none text-on-filled data-state-checked:flex",children:_jsxruntime.jsx.call(void 0, c,{className:"size-3"})}),_jsxruntime.jsx.call(void 0, t.Indicator,{className:"hidden items-center justify-center text-on-filled data-state-indeterminate:flex",children:_jsxruntime.jsx.call(void 0, l,{className:"size-3"})}),_jsxruntime.jsx.call(void 0, t.Indicator,{})]}));a.displayName="Checkbox";var c=({className:o,style:i})=>_jsxruntime.jsx.call(void 0, "svg",{className:o,style:i,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_jsxruntime.jsx.call(void 0, "path",{d:"M12.7071 4.29289C13.0976 4.68342 13.0976 5.31658 12.7071 5.70711L6.70711 11.7071C6.31658 12.0976 5.68342 12.0976 5.29289 11.7071L3.29289 9.70711C2.90237 9.31658 2.90237 8.68342 3.29289 8.29289C3.68342 7.90237 4.31658 7.90237 4.70711 8.29289L6 9.58579L11.2929 4.29289C11.6834 3.90237 12.3166 3.90237 12.7071 4.29289Z",fill:"currentColor"})}),l=({className:o,style:i})=>_jsxruntime.jsx.call(void 0, "svg",{className:o,style:i,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_jsxruntime.jsx.call(void 0, "path",{d:"M4 8C4 7.44772 4.44772 7 5 7H11C11.5523 7 12 7.44772 12 8C12 8.55228 11.5523 9 11 9H5C4.44772 9 4 8.55228 4 8Z",fill:"currentColor"})});exports.Checkbox = a;
|
|
2
|
-
//# sourceMappingURL=checkbox.cjs.map
|
package/dist/checkbox.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/checkbox/src/checkbox.tsx"],"names":["CheckboxPrimitive","forwardRef","jsx","jsxs","Checkbox","className","props","ref","cx","CheckedIcon","IndeterminateIcon","style"],"mappings":"yCAAA,UAAYA,MAAuB,2BACnC,OAAS,cAAAC,MAAkB,QAQ1B,OASE,OAAAC,EATF,QAAAC,MAAA,oBADD,IAAMC,EAAWH,EAA6D,CAAC,CAAE,UAAAI,EAAW,GAAGC,CAAM,EAAGC,IACvGJ,EAAmB,OAAlB,CACA,IAAKI,EACL,UAAWC,EACV,6XACAH,CACD,EACC,GAAGC,EAEJ,UAAAJ,EAAmB,YAAlB,CAA4B,UAAU,yFACtC,SAAAA,EAACO,EAAA,CAAY,UAAU,SAAS,EACjC,EACAP,EAAmB,YAAlB,CAA4B,UAAU,kFACtC,SAAAA,EAACQ,EAAA,CAAkB,UAAU,SAAS,EACvC,EACAR,EAAmB,YAAlB,EAA4B,GAC9B,CACA,EACDE,EAAS,YAAc,WAIvB,IAAMK,EAAc,CAAC,CAAE,UAAAJ,EAAW,MAAAM,CAAM,IACvCT,EAAC,OAAI,UAAWG,EAAW,MAAOM,EAAO,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAC9E,SAAAT,EAAC,QACA,EAAE,8TACF,KAAK,eACN,EACD,EAGKQ,EAAoB,CAAC,CAAE,UAAAL,EAAW,MAAAM,CAAM,IAC7CT,EAAC,OAAI,UAAWG,EAAW,MAAOM,EAAO,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAC9E,SAAAT,EAAC,QACA,EAAE,iHACF,KAAK,eACN,EACD","sourcesContent":["import * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\";\nimport { cx } from \"../../cx\";\nimport { WithStyleProps } from \"../../types\";\n\ntype Props = ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>;\n\nconst Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(({ className, ...props }, ref) => (\n\t<CheckboxPrimitive.Root\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"size-4 shrink-0 appearance-none rounded border border-form bg-form focus:border-accent-600 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-focus-accent disabled:cursor-not-allowed disabled:opacity-50 data-state-checked:border-transparent data-state-checked:bg-filled-accent data-state-indeterminate:border-transparent data-state-indeterminate:bg-filled-accent\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t<CheckboxPrimitive.Indicator className=\"hidden items-center justify-center leading-none text-on-filled data-state-checked:flex\">\n\t\t\t<CheckedIcon className=\"size-3\" />\n\t\t</CheckboxPrimitive.Indicator>\n\t\t<CheckboxPrimitive.Indicator className=\"hidden items-center justify-center text-on-filled data-state-indeterminate:flex\">\n\t\t\t<IndeterminateIcon className=\"size-3\" />\n\t\t</CheckboxPrimitive.Indicator>\n\t\t<CheckboxPrimitive.Indicator />\n\t</CheckboxPrimitive.Root>\n));\nCheckbox.displayName = \"Checkbox\";\n\nexport { Checkbox };\n\nconst CheckedIcon = ({ className, style }: WithStyleProps) => (\n\t<svg className={className} style={style} viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t<path\n\t\t\td=\"M12.7071 4.29289C13.0976 4.68342 13.0976 5.31658 12.7071 5.70711L6.70711 11.7071C6.31658 12.0976 5.68342 12.0976 5.29289 11.7071L3.29289 9.70711C2.90237 9.31658 2.90237 8.68342 3.29289 8.29289C3.68342 7.90237 4.31658 7.90237 4.70711 8.29289L6 9.58579L11.2929 4.29289C11.6834 3.90237 12.3166 3.90237 12.7071 4.29289Z\"\n\t\t\tfill=\"currentColor\"\n\t\t/>\n\t</svg>\n);\n\nconst IndeterminateIcon = ({ className, style }: WithStyleProps) => (\n\t<svg className={className} style={style} viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t<path\n\t\t\td=\"M4 8C4 7.44772 4.44772 7 5 7H11C11.5523 7 12 7.44772 12 8C12 8.55228 11.5523 9 11 9H5C4.44772 9 4 8.55228 4 8Z\"\n\t\t\tfill=\"currentColor\"\n\t\t/>\n\t</svg>\n);\n"]}
|
package/dist/checkbox.d.cts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
-
|
|
4
|
-
declare const Checkbox: react.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
|
|
6
|
-
export { Checkbox };
|
package/dist/chunk-D3F6KERE.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _clsx = require('clsx');var _tailwindmerge = require('tailwind-merge');function t(...r){return _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, r))}exports.a = t;
|
|
2
|
-
//# sourceMappingURL=chunk-D3F6KERE.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/cx/src/cx.ts"],"names":["clsx","twMerge","cx","inputs"],"mappings":"AAAA,OAAS,QAAAA,MAA6B,OACtC,OAAS,WAAAC,MAAe,iBAOjB,SAASC,KAAMC,EAAsB,CAC3C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC5B","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Conditionally add Tailwind (and other) CSS classes.\n *\n * Allows for tailwind overrides in LTR-specificity-like order of applied classes.\n */\nexport function cx(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n"]}
|
package/dist/chunk-IN6SIXF2.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _react = require('react');function c(e){let r=_react.useCallback.call(void 0, t=>{let n=window.matchMedia(e);return n.addEventListener("change",t),()=>{n.removeEventListener("change",t)}},[e]);return _react.useSyncExternalStore.call(void 0, r,()=>window.matchMedia(e).matches,()=>!1)}exports.a = c;
|
|
2
|
-
//# sourceMappingURL=chunk-IN6SIXF2.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/hooks/src/use-matches-media-query.tsx"],"names":["useCallback","useSyncExternalStore","useMatchesMediaQuery","query","subscribe","callback","matchMedia"],"mappings":"AAAA,OAAS,eAAAA,EAAa,wBAAAC,MAA4B,QAE3C,SAASC,EAAqBC,EAAe,CACnD,IAAMC,EAAYJ,EAChBK,GAAyB,CACzB,IAAMC,EAAa,OAAO,WAAWH,CAAK,EAE1C,OAAAG,EAAW,iBAAiB,SAAUD,CAAQ,EACvC,IAAM,CACZC,EAAW,oBAAoB,SAAUD,CAAQ,CAClD,CACD,EACA,CAACF,CAAK,CACP,EAEA,OAAOF,EACNG,EACA,IACQ,OAAO,WAAWD,CAAK,EAAE,QAEjC,IAAM,EACP,CACD","sourcesContent":["import { useCallback, useSyncExternalStore } from \"react\";\n\nexport function useMatchesMediaQuery(query: string) {\n\tconst subscribe = useCallback(\n\t\t(callback: () => void) => {\n\t\t\tconst matchMedia = window.matchMedia(query);\n\n\t\t\tmatchMedia.addEventListener(\"change\", callback);\n\t\t\treturn () => {\n\t\t\t\tmatchMedia.removeEventListener(\"change\", callback);\n\t\t\t};\n\t\t},\n\t\t[query],\n\t);\n\n\treturn useSyncExternalStore(\n\t\tsubscribe,\n\t\t() => {\n\t\t\treturn window.matchMedia(query).matches;\n\t\t},\n\t\t() => false,\n\t);\n}\n"]}
|
package/dist/chunk-JGNAMNKZ.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _react = require('react');var _tinyinvariant = require('tiny-invariant'); var _tinyinvariant2 = _interopRequireDefault(_tinyinvariant);var _jsxruntime = require('react/jsx-runtime');var a=({className:o,style:s,svg:r})=>{let t=_react.Children.only(r);return _tinyinvariant2.default.call(void 0, _react.isValidElement.call(void 0, t),"Icon must be passed a single SVG icon as a JSX tag."),_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_react.cloneElement.call(void 0, t,{className:_chunkD3F6KEREcjs.a.call(void 0, "size-6 sm:size-5 shrink-0",t.props.className,o),style:{...t.props.style,...s}})})};exports.a = a;
|
|
2
|
-
//# sourceMappingURL=chunk-JGNAMNKZ.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/icon/src/icon.tsx"],"names":["Children","cloneElement","isValidElement","invariant","Fragment","jsx","Icon","className","style","svg","icon","cx"],"mappings":"yCAAA,OAAS,YAAAA,EAAU,gBAAAC,EAA8B,kBAAAC,MAA+C,QAChG,OAAOC,MAAe,iBA2BpB,mBAAAC,EAAA,OAAAC,MAAA,oBALF,IAAMC,EAAO,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAO,IAAAC,CAAI,IAAiB,CACtD,IAAMC,EAAOV,EAAS,KAAKS,CAAG,EAC9B,OAAAN,EAAUD,EAA8BQ,CAAI,EAAG,qDAAqD,EAGnGL,EAAAD,EAAA,CACE,SAAAH,EAAaS,EAAM,CACnB,UAAWC,EAAG,4BAA6BD,EAAK,MAAM,UAAWH,CAAS,EAC1E,MAAO,CAAE,GAAGG,EAAK,MAAM,MAAO,GAAGF,CAAM,CACxC,CAAC,EACF,CAEF","sourcesContent":["import { Children, cloneElement, HTMLAttributes, isValidElement, ReactElement, ReactNode } from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { cx } from \"../../cx\";\nimport { WithStyleProps } from \"../../types\";\n\ntype IconProps = WithStyleProps & {\n\t/**\n\t * A single SVG icon element.\n\t */\n\tsvg: ReactNode;\n};\n\ntype SvgAttributes = HTMLAttributes<SVGElement> & {\n\tfocusable?: \"true\" | \"false\";\n};\n\n/**\n * Decorates an svg icon with automatic sizing styles.\n * Merges `className` selectors with the following order of precedence (last one wins):\n * 1. Icon base classes\n * 2. svg className\n * 3. Icon className\n */\nconst Icon = ({ className, style, svg }: IconProps) => {\n\tconst icon = Children.only(svg) as ReactElement;\n\tinvariant(isValidElement<SvgAttributes>(icon), \"Icon must be passed a single SVG icon as a JSX tag.\");\n\n\treturn (\n\t\t<>\n\t\t\t{cloneElement(icon, {\n\t\t\t\tclassName: cx(\"size-6 sm:size-5 shrink-0\", icon.props.className, className),\n\t\t\t\tstyle: { ...icon.props.style, ...style },\n\t\t\t})}\n\t\t</>\n\t);\n};\n\nexport { Icon };\nexport type { IconProps, SvgAttributes };\n"]}
|
package/dist/chunk-K4UKFOMI.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJGNAMNKZcjs = require('./chunk-JGNAMNKZ.cjs');var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _CircleNotch = require('@phosphor-icons/react/CircleNotch');var _reactslot = require('@radix-ui/react-slot');var _classvarianceauthority = require('class-variance-authority');var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var _react = require('react');var _tinyinvariant = require('tiny-invariant'); var _tinyinvariant2 = _interopRequireDefault(_tinyinvariant);var _jsxruntime = require('react/jsx-runtime');var W=_classvarianceauthority.cva.call(void 0, "items-center justify-center gap-1.5 whitespace-nowrap rounded-md focus-within:outline-none focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50 aria-disabled:opacity-50 sm:text-sm [&>*]:focus-within:outline-none",{variants:{appearance:{filled:"inline-flex h-11 border border-transparent bg-filled-accent px-3 font-medium text-on-filled hover:bg-filled-accent-hover focus-visible:border-accent-600 focus-visible:ring-focus-accent active:bg-filled-accent-active sm:h-9",ghost:"inline-flex h-11 border border-transparent px-3 font-medium text-accent-600 hover:bg-accent-500/10 hover:text-accent-700 focus-visible:ring-focus-accent active:bg-accent-500/15 active:text-accent-700 sm:h-9",outlined:"inline-flex h-11 border border-accent-600 bg-form px-3 font-medium text-accent-600 hover:border-accent-700 hover:bg-accent-500/10 hover:text-accent-700 focus-visible:ring-focus-accent active:border-accent-700 active:bg-accent-500/15 active:text-accent-700 sm:h-9",link:"group inline cursor-pointer border-transparent text-accent-600 hover:underline focus-visible:ring-focus-accent"},iconPlacement:{end:"pe-2.5",start:"ps-2.5"},isLoading:{false:"",true:"opacity-50"},priority:{danger:"",default:"",neutral:""}},defaultVariants:{appearance:"outlined",isLoading:!1,priority:"default"},compoundVariants:[{appearance:"ghost",priority:"danger",class:"border-transparent text-danger-600 hover:bg-danger-500/10 hover:text-danger-700 focus-visible:ring-focus-danger active:bg-danger-500/15 active:text-danger-700"},{appearance:"outlined",priority:"danger",class:"border-danger-600 bg-form text-danger-600 hover:border-danger-700 hover:bg-danger-500/10 hover:text-danger-700 focus-visible:ring-focus-danger active:border-danger-700 active:bg-danger-500/15 active:text-danger-700"},{appearance:"filled",priority:"danger",class:"border-transparent bg-filled-danger hover:bg-filled-danger-hover focus-visible:border-danger-600 focus-visible:ring-focus-danger active:bg-filled-danger-active"},{appearance:"link",priority:"danger",class:"text-danger-600 focus-visible:ring-focus-danger"},{appearance:"ghost",priority:"neutral",class:"border-transparent text-strong hover:bg-neutral-500/10 hover:text-strong focus-visible:ring-focus-accent active:bg-neutral-500/15 active:text-strong"},{appearance:"outlined",priority:"neutral",class:"border-form bg-form text-strong hover:border-neutral-400 hover:bg-form-hover hover:text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent active:border-neutral-400 active:bg-neutral-500/10 active:text-strong focus-visible:active:border-accent-600"},{appearance:"filled",priority:"neutral",class:"border-transparent bg-filled-neutral hover:bg-filled-neutral-hover focus-visible:border-neutral-600 focus-visible:ring-focus-neutral active:bg-filled-neutral-active"},{appearance:"link",priority:"neutral",class:"text-strong focus-visible:ring-focus-accent"}]}),V= exports.a =_react.forwardRef.call(void 0, ({"aria-disabled":l,appearance:r="outlined",asChild:o=!1,children:a,className:b,icon:t,iconPlacement:i="start",isLoading:n=!1,onClickCapture:g,priority:m="default",...v},h)=>{let x=_nullishCoalesce(l, () => (n)),u=n?_jsxruntime.jsx.call(void 0, _CircleNotch.CircleNotch,{className:"animate-spin"}):t,d=e=>{n&&(e.preventDefault(),e.stopPropagation()),_optionalChain([g, 'optionalCall', _2 => _2(e)])},y={"aria-disabled":x,className:_chunkD3F6KEREcjs.a.call(void 0, W({appearance:r,priority:m,isLoading:n,iconPlacement:u?i:void 0}),b),"data-loading":n,onClickCapture:d,ref:h,...v};if(o){let e=_react.Children.only(a);_tinyinvariant2.default.call(void 0, _react.isValidElement.call(void 0, e),"When using `asChild`, Button must be passed a single child as a JSX tag.");let B=_optionalChain([e, 'access', _3 => _3.props, 'optionalAccess', _4 => _4.children]);return _jsxruntime.jsx.call(void 0, _reactslot.Slot,{...y,children:_react.cloneElement.call(void 0, e,{},_jsxruntime.jsx.call(void 0, P,{appearance:r,icon:u,iconPlacement:i,children:B}))})}return _jsxruntime.jsx.call(void 0, "button",{...y,children:_jsxruntime.jsx.call(void 0, P,{appearance:r,icon:u,iconPlacement:i,children:a})})});V.displayName="Button";var P=({appearance:l,children:r,icon:o,iconPlacement:a})=>_jsxruntime.jsxs.call(void 0, "span",{className:_clsx2.default.call(void 0, "inline-flex items-center gap-1.5 focus-within:outline-none focus-visible:outline-none",l==="link"&&"group-hover:underline"),children:[o&&_jsxruntime.jsx.call(void 0, _chunkJGNAMNKZcjs.a,{svg:o,className:_clsx2.default.call(void 0, a==="end"&&"order-last")}),r]});var j=_classvarianceauthority.cva.call(void 0, "inline-flex items-center justify-center rounded-md border focus-within:outline-none focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50 aria-disabled:opacity-50",{variants:{appearance:{ghost:"border-transparent text-strong hover:bg-neutral-500/10 hover:text-strong focus-visible:ring-focus-accent active:bg-neutral-500/15 active:text-strong",outlined:"border-form bg-form text-strong hover:border-neutral-400 hover:bg-form-hover hover:text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent active:border-neutral-400 active:bg-neutral-500/10 active:text-strong focus-visible:active:border-accent-600"},isLoading:{false:"",true:"opacity-50"},size:{xs:"size-7 sm:size-6",sm:"size-9 sm:size-7",md:"size-11 sm:size-9"}},defaultVariants:{appearance:"outlined",size:"md"}}),I= exports.b =_react.forwardRef.call(void 0, ({"aria-disabled":l,appearance:r,asChild:o=!1,children:a,className:b,isLoading:t=!1,icon:i,label:n,onClickCapture:g,size:m,...v},h)=>{let x=_nullishCoalesce(l, () => (t)),u=e=>{t&&(e.preventDefault(),e.stopPropagation()),_optionalChain([g, 'optionalCall', _5 => _5(e)])},d={"aria-disabled":x,className:_chunkD3F6KEREcjs.a.call(void 0, j({appearance:r,isLoading:t,size:m}),b),"data-loading":t,onClickCapture:u,ref:h,...v};if(o){let e=_react.Children.only(a),B=_react.isValidElement.call(void 0, e);return _jsxruntime.jsx.call(void 0, _reactslot.Slot,{...d,children:B&&_react.cloneElement.call(void 0, e,{},_jsxruntime.jsx.call(void 0, _chunkJGNAMNKZcjs.a,{svg:t?_jsxruntime.jsx.call(void 0, _CircleNotch.CircleNotch,{className:"animate-spin"}):i}))})}return _jsxruntime.jsxs.call(void 0, "button",{...d,children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:n}),_jsxruntime.jsx.call(void 0, _chunkJGNAMNKZcjs.a,{svg:t?_jsxruntime.jsx.call(void 0, _CircleNotch.CircleNotch,{className:"animate-spin"}):i})]})});I.displayName="IconButton";exports.a = V; exports.b = I;
|
|
2
|
-
//# sourceMappingURL=chunk-K4UKFOMI.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/button/src/button.tsx","../packages/button/src/icon-button.tsx"],"names":["CircleNotch","Slot","cva","clsx","Children","cloneElement","forwardRef","isValidElement","invariant","jsx","jsxs","buttonVariants","Button","_ariaDisabled","appearance","asChild","children","className","propIcon","iconPlacement","isLoading","onClickCapture","priority","props","ref","ariaDisabled","icon","_onClickCapture","event","buttonProps","cx","singleChild","grandchildren","InnerContent","Icon","iconButtonVariants","IconButton","label","size","isValidChild"],"mappings":"kFAAA,OAAS,eAAAA,MAAmB,oCAC5B,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAAW,2BACpB,OAAOC,MAAU,OACjB,OAAS,YAAAC,EAAU,gBAAAC,EAAc,cAAAC,EAAY,kBAAAC,MAAsB,QAEnE,OAAOC,MAAe,iBAkJK,cAAAC,EA4D1B,QAAAC,MA5D0B,oBA5I3B,IAAMC,EAAiBT,EACtB,uOACA,CACC,SAAU,CAIT,WAAY,CACX,OACC,iOACD,MACC,iNACD,SACC,yQACD,KAAM,gHACP,EAKA,cAAe,CACd,IAAK,SACL,MAAO,QACR,EAMA,UAAW,CACV,MAAO,GACP,KAAM,YACP,EAKA,SAAU,CACT,OAAQ,GACR,QAAS,GACT,QAAS,EACV,CACD,EACA,gBAAiB,CAChB,WAAY,WACZ,UAAW,GACX,SAAU,SACX,EACA,iBAAkB,CACjB,CACC,WAAY,QACZ,SAAU,SACV,MACC,gKACF,EACA,CACC,WAAY,WACZ,SAAU,SACV,MACC,wNACF,EACA,CACC,WAAY,SACZ,SAAU,SACV,MACC,iKACF,EACA,CACC,WAAY,OACZ,SAAU,SACV,MAAO,iDACR,EACA,CACC,WAAY,QACZ,SAAU,UACV,MACC,sJACF,EACA,CACC,WAAY,WACZ,SAAU,UACV,MACC,6QACF,EACA,CACC,WAAY,SACZ,SAAU,UACV,MACC,sKACF,EACA,CACC,WAAY,OACZ,SAAU,UACV,MAAO,6CACR,CACD,CACD,CACD,EAyBMU,EAASN,EACd,CACC,CACC,gBAAiBO,EACjB,WAAAC,EAAa,WACb,QAAAC,EAAU,GACV,SAAAC,EACA,UAAAC,EACA,KAAMC,EACN,cAAAC,EAAgB,QAChB,UAAAC,EAAY,GACZ,eAAAC,EACA,SAAAC,EAAW,UACX,GAAGC,CACJ,EACAC,IACI,CACJ,IAAMC,EAAeZ,GAAiBO,EAChCM,EAAON,EAAYX,EAACT,EAAA,CAAY,UAAU,eAAe,EAAKkB,EAE9DS,EAAmBC,GAAyC,CAC7DR,IACHQ,EAAM,eAAe,EACrBA,EAAM,gBAAgB,GAEvBP,IAAiBO,CAAK,CACvB,EAEMC,EAAc,CACnB,gBAAiBJ,EACjB,UAAWK,EACVnB,EAAe,CAAE,WAAAG,EAAY,SAAAQ,EAAU,UAAAF,EAAW,cAAeM,EAAOP,EAAgB,MAAU,CAAC,EACnGF,CACD,EACA,eAAgBG,EAChB,eAAgBO,EAChB,IAAAH,EACA,GAAGD,CACJ,EAEA,GAAIR,EAAS,CACZ,IAAMgB,EAAc3B,EAAS,KAAKY,CAAQ,EAC1CR,EACCD,EAA4BwB,CAAW,EACvC,0EACD,EACA,IAAMC,EAAgBD,EAAY,OAAO,SAEzC,OACCtB,EAACR,EAAA,CAAM,GAAG4B,EACR,SAAAxB,EACA0B,EACA,CAAC,EACDtB,EAACwB,EAAA,CAAa,WAAYnB,EAAY,KAAMY,EAAM,cAAeP,EAC/D,SAAAa,EACF,CACD,EACD,CAEF,CAEA,OACCvB,EAAC,UAAQ,GAAGoB,EACX,SAAApB,EAACwB,EAAA,CAAa,WAAYnB,EAAY,KAAMY,EAAM,cAAeP,EAC/D,SAAAH,EACF,EACD,CAEF,CACD,EACAJ,EAAO,YAAc,SAOrB,IAAMqB,EAAe,CAAC,CAAE,WAAAnB,EAAY,SAAAE,EAAU,KAAAU,EAAM,cAAAP,CAAc,IACjET,EAAC,QACA,UAAWP,EACV,wFACAW,IAAe,QAAU,uBAC1B,EAEC,UAAAY,GAAQjB,EAACyB,EAAA,CAAK,IAAKR,EAAM,UAAWvB,EAAKgB,IAAkB,OAAS,YAAY,EAAG,EACnFH,GACF,EC5ND,OAAS,eAAAhB,MAAmB,oCAC5B,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAAW,2BACpB,OAA+B,YAAAE,EAAU,gBAAAC,EAAc,cAAAC,EAAY,kBAAAC,MAA6C,QA8GpF,cAAAE,EAQzB,QAAAC,MARyB,oBAzG5B,IAAMyB,EAAqBjC,EAC1B,qLACA,CACC,SAAU,CAIT,WAAY,CACX,MACC,uJACD,SACC,6QACF,EAMA,UAAW,CACV,MAAO,GACP,KAAM,YACP,EAIA,KAAM,CACL,GAAI,mBACJ,GAAI,mBACJ,GAAI,mBACL,CACD,EACA,gBAAiB,CAChB,WAAY,WACZ,KAAM,IACP,CACD,CACD,EA8BMkC,EAAa9B,EAClB,CACC,CACC,gBAAiBO,EACjB,WAAAC,EACA,QAAAC,EAAU,GACV,SAAAC,EACA,UAAAC,EACA,UAAAG,EAAY,GACZ,KAAMF,EACN,MAAAmB,EACA,eAAAhB,EACA,KAAAiB,EACA,GAAGf,CACJ,EACAC,IACI,CACJ,IAAMC,EAAeZ,GAAiBO,EAEhCO,EAAmBC,GAAyC,CAC7DR,IACHQ,EAAM,eAAe,EACrBA,EAAM,gBAAgB,GAEvBP,IAAiBO,CAAK,CACvB,EAEMC,EAAc,CACnB,gBAAiBJ,EACjB,UAAWK,EAAGK,EAAmB,CAAE,WAAArB,EAAY,UAAAM,EAAW,KAAAkB,CAAK,CAAC,EAAGrB,CAAS,EAC5E,eAAgBG,EAChB,eAAgBO,EAChB,IAAAH,EACA,GAAGD,CACJ,EAEA,GAAIR,EAAS,CACZ,IAAMgB,EAAc3B,EAAS,KAAKY,CAAQ,EACpCuB,EAAehC,EAAewB,CAAW,EAG/C,OAAOtB,EAACR,EAAA,CAAM,GAAG4B,EAAc,SAAAU,GAAgBlC,EAAa0B,EAAa,CAAC,EAAGtB,EAACyB,EAAA,CAAK,IAFtEd,EAAYX,EAACT,EAAA,CAAY,UAAU,eAAe,EAAKkB,EAE0B,CAAE,EAAE,CACnG,CAIA,OACCR,EAAC,UAAQ,GAAGmB,EACX,UAAApB,EAAC,QAAK,UAAU,UAAW,SAAA4B,EAAM,EACjC5B,EAACyB,EAAA,CAAK,IALKd,EAAYX,EAACT,EAAA,CAAY,UAAU,eAAe,EAAKkB,EAKjD,GAClB,CAEF,CACD,EACAkB,EAAW,YAAc","sourcesContent":["import { CircleNotch } from \"@phosphor-icons/react/CircleNotch\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva } from \"class-variance-authority\";\nimport clsx from \"clsx\";\nimport { Children, cloneElement, forwardRef, isValidElement } from \"react\";\nimport type { ButtonHTMLAttributes, MouseEvent, PropsWithChildren, ReactNode } from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { cx } from \"../../cx\";\nimport { Icon } from \"../../icon\";\nimport type { WithAsChild } from \"../../types/src/as-child\";\nimport type { VariantProps } from \"../../types/src/variant-props\";\n\nconst buttonVariants = cva(\n\t\"items-center justify-center gap-1.5 whitespace-nowrap rounded-md focus-within:outline-none focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50 aria-disabled:opacity-50 sm:text-sm [&>*]:focus-within:outline-none\",\n\t{\n\t\tvariants: {\n\t\t\t/**\n\t\t\t * Defines the visual style of the Button.\n\t\t\t */\n\t\t\tappearance: {\n\t\t\t\tfilled:\n\t\t\t\t\t\"inline-flex h-11 border border-transparent bg-filled-accent px-3 font-medium text-on-filled hover:bg-filled-accent-hover focus-visible:border-accent-600 focus-visible:ring-focus-accent active:bg-filled-accent-active sm:h-9\",\n\t\t\t\tghost:\n\t\t\t\t\t\"inline-flex h-11 border border-transparent px-3 font-medium text-accent-600 hover:bg-accent-500/10 hover:text-accent-700 focus-visible:ring-focus-accent active:bg-accent-500/15 active:text-accent-700 sm:h-9\",\n\t\t\t\toutlined:\n\t\t\t\t\t\"inline-flex h-11 border border-accent-600 bg-form px-3 font-medium text-accent-600 hover:border-accent-700 hover:bg-accent-500/10 hover:text-accent-700 focus-visible:ring-focus-accent active:border-accent-700 active:bg-accent-500/15 active:text-accent-700 sm:h-9\",\n\t\t\t\tlink: \"group inline cursor-pointer border-transparent text-accent-600 hover:underline focus-visible:ring-focus-accent\",\n\t\t\t},\n\t\t\t/**\n\t\t\t * The side that the icon will render on, if one is present. If `state=\"pending\"`,\n\t\t\t * then the loading icon will also render on this side.\n\t\t\t */\n\t\t\ticonPlacement: {\n\t\t\t\tend: \"pe-2.5\",\n\t\t\t\tstart: \"ps-2.5\",\n\t\t\t},\n\t\t\t/**\n\t\t\t * Whether or not the button is in a loading state, default `false`. Setting `isLoading` will\n\t\t\t * replace any `icon` with a spinner, or add one if an icon wasn't given.\n\t\t\t * It will also disable user interaction with the button and set `aria-disabled`.\n\t\t\t */\n\t\t\tisLoading: {\n\t\t\t\tfalse: \"\",\n\t\t\t\ttrue: \"opacity-50\",\n\t\t\t},\n\t\t\t/**\n\t\t\t * Indicates the importance or impact level of the button, affecting its\n\t\t\t * color and styling to communicate its purpose to the user\n\t\t\t */\n\t\t\tpriority: {\n\t\t\t\tdanger: \"\",\n\t\t\t\tdefault: \"\",\n\t\t\t\tneutral: \"\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tappearance: \"outlined\",\n\t\t\tisLoading: false,\n\t\t\tpriority: \"default\",\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tappearance: \"ghost\",\n\t\t\t\tpriority: \"danger\",\n\t\t\t\tclass:\n\t\t\t\t\t\"border-transparent text-danger-600 hover:bg-danger-500/10 hover:text-danger-700 focus-visible:ring-focus-danger active:bg-danger-500/15 active:text-danger-700\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"outlined\",\n\t\t\t\tpriority: \"danger\",\n\t\t\t\tclass:\n\t\t\t\t\t\"border-danger-600 bg-form text-danger-600 hover:border-danger-700 hover:bg-danger-500/10 hover:text-danger-700 focus-visible:ring-focus-danger active:border-danger-700 active:bg-danger-500/15 active:text-danger-700\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"filled\",\n\t\t\t\tpriority: \"danger\",\n\t\t\t\tclass:\n\t\t\t\t\t\"border-transparent bg-filled-danger hover:bg-filled-danger-hover focus-visible:border-danger-600 focus-visible:ring-focus-danger active:bg-filled-danger-active\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"link\",\n\t\t\t\tpriority: \"danger\",\n\t\t\t\tclass: \"text-danger-600 focus-visible:ring-focus-danger\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"ghost\",\n\t\t\t\tpriority: \"neutral\",\n\t\t\t\tclass:\n\t\t\t\t\t\"border-transparent text-strong hover:bg-neutral-500/10 hover:text-strong focus-visible:ring-focus-accent active:bg-neutral-500/15 active:text-strong\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"outlined\",\n\t\t\t\tpriority: \"neutral\",\n\t\t\t\tclass:\n\t\t\t\t\t\"border-form bg-form text-strong hover:border-neutral-400 hover:bg-form-hover hover:text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent active:border-neutral-400 active:bg-neutral-500/10 active:text-strong focus-visible:active:border-accent-600\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"filled\",\n\t\t\t\tpriority: \"neutral\",\n\t\t\t\tclass:\n\t\t\t\t\t\"border-transparent bg-filled-neutral hover:bg-filled-neutral-hover focus-visible:border-neutral-600 focus-visible:ring-focus-neutral active:bg-filled-neutral-active\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"link\",\n\t\t\t\tpriority: \"neutral\",\n\t\t\t\tclass: \"text-strong focus-visible:ring-focus-accent\",\n\t\t\t},\n\t\t],\n\t},\n);\n\ntype ButtonVariants = VariantProps<typeof buttonVariants>;\n\n/**\n * The props for the `Button` component.\n */\ntype ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n\tWithAsChild &\n\tButtonVariants & {\n\t\t/**\n\t\t * An icon to render inside the button. If the `state` is `\"pending\"`, then\n\t\t * the icon will automatically be replaced with a spinner.\n\t\t */\n\t\ticon?: ReactNode;\n\t};\n\n/**\n * Renders a button or a component that looks like a button, an interactive\n * element activated by a user with a mouse, keyboard, finger, voice command, or\n * other assistive technology. Once activated, it then performs an action, such\n * as submitting a form or opening a dialog.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n\t(\n\t\t{\n\t\t\t\"aria-disabled\": _ariaDisabled,\n\t\t\tappearance = \"outlined\",\n\t\t\tasChild = false,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\ticon: propIcon,\n\t\t\ticonPlacement = \"start\",\n\t\t\tisLoading = false,\n\t\t\tonClickCapture,\n\t\t\tpriority = \"default\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ariaDisabled = _ariaDisabled ?? isLoading;\n\t\tconst icon = isLoading ? <CircleNotch className=\"animate-spin\" /> : propIcon;\n\n\t\tconst _onClickCapture = (event: MouseEvent<HTMLButtonElement>) => {\n\t\t\tif (isLoading) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t\tonClickCapture?.(event);\n\t\t};\n\n\t\tconst buttonProps = {\n\t\t\t\"aria-disabled\": ariaDisabled,\n\t\t\tclassName: cx(\n\t\t\t\tbuttonVariants({ appearance, priority, isLoading, iconPlacement: icon ? iconPlacement : undefined }),\n\t\t\t\tclassName,\n\t\t\t),\n\t\t\t\"data-loading\": isLoading,\n\t\t\tonClickCapture: _onClickCapture,\n\t\t\tref,\n\t\t\t...props,\n\t\t};\n\n\t\tif (asChild) {\n\t\t\tconst singleChild = Children.only(children);\n\t\t\tinvariant(\n\t\t\t\tisValidElement<ButtonProps>(singleChild),\n\t\t\t\t\"When using `asChild`, Button must be passed a single child as a JSX tag.\",\n\t\t\t);\n\t\t\tconst grandchildren = singleChild.props?.children;\n\n\t\t\treturn (\n\t\t\t\t<Slot {...buttonProps}>\n\t\t\t\t\t{cloneElement(\n\t\t\t\t\t\tsingleChild,\n\t\t\t\t\t\t{},\n\t\t\t\t\t\t<InnerContent appearance={appearance} icon={icon} iconPlacement={iconPlacement}>\n\t\t\t\t\t\t\t{grandchildren}\n\t\t\t\t\t\t</InnerContent>,\n\t\t\t\t\t)}\n\t\t\t\t</Slot>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<button {...buttonProps}>\n\t\t\t\t<InnerContent appearance={appearance} icon={icon} iconPlacement={iconPlacement}>\n\t\t\t\t\t{children}\n\t\t\t\t</InnerContent>\n\t\t\t</button>\n\t\t);\n\t},\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\nexport type { ButtonProps };\n\ntype InnerContentProps = PropsWithChildren & Pick<ButtonProps, \"appearance\" | \"icon\" | \"iconPlacement\">;\n\nconst InnerContent = ({ appearance, children, icon, iconPlacement }: InnerContentProps) => (\n\t<span\n\t\tclassName={clsx(\n\t\t\t\"inline-flex items-center gap-1.5 focus-within:outline-none focus-visible:outline-none\",\n\t\t\tappearance === \"link\" && \"group-hover:underline\",\n\t\t)}\n\t>\n\t\t{icon && <Icon svg={icon} className={clsx(iconPlacement === \"end\" && \"order-last\")} />}\n\t\t{children}\n\t</span>\n);\n","import { CircleNotch } from \"@phosphor-icons/react/CircleNotch\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva } from \"class-variance-authority\";\nimport { ButtonHTMLAttributes, Children, cloneElement, forwardRef, isValidElement, MouseEvent, ReactNode } from \"react\";\nimport { cx } from \"../../cx\";\nimport { Icon } from \"../../icon\";\nimport type { VariantProps, WithAsChild } from \"../../types\";\n\nconst iconButtonVariants = cva(\n\t\"inline-flex items-center justify-center rounded-md border focus-within:outline-none focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50 aria-disabled:opacity-50\",\n\t{\n\t\tvariants: {\n\t\t\t/**\n\t\t\t * Defines the visual style of the Button.\n\t\t\t */\n\t\t\tappearance: {\n\t\t\t\tghost:\n\t\t\t\t\t\"border-transparent text-strong hover:bg-neutral-500/10 hover:text-strong focus-visible:ring-focus-accent active:bg-neutral-500/15 active:text-strong\",\n\t\t\t\toutlined:\n\t\t\t\t\t\"border-form bg-form text-strong hover:border-neutral-400 hover:bg-form-hover hover:text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent active:border-neutral-400 active:bg-neutral-500/10 active:text-strong focus-visible:active:border-accent-600\",\n\t\t\t},\n\t\t\t/**\n\t\t\t * Whether or not the button is in a loading state, default `false`. Setting `isLoading` will\n\t\t\t * replace the `icon` with a spinner.\n\t\t\t * It will also disable user interaction with the button and set `aria-disabled`.\n\t\t\t */\n\t\t\tisLoading: {\n\t\t\t\tfalse: \"\",\n\t\t\t\ttrue: \"opacity-50\",\n\t\t\t},\n\t\t\t/**\n\t\t\t * The size of the IconButton.\n\t\t\t */\n\t\t\tsize: {\n\t\t\t\txs: \"size-7 sm:size-6\",\n\t\t\t\tsm: \"size-9 sm:size-7\",\n\t\t\t\tmd: \"size-11 sm:size-9\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tappearance: \"outlined\",\n\t\t\tsize: \"md\",\n\t\t},\n\t},\n);\n\ntype IconButtonVariants = VariantProps<typeof iconButtonVariants>;\n\n/**\n * The props for the `Button` component.\n */\ntype IconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n\tWithAsChild &\n\tIconButtonVariants & {\n\t\t/**\n\t\t * The accessible label for the icon. This label will be visually hidden but announced to screen reader users, similar to alt text for img tags.\n\t\t */\n\t\tlabel: string;\n\t\t/**\n\t\t * An icon to render inside the button. If the `state` is `\"pending\"`, then\n\t\t * the icon will automatically be replaced with a spinner.\n\t\t */\n\t\ticon: ReactNode;\n\t};\n\n/**\n * Renders a button or a component that looks like a button, an interactive\n * element activated by a user with a mouse, keyboard, finger, voice command, or\n * other assistive technology. Once activated, it then performs an action, such\n * as submitting a form or opening a dialog.\n * Renders only a single icon as children with an accessible, screen-reader-only label.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button\n */\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n\t(\n\t\t{\n\t\t\t\"aria-disabled\": _ariaDisabled,\n\t\t\tappearance,\n\t\t\tasChild = false,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tisLoading = false,\n\t\t\ticon: propIcon,\n\t\t\tlabel,\n\t\t\tonClickCapture,\n\t\t\tsize,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ariaDisabled = _ariaDisabled ?? isLoading;\n\n\t\tconst _onClickCapture = (event: MouseEvent<HTMLButtonElement>) => {\n\t\t\tif (isLoading) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t\tonClickCapture?.(event);\n\t\t};\n\n\t\tconst buttonProps = {\n\t\t\t\"aria-disabled\": ariaDisabled,\n\t\t\tclassName: cx(iconButtonVariants({ appearance, isLoading, size }), className),\n\t\t\t\"data-loading\": isLoading,\n\t\t\tonClickCapture: _onClickCapture,\n\t\t\tref,\n\t\t\t...props,\n\t\t};\n\n\t\tif (asChild) {\n\t\t\tconst singleChild = Children.only(children);\n\t\t\tconst isValidChild = isValidElement(singleChild);\n\t\t\tconst icon = isLoading ? <CircleNotch className=\"animate-spin\" /> : propIcon;\n\n\t\t\treturn <Slot {...buttonProps}>{isValidChild && cloneElement(singleChild, {}, <Icon svg={icon} />)}</Slot>;\n\t\t}\n\n\t\tconst icon = isLoading ? <CircleNotch className=\"animate-spin\" /> : propIcon;\n\n\t\treturn (\n\t\t\t<button {...buttonProps}>\n\t\t\t\t<span className=\"sr-only\">{label}</span>\n\t\t\t\t<Icon svg={icon} />\n\t\t\t</button>\n\t\t);\n\t},\n);\nIconButton.displayName = \"IconButton\";\n\nexport { IconButton };\nexport type { IconButtonProps };\n"]}
|
package/dist/chunk-ROHPZJ5N.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _reactseparator = require('@radix-ui/react-separator'); var a = _interopRequireWildcard(_reactseparator);var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var e=_react.forwardRef.call(void 0, ({className:i,orientation:r="horizontal",decorative:o=!0,...p},m)=>_jsxruntime.jsx.call(void 0, a.Root,{ref:m,"aria-orientation":o?void 0:r,decorative:o,orientation:r,className:_chunkD3F6KEREcjs.a.call(void 0, "shrink-0 bg-gray-500/20 dark-high-contrast:bg-black high-contrast:bg-black dark:bg-gray-600/20",r==="horizontal"?"h-px w-full":"h-full w-px",i),...p}));e.displayName="Separator";exports.a = e;
|
|
2
|
-
//# sourceMappingURL=chunk-ROHPZJ5N.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/separator/src/separator.tsx"],"names":["SeparatorPrimitive","forwardRef","jsx","Separator","className","orientation","decorative","props","ref","cx"],"mappings":"yCAAA,UAAYA,MAAwB,4BACpC,OAAS,cAAAC,MAAkB,QAW1B,cAAAC,MAAA,oBAJD,IAAMC,EAAYF,EAGhB,CAAC,CAAE,UAAAG,EAAW,YAAAC,EAAc,aAAc,WAAAC,EAAa,GAAM,GAAGC,CAAM,EAAGC,IAC1EN,EAAoB,OAAnB,CACA,IAAKM,EACL,mBAAkBF,EAAa,OAAYD,EAC3C,WAAYC,EACZ,YAAaD,EACb,UAAWI,EACV,iGACAJ,IAAgB,aAAe,cAAgB,cAC/CD,CACD,EACC,GAAGG,EACL,CACA,EACDJ,EAAU,YAAc","sourcesContent":["import * as SeparatorPrimitive from \"@radix-ui/react-separator\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\";\nimport { cx } from \"../../cx\";\n\n/**\n * Visually or semantically separates content.\n */\nconst Separator = forwardRef<\n\tElementRef<typeof SeparatorPrimitive.Root>,\n\tComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n\t<SeparatorPrimitive.Root\n\t\tref={ref}\n\t\taria-orientation={decorative ? undefined : orientation}\n\t\tdecorative={decorative}\n\t\torientation={orientation}\n\t\tclassName={cx(\n\t\t\t\"shrink-0 bg-gray-500/20 dark-high-contrast:bg-black high-contrast:bg-black dark:bg-gray-600/20\",\n\t\t\torientation === \"horizontal\" ? \"h-px w-full\" : \"h-full w-px\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nSeparator.displayName = \"Separator\";\n\nexport { Separator };\n"]}
|
package/dist/code-block.cjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _reactslot = require('@radix-ui/react-slot');var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);var _react = require('react');require('prismjs/components/prism-bash.js');require('prismjs/components/prism-csharp.js');require('prismjs/components/prism-css.js');require('prismjs/components/prism-go.js');require('prismjs/components/prism-java.js');require('prismjs/components/prism-javascript.js');require('prismjs/components/prism-json.js');require('prismjs/components/prism-jsx.js');require('prismjs/components/prism-markup.js');require('prismjs/components/prism-python.js');require('prismjs/components/prism-ruby.js');require('prismjs/components/prism-rust.js');require('prismjs/components/prism-tsx.js');require('prismjs/components/prism-typescript.js');require('prismjs/components/prism-yaml.js');var _CaretDown = require('@phosphor-icons/react/CaretDown');var _Check = require('@phosphor-icons/react/Check');var _Copy = require('@phosphor-icons/react/Copy');var _usehooks = require('@uidotdev/usehooks');var _tinyinvariant = require('tiny-invariant'); var _tinyinvariant2 = _interopRequireDefault(_tinyinvariant);var b=["bash","cs","csharp","css","dotnet","go","html","java","javascript","js","json","jsx","markup","plain","plaintext","py","python","rb","ruby","rust","sh","shell","text","ts","tsx","txt","typescript","xml","yaml","yml"];function $(e){if(!e)return"sh";let o=e.trim().slice(e.indexOf("-")+1);return S(o)?o:"sh"}var S=e=>typeof e=="string"&&b.includes(e);function L(e="sh"){return`language-${_nullishCoalesce(e, () => ("sh"))}`}var _jsxruntime = require('react/jsx-runtime');var B=_react.createContext.call(void 0, {codeId:void 0,copyText:"",hasCodeExpander:!1,isCodeExpanded:!1,registerCodeId:()=>{},setCopyText:()=>{},setHasCodeExpander:()=>{},setIsCodeExpanded:()=>{},unregisterCodeId:()=>{}}),H= exports.CodeBlock =_react.forwardRef.call(void 0, ({className:e,...o},r)=>{let[t,a]=_react.useState.call(void 0, ""),[n,i]=_react.useState.call(void 0, !1),[s,c]=_react.useState.call(void 0, !1),[d,f]=_react.useState.call(void 0, void 0),h=_react.useMemo.call(void 0, ()=>({codeId:d,copyText:t,hasCodeExpander:n,isCodeExpanded:s,registerCodeId:p=>{f(C=>(_tinyinvariant2.default.call(void 0, C==null,"You can only render a single CodeBlockCode within a CodeBlock."),p))},setCopyText:a,setHasCodeExpander:i,setIsCodeExpanded:c,unregisterCodeId:p=>{f(C=>{_tinyinvariant2.default.call(void 0, C===p,"You can only render a single CodeBlockCode within a CodeBlock.")})}}),[d,t,n,s]);return _jsxruntime.jsx.call(void 0, B.Provider,{value:h,children:_jsxruntime.jsx.call(void 0, "div",{className:_chunkD3F6KEREcjs.a.call(void 0, "overflow-hidden rounded-md border border-gray-300 bg-gray-50 font-mono text-[0.8125rem]",e),ref:r,...o})})});H.displayName="CodeBlock";var I=_react.forwardRef.call(void 0, ({className:e,...o},r)=>_jsxruntime.jsx.call(void 0, "div",{className:_chunkD3F6KEREcjs.a.call(void 0, "relative",e),ref:r,...o}));I.displayName="CodeBlockBody";var N=_react.forwardRef.call(void 0, (e,o)=>{let{className:r,language:t="text",style:a,value:n}=e,i=_react.useId.call(void 0, ),{hasCodeExpander:s,isCodeExpanded:c,registerCodeId:d,setCopyText:f,unregisterCodeId:h}=_react.useContext.call(void 0, B),p=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _2 => _2.trim, 'call', _3 => _3()]), () => ("")),[C,j]=_react.useState.call(void 0, p);return _react.useEffect.call(void 0, ()=>{let E=_prismjs2.default.languages[t];_tinyinvariant2.default.call(void 0, E,`CodeBlock does not support the language "${t}". The syntax highlighter does not have a grammar for this language. The supported languages are: ${b.join(", ")}.`);let z=_prismjs2.default.highlight(p,E,t);j(z)},[p,t]),_react.useEffect.call(void 0, ()=>{f(p)},[p,f]),_react.useEffect.call(void 0, ()=>(d(i),()=>{h(i)}),[i,d,h]),_jsxruntime.jsx.call(void 0, "pre",{"aria-expanded":s?c:void 0,className:_chunkD3F6KEREcjs.a.call(void 0, L(t),"scrollbar overflow-x-auto overflow-y-hidden p-4 pr-[3.375rem] firefox:after:mr-[3.375rem] firefox:after:inline-block firefox:after:content-['']","aria-collapsed:max-h-[13.6rem]",r),"data-lang":t,id:i,ref:o,style:{...a,tabSize:2,MozTabSize:2},children:_jsxruntime.jsx.call(void 0, "code",{dangerouslySetInnerHTML:{__html:C}})})});N.displayName="CodeBlockCode";var A=_react.forwardRef.call(void 0, ({className:e,...o},r)=>_jsxruntime.jsx.call(void 0, "div",{className:_chunkD3F6KEREcjs.a.call(void 0, "flex items-center gap-1 border-b border-gray-300 bg-gray-100 px-4 py-2 text-gray-700",e),ref:r,...o}));A.displayName="CodeBlockHeader";var P=_react.forwardRef.call(void 0, ({asChild:e=!1,className:o,...r},t)=>_jsxruntime.jsx.call(void 0, e?_reactslot.Slot:"h3",{ref:t,className:_chunkD3F6KEREcjs.a.call(void 0, "font-mono text-[0.8125rem] font-normal",o),...r}));P.displayName="CodeBlockTitle";var D=_react.forwardRef.call(void 0, ({className:e,onCopy:o,onCopyError:r,style:t},a)=>{let{copyText:n}=_react.useContext.call(void 0, B),[,i]=_usehooks.useCopyToClipboard.call(void 0, ),[s,c]=_react.useState.call(void 0, !1);return _react.useEffect.call(void 0, ()=>{if(s){let d=window.setTimeout(()=>{c(!1)},2e3);return()=>{clearTimeout(d)}}},[s]),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:_chunkD3F6KEREcjs.a.call(void 0, "absolute right-3 top-3 z-10 flex h-7 w-7 items-center justify-center rounded border border-gray-300 bg-gray-50 shadow-[-1rem_0_0.75rem_-0.375rem_hsl(var(--gray-50)),1rem_0_0_-0.25rem_hsl(var(--gray-50))] hover:border-gray-400 hover:bg-gray-200 focus-visible:border-accent-600 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-focus-accent",s&&"w-auto gap-1 border-transparent bg-filled-success pl-2 pr-1.5 text-on-filled hover:border-transparent hover:bg-filled-success focus:bg-filled-success focus-visible:border-success-600 focus-visible:ring-focus-success",e),ref:a,style:t,onClick:async()=>{try{await i(n),_optionalChain([o, 'optionalCall', _4 => _4(n)]),c(!0)}catch(d){_optionalChain([r, 'optionalCall', _5 => _5(d)])}},children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Copy code"}),s?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:["Copied",_jsxruntime.jsx.call(void 0, _Check.Check,{className:"h-4 w-4",weight:"bold"})]}):_jsxruntime.jsx.call(void 0, _Copy.Copy,{className:"-ml-px h-5 w-5"})]})});D.displayName="CodeBlockCopyButton";var _=_react.forwardRef.call(void 0, ({className:e,onClick:o,...r},t)=>{let{codeId:a,isCodeExpanded:n,setIsCodeExpanded:i,setHasCodeExpander:s}=_react.useContext.call(void 0, B);return _react.useEffect.call(void 0, ()=>(s(!0),()=>{s(!1)}),[s]),_jsxruntime.jsxs.call(void 0, "button",{...r,"aria-controls":a,"aria-expanded":n,className:_chunkD3F6KEREcjs.a.call(void 0, "flex w-full items-center justify-center gap-0.5 border-t border-gray-300 bg-gray-50 px-4 py-2 font-sans text-gray-700 hover:bg-gray-100",e),ref:t,type:"button",onClick:c=>{i(d=>!d),_optionalChain([o, 'optionalCall', _6 => _6(c)])},children:[n?"Show less":"Show more"," ",_jsxruntime.jsx.call(void 0, _CaretDown.CaretDown,{className:_chunkD3F6KEREcjs.a.call(void 0, "h-4 w-4",n&&"rotate-180","transition-all duration-150"),weight:"bold"})]})});_.displayName="CodeBlockExpanderButton";function G(e,...o){if(!U(e)||!Array.isArray(o))throw new Error("It looks like you tried to call `fmtCode` as a function. Make sure to use it as a tagged template.\n Example: fmtCode`SELECT * FROM users`, not fmtCode('SELECT * FROM users')");let r=String.raw({raw:e},...o),t=K(r);return r.trim().split(`
|
|
2
|
-
`).map(n=>/^\S+/.test(n)?n:n.slice(t)).join(`
|
|
3
|
-
`)}function K(e){let o=e.match(/^[ \t]*(?=\S)/gm);return o?o.reduce((r,t)=>Math.min(r,t.length),1/0):0}function U(e){return Array.isArray(e)&&"raw"in e&&Array.isArray(e.raw)}var _zod = require('zod');var X=["file","cli"],Z=_zod.z.object({collapsible:_zod.z.boolean().default(!1),disableCopy:_zod.z.boolean().default(!1),mode:_zod.z.enum(X).optional(),title:_zod.z.string().trim().optional()}),k= exports.defaultMeta ={collapsible:!1,disableCopy:!1,mode:void 0,title:void 0};function ee(e){let o=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]), () => (""));if(!o)return k;let r=oe(o).reduce((t,a)=>{let[n,i]=a.split("=");if(!n)return t;let s=te(i);return t[n]=_nullishCoalesce(s, () => (!0)),t},{});try{let t=Z.parse(r);return{...k,...t}}catch (e2){return k}}function te(e){return _optionalChain([e, 'optionalAccess', _9 => _9.trim, 'call', _10 => _10(), 'access', _11 => _11.replace, 'call', _12 => _12(/^"(.*)"$/,"$1")])}function oe(e){let o=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _13 => _13.trim, 'call', _14 => _14()]), () => ("")),r=[],t="",a=!1;for(let n of o)n===" "&&!a?t&&(r.push(t),t=""):(n==='"'&&(a=!a),t+=n);return t&&r.push(t),r}exports.CodeBlock = H; exports.CodeBlockBody = I; exports.CodeBlockCode = N; exports.CodeBlockCopyButton = D; exports.CodeBlockExpanderButton = _; exports.CodeBlockHeader = A; exports.CodeBlockTitle = P; exports.defaultMeta = k; exports.fmtCode = G; exports.formatLanguageClassName = L; exports.isSupportedLanguage = S; exports.parseLanguage = $; exports.parseMetastring = ee; exports.supportedLanguages = b;
|
|
4
|
-
//# sourceMappingURL=code-block.cjs.map
|