@satoshibits/react-json-schema-builder 1.1.3 → 1.1.4
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.
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs16.js +1 -1
- package/dist/index.cjs2.js +1 -1
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs21.js +1 -1
- package/dist/index.cjs31.js +1 -1
- package/dist/index.cjs36.js +1 -1
- package/dist/index.cjs37.js +1 -1
- package/dist/index.cjs37.js.map +1 -1
- package/dist/index.cjs38.js +6 -1
- package/dist/index.cjs38.js.map +1 -1
- package/dist/index.cjs39.js +6 -1
- package/dist/index.cjs39.js.map +1 -1
- package/dist/index.cjs40.js +6 -1
- package/dist/index.cjs40.js.map +1 -1
- package/dist/index.cjs41.js +1 -1
- package/dist/index.cjs41.js.map +1 -1
- package/dist/index.cjs42.js +1 -1
- package/dist/index.cjs42.js.map +1 -1
- package/dist/index.cjs43.js +1 -1
- package/dist/index.cjs43.js.map +1 -1
- package/dist/index.cjs44.js +1 -6
- package/dist/index.cjs44.js.map +1 -1
- package/dist/index.cjs45.js +1 -6
- package/dist/index.cjs45.js.map +1 -1
- package/dist/index.cjs46.js +1 -6
- package/dist/index.cjs46.js.map +1 -1
- package/dist/index.cjs47.js +1 -1
- package/dist/index.cjs55.js +1 -1
- package/dist/index.cjs56.js +1 -1
- package/dist/index.cjs57.js +1 -1
- package/dist/index.cjs57.js.map +1 -1
- package/dist/index.cjs59.js +1 -1
- package/dist/index.cjs59.js.map +1 -1
- package/dist/index.cjs60.js +1 -1
- package/dist/index.cjs60.js.map +1 -1
- package/dist/index.cjs61.js +1 -1
- package/dist/index.cjs61.js.map +1 -1
- package/dist/index.cjs62.js +1 -1
- package/dist/index.cjs62.js.map +1 -1
- package/dist/index.cjs63.js +1 -1
- package/dist/index.cjs63.js.map +1 -1
- package/dist/index.cjs65.js +1 -1
- package/dist/index.cjs67.js +1 -1
- package/dist/index.cjs69.js +1 -1
- package/dist/index.cjs71.js +1 -1
- package/dist/index.cjs72.js +1 -1
- package/dist/index.cjs75.js +1 -1
- package/dist/index.cjs78.js +1 -1
- package/dist/index.cjs78.js.map +1 -1
- package/dist/index.cjs79.js +1 -1
- package/dist/index.cjs79.js.map +1 -1
- package/dist/index.cjs80.js +1 -1
- package/dist/index.cjs80.js.map +1 -1
- package/dist/index.cjs81.js +1 -1
- package/dist/index.cjs81.js.map +1 -1
- package/dist/index.cjs82.js +1 -1
- package/dist/index.cjs82.js.map +1 -1
- package/dist/index.es14.js +4 -4
- package/dist/index.es16.js +5 -5
- package/dist/index.es2.js +23 -21
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es21.js +6 -6
- package/dist/index.es31.js +1 -1
- package/dist/index.es36.js +6 -6
- package/dist/index.es37.js +815 -97
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +10 -56
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +10 -24
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es40.js +10 -45
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +99 -71
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +52 -56
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +19 -827
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +45 -10
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +86 -10
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +60 -10
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +2 -2
- package/dist/index.es55.js +5 -5
- package/dist/index.es56.js +1 -1
- package/dist/index.es57.js +6 -32
- package/dist/index.es57.js.map +1 -1
- package/dist/index.es59.js +64 -5
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es60.js +27 -63
- package/dist/index.es60.js.map +1 -1
- package/dist/index.es61.js +5 -29
- package/dist/index.es61.js.map +1 -1
- package/dist/index.es62.js +24 -5
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +32 -24
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es65.js +1 -1
- package/dist/index.es67.js +3 -3
- package/dist/index.es69.js +1 -1
- package/dist/index.es71.js +6 -6
- package/dist/index.es72.js +1 -1
- package/dist/index.es75.js +1 -1
- package/dist/index.es78.js +11 -67
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +203 -10
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es80.js +20 -203
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +392 -21
- package/dist/index.es81.js.map +1 -1
- package/dist/index.es82.js +61 -386
- package/dist/index.es82.js.map +1 -1
- package/dist/packages/builder/context.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs14.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index.cjs37.js"),l=require("./index.cjs22.js"),n=require("./index.cjs38.js"),d=require("./index.cjs39.js"),u=require("./index.cjs40.js");function p({...t}){return e.jsx(s.Root,{"data-slot":"select",...t})}function m({...t}){return e.jsx(s.Value,{"data-slot":"select-value",...t})}function f({className:t,children:a,...r}){return e.jsxs(s.Trigger,{"data-slot":"select-trigger","data-testid":"select-trigger",className:l.cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex h-9 w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[a,e.jsx(s.Icon,{asChild:!0,children:e.jsx(n.default,{className:"size-4 opacity-50"})})]})}function g({className:t,children:a,position:r="popper",...c}){return e.jsx(s.Portal,{children:e.jsxs(s.Content,{"data-slot":"select-content",className:l.cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...c,children:[e.jsx(o,{}),e.jsx(s.Viewport,{className:l.cn("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),e.jsx(i,{})]})})}function x({className:t,children:a,...r}){return e.jsxs(s.Item,{"data-slot":"select-item",className:l.cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[e.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(s.ItemIndicator,{children:e.jsx(d.default,{className:"size-4"})})}),e.jsx(s.ItemText,{children:a})]})}function o({className:t,...a}){return e.jsx(s.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:l.cn("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(u.default,{className:"size-4"})})}function i({className:t,...a}){return e.jsx(s.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:l.cn("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(n.default,{className:"size-4"})})}exports.Select=p;exports.SelectContent=g;exports.SelectItem=x;exports.SelectScrollDownButton=i;exports.SelectScrollUpButton=o;exports.SelectTrigger=f;exports.SelectValue=m;
|
|
2
2
|
//# sourceMappingURL=index.cjs14.js.map
|
package/dist/index.cjs16.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),m=require("react"),S=require("./index.cjs11.js"),c=require("./index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),m=require("react"),S=require("./index.cjs11.js"),c=require("./index.cjs41.js"),F=require("./index.cjs15.js"),p=require("./index.cjs10.js"),R=require("./index.cjs4.js"),V=require("./index.cjs42.js"),$=require("./index.cjs43.js"),A=require("./index.cjs21.js"),E=require("react-hook-form"),N=require("./index.cjs44.js"),k=require("./index.cjs45.js"),w=A.AddFormSchema.pick({constraints:!0,property:!0});function B({open:f,onOpenChange:h,onSubmit:g,property:i,propertyKey:y}){const r=E.useForm({resolver:N.zodResolver(w),defaultValues:{property:i}}),l=r.watch("constraints"),{getConstraintDefinitionsForType:C,getRendererForConstraint:j,validateConstraintValue:v}=R.useConstraints(),D=e=>{const{constraints:n}=e,a={...n?.reduce((s,o)=>({...s,[o.name]:o.value}),{})};g([y,a]),r.reset()},q=(e,n)=>{const a=p.a(l),s=a?.[e];if(!s){r.setError(`constraints.${e}`,{message:"The constraint was not found",type:"constraint_not_found"});return}const o=v(s.name,n);if(o.status==="error"){let u=o.message;o.code==="invalid"&&(u=`${u}: ${o.error?.map(b=>b.message).join(", ")}`),r.setError(`constraints.${e}`,{type:o.code,message:u});return}s.value=n,r.setValue("constraints",a),r.clearErrors(`constraints.${e}`)},x=e=>{if(!l)return;const a=p.a(l).filter(s=>s.name!==e);r.setValue("constraints",a)},d=m.useMemo(()=>C(typeof i?.type=="string"?i.type:""),[i.type]);return m.useEffect(()=>{const e=[];for(const n of d)n.name in i&&e.push({name:n.name,value:i[n.name]});r.setValue("constraints",e)},[d]),t.jsx(c.Dialog,{open:f,onOpenChange:h,children:t.jsxs(c.DialogContent,{children:[t.jsxs(c.DialogHeader,{children:[t.jsx(c.DialogTitle,{children:"Edit"}),t.jsx(c.DialogDescription,{children:"Constraints and other properties"})]}),t.jsx(k.Form,{...r,children:t.jsxs("form",{onSubmit:r.handleSubmit(D),className:"space-y-4","data-testid":"edit-property-form",children:[d.length?t.jsxs("div",{className:"space-y-2",children:[t.jsx(F.Label,{children:"Constraints"}),t.jsx(V.default,{addedConstraints:l??[],availableDefinitions:d,onAdd:e=>{r.setValue("constraints",e)}}),t.jsx($.Separator,{}),l?.map((e,n)=>{const a=j(e.name);if(!a)return null;const s=r.formState.errors.constraints?.[n];let o;return s&&(o={code:s?.type??"INVALID",message:s.message??"An error occurred"}),t.jsx(a,{constraintName:e.name,value:e.value,onConstraintChange:u=>{q(n,u)},onRemoveConstraint:()=>{x(e.name)},error:o},e.name)})]}):null,t.jsx(c.DialogFooter,{children:t.jsx(S.Button,{type:"submit",children:"Save"})})]})})]})})}exports.EditPropertyDialog=B;
|
|
2
2
|
//# sourceMappingURL=index.cjs16.js.map
|
package/dist/index.cjs2.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),d=require("react"),x=require("./index.cjs9.js"),m=require("./index.cjs10.js"),h=d.createContext(void 0),C={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"title",description:"",properties:{},required:[]};function O({children:c,initialSchema:f}){const[p,n]=d.useState(f??C),[u,a]=d.useState([]);return w.jsx(h.Provider,{value:{schema:p,setSchema:n,path:u,setPath:a},children:c})}function R({onSchemaChange:c}={}){const f=d.useContext(h);if(f===void 0)throw new Error("useSchema must be used within a SchemaProvider");const{path:p,schema:n,setSchema:u}=f,a=(r,e)=>{let t=r,i=null,o=null;for(const s of e)t.type==="array"&&t.items&&!Array.isArray(t.items)&&typeof t.items=="object"&&t.items.type==="object"&&typeof t.items.properties?.[s]=="object"?(o=t.items,i=t.items.properties[s],t=t.items):t.type==="object"&&t.properties&&!Array.isArray(t.properties)&&typeof t.properties[s]=="object"&&(o=t,i=t.properties[s],t=t.properties[s]);return{propertySchema:i,parentSchema:o}},l=r=>{const{propertySchema:e}=a(r??n,p);return e?e.type==="array"?e.items:e:r??n},b=()=>{const{propertySchema:r}=a(n,p);return r},j=(r,e)=>{const t=m.a(n),i=l(t);if(i.properties?.[r]){const o=Object.entries(i.properties).map(([s,v])=>[s===r?e:s,v]);i.properties=Object.fromEntries(o)}i.required?.includes(r)&&(i.required=i.required.map(o=>o===r?e:o)),u(t),c?.(t)},S=(r,e)=>{const t=m.a(n),i=l(t);typeof e=="object"&&"isRequired"in e&&(i.type==="object"&&(i.required||(i.required=[]),e.isRequired?i.required.includes(r)||i.required.push(r):i.required=i.required.filter(s=>s!==r)),delete e.isRequired);let o=!1;if(i.type==="object"&&i.properties){const s=i.properties[r];typeof s!="boolean"&&s&&typeof e!="boolean"&&(e.type&&e.type!==s.type?e={title:s.title,description:s.description,default:s.default,...e}:e.enum?(delete e.type,delete e.items,delete e.properties,e={title:s.title,description:s.description,...e}):e={...s,...e},i.properties[r]=e),o=!0}if(u(t),c?.(t),o)return{status:"success",property:i.properties[r]}},y=(r,e,t)=>{const i=m.a(n),o=l(i);return o.type!=="object"&&(o.type="object"),o.properties||(o.properties={}),o.properties[r]?{status:"error",code:"key-exists",message:`Property with key ${r} already exists`}:(e.enum&&(delete e.type,delete e.items,delete e.properties),e=Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0)),o.properties[r]=e,t&&(o.required||(o.required=[]),o.required.includes(r)||o.required.push(r)),u(i),c?.(i),{status:"success",property:o.properties[r]})},P=r=>{const e=m.a(n),t=l(e);t.type==="object"&&t.required&&(t.required=t.required.filter(i=>i!==r)),t.type==="object"&&t.properties&&delete t.properties[r],u(e),c?.(e)},g=r=>{const e=l().properties;if(!e||x.a(e)||typeof e[r]=="boolean")return;const t=e[r],i=`${r}_copy`,o=m.a(t);return y(i,o,q(r))},q=r=>{if(p.length){const{propertySchema:e}=a(n,p);return e?.type==="array"&&e.items&&typeof e.items!="boolean"&&!Array.isArray(e.items)&&e.items?.type==="object"?!!e.items?.required?.includes(r):!!e?.required?.includes(r)}return!!n?.required?.includes(r)};return{...f,getCurrentSchema:l,getCurrentProperty:b,handlePropertyChange:S,handleAddProperty:y,handleKeyChange:j,navigateToCorrectNesting:a,handleDeleteProperty:P,isPropertyRequired:q,getValue:()=>n,handleDuplicateProperty:g}}exports.SchemaContext=h;exports.SchemaProvider=O;exports.useSchema=R;
|
|
2
2
|
//# sourceMappingURL=index.cjs2.js.map
|
package/dist/index.cjs2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs2.js","sources":["../src/packages/builder/context.tsx"],"sourcesContent":["import { createContext, useContext, useState } from \"react\";\n\nimport type { PropsWithChildren, SetStateAction } from \"react\";\nimport type { JSONSchema7, JSONSchema7Definition } from \"json-schema\";\nimport { clone, isEmpty } from \"remeda\";\nimport type { OperationError } from \"./shared-types\";\n\ninterface ContextState<T extends JSONSchema7> {\n schema: T;\n setSchema: React.Dispatch<T>;\n path: string[];\n setPath: React.Dispatch<SetStateAction<string[]>>;\n}\n\nexport const SchemaContext = createContext<\n ContextState<JSONSchema7> | undefined\n>(undefined);\n\nconst defaultSchema: JSONSchema7 = {\n $schema: \"http://json-schema.org/draft-07/schema#\",\n type: \"object\",\n title: \"title\",\n description: \"\",\n properties: {},\n required: [],\n};\n\nfunction SchemaProvider({\n children,\n initialSchema,\n}: PropsWithChildren<{ initialSchema?: JSONSchema7 }>) {\n const [schema, setSchema] = useState<JSONSchema7>(\n initialSchema ?? defaultSchema,\n );\n\n /**\n * Path represents the path to a nested property in the schema.\n * It should only contain property keys.\n * An empty path means the current schema is the root schema since\n * the path only represents nested properties.\n */\n const [path, setPath] = useState<string[]>([]);\n\n // NOTE: you *might* need to memoize your values\n // Learn more in http://kcd.im/optimize-context\n\n return (\n <SchemaContext.Provider value={{ schema, setSchema, path, setPath }}>\n {children}\n </SchemaContext.Provider>\n );\n}\n\nexport type PropertyAddError = OperationError & {\n status: \"error\";\n};\n\nexport interface PropertyAddSuccess {\n status: \"success\";\n property: JSONSchema7;\n}\n\nexport interface PropertyChangeSuccess {\n status: \"success\";\n property: JSONSchema7Definition;\n}\n\nfunction useSchema({\n onSchemaChange,\n}: {\n onSchemaChange?: (schema: JSONSchema7) => void;\n} = {}) {\n const context = useContext(SchemaContext);\n\n if (context === undefined) {\n throw new Error(\"useSchema must be used within a SchemaProvider\");\n }\n\n const { path, schema, setSchema } = context;\n\n /**\n * Navigates to the correct property schema of the latest key in the provided path.\n *\n * It will traverse both \"properties\" and \"items\" to find the correct property schema.\n *\n * It will only return a property schema if the provided path is valid i.e. it\n * correctly follows the schema's nesting structure.\n *\n * It will only return a parent schema if the provided path is valid i.e. it\n * correctly follows the schema's nesting structure.\n */\n const navigateToCorrectNesting = (\n providedSchema: JSONSchema7,\n providedPath: string[],\n ) => {\n let current = providedSchema;\n let propertySchema: JSONSchema7 | null = null;\n // Should be the schema of type \"object\" containing the property in its properties key\n let parentSchema: JSONSchema7 | null = null;\n\n for (const p of providedPath) {\n if (\n current.type === \"array\" &&\n current.items &&\n !Array.isArray(current.items) &&\n typeof current.items === \"object\" &&\n current.items.type === \"object\" &&\n typeof current.items.properties?.[p] === \"object\"\n ) {\n parentSchema = current.items;\n propertySchema = current.items.properties[p];\n current = current.items;\n } else if (\n current.type === \"object\" &&\n current.properties &&\n !Array.isArray(current.properties) &&\n typeof current.properties[p] === \"object\"\n ) {\n parentSchema = current;\n propertySchema = current.properties[p];\n current = current.properties[p];\n }\n }\n\n return { propertySchema, parentSchema };\n };\n\n /**\n * Gets the current schema of the latest key in the path.\n * If path is empty, it will return the root schema.\n *\n * It should always return the \"object\" schema of the current path.\n */\n const getCurrentSchema = (initialSchema?: JSONSchema7) => {\n // Gets the correct object schema if under nesting\n // Otherwise, return the root schema\n const { propertySchema } = navigateToCorrectNesting(\n initialSchema ?? schema,\n path,\n );\n\n if (propertySchema) {\n if (propertySchema.type === \"array\") {\n return propertySchema.items as JSONSchema7;\n }\n\n return propertySchema;\n }\n\n return initialSchema ?? schema;\n };\n\n /**\n * Gets the correct property schema of the latest key in the path.\n * If no path is provided, it will return null.\n */\n const getCurrentProperty = () => {\n const { propertySchema } = navigateToCorrectNesting(schema, path);\n\n return propertySchema;\n };\n\n /**\n * Change the key of a property in the schema. It expects\n * the find the key at the current path.\n */\n const handleKeyChange = (key: string, newKey: string) => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to change\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n if (current.properties?.[key]) {\n //Important: maintain order as to not confuse users\n const newProperties = Object.entries(current.properties).map(\n ([k, val]) => {\n return [k === key ? newKey : k, val];\n },\n );\n\n current.properties = Object.fromEntries(\n newProperties,\n ) as JSONSchema7[\"properties\"];\n }\n\n if (current.required?.includes(key)) {\n current.required = current.required.map((item) =>\n item === key ? newKey : item,\n );\n }\n\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n };\n\n const handlePropertyChange = (\n key: string,\n updates: Partial<JSONSchema7Definition> & { isRequired?: boolean },\n ): PropertyChangeSuccess | undefined => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to change\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n // Handle required field updates\n if (typeof updates === \"object\" && \"isRequired\" in updates) {\n if (current.type === \"object\") {\n if (!current.required) {\n current.required = [];\n }\n if (updates.isRequired) {\n if (!current.required.includes(key)) {\n current.required.push(key);\n }\n } else {\n current.required = current.required.filter((item) => item !== key);\n }\n }\n delete updates.isRequired;\n }\n\n let isUpdated = false;\n\n // Update the property\n if (current.type === \"object\" && current.properties) {\n const originalProperty = current.properties[key];\n // Ensure the property exists and is not a boolean\n if (typeof originalProperty !== \"boolean\" && originalProperty) {\n if (typeof updates !== \"boolean\") {\n //if updates changes the type of the property,\n //only the title, description, and default properties should remain\n //from the original property\n if (updates.type && updates.type !== originalProperty.type) {\n updates = {\n title: originalProperty.title,\n description: originalProperty.description,\n default: originalProperty.default,\n ...updates,\n };\n } else if (updates.enum) {\n //if the property is an enum, only the title and description should remain\n //from the original property\n delete updates.type;\n delete updates.items;\n delete updates.properties;\n updates = {\n title: originalProperty.title,\n description: originalProperty.description,\n ...updates,\n };\n } else {\n updates = { ...originalProperty, ...updates };\n }\n\n current.properties[key] = updates;\n }\n }\n isUpdated = true;\n }\n\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n\n if (isUpdated) {\n return { status: \"success\", property: current.properties![key]! };\n }\n };\n\n /**\n * Adds a sibling property to the current schema.\n */\n const handleAddProperty = (\n key: string,\n propertyToAdd: JSONSchema7,\n isRequired: boolean,\n ) => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to add\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n // Ensure the current schema has a properties object\n if (current.type !== \"object\") {\n current.type = \"object\";\n }\n if (!current.properties) {\n current.properties = {};\n }\n\n //Ensure there's no existing property with the same key\n if (current.properties[key]) {\n return {\n status: \"error\",\n code: \"key-exists\" as const,\n message: `Property with key ${key} already exists`,\n } satisfies PropertyAddError;\n }\n\n if (propertyToAdd.enum) {\n //ensure that only the enum property is present\n delete propertyToAdd.type;\n delete propertyToAdd.items;\n delete propertyToAdd.properties;\n }\n\n // Add the new property\n current.properties[key] = propertyToAdd;\n\n // Handle required field\n if (isRequired) {\n if (!current.required) {\n current.required = [];\n }\n if (!current.required.includes(key)) {\n current.required.push(key);\n }\n }\n\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n\n return {\n status: \"success\" as const,\n property: current.properties[key],\n } satisfies PropertyAddSuccess;\n };\n\n const handleDeleteProperty = (key: string) => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to delete\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n // Handle required field updates\n if (current.type === \"object\") {\n if (current.required) {\n current.required = current.required.filter((item) => item !== key);\n }\n }\n\n // Delete the property\n if (current.type === \"object\" && current.properties) {\n delete current.properties[key];\n }\n\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n };\n\n const handleDuplicateProperty = (key: string) => {\n const currentProperties = getCurrentSchema().properties;\n if (\n !currentProperties ||\n isEmpty(currentProperties) ||\n typeof currentProperties[key] === \"boolean\"\n ) {\n return;\n }\n\n const propertyToDuplicate = currentProperties[key]!;\n const newKey = `${key}_copy`;\n const newProperty = clone(propertyToDuplicate);\n\n // Add the duplicated property\n return handleAddProperty(newKey, newProperty, isPropertyRequired(key));\n };\n\n const isPropertyRequired = (key: string) => {\n if (path.length) {\n const { propertySchema } = navigateToCorrectNesting(schema, path);\n\n if (\n propertySchema?.type === \"array\" &&\n propertySchema.items &&\n typeof propertySchema.items !== \"boolean\" &&\n !Array.isArray(propertySchema.items) &&\n propertySchema.items?.type === \"object\"\n ) {\n return Boolean(propertySchema.items?.required?.includes(key));\n } else {\n return Boolean(propertySchema?.required?.includes(key));\n }\n }\n\n return Boolean(schema?.required?.includes(key));\n };\n\n /**\n * Programatically get the current schema value\n */\n const getValue = () => {\n return schema;\n };\n\n return {\n ...context,\n getCurrentSchema,\n getCurrentProperty,\n handlePropertyChange,\n handleAddProperty,\n handleKeyChange,\n navigateToCorrectNesting,\n handleDeleteProperty,\n isPropertyRequired,\n getValue,\n handleDuplicateProperty,\n };\n}\n\nexport { SchemaProvider, useSchema };\n"],"names":["SchemaContext","createContext","defaultSchema","SchemaProvider","children","initialSchema","schema","setSchema","useState","path","setPath","jsx","useSchema","onSchemaChange","context","useContext","navigateToCorrectNesting","providedSchema","providedPath","current","propertySchema","parentSchema","p","getCurrentSchema","getCurrentProperty","handleKeyChange","key","newKey","newSchema","clone","newProperties","k","val","item","handlePropertyChange","updates","isUpdated","originalProperty","handleAddProperty","propertyToAdd","isRequired","handleDeleteProperty","handleDuplicateProperty","currentProperties","isEmpty","propertyToDuplicate","newProperty","isPropertyRequired"],"mappings":"mMAcaA,EAAgBC,gBAE3B,MAAS,EAELC,EAA6B,CACjC,QAAS,0CACT,KAAM,SACN,MAAO,QACP,YAAa,GACb,WAAY,CAAC,EACb,SAAU,CAAA,CACZ,EAEA,SAASC,EAAe,CACtB,SAAAC,EACA,cAAAC,CACF,EAAuD,CAC/C,KAAA,CAACC,EAAQC,CAAS,EAAIC,EAAA,SAC1BH,GAAiBH,CACnB,EAQM,CAACO,EAAMC,CAAO,EAAIF,EAAAA,SAAmB,CAAA,CAAE,EAM3C,OAAAG,MAACX,EAAc,SAAd,CAAuB,MAAO,CAAE,OAAAM,EAAQ,UAAAC,EAAW,KAAAE,EAAM,QAAAC,CAAQ,EAC/D,SAAAN,CACH,CAAA,CAEJ,CAgBA,SAASQ,EAAU,CACjB,eAAAC,CACF,EAEI,GAAI,CACA,MAAAC,EAAUC,aAAWf,CAAa,EAExC,GAAIc,IAAY,OACR,MAAA,IAAI,MAAM,gDAAgD,EAGlE,KAAM,CAAE,KAAAL,EAAM,OAAAH,EAAQ,UAAAC,CAAc,EAAAO,EAa9BE,EAA2B,CAC/BC,EACAC,IACG,CACH,IAAIC,EAAUF,EACVG,EAAqC,KAErCC,EAAmC,KAEvC,UAAWC,KAAKJ,EAEZC,EAAQ,OAAS,SACjBA,EAAQ,OACR,CAAC,MAAM,QAAQA,EAAQ,KAAK,GAC5B,OAAOA,EAAQ,OAAU,UACzBA,EAAQ,MAAM,OAAS,UACvB,OAAOA,EAAQ,MAAM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AG,CACvD,CAGF,MAAO,EAAQpB,GAAQ,UAAU,SAASoB,CAAG,CAC/C,EASO,MAAA,CACL,GAAGZ,EACH,iBAAAS,EACA,mBAAAC,EACA,qBAAAU,EACA,kBAAAI,EACA,gBAAAb,EACA,yBAAAT,EACA,qBAAAyB,EACA,mBAAAM,EACA,SAde,IACRzC,EAcP,wBAAAoC,CACF,CACF"}
|
|
1
|
+
{"version":3,"file":"index.cjs2.js","sources":["../src/packages/builder/context.tsx"],"sourcesContent":["import { createContext, useContext, useState } from \"react\";\n\nimport type { PropsWithChildren, SetStateAction } from \"react\";\nimport type { JSONSchema7, JSONSchema7Definition } from \"json-schema\";\nimport { clone, isEmpty } from \"remeda\";\nimport type { OperationError } from \"./shared-types\";\n\ninterface ContextState<T extends JSONSchema7> {\n schema: T;\n setSchema: React.Dispatch<T>;\n path: string[];\n setPath: React.Dispatch<SetStateAction<string[]>>;\n}\n\nexport const SchemaContext = createContext<\n ContextState<JSONSchema7> | undefined\n>(undefined);\n\nconst defaultSchema: JSONSchema7 = {\n $schema: \"http://json-schema.org/draft-07/schema#\",\n type: \"object\",\n title: \"title\",\n description: \"\",\n properties: {},\n required: [],\n};\n\nfunction SchemaProvider({\n children,\n initialSchema,\n}: PropsWithChildren<{ initialSchema?: JSONSchema7 }>) {\n const [schema, setSchema] = useState<JSONSchema7>(\n initialSchema ?? defaultSchema,\n );\n\n /**\n * Path represents the path to a nested property in the schema.\n * It should only contain property keys.\n * An empty path means the current schema is the root schema since\n * the path only represents nested properties.\n */\n const [path, setPath] = useState<string[]>([]);\n\n // NOTE: you *might* need to memoize your values\n // Learn more in http://kcd.im/optimize-context\n\n return (\n <SchemaContext.Provider value={{ schema, setSchema, path, setPath }}>\n {children}\n </SchemaContext.Provider>\n );\n}\n\nexport type PropertyAddError = OperationError & {\n status: \"error\";\n};\n\nexport interface PropertyAddSuccess {\n status: \"success\";\n property: JSONSchema7;\n}\n\nexport interface PropertyChangeSuccess {\n status: \"success\";\n property: JSONSchema7Definition;\n}\n\nfunction useSchema({\n onSchemaChange,\n}: {\n onSchemaChange?: (schema: JSONSchema7) => void;\n} = {}) {\n const context = useContext(SchemaContext);\n\n if (context === undefined) {\n throw new Error(\"useSchema must be used within a SchemaProvider\");\n }\n\n const { path, schema, setSchema } = context;\n\n /**\n * Navigates to the correct property schema of the latest key in the provided path.\n *\n * It will traverse both \"properties\" and \"items\" to find the correct property schema.\n *\n * It will only return a property schema if the provided path is valid i.e. it\n * correctly follows the schema's nesting structure.\n *\n * It will only return a parent schema if the provided path is valid i.e. it\n * correctly follows the schema's nesting structure.\n */\n const navigateToCorrectNesting = (\n providedSchema: JSONSchema7,\n providedPath: string[],\n ) => {\n let current = providedSchema;\n let propertySchema: JSONSchema7 | null = null;\n // Should be the schema of type \"object\" containing the property in its properties key\n let parentSchema: JSONSchema7 | null = null;\n\n for (const p of providedPath) {\n if (\n current.type === \"array\" &&\n current.items &&\n !Array.isArray(current.items) &&\n typeof current.items === \"object\" &&\n current.items.type === \"object\" &&\n typeof current.items.properties?.[p] === \"object\"\n ) {\n parentSchema = current.items;\n propertySchema = current.items.properties[p];\n current = current.items;\n } else if (\n current.type === \"object\" &&\n current.properties &&\n !Array.isArray(current.properties) &&\n typeof current.properties[p] === \"object\"\n ) {\n parentSchema = current;\n propertySchema = current.properties[p];\n current = current.properties[p];\n }\n }\n\n return { propertySchema, parentSchema };\n };\n\n /**\n * Gets the current schema of the latest key in the path.\n * If path is empty, it will return the root schema.\n *\n * It should always return the \"object\" schema of the current path.\n */\n const getCurrentSchema = (initialSchema?: JSONSchema7) => {\n // Gets the correct object schema if under nesting\n // Otherwise, return the root schema\n const { propertySchema } = navigateToCorrectNesting(\n initialSchema ?? schema,\n path,\n );\n\n if (propertySchema) {\n if (propertySchema.type === \"array\") {\n return propertySchema.items as JSONSchema7;\n }\n\n return propertySchema;\n }\n\n return initialSchema ?? schema;\n };\n\n /**\n * Gets the correct property schema of the latest key in the path.\n * If no path is provided, it will return null.\n */\n const getCurrentProperty = () => {\n const { propertySchema } = navigateToCorrectNesting(schema, path);\n\n return propertySchema;\n };\n\n /**\n * Change the key of a property in the schema. It expects\n * the find the key at the current path.\n */\n const handleKeyChange = (key: string, newKey: string) => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to change\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n if (current.properties?.[key]) {\n //Important: maintain order as to not confuse users\n const newProperties = Object.entries(current.properties).map(\n ([k, val]) => {\n return [k === key ? newKey : k, val];\n },\n );\n\n current.properties = Object.fromEntries(\n newProperties,\n ) as JSONSchema7[\"properties\"];\n }\n\n if (current.required?.includes(key)) {\n current.required = current.required.map((item) =>\n item === key ? newKey : item,\n );\n }\n\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n };\n\n const handlePropertyChange = (\n key: string,\n updates: Partial<JSONSchema7Definition> & { isRequired?: boolean },\n ): PropertyChangeSuccess | undefined => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to change\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n // Handle required field updates\n if (typeof updates === \"object\" && \"isRequired\" in updates) {\n if (current.type === \"object\") {\n if (!current.required) {\n current.required = [];\n }\n if (updates.isRequired) {\n if (!current.required.includes(key)) {\n current.required.push(key);\n }\n } else {\n current.required = current.required.filter((item) => item !== key);\n }\n }\n delete updates.isRequired;\n }\n\n let isUpdated = false;\n\n // Update the property\n if (current.type === \"object\" && current.properties) {\n const originalProperty = current.properties[key];\n // Ensure the property exists and is not a boolean\n if (typeof originalProperty !== \"boolean\" && originalProperty) {\n if (typeof updates !== \"boolean\") {\n //if updates changes the type of the property,\n //only the title, description, and default properties should remain\n //from the original property\n if (updates.type && updates.type !== originalProperty.type) {\n updates = {\n title: originalProperty.title,\n description: originalProperty.description,\n default: originalProperty.default,\n ...updates,\n };\n } else if (updates.enum) {\n //if the property is an enum, only the title and description should remain\n //from the original property\n delete updates.type;\n delete updates.items;\n delete updates.properties;\n updates = {\n title: originalProperty.title,\n description: originalProperty.description,\n ...updates,\n };\n } else {\n updates = { ...originalProperty, ...updates };\n }\n\n current.properties[key] = updates;\n }\n }\n isUpdated = true;\n }\n\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n\n if (isUpdated) {\n return { status: \"success\", property: current.properties![key]! };\n }\n };\n\n /**\n * Adds a sibling property to the current schema.\n */\n const handleAddProperty = (\n key: string,\n propertyToAdd: JSONSchema7,\n isRequired: boolean,\n ) => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to add\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n // Ensure the current schema has a properties object\n if (current.type !== \"object\") {\n current.type = \"object\";\n }\n if (!current.properties) {\n current.properties = {};\n }\n\n //Ensure there's no existing property with the same key\n if (current.properties[key]) {\n return {\n status: \"error\",\n code: \"key-exists\" as const,\n message: `Property with key ${key} already exists`,\n } satisfies PropertyAddError;\n }\n\n if (propertyToAdd.enum) {\n //ensure that only the enum property is present\n delete propertyToAdd.type;\n delete propertyToAdd.items;\n delete propertyToAdd.properties;\n }\n\n // Clean the propertyToAdd object ensuring it doesn't contain\n //keys with undefined values\n propertyToAdd = Object.fromEntries(\n Object.entries(propertyToAdd).filter(([, value]) => value !== undefined),\n );\n\n // Add the new property\n current.properties[key] = propertyToAdd;\n\n // Handle required field\n if (isRequired) {\n if (!current.required) {\n current.required = [];\n }\n if (!current.required.includes(key)) {\n current.required.push(key);\n }\n }\n\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n\n return {\n status: \"success\" as const,\n property: current.properties[key],\n } satisfies PropertyAddSuccess;\n };\n\n const handleDeleteProperty = (key: string) => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to delete\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n // Handle required field updates\n if (current.type === \"object\") {\n if (current.required) {\n current.required = current.required.filter((item) => item !== key);\n }\n }\n\n // Delete the property\n if (current.type === \"object\" && current.properties) {\n delete current.properties[key];\n }\n\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n };\n\n const handleDuplicateProperty = (key: string) => {\n const currentProperties = getCurrentSchema().properties;\n if (\n !currentProperties ||\n isEmpty(currentProperties) ||\n typeof currentProperties[key] === \"boolean\"\n ) {\n return;\n }\n\n const propertyToDuplicate = currentProperties[key]!;\n const newKey = `${key}_copy`;\n const newProperty = clone(propertyToDuplicate);\n\n // Add the duplicated property\n return handleAddProperty(newKey, newProperty, isPropertyRequired(key));\n };\n\n const isPropertyRequired = (key: string) => {\n if (path.length) {\n const { propertySchema } = navigateToCorrectNesting(schema, path);\n\n if (\n propertySchema?.type === \"array\" &&\n propertySchema.items &&\n typeof propertySchema.items !== \"boolean\" &&\n !Array.isArray(propertySchema.items) &&\n propertySchema.items?.type === \"object\"\n ) {\n return Boolean(propertySchema.items?.required?.includes(key));\n } else {\n return Boolean(propertySchema?.required?.includes(key));\n }\n }\n\n return Boolean(schema?.required?.includes(key));\n };\n\n /**\n * Programatically get the current schema value\n */\n const getValue = () => {\n return schema;\n };\n\n return {\n ...context,\n getCurrentSchema,\n getCurrentProperty,\n handlePropertyChange,\n handleAddProperty,\n handleKeyChange,\n navigateToCorrectNesting,\n handleDeleteProperty,\n isPropertyRequired,\n getValue,\n handleDuplicateProperty,\n };\n}\n\nexport { SchemaProvider, useSchema };\n"],"names":["SchemaContext","createContext","defaultSchema","SchemaProvider","children","initialSchema","schema","setSchema","useState","path","setPath","jsx","useSchema","onSchemaChange","context","useContext","navigateToCorrectNesting","providedSchema","providedPath","current","propertySchema","parentSchema","p","getCurrentSchema","getCurrentProperty","handleKeyChange","key","newKey","newSchema","clone","newProperties","k","val","item","handlePropertyChange","updates","isUpdated","originalProperty","handleAddProperty","propertyToAdd","isRequired","value","handleDeleteProperty","handleDuplicateProperty","currentProperties","isEmpty","propertyToDuplicate","newProperty","isPropertyRequired"],"mappings":"mMAcaA,EAAgBC,gBAE3B,MAAS,EAELC,EAA6B,CACjC,QAAS,0CACT,KAAM,SACN,MAAO,QACP,YAAa,GACb,WAAY,CAAC,EACb,SAAU,CA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:"Module"});const e=require("react/jsx-runtime"),N=require("./index.cjs11.js"),R=require("./index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("./index.cjs11.js"),R=require("./index.cjs44.js"),m=require("./index.cjs41.js"),E=require("./index.cjs28.js"),L=require("./index.cjs15.js"),a=require("./index.cjs14.js"),k=require("./index.cjs13.js"),v=require("./index.cjs20.js"),h=require("./index.cjs10.js"),w=require("./index.cjs46.js"),M=require("./index.cjs4.js"),P=require("./index.cjs42.js"),$=require("./index.cjs43.js"),o=require("zod"),B=require("react-hook-form"),t=require("./index.cjs45.js"),d=o.z.enum(["string","number","integer","boolean","object","array","null"]),b=o.z.object({key:o.z.string().trim().min(1,{message:"Key must be at least 1 character long"}),property:o.z.object({title:o.z.string().trim().min(1,{message:"Title must be at least 1 character long"}),type:d.or(o.z.array(d)),description:o.z.string().optional(),enum:o.z.array(o.z.string().or(o.z.number()).or(o.z.null()).or(o.z.boolean()).or(o.z.record(o.z.string(),o.z.any()))).optional(),items:o.z.object({type:d.or(o.z.array(d))}).or(o.z.array(o.z.object({type:d.or(o.z.array(d))}).or(o.z.boolean()))).or(o.z.boolean()).optional()}),required:o.z.boolean().default(!1),constraints:o.z.array(o.z.custom(()=>({name:o.z.string().trim().min(1),value:o.z.any()}))).optional()});function _({open:F,onOpenChange:C,onSubmit:S}){const n=B.useForm({resolver:R.zodResolver(b),defaultValues:{key:"",property:{title:""}}}),p=n.watch("constraints"),y=n.watch("property"),z=n.watch("property.enum"),I=n.watch("property.type"),{getConstraintDefinitionsForType:f,getRendererForConstraint:q,validateConstraintValue:D}=M.useConstraints(),A=r=>{const{key:s,property:l,required:c,constraints:i}=r,u={...l,...i?.reduce((j,g)=>({...j,[g.name]:g.value}),{})};S(s,u,c),n.reset()},V=(r,s)=>{const l=h.a(p),c=l?.[r];if(!c){n.setError(`constraints.${r}`,{message:"The constraint was not found",type:"constraint_not_found"});return}const i=D(c.name,s);if(i.status==="error"){let u=i.message;i.code==="invalid"&&(u=`${u}: ${i.error?.map(j=>j.message).join(", ")}`),n.setError(`constraints.${r}`,{type:i.code,message:u});return}c.value=s,n.setValue("constraints",l),n.clearErrors(`constraints.${r}`)},T=r=>{if(!p)return;const l=h.a(p).filter(c=>c.name!==r);n.setValue("constraints",l)},x=f(typeof y?.type=="string"?y.type:"");return e.jsx(m.Dialog,{open:F,onOpenChange:C,children:e.jsxs(m.DialogContent,{"data-testid":"add-property-dialog",children:[e.jsxs(m.DialogHeader,{children:[e.jsx(m.DialogTitle,{children:"Add"}),e.jsx(m.DialogDescription,{children:"Required property values and constraints"})]}),e.jsx(t.Form,{...n,children:e.jsxs("form",{onSubmit:r=>{r.stopPropagation(),r.preventDefault(),n.handleSubmit(A)(r)},className:"space-y-4","data-testid":"add-property-form",id:"add-property-form",children:[e.jsx("div",{className:"space-y-2",children:e.jsx(t.FormField,{control:n.control,name:"key",render:({field:r})=>{const{onChange:s,...l}=r;return e.jsxs(t.FormItem,{children:[e.jsx(t.FormLabel,{children:"Property Key"}),e.jsx(t.FormControl,{children:e.jsx(v.DebouncedInput,{...l,onDebounce:c=>s(c)})}),e.jsx(t.FormMessage,{})]})}})}),e.jsx("div",{className:"space-y-2",children:e.jsx(t.FormField,{control:n.control,name:"property.title",render:({field:r})=>{const{onChange:s,...l}=r;return e.jsxs(t.FormItem,{children:[e.jsx(t.FormLabel,{children:"Property Title"}),e.jsx(t.FormControl,{children:e.jsx(v.DebouncedInput,{...l,onDebounce:c=>s(c)})}),e.jsx(t.FormMessage,{})]})}})}),e.jsx("div",{className:"space-y-2",children:e.jsx(t.FormField,{control:n.control,name:"property.type",render:({field:r})=>e.jsxs(t.FormItem,{children:[e.jsx(t.FormLabel,{children:"Type"}),e.jsx(t.FormControl,{children:e.jsxs(a.Select,{value:Array.isArray(r.value)?void 0:r.value,onValueChange:s=>{s==="enum"?n.setValue("property.enum",[]):n.setValue("property.enum",void 0),r.value==="array"&&s!=="array"&&(n.clearErrors("property.items"),n.setValue("property.items",void 0)),r.onChange(s)},children:[e.jsx(a.SelectTrigger,{className:"w-full","aria-label":"Select type",children:e.jsx(a.SelectValue,{})}),e.jsxs(a.SelectContent,{children:[e.jsx(a.SelectItem,{value:"string",children:"string"}),e.jsx(a.SelectItem,{value:"number",children:"number"}),e.jsx(a.SelectItem,{value:"integer",children:"integer"}),e.jsx(a.SelectItem,{value:"boolean",children:"boolean"}),e.jsx(a.SelectItem,{value:"object",children:"object"}),e.jsx(a.SelectItem,{value:"array",children:"array"}),e.jsx(a.SelectItem,{value:"null",children:"null"})]})]})}),e.jsx(t.FormMessage,{})]})})}),I==="array"&&e.jsx("div",{className:"space-y-2",children:e.jsx(t.FormField,{control:n.control,name:"property.items.type",render:({field:r})=>e.jsxs(t.FormItem,{children:[e.jsx(t.FormLabel,{children:"Items of type"}),e.jsx(t.FormControl,{children:e.jsxs(a.Select,{value:Array.isArray(r.value)?void 0:r.value,onValueChange:s=>{n.clearErrors("property.items.type"),n.setValue("property.items.type",s)},children:[e.jsx(a.SelectTrigger,{className:"w-full","aria-label":"Select items of type",children:e.jsx(a.SelectValue,{placeholder:"Select item type"})}),e.jsxs(a.SelectContent,{children:[e.jsx(a.SelectItem,{value:"string",children:"string"}),e.jsx(a.SelectItem,{value:"number",children:"number"}),e.jsx(a.SelectItem,{value:"integer",children:"integer"}),e.jsx(a.SelectItem,{value:"boolean",children:"boolean"}),e.jsx(a.SelectItem,{value:"object",children:"object"}),e.jsx(a.SelectItem,{value:"array",children:"array"}),e.jsx(a.SelectItem,{value:"null",children:"null"})]})]})}),e.jsx(t.FormMessage,{})]})})}),e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(t.FormField,{control:n.control,name:"required",render:({field:r})=>e.jsxs(t.FormItem,{children:[e.jsx(t.FormControl,{children:e.jsx(k.Switch,{checked:r.value,onCheckedChange:s=>r.onChange(s)})}),e.jsx(t.FormLabel,{children:"Required"}),e.jsx(t.FormMessage,{})]})})}),e.jsx("div",{className:"space-y-2",children:e.jsx(t.FormField,{control:n.control,name:"property.description",render:({field:r})=>e.jsxs(t.FormItem,{children:[e.jsx(t.FormLabel,{children:"Description"}),e.jsx(t.FormControl,{children:e.jsx(E.Input,{...r})}),e.jsx(t.FormMessage,{})]})})}),z?e.jsx(t.FormField,{control:n.control,name:"property.enum",render:({field:r})=>e.jsxs(t.FormItem,{children:[e.jsx(t.FormLabel,{children:"Enum"}),e.jsx(t.FormControl,{children:e.jsx(w.default,{values:r.value?.filter(s=>typeof s=="string")??[],onAddValue:s=>{const l=[];r.value&&l.push(...r.value),l.push(s),r.onChange(l)},onRemoveValue:s=>{const l=h.a(r.value??[]);l.splice(s,1),r.onChange(l)}})}),e.jsx(t.FormMessage,{})]})}):null,x.length?e.jsxs("div",{className:"space-y-2",children:[e.jsx(L.Label,{children:"Constraints"}),e.jsx(P.default,{addedConstraints:p??[],availableDefinitions:x,onAdd:r=>{n.setValue("constraints",r)}}),e.jsx($.Separator,{}),p?.map((r,s)=>{const l=q(r.name);if(!l)return null;const c=n.formState.errors.constraints?.[s];let i;return c&&(i={code:c?.type??"INVALID",message:c.message??"An error occurred"}),e.jsx(l,{constraintName:r.name,value:r.value,onConstraintChange:u=>{V(s,u)},onRemoveConstraint:()=>{T(r.name)},error:i},r.name)})]}):null,e.jsx(m.DialogFooter,{children:e.jsx(N.Button,{type:"submit",form:"add-property-form",children:"Add Property"})})]})})]})})}exports.AddFormSchema=b;exports.AddPropertyDialog=_;
|
|
2
2
|
//# sourceMappingURL=index.cjs21.js.map
|
package/dist/index.cjs31.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),u=require("./index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),u=require("./index.cjs63.js"),i=require("react/jsx-runtime");function c(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const l=c(n);var s="Label",o=l.forwardRef((t,r)=>i.jsx(u.Primitive.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));o.displayName=s;var f=o;exports.Label=o;exports.Root=f;
|
|
2
2
|
//# sourceMappingURL=index.cjs31.js.map
|
package/dist/index.cjs36.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),_=require("./index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),_=require("./index.cjs57.js"),E=require("./index.cjs58.js"),O=require("./index.cjs59.js"),M=require("./index.cjs60.js"),$=require("./index.cjs61.js"),N=require("./index.cjs62.js"),C=require("./index.cjs63.js"),d=require("react/jsx-runtime");function H(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const s=H(T);var v="Switch",[I,z]=O.createContextScope(v),[B,D]=I(v),w=s.forwardRef((e,o)=>{const{__scopeSwitch:t,name:r,checked:c,defaultChecked:l,required:i,disabled:n,value:a="on",onCheckedChange:b,form:S,...p}=e,[u,y]=s.useState(null),j=E.useComposedRefs(o,f=>y(f)),m=s.useRef(!1),x=u?S||!!u.closest("form"):!0,[h=!1,R]=M.useControllableState({prop:c,defaultProp:l,onChange:b});return d.jsxs(B,{scope:t,checked:h,disabled:n,children:[d.jsx(C.Primitive.button,{type:"button",role:"switch","aria-checked":h,"aria-required":i,"data-state":g(h),"data-disabled":n?"":void 0,disabled:n,value:a,...p,ref:j,onClick:_.composeEventHandlers(e.onClick,f=>{R(q=>!q),x&&(m.current=f.isPropagationStopped(),m.current||f.stopPropagation())})}),x&&d.jsx(A,{control:u,bubbles:!m.current,name:r,value:a,checked:h,required:i,disabled:n,form:S,style:{transform:"translateX(-100%)"}})]})});w.displayName=v;var P="SwitchThumb",k=s.forwardRef((e,o)=>{const{__scopeSwitch:t,...r}=e,c=D(P,t);return d.jsx(C.Primitive.span,{"data-state":g(c.checked),"data-disabled":c.disabled?"":void 0,...r,ref:o})});k.displayName=P;var A=e=>{const{control:o,checked:t,bubbles:r=!0,...c}=e,l=s.useRef(null),i=$.usePrevious(t),n=N.useSize(o);return s.useEffect(()=>{const a=l.current,b=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(b,"checked").set;if(i!==t&&p){const u=new Event("click",{bubbles:r});p.call(a,t),a.dispatchEvent(u)}},[i,t,r]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...c,tabIndex:-1,ref:l,style:{...e.style,...n,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function g(e){return e?"checked":"unchecked"}var F=w,L=k;exports.Root=F;exports.Switch=w;exports.SwitchThumb=k;exports.Thumb=L;exports.createSwitchScope=z;
|
|
2
2
|
//# sourceMappingURL=index.cjs36.js.map
|
package/dist/index.cjs37.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./index.cjs55.js"),n=require("./index.cjs22.js"),r=require("./index.cjs30.js");function d({...t}){return e.jsx(o.Root,{"data-slot":"dialog",...t})}function s({...t}){return e.jsx(o.Portal,{"data-slot":"dialog-portal",...t})}function i({className:t,...a}){return e.jsx(o.Overlay,{"data-slot":"dialog-overlay",className:n.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",t),...a})}function c({className:t,children:a,...l}){return e.jsxs(s,{"data-slot":"dialog-portal",children:[e.jsx(i,{}),e.jsxs(o.Content,{"data-slot":"dialog-content",className:n.cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...l,children:[a,e.jsxs(o.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(r.default,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function g({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:n.cn("flex flex-col gap-2 text-center sm:text-left",t),...a})}function u({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:n.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function f({className:t,...a}){return e.jsx(o.Title,{"data-slot":"dialog-title",className:n.cn("text-lg leading-none font-semibold",t),...a})}function x({className:t,...a}){return e.jsx(o.Description,{"data-slot":"dialog-description",className:n.cn("text-muted-foreground text-sm",t),...a})}exports.Dialog=d;exports.DialogContent=c;exports.DialogDescription=x;exports.DialogFooter=u;exports.DialogHeader=g;exports.DialogOverlay=i;exports.DialogPortal=s;exports.DialogTitle=f;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const st=require("react"),ct=require("react-dom"),Le=require("./index.cjs64.js"),E=require("./index.cjs57.js"),lt=require("./index.cjs65.js"),H=require("./index.cjs58.js"),it=require("./index.cjs59.js"),at=require("./index.cjs66.js"),dt=require("./index.cjs67.js"),ut=require("./index.cjs68.js"),pt=require("./index.cjs69.js"),Ie=require("./index.cjs70.js"),ee=require("./index.cjs71.js"),ft=require("./index.cjs72.js"),M=require("./index.cjs63.js"),mt=require("./index.cjs34.js"),ht=require("./index.cjs73.js"),ke=require("./index.cjs60.js"),$=require("./index.cjs74.js"),vt=require("./index.cjs61.js"),St=require("./index.cjs75.js"),gt=require("./index.cjs76.js"),xt=require("./index.cjs77.js"),d=require("react/jsx-runtime");function Ve(o){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(l,e,i.get?i:{enumerable:!0,get:()=>o[e]})}}return l.default=o,Object.freeze(l)}const t=Ve(st),Be=Ve(ct);var wt=[" ","Enter","ArrowUp","ArrowDown"],Ct=[" ","Enter"],se="Select",[ae,de,yt]=lt.createCollection(se),[te,It]=it.createContextScope(se,[yt,ee.createPopperScope]),ue=ee.createPopperScope(),[Tt,G]=te(se),[Pt,Et]=te(se),Te=o=>{const{__scopeSelect:l,children:e,open:i,defaultOpen:r,onOpenChange:u,value:n,defaultValue:s,onValueChange:c,dir:f,name:S,autoComplete:w,disabled:R,required:T,form:y}=o,a=ue(l),[h,g]=t.useState(null),[m,v]=t.useState(null),[F,O]=t.useState(!1),oe=at.useDirection(f),[b=!1,D]=ke.useControllableState({prop:i,defaultProp:r,onChange:u}),[W,Y]=ke.useControllableState({prop:n,defaultProp:s,onChange:c}),L=t.useRef(null),k=h?y||!!h.closest("form"):!0,[U,V]=t.useState(new Set),B=Array.from(U).map(_=>_.props.value).join(";");return d.jsx(ee.Root,{...a,children:d.jsxs(Tt,{required:T,scope:l,trigger:h,onTriggerChange:g,valueNode:m,onValueNodeChange:v,valueNodeHasChildren:F,onValueNodeHasChildrenChange:O,contentId:Ie.useId(),value:W,onValueChange:Y,open:b,onOpenChange:D,dir:oe,triggerPointerDownPosRef:L,disabled:R,children:[d.jsx(ae.Provider,{scope:l,children:d.jsx(Pt,{scope:o.__scopeSelect,onNativeOptionAdd:t.useCallback(_=>{V(j=>new Set(j).add(_))},[]),onNativeOptionRemove:t.useCallback(_=>{V(j=>{const q=new Set(j);return q.delete(_),q})},[]),children:e})}),k?d.jsxs(ot,{"aria-hidden":!0,required:T,tabIndex:-1,name:S,autoComplete:w,value:W,onChange:_=>Y(_.target.value),disabled:R,form:y,children:[W===void 0?d.jsx("option",{value:""}):null,Array.from(U)]},B):null]})})};Te.displayName=se;var qe="SelectTrigger",Pe=t.forwardRef((o,l)=>{const{__scopeSelect:e,disabled:i=!1,...r}=o,u=ue(e),n=G(qe,e),s=n.disabled||i,c=H.useComposedRefs(l,n.onTriggerChange),f=de(e),S=t.useRef("touch"),[w,R,T]=nt(a=>{const h=f().filter(v=>!v.disabled),g=h.find(v=>v.value===n.value),m=rt(h,a,g);m!==void 0&&n.onValueChange(m.value)}),y=a=>{s||(n.onOpenChange(!0),T()),a&&(n.triggerPointerDownPosRef.current={x:Math.round(a.pageX),y:Math.round(a.pageY)})};return d.jsx(ee.Anchor,{asChild:!0,...u,children:d.jsx(M.Primitive.button,{type:"button",role:"combobox","aria-controls":n.contentId,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":"none",dir:n.dir,"data-state":n.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":tt(n.value)?"":void 0,...r,ref:c,onClick:E.composeEventHandlers(r.onClick,a=>{a.currentTarget.focus(),S.current!=="mouse"&&y(a)}),onPointerDown:E.composeEventHandlers(r.onPointerDown,a=>{S.current=a.pointerType;const h=a.target;h.hasPointerCapture(a.pointerId)&&h.releasePointerCapture(a.pointerId),a.button===0&&a.ctrlKey===!1&&a.pointerType==="mouse"&&(y(a),a.preventDefault())}),onKeyDown:E.composeEventHandlers(r.onKeyDown,a=>{const h=w.current!=="";!(a.ctrlKey||a.altKey||a.metaKey)&&a.key.length===1&&R(a.key),!(h&&a.key===" ")&&wt.includes(a.key)&&(y(),a.preventDefault())})})})});Pe.displayName=qe;var Fe="SelectValue",Ee=t.forwardRef((o,l)=>{const{__scopeSelect:e,className:i,style:r,children:u,placeholder:n="",...s}=o,c=G(Fe,e),{onValueNodeHasChildrenChange:f}=c,S=u!==void 0,w=H.useComposedRefs(l,c.onValueNodeChange);return $.useLayoutEffect(()=>{f(S)},[f,S]),d.jsx(M.Primitive.span,{...s,ref:w,style:{pointerEvents:"none"},children:tt(c.value)?d.jsx(d.Fragment,{children:n}):u})});Ee.displayName=Fe;var Rt="SelectIcon",Re=t.forwardRef((o,l)=>{const{__scopeSelect:e,children:i,...r}=o;return d.jsx(M.Primitive.span,{"aria-hidden":!0,...r,ref:l,children:i||"▼"})});Re.displayName=Rt;var bt="SelectPortal",be=o=>d.jsx(ft.Portal,{asChild:!0,...o});be.displayName=bt;var J="SelectContent",_e=t.forwardRef((o,l)=>{const e=G(J,o.__scopeSelect),[i,r]=t.useState();if($.useLayoutEffect(()=>{r(new DocumentFragment)},[]),!e.open){const u=i;return u?Be.createPortal(d.jsx(We,{scope:o.__scopeSelect,children:d.jsx(ae.Slot,{scope:o.__scopeSelect,children:d.jsx("div",{children:o.children})})}),u):null}return d.jsx(Ue,{...o,ref:l})});_e.displayName=J;var A=10,[We,z]=te(J),_t="SelectContentImpl",Ue=t.forwardRef((o,l)=>{const{__scopeSelect:e,position:i="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:u,onPointerDownOutside:n,side:s,sideOffset:c,align:f,alignOffset:S,arrowPadding:w,collisionBoundary:R,collisionPadding:T,sticky:y,hideWhenDetached:a,avoidCollisions:h,...g}=o,m=G(J,e),[v,F]=t.useState(null),[O,oe]=t.useState(null),b=H.useComposedRefs(l,p=>F(p)),[D,W]=t.useState(null),[Y,L]=t.useState(null),k=de(e),[U,V]=t.useState(!1),B=t.useRef(!1);t.useEffect(()=>{if(v)return gt.hideOthers(v)},[v]),ut.useFocusGuards();const _=t.useCallback(p=>{const[I,...N]=k().map(P=>P.ref.current),[x]=N.slice(-1),C=document.activeElement;for(const P of p)if(P===C||(P?.scrollIntoView({block:"nearest"}),P===I&&O&&(O.scrollTop=0),P===x&&O&&(O.scrollTop=O.scrollHeight),P?.focus(),document.activeElement!==C))return},[k,O]),j=t.useCallback(()=>_([D,v]),[_,D,v]);t.useEffect(()=>{U&&j()},[U,j]);const{onOpenChange:q,triggerPointerDownPosRef:K}=m;t.useEffect(()=>{if(v){let p={x:0,y:0};const I=x=>{p={x:Math.abs(Math.round(x.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(x.pageY)-(K.current?.y??0))}},N=x=>{p.x<=10&&p.y<=10?x.preventDefault():v.contains(x.target)||q(!1),document.removeEventListener("pointermove",I),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",N,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",N,{capture:!0})}}},[v,q,K]),t.useEffect(()=>{const p=()=>q(!1);return window.addEventListener("blur",p),window.addEventListener("resize",p),()=>{window.removeEventListener("blur",p),window.removeEventListener("resize",p)}},[q]);const[pe,ce]=nt(p=>{const I=k().filter(C=>!C.disabled),N=I.find(C=>C.ref.current===document.activeElement),x=rt(I,p,N);x&&setTimeout(()=>x.ref.current.focus())}),fe=t.useCallback((p,I,N)=>{const x=!B.current&&!N;(m.value!==void 0&&m.value===I||x)&&(W(p),x&&(B.current=!0))},[m.value]),me=t.useCallback(()=>v?.focus(),[v]),Q=t.useCallback((p,I,N)=>{const x=!B.current&&!N;(m.value!==void 0&&m.value===I||x)&&L(p)},[m.value]),le=i==="popper"?ge:Ke,ne=le===ge?{side:s,sideOffset:c,align:f,alignOffset:S,arrowPadding:w,collisionBoundary:R,collisionPadding:T,sticky:y,hideWhenDetached:a,avoidCollisions:h}:{};return d.jsx(We,{scope:e,content:v,viewport:O,onViewportChange:oe,itemRefCallback:fe,selectedItem:D,onItemLeave:me,itemTextRefCallback:Q,focusSelectedItem:j,selectedItemText:Y,position:i,isPositioned:U,searchRef:pe,children:d.jsx(xt.default,{as:mt.Slot,allowPinchZoom:!0,children:d.jsx(pt.FocusScope,{asChild:!0,trapped:m.open,onMountAutoFocus:p=>{p.preventDefault()},onUnmountAutoFocus:E.composeEventHandlers(r,p=>{m.trigger?.focus({preventScroll:!0}),p.preventDefault()}),children:d.jsx(dt.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:n,onFocusOutside:p=>p.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(le,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:p=>p.preventDefault(),...g,...ne,onPlaced:()=>V(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:E.composeEventHandlers(g.onKeyDown,p=>{const I=p.ctrlKey||p.altKey||p.metaKey;if(p.key==="Tab"&&p.preventDefault(),!I&&p.key.length===1&&ce(p.key),["ArrowUp","ArrowDown","Home","End"].includes(p.key)){let x=k().filter(C=>!C.disabled).map(C=>C.ref.current);if(["ArrowUp","End"].includes(p.key)&&(x=x.slice().reverse()),["ArrowUp","ArrowDown"].includes(p.key)){const C=p.target,P=x.indexOf(C);x=x.slice(P+1)}setTimeout(()=>_(x)),p.preventDefault()}})})})})})})});Ue.displayName=_t;var Nt="SelectItemAlignedPosition",Ke=t.forwardRef((o,l)=>{const{__scopeSelect:e,onPlaced:i,...r}=o,u=G(J,e),n=z(J,e),[s,c]=t.useState(null),[f,S]=t.useState(null),w=H.useComposedRefs(l,b=>S(b)),R=de(e),T=t.useRef(!1),y=t.useRef(!0),{viewport:a,selectedItem:h,selectedItemText:g,focusSelectedItem:m}=n,v=t.useCallback(()=>{if(u.trigger&&u.valueNode&&s&&f&&a&&h&&g){const b=u.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),W=u.valueNode.getBoundingClientRect(),Y=g.getBoundingClientRect();if(u.dir!=="rtl"){const C=Y.left-D.left,P=W.left-C,X=b.left-P,Z=b.width+X,he=Math.max(Z,D.width),ve=window.innerWidth-A,Se=Le.clamp(P,[A,Math.max(A,ve-he)]);s.style.minWidth=Z+"px",s.style.left=Se+"px"}else{const C=D.right-Y.right,P=window.innerWidth-W.right-C,X=window.innerWidth-b.right-P,Z=b.width+X,he=Math.max(Z,D.width),ve=window.innerWidth-A,Se=Le.clamp(P,[A,Math.max(A,ve-he)]);s.style.minWidth=Z+"px",s.style.right=Se+"px"}const L=R(),k=window.innerHeight-A*2,U=a.scrollHeight,V=window.getComputedStyle(f),B=parseInt(V.borderTopWidth,10),_=parseInt(V.paddingTop,10),j=parseInt(V.borderBottomWidth,10),q=parseInt(V.paddingBottom,10),K=B+_+U+q+j,pe=Math.min(h.offsetHeight*5,K),ce=window.getComputedStyle(a),fe=parseInt(ce.paddingTop,10),me=parseInt(ce.paddingBottom,10),Q=b.top+b.height/2-A,le=k-Q,ne=h.offsetHeight/2,p=h.offsetTop+ne,I=B+_+p,N=K-I;if(I<=Q){const C=L.length>0&&h===L[L.length-1].ref.current;s.style.bottom="0px";const P=f.clientHeight-a.offsetTop-a.offsetHeight,X=Math.max(le,ne+(C?me:0)+P+j),Z=I+X;s.style.height=Z+"px"}else{const C=L.length>0&&h===L[0].ref.current;s.style.top="0px";const X=Math.max(Q,B+a.offsetTop+(C?fe:0)+ne)+N;s.style.height=X+"px",a.scrollTop=I-Q+a.offsetTop}s.style.margin=`${A}px 0`,s.style.minHeight=pe+"px",s.style.maxHeight=k+"px",i?.(),requestAnimationFrame(()=>T.current=!0)}},[R,u.trigger,u.valueNode,s,f,a,h,g,u.dir,i]);$.useLayoutEffect(()=>v(),[v]);const[F,O]=t.useState();$.useLayoutEffect(()=>{f&&O(window.getComputedStyle(f).zIndex)},[f]);const oe=t.useCallback(b=>{b&&y.current===!0&&(v(),m?.(),y.current=!1)},[v,m]);return d.jsx(Ot,{scope:e,contentWrapper:s,shouldExpandOnScrollRef:T,onScrollButtonChange:oe,children:d.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(M.Primitive.div,{...r,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Ke.displayName=Nt;var Mt="SelectPopperPosition",ge=t.forwardRef((o,l)=>{const{__scopeSelect:e,align:i="start",collisionPadding:r=A,...u}=o,n=ue(e);return d.jsx(ee.Content,{...n,...u,ref:l,align:i,collisionPadding:r,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ge.displayName=Mt;var[Ot,Ne]=te(J,{}),xe="SelectViewport",Me=t.forwardRef((o,l)=>{const{__scopeSelect:e,nonce:i,...r}=o,u=z(xe,e),n=Ne(xe,e),s=H.useComposedRefs(l,u.onViewportChange),c=t.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),d.jsx(ae.Slot,{scope:e,children:d.jsx(M.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E.composeEventHandlers(r.onScroll,f=>{const S=f.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:R}=n;if(R?.current&&w){const T=Math.abs(c.current-S.scrollTop);if(T>0){const y=window.innerHeight-A*2,a=parseFloat(w.style.minHeight),h=parseFloat(w.style.height),g=Math.max(a,h);if(g<y){const m=g+T,v=Math.min(y,m),F=m-v;w.style.height=v+"px",w.style.bottom==="0px"&&(S.scrollTop=F>0?F:0,w.style.justifyContent="flex-end")}}}c.current=S.scrollTop})})})]})});Me.displayName=xe;var $e="SelectGroup",[At,Dt]=te($e),Ge=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o,r=Ie.useId();return d.jsx(At,{scope:e,id:r,children:d.jsx(M.Primitive.div,{role:"group","aria-labelledby":r,...i,ref:l})})});Ge.displayName=$e;var ze="SelectLabel",Ye=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o,r=Dt(ze,e);return d.jsx(M.Primitive.div,{id:r.id,...i,ref:l})});Ye.displayName=ze;var ie="SelectItem",[jt,Xe]=te(ie),Oe=t.forwardRef((o,l)=>{const{__scopeSelect:e,value:i,disabled:r=!1,textValue:u,...n}=o,s=G(ie,e),c=z(ie,e),f=s.value===i,[S,w]=t.useState(u??""),[R,T]=t.useState(!1),y=H.useComposedRefs(l,m=>c.itemRefCallback?.(m,i,r)),a=Ie.useId(),h=t.useRef("touch"),g=()=>{r||(s.onValueChange(i),s.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(jt,{scope:e,value:i,disabled:r,textId:a,isSelected:f,onItemTextChange:t.useCallback(m=>{w(v=>v||(m?.textContent??"").trim())},[]),children:d.jsx(ae.ItemSlot,{scope:e,value:i,disabled:r,textValue:S,children:d.jsx(M.Primitive.div,{role:"option","aria-labelledby":a,"data-highlighted":R?"":void 0,"aria-selected":f&&R,"data-state":f?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...n,ref:y,onFocus:E.composeEventHandlers(n.onFocus,()=>T(!0)),onBlur:E.composeEventHandlers(n.onBlur,()=>T(!1)),onClick:E.composeEventHandlers(n.onClick,()=>{h.current!=="mouse"&&g()}),onPointerUp:E.composeEventHandlers(n.onPointerUp,()=>{h.current==="mouse"&&g()}),onPointerDown:E.composeEventHandlers(n.onPointerDown,m=>{h.current=m.pointerType}),onPointerMove:E.composeEventHandlers(n.onPointerMove,m=>{h.current=m.pointerType,r?c.onItemLeave?.():h.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E.composeEventHandlers(n.onPointerLeave,m=>{m.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:E.composeEventHandlers(n.onKeyDown,m=>{c.searchRef?.current!==""&&m.key===" "||(Ct.includes(m.key)&&g(),m.key===" "&&m.preventDefault())})})})})});Oe.displayName=ie;var re="SelectItemText",Ae=t.forwardRef((o,l)=>{const{__scopeSelect:e,className:i,style:r,...u}=o,n=G(re,e),s=z(re,e),c=Xe(re,e),f=Et(re,e),[S,w]=t.useState(null),R=H.useComposedRefs(l,g=>w(g),c.onItemTextChange,g=>s.itemTextRefCallback?.(g,c.value,c.disabled)),T=S?.textContent,y=t.useMemo(()=>d.jsx("option",{value:c.value,disabled:c.disabled,children:T},c.value),[c.disabled,c.value,T]),{onNativeOptionAdd:a,onNativeOptionRemove:h}=f;return $.useLayoutEffect(()=>(a(y),()=>h(y)),[a,h,y]),d.jsxs(d.Fragment,{children:[d.jsx(M.Primitive.span,{id:c.textId,...u,ref:R}),c.isSelected&&n.valueNode&&!n.valueNodeHasChildren?Be.createPortal(u.children,n.valueNode):null]})});Ae.displayName=re;var Ze="SelectItemIndicator",De=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o;return Xe(Ze,e).isSelected?d.jsx(M.Primitive.span,{"aria-hidden":!0,...i,ref:l}):null});De.displayName=Ze;var we="SelectScrollUpButton",je=t.forwardRef((o,l)=>{const e=z(we,o.__scopeSelect),i=Ne(we,o.__scopeSelect),[r,u]=t.useState(!1),n=H.useComposedRefs(l,i.onScrollButtonChange);return $.useLayoutEffect(()=>{if(e.viewport&&e.isPositioned){let s=function(){const f=c.scrollTop>0;u(f)};const c=e.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[e.viewport,e.isPositioned]),r?d.jsx(Je,{...o,ref:n,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=e;s&&c&&(s.scrollTop=s.scrollTop-c.offsetHeight)}}):null});je.displayName=we;var Ce="SelectScrollDownButton",He=t.forwardRef((o,l)=>{const e=z(Ce,o.__scopeSelect),i=Ne(Ce,o.__scopeSelect),[r,u]=t.useState(!1),n=H.useComposedRefs(l,i.onScrollButtonChange);return $.useLayoutEffect(()=>{if(e.viewport&&e.isPositioned){let s=function(){const f=c.scrollHeight-c.clientHeight,S=Math.ceil(c.scrollTop)<f;u(S)};const c=e.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[e.viewport,e.isPositioned]),r?d.jsx(Je,{...o,ref:n,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=e;s&&c&&(s.scrollTop=s.scrollTop+c.offsetHeight)}}):null});He.displayName=Ce;var Je=t.forwardRef((o,l)=>{const{__scopeSelect:e,onAutoScroll:i,...r}=o,u=z("SelectScrollButton",e),n=t.useRef(null),s=de(e),c=t.useCallback(()=>{n.current!==null&&(window.clearInterval(n.current),n.current=null)},[]);return t.useEffect(()=>()=>c(),[c]),$.useLayoutEffect(()=>{s().find(S=>S.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),d.jsx(M.Primitive.div,{"aria-hidden":!0,...r,ref:l,style:{flexShrink:0,...r.style},onPointerDown:E.composeEventHandlers(r.onPointerDown,()=>{n.current===null&&(n.current=window.setInterval(i,50))}),onPointerMove:E.composeEventHandlers(r.onPointerMove,()=>{u.onItemLeave?.(),n.current===null&&(n.current=window.setInterval(i,50))}),onPointerLeave:E.composeEventHandlers(r.onPointerLeave,()=>{c()})})}),Ht="SelectSeparator",Qe=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o;return d.jsx(M.Primitive.div,{"aria-hidden":!0,...i,ref:l})});Qe.displayName=Ht;var ye="SelectArrow",et=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o,r=ue(e),u=G(ye,e),n=z(ye,e);return u.open&&n.position==="popper"?d.jsx(ee.Arrow,{...r,...i,ref:l}):null});et.displayName=ye;function tt(o){return o===""||o===void 0}var ot=t.forwardRef((o,l)=>{const{value:e,...i}=o,r=t.useRef(null),u=H.useComposedRefs(l,r),n=vt.usePrevious(e);return t.useEffect(()=>{const s=r.current,c=window.HTMLSelectElement.prototype,S=Object.getOwnPropertyDescriptor(c,"value").set;if(n!==e&&S){const w=new Event("change",{bubbles:!0});S.call(s,e),s.dispatchEvent(w)}},[n,e]),d.jsx(St.VisuallyHidden,{asChild:!0,children:d.jsx("select",{...i,ref:u,defaultValue:e})})});ot.displayName="BubbleSelect";function nt(o){const l=ht.useCallbackRef(o),e=t.useRef(""),i=t.useRef(0),r=t.useCallback(n=>{const s=e.current+n;l(s),function c(f){e.current=f,window.clearTimeout(i.current),f!==""&&(i.current=window.setTimeout(()=>c(""),1e3))}(s)},[l]),u=t.useCallback(()=>{e.current="",window.clearTimeout(i.current)},[]);return t.useEffect(()=>()=>window.clearTimeout(i.current),[]),[e,r,u]}function rt(o,l,e){const r=l.length>1&&Array.from(l).every(f=>f===l[0])?l[0]:l,u=e?o.indexOf(e):-1;let n=Lt(o,Math.max(u,0));r.length===1&&(n=n.filter(f=>f!==e));const c=n.find(f=>f.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==e?c:void 0}function Lt(o,l){return o.map((e,i)=>o[(l+i)%o.length])}var kt=Te,Vt=Pe,Bt=Ee,qt=Re,Ft=be,Wt=_e,Ut=Me,Kt=Oe,$t=Ae,Gt=De,zt=je,Yt=He;exports.Content=Wt;exports.Icon=qt;exports.Item=Kt;exports.ItemIndicator=Gt;exports.ItemText=$t;exports.Portal=Ft;exports.Root=kt;exports.ScrollDownButton=Yt;exports.ScrollUpButton=zt;exports.Select=Te;exports.SelectArrow=et;exports.SelectContent=_e;exports.SelectGroup=Ge;exports.SelectIcon=Re;exports.SelectItem=Oe;exports.SelectItemIndicator=De;exports.SelectItemText=Ae;exports.SelectLabel=Ye;exports.SelectPortal=be;exports.SelectScrollDownButton=He;exports.SelectScrollUpButton=je;exports.SelectSeparator=Qe;exports.SelectTrigger=Pe;exports.SelectValue=Ee;exports.SelectViewport=Me;exports.Trigger=Vt;exports.Value=Bt;exports.Viewport=Ut;exports.createSelectScope=It;
|
|
2
2
|
//# sourceMappingURL=index.cjs37.js.map
|
package/dist/index.cjs37.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs37.js","sources":["../src/components/ui/dialog.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content>) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n className\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\">\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n"],"names":["Dialog","props","DialogPrimitive.Root","DialogPortal","DialogPrimitive.Portal","DialogOverlay","className","jsx","DialogPrimitive.Overlay","cn","DialogContent","children","jsxs","DialogPrimitive.Content","DialogPrimitive.Close","XIcon","DialogHeader","DialogFooter","DialogTitle","DialogPrimitive.Title","DialogDescription","DialogPrimitive.Description"],"mappings":"+MAMA,SAASA,EAAO,CACd,GAAGC,CACL,EAAsD,CACpD,aAAQC,EAAAA,KAAA,CAAqB,YAAU,SAAU,GAAGD,EAAO,CAC7D,CAQA,SAASE,EAAa,CACpB,GAAGF,CACL,EAAwD,CACtD,aAAQG,EAAAA,OAAA,CAAuB,YAAU,gBAAiB,GAAGH,EAAO,CACtE,CAQA,SAASI,EAAc,CACrB,UAAAC,EACA,GAAGL,CACL,EAAyD,CAErD,OAAAM,EAAA,IAACC,EAAgB,QAAhB,CACC,YAAU,iBACV,UAAWC,EAAA,GACT,yJACAH,CACF,EACC,GAAGL,CAAA,CACN,CAEJ,CAEA,SAASS,EAAc,CACrB,UAAAJ,EACA,SAAAK,EACA,GAAGV,CACL,EAAyD,CAErD,OAAAW,EAAA,KAACT,EAAa,CAAA,YAAU,gBACtB,SAAA,CAAAI,EAAA,IAACF,EAAc,EAAA,EACfO,EAAA,KAACC,EAAgB,QAAhB,CACC,YAAU,iBACV,UAAWJ,EAAA,GACT,8WACAH,CACF,EACC,GAAGL,EAEH,SAAA,CAAAU,EACAC,EAAAA,KAAAE,EAAAA,MAAA,CAAsB,UAAU,oWAC/B,SAAA,CAAAP,EAAA,IAACQ,EAAM,QAAA,EAAA,EACNR,EAAA,IAAA,OAAA,CAAK,UAAU,UAAU,SAAK,OAAA,CAAA,CAAA,CACjC,CAAA,CAAA,CAAA,CAAA,CACF,EACF,CAEJ,CAEA,SAASS,EAAa,CAAE,UAAAV,EAAW,GAAGL,GAAsC,CAExE,OAAAM,EAAA,IAAC,MAAA,CACC,YAAU,gBACV,UAAWE,EAAAA,GAAG,+CAAgDH,CAAS,EACtE,GAAGL,CAAA,CACN,CAEJ,CAEA,SAASgB,EAAa,CAAE,UAAAX,EAAW,GAAGL,GAAsC,CAExE,OAAAM,EAAA,IAAC,MAAA,CACC,YAAU,gBACV,UAAWE,EAAA,GACT,yDACAH,CACF,EACC,GAAGL,CAAA,CACN,CAEJ,CAEA,SAASiB,EAAY,CACnB,UAAAZ,EACA,GAAGL,CACL,EAAuD,CAEnD,OAAAM,EAAA,IAACY,EAAgB,MAAhB,CACC,YAAU,eACV,UAAWV,EAAAA,GAAG,qCAAsCH,CAAS,EAC5D,GAAGL,CAAA,CACN,CAEJ,CAEA,SAASmB,EAAkB,CACzB,UAAAd,EACA,GAAGL,CACL,EAA6D,CAEzD,OAAAM,EAAA,IAACc,EAAgB,YAAhB,CACC,YAAU,qBACV,UAAWZ,EAAAA,GAAG,gCAAiCH,CAAS,EACvD,GAAGL,CAAA,CACN,CAEJ"}
|
|
1
|
+
{"version":3,"file":"index.cjs37.js","sources":["../../../node_modules/.pnpm/@radix-ui+react-select@2.1.6_@types+react-dom@18.3.5_@types+react@18.3.18__@types+react_c56d354b83a56e6a914687c302946fec/node_modules/@radix-ui/react-select/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/select/src/select.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { clamp } from \"@radix-ui/number\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { usePrevious } from \"@radix-ui/react-use-previous\";\nimport { VisuallyHidden } from \"@radix-ui/react-visually-hidden\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar OPEN_KEYS = [\" \", \"Enter\", \"ArrowUp\", \"ArrowDown\"];\nvar SELECTION_KEYS = [\" \", \"Enter\"];\nvar SELECT_NAME = \"Select\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME);\nvar [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [\n createCollectionScope,\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME);\nvar [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME);\nvar Select = (props) => {\n const {\n __scopeSelect,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange,\n dir,\n name,\n autoComplete,\n disabled,\n required,\n form\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const [trigger, setTrigger] = React.useState(null);\n const [valueNode, setValueNode] = React.useState(null);\n const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);\n const direction = useDirection(dir);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange\n });\n const triggerPointerDownPosRef = React.useRef(null);\n const isFormControl = trigger ? form || !!trigger.closest(\"form\") : true;\n const [nativeOptionsSet, setNativeOptionsSet] = React.useState(/* @__PURE__ */ new Set());\n const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(\";\");\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsxs(\n SelectProvider,\n {\n required,\n scope: __scopeSelect,\n trigger,\n onTriggerChange: setTrigger,\n valueNode,\n onValueNodeChange: setValueNode,\n valueNodeHasChildren,\n onValueNodeHasChildrenChange: setValueNodeHasChildren,\n contentId: useId(),\n value,\n onValueChange: setValue,\n open,\n onOpenChange: setOpen,\n dir: direction,\n triggerPointerDownPosRef,\n disabled,\n children: [\n /* @__PURE__ */ jsx(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(\n SelectNativeOptionsProvider,\n {\n scope: props.__scopeSelect,\n onNativeOptionAdd: React.useCallback((option) => {\n setNativeOptionsSet((prev) => new Set(prev).add(option));\n }, []),\n onNativeOptionRemove: React.useCallback((option) => {\n setNativeOptionsSet((prev) => {\n const optionsSet = new Set(prev);\n optionsSet.delete(option);\n return optionsSet;\n });\n }, []),\n children\n }\n ) }),\n isFormControl ? /* @__PURE__ */ jsxs(\n BubbleSelect,\n {\n \"aria-hidden\": true,\n required,\n tabIndex: -1,\n name,\n autoComplete,\n value,\n onChange: (event) => setValue(event.target.value),\n disabled,\n form,\n children: [\n value === void 0 ? /* @__PURE__ */ jsx(\"option\", { value: \"\" }) : null,\n Array.from(nativeOptionsSet)\n ]\n },\n nativeSelectKey\n ) : null\n ]\n }\n ) });\n};\nSelect.displayName = SELECT_NAME;\nvar TRIGGER_NAME = \"SelectTrigger\";\nvar SelectTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, disabled = false, ...triggerProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(TRIGGER_NAME, __scopeSelect);\n const isDisabled = context.disabled || disabled;\n const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);\n const getItems = useCollection(__scopeSelect);\n const pointerTypeRef = React.useRef(\"touch\");\n const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.value === context.value);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem !== void 0) {\n context.onValueChange(nextItem.value);\n }\n });\n const handleOpen = (pointerEvent) => {\n if (!isDisabled) {\n context.onOpenChange(true);\n resetTypeahead();\n }\n if (pointerEvent) {\n context.triggerPointerDownPosRef.current = {\n x: Math.round(pointerEvent.pageX),\n y: Math.round(pointerEvent.pageY)\n };\n }\n };\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n role: \"combobox\",\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open,\n \"aria-required\": context.required,\n \"aria-autocomplete\": \"none\",\n dir: context.dir,\n \"data-state\": context.open ? \"open\" : \"closed\",\n disabled: isDisabled,\n \"data-disabled\": isDisabled ? \"\" : void 0,\n \"data-placeholder\": shouldShowPlaceholder(context.value) ? \"\" : void 0,\n ...triggerProps,\n ref: composedRefs,\n onClick: composeEventHandlers(triggerProps.onClick, (event) => {\n event.currentTarget.focus();\n if (pointerTypeRef.current !== \"mouse\") {\n handleOpen(event);\n }\n }),\n onPointerDown: composeEventHandlers(triggerProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n const target = event.target;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n if (event.button === 0 && event.ctrlKey === false && event.pointerType === \"mouse\") {\n handleOpen(event);\n event.preventDefault();\n }\n }),\n onKeyDown: composeEventHandlers(triggerProps.onKeyDown, (event) => {\n const isTypingAhead = searchRef.current !== \"\";\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n if (isTypingAhead && event.key === \" \") return;\n if (OPEN_KEYS.includes(event.key)) {\n handleOpen();\n event.preventDefault();\n }\n })\n }\n ) });\n }\n);\nSelectTrigger.displayName = TRIGGER_NAME;\nvar VALUE_NAME = \"SelectValue\";\nvar SelectValue = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, className, style, children, placeholder = \"\", ...valueProps } = props;\n const context = useSelectContext(VALUE_NAME, __scopeSelect);\n const { onValueNodeHasChildrenChange } = context;\n const hasChildren = children !== void 0;\n const composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange);\n useLayoutEffect(() => {\n onValueNodeHasChildrenChange(hasChildren);\n }, [onValueNodeHasChildrenChange, hasChildren]);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...valueProps,\n ref: composedRefs,\n style: { pointerEvents: \"none\" },\n children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ jsx(Fragment, { children: placeholder }) : children\n }\n );\n }\n);\nSelectValue.displayName = VALUE_NAME;\nvar ICON_NAME = \"SelectIcon\";\nvar SelectIcon = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, children, ...iconProps } = props;\n return /* @__PURE__ */ jsx(Primitive.span, { \"aria-hidden\": true, ...iconProps, ref: forwardedRef, children: children || \"\\u25BC\" });\n }\n);\nSelectIcon.displayName = ICON_NAME;\nvar PORTAL_NAME = \"SelectPortal\";\nvar SelectPortal = (props) => {\n return /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, ...props });\n};\nSelectPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"SelectContent\";\nvar SelectContent = React.forwardRef(\n (props, forwardedRef) => {\n const context = useSelectContext(CONTENT_NAME, props.__scopeSelect);\n const [fragment, setFragment] = React.useState();\n useLayoutEffect(() => {\n setFragment(new DocumentFragment());\n }, []);\n if (!context.open) {\n const frag = fragment;\n return frag ? ReactDOM.createPortal(\n /* @__PURE__ */ jsx(SelectContentProvider, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsx(\"div\", { children: props.children }) }) }),\n frag\n ) : null;\n }\n return /* @__PURE__ */ jsx(SelectContentImpl, { ...props, ref: forwardedRef });\n }\n);\nSelectContent.displayName = CONTENT_NAME;\nvar CONTENT_MARGIN = 10;\nvar [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME);\nvar CONTENT_IMPL_NAME = \"SelectContentImpl\";\nvar SelectContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeSelect,\n position = \"item-aligned\",\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n //\n // PopperContent props\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions,\n //\n ...contentProps\n } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const [content, setContent] = React.useState(null);\n const [viewport, setViewport] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [selectedItem, setSelectedItem] = React.useState(null);\n const [selectedItemText, setSelectedItemText] = React.useState(\n null\n );\n const getItems = useCollection(__scopeSelect);\n const [isPositioned, setIsPositioned] = React.useState(false);\n const firstValidItemFoundRef = React.useRef(false);\n React.useEffect(() => {\n if (content) return hideOthers(content);\n }, [content]);\n useFocusGuards();\n const focusFirst = React.useCallback(\n (candidates) => {\n const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);\n const [lastItem] = restItems.slice(-1);\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate?.scrollIntoView({ block: \"nearest\" });\n if (candidate === firstItem && viewport) viewport.scrollTop = 0;\n if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;\n candidate?.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n },\n [getItems, viewport]\n );\n const focusSelectedItem = React.useCallback(\n () => focusFirst([selectedItem, content]),\n [focusFirst, selectedItem, content]\n );\n React.useEffect(() => {\n if (isPositioned) {\n focusSelectedItem();\n }\n }, [isPositioned, focusSelectedItem]);\n const { onOpenChange, triggerPointerDownPosRef } = context;\n React.useEffect(() => {\n if (content) {\n let pointerMoveDelta = { x: 0, y: 0 };\n const handlePointerMove = (event) => {\n pointerMoveDelta = {\n x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)),\n y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0))\n };\n };\n const handlePointerUp = (event) => {\n if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) {\n event.preventDefault();\n } else {\n if (!content.contains(event.target)) {\n onOpenChange(false);\n }\n }\n document.removeEventListener(\"pointermove\", handlePointerMove);\n triggerPointerDownPosRef.current = null;\n };\n if (triggerPointerDownPosRef.current !== null) {\n document.addEventListener(\"pointermove\", handlePointerMove);\n document.addEventListener(\"pointerup\", handlePointerUp, { capture: true, once: true });\n }\n return () => {\n document.removeEventListener(\"pointermove\", handlePointerMove);\n document.removeEventListener(\"pointerup\", handlePointerUp, { capture: true });\n };\n }\n }, [content, onOpenChange, triggerPointerDownPosRef]);\n React.useEffect(() => {\n const close = () => onOpenChange(false);\n window.addEventListener(\"blur\", close);\n window.addEventListener(\"resize\", close);\n return () => {\n window.removeEventListener(\"blur\", close);\n window.removeEventListener(\"resize\", close);\n };\n }, [onOpenChange]);\n const [searchRef, handleTypeaheadSearch] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.ref.current === document.activeElement);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem) {\n setTimeout(() => nextItem.ref.current.focus());\n }\n });\n const itemRefCallback = React.useCallback(\n (node, value, disabled) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== void 0 && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItem(node);\n if (isFirstValidItem) firstValidItemFoundRef.current = true;\n }\n },\n [context.value]\n );\n const handleItemLeave = React.useCallback(() => content?.focus(), [content]);\n const itemTextRefCallback = React.useCallback(\n (node, value, disabled) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== void 0 && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItemText(node);\n }\n },\n [context.value]\n );\n const SelectPosition = position === \"popper\" ? SelectPopperPosition : SelectItemAlignedPosition;\n const popperContentProps = SelectPosition === SelectPopperPosition ? {\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions\n } : {};\n return /* @__PURE__ */ jsx(\n SelectContentProvider,\n {\n scope: __scopeSelect,\n content,\n viewport,\n onViewportChange: setViewport,\n itemRefCallback,\n selectedItem,\n onItemLeave: handleItemLeave,\n itemTextRefCallback,\n focusSelectedItem,\n selectedItemText,\n position,\n isPositioned,\n searchRef,\n children: /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n trapped: context.open,\n onMountAutoFocus: (event) => {\n event.preventDefault();\n },\n onUnmountAutoFocus: composeEventHandlers(onCloseAutoFocus, (event) => {\n context.trigger?.focus({ preventScroll: true });\n event.preventDefault();\n }),\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents: true,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside: (event) => event.preventDefault(),\n onDismiss: () => context.onOpenChange(false),\n children: /* @__PURE__ */ jsx(\n SelectPosition,\n {\n role: \"listbox\",\n id: context.contentId,\n \"data-state\": context.open ? \"open\" : \"closed\",\n dir: context.dir,\n onContextMenu: (event) => event.preventDefault(),\n ...contentProps,\n ...popperContentProps,\n onPlaced: () => setIsPositioned(true),\n ref: composedRefs,\n style: {\n // flex layout so we can place the scroll buttons properly\n display: \"flex\",\n flexDirection: \"column\",\n // reset the outline by default as the content MAY get focused\n outline: \"none\",\n ...contentProps.style\n },\n onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (event.key === \"Tab\") event.preventDefault();\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n if ([\"ArrowUp\", \"ArrowDown\", \"Home\", \"End\"].includes(event.key)) {\n const items = getItems().filter((item) => !item.disabled);\n let candidateNodes = items.map((item) => item.ref.current);\n if ([\"ArrowUp\", \"End\"].includes(event.key)) {\n candidateNodes = candidateNodes.slice().reverse();\n }\n if ([\"ArrowUp\", \"ArrowDown\"].includes(event.key)) {\n const currentElement = event.target;\n const currentIndex = candidateNodes.indexOf(currentElement);\n candidateNodes = candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n event.preventDefault();\n }\n })\n }\n )\n }\n )\n }\n ) })\n }\n );\n }\n);\nSelectContentImpl.displayName = CONTENT_IMPL_NAME;\nvar ITEM_ALIGNED_POSITION_NAME = \"SelectItemAlignedPosition\";\nvar SelectItemAlignedPosition = React.forwardRef((props, forwardedRef) => {\n const { __scopeSelect, onPlaced, ...popperProps } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(CONTENT_NAME, __scopeSelect);\n const [contentWrapper, setContentWrapper] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const getItems = useCollection(__scopeSelect);\n const shouldExpandOnScrollRef = React.useRef(false);\n const shouldRepositionRef = React.useRef(true);\n const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;\n const position = React.useCallback(() => {\n if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {\n const triggerRect = context.trigger.getBoundingClientRect();\n const contentRect = content.getBoundingClientRect();\n const valueNodeRect = context.valueNode.getBoundingClientRect();\n const itemTextRect = selectedItemText.getBoundingClientRect();\n if (context.dir !== \"rtl\") {\n const itemTextOffset = itemTextRect.left - contentRect.left;\n const left = valueNodeRect.left - itemTextOffset;\n const leftDelta = triggerRect.left - left;\n const minContentWidth = triggerRect.width + leftDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const rightEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedLeft = clamp(left, [\n CONTENT_MARGIN,\n // Prevents the content from going off the starting edge of the\n // viewport. It may still go off the ending edge, but this can be\n // controlled by the user since they may want to manage overflow in a\n // specific way.\n // https://github.com/radix-ui/primitives/issues/2049\n Math.max(CONTENT_MARGIN, rightEdge - contentWidth)\n ]);\n contentWrapper.style.minWidth = minContentWidth + \"px\";\n contentWrapper.style.left = clampedLeft + \"px\";\n } else {\n const itemTextOffset = contentRect.right - itemTextRect.right;\n const right = window.innerWidth - valueNodeRect.right - itemTextOffset;\n const rightDelta = window.innerWidth - triggerRect.right - right;\n const minContentWidth = triggerRect.width + rightDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const leftEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedRight = clamp(right, [\n CONTENT_MARGIN,\n Math.max(CONTENT_MARGIN, leftEdge - contentWidth)\n ]);\n contentWrapper.style.minWidth = minContentWidth + \"px\";\n contentWrapper.style.right = clampedRight + \"px\";\n }\n const items = getItems();\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const itemsHeight = viewport.scrollHeight;\n const contentStyles = window.getComputedStyle(content);\n const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);\n const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);\n const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);\n const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);\n const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth;\n const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);\n const viewportStyles = window.getComputedStyle(viewport);\n const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);\n const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);\n const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - CONTENT_MARGIN;\n const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;\n const selectedItemHalfHeight = selectedItem.offsetHeight / 2;\n const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;\n const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;\n const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;\n const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;\n if (willAlignWithoutTopOverflow) {\n const isLastItem = items.length > 0 && selectedItem === items[items.length - 1].ref.current;\n contentWrapper.style.bottom = \"0px\";\n const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;\n const clampedTriggerMiddleToBottomEdge = Math.max(\n triggerMiddleToBottomEdge,\n selectedItemHalfHeight + // viewport might have padding bottom, include it to avoid a scrollable viewport\n (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth\n );\n const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;\n contentWrapper.style.height = height + \"px\";\n } else {\n const isFirstItem = items.length > 0 && selectedItem === items[0].ref.current;\n contentWrapper.style.top = \"0px\";\n const clampedTopEdgeToTriggerMiddle = Math.max(\n topEdgeToTriggerMiddle,\n contentBorderTopWidth + viewport.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport\n (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight\n );\n const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;\n contentWrapper.style.height = height + \"px\";\n viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;\n }\n contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;\n contentWrapper.style.minHeight = minContentHeight + \"px\";\n contentWrapper.style.maxHeight = availableHeight + \"px\";\n onPlaced?.();\n requestAnimationFrame(() => shouldExpandOnScrollRef.current = true);\n }\n }, [\n getItems,\n context.trigger,\n context.valueNode,\n contentWrapper,\n content,\n viewport,\n selectedItem,\n selectedItemText,\n context.dir,\n onPlaced\n ]);\n useLayoutEffect(() => position(), [position]);\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n const handleScrollButtonChange = React.useCallback(\n (node) => {\n if (node && shouldRepositionRef.current === true) {\n position();\n focusSelectedItem?.();\n shouldRepositionRef.current = false;\n }\n },\n [position, focusSelectedItem]\n );\n return /* @__PURE__ */ jsx(\n SelectViewportProvider,\n {\n scope: __scopeSelect,\n contentWrapper,\n shouldExpandOnScrollRef,\n onScrollButtonChange: handleScrollButtonChange,\n children: /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: setContentWrapper,\n style: {\n display: \"flex\",\n flexDirection: \"column\",\n position: \"fixed\",\n zIndex: contentZIndex\n },\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...popperProps,\n ref: composedRefs,\n style: {\n // When we get the height of the content, it includes borders. If we were to set\n // the height without having `boxSizing: 'border-box'` it would be too big.\n boxSizing: \"border-box\",\n // We need to ensure the content doesn't get taller than the wrapper\n maxHeight: \"100%\",\n ...popperProps.style\n }\n }\n )\n }\n )\n }\n );\n});\nSelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;\nvar POPPER_POSITION_NAME = \"SelectPopperPosition\";\nvar SelectPopperPosition = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeSelect,\n align = \"start\",\n collisionPadding = CONTENT_MARGIN,\n ...popperProps\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n return /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n ...popperScope,\n ...popperProps,\n ref: forwardedRef,\n align,\n collisionPadding,\n style: {\n // Ensure border-box for floating-ui calculations\n boxSizing: \"border-box\",\n ...popperProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-select-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-select-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-select-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-select-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-select-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n});\nSelectPopperPosition.displayName = POPPER_POSITION_NAME;\nvar [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME, {});\nvar VIEWPORT_NAME = \"SelectViewport\";\nvar SelectViewport = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, nonce, ...viewportProps } = props;\n const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);\n const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);\n const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);\n const prevScrollTopRef = React.useRef(0);\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n \"style\",\n {\n dangerouslySetInnerHTML: {\n __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`\n },\n nonce\n }\n ),\n /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-radix-select-viewport\": \"\",\n role: \"presentation\",\n ...viewportProps,\n ref: composedRefs,\n style: {\n // we use position: 'relative' here on the `viewport` so that when we call\n // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport\n // (independent of the scrollUpButton).\n position: \"relative\",\n flex: 1,\n // Viewport should only be scrollable in the vertical direction.\n // This won't work in vertical writing modes, so we'll need to\n // revisit this if/when that is supported\n // https://developer.chrome.com/blog/vertical-form-controls\n overflow: \"hidden auto\",\n ...viewportProps.style\n },\n onScroll: composeEventHandlers(viewportProps.onScroll, (event) => {\n const viewport = event.currentTarget;\n const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;\n if (shouldExpandOnScrollRef?.current && contentWrapper) {\n const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);\n if (scrolledBy > 0) {\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const cssMinHeight = parseFloat(contentWrapper.style.minHeight);\n const cssHeight = parseFloat(contentWrapper.style.height);\n const prevHeight = Math.max(cssMinHeight, cssHeight);\n if (prevHeight < availableHeight) {\n const nextHeight = prevHeight + scrolledBy;\n const clampedNextHeight = Math.min(availableHeight, nextHeight);\n const heightDiff = nextHeight - clampedNextHeight;\n contentWrapper.style.height = clampedNextHeight + \"px\";\n if (contentWrapper.style.bottom === \"0px\") {\n viewport.scrollTop = heightDiff > 0 ? heightDiff : 0;\n contentWrapper.style.justifyContent = \"flex-end\";\n }\n }\n }\n }\n prevScrollTopRef.current = viewport.scrollTop;\n })\n }\n ) })\n ] });\n }\n);\nSelectViewport.displayName = VIEWPORT_NAME;\nvar GROUP_NAME = \"SelectGroup\";\nvar [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME);\nvar SelectGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...groupProps } = props;\n const groupId = useId();\n return /* @__PURE__ */ jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx(Primitive.div, { role: \"group\", \"aria-labelledby\": groupId, ...groupProps, ref: forwardedRef }) });\n }\n);\nSelectGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"SelectLabel\";\nvar SelectLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...labelProps } = props;\n const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);\n return /* @__PURE__ */ jsx(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });\n }\n);\nSelectLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"SelectItem\";\nvar [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);\nvar SelectItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeSelect,\n value,\n disabled = false,\n textValue: textValueProp,\n ...itemProps\n } = props;\n const context = useSelectContext(ITEM_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);\n const isSelected = context.value === value;\n const [textValue, setTextValue] = React.useState(textValueProp ?? \"\");\n const [isFocused, setIsFocused] = React.useState(false);\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => contentContext.itemRefCallback?.(node, value, disabled)\n );\n const textId = useId();\n const pointerTypeRef = React.useRef(\"touch\");\n const handleSelect = () => {\n if (!disabled) {\n context.onValueChange(value);\n context.onOpenChange(false);\n }\n };\n if (value === \"\") {\n throw new Error(\n \"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.\"\n );\n }\n return /* @__PURE__ */ jsx(\n SelectItemContextProvider,\n {\n scope: __scopeSelect,\n value,\n disabled,\n textId,\n isSelected,\n onItemTextChange: React.useCallback((node) => {\n setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? \"\").trim());\n }, []),\n children: /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeSelect,\n value,\n disabled,\n textValue,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"option\",\n \"aria-labelledby\": textId,\n \"data-highlighted\": isFocused ? \"\" : void 0,\n \"aria-selected\": isSelected && isFocused,\n \"data-state\": isSelected ? \"checked\" : \"unchecked\",\n \"aria-disabled\": disabled || void 0,\n \"data-disabled\": disabled ? \"\" : void 0,\n tabIndex: disabled ? void 0 : -1,\n ...itemProps,\n ref: composedRefs,\n onFocus: composeEventHandlers(itemProps.onFocus, () => setIsFocused(true)),\n onBlur: composeEventHandlers(itemProps.onBlur, () => setIsFocused(false)),\n onClick: composeEventHandlers(itemProps.onClick, () => {\n if (pointerTypeRef.current !== \"mouse\") handleSelect();\n }),\n onPointerUp: composeEventHandlers(itemProps.onPointerUp, () => {\n if (pointerTypeRef.current === \"mouse\") handleSelect();\n }),\n onPointerDown: composeEventHandlers(itemProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n }),\n onPointerMove: composeEventHandlers(itemProps.onPointerMove, (event) => {\n pointerTypeRef.current = event.pointerType;\n if (disabled) {\n contentContext.onItemLeave?.();\n } else if (pointerTypeRef.current === \"mouse\") {\n event.currentTarget.focus({ preventScroll: true });\n }\n }),\n onPointerLeave: composeEventHandlers(itemProps.onPointerLeave, (event) => {\n if (event.currentTarget === document.activeElement) {\n contentContext.onItemLeave?.();\n }\n }),\n onKeyDown: composeEventHandlers(itemProps.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef?.current !== \"\";\n if (isTypingAhead && event.key === \" \") return;\n if (SELECTION_KEYS.includes(event.key)) handleSelect();\n if (event.key === \" \") event.preventDefault();\n })\n }\n )\n }\n )\n }\n );\n }\n);\nSelectItem.displayName = ITEM_NAME;\nvar ITEM_TEXT_NAME = \"SelectItemText\";\nvar SelectItemText = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, className, style, ...itemTextProps } = props;\n const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);\n const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);\n const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);\n const [itemTextNode, setItemTextNode] = React.useState(null);\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => setItemTextNode(node),\n itemContext.onItemTextChange,\n (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)\n );\n const textContent = itemTextNode?.textContent;\n const nativeOption = React.useMemo(\n () => /* @__PURE__ */ jsx(\"option\", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),\n [itemContext.disabled, itemContext.value, textContent]\n );\n const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;\n useLayoutEffect(() => {\n onNativeOptionAdd(nativeOption);\n return () => onNativeOptionRemove(nativeOption);\n }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),\n itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM.createPortal(itemTextProps.children, context.valueNode) : null\n ] });\n }\n);\nSelectItemText.displayName = ITEM_TEXT_NAME;\nvar ITEM_INDICATOR_NAME = \"SelectItemIndicator\";\nvar SelectItemIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...itemIndicatorProps } = props;\n const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);\n return itemContext.isSelected ? /* @__PURE__ */ jsx(Primitive.span, { \"aria-hidden\": true, ...itemIndicatorProps, ref: forwardedRef }) : null;\n }\n);\nSelectItemIndicator.displayName = ITEM_INDICATOR_NAME;\nvar SCROLL_UP_BUTTON_NAME = \"SelectScrollUpButton\";\nvar SelectScrollUpButton = React.forwardRef((props, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const [canScrollUp, setCanScrollUp] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n let handleScroll2 = function() {\n const canScrollUp2 = viewport.scrollTop > 0;\n setCanScrollUp(canScrollUp2);\n };\n var handleScroll = handleScroll2;\n const viewport = contentContext.viewport;\n handleScroll2();\n viewport.addEventListener(\"scroll\", handleScroll2);\n return () => viewport.removeEventListener(\"scroll\", handleScroll2);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n return canScrollUp ? /* @__PURE__ */ jsx(\n SelectScrollButtonImpl,\n {\n ...props,\n ref: composedRefs,\n onAutoScroll: () => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight;\n }\n }\n }\n ) : null;\n});\nSelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;\nvar SCROLL_DOWN_BUTTON_NAME = \"SelectScrollDownButton\";\nvar SelectScrollDownButton = React.forwardRef((props, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const [canScrollDown, setCanScrollDown] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n let handleScroll2 = function() {\n const maxScroll = viewport.scrollHeight - viewport.clientHeight;\n const canScrollDown2 = Math.ceil(viewport.scrollTop) < maxScroll;\n setCanScrollDown(canScrollDown2);\n };\n var handleScroll = handleScroll2;\n const viewport = contentContext.viewport;\n handleScroll2();\n viewport.addEventListener(\"scroll\", handleScroll2);\n return () => viewport.removeEventListener(\"scroll\", handleScroll2);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n return canScrollDown ? /* @__PURE__ */ jsx(\n SelectScrollButtonImpl,\n {\n ...props,\n ref: composedRefs,\n onAutoScroll: () => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight;\n }\n }\n }\n ) : null;\n});\nSelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;\nvar SelectScrollButtonImpl = React.forwardRef((props, forwardedRef) => {\n const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;\n const contentContext = useSelectContentContext(\"SelectScrollButton\", __scopeSelect);\n const autoScrollTimerRef = React.useRef(null);\n const getItems = useCollection(__scopeSelect);\n const clearAutoScrollTimer = React.useCallback(() => {\n if (autoScrollTimerRef.current !== null) {\n window.clearInterval(autoScrollTimerRef.current);\n autoScrollTimerRef.current = null;\n }\n }, []);\n React.useEffect(() => {\n return () => clearAutoScrollTimer();\n }, [clearAutoScrollTimer]);\n useLayoutEffect(() => {\n const activeItem = getItems().find((item) => item.ref.current === document.activeElement);\n activeItem?.ref.current?.scrollIntoView({ block: \"nearest\" });\n }, [getItems]);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"aria-hidden\": true,\n ...scrollIndicatorProps,\n ref: forwardedRef,\n style: { flexShrink: 0, ...scrollIndicatorProps.style },\n onPointerDown: composeEventHandlers(scrollIndicatorProps.onPointerDown, () => {\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n }),\n onPointerMove: composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {\n contentContext.onItemLeave?.();\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n }),\n onPointerLeave: composeEventHandlers(scrollIndicatorProps.onPointerLeave, () => {\n clearAutoScrollTimer();\n })\n }\n );\n});\nvar SEPARATOR_NAME = \"SelectSeparator\";\nvar SelectSeparator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...separatorProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { \"aria-hidden\": true, ...separatorProps, ref: forwardedRef });\n }\n);\nSelectSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"SelectArrow\";\nvar SelectArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(ARROW_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ARROW_NAME, __scopeSelect);\n return context.open && contentContext.position === \"popper\" ? /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }) : null;\n }\n);\nSelectArrow.displayName = ARROW_NAME;\nfunction shouldShowPlaceholder(value) {\n return value === \"\" || value === void 0;\n}\nvar BubbleSelect = React.forwardRef(\n (props, forwardedRef) => {\n const { value, ...selectProps } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const prevValue = usePrevious(value);\n React.useEffect(() => {\n const select = ref.current;\n const selectProto = window.HTMLSelectElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n selectProto,\n \"value\"\n );\n const setValue = descriptor.set;\n if (prevValue !== value && setValue) {\n const event = new Event(\"change\", { bubbles: true });\n setValue.call(select, value);\n select.dispatchEvent(event);\n }\n }, [prevValue, value]);\n return /* @__PURE__ */ jsx(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx(\"select\", { ...selectProps, ref: composedRefs, defaultValue: value }) });\n }\n);\nBubbleSelect.displayName = \"BubbleSelect\";\nfunction useTypeaheadSearch(onSearchChange) {\n const handleSearchChange = useCallbackRef(onSearchChange);\n const searchRef = React.useRef(\"\");\n const timerRef = React.useRef(0);\n const handleTypeaheadSearch = React.useCallback(\n (key) => {\n const search = searchRef.current + key;\n handleSearchChange(search);\n (function updateSearch(value) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== \"\") timerRef.current = window.setTimeout(() => updateSearch(\"\"), 1e3);\n })(search);\n },\n [handleSearchChange]\n );\n const resetTypeahead = React.useCallback(() => {\n searchRef.current = \"\";\n window.clearTimeout(timerRef.current);\n }, []);\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n return [searchRef, handleTypeaheadSearch, resetTypeahead];\n}\nfunction findNextItem(items, search, currentItem) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1;\n let wrappedItems = wrapArray(items, Math.max(currentItemIndex, 0));\n const excludeCurrentItem = normalizedSearch.length === 1;\n if (excludeCurrentItem) wrappedItems = wrappedItems.filter((v) => v !== currentItem);\n const nextItem = wrappedItems.find(\n (item) => item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextItem !== currentItem ? nextItem : void 0;\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root2 = Select;\nvar Trigger = SelectTrigger;\nvar Value = SelectValue;\nvar Icon = SelectIcon;\nvar Portal = SelectPortal;\nvar Content2 = SelectContent;\nvar Viewport = SelectViewport;\nvar Group = SelectGroup;\nvar Label = SelectLabel;\nvar Item = SelectItem;\nvar ItemText = SelectItemText;\nvar ItemIndicator = SelectItemIndicator;\nvar ScrollUpButton = SelectScrollUpButton;\nvar ScrollDownButton = SelectScrollDownButton;\nvar Separator = SelectSeparator;\nvar Arrow2 = SelectArrow;\nexport {\n Arrow2 as Arrow,\n Content2 as Content,\n Group,\n Icon,\n Item,\n ItemIndicator,\n ItemText,\n Label,\n Portal,\n Root2 as Root,\n ScrollDownButton,\n ScrollUpButton,\n Select,\n SelectArrow,\n SelectContent,\n SelectGroup,\n SelectIcon,\n SelectItem,\n SelectItemIndicator,\n SelectItemText,\n SelectLabel,\n SelectPortal,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n SelectViewport,\n Separator,\n Trigger,\n Value,\n Viewport,\n createSelectScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["OPEN_KEYS","SELECTION_KEYS","SELECT_NAME","Collection","useCollection","createCollectionScope","createCollection","createSelectContext","createSelectScope","createContextScope","createPopperScope","usePopperScope","SelectProvider","useSelectContext","SelectNativeOptionsProvider","useSelectNativeOptionsContext","Select","props","__scopeSelect","children","openProp","defaultOpen","onOpenChange","valueProp","defaultValue","onValueChange","dir","name","autoComplete","disabled","required","form","popperScope","trigger","setTrigger","React","valueNode","setValueNode","valueNodeHasChildren","setValueNodeHasChildren","direction","useDirection","open","setOpen","useControllableState","value","setValue","triggerPointerDownPosRef","isFormControl","nativeOptionsSet","setNativeOptionsSet","nativeSelectKey","option","jsx","PopperPrimitive.Root","jsxs","useId","prev","optionsSet","BubbleSelect","event","TRIGGER_NAME","SelectTrigger","forwardedRef","triggerProps","context","isDisabled","composedRefs","useComposedRefs","getItems","pointerTypeRef","searchRef","handleTypeaheadSearch","resetTypeahead","useTypeaheadSearch","search","enabledItems","item","currentItem","nextItem","findNextItem","handleOpen","pointerEvent","PopperPrimitive.Anchor","Primitive","shouldShowPlaceholder","composeEventHandlers","target","isTypingAhead","VALUE_NAME","SelectValue","className","style","placeholder","valueProps","onValueNodeHasChildrenChange","hasChildren","useLayoutEffect","Fragment","ICON_NAME","SelectIcon","iconProps","PORTAL_NAME","SelectPortal","PortalPrimitive","CONTENT_NAME","SelectContent","fragment","setFragment","frag","ReactDOM","SelectContentProvider","SelectContentImpl","CONTENT_MARGIN","useSelectContentContext","CONTENT_IMPL_NAME","position","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","side","sideOffset","align","alignOffset","arrowPadding","collisionBoundary","collisionPadding","sticky","hideWhenDetached","avoidCollisions","contentProps","content","setContent","viewport","setViewport","node","selectedItem","setSelectedItem","selectedItemText","setSelectedItemText","isPositioned","setIsPositioned","firstValidItemFoundRef","hideOthers","useFocusGuards","focusFirst","candidates","firstItem","restItems","lastItem","PREVIOUSLY_FOCUSED_ELEMENT","candidate","focusSelectedItem","pointerMoveDelta","handlePointerMove","handlePointerUp","close","itemRefCallback","isFirstValidItem","handleItemLeave","itemTextRefCallback","SelectPosition","SelectPopperPosition","SelectItemAlignedPosition","popperContentProps","RemoveScroll","Slot","FocusScope","DismissableLayer","isModifierKey","candidateNodes","currentElement","currentIndex","ITEM_ALIGNED_POSITION_NAME","onPlaced","popperProps","contentContext","contentWrapper","setContentWrapper","shouldExpandOnScrollRef","shouldRepositionRef","triggerRect","contentRect","valueNodeRect","itemTextRect","itemTextOffset","left","leftDelta","minContentWidth","contentWidth","rightEdge","clampedLeft","clamp","right","rightDelta","leftEdge","clampedRight","items","availableHeight","itemsHeight","contentStyles","contentBorderTopWidth","contentPaddingTop","contentBorderBottomWidth","contentPaddingBottom","fullContentHeight","minContentHeight","viewportStyles","viewportPaddingTop","viewportPaddingBottom","topEdgeToTriggerMiddle","triggerMiddleToBottomEdge","selectedItemHalfHeight","itemOffsetMiddle","contentTopToItemMiddle","itemMiddleToContentBottom","isLastItem","viewportOffsetBottom","clampedTriggerMiddleToBottomEdge","height","isFirstItem","contentZIndex","setContentZIndex","handleScrollButtonChange","SelectViewportProvider","POPPER_POSITION_NAME","PopperPrimitive.Content","useSelectViewportContext","VIEWPORT_NAME","SelectViewport","nonce","viewportProps","viewportContext","prevScrollTopRef","scrolledBy","cssMinHeight","cssHeight","prevHeight","nextHeight","clampedNextHeight","heightDiff","GROUP_NAME","SelectGroupContextProvider","useSelectGroupContext","SelectGroup","groupProps","groupId","LABEL_NAME","SelectLabel","labelProps","groupContext","ITEM_NAME","SelectItemContextProvider","useSelectItemContext","SelectItem","textValueProp","itemProps","isSelected","textValue","setTextValue","isFocused","setIsFocused","textId","handleSelect","prevTextValue","ITEM_TEXT_NAME","SelectItemText","itemTextProps","itemContext","nativeOptionsContext","itemTextNode","setItemTextNode","textContent","nativeOption","onNativeOptionAdd","onNativeOptionRemove","ITEM_INDICATOR_NAME","SelectItemIndicator","itemIndicatorProps","SCROLL_UP_BUTTON_NAME","SelectScrollUpButton","canScrollUp","setCanScrollUp","handleScroll2","canScrollUp2","SelectScrollButtonImpl","SCROLL_DOWN_BUTTON_NAME","SelectScrollDownButton","canScrollDown","setCanScrollDown","maxScroll","canScrollDown2","onAutoScroll","scrollIndicatorProps","autoScrollTimerRef","clearAutoScrollTimer","SEPARATOR_NAME","SelectSeparator","separatorProps","ARROW_NAME","SelectArrow","arrowProps","PopperPrimitive.Arrow","selectProps","ref","prevValue","usePrevious","select","selectProto","VisuallyHidden","onSearchChange","handleSearchChange","useCallbackRef","timerRef","key","updateSearch","normalizedSearch","char","currentItemIndex","wrappedItems","wrapArray","v","array","startIndex","_","index","Root2","Trigger","Value","Icon","Portal","Content2","Viewport","Item","ItemText","ItemIndicator","ScrollUpButton","ScrollDownButton"],"mappings":"+kCA4BA,IAAIA,GAAY,CAAC,IAAK,QAAS,UAAW,WAAW,EACjDC,GAAiB,CAAC,IAAK,OAAO,EAC9BC,GAAc,SACd,CAACC,GAAYC,GAAeC,EAAqB,EAAIC,GAAAA,iBAAiBJ,EAAW,EACjF,CAACK,GAAqBC,EAAiB,EAAIC,GAAAA,mBAAmBP,GAAa,CAC7EG,GACAK,GAAAA,iBACF,CAAC,EACGC,GAAiBD,GAAAA,kBAAmB,EACpC,CAACE,GAAgBC,CAAgB,EAAIN,GAAoBL,EAAW,EACpE,CAACY,GAA6BC,EAA6B,EAAIR,GAAoBL,EAAW,EAC9Fc,GAAUC,GAAU,CACtB,KAAM,CACJ,cAAAC,EACA,SAAAC,EACA,KAAMC,EACN,YAAAC,EACA,aAAAC,EACA,MAAOC,EACP,aAAAC,EACA,cAAAC,EACA,IAAAC,EACA,KAAAC,EACA,aAAAC,EACA,SAAAC,EACA,SAAAC,EACA,KAAAC,CACJ,EAAMd,EACEe,EAAcrB,GAAeO,CAAa,EAC1C,CAACe,EAASC,CAAU,EAAIC,EAAM,SAAS,IAAI,EAC3C,CAACC,EAAWC,CAAY,EAAIF,EAAM,SAAS,IAAI,EAC/C,CAACG,EAAsBC,CAAuB,EAAIJ,EAAM,SAAS,EAAK,EACtEK,GAAYC,G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nF,MAAMC,EAAWgP,EAAa,KAC3BlP,GAASA,EAAK,UAAU,YAAW,EAAG,WAAW+O,EAAiB,YAAa,CAAA,CACjF,EACD,OAAO7O,IAAaD,EAAcC,EAAW,MAC/C,CACA,SAASiP,GAAUE,EAAOC,EAAY,CACpC,OAAOD,EAAM,IAAI,CAACE,EAAGC,IAAUH,GAAOC,EAAaE,GAASH,EAAM,MAAM,CAAC,CAC3E,CACG,IAACI,GAAQtT,GACRuT,GAAUzQ,GACV0Q,GAAQ9O,GACR+O,GAAOrO,GACPsO,GAASnO,GACToO,GAAWjO,GACXkO,GAAWvG,GAGXwG,GAAO/E,GACPgF,GAAWpE,GACXqE,GAAgB1D,GAChB2D,GAAiBxD,GACjByD,GAAmBlD","x_google_ignoreList":[0]}
|
package/dist/index.cjs38.js
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./index.cjs49.js");/**
|
|
2
|
+
* @license lucide-react v0.477.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const e=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],t=o.default("ChevronDown",e);exports.__iconNode=e;exports.default=t;
|
|
2
7
|
//# sourceMappingURL=index.cjs38.js.map
|
package/dist/index.cjs38.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs38.js","sources":["
|
|
1
|
+
{"version":3,"file":"index.cjs38.js","sources":["../../../node_modules/.pnpm/lucide-react@0.477.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-down.js"],"sourcesContent":["/**\n * @license lucide-react v0.477.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m6 9 6 6 6-6\", key: \"qrunsl\" }]];\nconst ChevronDown = createLucideIcon(\"ChevronDown\", __iconNode);\n\nexport { __iconNode, ChevronDown as default };\n//# sourceMappingURL=chevron-down.js.map\n"],"names":["__iconNode","ChevronDown","createLucideIcon"],"mappings":"gJAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASK,MAACA,EAAa,CAAC,CAAC,OAAQ,CAAE,EAAG,eAAgB,IAAK,SAAU,CAAC,EAC5DC,EAAcC,EAAAA,QAAiB,cAAeF,CAAU","x_google_ignoreList":[0]}
|
package/dist/index.cjs39.js
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs49.js");/**
|
|
2
|
+
* @license lucide-react v0.477.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],c=t.default("Check",e);exports.__iconNode=e;exports.default=c;
|
|
2
7
|
//# sourceMappingURL=index.cjs39.js.map
|
package/dist/index.cjs39.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs39.js","sources":["
|
|
1
|
+
{"version":3,"file":"index.cjs39.js","sources":["../../../node_modules/.pnpm/lucide-react@0.477.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check.js"],"sourcesContent":["/**\n * @license lucide-react v0.477.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]];\nconst Check = createLucideIcon(\"Check\", __iconNode);\n\nexport { __iconNode, Check as default };\n//# sourceMappingURL=check.js.map\n"],"names":["__iconNode","Check","createLucideIcon"],"mappings":"gJAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASK,MAACA,EAAa,CAAC,CAAC,OAAQ,CAAE,EAAG,kBAAmB,IAAK,SAAU,CAAC,EAC/DC,EAAQC,EAAAA,QAAiB,QAASF,CAAU","x_google_ignoreList":[0]}
|