@bergetai/ui 0.16.2 → 0.18.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.
- package/dist/components/alert/Alert.d.cts +1 -1
- package/dist/components/alert/Alert.d.mts +1 -1
- package/dist/components/badge/Badge.d.cts +1 -1
- package/dist/components/badge/Badge.d.mts +1 -1
- package/dist/components/box/Box.d.cts +2 -2
- package/dist/components/box/Box.d.mts +2 -2
- package/dist/components/button/Button.cjs +21 -4
- package/dist/components/button/Button.cjs.map +1 -1
- package/dist/components/button/Button.d.cts +2 -1
- package/dist/components/button/Button.d.cts.map +1 -1
- package/dist/components/button/Button.d.mts +2 -1
- package/dist/components/button/Button.d.mts.map +1 -1
- package/dist/components/button/Button.mjs +19 -5
- package/dist/components/button/Button.mjs.map +1 -1
- package/dist/components/button/anchorVariants.cjs +56 -0
- package/dist/components/button/anchorVariants.cjs.map +1 -0
- package/dist/components/button/anchorVariants.d.cts +45 -0
- package/dist/components/button/anchorVariants.d.cts.map +1 -0
- package/dist/components/button/anchorVariants.d.mts +45 -0
- package/dist/components/button/anchorVariants.d.mts.map +1 -0
- package/dist/components/button/anchorVariants.mjs +55 -0
- package/dist/components/button/anchorVariants.mjs.map +1 -0
- package/dist/components/button/index.d.cts +2 -1
- package/dist/components/button/index.d.mts +2 -1
- package/dist/components/code-block/CodeBlock.cjs +50 -48
- package/dist/components/code-block/CodeBlock.cjs.map +1 -1
- package/dist/components/code-block/CodeBlock.d.cts +27 -7
- package/dist/components/code-block/CodeBlock.d.cts.map +1 -1
- package/dist/components/code-block/CodeBlock.d.mts +27 -7
- package/dist/components/code-block/CodeBlock.d.mts.map +1 -1
- package/dist/components/code-block/CodeBlock.mjs +45 -50
- package/dist/components/code-block/CodeBlock.mjs.map +1 -1
- package/dist/components/code-block/index.d.cts +3 -0
- package/dist/components/code-block/index.d.mts +3 -0
- package/dist/components/combobox/index.d.cts +2 -0
- package/dist/components/combobox/index.d.mts +2 -0
- package/dist/components/country-select/CountrySelect.cjs +1 -1
- package/dist/components/country-select/CountrySelect.mjs +1 -1
- package/dist/components/grid/Grid.d.cts +2 -2
- package/dist/components/grid/Grid.d.mts +2 -2
- package/dist/components/popover/index.d.cts +2 -0
- package/dist/components/popover/index.d.mts +2 -0
- package/dist/components/radio-group/index.d.cts +2 -0
- package/dist/components/radio-group/index.d.mts +2 -0
- package/dist/components/tabs/Tabs.cjs +109 -0
- package/dist/components/tabs/Tabs.cjs.map +1 -0
- package/dist/components/tabs/Tabs.d.cts +29 -0
- package/dist/components/tabs/Tabs.d.cts.map +1 -0
- package/dist/components/tabs/Tabs.d.mts +29 -0
- package/dist/components/tabs/Tabs.d.mts.map +1 -0
- package/dist/components/tabs/Tabs.mjs +103 -0
- package/dist/components/tabs/Tabs.mjs.map +1 -0
- package/dist/components/tabs/index.d.cts +2 -0
- package/dist/components/tabs/index.d.mts +2 -0
- package/dist/hooks/use-highlighted-code.cjs +58 -0
- package/dist/hooks/use-highlighted-code.cjs.map +1 -0
- package/dist/hooks/use-highlighted-code.d.cts +5 -0
- package/dist/hooks/use-highlighted-code.d.cts.map +1 -0
- package/dist/hooks/use-highlighted-code.d.mts +5 -0
- package/dist/hooks/use-highlighted-code.d.mts.map +1 -0
- package/dist/hooks/use-highlighted-code.mjs +56 -0
- package/dist/hooks/use-highlighted-code.mjs.map +1 -0
- package/dist/index.cjs +44 -0
- package/dist/index.d.cts +14 -2
- package/dist/index.d.mts +14 -2
- package/dist/index.mjs +9 -2
- package/dist/lib/highlighter.cjs +81 -0
- package/dist/lib/highlighter.cjs.map +1 -0
- package/dist/lib/highlighter.mjs +79 -0
- package/dist/lib/highlighter.mjs.map +1 -0
- package/dist/primitives/button.d.cts +1 -1
- package/dist/primitives/button.d.mts +1 -1
- package/dist/primitives/code-block.cjs +133 -0
- package/dist/primitives/code-block.cjs.map +1 -0
- package/dist/primitives/code-block.d.cts +29 -0
- package/dist/primitives/code-block.d.cts.map +1 -0
- package/dist/primitives/code-block.d.mts +29 -0
- package/dist/primitives/code-block.d.mts.map +1 -0
- package/dist/primitives/code-block.mjs +124 -0
- package/dist/primitives/code-block.mjs.map +1 -0
- package/dist/primitives/combobox.cjs +123 -0
- package/dist/primitives/combobox.cjs.map +1 -0
- package/dist/primitives/combobox.d.cts +25 -0
- package/dist/primitives/combobox.d.cts.map +1 -0
- package/dist/primitives/combobox.d.mts +25 -0
- package/dist/primitives/combobox.d.mts.map +1 -0
- package/dist/primitives/combobox.mjs +111 -0
- package/dist/primitives/combobox.mjs.map +1 -0
- package/dist/primitives/message-scroller.cjs +1 -1
- package/dist/primitives/message-scroller.mjs +1 -1
- package/dist/primitives/popover.cjs +24 -0
- package/dist/primitives/popover.cjs.map +1 -1
- package/dist/primitives/popover.d.cts +12 -0
- package/dist/primitives/popover.d.cts.map +1 -0
- package/dist/primitives/popover.d.mts +12 -0
- package/dist/primitives/popover.d.mts.map +1 -0
- package/dist/primitives/popover.mjs +22 -1
- package/dist/primitives/popover.mjs.map +1 -1
- package/dist/primitives/radio-group.cjs +23 -0
- package/dist/primitives/radio-group.cjs.map +1 -0
- package/dist/primitives/radio-group.d.cts +8 -0
- package/dist/primitives/radio-group.d.cts.map +1 -0
- package/dist/primitives/radio-group.d.mts +8 -0
- package/dist/primitives/radio-group.d.mts.map +1 -0
- package/dist/primitives/radio-group.mjs +22 -0
- package/dist/primitives/radio-group.mjs.map +1 -0
- package/dist/primitives/sidebar.cjs +1 -1
- package/dist/primitives/sidebar.mjs +1 -1
- package/dist/primitives/tabs.cjs +51 -0
- package/dist/primitives/tabs.cjs.map +1 -0
- package/dist/primitives/tabs.d.cts +11 -0
- package/dist/primitives/tabs.d.cts.map +1 -0
- package/dist/primitives/tabs.d.mts +11 -0
- package/dist/primitives/tabs.d.mts.map +1 -0
- package/dist/primitives/tabs.mjs +47 -0
- package/dist/primitives/tabs.mjs.map +1 -0
- package/dist/styles/index.css +61 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchorVariants.mjs","names":[],"sources":["../../../src/components/button/anchorVariants.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { cn } from '../../lib/utils';\nimport { buttonVariants } from '../../primitives/button';\nimport type { VariantProps } from 'class-variance-authority';\nimport {\n brandVariantClasses,\n interactionClasses,\n primitiveVariant,\n type CustomVariant,\n} from './Button';\n\n/** Props for {@link anchorVariants}. Consumes like `buttonVariants` with the\n * same variant union as the `Button` wrapper. */\nexport interface AnchorVariantsProps {\n /** Visual style variant — same union as `Button`'s `variant` prop. */\n variant?: CustomVariant;\n /** Full width or auto width. */\n width?: 'default' | 'full';\n /** Button size ladder — maps to the same text scale as `Button`. */\n size?: VariantProps<typeof buttonVariants>['size'];\n /** Extra classes, merged last (same override position as `Button`). */\n className?: string;\n}\n\n/**\n * Class variants for real `<a>` elements styled like `Button` chrome.\n *\n * Base UI's Button enforces button semantics and its docs forbid rendering\n * links through the `render` prop, and the package's `asChild` leaves\n * `nativeButton={true}` — anchors through it keep `role=\"button\"` and log a\n * dev-console error. This helper bakes in exactly the wrapper chrome the\n * `Button` component applies, so consumers can style a plain anchor instead\n * of replicating package internals:\n *\n * ```tsx\n * <a className={anchorVariants({ variant: 'primary', width: 'full' })} href=\"…\">\n * Open dashboard\n * </a>\n * ```\n *\n * Class output is equivalent to `Button variant=… width=…` (ignoring\n * `disabled:*`, which does not apply to anchors), with anchor-safe focus\n * treatment: `:focus-visible` works natively on `<a>` elements, and the\n * shared outline-based focus ring lands the same way.\n */\nexport function anchorVariants({\n variant = 'default',\n width = 'default',\n size,\n className,\n}: AnchorVariantsProps = {}): string {\n const isIcon = typeof size === 'string' && size.startsWith('icon');\n\n return cn(\n buttonVariants({ variant: primitiveVariant(variant), size }),\n // Full-width anchors use the square radius; otherwise pill (same rule\n // as the Button wrapper).\n width === 'full' ? 'rounded-berget-xs' : 'rounded-full',\n // Em-based padding, inline = 2× block, matching the Button wrapper.\n !isIcon && 'h-auto px-[0.8em] py-[0.4em]',\n // Text ladder: default renders at text-base like the wrapper Button.\n !isIcon &&\n (size === 'lg' ? 'text-lg' : size === 'sm' ? 'text-sm' : size === 'xs' ? '' : `text-base`),\n !isIcon && 'font-normal',\n brandVariantClasses(variant),\n interactionClasses,\n width === 'full' && 'w-full',\n className,\n );\n}\n\nexport type AnchorProps = React.ComponentProps<'a'> & AnchorVariantsProps;\n\n/** Ready-to-use anchor styled through {@link anchorVariants}. For cases\n * where a component (rather than a class string) is easier to consume. */\nexport function Anchor({ variant, width, size, className, children, ...props }: AnchorProps) {\n return (\n <a className={anchorVariants({ variant, width, size, className })} {...props}>\n <span className=\"inline-flex items-center gap-2\">{children}</span>\n </a>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAgB,eAAe,EAC7B,UAAU,WACV,QAAQ,WACR,MACA,cACuB,CAAC,GAAW;CACnC,MAAM,SAAS,OAAO,SAAS,YAAY,KAAK,WAAW,MAAM;CAEjE,OAAO,GACL,eAAe;EAAE,SAAS,iBAAiB,OAAO;EAAG;CAAK,CAAC,GAG3D,UAAU,SAAS,sBAAsB,gBAEzC,CAAC,UAAU,gCAEX,CAAC,WACE,SAAS,OAAO,YAAY,SAAS,OAAO,YAAY,SAAS,OAAO,KAAK,cAChF,CAAC,UAAU,eACX,oBAAoB,OAAO,GAC3B,oBACA,UAAU,UAAU,UACpB,SACF;AACF;;;AAMA,SAAgB,OAAO,EAAE,SAAS,OAAO,MAAM,WAAW,UAAU,GAAG,SAAsB;CAC3F,OACE,oBAAC,KAAD;EAAG,WAAW,eAAe;GAAE;GAAS;GAAO;GAAM;EAAU,CAAC;EAAG,GAAI;EACrE,UAAA,oBAAC,QAAD;GAAM,WAAU;GAAkC;EAAe,CAAA;CAChE,CAAA;AAEP"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { buttonVariants } from "../../primitives/button.cjs";
|
|
2
2
|
import { Button, ButtonProps } from "./Button.cjs";
|
|
3
|
-
|
|
3
|
+
import { Anchor, AnchorProps, AnchorVariantsProps, anchorVariants } from "./anchorVariants.cjs";
|
|
4
|
+
export { Anchor, type AnchorProps, type AnchorVariantsProps, Button, type ButtonProps, anchorVariants, buttonVariants };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { buttonVariants } from "../../primitives/button.mjs";
|
|
2
2
|
import { Button, ButtonProps } from "./Button.mjs";
|
|
3
|
-
|
|
3
|
+
import { Anchor, AnchorProps, AnchorVariantsProps, anchorVariants } from "./anchorVariants.mjs";
|
|
4
|
+
export { Anchor, type AnchorProps, type AnchorVariantsProps, Button, type ButtonProps, anchorVariants, buttonVariants };
|
|
@@ -1,61 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_utils = require("../../lib/utils.cjs");
|
|
3
|
-
const
|
|
4
|
-
let react = require("react");
|
|
3
|
+
const require_code_block = require("../../primitives/code-block.cjs");
|
|
5
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
let lucide_react = require("lucide-react");
|
|
7
5
|
//#region src/components/code-block/CodeBlock.tsx
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Compound code block built on the shadcn base `code-block` primitive. The
|
|
8
|
+
* parts add Berget styling and nothing else — compose them the way shadcn
|
|
9
|
+
* documents (ui.shadcn.com/docs/components/base/code-block):
|
|
10
|
+
*
|
|
11
|
+
* <CodeBlock>
|
|
12
|
+
* <CodeBlockHeader>
|
|
13
|
+
* <CodeBlockTitle>file.ts</CodeBlockTitle>
|
|
14
|
+
* <CodeBlockActions>
|
|
15
|
+
* <CodeBlockCopyButton value={code} />
|
|
16
|
+
* </CodeBlockActions>
|
|
17
|
+
* </CodeBlockHeader>
|
|
18
|
+
* <CodeBlockContent wrap lineNumbers>
|
|
19
|
+
* {code}
|
|
20
|
+
* </CodeBlockContent>
|
|
21
|
+
* </CodeBlock>
|
|
22
|
+
*
|
|
23
|
+
* For syntax highlighting, pass `useHighlightedCode(code, language)` output
|
|
24
|
+
* through `CodeBlockLine` elements. Highlighting is optional; a string child
|
|
25
|
+
* renders as plain text.
|
|
26
|
+
*/
|
|
27
|
+
function CodeBlock({ className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_code_block.CodeBlock, {
|
|
29
|
+
className: require_utils.cn(`
|
|
30
|
+
rounded-berget-xs border-berget-border bg-berget-codeblock-bg
|
|
31
|
+
backdrop-blur-md
|
|
32
|
+
dark:bg-berget-codeblock-bg
|
|
33
|
+
`, className),
|
|
34
|
+
...props
|
|
30
35
|
});
|
|
31
|
-
|
|
36
|
+
}
|
|
37
|
+
function CodeBlockHeader({ className, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_code_block.CodeBlockHeader, {
|
|
32
39
|
className: require_utils.cn(`
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
h-10 shrink-0 gap-2 border-b border-berget-border
|
|
41
|
+
bg-berget-codeblock-header-bg px-4 pt-0
|
|
42
|
+
dark:bg-berget-codeblock-header-bg
|
|
35
43
|
`, className),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}),
|
|
44
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
45
|
-
className: "absolute top-2 right-2 z-10",
|
|
46
|
-
children: copyButton
|
|
47
|
-
}),
|
|
48
|
-
html ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49
|
-
className: "\n [&_.shiki]:m-0! [&_.shiki]:overflow-x-auto [&_.shiki]:bg-transparent\n [&_.shiki]:p-4! [&_.shiki]:text-caption/relaxed!\n ",
|
|
50
|
-
dangerouslySetInnerHTML: { __html: html }
|
|
51
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
52
|
-
className: "\n m-0! overflow-x-auto p-4! text-caption/relaxed!\n text-berget-muted-foreground\n ",
|
|
53
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { children: code })
|
|
54
|
-
})
|
|
55
|
-
]
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function CodeBlockTitle({ className, ...props }) {
|
|
48
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_code_block.CodeBlockTitle, {
|
|
49
|
+
className: require_utils.cn("text-berget-muted-foreground", className),
|
|
50
|
+
...props
|
|
56
51
|
});
|
|
57
52
|
}
|
|
58
53
|
//#endregion
|
|
59
54
|
exports.CodeBlock = CodeBlock;
|
|
55
|
+
exports.CodeBlockActions = require_code_block.CodeBlockActions;
|
|
56
|
+
exports.CodeBlockContent = require_code_block.CodeBlockContent;
|
|
57
|
+
exports.CodeBlockCopyButton = require_code_block.CodeBlockCopyButton;
|
|
58
|
+
exports.CodeBlockFooter = require_code_block.CodeBlockFooter;
|
|
59
|
+
exports.CodeBlockHeader = CodeBlockHeader;
|
|
60
|
+
exports.CodeBlockLine = require_code_block.CodeBlockLine;
|
|
61
|
+
exports.CodeBlockTitle = CodeBlockTitle;
|
|
60
62
|
|
|
61
63
|
//# sourceMappingURL=CodeBlock.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.cjs","names":["
|
|
1
|
+
{"version":3,"file":"CodeBlock.cjs","names":["CodeBlockPrimitive","cn","CodeBlockHeaderPrimitive","CodeBlockTitlePrimitive"],"sources":["../../../src/components/code-block/CodeBlock.tsx"],"sourcesContent":["'use client';\n\nimport type { ComponentProps } from 'react';\nimport {\n CodeBlock as CodeBlockPrimitive,\n CodeBlockHeader as CodeBlockHeaderPrimitive,\n CodeBlockTitle as CodeBlockTitlePrimitive,\n} from '../../primitives/code-block';\nimport { cn } from '../../lib/utils';\n\n/**\n * Compound code block built on the shadcn base `code-block` primitive. The\n * parts add Berget styling and nothing else — compose them the way shadcn\n * documents (ui.shadcn.com/docs/components/base/code-block):\n *\n * <CodeBlock>\n * <CodeBlockHeader>\n * <CodeBlockTitle>file.ts</CodeBlockTitle>\n * <CodeBlockActions>\n * <CodeBlockCopyButton value={code} />\n * </CodeBlockActions>\n * </CodeBlockHeader>\n * <CodeBlockContent wrap lineNumbers>\n * {code}\n * </CodeBlockContent>\n * </CodeBlock>\n *\n * For syntax highlighting, pass `useHighlightedCode(code, language)` output\n * through `CodeBlockLine` elements. Highlighting is optional; a string child\n * renders as plain text.\n */\n\nexport function CodeBlock({ className, ...props }: ComponentProps<typeof CodeBlockPrimitive>) {\n return (\n <CodeBlockPrimitive\n className={cn(\n `\n rounded-berget-xs border-berget-border bg-berget-codeblock-bg\n backdrop-blur-md\n dark:bg-berget-codeblock-bg\n `,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function CodeBlockHeader({\n className,\n ...props\n}: ComponentProps<typeof CodeBlockHeaderPrimitive>) {\n return (\n <CodeBlockHeaderPrimitive\n className={cn(\n `\n h-10 shrink-0 gap-2 border-b border-berget-border\n bg-berget-codeblock-header-bg px-4 pt-0\n dark:bg-berget-codeblock-header-bg\n `,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function CodeBlockTitle({\n className,\n ...props\n}: ComponentProps<typeof CodeBlockTitlePrimitive>) {\n return (\n <CodeBlockTitlePrimitive className={cn('text-berget-muted-foreground', className)} {...props} />\n );\n}\n\nexport {\n CodeBlockActions,\n CodeBlockContent,\n CodeBlockCopyButton,\n CodeBlockFooter,\n CodeBlockLine,\n} from '../../primitives/code-block';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAgB,UAAU,EAAE,WAAW,GAAG,SAAoD;CAC5F,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,mBAAAA,WAAD;EACE,WAAWC,cAAAA,GACT;;;;WAKA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAgB,gBAAgB,EAC9B,WACA,GAAG,SAC+C;CAClD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,iBAAD;EACE,WAAWD,cAAAA,GACT;;;;WAKA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAgB,eAAe,EAC7B,WACA,GAAG,SAC8C;CACjD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACE,mBAAAA,gBAAD;EAAyB,WAAWF,cAAAA,GAAG,gCAAgC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAEnG"}
|
|
@@ -1,10 +1,30 @@
|
|
|
1
|
+
import { CodeBlock as CodeBlock$1, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader as CodeBlockHeader$1, CodeBlockLine, CodeBlockTitle as CodeBlockTitle$1 } from "../../primitives/code-block.cjs";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
1
3
|
//#region src/components/code-block/CodeBlock.d.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Compound code block built on the shadcn base `code-block` primitive. The
|
|
6
|
+
* parts add Berget styling and nothing else — compose them the way shadcn
|
|
7
|
+
* documents (ui.shadcn.com/docs/components/base/code-block):
|
|
8
|
+
*
|
|
9
|
+
* <CodeBlock>
|
|
10
|
+
* <CodeBlockHeader>
|
|
11
|
+
* <CodeBlockTitle>file.ts</CodeBlockTitle>
|
|
12
|
+
* <CodeBlockActions>
|
|
13
|
+
* <CodeBlockCopyButton value={code} />
|
|
14
|
+
* </CodeBlockActions>
|
|
15
|
+
* </CodeBlockHeader>
|
|
16
|
+
* <CodeBlockContent wrap lineNumbers>
|
|
17
|
+
* {code}
|
|
18
|
+
* </CodeBlockContent>
|
|
19
|
+
* </CodeBlock>
|
|
20
|
+
*
|
|
21
|
+
* For syntax highlighting, pass `useHighlightedCode(code, language)` output
|
|
22
|
+
* through `CodeBlockLine` elements. Highlighting is optional; a string child
|
|
23
|
+
* renders as plain text.
|
|
24
|
+
*/
|
|
25
|
+
export declare function CodeBlock({ className, ...props }: ComponentProps<typeof CodeBlock$1>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function CodeBlockHeader({ className, ...props }: ComponentProps<typeof CodeBlockHeader$1>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function CodeBlockTitle({ className, ...props }: ComponentProps<typeof CodeBlockTitle$1>): import("react/jsx-runtime").JSX.Element;
|
|
9
28
|
//#endregion
|
|
29
|
+
export { CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockLine };
|
|
10
30
|
//# sourceMappingURL=CodeBlock.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.d.cts","names":[],"sources":["../../../src/components/code-block/CodeBlock.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.cts","names":["CodeBlockPrimitive","CodeBlockHeaderPrimitive","CodeBlockTitlePrimitive"],"sources":["../../../src/components/code-block/CodeBlock.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;wBAgCgB,YAAY,cAAc,SAAS,sBAAsBA,2CAAmB,IAAA;wBAgB5E,kBACd,cACG,SACF,sBAAsBC,iDAAyB,IAAA;wBAgBlC,iBACd,cACG,SACF,sBAAsBC,gDAAwB,IAAA"}
|
|
@@ -1,10 +1,30 @@
|
|
|
1
|
+
import { CodeBlock as CodeBlock$1, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader as CodeBlockHeader$1, CodeBlockLine, CodeBlockTitle as CodeBlockTitle$1 } from "../../primitives/code-block.mjs";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
1
3
|
//#region src/components/code-block/CodeBlock.d.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Compound code block built on the shadcn base `code-block` primitive. The
|
|
6
|
+
* parts add Berget styling and nothing else — compose them the way shadcn
|
|
7
|
+
* documents (ui.shadcn.com/docs/components/base/code-block):
|
|
8
|
+
*
|
|
9
|
+
* <CodeBlock>
|
|
10
|
+
* <CodeBlockHeader>
|
|
11
|
+
* <CodeBlockTitle>file.ts</CodeBlockTitle>
|
|
12
|
+
* <CodeBlockActions>
|
|
13
|
+
* <CodeBlockCopyButton value={code} />
|
|
14
|
+
* </CodeBlockActions>
|
|
15
|
+
* </CodeBlockHeader>
|
|
16
|
+
* <CodeBlockContent wrap lineNumbers>
|
|
17
|
+
* {code}
|
|
18
|
+
* </CodeBlockContent>
|
|
19
|
+
* </CodeBlock>
|
|
20
|
+
*
|
|
21
|
+
* For syntax highlighting, pass `useHighlightedCode(code, language)` output
|
|
22
|
+
* through `CodeBlockLine` elements. Highlighting is optional; a string child
|
|
23
|
+
* renders as plain text.
|
|
24
|
+
*/
|
|
25
|
+
export declare function CodeBlock({ className, ...props }: ComponentProps<typeof CodeBlock$1>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function CodeBlockHeader({ className, ...props }: ComponentProps<typeof CodeBlockHeader$1>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function CodeBlockTitle({ className, ...props }: ComponentProps<typeof CodeBlockTitle$1>): import("react/jsx-runtime").JSX.Element;
|
|
9
28
|
//#endregion
|
|
29
|
+
export { CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockLine };
|
|
10
30
|
//# sourceMappingURL=CodeBlock.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.d.mts","names":[],"sources":["../../../src/components/code-block/CodeBlock.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.mts","names":["CodeBlockPrimitive","CodeBlockHeaderPrimitive","CodeBlockTitlePrimitive"],"sources":["../../../src/components/code-block/CodeBlock.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;wBAgCgB,YAAY,cAAc,SAAS,sBAAsBA,2CAAmB,IAAA;wBAgB5E,kBACd,cACG,SACF,sBAAsBC,iDAAyB,IAAA;wBAgBlC,iBACd,cACG,SACF,sBAAsBC,gDAAwB,IAAA"}
|
|
@@ -1,61 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../lib/utils.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { Check, Copy } from "lucide-react";
|
|
3
|
+
import { CodeBlock as CodeBlock$1, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader as CodeBlockHeader$1, CodeBlockLine, CodeBlockTitle as CodeBlockTitle$1 } from "../../primitives/code-block.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
5
|
//#region src/components/code-block/CodeBlock.tsx
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Compound code block built on the shadcn base `code-block` primitive. The
|
|
8
|
+
* parts add Berget styling and nothing else — compose them the way shadcn
|
|
9
|
+
* documents (ui.shadcn.com/docs/components/base/code-block):
|
|
10
|
+
*
|
|
11
|
+
* <CodeBlock>
|
|
12
|
+
* <CodeBlockHeader>
|
|
13
|
+
* <CodeBlockTitle>file.ts</CodeBlockTitle>
|
|
14
|
+
* <CodeBlockActions>
|
|
15
|
+
* <CodeBlockCopyButton value={code} />
|
|
16
|
+
* </CodeBlockActions>
|
|
17
|
+
* </CodeBlockHeader>
|
|
18
|
+
* <CodeBlockContent wrap lineNumbers>
|
|
19
|
+
* {code}
|
|
20
|
+
* </CodeBlockContent>
|
|
21
|
+
* </CodeBlock>
|
|
22
|
+
*
|
|
23
|
+
* For syntax highlighting, pass `useHighlightedCode(code, language)` output
|
|
24
|
+
* through `CodeBlockLine` elements. Highlighting is optional; a string child
|
|
25
|
+
* renders as plain text.
|
|
26
|
+
*/
|
|
27
|
+
function CodeBlock({ className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx(CodeBlock$1, {
|
|
29
|
+
className: cn(`
|
|
30
|
+
rounded-berget-xs border-berget-border bg-berget-codeblock-bg
|
|
31
|
+
backdrop-blur-md
|
|
32
|
+
dark:bg-berget-codeblock-bg
|
|
33
|
+
`, className),
|
|
34
|
+
...props
|
|
30
35
|
});
|
|
31
|
-
|
|
36
|
+
}
|
|
37
|
+
function CodeBlockHeader({ className, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx(CodeBlockHeader$1, {
|
|
32
39
|
className: cn(`
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
h-10 shrink-0 gap-2 border-b border-berget-border
|
|
41
|
+
bg-berget-codeblock-header-bg px-4 pt-0
|
|
42
|
+
dark:bg-berget-codeblock-header-bg
|
|
35
43
|
`, className),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}),
|
|
44
|
-
/* @__PURE__ */ jsx("div", {
|
|
45
|
-
className: "absolute top-2 right-2 z-10",
|
|
46
|
-
children: copyButton
|
|
47
|
-
}),
|
|
48
|
-
html ? /* @__PURE__ */ jsx("div", {
|
|
49
|
-
className: "\n [&_.shiki]:m-0! [&_.shiki]:overflow-x-auto [&_.shiki]:bg-transparent\n [&_.shiki]:p-4! [&_.shiki]:text-caption/relaxed!\n ",
|
|
50
|
-
dangerouslySetInnerHTML: { __html: html }
|
|
51
|
-
}) : /* @__PURE__ */ jsx("pre", {
|
|
52
|
-
className: "\n m-0! overflow-x-auto p-4! text-caption/relaxed!\n text-berget-muted-foreground\n ",
|
|
53
|
-
children: /* @__PURE__ */ jsx("code", { children: code })
|
|
54
|
-
})
|
|
55
|
-
]
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function CodeBlockTitle({ className, ...props }) {
|
|
48
|
+
return /* @__PURE__ */ jsx(CodeBlockTitle$1, {
|
|
49
|
+
className: cn("text-berget-muted-foreground", className),
|
|
50
|
+
...props
|
|
56
51
|
});
|
|
57
52
|
}
|
|
58
53
|
//#endregion
|
|
59
|
-
export { CodeBlock };
|
|
54
|
+
export { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle };
|
|
60
55
|
|
|
61
56
|
//# sourceMappingURL=CodeBlock.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.mjs","names":[],"sources":["../../../src/components/code-block/CodeBlock.tsx"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"CodeBlock.mjs","names":["CodeBlockPrimitive","CodeBlockHeaderPrimitive","CodeBlockTitlePrimitive"],"sources":["../../../src/components/code-block/CodeBlock.tsx"],"sourcesContent":["'use client';\n\nimport type { ComponentProps } from 'react';\nimport {\n CodeBlock as CodeBlockPrimitive,\n CodeBlockHeader as CodeBlockHeaderPrimitive,\n CodeBlockTitle as CodeBlockTitlePrimitive,\n} from '../../primitives/code-block';\nimport { cn } from '../../lib/utils';\n\n/**\n * Compound code block built on the shadcn base `code-block` primitive. The\n * parts add Berget styling and nothing else — compose them the way shadcn\n * documents (ui.shadcn.com/docs/components/base/code-block):\n *\n * <CodeBlock>\n * <CodeBlockHeader>\n * <CodeBlockTitle>file.ts</CodeBlockTitle>\n * <CodeBlockActions>\n * <CodeBlockCopyButton value={code} />\n * </CodeBlockActions>\n * </CodeBlockHeader>\n * <CodeBlockContent wrap lineNumbers>\n * {code}\n * </CodeBlockContent>\n * </CodeBlock>\n *\n * For syntax highlighting, pass `useHighlightedCode(code, language)` output\n * through `CodeBlockLine` elements. Highlighting is optional; a string child\n * renders as plain text.\n */\n\nexport function CodeBlock({ className, ...props }: ComponentProps<typeof CodeBlockPrimitive>) {\n return (\n <CodeBlockPrimitive\n className={cn(\n `\n rounded-berget-xs border-berget-border bg-berget-codeblock-bg\n backdrop-blur-md\n dark:bg-berget-codeblock-bg\n `,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function CodeBlockHeader({\n className,\n ...props\n}: ComponentProps<typeof CodeBlockHeaderPrimitive>) {\n return (\n <CodeBlockHeaderPrimitive\n className={cn(\n `\n h-10 shrink-0 gap-2 border-b border-berget-border\n bg-berget-codeblock-header-bg px-4 pt-0\n dark:bg-berget-codeblock-header-bg\n `,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function CodeBlockTitle({\n className,\n ...props\n}: ComponentProps<typeof CodeBlockTitlePrimitive>) {\n return (\n <CodeBlockTitlePrimitive className={cn('text-berget-muted-foreground', className)} {...props} />\n );\n}\n\nexport {\n CodeBlockActions,\n CodeBlockContent,\n CodeBlockCopyButton,\n CodeBlockFooter,\n CodeBlockLine,\n} from '../../primitives/code-block';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAgB,UAAU,EAAE,WAAW,GAAG,SAAoD;CAC5F,OACE,oBAACA,aAAD;EACE,WAAW,GACT;;;;WAKA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAgB,gBAAgB,EAC9B,WACA,GAAG,SAC+C;CAClD,OACE,oBAACC,mBAAD;EACE,WAAW,GACT;;;;WAKA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAgB,eAAe,EAC7B,WACA,GAAG,SAC8C;CACjD,OACE,oBAACC,kBAAD;EAAyB,WAAW,GAAG,gCAAgC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAEnG"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockLine } from "../../primitives/code-block.cjs";
|
|
2
|
+
import { CodeBlock, CodeBlockHeader, CodeBlockTitle } from "./CodeBlock.cjs";
|
|
3
|
+
export { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockLine } from "../../primitives/code-block.mjs";
|
|
2
|
+
import { CodeBlock, CodeBlockHeader, CodeBlockTitle } from "./CodeBlock.mjs";
|
|
3
|
+
export { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Combobox, ComboboxClear, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue } from "../../primitives/combobox.cjs";
|
|
2
|
+
export { Combobox, ComboboxClear, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Combobox, ComboboxClear, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue } from "../../primitives/combobox.mjs";
|
|
2
|
+
export { Combobox, ComboboxClear, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
3
3
|
const require_utils = require("../../lib/utils.cjs");
|
|
4
|
-
const require_Icon = require("../icon/Icon.cjs");
|
|
5
4
|
const require_popover = require("../../primitives/popover.cjs");
|
|
5
|
+
const require_Icon = require("../icon/Icon.cjs");
|
|
6
6
|
const require_command = require("../../primitives/command.cjs");
|
|
7
7
|
const require_countries = require("./countries.cjs");
|
|
8
8
|
let react = require("react");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../lib/utils.mjs";
|
|
3
|
-
import { Icon } from "../icon/Icon.mjs";
|
|
4
3
|
import { Popover, PopoverContent, PopoverTrigger } from "../../primitives/popover.mjs";
|
|
4
|
+
import { Icon } from "../icon/Icon.mjs";
|
|
5
5
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "../../primitives/command.mjs";
|
|
6
6
|
import { COUNTRIES } from "./countries.mjs";
|
|
7
7
|
import * as React from "react";
|
|
@@ -3,8 +3,8 @@ import { VariantProps } from "class-variance-authority";
|
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
4
|
//#region src/components/grid/Grid.d.ts
|
|
5
5
|
declare const gridVariants: (props?: ({
|
|
6
|
-
align?: "center" | "
|
|
7
|
-
justify?: "center" | "
|
|
6
|
+
align?: "center" | "end" | "start" | "stretch" | null | undefined;
|
|
7
|
+
justify?: "center" | "end" | "start" | "between" | "around" | "evenly" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
export type SpacingScale = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64 | 72 | 80 | 96;
|
|
10
10
|
export type GridColsScale = 1 | 2 | 3 | 4 | 6 | 12;
|
|
@@ -3,8 +3,8 @@ import { VariantProps } from "class-variance-authority";
|
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
4
|
//#region src/components/grid/Grid.d.ts
|
|
5
5
|
declare const gridVariants: (props?: ({
|
|
6
|
-
align?: "center" | "
|
|
7
|
-
justify?: "center" | "
|
|
6
|
+
align?: "center" | "end" | "start" | "stretch" | null | undefined;
|
|
7
|
+
justify?: "center" | "end" | "start" | "between" | "around" | "evenly" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
export type SpacingScale = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64 | 72 | 80 | 96;
|
|
10
10
|
export type GridColsScale = 1 | 2 | 3 | 4 | 6 | 12;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_utils = require("../../lib/utils.cjs");
|
|
4
|
+
const require_tabs = require("../../primitives/tabs.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
react = require_runtime.__toESM(react, 1);
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let class_variance_authority = require("class-variance-authority");
|
|
9
|
+
//#region src/components/tabs/Tabs.tsx
|
|
10
|
+
const TabsIndicatorPrimitive = require("@base-ui/react/tabs").Tabs.Indicator;
|
|
11
|
+
const Tabs = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tabs.Tabs, {
|
|
12
|
+
ref,
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}));
|
|
16
|
+
Tabs.displayName = "Tabs";
|
|
17
|
+
const tabsListVariants = (0, class_variance_authority.cva)(require_utils.cn(`
|
|
18
|
+
group/tabs-list inline-flex w-fit items-center justify-center
|
|
19
|
+
rounded-berget-xs p-[3px] text-berget-muted-foreground
|
|
20
|
+
`, `
|
|
21
|
+
group-data-[orientation=horizontal]/tabs:h-9
|
|
22
|
+
group-data-[orientation=vertical]/tabs:h-fit
|
|
23
|
+
group-data-[orientation=vertical]/tabs:flex-col
|
|
24
|
+
`), {
|
|
25
|
+
variants: { variant: {
|
|
26
|
+
default: "bg-berget-tabs-list-bg",
|
|
27
|
+
line: "relative gap-2 rounded-berget-none bg-transparent"
|
|
28
|
+
} },
|
|
29
|
+
defaultVariants: { variant: "default" }
|
|
30
|
+
});
|
|
31
|
+
const TabsList = react.forwardRef(({ className, variant = "default", children, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_tabs.TabsList, {
|
|
32
|
+
ref,
|
|
33
|
+
"data-variant": variant,
|
|
34
|
+
className: require_utils.cn(tabsListVariants({ variant }), className),
|
|
35
|
+
...props,
|
|
36
|
+
children: [children, variant === "line" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabsIndicatorPrimitive, { className: require_utils.cn(`
|
|
37
|
+
pointer-events-none absolute z-10 block rounded-berget-full
|
|
38
|
+
bg-berget-tabs-line-indicator transition-[left,top,width,height]
|
|
39
|
+
duration-200 ease-out
|
|
40
|
+
`, `
|
|
41
|
+
group-data-[orientation=horizontal]/tabs:bottom-0
|
|
42
|
+
group-data-[orientation=horizontal]/tabs:left-(--active-tab-left)
|
|
43
|
+
group-data-[orientation=horizontal]/tabs:h-0.5
|
|
44
|
+
group-data-[orientation=horizontal]/tabs:w-(--active-tab-width)
|
|
45
|
+
`, `
|
|
46
|
+
group-data-[orientation=vertical]/tabs:top-(--active-tab-top)
|
|
47
|
+
group-data-[orientation=vertical]/tabs:left-0
|
|
48
|
+
group-data-[orientation=vertical]/tabs:h-(--active-tab-height)
|
|
49
|
+
group-data-[orientation=vertical]/tabs:w-0.5
|
|
50
|
+
`) })]
|
|
51
|
+
}));
|
|
52
|
+
TabsList.displayName = "TabsList";
|
|
53
|
+
const tabsTriggerVariants = (0, class_variance_authority.cva)(require_utils.cn(`
|
|
54
|
+
relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center
|
|
55
|
+
gap-1.5 rounded-berget-xs border border-transparent px-3 py-1.5 text-sm
|
|
56
|
+
font-medium whitespace-nowrap transition-all
|
|
57
|
+
`, `
|
|
58
|
+
group-data-[orientation=vertical]/tabs:w-full
|
|
59
|
+
group-data-[orientation=vertical]/tabs:justify-start
|
|
60
|
+
`, `
|
|
61
|
+
text-berget-foreground-alt
|
|
62
|
+
hover:text-berget-foreground
|
|
63
|
+
`, `
|
|
64
|
+
focus-visible:ring-berget-focus-ring focus-visible:ring-2
|
|
65
|
+
focus-visible:ring-offset-2 focus-visible:ring-offset-berget-tabs-list-bg
|
|
66
|
+
focus-visible:outline-none
|
|
67
|
+
`, `
|
|
68
|
+
disabled:pointer-events-none disabled:opacity-50
|
|
69
|
+
aria-disabled:pointer-events-none aria-disabled:opacity-50
|
|
70
|
+
`, `
|
|
71
|
+
[&_svg]:pointer-events-none [&_svg]:shrink-0
|
|
72
|
+
[&_svg:not([class*=size-])]:size-4
|
|
73
|
+
`, "after:hidden"), {
|
|
74
|
+
variants: { variant: {
|
|
75
|
+
default: require_utils.cn(`
|
|
76
|
+
group-data-[variant=default]/tabs-list:data-active:bg-berget-tabs-trigger-active-bg
|
|
77
|
+
group-data-[variant=default]/tabs-list:data-active:text-berget-tabs-trigger-active-fg
|
|
78
|
+
group-data-[variant=default]/tabs-list:data-active:shadow-berget-sm
|
|
79
|
+
`),
|
|
80
|
+
line: require_utils.cn(`
|
|
81
|
+
group-data-[variant=line]/tabs-list:bg-transparent
|
|
82
|
+
group-data-[variant=line]/tabs-list:hover:bg-berget-surface-hover
|
|
83
|
+
group-data-[variant=line]/tabs-list:data-active:bg-transparent
|
|
84
|
+
group-data-[variant=line]/tabs-list:data-active:text-berget-foreground
|
|
85
|
+
`)
|
|
86
|
+
} },
|
|
87
|
+
defaultVariants: { variant: "default" }
|
|
88
|
+
});
|
|
89
|
+
const TabsTrigger = react.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tabs.TabsTrigger, {
|
|
90
|
+
ref,
|
|
91
|
+
className: require_utils.cn(tabsTriggerVariants({ variant }), className),
|
|
92
|
+
...props
|
|
93
|
+
}));
|
|
94
|
+
TabsTrigger.displayName = "TabsTrigger";
|
|
95
|
+
const TabsContent = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tabs.TabsContent, {
|
|
96
|
+
ref,
|
|
97
|
+
className: require_utils.cn("flex-1 text-sm text-berget-foreground outline-none", className),
|
|
98
|
+
...props
|
|
99
|
+
}));
|
|
100
|
+
TabsContent.displayName = "TabsContent";
|
|
101
|
+
//#endregion
|
|
102
|
+
exports.Tabs = Tabs;
|
|
103
|
+
exports.TabsContent = TabsContent;
|
|
104
|
+
exports.TabsList = TabsList;
|
|
105
|
+
exports.TabsTrigger = TabsTrigger;
|
|
106
|
+
exports.tabsListVariants = tabsListVariants;
|
|
107
|
+
exports.tabsTriggerVariants = tabsTriggerVariants;
|
|
108
|
+
|
|
109
|
+
//# sourceMappingURL=Tabs.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.cjs","names":["TabsBaseUI","React","TabsPrimitive","cva","cn","TabsListPrimitive","TabsTriggerPrimitive","TabsContentPrimitive"],"sources":["../../../src/components/tabs/Tabs.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { Tabs as TabsBaseUI } from '@base-ui/react/tabs';\n\nimport { cn } from '../../lib/utils';\nimport {\n Tabs as TabsPrimitive,\n TabsList as TabsListPrimitive,\n TabsTrigger as TabsTriggerPrimitive,\n TabsContent as TabsContentPrimitive,\n} from '../../primitives/tabs';\n\nconst TabsIndicatorPrimitive = TabsBaseUI.Indicator;\ntype TabsRootProps = React.ComponentProps<typeof TabsPrimitive>;\ntype TabsListPrimitiveProps = React.ComponentProps<typeof TabsListPrimitive>;\ntype TabsTabProps = React.ComponentProps<typeof TabsTriggerPrimitive>;\ntype TabsPanelProps = React.ComponentProps<typeof TabsContentPrimitive>;\n\n/* ------------------------------------------------------------------ */\n/* Root — thin pass-through, Berget gap only */\n/* ------------------------------------------------------------------ */\n\nconst Tabs = React.forwardRef<\n HTMLDivElement,\n Omit<TabsRootProps, 'className'> & {\n className?: string;\n }\n>(({ className, ...props }, ref) => <TabsPrimitive ref={ref} className={className} {...props} />);\nTabs.displayName = 'Tabs';\n\n/* ------------------------------------------------------------------ */\n/* List — Berget tokens + the sliding Indicator for the line variant */\n/* ------------------------------------------------------------------ */\n\nconst tabsListVariants = cva(\n cn(\n `\n group/tabs-list inline-flex w-fit items-center justify-center\n rounded-berget-xs p-[3px] text-berget-muted-foreground\n `,\n `\n group-data-[orientation=horizontal]/tabs:h-9\n group-data-[orientation=vertical]/tabs:h-fit\n group-data-[orientation=vertical]/tabs:flex-col\n `,\n ),\n {\n variants: {\n variant: {\n // Pill / segmented control: recessed track.\n default: 'bg-berget-tabs-list-bg',\n // Underline: transparent track; the Indicator is the underline.\n line: 'relative gap-2 rounded-berget-none bg-transparent',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\ntype TabsListProps = Omit<TabsListPrimitiveProps, 'className'> &\n VariantProps<typeof tabsListVariants> & {\n className?: string;\n };\n\nconst TabsList = React.forwardRef<HTMLDivElement, TabsListProps>(\n ({ className, variant = 'default', children, ...props }, ref) => (\n <TabsListPrimitive\n ref={ref}\n data-variant={variant}\n className={cn(tabsListVariants({ variant }), className)}\n {...props}\n >\n {children}\n {/* Animated sliding underline — rendered only for the line variant. */}\n {variant === 'line' && (\n <TabsIndicatorPrimitive\n className={cn(\n `\n pointer-events-none absolute z-10 block rounded-berget-full\n bg-berget-tabs-line-indicator transition-[left,top,width,height]\n duration-200 ease-out\n `,\n `\n group-data-[orientation=horizontal]/tabs:bottom-0\n group-data-[orientation=horizontal]/tabs:left-(--active-tab-left)\n group-data-[orientation=horizontal]/tabs:h-0.5\n group-data-[orientation=horizontal]/tabs:w-(--active-tab-width)\n `,\n `\n group-data-[orientation=vertical]/tabs:top-(--active-tab-top)\n group-data-[orientation=vertical]/tabs:left-0\n group-data-[orientation=vertical]/tabs:h-(--active-tab-height)\n group-data-[orientation=vertical]/tabs:w-0.5\n `,\n )}\n />\n )}\n </TabsListPrimitive>\n ),\n);\nTabsList.displayName = 'TabsList';\n\n/* ------------------------------------------------------------------ */\n/* Trigger — Berget-brand active/hover states */\n/* ------------------------------------------------------------------ */\n\nconst tabsTriggerVariants = cva(\n cn(\n `\n relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center\n gap-1.5 rounded-berget-xs border border-transparent px-3 py-1.5 text-sm\n font-medium whitespace-nowrap transition-all\n `,\n `\n group-data-[orientation=vertical]/tabs:w-full\n group-data-[orientation=vertical]/tabs:justify-start\n `,\n // Inactive: dimmed foreground.\n `\n text-berget-foreground-alt\n hover:text-berget-foreground\n `,\n // Focus.\n `\n focus-visible:ring-berget-focus-ring focus-visible:ring-2\n focus-visible:ring-offset-2 focus-visible:ring-offset-berget-tabs-list-bg\n focus-visible:outline-none\n `,\n // Disabled.\n `\n disabled:pointer-events-none disabled:opacity-50\n aria-disabled:pointer-events-none aria-disabled:opacity-50\n `,\n // Icons sized by the component, no manual sizing classes.\n `\n [&_svg]:pointer-events-none [&_svg]:shrink-0\n [&_svg:not([class*=size-])]:size-4\n `,\n // Hide the primitive's line-variant underline — Berget uses the sliding Indicator.\n 'after:hidden',\n ),\n {\n variants: {\n variant: {\n // Pill: active trigger lifts to the background surface.\n default: cn(\n `\n group-data-[variant=default]/tabs-list:data-active:bg-berget-tabs-trigger-active-bg\n group-data-[variant=default]/tabs-list:data-active:text-berget-tabs-trigger-active-fg\n group-data-[variant=default]/tabs-list:data-active:shadow-berget-sm\n `,\n ),\n // Underline: transparent trigger; the list's Indicator is the cue.\n line: cn(\n `\n group-data-[variant=line]/tabs-list:bg-transparent\n group-data-[variant=line]/tabs-list:hover:bg-berget-surface-hover\n group-data-[variant=line]/tabs-list:data-active:bg-transparent\n group-data-[variant=line]/tabs-list:data-active:text-berget-foreground\n `,\n ),\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\ntype TabsTriggerProps = Omit<TabsTabProps, 'className'> &\n VariantProps<typeof tabsTriggerVariants> & {\n className?: string;\n };\n\nconst TabsTrigger = React.forwardRef<HTMLButtonElement, TabsTriggerProps>(\n ({ className, variant, ...props }, ref) => (\n <TabsTriggerPrimitive\n ref={ref}\n className={cn(tabsTriggerVariants({ variant }), className)}\n {...props}\n />\n ),\n);\nTabsTrigger.displayName = 'TabsTrigger';\n\n/* ------------------------------------------------------------------ */\n/* Content */\n/* ------------------------------------------------------------------ */\n\nconst TabsContent = React.forwardRef<\n HTMLDivElement,\n Omit<TabsPanelProps, 'className'> & { className?: string }\n>(({ className, ...props }, ref) => (\n <TabsContentPrimitive\n ref={ref}\n className={cn('flex-1 text-sm text-berget-foreground outline-none', className)}\n {...props}\n />\n));\nTabsContent.displayName = 'TabsContent';\n\n/* ------------------------------------------------------------------ */\n/* Exports */\n/* ------------------------------------------------------------------ */\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants, tabsTriggerVariants };\n"],"mappings":";;;;;;;;;AAeA,MAAM,yB,6BAAyBA,CAAAA,CAAAA,KAAW;AAU1C,MAAM,OAAOC,MAAM,YAKhB,EAAE,WAAW,GAAG,SAAS,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,MAAD;CAAoB;CAAgB;CAAW,GAAI;AAAQ,CAAA,CAAC;AAChG,KAAK,cAAc;AAMnB,MAAM,oBAAA,GAAmBC,yBAAAA,IAAAA,CACvBC,cAAAA,GACE;;;OAIA;;;;KAKF,GACA;CACE,UAAU,EACR,SAAS;EAEP,SAAS;EAET,MAAM;CACR,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF;AAOA,MAAM,WAAWH,MAAM,YACpB,EAAE,WAAW,UAAU,WAAW,UAAU,GAAG,SAAS,QACvD,iBAAA,GAAA,kBAAA,KAAA,CAACI,aAAAA,UAAD;CACO;CACL,gBAAc;CACd,WAAWD,cAAAA,GAAG,iBAAiB,EAAE,QAAQ,CAAC,GAAG,SAAS;CACtD,GAAI;CAJN,UAAA,CAMG,UAEA,YAAY,UACX,iBAAA,GAAA,kBAAA,IAAA,CAAC,wBAAD,EACE,WAAWA,cAAAA,GACT;;;;eAKA;;;;;eAMA;;;;;aAMF,EACD,CAAA,CAEc;AAEvB,CAAA,CAAA;AACA,SAAS,cAAc;AAMvB,MAAM,uBAAA,GAAsBD,yBAAAA,IAAAA,CAC1BC,cAAAA,GACE;;;;OAKA;;;OAKA;;;OAKA;;;;OAMA;;;OAKA;;;OAKA,cACF,GACA;CACE,UAAU,EACR,SAAS;EAEP,SAASA,cAAAA,GACP;;;;WAKF;EAEA,MAAMA,cAAAA,GACJ;;;;;WAMF;CACF,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF;AAOA,MAAM,cAAcH,MAAM,YACvB,EAAE,WAAW,SAAS,GAAG,SAAS,QACjC,iBAAA,GAAA,kBAAA,IAAA,CAACK,aAAAA,aAAD;CACO;CACL,WAAWF,cAAAA,GAAG,oBAAoB,EAAE,QAAQ,CAAC,GAAG,SAAS;CACzD,GAAI;AACL,CAAA,CAEL;AACA,YAAY,cAAc;AAM1B,MAAM,cAAcH,MAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,iBAAA,GAAA,kBAAA,IAAA,CAACM,aAAAA,aAAD;CACO;CACL,WAAWH,cAAAA,GAAG,sDAAsD,SAAS;CAC7E,GAAI;AACL,CAAA,CACF;AACD,YAAY,cAAc"}
|