@medusajs/ui 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/cjs/components/button/button.js +8 -8
  2. package/dist/cjs/components/button/button.js.map +1 -1
  3. package/dist/cjs/components/calendar/calendar.js +1 -1
  4. package/dist/cjs/components/calendar/calendar.js.map +1 -1
  5. package/dist/cjs/components/checkbox/checkbox.js +1 -1
  6. package/dist/cjs/components/checkbox/checkbox.js.map +1 -1
  7. package/dist/cjs/components/command-bar/command-bar.js +5 -5
  8. package/dist/cjs/components/command-bar/command-bar.js.map +1 -1
  9. package/dist/cjs/components/currency-input/currency-input.js +10 -6
  10. package/dist/cjs/components/currency-input/currency-input.js.map +1 -1
  11. package/dist/cjs/components/date-picker/date-picker.js +165 -70
  12. package/dist/cjs/components/date-picker/date-picker.js.map +1 -1
  13. package/dist/cjs/components/dropdown-menu/dropdown-menu.js +7 -7
  14. package/dist/cjs/components/dropdown-menu/dropdown-menu.js.map +1 -1
  15. package/dist/cjs/components/icon-button/icon-button.js +8 -8
  16. package/dist/cjs/components/icon-button/icon-button.js.map +1 -1
  17. package/dist/cjs/components/input/input.js +1 -1
  18. package/dist/cjs/components/input/input.js.map +1 -1
  19. package/dist/cjs/components/popover/index.d.ts +1 -0
  20. package/dist/cjs/components/popover/index.js +5 -0
  21. package/dist/cjs/components/popover/index.js.map +1 -0
  22. package/dist/cjs/components/popover/popover.d.ts +17 -0
  23. package/dist/cjs/components/popover/popover.js +41 -0
  24. package/dist/cjs/components/popover/popover.js.map +1 -0
  25. package/dist/cjs/components/radio-group/radio-group.d.ts +5 -0
  26. package/dist/cjs/components/radio-group/radio-group.js +25 -4
  27. package/dist/cjs/components/radio-group/radio-group.js.map +1 -1
  28. package/dist/cjs/components/select/select.js +3 -7
  29. package/dist/cjs/components/select/select.js.map +1 -1
  30. package/dist/cjs/components/table/table.js +3 -4
  31. package/dist/cjs/components/table/table.js.map +1 -1
  32. package/dist/cjs/components/text/text.d.ts +1 -0
  33. package/dist/cjs/components/text/text.js +64 -7
  34. package/dist/cjs/components/text/text.js.map +1 -1
  35. package/dist/cjs/components/textarea/textarea.js +1 -1
  36. package/dist/cjs/components/textarea/textarea.js.map +1 -1
  37. package/dist/cjs/components/time-input/time-input.js +1 -1
  38. package/dist/cjs/components/time-input/time-input.js.map +1 -1
  39. package/dist/cjs/index.d.ts +1 -0
  40. package/dist/cjs/index.js +3 -1
  41. package/dist/cjs/index.js.map +1 -1
  42. package/dist/esm/components/button/button.js +8 -8
  43. package/dist/esm/components/button/button.js.map +1 -1
  44. package/dist/esm/components/calendar/calendar.js +1 -1
  45. package/dist/esm/components/calendar/calendar.js.map +1 -1
  46. package/dist/esm/components/checkbox/checkbox.js +1 -1
  47. package/dist/esm/components/checkbox/checkbox.js.map +1 -1
  48. package/dist/esm/components/command-bar/command-bar.js +5 -5
  49. package/dist/esm/components/command-bar/command-bar.js.map +1 -1
  50. package/dist/esm/components/currency-input/currency-input.js +10 -6
  51. package/dist/esm/components/currency-input/currency-input.js.map +1 -1
  52. package/dist/esm/components/date-picker/date-picker.js +165 -70
  53. package/dist/esm/components/date-picker/date-picker.js.map +1 -1
  54. package/dist/esm/components/dropdown-menu/dropdown-menu.js +7 -7
  55. package/dist/esm/components/dropdown-menu/dropdown-menu.js.map +1 -1
  56. package/dist/esm/components/icon-button/icon-button.js +8 -8
  57. package/dist/esm/components/icon-button/icon-button.js.map +1 -1
  58. package/dist/esm/components/input/input.js +1 -1
  59. package/dist/esm/components/input/input.js.map +1 -1
  60. package/dist/esm/components/popover/index.d.ts +1 -0
  61. package/dist/esm/components/popover/index.js +2 -0
  62. package/dist/esm/components/popover/index.js.map +1 -0
  63. package/dist/esm/components/popover/popover.d.ts +17 -0
  64. package/dist/esm/components/popover/popover.js +37 -0
  65. package/dist/esm/components/popover/popover.js.map +1 -0
  66. package/dist/esm/components/radio-group/radio-group.d.ts +5 -0
  67. package/dist/esm/components/radio-group/radio-group.js +25 -4
  68. package/dist/esm/components/radio-group/radio-group.js.map +1 -1
  69. package/dist/esm/components/select/select.js +4 -8
  70. package/dist/esm/components/select/select.js.map +1 -1
  71. package/dist/esm/components/table/table.js +3 -4
  72. package/dist/esm/components/table/table.js.map +1 -1
  73. package/dist/esm/components/text/text.d.ts +1 -0
  74. package/dist/esm/components/text/text.js +64 -7
  75. package/dist/esm/components/text/text.js.map +1 -1
  76. package/dist/esm/components/textarea/textarea.js +1 -1
  77. package/dist/esm/components/textarea/textarea.js.map +1 -1
  78. package/dist/esm/components/time-input/time-input.js +1 -1
  79. package/dist/esm/components/time-input/time-input.js.map +1 -1
  80. package/dist/esm/index.d.ts +1 -0
  81. package/dist/esm/index.js +1 -0
  82. package/dist/esm/index.js.map +1 -1
  83. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../../src/components/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAA+E;AAC/E,kFAA2D;AAC3D,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;AAC5B,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEtC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;AAClC,OAAO,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAE5C,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAA;AAC9B,KAAK,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAExC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAA;AAC9B,OAAO,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAE5C,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAA;AACxC,UAAU,CAAC,WAAW,GAAG,yBAAyB,CAAA;AAElD,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAGrC,CAAC,EA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IACJ,YAAY;IACZ,UAAU;IACV,SAAS;IACT,KAAK;IACL,SAAS;IACT,QAAQ;IACR,IAAI;CACL,CAAC,CAAA;AAEO,oCAAY","sourcesContent":["\"use client\"\n\nimport { CheckMini, ChevronRightMini, EllipseMiniSolid } from \"@medusajs/icons\"\nimport * as Primitives from \"@radix-ui/react-dropdown-menu\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst Root = Primitives.Root\nRoot.displayName = \"DropdownMenu.Root\"\n\nconst Trigger = Primitives.Trigger\nTrigger.displayName = \"DropdownMenu.Trigger\"\n\nconst Group = Primitives.Group\nGroup.displayName = \"DropdownMenu.Group\"\n\nconst SubMenu = Primitives.Sub\nSubMenu.displayName = \"DropdownMenu.SubMenu\"\n\nconst RadioGroup = Primitives.RadioGroup\nRadioGroup.displayName = \"DropdownMenu.RadioGroup\"\n\nconst SubMenuTrigger = React.forwardRef<\n React.ElementRef<typeof Primitives.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof Primitives.SubTrigger>\n>(({ className, children, ...props }, ref) => (\n <Primitives.SubTrigger\n ref={ref}\n className={clx(\n \"focus:bg-ui-bg-base-pressed data-[state=open]:bg-ui-bg-base-pressed txt-compact-small flex cursor-default select-none items-center rounded-sm px-3 py-2 outline-none\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightMini className=\"ml-auto\" />\n </Primitives.SubTrigger>\n))\nSubMenuTrigger.displayName = \"DropdownMenu.SubMenuTrigger\"\n\nconst SubMenuContent = React.forwardRef<\n React.ElementRef<typeof Primitives.SubContent>,\n React.ComponentPropsWithoutRef<typeof Primitives.SubContent>\n>(({ className, ...props }, ref) => (\n <Primitives.Portal>\n <Primitives.SubContent\n ref={ref}\n className={clx(\n \"bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout min-w-[8rem] overflow-hidden rounded-lg border p-1\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </Primitives.Portal>\n))\nSubMenuContent.displayName = \"DropdownMenu.SubMenuContent\"\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof Primitives.Content>,\n React.ComponentPropsWithoutRef<typeof Primitives.Content>\n>(({ className, sideOffset = 8, align = \"start\", ...props }, ref) => (\n <Primitives.Portal>\n <Primitives.Content\n ref={ref}\n sideOffset={sideOffset}\n align={align}\n className={clx(\n \"bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout min-w-[300px] overflow-hidden rounded-lg p-1\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </Primitives.Portal>\n))\nContent.displayName = \"DropdownMenu.Content\"\n\nconst Item = React.forwardRef<\n React.ElementRef<typeof Primitives.Item>,\n React.ComponentPropsWithoutRef<typeof Primitives.Item>\n>(({ className, ...props }, ref) => (\n <Primitives.Item\n ref={ref}\n className={clx(\n \"bg-ui-bg-base focus:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled txt-compact-small relative flex cursor-default select-none items-center rounded-md px-3 py-2 outline-none transition-colors data-[disabled]:pointer-events-none\",\n className\n )}\n {...props}\n />\n))\nItem.displayName = \"DropdownMenu.Item\"\n\nconst CheckboxItem = React.forwardRef<\n React.ElementRef<typeof Primitives.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof Primitives.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <Primitives.CheckboxItem\n ref={ref}\n className={clx(\n \"focus:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled relative flex cursor-default select-none items-center rounded-md py-2 pl-10 pr-3 text-sm outline-none transition-colors data-[disabled]:pointer-events-none\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-3 flex h-5 w-5 items-center justify-center\">\n <Primitives.ItemIndicator>\n <CheckMini />\n </Primitives.ItemIndicator>\n </span>\n {children}\n </Primitives.CheckboxItem>\n))\nCheckboxItem.displayName = \"DropdownMenu.CheckboxItem\"\n\nconst RadioItem = React.forwardRef<\n React.ElementRef<typeof Primitives.RadioItem>,\n React.ComponentPropsWithoutRef<typeof Primitives.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <Primitives.RadioItem\n ref={ref}\n className={clx(\n \"focus:bg-ui-bg-base-pressed hover:bg-ui-base-hover bg-ui-bg-base txt-compact-small relative flex cursor-default select-none items-center rounded-md py-2 pl-10 pr-3 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[state=checked]:font-medium data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-3 flex h-5 w-5 items-center justify-center\">\n <Primitives.ItemIndicator>\n <EllipseMiniSolid className=\"text-ui-fg-base\" />\n </Primitives.ItemIndicator>\n </span>\n {children}\n </Primitives.RadioItem>\n))\nRadioItem.displayName = \"DropdownMenu.RadioItem\"\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof Primitives.Label>,\n React.ComponentPropsWithoutRef<typeof Primitives.Label>\n>(({ className, ...props }, ref) => (\n <Primitives.Label\n ref={ref}\n className={clx(\n \"text-ui-fg-subtle txt-compact-xsmall-plus px-2 py-1.5\",\n className\n )}\n {...props}\n />\n))\nLabel.displayName = \"DropdownMenu.Label\"\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof Primitives.Separator>,\n React.ComponentPropsWithoutRef<typeof Primitives.Separator>\n>(({ className, ...props }, ref) => (\n <Primitives.Separator\n ref={ref}\n className={clx(\"bg-ui-border-base -mx-1 my-1 h-px\", className)}\n {...props}\n />\n))\nSeparator.displayName = \"DropdownMenu.Separator\"\n\nconst Shortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={clx(\n \"text-ui-fg-subtle txt-compact-small ml-auto tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\nShortcut.displayName = \"DropdownMenu.Shortcut\"\n\nconst Hint = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={clx(\n \"text-ui-fg-subtle txt-compact-small ml-auto tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\nHint.displayName = \"DropdownMenu.Hint\"\n\nconst DropdownMenu = Object.assign(Root, {\n Trigger,\n Group,\n SubMenu,\n SubMenuContent,\n SubMenuTrigger,\n Content,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n Label,\n Separator,\n Shortcut,\n Hint,\n})\n\nexport { DropdownMenu }\n"]}
