@ngrok/mantle 0.20.2 → 0.21.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.
@@ -0,0 +1,2 @@
1
+ import{a as S}from"./chunk-MF2QITTY.js";import{b as g}from"./chunk-R4XXPIT2.js";import{a as r}from"./chunk-AZ56JGNY.js";import{CaretDown as P}from"@phosphor-icons/react/CaretDown";import{CaretUp as R}from"@phosphor-icons/react/CaretUp";import{Check as I}from"@phosphor-icons/react/Check";import*as e from"@radix-ui/react-select";import{createContext as N,forwardRef as n,useContext as T}from"react";import{jsx as i,jsxs as u}from"react/jsx-runtime";var h=N({}),B=n(({"aria-invalid":o,children:a,id:t,validation:l,onBlur:s,onChange:d,...p},c)=>i(e.Root,{...p,onValueChange:d,children:i(h.Provider,{value:{"aria-invalid":o,id:t,validation:l,onBlur:s,ref:c},children:a})}));B.displayName="Select";var F=e.Group,G=e.Value,W=n(({"aria-invalid":o,className:a,children:t,id:l,validation:s,...d},p)=>{let c=T(h),m=c["aria-invalid"]??o,x=m!=null&&m!=="false",f=c.validation??s,v=x?"error":typeof f=="function"?f():f,C=m??v==="error",w=c.id??l;return u(e.Trigger,{"aria-invalid":C,className:r("h-9 text-sm","border-form bg-form text-strong placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left","hover:border-neutral-400","focus:outline-none focus:ring-4 aria-expanded:ring-4","focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent","data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success","data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning","data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger",a),"data-validation":v||void 0,id:w,ref:S(p,c.ref),...d,children:[t,i(e.Icon,{asChild:!0,children:i(P,{className:"size-4 shrink-0",weight:"bold"})})]})});W.displayName="SelectTrigger";var y=n(({className:o,...a},t)=>i(e.ScrollUpButton,{ref:t,className:r("flex cursor-default items-center justify-center py-1",o),...a,children:i(R,{className:"size-4 shrink-0",weight:"bold"})}));y.displayName="SelectScrollUpButton";var b=n(({className:o,...a},t)=>i(e.ScrollDownButton,{ref:t,className:r("flex cursor-default items-center justify-center py-1",o),...a,children:i(P,{className:"size-4 shrink-0",weight:"bold"})}));b.displayName="SelectScrollDownButton";var L=n(({className:o,children:a,position:t="popper",width:l,...s},d)=>i(e.Portal,{children:u(e.Content,{ref:d,className:r("border-popover 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 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","bg-popover",t==="popper"&&"data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-[var(--radix-select-content-available-height)]",l==="trigger"&&"w-[var(--radix-select-trigger-width)]",o),position:t,...s,children:[i(y,{}),i(e.Viewport,{className:r("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full"),children:a}),i(b,{})]})}));L.displayName="SelectContent";var k=n(({className:o,...a},t)=>i(e.Label,{ref:t,className:r("px-2 py-1.5 text-sm font-semibold",o),...a}));k.displayName="SelectLabel";var V=n(({className:o,children:a,...t},l)=>u(e.Item,{ref:l,className:r("relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm outline-none","focus:bg-popover-hover","data-disabled:pointer-events-none data-disabled:opacity-50","data-state-checked:bg-filled-accent data-state-checked:text-on-filled","focus:data-state-checked:bg-filled-accent",o),...t,children:[i(e.ItemText,{children:a}),i(e.ItemIndicator,{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:i(I,{className:"size-4 shrink-0",weight:"bold"})})]}));V.displayName="SelectItem";var E=n(({className:o,...a},t)=>i(g,{ref:t,className:r("-mx-1 my-1 h-px w-auto",o),...a}));E.displayName="SelectSeparator";export{B as a,F as b,G as c,W as d,L as e,k as f,V as g,E as h};
2
+ //# sourceMappingURL=chunk-5Q25P2WN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/select/select.tsx"],"sourcesContent":["import { CaretDown } from \"@phosphor-icons/react/CaretDown\";\nimport { CaretUp } from \"@phosphor-icons/react/CaretUp\";\nimport { Check } from \"@phosphor-icons/react/Check\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport type {\n\tComponentProps,\n\tComponentPropsWithoutRef,\n\tComponentRef,\n\tFocusEvent,\n\tRef,\n\tSelectHTMLAttributes,\n} from \"react\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport { composeRefs } from \"../../utils/compose-refs/compose-refs.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport type { WithValidation } from \"../input/types.js\";\nimport { Separator } from \"../separator/separator.js\";\n\ntype WithAriaInvalid = Pick<\n\tSelectHTMLAttributes<HTMLSelectElement>,\n\t\"aria-invalid\"\n>;\ntype SelectContextType = WithValidation &\n\tWithAriaInvalid & {\n\t\t/**\n\t\t * Ref for the trigger button.\n\t\t */\n\t\tref?: Ref<HTMLButtonElement>;\n\t\t/**\n\t\t * Event handler called when Select blurs.\n\t\t * @note this is a no-op for now until we can guarantee that it works identically to a native select onBlur\n\t\t */\n\t\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t} & Pick<ComponentProps<\"button\">, \"id\">;\n\nconst SelectContext = createContext<SelectContextType>({});\n\ntype SelectProps = Omit<\n\tComponentPropsWithoutRef<typeof SelectPrimitive.Root>,\n\t\"onValueChange\"\n> &\n\tWithValidation &\n\tWithAriaInvalid & {\n\t\t/**\n\t\t * Event handler called when the value changes.\n\t\t */\n\t\tonChange?: (value: string) => void;\n\t\t/**\n\t\t * Event handler called when Select blurs.\n\t\t * @note this is a no-op for now until we can guarantee that it works identically to a native select onBlur\n\t\t */\n\t\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t} & Pick<ComponentProps<\"button\">, \"id\">;\n\n/**\n * Displays a list of options for the user to pick from—triggered by a button.\n */\nconst Select = forwardRef<HTMLButtonElement, SelectProps>(\n\t(\n\t\t{\n\t\t\t\"aria-invalid\": _ariaInvalid,\n\t\t\tchildren,\n\t\t\tid,\n\t\t\tvalidation,\n\t\t\tonBlur,\n\t\t\tonChange,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\treturn (\n\t\t\t<SelectPrimitive.Root {...props} onValueChange={onChange}>\n\t\t\t\t<SelectContext.Provider\n\t\t\t\t\tvalue={{ \"aria-invalid\": _ariaInvalid, id, validation, onBlur, ref }}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</SelectContext.Provider>\n\t\t\t</SelectPrimitive.Root>\n\t\t);\n\t},\n);\nSelect.displayName = \"Select\";\n\n/**\n * A group of related options within a select menu. Similar to an html `<optgroup>` element.\n * Use in conjunction with Select.Label to ensure good accessibility via automatic labelling.\n */\nconst SelectGroup = SelectPrimitive.Group;\n\n/**\n * The part that reflects the selected value. By default the selected item's text will be rendered. if you require more control, you can instead control the select and pass your own children. It should not be styled to ensure correct positioning. An optional placeholder prop is also available for when the select has no value.\n */\nconst SelectValue = SelectPrimitive.Value;\n\ntype SelectTriggerProps = ComponentPropsWithoutRef<\n\ttypeof SelectPrimitive.Trigger\n> &\n\tWithAriaInvalid &\n\tWithValidation;\n\n/**\n * The button that toggles the select. The Select.Content will position itself adjacent to the trigger.\n */\nconst SelectTrigger = forwardRef<\n\tComponentRef<typeof SelectPrimitive.Trigger>,\n\tSelectTriggerProps\n>(\n\t(\n\t\t{\n\t\t\t\"aria-invalid\": ariaInValidProp,\n\t\t\tclassName,\n\t\t\tchildren,\n\t\t\tid: propId,\n\t\t\tvalidation: propValidation,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ctx = useContext(SelectContext);\n\t\tconst _ariaInvalid = ctx[\"aria-invalid\"] ?? ariaInValidProp;\n\t\tconst isInvalid = _ariaInvalid != null && _ariaInvalid !== \"false\";\n\t\tconst _validation = ctx.validation ?? propValidation;\n\t\tconst validation = isInvalid\n\t\t\t? \"error\"\n\t\t\t: typeof _validation === \"function\"\n\t\t\t\t? _validation()\n\t\t\t\t: _validation;\n\t\tconst ariaInvalid = _ariaInvalid ?? validation === \"error\";\n\t\tconst id = ctx.id ?? propId;\n\n\t\treturn (\n\t\t\t<SelectPrimitive.Trigger\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"h-9 text-sm\",\n\t\t\t\t\t\"border-form bg-form text-strong placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left\",\n\t\t\t\t\t\"hover:border-neutral-400\",\n\t\t\t\t\t\"focus:outline-none focus:ring-4 aria-expanded:ring-4\",\n\t\t\t\t\t\"focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent\",\n\t\t\t\t\t\"data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success\",\n\t\t\t\t\t\"data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning\",\n\t\t\t\t\t\"data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-validation={validation || undefined}\n\t\t\t\tid={id}\n\t\t\t\tref={composeRefs(ref, ctx.ref)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t<SelectPrimitive.Icon asChild>\n\t\t\t\t\t<CaretDown className=\"size-4 shrink-0\" weight=\"bold\" />\n\t\t\t\t</SelectPrimitive.Icon>\n\t\t\t</SelectPrimitive.Trigger>\n\t\t);\n\t},\n);\nSelectTrigger.displayName = \"SelectTrigger\";\n\nconst SelectScrollUpButton = forwardRef<\n\tComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.ScrollUpButton\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"flex cursor-default items-center justify-center py-1\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t<CaretUp className=\"size-4 shrink-0\" weight=\"bold\" />\n\t</SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = \"SelectScrollUpButton\";\n\nconst SelectScrollDownButton = forwardRef<\n\tComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.ScrollDownButton\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"flex cursor-default items-center justify-center py-1\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t<CaretDown className=\"size-4 shrink-0\" weight=\"bold\" />\n\t</SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName = \"SelectScrollDownButton\";\n\ntype SelectContentProps = ComponentPropsWithoutRef<\n\ttypeof SelectPrimitive.Content\n> & {\n\twidth?: \"trigger\" | \"content\";\n};\n\n/**\n * The component that pops out when the select is open as a portal adjacent to the trigger button.\n * It contains a scrolling viewport of the select items.\n */\nconst SelectContent = forwardRef<\n\tComponentRef<typeof SelectPrimitive.Content>,\n\tSelectContentProps\n>(({ className, children, position = \"popper\", width, ...props }, ref) => (\n\t<SelectPrimitive.Portal>\n\t\t<SelectPrimitive.Content\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"border-popover 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 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md\",\n\t\t\t\t\"bg-popover\",\n\t\t\t\tposition === \"popper\" &&\n\t\t\t\t\t\"data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-[var(--radix-select-content-available-height)]\",\n\t\t\t\twidth === \"trigger\" && \"w-[var(--radix-select-trigger-width)]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tposition={position}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SelectScrollUpButton />\n\t\t\t<SelectPrimitive.Viewport\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"p-1\",\n\t\t\t\t\tposition === \"popper\" &&\n\t\t\t\t\t\t\"h-[var(--radix-select-trigger-height)] w-full\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</SelectPrimitive.Viewport>\n\t\t\t<SelectScrollDownButton />\n\t\t</SelectPrimitive.Content>\n\t</SelectPrimitive.Portal>\n));\nSelectContent.displayName = \"SelectContent\";\n\n/**\n * Used to render the label of a group. It won't be focusable using arrow keys.\n */\nconst SelectLabel = forwardRef<\n\tComponentRef<typeof SelectPrimitive.Label>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.Label\n\t\tref={ref}\n\t\tclassName={cx(\"px-2 py-1.5 text-sm font-semibold\", className)}\n\t\t{...props}\n\t/>\n));\nSelectLabel.displayName = \"SelectLabel\";\n\n/**\n * An option within a select menu. Similar to an html `<option>` element.\n * Contains a `value` prop that will be passed to the `onChange` handler of the `Select` component when selected.\n * Displays the children as the option's text.\n */\nconst SelectItem = forwardRef<\n\tComponentRef<typeof SelectPrimitive.Item>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n\t<SelectPrimitive.Item\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm outline-none\",\n\t\t\t\"focus:bg-popover-hover\",\n\t\t\t\"data-disabled:pointer-events-none data-disabled:opacity-50\",\n\t\t\t\"data-state-checked:bg-filled-accent data-state-checked:text-on-filled\",\n\t\t\t\"focus:data-state-checked:bg-filled-accent\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n\t\t<SelectPrimitive.ItemIndicator className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t<Check className=\"size-4 shrink-0\" weight=\"bold\" />\n\t\t</SelectPrimitive.ItemIndicator>\n\t</SelectPrimitive.Item>\n));\nSelectItem.displayName = \"SelectItem\";\n\n/**\n * Used to visually separate items in the select.\n */\nconst SelectSeparator = forwardRef<\n\tComponentRef<typeof Separator>,\n\tComponentPropsWithoutRef<typeof Separator>\n>(({ className, ...props }, ref) => (\n\t<Separator\n\t\tref={ref}\n\t\tclassName={cx(\"-mx-1 my-1 h-px w-auto\", className)}\n\t\t{...props}\n\t/>\n));\nSelectSeparator.displayName = \"SelectSeparator\";\n\nexport {\n\tSelect,\n\tSelectGroup,\n\tSelectValue,\n\tSelectTrigger,\n\tSelectContent,\n\tSelectLabel,\n\tSelectItem,\n\tSelectSeparator,\n\tSelectScrollUpButton,\n\tSelectScrollDownButton,\n};\n"],"mappings":"wHAAA,OAAS,aAAAA,MAAiB,kCAC1B,OAAS,WAAAC,MAAe,gCACxB,OAAS,SAAAC,MAAa,8BACtB,UAAYC,MAAqB,yBASjC,OAAS,iBAAAC,EAAe,cAAAC,EAAY,cAAAC,MAAkB,QA4DlD,cAAAC,EA2DD,QAAAC,MA3DC,oBArCJ,IAAMC,EAAgBC,EAAiC,CAAC,CAAC,EAsBnDC,EAASC,EACd,CACC,CACC,eAAgBC,EAChB,SAAAC,EACA,GAAAC,EACA,WAAAC,EACA,OAAAC,EACA,SAAAC,EACA,GAAGC,CACJ,EACAC,IAGCb,EAAiB,OAAhB,CAAsB,GAAGY,EAAO,cAAeD,EAC/C,SAAAX,EAACE,EAAc,SAAd,CACA,MAAO,CAAE,eAAgBI,EAAc,GAAAE,EAAI,WAAAC,EAAY,OAAAC,EAAQ,IAAAG,CAAI,EAElE,SAAAN,EACF,EACD,CAGH,EACAH,EAAO,YAAc,SAMrB,IAAMU,EAA8B,QAK9BC,EAA8B,QAW9BC,EAAgBX,EAIrB,CACC,CACC,eAAgBY,EAChB,UAAAC,EACA,SAAAX,EACA,GAAIY,EACJ,WAAYC,EACZ,GAAGR,CACJ,EACAC,IACI,CACJ,IAAMQ,EAAMC,EAAWpB,CAAa,EAC9BI,EAAee,EAAI,cAAc,GAAKJ,EACtCM,EAAYjB,GAAgB,MAAQA,IAAiB,QACrDkB,EAAcH,EAAI,YAAcD,EAChCX,EAAac,EAChB,QACA,OAAOC,GAAgB,WACtBA,EAAY,EACZA,EACEC,EAAcnB,GAAgBG,IAAe,QAC7CD,EAAKa,EAAI,IAAMF,EA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F,EAEC,SAAA1B,EACF,EACAP,EAAC+B,EAAA,EAAuB,GACzB,EACD,CACA,EACDC,EAAc,YAAc,gBAK5B,IAAMG,EAAc9B,EAGlB,CAAC,CAAE,UAAAa,EAAW,GAAGN,CAAM,EAAGC,IAC3Bb,EAAiB,QAAhB,CACA,IAAKa,EACL,UAAWa,EAAG,oCAAqCR,CAAS,EAC3D,GAAGN,EACL,CACA,EACDuB,EAAY,YAAc,cAO1B,IAAMC,EAAa/B,EAGjB,CAAC,CAAE,UAAAa,EAAW,SAAAX,EAAU,GAAGK,CAAM,EAAGC,IACrCZ,EAAiB,OAAhB,CACA,IAAKY,EACL,UAAWa,EACV,6GACA,yBACA,6DACA,wEACA,4CACAR,CACD,EACC,GAAGN,EAEJ,UAAAZ,EAAiB,WAAhB,CAA0B,SAAAO,EAAS,EACpCP,EAAiB,gBAAhB,CAA8B,UAAU,gEACxC,SAAAA,EAACqC,EAAA,CAAM,UAAU,kBAAkB,OAAO,OAAO,EAClD,GACD,CACA,EACDD,EAAW,YAAc,aAKzB,IAAME,EAAkBjC,EAGtB,CAAC,CAAE,UAAAa,EAAW,GAAGN,CAAM,EAAGC,IAC3Bb,EAACuC,EAAA,CACA,IAAK1B,EACL,UAAWa,EAAG,yBAA0BR,CAAS,EAChD,GAAGN,EACL,CACA,EACD0B,EAAgB,YAAc","names":["CaretDown","CaretUp","Check","SelectPrimitive","createContext","forwardRef","useContext","jsx","jsxs","SelectContext","createContext","Select","forwardRef","_ariaInvalid","children","id","validation","onBlur","onChange","props","ref","SelectGroup","SelectValue","SelectTrigger","ariaInValidProp","className","propId","propValidation","ctx","useContext","isInvalid","_validation","ariaInvalid","cx","composeRefs","CaretDown","SelectScrollUpButton","CaretUp","SelectScrollDownButton","SelectContent","position","width","SelectLabel","SelectItem","Check","SelectSeparator","Separator"]}
@@ -0,0 +1,156 @@
1
+ import * as _radix_ui_react_separator from '@radix-ui/react-separator';
2
+ import * as react from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ import * as Primitive from '@ariakit/react';
5
+ import { W as WithAsChild } from './as-child-Cvu56SuO.js';
6
+ import { W as WithValidation } from './types-Cs5ck3Vt.js';
7
+
8
+ type ComboboxProps = Primitive.ComboboxProviderProps;
9
+ /**
10
+ * Root component for a combobox. Provides a combobox store that controls the state of Combobox components.
11
+ *
12
+ * @example
13
+ * <Combobox>
14
+ * <ComboboxInput />
15
+ * <ComboboxContent>
16
+ * <ComboboxItem value="Apple" />
17
+ * <ComboboxItem value="Banana" />
18
+ * </ComboboxContent>
19
+ * </Combobox>
20
+ */
21
+ declare const Combobox: ({ children, ...props }: ComboboxProps) => react_jsx_runtime.JSX.Element;
22
+ type ComboboxInputProps = Omit<Primitive.ComboboxProps, "render"> & WithValidation;
23
+ /**
24
+ * Renders a combobox input element that can be used to filter a list of items.
25
+ *
26
+ * @example
27
+ * <Combobox>
28
+ * <ComboboxInput />
29
+ * <ComboboxContent>
30
+ * <ComboboxItem value="Apple" />
31
+ * <ComboboxItem value="Banana" />
32
+ * </ComboboxContent>
33
+ * </Combobox>
34
+ */
35
+ declare const ComboboxInput: react.ForwardRefExoticComponent<Omit<ComboboxInputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
36
+ type ComboboxContentProps = Omit<Primitive.ComboboxPopoverProps, "render"> & WithAsChild;
37
+ /**
38
+ * Renders a popover that contains combobox content, e.g. ComboboxItems, ComboboxGroups, and ComboboxSeparators.
39
+ *
40
+ * @example
41
+ * <Combobox>
42
+ * <ComboboxInput />
43
+ * <ComboboxContent>
44
+ * <ComboboxItem value="Apple" />
45
+ * <ComboboxItem value="Banana" />
46
+ * </ComboboxContent>
47
+ * </Combobox>
48
+ */
49
+ declare const ComboboxContent: react.ForwardRefExoticComponent<Omit<ComboboxContentProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
50
+ type ComboboxItemProps = Omit<Primitive.ComboboxItemProps, "render"> & WithAsChild;
51
+ /**
52
+ * Renders a combobox item inside a ComboboxContent component.
53
+ *
54
+ * @example
55
+ * <Combobox>
56
+ * <ComboboxInput />
57
+ * <ComboboxContent>
58
+ * <ComboboxItem value="Apple" />
59
+ * <ComboboxItem value="Banana" />
60
+ * <ComboboxItem value="Orange" />
61
+ * </ComboboxContent>
62
+ * </Combobox>
63
+ */
64
+ declare const ComboboxItem: react.ForwardRefExoticComponent<Omit<ComboboxItemProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
65
+ type ComboboxGroupProps = Omit<Primitive.ComboboxGroupProps, "render"> & WithAsChild;
66
+ /**
67
+ * Renders a group for ComboboxItem elements.
68
+ *
69
+ * Optionally, a ComboboxGroupLabel can be rendered as a child to provide a label for the group.
70
+ *
71
+ * You should only reach for this component when it semantically makes sense to group items together, such as when a label is needed.
72
+ *
73
+ * @example
74
+ * <Combobox>
75
+ * <ComboboxInput />
76
+ * <ComboboxContent>
77
+ * <ComboboxGroup>
78
+ * <ComboboxGroupLabel>Fruits</ComboboxGroupLabel>
79
+ * <ComboboxItem value="Apple" />
80
+ * <ComboboxItem value="Banana" />
81
+ * </ComboboxGroup>
82
+ * </ComboboxContent>
83
+ * </Combobox>
84
+ */
85
+ declare const ComboboxGroup: react.ForwardRefExoticComponent<Omit<ComboboxGroupProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
86
+ type ComboboxGroupLabelProps = Omit<Primitive.ComboboxGroupLabelProps, "render"> & WithAsChild;
87
+ /**
88
+ * Renders a label in a combobox group.
89
+ *
90
+ * This component should be wrapped with ComboboxGroup so the aria-labelledby is correctly set on the group element.
91
+ *
92
+ * You should only reach for this component when it semantically makes sense to group items together, such as when a label is needed.
93
+ *
94
+ * @example
95
+ * <Combobox>
96
+ * <ComboboxInput />
97
+ * <ComboboxContent>
98
+ * <ComboboxGroup>
99
+ * <ComboboxGroupLabel>Fruits</ComboboxGroupLabel>
100
+ * <ComboboxItem value="Apple" />
101
+ * <ComboboxItem value="Banana" />
102
+ * </ComboboxGroup>
103
+ * </ComboboxContent>
104
+ * </Combobox>
105
+ */
106
+ declare const ComboboxGroupLabel: react.ForwardRefExoticComponent<Omit<ComboboxGroupLabelProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
107
+ type ComboboxItemValueProps = Omit<Primitive.ComboboxItemValueProps<"span">, "render"> & WithAsChild;
108
+ /**
109
+ * Highlights the match between the current ComboboxInput value (userValue) and parent ComboboxItem value.
110
+ *
111
+ * Renders a span element with the combobox item value as children.
112
+ * The value is split into span elements.
113
+ * Portions of the value matching the user input will have a data-user-value attribute, while the rest will have a data-autocomplete-value attribute.
114
+ *
115
+ * Should only be used as a child of ComboboxItem.
116
+ * The item value is automatically set to the value of the closest ComboboxItem component's value prop.
117
+ * The user input value is automatically set to the combobox store's value state.
118
+ * Both values can be overridden by providing the value and userValue props, respectively.
119
+ *
120
+ * @example
121
+ * <Combobox>
122
+ * <ComboboxInput />
123
+ * <ComboboxContent>
124
+ * <ComboboxItem value="Apple">
125
+ * 🍎
126
+ * <ComboboxItemValue>
127
+ * </ComboboxItemValue>
128
+ * <ComboboxItem value="Banana">
129
+ * 🍌
130
+ * <ComboboxItemValue>
131
+ * </ComboboxItemValue>
132
+ * </ComboboxContent>
133
+ * </Combobox>
134
+ */
135
+ declare const ComboboxItemValue: react.ForwardRefExoticComponent<Omit<ComboboxItemValueProps, "ref"> & react.RefAttributes<HTMLSpanElement>>;
136
+ /**
137
+ * Renders a separator between ComboboxItems or ComboboxGroups.
138
+ *
139
+ * @example
140
+ * <Combobox>
141
+ * <ComboboxInput />
142
+ * <ComboboxContent>
143
+ * <ComboboxGroup>
144
+ * <ComboboxItem value="Apple" />
145
+ * <ComboboxItem value="Banana" />
146
+ * </ComboboxGroup>
147
+ * <ComboboxSeparator />
148
+ * <ComboboxItem>
149
+ * Click me!
150
+ * </ComboboxItem>
151
+ * </ComboboxContent>
152
+ * </Combobox>
153
+ */
154
+ declare const ComboboxSeparator: react.ForwardRefExoticComponent<Omit<Omit<_radix_ui_react_separator.SeparatorProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
155
+
156
+ export { Combobox, ComboboxContent, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxItemValue, ComboboxSeparator };
@@ -0,0 +1,2 @@
1
+ import{b as f}from"./chunk-R4XXPIT2.js";import{a as d}from"./chunk-AZ56JGNY.js";import*as t from"@ariakit/react";import{Slot as l}from"@radix-ui/react-slot";import{createContext as h,forwardRef as s}from"react";import{jsx as r}from"react/jsx-runtime";var I=({children:o,...e})=>r(t.ComboboxProvider,{...e,children:o}),C=s(({"aria-invalid":o,autoComplete:e="list",autoSelect:i="always",className:m,validation:a,...n},b)=>{let p=o!=null&&o!=="false"?"error":typeof a=="function"?a():a;return r(t.Combobox,{"aria-invalid":o??p==="error",autoComplete:e,autoSelect:i,className:d("pointer-coarse:text-base h-9 text-sm","bg-form relative block w-full rounded-md border px-3 py-2 border-form text-strong","placeholder:text-placeholder","aria-disabled:opacity-50","hover:border-neutral-400","focus:outline-none focus:ring-4 aria-expanded:ring-4","focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent","data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success","data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning","data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger","autofill:shadow-[inset_0_0_0px_1000px_hsl(var(--blue-50))] autofill:bg-blue-50 autofill:[-webkit-text-fill-color:hsl(var(--text-strong))]",m),"data-validation":p||void 0,ref:b,...n})});C.displayName="ComboboxInput";var c=s(({asChild:o=!1,children:e,className:i,sameWidth:m=!0,unmountOnHide:a=!0,...n},b)=>r(t.ComboboxPopover,{className:d("border-popover bg-popover relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md p-1 my-1",i),ref:b,render:o?({ref:u,...p})=>r(l,{ref:u,...p}):void 0,sameWidth:m,unmountOnHide:a,...n,children:e}));c.displayName="ComboboxContent";var w=h(void 0),v=s(({asChild:o=!1,children:e,className:i,focusOnHover:m=!0,setValueOnClick:a=!0,value:n,...b},u)=>r(w.Provider,{value:n,children:r(t.ComboboxItem,{className:d("cursor-pointer rounded px-2 py-1.5 text-sm flex min-w-0 gap-2 items-center","data-active-item:bg-popover-hover","aria-disabled:opacity-50",i),focusOnHover:m,ref:u,render:o?({ref:p,...x})=>r(l,{ref:p,...x}):void 0,value:n,...b,children:e})}));v.displayName="ComboboxItem";var P=s(({asChild:o=!1,children:e,className:i,...m},a)=>r(t.ComboboxGroup,{className:d("",i),ref:a,render:o?({ref:n,...b})=>r(l,{ref:n,...b}):void 0,...m,children:e}));P.displayName="ComboboxGroup";var y=s(({asChild:o=!1,children:e,className:i,...m},a)=>r(t.ComboboxGroupLabel,{className:d("text-muted px-2 py-1 text-xs font-medium",i),ref:a,render:o?({ref:n,...b})=>r(l,{ref:n,...b}):void 0,...m,children:e}));y.displayName="ComboboxGroupLabel";var G=s(({asChild:o=!1,className:e,...i},m)=>r(t.ComboboxItemValue,{className:d("data-[user-value]:*:font-bold flex-1 shrink-0 text-strong font-normal",e),ref:m,render:o?({ref:a,...n})=>r(l,{ref:a,...n}):void 0,...i})),g=s(({className:o,...e},i)=>r(f,{ref:i,className:d("-mx-1.25 my-1 w-auto",o),...e}));g.displayName="ComboboxSeparator";export{I as Combobox,c as ComboboxContent,P as ComboboxGroup,y as ComboboxGroupLabel,C as ComboboxInput,v as ComboboxItem,G as ComboboxItemValue,g as ComboboxSeparator};
2
+ //# sourceMappingURL=combobox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/combobox/combobox.tsx"],"sourcesContent":["import * as Primitive from \"@ariakit/react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n\ttype ComponentPropsWithoutRef,\n\ttype ComponentRef,\n\ttype ElementRef,\n\tcreateContext,\n\tforwardRef,\n} from \"react\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport type { WithValidation } from \"../input/types.js\";\nimport { Separator } from \"../separator/separator.js\";\n\ntype ComboboxProps = Primitive.ComboboxProviderProps;\n\n/**\n * Root component for a combobox. Provides a combobox store that controls the state of Combobox components.\n *\n * @example\n * <Combobox>\n * <ComboboxInput />\n * <ComboboxContent>\n * <ComboboxItem value=\"Apple\" />\n * <ComboboxItem value=\"Banana\" />\n * </ComboboxContent>\n * </Combobox>\n */\nconst Combobox = ({ children, ...props }: ComboboxProps) => {\n\treturn (\n\t\t<Primitive.ComboboxProvider {...props}>\n\t\t\t{children}\n\t\t</Primitive.ComboboxProvider>\n\t);\n};\n\ntype ComboboxInputProps = Omit<\n\tPrimitive.ComboboxProps,\n\t\"render\" // we don't support a render prop for the combobox input\n> &\n\tWithValidation;\n\n/**\n * Renders a combobox input element that can be used to filter a list of items.\n *\n * @example\n * <Combobox>\n * <ComboboxInput />\n * <ComboboxContent>\n * <ComboboxItem value=\"Apple\" />\n * <ComboboxItem value=\"Banana\" />\n * </ComboboxContent>\n * </Combobox>\n */\nconst ComboboxInput = forwardRef<ComponentRef<\"input\">, ComboboxInputProps>(\n\t(\n\t\t{\n\t\t\t\"aria-invalid\": _ariaInvalid,\n\t\t\tautoComplete = \"list\",\n\t\t\tautoSelect = \"always\",\n\t\t\tclassName,\n\t\t\tvalidation: _validation,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst isInvalid = _ariaInvalid != null && _ariaInvalid !== \"false\";\n\t\tconst validation = isInvalid\n\t\t\t? \"error\"\n\t\t\t: typeof _validation === \"function\"\n\t\t\t\t? _validation()\n\t\t\t\t: _validation;\n\t\tconst ariaInvalid = _ariaInvalid ?? validation === \"error\";\n\n\t\treturn (\n\t\t\t<Primitive.Combobox\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t\tautoComplete={autoComplete}\n\t\t\t\tautoSelect={autoSelect}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"pointer-coarse:text-base h-9 text-sm\",\n\t\t\t\t\t\"bg-form relative block w-full rounded-md border px-3 py-2 border-form text-strong\",\n\t\t\t\t\t\"placeholder:text-placeholder\",\n\t\t\t\t\t\"aria-disabled:opacity-50\",\n\t\t\t\t\t\"hover:border-neutral-400\",\n\t\t\t\t\t\"focus:outline-none focus:ring-4 aria-expanded:ring-4\",\n\t\t\t\t\t\"focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent\",\n\t\t\t\t\t\"data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success\",\n\t\t\t\t\t\"data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning\",\n\t\t\t\t\t\"data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger\",\n\t\t\t\t\t\"autofill:shadow-[inset_0_0_0px_1000px_hsl(var(--blue-50))] autofill:bg-blue-50 autofill:[-webkit-text-fill-color:hsl(var(--text-strong))]\", // Autofill styling on the input itself and any children with autofill styling\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-validation={validation || undefined}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nComboboxInput.displayName = \"ComboboxInput\";\n\ntype ComboboxContentProps = Omit<Primitive.ComboboxPopoverProps, \"render\"> &\n\tWithAsChild;\n\n/**\n * Renders a popover that contains combobox content, e.g. ComboboxItems, ComboboxGroups, and ComboboxSeparators.\n *\n * @example\n * <Combobox>\n * <ComboboxInput />\n * <ComboboxContent>\n * <ComboboxItem value=\"Apple\" />\n * <ComboboxItem value=\"Banana\" />\n * </ComboboxContent>\n * </Combobox>\n */\nconst ComboboxContent = forwardRef<\n\tComponentRef<typeof Primitive.ComboboxPopover>,\n\tComboboxContentProps\n>(\n\t(\n\t\t{\n\t\t\tasChild = false,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tsameWidth = true,\n\t\t\tunmountOnHide = true,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\treturn (\n\t\t\t<Primitive.ComboboxPopover\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"border-popover bg-popover relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md p-1 my-1\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={ref}\n\t\t\t\trender={\n\t\t\t\t\tasChild\n\t\t\t\t\t\t? ({ ref, ...childProps }) => <Slot ref={ref} {...childProps} />\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tsameWidth={sameWidth}\n\t\t\t\tunmountOnHide={unmountOnHide}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Primitive.ComboboxPopover>\n\t\t);\n\t},\n);\nComboboxContent.displayName = \"ComboboxContent\";\n\ntype ComboboxItemProps = Omit<Primitive.ComboboxItemProps, \"render\"> &\n\tWithAsChild;\n\nconst ComboboxItemValueContext = createContext<string | undefined>(undefined);\n\n/**\n * Renders a combobox item inside a ComboboxContent component.\n *\n * @example\n * <Combobox>\n * <ComboboxInput />\n * <ComboboxContent>\n * <ComboboxItem value=\"Apple\" />\n * <ComboboxItem value=\"Banana\" />\n * <ComboboxItem value=\"Orange\" />\n * </ComboboxContent>\n * </Combobox>\n */\nconst ComboboxItem = forwardRef<\n\tComponentRef<typeof Primitive.ComboboxItem>,\n\tComboboxItemProps\n>(\n\t(\n\t\t{\n\t\t\tasChild = false,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tfocusOnHover = true,\n\t\t\tsetValueOnClick = true,\n\t\t\tvalue,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\treturn (\n\t\t\t<ComboboxItemValueContext.Provider value={value}>\n\t\t\t\t<Primitive.ComboboxItem\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\"cursor-pointer rounded px-2 py-1.5 text-sm flex min-w-0 gap-2 items-center\",\n\t\t\t\t\t\t\"data-active-item:bg-popover-hover\",\n\t\t\t\t\t\t\"aria-disabled:opacity-50\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\tfocusOnHover={focusOnHover}\n\t\t\t\t\tref={ref}\n\t\t\t\t\trender={\n\t\t\t\t\t\tasChild\n\t\t\t\t\t\t\t? ({ ref, ...childProps }) => <Slot ref={ref} {...childProps} />\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Primitive.ComboboxItem>\n\t\t\t</ComboboxItemValueContext.Provider>\n\t\t);\n\t},\n);\nComboboxItem.displayName = \"ComboboxItem\";\n\ntype ComboboxGroupProps = Omit<Primitive.ComboboxGroupProps, \"render\"> &\n\tWithAsChild;\n\n/**\n * Renders a group for ComboboxItem elements.\n *\n * Optionally, a ComboboxGroupLabel can be rendered as a child to provide a label for the group.\n *\n * You should only reach for this component when it semantically makes sense to group items together, such as when a label is needed.\n *\n * @example\n * <Combobox>\n * <ComboboxInput />\n * <ComboboxContent>\n * <ComboboxGroup>\n * <ComboboxGroupLabel>Fruits</ComboboxGroupLabel>\n * <ComboboxItem value=\"Apple\" />\n * <ComboboxItem value=\"Banana\" />\n * </ComboboxGroup>\n * </ComboboxContent>\n * </Combobox>\n */\nconst ComboboxGroup = forwardRef<\n\tComponentRef<typeof Primitive.ComboboxGroup>,\n\tComboboxGroupProps\n>(({ asChild = false, children, className, ...props }, ref) => {\n\treturn (\n\t\t<Primitive.ComboboxGroup\n\t\t\tclassName={cx(\"\", className)}\n\t\t\tref={ref}\n\t\t\trender={\n\t\t\t\tasChild\n\t\t\t\t\t? ({ ref, ...childProps }) => <Slot ref={ref} {...childProps} />\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Primitive.ComboboxGroup>\n\t);\n});\nComboboxGroup.displayName = \"ComboboxGroup\";\n\ntype ComboboxGroupLabelProps = Omit<\n\tPrimitive.ComboboxGroupLabelProps,\n\t\"render\"\n> &\n\tWithAsChild;\n\n/**\n * Renders a label in a combobox group.\n *\n * This component should be wrapped with ComboboxGroup so the aria-labelledby is correctly set on the group element.\n *\n * You should only reach for this component when it semantically makes sense to group items together, such as when a label is needed.\n *\n * @example\n * <Combobox>\n * <ComboboxInput />\n * <ComboboxContent>\n * <ComboboxGroup>\n * <ComboboxGroupLabel>Fruits</ComboboxGroupLabel>\n * <ComboboxItem value=\"Apple\" />\n * <ComboboxItem value=\"Banana\" />\n * </ComboboxGroup>\n * </ComboboxContent>\n * </Combobox>\n */\nconst ComboboxGroupLabel = forwardRef<\n\tComponentRef<typeof Primitive.ComboboxGroupLabel>,\n\tComboboxGroupLabelProps\n>(({ asChild = false, children, className, ...props }, ref) => {\n\treturn (\n\t\t<Primitive.ComboboxGroupLabel\n\t\t\tclassName={cx(\"text-muted px-2 py-1 text-xs font-medium\", className)}\n\t\t\tref={ref}\n\t\t\trender={\n\t\t\t\tasChild\n\t\t\t\t\t? ({ ref, ...childProps }) => <Slot ref={ref} {...childProps} />\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Primitive.ComboboxGroupLabel>\n\t);\n});\nComboboxGroupLabel.displayName = \"ComboboxGroupLabel\";\n\ntype ComboboxItemValueProps = Omit<\n\tPrimitive.ComboboxItemValueProps<\"span\">,\n\t\"render\"\n> &\n\tWithAsChild;\n\n/**\n * Highlights the match between the current ComboboxInput value (userValue) and parent ComboboxItem value.\n *\n * Renders a span element with the combobox item value as children.\n * The value is split into span elements.\n * Portions of the value matching the user input will have a data-user-value attribute, while the rest will have a data-autocomplete-value attribute.\n *\n * Should only be used as a child of ComboboxItem.\n * The item value is automatically set to the value of the closest ComboboxItem component's value prop.\n * The user input value is automatically set to the combobox store's value state.\n * Both values can be overridden by providing the value and userValue props, respectively.\n *\n * @example\n * <Combobox>\n * <ComboboxInput />\n * <ComboboxContent>\n * <ComboboxItem value=\"Apple\">\n * 🍎\n * <ComboboxItemValue>\n * </ComboboxItemValue>\n * <ComboboxItem value=\"Banana\">\n * 🍌\n * <ComboboxItemValue>\n * </ComboboxItemValue>\n * </ComboboxContent>\n * </Combobox>\n */\nconst ComboboxItemValue = forwardRef<\n\tComponentRef<typeof Primitive.ComboboxItemValue>,\n\tComboboxItemValueProps\n>(({ asChild = false, className, ...props }, ref) => {\n\treturn (\n\t\t<Primitive.ComboboxItemValue\n\t\t\tclassName={cx(\n\t\t\t\t\"data-[user-value]:*:font-bold flex-1 shrink-0 text-strong font-normal\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tref={ref}\n\t\t\trender={\n\t\t\t\tasChild\n\t\t\t\t\t? ({ ref, ...childProps }) => <Slot ref={ref} {...childProps} />\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\n/**\n * Renders a separator between ComboboxItems or ComboboxGroups.\n *\n * @example\n * <Combobox>\n * <ComboboxInput />\n * <ComboboxContent>\n * <ComboboxGroup>\n * <ComboboxItem value=\"Apple\" />\n * <ComboboxItem value=\"Banana\" />\n * </ComboboxGroup>\n * <ComboboxSeparator />\n * <ComboboxItem>\n * Click me!\n * </ComboboxItem>\n * </ComboboxContent>\n * </Combobox>\n */\nconst ComboboxSeparator = forwardRef<\n\tElementRef<typeof Separator>,\n\tComponentPropsWithoutRef<typeof Separator>\n>(({ className, ...props }, ref) => (\n\t<Separator\n\t\tref={ref}\n\t\tclassName={cx(\"-mx-1.25 my-1 w-auto\", className)}\n\t\t{...props}\n\t/>\n));\nComboboxSeparator.displayName = \"ComboboxSeparator\";\n\nexport {\n\t//,\n\tCombobox,\n\tComboboxContent,\n\tComboboxGroup,\n\tComboboxGroupLabel,\n\tComboboxInput,\n\tComboboxItem,\n\tComboboxItemValue,\n\tComboboxSeparator,\n};\n"],"mappings":"gFAAA,UAAYA,MAAe,iBAC3B,OAAS,QAAAC,MAAY,uBACrB,OAIC,iBAAAC,EACA,cAAAC,MACM,QAsBL,cAAAC,MAAA,oBAFF,IAAMC,EAAW,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAM,IAErCH,EAAW,mBAAV,CAA4B,GAAGG,EAC9B,SAAAD,EACF,EAsBIE,EAAgBC,EACrB,CACC,CACC,eAAgBC,EAChB,aAAAC,EAAe,OACf,WAAAC,EAAa,SACb,UAAAC,EACA,WAAYC,EACZ,GAAGP,CACJ,EACAQ,IACI,CAEJ,IAAMC,EADYN,GAAgB,MAAQA,IAAiB,QAExD,QACA,OAAOI,GAAgB,WACtBA,EAAY,EACZA,EAGJ,OACCV,EAAW,WAAV,CACA,eAJkBM,GAAgBM,IAAe,QAKjD,aAAcL,EACd,WAAYC,EACZ,UAAWK,EACV,uCACA,oFACA,+BACA,2BACA,2BACA,uDACA,kHACA,iQACA,iQACA,kPACA,4IACAJ,CACD,EACA,kBAAiBG,GAAc,OAC/B,IAAKD,EACJ,GAAGR,EACL,CAEF,CACD,EACAC,EAAc,YAAc,gBAiB5B,IAAMU,EAAkBT,EAIvB,CACC,CACC,QAAAU,EAAU,GACV,SAAAb,EACA,UAAAO,EACA,UAAAO,EAAY,GACZ,cAAAC,EAAgB,GAChB,GAAGd,CACJ,EACAQ,IAGCX,E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AErDX,EAAW,qBAAV,CACA,UAAWa,EAAG,2CAA4CJ,CAAS,EACnE,IAAKE,EACL,OACCI,EACG,CAAC,CAAE,IAAAJ,EAAK,GAAGO,CAAW,IAAMlB,EAACmB,EAAA,CAAK,IAAKR,EAAM,GAAGO,EAAY,EAC5D,OAEH,GAAGf,EAEH,SAAAD,EACF,CAED,EACDyB,EAAmB,YAAc,qBAmCjC,IAAMC,EAAoBvB,EAGxB,CAAC,CAAE,QAAAU,EAAU,GAAO,UAAAN,EAAW,GAAGN,CAAM,EAAGQ,IAE3CX,EAAW,oBAAV,CACA,UAAWa,EACV,wEACAJ,CACD,EACA,IAAKE,EACL,OACCI,EACG,CAAC,CAAE,IAAAJ,EAAK,GAAGO,CAAW,IAAMlB,EAACmB,EAAA,CAAK,IAAKR,EAAM,GAAGO,EAAY,EAC5D,OAEH,GAAGf,EACL,CAED,EAoBK0B,EAAoBxB,EAGxB,CAAC,CAAE,UAAAI,EAAW,GAAGN,CAAM,EAAGQ,IAC3BX,EAAC8B,EAAA,CACA,IAAKnB,EACL,UAAWE,EAAG,uBAAwBJ,CAAS,EAC9C,GAAGN,EACL,CACA,EACD0B,EAAkB,YAAc","names":["Primitive","Slot","createContext","forwardRef","jsx","Combobox","children","props","ComboboxInput","forwardRef","_ariaInvalid","autoComplete","autoSelect","className","_validation","ref","validation","cx","ComboboxContent","asChild","sameWidth","unmountOnHide","childProps","Slot","ComboboxItemValueContext","createContext","ComboboxItem","focusOnHover","setValueOnClick","value","ComboboxGroup","ComboboxGroupLabel","ComboboxItemValue","ComboboxSeparator","Separator"]}
package/dist/flag.d.ts CHANGED
@@ -4,7 +4,7 @@ import { ComponentProps } from 'react';
4
4
  /** All valid values for a flag
5
5
  * @see https://www.flagpack.xyz/docs/flag-index
6
6
  */
