@medusajs/ui 2.4.2 → 2.4.3-next-20240326101830

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.
@@ -7,11 +7,11 @@ const cva_1 = require("cva");
7
7
  const React = tslib_1.__importStar(require("react"));
8
8
  const clx_1 = require("../../utils/clx");
9
9
  const hintVariants = (0, cva_1.cva)({
10
- base: "txt-small inline-flex items-start gap-x-2",
10
+ base: "txt-small",
11
11
  variants: {
12
12
  variant: {
13
13
  info: "text-ui-fg-subtle",
14
- error: "text-ui-fg-error",
14
+ error: "text-ui-fg-error grid grid-cols-[20px_1fr] gap-2 items-start",
15
15
  },
16
16
  },
17
17
  defaultVariants: {
@@ -1 +1 @@
1
- {"version":3,"file":"hint.js","sourceRoot":"","sources":["../../../../src/components/hint/hint.tsx"],"names":[],"mappings":";;;;AAAA,2CAAwD;AACxD,6BAAuC;AACvC,qDAA8B;AAE9B,yCAAqC;AAErC,MAAM,YAAY,GAAG,IAAA,SAAG,EAAC;IACvB,IAAI,EAAE,2CAA2C;IACjD,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,kBAAkB;SAC1B;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,MAAM;KAChB;CACF,CAAC,CAAA;AAMF,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAC3B,CACE,EACE,SAAS;AACT;;GAEG;AACH,OAAO,GAAG,MAAM,EAChB,QAAQ,EACR,GAAG,KAAK,EACE,EACZ,GAAG,EACH,EAAE;IACF,OAAO,CACL,8BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,KAChD,KAAK;QAER,OAAO,KAAK,OAAO,IAAI,oBAAC,8BAAsB,OAAG;QACjD,QAAQ,CACJ,CACR,CAAA;AACH,CAAC,CACF,CAAA;AAGQ,oBAAI;AAFb,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA","sourcesContent":["import { ExclamationCircleSolid } from \"@medusajs/icons\"\nimport { VariantProps, cva } from \"cva\"\nimport * as React from \"react\"\n\nimport { clx } from \"../../utils/clx\"\n\nconst hintVariants = cva({\n base: \"txt-small inline-flex items-start gap-x-2\",\n variants: {\n variant: {\n info: \"text-ui-fg-subtle\",\n error: \"text-ui-fg-error\",\n },\n },\n defaultVariants: {\n variant: \"info\",\n },\n})\n\ninterface HintProps\n extends VariantProps<typeof hintVariants>,\n React.ComponentPropsWithoutRef<\"span\"> {}\n\nconst Hint = React.forwardRef<HTMLSpanElement, HintProps>(\n (\n {\n className,\n /**\n * The hint's style.\n */\n variant = \"info\",\n children,\n ...props\n }: HintProps,\n ref\n ) => {\n return (\n <span\n ref={ref}\n className={clx(hintVariants({ variant }), className)}\n {...props}\n >\n {variant === \"error\" && <ExclamationCircleSolid />}\n {children}\n </span>\n )\n }\n)\nHint.displayName = \"Hint\"\n\nexport { Hint }\n"]}
1
+ {"version":3,"file":"hint.js","sourceRoot":"","sources":["../../../../src/components/hint/hint.tsx"],"names":[],"mappings":";;;;AAAA,2CAAwD;AACxD,6BAAuC;AACvC,qDAA8B;AAE9B,yCAAqC;AAErC,MAAM,YAAY,GAAG,IAAA,SAAG,EAAC;IACvB,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,8DAA8D;SACtE;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,MAAM;KAChB;CACF,CAAC,CAAA;AAMF,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAC3B,CACE,EACE,SAAS;AACT;;GAEG;AACH,OAAO,GAAG,MAAM,EAChB,QAAQ,EACR,GAAG,KAAK,EACE,EACZ,GAAG,EACH,EAAE;IACF,OAAO,CACL,8BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,KAChD,KAAK;QAER,OAAO,KAAK,OAAO,IAAI,oBAAC,8BAAsB,OAAG;QACjD,QAAQ,CACJ,CACR,CAAA;AACH,CAAC,CACF,CAAA;AAGQ,oBAAI;AAFb,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA","sourcesContent":["import { ExclamationCircleSolid } from \"@medusajs/icons\"\nimport { VariantProps, cva } from \"cva\"\nimport * as React from \"react\"\n\nimport { clx } from \"../../utils/clx\"\n\nconst hintVariants = cva({\n base: \"txt-small\",\n variants: {\n variant: {\n info: \"text-ui-fg-subtle\",\n error: \"text-ui-fg-error grid grid-cols-[20px_1fr] gap-2 items-start\",\n },\n },\n defaultVariants: {\n variant: \"info\",\n },\n})\n\ninterface HintProps\n extends VariantProps<typeof hintVariants>,\n React.ComponentPropsWithoutRef<\"span\"> {}\n\nconst Hint = React.forwardRef<HTMLSpanElement, HintProps>(\n (\n {\n className,\n /**\n * The hint's style.\n */\n variant = \"info\",\n children,\n ...props\n }: HintProps,\n ref\n ) => {\n return (\n <span\n ref={ref}\n className={clx(hintVariants({ variant }), className)}\n {...props}\n >\n {variant === \"error\" && <ExclamationCircleSolid />}\n {children}\n </span>\n )\n }\n)\nHint.displayName = \"Hint\"\n\nexport { Hint }\n"]}
@@ -41,7 +41,7 @@ Group.displayName = "Select.Group";
41
41
  const Value = SelectPrimitive.Value;
42
42
  Value.displayName = "Select.Value";
43
43
  const triggerVariants = (0, cva_1.cva)({
44
- base: (0, clx_1.clx)("bg-ui-bg-field 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-visible: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"),
44
+ base: (0, clx_1.clx)("bg-ui-bg-field 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-visible: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"),
45
45
  variants: {
46
46
  size: {
47
47
  base: "h-8 px-2 py-1.5 txt-compact-small",
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAAiE;AACjE,gFAAyD;AACzD,6BAAyB;AACzB,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;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,QAAQ;AACR;;GAEG;AACH,IAAI,GAAG,MAAM,EACb,GAAG,KAAK,EACI,EAAE,EAAE;IAChB,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,CAAC;QACpE,oBAAC,eAAe,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AgB,EAAE,CAAA;IAEnC,OAAO,CACL,oBAAC,eAAe,CAAC,IAAI,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,oHAAoH,EACpH,6DAA6D,EAC7D;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,aAAa,CAAA;AAEhC,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,kBAAkB,CAAA;AAE1C,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 { EllipseMiniSolid, TrianglesMini } from \"@medusajs/icons\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { cva } from \"cva\"\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\n/**\n * This component is based on [Radix UI Select](https://www.radix-ui.com/primitives/docs/components/select).\n * It also accepts all props of the HTML `select` component.\n */\nconst Root = ({\n children,\n /**\n * The select's size.\n */\n size = \"base\",\n ...props\n}: SelectProps) => {\n return (\n <SelectContext.Provider value={React.useMemo(() => ({ size }), [size])}>\n <SelectPrimitive.Root {...props}>{children}</SelectPrimitive.Root>\n </SelectContext.Provider>\n )\n}\nRoot.displayName = \"Select\"\n\n/**\n * Groups multiple items together.\n */\nconst Group = SelectPrimitive.Group\nGroup.displayName = \"Select.Group\"\n\n/**\n * Displays the selected value, or a placeholder if no value is selected.\n * It's based on [Radix UI Select Value](https://www.radix-ui.com/primitives/docs/components/select#value).\n */\nconst Value = SelectPrimitive.Value\nValue.displayName = \"Select.Value\"\n\nconst triggerVariants = cva({\n base: clx(\n \"bg-ui-bg-field 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-visible: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 variants: {\n size: {\n base: \"h-8 px-2 py-1.5 txt-compact-small\",\n small: \"h-7 px-2 py-1 txt-compact-small\",\n },\n },\n})\n\n/**\n * The trigger that toggles the select.\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 <TrianglesMini className=\"text-ui-fg-muted group-disabled/trigger:text-ui-fg-disabled\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n})\nTrigger.displayName = \"Select.Trigger\"\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 = \"Select.Content\"\n\n/**\n * Used to label a group of items.\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 = \"Select.Label\"\n\n/**\n * An item in the select. It's based on [Radix UI Select Item](https://www.radix-ui.com/primitives/docs/components/select#item)\n * and accepts its props.\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 \"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-visible: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 = \"Select.Item\"\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 = \"Select.Separator\"\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,6BAAyB;AACzB,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;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,QAAQ;AACR;;GAEG;AACH,IAAI,GAAG,MAAM,EACb,GAAG,KAAK,EACI,EAAE,EAAE;IAChB,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,CAAC;QACpE,oBAAC,eAAe,CAAC,IAAI,OAAK,KAAK,IAAG,QAAQ,CAAwB,CAC3C,CAC1B,CAAA;AACH,CAAC,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAA;AAE3B;;GAEG;AACH,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAA;AACnC,KAAK,CAAC,WAAW,GAAG,cAAc,CAAA;AAElC;;;GAGG;AACH,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAA;AACnC,KAAK,CAAC,WAAW,GAAG,cAAc,CAAA;AAElC,MAAM,eAAe,GAAG,IAAA,SAAG,EAAC;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AAC,eAAe,CAAC,QAAQ,IAAC,SAAS,EAAC,iBAAiB,IAClD,QAAQ,CACgB,CACN,CACxB,CAAA;AACH,CAAC,CAAC,CAAA;AACF,IAAI,CAAC,WAAW,GAAG,aAAa,CAAA;AAEhC,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,kBAAkB,CAAA;AAE1C,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 { EllipseMiniSolid, TrianglesMini } from \"@medusajs/icons\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { cva } from \"cva\"\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\n/**\n * This component is based on [Radix UI Select](https://www.radix-ui.com/primitives/docs/components/select).\n * It also accepts all props of the HTML `select` component.\n */\nconst Root = ({\n children,\n /**\n * The select's size.\n */\n size = \"base\",\n ...props\n}: SelectProps) => {\n return (\n <SelectContext.Provider value={React.useMemo(() => ({ size }), [size])}>\n <SelectPrimitive.Root {...props}>{children}</SelectPrimitive.Root>\n </SelectContext.Provider>\n )\n}\nRoot.displayName = \"Select\"\n\n/**\n * Groups multiple items together.\n */\nconst Group = SelectPrimitive.Group\nGroup.displayName = \"Select.Group\"\n\n/**\n * Displays the selected value, or a placeholder if no value is selected.\n * It's based on [Radix UI Select Value](https://www.radix-ui.com/primitives/docs/components/select#value).\n */\nconst Value = SelectPrimitive.Value\nValue.displayName = \"Select.Value\"\n\nconst triggerVariants = cva({\n base: clx(\n \"bg-ui-bg-field 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-visible: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 variants: {\n size: {\n base: \"h-8 px-2 py-1.5 txt-compact-small\",\n small: \"h-7 px-2 py-1 txt-compact-small\",\n },\n },\n})\n\n/**\n * The trigger that toggles the select.\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 <TrianglesMini className=\"text-ui-fg-muted group-disabled/trigger:text-ui-fg-disabled\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n})\nTrigger.displayName = \"Select.Trigger\"\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 = \"Select.Content\"\n\n/**\n * Used to label a group of items.\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 = \"Select.Label\"\n\n/**\n * An item in the select. It's based on [Radix UI Select Item](https://www.radix-ui.com/primitives/docs/components/select#item)\n * and accepts its props.\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 \"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-visible: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 = \"Select.Item\"\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 = \"Select.Separator\"\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"]}
@@ -3,11 +3,11 @@ import { cva } from "cva";
3
3
  import * as React from "react";
4
4
  import { clx } from "../../utils/clx";
5
5
  const hintVariants = cva({
6
- base: "txt-small inline-flex items-start gap-x-2",
6
+ base: "txt-small",
7
7
  variants: {
8
8
  variant: {
9
9
  info: "text-ui-fg-subtle",
10
- error: "text-ui-fg-error",
10
+ error: "text-ui-fg-error grid grid-cols-[20px_1fr] gap-2 items-start",
11
11
  },
12
12
  },
13
13
  defaultVariants: {
@@ -1 +1 @@
1
- {"version":3,"file":"hint.js","sourceRoot":"","sources":["../../../../src/components/hint/hint.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAgB,GAAG,EAAE,MAAM,KAAK,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAErC,MAAM,YAAY,GAAG,GAAG,CAAC;IACvB,IAAI,EAAE,2CAA2C;IACjD,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,kBAAkB;SAC1B;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,MAAM;KAChB;CACF,CAAC,CAAA;AAMF,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAC3B,CACE,EACE,SAAS;AACT;;GAEG;AACH,OAAO,GAAG,MAAM,EAChB,QAAQ,EACR,GAAG,KAAK,EACE,EACZ,GAAG,EACH,EAAE;IACF,OAAO,CACL,8BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,KAChD,KAAK;QAER,OAAO,KAAK,OAAO,IAAI,oBAAC,sBAAsB,OAAG;QACjD,QAAQ,CACJ,CACR,CAAA;AACH,CAAC,CACF,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA;AAEzB,OAAO,EAAE,IAAI,EAAE,CAAA","sourcesContent":["import { ExclamationCircleSolid } from \"@medusajs/icons\"\nimport { VariantProps, cva } from \"cva\"\nimport * as React from \"react\"\n\nimport { clx } from \"../../utils/clx\"\n\nconst hintVariants = cva({\n base: \"txt-small inline-flex items-start gap-x-2\",\n variants: {\n variant: {\n info: \"text-ui-fg-subtle\",\n error: \"text-ui-fg-error\",\n },\n },\n defaultVariants: {\n variant: \"info\",\n },\n})\n\ninterface HintProps\n extends VariantProps<typeof hintVariants>,\n React.ComponentPropsWithoutRef<\"span\"> {}\n\nconst Hint = React.forwardRef<HTMLSpanElement, HintProps>(\n (\n {\n className,\n /**\n * The hint's style.\n */\n variant = \"info\",\n children,\n ...props\n }: HintProps,\n ref\n ) => {\n return (\n <span\n ref={ref}\n className={clx(hintVariants({ variant }), className)}\n {...props}\n >\n {variant === \"error\" && <ExclamationCircleSolid />}\n {children}\n </span>\n )\n }\n)\nHint.displayName = \"Hint\"\n\nexport { Hint }\n"]}
1
+ {"version":3,"file":"hint.js","sourceRoot":"","sources":["../../../../src/components/hint/hint.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAgB,GAAG,EAAE,MAAM,KAAK,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAErC,MAAM,YAAY,GAAG,GAAG,CAAC;IACvB,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,8DAA8D;SACtE;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,MAAM;KAChB;CACF,CAAC,CAAA;AAMF,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAC3B,CACE,EACE,SAAS;AACT;;GAEG;AACH,OAAO,GAAG,MAAM,EAChB,QAAQ,EACR,GAAG,KAAK,EACE,EACZ,GAAG,EACH,EAAE;IACF,OAAO,CACL,8BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,KAChD,KAAK;QAER,OAAO,KAAK,OAAO,IAAI,oBAAC,sBAAsB,OAAG;QACjD,QAAQ,CACJ,CACR,CAAA;AACH,CAAC,CACF,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA;AAEzB,OAAO,EAAE,IAAI,EAAE,CAAA","sourcesContent":["import { ExclamationCircleSolid } from \"@medusajs/icons\"\nimport { VariantProps, cva } from \"cva\"\nimport * as React from \"react\"\n\nimport { clx } from \"../../utils/clx\"\n\nconst hintVariants = cva({\n base: \"txt-small\",\n variants: {\n variant: {\n info: \"text-ui-fg-subtle\",\n error: \"text-ui-fg-error grid grid-cols-[20px_1fr] gap-2 items-start\",\n },\n },\n defaultVariants: {\n variant: \"info\",\n },\n})\n\ninterface HintProps\n extends VariantProps<typeof hintVariants>,\n React.ComponentPropsWithoutRef<\"span\"> {}\n\nconst Hint = React.forwardRef<HTMLSpanElement, HintProps>(\n (\n {\n className,\n /**\n * The hint's style.\n */\n variant = \"info\",\n children,\n ...props\n }: HintProps,\n ref\n ) => {\n return (\n <span\n ref={ref}\n className={clx(hintVariants({ variant }), className)}\n {...props}\n >\n {variant === \"error\" && <ExclamationCircleSolid />}\n {children}\n </span>\n )\n }\n)\nHint.displayName = \"Hint\"\n\nexport { Hint }\n"]}
@@ -37,7 +37,7 @@ Group.displayName = "Select.Group";
37
37
  const Value = SelectPrimitive.Value;
38
38
  Value.displayName = "Select.Value";
39
39
  const triggerVariants = cva({
40
- base: clx("bg-ui-bg-field 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-visible: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"),
40
+ base: clx("bg-ui-bg-field 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-visible: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"),
41
41
  variants: {
42
42
  size: {
43
43
  base: "h-8 px-2 py-1.5 txt-compact-small",
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;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;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,QAAQ;AACR;;GAEG;AACH,IAAI,GAAG,MAAM,EACb,GAAG,KAAK,EACI,EAAE,EAAE;IAChB,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,CAAC;QACpE,oBAAC,eAAe,CAAC,IAAI,OAAK,KAA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,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,GAAG,CACZ,oHAAoH,EACpH,6DAA6D,EAC7D;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,gBAAgB,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,aAAa,CAAA;AAEhC,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,GAAG,CAAC,mCAAmC,EAAE,SAAS,CAAC,KAC1D,KAAK,GACT,CACH,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,kBAAkB,CAAA;AAE1C,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;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport { EllipseMiniSolid, TrianglesMini } from \"@medusajs/icons\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { cva } from \"cva\"\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\n/**\n * This component is based on [Radix UI Select](https://www.radix-ui.com/primitives/docs/components/select).\n * It also accepts all props of the HTML `select` component.\n */\nconst Root = ({\n children,\n /**\n * The select's size.\n */\n size = \"base\",\n ...props\n}: SelectProps) => {\n return (\n <SelectContext.Provider value={React.useMemo(() => ({ size }), [size])}>\n <SelectPrimitive.Root {...props}>{children}</SelectPrimitive.Root>\n </SelectContext.Provider>\n )\n}\nRoot.displayName = \"Select\"\n\n/**\n * Groups multiple items together.\n */\nconst Group = SelectPrimitive.Group\nGroup.displayName = \"Select.Group\"\n\n/**\n * Displays the selected value, or a placeholder if no value is selected.\n * It's based on [Radix UI Select Value](https://www.radix-ui.com/primitives/docs/components/select#value).\n */\nconst Value = SelectPrimitive.Value\nValue.displayName = \"Select.Value\"\n\nconst triggerVariants = cva({\n base: clx(\n \"bg-ui-bg-field 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-visible: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 variants: {\n size: {\n base: \"h-8 px-2 py-1.5 txt-compact-small\",\n small: \"h-7 px-2 py-1 txt-compact-small\",\n },\n },\n})\n\n/**\n * The trigger that toggles the select.\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 <TrianglesMini className=\"text-ui-fg-muted group-disabled/trigger:text-ui-fg-disabled\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n})\nTrigger.displayName = \"Select.Trigger\"\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 = \"Select.Content\"\n\n/**\n * Used to label a group of items.\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 = \"Select.Label\"\n\n/**\n * An item in the select. It's based on [Radix UI Select Item](https://www.radix-ui.com/primitives/docs/components/select#item)\n * and accepts its props.\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 \"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-visible: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 = \"Select.Item\"\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 = \"Select.Separator\"\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,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;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;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,QAAQ;AACR;;GAEG;AACH,IAAI,GAAG,MAAM,EACb,GAAG,KAAK,EACI,EAAE,EAAE;IAChB,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,CAAC;QACpE,oBAAC,eAAe,CAAC,IAAI,OAAK,KAAK,IAAG,QAAQ,CAAwB,CAC3C,CAC1B,CAAA;AACH,CAAC,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAA;AAE3B;;GAEG;AACH,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAA;AACnC,KAAK,CAAC,WAAW,GAAG,cAAc,CAAA;AAElC;;;GAGG;AACH,MA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YACxD,oBAAC,eAAe,CAAC,aAAa;gBAC5B,oBAAC,gBAAgB,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,aAAa,CAAA;AAEhC,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,GAAG,CAAC,mCAAmC,EAAE,SAAS,CAAC,KAC1D,KAAK,GACT,CACH,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,kBAAkB,CAAA;AAE1C,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;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport { EllipseMiniSolid, TrianglesMini } from \"@medusajs/icons\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { cva } from \"cva\"\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\n/**\n * This component is based on [Radix UI Select](https://www.radix-ui.com/primitives/docs/components/select).\n * It also accepts all props of the HTML `select` component.\n */\nconst Root = ({\n children,\n /**\n * The select's size.\n */\n size = \"base\",\n ...props\n}: SelectProps) => {\n return (\n <SelectContext.Provider value={React.useMemo(() => ({ size }), [size])}>\n <SelectPrimitive.Root {...props}>{children}</SelectPrimitive.Root>\n </SelectContext.Provider>\n )\n}\nRoot.displayName = \"Select\"\n\n/**\n * Groups multiple items together.\n */\nconst Group = SelectPrimitive.Group\nGroup.displayName = \"Select.Group\"\n\n/**\n * Displays the selected value, or a placeholder if no value is selected.\n * It's based on [Radix UI Select Value](https://www.radix-ui.com/primitives/docs/components/select#value).\n */\nconst Value = SelectPrimitive.Value\nValue.displayName = \"Select.Value\"\n\nconst triggerVariants = cva({\n base: clx(\n \"bg-ui-bg-field 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-visible: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 variants: {\n size: {\n base: \"h-8 px-2 py-1.5 txt-compact-small\",\n small: \"h-7 px-2 py-1 txt-compact-small\",\n },\n },\n})\n\n/**\n * The trigger that toggles the select.\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 <TrianglesMini className=\"text-ui-fg-muted group-disabled/trigger:text-ui-fg-disabled\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n})\nTrigger.displayName = \"Select.Trigger\"\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 = \"Select.Content\"\n\n/**\n * Used to label a group of items.\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 = \"Select.Label\"\n\n/**\n * An item in the select. It's based on [Radix UI Select Item](https://www.radix-ui.com/primitives/docs/components/select#item)\n * and accepts its props.\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 \"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-visible: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 = \"Select.Item\"\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 = \"Select.Separator\"\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/ui",
3
- "version": "2.4.2",
3
+ "version": "2.4.3-next-20240326101830",
4
4
  "author": "Kasper Kristensen <kasper@medusajs.com>",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -42,7 +42,7 @@
42
42
  "typecheck": "tsc --noEmit"
43
43
  },
44
44
  "devDependencies": {
45
- "@medusajs/ui-preset": "^1.1.2",
45
+ "@medusajs/ui-preset": "1.1.3-next-20240326101830",
46
46
  "@storybook/addon-essentials": "^7.0.23",
47
47
  "@storybook/addon-interactions": "^7.0.23",
48
48
  "@storybook/addon-links": "^7.0.23",