{"version":3,"file":"Select.js","names":["SelectBehavior"],"sources":["esm/components/Select.js"],"sourcesContent":["import {\n  createStyledContext,\n  styled,\n  withStaticProperties\n} from \"@tamagui/core\";\nimport {\n  Select as SelectBehavior,\n  SelectNativeComponentContext\n} from \"@tamagui/select\";\nimport { SizableText } from \"@tamagui/text\";\nimport { jsx } from \"react/jsx-runtime\";\nconst IconGlyph = styled(SizableText, {\n  displayName: \"SelectIconGlyph\",\n  color: \"color\",\n  userSelect: \"none\"\n});\nconst ChevronDown = ({ size = 16 }) => /* @__PURE__ */ jsx(IconGlyph, { fontSize: size, lineHeight: 1, children: \"\\u25BE\" });\nconst ChevronUp = ({ size = 16 }) => /* @__PURE__ */ jsx(IconGlyph, { fontSize: size, lineHeight: 1, children: \"\\u25B4\" });\nconst Check = ({ size = 14 }) => /* @__PURE__ */ jsx(IconGlyph, { fontSize: size, lineHeight: 1, children: \"\\u2713\" });\nconst SelectContext = createStyledContext({ size: \"md\" });\nconst selectFrameSize = {\n  xs: { paddingInline: \"2\", paddingBlock: \"1\", borderRadius: \"sm\", gap: \"1\" },\n  sm: { paddingInline: \"3\", paddingBlock: \"1.5\", borderRadius: \"md\", gap: \"1.5\" },\n  md: { paddingInline: \"4\", paddingBlock: \"2\", borderRadius: \"md\", gap: \"2\" },\n  lg: { paddingInline: \"6\", paddingBlock: \"2\", borderRadius: \"md\", gap: \"2\" },\n  xl: { paddingInline: \"8\", paddingBlock: \"2.5\", borderRadius: \"lg\", gap: \"2.5\" }\n};\nconst selectTextSize = {\n  xs: { fontSize: \"xs\", lineHeight: \"xs\" },\n  sm: { fontSize: \"sm\", lineHeight: \"sm\" },\n  md: { fontSize: \"sm\", lineHeight: \"sm\" },\n  lg: { fontSize: \"base\", lineHeight: \"base\" },\n  xl: { fontSize: \"lg\", lineHeight: \"lg\" }\n};\nconst selectItemSize = {\n  xs: { gap: \"1\", paddingHorizontal: \"2\", paddingVertical: \"1\" },\n  sm: { gap: \"1.5\", paddingHorizontal: \"3\", paddingVertical: \"1.5\" },\n  md: { gap: \"2\", paddingHorizontal: \"4\", paddingVertical: \"2\" },\n  lg: { gap: \"2\", paddingHorizontal: \"6\", paddingVertical: \"2\" },\n  xl: { gap: \"2.5\", paddingHorizontal: \"8\", paddingVertical: \"2.5\" }\n};\nconst nativeChevronStroke = (angle) => `linear-gradient(${angle}deg, transparent calc(50% - 0.75px), currentColor calc(50% - 0.75px) calc(50% + 0.75px), transparent calc(50% + 0.75px))`;\nconst nativeChevronPosition = (paddingInline) => {\n  const center = paddingInline + 8;\n  return `calc(100% - ${center - 0.25}px) 50%, calc(100% - ${center - 4.75}px) 50%`;\n};\nconst selectNativeSize = {\n  // a native <select> ignores line-height, so it gets the control height\n  // (line height plus vertical padding) plus its 1px border on each side,\n  // and room for the chevron\n  xs: {\n    ...selectTextSize.xs,\n    paddingInline: \"2\",\n    paddingBlock: \"1\",\n    borderRadius: \"sm\",\n    gap: \"1\",\n    height: 26,\n    paddingRight: 28,\n    backgroundPosition: nativeChevronPosition(8)\n  },\n  sm: {\n    ...selectTextSize.sm,\n    paddingInline: \"3\",\n    paddingBlock: \"1.5\",\n    borderRadius: \"md\",\n    gap: \"1.5\",\n    height: 34,\n    paddingRight: 32,\n    backgroundPosition: nativeChevronPosition(12)\n  },\n  md: {\n    ...selectTextSize.md,\n    paddingInline: \"4\",\n    paddingBlock: \"2\",\n    borderRadius: \"md\",\n    gap: \"2\",\n    height: 38,\n    paddingRight: 36,\n    backgroundPosition: nativeChevronPosition(16)\n  },\n  lg: {\n    ...selectTextSize.lg,\n    paddingInline: \"6\",\n    paddingBlock: \"2\",\n    borderRadius: \"md\",\n    gap: \"2\",\n    height: 42,\n    paddingRight: 44,\n    backgroundPosition: nativeChevronPosition(24)\n  },\n  xl: {\n    ...selectTextSize.xl,\n    paddingInline: \"8\",\n    paddingBlock: \"2.5\",\n    borderRadius: \"lg\",\n    gap: \"2.5\",\n    height: 50,\n    paddingRight: 52,\n    backgroundPosition: nativeChevronPosition(32)\n  }\n};\nconst SelectNative = styled(SizableText, {\n  displayName: \"SelectNative\",\n  render: \"select\",\n  backgroundColor: \"background hover:background-hover\",\n  borderColor: \"border-color\",\n  borderWidth: 1,\n  color: \"color\",\n  outlineWidth: 0,\n  userSelect: \"none\",\n  backgroundImage: `${nativeChevronStroke(45)}, ${nativeChevronStroke(-45)}`,\n  backgroundRepeat: \"no-repeat\",\n  backgroundSize: \"5px 5px\",\n  variants: {\n    size: {\n      ...selectNativeSize,\n      true: selectNativeSize.md\n    }\n  },\n  defaultVariants: { size: \"md\" }\n});\nconst SelectTrigger = styled(SelectBehavior.Trigger, {\n  context: SelectContext,\n  displayName: \"SelectTrigger\",\n  width: \"100%\",\n  maxWidth: \"100%\",\n  overflow: \"hidden\",\n  flexWrap: \"nowrap\",\n  backgroundColor: \"background hover:background-hover press:background-press\",\n  borderColor: \"border-color hover:border-color-hover\",\n  borderWidth: 1,\n  justifyContent: \"space-between\",\n  outlineColor: \"focus-visible:outline-color\",\n  outlineStyle: \"focus-visible:solid\",\n  outlineWidth: \"focus-visible:2px\",\n  variants: {\n    size: {\n      ...selectFrameSize,\n      true: selectFrameSize.md\n    }\n  },\n  defaultVariants: { size: \"md\" }\n});\nconst SelectValue = styled(SelectBehavior.Value, {\n  context: SelectContext,\n  displayName: \"SelectValue\",\n  color: \"color\",\n  ellipsis: true,\n  variants: {\n    size: {\n      ...selectTextSize,\n      true: selectTextSize.md\n    }\n  },\n  defaultVariants: { size: \"md\" }\n});\nconst SelectIcon = styled(SelectBehavior.Icon, {\n  context: SelectContext,\n  displayName: \"SelectIcon\",\n  marginLeft: \"auto\",\n  children: /* @__PURE__ */ jsx(ChevronDown, {})\n});\nconst SelectGroup = styled(SelectBehavior.Group, {\n  displayName: \"SelectGroup\",\n  width: \"100%\"\n});\nconst SelectLabel = styled(SelectBehavior.Label, {\n  context: SelectContext,\n  displayName: \"SelectLabel\",\n  color: \"color-10\",\n  fontWeight: \"600\",\n  paddingHorizontal: 10,\n  paddingVertical: 6,\n  variants: {\n    size: {\n      ...selectTextSize,\n      true: selectTextSize.md\n    }\n  },\n  defaultVariants: { size: \"md\" }\n});\nconst SelectItem = styled(SelectBehavior.Item, {\n  context: SelectContext,\n  displayName: \"SelectItem\",\n  width: \"100%\",\n  maxWidth: \"100%\",\n  overflow: \"hidden\",\n  flexWrap: \"nowrap\",\n  justifyContent: \"space-between\",\n  cursor: \"default\",\n  outlineOffset: -1,\n  borderRadius: 6,\n  backgroundColor: \"hover:background-hover press:background-press focus:background-focus\",\n  outlineColor: \"focus-visible:outline-color\",\n  outlineStyle: \"focus-visible:solid\",\n  outlineWidth: \"focus-visible:1px\",\n  variants: {\n    size: {\n      ...selectItemSize,\n      true: selectItemSize.md\n    }\n  },\n  defaultVariants: { size: \"md\" }\n});\nconst SelectItemText = styled(SelectBehavior.ItemText, {\n  context: SelectContext,\n  displayName: \"SelectItemText\",\n  color: \"color\",\n  userSelect: \"none\",\n  ellipsis: true,\n  variants: {\n    size: {\n      ...selectTextSize,\n      true: selectTextSize.md\n    }\n  },\n  defaultVariants: { size: \"md\" }\n});\nconst SelectItemIndicator = styled(SelectBehavior.ItemIndicator, {\n  displayName: \"SelectItemIndicator\",\n  alignItems: \"center\",\n  justifyContent: \"center\",\n  marginLeft: \"auto\",\n  children: /* @__PURE__ */ jsx(Check, { size: 14 })\n});\nconst SelectIndicator = styled(SelectBehavior.Indicator, {\n  displayName: \"SelectIndicator\",\n  backgroundColor: \"background-focus\",\n  borderRadius: 6\n});\nconst SelectViewport = styled(SelectBehavior.Viewport, {\n  displayName: \"SelectViewport\",\n  backgroundColor: \"background\",\n  borderColor: \"border-color\",\n  borderRadius: 10,\n  borderWidth: 1,\n  maxHeight: 300,\n  padding: 4,\n  boxShadow: \"0 12px 28px rgba(0, 0, 0, 0.2)\"\n});\nconst SelectScrollUpButton = styled(SelectBehavior.ScrollUpButton, {\n  displayName: \"SelectScrollUpButton\",\n  alignItems: \"center\",\n  backgroundColor: \"background\",\n  height: 28,\n  justifyContent: \"center\",\n  children: /* @__PURE__ */ jsx(ChevronUp, { size: 16 })\n});\nconst SelectScrollDownButton = styled(SelectBehavior.ScrollDownButton, {\n  displayName: \"SelectScrollDownButton\",\n  alignItems: \"center\",\n  backgroundColor: \"background\",\n  height: 28,\n  justifyContent: \"center\",\n  children: /* @__PURE__ */ jsx(ChevronDown, { size: 16 })\n});\nconst SelectSeparator = styled(SelectBehavior.Separator, {\n  displayName: \"SelectSeparator\",\n  backgroundColor: \"border-color\",\n  height: 1,\n  marginVertical: 4\n});\nfunction SelectRoot({ size = true, ...props }) {\n  return /* @__PURE__ */ jsx(SelectNativeComponentContext.Provider, { value: SelectNative, children: /* @__PURE__ */ jsx(SelectContext.Provider, { size, children: /* @__PURE__ */ jsx(SelectBehavior.Root, { size, ...props }) }) });\n}\nconst selectParts = {\n  Adapt: SelectBehavior.Adapt,\n  Content: SelectBehavior.Content,\n  FocusScope: SelectBehavior.FocusScope,\n  Group: SelectGroup,\n  Icon: SelectIcon,\n  Indicator: SelectIndicator,\n  Item: SelectItem,\n  ItemIndicator: SelectItemIndicator,\n  ItemText: SelectItemText,\n  Label: SelectLabel,\n  ScrollDownButton: SelectScrollDownButton,\n  ScrollUpButton: SelectScrollUpButton,\n  Separator: SelectSeparator,\n  Trigger: SelectTrigger,\n  Value: SelectValue,\n  Viewport: SelectViewport\n};\nconst Select = withStaticProperties(SelectRoot, {\n  Root: SelectRoot,\n  ...selectParts\n});\nexport {\n  Select,\n  SelectGroup,\n  SelectIcon,\n  SelectIndicator,\n  SelectItem,\n  SelectItemIndicator,\n  SelectItemText,\n  SelectLabel,\n  SelectRoot,\n  SelectScrollDownButton,\n  SelectScrollUpButton,\n  SelectSeparator,\n  SelectTrigger,\n  SelectValue,\n  SelectViewport,\n  selectParts\n};\n//# sourceMappingURL=Select.js.map\n"],"mappings":";;;;;;AAWA,MAAM,YAAY,OAAO,aAAa;CACpC,aAAa;CACb,OAAO;CACP,YAAY;AACd,CAAC;AACD,MAAM,e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