7
- declare const countryCodes: readonly ["004", "008", "010", "016", "016", "020", "024", "028", "031", "032", "040", "044", "048", "050", "051", "052", "056", "060", "064", "068", "070", "072", "074", "076", "084", "086", "090", "092", "096", "100", "104", "108", "112", "116", "120", "124", "132", "136", "140", "144", "148", "152", "156", "158", "162", "166", "170", "174", "178", "180", "184", "188", "191", "192", "196", "203", "204", "208", "212", "214", "218", "222", "226", "231", "232", "233", "234", "238", "239", "242", "246", "248", "250", "254", "258", "260", "262", "266", "268", "270", "275", "276", "288", "292", "296", "300", "304", "308", "312", "316", "320", "324", "328", "332", "334", "336", "340", "344", "348", "352", "356", "360", "364", "368", "372", "376", "380", "384", "388", "392", "398", "400", "404", "408", "410", "414", "417", "418", "422", "426", "428", "430", "434", "438", "440", "442", "446", "450", "454", "458", "462", "466", "470", "474", "478", "480", "484", "492", "496", "498", "499", "500", "504", "508", "512", "516", "520", "524", "528", "531", "533", "534", "540", "548", "554", "558", "562", "566", "570", "574", "578", "580", "581", "583", "584", "585", "586", "591", "598", "600", "604", "608", "612", "616", "620", "624", "626", "630", "634", "638", "642", "643", "646", "652", "654", "659", "660", "662", "663", "666", "670", "674", "678", "682", "686", "688", "690", "694", "702", "703", "704", "705", "706", "710", "716", "724", "728", "729", "732", "740", "744", "748", "752", "756", "760", "762", "764", "768", "772", "776", "780", "784", "788", "792", "795", "796", "798", "800", "804", "807", "818", "831", "832", "833", "834", "836", "840", "850", "854", "858", "860", "862", "876", "882", "887", "894", "ABW", "AD", "AE", "AF", "AFG", "AFRUN", "AG", "AGO", "AI", "AIA", "AL", "ALA", "ALB", "AM", "AMS", "AND", "AO", "AQ", "AR", "ARE", "ARG", "ARM", "AS", "ASM", "AT", "ATA", "ATF", "ATG", "AU", "AUS", "AUT", "AW", "AX", "AZ", "AZE", "BA", "BB", "BD", "BDI", "BE", "BEL", "BEN", "BF", "BFA", "BG", "BGD", "BGR", "BH", "BHR", "BHS", "BI", "BIH", "BJ", "BL", "BLM", "BLR", "BLZ", "BM", "BMU", "BN", "BO", "BOL", "BQ-BO", "BQ-SA", "BQ-SE", "BR", "BRA", "BRB", "BRN", "BS", "BT", "BTN", "BV", "BVT", "BW", "BWA", "BY", "BZ", "CA", "CAF", "CAN", "CC", "CCK", "CD", "CF", "CG", "CH", "CHE", "CHL", "CHN", "CI", "CIV", "CK", "CL", "CM", "CMR", "CN", "CO", "COD", "COG", "COK", "COL", "COM", "CPV", "CR", "CRI", "CU", "CUB", "CUW", "CV", "CW", "CX", "CXR", "CY", "CYM", "CYP", "CZ", "CZE", "DE", "DEU", "DJ", "DJI", "DK", "DM", "DMA", "DNK", "DO", "DOM", "EC", "ECU", "EE", "EG", "EGY", "EH", "ER", "ERI", "ES", "ESH", "ESP", "EST", "ET", "ETH", "EU", "FI", "FIN", "FJ", "FJI", "FK", "FLK", "FM", "FO", "FR", "FRA", "FRO", "FSM", "GA", "GAB", "GB-ENG", "GB-NIR", "GB-SCT", "GB-UKM", "GB-WLS", "GBR", "GD", "GE", "GEO", "GF", "GG", "GGY", "GH", "GHA", "GI", "GIB", "GIN", "GL", "GLP", "GM", "GMB", "GN", "GNB", "GNQ", "GP", "GQ", "GR", "GRC", "GRD", "GRL", "GS", "GT", "GTM", "GU", "GUF", "GUM", "GUY", "GW", "GY", "HK", "HKG", "HM", "HMD", "HN", "HND", "HR", "HRV", "HT", "HTI", "HU", "HUN", "ID", "IDN", "IE", "IL", "IM", "IMN", "IN", "IND", "IO", "IOT", "IQ", "IR", "IRL", "IRN", "IRQ", "IS", "ISL", "ISR", "IT", "ITA", "JAM", "JE", "JEY", "JM", "JO", "JOR", "JP", "JPN", "KAZ", "KE", "KEN", "KG", "KGZ", "KH", "KHM", "KI", "KIR", "KM", "KN-SK", "KNA", "KOR", "KP", "KR", "KW", "KWT", "KY", "KZ", "LA", "LAO", "LB", "LBN", "LBR", "LBY", "LC", "LCA", "LI", "LIE", "LK", "LKA", "LR", "LS", "LSO", "LT", "LTU", "LU", "LUX", "LV", "LVA", "LY", "MA", "MAC", "MAF", "MAR", "MC", "MCO", "MD", "MDA", "MDG", "MDV", "ME", "MEX", "MF", "MG", "MH", "MHL", "MK", "MKD", "ML", "MLI", "MLT", "MM", "MMR", "MN", "MNE", "MNG", "MNP", "MO", "MOZ", "MP", "MQ", "MR", "MRT", "MS", "MSR", "MT", "MTQ", "MU", "MUS", "MV", "MW", "MWI", "MX", "MY", "MYS", "MZ", "NA", "NAM", "NC", "NCL", "NE", "NER", "NF", "NFK", "NG", "NGA", "NI", "NIC", "NIU", "NL", "NLD", "NO", "NOR", "NP", "NPL", "NR", "NRU", "NU", "NZ", "NZL", "OM", "OMN", "PA", "PAK", "PAN", "PCN", "PE", "PER", "PF", "PG", "PH", "PHL", "PK", "PL", "PLW", "PM", "PN", "PNG", "POL", "PR", "PRI", "PRK", "PRT", "PRY", "PS", "PSE", "PT", "PW", "PY", "PYF", "QA", "QAT", "RAINBOW", "RE", "REU", "RO", "ROU", "RS", "RU", "RUS", "RW", "RWA", "SA", "SAU", "SB", "SC", "SD", "SDN", "SE", "SEN", "SG", "SGP", "SGS", "SH", "SHN", "SI", "SJ", "SJM", "SK", "SL", "SLB", "SLE", "SLV", "SM", "SMR", "SN", "SO", "SOM", "SPM", "SR", "SRB", "SS", "SSD", "ST", "STP", "SUR", "SV", "SVK", "SVN", "SWE", "SWZ", "SX", "SXM", "SY", "SYC", "SYR", "SZ", "TC", "TCA", "TCD", "TD", "TF", "TG", "TGO", "TH", "THA", "TJ", "TJK", "TK", "TKL", "TKM", "TL", "TLS", "TM", "TN", "TO", "TON", "TR", "TT", "TTO", "TUN", "TUR", "TUV", "TV", "TW", "TWN", "TZ", "TZA", "UA", "UG", "UGA", "UKR", "UM", "UMI", "UNASUR", "URY", "US", "USA", "UY", "UZ", "UZB", "VA", "VAT", "VC", "VCT", "VE", "VEN", "VG", "VGB", "VI", "VIR", "VN", "VNM", "VU", "VUT", "WF", "WLF", "WS", "WSM", "YE", "YEM", "ZA", "ZAF", "ZM", "ZMB", "ZW", "ZWE"];
7
+ declare const countryCodes: readonly ["004", "008", "010", "016", "016", "020", "024", "028", "031", "032", "040", "044", "048", "050", "051", "052", "056", "060", "064", "068", "070", "072", "074", "076", "084", "086", "090", "092", "096", "100", "104", "108", "112", "116", "120", "124", "132", "136", "140", "144", "148", "152", "156", "158", "162", "166", "170", "174", "178", "180", "184", "188", "191", "192", "196", "203", "204", "208", "212", "214", "218", "222", "226", "231", "232", "233", "234", "238", "239", "242", "246", "248", "250", "254", "258", "260", "262", "266", "268", "270", "275", "276", "288", "292", "296", "300", "304", "308", "312", "316", "320", "324", "328", "332", "334", "336", "340", "344", "348", "352", "356", "360", "364", "368", "372", "376", "380", "384", "388", "392", "398", "400", "404", "408", "410", "414", "417", "418", "422", "426", "428", "430", "434", "438", "440", "442", "446", "450", "454", "458", "462", "466", "470", "474", "478", "480", "484", "492", "496", "498", "499", "500", "504", "508", "512", "516", "520", "524", "528", "531", "533", "534", "540", "548", "554", "558", "562", "566", "570", "574", "578", "580", "581", "583", "584", "585", "586", "591", "598", "600", "604", "608", "612", "616", "620", "624", "626", "630", "634", "638", "642", "643", "646", "652", "654", "659", "660", "662", "663", "666", "670", "674", "678", "682", "686", "688", "690", "694", "702", "703", "704", "705", "706", "710", "716", "724", "728", "729", "732", "740", "744", "748", "752", "756", "760", "762", "764", "768", "772", "776", "780", "784", "788", "792", "795", "796", "798", "800", "804", "807", "818", "831", "832", "833", "834", "836", "840", "850", "854", "858", "860", "862", "876", "882", "887", "894", "ABW", "AD", "AE", "AF", "AFG", "AFRUN", "AG", "AGO", "AI", "AIA", "AL", "ALA", "ALB", "AM", "AMS", "AND", "AO", "AQ", "AR", "ARE", "ARG", "ARM", "AS", "ASM", "AT", "ATA", "ATF", "ATG", "AU", "AUS", "AUT", "AW", "AX", "AZ", "AZE", "BA", "BB", "BD", "BDI", "BE", "BEL", "BEN", "BF", "BFA", "BG", "BGD", "BGR", "BH", "BHR", "BHS", "BI", "BIH", "BJ", "BL", "BLM", "BLR", "BLZ", "BM", "BMU", "BN", "BO", "BOL", "BQ-BO", "BQ-SA", "BQ-SE", "BR", "BRA", "BRB", "BRN", "BS", "BT", "BTN", "BV", "BVT", "BW", "BWA", "BY", "BZ", "CA", "CAF", "CAN", "CC", "CCK", "CD", "CF", "CG", "CH", "CHE", "CHL", "CHN", "CI", "CIV", "CK", "CL", "CM", "CMR", "CN", "CO", "COD", "COG", "COK", "COL", "COM", "CPV", "CR", "CRI", "CU", "CUB", "CUW", "CV", "CW", "CX", "CXR", "CY", "CYM", "CYP", "CZ", "CZE", "DE", "DEU", "DJ", "DJI", "DK", "DM", "DMA", "DNK", "DO", "DOM", "EC", "ECU", "EE", "EG", "EGY", "EH", "ER", "ERI", "ES", "ESH", "ESP", "EST", "ET", "ETH", "EU", "FI", "FIN", "FJ", "FJI", "FK", "FLK", "FM", "FO", "FR", "FRA", "FRO", "FSM", "GA", "GAB", "GB-ENG", "GB-NIR", "GB-SCT", "GB-UKM", "GB-WLS", "GB", "GBR", "GD", "GE", "GEO", "GF", "GG", "GGY", "GH", "GHA", "GI", "GIB", "GIN", "GL", "GLP", "GM", "GMB", "GN", "GNB", "GNQ", "GP", "GQ", "GR", "GRC", "GRD", "GRL", "GS", "GT", "GTM", "GU", "GUF", "GUM", "GUY", "GW", "GY", "HK", "HKG", "HM", "HMD", "HN", "HND", "HR", "HRV", "HT", "HTI", "HU", "HUN", "ID", "IDN", "IE", "IL", "IM", "IMN", "IN", "IND", "IO", "IOT", "IQ", "IR", "IRL", "IRN", "IRQ", "IS", "ISL", "ISR", "IT", "ITA", "JAM", "JE", "JEY", "JM", "JO", "JOR", "JP", "JPN", "KAZ", "KE", "KEN", "KG", "KGZ", "KH", "KHM", "KI", "KIR", "KM", "KN-SK", "KNA", "KOR", "KP", "KR", "KW", "KWT", "KY", "KZ", "LA", "LAO", "LB", "LBN", "LBR", "LBY", "LC", "LCA", "LI", "LIE", "LK", "LKA", "LR", "LS", "LSO", "LT", "LTU", "LU", "LUX", "LV", "LVA", "LY", "MA", "MAC", "MAF", "MAR", "MC", "MCO", "MD", "MDA", "MDG", "MDV", "ME", "MEX", "MF", "MG", "MH", "MHL", "MK", "MKD", "ML", "MLI", "MLT", "MM", "MMR", "MN", "MNE", "MNG", "MNP", "MO", "MOZ", "MP", "MQ", "MR", "MRT", "MS", "MSR", "MT", "MTQ", "MU", "MUS", "MV", "MW", "MWI", "MX", "MY", "MYS", "MZ", "NA", "NAM", "NC", "NCL", "NE", "NER", "NF", "NFK", "NG", "NGA", "NI", "NIC", "NIU", "NL", "NLD", "NO", "NOR", "NP", "NPL", "NR", "NRU", "NU", "NZ", "NZL", "OM", "OMN", "PA", "PAK", "PAN", "PCN", "PE", "PER", "PF", "PG", "PH", "PHL", "PK", "PL", "PLW", "PM", "PN", "PNG", "POL", "PR", "PRI", "PRK", "PRT", "PRY", "PS", "PSE", "PT", "PW", "PY", "PYF", "QA", "QAT", "RAINBOW", "RE", "REU", "RO", "ROU", "RS", "RU", "RUS", "RW", "RWA", "SA", "SAU", "SB", "SC", "SD", "SDN", "SE", "SEN", "SG", "SGP", "SGS", "SH", "SHN", "SI", "SJ", "SJM", "SK", "SL", "SLB", "SLE", "SLV", "SM", "SMR", "SN", "SO", "SOM", "SPM", "SR", "SRB", "SS", "SSD", "ST", "STP", "SUR", "SV", "SVK", "SVN", "SWE", "SWZ", "SX", "SXM", "SY", "SYC", "SYR", "SZ", "TC", "TCA", "TCD", "TD", "TF", "TG", "TGO", "TH", "THA", "TJ", "TJK", "TK", "TKL", "TKM", "TL", "TLS", "TM", "TN", "TO", "TON", "TR", "TT", "TTO", "TUN", "TUR", "TUV", "TV", "TW", "TWN", "TZ", "TZA", "UA", "UG", "UGA", "UKR", "UM", "UMI", "UNASUR", "URY", "US", "USA", "UY", "UZ", "UZB", "VA", "VAT", "VC", "VCT", "VE", "VEN", "VG", "VGB", "VI", "VIR", "VN", "VNM", "VU", "VUT", "WF", "WLF", "WS", "WSM", "YE", "YEM", "ZA", "ZAF", "ZM", "ZMB", "ZW", "ZWE"];
8
8
  type CountryCode = (typeof countryCodes)[number];
