@madebywild/sanity-icon-field 0.2.2 → 0.2.3

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 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/input.tsx","../src/types.tsx","../src/index.tsx"],"sourcesContent":["import { AsyncAutocomplete } from \"@madebywild/sanity-utils/async-autocomplete\";\nimport { Box, Card, Flex, Text } from \"@sanity/ui\";\nimport { type StringInputProps, set, unset } from \"sanity\";\nimport type { FieldOptions, PluginConfig } from \"./types\";\n\nfunction IconInput({\n pluginConfig,\n ...props\n}: StringInputProps & {\n pluginConfig: PluginConfig;\n}) {\n const options = props.schemaType.options as FieldOptions | undefined;\n const iconList = options?.iconList ?? pluginConfig.iconList;\n const renderOption = options?.renderOption ?? pluginConfig.renderOption;\n const renderSelected = options?.renderSelected ?? pluginConfig.renderSelected;\n\n return (\n <AsyncAutocomplete\n placeholder=\"Select icon\"\n noOptionsPlaceholder=\"No icons found\"\n listItems={iconList}\n value={props.value}\n renderValue={(value, opt) => opt?.label ?? value}\n onChange={(value) => {\n const next = value ? set(value) : unset();\n return props.onChange(next);\n }}\n renderSelected={(value) => {\n if (renderSelected) return renderSelected(value);\n return <Text size={2}>{value}</Text>;\n }}\n renderOption={({ label, value }) => {\n if (renderOption) return renderOption({ label, value });\n return (\n <Card as=\"button\">\n <Flex align=\"center\" padding={2}>\n <span>🧿</span>\n <Box flex={1} padding={2}>\n <Text size={2}>{label}</Text>\n </Box>\n </Flex>\n </Card>\n );\n }}\n />\n );\n}\n\nexport { IconInput };\n","import type { ListItems } from \"@madebywild/sanity-utils/async-autocomplete\";\nimport type { StringDefinition, StringOptions } from \"sanity\";\n\n/** @public */\nexport const typeName = \"wild.icon\" as const;\n\n/** @public */\nexport type PluginConfig = {\n iconList: ListItems;\n renderSelected?: (value: string) => React.JSX.Element;\n renderOption?: (item: { label?: string; value: string }) => React.JSX.Element;\n};\n\n/** @public */\nexport type FieldOptions = StringOptions & {\n iconList?: ListItems;\n renderSelected?: (value: string) => React.JSX.Element;\n renderOption?: (item: { label?: string; value: string }) => React.JSX.Element;\n};\n\n// Add the custom field definition to Sanity's intrinsic definitions\n// so that type checking works correctly when using this field type.\ndeclare module \"sanity\" {\n export interface IntrinsicDefinitions {\n [typeName]: Omit<StringDefinition, \"type\" | \"fields\"> & {\n type: typeof typeName;\n };\n }\n}\n","import { definePlugin, defineType } from \"sanity\";\nimport { IconInput } from \"./input\";\nimport { type FieldOptions, type PluginConfig, typeName } from \"./types\";\n\n/** @public */\nconst wildSanityIconFieldPlugin = definePlugin<PluginConfig>((config) => {\n return {\n name: \"@madebywild/sanity-icon-field\",\n schema: {\n types: [\n defineType({\n name: typeName,\n type: \"string\",\n title: \"Icon\",\n description: \"Select an icon.\",\n icon: () => <>🧿</>,\n components: {\n input: (props) => <IconInput pluginConfig={config} {...props} />,\n },\n }),\n ],\n },\n };\n});\n\nexport { wildSanityIconFieldPlugin, typeName, type PluginConfig, type FieldOptions };\n"],"names":["jsx","AsyncAutocomplete","set","unset","Text","Card","Flex","Box","definePlugin","defineType","Fragment"],"mappings":";;;AAKA,SAAS,UAAU;AAAA,EACjB;AAAA,EACA,GAAG;AACL,GAEG;AACD,QAAM,UAAU,MAAM,WAAW,SAC3B,WAAW,SAAS,YAAY,aAAa,UAC7C,eAAe,SAAS,gBAAgB,aAAa,cACrD,iBAAiB,SAAS,kBAAkB,aAAa;AAE/D,SACEA,2BAAAA;AAAAA,IAACC,kBAAAA;AAAAA,IAAA;AAAA,MACC,aAAY;AAAA,MACZ,sBAAqB;AAAA,MACrB,WAAW;AAAA,MACX,OAAO,MAAM;AAAA,MACb,aAAa,CAAC,OAAO,QAAQ,KAAK,SAAS;AAAA,MAC3C,UAAU,CAAC,UAAU;AACnB,cAAM,OAAO,QAAQC,OAAAA,IAAI,KAAK,IAAIC,OAAAA,MAAA;AAClC,eAAO,MAAM,SAAS,IAAI;AAAA,MAC5B;AAAA,MACA,gBAAgB,CAAC,UACX,iBAAuB,eAAe,KAAK,IACxCH,+BAACI,GAAAA,MAAA,EAAK,MAAM,GAAI,UAAA,MAAA,CAAM;AAAA,MAE/B,cAAc,CAAC,EAAE,OAAO,YAClB,eAAqB,aAAa,EAAE,OAAO,MAAA,CAAO,IAEpDJ,2BAAAA,IAACK,WAAK,IAAG,UACP,0CAACC,GAAAA,MAAA,EAAK,OAAM,UAAS,SAAS,GAC5B,UAAA;AAAA,QAAAN,2BAAAA,IAAC,UAAK,UAAA,YAAA,CAAE;AAAA,QACRA,2BAAAA,IAACO,GAAAA,KAAA,EAAI,MAAM,GAAG,SAAS,GACrB,UAAAP,2BAAAA,IAACI,GAAAA,MAAA,EAAK,MAAM,GAAI,UAAA,MAAA,CAAM,EAAA,CACxB;AAAA,MAAA,EAAA,CACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAKV;AC1CO,MAAM,WAAW,aCClB,4BAA4BI,OAAAA,aAA2B,CAAC,YACrD;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AAAA,IACN,OAAO;AAAA,MACLC,kBAAW;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,MAAM,MAAMT,2BAAAA,IAAAU,WAAAA,UAAA,EAAE,UAAA,YAAA,CAAE;AAAA,QAChB,YAAY;AAAA,UACV,OAAO,CAAC,UAAUV,+BAAC,aAAU,cAAc,QAAS,GAAG,MAAA,CAAO;AAAA,QAAA;AAAA,MAChE,CACD;AAAA,IAAA;AAAA,EACH;AAEJ,EACD;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/input.tsx","../src/types.tsx","../src/index.tsx"],"sourcesContent":["import { AsyncAutocomplete } from \"@madebywild/sanity-utils/async-autocomplete\";\nimport { Box, Card, Flex, Text } from \"@sanity/ui\";\nimport { type StringInputProps, set, unset } from \"sanity\";\nimport type { FieldOptions, PluginConfig } from \"./types\";\n\nfunction IconInput({\n pluginConfig,\n ...props\n}: StringInputProps & {\n pluginConfig: PluginConfig;\n}) {\n const options = props.schemaType.options as FieldOptions | undefined;\n const iconList = options?.iconList ?? pluginConfig.iconList;\n const renderOption = options?.renderOption ?? pluginConfig.renderOption;\n const renderSelected = options?.renderSelected ?? pluginConfig.renderSelected;\n\n return (\n <AsyncAutocomplete\n placeholder=\"Select icon\"\n noOptionsPlaceholder=\"No icons found\"\n listItems={iconList}\n value={props.value}\n renderValue={(value, opt) => opt?.label ?? value}\n onChange={(value) => {\n const next = value ? set(value) : unset();\n return props.onChange(next);\n }}\n renderSelected={(value) => {\n if (renderSelected) return renderSelected(value);\n return <Text size={2}>{value}</Text>;\n }}\n renderOption={({ label, value }) => {\n if (renderOption) return renderOption({ label, value });\n return (\n <Card as=\"button\">\n <Flex align=\"center\" padding={2}>\n <span>🧿</span>\n <Box flex={1} padding={2}>\n <Text size={2}>{label}</Text>\n </Box>\n </Flex>\n </Card>\n );\n }}\n />\n );\n}\n\nexport { IconInput };\n","import type { ListItems } from \"@madebywild/sanity-utils/async-autocomplete\";\nimport type { StringDefinition, StringOptions } from \"sanity\";\n\n/** @public */\nexport const typeName = \"wild.icon\" as const;\n\n/** @public */\nexport type PluginConfig = {\n iconList: ListItems;\n renderSelected?: (value: string) => React.JSX.Element;\n renderOption?: (item: { label?: string; value: string }) => React.JSX.Element;\n};\n\n/** @public */\nexport type FieldOptions = StringOptions & {\n iconList?: ListItems;\n renderSelected?: (value: string) => React.JSX.Element;\n renderOption?: (item: { label?: string; value: string }) => React.JSX.Element;\n};\n\n// Add the custom field definition to Sanity's intrinsic definitions\n// so that type checking works correctly when using this field type.\ndeclare module \"sanity\" {\n export interface IntrinsicDefinitions {\n [typeName]: Omit<StringDefinition, \"type\" | \"fields\" | \"options\"> & {\n type: typeof typeName;\n options?: FieldOptions;\n };\n }\n}\n","import { definePlugin, defineType } from \"sanity\";\nimport { IconInput } from \"./input\";\nimport { type FieldOptions, type PluginConfig, typeName } from \"./types\";\n\n/** @public */\nconst wildSanityIconFieldPlugin = definePlugin<PluginConfig>((config) => {\n return {\n name: \"@madebywild/sanity-icon-field\",\n schema: {\n types: [\n defineType({\n name: typeName,\n type: \"string\",\n title: \"Icon\",\n description: \"Select an icon.\",\n icon: () => <>🧿</>,\n components: {\n input: (props) => <IconInput pluginConfig={config} {...props} />,\n },\n }),\n ],\n },\n };\n});\n\nexport { wildSanityIconFieldPlugin, typeName, type PluginConfig, type FieldOptions };\n"],"names":["jsx","AsyncAutocomplete","set","unset","Text","Card","Flex","Box","definePlugin","defineType","Fragment"],"mappings":";;;AAKA,SAAS,UAAU;AAAA,EACjB;AAAA,EACA,GAAG;AACL,GAEG;AACD,QAAM,UAAU,MAAM,WAAW,SAC3B,WAAW,SAAS,YAAY,aAAa,UAC7C,eAAe,SAAS,gBAAgB,aAAa,cACrD,iBAAiB,SAAS,kBAAkB,aAAa;AAE/D,SACEA,2BAAAA;AAAAA,IAACC,kBAAAA;AAAAA,IAAA;AAAA,MACC,aAAY;AAAA,MACZ,sBAAqB;AAAA,MACrB,WAAW;AAAA,MACX,OAAO,MAAM;AAAA,MACb,aAAa,CAAC,OAAO,QAAQ,KAAK,SAAS;AAAA,MAC3C,UAAU,CAAC,UAAU;AACnB,cAAM,OAAO,QAAQC,OAAAA,IAAI,KAAK,IAAIC,OAAAA,MAAA;AAClC,eAAO,MAAM,SAAS,IAAI;AAAA,MAC5B;AAAA,MACA,gBAAgB,CAAC,UACX,iBAAuB,eAAe,KAAK,IACxCH,+BAACI,GAAAA,MAAA,EAAK,MAAM,GAAI,UAAA,MAAA,CAAM;AAAA,MAE/B,cAAc,CAAC,EAAE,OAAO,YAClB,eAAqB,aAAa,EAAE,OAAO,MAAA,CAAO,IAEpDJ,2BAAAA,IAACK,WAAK,IAAG,UACP,0CAACC,GAAAA,MAAA,EAAK,OAAM,UAAS,SAAS,GAC5B,UAAA;AAAA,QAAAN,2BAAAA,IAAC,UAAK,UAAA,YAAA,CAAE;AAAA,QACRA,2BAAAA,IAACO,GAAAA,KAAA,EAAI,MAAM,GAAG,SAAS,GACrB,UAAAP,2BAAAA,IAACI,GAAAA,MAAA,EAAK,MAAM,GAAI,UAAA,MAAA,CAAM,EAAA,CACxB;AAAA,MAAA,EAAA,CACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAKV;AC1CO,MAAM,WAAW,aCClB,4BAA4BI,OAAAA,aAA2B,CAAC,YACrD;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AAAA,IACN,OAAO;AAAA,MACLC,kBAAW;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,MAAM,MAAMT,2BAAAA,IAAAU,WAAAA,UAAA,EAAE,UAAA,YAAA,CAAE;AAAA,QAChB,YAAY;AAAA,UACV,OAAO,CAAC,UAAUV,+BAAC,aAAU,cAAc,QAAS,GAAG,MAAA,CAAO;AAAA,QAAA;AAAA,MAChE,CACD;AAAA,IAAA;AAAA,EACH;AAEJ,EACD;;;"}
package/dist/index.d.cts CHANGED
@@ -30,8 +30,9 @@ type FieldOptions = StringOptions & {
30
30
  };