1
+ {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../../src/components/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAA+E;AAC/E,kFAA2D;AAC3D,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;AAC5B,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEtC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;AAClC,OAAO,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAE5C,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAA;AAC9B,KAAK,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAExC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAA;AAC9B,OAAO,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAE5C,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAA;AACxC,UAAU,CA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C,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEtC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACvC,OAAO;IACP,KAAK;IACL,OAAO;IACP,cAAc;IACd,cAAc;IACd,OAAO;IACP,IAAI;IACJ,YAAY;IACZ,UAAU;IACV,SAAS;IACT,KAAK;IACL,SAAS;IACT,QAAQ;IACR,IAAI;CACL,CAAC,CAAA;AAEO,oCAAY","sourcesContent":["\"use client\"\n\nimport { CheckMini, ChevronRightMini, EllipseMiniSolid } from \"@medusajs/icons\"\nimport * as Primitives from \"@radix-ui/react-dropdown-menu\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst Root = Primitives.Root\nRoot.displayName = \"DropdownMenu.Root\"\n\nconst Trigger = Primitives.Trigger\nTrigger.displayName = \"DropdownMenu.Trigger\"\n\nconst Group = Primitives.Group\nGroup.displayName = \"DropdownMenu.Group\"\n\nconst SubMenu = Primitives.Sub\nSubMenu.displayName = \"DropdownMenu.SubMenu\"\n\nconst RadioGroup = Primitives.RadioGroup\nRadioGroup.displayName = \"DropdownMenu.RadioGroup\"\n\nconst SubMenuTrigger = React.forwardRef<\n React.ElementRef<typeof Primitives.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof Primitives.SubTrigger>\n>(({ className, children, ...props }, ref) => (\n <Primitives.SubTrigger\n ref={ref}\n className={clx(\n \"focus:bg-ui-bg-base-pressed data-[state=open]:bg-ui-bg-base-pressed txt-compact-small flex cursor-default select-none items-center rounded-sm px-3 py-2 outline-none\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightMini className=\"ml-auto\" />\n </Primitives.SubTrigger>\n))\nSubMenuTrigger.displayName = \"DropdownMenu.SubMenuTrigger\"\n\nconst SubMenuContent = React.forwardRef<\n React.ElementRef<typeof Primitives.SubContent>,\n React.ComponentPropsWithoutRef<typeof Primitives.SubContent>\n>(({ className, collisionPadding = 8, ...props }, ref) => (\n <Primitives.Portal>\n <Primitives.SubContent\n ref={ref}\n collisionPadding={collisionPadding}\n className={clx(\n \"bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout max-h-[var(--radix-popper-available-height)] min-w-[8rem] overflow-hidden rounded-lg border p-1\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </Primitives.Portal>\n))\nSubMenuContent.displayName = \"DropdownMenu.SubMenuContent\"\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof Primitives.Content>,\n React.ComponentPropsWithoutRef<typeof Primitives.Content>\n>(\n (\n {\n className,\n sideOffset = 8,\n collisionPadding = 8,\n align = \"start\",\n ...props\n },\n ref\n ) => (\n <Primitives.Portal>\n <Primitives.Content\n ref={ref}\n sideOffset={sideOffset}\n align={align}\n collisionPadding={collisionPadding}\n className={clx(\n \"bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout max-h-[var(--radix-popper-available-height)] min-w-[220px] overflow-hidden rounded-lg p-1\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </Primitives.Portal>\n )\n)\nContent.displayName = \"DropdownMenu.Content\"\n\nconst Item = React.forwardRef<\n React.ElementRef<typeof Primitives.Item>,\n React.ComponentPropsWithoutRef<typeof Primitives.Item>\n>(({ className, ...props }, ref) => (\n <Primitives.Item\n ref={ref}\n className={clx(\n \"bg-ui-bg-base focus:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled txt-compact-small relative flex cursor-pointer select-none items-center rounded-md px-3 py-2 outline-none transition-colors data-[disabled]:pointer-events-none\",\n className\n )}\n {...props}\n />\n))\nItem.displayName = \"DropdownMenu.Item\"\n\nconst CheckboxItem = React.forwardRef<\n React.ElementRef<typeof Primitives.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof Primitives.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <Primitives.CheckboxItem\n ref={ref}\n className={clx(\n \"focus:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled relative flex cursor-pointer select-none items-center rounded-md py-2 pl-10 pr-3 text-sm outline-none transition-colors data-[disabled]:pointer-events-none\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-3 flex h-5 w-5 items-center justify-center\">\n <Primitives.ItemIndicator>\n <CheckMini />\n </Primitives.ItemIndicator>\n </span>\n {children}\n </Primitives.CheckboxItem>\n))\nCheckboxItem.displayName = \"DropdownMenu.CheckboxItem\"\n\nconst RadioItem = React.forwardRef<\n React.ElementRef<typeof Primitives.RadioItem>,\n React.ComponentPropsWithoutRef<typeof Primitives.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <Primitives.RadioItem\n ref={ref}\n className={clx(\n \"focus:bg-ui-bg-base-pressed hover:bg-ui-base-hover bg-ui-bg-base txt-compact-small relative flex cursor-pointer select-none items-center rounded-md py-2 pl-10 pr-3 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[state=checked]:font-medium data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-3 flex h-5 w-5 items-center justify-center\">\n <Primitives.ItemIndicator>\n <EllipseMiniSolid className=\"text-ui-fg-base\" />\n </Primitives.ItemIndicator>\n </span>\n {children}\n </Primitives.RadioItem>\n))\nRadioItem.displayName = \"DropdownMenu.RadioItem\"\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof Primitives.Label>,\n React.ComponentPropsWithoutRef<typeof Primitives.Label>\n>(({ className, ...props }, ref) => (\n <Primitives.Label\n ref={ref}\n className={clx(\n \"text-ui-fg-subtle txt-compact-xsmall-plus px-2 py-1.5\",\n className\n )}\n {...props}\n />\n))\nLabel.displayName = \"DropdownMenu.Label\"\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof Primitives.Separator>,\n React.ComponentPropsWithoutRef<typeof Primitives.Separator>\n>(({ className, ...props }, ref) => (\n <Primitives.Separator\n ref={ref}\n className={clx(\"bg-ui-border-base -mx-1 my-1 h-px\", className)}\n {...props}\n />\n))\nSeparator.displayName = \"DropdownMenu.Separator\"\n\nconst Shortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={clx(\n \"text-ui-fg-subtle txt-compact-small ml-auto tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\nShortcut.displayName = \"DropdownMenu.Shortcut\"\n\nconst Hint = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={clx(\n \"text-ui-fg-subtle txt-compact-small ml-auto tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\nHint.displayName = \"DropdownMenu.Hint\"\n\nconst DropdownMenu = Object.assign(Root, {\n Trigger,\n Group,\n SubMenu,\n SubMenuContent,\n SubMenuTrigger,\n Content,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n Label,\n Separator,\n Shortcut,\n Hint,\n})\n\nexport { DropdownMenu }\n"]}
@@ -2,21 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.iconButtonVariants = exports.IconButton = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const icons_1 = require("@medusajs/icons");
6
+ const react_slot_1 = require("@radix-ui/react-slot");
5
7
  const class_variance_authority_1 = require("class-variance-authority");
6
8
  const React = tslib_1.__importStar(require("react"));
7
9
  const clx_1 = require("../../utils/clx");
