@bergetai/ui 0.11.0 → 0.11.2
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 +44 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +43 -1
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +6 -31
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -45,7 +45,7 @@ declare const buttonVariants: (props?: ({
|
|
|
45
45
|
declare function Button$1({ className, variant, size, ...props }: Button$2.Props & VariantProps<typeof buttonVariants>): react_jsx_runtime.JSX.Element;
|
|
46
46
|
|
|
47
47
|
/** Variants exposed by the Berget wrapper. */
|
|
48
|
-
type CustomVariant = 'default' | 'primary' | 'destructive' | 'link';
|
|
48
|
+
type CustomVariant = 'default' | 'primary' | 'destructive' | 'outline' | 'link';
|
|
49
49
|
/** Props for the Berget Button wrapper. */
|
|
50
50
|
interface ButtonProps extends Omit<React$1.ComponentProps<typeof Button$1>, 'variant' | 'ref'> {
|
|
51
51
|
/** Visual style variant. `primary` is Berget-specific. */
|
|
@@ -70,6 +70,7 @@ declare const Typography: React$1.ForwardRefExoticComponent<TypographyProps & Re
|
|
|
70
70
|
declare function CardHeader({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
71
71
|
declare function CardTitle({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
72
72
|
declare function CardDescription({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
73
|
+
declare function CardAction({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
73
74
|
declare function CardContent({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
74
75
|
declare function CardFooter({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
75
76
|
|
|
@@ -672,4 +673,4 @@ interface FogIllustrationProps {
|
|
|
672
673
|
}
|
|
673
674
|
declare const FogIllustration: ({ palette, speed, className }: FogIllustrationProps) => react_jsx_runtime.JSX.Element;
|
|
674
675
|
|
|
675
|
-
export { Alert, AlertDescription, type AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTitleProps, Badge, type BadgeProps, BergetLogo, type BergetLogoProps, Box, type BoxProps, type SpacingScale as BoxSpacingScale, Button, type ButtonProps, COUNTRIES, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockProps, Container, type ContainerProps, type Country, CountrySelect, type CountrySelectProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EU_COUNTRY_CODES, FOG_BRAND_PALETTE, FeatureList, type FeatureListProps, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FogIllustration, type FogIllustrationProps, type FogPalette, Grid, type GridColsScale, type GridProps, type GridRowsScale, type SpacingScale$1 as GridSpacingScale, Icon, type IconProps, Input, type InputProps, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, type ItemProps, ItemSeparator, ItemTitle, Label, LanguageSelect, type LanguageSelectOption, type LanguageSelectProps, Link, type LinkProps, List, ListHeader, type ListHeaderProps, ListItem, type ListItemProps, type ListProps, ModelCard, type ModelCardProps, type ModelCategory, type ModelLifecycle, ModelLogo, type ModelLogoProps, type ModelLogoProvider, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, Select, type SelectOption, type SelectProps, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, type TerminalExample, TextArea, type TextAreaProps, type Theme, ThemeProvider, type ThemeProviderProps, ThemeToggle, type ThemeToggleProps, Typography, type TypographyProps, WindowFrame, type WindowFrameProps, type WindowTab, alertVariants, badgeVariants, boxVariants, buttonVariants, cardVariants, categoryLabels, checkboxVariants, containerVariants, getCountryByCode, getCountryByName, gridVariants, isEUCountry, linkVariants, navigationMenuTriggerStyle, selectVariants, switchRootVariants, switchThumbVariants, textAreaVariants, typographyVariants, useTheme };
|
|
676
|
+
export { Alert, AlertDescription, type AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTitleProps, Badge, type BadgeProps, BergetLogo, type BergetLogoProps, Box, type BoxProps, type SpacingScale as BoxSpacingScale, Button, type ButtonProps, COUNTRIES, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockProps, Container, type ContainerProps, type Country, CountrySelect, type CountrySelectProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EU_COUNTRY_CODES, FOG_BRAND_PALETTE, FeatureList, type FeatureListProps, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FogIllustration, type FogIllustrationProps, type FogPalette, Grid, type GridColsScale, type GridProps, type GridRowsScale, type SpacingScale$1 as GridSpacingScale, Icon, type IconProps, Input, type InputProps, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, type ItemProps, ItemSeparator, ItemTitle, Label, LanguageSelect, type LanguageSelectOption, type LanguageSelectProps, Link, type LinkProps, List, ListHeader, type ListHeaderProps, ListItem, type ListItemProps, type ListProps, ModelCard, type ModelCardProps, type ModelCategory, type ModelLifecycle, ModelLogo, type ModelLogoProps, type ModelLogoProvider, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, Select, type SelectOption, type SelectProps, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, type TerminalExample, TextArea, type TextAreaProps, type Theme, ThemeProvider, type ThemeProviderProps, ThemeToggle, type ThemeToggleProps, Typography, type TypographyProps, WindowFrame, type WindowFrameProps, type WindowTab, alertVariants, badgeVariants, boxVariants, buttonVariants, cardVariants, categoryLabels, checkboxVariants, containerVariants, getCountryByCode, getCountryByName, gridVariants, isEUCountry, linkVariants, navigationMenuTriggerStyle, selectVariants, switchRootVariants, switchThumbVariants, textAreaVariants, typographyVariants, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ declare const buttonVariants: (props?: ({
|
|
|
45
45
|
declare function Button$1({ className, variant, size, ...props }: Button$2.Props & VariantProps<typeof buttonVariants>): react_jsx_runtime.JSX.Element;
|
|
46
46
|
|
|
47
47
|
/** Variants exposed by the Berget wrapper. */
|
|
48
|
-
type CustomVariant = 'default' | 'primary' | 'destructive' | 'link';
|
|
48
|
+
type CustomVariant = 'default' | 'primary' | 'destructive' | 'outline' | 'link';
|
|
49
49
|
/** Props for the Berget Button wrapper. */
|
|
50
50
|
interface ButtonProps extends Omit<React$1.ComponentProps<typeof Button$1>, 'variant' | 'ref'> {
|
|
51
51
|
/** Visual style variant. `primary` is Berget-specific. */
|
|
@@ -70,6 +70,7 @@ declare const Typography: React$1.ForwardRefExoticComponent<TypographyProps & Re
|
|
|
70
70
|
declare function CardHeader({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
71
71
|
declare function CardTitle({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
72
72
|
declare function CardDescription({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
73
|
+
declare function CardAction({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
73
74
|
declare function CardContent({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
74
75
|
declare function CardFooter({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
75
76
|
|
|
@@ -672,4 +673,4 @@ interface FogIllustrationProps {
|
|
|
672
673
|
}
|
|
673
674
|
declare const FogIllustration: ({ palette, speed, className }: FogIllustrationProps) => react_jsx_runtime.JSX.Element;
|
|
674
675
|
|
|
675
|
-
export { Alert, AlertDescription, type AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTitleProps, Badge, type BadgeProps, BergetLogo, type BergetLogoProps, Box, type BoxProps, type SpacingScale as BoxSpacingScale, Button, type ButtonProps, COUNTRIES, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockProps, Container, type ContainerProps, type Country, CountrySelect, type CountrySelectProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EU_COUNTRY_CODES, FOG_BRAND_PALETTE, FeatureList, type FeatureListProps, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FogIllustration, type FogIllustrationProps, type FogPalette, Grid, type GridColsScale, type GridProps, type GridRowsScale, type SpacingScale$1 as GridSpacingScale, Icon, type IconProps, Input, type InputProps, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, type ItemProps, ItemSeparator, ItemTitle, Label, LanguageSelect, type LanguageSelectOption, type LanguageSelectProps, Link, type LinkProps, List, ListHeader, type ListHeaderProps, ListItem, type ListItemProps, type ListProps, ModelCard, type ModelCardProps, type ModelCategory, type ModelLifecycle, ModelLogo, type ModelLogoProps, type ModelLogoProvider, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, Select, type SelectOption, type SelectProps, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, type TerminalExample, TextArea, type TextAreaProps, type Theme, ThemeProvider, type ThemeProviderProps, ThemeToggle, type ThemeToggleProps, Typography, type TypographyProps, WindowFrame, type WindowFrameProps, type WindowTab, alertVariants, badgeVariants, boxVariants, buttonVariants, cardVariants, categoryLabels, checkboxVariants, containerVariants, getCountryByCode, getCountryByName, gridVariants, isEUCountry, linkVariants, navigationMenuTriggerStyle, selectVariants, switchRootVariants, switchThumbVariants, textAreaVariants, typographyVariants, useTheme };
|
|
676
|
+
export { Alert, AlertDescription, type AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTitleProps, Badge, type BadgeProps, BergetLogo, type BergetLogoProps, Box, type BoxProps, type SpacingScale as BoxSpacingScale, Button, type ButtonProps, COUNTRIES, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockProps, Container, type ContainerProps, type Country, CountrySelect, type CountrySelectProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EU_COUNTRY_CODES, FOG_BRAND_PALETTE, FeatureList, type FeatureListProps, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FogIllustration, type FogIllustrationProps, type FogPalette, Grid, type GridColsScale, type GridProps, type GridRowsScale, type SpacingScale$1 as GridSpacingScale, Icon, type IconProps, Input, type InputProps, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, type ItemProps, ItemSeparator, ItemTitle, Label, LanguageSelect, type LanguageSelectOption, type LanguageSelectProps, Link, type LinkProps, List, ListHeader, type ListHeaderProps, ListItem, type ListItemProps, type ListProps, ModelCard, type ModelCardProps, type ModelCategory, type ModelLifecycle, ModelLogo, type ModelLogoProps, type ModelLogoProvider, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, Select, type SelectOption, type SelectProps, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, type TerminalExample, TextArea, type TextAreaProps, type Theme, ThemeProvider, type ThemeProviderProps, ThemeToggle, type ThemeToggleProps, Typography, type TypographyProps, WindowFrame, type WindowFrameProps, type WindowTab, alertVariants, badgeVariants, boxVariants, buttonVariants, cardVariants, categoryLabels, checkboxVariants, containerVariants, getCountryByCode, getCountryByName, gridVariants, isEUCountry, linkVariants, navigationMenuTriggerStyle, selectVariants, switchRootVariants, switchThumbVariants, textAreaVariants, typographyVariants, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -301,9 +301,28 @@ function brandVariantClasses(variant) {
|
|
|
301
301
|
disabledClasses,
|
|
302
302
|
"disabled:bg-berget-button-destructive-disabled-bg"
|
|
303
303
|
);
|
|
304
|
+
case "outline":
|
|
305
|
+
return cn(
|
|
306
|
+
// Transparent fill with a theme-foreground-derived border (25% of the
|
|
307
|
+
// foreground). The state treatment is static: hover, press and
|
|
308
|
+
// keyboard focus render identically to rest — only the shared focus
|
|
309
|
+
// outline and the disabled treatment deviate.
|
|
310
|
+
"bg-transparent border-berget-button-outline-border text-berget-button-outline-fg",
|
|
311
|
+
// Hover: slight brightening (hover bg token); the border and
|
|
312
|
+
// foreground stay at rest. The dark:hover twin also neutralises
|
|
313
|
+
// the primitive ghost's dark:hover:bg-muted/50. Pressed drops the
|
|
314
|
+
// fill back to transparent (a pressed element is still hovered, so
|
|
315
|
+
// an explicit active override is needed in both colour schemes).
|
|
316
|
+
"hover:bg-berget-button-outline-hover dark:hover:bg-berget-button-outline-hover",
|
|
317
|
+
"active:bg-transparent dark:active:bg-transparent",
|
|
318
|
+
// Keep the resting border on focus — the shared outline is the indicator.
|
|
319
|
+
"focus-visible:border-berget-button-outline-border",
|
|
320
|
+
disabledClasses,
|
|
321
|
+
"disabled:bg-transparent disabled:border-berget-button-disabled-border"
|
|
322
|
+
);
|
|
304
323
|
case "link":
|
|
305
324
|
return cn(
|
|
306
|
-
"h-auto bg-transparent p-0 text-berget-button-link-fg underline-offset-4 shadow-none",
|
|
325
|
+
"h-auto bg-transparent p-0 text-berget-button-link-fg font-medium underline-offset-4 shadow-none",
|
|
307
326
|
"hover:bg-transparent hover:text-berget-button-link-hover-fg",
|
|
308
327
|
// On press, return to the resting foreground (hover fg otherwise sticks).
|
|
309
328
|
"active:text-berget-button-link-fg",
|
|
@@ -334,6 +353,7 @@ function primitiveVariant(variant) {
|
|
|
334
353
|
switch (variant) {
|
|
335
354
|
case "primary":
|
|
336
355
|
case "destructive":
|
|
356
|
+
case "outline":
|
|
337
357
|
return "ghost";
|
|
338
358
|
default:
|
|
339
359
|
return variant;
|
|
@@ -362,6 +382,14 @@ function Button2({
|
|
|
362
382
|
// larger button text. h-auto drops the primitive's fixed h-* so the
|
|
363
383
|
// vertical paddings take effect.
|
|
364
384
|
!isLink && !isIcon && "py-[0.57em] px-[1.14em] h-auto",
|
|
385
|
+
// Text ladder: size = typography scale; the em-based padding above
|
|
386
|
+
// follows automatically, so no per-size paddings are needed. Only
|
|
387
|
+
// default/lg/sm need overrides — xs keeps the primitive's text-xs.
|
|
388
|
+
!isLink && !isIcon && (size === "lg" ? "text-lg" : size === "sm" ? "text-sm" : size === "xs" ? "" : "text-base"),
|
|
389
|
+
// Normal weight for every non-link variant — tailwind-merge strips the
|
|
390
|
+
// primitive's font-medium (font-weight: var(--font-weight-medium)); the
|
|
391
|
+
// link variant keeps medium via its own classes above.
|
|
392
|
+
!isLink && "font-normal",
|
|
365
393
|
brandVariantClasses(variant),
|
|
366
394
|
interactionClasses,
|
|
367
395
|
!isLink && width === "full" && "w-full",
|
|
@@ -514,6 +542,19 @@ function CardDescription({ className, ...props }) {
|
|
|
514
542
|
}
|
|
515
543
|
);
|
|
516
544
|
}
|
|
545
|
+
function CardAction({ className, ...props }) {
|
|
546
|
+
return /* @__PURE__ */ jsx6(
|
|
547
|
+
"div",
|
|
548
|
+
{
|
|
549
|
+
"data-slot": "card-action",
|
|
550
|
+
className: cn3(
|
|
551
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
552
|
+
className
|
|
553
|
+
),
|
|
554
|
+
...props
|
|
555
|
+
}
|
|
556
|
+
);
|
|
557
|
+
}
|
|
517
558
|
function CardContent({ className, ...props }) {
|
|
518
559
|
return /* @__PURE__ */ jsx6(
|
|
519
560
|
"div",
|
|
@@ -4364,6 +4405,7 @@ export {
|
|
|
4364
4405
|
Button2 as Button,
|
|
4365
4406
|
COUNTRIES,
|
|
4366
4407
|
Card2 as Card,
|
|
4408
|
+
CardAction,
|
|
4367
4409
|
CardContent,
|
|
4368
4410
|
CardDescription,
|
|
4369
4411
|
CardFooter,
|