31
31
  declare module "sanity" {
32
32
  interface IntrinsicDefinitions {
33
- [typeName]: Omit<StringDefinition, "type" | "fields"> & {
33
+ [typeName]: Omit<StringDefinition, "type" | "fields" | "options"> & {
34
34
  type: typeof typeName;
35
+ options?: FieldOptions;
35
36
  };
36
37
  }
37
38
  }
package/dist/index.d.ts CHANGED
@@ -30,8 +30,9 @@ type FieldOptions = StringOptions & {
30
30
  };
31
31
  declare module "sanity" {
32
32
  interface IntrinsicDefinitions {
33
- [typeName]: Omit<StringDefinition, "type" | "fields"> & {
33
+ [typeName]: Omit<StringDefinition, "type" | "fields" | "options"> & {
34
34
  type: typeof typeName;
35
+ options?: FieldOptions;
35
36
  };
36
37
  }
37
38
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/input.tsx","../src/types.tsx","../src/index.tsx"],"sourcesContent":["import { AsyncAutocomplete } from \"@madebywild/sanity-utils/async-autocomplete\";\nimport { Box, Card, Flex, Text } from \"@sanity/ui\";\nimport { type StringInputProps, set, unset } from \"sanity\";\nimport type { FieldOptions, PluginConfig } from \"./types\";\n\nfunction IconInput({\n pluginConfig,\n ...props\n}: StringInputProps & {\n pluginConfig: PluginConfig;\n}) {\n const options = props.schemaType.options as FieldOptions | undefined;\n const iconList = options?.iconList ?? pluginConfig.iconList;\n const renderOption = options?.renderOption ?? pluginConfig.renderOption;\n const renderSelected = options?.renderSelected ?? pluginConfig.renderSelected;\n\n return (\n <AsyncAutocomplete\n placeholder=\"Select icon\"\n noOptionsPlaceholder=\"No icons found\"\n listItems={iconList}\n value={props.value}\n renderValue={(value, opt) => opt?.label ?? value}\n onChange={(value) => {\n const next = value ? set(value) : unset();\n return props.onChange(next);\n }}\n renderSelected={(value) => {\n if (renderSelected) return renderSelected(value);\n return <Text size={2}>{value}</Text>;\n }}\n renderOption={({ label, value }) => {\n if (renderOption) return renderOption({ label, value });\n return (\n <Card as=\"button\">\n <Flex align=\"center\" padding={2}>\n <span>🧿</span>\n <Box flex={1} padding={2}>\n <Text size={2}>{label}</Text>\n </Box>\n </Flex>\n </Card>\n );\n }}\n />\n );\n}\n\nexport { IconInput };\n","import type { ListItems } from \"@madebywild/sanity-utils/async-autocomplete\";\nimport type { StringDefinition, StringOptions } from \"sanity\";\n\n/** @public */\nexport const typeName = \"wild.icon\" as const;\n\n/** @public */\nexport type PluginConfig = {\n iconList: ListItems;\n renderSelected?: (value: string) => React.JSX.Element;\n renderOption?: (item: { label?: string; value: string }) => React.JSX.Element;\n};\n\n/** @public */\nexport type FieldOptions = StringOptions & {\n iconList?: ListItems;\n renderSelected?: (value: string) => React.JSX.Element;\n renderOption?: (item: { label?: string; value: string }) => React.JSX.Element;\n};\n\n// Add the custom field definition to Sanity's intrinsic definitions\n// so that type checking works correctly when using this field type.\ndeclare module \"sanity\" {\n export interface IntrinsicDefinitions {\n [typeName]: Omit<StringDefinition, \"type\" | \"fields\"> & {\n type: typeof typeName;\n };\n }\n}\n","import { definePlugin, defineType } from \"sanity\";\nimport { IconInput } from \"./input\";\nimport { type FieldOptions, type PluginConfig, typeName } from \"./types\";\n\n/** @public */\nconst wildSanityIconFieldPlugin = definePlugin<PluginConfig>((config) => {\n return {\n name: \"@madebywild/sanity-icon-field\",\n schema: {\n types: [\n defineType({\n name: typeName,\n type: \"string\",\n title: \"Icon\",\n description: \"Select an icon.\",\n icon: () => <>🧿</>,\n components: {\n input: (props) => <IconInput pluginConfig={config} {...props} />,\n },\n }),\n ],\n },\n };\n});\n\nexport { wildSanityIconFieldPlugin, typeName, type PluginConfig, type FieldOptions };\n"],"names":[],"mappings":";;;;AAKA,SAAS,UAAU;AAAA,EACjB;AAAA,EACA,GAAG;AACL,GAEG;AACD,QAAM,UAAU,MAAM,WAAW,SAC3B,WAAW,SAAS,YAAY,aAAa,UAC7C,eAAe,SAAS,gBAAgB,aAAa,cACrD,iBAAiB,SAAS,kBAAkB,aAAa;AAE/D,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAY;AAAA,MACZ,sBAAqB;AAAA,MACrB,WAAW;AAAA,MACX,OAAO,MAAM;AAAA,MACb,aAAa,CAAC,OAAO,QAAQ,KAAK,SAAS;AAAA,MAC3C,UAAU,CAAC,UAAU;AACnB,cAAM,OAAO,QAAQ,IAAI,KAAK,IAAI,MAAA;AAClC,eAAO,MAAM,SAAS,IAAI;AAAA,MAC5B;AAAA,MACA,gBAAgB,CAAC,UACX,iBAAuB,eAAe,KAAK,IACxC,oBAAC,MAAA,EAAK,MAAM,GAAI,UAAA,MAAA,CAAM;AAAA,MAE/B,cAAc,CAAC,EAAE,OAAO,YAClB,eAAqB,aAAa,EAAE,OAAO,MAAA,CAAO,IAEpD,oBAAC,QAAK,IAAG,UACP,+BAAC,MAAA,EAAK,OAAM,UAAS,SAAS,GAC5B,UAAA;AAAA,QAAA,oBAAC,UAAK,UAAA,YAAA,CAAE;AAAA,QACR,oBAAC,KAAA,EAAI,MAAM,GAAG,SAAS,GACrB,UAAA,oBAAC,MAAA,EAAK,MAAM,GAAI,UAAA,MAAA,CAAM,EAAA,CACxB;AAAA,MAAA,EAAA,CACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAKV;AC1CO,MAAM,WAAW,aCClB,4BAA4B,aAA2B,CAAC,YACrD;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,WAAW;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,MAAM,MAAM,oBAAA,UAAA,EAAE,UAAA,YAAA,CAAE;AAAA,QAChB,YAAY;AAAA,UACV,OAAO,CAAC,UAAU,oBAAC,aAAU,cAAc,QAAS,GAAG,MAAA,CAAO;AAAA,QAAA;AAAA,MAChE,CACD;AAAA,IAAA;AAAA,EACH;AAEJ,EACD;"}
1
+ {"version":3,"file":"index.js","sources":["../src/input.tsx","../src/types.tsx","../src/index.tsx"],"sourcesContent":["import { AsyncAutocomplete } from \"@madebywild/sanity-utils/async-autocomplete\";\nimport { Box, Card, Flex, Text } from \"@sanity/ui\";\nimport { type StringInputProps, set, unset } from \"sanity\";\nimport type { FieldOptions, PluginConfig } from \"./types\";\n\nfunction IconInput({\n pluginConfig,\n ...props\n}: StringInputProps & {\n pluginConfig: PluginConfig;\n}) {\n const options = props.schemaType.options as FieldOptions | undefined;\n const iconList = options?.iconList ?? pluginConfig.iconList;\n const renderOption = options?.renderOption ?? pluginConfig.renderOption;\n const renderSelected = options?.renderSelected ?? pluginConfig.renderSelected;\n\n return (\n <AsyncAutocomplete\n placeholder=\"Select icon\"\n noOptionsPlaceholder=\"No icons found\"\n listItems={iconList}\n value={props.value}\n renderValue={(value, opt) => opt?.label ?? value}\n onChange={(value) => {\n const next = value ? set(value) : unset();\n return props.onChange(next);\n }}\n renderSelected={(value) => {\n if (renderSelected) return renderSelected(value);\n return <Text size={2}>{value}</Text>;\n }}\n renderOption={({ label, value }) => {\n if (renderOption) return renderOption({ label, value });\n return (\n <Card as=\"button\">\n <Flex align=\"center\" padding={2}>\n <span>🧿</span>\n <Box flex={1} padding={2}>\n <Text size={2}>{label}</Text>\n </Box>\n </Flex>\n </Card>\n );\n }}\n />\n );\n}\n\nexport { IconInput };\n","import type { ListItems } from \"@madebywild/sanity-utils/async-autocomplete\";\nimport type { StringDefinition, StringOptions } from \"sanity\";\n\n/** @public */\nexport const typeName = \"wild.icon\" as const;\n\n/** @public */\nexport type PluginConfig = {\n iconList: ListItems;\n renderSelected?: (value: string) => React.JSX.Element;\n renderOption?: (item: { label?: string; value: string }) => React.JSX.Element;\n};\n\n/** @public */\nexport type FieldOptions = StringOptions & {\n iconList?: ListItems;\n renderSelected?: (value: string) => React.JSX.Element;\n renderOption?: (item: { label?: string; value: string }) => React.JSX.Element;\n};\n\n// Add the custom field definition to Sanity's intrinsic definitions\n// so that type checking works correctly when using this field type.\ndeclare module \"sanity\" {\n export interface IntrinsicDefinitions {\n [typeName]: Omit<StringDefinition, \"type\" | \"fields\" | \"options\"> & {\n type: typeof typeName;\n options?: FieldOptions;\n };\n }\n}\n","import { definePlugin, defineType } from \"sanity\";\nimport { IconInput } from \"./input\";\nimport { type FieldOptions, type PluginConfig, typeName } from \"./types\";\n\n/** @public */\nconst wildSanityIconFieldPlugin = definePlugin<PluginConfig>((config) => {\n return {\n name: \"@madebywild/sanity-icon-field\",\n schema: {\n types: [\n defineType({\n name: typeName,\n type: \"string\",\n title: \"Icon\",\n description: \"Select an icon.\",\n icon: () => <>🧿</>,\n components: {\n input: (props) => <IconInput pluginConfig={config} {...props} />,\n },\n }),\n ],\n },\n };\n});\n\nexport { wildSanityIconFieldPlugin, typeName, type PluginConfig, type FieldOptions };\n"],"names":[],"mappings":";;;;AAKA,SAAS,UAAU;AAAA,EACjB;AAAA,EACA,GAAG;AACL,GAEG;AACD,QAAM,UAAU,MAAM,WAAW,SAC3B,WAAW,SAAS,YAAY,aAAa,UAC7C,eAAe,SAAS,gBAAgB,aAAa,cACrD,iBAAiB,SAAS,kBAAkB,aAAa;AAE/D,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAY;AAAA,MACZ,sBAAqB;AAAA,MACrB,WAAW;AAAA,MACX,OAAO,MAAM;AAAA,MACb,aAAa,CAAC,OAAO,QAAQ,KAAK,SAAS;AAAA,MAC3C,UAAU,CAAC,UAAU;AACnB,cAAM,OAAO,QAAQ,IAAI,KAAK,IAAI,MAAA;AAClC,eAAO,MAAM,SAAS,IAAI;AAAA,MAC5B;AAAA,MACA,gBAAgB,CAAC,UACX,iBAAuB,eAAe,KAAK,IACxC,oBAAC,MAAA,EAAK,MAAM,GAAI,UAAA,MAAA,CAAM;AAAA,MAE/B,cAAc,CAAC,EAAE,OAAO,YAClB,eAAqB,aAAa,EAAE,OAAO,MAAA,CAAO,IAEpD,oBAAC,QAAK,IAAG,UACP,+BAAC,MAAA,EAAK,OAAM,UAAS,SAAS,GAC5B,UAAA;AAAA,QAAA,oBAAC,UAAK,UAAA,YAAA,CAAE;AAAA,QACR,oBAAC,KAAA,EAAI,MAAM,GAAG,SAAS,GACrB,UAAA,oBAAC,MAAA,EAAK,MAAM,GAAI,UAAA,MAAA,CAAM,EAAA,CACxB;AAAA,MAAA,EAAA,CACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAKV;AC1CO,MAAM,WAAW,aCClB,4BAA4B,aAA2B,CAAC,YACrD;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,WAAW;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,MAAM,MAAM,oBAAA,UAAA,EAAE,UAAA,YAAA,CAAE;AAAA,QAChB,YAAY;AAAA,UACV,OAAO,CAAC,UAAU,oBAAC,aAAU,cAAc,QAAS,GAAG,MAAA,CAAO;AAAA,QAAA;AAAA,MAChE,CACD;AAAA,IAAA;AAAA,EACH;AAEJ,EACD;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madebywild/sanity-icon-field",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "UNLICENSED",
@@ -21,7 +21,7 @@
21
21
  "access": "restricted"
22
22
  },
23
23
  "dependencies": {
24
- "@madebywild/sanity-utils": "0.2.2"
24
+ "@madebywild/sanity-utils": "0.2.3"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@sanity/ui": "^3.1",
package/src/types.tsx CHANGED
@@ -22,8 +22,9 @@ export type FieldOptions = StringOptions & {
22
22
  // so that type checking works correctly when using this field type.
23
23
  declare module "sanity" {
24
24
  export interface IntrinsicDefinitions {
25
- [typeName]: Omit<StringDefinition, "type" | "fields"> & {
25
+ [typeName]: Omit<StringDefinition, "type" | "fields" | "options"> & {
26
26
  type: typeof typeName;
27
+ options?: FieldOptions;
27
28
  };
28
29
  }
29
30
  }