@bergetai/ui 0.18.0 → 0.19.1

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.
Files changed (60) hide show
  1. package/dist/components/alert-dialog/AlertDialog.cjs +3 -3
  2. package/dist/components/alert-dialog/AlertDialog.cjs.map +1 -1
  3. package/dist/components/alert-dialog/AlertDialog.d.cts +3 -3
  4. package/dist/components/alert-dialog/AlertDialog.d.mts +3 -3
  5. package/dist/components/alert-dialog/AlertDialog.mjs +3 -3
  6. package/dist/components/alert-dialog/AlertDialog.mjs.map +1 -1
  7. package/dist/components/box/Box.cjs.map +1 -1
  8. package/dist/components/box/Box.d.cts +3 -3
  9. package/dist/components/box/Box.d.mts +3 -3
  10. package/dist/components/box/Box.mjs.map +1 -1
  11. package/dist/components/button/Button.cjs +3 -1
  12. package/dist/components/button/Button.cjs.map +1 -1
  13. package/dist/components/button/Button.d.cts +1 -1
  14. package/dist/components/button/Button.d.mts +1 -1
  15. package/dist/components/button/Button.mjs +3 -1
  16. package/dist/components/button/Button.mjs.map +1 -1
  17. package/dist/components/container/Container.cjs.map +1 -1
  18. package/dist/components/container/Container.d.cts +1 -1
  19. package/dist/components/container/Container.d.mts +1 -1
  20. package/dist/components/container/Container.mjs.map +1 -1
  21. package/dist/components/country-select/CountrySelect.cjs +2 -2
  22. package/dist/components/country-select/CountrySelect.cjs.map +1 -1
  23. package/dist/components/country-select/CountrySelect.mjs +2 -2
  24. package/dist/components/country-select/CountrySelect.mjs.map +1 -1
  25. package/dist/components/dialog/Dialog.cjs +3 -3
  26. package/dist/components/dialog/Dialog.cjs.map +1 -1
  27. package/dist/components/dialog/Dialog.d.cts +1 -1
  28. package/dist/components/dialog/Dialog.d.mts +1 -1
  29. package/dist/components/dialog/Dialog.mjs +3 -3
  30. package/dist/components/dialog/Dialog.mjs.map +1 -1
  31. package/dist/components/dropdown-menu/DropdownMenu.cjs.map +1 -1
  32. package/dist/components/dropdown-menu/DropdownMenu.d.cts +9 -9
  33. package/dist/components/dropdown-menu/DropdownMenu.d.mts +9 -9
  34. package/dist/components/dropdown-menu/DropdownMenu.mjs.map +1 -1
  35. package/dist/components/grid/Grid.cjs.map +1 -1
  36. package/dist/components/grid/Grid.d.cts +3 -3
  37. package/dist/components/grid/Grid.d.mts +3 -3
  38. package/dist/components/grid/Grid.mjs.map +1 -1
  39. package/dist/components/item/Item.cjs.map +1 -1
  40. package/dist/components/item/Item.d.cts +1 -1
  41. package/dist/components/item/Item.d.mts +1 -1
  42. package/dist/components/item/Item.mjs.map +1 -1
  43. package/dist/components/typography/Typography.d.cts +1 -1
  44. package/dist/components/typography/Typography.d.mts +1 -1
  45. package/dist/index.cjs +2 -0
  46. package/dist/index.d.cts +2 -1
  47. package/dist/index.d.mts +2 -1
  48. package/dist/index.mjs +2 -1
  49. package/dist/lib/utils.cjs +4 -4
  50. package/dist/lib/utils.cjs.map +1 -1
  51. package/dist/lib/utils.d.cts +6 -0
  52. package/dist/lib/utils.d.cts.map +1 -0
  53. package/dist/lib/utils.d.mts +6 -0
  54. package/dist/lib/utils.d.mts.map +1 -0
  55. package/dist/lib/utils.mjs +4 -4
  56. package/dist/lib/utils.mjs.map +1 -1
  57. package/dist/primitives/button.d.cts +1 -1
  58. package/dist/primitives/button.d.mts +1 -1
  59. package/dist/styles/index.css +99 -0
  60. package/package.json +1 -1