9
9
  /**
10
10
  * Type Predicate: check if the given value is a valid country code
package/dist/flag.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as A}from"./chunk-AZ56JGNY.js";import{cva as R}from"class-variance-authority";import{jsx as N,jsxs as L}from"react/jsx-runtime";var t="https://assets.ngrok.com";var B=R("",{variants:{size:{s:"rounded-[0.0625rem]",m:"rounded-[0.09375rem]",l:"rounded-sm"}}}),T=R("",{variants:{size:{s:"w-4 h-3",m:"w-5 h-[0.9375rem]",l:"w-8 h-6"}}});function n({className:o,code:S,size:M="l",loading:e="lazy",...G}){let C=B({size:M}),s=T({size:M});return L("div",{className:A("flag relative overflow-hidden",C,s,o),...G,children:[N("div",{"aria-hidden":!0,className:A("absolute inset-0 border border-[#000]/10",C)}),N("img",{className:"h-full w-full block object-cover",src:`${t}/flags/${M}/${S}.svg`,alt:`flag for ${S}`,loading:e})]})}var r=["004","008","010","016","016","020","024","028","031","032","040","044","048","050","051","052","056","060","064","068","070","072","074","076","084","086","090","092","096","100","104","108","112","116","120","124","132","136","140","144","148","152","156","158","162","166","170","174","178","180","184","188","191","192","196","203","204","208","212","214","218","222","226","231","232","233","234","238","239","242","246","248","250","254","258","260","262","266","268","270","275","276","288","292","296","300","304","308","312","316","320","324","328","332","334","336","340","344","348","352","356","360","364","368","372","376","380","384","388","392","398","400","404","408","410","414","417","418","422","426","428","430","434","438","440","442","446","450","454","458","462","466","470","474","478","480","484","492","496","498","499","500","504","508","512","516","520","524","528","531","533","534","540","548","554","558","562","566","570","574","578","580","581","583","584","585","586","591","598","600","604","608","612","616","620","624","626","630","634","638","642","643","646","652","654","659","660","662","663","666","670","674","678","682","686","688","690","694","702","703","704","705","706","710","716","724","728","729","732","740","744","748","752","756","760","762","764","768","772","776","780","784","788","792","795","796","798","800","804","807","818","831","832","833","834","836","840","850","854","858","860","862","876","882","887","894","ABW","AD","AE","AF","AFG","AFRUN","AG","AGO","AI","AIA","AL","ALA","ALB","AM","AMS","AND","AO","AQ","AR","ARE","ARG","ARM","AS","ASM","AT","ATA","ATF","ATG","AU","AUS","AUT","AW","AX","AZ","AZE","BA","BB","BD","BDI","BE","BEL","BEN","BF","BFA","BG","BGD","BGR","BH","BHR","BHS","BI","BIH","BJ","BL","BLM","BLR","BLZ","BM","BMU","BN","BO","BOL","BQ-BO","BQ-SA","BQ-SE","BR","BRA","BRB","BRN","BS","BT","BTN","BV","BVT","BW","BWA","BY","BZ","CA","CAF","CAN","CC","CCK","CD","CF","CG","CH","CHE","CHL","CHN","CI","CIV","CK","CL","CM","CMR","CN","CO","COD","COG","COK","COL","COM","CPV","CR","CRI","CU","CUB","CUW","CV","CW","CX","CXR","CY","CYM","CYP","CZ","CZE","DE","DEU","DJ","DJI","DK","DM","DMA","DNK","DO","DOM","EC","ECU","EE","EG","EGY","EH","ER","ERI","ES","ESH","ESP","EST","ET","ETH","EU","FI","FIN","FJ","FJI","FK","FLK","FM","FO","FR","FRA","FRO","FSM","GA","GAB","GB-ENG","GB-NIR","GB-SCT","GB-UKM","GB-WLS","GBR","GD","GE","GEO","GF","GG","GGY","GH","GHA","GI","GIB","GIN","GL","GLP","GM","GMB","GN","GNB","GNQ","GP","GQ","GR","GRC","GRD","GRL","GS","GT","GTM","GU","GUF","GUM","GUY","GW","GY","HK","HKG","HM","HMD","HN","HND","HR","HRV","HT","HTI","HU","HUN","ID","IDN","IE","IL","IM","IMN","IN","IND","IO","IOT","IQ","IR","IRL","IRN","IRQ","IS","ISL","ISR","IT","ITA","JAM","JE","JEY","JM","JO","JOR","JP","JPN","KAZ","KE","KEN","KG","KGZ","KH","KHM","KI","KIR","KM","KN-SK","KNA","KOR","KP","KR","KW","KWT","KY","KZ","LA","LAO","LB","LBN","LBR","LBY","LC","LCA","LI","LIE","LK","LKA","LR","LS","LSO","LT","LTU","LU","LUX","LV","LVA","LY","MA","MAC","MAF","MAR","MC","MCO","MD","MDA","MDG","MDV","ME","MEX","MF","MG","MH","MHL","MK","MKD","ML","MLI","MLT","MM","MMR","MN","MNE","MNG","MNP","MO","MOZ","MP","MQ","MR","MRT","MS","MSR","MT","MTQ","MU","MUS","MV","MW","MWI","MX","MY","MYS","MZ","NA","NAM","NC","NCL","NE","NER","NF","NFK","NG","NGA","NI","NIC","NIU","NL","NLD","NO","NOR","NP","NPL","NR","NRU","NU","NZ","NZL","OM","OMN","PA","PAK","PAN","PCN","PE","PER","PF","PG","PH","PHL","PK","PL","PLW","PM","PN","PNG","POL","PR","PRI","PRK","PRT","PRY","PS","PSE","PT","PW","PY","PYF","QA","QAT","RAINBOW","RE","REU","RO","ROU","RS","RU","RUS","RW","RWA","SA","SAU","SB","SC","SD","SDN","SE","SEN","SG","SGP","SGS","SH","SHN","SI","SJ","SJM","SK","SL","SLB","SLE","SLV","SM","SMR","SN","SO","SOM","SPM","SR","SRB","SS","SSD","ST","STP","SUR","SV","SVK","SVN","SWE","SWZ","SX","SXM","SY","SYC","SYR","SZ","TC","TCA","TCD","TD","TF","TG","TGO","TH","THA","TJ","TJK","TK","TKL","TKM","TL","TLS","TM","TN","TO","TON","TR","TT","TTO","TUN","TUR","TUV","TV","TW","TWN","TZ","TZA","UA","UG","UGA","UKR","UM","UMI","UNASUR","URY","US","USA","UY","UZ","UZB","VA","VAT","VC","VCT","VE","VEN","VG","VGB","VI","VIR","VN","VNM","VU","VUT","WF","WLF","WS","WSM","YE","YEM","ZA","ZAF","ZM","ZMB","ZW","ZWE"];function E(o){return r.includes(o)}export{n as Flag,r as countryCodes,E as isCountryCode};
1
+ import{a as A}from"./chunk-AZ56JGNY.js";import{cva as R}from"class-variance-authority";import{jsx as N,jsxs as L}from"react/jsx-runtime";var t="https://assets.ngrok.com";var B=R("",{variants:{size:{s:"rounded-[0.0625rem]",m:"rounded-[0.09375rem]",l:"rounded-sm"}}}),T=R("",{variants:{size:{s:"w-4 h-3",m:"w-5 h-[0.9375rem]",l:"w-8 h-6"}}});function n({className:o,code:S,size:M="l",loading:e="lazy",...G}){let C=B({size:M}),s=T({size:M});return L("div",{className:A("flag relative overflow-hidden",C,s,o),...G,children:[N("div",{"aria-hidden":!0,className:A("absolute inset-0 border border-[#000]/10",C)}),N("img",{className:"h-full w-full block object-cover",src:`${t}/flags/${M}/${S}.svg`,alt:`flag for ${S}`,loading:e})]})}var r=["004","008","010","016","016","020","024","028","031","032","040","044","048","050","051","052","056","060","064","068","070","072","074","076","084","086","090","092","096","100","104","108","112","116","120","124","132","136","140","144","148","152","156","158","162","166","170","174","178","180","184","188","191","192","196","203","204","208","212","214","218","222","226","231","232","233","234","238","239","242","246","248","250","254","258","260","262","266","268","270","275","276","288","292","296","300","304","308","312","316","320","324","328","332","334","336","340","344","348","352","356","360","364","368","372","376","380","384","388","392","398","400","404","408","410","414","417","418","422","426","428","430","434","438","440","442","446","450","454","458","462","466","470","474","478","480","484","492","496","498","499","500","504","508","512","516","520","524","528","531","533","534","540","548","554","558","562","566","570","574","578","580","581","583","584","585","586","591","598","600","604","608","612","616","620","624","626","630","634","638","642","643","646","652","654","659","660","662","663","666","670","674","678","682","686","688","690","694","702","703","704","705","706","710","716","724","728","729","732","740","744","748","752","756","760","762","764","768","772","776","780","784","788","792","795","796","798","800","804","807","818","831","832","833","834","836","840","850","854","858","860","862","876","882","887","894","ABW","AD","AE","AF","AFG","AFRUN","AG","AGO","AI","AIA","AL","ALA","ALB","AM","AMS","AND","AO","AQ","AR","ARE","ARG","ARM","AS","ASM","AT","ATA","ATF","ATG","AU","AUS","AUT","AW","AX","AZ","AZE","BA","BB","BD","BDI","BE","BEL","BEN","BF","BFA","BG","BGD","BGR","BH","BHR","BHS","BI","BIH","BJ","BL","BLM","BLR","BLZ","BM","BMU","BN","BO","BOL","BQ-BO","BQ-SA","BQ-SE","BR","BRA","BRB","BRN","BS","BT","BTN","BV","BVT","BW","BWA","BY","BZ","CA","CAF","CAN","CC","CCK","CD","CF","CG","CH","CHE","CHL","CHN","CI","CIV","CK","CL","CM","CMR","CN","CO","COD","COG","COK","COL","COM","CPV","CR","CRI","CU","CUB","CUW","CV","CW","CX","CXR","CY","CYM","CYP","CZ","CZE","DE","DEU","DJ","DJI","DK","DM","DMA","DNK","DO","DOM","EC","ECU","EE","EG","EGY","EH","ER","ERI","ES","ESH","ESP","EST","ET","ETH","EU","FI","FIN","FJ","FJI","FK","FLK","FM","FO","FR","FRA","FRO","FSM","GA","GAB","GB-ENG","GB-NIR","GB-SCT","GB-UKM","GB-WLS","GB","GBR","GD","GE","GEO","GF","GG","GGY","GH","GHA","GI","GIB","GIN","GL","GLP","GM","GMB","GN","GNB","GNQ","GP","GQ","GR","GRC","GRD","GRL","GS","GT","GTM","GU","GUF","GUM","GUY","GW","GY","HK","HKG","HM","HMD","HN","HND","HR","HRV","HT","HTI","HU","HUN","ID","IDN","IE","IL","IM","IMN","IN","IND","IO","IOT","IQ","IR","IRL","IRN","IRQ","IS","ISL","ISR","IT","ITA","JAM","JE","JEY","JM","JO","JOR","JP","JPN","KAZ","KE","KEN","KG","KGZ","KH","KHM","KI","KIR","KM","KN-SK","KNA","KOR","KP","KR","KW","KWT","KY","KZ","LA","LAO","LB","LBN","LBR","LBY","LC","LCA","LI","LIE","LK","LKA","LR","LS","LSO","LT","LTU","LU","LUX","LV","LVA","LY","MA","MAC","MAF","MAR","MC","MCO","MD","MDA","MDG","MDV","ME","MEX","MF","MG","MH","MHL","MK","MKD","ML","MLI","MLT","MM","MMR","MN","MNE","MNG","MNP","MO","MOZ","MP","MQ","MR","MRT","MS","MSR","MT","MTQ","MU","MUS","MV","MW","MWI","MX","MY","MYS","MZ","NA","NAM","NC","NCL","NE","NER","NF","NFK","NG","NGA","NI","NIC","NIU","NL","NLD","NO","NOR","NP","NPL","NR","NRU","NU","NZ","NZL","OM","OMN","PA","PAK","PAN","PCN","PE","PER","PF","PG","PH","PHL","PK","PL","PLW","PM","PN","PNG","POL","PR","PRI","PRK","PRT","PRY","PS","PSE","PT","PW","PY","PYF","QA","QAT","RAINBOW","RE","REU","RO","ROU","RS","RU","RUS","RW","RWA","SA","SAU","SB","SC","SD","SDN","SE","SEN","SG","SGP","SGS","SH","SHN","SI","SJ","SJM","SK","SL","SLB","SLE","SLV","SM","SMR","SN","SO","SOM","SPM","SR","SRB","SS","SSD","ST","STP","SUR","SV","SVK","SVN","SWE","SWZ","SX","SXM","SY","SYC","SYR","SZ","TC","TCA","TCD","TD","TF","TG","TGO","TH","THA","TJ","TJK","TK","TKL","TKM","TL","TLS","TM","TN","TO","TON","TR","TT","TTO","TUN","TUR","TUV","TV","TW","TWN","TZ","TZA","UA","UG","UGA","UKR","UM","UMI","UNASUR","URY","US","USA","UY","UZ","UZB","VA","VAT","VC","VCT","VE","VEN","VG","VGB","VI","VIR","VN","VNM","VU","VUT","WF","WLF","WS","WSM","YE","YEM","ZA","ZAF","ZM","ZMB","ZW","ZWE"];function E(o){return r.includes(o)}export{n as Flag,r as countryCodes,E as isCountryCode};
2
2
  //# sourceMappingURL=flag.js.map
package/dist/flag.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/flag/flag.tsx","../src/components/flag/country-code.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport type { ComponentProps } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport type { CountryCode } from \"./country-code.js\";\n\nconst cdnOrigin = \"https://assets.ngrok.com\";\n\nconst sizes = [\"s\", \"m\", \"l\"] as const;\ntype Size = (typeof sizes)[number];\n\ntype Props = Omit<ComponentProps<\"div\">, \"children\"> & {\n\t/**\n\t * The country code for the flag to display\n\t * @example \"US\"\n\t */\n\tcode: CountryCode;\n\t/**\n\t * The size of flag to render, \"s\", \"m\", or \"l\"\n\t * @default \"l\"\n\t */\n\tsize?: Size;\n\t/**\n\t * A string providing a hint to the user agent as to how to best schedule the loading of the image to optimize page performance.\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/loading\n\t * @default \"lazy\"\n\t */\n\tloading?: ComponentProps<\"img\">[\"loading\"];\n};\n\nconst borderRadiusVariants = cva(\"\", {\n\tvariants: {\n\t\tsize: {\n\t\t\ts: \"rounded-[0.0625rem]\",\n\t\t\tm: \"rounded-[0.09375rem]\",\n\t\t\tl: \"rounded-sm\",\n\t\t} as const satisfies Record<Size, string>,\n\t},\n});\n\nconst sizingVariants = cva(\"\", {\n\tvariants: {\n\t\tsize: {\n\t\t\ts: \"w-4 h-3\",\n\t\t\tm: \"w-5 h-[0.9375rem]\",\n\t\t\tl: \"w-8 h-6\",\n\t\t} as const satisfies Record<Size, string>,\n\t},\n});\n\n/**\n * A flag component that displays a flag based on the provided country code.\n * Inspired by [react-flagpack](https://flagpack.xyz/docs/development/react).\n *\n * @example\n * <Flag code=\"US\" />\n * <Flag code=\"JP\" size=\"m\" loading=\"eager\" />\n * <Flag code=\"CA\" size=\"s\" loading=\"lazy\" />\n * <Flag code=\"GB\" size=\"l\" />\n */\nfunction Flag({\n\t//,\n\tclassName,\n\tcode,\n\tsize = \"l\",\n\tloading = \"lazy\",\n\t...props\n}: Props) {\n\tconst borderRadius = borderRadiusVariants({ size });\n\tconst sizing = sizingVariants({ size });\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cx(\n\t\t\t\t\"flag relative overflow-hidden\",\n\t\t\t\tborderRadius,\n\t\t\t\tsizing,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<div\n\t\t\t\taria-hidden\n\t\t\t\tclassName={cx(\"absolute inset-0 border border-[#000]/10\", borderRadius)}\n\t\t\t/>\n\t\t\t<img\n\t\t\t\tclassName=\"h-full w-full block object-cover\"\n\t\t\t\tsrc={`${cdnOrigin}/flags/${size}/${code}.svg`}\n\t\t\t\talt={`flag for ${code}`}\n\t\t\t\tloading={loading}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport {\n\t//,\n\tFlag,\n};\n\nexport type {\n\t//,\n\tProps as FlagProps,\n};\n","/** All valid values for a flag\n * @see https://www.flagpack.xyz/docs/flag-index\n */\nconst countryCodes = [\n\t\"004\",\n\t\"008\",\n\t\"010\",\n\t\"016\",\n\t\"016\",\n\t\"020\",\n\t\"024\",\n\t\"028\",\n\t\"031\",\n\t\"032\",\n\t\"040\",\n\t\"044\",\n\t\"048\",\n\t\"050\",\n\t\"051\",\n\t\"052\",\n\t\"056\",\n\t\"060\",\n\t\"064\",\n\t\"068\",\n\t\"070\",\n\t\"072\",\n\t\"074\",\n\t\"076\",\n\t\"084\",\n\t\"086\",\n\t\"090\",\n\t\"092\",\n\t\"096\",\n\t\"100\",\n\t\"104\",\n\t\"108\",\n\t\"112\",\n\t\"116\",\n\t\"120\",\n\t\"124\",\n\t\"132\",\n\t\"136\",\n\t\"140\",\n\t\"144\",\n\t\"148\",\n\t\"152\",\n\t\"156\",\n\t\"158\",\n\t\"162\",\n\t\"166\",\n\t\"170\",\n\t\"174\",\n\t\"178\",\n\t\"180\",\n\t\"184\",\n\t\"188\",\n\t\"191\",\n\t\"192\",\n\t\"196\",\n\t\"203\",\n\t\"204\",\n\t\"208\",\n\t\"212\",\n\t\"214\",\n\t\"218\",\n\t\"222\",\n\t\"226\",\n\t\"231\",\n\t\"232\",\n\t\"233\",\n\t\"234\",\n\t\"238\",\n\t\"239\",\n\t\"242\",\n\t\"246\",\n\t\"248\",\n\t\"250\",\n\t\"254\",\n\t\"258\",\n\t\"260\",\n\t\"262\",\n\t\"266\",\n\t\"268\",\n\t\"270\",\n\t\"275\",\n\t\"276\",\n\t\"288\",\n\t\"292\",\n\t\"296\",\n\t\"300\",\n\t\"304\",\n\t\"308\",\n\t\"312\",\n\t\"316\",\n\t\"320\",\n\t\"324\",\n\t\"328\",\n\t\"332\",\n\t\"334\",\n\t\"336\",\n\t\"340\",\n\t\"344\",\n\t\"348\",\n\t\"352\",\n\t\"356\",\n\t\"360\",\n\t\"364\",\n\t\"368\",\n\t\"372\",\n\t\"376\",\n\t\"380\",\n\t\"384\",\n\t\"388\",\n\t\"392\",\n\t\"398\",\n\t\"400\",\n\t\"404\",\n\t\"408\",\n\t\"410\",\n\t\"414\",\n\t\"417\",\n\t\"418\",\n\t\"422\",\n\t\"426\",\n\t\"428\",\n\t\"430\",\n\t\"434\",\n\t\"438\",\n\t\"440\",\n\t\"442\",\n\t\"446\",\n\t\"450\",\n\t\"454\",\n\t\"458\",\n\t\"462\",\n\t\"466\",\n\t\"470\",\n\t\"474\",\n\t\"478\",\n\t\"480\",\n\t\"484\",\n\t\"492\",\n\t\"496\",\n\t\"498\",\n\t\"499\",\n\t\"500\",\n\t\"504\",\n\t\"508\",\n\t\"512\",\n\t\"516\",\n\t\"520\",\n\t\"524\",\n\t\"528\",\n\t\"531\",\n\t\"533\",\n\t\"534\",\n\t\"540\",\n\t\"548\",\n\t\"554\",\n\t\"558\",\n\t\"562\",\n\t\"566\",\n\t\"570\",\n\t\"574\",\n\t\"578\",\n\t\"580\",\n\t\"581\",\n\t\"583\",\n\t\"584\",\n\t\"585\",\n\t\"586\",\n\t\"591\",\n\t\"598\",\n\t\"600\",\n\t\"604\",\n\t\"608\",\n\t\"612\",\n\t\"616\",\n\t\"620\",\n\t\"624\",\n\t\"626\",\n\t\"630\",\n\t\"634\",\n\t\"638\",\n\t\"642\",\n\t\"643\",\n\t\"646\",\n\t\"652\",\n\t\"654\",\n\t\"659\",\n\t\"660\",\n\t\"662\",\n\t\"663\",\n\t\"666\",\n\t\"670\",\n\t\"674\",\n\t\"678\",\n\t\"682\",\n\t\"686\",\n\t\"688\",\n\t\"690\",\n\t\"694\",\n\t\"702\",\n\t\"703\",\n\t\"704\",\n\t\"705\",\n\t\"706\",\n\t\"710\",\n\t\"716\",\n\t\"724\",\n\t\"728\",\n\t\"729\",\n\t\"732\",\n\t\"740\",\n\t\"744\",\n\t\"748\",\n\t\"752\",\n\t\"756\",\n\t\"760\",\n\t\"762\",\n\t\"764\",\n\t\"768\",\n\t\"772\",\n\t\"776\",\n\t\"780\",\n\t\"784\",\n\t\"788\",\n\t\"792\",\n\t\"795\",\n\t\"796\",\n\t\"798\",\n\t\"800\",\n\t\"804\",\n\t\"807\",\n\t\"818\",\n\t\"831\",\n\t\"832\",\n\t\"833\",\n\t\"834\",\n\t\"836\",\n\t\"840\",\n\t\"850\",\n\t\"854\",\n\t\"858\",\n\t\"860\",\n\t\"862\",\n\t\"876\",\n\t\"882\",\n\t\"887\",\n\t\"894\",\n\t\"ABW\",\n\t\"AD\",\n\t\"AE\",\n\t\"AF\",\n\t\"AFG\",\n\t\"AFRUN\",\n\t\"AG\",\n\t\"AGO\",\n\t\"AI\",\n\t\"AIA\",\n\t\"AL\",\n\t\"ALA\",\n\t\"ALB\",\n\t\"AM\",\n\t\"AMS\",\n\t\"AND\",\n\t\"AO\",\n\t\"AQ\",\n\t\"AR\",\n\t\"ARE\",\n\t\"ARG\",\n\t\"ARM\",\n\t\"AS\",\n\t\"ASM\",\n\t\"AT\",\n\t\"ATA\",\n\t\"ATF\",\n\t\"ATG\",\n\t\"AU\",\n\t\"AUS\",\n\t\"AUT\",\n\t\"AW\",\n\t\"AX\",\n\t\"AZ\",\n\t\"AZE\",\n\t\"BA\",\n\t\"BB\",\n\t\"BD\",\n\t\"BDI\",\n\t\"BE\",\n\t\"BEL\",\n\t\"BEN\",\n\t\"BF\",\n\t\"BFA\",\n\t\"BG\",\n\t\"BGD\",\n\t\"BGR\",\n\t\"BH\",\n\t\"BHR\",\n\t\"BHS\",\n\t\"BI\",\n\t\"BIH\",\n\t\"BJ\",\n\t\"BL\",\n\t\"BLM\",\n\t\"BLR\",\n\t\"BLZ\",\n\t\"BM\",\n\t\"BMU\",\n\t\"BN\",\n\t\"BO\",\n\t\"BOL\",\n\t\"BQ-BO\",\n\t\"BQ-SA\",\n\t\"BQ-SE\",\n\t\"BR\",\n\t\"BRA\",\n\t\"BRB\",\n\t\"BRN\",\n\t\"BS\",\n\t\"BT\",\n\t\"BTN\",\n\t\"BV\",\n\t\"BVT\",\n\t\"BW\",\n\t\"BWA\",\n\t\"BY\",\n\t\"BZ\",\n\t\"CA\",\n\t\"CAF\",\n\t\"CAN\",\n\t\"CC\",\n\t\"CCK\",\n\t\"CD\",\n\t\"CF\",\n\t\"CG\",\n\t\"CH\",\n\t\"CHE\",\n\t\"CHL\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t\"UZ\",\n\t\"UZB\",\n\t\"VA\",\n\t\"VAT\",\n\t\"VC\",\n\t\"VCT\",\n\t\"VE\",\n\t\"VEN\",\n\t\"VG\",\n\t\"VGB\",\n\t\"VI\",\n\t\"VIR\",\n\t\"VN\",\n\t\"VNM\",\n\t\"VU\",\n\t\"VUT\",\n\t\"WF\",\n\t\"WLF\",\n\t\"WS\",\n\t\"WSM\",\n\t\"YE\",\n\t\"YEM\",\n\t\"ZA\",\n\t\"ZAF\",\n\t\"ZM\",\n\t\"ZMB\",\n\t\"ZW\",\n\t\"ZWE\",\n] as const;\ntype CountryCode = (typeof countryCodes)[number];\n\n/**\n * Type Predicate: check if the given value is a valid country code\n */\nfunction isCountryCode(value: unknown): value is CountryCode {\n\treturn countryCodes.includes(value as CountryCode);\n}\n\nexport {\n\t//,\n\tisCountryCode,\n\tcountryCodes,\n};\n\nexport type {\n\t//,\n\tCountryCode,\n};\n"],"mappings":"wCAAA,OAAS,OAAAA,MAAW,2BAuElB,OASC,OAAAC,EATD,QAAAC,MAAA,oBAlEF,IAAMC,EAAY,2BAwBlB,IAAMC,EAAuBC,EAAI,GAAI,CACpC,SAAU,CACT,KAAM,CACL,EAAG,sBACH,EAAG,uBACH,EAAG,YACJ,CACD,CACD,CAAC,EAEKC,EAAiBD,EAAI,GAAI,CAC9B,SAAU,CACT,KAAM,CACL,EAAG,UACH,EAAG,oBACH,EAAG,SACJ,CACD,CACD,CAAC,EAYD,SAASE,EAAK,CAEb,UAAAC,EACA,KAAAC,EACA,KAAAC,EAAO,IACP,QAAAC,EAAU,OACV,GAAGC,CACJ,EAAU,CACT,IAAMC,EAAeT,EAAqB,CAAE,KAAAM,CAAK,CAAC,EAC5CI,EAASR,EAAe,CAAE,KAAAI,CAAK,CAAC,EAEtC,OACCK,EAAC,OACA,UAAWC,EACV,gCACAH,EACAC,EACAN,CACD,EACC,GAAGI,EAEJ,UAAAK,EAAC,OACA,cAAW,GACX,UAAWD,EAAG,2CAA4CH,CAAY,EACvE,EACAI,EAAC,OACA,UAAU,mCACV,IAAK,GAAGC,CAAS,UAAUR,CAAI,IAAID,CAAI,OACvC,IAAK,YAAYA,CAAI,GACrB,QAASE,EACV,GACD,CAEF,CCzFA,IAAMQ,EAAe,CACpB,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,KACA,KACA,MACA,QACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,QACA,QACA,QACA,KACA,MACA,MACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,SACA,SACA,SACA,SACA,SACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,QACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,UACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,SACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACD,EAMA,SAASC,EAAcC,EAAsC,CAC5D,OAAOF,EAAa,SAASE,CAAoB,CAClD","names":["cva","jsx","jsxs","cdnOrigin","borderRadiusVariants","cva","sizingVariants","Flag","className","code","size","loading","props","borderRadius","sizing","jsxs","cx","jsx","cdnOrigin","countryCodes","isCountryCode","value"]}
1
+ {"version":3,"sources":["../src/components/flag/flag.tsx","../src/components/flag/country-code.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport type { ComponentProps } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport type { CountryCode } from \"./country-code.js\";\n\nconst cdnOrigin = \"https://assets.ngrok.com\";\n\nconst sizes = [\"s\", \"m\", \"l\"] as const;\ntype Size = (typeof sizes)[number];\n\ntype Props = Omit<ComponentProps<\"div\">, \"children\"> & {\n\t/**\n\t * The country code for the flag to display\n\t * @example \"US\"\n\t */\n\tcode: CountryCode;\n\t/**\n\t * The size of flag to render, \"s\", \"m\", or \"l\"\n\t * @default \"l\"\n\t */\n\tsize?: Size;\n\t/**\n\t * A string providing a hint to the user agent as to how to best schedule the loading of the image to optimize page performance.\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/loading\n\t * @default \"lazy\"\n\t */\n\tloading?: ComponentProps<\"img\">[\"loading\"];\n};\n\nconst borderRadiusVariants = cva(\"\", {\n\tvariants: {\n\t\tsize: {\n\t\t\ts: \"rounded-[0.0625rem]\",\n\t\t\tm: \"rounded-[0.09375rem]\",\n\t\t\tl: \"rounded-sm\",\n\t\t} as const satisfies Record<Size, string>,\n\t},\n});\n\nconst sizingVariants = cva(\"\", {\n\tvariants: {\n\t\tsize: {\n\t\t\ts: \"w-4 h-3\",\n\t\t\tm: \"w-5 h-[0.9375rem]\",\n\t\t\tl: \"w-8 h-6\",\n\t\t} as const satisfies Record<Size, string>,\n\t},\n});\n\n/**\n * A flag component that displays a flag based on the provided country code.\n * Inspired by [react-flagpack](https://flagpack.xyz/docs/development/react).\n *\n * @example\n * <Flag code=\"US\" />\n * <Flag code=\"JP\" size=\"m\" loading=\"eager\" />\n * <Flag code=\"CA\" size=\"s\" loading=\"lazy\" />\n * <Flag code=\"GB\" size=\"l\" />\n */\nfunction Flag({\n\t//,\n\tclassName,\n\tcode,\n\tsize = \"l\",\n\tloading = \"lazy\",\n\t...props\n}: Props) {\n\tconst borderRadius = borderRadiusVariants({ size });\n\tconst sizing = sizingVariants({ size });\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cx(\n\t\t\t\t\"flag relative overflow-hidden\",\n\t\t\t\tborderRadius,\n\t\t\t\tsizing,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<div\n\t\t\t\taria-hidden\n\t\t\t\tclassName={cx(\"absolute inset-0 border border-[#000]/10\", borderRadius)}\n\t\t\t/>\n\t\t\t<img\n\t\t\t\tclassName=\"h-full w-full block object-cover\"\n\t\t\t\tsrc={`${cdnOrigin}/flags/${size}/${code}.svg`}\n\t\t\t\talt={`flag for ${code}`}\n\t\t\t\tloading={loading}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport {\n\t//,\n\tFlag,\n};\n\nexport type {\n\t//,\n\tProps as FlagProps,\n};\n","/** All valid values for a flag\n * @see https://www.flagpack.xyz/docs/flag-index\n */\nconst countryCodes = [\n\t\"004\",\n\t\"008\",\n\t\"010\",\n\t\"016\",\n\t\"016\",\n\t\"020\",\n\t\"024\",\n\t\"028\",\n\t\"031\",\n\t\"032\",\n\t\"040\",\n\t\"044\",\n\t\"048\",\n\t\"050\",\n\t\"051\",\n\t\"052\",\n\t\"056\",\n\t\"060\",\n\t\"064\",\n\t\"068\",\n\t\"070\",\n\t\"072\",\n\t\"074\",\n\t\"076\",\n\t\"084\",\n\t\"086\",\n\t\"090\",\n\t\"092\",\n\t\"096\",\n\t\"100\",\n\t\"104\",\n\t\"108\",\n\t\"112\",\n\t\"116\",\n\t\"120\",\n\t\"124\",\n\t\"132\",\n\t\"136\",\n\t\"140\",\n\t\"144\",\n\t\"148\",\n\t\"152\",\n\t\"156\",\n\t\"158\",\n\t\"162\",\n\t\"166\",\n\t\"170\",\n\t\"174\",\n\t\"178\",\n\t\"180\",\n\t\"184\",\n\t\"188\",\n\t\"191\",\n\t\"192\",\n\t\"196\",\n\t\"203\",\n\t\"204\",\n\t\"208\",\n\t\"212\",\n\t\"214\",\n\t\"218\",\n\t\"222\",\n\t\"226\",\n\t\"231\",\n\t\"232\",\n\t\"233\",\n\t\"234\",\n\t\"238\",\n\t\"239\",\n\t\"242\",\n\t\"246\",\n\t\"248\",\n\t\"250\",\n\t\"254\",\n\t\"258\",\n\t\"260\",\n\t\"262\",\n\t\"266\",\n\t\"268\",\n\t\"270\",\n\t\"275\",\n\t\"276\",\n\t\"288\",\n\t\"292\",\n\t\"296\",\n\t\"300\",\n\t\"304\",\n\t\"308\",\n\t\"312\",\n\t\"316\",\n\t\"320\",\n\t\"324\",\n\t\"328\",\n\t\"332\",\n\t\"334\",\n\t\"336\",\n\t\"340\",\n\t\"344\",\n\t\"348\",\n\t\"352\",\n\t\"356\",\n\t\"360\",\n\t\"364\",\n\t\"368\",\n\t\"372\",\n\t\"376\",\n\t\"380\",\n\t\"384\",\n\t\"388\",\n\t\"392\",\n\t\"398\",\n\t\"400\",\n\t\"404\",\n\t\"408\",\n\t\"410\",\n\t\"414\",\n\t\"417\",\n\t\"418\",\n\t\"422\",\n\t\"426\",\n\t\"428\",\n\t\"430\",\n\t\"434\",\n\t\"438\",\n\t\"440\",\n\t\"442\",\n\t\"446\",\n\t\"450\",\n\t\"454\",\n\t\"458\",\n\t\"462\",\n\t\"466\",\n\t\"470\",\n\t\"474\",\n\t\"478\",\n\t\"480\",\n\t\"484\",\n\t\"492\",\n\t\"496\",\n\t\"498\",\n\t\"499\",\n\t\"500\",\n\t\"504\",\n\t\"508\",\n\t\"512\",\n\t\"516\",\n\t\"520\",\n\t\"524\",\n\t\"528\",\n\t\"531\",\n\t\"533\",\n\t\"534\",\n\t\"540\",\n\t\"548\",\n\t\"554\",\n\t\"558\",\n\t\"562\",\n\t\"566\",\n\t\"570\",\n\t\"574\",\n\t\"578\",\n\t\"580\",\n\t\"581\",\n\t\"583\",\n\t\"584\",\n\t\"585\",\n\t\"586\",\n\t\"591\",\n\t\"598\",\n\t\"600\",\n\t\"604\",\n\t\"608\",\n\t\"612\",\n\t\"616\",\n\t\"620\",\n\t\"624\",\n\t\"626\",\n\t\"630\",\n\t\"634\",\n\t\"638\",\n\t\"642\",\n\t\"643\",\n\t\"646\",\n\t\"652\",\n\t\"654\",\n\t\"659\",\n\t\"660\",\n\t\"662\",\n\t\"663\",\n\t\"666\",\n\t\"670\",\n\t\"674\",\n\t\"678\",\n\t\"682\",\n\t\"686\",\n\t\"688\",\n\t\"690\",\n\t\"694\",\n\t\"702\",\n\t\"703\",\n\t\"704\",\n\t\"705\",\n\t\"706\",\n\t\"710\",\n\t\"716\",\n\t\"724\",\n\t\"728\",\n\t\"729\",\n\t\"732\",\n\t\"740\",\n\t\"744\",\n\t\"748\",\n\t\"752\",\n\t\"756\",\n\t\"760\",\n\t\"762\",\n\t\"764\",\n\t\"768\",\n\t\"772\",\n\t\"776\",\n\t\"780\",\n\t\"784\",\n\t\"788\",\n\t\"792\",\n\t\"795\",\n\t\"796\",\n\t\"798\",\n\t\"800\",\n\t\"804\",\n\t\"807\",\n\t\"818\",\n\t\"831\",\n\t\"832\",\n\t\"833\",\n\t\"834\",\n\t\"836\",\n\t\"840\",\n\t\"850\",\n\t\"854\",\n\t\"858\",\n\t\"860\",\n\t\"862\",\n\t\"876\",\n\t\"882\",\n\t\"887\",\n\t\"894\",\n\t\"ABW\",\n\t\"AD\",\n\t\"AE\",\n\t\"AF\",\n\t\"AFG\",\n\t\"AFRUN\",\n\t\"AG\",\n\t\"AGO\",\n\t\"AI\",\n\t\"AIA\",\n\t\"AL\",\n\t\"ALA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\t\"WS\",\n\t\"WSM\",\n\t\"YE\",\n\t\"YEM\",\n\t\"ZA\",\n\t\"ZAF\",\n\t\"ZM\",\n\t\"ZMB\",\n\t\"ZW\",\n\t\"ZWE\",\n] as const;\ntype CountryCode = (typeof countryCodes)[number];\n\n/**\n * Type Predicate: check if the given value is a valid country code\n */\nfunction isCountryCode(value: unknown): value is CountryCode {\n\treturn countryCodes.includes(value as CountryCode);\n}\n\nexport {\n\t//,\n\tisCountryCode,\n\tcountryCodes,\n};\n\nexport type {\n\t//,\n\tCountryCode,\n};\n"],"mappings":"wCAAA,OAAS,OAAAA,MAAW,2BAuElB,OASC,OAAAC,EATD,QAAAC,MAAA,oBAlEF,IAAMC,EAAY,2BAwBlB,IAAMC,EAAuBC,EAAI,GAAI,CACpC,SAAU,CACT,KAAM,CACL,EAAG,sBACH,EAAG,uBACH,EAAG,YACJ,CACD,CACD,CAAC,EAEKC,EAAiBD,EAAI,GAAI,CAC9B,SAAU,CACT,KAAM,CACL,EAAG,UACH,EAAG,oBACH,EAAG,SACJ,CACD,CACD,CAAC,EAYD,SAASE,EAAK,CAEb,UAAAC,EACA,KAAAC,EACA,KAAAC,EAAO,IACP,QAAAC,EAAU,OACV,GAAGC,CACJ,EAAU,CACT,IAAMC,EAAeT,EAAqB,CAAE,KAAAM,CAAK,CAAC,EAC5CI,EAASR,EAAe,CAAE,KAAAI,CAAK,CAAC,EAEtC,OACCK,EAAC,OACA,UAAWC,EACV,gCACAH,EACAC,EACAN,CACD,EACC,GAAGI,EAEJ,UAAAK,EAAC,OACA,cAAW,GACX,UAAWD,EAAG,2CAA4CH,CAAY,EACvE,EACAI,EAAC,OACA,UAAU,mCACV,IAAK,GAAGC,CAAS,UAAUR,CAAI,IAAID,CAAI,OACvC,IAAK,YAAYA,CAAI,GACrB,QAASE,EACV,GACD,CAEF,CCzFA,IAAMQ,EAAe,CACpB,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,KACA,KACA,MACA,QACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,QACA,QACA,QACA,KACA,MACA,MACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,SACA,SACA,SACA,SACA,SACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,QACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,UACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,SACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACD,EAMA,SAASC,EAAcC,EAAsC,CAC5D,OAAOF,EAAa,SAASE,CAAoB,CAClD","names":["cva","jsx","jsxs","cdnOrigin","borderRadiusVariants","cva","sizingVariants","Flag","className","code","size","loading","props","borderRadius","sizing","jsxs","cx","jsx","cdnOrigin","countryCodes","isCountryCode","value"]}
@@ -1,2 +1,2 @@
1
- import{a as b,c as v,d as x,e as y,g as h}from"./chunk-6GIEBXSN.js";import"./chunk-MF2QITTY.js";import{b as z}from"./chunk-R4XXPIT2.js";import{a as d}from"./chunk-7XIZZ4HQ.js";import{a as l}from"./chunk-ESJ3HLYJ.js";import"./chunk-PJLA4NRO.js";import"./chunk-4LSFAAZW.js";import"./chunk-3C5O3AQA.js";import"./chunk-72TJUKMV.js";import"./chunk-DJGIRPRQ.js";import"./chunk-HDPLH5HC.js";import{a as p}from"./chunk-AZ56JGNY.js";import{CaretLeft as k}from"@phosphor-icons/react/dist/icons/CaretLeft";import{CaretRight as A}from"@phosphor-icons/react/dist/icons/CaretRight";import{Slot as E}from"@radix-ui/react-slot";import{createContext as F,forwardRef as m,useContext as N,useState as W}from"react";import P from"tiny-invariant";import{jsx as s,jsxs as f}from"react/jsx-runtime";var c=F(void 0),O=m(({className:n,children:e,defaultPageSize:a,...t},i)=>{let[o,r]=W(a);return s(c.Provider,{value:{defaultPageSize:a,pageSize:o,setPageSize:r},children:s("div",{className:p("inline-flex items-center justify-between gap-2",n),ref:i,...t,children:e})})});O.displayName="CursorPagination";var T=m(({hasNextPage:n,hasPreviousPage:e,onNextPage:a,onPreviousPage:t,...i},o)=>f(d,{appearance:"panel",ref:o,...i,children:[s(l,{appearance:"ghost",disabled:!e,icon:s(k,{}),label:"Previous page",onClick:t,size:"sm",type:"button"}),s(z,{orientation:"vertical",className:"min-h-5"}),s(l,{appearance:"ghost",disabled:!n,icon:s(A,{}),label:"Next page",onClick:a,size:"sm",type:"button"})]}));T.displayName="CursorButtons";var $=[5,10,20,50,100],B=m(({className:n,pageSizes:e=$,onChangePageSize:a,...t},i)=>{let o=N(c);return P(o,"CursorPageSizeSelect must be used as a child of a CursorPagination component"),P(e.includes(o.defaultPageSize),"CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes"),P(e.includes(o.pageSize),"CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes"),f(b,{defaultValue:`${o.pageSize}`,onChange:r=>{let g=Number.parseInt(r,10);Number.isNaN(g)&&(g=o.defaultPageSize),o.setPageSize(g),a?.(g)},children:[s(x,{ref:i,className:p("w-auto min-w-36",n),value:o.pageSize,...t,children:s(v,{})}),s(y,{width:"trigger",children:e.map(r=>f(h,{value:`${r}`,children:[r," per page"]},r))})]})});B.displayName="CursorPageSizeSelect";function D({asChild:n=!1,className:e,...a}){let t=N(c);return P(t,"CursorPageSizeValue must be used as a child of a CursorPagination component"),f(n?E:"span",{className:p("text-muted text-sm font-normal",e),...a,children:[t.pageSize," per page"]})}import{useEffect as V,useState as w}from"react";function H({listSize:n,pageSize:e}){let[a,t]=w(1),[i,o]=w(e);V(()=>{o(e),t(1)},[e]),V(()=>{t(1)},[n]);let r=Math.ceil(n/i),g=(a-1)*i,S=a>1,C=a<r;function M(u){let j=Math.max(1,Math.min(u,r));t(j)}function R(){C&&t(u=>Math.min(u+1,r))}function G(){S&&t(u=>Math.max(u-1,1))}function I(u){o(u),t(1)}function L(){t(r)}function U(){t(1)}return{currentPage:a,goToFirstPage:U,goToLastPage:L,goToPage:M,hasNextPage:C,hasPreviousPage:S,nextPage:R,offset:g,pageSize:i,previousPage:G,setPageSize:I,totalPages:r}}function q(n,e){return n.slice(e.offset,e.offset+e.pageSize)}export{T as CursorButtons,B as CursorPageSizeSelect,D as CursorPageSizeValue,O as CursorPagination,q as getOffsetPaginatedSlice,H as useOffsetPagination};
1
+ import{a as b,c as v,d as x,e as y,g as h}from"./chunk-5Q25P2WN.js";import"./chunk-MF2QITTY.js";import{b as z}from"./chunk-R4XXPIT2.js";import{a as d}from"./chunk-7XIZZ4HQ.js";import{a as l}from"./chunk-ESJ3HLYJ.js";import"./chunk-PJLA4NRO.js";import"./chunk-4LSFAAZW.js";import"./chunk-3C5O3AQA.js";import"./chunk-72TJUKMV.js";import"./chunk-DJGIRPRQ.js";import"./chunk-HDPLH5HC.js";import{a as p}from"./chunk-AZ56JGNY.js";import{CaretLeft as k}from"@phosphor-icons/react/dist/icons/CaretLeft";import{CaretRight as A}from"@phosphor-icons/react/dist/icons/CaretRight";import{Slot as E}from"@radix-ui/react-slot";import{createContext as F,forwardRef as m,useContext as N,useState as W}from"react";import P from"tiny-invariant";import{jsx as s,jsxs as f}from"react/jsx-runtime";var c=F(void 0),O=m(({className:n,children:e,defaultPageSize:a,...t},i)=>{let[o,r]=W(a);return s(c.Provider,{value:{defaultPageSize:a,pageSize:o,setPageSize:r},children:s("div",{className:p("inline-flex items-center justify-between gap-2",n),ref:i,...t,children:e})})});O.displayName="CursorPagination";var T=m(({hasNextPage:n,hasPreviousPage:e,onNextPage:a,onPreviousPage:t,...i},o)=>f(d,{appearance:"panel",ref:o,...i,children:[s(l,{appearance:"ghost",disabled:!e,icon:s(k,{}),label:"Previous page",onClick:t,size:"sm",type:"button"}),s(z,{orientation:"vertical",className:"min-h-5"}),s(l,{appearance:"ghost",disabled:!n,icon:s(A,{}),label:"Next page",onClick:a,size:"sm",type:"button"})]}));T.displayName="CursorButtons";var $=[5,10,20,50,100],B=m(({className:n,pageSizes:e=$,onChangePageSize:a,...t},i)=>{let o=N(c);return P(o,"CursorPageSizeSelect must be used as a child of a CursorPagination component"),P(e.includes(o.defaultPageSize),"CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes"),P(e.includes(o.pageSize),"CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes"),f(b,{defaultValue:`${o.pageSize}`,onChange:r=>{let g=Number.parseInt(r,10);Number.isNaN(g)&&(g=o.defaultPageSize),o.setPageSize(g),a?.(g)},children:[s(x,{ref:i,className:p("w-auto min-w-36",n),value:o.pageSize,...t,children:s(v,{})}),s(y,{width:"trigger",children:e.map(r=>f(h,{value:`${r}`,children:[r," per page"]},r))})]})});B.displayName="CursorPageSizeSelect";function D({asChild:n=!1,className:e,...a}){let t=N(c);return P(t,"CursorPageSizeValue must be used as a child of a CursorPagination component"),f(n?E:"span",{className:p("text-muted text-sm font-normal",e),...a,children:[t.pageSize," per page"]})}import{useEffect as V,useState as w}from"react";function H({listSize:n,pageSize:e}){let[a,t]=w(1),[i,o]=w(e);V(()=>{o(e),t(1)},[e]),V(()=>{t(1)},[n]);let r=Math.ceil(n/i),g=(a-1)*i,S=a>1,C=a<r;function M(u){let j=Math.max(1,Math.min(u,r));t(j)}function R(){C&&t(u=>Math.min(u+1,r))}function G(){S&&t(u=>Math.max(u-1,1))}function I(u){o(u),t(1)}function L(){t(r)}function U(){t(1)}return{currentPage:a,goToFirstPage:U,goToLastPage:L,goToPage:M,hasNextPage:C,hasPreviousPage:S,nextPage:R,offset:g,pageSize:i,previousPage:G,setPageSize:I,totalPages:r}}function q(n,e){return n.slice(e.offset,e.offset+e.pageSize)}export{T as CursorButtons,B as CursorPageSizeSelect,D as CursorPageSizeValue,O as CursorPagination,q as getOffsetPaginatedSlice,H as useOffsetPagination};
2
2
  //# sourceMappingURL=pagination.js.map
