@mintlify/msft-sdk 1.1.36 → 1.1.38

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.
@@ -1,7 +1,6 @@
1
1
  import "react/jsx-runtime";
2
- import "@mintlify/validation";
3
- const r = (t) => t.type === "enum<integer>" || t.type === "enum<number>" || t.type === "enum<string>";
2
+ const t = (e) => e.type === "enum<integer>" || e.type === "enum<number>" || e.type === "enum<string>";
4
3
  export {
5
- r as isEnum
4
+ t as isEnum
6
5
  };
7
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.tsx"],"sourcesContent":["\nimport {\n AnySchema,\n BooleanSchema,\n DataSchema,\n DataSchemaArray,\n FileSchema,\n IncrementalDataSchema,\n IncrementalDataSchemaArray,\n NullSchema,\n NumberEnumSchema,\n NumberSchema,\n StringEnumSchema,\n StringSchema,\n} from '@mintlify/validation';\n\nimport { ParamHead } from '@/components/Api/Param';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { Description } from '../../components/Description';\nimport { ExampleDescription } from '../ExampleDescription';\nimport { EnumConstTable, EnumOptions } from './Enum';\nimport { NumberMetadata } from './NumberMetadata';\nimport { StringMetadata } from './StringMetadata';\nimport { FieldType } from '@/api-playground-2/types/api';\n\nexport type PrimitiveParamFieldParams = {\n fieldType: FieldType;\n schema:\n | BooleanSchema\n | StringSchema\n | NumberSchema\n | StringEnumSchema\n | NumberEnumSchema\n | FileSchema\n | NullSchema\n | AnySchema;\n schemaArray?: DataSchemaArray | IncrementalDataSchemaArray;\n typeOptions: string[];\n name?: string | null;\n location?: string;\n selectedIndex?: number;\n onSelectTypeOption?: (index: number) => void;\n parentName?: string;\n paramId?: string;\n style?: string;\n explode?: boolean;\n};\n\nexport const PrimitiveParamField = ({\n fieldType,\n schema,\n schemaArray,\n name,\n location,\n typeOptions,\n selectedIndex,\n onSelectTypeOption,\n parentName,\n paramId,\n style,\n explode,\n}: PrimitiveParamFieldParams) => {\n const typeLabel = typeOptions[selectedIndex ?? 0];\n\n const description =\n schema.description ??\n (name === undefined ? `The ${fieldType} is of type \\`${typeLabel}\\`.` : undefined);\n\n return (\n <div className=\"mint:py-6\">\n <ParamHead\n id={paramId}\n name={name}\n typeLabel={typeLabel}\n location={location}\n fieldType={fieldType}\n required={schema.required}\n deprecated={schema.deprecated}\n defaultValue={schema.default}\n typeOptions={typeOptions}\n selectedTypeOptionIndex={selectedIndex}\n onSelectTypeOption={onSelectTypeOption}\n parentName={parentName}\n style={style}\n explode={explode}\n />\n <div className={cn({ 'mint:mt-4': description || isEnum(schema) })}>\n {description && <Description markdown={description} />}\n {schemaArray && isEnumWithConsts(schemaArray) ? (\n <EnumConstTable schemaArray={schemaArray} />\n ) : (\n isEnum(schema) && <EnumOptions schema={schema} />\n )}\n {isStringSchema(schema) && <StringMetadata schema={schema} description={description} />}\n {isNumberSchema(schema) && <NumberMetadata schema={schema} />}\n <ExampleDescription schema={schema} />\n </div>\n </div>\n );\n};\n\nexport const isEnum = (\n schema: DataSchema | IncrementalDataSchema\n): schema is NumberEnumSchema | StringEnumSchema => {\n return (\n schema.type === 'enum<integer>' ||\n schema.type === 'enum<number>' ||\n schema.type === 'enum<string>'\n );\n};\n\nexport const isEnumWithConsts = (\n schemaArray?: DataSchemaArray | IncrementalDataSchemaArray\n): boolean => {\n if (!schemaArray) return false;\n return schemaArray.some((schema) => isEnum(schema) && 'const' in schema);\n};\n\nconst isStringSchema = (schema: DataSchema | IncrementalDataSchema): schema is StringSchema => {\n return schema.type === 'string';\n};\n\nconst isNumberSchema = (schema: DataSchema | IncrementalDataSchema): schema is NumberSchema => {\n return schema.type === 'number' || schema.type === 'integer';\n};\n"],"names":["isEnum","schema"],"mappings":";;AAsGO,MAAMA,IAAS,CACpBC,MAGEA,EAAO,SAAS,mBAChBA,EAAO,SAAS,kBAChBA,EAAO,SAAS;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.tsx"],"sourcesContent":["\nimport {\n AnySchema,\n BooleanSchema,\n DataSchema,\n DataSchemaArray,\n FileSchema,\n IncrementalDataSchema,\n IncrementalDataSchemaArray,\n NullSchema,\n NumberEnumSchema,\n NumberSchema,\n StringEnumSchema,\n StringSchema,\n} from '@mintlify/validation';\n\nimport { ParamHead } from '@/components/Api/Param';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { Description } from '../../components/Description';\nimport { ExampleDescription } from '../ExampleDescription';\nimport { EnumConstTable, EnumOptions } from './Enum';\nimport { NumberMetadata } from './NumberMetadata';\nimport { StringMetadata } from './StringMetadata';\nimport { FieldType } from '@/api-playground-2/types/api';\n\nexport type PrimitiveParamFieldParams = {\n fieldType: FieldType;\n schema:\n | BooleanSchema\n | StringSchema\n | NumberSchema\n | StringEnumSchema\n | NumberEnumSchema\n | FileSchema\n | NullSchema\n | AnySchema;\n schemaArray?: DataSchemaArray | IncrementalDataSchemaArray;\n typeOptions: string[];\n name?: string | null;\n location?: string;\n selectedIndex?: number;\n onSelectTypeOption?: (index: number) => void;\n parentName?: string;\n paramId?: string;\n style?: string;\n explode?: boolean;\n};\n\nexport const PrimitiveParamField = ({\n fieldType,\n schema,\n schemaArray,\n name,\n location,\n typeOptions,\n selectedIndex,\n onSelectTypeOption,\n parentName,\n paramId,\n style,\n explode,\n}: PrimitiveParamFieldParams) => {\n const typeLabel = typeOptions[selectedIndex ?? 0];\n\n const description =\n schema.description ??\n (name === undefined ? `The ${fieldType} is of type \\`${typeLabel}\\`.` : undefined);\n\n return (\n <div className=\"mint:py-6\">\n <ParamHead\n id={paramId}\n name={name}\n typeLabel={typeLabel}\n location={location}\n fieldType={fieldType}\n required={schema.required}\n deprecated={schema.deprecated}\n defaultValue={schema.default}\n typeOptions={typeOptions}\n selectedTypeOptionIndex={selectedIndex}\n onSelectTypeOption={onSelectTypeOption}\n parentName={parentName}\n style={style}\n explode={explode}\n />\n <div className={cn({ 'mint:mt-4': description || isEnum(schema) })}>\n {description && <Description markdown={description} />}\n {schemaArray && isEnumWithConsts(schemaArray) ? (\n <EnumConstTable schemaArray={schemaArray} />\n ) : (\n isEnum(schema) && <EnumOptions schema={schema} />\n )}\n {isStringSchema(schema) && <StringMetadata schema={schema} description={description} />}\n {isNumberSchema(schema) && <NumberMetadata schema={schema} />}\n <ExampleDescription schema={schema} />\n </div>\n </div>\n );\n};\n\nexport const isEnum = (\n schema: DataSchema | IncrementalDataSchema\n): schema is NumberEnumSchema | StringEnumSchema => {\n return (\n schema.type === 'enum<integer>' ||\n schema.type === 'enum<number>' ||\n schema.type === 'enum<string>'\n );\n};\n\nexport const isEnumWithConsts = (\n schemaArray?: DataSchemaArray | IncrementalDataSchemaArray\n): boolean => {\n if (!schemaArray) return false;\n return schemaArray.some((schema) => isEnum(schema) && 'const' in schema);\n};\n\nconst isStringSchema = (schema: DataSchema | IncrementalDataSchema): schema is StringSchema => {\n return schema.type === 'string';\n};\n\nconst isNumberSchema = (schema: DataSchema | IncrementalDataSchema): schema is NumberSchema => {\n return schema.type === 'number' || schema.type === 'integer';\n};\n"],"names":["isEnum","schema"],"mappings":";AAsGO,MAAMA,IAAS,CACpBC,MAGEA,EAAO,SAAS,mBAChBA,EAAO,SAAS,kBAChBA,EAAO,SAAS;"}
@@ -1,13 +1,14 @@
1
1
  import "react/jsx-runtime";
2
- import $ from "@sindresorhus/slugify";
3
- const c = (r, e, t, i) => $(
4
- `${r ? `${r}-` : ""}${t ? `${t}-` : ""}${e || ""}-`,
2
+ import i from "@sindresorhus/slugify";
3
+ import "../../../contexts/EndpointLocationContext.js";
4
+ const s = (r, t, e, $) => i(
5
+ `${r ? `${r}-` : ""}${e ? `${e}-` : ""}${t || ""}-`,
5
6
  {
6
7
  decamelize: !0
7
8
  }
8
- ), s = (r, e) => r ? `${e ? `${e}` : ""}${r}.` : "";
9
+ ), m = (r, t) => r ? `${t ? `${t}` : ""}${r}.` : "";
9
10
  export {
10
- c as buildRecursiveParamFieldId,
11
- s as getRecursiveParentName
11
+ s as buildRecursiveParamFieldId,
12
+ m as getRecursiveParentName
12
13
  };