8
- const icons_1 = require("@medusajs/icons");
9
- const react_slot_1 = require("@radix-ui/react-slot");
10
- const iconButtonVariants = (0, class_variance_authority_1.cva)((0, clx_1.clx)("transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md border outline-none", "disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:!shadow-none disabled:after:hidden", "after:absolute after:inset-0 after:content-['']"), {
10
+ const iconButtonVariants = (0, class_variance_authority_1.cva)((0, clx_1.clx)("transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none", "disabled:bg-ui-bg-disabled disabled:shadow-buttons-neutral disabled:text-ui-fg-disabled disabled:after:hidden"), {
11
11
  variants: {
12
12
  variant: {
13
- primary: (0, clx_1.clx)("shadow-buttons-neutral text-ui-fg-base border-ui-border-base bg-ui-button-neutral after:button-neutral-gradient", "hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient", "active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient", "focus:shadow-buttons-neutral-focus"),
14
- transparent: (0, clx_1.clx)("text-ui-fg-base border-ui-border-transparent bg-ui-button-transparent", "hover:bg-ui-button-transparent-hover", "active:bg-ui-button-transparent-pressed active:border-ui-border-base", "focus:shadow-borders-focus focus:bg-ui-bg-base focus:border-ui-border-base", "disabled:!border-none disabled:!bg-transparent disabled:!shadow-none"),
13
+ primary: (0, clx_1.clx)("shadow-buttons-neutral text-ui-fg-subtle bg-ui-button-neutral after:button-neutral-gradient", "hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient", "active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient", "focus:shadow-buttons-neutral-focus", "after:absolute after:inset-0 after:content-['']"),
14
+ transparent: (0, clx_1.clx)("text-ui-fg-subtle bg-ui-button-transparent", "hover:bg-ui-button-transparent-hover", "active:bg-ui-button-transparent-pressed", "focus:shadow-buttons-neutral-focus focus:bg-ui-bg-base", "disabled:!bg-transparent disabled:!shadow-none"),
15
15
  },
16
16
  size: {
17
- base: "h-8 w-8 p-[5px]",
18
- large: "h-10 w-10 p-[9px]",
19
- xlarge: "h-12 w-12 p-[13px]",
17
+ base: "h-8 w-8 p-1.5",
18
+ large: "h-10 w-10 p-2.5",
19
+ xlarge: "h-12 w-12 p-3.5",
20
20
  },
21
21
  },
22
22
  defaultVariants: {
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../../../src/components/icon-button/icon-button.tsx"],"names":[],"mappings":";;;;AAAA,uEAA4D;AAC5D,qDAA8B;AAE9B,qCAAiC;AACjC,2CAAyC;AACzC,qDAA2C;AAE3C,MAAM,kBAAkB,GAAG,IAAA,8BAAG,EAC5B,IAAA,SAAG,EACD,qHAAqH,EACrH,oIAAoI,EACpI,iDAAiD,CAClD,EACD;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,IAAA,SAAG,EACV,iHAAiH,EACjH,4EAA4E,EAC5E,kFAAkF,EAClF,oCAAoC,CACrC;YACD,WAAW,EAAE,IAAA,SAAG,EACd,uEAAuE,EACvE,sCAAsC,EACtC,sEAAsE,EACtE,4EAA4E,EAC5E,sEAAsE,CACvE;SACF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,mBAAmB;YAC1B,MAAM,EAAE,oBAAoB;SAC7B;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,MAAM;KACb;CACF,CACF,CAAA;AA+DoB,gDAAkB;AAtDvC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACjC,CACE,EACE,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,MAAM,EACb,OAAO,GAAG,KAAK,EACf,SAAS,EACT,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAI,CAAC,CAAC,CAAC,QAAQ,CAAA;IAE3C;;;;OAIG;IACH,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,SAAS,EAAE;YACb,OAAO,CACL,8BAAM,SAAS,EAAC,qBAAqB;gBACnC,6BACE,SAAS,EAAE,IAAA,SAAG,EACZ,gFAAgF,CACjF;oBAED,oBAAC,eAAO,IAAC,SAAS,EAAC,cAAc,GAAG,CAChC;gBACL,QAAQ,CACJ,CACR,CAAA;SACF;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC,CAAA;IAED,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,KACJ,KAAK,EACT,SAAS,EAAE,IAAA,SAAG,EAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,EAChE,QAAQ,EAAE,QAAQ,IAAI,SAAS,IAE9B,WAAW,EAAE,CACJ,CACb,CAAA;AACH,CAAC,CACF,CAAA;AAGQ,gCAAU;AAFnB,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA","sourcesContent":["import { VariantProps, cva } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\nimport { Spinner } from \"@medusajs/icons\"\nimport { Slot } from \"@radix-ui/react-slot\"\n\nconst iconButtonVariants = cva(\n clx(\n \"transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md border outline-none\",\n \"disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:!shadow-none disabled:after:hidden\",\n \"after:absolute after:inset-0 after:content-['']\"\n ),\n {\n variants: {\n variant: {\n primary: clx(\n \"shadow-buttons-neutral text-ui-fg-base border-ui-border-base bg-ui-button-neutral after:button-neutral-gradient\",\n \"hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient\",\n \"active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient\",\n \"focus:shadow-buttons-neutral-focus\"\n ),\n transparent: clx(\n \"text-ui-fg-base border-ui-border-transparent bg-ui-button-transparent\",\n \"hover:bg-ui-button-transparent-hover\",\n \"active:bg-ui-button-transparent-pressed active:border-ui-border-base\",\n \"focus:shadow-borders-focus focus:bg-ui-bg-base focus:border-ui-border-base\",\n \"disabled:!border-none disabled:!bg-transparent disabled:!shadow-none\"\n ),\n },\n size: {\n base: \"h-8 w-8 p-[5px]\",\n large: \"h-10 w-10 p-[9px]\",\n xlarge: \"h-12 w-12 p-[13px]\",\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"base\",\n },\n }\n)\n\ninterface IconButtonProps\n extends React.ComponentPropsWithoutRef<\"button\">,\n VariantProps<typeof iconButtonVariants> {\n asChild?: boolean\n isLoading?: boolean\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n variant = \"primary\",\n size = \"base\",\n asChild = false,\n className,\n children,\n isLoading = false,\n disabled,\n ...props\n },\n ref\n ) => {\n const Component = asChild ? Slot : \"button\"\n\n /**\n * In the case of a button where asChild is true, and isLoading is true, we ensure that\n * only on element is passed as a child to the Slot component. This is because the Slot\n * component only accepts a single child.\n */\n const renderInner = () => {\n if (isLoading) {\n return (\n <span className=\"pointer-events-none\">\n <div\n className={clx(\n \"bg-ui-bg-disabled absolute inset-0 flex items-center justify-center rounded-md\"\n )}\n >\n <Spinner className=\"animate-spin\" />\n </div>\n {children}\n </span>\n )\n }\n\n return children\n }\n\n return (\n <Component\n ref={ref}\n {...props}\n className={clx(iconButtonVariants({ variant, size }), className)}\n disabled={disabled || isLoading}\n >\n {renderInner()}\n </Component>\n )\n }\n)\nIconButton.displayName = \"IconButton\"\n\nexport { IconButton, iconButtonVariants }\n"]}
1
+ {"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../../../src/components/icon-button/icon-button.tsx"],"names":[],"mappings":";;;;AAAA,2CAAyC;AACzC,qDAA2C;AAC3C,uEAA4D;AAC5D,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,kBAAkB,GAAG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EAAE,IAAA,SAAG,EAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,EAChE,QAAQ,EAAE,QAAQ,IAAI,SAAS,IAE9B,WAAW,EAAE,CACJ,CACb,CAAA;AACH,CAAC,CACF,CAAA;AAGQ,gCAAU;AAFnB,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA","sourcesContent":["import { Spinner } from \"@medusajs/icons\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { VariantProps, cva } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst iconButtonVariants = cva(\n clx(\n \"transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none\",\n \"disabled:bg-ui-bg-disabled disabled:shadow-buttons-neutral disabled:text-ui-fg-disabled disabled:after:hidden\"\n ),\n {\n variants: {\n variant: {\n primary: clx(\n \"shadow-buttons-neutral text-ui-fg-subtle bg-ui-button-neutral after:button-neutral-gradient\",\n \"hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient\",\n \"active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient\",\n \"focus:shadow-buttons-neutral-focus\",\n \"after:absolute after:inset-0 after:content-['']\"\n ),\n transparent: clx(\n \"text-ui-fg-subtle bg-ui-button-transparent\",\n \"hover:bg-ui-button-transparent-hover\",\n \"active:bg-ui-button-transparent-pressed\",\n \"focus:shadow-buttons-neutral-focus focus:bg-ui-bg-base\",\n \"disabled:!bg-transparent disabled:!shadow-none\"\n ),\n },\n size: {\n base: \"h-8 w-8 p-1.5\",\n large: \"h-10 w-10 p-2.5\",\n xlarge: \"h-12 w-12 p-3.5\",\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"base\",\n },\n }\n)\n\ninterface IconButtonProps\n extends React.ComponentPropsWithoutRef<\"button\">,\n VariantProps<typeof iconButtonVariants> {\n asChild?: boolean\n isLoading?: boolean\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n variant = \"primary\",\n size = \"base\",\n asChild = false,\n className,\n children,\n isLoading = false,\n disabled,\n ...props\n },\n ref\n ) => {\n const Component = asChild ? Slot : \"button\"\n\n /**\n * In the case of a button where asChild is true, and isLoading is true, we ensure that\n * only on element is passed as a child to the Slot component. This is because the Slot\n * component only accepts a single child.\n */\n const renderInner = () => {\n if (isLoading) {\n return (\n <span className=\"pointer-events-none\">\n <div\n className={clx(\n \"bg-ui-bg-disabled absolute inset-0 flex items-center justify-center rounded-md\"\n )}\n >\n <Spinner className=\"animate-spin\" />\n </div>\n {children}\n </span>\n )\n }\n\n return children\n }\n\n return (\n <Component\n ref={ref}\n {...props}\n className={clx(iconButtonVariants({ variant, size }), className)}\n disabled={disabled || isLoading}\n >\n {renderInner()}\n </Component>\n )\n }\n)\nIconButton.displayName = \"IconButton\"\n\nexport { IconButton, iconButtonVariants }\n"]}
@@ -7,7 +7,7 @@ const icons_1 = require("@medusajs/icons");
7
7
  const class_variance_authority_1 = require("class-variance-authority");
8
8
  const React = tslib_1.__importStar(require("react"));
9
9
  const clx_1 = require("../../utils/clx");
10
- const inputBaseStyles = (0, clx_1.clx)("caret-ui-fg-base bg-ui-bg-field hover:bg-ui-bg-field-hover border-ui-border-base shadow-buttons-neutral placeholder-ui-fg-muted text-ui-fg-base transition-fg relative w-full appearance-none rounded-md border outline-none", "focus:border-ui-border-interactive focus:shadow-borders-active", "disabled:text-ui-fg-disabled disabled:!bg-ui-bg-disabled disabled:!border-ui-border-base disabled:placeholder-ui-fg-disabled disabled:cursor-not-allowed disabled:!shadow-none", "aria-[invalid=true]:!border-ui-border-error aria-[invalid=true]:focus:!shadow-borders-error invalid:!border-ui-border-error invalid:focus:!shadow-borders-error");
10
+ const inputBaseStyles = (0, clx_1.clx)("caret-ui-fg-base bg-ui-bg-field hover:bg-ui-bg-field-hover shadow-borders-base placeholder-ui-fg-muted text-ui-fg-base transition-fg relative w-full appearance-none rounded-md outline-none", "focus:shadow-borders-interactive-with-active", "disabled:text-ui-fg-disabled disabled:!bg-ui-bg-disabled disabled:placeholder-ui-fg-disabled disabled:cursor-not-allowed", "aria-[invalid=true]:!shadow-borders-error invalid:!shadow-borders-error");
11
11
  exports.inputBaseStyles = inputBaseStyles;
12
12
  const inputVariants = (0, class_variance_authority_1.cva)((0, clx_1.clx)(inputBaseStyles, "[&::--webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden"), {
13
13
  variants: {
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../src/components/input/input.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAAoE;AACpE,uEAA4D;AAC5D,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,eAAe,GAAG,IAAA,SAAG,EACzB,8NAA8N,EAC9N,gEAAgE,EAChE,gLAAgL,EAChL,iKAAiK,CAClK,CAAA;AA0Fe,0CAAe;AAxF/B,MAAM,aAAa,GAAG,IAAA,8BAAG,EACvB,IAAA,SAAG,EACD,eAAe,EACf,0HAA0H,CAC3H,EACD;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,IAAI,EAAE,uCAAuC;YAC7C,KAAK,EAAE,qCAAqC;SAC7C;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;KACb;CACF,CACF,CAAA;AAED,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAI5B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACtD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAEtD,MAAM,UAAU,GAAG,IAAI,KAAK,UAAU,CAAA;IACtC,MAAM,QAAQ,GAAG,IAAI,KAAK,QAAQ,CAAA;IAElC,OAAO,CACL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BAAQ,OAAG,CAC3C,CACL,CACP,CACG,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAGO,sBAAK;AAFd,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA","sourcesContent":["\"use client\"\n\nimport { Eye, EyeSlash, MagnifyingGlassMini } from \"@medusajs/icons\"\nimport { VariantProps, cva } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst inputBaseStyles = clx(\n \"caret-ui-fg-base bg-ui-bg-field hover:bg-ui-bg-field-hover border-ui-border-base shadow-buttons-neutral placeholder-ui-fg-muted text-ui-fg-base transition-fg relative w-full appearance-none rounded-md border outline-none\",\n \"focus:border-ui-border-interactive focus:shadow-borders-active\",\n \"disabled:text-ui-fg-disabled disabled:!bg-ui-bg-disabled disabled:!border-ui-border-base disabled:placeholder-ui-fg-disabled disabled:cursor-not-allowed disabled:!shadow-none\",\n \"aria-[invalid=true]:!border-ui-border-error aria-[invalid=true]:focus:!shadow-borders-error invalid:!border-ui-border-error invalid:focus:!shadow-borders-error\"\n)\n\nconst inputVariants = cva(\n clx(\n inputBaseStyles,\n \"[&::--webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden\"\n ),\n {\n variants: {\n size: {\n base: \"txt-compact-medium h-10 px-3 py-[9px]\",\n small: \"txt-compact-small h-8 px-2 py-[5px]\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n }\n)\n\nconst Input = React.forwardRef<\n HTMLInputElement,\n VariantProps<typeof inputVariants> &\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">\n>(({ className, type, size = \"base\", ...props }, ref) => {\n const [typeState, setTypeState] = React.useState(type)\n\n const isPassword = type === \"password\"\n const isSearch = type === \"search\"\n\n return (\n <div className=\"relative\">\n <input\n ref={ref}\n type={isPassword ? typeState : type}\n className={clx(\n inputVariants({ size: size }),\n {\n \"pr-11\": isPassword && size === \"base\",\n \"pl-11\": isSearch && size === \"base\",\n \"pr-9\": isPassword && size === \"small\",\n \"pl-9\": isSearch && size === \"small\",\n },\n className\n )}\n {...props}\n />\n {isSearch && (\n <div\n className={clx(\n \"text-ui-fg-muted absolute bottom-0 left-0 flex items-center justify-center\",\n {\n \"h-10 w-11\": size === \"base\",\n \"h-8 w-9\": size === \"small\",\n }\n )}\n role=\"img\"\n >\n <MagnifyingGlassMini />\n </div>\n )}\n {isPassword && (\n <div\n className={clx(\n \"absolute bottom-0 right-0 flex w-11 items-center justify-center\",\n {\n \"h-10 w-11\": size === \"base\",\n \"h-8 w-9\": size === \"small\",\n }\n )}\n >\n <button\n className=\"text-ui-fg-muted hover:text-ui-fg-base focus:text-ui-fg-base focus:shadow-borders-interactive-w-focus active:text-ui-fg-base h-fit w-fit rounded-sm outline-none transition-all\"\n type=\"button\"\n onClick={() => {\n setTypeState(typeState === \"password\" ? \"text\" : \"password\")\n }}\n >\n <span className=\"sr-only\">\n {typeState === \"password\" ? \"Show password\" : \"Hide password\"}\n </span>\n {typeState === \"password\" ? <Eye /> : <EyeSlash />}\n </button>\n </div>\n )}\n </div>\n )\n})\nInput.displayName = \"Input\"\n\nexport { Input, inputBaseStyles }\n"]}
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../src/components/input/input.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAAoE;AACpE,uEAA4D;AAC5D,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,eAAe,GAAG,IAAA,SAAG,EACzB,8LAA8L,EAC9L,8CAA8C,EAC9C,0HAA0H,EAC1H,0EAA0E,CAC3E,CAAA;AA0Fe,0CAAe;AAxF/B,MAAM,aAAa,GAAG,IAAA,8BAAG,EACvB,IAAA,SAAG,EACD,eAAe,EACf,0HAA0H,CAC3H,EACD;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,IAAI,EAAE,uCAAuC;YAC7C,KAAK,EAAE,qCAAqC;SAC7C;KACF;IACD,eAAe,EAA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B,CACF;YAED,gCACE,SAAS,EAAC,iLAAiL,EAC3L,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE;oBACZ,YAAY,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;gBAC9D,CAAC;gBAED,8BAAM,SAAS,EAAC,SAAS,IACtB,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CACxD;gBACN,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,oBAAC,WAAG,OAAG,CAAC,CAAC,CAAC,oBAAC,gBAAQ,OAAG,CAC3C,CACL,CACP,CACG,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAGO,sBAAK;AAFd,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA","sourcesContent":["\"use client\"\n\nimport { Eye, EyeSlash, MagnifyingGlassMini } from \"@medusajs/icons\"\nimport { VariantProps, cva } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst inputBaseStyles = clx(\n \"caret-ui-fg-base bg-ui-bg-field hover:bg-ui-bg-field-hover shadow-borders-base placeholder-ui-fg-muted text-ui-fg-base transition-fg relative w-full appearance-none rounded-md outline-none\",\n \"focus:shadow-borders-interactive-with-active\",\n \"disabled:text-ui-fg-disabled disabled:!bg-ui-bg-disabled disabled:placeholder-ui-fg-disabled disabled:cursor-not-allowed\",\n \"aria-[invalid=true]:!shadow-borders-error invalid:!shadow-borders-error\"\n)\n\nconst inputVariants = cva(\n clx(\n inputBaseStyles,\n \"[&::--webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden\"\n ),\n {\n variants: {\n size: {\n base: \"txt-compact-medium h-10 px-3 py-[9px]\",\n small: \"txt-compact-small h-8 px-2 py-[5px]\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n }\n)\n\nconst Input = React.forwardRef<\n HTMLInputElement,\n VariantProps<typeof inputVariants> &\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">\n>(({ className, type, size = \"base\", ...props }, ref) => {\n const [typeState, setTypeState] = React.useState(type)\n\n const isPassword = type === \"password\"\n const isSearch = type === \"search\"\n\n return (\n <div className=\"relative\">\n <input\n ref={ref}\n type={isPassword ? typeState : type}\n className={clx(\n inputVariants({ size: size }),\n {\n \"pr-11\": isPassword && size === \"base\",\n \"pl-11\": isSearch && size === \"base\",\n \"pr-9\": isPassword && size === \"small\",\n \"pl-9\": isSearch && size === \"small\",\n },\n className\n )}\n {...props}\n />\n {isSearch && (\n <div\n className={clx(\n \"text-ui-fg-muted absolute bottom-0 left-0 flex items-center justify-center\",\n {\n \"h-10 w-11\": size === \"base\",\n \"h-8 w-9\": size === \"small\",\n }\n )}\n role=\"img\"\n >\n <MagnifyingGlassMini />\n </div>\n )}\n {isPassword && (\n <div\n className={clx(\n \"absolute bottom-0 right-0 flex w-11 items-center justify-center\",\n {\n \"h-10 w-11\": size === \"base\",\n \"h-8 w-9\": size === \"small\",\n }\n )}\n >\n <button\n className=\"text-ui-fg-muted hover:text-ui-fg-base focus:text-ui-fg-base focus:shadow-borders-interactive-w-focus active:text-ui-fg-base h-fit w-fit rounded-sm outline-none transition-all\"\n type=\"button\"\n onClick={() => {\n setTypeState(typeState === \"password\" ? \"text\" : \"password\")\n }}\n >\n <span className=\"sr-only\">\n {typeState === \"password\" ? \"Show password\" : \"Hide password\"}\n </span>\n {typeState === \"password\" ? <Eye /> : <EyeSlash />}\n </button>\n </div>\n )}\n </div>\n )\n})\nInput.displayName = \"Input\"\n\nexport { Input, inputBaseStyles }\n"]}
@@ -0,0 +1 @@
1
+ export * from "./popover";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./popover"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/popover/index.ts"],"names":[],"mappings":";;;AAAA,oDAAyB","sourcesContent":["export * from \"./popover\"\n"]}
@@ -0,0 +1,17 @@
1
+ import * as Primitives from "@radix-ui/react-popover";
2
+ import * as React from "react";
3
+ declare const Root: {
4
+ (props: React.ComponentPropsWithoutRef<typeof Primitives.Root>): React.JSX.Element;
5
+ displayName: string;
6
+ };
7
+ declare const Popover: {
8
+ (props: React.ComponentPropsWithoutRef<typeof Primitives.Root>): React.JSX.Element;
9
+ displayName: string;
10
+ } & {
11
+ Trigger: React.ForwardRefExoticComponent<Omit<Primitives.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
12
+ Anchor: React.ForwardRefExoticComponent<Omit<Primitives.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ Close: React.ForwardRefExoticComponent<Omit<Primitives.PopoverCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
14
+ Content: React.ForwardRefExoticComponent<Omit<Primitives.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
+ Seperator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
+ };
17
+ export { Popover };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Popover = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Primitives = tslib_1.__importStar(require("@radix-ui/react-popover"));
6
+ const React = tslib_1.__importStar(require("react"));
7
+ const clx_1 = require("../../utils/clx");
8
+ const Root = (props) => {
9
+ return React.createElement(Primitives.Root, { ...props });
10
+ };
11
+ Root.displayName = "Popover";
12
+ const Trigger = React.forwardRef((props, ref) => {
13
+ return React.createElement(Primitives.Trigger, { ref: ref, ...props });
14
+ });
15
+ Trigger.displayName = "Popover.Trigger";
16
+ const Anchor = React.forwardRef((props, ref) => {
17
+ return React.createElement(Primitives.Anchor, { ref: ref, ...props });
18
+ });
19
+ Anchor.displayName = "Popover.Anchor";
20
+ const Close = React.forwardRef((props, ref) => {
21
+ return React.createElement(Primitives.Close, { ref: ref, ...props });
22
+ });
23
+ Close.displayName = "Popover.Close";
24
+ const Content = React.forwardRef(({ className, sideOffset = 8, side = "bottom", align = "start", collisionPadding, ...props }, ref) => {
25
+ return (React.createElement(Primitives.Portal, null,
26
+ React.createElement(Primitives.Content, { ref: ref, sideOffset: sideOffset, side: side, align: align, collisionPadding: collisionPadding, className: (0, clx_1.clx)("bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout max-h-[var(--radix-popper-available-height)] min-w-[220px] overflow-hidden rounded-lg p-1", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props })));
27
+ });
28
+ Content.displayName = "Popover.Content";
29
+ const Seperator = React.forwardRef(({ className, ...props }, ref) => {
30
+ return (React.createElement("div", { ref: ref, className: (0, clx_1.clx)("bg-ui-border-base -mx-1 my-1 h-px", className), ...props }));
31
+ });
32
+ Seperator.displayName = "Popover.Seperator";
33
+ const Popover = Object.assign(Root, {
34
+ Trigger,
35
+ Anchor,
36
+ Close,
37
+ Content,
38
+ Seperator,
39
+ });
40
+ exports.Popover = Popover;
41
+ //# sourceMappingURL=popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.js","sourceRoot":"","sources":["../../../../src/components/popover/popover.tsx"],"names":[],"mappings":";;;;AAAA,4EAAqD;AACrD,qD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,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,IAAA,SAAG,EACZ,iJAAiJ,EACjJ,kVAAkV,EAClV,SAAS,CACV,KACG,KAAK,GACT,CACgB,CACrB,CAAA;AACH,CAAC,CACF,CAAA;AACD,OAAO,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAEvC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAGhC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjC,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,mCAAmC,EAAE,SAAS,CAAC,KAC1D,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAE3C,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IAClC,OAAO;IACP,MAAM;IACN,KAAK;IACL,OAAO;IACP,SAAS;CACV,CAAC,CAAA;AAEO,0BAAO","sourcesContent":["import * as Primitives from \"@radix-ui/react-popover\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst Root = (\n props: React.ComponentPropsWithoutRef<typeof Primitives.Root>\n) => {\n return <Primitives.Root {...props} />\n}\nRoot.displayName = \"Popover\"\n\nconst Trigger = React.forwardRef<\n React.ElementRef<typeof Primitives.Trigger>,\n React.ComponentPropsWithoutRef<typeof Primitives.Trigger>\n>((props, ref) => {\n return <Primitives.Trigger ref={ref} {...props} />\n})\nTrigger.displayName = \"Popover.Trigger\"\n\nconst Anchor = React.forwardRef<\n React.ElementRef<typeof Primitives.Anchor>,\n React.ComponentPropsWithoutRef<typeof Primitives.Anchor>\n>((props, ref) => {\n return <Primitives.Anchor ref={ref} {...props} />\n})\nAnchor.displayName = \"Popover.Anchor\"\n\nconst Close = React.forwardRef<\n React.ElementRef<typeof Primitives.Close>,\n React.ComponentPropsWithoutRef<typeof Primitives.Close>\n>((props, ref) => {\n return <Primitives.Close ref={ref} {...props} />\n})\nClose.displayName = \"Popover.Close\"\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof Primitives.Content>,\n React.ComponentPropsWithoutRef<typeof Primitives.Content>\n>(\n (\n {\n className,\n sideOffset = 8,\n side = \"bottom\",\n align = \"start\",\n collisionPadding,\n ...props\n },\n ref\n ) => {\n return (\n <Primitives.Portal>\n <Primitives.Content\n ref={ref}\n sideOffset={sideOffset}\n side={side}\n align={align}\n collisionPadding={collisionPadding}\n className={clx(\n \"bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout max-h-[var(--radix-popper-available-height)] min-w-[220px] overflow-hidden rounded-lg p-1\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </Primitives.Portal>\n )\n }\n)\nContent.displayName = \"Popover.Content\"\n\nconst Seperator = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clx(\"bg-ui-border-base -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n})\nSeperator.displayName = \"Popover.Seperator\"\n\nconst Popover = Object.assign(Root, {\n Trigger,\n Anchor,\n Close,\n Content,\n Seperator,\n})\n\nexport { Popover }\n"]}
@@ -1,6 +1,11 @@
1
1
  import * as Primitives from "@radix-ui/react-radio-group";
2
2
  import * as React from "react";
3
+ interface ChoiceBoxProps extends React.ComponentPropsWithoutRef<typeof Primitives.Item> {
4
+ label: string;
5
+ description: string;
6
+ }
3
7
  declare const RadioGroup: React.ForwardRefExoticComponent<Omit<Primitives.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>> & {
4
8
  Item: React.ForwardRefExoticComponent<Omit<Primitives.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
9
+ ChoiceBox: React.ForwardRefExoticComponent<ChoiceBoxProps & React.RefAttributes<HTMLButtonElement>>;
5
10
  };
6
11
  export { RadioGroup };
@@ -6,17 +6,38 @@ const tslib_1 = require("tslib");
6
6
  const Primitives = tslib_1.__importStar(require("@radix-ui/react-radio-group"));
7
7
  const React = tslib_1.__importStar(require("react"));
8
8
  const clx_1 = require("../../utils/clx");
9
+ const hint_1 = require("../hint");
10
+ const label_1 = require("../label");
9
11
  const Root = React.forwardRef(({ className, ...props }, ref) => {
10
12
  return (React.createElement(Primitives.Root, { className: (0, clx_1.clx)("grid gap-2", className), ...props, ref: ref }));
11
13
  });
12
14
  Root.displayName = "RadioGroup.Root";
15
+ const Indicator = React.forwardRef(({ className, ...props }, ref) => {
16
+ return (React.createElement(Primitives.Indicator, { ref: ref, className: (0, clx_1.clx)("flex items-center justify-center", className), ...props },
17
+ React.createElement("div", { className: (0, clx_1.clx)("bg-ui-bg-base shadow-details-contrast-on-bg-interactive group-disabled:bg-ui-fg-disabled h-1.5 w-1.5 rounded-full group-disabled:shadow-none") })));
18
+ });
19
+ Indicator.displayName = "RadioGroup.Indicator";
13
20
  const Item = React.forwardRef(({ className, ...props }, ref) => {
14
21
  return (React.createElement(Primitives.Item, { ref: ref, className: (0, clx_1.clx)("group relative flex h-5 w-5 items-center justify-center outline-none", className), ...props },
15
- React.createElement("div", { className: "shadow-borders-base-with-shadow group-hover:shadow-borders-strong-with-shadow bg-ui-bg-base group-data-[state=checked]:bg-ui-bg-interactive group-data-[state=checked]:shadow-borders-interactive group-focus:!shadow-borders-interactive-with-focus group-disabled:!bg-ui-bg-disabled group-disabled:!shadow-borders-base flex h-[14px] w-[14px] items-center justify-center rounded-full transition-all" },
16
- React.createElement(Primitives.Indicator, { className: "flex items-center justify-center" },
17
- React.createElement("div", { className: (0, clx_1.clx)("bg-ui-bg-base shadow-details-contrast-on-bg-interactive group-disabled:bg-ui-fg-disabled h-1.5 w-1.5 rounded-full group-disabled:shadow-none") })))));
22
+ React.createElement("div", { className: (0, clx_1.clx)("shadow-borders-base bg-ui-bg-base transition-fg flex h-[14px] w-[14px] items-center justify-center rounded-full", "group-hover:bg-ui-bg-base-hover", "group-data-[state=checked]:bg-ui-bg-interactive group-data-[state=checked]:shadow-borders-interactive-with-shadow", "group-focus:!shadow-borders-interactive-with-focus", "group-disabled:!bg-ui-bg-disabled group-disabled:!shadow-borders-base") },
23
+ React.createElement(Indicator, null))));
18
24
  });
19
25
  Item.displayName = "RadioGroup.Item";
20
- const RadioGroup = Object.assign(Root, { Item });
26
+ const ChoiceBox = React.forwardRef(({ className, id, label, description, ...props }, ref) => {
27
+ const generatedId = React.useId();
28
+ if (!id) {
29
+ id = generatedId;
30
+ }
31
+ const descriptionId = `${id}-description`;
32
+ return (React.createElement(Primitives.Item, { ref: ref, className: (0, clx_1.clx)("shadow-borders-base bg-ui-bg-base focus:shadow-borders-interactive-with-focus transition-fg disabled:bg-ui-bg-disabled group flex items-start gap-x-2 rounded-lg p-3 disabled:cursor-not-allowed", className), ...props, id: id, "aria-describedby": descriptionId },
33
+ React.createElement("div", { className: "flex h-5 w-5 items-center justify-center" },
34
+ React.createElement("div", { className: "shadow-borders-base bg-ui-bg-base group-data-[state=checked]:bg-ui-bg-interactive group-data-[state=checked]:shadow-borders-interactive-with-shadow transition-fg group-disabled:!bg-ui-bg-disabled group-hover:bg-ui-bg-base-hover group-disabled:!shadow-borders-base flex h-3.5 w-3.5 items-center justify-center rounded-full" },
35
+ React.createElement(Indicator, null))),
36
+ React.createElement("div", { className: "flex flex-col items-start" },
37
+ React.createElement(label_1.Label, { htmlFor: id, size: "base", weight: "plus", className: "group-disabled:text-ui-fg-disabled cursor-pointer group-disabled:cursor-not-allowed" }, label),
38
+ React.createElement(hint_1.Hint, { className: "txt-compact-medium text-ui-fg-subtle group-disabled:text-ui-fg-disabled", id: descriptionId }, description))));
39
+ });
40
+ ChoiceBox.displayName = "RadioGroup.ChoiceBox";
41
+ const RadioGroup = Object.assign(Root, { Item, ChoiceBox });
21
42
  exports.RadioGroup = RadioGroup;
22
43
  //# sourceMappingURL=radio-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/components/radio-group/radio-group.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,gFAAyD;AACzD,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAG3B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjC,OAAO,CACL,oBAAC,UAAU,CAAC,IAAI,IACd,SAAS,EAAE,IAAA,SAAG,EAAC,YAAY,EAAE,SAAS,CAAC,KACnC,KAAK,EACT,GAAG,EAAE,GAAG,GACR,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AACF,IAAI,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAEpC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAG3B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjC,OAAO,CACL,oBAAC,UAAU,CAAC,IAAI,IACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,sEAAsE,EACtE,SAAS,CACV,KACG,KAAK;QAET,6BAAK,SAAS,EAAC,2YAA2Y;YACxZ,oBAAC,UAAU,CAAC,SAAS,IAAC,SAAS,EAAC,kCAAkC;gBAChE,6BACE,SAAS,EAAE,IAAA,SAAG,EACZ,8IAA8I,CAC/I,GACD,CACmB,CACnB,CACU,CACnB,CAAA;AACH,CAAC,CAAC,CAAA;AACF,IAAI,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAEpC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;AAEvC,gCAAU","sourcesContent":["\"use client\"\n\nimport * as Primitives from \"@radix-ui/react-radio-group\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst Root = React.forwardRef<\n React.ElementRef<typeof Primitives.Root>,\n React.ComponentPropsWithoutRef<typeof Primitives.Root>\n>(({ className, ...props }, ref) => {\n return (\n <Primitives.Root\n className={clx(\"grid gap-2\", className)}\n {...props}\n ref={ref}\n />\n )\n})\nRoot.displayName = \"RadioGroup.Root\"\n\nconst Item = React.forwardRef<\n React.ElementRef<typeof Primitives.Item>,\n React.ComponentPropsWithoutRef<typeof Primitives.Item>\n>(({ className, ...props }, ref) => {\n return (\n <Primitives.Item\n ref={ref}\n className={clx(\n \"group relative flex h-5 w-5 items-center justify-center outline-none\",\n className\n )}\n {...props}\n >\n <div className=\"shadow-borders-base-with-shadow group-hover:shadow-borders-strong-with-shadow bg-ui-bg-base group-data-[state=checked]:bg-ui-bg-interactive group-data-[state=checked]:shadow-borders-interactive group-focus:!shadow-borders-interactive-with-focus group-disabled:!bg-ui-bg-disabled group-disabled:!shadow-borders-base flex h-[14px] w-[14px] items-center justify-center rounded-full transition-all\">\n <Primitives.Indicator className=\"flex items-center justify-center\">\n <div\n className={clx(\n \"bg-ui-bg-base shadow-details-contrast-on-bg-interactive group-disabled:bg-ui-fg-disabled h-1.5 w-1.5 rounded-full group-disabled:shadow-none\"\n )}\n />\n </Primitives.Indicator>\n </div>\n </Primitives.Item>\n )\n})\nItem.displayName = \"RadioGroup.Item\"\n\nconst RadioGroup = Object.assign(Root, { Item })\n\nexport { RadioGroup }\n"]}
1
+ {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/components/radio-group/radio-group.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,gFAAyD;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ACF,IAAI,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAQpC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAGhC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACzD,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA;IAEjC,IAAI,CAAC,EAAE,EAAE;QACP,EAAE,GAAG,WAAW,CAAA;KACjB;IAED,MAAM,aAAa,GAAG,GAAG,EAAE,cAAc,CAAA;IAEzC,OAAO,CACL,oBAAC,UAAU,CAAC,IAAI,IACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,kMAAkM,EAClM,SAAS,CACV,KACG,KAAK,EACT,EAAE,EAAE,EAAE,sBACY,aAAa;QAE/B,6BAAK,SAAS,EAAC,0CAA0C;YACvD,6BAAK,SAAS,EAAC,mUAAmU;gBAChV,oBAAC,SAAS,OAAG,CACT,CACF;QACN,6BAAK,SAAS,EAAC,2BAA2B;YACxC,oBAAC,aAAK,IACJ,OAAO,EAAE,EAAE,EACX,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,MAAM,EACb,SAAS,EAAC,qFAAqF,IAE9F,KAAK,CACA;YACR,oBAAC,WAAI,IACH,SAAS,EAAC,yEAAyE,EACnF,EAAE,EAAE,aAAa,IAEhB,WAAW,CACP,CACH,CACU,CACnB,CAAA;AACH,CAAC,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAE9C,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAElD,gCAAU","sourcesContent":["\"use client\"\n\nimport * as Primitives from \"@radix-ui/react-radio-group\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\nimport { Hint } from \"../hint\"\nimport { Label } from \"../label\"\n\nconst Root = React.forwardRef<\n React.ElementRef<typeof Primitives.Root>,\n React.ComponentPropsWithoutRef<typeof Primitives.Root>\n>(({ className, ...props }, ref) => {\n return (\n <Primitives.Root\n className={clx(\"grid gap-2\", className)}\n {...props}\n ref={ref}\n />\n )\n})\nRoot.displayName = \"RadioGroup.Root\"\n\nconst Indicator = React.forwardRef<\n React.ElementRef<typeof Primitives.Indicator>,\n React.ComponentPropsWithoutRef<typeof Primitives.Indicator>\n>(({ className, ...props }, ref) => {\n return (\n <Primitives.Indicator\n ref={ref}\n className={clx(\"flex items-center justify-center\", className)}\n {...props}\n >\n <div\n className={clx(\n \"bg-ui-bg-base shadow-details-contrast-on-bg-interactive group-disabled:bg-ui-fg-disabled h-1.5 w-1.5 rounded-full group-disabled:shadow-none\"\n )}\n />\n </Primitives.Indicator>\n )\n})\nIndicator.displayName = \"RadioGroup.Indicator\"\n\nconst Item = React.forwardRef<\n React.ElementRef<typeof Primitives.Item>,\n React.ComponentPropsWithoutRef<typeof Primitives.Item>\n>(({ className, ...props }, ref) => {\n return (\n <Primitives.Item\n ref={ref}\n className={clx(\n \"group relative flex h-5 w-5 items-center justify-center outline-none\",\n className\n )}\n {...props}\n >\n <div\n className={clx(\n \"shadow-borders-base bg-ui-bg-base transition-fg flex h-[14px] w-[14px] items-center justify-center rounded-full\",\n \"group-hover:bg-ui-bg-base-hover\",\n \"group-data-[state=checked]:bg-ui-bg-interactive group-data-[state=checked]:shadow-borders-interactive-with-shadow\",\n \"group-focus:!shadow-borders-interactive-with-focus\",\n \"group-disabled:!bg-ui-bg-disabled group-disabled:!shadow-borders-base\"\n )}\n >\n <Indicator />\n </div>\n </Primitives.Item>\n )\n})\nItem.displayName = \"RadioGroup.Item\"\n\ninterface ChoiceBoxProps\n extends React.ComponentPropsWithoutRef<typeof Primitives.Item> {\n label: string\n description: string\n}\n\nconst ChoiceBox = React.forwardRef<\n React.ElementRef<typeof Primitives.Item>,\n ChoiceBoxProps\n>(({ className, id, label, description, ...props }, ref) => {\n const generatedId = React.useId()\n\n if (!id) {\n id = generatedId\n }\n\n const descriptionId = `${id}-description`\n\n return (\n <Primitives.Item\n ref={ref}\n className={clx(\n \"shadow-borders-base bg-ui-bg-base focus:shadow-borders-interactive-with-focus transition-fg disabled:bg-ui-bg-disabled group flex items-start gap-x-2 rounded-lg p-3 disabled:cursor-not-allowed\",\n className\n )}\n {...props}\n id={id}\n aria-describedby={descriptionId}\n >\n <div className=\"flex h-5 w-5 items-center justify-center\">\n <div className=\"shadow-borders-base bg-ui-bg-base group-data-[state=checked]:bg-ui-bg-interactive group-data-[state=checked]:shadow-borders-interactive-with-shadow transition-fg group-disabled:!bg-ui-bg-disabled group-hover:bg-ui-bg-base-hover group-disabled:!shadow-borders-base flex h-3.5 w-3.5 items-center justify-center rounded-full\">\n <Indicator />\n </div>\n </div>\n <div className=\"flex flex-col items-start\">\n <Label\n htmlFor={id}\n size=\"base\"\n weight=\"plus\"\n className=\"group-disabled:text-ui-fg-disabled cursor-pointer group-disabled:cursor-not-allowed\"\n >\n {label}\n </Label>\n <Hint\n className=\"txt-compact-medium text-ui-fg-subtle group-disabled:text-ui-fg-disabled\"\n id={descriptionId}\n >\n {description}\n </Hint>\n </div>\n </Primitives.Item>\n )\n})\nChoiceBox.displayName = \"RadioGroup.ChoiceBox\"\n\nconst RadioGroup = Object.assign(Root, { Item, ChoiceBox })\n\nexport { RadioGroup }\n"]}
@@ -5,9 +5,9 @@ exports.Select = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const icons_1 = require("@medusajs/icons");
7
7
  const SelectPrimitive = tslib_1.__importStar(require("@radix-ui/react-select"));
8
+ const class_variance_authority_1 = require("class-variance-authority");
8
9
  const React = tslib_1.__importStar(require("react"));
9
10
  const clx_1 = require("../../utils/clx");
10
- const class_variance_authority_1 = require("class-variance-authority");
11
11
  const SelectContext = React.createContext(null);
12
12
  const useSelectContext = () => {
13
13
  const context = React.useContext(SelectContext);
@@ -22,7 +22,7 @@ const Root = ({ children, size = "base", ...props }) => {
22
22
  };
23
23
  const Group = SelectPrimitive.Group;
24
24
  const Value = SelectPrimitive.Value;
25
- const triggerVariants = (0, class_variance_authority_1.cva)((0, clx_1.clx)("bg-ui-bg-field txt-compact-medium border-ui-border-base shadow-buttons-neutral transition-fg flex w-full select-none items-center justify-between rounded-md border outline-none", "data-[placeholder]:text-ui-fg-muted text-ui-fg-base", "hover:bg-ui-bg-field-hover", "focus:shadow-borders-active focus:border-ui-border-interactive data-[state=open]:!shadow-borders-active data-[state=open]:!border-ui-border-interactive", "aria-[invalid=true]:border-ui-border-error aria-[invalid=true]:shadow-borders-error", "invalid::border-ui-border-error invalid:shadow-borders-error", "disabled:!bg-ui-bg-disabled disabled:!text-ui-fg-disabled", "group/trigger"), {
25
+ const triggerVariants = (0, class_variance_authority_1.cva)((0, clx_1.clx)("bg-ui-bg-field txt-compact-medium shadow-buttons-neutral transition-fg flex w-full select-none items-center justify-between rounded-md outline-none", "data-[placeholder]:text-ui-fg-muted text-ui-fg-base", "hover:bg-ui-bg-field-hover", "focus:shadow-borders-interactive-with-active data-[state=open]:!shadow-borders-interactive-with-active", "aria-[invalid=true]:border-ui-border-error aria-[invalid=true]:shadow-borders-error", "invalid::border-ui-border-error invalid:shadow-borders-error", "disabled:!bg-ui-bg-disabled disabled:!text-ui-fg-disabled", "group/trigger"), {
26
26
  variants: {
27
27
  size: {
28
28
  base: "h-10 px-3 py-[9px]",
@@ -42,12 +42,8 @@ const Content = React.forwardRef(({ className, children, position = "popper", si
42
42
  React.createElement(SelectPrimitive.Content, { ref: ref, className: (0, clx_1.clx)("bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout relative max-h-[200px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-lg", "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", {
43
43
  "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1": position === "popper",
44
44
  }, className), position: position, sideOffset: sideOffset, collisionPadding: collisionPadding, ...props },
45
- React.createElement(SelectPrimitive.ScrollUpButton, { className: "text-ui-fg-muted bg-ui-bg-base flex h-[25px] cursor-default items-center justify-center" },
46
- React.createElement(icons_1.ChevronUpMini, null)),
47
45
  React.createElement(SelectPrimitive.Viewport, { className: (0, clx_1.clx)("p-1", position === "popper" &&
48
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]") }, children),
49
- React.createElement(SelectPrimitive.ScrollDownButton, { className: "text-ui-fg-muted bg-ui-bg-base flex h-[25px] cursor-default items-center justify-center" },
50
- React.createElement(icons_1.ChevronDownMini, null))))));
46
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]") }, children)))));
51
47
  Content.displayName = SelectPrimitive.Content.displayName;
52
48
  const Label = React.forwardRef(({ className, ...props }, ref) => (React.createElement(SelectPrimitive.Label, { ref: ref, className: (0, clx_1.clx)("txt-compact-xsmall-plus text-ui-fg-subtle px-3 py-2", className), ...props })));
53
49
  Label.displayName = SelectPrimitive.Label.displayName;
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAKwB;AACxB,gFAAyD;AACzD,qDAA8B;AAE9B,qCAAiC;AACjC,uEAA8C;AAW9C,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAA4B,IAAI,CAAC,CAAA;AAE1E,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;IAE/C,IAAI,OAAO,KAAK,IAAI,EAAE;QACp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CACH,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,eAAe,CAAC,SAAS,CAAC,WAAW,CAAA;AAE7D,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACjC,KAAK;IACL,KAAK;IACL,OAAO;IACP,OAAO;IACP,KAAK;IACL,IAAI;IACJ,SAAS;CACV,CAAC,CAAA;AAEO,wBAAM","sourcesContent":["\"use client\"\n\nimport {\n ChevronDownMini,\n ChevronUpDown,\n ChevronUpMini,\n EllipseMiniSolid,\n} from \"@medusajs/icons\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\nimport { cva } from \"class-variance-authority\"\n\ninterface SelectProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root> {\n size?: \"base\" | \"small\"\n}\n\ntype SelectContextValue = {\n size: \"base\" | \"small\"\n}\n\nconst SelectContext = React.createContext<SelectContextValue | null>(null)\n\nconst useSelectContext = () => {\n const context = React.useContext(SelectContext)\n\n if (context === null) {\n throw new Error(\"useSelectContext must be used within a SelectProvider\")\n }\n\n return context\n}\n\nconst Root = ({ children, size = \"base\", ...props }: SelectProps) => {\n return (\n <SelectContext.Provider value={React.useMemo(() => ({ size }), [size])}>\n <SelectPrimitive.Root {...props}>{children}</SelectPrimitive.Root>\n </SelectContext.Provider>\n )\n}\n\nconst Group = SelectPrimitive.Group\n\nconst Value = SelectPrimitive.Value\n\nconst triggerVariants = cva(\n clx(\n \"bg-ui-bg-field txt-compact-medium border-ui-border-base shadow-buttons-neutral transition-fg flex w-full select-none items-center justify-between rounded-md border outline-none\",\n \"data-[placeholder]:text-ui-fg-muted text-ui-fg-base\",\n \"hover:bg-ui-bg-field-hover\",\n \"focus:shadow-borders-active focus:border-ui-border-interactive data-[state=open]:!shadow-borders-active data-[state=open]:!border-ui-border-interactive\",\n \"aria-[invalid=true]:border-ui-border-error aria-[invalid=true]:shadow-borders-error\",\n \"invalid::border-ui-border-error invalid:shadow-borders-error\",\n \"disabled:!bg-ui-bg-disabled disabled:!text-ui-fg-disabled\",\n \"group/trigger\"\n ),\n {\n variants: {\n size: {\n base: \"h-10 px-3 py-[9px]\",\n small: \"h-8 px-2 py-[5px]\",\n },\n },\n }\n)\n\nconst Trigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => {\n const { size } = useSelectContext()\n\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={clx(triggerVariants({ size }), className)}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronUpDown className=\"text-ui-fg-muted group-disabled/trigger:text-ui-fg-disabled\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n})\nTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(\n (\n {\n className,\n children,\n position = \"popper\",\n sideOffset = 8,\n collisionPadding = 24,\n ...props\n },\n ref\n ) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout relative max-h-[200px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-lg\",\n \"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n {\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\":\n position === \"popper\",\n },\n className\n )}\n position={position}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n {...props}\n >\n <SelectPrimitive.ScrollUpButton className=\"text-ui-fg-muted bg-ui-bg-base flex h-[25px] cursor-default items-center justify-center\">\n <ChevronUpMini />\n </SelectPrimitive.ScrollUpButton>\n <SelectPrimitive.Viewport\n className={clx(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectPrimitive.ScrollDownButton className=\"text-ui-fg-muted bg-ui-bg-base flex h-[25px] cursor-default items-center justify-center\">\n <ChevronDownMini />\n </SelectPrimitive.ScrollDownButton>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n)\nContent.displayName = SelectPrimitive.Content.displayName\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={clx(\n \"txt-compact-xsmall-plus text-ui-fg-subtle px-3 py-2\",\n className\n )}\n {...props}\n />\n))\nLabel.displayName = SelectPrimitive.Label.displayName\n\nconst Item = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => {\n const { size } = useSelectContext()\n\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={clx(\n \"txt-compact-medium bg-ui-bg-base grid cursor-pointer grid-cols-[20px_1fr] gap-x-2 rounded-md px-3 py-2 outline-none transition-colors\",\n \"hover:bg-ui-bg-base-hover focus:bg-ui-bg-base-hover\",\n {\n \"txt-compact-medium data-[state=checked]:txt-compact-medium-plus\":\n size === \"base\",\n \"txt-compact-small data-[state=checked]:txt-compact-medium-plus\":\n size === \"small\",\n },\n className\n )}\n {...props}\n >\n <span className=\"flex h-5 w-5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <EllipseMiniSolid />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText className=\"flex-1 truncate\">\n {children}\n </SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n})\nItem.displayName = SelectPrimitive.Item.displayName\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={clx(\"bg-ui-border-base -mx-1 my-1 h-px\", className)}\n {...props}\n />\n))\nSeparator.displayName = SelectPrimitive.Separator.displayName\n\nconst Select = Object.assign(Root, {\n Group,\n Value,\n Trigger,\n Content,\n Label,\n Item,\n Separator,\n})\n\nexport { Select }\n"]}
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAAiE;AACjE,gFAAyD;AACzD,uEAA8C;AAC9C,qDAA8B;AAE9B,qCAAiC;AAWjC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAA4B,IAAI,CAAC,CAAA;AAE1E,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;IAE/C,IAAI,OAAO,KAAK,IAAI,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;KACzE;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,IAAI,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,KAAK,EAAe,EAAE,EAAE;IAClE,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,C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AAG,EACZ,uIAAuI,EACvI,qDAAqD,EACrD;YACE,iEAAiE,EAC/D,IAAI,KAAK,MAAM;YACjB,gEAAgE,EAC9D,IAAI,KAAK,OAAO;SACnB,EACD,SAAS,CACV,KACG,KAAK;QAET,8BAAM,SAAS,EAAC,0CAA0C;YACxD,oBAAC,eAAe,CAAC,aAAa;gBAC5B,oBAAC,wBAAgB,OAAG,CACU,CAC3B;QACP,oBAAC,eAAe,CAAC,QAAQ,IAAC,SAAS,EAAC,iBAAiB,IAClD,QAAQ,CACgB,CACN,CACxB,CAAA;AACH,CAAC,CAAC,CAAA;AACF,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,WAAW,CAAA;AAEnD,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAGhC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,oBAAC,eAAe,CAAC,SAAS,IACxB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,mCAAmC,EAAE,SAAS,CAAC,KAC1D,KAAK,GACT,CACH,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,eAAe,CAAC,SAAS,CAAC,WAAW,CAAA;AAE7D,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACjC,KAAK;IACL,KAAK;IACL,OAAO;IACP,OAAO;IACP,KAAK;IACL,IAAI;IACJ,SAAS;CACV,CAAC,CAAA;AAEO,wBAAM","sourcesContent":["\"use client\"\n\nimport { ChevronUpDown, EllipseMiniSolid } from \"@medusajs/icons\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { cva } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\ninterface SelectProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root> {\n size?: \"base\" | \"small\"\n}\n\ntype SelectContextValue = {\n size: \"base\" | \"small\"\n}\n\nconst SelectContext = React.createContext<SelectContextValue | null>(null)\n\nconst useSelectContext = () => {\n const context = React.useContext(SelectContext)\n\n if (context === null) {\n throw new Error(\"useSelectContext must be used within a SelectProvider\")\n }\n\n return context\n}\n\nconst Root = ({ children, size = \"base\", ...props }: SelectProps) => {\n return (\n <SelectContext.Provider value={React.useMemo(() => ({ size }), [size])}>\n <SelectPrimitive.Root {...props}>{children}</SelectPrimitive.Root>\n </SelectContext.Provider>\n )\n}\n\nconst Group = SelectPrimitive.Group\n\nconst Value = SelectPrimitive.Value\n\nconst triggerVariants = cva(\n clx(\n \"bg-ui-bg-field txt-compact-medium shadow-buttons-neutral transition-fg flex w-full select-none items-center justify-between rounded-md outline-none\",\n \"data-[placeholder]:text-ui-fg-muted text-ui-fg-base\",\n \"hover:bg-ui-bg-field-hover\",\n \"focus:shadow-borders-interactive-with-active data-[state=open]:!shadow-borders-interactive-with-active\",\n \"aria-[invalid=true]:border-ui-border-error aria-[invalid=true]:shadow-borders-error\",\n \"invalid::border-ui-border-error invalid:shadow-borders-error\",\n \"disabled:!bg-ui-bg-disabled disabled:!text-ui-fg-disabled\",\n \"group/trigger\"\n ),\n {\n variants: {\n size: {\n base: \"h-10 px-3 py-[9px]\",\n small: \"h-8 px-2 py-[5px]\",\n },\n },\n }\n)\n\nconst Trigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => {\n const { size } = useSelectContext()\n\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={clx(triggerVariants({ size }), className)}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronUpDown className=\"text-ui-fg-muted group-disabled/trigger:text-ui-fg-disabled\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n})\nTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(\n (\n {\n className,\n children,\n position = \"popper\",\n sideOffset = 8,\n collisionPadding = 24,\n ...props\n },\n ref\n ) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout relative max-h-[200px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-lg\",\n \"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n {\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\":\n position === \"popper\",\n },\n className\n )}\n position={position}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={clx(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n)\nContent.displayName = SelectPrimitive.Content.displayName\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={clx(\n \"txt-compact-xsmall-plus text-ui-fg-subtle px-3 py-2\",\n className\n )}\n {...props}\n />\n))\nLabel.displayName = SelectPrimitive.Label.displayName\n\nconst Item = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => {\n const { size } = useSelectContext()\n\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={clx(\n \"txt-compact-medium bg-ui-bg-base grid cursor-pointer grid-cols-[20px_1fr] gap-x-2 rounded-md px-3 py-2 outline-none transition-colors\",\n \"hover:bg-ui-bg-base-hover focus:bg-ui-bg-base-hover\",\n {\n \"txt-compact-medium data-[state=checked]:txt-compact-medium-plus\":\n size === \"base\",\n \"txt-compact-small data-[state=checked]:txt-compact-medium-plus\":\n size === \"small\",\n },\n className\n )}\n {...props}\n >\n <span className=\"flex h-5 w-5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <EllipseMiniSolid />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText className=\"flex-1 truncate\">\n {children}\n </SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n})\nItem.displayName = SelectPrimitive.Item.displayName\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={clx(\"bg-ui-border-base -mx-1 my-1 h-px\", className)}\n {...props}\n />\n))\nSeparator.displayName = SelectPrimitive.Separator.displayName\n\nconst Select = Object.assign(Root, {\n Group,\n Value,\n Trigger,\n Content,\n Label,\n Item,\n Separator,\n})\n\nexport { Select }\n"]}
@@ -2,18 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Table = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const icons_1 = require("@medusajs/icons");
5
6
  const React = tslib_1.__importStar(require("react"));
6
7
  const button_1 = require("../button");
7
8
  const clx_1 = require("../../utils/clx");
8
- const icons_1 = require("@medusajs/icons");
9
- const Root = React.forwardRef(({ className, ...props }, ref) => (React.createElement("div", { className: "w-full overflow-auto" },
10
- React.createElement("table", { ref: ref, className: (0, clx_1.clx)("text-ui-fg-subtle txt-compact-small w-full", className), ...props }))));
9
+ const Root = React.forwardRef(({ className, ...props }, ref) => (React.createElement("table", { ref: ref, className: (0, clx_1.clx)("text-ui-fg-subtle txt-compact-small w-full", className), ...props })));
11
10
  Root.displayName = "Table";
12
11
  const Row = React.forwardRef(({ className, ...props }, ref) => (React.createElement("tr", { ref: ref, className: (0, clx_1.clx)("bg-ui-bg-base hover:bg-ui-bg-base-hover border-ui-border-base transition-fg border-b", "[&_td:last-child]:pr-8 [&_th:last-child]:pr-8", "[&_td:first-child]:pl-8 [&_th:first-child]:pl-8", className), ...props })));
13
12
  Row.displayName = "Table.Row";
14
13
  const Cell = React.forwardRef(({ className, ...props }, ref) => (React.createElement("td", { ref: ref, className: (0, clx_1.clx)("h-12 pr-3", className), ...props })));
15
14
  Cell.displayName = "Table.Cell";
16
- const Header = React.forwardRef(({ className, ...props }, ref) => (React.createElement("thead", { ref: ref, className: (0, clx_1.clx)("border-ui-border-base txt-compact-small-plus border-y", className), ...props })));
15
+ const Header = React.forwardRef(({ className, ...props }, ref) => (React.createElement("thead", { ref: ref, className: (0, clx_1.clx)("border-ui-border-base txt-compact-small-plus [&_tr:hover]:bg-ui-bg-base border-y", className), ...props })));
17
16
  Header.displayName = "Table.Header";
18
17
  const HeaderCell = React.forwardRef(({ className, ...props }, ref) => (React.createElement("th", { ref: ref, className: (0, clx_1.clx)("h-12 pr-3 text-left", className), ...props })));
19
18
  HeaderCell.displayName = "Table.HeaderCell";
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../../src/components/table/table.tsx"],"names":[],"mappings":";;;;AAAA,qDAA8B;AAE9B,gDAA4C;AAC5C,qCAAiC;AACjC,2CAAuC;AAEvC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAG3B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,6BAAK,SAAS,EAAC,sBAAsB;IACnC,+BACE,GAAG,EAAE,GAAG,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,EAAC,kBAAkB,GAAG;YACtC,+BAAI,GAAG,EAAE,OAAO,KAAK,UAAU,CAAK,CAChC;QACN,6BAAK,SAAS,EAAC,2BAA2B;YACxC,6BAAK,SAAS,EAAC,gDAAgD;gBAC7D;oBACG,SAAS,GAAG,CAAC;;oBAAM,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CACxC,CACA;YACN,oBAAC,eAAM,IACL,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,CAAC,eAAe,WAGnB;YACT,oBAAC,eAAM,IACL,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,CAAC,WAAW,WAGf,CACL,CACF,CACP,CAAA;AACH,CAAC,CACF,CAAA;AACD,UAAU,CAAC,WAAW,GAAG,kBAAkB,CAAA;AAE3C,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IAChC,GAAG;IACH,IAAI;IACJ,MAAM;IACN,UAAU;IACV,IAAI;IACJ,UAAU;CACX,CAAC,CAAA;AAEO,sBAAK","sourcesContent":["import * as React from \"react\"\n\nimport { Button } from \"@/components/button\"\nimport { clx } from \"@/utils/clx\"\nimport { Minus } from \"@medusajs/icons\"\n\nconst Root = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className=\"w-full overflow-auto\">\n <table\n ref={ref}\n className={clx(\"text-ui-fg-subtle txt-compact-small w-full\", className)}\n {...props}\n />\n </div>\n))\nRoot.displayName = \"Table\"\n\nconst Row = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={clx(\n \"bg-ui-bg-base hover:bg-ui-bg-base-hover border-ui-border-base transition-fg border-b\",\n \"[&_td:last-child]:pr-8 [&_th:last-child]:pr-8\",\n \"[&_td:first-child]:pl-8 [&_th:first-child]:pl-8\",\n className\n )}\n {...props}\n />\n))\nRow.displayName = \"Table.Row\"\n\nconst Cell = React.forwardRef<\n HTMLTableCellElement,\n React.HTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td ref={ref} className={clx(\"h-12 pr-3\", className)} {...props} />\n))\nCell.displayName = \"Table.Cell\"\n\nconst Header = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead\n ref={ref}\n className={clx(\n \"border-ui-border-base txt-compact-small-plus border-y\",\n className\n )}\n {...props}\n />\n))\nHeader.displayName = \"Table.Header\"\n\nconst HeaderCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th ref={ref} className={clx(\"h-12 pr-3 text-left\", className)} {...props} />\n))\nHeaderCell.displayName = \"Table.HeaderCell\"\n\nconst Body = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={clx(\"border-ui-border-base border-b\", className)}\n {...props}\n />\n))\nBody.displayName = \"Table.Body\"\n\ninterface TablePaginationProps extends React.HTMLAttributes<HTMLDivElement> {\n count: number\n pageSize: number\n pageIndex: number\n pageCount: number\n canPreviousPage: boolean\n canNextPage: boolean\n previousPage: () => void\n nextPage: () => void\n}\n\nconst Pagination = React.forwardRef<HTMLDivElement, TablePaginationProps>(\n (\n {\n className,\n count,\n pageSize,\n pageCount,\n pageIndex,\n canPreviousPage,\n canNextPage,\n nextPage,\n previousPage,\n ...props\n },\n ref\n ) => {\n const { from, to } = React.useMemo(() => {\n const from = count === 0 ? count : pageIndex * pageSize + 1\n const to = Math.min(count, (pageIndex + 1) * pageSize)\n\n return { from, to }\n }, [count, pageIndex, pageSize])\n\n return (\n <div\n ref={ref}\n className={clx(\n \"text-ui-fg-subtle txt-compact-small-plus flex w-full items-center justify-between px-5 pb-6 pt-4\",\n className\n )}\n {...props}\n >\n <div className=\"inline-flex items-center gap-x-1 px-3 py-[5px]\">\n <p>{from}</p>\n <Minus className=\"text-ui-fg-muted\" />\n <p>{`${to} of ${count} results`}</p>\n </div>\n <div className=\"flex items-center gap-x-2\">\n <div className=\"inline-flex items-center gap-x-1 px-3 py-[5px]\">\n <p>\n {pageIndex + 1} of {Math.max(pageCount, 1)}\n </p>\n </div>\n <Button\n variant={\"transparent\"}\n onClick={previousPage}\n disabled={!canPreviousPage}\n >\n Prev\n </Button>\n <Button\n variant={\"transparent\"}\n onClick={nextPage}\n disabled={!canNextPage}\n >\n Next\n </Button>\n </div>\n </div>\n )\n }\n)\nPagination.displayName = \"Table.Pagination\"\n\nconst Table = Object.assign(Root, {\n Row,\n Cell,\n Header,\n HeaderCell,\n Body,\n Pagination,\n})\n\nexport { Table }\n"]}
1
+ {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../../src/components/table/table.tsx"],"names":[],"mappings":";;;;AAAA,2CAAuC;AACvC,qDAA8B;AAE9B,gDAA4C;AAC5C,qCAAiC;AAEjC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAG3B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,+BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,4CAA4C,EAAE,SAAS,CAAC,KACnE,KAAK,GACT,CACH,CAAC,CAAA;AACF,IAAI,CAAC,WAAW,GAAG,OAAO,CAAA;AAE1B,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAG1B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,4BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,sFAAsF,EACtF,+CAA+C,EAC/C,iDAAiD,EACjD,SAAS,CACV,KACG,KAAK,GACT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,EAAE,QAAQ,EACjB,QAAQ,EAAE,CAAC,WAAW,WAGf,CACL,CACF,CACP,CAAA;AACH,CAAC,CACF,CAAA;AACD,UAAU,CAAC,WAAW,GAAG,kBAAkB,CAAA;AAE3C,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IAChC,GAAG;IACH,IAAI;IACJ,MAAM;IACN,UAAU;IACV,IAAI;IACJ,UAAU;CACX,CAAC,CAAA;AAEO,sBAAK","sourcesContent":["import { Minus } from \"@medusajs/icons\"\nimport * as React from \"react\"\n\nimport { Button } from \"@/components/button\"\nimport { clx } from \"@/utils/clx\"\n\nconst Root = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <table\n ref={ref}\n className={clx(\"text-ui-fg-subtle txt-compact-small w-full\", className)}\n {...props}\n />\n))\nRoot.displayName = \"Table\"\n\nconst Row = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={clx(\n \"bg-ui-bg-base hover:bg-ui-bg-base-hover border-ui-border-base transition-fg border-b\",\n \"[&_td:last-child]:pr-8 [&_th:last-child]:pr-8\",\n \"[&_td:first-child]:pl-8 [&_th:first-child]:pl-8\",\n className\n )}\n {...props}\n />\n))\nRow.displayName = \"Table.Row\"\n\nconst Cell = React.forwardRef<\n HTMLTableCellElement,\n React.HTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td ref={ref} className={clx(\"h-12 pr-3\", className)} {...props} />\n))\nCell.displayName = \"Table.Cell\"\n\nconst Header = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead\n ref={ref}\n className={clx(\n \"border-ui-border-base txt-compact-small-plus [&_tr:hover]:bg-ui-bg-base border-y\",\n className\n )}\n {...props}\n />\n))\nHeader.displayName = \"Table.Header\"\n\nconst HeaderCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th ref={ref} className={clx(\"h-12 pr-3 text-left\", className)} {...props} />\n))\nHeaderCell.displayName = \"Table.HeaderCell\"\n\nconst Body = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={clx(\"border-ui-border-base border-b\", className)}\n {...props}\n />\n))\nBody.displayName = \"Table.Body\"\n\ninterface TablePaginationProps extends React.HTMLAttributes<HTMLDivElement> {\n count: number\n pageSize: number\n pageIndex: number\n pageCount: number\n canPreviousPage: boolean\n canNextPage: boolean\n previousPage: () => void\n nextPage: () => void\n}\n\nconst Pagination = React.forwardRef<HTMLDivElement, TablePaginationProps>(\n (\n {\n className,\n count,\n pageSize,\n pageCount,\n pageIndex,\n canPreviousPage,\n canNextPage,\n nextPage,\n previousPage,\n ...props\n },\n ref\n ) => {\n const { from, to } = React.useMemo(() => {\n const from = count === 0 ? count : pageIndex * pageSize + 1\n const to = Math.min(count, (pageIndex + 1) * pageSize)\n\n return { from, to }\n }, [count, pageIndex, pageSize])\n\n return (\n <div\n ref={ref}\n className={clx(\n \"text-ui-fg-subtle txt-compact-small-plus flex w-full items-center justify-between px-5 pb-6 pt-4\",\n className\n )}\n {...props}\n >\n <div className=\"inline-flex items-center gap-x-1 px-3 py-[5px]\">\n <p>{from}</p>\n <Minus className=\"text-ui-fg-muted\" />\n <p>{`${to} of ${count} results`}</p>\n </div>\n <div className=\"flex items-center gap-x-2\">\n <div className=\"inline-flex items-center gap-x-1 px-3 py-[5px]\">\n <p>\n {pageIndex + 1} of {Math.max(pageCount, 1)}\n </p>\n </div>\n <Button\n variant={\"transparent\"}\n onClick={previousPage}\n disabled={!canPreviousPage}\n >\n Prev\n </Button>\n <Button\n variant={\"transparent\"}\n onClick={nextPage}\n disabled={!canNextPage}\n >\n Next\n </Button>\n </div>\n </div>\n )\n }\n)\nPagination.displayName = \"Table.Pagination\"\n\nconst Table = Object.assign(Root, {\n Row,\n Cell,\n Header,\n HeaderCell,\n Body,\n Pagination,\n})\n\nexport { Table }\n"]}
@@ -4,6 +4,7 @@ declare const textVariants: (props?: ({
4
4
  size?: "base" | "large" | "small" | "xlarge" | "xsmall" | null | undefined;
5
5
  weight?: "regular" | "plus" | null | undefined;
6
6
  family?: "sans" | "mono" | null | undefined;
7
+ leading?: "normal" | "compact" | null | undefined;
7
8
  } & ({
8
9
  class: import("clsx").ClassValue;
9
10
  className?: undefined;