package/dist/select.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as e,b as t,c as l,d as S,e as c,f as r,g as o,h as a}from"./chunk-6GIEBXSN.js";import"./chunk-MF2QITTY.js";import"./chunk-R4XXPIT2.js";import"./chunk-AZ56JGNY.js";export{e as Select,c as SelectContent,t as SelectGroup,o as SelectItem,r as SelectLabel,a as SelectSeparator,S as SelectTrigger,l as SelectValue};
1
+ import{a as e,b as t,c as l,d as S,e as c,f as r,g as o,h as a}from"./chunk-5Q25P2WN.js";import"./chunk-MF2QITTY.js";import"./chunk-R4XXPIT2.js";import"./chunk-AZ56JGNY.js";export{e as Select,c as SelectContent,t as SelectGroup,o as SelectItem,r as SelectLabel,a as SelectSeparator,S as SelectTrigger,l as SelectValue};
2
2
  //# sourceMappingURL=select.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "mantle is ngrok's UI library and design system.",
4
4
  "author": "ngrok",
5
5
  "license": "MIT",
6
- "version": "0.20.2",
6
+ "version": "0.21.0",
7
7
  "homepage": "https://mantle.ngrok.com",
8
8
  "repository": {
9
9
  "type": "git",
@@ -25,6 +25,7 @@
25
25
  "node": "^22.0.0"
26
26
  },