13
14
  //# sourceMappingURL=RecursiveParamField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RecursiveParamField.js","sources":["../../../../src/api-playground/EndpointFields/ParamFields/RecursiveParamField.tsx"],"sourcesContent":["\nimport { DataSchema, DataSchemaArray, IncrementalDataSchemaArray } from '@mintlify/validation';\nimport slugify from '@sindresorhus/slugify';\n\nimport { useEndpointLocation } from '@/contexts/EndpointLocationContext';\nimport { getConstFilteredSchemaArray } from '@/openapi/filterEnums';\nimport {\n getAuthFilteredSchemaArray,\n isDataSchemaArrayOrIncrementalDataSchemaArray,\n} from '@/openapi/getAuthFilteredSchemaArray';\nimport { getNextPropertiesByType } from '@/utils/api-reference/getNextPropertiesByType';\n\nimport { RecursiveParamFieldWithChildrenObserver } from './RecursiveParamFieldWithChildrenObserver';\nimport { RecursiveParamFieldWithObserver } from './RecursiveParamFieldWithObserver';\nimport { FieldType, RenderedRefs } from '@/api-playground-2/types/api';\n\nexport type RecursiveParamFieldParams = {\n fieldType: FieldType;\n schemaArray: DataSchemaArray | IncrementalDataSchemaArray;\n renderedRefs?: RenderedRefs;\n name?: string | null;\n location?: string;\n parentName?: string;\n depth?: number;\n hideDescription?: boolean;\n circularRefs?: string[];\n paramId?: string;\n style?: string;\n explode?: boolean;\n};\n\nexport const RecursiveParamField = ({\n fieldType,\n schemaArray,\n name,\n location,\n parentName,\n depth = 0,\n hideDescription = false,\n renderedRefs = new Set(),\n circularRefs,\n paramId,\n style,\n explode,\n}: RecursiveParamFieldParams) => {\n const { anchor } = useEndpointLocation();\n let filteredSchemaArray: DataSchemaArray | IncrementalDataSchemaArray | null = schemaArray;\n filteredSchemaArray = getAuthFilteredSchemaArray({ schemaArray, userGroups: undefined });\n\n if (\n filteredSchemaArray &&\n filteredSchemaArray.some((schema) => 'enum' in schema && 'const' in schema)\n ) {\n filteredSchemaArray = getConstFilteredSchemaArray({ schemaArray });\n }\n\n if (!isDataSchemaArrayOrIncrementalDataSchemaArray(filteredSchemaArray)) {\n return null;\n }\n\n const RecursiveParamFieldType = anchor\n ? RecursiveParamFieldWithChildrenObserver\n : RecursiveParamFieldWithObserver;\n\n return (\n <RecursiveParamFieldType\n fieldType={fieldType}\n schemaArray={filteredSchemaArray}\n name={name}\n location={location}\n parentName={parentName}\n depth={depth}\n style={style}\n explode={explode}\n hideDescription={hideDescription}\n renderedRefs={renderedRefs}\n circularRefs={circularRefs}\n paramId={paramId}\n />\n );\n};\n\ntype RenderNextPropertiesRecursivelyParams = {\n properties: [string, DataSchemaArray | IncrementalDataSchemaArray][];\n fieldType: FieldType;\n depth: number;\n refs: Set<string>;\n parentName?: string;\n name?: string | null;\n currentSchemaRef: string | undefined;\n style?: string;\n explode?: boolean;\n hideParentName?: boolean;\n};\n\nexport const renderNextPropertiesRecursively = ({\n currentSchemaRef,\n properties,\n fieldType,\n parentName,\n name,\n depth,\n refs,\n style,\n explode,\n hideParentName,\n}: RenderNextPropertiesRecursivelyParams) => {\n // Create a new set with the current refs for this level\n const currentLevelRefs = new Set(refs);\n\n if (currentSchemaRef) {\n currentLevelRefs.add(currentSchemaRef);\n }\n\n if (currentLevelRefs.size > 0) {\n return properties.map((property) => {\n const [propertyName, schemaArray] = property;\n const nextSchemaArray = schemaArray[0];\n const nextSchemaArrayProperties = getNextPropertiesByType(nextSchemaArray);\n const paramId = buildRecursiveParamFieldId(fieldType, name, parentName, propertyName);\n const passedName = hideParentName ? '' : name;\n let circularReferences: string[] = [];\n if (\n Object.values(nextSchemaArrayProperties).some(\n (value: unknown) => typeof value === 'string' && currentLevelRefs.has(value)\n )\n ) {\n circularReferences = Object.values(nextSchemaArrayProperties).filter(\n (value: unknown) => typeof value === 'string' && currentLevelRefs.has(value)\n );\n }\n return (\n <RecursiveParamField\n paramId={paramId}\n fieldType={fieldType}\n key={propertyName}\n schemaArray={schemaArray}\n name={propertyName}\n parentName={\n style === 'deepObject' && explode\n ? getDeepObjectParentName(passedName, parentName)\n : getRecursiveParentName(passedName, parentName)\n }\n depth={depth + 1}\n renderedRefs={new Set(currentLevelRefs)}\n circularRefs={circularReferences}\n style={style}\n explode={explode}\n />\n );\n });\n } else {\n return properties.map(([propertyName, schemaArray]) => {\n const paramId = buildRecursiveParamFieldId(fieldType, name, parentName, propertyName);\n const passedName = hideParentName ? '' : name;\n return (\n <RecursiveParamField\n paramId={paramId}\n fieldType={fieldType}\n key={propertyName}\n schemaArray={schemaArray}\n name={propertyName}\n parentName={\n style === 'deepObject' && explode\n ? getDeepObjectParentName(passedName, parentName)\n : getRecursiveParentName(passedName, parentName)\n }\n depth={depth + 1}\n renderedRefs={new Set()}\n style={style}\n explode={explode}\n />\n );\n });\n }\n};\n\ntype RenderTruncatedNextPropertiesParams = {\n properties: [string, DataSchemaArray | IncrementalDataSchemaArray][];\n fieldType: FieldType;\n parentName?: string;\n name?: string | null;\n depth: number;\n};\n\nexport const renderTruncatedNextProperties = ({\n properties,\n fieldType,\n parentName,\n name,\n depth,\n}: RenderTruncatedNextPropertiesParams) => {\n return properties.map((property) => {\n const [propertyName, schemaArray] = property;\n const nextSchemaArray = schemaArray[0];\n const baseSchema: DataSchema = nextSchemaArray as DataSchema;\n if (baseSchema.type === 'array') {\n baseSchema.items = [{ type: 'any' }];\n } else if (baseSchema.type === 'object') {\n baseSchema.properties = {};\n }\n const paramId = buildRecursiveParamFieldId(fieldType, name, parentName);\n const id = `${paramId}-${propertyName}`;\n return (\n <RecursiveParamField\n fieldType={fieldType}\n key={propertyName}\n schemaArray={[baseSchema]}\n name={propertyName}\n paramId={id}\n depth={depth + 1}\n renderedRefs={new Set()}\n />\n );\n });\n};\n\nexport const buildRecursiveParamFieldId = (\n fieldType: FieldType | undefined,\n name: string | undefined | null,\n parentName: string | undefined,\n propertyName?: string | undefined\n) => {\n return slugify(\n `${fieldType ? `${fieldType}-` : ''}${parentName ? `${parentName}-` : ''}${name ? name : ''}-${propertyName ? propertyName : ''}`,\n {\n decamelize: true,\n }\n );\n};\n\nexport const getRecursiveParentName = (name?: string | null, parentName?: string): string => {\n if (!name) {\n return '';\n }\n\n return `${parentName ? `${parentName}` : ''}${name}.`;\n};\n\nexport const getDeepObjectParentName = (name?: string | null, parentName?: string): string => {\n if (!name) {\n return '';\n }\n\n return parentName ? `${parentName}${name}][` : `${name}[`;\n};\n"],"names":["buildRecursiveParamFieldId","fieldType","name","parentName","propertyName","slugify","getRecursiveParentName"],"mappings":";;AAyNO,MAAMA,IAA6B,CACxCC,GACAC,GACAC,GACAC,MAEOC;AAAA,EACL,GAAGJ,IAAY,GAAGA,CAAS,MAAM,EAAE,GAAGE,IAAa,GAAGA,CAAU,MAAM,EAAE,GAAGD,KAAc,EAAE;AAAA,EAC3F;AAAA,IACE,YAAY;AAAA,EAAA;AACd,GAISI,IAAyB,CAACJ,GAAsBC,MACtDD,IAIE,GAAGC,IAAa,GAAGA,CAAU,KAAK,EAAE,GAAGD,CAAI,MAHzC;"}
1
+ {"version":3,"file":"RecursiveParamField.js","sources":["../../../../src/api-playground/EndpointFields/ParamFields/RecursiveParamField.tsx"],"sourcesContent":["\nimport { DataSchema, DataSchemaArray, IncrementalDataSchemaArray } from '@mintlify/validation';\nimport slugify from '@sindresorhus/slugify';\n\nimport { useEndpointLocation } from '@/contexts/EndpointLocationContext';\nimport { getConstFilteredSchemaArray } from '@/openapi/filterEnums';\nimport {\n getAuthFilteredSchemaArray,\n isDataSchemaArrayOrIncrementalDataSchemaArray,\n} from '@/openapi/getAuthFilteredSchemaArray';\nimport { getNextPropertiesByType } from '@/utils/api-reference/getNextPropertiesByType';\n\nimport { RecursiveParamFieldWithChildrenObserver } from './RecursiveParamFieldWithChildrenObserver';\nimport { RecursiveParamFieldWithObserver } from './RecursiveParamFieldWithObserver';\nimport { FieldType, RenderedRefs } from '@/api-playground-2/types/api';\n\nexport type RecursiveParamFieldParams = {\n fieldType: FieldType;\n schemaArray: DataSchemaArray | IncrementalDataSchemaArray;\n renderedRefs?: RenderedRefs;\n name?: string | null;\n location?: string;\n parentName?: string;\n depth?: number;\n hideDescription?: boolean;\n circularRefs?: string[];\n paramId?: string;\n style?: string;\n explode?: boolean;\n};\n\nexport const RecursiveParamField = ({\n fieldType,\n schemaArray,\n name,\n location,\n parentName,\n depth = 0,\n hideDescription = false,\n renderedRefs = new Set(),\n circularRefs,\n paramId,\n style,\n explode,\n}: RecursiveParamFieldParams) => {\n const { anchor } = useEndpointLocation();\n let filteredSchemaArray: DataSchemaArray | IncrementalDataSchemaArray | null = schemaArray;\n filteredSchemaArray = getAuthFilteredSchemaArray({ schemaArray, userGroups: undefined });\n\n if (\n filteredSchemaArray &&\n filteredSchemaArray.some((schema) => 'enum' in schema && 'const' in schema)\n ) {\n filteredSchemaArray = getConstFilteredSchemaArray({ schemaArray });\n }\n\n if (!isDataSchemaArrayOrIncrementalDataSchemaArray(filteredSchemaArray)) {\n return null;\n }\n\n const RecursiveParamFieldType = anchor\n ? RecursiveParamFieldWithChildrenObserver\n : RecursiveParamFieldWithObserver;\n\n return (\n <RecursiveParamFieldType\n fieldType={fieldType}\n schemaArray={filteredSchemaArray}\n name={name}\n location={location}\n parentName={parentName}\n depth={depth}\n style={style}\n explode={explode}\n hideDescription={hideDescription}\n renderedRefs={renderedRefs}\n circularRefs={circularRefs}\n paramId={paramId}\n />\n );\n};\n\ntype RenderNextPropertiesRecursivelyParams = {\n properties: [string, DataSchemaArray | IncrementalDataSchemaArray][];\n fieldType: FieldType;\n depth: number;\n refs: Set<string>;\n parentName?: string;\n name?: string | null;\n currentSchemaRef: string | undefined;\n style?: string;\n explode?: boolean;\n hideParentName?: boolean;\n};\n\nexport const renderNextPropertiesRecursively = ({\n currentSchemaRef,\n properties,\n fieldType,\n parentName,\n name,\n depth,\n refs,\n style,\n explode,\n hideParentName,\n}: RenderNextPropertiesRecursivelyParams) => {\n // Create a new set with the current refs for this level\n const currentLevelRefs = new Set(refs);\n\n if (currentSchemaRef) {\n currentLevelRefs.add(currentSchemaRef);\n }\n\n if (currentLevelRefs.size > 0) {\n return properties.map((property) => {\n const [propertyName, schemaArray] = property;\n const nextSchemaArray = schemaArray[0];\n const nextSchemaArrayProperties = getNextPropertiesByType(nextSchemaArray);\n const paramId = buildRecursiveParamFieldId(fieldType, name, parentName, propertyName);\n const passedName = hideParentName ? '' : name;\n let circularReferences: string[] = [];\n if (\n Object.values(nextSchemaArrayProperties).some(\n (value: unknown) => typeof value === 'string' && currentLevelRefs.has(value)\n )\n ) {\n circularReferences = Object.values(nextSchemaArrayProperties).filter(\n (value: unknown) => typeof value === 'string' && currentLevelRefs.has(value)\n );\n }\n return (\n <RecursiveParamField\n paramId={paramId}\n fieldType={fieldType}\n key={propertyName}\n schemaArray={schemaArray}\n name={propertyName}\n parentName={\n style === 'deepObject' && explode\n ? getDeepObjectParentName(passedName, parentName)\n : getRecursiveParentName(passedName, parentName)\n }\n depth={depth + 1}\n renderedRefs={new Set(currentLevelRefs)}\n circularRefs={circularReferences}\n style={style}\n explode={explode}\n />\n );\n });\n } else {\n return properties.map(([propertyName, schemaArray]) => {\n const paramId = buildRecursiveParamFieldId(fieldType, name, parentName, propertyName);\n const passedName = hideParentName ? '' : name;\n return (\n <RecursiveParamField\n paramId={paramId}\n fieldType={fieldType}\n key={propertyName}\n schemaArray={schemaArray}\n name={propertyName}\n parentName={\n style === 'deepObject' && explode\n ? getDeepObjectParentName(passedName, parentName)\n : getRecursiveParentName(passedName, parentName)\n }\n depth={depth + 1}\n renderedRefs={new Set()}\n style={style}\n explode={explode}\n />\n );\n });\n }\n};\n\ntype RenderTruncatedNextPropertiesParams = {\n properties: [string, DataSchemaArray | IncrementalDataSchemaArray][];\n fieldType: FieldType;\n parentName?: string;\n name?: string | null;\n depth: number;\n};\n\nexport const renderTruncatedNextProperties = ({\n properties,\n fieldType,\n parentName,\n name,\n depth,\n}: RenderTruncatedNextPropertiesParams) => {\n return properties.map((property) => {\n const [propertyName, schemaArray] = property;\n const nextSchemaArray = schemaArray[0];\n const baseSchema: DataSchema = nextSchemaArray as DataSchema;\n if (baseSchema.type === 'array') {\n baseSchema.items = [{ type: 'any' }];\n } else if (baseSchema.type === 'object') {\n baseSchema.properties = {};\n }\n const paramId = buildRecursiveParamFieldId(fieldType, name, parentName);\n const id = `${paramId}-${propertyName}`;\n return (\n <RecursiveParamField\n fieldType={fieldType}\n key={propertyName}\n schemaArray={[baseSchema]}\n name={propertyName}\n paramId={id}\n depth={depth + 1}\n renderedRefs={new Set()}\n />\n );\n });\n};\n\nexport const buildRecursiveParamFieldId = (\n fieldType: FieldType | undefined,\n name: string | undefined | null,\n parentName: string | undefined,\n propertyName?: string | undefined\n) => {\n return slugify(\n `${fieldType ? `${fieldType}-` : ''}${parentName ? `${parentName}-` : ''}${name ? name : ''}-${propertyName ? propertyName : ''}`,\n {\n decamelize: true,\n }\n );\n};\n\nexport const getRecursiveParentName = (name?: string | null, parentName?: string): string => {\n if (!name) {\n return '';\n }\n\n return `${parentName ? `${parentName}` : ''}${name}.`;\n};\n\nexport const getDeepObjectParentName = (name?: string | null, parentName?: string): string => {\n if (!name) {\n return '';\n }\n\n return parentName ? `${parentName}${name}][` : `${name}[`;\n};\n"],"names":["buildRecursiveParamFieldId","fieldType","name","parentName","propertyName","slugify","getRecursiveParentName"],"mappings":";;;AAyNO,MAAMA,IAA6B,CACxCC,GACAC,GACAC,GACAC,MAEOC;AAAA,EACL,GAAGJ,IAAY,GAAGA,CAAS,MAAM,EAAE,GAAGE,IAAa,GAAGA,CAAU,MAAM,EAAE,GAAGD,KAAc,EAAE;AAAA,EAC3F;AAAA,IACE,YAAY;AAAA,EAAA;AACd,GAISI,IAAyB,CAACJ,GAAsBC,MACtDD,IAIE,GAAGC,IAAa,GAAGA,CAAU,KAAK,EAAE,GAAGD,CAAI,MAHzC;"}
@@ -1,7 +1,8 @@
1
1
  import "react/jsx-runtime";
