@bergetai/ui 0.1.79 → 0.1.81
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/index.cjs +512 -396
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -28
- package/dist/index.d.ts +40 -28
- package/dist/index.js +514 -400
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +231 -38
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -75,9 +75,10 @@ __export(index_exports, {
|
|
|
75
75
|
Section: () => Section,
|
|
76
76
|
SectionHeader: () => SectionHeader,
|
|
77
77
|
Select: () => Select2,
|
|
78
|
-
StatCard: () => StatCard,
|
|
79
78
|
Switch: () => Switch,
|
|
80
79
|
TextArea: () => TextArea,
|
|
80
|
+
ThemeProvider: () => ThemeProvider,
|
|
81
|
+
ThemeToggle: () => ThemeToggle,
|
|
81
82
|
Typography: () => Typography,
|
|
82
83
|
alertVariants: () => alertVariants2,
|
|
83
84
|
badgeVariants: () => badgeVariants,
|
|
@@ -93,13 +94,95 @@ __export(index_exports, {
|
|
|
93
94
|
switchRootVariants: () => switchRootVariants,
|
|
94
95
|
switchThumbVariants: () => switchThumbVariants,
|
|
95
96
|
textAreaVariants: () => textAreaVariants,
|
|
96
|
-
typographyVariants: () => typographyVariants
|
|
97
|
+
typographyVariants: () => typographyVariants,
|
|
98
|
+
useTheme: () => useTheme
|
|
97
99
|
});
|
|
98
100
|
module.exports = __toCommonJS(index_exports);
|
|
99
101
|
|
|
100
|
-
// src/components/
|
|
101
|
-
var
|
|
102
|
-
var
|
|
102
|
+
// src/components/theme-provider/ThemeProvider.tsx
|
|
103
|
+
var React = __toESM(require("react"), 1);
|
|
104
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
105
|
+
var ThemeProviderContext = React.createContext(void 0);
|
|
106
|
+
var STORAGE_KEY = "berget-theme";
|
|
107
|
+
function getSystemTheme() {
|
|
108
|
+
return window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark";
|
|
109
|
+
}
|
|
110
|
+
function resolveTheme(theme) {
|
|
111
|
+
return {
|
|
112
|
+
theme,
|
|
113
|
+
resolvedTheme: theme === "system" ? getSystemTheme() : theme
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
var ThemeProvider = React.memo(function ThemeProvider2({
|
|
117
|
+
children,
|
|
118
|
+
theme: controlledTheme
|
|
119
|
+
}) {
|
|
120
|
+
const isControlled = controlledTheme !== void 0;
|
|
121
|
+
const [state, setState] = React.useState(() => {
|
|
122
|
+
if (isControlled) {
|
|
123
|
+
return resolveTheme(controlledTheme);
|
|
124
|
+
}
|
|
125
|
+
let theme = "system";
|
|
126
|
+
try {
|
|
127
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
128
|
+
if (stored && ["dark", "light", "system"].includes(stored)) {
|
|
129
|
+
theme = stored;
|
|
130
|
+
}
|
|
131
|
+
} catch {
|
|
132
|
+
}
|
|
133
|
+
return resolveTheme(theme);
|
|
134
|
+
});
|
|
135
|
+
React.useEffect(() => {
|
|
136
|
+
document.documentElement.setAttribute("data-theme", state.resolvedTheme);
|
|
137
|
+
}, [state.resolvedTheme]);
|
|
138
|
+
React.useEffect(() => {
|
|
139
|
+
if (isControlled && state.theme !== controlledTheme) {
|
|
140
|
+
setState(resolveTheme(controlledTheme));
|
|
141
|
+
}
|
|
142
|
+
}, [isControlled, controlledTheme, state.theme]);
|
|
143
|
+
const setTheme = React.useCallback(
|
|
144
|
+
(theme) => {
|
|
145
|
+
if (isControlled) return;
|
|
146
|
+
const next = resolveTheme(theme);
|
|
147
|
+
setState(next);
|
|
148
|
+
try {
|
|
149
|
+
localStorage.setItem(STORAGE_KEY, theme);
|
|
150
|
+
} catch {
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
[isControlled]
|
|
154
|
+
);
|
|
155
|
+
React.useEffect(() => {
|
|
156
|
+
if (isControlled || state.theme !== "system") return;
|
|
157
|
+
const media = window.matchMedia("(prefers-color-scheme: light)");
|
|
158
|
+
const handler = () => {
|
|
159
|
+
setState((prev) => ({
|
|
160
|
+
...prev,
|
|
161
|
+
resolvedTheme: getSystemTheme()
|
|
162
|
+
}));
|
|
163
|
+
};
|
|
164
|
+
media.addEventListener("change", handler);
|
|
165
|
+
return () => media.removeEventListener("change", handler);
|
|
166
|
+
}, [isControlled, state.theme]);
|
|
167
|
+
const value = React.useMemo(
|
|
168
|
+
() => ({
|
|
169
|
+
...state,
|
|
170
|
+
setTheme
|
|
171
|
+
}),
|
|
172
|
+
[state, setTheme]
|
|
173
|
+
);
|
|
174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeProviderContext.Provider, { value, children });
|
|
175
|
+
});
|
|
176
|
+
function useTheme() {
|
|
177
|
+
const context = React.useContext(ThemeProviderContext);
|
|
178
|
+
if (!context) {
|
|
179
|
+
throw new Error("useTheme must be used within a ThemeProvider.");
|
|
180
|
+
}
|
|
181
|
+
return context;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// src/components/theme-provider/ThemeToggle.tsx
|
|
185
|
+
var React2 = __toESM(require("react"), 1);
|
|
103
186
|
|
|
104
187
|
// src/lib/utils.ts
|
|
105
188
|
var import_clsx = require("clsx");
|
|
@@ -123,11 +206,102 @@ function cn(...inputs) {
|
|
|
123
206
|
return twMerge((0, import_clsx.clsx)(inputs));
|
|
124
207
|
}
|
|
125
208
|
|
|
209
|
+
// src/components/theme-provider/ThemeToggle.tsx
|
|
210
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
211
|
+
var ThemeToggle = React2.forwardRef(
|
|
212
|
+
({ className, label = "Toggle theme", size = "md", ...props }, ref) => {
|
|
213
|
+
const { theme, resolvedTheme, setTheme } = useTheme();
|
|
214
|
+
const toggle = React2.useCallback(() => {
|
|
215
|
+
setTheme(theme === "dark" ? "light" : "dark");
|
|
216
|
+
}, [theme, setTheme]);
|
|
217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
218
|
+
"button",
|
|
219
|
+
{
|
|
220
|
+
ref,
|
|
221
|
+
type: "button",
|
|
222
|
+
onClick: toggle,
|
|
223
|
+
"aria-label": label,
|
|
224
|
+
title: `Toggle ${resolvedTheme === "dark" ? "light" : "dark"} mode`,
|
|
225
|
+
className: cn(
|
|
226
|
+
"relative inline-flex items-center justify-center rounded-full cursor-pointer",
|
|
227
|
+
"transition-colors duration-200",
|
|
228
|
+
"hover:bg-berget-surface-hover",
|
|
229
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-berget-ring",
|
|
230
|
+
size === "sm" && "w-7 h-7",
|
|
231
|
+
size === "md" && "w-9 h-9",
|
|
232
|
+
size === "lg" && "w-11 h-11",
|
|
233
|
+
className
|
|
234
|
+
),
|
|
235
|
+
...props,
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
238
|
+
"svg",
|
|
239
|
+
{
|
|
240
|
+
className: cn(
|
|
241
|
+
"absolute transition-all duration-200",
|
|
242
|
+
resolvedTheme === "dark" ? "opacity-100 scale-100 rotate-0" : "opacity-0 scale-0 -rotate-90",
|
|
243
|
+
size === "sm" && "w-3.5 h-3.5",
|
|
244
|
+
size === "md" && "w-4 h-4",
|
|
245
|
+
size === "lg" && "w-5 h-5"
|
|
246
|
+
),
|
|
247
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
248
|
+
fill: "none",
|
|
249
|
+
viewBox: "0 0 24 24",
|
|
250
|
+
stroke: "currentColor",
|
|
251
|
+
strokeWidth: 2,
|
|
252
|
+
children: [
|
|
253
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "12", r: "4" }),
|
|
254
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
255
|
+
"path",
|
|
256
|
+
{
|
|
257
|
+
strokeLinecap: "round",
|
|
258
|
+
d: "M12 2v2m0 16v2m9-10h-2M5 12H3m15.36 6.36-1.41-1.41M6.05 6.05 4.64 4.64m12.72 0-1.41 1.41M6.05 17.95l-1.41 1.41"
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
),
|
|
264
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
265
|
+
"svg",
|
|
266
|
+
{
|
|
267
|
+
className: cn(
|
|
268
|
+
"absolute transition-all duration-200",
|
|
269
|
+
resolvedTheme === "light" ? "opacity-100 scale-100 rotate-0" : "opacity-0 scale-0 rotate-90",
|
|
270
|
+
size === "sm" && "w-3.5 h-3.5",
|
|
271
|
+
size === "md" && "w-4 h-4",
|
|
272
|
+
size === "lg" && "w-5 h-5"
|
|
273
|
+
),
|
|
274
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
275
|
+
fill: "none",
|
|
276
|
+
viewBox: "0 0 24 24",
|
|
277
|
+
stroke: "currentColor",
|
|
278
|
+
strokeWidth: 2,
|
|
279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
280
|
+
"path",
|
|
281
|
+
{
|
|
282
|
+
strokeLinecap: "round",
|
|
283
|
+
strokeLinejoin: "round",
|
|
284
|
+
d: "M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
}
|
|
288
|
+
)
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
ThemeToggle.displayName = "ThemeToggle";
|
|
295
|
+
|
|
296
|
+
// src/components/button/Button.tsx
|
|
297
|
+
var React5 = __toESM(require("react"), 1);
|
|
298
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
299
|
+
|
|
126
300
|
// src/primitives/button.tsx
|
|
127
|
-
var
|
|
301
|
+
var React3 = __toESM(require("react"), 1);
|
|
128
302
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
129
303
|
var import_class_variance_authority = require("class-variance-authority");
|
|
130
|
-
var
|
|
304
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
131
305
|
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
132
306
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
133
307
|
{
|
|
@@ -153,23 +327,23 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
153
327
|
}
|
|
154
328
|
}
|
|
155
329
|
);
|
|
156
|
-
var Button =
|
|
330
|
+
var Button = React3.forwardRef(
|
|
157
331
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
158
332
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
159
|
-
return /* @__PURE__ */ (0,
|
|
333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Comp, { className: cn(buttonVariants({ variant, size }), className), ref, ...props });
|
|
160
334
|
}
|
|
161
335
|
);
|
|
162
336
|
Button.displayName = "Button";
|
|
163
337
|
|
|
164
338
|
// src/components/icon/Icon.tsx
|
|
165
|
-
var
|
|
166
|
-
var
|
|
339
|
+
var React4 = __toESM(require("react"), 1);
|
|
340
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
167
341
|
var iconStrokeMap = {
|
|
168
342
|
16: 1.4,
|
|
169
343
|
24: 1.6,
|
|
170
344
|
32: 1.8
|
|
171
345
|
};
|
|
172
|
-
var Icon =
|
|
346
|
+
var Icon = React4.forwardRef(
|
|
173
347
|
({
|
|
174
348
|
icon: IconComponent,
|
|
175
349
|
size,
|
|
@@ -181,7 +355,7 @@ var Icon = React2.forwardRef(
|
|
|
181
355
|
const strokeWidth = iconStrokeMap[size];
|
|
182
356
|
const sizeClass = size === 16 ? "w-4 h-4" : size === 24 ? "w-6 h-6" : "w-8 h-8";
|
|
183
357
|
const ariaAttributes = ariaLabel ? { "aria-label": ariaLabel } : { "aria-hidden": ariaHidden };
|
|
184
|
-
return /* @__PURE__ */ (0,
|
|
358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
185
359
|
IconComponent,
|
|
186
360
|
{
|
|
187
361
|
ref,
|
|
@@ -197,7 +371,7 @@ Icon.displayName = "Icon";
|
|
|
197
371
|
|
|
198
372
|
// src/components/button/Button.tsx
|
|
199
373
|
var import_lucide_react = require("lucide-react");
|
|
200
|
-
var
|
|
374
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
201
375
|
var buttonVariants2 = (0, import_class_variance_authority2.cva)(
|
|
202
376
|
"inline-flex items-center justify-center whitespace-nowrap rounded-full text-sm font-medium cursor-pointer transition-all duration-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-berget-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
203
377
|
{
|
|
@@ -228,7 +402,7 @@ var buttonVariants2 = (0, import_class_variance_authority2.cva)(
|
|
|
228
402
|
}
|
|
229
403
|
}
|
|
230
404
|
);
|
|
231
|
-
var Button2 =
|
|
405
|
+
var Button2 = React5.forwardRef(
|
|
232
406
|
({
|
|
233
407
|
className,
|
|
234
408
|
variant,
|
|
@@ -243,7 +417,7 @@ var Button2 = React3.forwardRef(
|
|
|
243
417
|
const isHighlight = variant === "highlight";
|
|
244
418
|
const isIcon = variant === "icon";
|
|
245
419
|
if (asChild) {
|
|
246
|
-
return /* @__PURE__ */ (0,
|
|
420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
247
421
|
Button,
|
|
248
422
|
{
|
|
249
423
|
className: cn(buttonVariants2({ variant, size, width }), className),
|
|
@@ -257,7 +431,7 @@ var Button2 = React3.forwardRef(
|
|
|
257
431
|
}
|
|
258
432
|
);
|
|
259
433
|
}
|
|
260
|
-
return /* @__PURE__ */ (0,
|
|
434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
261
435
|
Button,
|
|
262
436
|
{
|
|
263
437
|
className: cn(buttonVariants2({ variant, size, width }), className),
|
|
@@ -267,11 +441,11 @@ var Button2 = React3.forwardRef(
|
|
|
267
441
|
"aria-busy": isLoading || void 0,
|
|
268
442
|
...props,
|
|
269
443
|
children: [
|
|
270
|
-
isHighlight && /* @__PURE__ */ (0,
|
|
271
|
-
/* @__PURE__ */ (0,
|
|
272
|
-
/* @__PURE__ */ (0,
|
|
444
|
+
isHighlight && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
445
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "absolute inset-0 top-[1px] h-[calc(100%-1px)] w-full bg-[radial-gradient(100%_100%_at_49.87%_0%,color-mix(in_oklch,var(--berget-foreground)_4%,transparent)_0%,transparent_100%)] pointer-events-none" }),
|
|
446
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "absolute top-0 left-0 right-0 h-[1px] bg-[radial-gradient(55.66%_112.5%_at_50%_0%,var(--berget-foreground)_0%,transparent_92.4%)] opacity-[0.3] pointer-events-none" })
|
|
273
447
|
] }),
|
|
274
|
-
/* @__PURE__ */ (0,
|
|
448
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
275
449
|
"span",
|
|
276
450
|
{
|
|
277
451
|
className: cn(
|
|
@@ -279,8 +453,8 @@ var Button2 = React3.forwardRef(
|
|
|
279
453
|
!isIcon && "gap-2",
|
|
280
454
|
isHighlight && "relative z-10"
|
|
281
455
|
),
|
|
282
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
283
|
-
/* @__PURE__ */ (0,
|
|
456
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
457
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { icon: import_lucide_react.Loader2, size: 16, className: "animate-spin", "aria-hidden": true }),
|
|
284
458
|
!isIcon && children
|
|
285
459
|
] }) : children
|
|
286
460
|
}
|
|
@@ -293,9 +467,9 @@ var Button2 = React3.forwardRef(
|
|
|
293
467
|
Button2.displayName = "Button";
|
|
294
468
|
|
|
295
469
|
// src/components/typography/Typography.tsx
|
|
296
|
-
var
|
|
470
|
+
var React6 = __toESM(require("react"), 1);
|
|
297
471
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
298
|
-
var
|
|
472
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
299
473
|
var typographyVariants = (0, import_class_variance_authority3.cva)("", {
|
|
300
474
|
variants: {
|
|
301
475
|
variant: {
|
|
@@ -340,10 +514,10 @@ var defaultElementMap = {
|
|
|
340
514
|
mono: "p",
|
|
341
515
|
code: "span"
|
|
342
516
|
};
|
|
343
|
-
var Typography =
|
|
517
|
+
var Typography = React6.forwardRef(
|
|
344
518
|
({ className, variant = "body", color = "default", as, children, ...props }, ref) => {
|
|
345
519
|
const Component = as ?? defaultElementMap[variant ?? "body"] ?? "p";
|
|
346
|
-
return /* @__PURE__ */ (0,
|
|
520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
347
521
|
Component,
|
|
348
522
|
{
|
|
349
523
|
className: cn(typographyVariants({ variant, color }), className),
|
|
@@ -357,14 +531,14 @@ var Typography = React4.forwardRef(
|
|
|
357
531
|
Typography.displayName = "Typography";
|
|
358
532
|
|
|
359
533
|
// src/components/card/Card.tsx
|
|
360
|
-
var
|
|
534
|
+
var React8 = __toESM(require("react"), 1);
|
|
361
535
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
362
536
|
|
|
363
537
|
// src/primitives/card.tsx
|
|
364
|
-
var
|
|
365
|
-
var
|
|
366
|
-
var Card =
|
|
367
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
538
|
+
var React7 = __toESM(require("react"), 1);
|
|
539
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
540
|
+
var Card = React7.forwardRef(
|
|
541
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
368
542
|
"div",
|
|
369
543
|
{
|
|
370
544
|
ref,
|
|
@@ -374,29 +548,29 @@ var Card = React5.forwardRef(
|
|
|
374
548
|
)
|
|
375
549
|
);
|
|
376
550
|
Card.displayName = "Card";
|
|
377
|
-
var CardHeader =
|
|
378
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
551
|
+
var CardHeader = React7.forwardRef(
|
|
552
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })
|
|
379
553
|
);
|
|
380
554
|
CardHeader.displayName = "CardHeader";
|
|
381
|
-
var CardTitle =
|
|
382
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
555
|
+
var CardTitle = React7.forwardRef(
|
|
556
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { ref, className: cn("text-2xl leading-none tracking-tight", className), ...props })
|
|
383
557
|
);
|
|
384
558
|
CardTitle.displayName = "CardTitle";
|
|
385
|
-
var CardDescription =
|
|
386
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
559
|
+
var CardDescription = React7.forwardRef(
|
|
560
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref, className: cn("text-sm text-muted-foreground", className), ...props })
|
|
387
561
|
);
|
|
388
562
|
CardDescription.displayName = "CardDescription";
|
|
389
|
-
var CardContent =
|
|
390
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
563
|
+
var CardContent = React7.forwardRef(
|
|
564
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref, className: cn("p-6 pt-0", className), ...props })
|
|
391
565
|
);
|
|
392
566
|
CardContent.displayName = "CardContent";
|
|
393
|
-
var CardFooter =
|
|
394
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
567
|
+
var CardFooter = React7.forwardRef(
|
|
568
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref, className: cn("flex items-center p-6 pt-0", className), ...props })
|
|
395
569
|
);
|
|
396
570
|
CardFooter.displayName = "CardFooter";
|
|
397
571
|
|
|
398
572
|
// src/components/card/Card.tsx
|
|
399
|
-
var
|
|
573
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
400
574
|
var cardVariants = (0, import_class_variance_authority4.cva)("rounded-berget-sm", {
|
|
401
575
|
variants: {
|
|
402
576
|
variant: {
|
|
@@ -415,9 +589,9 @@ var cardVariants = (0, import_class_variance_authority4.cva)("rounded-berget-sm"
|
|
|
415
589
|
padding: "md"
|
|
416
590
|
}
|
|
417
591
|
});
|
|
418
|
-
var Card2 =
|
|
592
|
+
var Card2 = React8.forwardRef(
|
|
419
593
|
({ className, variant, padding, children, ...props }, ref) => {
|
|
420
|
-
return /* @__PURE__ */ (0,
|
|
594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
421
595
|
Card,
|
|
422
596
|
{
|
|
423
597
|
ref,
|
|
@@ -431,9 +605,9 @@ var Card2 = React6.forwardRef(
|
|
|
431
605
|
Card2.displayName = "Card";
|
|
432
606
|
|
|
433
607
|
// src/components/badge/Badge.tsx
|
|
434
|
-
var
|
|
608
|
+
var React9 = __toESM(require("react"), 1);
|
|
435
609
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
436
|
-
var
|
|
610
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
437
611
|
var badgeVariants = (0, import_class_variance_authority5.cva)(
|
|
438
612
|
"inline-flex items-center whitespace-nowrap rounded-full transition-colors focus:outline-none focus:ring-1 focus:ring-ring focus:ring-offset-2",
|
|
439
613
|
{
|
|
@@ -466,10 +640,10 @@ var badgeVariants = (0, import_class_variance_authority5.cva)(
|
|
|
466
640
|
}
|
|
467
641
|
}
|
|
468
642
|
);
|
|
469
|
-
var Badge =
|
|
643
|
+
var Badge = React9.forwardRef(
|
|
470
644
|
({ className, variant, status, size, icon, iconGap = 2, children, ...props }, ref) => {
|
|
471
|
-
return /* @__PURE__ */ (0,
|
|
472
|
-
icon && /* @__PURE__ */ (0,
|
|
645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn(badgeVariants({ variant, status, size }), className), ref, ...props, children: [
|
|
646
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { marginRight: children ? `${iconGap * 0.25}rem` : "0" }, children: icon }),
|
|
473
647
|
children
|
|
474
648
|
] });
|
|
475
649
|
}
|
|
@@ -477,13 +651,13 @@ var Badge = React7.forwardRef(
|
|
|
477
651
|
Badge.displayName = "Badge";
|
|
478
652
|
|
|
479
653
|
// src/components/alert/Alert.tsx
|
|
480
|
-
var
|
|
654
|
+
var React11 = __toESM(require("react"), 1);
|
|
481
655
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
482
656
|
|
|
483
657
|
// src/primitives/alert.tsx
|
|
484
|
-
var
|
|
658
|
+
var React10 = __toESM(require("react"), 1);
|
|
485
659
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
486
|
-
var
|
|
660
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
487
661
|
var alertVariants = (0, import_class_variance_authority6.cva)(
|
|
488
662
|
"relative w-full rounded-lg p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4",
|
|
489
663
|
{
|
|
@@ -498,17 +672,17 @@ var alertVariants = (0, import_class_variance_authority6.cva)(
|
|
|
498
672
|
}
|
|
499
673
|
}
|
|
500
674
|
);
|
|
501
|
-
var Alert =
|
|
675
|
+
var Alert = React10.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref, role: "alert", className: cn(alertVariants({ variant }), className), ...props }));
|
|
502
676
|
Alert.displayName = "Alert";
|
|
503
|
-
var AlertTitle =
|
|
504
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
677
|
+
var AlertTitle = React10.forwardRef(
|
|
678
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h5", { ref, className: cn("mb-1 leading-none tracking-tight", className), ...props })
|
|
505
679
|
);
|
|
506
680
|
AlertTitle.displayName = "AlertTitle";
|
|
507
|
-
var AlertDescription =
|
|
681
|
+
var AlertDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref, className: cn("text-sm [&_p]:leading-relaxed", className), ...props }));
|
|
508
682
|
AlertDescription.displayName = "AlertDescription";
|
|
509
683
|
|
|
510
684
|
// src/components/alert/Alert.tsx
|
|
511
|
-
var
|
|
685
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
512
686
|
var alertVariants2 = (0, import_class_variance_authority7.cva)("", {
|
|
513
687
|
variants: {
|
|
514
688
|
variant: {
|
|
@@ -523,20 +697,20 @@ var alertVariants2 = (0, import_class_variance_authority7.cva)("", {
|
|
|
523
697
|
variant: "default"
|
|
524
698
|
}
|
|
525
699
|
});
|
|
526
|
-
var Alert2 =
|
|
527
|
-
({ className, variant, ...props }, ref) => /* @__PURE__ */ (0,
|
|
700
|
+
var Alert2 = React11.forwardRef(
|
|
701
|
+
({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Alert, { ref, className: cn(alertVariants2({ variant }), className), ...props })
|
|
528
702
|
);
|
|
529
703
|
Alert2.displayName = "Alert";
|
|
530
704
|
|
|
531
705
|
// src/components/input/Input.tsx
|
|
532
|
-
var
|
|
706
|
+
var React13 = __toESM(require("react"), 1);
|
|
533
707
|
|
|
534
708
|
// src/primitives/input.tsx
|
|
535
|
-
var
|
|
536
|
-
var
|
|
537
|
-
var Input =
|
|
709
|
+
var React12 = __toESM(require("react"), 1);
|
|
710
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
711
|
+
var Input = React12.forwardRef(
|
|
538
712
|
({ className, type, ...props }, ref) => {
|
|
539
|
-
return /* @__PURE__ */ (0,
|
|
713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
540
714
|
"input",
|
|
541
715
|
{
|
|
542
716
|
type,
|
|
@@ -553,14 +727,14 @@ var Input = React10.forwardRef(
|
|
|
553
727
|
Input.displayName = "Input";
|
|
554
728
|
|
|
555
729
|
// src/components/input/Input.tsx
|
|
556
|
-
var
|
|
557
|
-
var Input2 =
|
|
730
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
731
|
+
var Input2 = React13.forwardRef(
|
|
558
732
|
({ className, icon, actionButton, label, description, error, id, disabled, ...props }, ref) => {
|
|
559
|
-
const generatedId =
|
|
733
|
+
const generatedId = React13.useId();
|
|
560
734
|
const inputId = id || generatedId;
|
|
561
735
|
const errorId = `${inputId}-error`;
|
|
562
736
|
const descriptionId = `${inputId}-description`;
|
|
563
|
-
const inputElement = /* @__PURE__ */ (0,
|
|
737
|
+
const inputElement = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
564
738
|
Input,
|
|
565
739
|
{
|
|
566
740
|
ref,
|
|
@@ -580,8 +754,8 @@ var Input2 = React11.forwardRef(
|
|
|
580
754
|
}
|
|
581
755
|
);
|
|
582
756
|
if (!icon && !actionButton) {
|
|
583
|
-
return /* @__PURE__ */ (0,
|
|
584
|
-
label && /* @__PURE__ */ (0,
|
|
757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
758
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
585
759
|
"label",
|
|
586
760
|
{
|
|
587
761
|
htmlFor: inputId,
|
|
@@ -594,9 +768,9 @@ var Input2 = React11.forwardRef(
|
|
|
594
768
|
}
|
|
595
769
|
),
|
|
596
770
|
inputElement,
|
|
597
|
-
(description || error) && /* @__PURE__ */ (0,
|
|
598
|
-
description && /* @__PURE__ */ (0,
|
|
599
|
-
error && /* @__PURE__ */ (0,
|
|
771
|
+
(description || error) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
772
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Typography, { variant: "xs", color: "muted", id: descriptionId, children: description }),
|
|
773
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
600
774
|
Typography,
|
|
601
775
|
{
|
|
602
776
|
variant: "xs",
|
|
@@ -608,8 +782,8 @@ var Input2 = React11.forwardRef(
|
|
|
608
782
|
] })
|
|
609
783
|
] });
|
|
610
784
|
}
|
|
611
|
-
return /* @__PURE__ */ (0,
|
|
612
|
-
label && /* @__PURE__ */ (0,
|
|
785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
786
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
613
787
|
"label",
|
|
614
788
|
{
|
|
615
789
|
htmlFor: inputId,
|
|
@@ -621,14 +795,14 @@ var Input2 = React11.forwardRef(
|
|
|
621
795
|
children: label
|
|
622
796
|
}
|
|
623
797
|
),
|
|
624
|
-
/* @__PURE__ */ (0,
|
|
625
|
-
icon && /* @__PURE__ */ (0,
|
|
798
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative w-full", children: [
|
|
799
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "absolute left-3 top-1/2 -translate-y-1/2", children: icon }),
|
|
626
800
|
inputElement,
|
|
627
|
-
actionButton && /* @__PURE__ */ (0,
|
|
801
|
+
actionButton && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "absolute right-2 top-1/2 -translate-y-1/2", children: actionButton })
|
|
628
802
|
] }),
|
|
629
|
-
(description || error) && /* @__PURE__ */ (0,
|
|
630
|
-
description && /* @__PURE__ */ (0,
|
|
631
|
-
error && /* @__PURE__ */ (0,
|
|
803
|
+
(description || error) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
804
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Typography, { variant: "xs", color: "muted", id: descriptionId, children: description }),
|
|
805
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Typography, { variant: "xs", id: errorId, className: "text-berget-destructive-foreground", children: error })
|
|
632
806
|
] })
|
|
633
807
|
] });
|
|
634
808
|
}
|
|
@@ -636,17 +810,17 @@ var Input2 = React11.forwardRef(
|
|
|
636
810
|
Input2.displayName = "Input";
|
|
637
811
|
|
|
638
812
|
// src/components/checkbox/Checkbox.tsx
|
|
639
|
-
var
|
|
813
|
+
var React15 = __toESM(require("react"), 1);
|
|
640
814
|
var CheckboxPrimitive2 = __toESM(require("@radix-ui/react-checkbox"), 1);
|
|
641
815
|
var import_lucide_react3 = require("lucide-react");
|
|
642
816
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
643
817
|
|
|
644
818
|
// src/primitives/checkbox.tsx
|
|
645
|
-
var
|
|
819
|
+
var React14 = __toESM(require("react"), 1);
|
|
646
820
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
|
|
647
821
|
var import_lucide_react2 = require("lucide-react");
|
|
648
|
-
var
|
|
649
|
-
var Checkbox =
|
|
822
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
823
|
+
var Checkbox = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
650
824
|
CheckboxPrimitive.Root,
|
|
651
825
|
{
|
|
652
826
|
ref,
|
|
@@ -655,23 +829,23 @@ var Checkbox = React12.forwardRef(({ className, children, ...props }, ref) => /*
|
|
|
655
829
|
className
|
|
656
830
|
),
|
|
657
831
|
...props,
|
|
658
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
832
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CheckboxPrimitive.Indicator, { className: cn("grid place-content-center"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react2.Check, { className: "h-4 w-4" }) })
|
|
659
833
|
}
|
|
660
834
|
));
|
|
661
835
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
662
|
-
var CheckboxIndicator =
|
|
836
|
+
var CheckboxIndicator = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
663
837
|
CheckboxPrimitive.Indicator,
|
|
664
838
|
{
|
|
665
839
|
ref,
|
|
666
840
|
className: cn("grid place-content-center", className),
|
|
667
841
|
...props,
|
|
668
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
842
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react2.Check, { className: "h-4 w-4" })
|
|
669
843
|
}
|
|
670
844
|
));
|
|
671
845
|
CheckboxIndicator.displayName = CheckboxPrimitive.Indicator.displayName;
|
|
672
846
|
|
|
673
847
|
// src/components/checkbox/Checkbox.tsx
|
|
674
|
-
var
|
|
848
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
675
849
|
var checkboxVariants = (0, import_class_variance_authority8.cva)(
|
|
676
850
|
"inline-flex items-center justify-center rounded-md transition-all duration-200 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
677
851
|
{
|
|
@@ -693,13 +867,13 @@ var checkboxVariants = (0, import_class_variance_authority8.cva)(
|
|
|
693
867
|
}
|
|
694
868
|
}
|
|
695
869
|
);
|
|
696
|
-
var Checkbox2 =
|
|
870
|
+
var Checkbox2 = React15.forwardRef(
|
|
697
871
|
({ className, variant, size, label, description, error, id, disabled, ...props }, ref) => {
|
|
698
|
-
const generatedId =
|
|
872
|
+
const generatedId = React15.useId();
|
|
699
873
|
const checkboxId = id || generatedId;
|
|
700
874
|
const errorId = `${checkboxId}-error`;
|
|
701
|
-
return /* @__PURE__ */ (0,
|
|
702
|
-
/* @__PURE__ */ (0,
|
|
875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
876
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "relative flex items-start pt-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
703
877
|
Checkbox,
|
|
704
878
|
{
|
|
705
879
|
ref,
|
|
@@ -714,7 +888,7 @@ var Checkbox2 = React13.forwardRef(
|
|
|
714
888
|
className
|
|
715
889
|
),
|
|
716
890
|
...props,
|
|
717
|
-
children: /* @__PURE__ */ (0,
|
|
891
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CheckboxPrimitive2.Indicator, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
718
892
|
import_lucide_react3.Check,
|
|
719
893
|
{
|
|
720
894
|
className: "h-4 w-4 text-current stroke-current",
|
|
@@ -723,8 +897,8 @@ var Checkbox2 = React13.forwardRef(
|
|
|
723
897
|
) })
|
|
724
898
|
}
|
|
725
899
|
) }),
|
|
726
|
-
(label || description || error) && /* @__PURE__ */ (0,
|
|
727
|
-
label && /* @__PURE__ */ (0,
|
|
900
|
+
(label || description || error) && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
901
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
728
902
|
"label",
|
|
729
903
|
{
|
|
730
904
|
htmlFor: checkboxId,
|
|
@@ -736,8 +910,8 @@ var Checkbox2 = React13.forwardRef(
|
|
|
736
910
|
children: label
|
|
737
911
|
}
|
|
738
912
|
),
|
|
739
|
-
description && /* @__PURE__ */ (0,
|
|
740
|
-
error && /* @__PURE__ */ (0,
|
|
913
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Typography, { variant: "xs", color: "muted", children: description }),
|
|
914
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Typography, { variant: "xs", id: errorId, className: "text-berget-destructive-foreground", children: error })
|
|
741
915
|
] })
|
|
742
916
|
] });
|
|
743
917
|
}
|
|
@@ -745,10 +919,10 @@ var Checkbox2 = React13.forwardRef(
|
|
|
745
919
|
Checkbox2.displayName = "Checkbox";
|
|
746
920
|
|
|
747
921
|
// src/components/switch/Switch.tsx
|
|
748
|
-
var
|
|
922
|
+
var React16 = __toESM(require("react"), 1);
|
|
749
923
|
var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"), 1);
|
|
750
924
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
751
|
-
var
|
|
925
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
752
926
|
var switchRootVariants = (0, import_class_variance_authority9.cva)(
|
|
753
927
|
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-berget-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",
|
|
754
928
|
{
|
|
@@ -785,13 +959,13 @@ var switchThumbVariants = (0, import_class_variance_authority9.cva)(
|
|
|
785
959
|
}
|
|
786
960
|
}
|
|
787
961
|
);
|
|
788
|
-
var Switch =
|
|
962
|
+
var Switch = React16.forwardRef(
|
|
789
963
|
({ className, variant, size, label, description, error, id, disabled, ...props }, ref) => {
|
|
790
|
-
const generatedId =
|
|
964
|
+
const generatedId = React16.useId();
|
|
791
965
|
const switchId = id || generatedId;
|
|
792
966
|
const errorId = `${switchId}-error`;
|
|
793
|
-
return /* @__PURE__ */ (0,
|
|
794
|
-
/* @__PURE__ */ (0,
|
|
967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
968
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
795
969
|
SwitchPrimitives.Root,
|
|
796
970
|
{
|
|
797
971
|
ref,
|
|
@@ -805,11 +979,11 @@ var Switch = React14.forwardRef(
|
|
|
805
979
|
className
|
|
806
980
|
),
|
|
807
981
|
...props,
|
|
808
|
-
children: /* @__PURE__ */ (0,
|
|
982
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SwitchPrimitives.Thumb, { className: cn(switchThumbVariants({ size })) })
|
|
809
983
|
}
|
|
810
984
|
),
|
|
811
|
-
(label || description || error) && /* @__PURE__ */ (0,
|
|
812
|
-
label && /* @__PURE__ */ (0,
|
|
985
|
+
(label || description || error) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
986
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
813
987
|
"label",
|
|
814
988
|
{
|
|
815
989
|
htmlFor: switchId,
|
|
@@ -820,8 +994,8 @@ var Switch = React14.forwardRef(
|
|
|
820
994
|
children: label
|
|
821
995
|
}
|
|
822
996
|
),
|
|
823
|
-
description && /* @__PURE__ */ (0,
|
|
824
|
-
error && /* @__PURE__ */ (0,
|
|
997
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "xs", color: "muted", children: description }),
|
|
998
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "xs", id: errorId, className: "text-berget-destructive-foreground", children: error })
|
|
825
999
|
] })
|
|
826
1000
|
] });
|
|
827
1001
|
}
|
|
@@ -829,17 +1003,17 @@ var Switch = React14.forwardRef(
|
|
|
829
1003
|
Switch.displayName = "Switch";
|
|
830
1004
|
|
|
831
1005
|
// src/components/select/Select.tsx
|
|
832
|
-
var
|
|
1006
|
+
var React18 = __toESM(require("react"), 1);
|
|
833
1007
|
var import_class_variance_authority10 = require("class-variance-authority");
|
|
834
1008
|
|
|
835
1009
|
// src/primitives/select.tsx
|
|
836
|
-
var
|
|
1010
|
+
var React17 = __toESM(require("react"), 1);
|
|
837
1011
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
|
|
838
1012
|
var import_lucide_react4 = require("lucide-react");
|
|
839
|
-
var
|
|
1013
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
840
1014
|
var Select = SelectPrimitive.Root;
|
|
841
1015
|
var SelectValue = SelectPrimitive.Value;
|
|
842
|
-
var SelectTrigger =
|
|
1016
|
+
var SelectTrigger = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
843
1017
|
SelectPrimitive.Trigger,
|
|
844
1018
|
{
|
|
845
1019
|
ref,
|
|
@@ -850,32 +1024,32 @@ var SelectTrigger = React15.forwardRef(({ className, children, ...props }, ref)
|
|
|
850
1024
|
...props,
|
|
851
1025
|
children: [
|
|
852
1026
|
children,
|
|
853
|
-
/* @__PURE__ */ (0,
|
|
1027
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react4.ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
854
1028
|
]
|
|
855
1029
|
}
|
|
856
1030
|
));
|
|
857
1031
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
858
|
-
var SelectScrollUpButton =
|
|
1032
|
+
var SelectScrollUpButton = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
859
1033
|
SelectPrimitive.ScrollUpButton,
|
|
860
1034
|
{
|
|
861
1035
|
ref,
|
|
862
1036
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
863
1037
|
...props,
|
|
864
|
-
children: /* @__PURE__ */ (0,
|
|
1038
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react4.ChevronUp, { className: "h-4 w-4" })
|
|
865
1039
|
}
|
|
866
1040
|
));
|
|
867
1041
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
868
|
-
var SelectScrollDownButton =
|
|
1042
|
+
var SelectScrollDownButton = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
869
1043
|
SelectPrimitive.ScrollDownButton,
|
|
870
1044
|
{
|
|
871
1045
|
ref,
|
|
872
1046
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
873
1047
|
...props,
|
|
874
|
-
children: /* @__PURE__ */ (0,
|
|
1048
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react4.ChevronDown, { className: "h-4 w-4" })
|
|
875
1049
|
}
|
|
876
1050
|
));
|
|
877
1051
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
878
|
-
var SelectContent =
|
|
1052
|
+
var SelectContent = React17.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
879
1053
|
SelectPrimitive.Content,
|
|
880
1054
|
{
|
|
881
1055
|
ref,
|
|
@@ -887,8 +1061,8 @@ var SelectContent = React15.forwardRef(({ className, children, position = "poppe
|
|
|
887
1061
|
position,
|
|
888
1062
|
...props,
|
|
889
1063
|
children: [
|
|
890
|
-
/* @__PURE__ */ (0,
|
|
891
|
-
/* @__PURE__ */ (0,
|
|
1064
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectScrollUpButton, {}),
|
|
1065
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
892
1066
|
SelectPrimitive.Viewport,
|
|
893
1067
|
{
|
|
894
1068
|
className: cn(
|
|
@@ -898,12 +1072,12 @@ var SelectContent = React15.forwardRef(({ className, children, position = "poppe
|
|
|
898
1072
|
children
|
|
899
1073
|
}
|
|
900
1074
|
),
|
|
901
|
-
/* @__PURE__ */ (0,
|
|
1075
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectScrollDownButton, {})
|
|
902
1076
|
]
|
|
903
1077
|
}
|
|
904
1078
|
) }));
|
|
905
1079
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
906
|
-
var SelectLabel =
|
|
1080
|
+
var SelectLabel = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
907
1081
|
SelectPrimitive.Label,
|
|
908
1082
|
{
|
|
909
1083
|
ref,
|
|
@@ -912,7 +1086,7 @@ var SelectLabel = React15.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
912
1086
|
}
|
|
913
1087
|
));
|
|
914
1088
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
915
|
-
var SelectItem =
|
|
1089
|
+
var SelectItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
916
1090
|
SelectPrimitive.Item,
|
|
917
1091
|
{
|
|
918
1092
|
ref,
|
|
@@ -922,13 +1096,13 @@ var SelectItem = React15.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
922
1096
|
),
|
|
923
1097
|
...props,
|
|
924
1098
|
children: [
|
|
925
|
-
/* @__PURE__ */ (0,
|
|
926
|
-
/* @__PURE__ */ (0,
|
|
1099
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react4.Check, { className: "h-4 w-4" }) }) }),
|
|
1100
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectPrimitive.ItemText, { children })
|
|
927
1101
|
]
|
|
928
1102
|
}
|
|
929
1103
|
));
|
|
930
1104
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
931
|
-
var SelectSeparator =
|
|
1105
|
+
var SelectSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
932
1106
|
SelectPrimitive.Separator,
|
|
933
1107
|
{
|
|
934
1108
|
ref,
|
|
@@ -939,7 +1113,7 @@ var SelectSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
939
1113
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
940
1114
|
|
|
941
1115
|
// src/components/select/Select.tsx
|
|
942
|
-
var
|
|
1116
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
943
1117
|
var selectVariants = (0, import_class_variance_authority10.cva)(
|
|
944
1118
|
"flex w-full items-center justify-between rounded-berget-xs border bg-card px-4 py-3 text-sm transition-colors duration-200 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:border-berget-form-focus-border disabled:cursor-not-allowed disabled:opacity-50",
|
|
945
1119
|
{
|
|
@@ -962,7 +1136,7 @@ var selectVariants = (0, import_class_variance_authority10.cva)(
|
|
|
962
1136
|
}
|
|
963
1137
|
}
|
|
964
1138
|
);
|
|
965
|
-
var Select2 =
|
|
1139
|
+
var Select2 = React18.forwardRef(
|
|
966
1140
|
({
|
|
967
1141
|
className,
|
|
968
1142
|
variant,
|
|
@@ -980,12 +1154,12 @@ var Select2 = React16.forwardRef(
|
|
|
980
1154
|
name,
|
|
981
1155
|
required
|
|
982
1156
|
}, ref) => {
|
|
983
|
-
const generatedId =
|
|
1157
|
+
const generatedId = React18.useId();
|
|
984
1158
|
const selectId = id || generatedId;
|
|
985
1159
|
const errorId = `${selectId}-error`;
|
|
986
1160
|
const descriptionId = `${selectId}-description`;
|
|
987
|
-
return /* @__PURE__ */ (0,
|
|
988
|
-
label && /* @__PURE__ */ (0,
|
|
1161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
1162
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
989
1163
|
"label",
|
|
990
1164
|
{
|
|
991
1165
|
htmlFor: selectId,
|
|
@@ -997,7 +1171,7 @@ var Select2 = React16.forwardRef(
|
|
|
997
1171
|
children: label
|
|
998
1172
|
}
|
|
999
1173
|
),
|
|
1000
|
-
/* @__PURE__ */ (0,
|
|
1174
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1001
1175
|
Select,
|
|
1002
1176
|
{
|
|
1003
1177
|
value,
|
|
@@ -1007,7 +1181,7 @@ var Select2 = React16.forwardRef(
|
|
|
1007
1181
|
name,
|
|
1008
1182
|
required,
|
|
1009
1183
|
children: [
|
|
1010
|
-
/* @__PURE__ */ (0,
|
|
1184
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1011
1185
|
SelectTrigger,
|
|
1012
1186
|
{
|
|
1013
1187
|
ref,
|
|
@@ -1019,30 +1193,30 @@ var Select2 = React16.forwardRef(
|
|
|
1019
1193
|
error && "border-berget-destructive-foreground/50 bg-berget-destructive",
|
|
1020
1194
|
className
|
|
1021
1195
|
),
|
|
1022
|
-
children: /* @__PURE__ */ (0,
|
|
1196
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectValue, { placeholder })
|
|
1023
1197
|
}
|
|
1024
1198
|
),
|
|
1025
|
-
/* @__PURE__ */ (0,
|
|
1199
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectContent, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectItem, { value: option.value, disabled: option.disabled, children: option.label }, option.value)) })
|
|
1026
1200
|
]
|
|
1027
1201
|
}
|
|
1028
1202
|
),
|
|
1029
|
-
description && /* @__PURE__ */ (0,
|
|
1030
|
-
error && /* @__PURE__ */ (0,
|
|
1203
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Typography, { variant: "xs", color: "muted", id: descriptionId, children: description }),
|
|
1204
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Typography, { variant: "xs", id: errorId, className: "text-berget-destructive-foreground", children: error })
|
|
1031
1205
|
] });
|
|
1032
1206
|
}
|
|
1033
1207
|
);
|
|
1034
1208
|
Select2.displayName = "Select";
|
|
1035
1209
|
|
|
1036
1210
|
// src/components/text-area/TextArea.tsx
|
|
1037
|
-
var
|
|
1211
|
+
var React20 = __toESM(require("react"), 1);
|
|
1038
1212
|
var import_class_variance_authority11 = require("class-variance-authority");
|
|
1039
1213
|
|
|
1040
1214
|
// src/primitives/textarea.tsx
|
|
1041
|
-
var
|
|
1042
|
-
var
|
|
1043
|
-
var Textarea =
|
|
1215
|
+
var React19 = __toESM(require("react"), 1);
|
|
1216
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1217
|
+
var Textarea = React19.forwardRef(
|
|
1044
1218
|
({ className, ...props }, ref) => {
|
|
1045
|
-
return /* @__PURE__ */ (0,
|
|
1219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1046
1220
|
"textarea",
|
|
1047
1221
|
{
|
|
1048
1222
|
className: cn(
|
|
@@ -1058,7 +1232,7 @@ var Textarea = React17.forwardRef(
|
|
|
1058
1232
|
Textarea.displayName = "Textarea";
|
|
1059
1233
|
|
|
1060
1234
|
// src/components/text-area/TextArea.tsx
|
|
1061
|
-
var
|
|
1235
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1062
1236
|
var textAreaVariants = (0, import_class_variance_authority11.cva)(
|
|
1063
1237
|
"rounded-berget-xs bg-card px-4 py-3 transition-colors duration-200 focus-visible:border-berget-form-focus-border focus-visible:ring-0 focus-visible:ring-offset-0 resize-y",
|
|
1064
1238
|
{
|
|
@@ -1081,7 +1255,7 @@ var textAreaVariants = (0, import_class_variance_authority11.cva)(
|
|
|
1081
1255
|
}
|
|
1082
1256
|
}
|
|
1083
1257
|
);
|
|
1084
|
-
var TextArea =
|
|
1258
|
+
var TextArea = React20.forwardRef(
|
|
1085
1259
|
({
|
|
1086
1260
|
className,
|
|
1087
1261
|
variant,
|
|
@@ -1101,13 +1275,13 @@ var TextArea = React18.forwardRef(
|
|
|
1101
1275
|
actionButton,
|
|
1102
1276
|
...props
|
|
1103
1277
|
}, ref) => {
|
|
1104
|
-
const generatedId =
|
|
1278
|
+
const generatedId = React20.useId();
|
|
1105
1279
|
const textareaId = id || generatedId;
|
|
1106
1280
|
const errorId = `${textareaId}-error`;
|
|
1107
1281
|
const descriptionId = `${textareaId}-description`;
|
|
1108
1282
|
const characterCount = typeof value === "string" ? value.length : 0;
|
|
1109
|
-
return /* @__PURE__ */ (0,
|
|
1110
|
-
label && /* @__PURE__ */ (0,
|
|
1283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
1284
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1111
1285
|
"label",
|
|
1112
1286
|
{
|
|
1113
1287
|
htmlFor: textareaId,
|
|
@@ -1119,9 +1293,9 @@ var TextArea = React18.forwardRef(
|
|
|
1119
1293
|
children: label
|
|
1120
1294
|
}
|
|
1121
1295
|
),
|
|
1122
|
-
/* @__PURE__ */ (0,
|
|
1123
|
-
icon && /* @__PURE__ */ (0,
|
|
1124
|
-
/* @__PURE__ */ (0,
|
|
1296
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative", children: [
|
|
1297
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "absolute left-2 top-1/2 -translate-y-1/2", children: icon }),
|
|
1298
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1125
1299
|
Textarea,
|
|
1126
1300
|
{
|
|
1127
1301
|
ref,
|
|
@@ -1146,13 +1320,13 @@ var TextArea = React18.forwardRef(
|
|
|
1146
1320
|
...props
|
|
1147
1321
|
}
|
|
1148
1322
|
),
|
|
1149
|
-
secondaryIcon && /* @__PURE__ */ (0,
|
|
1150
|
-
actionButton && /* @__PURE__ */ (0,
|
|
1323
|
+
secondaryIcon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "absolute right-12 top-1/2 -translate-y-1/2", children: secondaryIcon }),
|
|
1324
|
+
actionButton && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "absolute right-2 top-1/2 -translate-y-1/2", children: actionButton })
|
|
1151
1325
|
] }),
|
|
1152
|
-
(description || error || showCount && maxLength) && /* @__PURE__ */ (0,
|
|
1153
|
-
description && /* @__PURE__ */ (0,
|
|
1154
|
-
(error || showCount && maxLength) && /* @__PURE__ */ (0,
|
|
1155
|
-
showCount && maxLength && /* @__PURE__ */ (0,
|
|
1326
|
+
(description || error || showCount && maxLength) && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1327
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "xs", color: "muted", id: descriptionId, children: description }),
|
|
1328
|
+
(error || showCount && maxLength) && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2 ml-auto", children: [
|
|
1329
|
+
showCount && maxLength && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1156
1330
|
Typography,
|
|
1157
1331
|
{
|
|
1158
1332
|
variant: "xs",
|
|
@@ -1166,7 +1340,7 @@ var TextArea = React18.forwardRef(
|
|
|
1166
1340
|
]
|
|
1167
1341
|
}
|
|
1168
1342
|
),
|
|
1169
|
-
error && /* @__PURE__ */ (0,
|
|
1343
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1170
1344
|
Typography,
|
|
1171
1345
|
{
|
|
1172
1346
|
variant: "xs",
|
|
@@ -1183,14 +1357,14 @@ var TextArea = React18.forwardRef(
|
|
|
1183
1357
|
TextArea.displayName = "TextArea";
|
|
1184
1358
|
|
|
1185
1359
|
// src/primitives/label.tsx
|
|
1186
|
-
var
|
|
1360
|
+
var React21 = __toESM(require("react"), 1);
|
|
1187
1361
|
var LabelPrimitive = __toESM(require("@radix-ui/react-label"), 1);
|
|
1188
1362
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
1189
|
-
var
|
|
1363
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1190
1364
|
var labelVariants = (0, import_class_variance_authority12.cva)(
|
|
1191
1365
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
1192
1366
|
);
|
|
1193
|
-
var Label2 =
|
|
1367
|
+
var Label2 = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LabelPrimitive.Root, { ref, className: cn(labelVariants(), className), ...props }));
|
|
1194
1368
|
Label2.displayName = LabelPrimitive.Root.displayName;
|
|
1195
1369
|
|
|
1196
1370
|
// src/primitives/field.tsx
|
|
@@ -1198,10 +1372,10 @@ var import_react = require("react");
|
|
|
1198
1372
|
var import_class_variance_authority13 = require("class-variance-authority");
|
|
1199
1373
|
|
|
1200
1374
|
// src/primitives/separator.tsx
|
|
1201
|
-
var
|
|
1375
|
+
var React22 = __toESM(require("react"), 1);
|
|
1202
1376
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
|
|
1203
|
-
var
|
|
1204
|
-
var Separator2 =
|
|
1377
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1378
|
+
var Separator2 = React22.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1205
1379
|
SeparatorPrimitive.Root,
|
|
1206
1380
|
{
|
|
1207
1381
|
ref,
|
|
@@ -1218,9 +1392,9 @@ var Separator2 = React20.forwardRef(({ className, orientation = "horizontal", de
|
|
|
1218
1392
|
Separator2.displayName = SeparatorPrimitive.Root.displayName;
|
|
1219
1393
|
|
|
1220
1394
|
// src/primitives/field.tsx
|
|
1221
|
-
var
|
|
1395
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1222
1396
|
function FieldSet({ className, ...props }) {
|
|
1223
|
-
return /* @__PURE__ */ (0,
|
|
1397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1224
1398
|
"fieldset",
|
|
1225
1399
|
{
|
|
1226
1400
|
"data-slot": "field-set",
|
|
@@ -1238,7 +1412,7 @@ function FieldLegend({
|
|
|
1238
1412
|
variant = "legend",
|
|
1239
1413
|
...props
|
|
1240
1414
|
}) {
|
|
1241
|
-
return /* @__PURE__ */ (0,
|
|
1415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1242
1416
|
"legend",
|
|
1243
1417
|
{
|
|
1244
1418
|
"data-slot": "field-legend",
|
|
@@ -1254,7 +1428,7 @@ function FieldLegend({
|
|
|
1254
1428
|
);
|
|
1255
1429
|
}
|
|
1256
1430
|
function FieldGroup({ className, ...props }) {
|
|
1257
|
-
return /* @__PURE__ */ (0,
|
|
1431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1258
1432
|
"div",
|
|
1259
1433
|
{
|
|
1260
1434
|
"data-slot": "field-group",
|
|
@@ -1291,7 +1465,7 @@ function Field({
|
|
|
1291
1465
|
orientation = "vertical",
|
|
1292
1466
|
...props
|
|
1293
1467
|
}) {
|
|
1294
|
-
return /* @__PURE__ */ (0,
|
|
1468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1295
1469
|
"div",
|
|
1296
1470
|
{
|
|
1297
1471
|
role: "group",
|
|
@@ -1303,7 +1477,7 @@ function Field({
|
|
|
1303
1477
|
);
|
|
1304
1478
|
}
|
|
1305
1479
|
function FieldContent({ className, ...props }) {
|
|
1306
|
-
return /* @__PURE__ */ (0,
|
|
1480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1307
1481
|
"div",
|
|
1308
1482
|
{
|
|
1309
1483
|
"data-slot": "field-content",
|
|
@@ -1313,7 +1487,7 @@ function FieldContent({ className, ...props }) {
|
|
|
1313
1487
|
);
|
|
1314
1488
|
}
|
|
1315
1489
|
function FieldLabel({ className, ...props }) {
|
|
1316
|
-
return /* @__PURE__ */ (0,
|
|
1490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1317
1491
|
Label2,
|
|
1318
1492
|
{
|
|
1319
1493
|
"data-slot": "field-label",
|
|
@@ -1328,7 +1502,7 @@ function FieldLabel({ className, ...props }) {
|
|
|
1328
1502
|
);
|
|
1329
1503
|
}
|
|
1330
1504
|
function FieldTitle({ className, ...props }) {
|
|
1331
|
-
return /* @__PURE__ */ (0,
|
|
1505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1332
1506
|
"div",
|
|
1333
1507
|
{
|
|
1334
1508
|
"data-slot": "field-label",
|
|
@@ -1341,7 +1515,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
1341
1515
|
);
|
|
1342
1516
|
}
|
|
1343
1517
|
function FieldDescription({ className, ...props }) {
|
|
1344
|
-
return /* @__PURE__ */ (0,
|
|
1518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1345
1519
|
"p",
|
|
1346
1520
|
{
|
|
1347
1521
|
"data-slot": "field-description",
|
|
@@ -1360,7 +1534,7 @@ function FieldSeparator({
|
|
|
1360
1534
|
className,
|
|
1361
1535
|
...props
|
|
1362
1536
|
}) {
|
|
1363
|
-
return /* @__PURE__ */ (0,
|
|
1537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1364
1538
|
"div",
|
|
1365
1539
|
{
|
|
1366
1540
|
"data-slot": "field-separator",
|
|
@@ -1371,8 +1545,8 @@ function FieldSeparator({
|
|
|
1371
1545
|
),
|
|
1372
1546
|
...props,
|
|
1373
1547
|
children: [
|
|
1374
|
-
/* @__PURE__ */ (0,
|
|
1375
|
-
children && /* @__PURE__ */ (0,
|
|
1548
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Separator2, { className: "absolute inset-0 top-1/2" }),
|
|
1549
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1376
1550
|
"span",
|
|
1377
1551
|
{
|
|
1378
1552
|
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
@@ -1400,12 +1574,12 @@ function FieldError({
|
|
|
1400
1574
|
if (errors?.length === 1 && errors[0]?.message) {
|
|
1401
1575
|
return errors[0].message;
|
|
1402
1576
|
}
|
|
1403
|
-
return /* @__PURE__ */ (0,
|
|
1577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map((error, index) => error?.message && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { children: error.message }, index)) });
|
|
1404
1578
|
}, [children, errors]);
|
|
1405
1579
|
if (!content) {
|
|
1406
1580
|
return null;
|
|
1407
1581
|
}
|
|
1408
|
-
return /* @__PURE__ */ (0,
|
|
1582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1409
1583
|
"div",
|
|
1410
1584
|
{
|
|
1411
1585
|
role: "alert",
|
|
@@ -1418,10 +1592,10 @@ function FieldError({
|
|
|
1418
1592
|
}
|
|
1419
1593
|
|
|
1420
1594
|
// src/components/link/Link.tsx
|
|
1421
|
-
var
|
|
1595
|
+
var React23 = __toESM(require("react"), 1);
|
|
1422
1596
|
var import_class_variance_authority14 = require("class-variance-authority");
|
|
1423
1597
|
var import_lucide_react5 = require("lucide-react");
|
|
1424
|
-
var
|
|
1598
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1425
1599
|
var linkVariants = (0, import_class_variance_authority14.cva)(
|
|
1426
1600
|
"inline-flex items-center gap-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",
|
|
1427
1601
|
{
|
|
@@ -1446,7 +1620,7 @@ var linkVariants = (0, import_class_variance_authority14.cva)(
|
|
|
1446
1620
|
}
|
|
1447
1621
|
}
|
|
1448
1622
|
);
|
|
1449
|
-
var Link =
|
|
1623
|
+
var Link = React23.forwardRef(
|
|
1450
1624
|
({
|
|
1451
1625
|
className,
|
|
1452
1626
|
variant,
|
|
@@ -1459,7 +1633,7 @@ var Link = React21.forwardRef(
|
|
|
1459
1633
|
...props
|
|
1460
1634
|
}, ref) => {
|
|
1461
1635
|
const isExternal = external || typeof props.href === "string" && (props.href.startsWith("http://") || props.href.startsWith("https://") || props.href.startsWith("mailto:") || props.href.startsWith("tel:"));
|
|
1462
|
-
return /* @__PURE__ */ (0,
|
|
1636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1463
1637
|
"a",
|
|
1464
1638
|
{
|
|
1465
1639
|
ref,
|
|
@@ -1475,8 +1649,8 @@ var Link = React21.forwardRef(
|
|
|
1475
1649
|
},
|
|
1476
1650
|
children: [
|
|
1477
1651
|
children,
|
|
1478
|
-
icon && /* @__PURE__ */ (0,
|
|
1479
|
-
showExternalIcon && isExternal && !disabled && /* @__PURE__ */ (0,
|
|
1652
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "inline-flex items-center", children: icon }),
|
|
1653
|
+
showExternalIcon && isExternal && !disabled && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "inline-flex items-center ml-1 opacity-60", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { icon: import_lucide_react5.ExternalLink, size: 16 }) })
|
|
1480
1654
|
]
|
|
1481
1655
|
}
|
|
1482
1656
|
);
|
|
@@ -1485,14 +1659,14 @@ var Link = React21.forwardRef(
|
|
|
1485
1659
|
Link.displayName = "Link";
|
|
1486
1660
|
|
|
1487
1661
|
// src/components/section/Section.tsx
|
|
1488
|
-
var
|
|
1662
|
+
var React25 = __toESM(require("react"), 1);
|
|
1489
1663
|
var import_class_variance_authority16 = require("class-variance-authority");
|
|
1490
1664
|
|
|
1491
1665
|
// src/components/container/Container.tsx
|
|
1492
|
-
var
|
|
1666
|
+
var React24 = __toESM(require("react"), 1);
|
|
1493
1667
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
1494
1668
|
var import_class_variance_authority15 = require("class-variance-authority");
|
|
1495
|
-
var
|
|
1669
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1496
1670
|
var containerVariants = (0, import_class_variance_authority15.cva)("w-full mx-auto", {
|
|
1497
1671
|
variants: {
|
|
1498
1672
|
size: {
|
|
@@ -1514,10 +1688,10 @@ var containerVariants = (0, import_class_variance_authority15.cva)("w-full mx-au
|
|
|
1514
1688
|
padding: "md"
|
|
1515
1689
|
}
|
|
1516
1690
|
});
|
|
1517
|
-
var Container =
|
|
1691
|
+
var Container = React24.forwardRef(
|
|
1518
1692
|
({ className, size, padding, asChild = false, children, ...props }, ref) => {
|
|
1519
1693
|
const Component = asChild ? import_react_slot2.Slot : "div";
|
|
1520
|
-
return /* @__PURE__ */ (0,
|
|
1694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1521
1695
|
Component,
|
|
1522
1696
|
{
|
|
1523
1697
|
ref,
|
|
@@ -1531,7 +1705,7 @@ var Container = React22.forwardRef(
|
|
|
1531
1705
|
Container.displayName = "Container";
|
|
1532
1706
|
|
|
1533
1707
|
// src/components/section/Section.tsx
|
|
1534
|
-
var
|
|
1708
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1535
1709
|
var sectionVariants = (0, import_class_variance_authority16.cva)("relative", {
|
|
1536
1710
|
variants: {
|
|
1537
1711
|
padding: {
|
|
@@ -1551,15 +1725,15 @@ var sectionVariants = (0, import_class_variance_authority16.cva)("relative", {
|
|
|
1551
1725
|
background: "transparent"
|
|
1552
1726
|
}
|
|
1553
1727
|
});
|
|
1554
|
-
var Section =
|
|
1728
|
+
var Section = React25.forwardRef(
|
|
1555
1729
|
({ className, padding, background, children, ...props }, ref) => {
|
|
1556
|
-
return /* @__PURE__ */ (0,
|
|
1730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1557
1731
|
"section",
|
|
1558
1732
|
{
|
|
1559
1733
|
ref,
|
|
1560
1734
|
className: cn(sectionVariants({ padding, background }), className),
|
|
1561
1735
|
...props,
|
|
1562
|
-
children: /* @__PURE__ */ (0,
|
|
1736
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Container, { children })
|
|
1563
1737
|
}
|
|
1564
1738
|
);
|
|
1565
1739
|
}
|
|
@@ -1567,9 +1741,9 @@ var Section = React23.forwardRef(
|
|
|
1567
1741
|
Section.displayName = "Section";
|
|
1568
1742
|
|
|
1569
1743
|
// src/components/section-header/SectionHeader.tsx
|
|
1570
|
-
var
|
|
1571
|
-
var
|
|
1572
|
-
var SectionHeader =
|
|
1744
|
+
var React26 = __toESM(require("react"), 1);
|
|
1745
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1746
|
+
var SectionHeader = React26.forwardRef(
|
|
1573
1747
|
({
|
|
1574
1748
|
className,
|
|
1575
1749
|
title,
|
|
@@ -1581,22 +1755,22 @@ var SectionHeader = React24.forwardRef(
|
|
|
1581
1755
|
id,
|
|
1582
1756
|
...props
|
|
1583
1757
|
}, ref) => {
|
|
1584
|
-
return /* @__PURE__ */ (0,
|
|
1758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1585
1759
|
"div",
|
|
1586
1760
|
{
|
|
1587
1761
|
id,
|
|
1588
1762
|
ref,
|
|
1589
1763
|
className: cn("w-full px-fluid-md py-fluid-xl text-center", className),
|
|
1590
1764
|
...props,
|
|
1591
|
-
children: /* @__PURE__ */ (0,
|
|
1592
|
-
/* @__PURE__ */ (0,
|
|
1593
|
-
tagline && /* @__PURE__ */ (0,
|
|
1594
|
-
/* @__PURE__ */ (0,
|
|
1595
|
-
/* @__PURE__ */ (0,
|
|
1596
|
-
description && /* @__PURE__ */ (0,
|
|
1765
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col items-center gap-fluid-lg", children: [
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "max-w-3xl mx-auto flex flex-col items-center gap-fluid-lg", children: [
|
|
1767
|
+
tagline && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Badge, { variant: "default", className: "text-sm", children: tagline }),
|
|
1768
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col items-center gap-fluid-sm", children: [
|
|
1769
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Typography, { variant: headingLevel, children: title }),
|
|
1770
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Typography, { variant: descriptionVariant, color: "muted", children: description })
|
|
1597
1771
|
] })
|
|
1598
1772
|
] }),
|
|
1599
|
-
action && /* @__PURE__ */ (0,
|
|
1773
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mt-4", children: action })
|
|
1600
1774
|
] })
|
|
1601
1775
|
}
|
|
1602
1776
|
);
|
|
@@ -1605,10 +1779,10 @@ var SectionHeader = React24.forwardRef(
|
|
|
1605
1779
|
SectionHeader.displayName = "SectionHeader";
|
|
1606
1780
|
|
|
1607
1781
|
// src/components/grid/Grid.tsx
|
|
1608
|
-
var
|
|
1782
|
+
var React27 = __toESM(require("react"), 1);
|
|
1609
1783
|
var import_class_variance_authority17 = require("class-variance-authority");
|
|
1610
1784
|
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
1611
|
-
var
|
|
1785
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1612
1786
|
var gridVariants = (0, import_class_variance_authority17.cva)("grid", {
|
|
1613
1787
|
variants: {
|
|
1614
1788
|
align: {
|
|
@@ -1631,10 +1805,10 @@ var gridVariants = (0, import_class_variance_authority17.cva)("grid", {
|
|
|
1631
1805
|
justify: "start"
|
|
1632
1806
|
}
|
|
1633
1807
|
});
|
|
1634
|
-
var Grid =
|
|
1808
|
+
var Grid = React27.forwardRef(
|
|
1635
1809
|
({ className, align, justify, cols, rows, gap, gapX, gapY, asChild = false, children, ...props }, ref) => {
|
|
1636
1810
|
const Component = asChild ? import_react_slot3.Slot : "div";
|
|
1637
|
-
return /* @__PURE__ */ (0,
|
|
1811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1638
1812
|
Component,
|
|
1639
1813
|
{
|
|
1640
1814
|
ref,
|
|
@@ -1656,10 +1830,10 @@ var Grid = React25.forwardRef(
|
|
|
1656
1830
|
Grid.displayName = "Grid";
|
|
1657
1831
|
|
|
1658
1832
|
// src/components/box/Box.tsx
|
|
1659
|
-
var
|
|
1833
|
+
var React28 = __toESM(require("react"), 1);
|
|
1660
1834
|
var import_class_variance_authority18 = require("class-variance-authority");
|
|
1661
1835
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
1662
|
-
var
|
|
1836
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1663
1837
|
var boxVariants = (0, import_class_variance_authority18.cva)("flex", {
|
|
1664
1838
|
variants: {
|
|
1665
1839
|
direction: {
|
|
@@ -1696,10 +1870,10 @@ var boxVariants = (0, import_class_variance_authority18.cva)("flex", {
|
|
|
1696
1870
|
wrap: "nowrap"
|
|
1697
1871
|
}
|
|
1698
1872
|
});
|
|
1699
|
-
var Box =
|
|
1873
|
+
var Box = React28.forwardRef(
|
|
1700
1874
|
({ className, direction, align, justify, wrap, gap, asChild = false, children, ...props }, ref) => {
|
|
1701
1875
|
const Component = asChild ? import_react_slot4.Slot : "div";
|
|
1702
|
-
return /* @__PURE__ */ (0,
|
|
1876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1703
1877
|
Component,
|
|
1704
1878
|
{
|
|
1705
1879
|
ref,
|
|
@@ -1717,16 +1891,16 @@ var Box = React26.forwardRef(
|
|
|
1717
1891
|
Box.displayName = "Box";
|
|
1718
1892
|
|
|
1719
1893
|
// src/components/berget-logo/BergetLogo.tsx
|
|
1720
|
-
var
|
|
1721
|
-
var
|
|
1722
|
-
var BergetLogo =
|
|
1723
|
-
({ variant = "logotype", color = "
|
|
1724
|
-
const fillColor = color === "white" ? "var(--berget-logo-light)" : "var(--berget-logo-dark)";
|
|
1894
|
+
var React29 = __toESM(require("react"), 1);
|
|
1895
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1896
|
+
var BergetLogo = React29.forwardRef(
|
|
1897
|
+
({ variant = "logotype", color = "auto", size = 48, className, ...props }, ref) => {
|
|
1898
|
+
const fillColor = color === "auto" ? "var(--berget-logo-light)" : color === "white" ? "var(--berget-logo-light)" : "var(--berget-logo-dark)";
|
|
1725
1899
|
if (variant === "symbol") {
|
|
1726
1900
|
const aspectRatio2 = 463 / 419;
|
|
1727
1901
|
const width2 = size * aspectRatio2;
|
|
1728
1902
|
const height2 = size;
|
|
1729
|
-
return /* @__PURE__ */ (0,
|
|
1903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1730
1904
|
"svg",
|
|
1731
1905
|
{
|
|
1732
1906
|
ref,
|
|
@@ -1739,7 +1913,7 @@ var BergetLogo = React27.forwardRef(
|
|
|
1739
1913
|
"aria-label": "Berget symbol",
|
|
1740
1914
|
className: cn("inline-block", className),
|
|
1741
1915
|
...props,
|
|
1742
|
-
children: /* @__PURE__ */ (0,
|
|
1916
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1743
1917
|
"path",
|
|
1744
1918
|
{
|
|
1745
1919
|
d: "M208.739 17L255.261 17L446 403L398 403L313.5 255L261.5 176L233.163 96.1677L237.815 98.6522H226.185L230.837 96.1677L113 331L64.5 403L18 403L208.739 17Z",
|
|
@@ -1752,7 +1926,7 @@ var BergetLogo = React27.forwardRef(
|
|
|
1752
1926
|
const aspectRatio = 793.63 / 204.37;
|
|
1753
1927
|
const width = size * aspectRatio;
|
|
1754
1928
|
const height = size;
|
|
1755
|
-
return /* @__PURE__ */ (0,
|
|
1929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
1756
1930
|
"svg",
|
|
1757
1931
|
{
|
|
1758
1932
|
ref,
|
|
@@ -1766,59 +1940,59 @@ var BergetLogo = React27.forwardRef(
|
|
|
1766
1940
|
className: cn("inline-block", className),
|
|
1767
1941
|
...props,
|
|
1768
1942
|
children: [
|
|
1769
|
-
/* @__PURE__ */ (0,
|
|
1770
|
-
/* @__PURE__ */ (0,
|
|
1943
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("g", { style: { fill: fillColor }, children: [
|
|
1944
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1771
1945
|
"path",
|
|
1772
1946
|
{
|
|
1773
1947
|
className: "berget-logotype-fill",
|
|
1774
1948
|
d: "M268.78,172.54v-96.04h37.74c10.39,0,18.26,2.33,23.6,7,5.33,4.67,8.01,10.52,8.01,17.56,0,6.13-1.72,11-5.15,14.61-3.43,3.61-7.58,6.06-12.44,7.34,3.81.73,7.22,2.2,10.22,4.39,3.01,2.2,5.36,4.94,7.08,8.23,1.72,3.29,2.58,6.86,2.58,10.7,0,4.94-1.27,9.4-3.79,13.38-2.53,3.98-6.22,7.11-11.08,9.4-4.86,2.29-10.82,3.43-17.87,3.43h-38.89ZM283.93,117.66h20.74c5.81,0,10.24-1.3,13.29-3.91,3.05-2.61,4.58-6.19,4.58-10.77s-1.51-8.05-4.51-10.7c-3-2.65-7.55-3.98-13.65-3.98h-20.45v29.36ZM283.93,160.61h21.74c6.1,0,10.84-1.37,14.22-4.11,3.38-2.75,5.08-6.59,5.08-11.53s-1.76-8.85-5.29-11.73-8.29-4.32-14.3-4.32h-21.45v31.69Z"
|
|
1775
1949
|
}
|
|
1776
1950
|
),
|
|
1777
|
-
/* @__PURE__ */ (0,
|
|
1951
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1778
1952
|
"path",
|
|
1779
1953
|
{
|
|
1780
1954
|
className: "berget-logotype-fill",
|
|
1781
1955
|
d: "M382.45,174.19c-6.96,0-13.13-1.49-18.52-4.46-5.39-2.97-9.6-7.11-12.65-12.42-3.05-5.3-4.57-11.48-4.57-18.52s1.5-13.4,4.5-18.79,7.19-9.61,12.58-12.62c5.39-3.02,11.65-4.53,18.81-4.53s13,1.48,18.15,4.46c5.15,2.97,9.16,6.93,12.01,11.87,2.86,4.94,4.29,10.38,4.29,16.33,0,.92-.02,1.9-.07,2.95-.05,1.05-.12,2.22-.22,3.5h-55.19c.48,6.59,2.75,11.59,6.79,15.02,4.05,3.43,8.75,5.14,14.09,5.14,4.29,0,7.89-.93,10.79-2.81,2.91-1.88,5.08-4.41,6.51-7.61h15.16c-1.91,6.4-5.7,11.75-11.37,16.05-5.68,4.3-12.71,6.45-21.09,6.45ZM382.45,114.78c-5.05,0-9.54,1.44-13.44,4.32-3.91,2.88-6.29,7.2-7.15,12.97h40.04c-.29-5.3-2.24-9.51-5.87-12.62-3.62-3.11-8.15-4.67-13.58-4.67Z"
|
|
1782
1956
|
}
|
|
1783
1957
|
),
|
|
1784
|
-
/* @__PURE__ */ (0,
|
|
1958
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1785
1959
|
"path",
|
|
1786
1960
|
{
|
|
1787
1961
|
className: "berget-logotype-fill",
|
|
1788
1962
|
d: "M425.62,172.54v-68.05h13.59l1.29,12.9c2.47-4.48,5.93-8.03,10.37-10.63,4.43-2.61,9.79-3.91,16.08-3.91v15.23h-4.15c-4.19,0-7.93.67-11.22,1.99-3.29,1.33-5.91,3.57-7.86,6.72-1.96,3.16-2.93,7.53-2.93,13.1v32.65h-15.16Z"
|
|
1789
1963
|
}
|
|
1790
1964
|
),
|
|
1791
|
-
/* @__PURE__ */ (0,
|
|
1965
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1792
1966
|
"path",
|
|
1793
1967
|
{
|
|
1794
1968
|
className: "berget-logotype-fill",
|
|
1795
1969
|
d: "M500.25,151.69c-3.72,0-7.14-.41-10.29-1.24l-6.15,5.76c1.05.64,2.34,1.19,3.86,1.65,1.52.46,3.66.87,6.43,1.23,2.76.37,6.53.73,11.29,1.1,9.43.82,16.25,3,20.44,6.52,4.2,3.52,6.29,8.21,6.29,14.06,0,4.02-1.12,7.84-3.35,11.45-2.24,3.61-5.72,6.54-10.44,8.78s-10.74,3.36-18.09,3.36c-9.91,0-17.94-1.8-24.09-5.42-6.15-3.62-9.22-9.08-9.22-16.4,0-2.84.78-5.65,2.35-8.44,1.57-2.79,4.08-5.42,7.51-7.89-2-.83-3.74-1.72-5.22-2.68-1.48-.96-2.79-1.94-3.94-2.95v-3.29l12.3-12.07c-5.53-4.57-8.29-10.56-8.29-17.97,0-4.48,1.12-8.58,3.36-12.28,2.24-3.7,5.5-6.65,9.79-8.85,4.29-2.2,9.43-3.29,15.44-3.29,4.01,0,7.72.55,11.15,1.64h26.45v9.6l-12.58.69c2.28,3.75,3.43,7.91,3.43,12.49s-1.13,8.69-3.36,12.35c-2.24,3.66-5.48,6.59-9.72,8.78-4.25,2.2-9.37,3.29-15.37,3.29ZM481.24,181.19c0,3.93,1.81,6.88,5.44,8.85,3.62,1.97,8.15,2.95,13.58,2.95s9.48-1.07,12.72-3.22c3.24-2.15,4.86-5,4.86-8.57,0-2.65-1.09-4.92-3.29-6.79-2.19-1.87-6.34-3.04-12.44-3.5-4.57-.27-8.63-.68-12.15-1.23-3.34,1.74-5.63,3.61-6.86,5.63-1.25,2.01-1.86,3.98-1.86,5.9ZM500.25,140.3c4.38,0,7.93-1.12,10.66-3.36,2.71-2.24,4.07-5.42,4.07-9.53s-1.36-7.41-4.07-9.6c-2.72-2.2-6.27-3.29-10.66-3.29s-8.08,1.1-10.79,3.29c-2.71,2.2-4.08,5.4-4.08,9.6s1.36,7.3,4.08,9.53c2.71,2.24,6.31,3.36,10.79,3.36Z"
|
|
1796
1970
|
}
|
|
1797
1971
|
),
|
|
1798
|
-
/* @__PURE__ */ (0,
|
|
1972
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1799
1973
|
"path",
|
|
1800
1974
|
{
|
|
1801
1975
|
className: "berget-logotype-fill",
|
|
1802
1976
|
d: "M574.61,174.19c-6.96,0-13.13-1.49-18.52-4.46-5.39-2.97-9.6-7.11-12.65-12.42-3.05-5.3-4.57-11.48-4.57-18.52s1.5-13.4,4.5-18.79c3-5.4,7.19-9.61,12.58-12.62c5.39-3.02,11.65-4.53,18.81-4.53s13,1.48,18.15,4.46c5.15,2.97,9.16,6.93,12.01,11.87,2.86,4.94,4.29,10.38,4.29,16.33,0,.92-.02,1.9-.07,2.95-.05,1.05-.12,2.22-.22,3.5h-55.19c.48,6.59,2.75,11.59,6.79,15.02,4.05,3.43,8.75,5.14,14.09,5.14,4.29,0,7.89-.93,10.79-2.81s5.08-4.41,6.51-7.61h15.16c-1.91,6.4-5.7,11.75-11.37,16.05-5.68,4.3-12.71,6.45-21.09,6.45ZM574.61,114.78c-5.05,0-9.54,1.44-13.44,4.32-3.91,2.88-6.29,7.2-7.15,12.97h40.04c-.29-5.3-2.24-9.51-5.87-12.62-3.62-3.11-8.15-4.67-13.58-4.67Z"
|
|
1803
1977
|
}
|
|
1804
1978
|
),
|
|
1805
|
-
/* @__PURE__ */ (0,
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1806
1980
|
"path",
|
|
1807
1981
|
{
|
|
1808
1982
|
className: "berget-logotype-fill",
|
|
1809
1983
|
d: "M646.23,172.54c-6.96,0-12.49-1.62-16.59-4.87-4.1-3.25-6.15-9.03-6.15-17.36v-33.61h-12.16v-12.21h12.16l1.86-17.29h13.29v17.29h20.02v12.21h-20.02v33.61c0,3.75.84,6.33,2.51,7.75,1.67,1.42,4.55,2.13,8.65,2.13h8.14v12.35h-11.72Z"
|
|
1810
1984
|
}
|
|
1811
1985
|
),
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1986
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1813
1987
|
"path",
|
|
1814
1988
|
{
|
|
1815
1989
|
className: "berget-logotype-fill",
|
|
1816
1990
|
d: "M684.4,172.54l36.89-96.04h16.59l36.6,96.04h-16.01l-8.58-23.46h-40.88l-8.58,23.46h-16.01ZM713.28,137.56h32.31l-16.16-43.77-16.16,43.77Z"
|
|
1817
1991
|
}
|
|
1818
1992
|
),
|
|
1819
|
-
/* @__PURE__ */ (0,
|
|
1993
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { className: "berget-logotype-fill", d: "M778.48,172.54v-96.04h15.15v96.04h-15.15Z" })
|
|
1820
1994
|
] }),
|
|
1821
|
-
/* @__PURE__ */ (0,
|
|
1995
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1822
1996
|
"path",
|
|
1823
1997
|
{
|
|
1824
1998
|
style: { fill: fillColor },
|
|
@@ -1833,18 +2007,18 @@ var BergetLogo = React27.forwardRef(
|
|
|
1833
2007
|
BergetLogo.displayName = "BergetLogo";
|
|
1834
2008
|
|
|
1835
2009
|
// src/components/header/Header.tsx
|
|
1836
|
-
var
|
|
2010
|
+
var React31 = __toESM(require("react"), 1);
|
|
1837
2011
|
var import_class_variance_authority19 = require("class-variance-authority");
|
|
1838
2012
|
var import_lucide_react7 = require("lucide-react");
|
|
1839
2013
|
|
|
1840
2014
|
// src/components/language-select/LanguageSelect.tsx
|
|
1841
|
-
var
|
|
2015
|
+
var React30 = __toESM(require("react"), 1);
|
|
1842
2016
|
var SelectPrimitive2 = __toESM(require("@radix-ui/react-select"), 1);
|
|
1843
2017
|
var import_lucide_react6 = require("lucide-react");
|
|
1844
|
-
var
|
|
1845
|
-
var LanguageSelect =
|
|
1846
|
-
return /* @__PURE__ */ (0,
|
|
1847
|
-
/* @__PURE__ */ (0,
|
|
2018
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2019
|
+
var LanguageSelect = React30.forwardRef(({ className, options, value, onValueChange }, ref) => {
|
|
2020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(SelectPrimitive2.Root, { value, onValueChange, children: [
|
|
2021
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1848
2022
|
SelectPrimitive2.Trigger,
|
|
1849
2023
|
{
|
|
1850
2024
|
ref,
|
|
@@ -1865,10 +2039,10 @@ var LanguageSelect = React28.forwardRef(({ className, options, value, onValueCha
|
|
|
1865
2039
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1866
2040
|
className
|
|
1867
2041
|
),
|
|
1868
|
-
children: /* @__PURE__ */ (0,
|
|
2042
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { icon: import_lucide_react6.Globe, size: 16 })
|
|
1869
2043
|
}
|
|
1870
2044
|
),
|
|
1871
|
-
/* @__PURE__ */ (0,
|
|
2045
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SelectPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1872
2046
|
SelectPrimitive2.Content,
|
|
1873
2047
|
{
|
|
1874
2048
|
className: cn(
|
|
@@ -1896,7 +2070,7 @@ var LanguageSelect = React28.forwardRef(({ className, options, value, onValueCha
|
|
|
1896
2070
|
"origin-[--radix-select-content-transform-origin]"
|
|
1897
2071
|
),
|
|
1898
2072
|
position: "popper",
|
|
1899
|
-
children: /* @__PURE__ */ (0,
|
|
2073
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SelectPrimitive2.Viewport, { className: "p-1", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1900
2074
|
SelectPrimitive2.Item,
|
|
1901
2075
|
{
|
|
1902
2076
|
value: option.value,
|
|
@@ -1913,7 +2087,7 @@ var LanguageSelect = React28.forwardRef(({ className, options, value, onValueCha
|
|
|
1913
2087
|
// Disabled state
|
|
1914
2088
|
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
|
1915
2089
|
),
|
|
1916
|
-
children: /* @__PURE__ */ (0,
|
|
2090
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SelectPrimitive2.ItemText, { children: option.label })
|
|
1917
2091
|
},
|
|
1918
2092
|
option.value
|
|
1919
2093
|
)) })
|
|
@@ -1924,7 +2098,7 @@ var LanguageSelect = React28.forwardRef(({ className, options, value, onValueCha
|
|
|
1924
2098
|
LanguageSelect.displayName = "LanguageSelect";
|
|
1925
2099
|
|
|
1926
2100
|
// src/components/header/Header.tsx
|
|
1927
|
-
var
|
|
2101
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1928
2102
|
var headerVariants = (0, import_class_variance_authority19.cva)(
|
|
1929
2103
|
"sticky top-0 z-50 header-backdrop backdrop-blur-xl border-b border-berget-border transition-all duration-200",
|
|
1930
2104
|
{
|
|
@@ -1939,18 +2113,18 @@ var headerVariants = (0, import_class_variance_authority19.cva)(
|
|
|
1939
2113
|
}
|
|
1940
2114
|
}
|
|
1941
2115
|
);
|
|
1942
|
-
var HeaderContext =
|
|
2116
|
+
var HeaderContext = React31.createContext({
|
|
1943
2117
|
isMobileMenuOpen: false,
|
|
1944
2118
|
setIsMobileMenuOpen: () => {
|
|
1945
2119
|
}
|
|
1946
2120
|
});
|
|
1947
|
-
var useHeaderContext = () =>
|
|
1948
|
-
var HeaderLogo =
|
|
1949
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2121
|
+
var useHeaderContext = () => React31.useContext(HeaderContext);
|
|
2122
|
+
var HeaderLogo = React31.forwardRef(
|
|
2123
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ref, className: cn("flex items-center", className), ...props, children })
|
|
1950
2124
|
);
|
|
1951
2125
|
HeaderLogo.displayName = "HeaderLogo";
|
|
1952
|
-
var HeaderNav =
|
|
1953
|
-
return /* @__PURE__ */ (0,
|
|
2126
|
+
var HeaderNav = React31.forwardRef(({ className, links, ...props }, ref) => {
|
|
2127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("nav", { ref, className: cn("hidden md:flex items-center gap-fluid-lg", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { className: "flex items-center gap-fluid-lg", children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1954
2128
|
Link,
|
|
1955
2129
|
{
|
|
1956
2130
|
href: link.href,
|
|
@@ -1958,14 +2132,14 @@ var HeaderNav = React29.forwardRef(({ className, links, ...props }, ref) => {
|
|
|
1958
2132
|
size: "sm",
|
|
1959
2133
|
className: cn("relative transition-all duration-200", link.active && "font-medium"),
|
|
1960
2134
|
children: [
|
|
1961
|
-
link.icon && /* @__PURE__ */ (0,
|
|
2135
|
+
link.icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "inline-flex items-center mr-2", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { icon: link.icon, size: 16 }) }),
|
|
1962
2136
|
link.label
|
|
1963
2137
|
]
|
|
1964
2138
|
}
|
|
1965
2139
|
) }, link.href)) }) });
|
|
1966
2140
|
});
|
|
1967
2141
|
HeaderNav.displayName = "HeaderNav";
|
|
1968
|
-
var HeaderActions =
|
|
2142
|
+
var HeaderActions = React31.forwardRef(
|
|
1969
2143
|
({
|
|
1970
2144
|
className,
|
|
1971
2145
|
languageOptions,
|
|
@@ -1975,8 +2149,8 @@ var HeaderActions = React29.forwardRef(
|
|
|
1975
2149
|
ctaButton,
|
|
1976
2150
|
...props
|
|
1977
2151
|
}, ref) => {
|
|
1978
|
-
return /* @__PURE__ */ (0,
|
|
1979
|
-
languageOptions.length > 0 && /* @__PURE__ */ (0,
|
|
2152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { ref, className: cn("hidden md:flex items-center gap-2", className), ...props, children: [
|
|
2153
|
+
languageOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1980
2154
|
LanguageSelect,
|
|
1981
2155
|
{
|
|
1982
2156
|
options: languageOptions,
|
|
@@ -1990,16 +2164,16 @@ var HeaderActions = React29.forwardRef(
|
|
|
1990
2164
|
}
|
|
1991
2165
|
);
|
|
1992
2166
|
HeaderActions.displayName = "HeaderActions";
|
|
1993
|
-
var MobileMenuButton =
|
|
2167
|
+
var MobileMenuButton = React31.forwardRef(({ className, ...props }, ref) => {
|
|
1994
2168
|
const { isMobileMenuOpen, setIsMobileMenuOpen } = useHeaderContext();
|
|
1995
|
-
return /* @__PURE__ */ (0,
|
|
2169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1996
2170
|
"button",
|
|
1997
2171
|
{
|
|
1998
2172
|
ref,
|
|
1999
2173
|
className: cn(
|
|
2000
2174
|
"md:hidden flex items-center justify-center w-8 h-8 rounded-full",
|
|
2001
2175
|
"cursor-pointer transition-all duration-200",
|
|
2002
|
-
"hover:bg-berget-surface-hover
|
|
2176
|
+
"hover:bg-berget-surface-hover",
|
|
2003
2177
|
className
|
|
2004
2178
|
),
|
|
2005
2179
|
onClick: () => setIsMobileMenuOpen(!isMobileMenuOpen),
|
|
@@ -2007,12 +2181,12 @@ var MobileMenuButton = React29.forwardRef(({ className, ...props }, ref) => {
|
|
|
2007
2181
|
"aria-expanded": isMobileMenuOpen,
|
|
2008
2182
|
"aria-controls": "mobile-menu",
|
|
2009
2183
|
...props,
|
|
2010
|
-
children: isMobileMenuOpen ? /* @__PURE__ */ (0,
|
|
2184
|
+
children: isMobileMenuOpen ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { icon: import_lucide_react7.X, size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { icon: import_lucide_react7.Menu, size: 16 })
|
|
2011
2185
|
}
|
|
2012
2186
|
);
|
|
2013
2187
|
});
|
|
2014
2188
|
MobileMenuButton.displayName = "MobileMenuButton";
|
|
2015
|
-
var MobileMenu =
|
|
2189
|
+
var MobileMenu = React31.forwardRef(
|
|
2016
2190
|
({
|
|
2017
2191
|
className,
|
|
2018
2192
|
links,
|
|
@@ -2025,7 +2199,7 @@ var MobileMenu = React29.forwardRef(
|
|
|
2025
2199
|
}, ref) => {
|
|
2026
2200
|
const { isMobileMenuOpen, setIsMobileMenuOpen } = useHeaderContext();
|
|
2027
2201
|
if (!isMobileMenuOpen) return null;
|
|
2028
|
-
return /* @__PURE__ */ (0,
|
|
2202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2029
2203
|
"nav",
|
|
2030
2204
|
{
|
|
2031
2205
|
ref,
|
|
@@ -2036,8 +2210,8 @@ var MobileMenu = React29.forwardRef(
|
|
|
2036
2210
|
className
|
|
2037
2211
|
),
|
|
2038
2212
|
...props,
|
|
2039
|
-
children: /* @__PURE__ */ (0,
|
|
2040
|
-
/* @__PURE__ */ (0,
|
|
2213
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box, { direction: "column", gap: 0, className: "py-fluid-md", children: [
|
|
2214
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { className: "px-fluid-md pb-fluid-md border-b border-berget-border/50", children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2041
2215
|
Link,
|
|
2042
2216
|
{
|
|
2043
2217
|
href: link.href,
|
|
@@ -2048,13 +2222,13 @@ var MobileMenu = React29.forwardRef(
|
|
|
2048
2222
|
),
|
|
2049
2223
|
onClick: () => setIsMobileMenuOpen(false),
|
|
2050
2224
|
children: [
|
|
2051
|
-
link.icon && /* @__PURE__ */ (0,
|
|
2225
|
+
link.icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "inline-flex items-center mr-2", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { icon: link.icon, size: 16 }) }),
|
|
2052
2226
|
link.label
|
|
2053
2227
|
]
|
|
2054
2228
|
}
|
|
2055
2229
|
) }, link.href)) }),
|
|
2056
|
-
/* @__PURE__ */ (0,
|
|
2057
|
-
languageOptions.length > 0 && /* @__PURE__ */ (0,
|
|
2230
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "px-fluid-md py-fluid-md", children: [
|
|
2231
|
+
languageOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "mb-fluid-md", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2058
2232
|
LanguageSelect,
|
|
2059
2233
|
{
|
|
2060
2234
|
options: languageOptions,
|
|
@@ -2062,8 +2236,8 @@ var MobileMenu = React29.forwardRef(
|
|
|
2062
2236
|
onValueChange: onLanguageChange
|
|
2063
2237
|
}
|
|
2064
2238
|
) }),
|
|
2065
|
-
loginButton && /* @__PURE__ */ (0,
|
|
2066
|
-
ctaButton && /* @__PURE__ */ (0,
|
|
2239
|
+
loginButton && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "mb-fluid-md w-full", children: loginButton }),
|
|
2240
|
+
ctaButton && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "w-full", children: ctaButton })
|
|
2067
2241
|
] })
|
|
2068
2242
|
] })
|
|
2069
2243
|
}
|
|
@@ -2071,7 +2245,7 @@ var MobileMenu = React29.forwardRef(
|
|
|
2071
2245
|
}
|
|
2072
2246
|
);
|
|
2073
2247
|
MobileMenu.displayName = "MobileMenu";
|
|
2074
|
-
var Header =
|
|
2248
|
+
var Header = React31.forwardRef(
|
|
2075
2249
|
({
|
|
2076
2250
|
className,
|
|
2077
2251
|
variant,
|
|
@@ -2084,8 +2258,8 @@ var Header = React29.forwardRef(
|
|
|
2084
2258
|
onLanguageChange,
|
|
2085
2259
|
...props
|
|
2086
2260
|
}, ref) => {
|
|
2087
|
-
const [isMobileMenuOpen, setIsMobileMenuOpen] =
|
|
2088
|
-
|
|
2261
|
+
const [isMobileMenuOpen, setIsMobileMenuOpen] = React31.useState(false);
|
|
2262
|
+
React31.useEffect(() => {
|
|
2089
2263
|
if (isMobileMenuOpen) {
|
|
2090
2264
|
document.body.style.overflow = "hidden";
|
|
2091
2265
|
} else {
|
|
@@ -2095,12 +2269,12 @@ var Header = React29.forwardRef(
|
|
|
2095
2269
|
document.body.style.overflow = "unset";
|
|
2096
2270
|
};
|
|
2097
2271
|
}, [isMobileMenuOpen]);
|
|
2098
|
-
return /* @__PURE__ */ (0,
|
|
2099
|
-
/* @__PURE__ */ (0,
|
|
2100
|
-
/* @__PURE__ */ (0,
|
|
2101
|
-
/* @__PURE__ */ (0,
|
|
2102
|
-
/* @__PURE__ */ (0,
|
|
2103
|
-
/* @__PURE__ */ (0,
|
|
2272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(HeaderContext.Provider, { value: { isMobileMenuOpen, setIsMobileMenuOpen }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("header", { ref, className: cn(headerVariants({ variant }), className), ...props, children: [
|
|
2273
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Container, { size: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box, { direction: "row", align: "center", justify: "between", className: "h-16", children: [
|
|
2274
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(HeaderLogo, { children: logo || /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(BergetLogo, { variant: "logotype", color: "auto", size: 32 }) }),
|
|
2275
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(HeaderNav, { links }),
|
|
2276
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Box, { direction: "row", align: "center", gap: 3, children: [
|
|
2277
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2104
2278
|
HeaderActions,
|
|
2105
2279
|
{
|
|
2106
2280
|
languageOptions,
|
|
@@ -2110,11 +2284,11 @@ var Header = React29.forwardRef(
|
|
|
2110
2284
|
ctaButton
|
|
2111
2285
|
}
|
|
2112
2286
|
),
|
|
2113
|
-
ctaButton && /* @__PURE__ */ (0,
|
|
2114
|
-
/* @__PURE__ */ (0,
|
|
2287
|
+
ctaButton && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "md:hidden", children: ctaButton }),
|
|
2288
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MobileMenuButton, {})
|
|
2115
2289
|
] })
|
|
2116
2290
|
] }) }),
|
|
2117
|
-
/* @__PURE__ */ (0,
|
|
2291
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2118
2292
|
MobileMenu,
|
|
2119
2293
|
{
|
|
2120
2294
|
links,
|
|
@@ -2131,16 +2305,16 @@ var Header = React29.forwardRef(
|
|
|
2131
2305
|
Header.displayName = "Header";
|
|
2132
2306
|
|
|
2133
2307
|
// src/components/feature-cards/FeatureCards.tsx
|
|
2134
|
-
var
|
|
2308
|
+
var React34 = __toESM(require("react"), 1);
|
|
2135
2309
|
var import_class_variance_authority21 = require("class-variance-authority");
|
|
2136
2310
|
|
|
2137
2311
|
// src/components/list/List.tsx
|
|
2138
|
-
var
|
|
2312
|
+
var React33 = __toESM(require("react"), 1);
|
|
2139
2313
|
|
|
2140
2314
|
// src/components/divider/Divider.tsx
|
|
2141
|
-
var
|
|
2315
|
+
var React32 = __toESM(require("react"), 1);
|
|
2142
2316
|
var import_class_variance_authority20 = require("class-variance-authority");
|
|
2143
|
-
var
|
|
2317
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2144
2318
|
var dividerVariants = (0, import_class_variance_authority20.cva)("", {
|
|
2145
2319
|
variants: {
|
|
2146
2320
|
variant: {
|
|
@@ -2161,7 +2335,7 @@ var dividerVariants = (0, import_class_variance_authority20.cva)("", {
|
|
|
2161
2335
|
size: "thin"
|
|
2162
2336
|
}
|
|
2163
2337
|
});
|
|
2164
|
-
var Divider =
|
|
2338
|
+
var Divider = React32.forwardRef(
|
|
2165
2339
|
({
|
|
2166
2340
|
className,
|
|
2167
2341
|
orientation = "horizontal",
|
|
@@ -2172,16 +2346,16 @@ var Divider = React30.forwardRef(
|
|
|
2172
2346
|
...props
|
|
2173
2347
|
}, ref) => {
|
|
2174
2348
|
if (label) {
|
|
2175
|
-
return /* @__PURE__ */ (0,
|
|
2176
|
-
labelPosition !== "right" && /* @__PURE__ */ (0,
|
|
2349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { ref, className: cn("flex items-center w-full", className), ...props, children: [
|
|
2350
|
+
labelPosition !== "right" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2177
2351
|
Separator2,
|
|
2178
2352
|
{
|
|
2179
2353
|
orientation: "horizontal",
|
|
2180
2354
|
className: cn(dividerVariants({ variant, size }), "flex-1")
|
|
2181
2355
|
}
|
|
2182
2356
|
),
|
|
2183
|
-
/* @__PURE__ */ (0,
|
|
2184
|
-
labelPosition !== "left" && /* @__PURE__ */ (0,
|
|
2357
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Typography, { variant: "small", color: "muted", className: "px-4 whitespace-nowrap", children: label }),
|
|
2358
|
+
labelPosition !== "left" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2185
2359
|
Separator2,
|
|
2186
2360
|
{
|
|
2187
2361
|
orientation: "horizontal",
|
|
@@ -2190,7 +2364,7 @@ var Divider = React30.forwardRef(
|
|
|
2190
2364
|
)
|
|
2191
2365
|
] });
|
|
2192
2366
|
}
|
|
2193
|
-
return /* @__PURE__ */ (0,
|
|
2367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2194
2368
|
Separator2,
|
|
2195
2369
|
{
|
|
2196
2370
|
ref,
|
|
@@ -2208,19 +2382,19 @@ Divider.displayName = "Divider";
|
|
|
2208
2382
|
|
|
2209
2383
|
// src/components/list/List.tsx
|
|
2210
2384
|
var import_lucide_react8 = require("lucide-react");
|
|
2211
|
-
var
|
|
2212
|
-
var List =
|
|
2385
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2386
|
+
var List = React33.forwardRef(
|
|
2213
2387
|
({ className, children, ...props }, ref) => {
|
|
2214
|
-
const childrenArray =
|
|
2215
|
-
return /* @__PURE__ */ (0,
|
|
2388
|
+
const childrenArray = React33.Children.toArray(children);
|
|
2389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref, className: cn("flex flex-col", className), ...props, children: childrenArray.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(React33.Fragment, { children: [
|
|
2216
2390
|
child,
|
|
2217
|
-
index < childrenArray.length - 1 && /* @__PURE__ */ (0,
|
|
2391
|
+
index < childrenArray.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Divider, { variant: "subtle" })
|
|
2218
2392
|
] }, index)) });
|
|
2219
2393
|
}
|
|
2220
2394
|
);
|
|
2221
2395
|
List.displayName = "List";
|
|
2222
|
-
var ListItem =
|
|
2223
|
-
({ className, icon, children, interactive = true, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2396
|
+
var ListItem = React33.forwardRef(
|
|
2397
|
+
({ className, icon, children, interactive = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2224
2398
|
"div",
|
|
2225
2399
|
{
|
|
2226
2400
|
ref,
|
|
@@ -2231,15 +2405,15 @@ var ListItem = React31.forwardRef(
|
|
|
2231
2405
|
),
|
|
2232
2406
|
...props,
|
|
2233
2407
|
children: [
|
|
2234
|
-
icon && /* @__PURE__ */ (0,
|
|
2235
|
-
/* @__PURE__ */ (0,
|
|
2408
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex-shrink-0 flex items-center justify-center", children: icon }),
|
|
2409
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex-1 min-w-0", children })
|
|
2236
2410
|
]
|
|
2237
2411
|
}
|
|
2238
2412
|
)
|
|
2239
2413
|
);
|
|
2240
2414
|
ListItem.displayName = "ListItem";
|
|
2241
|
-
var ListHeader =
|
|
2242
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2415
|
+
var ListHeader = React33.forwardRef(
|
|
2416
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2243
2417
|
"div",
|
|
2244
2418
|
{
|
|
2245
2419
|
ref,
|
|
@@ -2250,18 +2424,18 @@ var ListHeader = React31.forwardRef(
|
|
|
2250
2424
|
)
|
|
2251
2425
|
);
|
|
2252
2426
|
ListHeader.displayName = "ListHeader";
|
|
2253
|
-
var FeatureList =
|
|
2427
|
+
var FeatureList = React33.forwardRef(
|
|
2254
2428
|
({ items, variant = "bullet", className, ...props }, ref) => {
|
|
2255
|
-
return /* @__PURE__ */ (0,
|
|
2256
|
-
variant === "bullet" ? /* @__PURE__ */ (0,
|
|
2257
|
-
/* @__PURE__ */ (0,
|
|
2429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("ul", { ref, className: cn("flex flex-col gap-fluid-md", className), ...props, children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("li", { className: "flex items-start gap-fluid-md", children: [
|
|
2430
|
+
variant === "bullet" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-berget-icon-muted flex-shrink-0 mt-2" }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Icon, { icon: import_lucide_react8.Check, size: 24, className: "text-berget-logo-light" }) }),
|
|
2431
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Typography, { variant: "body", color: "muted", children: item })
|
|
2258
2432
|
] }, index)) });
|
|
2259
2433
|
}
|
|
2260
2434
|
);
|
|
2261
2435
|
FeatureList.displayName = "FeatureList";
|
|
2262
2436
|
|
|
2263
2437
|
// src/components/feature-cards/FeatureCards.tsx
|
|
2264
|
-
var
|
|
2438
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2265
2439
|
var featureCardVariants = (0, import_class_variance_authority21.cva)("", {
|
|
2266
2440
|
variants: {
|
|
2267
2441
|
variant: {
|
|
@@ -2274,7 +2448,7 @@ var featureCardVariants = (0, import_class_variance_authority21.cva)("", {
|
|
|
2274
2448
|
variant: "highlight"
|
|
2275
2449
|
}
|
|
2276
2450
|
});
|
|
2277
|
-
var FeatureCard =
|
|
2451
|
+
var FeatureCard = React34.forwardRef(
|
|
2278
2452
|
({
|
|
2279
2453
|
className,
|
|
2280
2454
|
variant = "highlight",
|
|
@@ -2289,23 +2463,23 @@ var FeatureCard = React32.forwardRef(
|
|
|
2289
2463
|
columns: _columns,
|
|
2290
2464
|
...props
|
|
2291
2465
|
}, ref) => {
|
|
2292
|
-
return /* @__PURE__ */ (0,
|
|
2466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2293
2467
|
Card2,
|
|
2294
2468
|
{
|
|
2295
2469
|
ref,
|
|
2296
2470
|
variant,
|
|
2297
2471
|
className: cn("w-full py-fluid-lg px-fluid-md", className),
|
|
2298
2472
|
...props,
|
|
2299
|
-
children: /* @__PURE__ */ (0,
|
|
2300
|
-
(Icon3 || badge) && /* @__PURE__ */ (0,
|
|
2301
|
-
Icon3 && /* @__PURE__ */ (0,
|
|
2473
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col items-start gap-fluid-md", children: [
|
|
2474
|
+
(Icon3 || badge) && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-between w-full", children: [
|
|
2475
|
+
Icon3 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex h-7 w-7 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2302
2476
|
Icon3,
|
|
2303
2477
|
{
|
|
2304
2478
|
className: cn("h-7 w-7", iconColor || "text-foreground"),
|
|
2305
2479
|
strokeWidth: 1.5
|
|
2306
2480
|
}
|
|
2307
2481
|
) }),
|
|
2308
|
-
badge && /* @__PURE__ */ (0,
|
|
2482
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex h-6 items-center justify-start px-6 bg-berget-feature-card-badge-bg rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2309
2483
|
Typography,
|
|
2310
2484
|
{
|
|
2311
2485
|
variant: "body",
|
|
@@ -2315,10 +2489,10 @@ var FeatureCard = React32.forwardRef(
|
|
|
2315
2489
|
}
|
|
2316
2490
|
) })
|
|
2317
2491
|
] }),
|
|
2318
|
-
/* @__PURE__ */ (0,
|
|
2319
|
-
/* @__PURE__ */ (0,
|
|
2320
|
-
items && items.length > 0 && /* @__PURE__ */ (0,
|
|
2321
|
-
linkText && linkHref && /* @__PURE__ */ (0,
|
|
2492
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Typography, { variant: "h3", className: "text-foreground", children: title }),
|
|
2493
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Typography, { variant: "body", className: "text-foreground/80", children: description }),
|
|
2494
|
+
items && items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FeatureList, { items, variant: "bullet" }),
|
|
2495
|
+
linkText && linkHref && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("a", { href: linkHref, className: "text-p font-p leading-p text-berget-accent", children: [
|
|
2322
2496
|
linkText,
|
|
2323
2497
|
" \u2192"
|
|
2324
2498
|
] })
|
|
@@ -2328,9 +2502,9 @@ var FeatureCard = React32.forwardRef(
|
|
|
2328
2502
|
}
|
|
2329
2503
|
);
|
|
2330
2504
|
FeatureCard.displayName = "FeatureCard";
|
|
2331
|
-
var FeatureCards =
|
|
2505
|
+
var FeatureCards = React34.forwardRef(
|
|
2332
2506
|
({ features, columns = 3, className }, ref) => {
|
|
2333
|
-
return /* @__PURE__ */ (0,
|
|
2507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2334
2508
|
"div",
|
|
2335
2509
|
{
|
|
2336
2510
|
ref,
|
|
@@ -2343,7 +2517,7 @@ var FeatureCards = React32.forwardRef(
|
|
|
2343
2517
|
columns === 4 && "grid-cols-1 md:grid-cols-2 lg:grid-cols-4",
|
|
2344
2518
|
className
|
|
2345
2519
|
),
|
|
2346
|
-
children: features.map((feature, index) => /* @__PURE__ */ (0,
|
|
2520
|
+
children: features.map((feature, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FeatureCard, { ...feature }, index))
|
|
2347
2521
|
}
|
|
2348
2522
|
);
|
|
2349
2523
|
}
|
|
@@ -2351,9 +2525,9 @@ var FeatureCards = React32.forwardRef(
|
|
|
2351
2525
|
FeatureCards.displayName = "FeatureCards";
|
|
2352
2526
|
|
|
2353
2527
|
// src/components/hero-block/HeroBlock.tsx
|
|
2354
|
-
var
|
|
2528
|
+
var React35 = __toESM(require("react"), 1);
|
|
2355
2529
|
var import_class_variance_authority22 = require("class-variance-authority");
|
|
2356
|
-
var
|
|
2530
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2357
2531
|
var heroBlockVariants = (0, import_class_variance_authority22.cva)(
|
|
2358
2532
|
"relative overflow-hidden min-h-[40dvh] flex items-center py-fluid-2xl",
|
|
2359
2533
|
{
|
|
@@ -2374,7 +2548,7 @@ var heroBlockVariants = (0, import_class_variance_authority22.cva)(
|
|
|
2374
2548
|
}
|
|
2375
2549
|
}
|
|
2376
2550
|
);
|
|
2377
|
-
var HeroBlock =
|
|
2551
|
+
var HeroBlock = React35.forwardRef(
|
|
2378
2552
|
({
|
|
2379
2553
|
className,
|
|
2380
2554
|
variant,
|
|
@@ -2386,26 +2560,26 @@ var HeroBlock = React33.forwardRef(
|
|
|
2386
2560
|
actions,
|
|
2387
2561
|
...props
|
|
2388
2562
|
}, ref) => {
|
|
2389
|
-
return /* @__PURE__ */ (0,
|
|
2563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2390
2564
|
"div",
|
|
2391
2565
|
{
|
|
2392
2566
|
ref,
|
|
2393
2567
|
className: cn(heroBlockVariants({ variant, withPattern }), className),
|
|
2394
2568
|
...props,
|
|
2395
|
-
children: /* @__PURE__ */ (0,
|
|
2396
|
-
tagline && /* @__PURE__ */ (0,
|
|
2569
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "mx-auto px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mx-auto text-center max-w-4xl", children: [
|
|
2570
|
+
tagline && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2397
2571
|
Badge,
|
|
2398
2572
|
{
|
|
2399
2573
|
variant: "default",
|
|
2400
|
-
icon: TaglineIcon ? /* @__PURE__ */ (0,
|
|
2574
|
+
icon: TaglineIcon ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon, { icon: TaglineIcon, size: 16 }) : void 0,
|
|
2401
2575
|
iconGap: 2,
|
|
2402
2576
|
className: "mb-fluid-md",
|
|
2403
2577
|
children: tagline
|
|
2404
2578
|
}
|
|
2405
2579
|
),
|
|
2406
|
-
/* @__PURE__ */ (0,
|
|
2407
|
-
/* @__PURE__ */ (0,
|
|
2408
|
-
actions && /* @__PURE__ */ (0,
|
|
2580
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Typography, { variant: "h1", className: "mb-fluid-md", children: title }),
|
|
2581
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Typography, { variant: "h3", color: "muted", className: "mb-fluid-lg", children: description }),
|
|
2582
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex flex-wrap gap-fluid-md justify-center", children: actions })
|
|
2409
2583
|
] }) })
|
|
2410
2584
|
}
|
|
2411
2585
|
);
|
|
@@ -2413,66 +2587,6 @@ var HeroBlock = React33.forwardRef(
|
|
|
2413
2587
|
);
|
|
2414
2588
|
HeroBlock.displayName = "HeroBlock";
|
|
2415
2589
|
|
|
2416
|
-
// src/components/stat-card/StatCard.tsx
|
|
2417
|
-
var React34 = __toESM(require("react"), 1);
|
|
2418
|
-
var import_class_variance_authority23 = require("class-variance-authority");
|
|
2419
|
-
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2420
|
-
var statCardVariants = (0, import_class_variance_authority23.cva)("", {
|
|
2421
|
-
variants: {
|
|
2422
|
-
variant: {
|
|
2423
|
-
highlight: "",
|
|
2424
|
-
glass: "",
|
|
2425
|
-
solid: ""
|
|
2426
|
-
}
|
|
2427
|
-
},
|
|
2428
|
-
defaultVariants: {
|
|
2429
|
-
variant: "highlight"
|
|
2430
|
-
}
|
|
2431
|
-
});
|
|
2432
|
-
var StatCard = React34.forwardRef(
|
|
2433
|
-
({
|
|
2434
|
-
className,
|
|
2435
|
-
variant = "highlight",
|
|
2436
|
-
icon: Icon3,
|
|
2437
|
-
iconColor,
|
|
2438
|
-
title,
|
|
2439
|
-
description,
|
|
2440
|
-
stats,
|
|
2441
|
-
badge: _badge,
|
|
2442
|
-
...props
|
|
2443
|
-
}, ref) => {
|
|
2444
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2445
|
-
Card2,
|
|
2446
|
-
{
|
|
2447
|
-
ref,
|
|
2448
|
-
variant,
|
|
2449
|
-
className: cn("w-full py-fluid-lg px-fluid-md", className),
|
|
2450
|
-
...props,
|
|
2451
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col h-full gap-fluid-md", children: [
|
|
2452
|
-
Icon3 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex h-7 w-7 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2453
|
-
Icon3,
|
|
2454
|
-
{
|
|
2455
|
-
className: cn("h-7 w-7", iconColor || "text-berget-foreground"),
|
|
2456
|
-
strokeWidth: 1.5
|
|
2457
|
-
}
|
|
2458
|
-
) }),
|
|
2459
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Typography, { variant: "h3", as: "h3", className: "text-berget-foreground", children: title }),
|
|
2460
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2461
|
-
Typography,
|
|
2462
|
-
{
|
|
2463
|
-
variant: "body",
|
|
2464
|
-
className: "text-berget-foreground/80 leading-relaxed flex-grow",
|
|
2465
|
-
children: description
|
|
2466
|
-
}
|
|
2467
|
-
),
|
|
2468
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Typography, { variant: "small", as: "div", className: "font-medium text-berget-foreground", children: stats })
|
|
2469
|
-
] })
|
|
2470
|
-
}
|
|
2471
|
-
);
|
|
2472
|
-
}
|
|
2473
|
-
);
|
|
2474
|
-
StatCard.displayName = "StatCard";
|
|
2475
|
-
|
|
2476
2590
|
// src/components/code-block/CodeBlock.tsx
|
|
2477
2591
|
var import_react2 = require("react");
|
|
2478
2592
|
var import_lucide_react9 = require("lucide-react");
|
|
@@ -2601,7 +2715,7 @@ function getHighlighter() {
|
|
|
2601
2715
|
}
|
|
2602
2716
|
|
|
2603
2717
|
// src/components/code-block/CodeBlock.tsx
|
|
2604
|
-
var
|
|
2718
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2605
2719
|
function CodeBlock({ code, language = "text", title, className }) {
|
|
2606
2720
|
const [html, setHtml] = (0, import_react2.useState)(null);
|
|
2607
2721
|
const [copied, setCopied] = (0, import_react2.useState)(false);
|
|
@@ -2617,16 +2731,16 @@ function CodeBlock({ code, language = "text", title, className }) {
|
|
|
2617
2731
|
setCopied(true);
|
|
2618
2732
|
setTimeout(() => setCopied(false), 2e3);
|
|
2619
2733
|
}, [code]);
|
|
2620
|
-
const copyButton = /* @__PURE__ */ (0,
|
|
2734
|
+
const copyButton = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2621
2735
|
"button",
|
|
2622
2736
|
{
|
|
2623
2737
|
onClick: handleCopy,
|
|
2624
2738
|
className: "flex items-center justify-center w-6 h-6 text-berget-muted-foreground hover:text-berget-foreground transition-colors",
|
|
2625
2739
|
"aria-label": "Copy code",
|
|
2626
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
2740
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react9.Check, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react9.Copy, { className: "w-3.5 h-3.5" })
|
|
2627
2741
|
}
|
|
2628
2742
|
);
|
|
2629
|
-
return /* @__PURE__ */ (0,
|
|
2743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2630
2744
|
"div",
|
|
2631
2745
|
{
|
|
2632
2746
|
className: cn(
|
|
@@ -2634,15 +2748,15 @@ function CodeBlock({ code, language = "text", title, className }) {
|
|
|
2634
2748
|
className
|
|
2635
2749
|
),
|
|
2636
2750
|
children: [
|
|
2637
|
-
title && /* @__PURE__ */ (0,
|
|
2638
|
-
/* @__PURE__ */ (0,
|
|
2639
|
-
html ? /* @__PURE__ */ (0,
|
|
2751
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "!h-10 flex items-center !px-4 !text-xs !leading-normal border-b border-berget-border bg-berget-codeblock-header-bg", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-berget-muted-foreground", children: title }) }),
|
|
2752
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "absolute right-2 top-2 z-10", children: copyButton }),
|
|
2753
|
+
html ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2640
2754
|
"div",
|
|
2641
2755
|
{
|
|
2642
2756
|
className: "[&_.shiki]:!p-4 [&_.shiki]:!m-0 [&_.shiki]:overflow-x-auto [&_.shiki]:!text-sm [&_.shiki]:!leading-relaxed [&_.shiki]:bg-transparent",
|
|
2643
2757
|
dangerouslySetInnerHTML: { __html: html }
|
|
2644
2758
|
}
|
|
2645
|
-
) : /* @__PURE__ */ (0,
|
|
2759
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("pre", { className: "!p-4 !m-0 overflow-x-auto !text-sm !leading-relaxed text-berget-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("code", { children: code }) })
|
|
2646
2760
|
]
|
|
2647
2761
|
}
|
|
2648
2762
|
);
|
|
@@ -2694,9 +2808,10 @@ function CodeBlock({ code, language = "text", title, className }) {
|
|
|
2694
2808
|
Section,
|
|
2695
2809
|
SectionHeader,
|
|
2696
2810
|
Select,
|
|
2697
|
-
StatCard,
|
|
2698
2811
|
Switch,
|
|
2699
2812
|
TextArea,
|
|
2813
|
+
ThemeProvider,
|
|
2814
|
+
ThemeToggle,
|
|
2700
2815
|
Typography,
|
|
2701
2816
|
alertVariants,
|
|
2702
2817
|
badgeVariants,
|
|
@@ -2712,6 +2827,7 @@ function CodeBlock({ code, language = "text", title, className }) {
|
|
|
2712
2827
|
switchRootVariants,
|
|
2713
2828
|
switchThumbVariants,
|
|
2714
2829
|
textAreaVariants,
|
|
2715
|
-
typographyVariants
|
|
2830
|
+
typographyVariants,
|
|
2831
|
+
useTheme
|
|
2716
2832
|
});
|
|
2717
2833
|
//# sourceMappingURL=index.cjs.map
|