@@ -50,7 +50,7 @@ const CountrySelect = React.forwardRef(({ value, onValueChange, placeholder = "S
50
50
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
51
51
  icon: Globe,
52
52
  size: 16,
53
- className: "shrink-0 text-berget-muted-foreground"
53
+ className: "\n shrink-0 text-berget-muted-foreground\n "
54
54
  }), /* @__PURE__ */ jsx("span", {
55
55
  className: "truncate text-berget-muted-foreground",
56
56
  children: placeholder
@@ -63,7 +63,7 @@ const CountrySelect = React.forwardRef(({ value, onValueChange, placeholder = "S
63
63
  }), /* @__PURE__ */ jsx(PopoverContent, {
64
64
  align,
65
65
  sideOffset,
66
- className: "w-(--radix-popover-trigger-width) p-0",
66
+ className: "\n w-(--trigger-width) p-0\n ",
67
67
  children: /* @__PURE__ */ jsxs(Command, { children: [/* @__PURE__ */ jsx(CommandInput, { placeholder: "Search country..." }), /* @__PURE__ */ jsxs(CommandList, { children: [/* @__PURE__ */ jsx(CommandEmpty, { children: "No countries found." }), /* @__PURE__ */ jsx(CommandGroup, { children: COUNTRIES.map((country) => /* @__PURE__ */ jsxs(CommandItem, {
68
68
  value: `${country.name} ${country.code}`,
69
69
  onSelect: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"CountrySelect.mjs","names":[],"sources":["../../../src/components/country-select/CountrySelect.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ChevronDown, Globe } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Icon } from '@/components/icon';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/primitives/popover';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/primitives/command';\nimport { type Country, COUNTRIES } from './countries';\n\nexport interface CountrySelectProps {\n value?: string | null;\n onValueChange?: (code: string) => void;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n align?: 'center' | 'start' | 'end';\n sideOffset?: number;\n}\n\nconst CountrySelect = React.forwardRef<React.ElementRef<'button'>, CountrySelectProps>(\n (\n {\n value,\n onValueChange,\n placeholder = 'Select country',\n disabled = false,\n className,\n align = 'center',\n sideOffset = 4,\n },\n ref,\n ) => {\n const [open, setOpen] = React.useState(false);\n const selectedCountry = React.useMemo(() => COUNTRIES.find((c) => c.code === value), [value]);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n ref={ref}\n render={\n <button\n type=\"button\"\n disabled={disabled}\n aria-expanded={open}\n className={cn(\n // Base layout — consistent with Select trigger\n 'flex w-full items-center justify-between',\n 'rounded-berget-xs border bg-card',\n 'px-4 py-3 text-sm',\n 'transition-colors duration-200',\n 'focus-visible:ring-0 focus-visible:outline-none',\n `\n focus-visible:border-berget-form-focus-border\n focus-visible:ring-offset-0\n `,\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Default border & hover matching Select variant \"default\"\n `\n border-berget-border-interactive\n hover:bg-berget-surface-hover\n `,\n className,\n )}\n />\n }\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n {selectedCountry ? (\n <>\n <span className=\"shrink-0 text-xl\">{selectedCountry.flag}</span>\n <span className=\"truncate\">{selectedCountry.name}</span>\n <span className=\"shrink-0 text-xs text-berget-muted-foreground\">\n ({selectedCountry.code})\n </span>\n </>\n ) : (\n <>\n <Icon icon={Globe} size={16} className=\"shrink-0 text-berget-muted-foreground\" />\n <span className=\"truncate text-berget-muted-foreground\">{placeholder}</span>\n </>\n )}\n </div>\n <Icon\n icon={ChevronDown}\n size={16}\n className={cn(\n 'shrink-0 text-berget-muted-foreground',\n 'transition-transform duration-200',\n open && 'rotate-180',\n )}\n />\n </PopoverTrigger>\n\n <PopoverContent\n align={align}\n sideOffset={sideOffset}\n className=\"w-(--radix-popover-trigger-width) p-0\"\n >\n <Command>\n <CommandInput placeholder=\"Search country...\" />\n <CommandList>\n <CommandEmpty>No countries found.</CommandEmpty>\n <CommandGroup>\n {COUNTRIES.map((country) => (\n <CommandItem\n key={country.code}\n value={`${country.name} ${country.code}`}\n onSelect={() => {\n onValueChange?.(country.code);\n setOpen(false);\n }}\n className={cn(\n 'flex items-center gap-3 px-3 py-2.5',\n `\n data-[selected='true']:bg-berget-brand-granite-700/40!\n data-[selected=true]:text-berget-foreground\n `,\n value === country.code && 'bg-berget-brand-granite-800/40',\n )}\n >\n <span className=\"shrink-0 text-xl\">{country.flag}</span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate text-sm\">{country.name}</div>\n <div className=\"text-xs text-berget-muted-foreground\">{country.code}</div>\n </div>\n {value === country.code && (\n <div\n className=\"\n size-2 shrink-0 rounded-full\n bg-berget-brand-granite-400\n \"\n />\n )}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nCountrySelect.displayName = 'CountrySelect';\n\nexport { CountrySelect };\nexport type { Country };\nexport {\n COUNTRIES,\n EU_COUNTRY_CODES,\n getCountryByCode,\n getCountryByName,\n isEUCountry,\n} from './countries';\n"],"mappings":";;;;;;;;;;AA4BA,MAAM,gBAAgB,MAAM,YAExB,EACE,OACA,eACA,cAAc,kBACd,WAAW,OACX,WACA,QAAQ,UACR,aAAa,KAEf,QACG;CACH,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,KAAK;CAC5C,MAAM,kBAAkB,MAAM,cAAc,UAAU,MAAM,MAAM,EAAE,SAAS,KAAK,GAAG,CAAC,KAAK,CAAC;CAE5F,OACE,qBAAC,SAAD;EAAe;EAAM,cAAc;EAAnC,UAAA,CACE,qBAAC,gBAAD;GACO;GACL,QACE,oBAAC,UAAD;IACE,MAAK;IACK;IACV,iBAAe;IACf,WAAW,GAET,4CACA,oCACA,qBACA,kCACA,mDACA;;;mBAIA,mDAEA;;;mBAIA,SACF;GACD,CAAA;GA1BL,UAAA,CA6BE,oBAAC,OAAD;IAAK,WAAU;IACZ,UAAA,kBACC,qBAAA,UAAA,EAAA,UAAA;KACE,oBAAC,QAAD;MAAM,WAAU;MAAoB,UAAA,gBAAgB;KAAW,CAAA;KAC/D,oBAAC,QAAD;MAAM,WAAU;MAAY,UAAA,gBAAgB;KAAW,CAAA;KACvD,qBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA;OAAgE;OAC5D,gBAAgB;OAAK;MACnB;;IACN,EAAA,CAAA,IAEF,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,MAAD;KAAM,MAAM;KAAO,MAAM;KAAI,WAAU;IAAyC,CAAA,GAChF,oBAAC,QAAD;KAAM,WAAU;KAAyC,UAAA;IAAkB,CAAA,CAC3E,EAAA,CAAA;GAED,CAAA,GACL,oBAAC,MAAD;IACE,MAAM;IACN,MAAM;IACN,WAAW,GACT,yCACA,qCACA,QAAQ,YACV;GACD,CAAA,CACa;EAEhB,CAAA,GAAA,oBAAC,gBAAD;GACS;GACK;GACZ,WAAU;GAEV,UAAA,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,cAAD,EAAc,aAAY,oBAAqB,CAAA,GAC/C,qBAAC,aAAD,EAAA,UAAA,CACE,oBAAC,cAAD,EAAA,UAAc,sBAAiC,CAAA,GAC/C,oBAAC,cAAD,EAAA,UACG,UAAU,KAAK,YACd,qBAAC,aAAD;IAEE,OAAO,GAAG,QAAQ,KAAK,GAAG,QAAQ;IAClC,gBAAgB;KACd,gBAAgB,QAAQ,IAAI;KAC5B,QAAQ,KAAK;IACf;IACA,WAAW,GACT,uCACA;;;yBAIA,UAAU,QAAQ,QAAQ,gCAC5B;IAdF,UAAA;KAgBE,oBAAC,QAAD;MAAM,WAAU;MAAoB,UAAA,QAAQ;KAAW,CAAA;KACvD,qBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,oBAAC,OAAD;OAAK,WAAU;OAAoB,UAAA,QAAQ;MAAU,CAAA,GACrD,oBAAC,OAAD;OAAK,WAAU;OAAwC,UAAA,QAAQ;MAAU,CAAA,CACtE;;KACJ,UAAU,QAAQ,QACjB,oBAAC,OAAD,EACE,WAAU,4IAIX,CAAA;IAEQ;GA5BN,GAAA,QAAQ,IA4BF,CACd,EACW,CAAA,CACH,EAAA,CAAA,CACN,EAAA,CAAA;EACK,CAAA,CACT;;AAEb,CACF;AAEA,cAAc,cAAc"}
1
+ {"version":3,"file":"CountrySelect.mjs","names":[],"sources":["../../../src/components/country-select/CountrySelect.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ChevronDown, Globe } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Icon } from '@/components/icon';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/primitives/popover';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/primitives/command';\nimport { type Country, COUNTRIES } from './countries';\n\nexport interface CountrySelectProps {\n value?: string | null;\n onValueChange?: (code: string) => void;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n align?: 'center' | 'start' | 'end';\n sideOffset?: number;\n}\n\nconst CountrySelect = React.forwardRef<React.ElementRef<'button'>, CountrySelectProps>(\n (\n {\n value,\n onValueChange,\n placeholder = 'Select country',\n disabled = false,\n className,\n align = 'center',\n sideOffset = 4,\n },\n ref,\n ) => {\n const [open, setOpen] = React.useState(false);\n const selectedCountry = React.useMemo(() => COUNTRIES.find((c) => c.code === value), [value]);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n ref={ref}\n render={\n <button\n type=\"button\"\n disabled={disabled}\n aria-expanded={open}\n className={cn(\n // Base layout — consistent with Select trigger\n 'flex w-full items-center justify-between',\n 'rounded-berget-xs border bg-card',\n 'px-4 py-3 text-sm',\n 'transition-colors duration-200',\n 'focus-visible:ring-0 focus-visible:outline-none',\n `\n focus-visible:border-berget-form-focus-border\n focus-visible:ring-offset-0\n `,\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Default border & hover matching Select variant \"default\"\n `\n border-berget-border-interactive\n hover:bg-berget-surface-hover\n `,\n className,\n )}\n />\n }\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n {selectedCountry ? (\n <>\n <span className=\"shrink-0 text-xl\">{selectedCountry.flag}</span>\n <span className=\"truncate\">{selectedCountry.name}</span>\n <span className=\"shrink-0 text-xs text-berget-muted-foreground\">\n ({selectedCountry.code})\n </span>\n </>\n ) : (\n <>\n <Icon\n icon={Globe}\n size={16}\n className=\"\n shrink-0 text-berget-muted-foreground\n \"\n />\n <span className=\"truncate text-berget-muted-foreground\">{placeholder}</span>\n </>\n )}\n </div>\n <Icon\n icon={ChevronDown}\n size={16}\n className={cn(\n 'shrink-0 text-berget-muted-foreground',\n 'transition-transform duration-200',\n open && 'rotate-180',\n )}\n />\n </PopoverTrigger>\n\n <PopoverContent\n align={align}\n sideOffset={sideOffset}\n className=\"\n w-(--trigger-width) p-0\n \"\n >\n <Command>\n <CommandInput placeholder=\"Search country...\" />\n <CommandList>\n <CommandEmpty>No countries found.</CommandEmpty>\n <CommandGroup>\n {COUNTRIES.map((country) => (\n <CommandItem\n key={country.code}\n value={`${country.name} ${country.code}`}\n onSelect={() => {\n onValueChange?.(country.code);\n setOpen(false);\n }}\n className={cn(\n 'flex items-center gap-3 px-3 py-2.5',\n `\n data-[selected='true']:bg-berget-brand-granite-700/40!\n data-[selected=true]:text-berget-foreground\n `,\n value === country.code && 'bg-berget-brand-granite-800/40',\n )}\n >\n <span className=\"shrink-0 text-xl\">{country.flag}</span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate text-sm\">{country.name}</div>\n <div className=\"text-xs text-berget-muted-foreground\">{country.code}</div>\n </div>\n {value === country.code && (\n <div\n className=\"\n size-2 shrink-0 rounded-full\n bg-berget-brand-granite-400\n \"\n />\n )}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nCountrySelect.displayName = 'CountrySelect';\n\nexport { CountrySelect };\nexport type { Country };\nexport {\n COUNTRIES,\n EU_COUNTRY_CODES,\n getCountryByCode,\n getCountryByName,\n isEUCountry,\n} from './countries';\n"],"mappings":";;;;;;;;;;AA4BA,MAAM,gBAAgB,MAAM,YAExB,EACE,OACA,eACA,cAAc,kBACd,WAAW,OACX,WACA,QAAQ,UACR,aAAa,KAEf,QACG;CACH,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,KAAK;CAC5C,MAAM,kBAAkB,MAAM,cAAc,UAAU,MAAM,MAAM,EAAE,SAAS,KAAK,GAAG,CAAC,KAAK,CAAC;CAE5F,OACE,qBAAC,SAAD;EAAe;EAAM,cAAc;EAAnC,UAAA,CACE,qBAAC,gBAAD;GACO;G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QAAQ;KAAW,CAAA;KACvD,qBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,oBAAC,OAAD;OAAK,WAAU;OAAoB,UAAA,QAAQ;MAAU,CAAA,GACrD,oBAAC,OAAD;OAAK,WAAU;OAAwC,UAAA,QAAQ;MAAU,CAAA,CACtE;;KACJ,UAAU,QAAQ,QACjB,oBAAC,OAAD,EACE,WAAU,4IAIX,CAAA;IAEQ;GA5BN,GAAA,QAAQ,IA4BF,CACd,EACW,CAAA,CACH,EAAA,CAAA,CACN,EAAA,CAAA;EACK,CAAA,CACT;;AAEb,CACF;AAEA,cAAc,cAAc"}
@@ -32,9 +32,9 @@ DialogOverlay.displayName = "DialogOverlay";
32
32
  const DialogContent = react.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DialogPortal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogOverlay, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_dialog.Dialog.Popup, {
33
33
  ref,
34
34
  className: require_utils.cn(`
35
- fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg
36
- translate-x-[-50%] translate-y-[-50%] gap-4 rounded-berget-sm border
37
- border-berget-dialog-border bg-berget-dialog-bg p-6 shadow-berget-lg
35
+ fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-[-50%]
36
+ gap-4 rounded-berget-sm border border-berget-dialog-border
37
+ bg-berget-dialog-bg p-6 shadow-berget-lg
38
38
  transition-[opacity,transform] duration-200
39
39
  data-ending-style:scale-95 data-ending-style:opacity-0
40
40
  data-starting-style:scale-95 data-starting-style:opacity-0
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.cjs","names":["DialogPrimitive","React","asChildRender","cn","X","Typography"],"sources":["../../../src/components/dialog/Dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\n\nimport { cn, asChildRender } from '../../lib/utils';\nimport { Typography } from '../typography';\n\nconst Dialog = DialogPrimitive.Root;\n\ntype DialogTriggerProps = Omit<DialogPrimitive.Trigger.Props, 'className' | 'render'> & {\n className?: string;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DialogTrigger = React.forwardRef<HTMLButtonElement, DialogTriggerProps>(\n ({ asChild, children, ...props }, ref) => (\n <DialogPrimitive.Trigger ref={ref} render={asChildRender(asChild, children)} {...props}>\n {asChild ? undefined : children}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'DialogTrigger';\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n HTMLDivElement,\n Omit<DialogPrimitive.Backdrop.Props, 'className'> & { className?: string }\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Backdrop\n ref={ref}\n className={cn(\n `\n fixed inset-0 z-50 bg-berget-dialog-overlay-bg transition-opacity\n duration-200\n data-ending-style:opacity-0\n data-starting-style:opacity-0\n `,\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = 'DialogOverlay';\n\nconst DialogContent = React.forwardRef<\n HTMLDivElement,\n Omit<DialogPrimitive.Popup.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Popup\n ref={ref}\n className={cn(\n `\n fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg\n translate-x-[-50%] translate-y-[-50%] gap-4 rounded-berget-sm border\n border-berget-dialog-border bg-berget-dialog-bg p-6 shadow-berget-lg\n transition-[opacity,transform] duration-200\n data-ending-style:scale-95 data-ending-style:opacity-0\n data-starting-style:scale-95 data-starting-style:opacity-0\n `,\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close\n className=\"\n focus:ring-berget-focus-ring\n absolute top-4 right-4 rounded-berget-xs opacity-70\n ring-offset-berget-dialog-bg transition-opacity\n hover:opacity-100\n focus:ring-2 focus:ring-offset-2 focus:outline-none\n disabled:pointer-events-none\n data-open:bg-berget-muted data-open:text-berget-muted-foreground\n \"\n >\n <X className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Popup>\n </DialogPortal>\n));\nDialogContent.displayName = 'DialogContent';\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n `\n flex flex-col gap-1.5 text-center\n sm:text-left\n `,\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n `\n flex flex-col-reverse gap-2\n sm:flex-row sm:justify-end\n `,\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n HTMLHeadingElement,\n Omit<DialogPrimitive.Title.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n render={<Typography variant=\"h5\" color=\"default\" as=\"h2\" className={className} />}\n {...props}\n >\n {children}\n </DialogPrimitive.Title>\n));\nDialogTitle.displayName = 'DialogTitle';\n\nconst DialogDescription = React.forwardRef<\n HTMLParagraphElement,\n Omit<DialogPrimitive.Description.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n render={<Typography variant=\"small\" color=\"muted\" className={className} />}\n {...props}\n >\n {children}\n </DialogPrimitive.Description>\n));\nDialogDescription.displayName = 'DialogDescription';\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;;;;;AASA,MAAM,SAASA,sBAAAA,OAAgB;AAQ/B,MAAM,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;CACE,WAAWD,cAAAA,GACT;;;SAIA,SACF;CACA,GAAI;AACL,CAAA;AAEH,aAAa,cAAc;AAE3B,MAAM,gBAAgB,EAAE,WAAW,GAAG,YACpC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;CACE,WAAWA,cAAAA,GACT;;;SAIA,SACF;CACA,GAAI;AACL,CAAA;AAEH,aAAa,cAAc;AAE3B,MAAM,cAAcF,MAAM,YAGvB,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,iBAAA,GAAA,kBAAA,IAAA,CAACD,sBAAAA,OAAgB,OAAjB;CACO;CACL,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAACK,mBAAAA,YAAD;EAAY,SAAQ;EAAK,OAAM;EAAU,IAAG;EAAgB;CAAY,CAAA;CAChF,GAAI;CAEH;AACoB,CAAA,CACxB;AACD,YAAY,cAAc;AAE1B,MAAM,oBAAoBJ,MAAM,YAG7B,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,iBAAA,GAAA,kBAAA,IAAA,CAACD,sBAAAA,OAAgB,aAAjB;CACO;CACL,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAACK,mBAAAA,YAAD;EAAY,SAAQ;EAAQ,OAAM;EAAmB;CAAY,CAAA;CACzE,GAAI;CAEH;AAC0B,CAAA,CAC9B;AACD,kBAAkB,cAAc"}
1
+ {"version":3,"file":"Dialog.cjs","names":["DialogPrimitive","React","asChildRender","cn","X","Typography"],"sources":["../../../src/components/dialog/Dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\n\nimport { cn, asChildRender } from '../../lib/utils';\nimport { Typography } from '../typography';\n\nconst Dialog = DialogPrimitive.Root;\n\ntype DialogTriggerProps = Omit<DialogPrimitive.Trigger.Props, 'className' | 'render'> & {\n className?: string;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DialogTrigger = React.forwardRef<HTMLButtonElement, DialogTriggerProps>(\n ({ asChild, children, ...props }, ref) => (\n <DialogPrimitive.Trigger ref={ref} render={asChildRender(asChild, children)} {...props}>\n {asChild ? undefined : children}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'DialogTrigger';\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n HTMLDivElement,\n Omit<DialogPrimitive.Backdrop.Props, 'className'> & { className?: string }\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Backdrop\n ref={ref}\n className={cn(\n `\n fixed inset-0 z-50 bg-berget-dialog-overlay-bg transition-opacity\n duration-200\n data-ending-style:opacity-0\n data-starting-style:opacity-0\n `,\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = 'DialogOverlay';\n\nconst DialogContent = React.forwardRef<\n HTMLDivElement,\n Omit<DialogPrimitive.Popup.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Popup\n ref={ref}\n className={cn(\n `\n fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-[-50%]\n gap-4 rounded-berget-sm border border-berget-dialog-border\n bg-berget-dialog-bg p-6 shadow-berget-lg\n transition-[opacity,transform] duration-200\n data-ending-style:scale-95 data-ending-style:opacity-0\n data-starting-style:scale-95 data-starting-style:opacity-0\n `,\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close\n className=\"\n focus:ring-berget-focus-ring\n absolute top-4 right-4 rounded-berget-xs opacity-70\n ring-offset-berget-dialog-bg transition-opacity\n hover:opacity-100\n focus:ring-2 focus:ring-offset-2 focus:outline-none\n disabled:pointer-events-none\n data-open:bg-berget-muted data-open:text-berget-muted-foreground\n \"\n >\n <X className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Popup>\n </DialogPortal>\n));\nDialogContent.displayName = 'DialogContent';\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n `\n flex flex-col gap-1.5 text-center\n sm:text-left\n `,\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n `\n flex flex-col-reverse gap-2\n sm:flex-row sm:justify-end\n `,\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n HTMLHeadingElement,\n Omit<DialogPrimitive.Title.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n render={<Typography variant=\"h5\" color=\"default\" as=\"h2\" className={className} />}\n {...props}\n >\n {children}\n </DialogPrimitive.Title>\n));\nDialogTitle.displayName = 'DialogTitle';\n\nconst DialogDescription = React.forwardRef<\n HTMLParagraphElement,\n Omit<DialogPrimitive.Description.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n render={<Typography variant=\"small\" color=\"muted\" className={className} />}\n {...props}\n >\n {children}\n </DialogPrimitive.Description>\n));\nDialogDescription.displayName = 'DialogDescription';\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;;;;;AASA,MAAM,SAASA,sBAAAA,OAAgB;AAQ/B,MAAM,gBAAgBC,MAAM,YACzB,EAAE,SAAS,UAAU,GAAG,SAAS,QAChC,iBAAA,GAAA,kBAAA,IAAA,CAACD,sBAAAA,OAAgB,SAAjB;CAA8B;CAAK,QAAQE,cAAAA,cAAc,SAAS,QAAQ;CAAG,GAAI;CAC9E,UAAA,UAAU,KAAA,IAAY;AACA,CAAA,CAE7B;AACA,cA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AAa,cAAc;AAE3B,MAAM,cAAcF,MAAM,YAGvB,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,iBAAA,GAAA,kBAAA,IAAA,CAACD,sBAAAA,OAAgB,OAAjB;CACO;CACL,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAACK,mBAAAA,YAAD;EAAY,SAAQ;EAAK,OAAM;EAAU,IAAG;EAAgB;CAAY,CAAA;CAChF,GAAI;CAEH;AACoB,CAAA,CACxB;AACD,YAAY,cAAc;AAE1B,MAAM,oBAAoBJ,MAAM,YAG7B,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,iBAAA,GAAA,kBAAA,IAAA,CAACD,sBAAAA,OAAgB,aAAjB;CACO;CACL,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAACK,mBAAAA,YAAD;EAAY,SAAQ;EAAQ,OAAM;EAAmB;CAAY,CAAA;CACzE,GAAI;CAEH;AAC0B,CAAA,CAC9B;AACD,kBAAkB,cAAc"}
@@ -4,7 +4,7 @@ import { Dialog } from "@base-ui/react/dialog";
4
4
  declare const Dialog$1: <Payload>(props: Dialog.Root.Props<Payload>) => React.JSX.Element;
5
5
  type DialogTriggerProps = Omit<Dialog.Trigger.Props, 'className' | 'render'> & {
6
6
  className?: string;
7
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
7
+ /** Render as a different element/component by merging props onto the child. */
8
8
  asChild?: boolean;
9
9
  };
10
10
  declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<DialogTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -4,7 +4,7 @@ import { Dialog } from "@base-ui/react/dialog";
4
4
  declare const Dialog$1: <Payload>(props: Dialog.Root.Props<Payload>) => React.JSX.Element;
5
5
  type DialogTriggerProps = Omit<Dialog.Trigger.Props, 'className' | 'render'> & {
6
6
  className?: string;
7
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
7
+ /** Render as a different element/component by merging props onto the child. */
8
8
  asChild?: boolean;
9
9
  };
10
10
  declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<DialogTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -30,9 +30,9 @@ DialogOverlay.displayName = "DialogOverlay";
30
30
  const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(Dialog.Popup, {
31
31
  ref,
32
32
  className: cn(`
33
- fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg
34
- translate-x-[-50%] translate-y-[-50%] gap-4 rounded-berget-sm border
35
- border-berget-dialog-border bg-berget-dialog-bg p-6 shadow-berget-lg
33
+ fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-[-50%]
34
+ gap-4 rounded-berget-sm border border-berget-dialog-border
35
+ bg-berget-dialog-bg p-6 shadow-berget-lg
36
36
  transition-[opacity,transform] duration-200
37
37
  data-ending-style:scale-95 data-ending-style:opacity-0
38
38
  data-starting-style:scale-95 data-starting-style:opacity-0
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.mjs","names":["Dialog","DialogPrimitive"],"sources":["../../../src/components/dialog/Dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\n\nimport { cn, asChildRender } from '../../lib/utils';\nimport { Typography } from '../typography';\n\nconst Dialog = DialogPrimitive.Root;\n\ntype DialogTriggerProps = Omit<DialogPrimitive.Trigger.Props, 'className' | 'render'> & {\n className?: string;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DialogTrigger = React.forwardRef<HTMLButtonElement, DialogTriggerProps>(\n ({ asChild, children, ...props }, ref) => (\n <DialogPrimitive.Trigger ref={ref} render={asChildRender(asChild, children)} {...props}>\n {asChild ? undefined : children}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'DialogTrigger';\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n HTMLDivElement,\n Omit<DialogPrimitive.Backdrop.Props, 'className'> & { className?: string }\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Backdrop\n ref={ref}\n className={cn(\n `\n fixed inset-0 z-50 bg-berget-dialog-overlay-bg transition-opacity\n duration-200\n data-ending-style:opacity-0\n data-starting-style:opacity-0\n `,\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = 'DialogOverlay';\n\nconst DialogContent = React.forwardRef<\n HTMLDivElement,\n Omit<DialogPrimitive.Popup.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Popup\n ref={ref}\n className={cn(\n `\n fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg\n translate-x-[-50%] translate-y-[-50%] gap-4 rounded-berget-sm border\n border-berget-dialog-border bg-berget-dialog-bg p-6 shadow-berget-lg\n transition-[opacity,transform] duration-200\n data-ending-style:scale-95 data-ending-style:opacity-0\n data-starting-style:scale-95 data-starting-style:opacity-0\n `,\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close\n className=\"\n focus:ring-berget-focus-ring\n absolute top-4 right-4 rounded-berget-xs opacity-70\n ring-offset-berget-dialog-bg transition-opacity\n hover:opacity-100\n focus:ring-2 focus:ring-offset-2 focus:outline-none\n disabled:pointer-events-none\n data-open:bg-berget-muted data-open:text-berget-muted-foreground\n \"\n >\n <X className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Popup>\n </DialogPortal>\n));\nDialogContent.displayName = 'DialogContent';\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n `\n flex flex-col gap-1.5 text-center\n sm:text-left\n `,\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n `\n flex flex-col-reverse gap-2\n sm:flex-row sm:justify-end\n `,\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n HTMLHeadingElement,\n Omit<DialogPrimitive.Title.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n render={<Typography variant=\"h5\" color=\"default\" as=\"h2\" className={className} />}\n {...props}\n >\n {children}\n </DialogPrimitive.Title>\n));\nDialogTitle.displayName = 'DialogTitle';\n\nconst DialogDescription = React.forwardRef<\n HTMLParagraphElement,\n Omit<DialogPrimitive.Description.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n render={<Typography variant=\"small\" color=\"muted\" className={className} />}\n {...props}\n >\n {children}\n </DialogPrimitive.Description>\n));\nDialogDescription.displayName = 'DialogDescription';\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;;;AASA,MAAMA,WAASC,OAAgB;AAQ/B,MAAM,gBAAgB,MAAM,YACzB,EAAE,SAAS,UAAU,GAAG,SAAS,QAChC,oBAACA,OAAgB,SAAjB;CAA8B;CAAK,QAAQ,cAAc,SAAS,QAAQ;CAAG,GAAI;CAC9E,UAAA,UAAU,KAAA,IAAY;AACA,CAAA,CAE7B;AACA,cAAc,cAAc;AAE5B,MAAM,eAAeA,OAAgB;AAErC,MAAM,cAAcA,OAAgB;AAEpC,MAAM,gBAAgB,MAAM,YAGzB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAACA,OAAgB,UAAjB;CACO;CACL,WAAW,GACT;;;;;SAMA,SACF;CACA,GAAI;AACL,CAAA,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":["../../../src/components/dialog/Dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\n\nimport { cn, asChildRender } from '../../lib/utils';\nimport { Typography } from '../typography';\n\nconst Dialog = DialogPrimitive.Root;\n\ntype DialogTriggerProps = Omit<DialogPrimitive.Trigger.Props, 'className' | 'render'> & {\n className?: string;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DialogTrigger = React.forwardRef<HTMLButtonElement, DialogTriggerProps>(\n ({ asChild, children, ...props }, ref) => (\n <DialogPrimitive.Trigger ref={ref} render={asChildRender(asChild, children)} {...props}>\n {asChild ? undefined : children}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'DialogTrigger';\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n HTMLDivElement,\n Omit<DialogPrimitive.Backdrop.Props, 'className'> & { className?: string }\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Backdrop\n ref={ref}\n className={cn(\n `\n fixed inset-0 z-50 bg-berget-dialog-overlay-bg transition-opacity\n duration-200\n data-ending-style:opacity-0\n data-starting-style:opacity-0\n `,\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = 'DialogOverlay';\n\nconst DialogContent = React.forwardRef<\n HTMLDivElement,\n Omit<DialogPrimitive.Popup.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Popup\n ref={ref}\n className={cn(\n `\n fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-[-50%]\n gap-4 rounded-berget-sm border border-berget-dialog-border\n bg-berget-dialog-bg p-6 shadow-berget-lg\n transition-[opacity,transform] duration-200\n data-ending-style:scale-95 data-ending-style:opacity-0\n data-starting-style:scale-95 data-starting-style:opacity-0\n `,\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close\n className=\"\n focus:ring-berget-focus-ring\n absolute top-4 right-4 rounded-berget-xs opacity-70\n ring-offset-berget-dialog-bg transition-opacity\n hover:opacity-100\n focus:ring-2 focus:ring-offset-2 focus:outline-none\n disabled:pointer-events-none\n data-open:bg-berget-muted data-open:text-berget-muted-foreground\n \"\n >\n <X className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Popup>\n </DialogPortal>\n));\nDialogContent.displayName = 'DialogContent';\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n `\n flex flex-col gap-1.5 text-center\n sm:text-left\n `,\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n `\n flex flex-col-reverse gap-2\n sm:flex-row sm:justify-end\n `,\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n HTMLHeadingElement,\n Omit<DialogPrimitive.Title.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n render={<Typography variant=\"h5\" color=\"default\" as=\"h2\" className={className} />}\n {...props}\n >\n {children}\n </DialogPrimitive.Title>\n));\nDialogTitle.displayName = 'DialogTitle';\n\nconst DialogDescription = React.forwardRef<\n HTMLParagraphElement,\n Omit<DialogPrimitive.Description.Props, 'className'> & { className?: string }\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n render={<Typography variant=\"small\" color=\"muted\" className={className} />}\n {...props}\n >\n {children}\n </DialogPrimitive.Description>\n));\nDialogDescription.displayName = 'DialogDescription';\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n Dialog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YAGvB,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,oBAACA,OAAgB,OAAjB;CACO;CACL,QAAQ,oBAAC,YAAD;EAAY,SAAQ;EAAK,OAAM;EAAU,IAAG;EAAgB;CAAY,CAAA;CAChF,GAAI;CAEH;AACoB,CAAA,CACxB;AACD,YAAY,cAAc;AAE1B,MAAM,oBAAoB,MAAM,YAG7B,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,oBAACA,OAAgB,aAAjB;CACO;CACL,QAAQ,oBAAC,YAAD;EAAY,SAAQ;EAAQ,OAAM;EAAmB;CAAY,CAAA;CACzE,GAAI;CAEH;AAC0B,CAAA,CAC9B;AACD,kBAAkB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenu.cjs","names":["React","DropdownMenuTriggerPrimitive","asChildRender","DropdownMenuSubTriggerPrimitive","cn","DropdownMenuSubContentPrimitive","DropdownMenuContentPrimitive","DropdownMenuItemPrimitive","DropdownMenuCheckboxItemPrimitive","DropdownMenuRadioItemPrimitive","DropdownMenuLabelPrimitive","DropdownMenuSeparatorPrimitive","DropdownMenuShortcutPrimitive"],"sources":["../../../src/components/dropdown-menu/DropdownMenu.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport {\n DropdownMenuCheckboxItem as DropdownMenuCheckboxItemPrimitive,\n DropdownMenuContent as DropdownMenuContentPrimitive,\n DropdownMenuItem as DropdownMenuItemPrimitive,\n DropdownMenuLabel as DropdownMenuLabelPrimitive,\n DropdownMenuRadioItem as DropdownMenuRadioItemPrimitive,\n DropdownMenuSeparator as DropdownMenuSeparatorPrimitive,\n DropdownMenuShortcut as DropdownMenuShortcutPrimitive,\n DropdownMenuSubContent as DropdownMenuSubContentPrimitive,\n DropdownMenuSubTrigger as DropdownMenuSubTriggerPrimitive,\n DropdownMenuTrigger as DropdownMenuTriggerPrimitive,\n} from '../../primitives/dropdown-menu';\nimport { cn, asChildRender } from '../../lib/utils';\n\n/* ------------------------------------------------------------------ */\n/* Root & inert sub-components (re-exported from the primitive) */\n/* ------------------------------------------------------------------ */\n\nexport {\n DropdownMenu,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuRadioGroup,\n} from '../../primitives/dropdown-menu';\n\n/* ------------------------------------------------------------------ */\n/* Trigger */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuTriggerProps = Omit<\n React.ComponentProps<typeof DropdownMenuTriggerPrimitive>,\n 'className' | 'render'\n> & {\n className?: string;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DropdownMenuTrigger = React.forwardRef<HTMLButtonElement, DropdownMenuTriggerProps>(\n ({ asChild, children, ...props }, ref) => (\n <DropdownMenuTriggerPrimitive ref={ref} render={asChildRender(asChild, children)} {...props}>\n {asChild ? undefined : children}\n </DropdownMenuTriggerPrimitive>\n ),\n);\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\n/* ------------------------------------------------------------------ */\n/* SubTrigger */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuSubTriggerProps = Omit<\n React.ComponentProps<typeof DropdownMenuSubTriggerPrimitive>,\n 'className' | 'render'\n> & {\n className?: string;\n inset?: boolean;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DropdownMenuSubTrigger = React.forwardRef<HTMLDivElement, DropdownMenuSubTriggerProps>(\n ({ className, inset, asChild, children, ...props }, ref) => (\n <DropdownMenuSubTriggerPrimitive\n ref={ref}\n className={cn(\n // Berget density & radius; focus/accent styling comes from the primitive.\n 'gap-2 rounded-berget-xs px-2 py-1.5',\n inset && 'pl-8',\n className,\n )}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuSubTriggerPrimitive>\n ),\n);\nDropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';\n\n/* ------------------------------------------------------------------ */\n/* SubContent */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuSubContentPrimitive>;\n\nconst DropdownMenuSubContent = React.forwardRef<HTMLDivElement, DropdownMenuSubContentProps>(\n ({ className, ...props }, ref) => (\n <DropdownMenuSubContentPrimitive\n ref={ref}\n className={cn(\n `\n rounded-berget-xs bg-berget-popover text-berget-popover-foreground\n shadow-berget-lg\n `,\n className,\n )}\n {...props}\n />\n ),\n);\nDropdownMenuSubContent.displayName = 'DropdownMenuSubContent';\n\n/* ------------------------------------------------------------------ */\n/* Content */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuContentPrimitive>;\n\nconst DropdownMenuContent = React.forwardRef<HTMLDivElement, DropdownMenuContentProps>(\n ({ className, ...props }, ref) => (\n <DropdownMenuContentPrimitive\n ref={ref}\n className={cn(\n `\n rounded-berget-xs bg-berget-popover text-berget-popover-foreground\n shadow-berget-md\n `,\n className,\n )}\n {...props}\n />\n ),\n);\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n\n/* ------------------------------------------------------------------ */\n/* Item */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuItemProps = Omit<\n React.ComponentProps<typeof DropdownMenuItemPrimitive>,\n 'className' | 'render' | 'label'\n> & {\n className?: string;\n inset?: boolean;\n /** Typeahead label. Replaces the Radix `textValue` prop. */\n textValue?: string;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DropdownMenuItem = React.forwardRef<HTMLDivElement, DropdownMenuItemProps>(\n ({ className, inset, asChild, children, textValue, ...props }, ref) => (\n <DropdownMenuItemPrimitive\n ref={ref}\n label={textValue}\n className={cn(\n // Berget density & radius; focus accent and destructive variant from the primitive.\n 'gap-2 rounded-berget-xs px-2 py-1.5',\n inset && 'pl-8',\n className,\n )}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuItemPrimitive>\n ),\n);\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\n/* ------------------------------------------------------------------ */\n/* CheckboxItem */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuCheckboxItemProps = Omit<\n React.ComponentProps<typeof DropdownMenuCheckboxItemPrimitive>,\n 'className' | 'render' | 'label'\n> & {\n className?: string;\n /** Typeahead label. Replaces the Radix `textValue` prop. */\n textValue?: string;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DropdownMenuCheckboxItem = React.forwardRef<HTMLDivElement, DropdownMenuCheckboxItemProps>(\n ({ className, children, asChild, textValue, ...props }, ref) => (\n <DropdownMenuCheckboxItemPrimitive\n ref={ref}\n label={textValue}\n className={cn('rounded-berget-xs', className)}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuCheckboxItemPrimitive>\n ),\n);\nDropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';\n\n/* ------------------------------------------------------------------ */\n/* RadioItem */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuRadioItemProps = Omit<\n React.ComponentProps<typeof DropdownMenuRadioItemPrimitive>,\n 'className' | 'render' | 'label'\n> & {\n className?: string;\n /** Typeahead label. Replaces the Radix `textValue` prop. */\n textValue?: string;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DropdownMenuRadioItem = React.forwardRef<HTMLDivElement, DropdownMenuRadioItemProps>(\n ({ className, children, asChild, textValue, ...props }, ref) => (\n <DropdownMenuRadioItemPrimitive\n ref={ref}\n label={textValue}\n className={cn('rounded-berget-xs', className)}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuRadioItemPrimitive>\n ),\n);\nDropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';\n\n/* ------------------------------------------------------------------ */\n/* Label */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuLabelProps = Omit<\n React.ComponentProps<typeof DropdownMenuLabelPrimitive>,\n 'className' | 'render'\n> & {\n className?: string;\n inset?: boolean;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DropdownMenuLabel = React.forwardRef<HTMLDivElement, DropdownMenuLabelProps>(\n ({ className, inset, asChild, children, ...props }, ref) => (\n <DropdownMenuLabelPrimitive\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold text-berget-foreground',\n inset && 'pl-8',\n className,\n )}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuLabelPrimitive>\n ),\n);\nDropdownMenuLabel.displayName = 'DropdownMenuLabel';\n\n/* ------------------------------------------------------------------ */\n/* Separator */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuSeparatorProps = Omit<\n React.ComponentProps<typeof DropdownMenuSeparatorPrimitive>,\n 'className'\n> & { className?: string };\n\nconst DropdownMenuSeparator = React.forwardRef<HTMLDivElement, DropdownMenuSeparatorProps>(\n ({ className, ...props }, ref) => (\n <DropdownMenuSeparatorPrimitive\n ref={ref}\n className={cn('bg-berget-separator', className)}\n {...props}\n />\n ),\n);\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\n/* ------------------------------------------------------------------ */\n/* Shortcut */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuShortcutProps = React.ComponentProps<typeof DropdownMenuShortcutPrimitive>;\n\nconst DropdownMenuShortcut = ({ className, ...props }: DropdownMenuShortcutProps) => {\n return (\n <DropdownMenuShortcutPrimitive\n className={cn('text-berget-muted-foreground', className)}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\n/* ------------------------------------------------------------------ */\n/* Exports */\n/* ------------------------------------------------------------------ */\n\nexport {\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortc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AAQpC,MAAM,wBAAwB,EAAE,WAAW,GAAG,YAAuC;CACnF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACQ,sBAAAA,sBAAD;EACE,WAAWR,cAAAA,GAAG,gCAAgC,SAAS;EACvD,GAAI;CACL,CAAA;AAEL;AACA,qBAAqB,cAAc"}
1
+ {"version":3,"file":"DropdownMenu.cjs","names":["React","DropdownMenuTriggerPrimitive","asChildRender","DropdownMenuSubTriggerPrimitive","cn","DropdownMenuSubContentPrimitive","DropdownMenuContentPrimitive","DropdownMenuItemPrimitive","DropdownMenuCheckboxItemPrimitive","DropdownMenuRadioItemPrimitive","DropdownMenuLabelPrimitive","DropdownMenuSeparatorPrimitive","DropdownMenuShortcutPrimitive"],"sources":["../../../src/components/dropdown-menu/DropdownMenu.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport {\n DropdownMenuCheckboxItem as DropdownMenuCheckboxItemPrimitive,\n DropdownMenuContent as DropdownMenuContentPrimitive,\n DropdownMenuItem as DropdownMenuItemPrimitive,\n DropdownMenuLabel as DropdownMenuLabelPrimitive,\n DropdownMenuRadioItem as DropdownMenuRadioItemPrimitive,\n DropdownMenuSeparator as DropdownMenuSeparatorPrimitive,\n DropdownMenuShortcut as DropdownMenuShortcutPrimitive,\n DropdownMenuSubContent as DropdownMenuSubContentPrimitive,\n DropdownMenuSubTrigger as DropdownMenuSubTriggerPrimitive,\n DropdownMenuTrigger as DropdownMenuTriggerPrimitive,\n} from '../../primitives/dropdown-menu';\nimport { cn, asChildRender } from '../../lib/utils';\n\n/* ------------------------------------------------------------------ */\n/* Root & inert sub-components (re-exported from the primitive) */\n/* ------------------------------------------------------------------ */\n\nexport {\n DropdownMenu,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuRadioGroup,\n} from '../../primitives/dropdown-menu';\n\n/* ------------------------------------------------------------------ */\n/* Trigger */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuTriggerProps = Omit<\n React.ComponentProps<typeof DropdownMenuTriggerPrimitive>,\n 'className' | 'render'\n> & {\n className?: string;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DropdownMenuTrigger = React.forwardRef<HTMLButtonElement, DropdownMenuTriggerProps>(\n ({ asChild, children, ...props }, ref) => (\n <DropdownMenuTriggerPrimitive ref={ref} render={asChildRender(asChild, children)} {...props}>\n {asChild ? undefined : children}\n </DropdownMenuTriggerPrimitive>\n ),\n);\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\n/* ------------------------------------------------------------------ */\n/* SubTrigger */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuSubTriggerProps = Omit<\n React.ComponentProps<typeof DropdownMenuSubTriggerPrimitive>,\n 'className' | 'render'\n> & {\n className?: string;\n inset?: boolean;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DropdownMenuSubTrigger = React.forwardRef<HTMLDivElement, DropdownMenuSubTriggerProps>(\n ({ className, inset, asChild, children, ...props }, ref) => (\n <DropdownMenuSubTriggerPrimitive\n ref={ref}\n className={cn(\n // Berget density & radius; focus/accent styling comes from the primitive.\n 'gap-2 rounded-berget-xs px-2 py-1.5',\n inset && 'pl-8',\n className,\n )}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuSubTriggerPrimitive>\n ),\n);\nDropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';\n\n/* ------------------------------------------------------------------ */\n/* SubContent */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuSubContentPrimitive>;\n\nconst DropdownMenuSubContent = React.forwardRef<HTMLDivElement, DropdownMenuSubContentProps>(\n ({ className, ...props }, ref) => (\n <DropdownMenuSubContentPrimitive\n ref={ref}\n className={cn(\n `\n rounded-berget-xs bg-berget-popover text-berget-popover-foreground\n shadow-berget-lg\n `,\n className,\n )}\n {...props}\n />\n ),\n);\nDropdownMenuSubContent.displayName = 'DropdownMenuSubContent';\n\n/* ------------------------------------------------------------------ */\n/* Content */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuContentPrimitive>;\n\nconst DropdownMenuContent = React.forwardRef<HTMLDivElement, DropdownMenuContentProps>(\n ({ className, ...props }, ref) => (\n <DropdownMenuContentPrimitive\n ref={ref}\n className={cn(\n `\n rounded-berget-xs bg-berget-popover text-berget-popover-foreground\n shadow-berget-md\n `,\n className,\n )}\n {...props}\n />\n ),\n);\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n\n/* ------------------------------------------------------------------ */\n/* Item */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuItemProps = Omit<\n React.ComponentProps<typeof DropdownMenuItemPrimitive>,\n 'className' | 'render' | 'label'\n> & {\n className?: string;\n inset?: boolean;\n /** Typeahead label for keyboard typeahead. */\n textValue?: string;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DropdownMenuItem = React.forwardRef<HTMLDivElement, DropdownMenuItemProps>(\n ({ className, inset, asChild, children, textValue, ...props }, ref) => (\n <DropdownMenuItemPrimitive\n ref={ref}\n label={textValue}\n className={cn(\n // Berget density & radius; focus accent and destructive variant from the primitive.\n 'gap-2 rounded-berget-xs px-2 py-1.5',\n inset && 'pl-8',\n className,\n )}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuItemPrimitive>\n ),\n);\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\n/* ------------------------------------------------------------------ */\n/* CheckboxItem */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuCheckboxItemProps = Omit<\n React.ComponentProps<typeof DropdownMenuCheckboxItemPrimitive>,\n 'className' | 'render' | 'label'\n> & {\n className?: string;\n /** Typeahead label for keyboard typeahead. */\n textValue?: string;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DropdownMenuCheckboxItem = React.forwardRef<HTMLDivElement, DropdownMenuCheckboxItemProps>(\n ({ className, children, asChild, textValue, ...props }, ref) => (\n <DropdownMenuCheckboxItemPrimitive\n ref={ref}\n label={textValue}\n className={cn('rounded-berget-xs', className)}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuCheckboxItemPrimitive>\n ),\n);\nDropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';\n\n/* ------------------------------------------------------------------ */\n/* RadioItem */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuRadioItemProps = Omit<\n React.ComponentProps<typeof DropdownMenuRadioItemPrimitive>,\n 'className' | 'render' | 'label'\n> & {\n className?: string;\n /** Typeahead label for keyboard typeahead. */\n textValue?: string;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DropdownMenuRadioItem = React.forwardRef<HTMLDivElement, DropdownMenuRadioItemProps>(\n ({ className, children, asChild, textValue, ...props }, ref) => (\n <DropdownMenuRadioItemPrimitive\n ref={ref}\n label={textValue}\n className={cn('rounded-berget-xs', className)}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuRadioItemPrimitive>\n ),\n);\nDropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';\n\n/* ------------------------------------------------------------------ */\n/* Label */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuLabelProps = Omit<\n React.ComponentProps<typeof DropdownMenuLabelPrimitive>,\n 'className' | 'render'\n> & {\n className?: string;\n inset?: boolean;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DropdownMenuLabel = React.forwardRef<HTMLDivElement, DropdownMenuLabelProps>(\n ({ className, inset, asChild, children, ...props }, ref) => (\n <DropdownMenuLabelPrimitive\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold text-berget-foreground',\n inset && 'pl-8',\n className,\n )}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuLabelPrimitive>\n ),\n);\nDropdownMenuLabel.displayName = 'DropdownMenuLabel';\n\n/* ------------------------------------------------------------------ */\n/* Separator */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuSeparatorProps = Omit<\n React.ComponentProps<typeof DropdownMenuSeparatorPrimitive>,\n 'className'\n> & { className?: string };\n\nconst DropdownMenuSeparator = React.forwardRef<HTMLDivElement, DropdownMenuSeparatorProps>(\n ({ className, ...props }, ref) => (\n <DropdownMenuSeparatorPrimitive\n ref={ref}\n className={cn('bg-berget-separator', className)}\n {...props}\n />\n ),\n);\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\n/* ------------------------------------------------------------------ */\n/* Shortcut */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuShortcutProps = React.ComponentProps<typeof DropdownMenuShortcutPrimitive>;\n\nconst DropdownMenuShortcut = ({ className, ...props }: DropdownMenuShortcutProps) => {\n return (\n <DropdownMenuShortcutPrimitive\n className={cn('text-berget-muted-foreground', className)}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\n/* ------------------------------------------------------------------ */\n/* Exports */\n/* ------------------------------------------------------------------ */\n\nexport {\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n};\n"],"mappings":";;;;;;;;AA2CA,MAAM,sBAAsBA,MAAM,YAC/B,EAAE,SAAS,UAAU,GAAG,SAAS,QAChC,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,qBAAD;CAAmC;CAAK,QAAQC,cAAAA,cAAc,SAAS,QAAQ;CAAG,GAAI;CACnF,UAAA,UAAU,KAAA,IAAY;AACK,CAAA,CAElC;AACA,oBAAoB,cAAc;AAgBlC,MAAM,yBAAyBF,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Q;CACvC,GAAI;CAEH,UAAA,UAAU,KAAA,IAAY;AACU,CAAA,CAEvC;AACA,yBAAyB,cAAc;AAiBvC,MAAM,wBAAwBF,MAAM,YACjC,EAAE,WAAW,UAAU,SAAS,WAAW,GAAG,SAAS,QACtD,iBAAA,GAAA,kBAAA,IAAA,CAACS,sBAAAA,uBAAD;CACO;CACL,OAAO;CACP,WAAWL,cAAAA,GAAG,qBAAqB,SAAS;CAC5C,QAAQF,cAAAA,cAAc,SAAS,QAAQ;CACvC,GAAI;CAEH,UAAA,UAAU,KAAA,IAAY;AACO,CAAA,CAEpC;AACA,sBAAsB,cAAc;AAgBpC,MAAM,oBAAoBF,MAAM,YAC7B,EAAE,WAAW,OAAO,SAAS,UAAU,GAAG,SAAS,QAClD,iBAAA,GAAA,kBAAA,IAAA,CAACU,sBAAAA,mBAAD;CACO;CACL,WAAWN,cAAAA,GACT,4DACA,SAAS,QACT,SACF;CACA,QAAQF,cAAAA,cAAc,SAAS,QAAQ;CACvC,GAAI;CAEH,UAAA,UAAU,KAAA,IAAY;AACG,CAAA,CAEhC;AACA,kBAAkB,cAAc;AAWhC,MAAM,wBAAwBF,MAAM,YACjC,EAAE,WAAW,GAAG,SAAS,QACxB,iBAAA,GAAA,kBAAA,IAAA,CAACW,sBAAAA,uBAAD;CACO;CACL,WAAWP,cAAAA,GAAG,uBAAuB,SAAS;CAC9C,GAAI;AACL,CAAA,CAEL;AACA,sBAAsB,cAAc;AAQpC,MAAM,wBAAwB,EAAE,WAAW,GAAG,YAAuC;CACnF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACQ,sBAAAA,sBAAD;EACE,WAAWR,cAAAA,GAAG,gCAAgC,SAAS;EACvD,GAAI;CACL,CAAA;AAEL;AACA,qBAAqB,cAAc"}
@@ -3,14 +3,14 @@ import * as React from "react";
3
3
  //#region src/components/dropdown-menu/DropdownMenu.d.ts
4
4
  type DropdownMenuTriggerProps = Omit<React.ComponentProps<typeof DropdownMenuTrigger$1>, 'className' | 'render'> & {
5
5
  className?: string;
6
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
6
+ /** Render as a different element/component by merging props onto the child. */
7
7
  asChild?: boolean;
8
8
  };
9
9
  declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
10
10
  type DropdownMenuSubTriggerProps = Omit<React.ComponentProps<typeof DropdownMenuSubTrigger$1>, 'className' | 'render'> & {
11
11
  className?: string;
12
12
  inset?: boolean;
13
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
13
+ /** Render as a different element/component by merging props onto the child. */
14
14
  asChild?: boolean;
15
15
  };
16
16
  declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuSubTriggerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -19,32 +19,32 @@ declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<import("
19
19
  type DropdownMenuItemProps = Omit<React.ComponentProps<typeof DropdownMenuItem$1>, 'className' | 'render' | 'label'> & {
20
20
  className?: string;
21
21
  inset?: boolean;
22
- /** Typeahead label. Replaces the Radix `textValue` prop. */
22
+ /** Typeahead label for keyboard typeahead. */
23
23
  textValue?: string;
24
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
24
+ /** Render as a different element/component by merging props onto the child. */
25
25
  asChild?: boolean;
26
26
  };
27
27
  declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
28
28
  type DropdownMenuCheckboxItemProps = Omit<React.ComponentProps<typeof DropdownMenuCheckboxItem$1>, 'className' | 'render' | 'label'> & {
29
29
  className?: string;
30
- /** Typeahead label. Replaces the Radix `textValue` prop. */
30
+ /** Typeahead label for keyboard typeahead. */
31
31
  textValue?: string;
32
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
32
+ /** Render as a different element/component by merging props onto the child. */
33
33
  asChild?: boolean;
34
34
  };
35
35
  declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuCheckboxItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
36
  type DropdownMenuRadioItemProps = Omit<React.ComponentProps<typeof DropdownMenuRadioItem$1>, 'className' | 'render' | 'label'> & {
37
37
  className?: string;
38
- /** Typeahead label. Replaces the Radix `textValue` prop. */
38
+ /** Typeahead label for keyboard typeahead. */
39
39
  textValue?: string;
40
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
40
+ /** Render as a different element/component by merging props onto the child. */
41
41
  asChild?: boolean;
42
42
  };
43
43
  declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuRadioItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
44
44
  type DropdownMenuLabelProps = Omit<React.ComponentProps<typeof DropdownMenuLabel$1>, 'className' | 'render'> & {
45
45
  className?: string;
46
46
  inset?: boolean;
47
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
47
+ /** Render as a different element/component by merging props onto the child. */
48
48
  asChild?: boolean;
49
49
  };
50
50
  declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuLabelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -3,14 +3,14 @@ import * as React from "react";
3
3
  //#region src/components/dropdown-menu/DropdownMenu.d.ts
4
4
  type DropdownMenuTriggerProps = Omit<React.ComponentProps<typeof DropdownMenuTrigger$1>, 'className' | 'render'> & {
5
5
  className?: string;
6
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
6
+ /** Render as a different element/component by merging props onto the child. */
7
7
  asChild?: boolean;
8
8
  };
9
9
  declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
10
10
  type DropdownMenuSubTriggerProps = Omit<React.ComponentProps<typeof DropdownMenuSubTrigger$1>, 'className' | 'render'> & {
11
11
  className?: string;
12
12
  inset?: boolean;
13
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
13
+ /** Render as a different element/component by merging props onto the child. */
14
14
  asChild?: boolean;
15
15
  };
16
16
  declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuSubTriggerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -19,32 +19,32 @@ declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<import("
19
19
  type DropdownMenuItemProps = Omit<React.ComponentProps<typeof DropdownMenuItem$1>, 'className' | 'render' | 'label'> & {
20
20
  className?: string;
21
21
  inset?: boolean;
22
- /** Typeahead label. Replaces the Radix `textValue` prop. */
22
+ /** Typeahead label for keyboard typeahead. */
23
23
  textValue?: string;
24
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
24
+ /** Render as a different element/component by merging props onto the child. */
25
25
  asChild?: boolean;
26
26
  };
27
27
  declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
28
28
  type DropdownMenuCheckboxItemProps = Omit<React.ComponentProps<typeof DropdownMenuCheckboxItem$1>, 'className' | 'render' | 'label'> & {
29
29
  className?: string;
30
- /** Typeahead label. Replaces the Radix `textValue` prop. */
30
+ /** Typeahead label for keyboard typeahead. */
31
31
  textValue?: string;
32
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
32
+ /** Render as a different element/component by merging props onto the child. */
33
33
  asChild?: boolean;
34
34
  };
35
35
  declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuCheckboxItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
36
  type DropdownMenuRadioItemProps = Omit<React.ComponentProps<typeof DropdownMenuRadioItem$1>, 'className' | 'render' | 'label'> & {
37
37
  className?: string;
38
- /** Typeahead label. Replaces the Radix `textValue` prop. */
38
+ /** Typeahead label for keyboard typeahead. */
39
39
  textValue?: string;
40
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
40
+ /** Render as a different element/component by merging props onto the child. */
41
41
  asChild?: boolean;
42
42
  };
43
43
  declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuRadioItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
44
44
  type DropdownMenuLabelProps = Omit<React.ComponentProps<typeof DropdownMenuLabel$1>, 'className' | 'render'> & {
45
45
  className?: string;
46
46
  inset?: boolean;
47
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
47
+ /** Render as a different element/component by merging props onto the child. */
48
48
  asChild?: boolean;
49
49
  };
50
50
  declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuLabelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenu.mjs","names":["DropdownMenuTriggerPrimitive","DropdownMenuSubTriggerPrimitive","DropdownMenuSubContentPrimitive","DropdownMenuContentPrimitive","DropdownMenuItemPrimitive","DropdownMenuCheckboxItemPrimitive","DropdownMenuRadioItemPrimitive","DropdownMenuLabelPrimitive","DropdownMenuSeparatorPrimitive","DropdownMenuShortcutPrimitive"],"sources":["../../../src/components/dropdown-menu/DropdownMenu.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport {\n DropdownMenuCheckboxItem as DropdownMenuCheckboxItemPrimitive,\n DropdownMenuContent as DropdownMenuContentPrimitive,\n DropdownMenuItem as DropdownMenuItemPrimitive,\n DropdownMenuLabel as DropdownMenuLabelPrimitive,\n DropdownMenuRadioItem as DropdownMenuRadioItemPrimitive,\n DropdownMenuSeparator as DropdownMenuSeparatorPrimitive,\n DropdownMenuShortcut as DropdownMenuShortcutPrimitive,\n DropdownMenuSubContent as DropdownMenuSubContentPrimitive,\n DropdownMenuSubTrigger as DropdownMenuSubTriggerPrimitive,\n DropdownMenuTrigger as DropdownMenuTriggerPrimitive,\n} from '../../primitives/dropdown-menu';\nimport { cn, asChildRender } from '../../lib/utils';\n\n/* ------------------------------------------------------------------ */\n/* Root & inert sub-components (re-exported from the primitive) */\n/* ------------------------------------------------------------------ */\n\nexport {\n DropdownMenu,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuRadioGroup,\n} from '../../primitives/dropdown-menu';\n\n/* ------------------------------------------------------------------ */\n/* Trigger */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuTriggerProps = Omit<\n React.ComponentProps<typeof DropdownMenuTriggerPrimitive>,\n 'className' | 'render'\n> & {\n className?: string;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DropdownMenuTrigger = React.forwardRef<HTMLButtonElement, DropdownMenuTriggerProps>(\n ({ asChild, children, ...props }, ref) => (\n <DropdownMenuTriggerPrimitive ref={ref} render={asChildRender(asChild, children)} {...props}>\n {asChild ? undefined : children}\n </DropdownMenuTriggerPrimitive>\n ),\n);\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\n/* ------------------------------------------------------------------ */\n/* SubTrigger */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuSubTriggerProps = Omit<\n React.ComponentProps<typeof DropdownMenuSubTriggerPrimitive>,\n 'className' | 'render'\n> & {\n className?: string;\n inset?: boolean;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DropdownMenuSubTrigger = React.forwardRef<HTMLDivElement, DropdownMenuSubTriggerProps>(\n ({ className, inset, asChild, children, ...props }, ref) => (\n <DropdownMenuSubTriggerPrimitive\n ref={ref}\n className={cn(\n // Berget density & radius; focus/accent styling comes from the primitive.\n 'gap-2 rounded-berget-xs px-2 py-1.5',\n inset && 'pl-8',\n className,\n )}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuSubTriggerPrimitive>\n ),\n);\nDropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';\n\n/* ------------------------------------------------------------------ */\n/* SubContent */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuSubContentPrimitive>;\n\nconst DropdownMenuSubContent = React.forwardRef<HTMLDivElement, DropdownMenuSubContentProps>(\n ({ className, ...props }, ref) => (\n <DropdownMenuSubContentPrimitive\n ref={ref}\n className={cn(\n `\n rounded-berget-xs bg-berget-popover text-berget-popover-foreground\n shadow-berget-lg\n `,\n className,\n )}\n {...props}\n />\n ),\n);\nDropdownMenuSubContent.displayName = 'DropdownMenuSubContent';\n\n/* ------------------------------------------------------------------ */\n/* Content */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuContentPrimitive>;\n\nconst DropdownMenuContent = React.forwardRef<HTMLDivElement, DropdownMenuContentProps>(\n ({ className, ...props }, ref) => (\n <DropdownMenuContentPrimitive\n ref={ref}\n className={cn(\n `\n rounded-berget-xs bg-berget-popover text-berget-popover-foreground\n shadow-berget-md\n `,\n className,\n )}\n {...props}\n />\n ),\n);\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n\n/* ------------------------------------------------------------------ */\n/* Item */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuItemProps = Omit<\n React.ComponentProps<typeof DropdownMenuItemPrimitive>,\n 'className' | 'render' | 'label'\n> & {\n className?: string;\n inset?: boolean;\n /** Typeahead label. Replaces the Radix `textValue` prop. */\n textValue?: string;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DropdownMenuItem = React.forwardRef<HTMLDivElement, DropdownMenuItemProps>(\n ({ className, inset, asChild, children, textValue, ...props }, ref) => (\n <DropdownMenuItemPrimitive\n ref={ref}\n label={textValue}\n className={cn(\n // Berget density & radius; focus accent and destructive variant from the primitive.\n 'gap-2 rounded-berget-xs px-2 py-1.5',\n inset && 'pl-8',\n className,\n )}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuItemPrimitive>\n ),\n);\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\n/* ------------------------------------------------------------------ */\n/* CheckboxItem */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuCheckboxItemProps = Omit<\n React.ComponentProps<typeof DropdownMenuCheckboxItemPrimitive>,\n 'className' | 'render' | 'label'\n> & {\n className?: string;\n /** Typeahead label. Replaces the Radix `textValue` prop. */\n textValue?: string;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DropdownMenuCheckboxItem = React.forwardRef<HTMLDivElement, DropdownMenuCheckboxItemProps>(\n ({ className, children, asChild, textValue, ...props }, ref) => (\n <DropdownMenuCheckboxItemPrimitive\n ref={ref}\n label={textValue}\n className={cn('rounded-berget-xs', className)}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuCheckboxItemPrimitive>\n ),\n);\nDropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';\n\n/* ------------------------------------------------------------------ */\n/* RadioItem */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuRadioItemProps = Omit<\n React.ComponentProps<typeof DropdownMenuRadioItemPrimitive>,\n 'className' | 'render' | 'label'\n> & {\n className?: string;\n /** Typeahead label. Replaces the Radix `textValue` prop. */\n textValue?: string;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DropdownMenuRadioItem = React.forwardRef<HTMLDivElement, DropdownMenuRadioItemProps>(\n ({ className, children, asChild, textValue, ...props }, ref) => (\n <DropdownMenuRadioItemPrimitive\n ref={ref}\n label={textValue}\n className={cn('rounded-berget-xs', className)}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuRadioItemPrimitive>\n ),\n);\nDropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';\n\n/* ------------------------------------------------------------------ */\n/* Label */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuLabelProps = Omit<\n React.ComponentProps<typeof DropdownMenuLabelPrimitive>,\n 'className' | 'render'\n> & {\n className?: string;\n inset?: boolean;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n};\n\nconst DropdownMenuLabel = React.forwardRef<HTMLDivElement, DropdownMenuLabelProps>(\n ({ className, inset, asChild, children, ...props }, ref) => (\n <DropdownMenuLabelPrimitive\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold text-berget-foreground',\n inset && 'pl-8',\n className,\n )}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuLabelPrimitive>\n ),\n);\nDropdownMenuLabel.displayName = 'DropdownMenuLabel';\n\n/* ------------------------------------------------------------------ */\n/* Separator */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuSeparatorProps = Omit<\n React.ComponentProps<typeof DropdownMenuSeparatorPrimitive>,\n 'className'\n> & { className?: string };\n\nconst DropdownMenuSeparator = React.forwardRef<HTMLDivElement, DropdownMenuSeparatorProps>(\n ({ className, ...props }, ref) => (\n <DropdownMenuSeparatorPrimitive\n ref={ref}\n className={cn('bg-berget-separator', className)}\n {...props}\n />\n ),\n);\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\n/* ------------------------------------------------------------------ */\n/* Shortcut */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuShortcutProps = React.ComponentProps<typeof DropdownMenuShortcutPrimitive>;\n\nconst DropdownMenuShortcut = ({ className, ...props }: DropdownMenuShortcutProps) => {\n return (\n <DropdownMenuShortcutPrimitive\n className={cn('text-berget-muted-foreground', className)}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\n/* ------------------------------------------------------------------ */\n/* Exports */\n/* ------------------------------------------------------------------ */\n\nexport {\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator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ACP,WAAW,GAAG,qBAAqB,SAAS;CAC5C,QAAQ,cAAc,SAAS,QAAQ;CACvC,GAAI;CAEH,UAAA,UAAU,KAAA,IAAY;AACU,CAAA,CAEvC;AACA,yBAAyB,cAAc;AAiBvC,MAAM,wBAAwB,MAAM,YACjC,EAAE,WAAW,UAAU,SAAS,WAAW,GAAG,SAAS,QACtD,oBAACC,yBAAD;CACO;CACL,OAAO;CACP,WAAW,GAAG,qBAAqB,SAAS;CAC5C,QAAQ,cAAc,SAAS,QAAQ;CACvC,GAAI;CAEH,UAAA,UAAU,KAAA,IAAY;AACO,CAAA,CAEpC;AACA,sBAAsB,cAAc;AAgBpC,MAAM,oBAAoB,MAAM,YAC7B,EAAE,WAAW,OAAO,SAAS,UAAU,GAAG,SAAS,QAClD,oBAACC,qBAAD;CACO;CACL,WAAW,GACT,4DACA,SAAS,QACT,SACF;CACA,QAAQ,cAAc,SAAS,QAAQ;CACvC,GAAI;CAEH,UAAA,UAAU,KAAA,IAAY;AACG,CAAA,CAEhC;AACA,kBAAkB,cAAc;AAWhC,MAAM,wBAAwB,MAAM,YACjC,EAAE,WAAW,GAAG,SAAS,QACxB,oBAACC,yBAAD;CACO;CACL,WAAW,GAAG,uBAAuB,SAAS;CAC9C,GAAI;AACL,CAAA,CAEL;AACA,sBAAsB,cAAc;AAQpC,MAAM,wBAAwB,EAAE,WAAW,GAAG,YAAuC;CACnF,OACE,oBAACC,wBAAD;EACE,WAAW,GAAG,gCAAgC,SAAS;EACvD,GAAI;CACL,CAAA;AAEL;AACA,qBAAqB,cAAc"}
1
+ {"version":3,"file":"DropdownMenu.mjs","names":["DropdownMenuTriggerPrimitive","DropdownMenuSubTriggerPrimitive","DropdownMenuSubContentPrimitive","DropdownMenuContentPrimitive","DropdownMenuItemPrimitive","DropdownMenuCheckboxItemPrimitive","DropdownMenuRadioItemPrimitive","DropdownMenuLabelPrimitive","DropdownMenuSeparatorPrimitive","DropdownMenuShortcutPrimitive"],"sources":["../../../src/components/dropdown-menu/DropdownMenu.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport {\n DropdownMenuCheckboxItem as DropdownMenuCheckboxItemPrimitive,\n DropdownMenuContent as DropdownMenuContentPrimitive,\n DropdownMenuItem as DropdownMenuItemPrimitive,\n DropdownMenuLabel as DropdownMenuLabelPrimitive,\n DropdownMenuRadioItem as DropdownMenuRadioItemPrimitive,\n DropdownMenuSeparator as DropdownMenuSeparatorPrimitive,\n DropdownMenuShortcut as DropdownMenuShortcutPrimitive,\n DropdownMenuSubContent as DropdownMenuSubContentPrimitive,\n DropdownMenuSubTrigger as DropdownMenuSubTriggerPrimitive,\n DropdownMenuTrigger as DropdownMenuTriggerPrimitive,\n} from '../../primitives/dropdown-menu';\nimport { cn, asChildRender } from '../../lib/utils';\n\n/* ------------------------------------------------------------------ */\n/* Root & inert sub-components (re-exported from the primitive) */\n/* ------------------------------------------------------------------ */\n\nexport {\n DropdownMenu,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuRadioGroup,\n} from '../../primitives/dropdown-menu';\n\n/* ------------------------------------------------------------------ */\n/* Trigger */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuTriggerProps = Omit<\n React.ComponentProps<typeof DropdownMenuTriggerPrimitive>,\n 'className' | 'render'\n> & {\n className?: string;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DropdownMenuTrigger = React.forwardRef<HTMLButtonElement, DropdownMenuTriggerProps>(\n ({ asChild, children, ...props }, ref) => (\n <DropdownMenuTriggerPrimitive ref={ref} render={asChildRender(asChild, children)} {...props}>\n {asChild ? undefined : children}\n </DropdownMenuTriggerPrimitive>\n ),\n);\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\n/* ------------------------------------------------------------------ */\n/* SubTrigger */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuSubTriggerProps = Omit<\n React.ComponentProps<typeof DropdownMenuSubTriggerPrimitive>,\n 'className' | 'render'\n> & {\n className?: string;\n inset?: boolean;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DropdownMenuSubTrigger = React.forwardRef<HTMLDivElement, DropdownMenuSubTriggerProps>(\n ({ className, inset, asChild, children, ...props }, ref) => (\n <DropdownMenuSubTriggerPrimitive\n ref={ref}\n className={cn(\n // Berget density & radius; focus/accent styling comes from the primitive.\n 'gap-2 rounded-berget-xs px-2 py-1.5',\n inset && 'pl-8',\n className,\n )}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuSubTriggerPrimitive>\n ),\n);\nDropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';\n\n/* ------------------------------------------------------------------ */\n/* SubContent */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuSubContentPrimitive>;\n\nconst DropdownMenuSubContent = React.forwardRef<HTMLDivElement, DropdownMenuSubContentProps>(\n ({ className, ...props }, ref) => (\n <DropdownMenuSubContentPrimitive\n ref={ref}\n className={cn(\n `\n rounded-berget-xs bg-berget-popover text-berget-popover-foreground\n shadow-berget-lg\n `,\n className,\n )}\n {...props}\n />\n ),\n);\nDropdownMenuSubContent.displayName = 'DropdownMenuSubContent';\n\n/* ------------------------------------------------------------------ */\n/* Content */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuContentPrimitive>;\n\nconst DropdownMenuContent = React.forwardRef<HTMLDivElement, DropdownMenuContentProps>(\n ({ className, ...props }, ref) => (\n <DropdownMenuContentPrimitive\n ref={ref}\n className={cn(\n `\n rounded-berget-xs bg-berget-popover text-berget-popover-foreground\n shadow-berget-md\n `,\n className,\n )}\n {...props}\n />\n ),\n);\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n\n/* ------------------------------------------------------------------ */\n/* Item */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuItemProps = Omit<\n React.ComponentProps<typeof DropdownMenuItemPrimitive>,\n 'className' | 'render' | 'label'\n> & {\n className?: string;\n inset?: boolean;\n /** Typeahead label for keyboard typeahead. */\n textValue?: string;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DropdownMenuItem = React.forwardRef<HTMLDivElement, DropdownMenuItemProps>(\n ({ className, inset, asChild, children, textValue, ...props }, ref) => (\n <DropdownMenuItemPrimitive\n ref={ref}\n label={textValue}\n className={cn(\n // Berget density & radius; focus accent and destructive variant from the primitive.\n 'gap-2 rounded-berget-xs px-2 py-1.5',\n inset && 'pl-8',\n className,\n )}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuItemPrimitive>\n ),\n);\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\n/* ------------------------------------------------------------------ */\n/* CheckboxItem */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuCheckboxItemProps = Omit<\n React.ComponentProps<typeof DropdownMenuCheckboxItemPrimitive>,\n 'className' | 'render' | 'label'\n> & {\n className?: string;\n /** Typeahead label for keyboard typeahead. */\n textValue?: string;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DropdownMenuCheckboxItem = React.forwardRef<HTMLDivElement, DropdownMenuCheckboxItemProps>(\n ({ className, children, asChild, textValue, ...props }, ref) => (\n <DropdownMenuCheckboxItemPrimitive\n ref={ref}\n label={textValue}\n className={cn('rounded-berget-xs', className)}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuCheckboxItemPrimitive>\n ),\n);\nDropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';\n\n/* ------------------------------------------------------------------ */\n/* RadioItem */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuRadioItemProps = Omit<\n React.ComponentProps<typeof DropdownMenuRadioItemPrimitive>,\n 'className' | 'render' | 'label'\n> & {\n className?: string;\n /** Typeahead label for keyboard typeahead. */\n textValue?: string;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DropdownMenuRadioItem = React.forwardRef<HTMLDivElement, DropdownMenuRadioItemProps>(\n ({ className, children, asChild, textValue, ...props }, ref) => (\n <DropdownMenuRadioItemPrimitive\n ref={ref}\n label={textValue}\n className={cn('rounded-berget-xs', className)}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuRadioItemPrimitive>\n ),\n);\nDropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';\n\n/* ------------------------------------------------------------------ */\n/* Label */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuLabelProps = Omit<\n React.ComponentProps<typeof DropdownMenuLabelPrimitive>,\n 'className' | 'render'\n> & {\n className?: string;\n inset?: boolean;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n};\n\nconst DropdownMenuLabel = React.forwardRef<HTMLDivElement, DropdownMenuLabelProps>(\n ({ className, inset, asChild, children, ...props }, ref) => (\n <DropdownMenuLabelPrimitive\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold text-berget-foreground',\n inset && 'pl-8',\n className,\n )}\n render={asChildRender(asChild, children)}\n {...props}\n >\n {asChild ? undefined : children}\n </DropdownMenuLabelPrimitive>\n ),\n);\nDropdownMenuLabel.displayName = 'DropdownMenuLabel';\n\n/* ------------------------------------------------------------------ */\n/* Separator */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuSeparatorProps = Omit<\n React.ComponentProps<typeof DropdownMenuSeparatorPrimitive>,\n 'className'\n> & { className?: string };\n\nconst DropdownMenuSeparator = React.forwardRef<HTMLDivElement, DropdownMenuSeparatorProps>(\n ({ className, ...props }, ref) => (\n <DropdownMenuSeparatorPrimitive\n ref={ref}\n className={cn('bg-berget-separator', className)}\n {...props}\n />\n ),\n);\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\n/* ------------------------------------------------------------------ */\n/* Shortcut */\n/* ------------------------------------------------------------------ */\n\ntype DropdownMenuShortcutProps = React.ComponentProps<typeof DropdownMenuShortcutPrimitive>;\n\nconst DropdownMenuShortcut = ({ className, ...props }: DropdownMenuShortcutProps) => {\n return (\n <DropdownMenuShortcutPrimitive\n className={cn('text-berget-muted-foreground', className)}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\n/* ------------------------------------------------------------------ */\n/* Exports */\n/* ------------------------------------------------------------------ */\n\nexport {\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n};\n"],"mappings":";;;;;;AA2CA,MAAM,sBAAsB,MAAM,YAC/B,EAAE,SAAS,UAAU,GAAG,SAAS,QAChC,oBAACA,uBAAD;CAAmC;CAAK,QAAQ,cAAc,SAAS,QAAQ;CAAG,GAAI;CACnF,UAAA,UAAU,KAAA,IAAY;AACK,CAAA,CAElC;AACA,oBAAoB,cAAc;AAgBlC,MAAM,yBAAyB,MAAM,YAClC,EAAE,WAAW,OAAO,SAAS,UAAU,GAAG,SAAS,QAClD,oBAACC,0BAAD;CACO;CACL,WAAW,GAET,uCACA,SAAS,QACT,SACF;CACA,QAAQ,cAAc,SAAS,QAAQ;CACvC,GAAI;CAEH,UAAA,UAAU,KAAA,IAAY;AACQ,CAAA,CAErC;AACA,uBAAuB,cAAc;AAQrC,MAAM,yBAAyB,MAAM,YAClC,EAAE,WAAW,GAAG,SAAS,QACxB,oBAACC,0BAAD;CACO;CACL,WAAW,GACT;;;WAIA,SACF;CACA,GAAI;AACL,CAAA,CAEL;AACA,uBAAuB,cAAc;AAQrC,MAAM,sBAAsB,MAAM,YAC/B,EAAE,WAAW,GAAG,SAAS,QACxB,oBAACC,uBAAD;CACO;CACL,WAAW,GACT;;;WAIA,SACF;CACA,GAAI;AACL,CAA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C,MAAM,wBAAwB,EAAE,WAAW,GAAG,YAAuC;CACnF,OACE,oBAACC,wBAAD;EACE,WAAW,GAAG,gCAAgC,SAAS;EACvD,GAAI;CACL,CAAA;AAEL;AACA,qBAAqB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.cjs","names":["cva","React","useRender","mergeProps","cn"],"sources":["../../../src/components/grid/Grid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cn } from '../../lib/utils';\n\nconst gridVariants = cva('grid', {\n variants: {\n align: {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n },\n },\n defaultVariants: {\n align: 'stretch',\n justify: 'start',\n },\n});\n\nexport type SpacingScale =\n | 0\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6\n | 8\n | 10\n | 12\n | 16\n | 20\n | 24\n | 32\n | 40\n | 48\n | 56\n | 64\n | 72\n | 80\n | 96;\n\nexport type GridColsScale = 1 | 2 | 3 | 4 | 6 | 12;\n\nexport type GridRowsScale = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface GridProps\n extends useRender.ComponentProps<'div'>, VariantProps<typeof gridVariants> {\n children?: React.ReactNode;\n cols?: GridColsScale;\n rows?: GridRowsScale;\n gap?: SpacingScale;\n gapX?: SpacingScale;\n gapY?: SpacingScale;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n}\n\nconst Grid = React.forwardRef<HTMLElement, GridProps>(\n (\n { className, align, justify, cols, rows, gap, gapX, gapY, asChild = false, children, ...props },\n ref,\n ) => {\n return useRender({\n ref,\n defaultTagName: 'div',\n render: asChild ? (children as React.ReactElement) : undefined,\n props: mergeProps<'div'>(\n {\n className: cn(\n gridVariants({ align, justify }),\n cols !== undefined &&\n `\n grid-cols-${cols}\n `,\n rows !== undefined &&\n `\n grid-rows-${rows}\n `,\n gap !== undefined &&\n `\n gap-${gap}\n `,\n gapX !== undefined &&\n `\n gap-x-${gapX}\n `,\n gapY !== undefined &&\n `\n gap-y-${gapY}\n `,\n className,\n ),\n children: asChild ? undefined : children,\n } as React.ComponentProps<'div'>,\n props,\n ),\n });\n },\n);\nGrid.displayName = 'Grid';\n\nexport { Grid, gridVariants };\n"],"mappings":";;;;;;;;;AAQA,MAAM,gBAAA,GAAeA,yBAAAA,IAAAA,CAAI,QAAQ;CAC/B,UAAU;EACR,OAAO;GACL,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;EACX;EACA,SAAS;GACP,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,QAAQ;GACR,QAAQ;EACV;CACF;CACA,iBAAiB;EACf,OAAO;EACP,SAAS;CACX;AACF,CAAC;AAyCD,MAAM,OAAOC,MAAM,YAEf,EAAE,WAAW,OAAO,SAAS,MAAM,MAAM,KAAK,MAAM,MAAM,UAAU,OAAO,UAAU,GAAG,SACxF,QACG;CACH,QAAA,GAAOC,0BAAAA,UAAAA,CAAU;EACf;EACA,gBAAgB;EAChB,QAAQ,UAAW,WAAkC,KAAA;EACrD,QAAA,GAAOC,2BAAAA,WAAAA,CACL;GACE,WAAWC,cAAAA,GACT,aAAa;IAAE;IAAO;GAAQ,CAAC,GAC/B,SAAS,KAAA,KACP;4BACc,KAAK;iBAErB,SAAS,KAAA,KACP;4BACc,KAAK;iBAErB,QAAQ,KAAA,KACN;sBACQ,IAAI;iBAEd,SAAS,KAAA,KACP;wBACU,KAAK;iBAEjB,SAAS,KAAA,KACP;wBACU,KAAK;iBAEjB,SACF;GACA,UAAU,UAAU,KAAA,IAAY;EAClC,GACA,KACF;CACF,CAAC;AACH,CACF;AACA,KAAK,cAAc"}
1
+ {"version":3,"file":"Grid.cjs","names":["cva","React","useRender","mergeProps","cn"],"sources":["../../../src/components/grid/Grid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cn } from '../../lib/utils';\n\nconst gridVariants = cva('grid', {\n variants: {\n align: {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n },\n },\n defaultVariants: {\n align: 'stretch',\n justify: 'start',\n },\n});\n\nexport type SpacingScale =\n | 0\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6\n | 8\n | 10\n | 12\n | 16\n | 20\n | 24\n | 32\n | 40\n | 48\n | 56\n | 64\n | 72\n | 80\n | 96;\n\nexport type GridColsScale = 1 | 2 | 3 | 4 | 6 | 12;\n\nexport type GridRowsScale = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface GridProps\n extends useRender.ComponentProps<'div'>, VariantProps<typeof gridVariants> {\n children?: React.ReactNode;\n cols?: GridColsScale;\n rows?: GridRowsScale;\n gap?: SpacingScale;\n gapX?: SpacingScale;\n gapY?: SpacingScale;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n}\n\nconst Grid = React.forwardRef<HTMLElement, GridProps>(\n (\n { className, align, justify, cols, rows, gap, gapX, gapY, asChild = false, children, ...props },\n ref,\n ) => {\n return useRender({\n ref,\n defaultTagName: 'div',\n render: asChild ? (children as React.ReactElement) : undefined,\n props: mergeProps<'div'>(\n {\n className: cn(\n gridVariants({ align, justify }),\n cols !== undefined &&\n `\n grid-cols-${cols}\n `,\n rows !== undefined &&\n `\n grid-rows-${rows}\n `,\n gap !== undefined &&\n `\n gap-${gap}\n `,\n gapX !== undefined &&\n `\n gap-x-${gapX}\n `,\n gapY !== undefined &&\n `\n gap-y-${gapY}\n `,\n className,\n ),\n children: asChild ? undefined : children,\n } as React.ComponentProps<'div'>,\n props,\n ),\n });\n },\n);\nGrid.displayName = 'Grid';\n\nexport { Grid, gridVariants };\n"],"mappings":";;;;;;;;;AAQA,MAAM,gBAAA,GAAeA,yBAAAA,IAAAA,CAAI,QAAQ;CAC/B,UAAU;EACR,OAAO;GACL,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;EACX;EACA,SAAS;GACP,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,QAAQ;GACR,QAAQ;EACV;CACF;CACA,iBAAiB;EACf,OAAO;EACP,SAAS;CACX;AACF,CAAC;AAyCD,MAAM,OAAOC,MAAM,YAEf,EAAE,WAAW,OAAO,SAAS,MAAM,MAAM,KAAK,MAAM,MAAM,UAAU,OAAO,UAAU,GAAG,SACxF,QACG;CACH,QAAA,GAAOC,0BAAAA,UAAAA,CAAU;EACf;EACA,gBAAgB;EAChB,QAAQ,UAAW,WAAkC,KAAA;EACrD,QAAA,GAAOC,2BAAAA,WAAAA,CACL;GACE,WAAWC,cAAAA,GACT,aAAa;IAAE;IAAO;GAAQ,CAAC,GAC/B,SAAS,KAAA,KACP;4BACc,KAAK;iBAErB,SAAS,KAAA,KACP;4BACc,KAAK;iBAErB,QAAQ,KAAA,KACN;sBACQ,IAAI;iBAEd,SAAS,KAAA,KACP;wBACU,KAAK;iBAEjB,SAAS,KAAA,KACP;wBACU,KAAK;iBAEjB,SACF;GACA,UAAU,UAAU,KAAA,IAAY;EAClC,GACA,KACF;CACF,CAAC;AACH,CACF;AACA,KAAK,cAAc"}
@@ -3,8 +3,8 @@ import { VariantProps } from "class-variance-authority";
3
3
  import { useRender } from "@base-ui/react/use-render";
4
4
  //#region src/components/grid/Grid.d.ts
5
5
  declare const gridVariants: (props?: ({
6
- align?: "center" | "end" | "start" | "stretch" | null | undefined;
7
- justify?: "center" | "end" | "start" | "between" | "around" | "evenly" | null | undefined;
6
+ align?: "end" | "start" | "center" | "stretch" | null | undefined;
7
+ justify?: "end" | "start" | "center" | "between" | "around" | "evenly" | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  export type SpacingScale = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64 | 72 | 80 | 96;
10
10
  export type GridColsScale = 1 | 2 | 3 | 4 | 6 | 12;
@@ -16,7 +16,7 @@ export interface GridProps extends useRender.ComponentProps<'div'>, VariantProps
16
16
  gap?: SpacingScale;
17
17
  gapX?: SpacingScale;
18
18
  gapY?: SpacingScale;
19
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
19
+ /** Render as a different element/component by merging props onto the child. */
20
20
  asChild?: boolean;
21
21
  }
22
22
  declare const Grid: React.ForwardRefExoticComponent<Omit<GridProps, "ref"> & React.RefAttributes<HTMLElement>>;
@@ -3,8 +3,8 @@ import { VariantProps } from "class-variance-authority";
3
3
  import { useRender } from "@base-ui/react/use-render";
4
4
  //#region src/components/grid/Grid.d.ts
5
5
  declare const gridVariants: (props?: ({
6
- align?: "center" | "end" | "start" | "stretch" | null | undefined;
7
- justify?: "center" | "end" | "start" | "between" | "around" | "evenly" | null | undefined;
6
+ align?: "end" | "start" | "center" | "stretch" | null | undefined;
7
+ justify?: "end" | "start" | "center" | "between" | "around" | "evenly" | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  export type SpacingScale = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64 | 72 | 80 | 96;
10
10
  export type GridColsScale = 1 | 2 | 3 | 4 | 6 | 12;
@@ -16,7 +16,7 @@ export interface GridProps extends useRender.ComponentProps<'div'>, VariantProps
16
16
  gap?: SpacingScale;
17
17
  gapX?: SpacingScale;
18
18
  gapY?: SpacingScale;
19
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
19
+ /** Render as a different element/component by merging props onto the child. */
20
20
  asChild?: boolean;
21
21
  }
22
22
  declare const Grid: React.ForwardRefExoticComponent<Omit<GridProps, "ref"> & React.RefAttributes<HTMLElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.mjs","names":[],"sources":["../../../src/components/grid/Grid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cn } from '../../lib/utils';\n\nconst gridVariants = cva('grid', {\n variants: {\n align: {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n },\n },\n defaultVariants: {\n align: 'stretch',\n justify: 'start',\n },\n});\n\nexport type SpacingScale =\n | 0\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6\n | 8\n | 10\n | 12\n | 16\n | 20\n | 24\n | 32\n | 40\n | 48\n | 56\n | 64\n | 72\n | 80\n | 96;\n\nexport type GridColsScale = 1 | 2 | 3 | 4 | 6 | 12;\n\nexport type GridRowsScale = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface GridProps\n extends useRender.ComponentProps<'div'>, VariantProps<typeof gridVariants> {\n children?: React.ReactNode;\n cols?: GridColsScale;\n rows?: GridRowsScale;\n gap?: SpacingScale;\n gapX?: SpacingScale;\n gapY?: SpacingScale;\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n}\n\nconst Grid = React.forwardRef<HTMLElement, GridProps>(\n (\n { className, align, justify, cols, rows, gap, gapX, gapY, asChild = false, children, ...props },\n ref,\n ) => {\n return useRender({\n ref,\n defaultTagName: 'div',\n render: asChild ? (children as React.ReactElement) : undefined,\n props: mergeProps<'div'>(\n {\n className: cn(\n gridVariants({ align, justify }),\n cols !== undefined &&\n `\n grid-cols-${cols}\n `,\n rows !== undefined &&\n `\n grid-rows-${rows}\n `,\n gap !== undefined &&\n `\n gap-${gap}\n `,\n gapX !== undefined &&\n `\n gap-x-${gapX}\n `,\n gapY !== undefined &&\n `\n gap-y-${gapY}\n `,\n className,\n ),\n children: asChild ? undefined : children,\n } as React.ComponentProps<'div'>,\n props,\n ),\n });\n },\n);\nGrid.displayName = 'Grid';\n\nexport { Grid, gridVariants };\n"],"mappings":";;;;;;;AAQA,MAAM,eAAe,IAAI,QAAQ;CAC/B,UAAU;EACR,OAAO;GACL,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;EACX;EACA,SAAS;GACP,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,QAAQ;GACR,QAAQ;EACV;CACF;CACA,iBAAiB;EACf,OAAO;EACP,SAAS;CACX;AACF,CAAC;AAyCD,MAAM,OAAO,MAAM,YAEf,EAAE,WAAW,OAAO,SAAS,MAAM,MAAM,KAAK,MAAM,MAAM,UAAU,OAAO,UAAU,GAAG,SACxF,QACG;CACH,OAAO,UAAU;EACf;EACA,gBAAgB;EAChB,QAAQ,UAAW,WAAkC,KAAA;EACrD,OAAO,WACL;GACE,WAAW,GACT,aAAa;IAAE;IAAO;GAAQ,CAAC,GAC/B,SAAS,KAAA,KACP;4BACc,KAAK;iBAErB,SAAS,KAAA,KACP;4BACc,KAAK;iBAErB,QAAQ,KAAA,KACN;sBACQ,IAAI;iBAEd,SAAS,KAAA,KACP;wBACU,KAAK;iBAEjB,SAAS,KAAA,KACP;wBACU,KAAK;iBAEjB,SACF;GACA,UAAU,UAAU,KAAA,IAAY;EAClC,GACA,KACF;CACF,CAAC;AACH,CACF;AACA,KAAK,cAAc"}
1
+ {"version":3,"file":"Grid.mjs","names":[],"sources":["../../../src/components/grid/Grid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cn } from '../../lib/utils';\n\nconst gridVariants = cva('grid', {\n variants: {\n align: {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n },\n },\n defaultVariants: {\n align: 'stretch',\n justify: 'start',\n },\n});\n\nexport type SpacingScale =\n | 0\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6\n | 8\n | 10\n | 12\n | 16\n | 20\n | 24\n | 32\n | 40\n | 48\n | 56\n | 64\n | 72\n | 80\n | 96;\n\nexport type GridColsScale = 1 | 2 | 3 | 4 | 6 | 12;\n\nexport type GridRowsScale = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface GridProps\n extends useRender.ComponentProps<'div'>, VariantProps<typeof gridVariants> {\n children?: React.ReactNode;\n cols?: GridColsScale;\n rows?: GridRowsScale;\n gap?: SpacingScale;\n gapX?: SpacingScale;\n gapY?: SpacingScale;\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n}\n\nconst Grid = React.forwardRef<HTMLElement, GridProps>(\n (\n { className, align, justify, cols, rows, gap, gapX, gapY, asChild = false, children, ...props },\n ref,\n ) => {\n return useRender({\n ref,\n defaultTagName: 'div',\n render: asChild ? (children as React.ReactElement) : undefined,\n props: mergeProps<'div'>(\n {\n className: cn(\n gridVariants({ align, justify }),\n cols !== undefined &&\n `\n grid-cols-${cols}\n `,\n rows !== undefined &&\n `\n grid-rows-${rows}\n `,\n gap !== undefined &&\n `\n gap-${gap}\n `,\n gapX !== undefined &&\n `\n gap-x-${gapX}\n `,\n gapY !== undefined &&\n `\n gap-y-${gapY}\n `,\n className,\n ),\n children: asChild ? undefined : children,\n } as React.ComponentProps<'div'>,\n props,\n ),\n });\n },\n);\nGrid.displayName = 'Grid';\n\nexport { Grid, gridVariants };\n"],"mappings":";;;;;;;AAQA,MAAM,eAAe,IAAI,QAAQ;CAC/B,UAAU;EACR,OAAO;GACL,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;EACX;EACA,SAAS;GACP,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,QAAQ;GACR,QAAQ;EACV;CACF;CACA,iBAAiB;EACf,OAAO;EACP,SAAS;CACX;AACF,CAAC;AAyCD,MAAM,OAAO,MAAM,YAEf,EAAE,WAAW,OAAO,SAAS,MAAM,MAAM,KAAK,MAAM,MAAM,UAAU,OAAO,UAAU,GAAG,SACxF,QACG;CACH,OAAO,UAAU;EACf;EACA,gBAAgB;EAChB,QAAQ,UAAW,WAAkC,KAAA;EACrD,OAAO,WACL;GACE,WAAW,GACT,aAAa;IAAE;IAAO;GAAQ,CAAC,GAC/B,SAAS,KAAA,KACP;4BACc,KAAK;iBAErB,SAAS,KAAA,KACP;4BACc,KAAK;iBAErB,QAAQ,KAAA,KACN;sBACQ,IAAI;iBAEd,SAAS,KAAA,KACP;wBACU,KAAK;iBAEjB,SAAS,KAAA,KACP;wBACU,KAAK;iBAEjB,SACF;GACA,UAAU,UAAU,KAAA,IAAY;EAClC,GACA,KACF;CACF,CAAC;AACH,CACF;AACA,KAAK,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Item.cjs","names":["ItemPrimitive","cn","React","ItemMediaPrimitive","ItemTitlePrimitive","ItemDescriptionPrimitive","ItemSeparatorPrimitive"],"sources":["../../../src/components/item/Item.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../lib/utils';\nimport {\n Item as ItemPrimitive,\n ItemGroup,\n ItemSeparator as ItemSeparatorPrimitive,\n ItemMedia as ItemMediaPrimitive,\n ItemContent,\n ItemTitle as ItemTitlePrimitive,\n ItemDescription as ItemDescriptionPrimitive,\n ItemActions,\n ItemHeader,\n ItemFooter,\n} from '@/primitives/item';\nimport type { VariantProps } from 'class-variance-authority';\n\nexport interface ItemProps extends React.ComponentProps<typeof ItemPrimitive> {\n variant?: VariantProps<typeof ItemPrimitive>['variant'];\n size?: VariantProps<typeof ItemPrimitive>['size'];\n /** Render as a different element/component. Replaces the Radix `asChild` prop. */\n asChild?: boolean;\n}\n\nexport function Item({ className, asChild, children, ...props }: ItemProps) {\n return (\n <ItemPrimitive\n render={asChild ? (children as React.ReactElement) : undefined}\n className={cn(\n /* Variant colours — override primitive defaults */\n 'data-[variant=outline]:border-berget-item-outline-border',\n 'data-[variant=muted]:bg-berget-item-muted-bg',\n 'data-[variant=muted]:text-berget-item-muted-fg',\n /* Hover / focus */\n '[&_a]:hover:bg-berget-item-link-hover-surface',\n `\n focus-visible:border-berget-item-focus-ring\n focus-visible:ring-berget-item-focus-ring/50\n `,\n className,\n )}\n {...props}\n >\n {asChild ? undefined : children}\n </ItemPrimitive>\n );\n}\n\n/** Re-export unchanged sub-components. */\nexport { ItemGroup, ItemContent, ItemActions, ItemHeader, ItemFooter };\n\n/** ItemMedia — override icon background. */\nexport const ItemMedia = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof ItemMediaPrimitive>\n>(({ className, ...props }, ref) => {\n return (\n <ItemMediaPrimitive\n ref={ref}\n className={cn('data-[variant=icon]:bg-berget-item-media-icon-bg', className)}\n {...props}\n />\n );\n});\nItemMedia.displayName = 'ItemMedia';\n\n/** ItemTitle — override to use semantic foreground. */\nexport const ItemTitle = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof ItemTitlePrimitive>\n>(({ className, ...props }, ref) => {\n return (\n <ItemTitlePrimitive\n ref={ref}\n className={cn('text-berget-item-default-fg', className)}\n {...props}\n />\n );\n});\nItemTitle.displayName = 'ItemTitle';\n\n/** ItemDescription — override muted text colour. */\nexport const ItemDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentProps<typeof ItemDescriptionPrimitive>\n>(({ className, ...props }, ref) => {\n return (\n <ItemDescriptionPrimitive\n ref={ref}\n className={cn('text-berget-item-description-fg', className)}\n {...props}\n />\n );\n});\nItemDescription.displayName = 'ItemDescription';\n\n/** ItemSeparator — override colour. */\nexport const ItemSeparator = React.forwardRef<\n React.ComponentRef<typeof ItemSeparatorPrimitive>,\n React.ComponentProps<typeof ItemSeparatorPrimitive>\n>(({ className, ...props }, ref) => {\n return (\n <ItemSeparatorPrimitive\n ref={ref}\n className={cn('bg-berget-item-separator', className)}\n {...props}\n />\n );\n});\nItemSeparator.displayName = 'ItemSeparator';\n"],"mappings":";;;;;;;;AAyBA,SAAgB,KAAK,EAAE,WAAW,SAAS,UAAU,GAAG,SAAoB;CAC1E,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,aAAAA,MAAD;EACE,QAAQ,UAAW,WAAkC,KAAA;EACrD,WAAWC,cAAAA,GAET,4DACA,gDACA,kDAEA,iDACA;;;WAIA,SACF;EACA,GAAI;EAEH,UAAA,UAAU,KAAA,IAAY;CACV,CAAA;AAEnB;;AAMA,MAAa,YAAYC,MAAM,YAG5B,EAAE,WAAW,GAAG,SAAS,QAAQ;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,WAAD;EACO;EACL,WAAWF,cAAAA,GAAG,oDAAoD,SAAS;EAC3E,GAAI;CACL,CAAA;AAEL,CAAC;AACD,UAAU,cAAc;;AAGxB,MAAa,YAAYC,MAAM,YAG5B,EAAE,WAAW,GAAG,SAAS,QAAQ;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACE,aAAAA,WAAD;EACO;EACL,WAAWH,cAAAA,GAAG,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL,CAAC;AACD,UAAU,cAAc;;AAGxB,MAAa,kBAAkBC,MAAM,YAGlC,EAAE,WAAW,GAAG,SAAS,QAAQ;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACG,aAAAA,iBAAD;EACO;EACL,WAAWJ,cAAAA,GAAG,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL,CAAC;AACD,gBAAgB,cAAc;;AAG9B,MAAa,gBAAgBC,MAAM,YAGhC,EAAE,WAAW,GAAG,SAAS,QAAQ;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACI,aAAAA,eAAD;EACO;EACL,WAAWL,cAAAA,GAAG,4BAA4B,SAAS;EACnD,GAAI;CACL,CAAA;AAEL,CAAC;AACD,cAAc,cAAc"}
1
+ {"version":3,"file":"Item.cjs","names":["ItemPrimitive","cn","React","ItemMediaPrimitive","ItemTitlePrimitive","ItemDescriptionPrimitive","ItemSeparatorPrimitive"],"sources":["../../../src/components/item/Item.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../lib/utils';\nimport {\n Item as ItemPrimitive,\n ItemGroup,\n ItemSeparator as ItemSeparatorPrimitive,\n ItemMedia as ItemMediaPrimitive,\n ItemContent,\n ItemTitle as ItemTitlePrimitive,\n ItemDescription as ItemDescriptionPrimitive,\n ItemActions,\n ItemHeader,\n ItemFooter,\n} from '@/primitives/item';\nimport type { VariantProps } from 'class-variance-authority';\n\nexport interface ItemProps extends React.ComponentProps<typeof ItemPrimitive> {\n variant?: VariantProps<typeof ItemPrimitive>['variant'];\n size?: VariantProps<typeof ItemPrimitive>['size'];\n /** Render as a different element/component by merging props onto the child. */\n asChild?: boolean;\n}\n\nexport function Item({ className, asChild, children, ...props }: ItemProps) {\n return (\n <ItemPrimitive\n render={asChild ? (children as React.ReactElement) : undefined}\n className={cn(\n /* Variant colours — override primitive defaults */\n 'data-[variant=outline]:border-berget-item-outline-border',\n 'data-[variant=muted]:bg-berget-item-muted-bg',\n 'data-[variant=muted]:text-berget-item-muted-fg',\n /* Hover / focus */\n '[&_a]:hover:bg-berget-item-link-hover-surface',\n `\n focus-visible:border-berget-item-focus-ring\n focus-visible:ring-berget-item-focus-ring/50\n `,\n className,\n )}\n {...props}\n >\n {asChild ? undefined : children}\n </ItemPrimitive>\n );\n}\n\n/** Re-export unchanged sub-components. */\nexport { ItemGroup, ItemContent, ItemActions, ItemHeader, ItemFooter };\n\n/** ItemMedia — override icon background. */\nexport const ItemMedia = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof ItemMediaPrimitive>\n>(({ className, ...props }, ref) => {\n return (\n <ItemMediaPrimitive\n ref={ref}\n className={cn('data-[variant=icon]:bg-berget-item-media-icon-bg', className)}\n {...props}\n />\n );\n});\nItemMedia.displayName = 'ItemMedia';\n\n/** ItemTitle — override to use semantic foreground. */\nexport const ItemTitle = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof ItemTitlePrimitive>\n>(({ className, ...props }, ref) => {\n return (\n <ItemTitlePrimitive\n ref={ref}\n className={cn('text-berget-item-default-fg', className)}\n {...props}\n />\n );\n});\nItemTitle.displayName = 'ItemTitle';\n\n/** ItemDescription — override muted text colour. */\nexport const ItemDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentProps<typeof ItemDescriptionPrimitive>\n>(({ className, ...props }, ref) => {\n return (\n <ItemDescriptionPrimitive\n ref={ref}\n className={cn('text-berget-item-description-fg', className)}\n {...props}\n />\n );\n});\nItemDescription.displayName = 'ItemDescription';\n\n/** ItemSeparator — override colour. */\nexport const ItemSeparator = React.forwardRef<\n React.ComponentRef<typeof ItemSeparatorPrimitive>,\n React.ComponentProps<typeof ItemSeparatorPrimitive>\n>(({ className, ...props }, ref) => {\n return (\n <ItemSeparatorPrimitive\n ref={ref}\n className={cn('bg-berget-item-separator', className)}\n {...props}\n />\n );\n});\nItemSeparator.displayName = 'ItemSeparator';\n"],"mappings":";;;;;;;;AAyBA,SAAgB,KAAK,EAAE,WAAW,SAAS,UAAU,GAAG,SAAoB;CAC1E,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,aAAAA,MAAD;EACE,QAAQ,UAAW,WAAkC,KAAA;EACrD,WAAWC,cAAAA,GAET,4DACA,gDACA,kDAEA,iDACA;;;WAIA,SACF;EACA,GAAI;EAEH,UAAA,UAAU,KAAA,IAAY;CACV,CAAA;AAEnB;;AAMA,MAAa,YAAYC,MAAM,YAG5B,EAAE,WAAW,GAAG,SAAS,QAAQ;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,WAAD;EACO;EACL,WAAWF,cAAAA,GAAG,oDAAoD,SAAS;EAC3E,GAAI;CACL,CAAA;AAEL,CAAC;AACD,UAAU,cAAc;;AAGxB,MAAa,YAAYC,MAAM,YAG5B,EAAE,WAAW,GAAG,SAAS,QAAQ;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACE,aAAAA,WAAD;EACO;EACL,WAAWH,cAAAA,GAAG,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL,CAAC;AACD,UAAU,cAAc;;AAGxB,MAAa,kBAAkBC,MAAM,YAGlC,EAAE,WAAW,GAAG,SAAS,QAAQ;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACG,aAAAA,iBAAD;EACO;EACL,WAAWJ,cAAAA,GAAG,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL,CAAC;AACD,gBAAgB,cAAc;;AAG9B,MAAa,gBAAgBC,MAAM,YAGhC,EAAE,WAAW,GAAG,SAAS,QAAQ;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACI,aAAAA,eAAD;EACO;EACL,WAAWL,cAAAA,GAAG,4BAA4B,SAAS;EACnD,GAAI;CACL,CAAA;AAEL,CAAC;AACD,cAAc,cAAc"}
@@ -5,7 +5,7 @@ import { VariantProps } from "class-variance-authority";
5
5
  export interface ItemProps extends React.ComponentProps<typeof Item$1> {
6
6
  variant?: VariantProps<typeof Item$1>['variant'];
7
7
  size?: VariantProps<typeof Item$1>['size'];
8
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
8
+ /** Render as a different element/component by merging props onto the child. */
9
9
  asChild?: boolean;
10
10
  }
11
11
  export declare function Item({ className, asChild, children, ...props }: ItemProps): import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ import { VariantProps } from "class-variance-authority";
5
5
  export interface ItemProps extends React.ComponentProps<typeof Item$1> {
6
6
  variant?: VariantProps<typeof Item$1>['variant'];
7
7
  size?: VariantProps<typeof Item$1>['size'];
8
- /** Render as a different element/component. Replaces the Radix `asChild` prop. */
8
+ /** Render as a different element/component by merging props onto the child. */
9
9
  asChild?: boolean;
10
10
  }
11
11
  export declare function Item({ className, asChild, children, ...props }: ItemProps): import("react/jsx-runtime").JSX.Element;