2
- import { useOpenApiEndpoint as n } from "../../hooks/useEndpoint.js";
3
- const p = () => (n(), null);
2
+ import "../../contexts/EndpointLocationContext.js";
3
+ import { useOpenApiEndpoint as t } from "../../hooks/useEndpoint.js";
4
+ const i = () => (t(), null);
4
5
  export {
5
- p as default
6
+ i as default
6
7
  };
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/api-playground/EndpointFields/index.tsx"],"sourcesContent":["\nimport { EndpointLocationProvider } from '@/contexts/EndpointLocationContext';\nimport { useOpenApiEndpoint } from '@/hooks/useEndpoint';\nimport { getFilteredSecurityOptions } from '@/utils/api-reference/getFilteredSecurityOptions';\n\nimport { EndpointBody } from './EndpointBody';\nimport { EndpointParameters } from './EndpointParameters';\nimport { EndpointResponse } from './EndpointResponse';\nimport { EndpointSecurity } from './EndpointSecurity';\n\nconst EndpointFields = () => {\n const endpoint = useOpenApiEndpoint();\n const newApiReferencePage = true;\n\n if (endpoint === undefined || newApiReferencePage) {\n return null;\n }\n\n // TODO(ronan): remove when all security options are handled (none should be empty)\n const filteredSecurityOptions = getFilteredSecurityOptions(endpoint);\n\n return (\n <>\n {filteredSecurityOptions.length > 0 && (\n <EndpointSecurity securityOptions={filteredSecurityOptions} />\n )}\n <EndpointParameters parameters={endpoint.request.parameters} />\n <EndpointLocationProvider location=\"request\">\n <EndpointBody body={endpoint.request.body} />\n </EndpointLocationProvider>\n <EndpointLocationProvider location=\"response\">\n {Object.entries(endpoint.response)[0] && <EndpointResponse response={endpoint.response} />}\n </EndpointLocationProvider>\n </>\n );\n};\n\nexport default EndpointFields;\n"],"names":["EndpointFields","useOpenApiEndpoint"],"mappings":";;AAUA,MAAMA,IAAiB,OACJC,EAAA,GAIR;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/api-playground/EndpointFields/index.tsx"],"sourcesContent":["\nimport { EndpointLocationProvider } from '@/contexts/EndpointLocationContext';\nimport { useOpenApiEndpoint } from '@/hooks/useEndpoint';\nimport { getFilteredSecurityOptions } from '@/utils/api-reference/getFilteredSecurityOptions';\n\nimport { EndpointBody } from './EndpointBody';\nimport { EndpointParameters } from './EndpointParameters';\nimport { EndpointResponse } from './EndpointResponse';\nimport { EndpointSecurity } from './EndpointSecurity';\n\nconst EndpointFields = () => {\n const endpoint = useOpenApiEndpoint();\n const newApiReferencePage = true;\n\n if (endpoint === undefined || newApiReferencePage) {\n return null;\n }\n\n // TODO(ronan): remove when all security options are handled (none should be empty)\n const filteredSecurityOptions = getFilteredSecurityOptions(endpoint);\n\n return (\n <>\n {filteredSecurityOptions.length > 0 && (\n <EndpointSecurity securityOptions={filteredSecurityOptions} />\n )}\n <EndpointParameters parameters={endpoint.request.parameters} />\n <EndpointLocationProvider location=\"request\">\n <EndpointBody body={endpoint.request.body} />\n </EndpointLocationProvider>\n <EndpointLocationProvider location=\"response\">\n {Object.entries(endpoint.response)[0] && <EndpointResponse response={endpoint.response} />}\n </EndpointLocationProvider>\n </>\n );\n};\n\nexport default EndpointFields;\n"],"names":["EndpointFields","useOpenApiEndpoint"],"mappings":";;;AAUA,MAAMA,IAAiB,OACJC,EAAA,GAIR;"}
@@ -34,8 +34,8 @@ const f = {
34
34
  warning: "Warning",
35
35
  nextstepaction: "Next step action"
36
36
  };
37
- function h({ type: n, children: e }) {
38
- const i = f[n], a = b[n];
37
+ function h({ type: i, children: e }) {
38
+ const n = f[i], a = b[i];
39
39
  return /* @__PURE__ */ r(
40
40
  "aside",
41
41
  {
@@ -43,17 +43,10 @@ function h({ type: n, children: e }) {
43
43
  "aria-label": a,
44
44
  className: l(
45
45
  "mint:my-4 mint:flex mint:gap-2 mint:px-3 mint:py-2.5 mint:rounded-lg mint:border mint:overflow-hidden",
46
- i.className
46
+ n.className
47
47
  ),
48
48
  children: [
49
- i.icon && /* @__PURE__ */ t(
50
- "div",
51
- {
52
- className: "mint:flex mint:items-start mint:justify-center",
53
- "aria-hidden": "true",
54
- children: i.icon
55
- }
56
- ),
49
+ n.icon && /* @__PURE__ */ t("div", { className: "mint:flex mint:items-center mint:justify-center", "aria-hidden": "true", children: n.icon }),
57
50
  /* @__PURE__ */ t("div", { className: "mint:text-sm mint:min-w-0 mint:w-full mint:max-w-none mint:prose mint:dark:prose-invert mint:[&>p:first-child]:font-semibold", children: e })
58
51
  ]
59
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"callouts.js","sources":["../../../src/components/content-components/callouts.tsx"],"sourcesContent":["import {\n Lightbulb20Regular,\n InfoFilled,\n Warning20Regular,\n DismissCircle20Regular,\n Info20Regular,\n} from \"@fluentui/react-icons\";\nimport { cn } from \"../../utils/cn\";\n\nexport type CalloutType =\n | \"note\"\n | \"tip\"\n | \"important\"\n | \"caution\"\n | \"warning\"\n | \"nextstepaction\";\n\ninterface CalloutProps {\n type: CalloutType;\n children: React.ReactNode;\n}\n\nconst calloutConfig: Record<\n CalloutType,\n {\n icon?: React.ReactNode;\n className: string;\n }\n> = {\n tip: {\n icon: <Lightbulb20Regular className=\"mint:w-5 mint:h-5 mint:shrink-0\" />,\n className:\n \"mint:bg-[#f1faf1] mint:border-[#9fd89f] mint:text-[#0c5e0c] mint:dark:bg-[#052505] mint:dark:border-[#54b054] mint:dark:text-[#54b054]\",\n },\n note: {\n icon: <Info20Regular className=\"mint:w-5 mint:h-5 mint:shrink-0\" />,\n className:\n \"mint:bg-[#f5f5f5] mint:border-[#d1d1d1] mint:text-[#242424] mint:dark:bg-[#141414] mint:dark:border-[#666666] mint:dark:text-white\",\n },\n warning: {\n icon: <Warning20Regular className=\"mint:w-5 mint:h-5 mint:shrink-0\" />,\n className:\n \"mint:bg-[#fff9f5] mint:border-[#fdcfb4] mint:text-[#8a3707] mint:dark:bg-[#4a1e04] mint:dark:border-[#de590b] mint:dark:text-[#faa06b]\",\n },\n caution: {\n icon: (\n <DismissCircle20Regular className=\"mint:w-5 mint:h-5 mint:shrink-0\" />\n ),\n className:\n \"mint:bg-[#fdf3f4] mint:border-[#eeacb2] mint:text-[#960b18] mint:dark:bg-[#3b0509] mint:dark:border-[#c50f1f] mint:dark:text-[#dc626d]\",\n },\n important: {\n icon: <Warning20Regular className=\"mint:w-5 mint:h-5 mint:shrink-0\" />,\n className:\n \"mint:bg-[#e1cefc] mint:border-[#8251ee] mint:text-[#643fb2] mint:dark:bg-[#1a1326] mint:dark:border-[#9263f1] mint:dark:text-[#9263f1]\",\n },\n nextstepaction: {\n icon: (\n <InfoFilled className=\"mint:w-5 mint:h-5 mint:shrink-0 mint:text-[#616161] mint:dark:text-white\" />\n ),\n className:\n \"mint:bg-[#f9fafb] mint:border-[#d1d1d1] mint:text-[#141414] mint:dark:bg-[#141414] mint:dark:border-[#666666] mint:dark:text-white\",\n },\n};\n\nconst calloutLabels: Record<CalloutType, string> = {\n note: \"Note\",\n tip: \"Tip\",\n important: \"Important\",\n caution: \"Caution\",\n warning: \"Warning\",\n nextstepaction: \"Next step action\",\n};\n\nexport function Callout({ type, children }: CalloutProps) {\n const config = calloutConfig[type];\n const label = calloutLabels[type];\n\n return (\n <aside\n role=\"note\"\n aria-label={label}\n className={cn(\n \"mint:my-4 mint:flex mint:gap-2 mint:px-3 mint:py-2.5 mint:rounded-lg mint:border mint:overflow-hidden\",\n config.className\n )}\n >\n {config.icon && (\n <div\n className=\"mint:flex mint:items-start mint:justify-center\"\n aria-hidden=\"true\"\n >\n {config.icon}\n </div>\n )}\n <div className=\"mint:text-sm mint:min-w-0 mint:w-full mint:max-w-none mint:prose mint:dark:prose-invert mint:[&>p:first-child]:font-semibold\">\n {children}\n </div>\n </aside>\n );\n}\n"],"names":["calloutConfig","jsx","Lightbulb20Regular","Info20Regular","Warning20Regular","DismissCircle20Regular","InfoFilled","calloutLabels","Callout","type","children","config","label","jsxs","cn"],"mappings":";;;AAsBA,MAAMA,IAMF;AAAA,EACF,KAAK;AAAA,IACH,MAAM,gBAAAC,EAACC,GAAA,EAAmB,WAAU,kCAAA,CAAkC;AAAA,IACtE,WACE;AAAA,EAAA;AAAA,EAEJ,MAAM;AAAA,IACJ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/components/content-components/callouts.tsx"],"sourcesContent":["import {\n Lightbulb20Regular,\n InfoFilled,\n Warning20Regular,\n DismissCircle20Regular,\n Info20Regular,\n} from '@fluentui/react-icons';\n\nimport { cn } from '../../utils/cn';\n\nexport type CalloutType = 'note' | 'tip' | 'important' | 'caution' | 'warning' | 'nextstepaction';\n\ninterface CalloutProps {\n type: CalloutType;\n children: React.ReactNode;\n}\n\nconst calloutConfig: Record<\n CalloutType,\n {\n icon?: React.ReactNode;\n className: string;\n }\n> = {\n tip: {\n icon: <Lightbulb20Regular className=\"mint:w-5 mint:h-5 mint:shrink-0\" />,\n className:\n 'mint:bg-[#f1faf1] mint:border-[#9fd89f] mint:text-[#0c5e0c] mint:dark:bg-[#052505] mint:dark:border-[#54b054] mint:dark:text-[#54b054]',\n },\n note: {\n icon: <Info20Regular className=\"mint:w-5 mint:h-5 mint:shrink-0\" />,\n className:\n 'mint:bg-[#f5f5f5] mint:border-[#d1d1d1] mint:text-[#242424] mint:dark:bg-[#141414] mint:dark:border-[#666666] mint:dark:text-white',\n },\n warning: {\n icon: <Warning20Regular className=\"mint:w-5 mint:h-5 mint:shrink-0\" />,\n className:\n 'mint:bg-[#fff9f5] mint:border-[#fdcfb4] mint:text-[#8a3707] mint:dark:bg-[#4a1e04] mint:dark:border-[#de590b] mint:dark:text-[#faa06b]',\n },\n caution: {\n icon: <DismissCircle20Regular className=\"mint:w-5 mint:h-5 mint:shrink-0\" />,\n className:\n 'mint:bg-[#fdf3f4] mint:border-[#eeacb2] mint:text-[#960b18] mint:dark:bg-[#3b0509] mint:dark:border-[#c50f1f] mint:dark:text-[#dc626d]',\n },\n important: {\n icon: <Warning20Regular className=\"mint:w-5 mint:h-5 mint:shrink-0\" />,\n className:\n 'mint:bg-[#e1cefc] mint:border-[#8251ee] mint:text-[#643fb2] mint:dark:bg-[#1a1326] mint:dark:border-[#9263f1] mint:dark:text-[#9263f1]',\n },\n nextstepaction: {\n icon: (\n <InfoFilled className=\"mint:w-5 mint:h-5 mint:shrink-0 mint:text-[#616161] mint:dark:text-white\" />\n ),\n className:\n 'mint:bg-[#f9fafb] mint:border-[#d1d1d1] mint:text-[#141414] mint:dark:bg-[#141414] mint:dark:border-[#666666] mint:dark:text-white',\n },\n};\n\nconst calloutLabels: Record<CalloutType, string> = {\n note: 'Note',\n tip: 'Tip',\n important: 'Important',\n caution: 'Caution',\n warning: 'Warning',\n nextstepaction: 'Next step action',\n};\n\nexport function Callout({ type, children }: CalloutProps) {\n const config = calloutConfig[type];\n const label = calloutLabels[type];\n\n return (\n <aside\n role=\"note\"\n aria-label={label}\n className={cn(\n 'mint:my-4 mint:flex mint:gap-2 mint:px-3 mint:py-2.5 mint:rounded-lg mint:border mint:overflow-hidden',\n config.className\n )}\n >\n {config.icon && (\n <div className=\"mint:flex mint:items-center mint:justify-center\" aria-hidden=\"true\">\n {config.icon}\n </div>\n )}\n <div className=\"mint:text-sm mint:min-w-0 mint:w-full mint:max-w-none mint:prose mint:dark:prose-invert mint:[&>p:first-child]:font-semibold\">\n {children}\n </div>\n </aside>\n );\n}\n"],"names":["calloutConfig","jsx","Lightbulb20Regular","Info20Regular","Warning20Regular","DismissCircle20Regular","InfoFilled","calloutLabels","Callout","type","children","config","label","jsxs","cn"],"mappings":";;;AAiBA,MAAMA,IAMF;AAAA,EACF,KAAK;AAAA,IACH,MAAM,gBAAAC,EAACC,GAAA,EAAmB,WAAU,kCAAA,CAAkC;AAAA,IACtE,WACE;AAAA,EAAA;AAAA,EAEJ,MAAM;AAAA,IACJ,MAAM,gBAAAD,EAACE,GAAA,EAAc,WAAU,kCAAA,CAAkC;AAAA,IACjE,WACE;AAAA,EAAA;AAAA,EAEJ,SAAS;AAAA,IACP,MAAM,gBAAAF,EAACG,GAAA,EAAiB,WAAU,kCAAA,CAAkC;AAAA,IACpE,WACE;AAAA,EAAA;AAAA,EAEJ,SAAS;AAAA,IACP,MAAM,gBAAAH,EAACI,GAAA,EAAuB,WAAU,kCAAA,CAAkC;AAAA,IAC1E,WACE;AAAA,EAAA;AAAA,EAEJ,WAAW;AAAA,IACT,MAAM,gBAAAJ,EAACG,GAAA,EAAiB,WAAU,kCAAA,CAAkC;AAAA,IACpE,WACE;AAAA,EAAA;AAAA,EAEJ,gBAAgB;AAAA,IACd,MACE,gBAAAH,EAACK,GAAA,EAAW,WAAU,2EAAA,CAA2E;AAAA,IAEnG,WACE;AAAA,EAAA;AAEN,GAEMC,IAA6C;AAAA,EACjD,MAAM;AAAA,EACN,KAAK;AAAA,EACL,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AAAA,EACT,gBAAgB;AAClB;AAEO,SAASC,EAAQ,EAAE,MAAAC,GAAM,UAAAC,KAA0B;AACxD,QAAMC,IAASX,EAAcS,CAAI,GAC3BG,IAAQL,EAAcE,CAAI;AAEhC,SACE,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAYD;AAAA,MACZ,WAAWE;AAAA,QACT;AAAA,QACAH,EAAO;AAAA,MAAA;AAAA,MAGR,UAAA;AAAA,QAAAA,EAAO,0BACL,OAAA,EAAI,WAAU,mDAAkD,eAAY,QAC1E,YAAO,KAAA,CACV;AAAA,QAEF,gBAAAV,EAAC,OAAA,EAAI,WAAU,gIACZ,UAAAS,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,23 +1,23 @@
1
- import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
- import { cn as r } from "../../utils/cn.js";
3
- function p({ href: n, children: o, className: s }) {
4
- const t = (n == null ? void 0 : n.startsWith("http")) || (n == null ? void 0 : n.startsWith("//"));
5
- return /* @__PURE__ */ i(
1
+ import { jsxs as o, jsx as s } from "react/jsx-runtime";
2
+ import { cn as e } from "../../utils/cn.js";
3
+ function m({ href: t, children: a, className: i }) {
4
+ const n = (t == null ? void 0 : t.startsWith("http")) || (t == null ? void 0 : t.startsWith("//"));
5
+ return /* @__PURE__ */ o(
6
6
  "a",
7
7
  {
8
- href: n,
9
- className: r("not-prose mint:underline", s),
10
- target: t ? "_blank" : void 0,
11
- rel: t ? "noopener noreferrer" : void 0,
12
- "aria-label": t ? `${o} (opens in new tab)` : void 0,
8
+ href: t,
9
+ className: e("not-prose mint:underline mint:text-[#643fb2] mint:dark:text-[#c9aaf9]", i),
10
+ target: n ? "_blank" : void 0,
11
+ rel: n ? "noopener noreferrer" : void 0,
12
+ "aria-label": n ? `${a} (opens in new tab)` : void 0,
13
13
  children: [
14
- o,
15
- t && /* @__PURE__ */ a("span", { className: "mint:sr-only", children: " (opens in new tab)" })
14
+ a,
15
+ n && /* @__PURE__ */ s("span", { className: "mint:sr-only", children: " (opens in new tab)" })
16
16
  ]
17
17
  }
18
18
  );
19
19
  }
20
20
  export {
21
- p as Link
21
+ m as Link
22
22
  };
23
23
  //# sourceMappingURL=link.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"link.js","sources":["../../../src/components/content-components/link.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\ninterface LinkProps {\n href?: string;\n children: React.ReactNode;\n className?: string;\n}\n\nexport function Link({ href, children, className }: LinkProps) {\n const isExternal = href?.startsWith(\"http\") || href?.startsWith(\"//\");\n\n return (\n <a\n href={href}\n className={cn(\"not-prose mint:underline\", className)}\n target={isExternal ? \"_blank\" : undefined}\n rel={isExternal ? \"noopener noreferrer\" : undefined}\n aria-label={isExternal ? `${children} (opens in new tab)` : undefined}\n >\n {children}\n {isExternal && <span className=\"mint:sr-only\"> (opens in new tab)</span>}\n </a>\n );\n}\n"],"names":["Link","href","children","className","isExternal","jsxs","cn","jsx"],"mappings":";;AASO,SAASA,EAAK,EAAE,MAAAC,GAAM,UAAAC,GAAU,WAAAC,KAAwB;AAC7D,QAAMC,KAAaH,KAAA,gBAAAA,EAAM,WAAW,aAAWA,KAAA,gBAAAA,EAAM,WAAW;AAEhE,SACE,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAAJ;AAAA,MACA,WAAWK,EAAG,4BAA4BH,CAAS;AAAA,MACnD,QAAQC,IAAa,WAAW;AAAA,MAChC,KAAKA,IAAa,wBAAwB;AAAA,MAC1C,cAAYA,IAAa,GAAGF,CAAQ,wBAAwB;AAAA,MAE3D,UAAA;AAAA,QAAAA;AAAA,QACAE,KAAc,gBAAAG,EAAC,QAAA,EAAK,WAAU,gBAAe,UAAA,sBAAA,CAAmB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGvE;"}
1
+ {"version":3,"file":"link.js","sources":["../../../src/components/content-components/link.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\ninterface LinkProps {\n href?: string;\n children: React.ReactNode;\n className?: string;\n}\n\nexport function Link({ href, children, className }: LinkProps) {\n const isExternal = href?.startsWith(\"http\") || href?.startsWith(\"//\");\n\n return (\n <a\n href={href}\n className={cn(\"not-prose mint:underline mint:text-[#643fb2] mint:dark:text-[#c9aaf9]\", className)}\n target={isExternal ? \"_blank\" : undefined}\n rel={isExternal ? \"noopener noreferrer\" : undefined}\n aria-label={isExternal ? `${children} (opens in new tab)` : undefined}\n >\n {children}\n {isExternal && <span className=\"mint:sr-only\"> (opens in new tab)</span>}\n </a>\n );\n}\n"],"names":["Link","href","children","className","isExternal","jsxs","cn","jsx"],"mappings":";;AASO,SAASA,EAAK,EAAE,MAAAC,GAAM,UAAAC,GAAU,WAAAC,KAAwB;AAC7D,QAAMC,KAAaH,KAAA,gBAAAA,EAAM,WAAW,aAAWA,KAAA,gBAAAA,EAAM,WAAW;AAEhE,SACE,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAAJ;AAAA,MACA,WAAWK,EAAG,yEAAyEH,CAAS;AAAA,MAChG,QAAQC,IAAa,WAAW;AAAA,MAChC,KAAKA,IAAa,wBAAwB;AAAA,MAC1C,cAAYA,IAAa,GAAGF,CAAQ,wBAAwB;AAAA,MAE3D,UAAA;AAAA,QAAAA;AAAA,QACAE,KAAc,gBAAAG,EAAC,QAAA,EAAK,WAAU,gBAAe,UAAA,sBAAA,CAAmB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGvE;"}
@@ -1,99 +1,117 @@
1
- import { jsx as a, jsxs as u } from "react/jsx-runtime";
2
- import m, { useState as k, useRef as w, useEffect as N } from "react";
1
+ import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
+ import o, { useState as v, useRef as $, useEffect as g } from "react";
3
3
  import { cn as p } from "../../../utils/cn.js";
4
- const x = m.createContext({
4
+ const A = o.createContext({
5
5
  activeTab: 0,
6
6
  setActiveTab: () => {
7
7
  }
8
8
  });
9
- function E({ children: h, defaultTab: v = 0, defaultTabIndex: y, className: g, onClickTab: o, onChange: c }) {
10
- const [s, b] = k(y ?? v), l = w([]), n = m.Children.toArray(h);
11
- N(() => {
12
- l.current = l.current.slice(0, n.length);
13
- }, [n.length]);
14
- const _ = (e, t) => {
15
- var i;
16
- let r = t;
9
+ function T({ children: y, defaultTab: w = 0, defaultTabIndex: x, className: _, onClickTab: f, onChange: c }) {
10
+ const [a, b] = v(x ?? w), l = $([]), [h, N] = v({ left: 0, width: 0 }), i = o.Children.toArray(y);
11
+ g(() => {
12
+ l.current = l.current.slice(0, i.length);
13
+ }, [i.length]), g(() => {
14
+ const e = l.current[a];
15
+ e && N({
16
+ left: e.offsetLeft,
17
+ width: e.offsetWidth
18
+ });
19
+ }, [a]);
20
+ const k = (e, t) => {
21
+ var s;
22
+ let n = t;
17
23
  switch (e.key) {
18
24
  case "ArrowRight":
19
- e.preventDefault(), r = (t + 1) % n.length;
25
+ e.preventDefault(), n = (t + 1) % i.length;
20
26
  break;
21
27
  case "ArrowLeft":
22
- e.preventDefault(), r = (t - 1 + n.length) % n.length;
28
+ e.preventDefault(), n = (t - 1 + i.length) % i.length;
23
29
  break;
24
30
  case "Home":
25
- e.preventDefault(), r = 0;
31
+ e.preventDefault(), n = 0;
26
32
  break;
27
33
  case "End":
28
- e.preventDefault(), r = n.length - 1;
34
+ e.preventDefault(), n = i.length - 1;
29
35
  break;
30
36
  default:
31
37
  return;
32
38
  }
33
- b(r), (i = l.current[r]) == null || i.focus();
39
+ b(n), (s = l.current[n]) == null || s.focus();
34
40
  };
35
- return /* @__PURE__ */ a(x.Provider, { value: { activeTab: s, setActiveTab: b }, children: /* @__PURE__ */ u("div", { className: p("mint:my-6", g), children: [
36
- /* @__PURE__ */ a(
41
+ return /* @__PURE__ */ r(A.Provider, { value: { activeTab: a, setActiveTab: b }, children: /* @__PURE__ */ m("div", { className: p("mint:my-6", _), children: [
42
+ /* @__PURE__ */ m(
37
43
  "div",
38
44
  {
39
45
  role: "tablist",
40
46
  "aria-label": "Content tabs",
41
- className: "mint:flex mint:gap-1 mint:border-b mint:border-gray-200 mint:mb-4 mint:overflow-x-auto mint:dark:border-b-gray-700",
42
- children: n.map((e, t) => {
43
- if (!m.isValidElement(e)) return null;
44
- const r = e.props.title || `Tab ${t + 1}`, i = e.props.icon, d = s === t;
45
- return /* @__PURE__ */ a(
46
- "button",
47
- {
48
- ref: (f) => {
49
- l.current[t] = f;
50
- },
51
- role: "tab",
52
- "aria-selected": d,
53
- "aria-controls": `tabpanel-${t}`,
54
- id: `tab-${t}`,
55
- tabIndex: d ? 0 : -1,
56
- onClick: () => {
57
- b(t), o == null || o(t), c == null || c(t);
58
- },
59
- onKeyDown: (f) => _(f, t),
60
- className: p(
61
- "mint:px-4 mint:py-2 mint:text-sm mint:font-medium mint:border-0 mint:border-b-2 mint:rounded-t mint:bg-transparent mint:cursor-pointer mint:focus:outline-none mint:focus-visible:shadow-[0_0_0_2px_#fff,0_0_0_4px_#75b6e7] mint:focus-visible:outline-offset-2",
62
- d ? "mint:border-b-[#8251ee] mint:text-[#242424] mint:dark:border-b-[#9263f1] mint:dark:text-[#ffffff] mint:font-semibold" : "mint:border-b-transparent mint:text-gray-600 mint:hover:text-gray-900 mint:hover:border-b-gray-300 mint:dark:text-gray-400 mint:dark:hover:text-gray-200 mint:dark:hover:border-b-gray-600"
63
- ),
64
- children: /* @__PURE__ */ u("span", { className: "mint:flex mint:items-center mint:gap-2", children: [
65
- i && /* @__PURE__ */ a("span", { "aria-hidden": "true", children: i }),
66
- /* @__PURE__ */ u("span", { className: "mint:relative", children: [
67
- /* @__PURE__ */ a("span", { className: "mint:invisible mint:font-semibold", "aria-hidden": "true", children: r }),
68
- /* @__PURE__ */ a("span", { className: "mint:absolute mint:inset-0", children: r })
47
+ className: "mint:relative mint:flex mint:gap-1 mint:mb-4 mint:overflow-x-auto mint:pb-[3px] mint:before:content-[''] mint:before:absolute mint:before:left-0 mint:before:right-0 mint:before:bottom-0 mint:before:h-[2px] mint:before:bg-[#f2f3f3] mint:before:dark:bg-[#222223] mint:before:rounded-full",
48
+ children: [
49
+ i.map((e, t) => {
50
+ if (!o.isValidElement(e)) return null;
51
+ const n = e.props.title || `Tab ${t + 1}`, s = e.props.icon, d = a === t;
52
+ return /* @__PURE__ */ r(
53
+ "button",
54
+ {
55
+ ref: (u) => {
56
+ l.current[t] = u;
57
+ },
58
+ role: "tab",
59
+ "aria-selected": d,
60
+ "aria-controls": `tabpanel-${t}`,
61
+ id: `tab-${t}`,
62
+ tabIndex: d ? 0 : -1,
63
+ onClick: () => {
64
+ b(t), f == null || f(t), c == null || c(t);
65
+ },
66
+ onKeyDown: (u) => k(u, t),
67
+ className: p(
68
+ "mint:relative mint:px-4 mint:py-2 mint:text-sm mint:font-medium mint:border-0 mint:bg-transparent mint:cursor-pointer mint:focus:outline-none mint:focus-visible:shadow-[0_0_0_2px_#fff,0_0_0_4px_#75b6e7] mint:focus-visible:outline-offset-2",
69
+ d ? "mint:text-[#242424] mint:dark:text-[#ffffff] mint:font-semibold" : "mint:text-gray-600 mint:hover:text-gray-900 mint:dark:text-gray-400 mint:dark:hover:text-gray-200"
70
+ ),
71
+ children: /* @__PURE__ */ m("span", { className: "mint:flex mint:items-center mint:gap-2", children: [
72
+ s && /* @__PURE__ */ r("span", { "aria-hidden": "true", children: s }),
73
+ /* @__PURE__ */ m("span", { className: "mint:relative", children: [
74
+ /* @__PURE__ */ r("span", { className: "mint:invisible mint:font-semibold", "aria-hidden": "true", children: n }),
75
+ /* @__PURE__ */ r("span", { className: "mint:absolute mint:inset-0", children: n })
76
+ ] })
69
77
  ] })
70
- ] })
71
- },
72
- t
73
- );
74
- })
78
+ },
79
+ t
80
+ );
81
+ }),
82
+ /* @__PURE__ */ r(
83
+ "div",
84
+ {
85
+ className: "mint:absolute mint:bottom-0 mint:h-[3px] mint:rounded-full mint:bg-[#8251ee] mint:dark:bg-[#9263f1] mint:transition-all mint:duration-300 mint:ease-out mint:z-10",
86
+ style: {
87
+ left: `${h.left}px`,
88
+ width: `${h.width}px`
89
+ }
90
+ }
91
+ )
92
+ ]
75
93
  }
76
94
  ),
77
- /* @__PURE__ */ a("div", { children: n.map((e, t) => /* @__PURE__ */ a(
95
+ /* @__PURE__ */ r("div", { children: i.map((e, t) => /* @__PURE__ */ r(
78
96
  "div",
79
97
  {
80
98
  role: "tabpanel",
81
99
  id: `tabpanel-${t}`,
82
100
  "aria-labelledby": `tab-${t}`,
83
101
  tabIndex: 0,
84
- hidden: s !== t,
102
+ hidden: a !== t,
85
103
  className: p(
86
104
  "mint:outline-none",
87
- s !== t && "mint:hidden"
105
+ a !== t && "mint:hidden"
88
106
  ),
89
- children: m.isValidElement(e) ? e.props.children : null
107
+ children: o.isValidElement(e) ? e.props.children : null
90
108
  },
91
109
  t
92
110
  )) })
93
111
  ] }) });
94
112
  }
95
113
  export {
96
- E as Tabs,
97
- x as TabsContext
114
+ T as Tabs,
115
+ A as TabsContext
98
116
  };
99
117
  //# sourceMappingURL=tabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.js","sources":["../../../../src/components/content-components/tabs/tabs.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from \"react\";\nimport { cn } from \"../../../utils/cn\";\n\ninterface TabsProps {\n children: React.ReactNode;\n defaultTab?: number;\n defaultTabIndex?: number;\n className?: string;\n onClickTab?: (index: number) => void;\n onChange?: (index: number) => void;\n}\n\ninterface TabsContextValue {\n activeTab: number;\n setActiveTab: (index: number) => void;\n}\n\nexport const TabsContext = React.createContext<TabsContextValue>({\n activeTab: 0,\n setActiveTab: () => {},\n});\n\nexport function Tabs({ children, defaultTab = 0, defaultTabIndex, className, onClickTab, onChange }: TabsProps) {\n const [activeTab, setActiveTab] = useState(defaultTabIndex ?? defaultTab);\n const tabRefs = useRef<(HTMLButtonElement | null)[]>([]);\n\n const tabs = React.Children.toArray(children);\n\n useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, tabs.length);\n }, [tabs.length]);\n\n const handleKeyDown = (event: React.KeyboardEvent, currentIndex: number) => {\n let newIndex = currentIndex;\n\n switch (event.key) {\n case \"ArrowRight\":\n event.preventDefault();\n newIndex = (currentIndex + 1) % tabs.length;\n break;\n case \"ArrowLeft\":\n event.preventDefault();\n newIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n break;\n case \"Home\":\n event.preventDefault();\n newIndex = 0;\n break;\n case \"End\":\n event.preventDefault();\n newIndex = tabs.length - 1;\n break;\n default:\n return;\n }\n\n setActiveTab(newIndex);\n tabRefs.current[newIndex]?.focus();\n };\n\n return (\n <TabsContext.Provider value={{ activeTab, setActiveTab }}>\n <div className={cn(\"mint:my-6\", className)}>\n <div\n role=\"tablist\"\n aria-label=\"Content tabs\"\n className=\"mint:flex mint:gap-1 mint:border-b mint:border-gray-200 mint:mb-4 mint:overflow-x-auto mint:dark:border-b-gray-700\"\n >\n {tabs.map((tab, index) => {\n if (!React.isValidElement(tab)) return null;\n const title = tab.props.title || `Tab ${index + 1}`;\n const icon = tab.props.icon;\n const isActive = activeTab === index;\n\n return (\n <button\n key={index}\n ref={(el) => {tabRefs.current[index] = el}}\n role=\"tab\"\n aria-selected={isActive}\n aria-controls={`tabpanel-${index}`}\n id={`tab-${index}`}\n tabIndex={isActive ? 0 : -1}\n onClick={() => {\n setActiveTab(index);\n onClickTab?.(index);\n onChange?.(index);\n }}\n onKeyDown={(e) => handleKeyDown(e, index)}\n className={cn(\n \"mint:px-4 mint:py-2 mint:text-sm mint:font-medium mint:border-0 mint:border-b-2 mint:rounded-t mint:bg-transparent mint:cursor-pointer mint:focus:outline-none mint:focus-visible:shadow-[0_0_0_2px_#fff,0_0_0_4px_#75b6e7] mint:focus-visible:outline-offset-2\",\n isActive\n ? \"mint:border-b-[#8251ee] mint:text-[#242424] mint:dark:border-b-[#9263f1] mint:dark:text-[#ffffff] mint:font-semibold\"\n : \"mint:border-b-transparent mint:text-gray-600 mint:hover:text-gray-900 mint:hover:border-b-gray-300 mint:dark:text-gray-400 mint:dark:hover:text-gray-200 mint:dark:hover:border-b-gray-600\"\n )}\n >\n <span className=\"mint:flex mint:items-center mint:gap-2\">\n {icon && <span aria-hidden=\"true\">{icon}</span>}\n <span className=\"mint:relative\">\n <span className=\"mint:invisible mint:font-semibold\" aria-hidden=\"true\">\n {title}\n </span>\n <span className=\"mint:absolute mint:inset-0\">\n {title}\n </span>\n </span>\n </span>\n </button>\n );\n })}\n </div>\n\n <div>\n {tabs.map((tab, index) => (\n <div\n key={index}\n role=\"tabpanel\"\n id={`tabpanel-${index}`}\n aria-labelledby={`tab-${index}`}\n tabIndex={0}\n hidden={activeTab !== index}\n className={cn(\n \"mint:outline-none\",\n activeTab !== index && \"mint:hidden\"\n )}\n >\n {React.isValidElement(tab) ? tab.props.children : null}\n </div>\n ))}\n </div>\n </div>\n </TabsContext.Provider>\n );\n}\n"],"names":["TabsContext","React","Tabs","children","defaultTab","defaultTabIndex","className","onClickTab","onChange","activeTab","setActiveTab","useState","tabRefs","useRef","tabs","useEffect","handleKeyDown","event","currentIndex","newIndex","_a","jsx","cn","tab","index","title","icon","isActive","el","e","jsxs"],"mappings":";;;AAiBO,MAAMA,IAAcC,EAAM,cAAgC;AAAA,EAC/D,WAAW;AAAA,EACX,cAAc,MAAM;AAAA,EAAC;AACvB,CAAC;AAEM,SAASC,EAAK,EAAE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iB,OAAOA,CAAK;AAAA,QAC7B,UAAU;AAAA,QACV,QAAQf,MAAce;AAAA,QACtB,WAAWF;AAAA,UACT;AAAA,UACAb,MAAce,KAAS;AAAA,QAAA;AAAA,QAGxB,YAAM,eAAeD,CAAG,IAAIA,EAAI,MAAM,WAAW;AAAA,MAAA;AAAA,MAX7CC;AAAA,IAAA,CAaR,EAAA,CACH;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"tabs.js","sources":["../../../../src/components/content-components/tabs/tabs.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from \"react\";\nimport { cn } from \"../../../utils/cn\";\n\ninterface TabsProps {\n children: React.ReactNode;\n defaultTab?: number;\n defaultTabIndex?: number;\n className?: string;\n onClickTab?: (index: number) => void;\n onChange?: (index: number) => void;\n}\n\ninterface TabsContextValue {\n activeTab: number;\n setActiveTab: (index: number) => void;\n}\n\nexport const TabsContext = React.createContext<TabsContextValue>({\n activeTab: 0,\n setActiveTab: () => {},\n});\n\nexport function Tabs({ children, defaultTab = 0, defaultTabIndex, className, onClickTab, onChange }: TabsProps) {\n const [activeTab, setActiveTab] = useState(defaultTabIndex ?? defaultTab);\n const tabRefs = useRef<(HTMLButtonElement | null)[]>([]);\n const [indicatorStyle, setIndicatorStyle] = useState({ left: 0, width: 0 });\n\n const tabs = React.Children.toArray(children);\n\n useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, tabs.length);\n }, [tabs.length]);\n\n useEffect(() => {\n const activeTabElement = tabRefs.current[activeTab];\n if (activeTabElement) {\n setIndicatorStyle({\n left: activeTabElement.offsetLeft,\n width: activeTabElement.offsetWidth,\n });\n }\n }, [activeTab]);\n\n const handleKeyDown = (event: React.KeyboardEvent, currentIndex: number) => {\n let newIndex = currentIndex;\n\n switch (event.key) {\n case \"ArrowRight\":\n event.preventDefault();\n newIndex = (currentIndex + 1) % tabs.length;\n break;\n case \"ArrowLeft\":\n event.preventDefault();\n newIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n break;\n case \"Home\":\n event.preventDefault();\n newIndex = 0;\n break;\n case \"End\":\n event.preventDefault();\n newIndex = tabs.length - 1;\n break;\n default:\n return;\n }\n\n setActiveTab(newIndex);\n tabRefs.current[newIndex]?.focus();\n };\n\n return (\n <TabsContext.Provider value={{ activeTab, setActiveTab }}>\n <div className={cn(\"mint:my-6\", className)}>\n <div\n role=\"tablist\"\n aria-label=\"Content tabs\"\n className=\"mint:relative mint:flex mint:gap-1 mint:mb-4 mint:overflow-x-auto mint:pb-[3px] mint:before:content-[''] mint:before:absolute mint:before:left-0 mint:before:right-0 mint:before:bottom-0 mint:before:h-[2px] mint:before:bg-[#f2f3f3] mint:before:dark:bg-[#222223] mint:before:rounded-full\"\n >\n {tabs.map((tab, index) => {\n if (!React.isValidElement(tab)) return null;\n const title = tab.props.title || `Tab ${index + 1}`;\n const icon = tab.props.icon;\n const isActive = activeTab === index;\n\n return (\n <button\n key={index}\n ref={(el) => {tabRefs.current[index] = el}}\n role=\"tab\"\n aria-selected={isActive}\n aria-controls={`tabpanel-${index}`}\n id={`tab-${index}`}\n tabIndex={isActive ? 0 : -1}\n onClick={() => {\n setActiveTab(index);\n onClickTab?.(index);\n onChange?.(index);\n }}\n onKeyDown={(e) => handleKeyDown(e, index)}\n className={cn(\n \"mint:relative mint:px-4 mint:py-2 mint:text-sm mint:font-medium mint:border-0 mint:bg-transparent mint:cursor-pointer mint:focus:outline-none mint:focus-visible:shadow-[0_0_0_2px_#fff,0_0_0_4px_#75b6e7] mint:focus-visible:outline-offset-2\",\n isActive\n ? \"mint:text-[#242424] mint:dark:text-[#ffffff] mint:font-semibold\"\n : \"mint:text-gray-600 mint:hover:text-gray-900 mint:dark:text-gray-400 mint:dark:hover:text-gray-200\"\n )}\n >\n <span className=\"mint:flex mint:items-center mint:gap-2\">\n {icon && <span aria-hidden=\"true\">{icon}</span>}\n <span className=\"mint:relative\">\n <span className=\"mint:invisible mint:font-semibold\" aria-hidden=\"true\">\n {title}\n </span>\n <span className=\"mint:absolute mint:inset-0\">\n {title}\n </span>\n </span>\n </span>\n </button>\n );\n })}\n <div\n className=\"mint:absolute mint:bottom-0 mint:h-[3px] mint:rounded-full mint:bg-[#8251ee] mint:dark:bg-[#9263f1] mint:transition-all mint:duration-300 mint:ease-out mint:z-10\"\n style={{\n left: `${indicatorStyle.left}px`,\n width: `${indicatorStyle.width}px`,\n }}\n />\n </div>\n\n <div>\n {tabs.map((tab, index) => (\n <div\n key={index}\n role=\"tabpanel\"\n id={`tabpanel-${index}`}\n aria-labelledby={`tab-${index}`}\n tabIndex={0}\n hidden={activeTab !== index}\n className={cn(\n \"mint:outline-none\",\n activeTab !== index && \"mint:hidden\"\n )}\n >\n {React.isValidElement(tab) ? tab.props.children : null}\n </div>\n ))}\n </div>\n </div>\n </TabsContext.Provider>\n );\n}\n"],"names":["TabsContext","React","Tabs","children","defaultTab","defaultTabIndex","className","onClickTab","onChange","activeTab","setActiveTab","useState","tabRefs","useRef","indicatorStyle","setIndicatorStyle","tabs","useEffect","activeTabElement","handleKeyDown","event","currentIndex","newIndex","_a","jsx","cn","jsxs","tab","index","title","icon","isActive","el","e"],"mappings":";;;AAiBO,MAAMA,IAAcC,EAAM,cAAgC;AAAA,EAC/D,WAAW;AAAA,EACX,cAAc,MAAM;AAAA,EAAC;AACvB,CAAC;AAEM,SAASC,EAAK,EAAE,UAAAC,GAAU,YAAAC,IAAa,GAAG,iBAAAC,GAAiB,WAAAC,GAAW,YAAAC,GAAY,UAAAC,KAAuB;AAC9G,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAASN,KAAmBD,CAAU,GAClEQ,IAAUC,EAAqC,EAAE,GACjD,CAACC,GAAgBC,CAAiB,IAAIJ,EAAS,EAAE,MAAM,GAAG,OAAO,GAAG,GAEpEK,IAAOf,EAAM,SAAS,QAAQE,CAAQ;AAE5C,EAAAc,EAAU,MAAM;AACd,IAAAL,EAAQ,UAAUA,EAAQ,QAAQ,MAAM,GAAGI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AE,EAAK,IAAI,CAACW,GAAKC,MACd,gBAAAJ;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,MAAK;AAAA,QACL,IAAI,YAAYI,CAAK;AAAA,QACrB,mBAAiB,OAAOA,CAAK;AAAA,QAC7B,UAAU;AAAA,QACV,QAAQnB,MAAcmB;AAAA,QACtB,WAAWH;AAAA,UACT;AAAA,UACAhB,MAAcmB,KAAS;AAAA,QAAA;AAAA,QAGxB,YAAM,eAAeD,CAAG,IAAIA,EAAI,MAAM,WAAW;AAAA,MAAA;AAAA,MAX7CC;AAAA,IAAA,CAaR,EAAA,CACH;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
@@ -2,12 +2,12 @@ import { jsx as r, jsxs as w } from "react/jsx-runtime";
2
2
  import { useRef as p } from "react";
3
3
  import { useZonePivotContext as u } from "./zone-pivot-context.js";
4
4
  import { cn as k } from "../../../utils/cn.js";
5
- function g({
5
+ function A({
6
6
  group: e,
7
- className: h
7
+ className: b
8
8
  }) {
9
9
  var c;
10
- const { activePivots: b, setActivePivot: d } = u(), m = p(null), l = (c = e.pivots.find((t) => b.has(t.id))) == null ? void 0 : c.id, v = e.pivots.findIndex((t) => t.id === l), x = (t) => {
10
+ const { activePivots: h, setActivePivot: a } = u(), m = p(null), l = (c = e.pivots.find((t) => h.has(t.id))) == null ? void 0 : c.id, v = e.pivots.findIndex((t) => t.id === l), x = (t) => {
11
11
  var f;
12
12
  const { key: i } = t, n = v;
13
13
  let o = n;
@@ -31,20 +31,20 @@ function g({
31
31
  }
32
32
  const s = e.pivots[o];
33
33
  if (s) {
34
- d(e.id, s.id);
35
- const a = (f = m.current) == null ? void 0 : f.querySelector(
34
+ a(e.id, s.id);
35
+ const d = (f = m.current) == null ? void 0 : f.querySelector(
36
36
  `[data-pivot-id="${s.id}"]`
37
37
  );
38
- a == null || a.focus();
38
+ d == null || d.focus();
39
39
  }
40
40
  };
41
- return /* @__PURE__ */ r("div", { className: h, "data-zone-pivot-group": e.id, children: /* @__PURE__ */ r(
41
+ return /* @__PURE__ */ r("div", { className: b, "data-zone-pivot-group": e.id, children: /* @__PURE__ */ r(
42
42
  "div",
43
43
  {
44
44
  ref: m,
45
45
  role: "tablist",
46
46
  "aria-label": e.prompt,
47
- className: "mint:inline-flex mint:items-center mint:gap-1 mint:p-1 mint:bg-gray-100 mint:rounded-lg mint:dark:bg-white/5",
47
+ className: "mint:inline-flex mint:items-center mint:gap-1 mint:p-0.5 mint:bg-[#f5f5f5] mint:rounded-lg mint:dark:bg-[#141414]",
48
48
  children: e.pivots.map((t) => {
49
49
  const i = t.id === l;
50
50
  return /* @__PURE__ */ w(
@@ -57,7 +57,7 @@ function g({
57
57
  "aria-selected": i,
58
58
  "aria-controls": `panel-${e.id}-${t.id}`,
59
59
  tabIndex: i ? 0 : -1,
60
- onClick: () => d(e.id, t.id),
60
+ onClick: () => a(e.id, t.id),
61
61
  onKeyDown: x,
62
62
  className: k(
63
63
  "mint:relative mint:px-3 mint:py-1.5 mint:text-sm mint:rounded-md mint:bg-transparent mint:border-none mint:cursor-pointer mint:focus:outline-none mint:focus-visible:shadow-[0_0_0_2px_#3b82f6] mint:focus-visible:outline-offset-2",
@@ -75,6 +75,6 @@ function g({
75
75
  ) });
76
76
  }
77
77
  export {
78
- g as ZonePivotSelector
78
+ A as ZonePivotSelector
79
79
  };
80
80
  //# sourceMappingURL=zone-pivot-selector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zone-pivot-selector.js","sources":["../../../../src/components/content-components/zone-pivots/zone-pivot-selector.tsx"],"sourcesContent":["import React, { useRef } from \"react\";\nimport { useZonePivotContext } from \"./zone-pivot-context\";\nimport type { ZonePivotGroup } from \"../../../types/page\";\nimport { cn } from \"../../../utils/cn\";\n\nexport interface ZonePivotSelectorProps {\n group: ZonePivotGroup;\n className?: string;\n}\n\nexport function ZonePivotSelector({\n group,\n className,\n}: ZonePivotSelectorProps) {\n const { activePivots, setActivePivot } = useZonePivotContext();\n const tabListRef = useRef<HTMLDivElement>(null);\n\n const selectedPivotId = group.pivots.find((p) => activePivots.has(p.id))?.id;\n const selectedIndex = group.pivots.findIndex((p) => p.id === selectedPivotId);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n const { key } = event;\n const currentIndex = selectedIndex;\n let nextIndex = currentIndex;\n\n switch (key) {\n case \"ArrowLeft\":\n case \"ArrowUp\":\n event.preventDefault();\n nextIndex =\n currentIndex > 0 ? currentIndex - 1 : group.pivots.length - 1;\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n event.preventDefault();\n nextIndex =\n currentIndex < group.pivots.length - 1 ? currentIndex + 1 : 0;\n break;\n case \"Home\":\n event.preventDefault();\n nextIndex = 0;\n break;\n case \"End\":\n event.preventDefault();\n nextIndex = group.pivots.length - 1;\n break;\n default:\n return;\n }\n\n const nextPivot = group.pivots[nextIndex];\n if (nextPivot) {\n setActivePivot(group.id, nextPivot.id);\n const button = tabListRef.current?.querySelector(\n `[data-pivot-id=\"${nextPivot.id}\"]`\n ) as HTMLButtonElement;\n button?.focus();\n }\n };\n\n return (\n <div className={className} data-zone-pivot-group={group.id}>\n <div\n ref={tabListRef}\n role=\"tablist\"\n aria-label={group.prompt}\n className=\"mint:inline-flex mint:items-center mint:gap-1 mint:p-1 mint:bg-gray-100 mint:rounded-lg mint:dark:bg-white/5\"\n >\n {group.pivots.map((pivot) => {\n const isSelected = pivot.id === selectedPivotId;\n return (\n <button\n key={pivot.id}\n id={`tab-${group.id}-${pivot.id}`}\n role=\"tab\"\n type=\"button\"\n data-pivot-id={pivot.id}\n aria-selected={isSelected}\n aria-controls={`panel-${group.id}-${pivot.id}`}\n tabIndex={isSelected ? 0 : -1}\n onClick={() => setActivePivot(group.id, pivot.id)}\n onKeyDown={handleKeyDown}\n className={cn(\n \"mint:relative mint:px-3 mint:py-1.5 mint:text-sm mint:rounded-md mint:bg-transparent mint:border-none mint:cursor-pointer mint:focus:outline-none mint:focus-visible:shadow-[0_0_0_2px_#3b82f6] mint:focus-visible:outline-offset-2\",\n isSelected\n ? \"mint:bg-white mint:text-[#141414] mint:shadow-sm mint:dark:bg-white/10 mint:dark:text-white mint:font-semibold\"\n : \"mint:text-gray-600 mint:hover:text-[#141414] mint:hover:bg-white/50 mint:dark:text-gray-400 mint:dark:hover:text-white mint:dark:hover:bg-white/10 mint:font-medium\"\n )}\n >\n <span className=\"mint:invisible mint:font-semibold mint:block mint:h-0 mint:overflow-hidden\" aria-hidden=\"true\">\n {pivot.title}\n </span>\n <span className=\"mint:block\">{pivot.title}</span>\n </button>\n );\n })}\n </div>\n </div>\n );\n}\n"],"names":["ZonePivotSelector","group","className","activePivots","setActivePivot","useZonePivotContext","tabListRef","useRef","selectedPivotId","_a","p","selectedIndex","handleKeyDown","event","key","currentIndex","nextIndex","nextPivot","button","jsx","pivot","isSelected","jsxs","cn"],"mappings":";;;;AAUO,SAASA,EAAkB;AAAA,EAChC,OAAAC;AAAA,EACA,WAAAC;AACF,GAA2B;;AACzB,QAAM,EAAE,cAAAC,GAAc,gBAAAC,EAAA,IAAmBC,EAAA,GACnCC,IAAaC,EAAuB,IAAI,GAExCC,KAAkBC,IAAAR,EAAM,OAAO,KAAK,CAACS,MAAMP,EAAa,IAAIO,EAAE,EAAE,CAAC,MAA/C,gBAAAD,EAAkD,IACpEE,IAAgBV,EAAM,OAAO,UAAU,CAACS,MAAMA,EAAE,OAAOF,CAAe,GAEtEI,IAAgB,CAACC,MAAkD;;AACvE,UAAM,EAAE,KAAAC,MAAQD,GACVE,IAAeJ;AACrB,QAAIK,IAAYD;AAEhB,YAAQD,GAAA;AAAA,MACN,KAAK;AAAA,MACL,KAAK;AACH,QAAAD,EAAM,eAAA,GACNG,IACED,IAAe,IAAIA,IAAe,IAAId,EAAM,OAAO,SAAS;AAC9D;AAAA,MACF,KAAK;AAAA,MACL,KAAK;AACH,QAAAY,EAAM,eAAA,GACNG,IACED,IAAed,EAAM,OAAO,SAAS,IAAIc,IAAe,IAAI;AAC9D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AAA,EAAK,WAAU,cAAc,YAAM,MAAA,CAAM;AAAA,YAAA;AAAA,UAAA;AAAA,UApBrCC,EAAM;AAAA,QAAA;AAAA,MAuBjB,CAAC;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;"}
1
+ {"version":3,"file":"zone-pivot-selector.js","sources":["../../../../src/components/content-components/zone-pivots/zone-pivot-selector.tsx"],"sourcesContent":["import React, { useRef } from \"react\";\nimport { useZonePivotContext } from \"./zone-pivot-context\";\nimport type { ZonePivotGroup } from \"../../../types/page\";\nimport { cn } from \"../../../utils/cn\";\n\nexport interface ZonePivotSelectorProps {\n group: ZonePivotGroup;\n className?: string;\n}\n\nexport function ZonePivotSelector({\n group,\n className,\n}: ZonePivotSelectorProps) {\n const { activePivots, setActivePivot } = useZonePivotContext();\n const tabListRef = useRef<HTMLDivElement>(null);\n\n const selectedPivotId = group.pivots.find((p) => activePivots.has(p.id))?.id;\n const selectedIndex = group.pivots.findIndex((p) => p.id === selectedPivotId);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n const { key } = event;\n const currentIndex = selectedIndex;\n let nextIndex = currentIndex;\n\n switch (key) {\n case \"ArrowLeft\":\n case \"ArrowUp\":\n event.preventDefault();\n nextIndex =\n currentIndex > 0 ? currentIndex - 1 : group.pivots.length - 1;\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n event.preventDefault();\n nextIndex =\n currentIndex < group.pivots.length - 1 ? currentIndex + 1 : 0;\n break;\n case \"Home\":\n event.preventDefault();\n nextIndex = 0;\n break;\n case \"End\":\n event.preventDefault();\n nextIndex = group.pivots.length - 1;\n break;\n default:\n return;\n }\n\n const nextPivot = group.pivots[nextIndex];\n if (nextPivot) {\n setActivePivot(group.id, nextPivot.id);\n const button = tabListRef.current?.querySelector(\n `[data-pivot-id=\"${nextPivot.id}\"]`\n ) as HTMLButtonElement;\n button?.focus();\n }\n };\n\n return (\n <div className={className} data-zone-pivot-group={group.id}>\n <div\n ref={tabListRef}\n role=\"tablist\"\n aria-label={group.prompt}\n className=\"mint:inline-flex mint:items-center mint:gap-1 mint:p-0.5 mint:bg-[#f5f5f5] mint:rounded-lg mint:dark:bg-[#141414]\"\n >\n {group.pivots.map((pivot) => {\n const isSelected = pivot.id === selectedPivotId;\n return (\n <button\n key={pivot.id}\n id={`tab-${group.id}-${pivot.id}`}\n role=\"tab\"\n type=\"button\"\n data-pivot-id={pivot.id}\n aria-selected={isSelected}\n aria-controls={`panel-${group.id}-${pivot.id}`}\n tabIndex={isSelected ? 0 : -1}\n onClick={() => setActivePivot(group.id, pivot.id)}\n onKeyDown={handleKeyDown}\n className={cn(\n \"mint:relative mint:px-3 mint:py-1.5 mint:text-sm mint:rounded-md mint:bg-transparent mint:border-none mint:cursor-pointer mint:focus:outline-none mint:focus-visible:shadow-[0_0_0_2px_#3b82f6] mint:focus-visible:outline-offset-2\",\n isSelected\n ? \"mint:bg-white mint:text-[#141414] mint:shadow-sm mint:dark:bg-white/10 mint:dark:text-white mint:font-semibold\"\n : \"mint:text-gray-600 mint:hover:text-[#141414] mint:hover:bg-white/50 mint:dark:text-gray-400 mint:dark:hover:text-white mint:dark:hover:bg-white/10 mint:font-medium\"\n )}\n >\n <span className=\"mint:invisible mint:font-semibold mint:block mint:h-0 mint:overflow-hidden\" aria-hidden=\"true\">\n {pivot.title}\n </span>\n <span className=\"mint:block\">{pivot.title}</span>\n </button>\n );\n })}\n </div>\n </div>\n );\n}\n"],"names":["ZonePivotSelector","group","className","activePivots","setActivePivot","useZonePivotContext","tabListRef","useRef","selectedPivotId","_a","p","selectedIndex","handleKeyDown","event","key","currentIndex","nextIndex","nextPivot","button","jsx","pivot","isSelected","jsxs","cn"],"mappings":";;;;AAUO,SAASA,EAAkB;AAAA,EAChC,OAAAC;AAAA,EACA,WAAAC;AACF,GAA2B;;AACzB,QAAM,EAAE,cAAAC,GAAc,gBAAAC,EAAA,IAAmBC,EAAA,GACnCC,IAAaC,EAAuB,IAAI,GAExCC,KAAkBC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AAc;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,IAAI,OAAOrB,EAAM,EAAE,IAAImB,EAAM,EAAE;AAAA,YAC/B,MAAK;AAAA,YACL,MAAK;AAAA,YACL,iBAAeA,EAAM;AAAA,YACrB,iBAAeC;AAAA,YACf,iBAAe,SAASpB,EAAM,EAAE,IAAImB,EAAM,EAAE;AAAA,YAC5C,UAAUC,IAAa,IAAI;AAAA,YAC3B,SAAS,MAAMjB,EAAeH,EAAM,IAAImB,EAAM,EAAE;AAAA,YAChD,WAAWR;AAAA,YACX,WAAWW;AAAA,cACT;AAAA,cACAF,IACI,mHACA;AAAA,YAAA;AAAA,YAGN,UAAA;AAAA,cAAA,gBAAAF,EAAC,UAAK,WAAU,8EAA6E,eAAY,QACtG,YAAM,OACT;AAAA,cACA,gBAAAA,EAAC,QAAA,EAAK,WAAU,cAAc,YAAM,MAAA,CAAM;AAAA,YAAA;AAAA,UAAA;AAAA,UApBrCC,EAAM;AAAA,QAAA;AAAA,MAuBjB,CAAC;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;"}
@@ -27,7 +27,7 @@ function at({
27
27
  localization: N,
28
28
  telemetry: J,
29
29
  contextMenu: n,
30
- apiReferenceData2: r
30
+ apiReferenceData2: l
31
31
  }) {
32
32
  var f, h;
33
33
  const T = i.serializedContent, a = ((f = i.mdxExtracts) == null ? void 0 : f.zonePivotGroups) || [], c = (h = i.mdxExtracts) == null ? void 0 : h.pivotTocItems, P = !i.title, C = { ...{
@@ -42,10 +42,10 @@ function at({
42
42
  const { hash: m } = window.location;
43
43
  if (!m) return;
44
44
  const y = setTimeout(() => {
45
- const E = m.substring(1), l = document.getElementById("main-content"), g = document.getElementById(E);
46
- if (l && g) {
47
- const b = window.getComputedStyle(document.documentElement), z = parseFloat(b.getPropertyValue("--scroll-mt") || "0"), F = parseFloat(b.fontSize), I = z * F, L = l.getBoundingClientRect(), O = g.getBoundingClientRect().top - L.top + l.scrollTop - I;
48
- l.scrollTo({
45
+ const E = m.substring(1), r = document.getElementById("main-content"), g = document.getElementById(E);
46
+ if (r && g) {
47
+ const b = window.getComputedStyle(document.documentElement), z = parseFloat(b.getPropertyValue("--scroll-mt") || "0"), F = parseFloat(b.fontSize), I = z * F, L = r.getBoundingClientRect(), O = g.getBoundingClientRect().top - L.top + r.scrollTop - I;
48
+ r.scrollTo({
49
49
  top: O,
50
50
  behavior: "instant"
51
51
  });
@@ -83,7 +83,7 @@ function at({
83
83
  className: "mint:flex mint:flex-row-reverse mint:gap-12 mint:justify-center mint:mx-auto mint:w-full",
84
84
  id: "content-layout-container",
85
85
  children: [
86
- r != null && r.operation ? /* @__PURE__ */ t("div", { className: "mint:hidden mint:xl:!flex mint:self-start mint:sticky mint:flex-col mint:max-w-[28rem] mint:top-0 mint:gap-6", children: /* @__PURE__ */ t(B, { apiReferenceData: r }) }) : o && o.length > 0 ? /* @__PURE__ */ t("aside", { className: "mint:w-64 mint:shrink-0 mint:ml-8 mint:max-xl:hidden mint:xl:block", children: /* @__PURE__ */ e("div", { className: "mint:sticky mint:top-2 mint:p-2 mint:pb-6 mint:max-h-[calc(100vh-3.5rem)] mint:overflow-y-auto", children: [
86
+ l != null && l.operation ? /* @__PURE__ */ t("div", { className: "mint:hidden mint:xl:flex! mint:self-start mint:sticky mint:flex-col mint:max-w-md mint:top-0 mint:gap-6", children: /* @__PURE__ */ t(B, { apiReferenceData: l }) }) : o && o.length > 0 ? /* @__PURE__ */ t("aside", { className: "mint:w-68 mint:shrink-0 mint:ml-8 mint:max-xl:hidden mint:xl:block", children: /* @__PURE__ */ e("div", { className: "mint:sticky mint:top-2 mint:p-2 mint:pb-6 mint:max-h-[calc(100vh-3.5rem)] mint:overflow-y-auto", children: [
87
87
  /* @__PURE__ */ e("div", { className: "mint:flex mint:items-center mint:gap-2 mint:mb-4", children: [
88
88
  /* @__PURE__ */ t(S, { className: "mint:w-4 mint:h-4 mint:text-[#4b5563] mint:dark:text-[#9ca3af]" }),
89
89
  /* @__PURE__ */ t("h2", { className: "mint:text-sm mint:font-semibold mint:text-[#141414] mint:dark:text-white", children: C.onThisPage })
@@ -100,7 +100,7 @@ function at({
100
100
  children: [
101
101
  i.title && /* @__PURE__ */ t("header", { className: "mint:mb-6", children: /* @__PURE__ */ e("div", { className: "mint:flex mint:flex-col mint:gap-5", children: [
102
102
  /* @__PURE__ */ e("div", { className: "mint:flex mint:flex-col mint:gap-2 mint:items-start", children: [
103
- /* @__PURE__ */ t("h1", { className: "mint:text-[1.875rem] mint:font-bold mint:text-[#141414] mint:dark:text-white mint:m-0 mint:leading-[1.2]", children: i.title }),
103
+ /* @__PURE__ */ t("h1", { className: "mint:text-[1.875rem] mint:font-bold mint:text-[#141414] mint:dark:text-white mint:m-0 mint:leading-[1.2] mint:pt-3", children: i.title }),
104
104
  i.description && /* @__PURE__ */ t("p", { className: "mint:text-lg mint:text-[#4b5563] mint:dark:text-[#d1d5db] mint:m-0", children: i.description })
105
105
  ] }),
106
106
  s && /* @__PURE__ */ t(