@bergetai/ui 0.17.0 → 0.19.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-dialog/AlertDialog.cjs +3 -3
- package/dist/components/alert-dialog/AlertDialog.cjs.map +1 -1
- package/dist/components/alert-dialog/AlertDialog.d.cts +3 -3
- package/dist/components/alert-dialog/AlertDialog.d.mts +3 -3
- package/dist/components/alert-dialog/AlertDialog.mjs +3 -3
- package/dist/components/alert-dialog/AlertDialog.mjs.map +1 -1
- package/dist/components/box/Box.cjs.map +1 -1
- package/dist/components/box/Box.d.cts +3 -3
- package/dist/components/box/Box.d.mts +3 -3
- package/dist/components/box/Box.mjs.map +1 -1
- package/dist/components/button/Button.cjs +3 -1
- package/dist/components/button/Button.cjs.map +1 -1
- package/dist/components/button/Button.d.cts +1 -1
- package/dist/components/button/Button.d.mts +1 -1
- package/dist/components/button/Button.mjs +3 -1
- package/dist/components/button/Button.mjs.map +1 -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/container/Container.cjs.map +1 -1
- package/dist/components/container/Container.d.cts +3 -3
- package/dist/components/container/Container.d.mts +3 -3
- package/dist/components/container/Container.mjs.map +1 -1
- package/dist/components/country-select/CountrySelect.cjs +2 -2
- package/dist/components/country-select/CountrySelect.cjs.map +1 -1
- package/dist/components/country-select/CountrySelect.mjs +2 -2
- package/dist/components/country-select/CountrySelect.mjs.map +1 -1
- package/dist/components/dialog/Dialog.cjs +3 -3
- package/dist/components/dialog/Dialog.cjs.map +1 -1
- package/dist/components/dialog/Dialog.d.cts +1 -1
- package/dist/components/dialog/Dialog.d.mts +1 -1
- package/dist/components/dialog/Dialog.mjs +3 -3
- package/dist/components/dialog/Dialog.mjs.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.cjs.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.d.cts +9 -9
- package/dist/components/dropdown-menu/DropdownMenu.d.mts +9 -9
- package/dist/components/dropdown-menu/DropdownMenu.mjs.map +1 -1
- package/dist/components/grid/Grid.cjs.map +1 -1
- package/dist/components/grid/Grid.d.cts +3 -3
- package/dist/components/grid/Grid.d.mts +3 -3
- package/dist/components/grid/Grid.mjs.map +1 -1
- package/dist/components/item/Item.cjs.map +1 -1
- package/dist/components/item/Item.d.cts +1 -1
- package/dist/components/item/Item.d.mts +1 -1
- package/dist/components/item/Item.mjs.map +1 -1
- package/dist/components/typography/Typography.d.cts +1 -1
- package/dist/components/typography/Typography.d.mts +1 -1
- 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 +12 -0
- package/dist/index.d.cts +6 -2
- package/dist/index.d.mts +6 -2
- package/dist/index.mjs +5 -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/lib/utils.cjs +4 -4
- package/dist/lib/utils.cjs.map +1 -1
- package/dist/lib/utils.d.cts +6 -0
- package/dist/lib/utils.d.cts.map +1 -0
- package/dist/lib/utils.d.mts +6 -0
- package/dist/lib/utils.d.mts.map +1 -0
- package/dist/lib/utils.mjs +4 -4
- package/dist/lib/utils.mjs.map +1 -1
- 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/styles/index.css +61 -0
- package/package.json +2 -1
|
@@ -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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.cjs","names":["cva","React","useRender","mergeProps","cn"],"sources":["../../../src/components/container/Container.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\n\nconst containerVariants = cva('mx-auto w-full', {\n variants: {\n size: {\n sm: 'max-w-3xl',\n md: 'max-w-5xl',\n lg: 'max-w-7xl',\n xl: 'max-w-7xl',\n full: 'max-w-full',\n },\n padding: {\n none: 'px-0',\n sm: `\n px-4\n sm:px-6\n `,\n md: `\n px-4\n sm:px-6\n lg:px-8\n `,\n lg: `\n px-4\n sm:px-8\n lg:px-12\n `,\n },\n },\n defaultVariants: {\n size: 'lg',\n padding: 'md',\n },\n});\n\nexport interface ContainerProps\n extends useRender.ComponentProps<'div'>, VariantProps<typeof containerVariants> {\n children?: React.ReactNode;\n /** Render as a different element/component
|
|
1
|
+
{"version":3,"file":"Container.cjs","names":["cva","React","useRender","mergeProps","cn"],"sources":["../../../src/components/container/Container.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\n\nconst containerVariants = cva('mx-auto w-full', {\n variants: {\n size: {\n sm: 'max-w-3xl',\n md: 'max-w-5xl',\n lg: 'max-w-7xl',\n xl: 'max-w-7xl',\n full: 'max-w-full',\n },\n padding: {\n none: 'px-0',\n sm: `\n px-4\n sm:px-6\n `,\n md: `\n px-4\n sm:px-6\n lg:px-8\n `,\n lg: `\n px-4\n sm:px-8\n lg:px-12\n `,\n },\n },\n defaultVariants: {\n size: 'lg',\n padding: 'md',\n },\n});\n\nexport interface ContainerProps\n extends useRender.ComponentProps<'div'>, VariantProps<typeof containerVariants> {\n children?: React.ReactNode;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n}\n\nconst Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ className, size, padding, asChild = false, children, ...props }, ref) => {\n return useRender({\n ref,\n defaultTagName: 'div',\n render: asChild ? (children as React.ReactElement) : undefined,\n props: mergeProps<'div'>(\n {\n className: cn(containerVariants({ size, padding }), className),\n children: asChild ? undefined : children,\n } as React.ComponentProps<'div'>,\n props,\n ),\n });\n },\n);\nContainer.displayName = 'Container';\n\nexport { Container, containerVariants };\n"],"mappings":";;;;;;;;;AAQA,MAAM,qBAAA,GAAoBA,yBAAAA,IAAAA,CAAI,kBAAkB;CAC9C,UAAU;EACR,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;EACR;EACA,SAAS;GACP,MAAM;GACN,IAAI;;;;GAIJ,IAAI;;;;;GAKJ,IAAI;;;;;EAKN;CACF;CACA,iBAAiB;EACf,MAAM;EACN,SAAS;CACX;AACF,CAAC;AASD,MAAM,YAAYC,MAAM,YACrB,EAAE,WAAW,MAAM,SAAS,UAAU,OAAO,UAAU,GAAG,SAAS,QAAQ;CAC1E,QAAA,GAAOC,0BAAAA,UAAAA,CAAU;EACf;EACA,gBAAgB;EAChB,QAAQ,UAAW,WAAkC,KAAA;EACrD,QAAA,GAAOC,2BAAAA,WAAAA,CACL;GACE,WAAWC,cAAAA,GAAG,kBAAkB;IAAE;IAAM;GAAQ,CAAC,GAAG,SAAS;GAC7D,UAAU,UAAU,KAAA,IAAY;EAClC,GACA,KACF;CACF,CAAC;AACH,CACF;AACA,UAAU,cAAc"}
|
|
@@ -3,12 +3,12 @@ import { VariantProps } from "class-variance-authority";
|
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
4
|
//#region src/components/container/Container.d.ts
|
|
5
5
|
declare const containerVariants: (props?: ({
|
|
6
|
-
size?: "sm" | "
|
|
7
|
-
padding?: "none" | "sm" | "
|
|
6
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
7
|
+
padding?: "none" | "sm" | "md" | "lg" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
export interface ContainerProps extends useRender.ComponentProps<'div'>, VariantProps<typeof containerVariants> {
|
|
10
10
|
children?: React.ReactNode;
|
|
11
|
-
/** Render as a different element/component
|
|
11
|
+
/** Render as a different element/component by merging props onto the child. */
|
|
12
12
|
asChild?: boolean;
|
|
13
13
|
}
|
|
14
14
|
declare const Container: React.ForwardRefExoticComponent<Omit<ContainerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -3,12 +3,12 @@ import { VariantProps } from "class-variance-authority";
|
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
4
|
//#region src/components/container/Container.d.ts
|
|
5
5
|
declare const containerVariants: (props?: ({
|
|
6
|
-
size?: "sm" | "
|
|
7
|
-
padding?: "none" | "sm" | "
|
|
6
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
7
|
+
padding?: "none" | "sm" | "md" | "lg" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
export interface ContainerProps extends useRender.ComponentProps<'div'>, VariantProps<typeof containerVariants> {
|
|
10
10
|
children?: React.ReactNode;
|
|
11
|
-
/** Render as a different element/component
|
|
11
|
+
/** Render as a different element/component by merging props onto the child. */
|
|
12
12
|
asChild?: boolean;
|
|
13
13
|
}
|
|
14
14
|
declare const Container: React.ForwardRefExoticComponent<Omit<ContainerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.mjs","names":[],"sources":["../../../src/components/container/Container.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\n\nconst containerVariants = cva('mx-auto w-full', {\n variants: {\n size: {\n sm: 'max-w-3xl',\n md: 'max-w-5xl',\n lg: 'max-w-7xl',\n xl: 'max-w-7xl',\n full: 'max-w-full',\n },\n padding: {\n none: 'px-0',\n sm: `\n px-4\n sm:px-6\n `,\n md: `\n px-4\n sm:px-6\n lg:px-8\n `,\n lg: `\n px-4\n sm:px-8\n lg:px-12\n `,\n },\n },\n defaultVariants: {\n size: 'lg',\n padding: 'md',\n },\n});\n\nexport interface ContainerProps\n extends useRender.ComponentProps<'div'>, VariantProps<typeof containerVariants> {\n children?: React.ReactNode;\n /** Render as a different element/component
|
|
1
|
+
{"version":3,"file":"Container.mjs","names":[],"sources":["../../../src/components/container/Container.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\n\nconst containerVariants = cva('mx-auto w-full', {\n variants: {\n size: {\n sm: 'max-w-3xl',\n md: 'max-w-5xl',\n lg: 'max-w-7xl',\n xl: 'max-w-7xl',\n full: 'max-w-full',\n },\n padding: {\n none: 'px-0',\n sm: `\n px-4\n sm:px-6\n `,\n md: `\n px-4\n sm:px-6\n lg:px-8\n `,\n lg: `\n px-4\n sm:px-8\n lg:px-12\n `,\n },\n },\n defaultVariants: {\n size: 'lg',\n padding: 'md',\n },\n});\n\nexport interface ContainerProps\n extends useRender.ComponentProps<'div'>, VariantProps<typeof containerVariants> {\n children?: React.ReactNode;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n}\n\nconst Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ className, size, padding, asChild = false, children, ...props }, ref) => {\n return useRender({\n ref,\n defaultTagName: 'div',\n render: asChild ? (children as React.ReactElement) : undefined,\n props: mergeProps<'div'>(\n {\n className: cn(containerVariants({ size, padding }), className),\n children: asChild ? undefined : children,\n } as React.ComponentProps<'div'>,\n props,\n ),\n });\n },\n);\nContainer.displayName = 'Container';\n\nexport { Container, containerVariants };\n"],"mappings":";;;;;;;AAQA,MAAM,oBAAoB,IAAI,kBAAkB;CAC9C,UAAU;EACR,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;EACR;EACA,SAAS;GACP,MAAM;GACN,IAAI;;;;GAIJ,IAAI;;;;;GAKJ,IAAI;;;;;EAKN;CACF;CACA,iBAAiB;EACf,MAAM;EACN,SAAS;CACX;AACF,CAAC;AASD,MAAM,YAAY,MAAM,YACrB,EAAE,WAAW,MAAM,SAAS,UAAU,OAAO,UAAU,GAAG,SAAS,QAAQ;CAC1E,OAAO,UAAU;EACf;EACA,gBAAgB;EAChB,QAAQ,UAAW,WAAkC,KAAA;EACrD,OAAO,WACL;GACE,WAAW,GAAG,kBAAkB;IAAE;IAAM;GAAQ,CAAC,GAAG,SAAS;GAC7D,UAAU,UAAU,KAAA,IAAY;EAClC,GACA,KACF;CACF,CAAC;AACH,CACF;AACA,UAAU,cAAc"}
|
|
@@ -52,7 +52,7 @@ const CountrySelect = react.forwardRef(({ value, onValueChange, placeholder = "S
|
|
|
52
52
|
] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
53
53
|
icon: lucide_react.Globe,
|
|
54
54
|
size: 16,
|
|
55
|
-
className: "shrink-0 text-berget-muted-foreground"
|
|
55
|
+
className: "\n shrink-0 text-berget-muted-foreground\n "
|
|
56
56
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
57
57
|
className: "truncate text-berget-muted-foreground",
|
|
58
58
|
children: placeholder
|
|
@@ -65,7 +65,7 @@ const CountrySelect = react.forwardRef(({ value, onValueChange, placeholder = "S
|
|
|
65
65
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_popover.PopoverContent, {
|
|
66
66
|
align,
|
|
67
67
|
sideOffset,
|
|
68
|
-
className: "w-(--
|
|
68
|
+
className: "\n w-(--trigger-width) p-0\n ",
|
|
69
69
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_command.Command, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_command.CommandInput, { placeholder: "Search country..." }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_command.CommandList, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_command.CommandEmpty, { children: "No countries found." }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_command.CommandGroup, { children: require_countries.COUNTRIES.map((country) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_command.CommandItem, {
|
|
70
70
|
value: `${country.name} ${country.code}`,
|
|
71
71
|
onSelect: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CountrySelect.cjs","names":["React","COUNTRIES","Popover","PopoverTrigger","cn","Icon","Globe","ChevronDown","PopoverContent","Command","CommandInput","CommandList","CommandEmpty","CommandGroup","CommandItem"],"sources":["../../../src/components/country-select/CountrySelect.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ChevronDown, Globe } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Icon } from '@/components/icon';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/primitives/popover';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/primitives/command';\nimport { type Country, COUNTRIES } from './countries';\n\nexport interface CountrySelectProps {\n value?: string | null;\n onValueChange?: (code: string) => void;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n align?: 'center' | 'start' | 'end';\n sideOffset?: number;\n}\n\nconst CountrySelect = React.forwardRef<React.ElementRef<'button'>, CountrySelectProps>(\n (\n {\n value,\n onValueChange,\n placeholder = 'Select country',\n disabled = false,\n className,\n align = 'center',\n sideOffset = 4,\n },\n ref,\n ) => {\n const [open, setOpen] = React.useState(false);\n const selectedCountry = React.useMemo(() => COUNTRIES.find((c) => c.code === value), [value]);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n ref={ref}\n render={\n <button\n type=\"button\"\n disabled={disabled}\n aria-expanded={open}\n className={cn(\n // Base layout — consistent with Select trigger\n 'flex w-full items-center justify-between',\n 'rounded-berget-xs border bg-card',\n 'px-4 py-3 text-sm',\n 'transition-colors duration-200',\n 'focus-visible:ring-0 focus-visible:outline-none',\n `\n focus-visible:border-berget-form-focus-border\n focus-visible:ring-offset-0\n `,\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Default border & hover matching Select variant \"default\"\n `\n border-berget-border-interactive\n hover:bg-berget-surface-hover\n `,\n className,\n )}\n />\n }\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n {selectedCountry ? (\n <>\n <span className=\"shrink-0 text-xl\">{selectedCountry.flag}</span>\n <span className=\"truncate\">{selectedCountry.name}</span>\n <span className=\"shrink-0 text-xs text-berget-muted-foreground\">\n ({selectedCountry.code})\n </span>\n </>\n ) : (\n <>\n <Icon
|
|
1
|
+
{"version":3,"file":"CountrySelect.cjs","names":["React","COUNTRIES","Popover","PopoverTrigger","cn","Icon","Globe","ChevronDown","PopoverContent","Command","CommandInput","CommandList","CommandEmpty","CommandGroup","CommandItem"],"sources":["../../../src/components/country-select/CountrySelect.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ChevronDown, Globe } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Icon } from '@/components/icon';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/primitives/popover';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/primitives/command';\nimport { type Country, COUNTRIES } from './countries';\n\nexport interface CountrySelectProps {\n value?: string | null;\n onValueChange?: (code: string) => void;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n align?: 'center' | 'start' | 'end';\n sideOffset?: number;\n}\n\nconst CountrySelect = React.forwardRef<React.ElementRef<'button'>, CountrySelectProps>(\n (\n {\n value,\n onValueChange,\n placeholder = 'Select country',\n disabled = false,\n className,\n align = 'center',\n sideOffset = 4,\n },\n ref,\n ) => {\n const [open, setOpen] = React.useState(false);\n const selectedCountry = React.useMemo(() => COUNTRIES.find((c) => c.code === value), [value]);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n ref={ref}\n render={\n <button\n type=\"button\"\n disabled={disabled}\n aria-expanded={open}\n className={cn(\n // Base layout — consistent with Select trigger\n 'flex w-full items-center justify-between',\n 'rounded-berget-xs border bg-card',\n 'px-4 py-3 text-sm',\n 'transition-colors duration-200',\n 'focus-visible:ring-0 focus-visible:outline-none',\n `\n focus-visible:border-berget-form-focus-border\n focus-visible:ring-offset-0\n `,\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Default border & hover matching Select variant \"default\"\n `\n border-berget-border-interactive\n hover:bg-berget-surface-hover\n `,\n className,\n )}\n />\n }\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n {selectedCountry ? (\n <>\n <span className=\"shrink-0 text-xl\">{selectedCountry.flag}</span>\n <span className=\"truncate\">{selectedCountry.name}</span>\n <span className=\"shrink-0 text-xs text-berget-muted-foreground\">\n ({selectedCountry.code})\n </span>\n </>\n ) : (\n <>\n <Icon\n icon={Globe}\n size={16}\n className=\"\n shrink-0 text-berget-muted-foreground\n \"\n />\n <span className=\"truncate text-berget-muted-foreground\">{placeholder}</span>\n </>\n )}\n </div>\n <Icon\n icon={ChevronDown}\n size={16}\n className={cn(\n 'shrink-0 text-berget-muted-foreground',\n 'transition-transform duration-200',\n open && 'rotate-180',\n )}\n />\n </PopoverTrigger>\n\n <PopoverContent\n align={align}\n sideOffset={sideOffset}\n className=\"\n w-(--trigger-width) p-0\n \"\n >\n <Command>\n <CommandInput placeholder=\"Search country...\" />\n <CommandList>\n <CommandEmpty>No countries found.</CommandEmpty>\n <CommandGroup>\n {COUNTRIES.map((country) => (\n <CommandItem\n key={country.code}\n value={`${country.name} ${country.code}`}\n onSelect={() => {\n onValueChange?.(country.code);\n setOpen(false);\n }}\n className={cn(\n 'flex items-center gap-3 px-3 py-2.5',\n `\n data-[selected='true']:bg-berget-brand-granite-700/40!\n data-[selected=true]:text-berget-foreground\n `,\n value === country.code && 'bg-berget-brand-granite-800/40',\n )}\n >\n <span className=\"shrink-0 text-xl\">{country.flag}</span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate text-sm\">{country.name}</div>\n <div className=\"text-xs text-berget-muted-foreground\">{country.code}</div>\n </div>\n {value === country.code && (\n <div\n className=\"\n size-2 shrink-0 rounded-full\n bg-berget-brand-granite-400\n \"\n />\n )}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nCountrySelect.displayName = 'CountrySelect';\n\nexport { CountrySelect };\nexport type { Country };\nexport {\n COUNTRIES,\n EU_COUNTRY_CODES,\n getCountryByCode,\n getCountryByName,\n isEUCountry,\n} from './countries';\n"],"mappings":";;;;;;;;;;;;AA4BA,MAAM,gBAAgBA,MAAM,YAExB,EACE,OACA,eACA,cAAc,kBACd,WAAW,OACX,WACA,QAAQ,UACR,aAAa,KAEf,QACG;CACH,MAAM,CAAC,MAAM,WAAWA,MAAM,SAAS,KAAK;CAC5C,MAAM,kBAAkBA,MAAM,cAAcC,kBAAAA,UAAU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AAA,CAAA;EACK,CAAA,CACT;;AAEb,CACF;AAEA,cAAc,cAAc"}
|
|
@@ -50,7 +50,7 @@ const CountrySelect = React.forwardRef(({ value, onValueChange, placeholder = "S
|
|
|
50
50
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
51
51
|
icon: Globe,
|
|
52
52
|
size: 16,
|
|
53
|
-
className: "shrink-0 text-berget-muted-foreground"
|
|
53
|
+
className: "\n shrink-0 text-berget-muted-foreground\n "
|
|
54
54
|
}), /* @__PURE__ */ jsx("span", {
|
|
55
55
|
className: "truncate text-berget-muted-foreground",
|
|
56
56
|
children: placeholder
|
|
@@ -63,7 +63,7 @@ const CountrySelect = React.forwardRef(({ value, onValueChange, placeholder = "S
|
|
|
63
63
|
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
64
64
|
align,
|
|
65
65
|
sideOffset,
|
|
66
|
-
className: "w-(--
|
|
66
|
+
className: "\n w-(--trigger-width) p-0\n ",
|
|
67
67
|
children: /* @__PURE__ */ jsxs(Command, { children: [/* @__PURE__ */ jsx(CommandInput, { placeholder: "Search country..." }), /* @__PURE__ */ jsxs(CommandList, { children: [/* @__PURE__ */ jsx(CommandEmpty, { children: "No countries found." }), /* @__PURE__ */ jsx(CommandGroup, { children: COUNTRIES.map((country) => /* @__PURE__ */ jsxs(CommandItem, {
|
|
68
68
|
value: `${country.name} ${country.code}`,
|
|
69
69
|
onSelect: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CountrySelect.mjs","names":[],"sources":["../../../src/components/country-select/CountrySelect.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ChevronDown, Globe } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Icon } from '@/components/icon';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/primitives/popover';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/primitives/command';\nimport { type Country, COUNTRIES } from './countries';\n\nexport interface CountrySelectProps {\n value?: string | null;\n onValueChange?: (code: string) => void;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n align?: 'center' | 'start' | 'end';\n sideOffset?: number;\n}\n\nconst CountrySelect = React.forwardRef<React.ElementRef<'button'>, CountrySelectProps>(\n (\n {\n value,\n onValueChange,\n placeholder = 'Select country',\n disabled = false,\n className,\n align = 'center',\n sideOffset = 4,\n },\n ref,\n ) => {\n const [open, setOpen] = React.useState(false);\n const selectedCountry = React.useMemo(() => COUNTRIES.find((c) => c.code === value), [value]);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n ref={ref}\n render={\n <button\n type=\"button\"\n disabled={disabled}\n aria-expanded={open}\n className={cn(\n // Base layout — consistent with Select trigger\n 'flex w-full items-center justify-between',\n 'rounded-berget-xs border bg-card',\n 'px-4 py-3 text-sm',\n 'transition-colors duration-200',\n 'focus-visible:ring-0 focus-visible:outline-none',\n `\n focus-visible:border-berget-form-focus-border\n focus-visible:ring-offset-0\n `,\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Default border & hover matching Select variant \"default\"\n `\n border-berget-border-interactive\n hover:bg-berget-surface-hover\n `,\n className,\n )}\n />\n }\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n {selectedCountry ? (\n <>\n <span className=\"shrink-0 text-xl\">{selectedCountry.flag}</span>\n <span className=\"truncate\">{selectedCountry.name}</span>\n <span className=\"shrink-0 text-xs text-berget-muted-foreground\">\n ({selectedCountry.code})\n </span>\n </>\n ) : (\n <>\n <Icon
|
|
1
|
+
{"version":3,"file":"CountrySelect.mjs","names":[],"sources":["../../../src/components/country-select/CountrySelect.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ChevronDown, Globe } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Icon } from '@/components/icon';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/primitives/popover';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/primitives/command';\nimport { type Country, COUNTRIES } from './countries';\n\nexport interface CountrySelectProps {\n value?: string | null;\n onValueChange?: (code: string) => void;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n align?: 'center' | 'start' | 'end';\n sideOffset?: number;\n}\n\nconst CountrySelect = React.forwardRef<React.ElementRef<'button'>, CountrySelectProps>(\n (\n {\n value,\n onValueChange,\n placeholder = 'Select country',\n disabled = false,\n className,\n align = 'center',\n sideOffset = 4,\n },\n ref,\n ) => {\n const [open, setOpen] = React.useState(false);\n const selectedCountry = React.useMemo(() => COUNTRIES.find((c) => c.code === value), [value]);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n ref={ref}\n render={\n <button\n type=\"button\"\n disabled={disabled}\n aria-expanded={open}\n className={cn(\n // Base layout — consistent with Select trigger\n 'flex w-full items-center justify-between',\n 'rounded-berget-xs border bg-card',\n 'px-4 py-3 text-sm',\n 'transition-colors duration-200',\n 'focus-visible:ring-0 focus-visible:outline-none',\n `\n focus-visible:border-berget-form-focus-border\n focus-visible:ring-offset-0\n `,\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Default border & hover matching Select variant \"default\"\n `\n border-berget-border-interactive\n hover:bg-berget-surface-hover\n `,\n className,\n )}\n />\n }\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n {selectedCountry ? (\n <>\n <span className=\"shrink-0 text-xl\">{selectedCountry.flag}</span>\n <span className=\"truncate\">{selectedCountry.name}</span>\n <span className=\"shrink-0 text-xs text-berget-muted-foreground\">\n ({selectedCountry.code})\n </span>\n </>\n ) : (\n <>\n <Icon\n icon={Globe}\n size={16}\n className=\"\n shrink-0 text-berget-muted-foreground\n \"\n />\n <span className=\"truncate text-berget-muted-foreground\">{placeholder}</span>\n </>\n )}\n </div>\n <Icon\n icon={ChevronDown}\n size={16}\n className={cn(\n 'shrink-0 text-berget-muted-foreground',\n 'transition-transform duration-200',\n open && 'rotate-180',\n )}\n />\n </PopoverTrigger>\n\n <PopoverContent\n align={align}\n sideOffset={sideOffset}\n className=\"\n w-(--trigger-width) p-0\n \"\n >\n <Command>\n <CommandInput placeholder=\"Search country...\" />\n <CommandList>\n <CommandEmpty>No countries found.</CommandEmpty>\n <CommandGroup>\n {COUNTRIES.map((country) => (\n <CommandItem\n key={country.code}\n value={`${country.name} ${country.code}`}\n onSelect={() => {\n onValueChange?.(country.code);\n setOpen(false);\n }}\n className={cn(\n 'flex items-center gap-3 px-3 py-2.5',\n `\n data-[selected='true']:bg-berget-brand-granite-700/40!\n data-[selected=true]:text-berget-foreground\n `,\n value === country.code && 'bg-berget-brand-granite-800/40',\n )}\n >\n <span className=\"shrink-0 text-xl\">{country.flag}</span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate text-sm\">{country.name}</div>\n <div className=\"text-xs text-berget-muted-foreground\">{country.code}</div>\n </div>\n {value === country.code && (\n <div\n className=\"\n size-2 shrink-0 rounded-full\n bg-berget-brand-granite-400\n \"\n />\n )}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nCountrySelect.displayName = 'CountrySelect';\n\nexport { CountrySelect };\nexport type { Country };\nexport {\n COUNTRIES,\n EU_COUNTRY_CODES,\n getCountryByCode,\n getCountryByName,\n isEUCountry,\n} from './countries';\n"],"mappings":";;;;;;;;;;AA4BA,MAAM,gBAAgB,MAAM,YAExB,EACE,OACA,eACA,cAAc,kBACd,WAAW,OACX,WACA,QAAQ,UACR,aAAa,KAEf,QACG;CACH,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,KAAK;CAC5C,MAAM,kBAAkB,MAAM,cAAc,UAAU,MAAM,MAAM,EAAE,SAAS,KAAK,GAAG,CAAC,KAAK,CAAC;CAE5F,OACE,qBAAC,SAAD;EAAe;EAAM,cAAc;EAAnC,UAAA,CACE,qBAAC,gBAAD;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UAAA,QAAQ;KAAW,CAAA;KACvD,qBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,oBAAC,OAAD;OAAK,WAAU;OAAoB,UAAA,QAAQ;MAAU,CAAA,GACrD,oBAAC,OAAD;OAAK,WAAU;OAAwC,UAAA,QAAQ;MAAU,CAAA,CACtE;;KACJ,UAAU,QAAQ,QACjB,oBAAC,OAAD,EACE,WAAU,4IAIX,CAAA;IAEQ;GA5BN,GAAA,QAAQ,IA4BF,CACd,EACW,CAAA,CACH,EAAA,CAAA,CACN,EAAA,CAAA;EACK,CAAA,CACT;;AAEb,CACF;AAEA,cAAc,cAAc"}
|
|
@@ -32,9 +32,9 @@ DialogOverlay.displayName = "DialogOverlay";
|
|
|
32
32
|
const DialogContent = react.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DialogPortal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogOverlay, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_dialog.Dialog.Popup, {
|
|
33
33
|
ref,
|
|
34
34
|
className: require_utils.cn(`
|
|
35
|
-
fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-[-50%]
|
|
36
|
+
gap-4 rounded-berget-sm border border-berget-dialog-border
|
|
37
|
+
bg-berget-dialog-bg p-6 shadow-berget-lg
|
|
38
38
|
transition-[opacity,transform] duration-200
|
|
39
39
|
data-ending-style:scale-95 data-ending-style:opacity-0
|
|
40
40
|
data-starting-style:scale-95 data-starting-style:opacity-0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.cjs","names":["DialogPrimitive","React","asChildRender","cn","X","Typography"],"sources":["../../../src/components/dialog/Dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\n\nimport { cn, asChildRender } from '../../lib/utils';\nimport { Typography } from '../typography';\n\nconst Dialog = DialogPrimitive.Root;\n\ntype DialogTriggerProps = Omit<DialogPrimitive.Trigger.Props, 'className' | 'render'> & {\n className?: string;\n /** Render as a different element/component
|
|
1
|
+
{"version":3,"file":"Dialog.cjs","names":["DialogPrimitive","React","asChildRender","cn","X","Typography"],"sources":["../../../src/components/dialog/Dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\n\nimport { cn, asChildRender } from '../../lib/utils';\nimport { Typography } from '../typography';\n\nconst Dialog = DialogPrimitive.Root;\n\ntype DialogTriggerProps = Omit<DialogPrimitive.Trigger.Props, 'className' | 'render'> & {\n className?: string;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DialogTrigger = React.forwardRef<HTMLButtonElement, DialogTriggerProps>(\n ({ asChild, children, ...props }, ref) => (\n <DialogPrimitive.Trigger ref={ref} render={asChildRender(asChild, children)} {...props}>\n {asChild ? undefined : children}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'DialogTrigger';\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n HTMLDivElement,\n Omit<DialogPrimitive.Backdrop.Props, 'className'> & { className?: string }\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Backdrop\n ref={ref}\n className={cn(\n `\n fixed inset-0 z-50 bg-berget-dialog-overlay-bg transition-opacity\n duration-200\n data-ending-style:opacity-0\n data-starting-style:opacity-0\n `,\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = 'DialogOverlay';\n\nconst DialogContent = React.forwardRef<\n HTMLDivElement,\n Omit<DialogPrimitive.Popup.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Popup\n ref={ref}\n className={cn(\n `\n fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-[-50%]\n gap-4 rounded-berget-sm border border-berget-dialog-border\n bg-berget-dialog-bg p-6 shadow-berget-lg\n transition-[opacity,transform] duration-200\n data-ending-style:scale-95 data-ending-style:opacity-0\n data-starting-style:scale-95 data-starting-style:opacity-0\n `,\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close\n className=\"\n focus:ring-berget-focus-ring\n absolute top-4 right-4 rounded-berget-xs opacity-70\n ring-offset-berget-dialog-bg transition-opacity\n hover:opacity-100\n focus:ring-2 focus:ring-offset-2 focus:outline-none\n disabled:pointer-events-none\n data-open:bg-berget-muted data-open:text-berget-muted-foreground\n \"\n >\n <X className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Popup>\n </DialogPortal>\n));\nDialogContent.displayName = 'DialogContent';\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n `\n flex flex-col gap-1.5 text-center\n sm:text-left\n `,\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n `\n flex flex-col-reverse gap-2\n sm:flex-row sm:justify-end\n `,\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n HTMLHeadingElement,\n Omit<DialogPrimitive.Title.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n render={<Typography variant=\"h5\" color=\"default\" as=\"h2\" className={className} />}\n {...props}\n >\n {children}\n </DialogPrimitive.Title>\n));\nDialogTitle.displayName = 'DialogTitle';\n\nconst DialogDescription = React.forwardRef<\n HTMLParagraphElement,\n Omit<DialogPrimitive.Description.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n render={<Typography variant=\"small\" color=\"muted\" className={className} />}\n {...props}\n >\n {children}\n </DialogPrimitive.Description>\n));\nDialogDescription.displayName = 'DialogDescription';\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;;;;;AASA,MAAM,SAASA,sBAAAA,OAAgB;AAQ/B,MAAM,gBAAgBC,MAAM,YACzB,EAAE,SAAS,UAAU,GAAG,SAAS,QAChC,iBAAA,GAAA,kBAAA,IAAA,CAACD,sBAAAA,OAAgB,SAAjB;CAA8B;CAAK,QAAQE,cAAAA,cAAc,SAAS,QAAQ;CAAG,GAAI;CAC9E,UAAA,UAAU,KAAA,IAAY;AACA,CAAA,CAE7B;AACA,cAAc,cAAc;AAE5B,MAAM,eAAeF,sBAAAA,OAAgB;AAErC,MAAM,cAAcA,sBAAAA,OAAgB;AAEpC,MAAM,gBAAgBC,MAAM,YAGzB,EAAE,WAAW,GAAG,SAAS,QAC1B,iBAAA,GAAA,kBAAA,IAAA,CAACD,sBAAAA,OAAgB,UAAjB;CACO;CACL,WAAWG,cAAAA,GACT;;;;;SAMA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,cAAc,cAAc;AAE5B,MAAM,gBAAgBF,MAAM,YAGzB,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,iBAAA,GAAA,kBAAA,KAAA,CAAC,cAAD,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD,CAAgB,CAAA,GAChB,iBAAA,GAAA,kBAAA,KAAA,CAACD,sBAAAA,OAAgB,OAAjB;CACO;CACL,WAAWG,cAAAA,GACT;;;;;;;WAQA,SACF;CACA,GAAI;CAbN,UAAA,CAeG,UACD,iBAAA,GAAA,kBAAA,KAAA,CAACH,sBA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/react/dialog";
|
|
|
4
4
|
declare const Dialog$1: <Payload>(props: Dialog.Root.Props<Payload>) => React.JSX.Element;
|
|
5
5
|
type DialogTriggerProps = Omit<Dialog.Trigger.Props, 'className' | 'render'> & {
|
|
6
6
|
className?: string;
|
|
7
|
-
/** Render as a different element/component
|
|
7
|
+
/** Render as a different element/component by merging props onto the child. */
|
|
8
8
|
asChild?: boolean;
|
|
9
9
|
};
|
|
10
10
|
declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<DialogTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -4,7 +4,7 @@ import { Dialog } from "@base-ui/react/dialog";
|
|
|
4
4
|
declare const Dialog$1: <Payload>(props: Dialog.Root.Props<Payload>) => React.JSX.Element;
|
|
5
5
|
type DialogTriggerProps = Omit<Dialog.Trigger.Props, 'className' | 'render'> & {
|
|
6
6
|
className?: string;
|
|
7
|
-
/** Render as a different element/component
|
|
7
|
+
/** Render as a different element/component by merging props onto the child. */
|
|
8
8
|
asChild?: boolean;
|
|
9
9
|
};
|
|
10
10
|
declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<DialogTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -30,9 +30,9 @@ DialogOverlay.displayName = "DialogOverlay";
|
|
|
30
30
|
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(Dialog.Popup, {
|
|
31
31
|
ref,
|
|
32
32
|
className: cn(`
|
|
33
|
-
fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-[-50%]
|
|
34
|
+
gap-4 rounded-berget-sm border border-berget-dialog-border
|
|
35
|
+
bg-berget-dialog-bg p-6 shadow-berget-lg
|
|
36
36
|
transition-[opacity,transform] duration-200
|
|
37
37
|
data-ending-style:scale-95 data-ending-style:opacity-0
|
|
38
38
|
data-starting-style:scale-95 data-starting-style:opacity-0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.mjs","names":["Dialog","DialogPrimitive"],"sources":["../../../src/components/dialog/Dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\n\nimport { cn, asChildRender } from '../../lib/utils';\nimport { Typography } from '../typography';\n\nconst Dialog = DialogPrimitive.Root;\n\ntype DialogTriggerProps = Omit<DialogPrimitive.Trigger.Props, 'className' | 'render'> & {\n className?: string;\n /** Render as a different element/component
|
|
1
|
+
{"version":3,"file":"Dialog.mjs","names":["Dialog","DialogPrimitive"],"sources":["../../../src/components/dialog/Dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\n\nimport { cn, asChildRender } from '../../lib/utils';\nimport { Typography } from '../typography';\n\nconst Dialog = DialogPrimitive.Root;\n\ntype DialogTriggerProps = Omit<DialogPrimitive.Trigger.Props, 'className' | 'render'> & {\n className?: string;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DialogTrigger = React.forwardRef<HTMLButtonElement, DialogTriggerProps>(\n ({ asChild, children, ...props }, ref) => (\n <DialogPrimitive.Trigger ref={ref} render={asChildRender(asChild, children)} {...props}>\n {asChild ? undefined : children}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'DialogTrigger';\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n HTMLDivElement,\n Omit<DialogPrimitive.Backdrop.Props, 'className'> & { className?: string }\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Backdrop\n ref={ref}\n className={cn(\n `\n fixed inset-0 z-50 bg-berget-dialog-overlay-bg transition-opacity\n duration-200\n data-ending-style:opacity-0\n data-starting-style:opacity-0\n `,\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = 'DialogOverlay';\n\nconst DialogContent = React.forwardRef<\n HTMLDivElement,\n Omit<DialogPrimitive.Popup.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Popup\n ref={ref}\n className={cn(\n `\n fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-[-50%]\n gap-4 rounded-berget-sm border border-berget-dialog-border\n bg-berget-dialog-bg p-6 shadow-berget-lg\n transition-[opacity,transform] duration-200\n data-ending-style:scale-95 data-ending-style:opacity-0\n data-starting-style:scale-95 data-starting-style:opacity-0\n `,\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close\n className=\"\n focus:ring-berget-focus-ring\n absolute top-4 right-4 rounded-berget-xs opacity-70\n ring-offset-berget-dialog-bg transition-opacity\n hover:opacity-100\n focus:ring-2 focus:ring-offset-2 focus:outline-none\n disabled:pointer-events-none\n data-open:bg-berget-muted data-open:text-berget-muted-foreground\n \"\n >\n <X className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Popup>\n </DialogPortal>\n));\nDialogContent.displayName = 'DialogContent';\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n `\n flex flex-col gap-1.5 text-center\n sm:text-left\n `,\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n `\n flex flex-col-reverse gap-2\n sm:flex-row sm:justify-end\n `,\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n HTMLHeadingElement,\n Omit<DialogPrimitive.Title.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n render={<Typography variant=\"h5\" color=\"default\" as=\"h2\" className={className} />}\n {...props}\n >\n {children}\n </DialogPrimitive.Title>\n));\nDialogTitle.displayName = 'DialogTitle';\n\nconst DialogDescription = React.forwardRef<\n HTMLParagraphElement,\n Omit<DialogPrimitive.Description.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n render={<Typography variant=\"small\" color=\"muted\" className={className} />}\n {...props}\n >\n {children}\n </DialogPrimitive.Description>\n));\nDialogDescription.displayName = 'DialogDescription';\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;;;AASA,MAAMA,WAASC,OAAgB;AAQ/B,MAAM,gBAAgB,MAAM,YACzB,EAAE,SAAS,UAAU,GAAG,SAAS,QAChC,oBAACA,OAAgB,SAAjB;CAA8B;CAAK,QAAQ,cAAc,SAAS,QAAQ;CAAG,GAAI;CAC9E,UAAA,UAAU,KAAA,IAAY;AACA,CAAA,CAE7B;AACA,cAAc,cAAc;AAE5B,MAAM,eAAeA,OAAgB;AAErC,MAAM,cAAcA,OAAgB;AAEpC,MAAM,gBAAgB,MAAM,YAGzB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAACA,OAAgB,UAAjB;CACO;CACL,WAAW,GACT;;;;;SAMA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,cAAc,cAAc;AAE5B,MAAM,gBAAgB,MAAM,YAGzB,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,qBAAC,cAAD,EAAA,UAAA,CACE,oBAAC,eAAD,CAAgB,CAAA,GAChB,qBAACA,OAAgB,OAAjB;CACO;CACL,WAAW,GACT;;;;;;;WAQA,SACF;CACA,GAAI;CAbN,UAAA,C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