27
27
  "dependencies": {
28
+ "@ariakit/react": "0.4.15",
28
29
  "@headlessui/react": "2.2.0",
29
30
  "@radix-ui/react-accordion": "1.2.3",
30
31
  "@radix-ui/react-dialog": "1.1.6",
@@ -63,7 +64,7 @@
63
64
  "browserslist": "4.24.4",
64
65
  "date-fns": "3.6.0",
65
66
  "jsdom": "26.0.0",
66
- "postcss": "8.5.2",
67
+ "postcss": "8.5.3",
67
68
  "react": "18.3.1",
68
69
  "react-dom": "18.3.1",
69
70
  "react-router": "7.2.0",
@@ -146,6 +147,11 @@
146
147
  "import": "./dist/color.js",
147
148
  "types": "./dist/color.d.ts"
148
149
  },
150
+ "./combobox": {
151
+ "@ngrok/mantle/source": "./src/components/combobox/index.ts",
152
+ "import": "./dist/combobox.js",
153
+ "types": "./dist/combobox.d.ts"
154
+ },
149
155
  "./compose-refs": {
150
156
  "@ngrok/mantle/source": "./src/utils/compose-refs/index.ts",
151
157
  "import": "./dist/compose-refs.js",
@@ -1,2 +0,0 @@
1
- import{a as S}from"./chunk-MF2QITTY.js";import{b as g}from"./chunk-R4XXPIT2.js";import{a as r}from"./chunk-AZ56JGNY.js";import{CaretDown as P}from"@phosphor-icons/react/CaretDown";import{CaretUp as R}from"@phosphor-icons/react/CaretUp";import{Check as I}from"@phosphor-icons/react/Check";import*as e from"@radix-ui/react-select";import{createContext as N,forwardRef as n,useContext as T}from"react";import{jsx as i,jsxs as u}from"react/jsx-runtime";var h=N({}),B=n(({"aria-invalid":o,children:a,id:t,validation:l,onBlur:s,onChange:d,...p},c)=>i(e.Root,{...p,onValueChange:d,children:i(h.Provider,{value:{"aria-invalid":o,id:t,validation:l,onBlur:s,ref:c},children:a})}));B.displayName="Select";var F=e.Group,G=e.Value,W=n(({"aria-invalid":o,className:a,children:t,id:l,validation:s,...d},p)=>{let c=T(h),m=c["aria-invalid"]??o,x=m!=null&&m!=="false",f=c.validation??s,v=x?"error":typeof f=="function"?f():f,C=m??v==="error",w=c.id??l;return u(e.Trigger,{"aria-invalid":C,"data-validation":v||void 0,className:r("h-9 text-sm","border-form bg-form text-strong placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 hover:border-neutral-400 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left","focus:outline-none focus:ring-4 aria-expanded:ring-4","focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent","data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success","data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning","data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger",a),id:w,ref:S(p,c.ref),...d,children:[t,i(e.Icon,{asChild:!0,children:i(P,{className:"size-4 shrink-0",weight:"bold"})})]})});W.displayName="SelectTrigger";var y=n(({className:o,...a},t)=>i(e.ScrollUpButton,{ref:t,className:r("flex cursor-default items-center justify-center py-1",o),...a,children:i(R,{className:"size-4 shrink-0",weight:"bold"})}));y.displayName="SelectScrollUpButton";var b=n(({className:o,...a},t)=>i(e.ScrollDownButton,{ref:t,className:r("flex cursor-default items-center justify-center py-1",o),...a,children:i(P,{className:"size-4 shrink-0",weight:"bold"})}));b.displayName="SelectScrollDownButton";var L=n(({className:o,children:a,position:t="popper",width:l,...s},d)=>i(e.Portal,{children:u(e.Content,{ref:d,className:r("border-popover 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 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","bg-popover",t==="popper"&&"data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-[var(--radix-select-content-available-height)]",l==="trigger"&&"w-[var(--radix-select-trigger-width)]",o),position:t,...s,children:[i(y,{}),i(e.Viewport,{className:r("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full"),children:a}),i(b,{})]})}));L.displayName="SelectContent";var k=n(({className:o,...a},t)=>i(e.Label,{ref:t,className:r("px-2 py-1.5 text-sm font-semibold",o),...a}));k.displayName="SelectLabel";var V=n(({className:o,children:a,...t},l)=>u(e.Item,{ref:l,className:r("relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm outline-none","focus:bg-popover-hover","data-disabled:pointer-events-none data-disabled:opacity-50","data-state-checked:bg-filled-accent data-state-checked:text-on-filled","focus:data-state-checked:bg-filled-accent",o),...t,children:[i(e.ItemText,{children:a}),i(e.ItemIndicator,{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:i(I,{className:"size-4 shrink-0",weight:"bold"})})]}));V.displayName="SelectItem";var E=n(({className:o,...a},t)=>i(g,{ref:t,className:r("-mx-1 my-1 h-px w-auto",o),...a}));E.displayName="SelectSeparator";export{B as a,F as b,G as c,W as d,L as e,k as f,V as g,E as h};
2
- //# sourceMappingURL=chunk-6GIEBXSN.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/select/select.tsx"],"sourcesContent":["import { CaretDown } from \"@phosphor-icons/react/CaretDown\";\nimport { CaretUp } from \"@phosphor-icons/react/CaretUp\";\nimport { Check } from \"@phosphor-icons/react/Check\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport type {\n\tComponentProps,\n\tComponentPropsWithoutRef,\n\tComponentRef,\n\tFocusEvent,\n\tRef,\n\tSelectHTMLAttributes,\n} from \"react\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport { composeRefs } from \"../../utils/compose-refs/compose-refs.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport type { WithValidation } from \"../input/types.js\";\nimport { Separator } from \"../separator/separator.js\";\n\ntype WithAriaInvalid = Pick<\n\tSelectHTMLAttributes<HTMLSelectElement>,\n\t\"aria-invalid\"\n>;\ntype SelectContextType = WithValidation &\n\tWithAriaInvalid & {\n\t\t/**\n\t\t * Ref for the trigger button.\n\t\t */\n\t\tref?: Ref<HTMLButtonElement>;\n\t\t/**\n\t\t * Event handler called when Select blurs.\n\t\t * @note this is a no-op for now until we can guarantee that it works identically to a native select onBlur\n\t\t */\n\t\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t} & Pick<ComponentProps<\"button\">, \"id\">;\n\nconst SelectContext = createContext<SelectContextType>({});\n\ntype SelectProps = Omit<\n\tComponentPropsWithoutRef<typeof SelectPrimitive.Root>,\n\t\"onValueChange\"\n> &\n\tWithValidation &\n\tWithAriaInvalid & {\n\t\t/**\n\t\t * Event handler called when the value changes.\n\t\t */\n\t\tonChange?: (value: string) => void;\n\t\t/**\n\t\t * Event handler called when Select blurs.\n\t\t * @note this is a no-op for now until we can guarantee that it works identically to a native select onBlur\n\t\t */\n\t\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t} & Pick<ComponentProps<\"button\">, \"id\">;\n\n/**\n * Displays a list of options for the user to pick from—triggered by a button.\n */\nconst Select = forwardRef<HTMLButtonElement, SelectProps>(\n\t(\n\t\t{\n\t\t\t\"aria-invalid\": _ariaInvalid,\n\t\t\tchildren,\n\t\t\tid,\n\t\t\tvalidation,\n\t\t\tonBlur,\n\t\t\tonChange,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\treturn (\n\t\t\t<SelectPrimitive.Root {...props} onValueChange={onChange}>\n\t\t\t\t<SelectContext.Provider\n\t\t\t\t\tvalue={{ \"aria-invalid\": _ariaInvalid, id, validation, onBlur, ref }}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</SelectContext.Provider>\n\t\t\t</SelectPrimitive.Root>\n\t\t);\n\t},\n);\nSelect.displayName = \"Select\";\n\n/**\n * A group of related options within a select menu. Similar to an html `<optgroup>` element.\n * Use in conjunction with Select.Label to ensure good accessibility via automatic labelling.\n */\nconst SelectGroup = SelectPrimitive.Group;\n\n/**\n * The part that reflects the selected value. By default the selected item's text will be rendered. if you require more control, you can instead control the select and pass your own children. It should not be styled to ensure correct positioning. An optional placeholder prop is also available for when the select has no value.\n */\nconst SelectValue = SelectPrimitive.Value;\n\ntype SelectTriggerProps = ComponentPropsWithoutRef<\n\ttypeof SelectPrimitive.Trigger\n> &\n\tWithAriaInvalid &\n\tWithValidation;\n\n/**\n * The button that toggles the select. The Select.Content will position itself adjacent to the trigger.\n */\nconst SelectTrigger = forwardRef<\n\tComponentRef<typeof SelectPrimitive.Trigger>,\n\tSelectTriggerProps\n>(\n\t(\n\t\t{\n\t\t\t\"aria-invalid\": ariaInValidProp,\n\t\t\tclassName,\n\t\t\tchildren,\n\t\t\tid: propId,\n\t\t\tvalidation: propValidation,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ctx = useContext(SelectContext);\n\t\tconst _ariaInvalid = ctx[\"aria-invalid\"] ?? ariaInValidProp;\n\t\tconst isInvalid = _ariaInvalid != null && _ariaInvalid !== \"false\";\n\t\tconst _validation = ctx.validation ?? propValidation;\n\t\tconst validation = isInvalid\n\t\t\t? \"error\"\n\t\t\t: typeof _validation === \"function\"\n\t\t\t\t? _validation()\n\t\t\t\t: _validation;\n\t\tconst ariaInvalid = _ariaInvalid ?? validation === \"error\";\n\t\tconst id = ctx.id ?? propId;\n\n\t\treturn (\n\t\t\t<SelectPrimitive.Trigger\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t\tdata-validation={validation || undefined}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"h-9 text-sm\",\n\t\t\t\t\t\"border-form bg-form text-strong placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 hover:border-neutral-400 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left\",\n\t\t\t\t\t\"focus:outline-none focus:ring-4 aria-expanded:ring-4\",\n\t\t\t\t\t\"focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent\",\n\t\t\t\t\t\"data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success\",\n\t\t\t\t\t\"data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning\",\n\t\t\t\t\t\"data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tid={id}\n\t\t\t\tref={composeRefs(ref, ctx.ref)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t<SelectPrimitive.Icon asChild>\n\t\t\t\t\t<CaretDown className=\"size-4 shrink-0\" weight=\"bold\" />\n\t\t\t\t</SelectPrimitive.Icon>\n\t\t\t</SelectPrimitive.Trigger>\n\t\t);\n\t},\n);\nSelectTrigger.displayName = \"SelectTrigger\";\n\nconst SelectScrollUpButton = forwardRef<\n\tComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.ScrollUpButton\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"flex cursor-default items-center justify-center py-1\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t<CaretUp className=\"size-4 shrink-0\" weight=\"bold\" />\n\t</SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = \"SelectScrollUpButton\";\n\nconst SelectScrollDownButton = forwardRef<\n\tComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.ScrollDownButton\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"flex cursor-default items-center justify-center py-1\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t<CaretDown className=\"size-4 shrink-0\" weight=\"bold\" />\n\t</SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName = \"SelectScrollDownButton\";\n\ntype SelectContentProps = ComponentPropsWithoutRef<\n\ttypeof SelectPrimitive.Content\n> & {\n\twidth?: \"trigger\" | \"content\";\n};\n\n/**\n * The component that pops out when the select is open as a portal adjacent to the trigger button.\n * It contains a scrolling viewport of the select items.\n */\nconst SelectContent = forwardRef<\n\tComponentRef<typeof SelectPrimitive.Content>,\n\tSelectContentProps\n>(({ className, children, position = \"popper\", width, ...props }, ref) => (\n\t<SelectPrimitive.Portal>\n\t\t<SelectPrimitive.Content\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"border-popover 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 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md\",\n\t\t\t\t\"bg-popover\",\n\t\t\t\tposition === \"popper\" &&\n\t\t\t\t\t\"data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-[var(--radix-select-content-available-height)]\",\n\t\t\t\twidth === \"trigger\" && \"w-[var(--radix-select-trigger-width)]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tposition={position}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SelectScrollUpButton />\n\t\t\t<SelectPrimitive.Viewport\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"p-1\",\n\t\t\t\t\tposition === \"popper\" &&\n\t\t\t\t\t\t\"h-[var(--radix-select-trigger-height)] w-full\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</SelectPrimitive.Viewport>\n\t\t\t<SelectScrollDownButton />\n\t\t</SelectPrimitive.Content>\n\t</SelectPrimitive.Portal>\n));\nSelectContent.displayName = \"SelectContent\";\n\n/**\n * Used to render the label of a group. It won't be focusable using arrow keys.\n */\nconst SelectLabel = forwardRef<\n\tComponentRef<typeof SelectPrimitive.Label>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.Label\n\t\tref={ref}\n\t\tclassName={cx(\"px-2 py-1.5 text-sm font-semibold\", className)}\n\t\t{...props}\n\t/>\n));\nSelectLabel.displayName = \"SelectLabel\";\n\n/**\n * An option within a select menu. Similar to an html `<option>` element.\n * Contains a `value` prop that will be passed to the `onChange` handler of the `Select` component when selected.\n * Displays the children as the option's text.\n */\nconst SelectItem = forwardRef<\n\tComponentRef<typeof SelectPrimitive.Item>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n\t<SelectPrimitive.Item\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm outline-none\",\n\t\t\t\"focus:bg-popover-hover\",\n\t\t\t\"data-disabled:pointer-events-none data-disabled:opacity-50\",\n\t\t\t\"data-state-checked:bg-filled-accent data-state-checked:text-on-filled\",\n\t\t\t\"focus:data-state-checked:bg-filled-accent\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n\t\t<SelectPrimitive.ItemIndicator className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t<Check className=\"size-4 shrink-0\" weight=\"bold\" />\n\t\t</SelectPrimitive.ItemIndicator>\n\t</SelectPrimitive.Item>\n));\nSelectItem.displayName = \"SelectItem\";\n\n/**\n * Used to visually separate items in the select.\n */\nconst SelectSeparator = forwardRef<\n\tComponentRef<typeof Separator>,\n\tComponentPropsWithoutRef<typeof Separator>\n>(({ className, ...props }, ref) => (\n\t<Separator\n\t\tref={ref}\n\t\tclassName={cx(\"-mx-1 my-1 h-px w-auto\", className)}\n\t\t{...props}\n\t/>\n));\nSelectSeparator.displayName = \"SelectSeparator\";\n\nexport {\n\tSelect,\n\tSelectGroup,\n\tSelectValue,\n\tSelectTrigger,\n\tSelectContent,\n\tSelectLabel,\n\tSelectItem,\n\tSelectSeparator,\n\tSelectScrollUpButton,\n\tSelectScrollDownButton,\n};\n"],"mappings":"wHAAA,OAAS,aAAAA,MAAiB,kCAC1B,OAAS,WAAAC,MAAe,gCACxB,OAAS,SAAAC,MAAa,8BACtB,UAAYC,MAAqB,yBASjC,OAAS,iBAAAC,EAAe,cAAAC,EAAY,cAAAC,MAAkB,QA4DlD,cAAAC,EA2DD,QAAAC,MA3DC,oBArCJ,IAAMC,EAAgBC,EAAiC,CAAC,CAAC,EAsBnDC,EAASC,EACd,CACC,CACC,eAAgBC,EAChB,SAAAC,EACA,GAAAC,EACA,WAAAC,EACA,OAAAC,EACA,SAAAC,EACA,GAAGC,CACJ,EACAC,IAGCb,EAAiB,OAAhB,CAAsB,GAAGY,EAAO,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B,IAAME,EAAkBjC,EAGtB,CAAC,CAAE,UAAAa,EAAW,GAAGN,CAAM,EAAGC,IAC3Bb,EAACuC,EAAA,CACA,IAAK1B,EACL,UAAWa,EAAG,yBAA0BR,CAAS,EAChD,GAAGN,EACL,CACA,EACD0B,EAAgB,YAAc","names":["CaretDown","CaretUp","Check","SelectPrimitive","createContext","forwardRef","useContext","jsx","jsxs","SelectContext","createContext","Select","forwardRef","_ariaInvalid","children","id","validation","onBlur","onChange","props","ref","SelectGroup","SelectValue","SelectTrigger","ariaInValidProp","className","propId","propValidation","ctx","useContext","isInvalid","_validation","ariaInvalid","cx","composeRefs","CaretDown","SelectScrollUpButton","CaretUp","SelectScrollDownButton","SelectContent","position","width","SelectLabel","SelectItem","Check","SelectSeparator","Separator"]}