@sanity/color-input

6.1.36.1.4
~

Modified (3 files)

Index: package/dist/index.js
===================================================================
--- package/dist/index.js
+++ package/dist/index.js
@@ -4,9 +4,9 @@
 import { c } from "react/compiler-runtime";
 import { assignInlineVars } from "@vanilla-extract/dynamic";
 import { lazy } from "react";
 import { jsx } from "react/jsx-runtime";
-const ColorInput = lazy(() => import("./ColorInput-BRrHwG0Y.js"));
+const ColorInput = lazy(() => import("./ColorInput-CMhbbfkK.js"));
 var backgroundColorVar = "var(--aabeth0)", colorPreview = "aabeth2", opacityVar = "var(--aabeth1)";
 const round = (val = 1) => Math.round(val * 100);
 function ColorPreviewMedia(t0) {
 	let $ = c(5), { hex, alpha } = t0, t1 = hex ?? "#000", t2 = String(alpha ?? 1), t3;
Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
 {
   "name": "@sanity/color-input",
-  "version": "6.1.3",
+  "version": "6.1.4",
   "description": "Color input",
   "keywords": [
     "cms",
     "color-input",
@@ -39,25 +39,25 @@
     "./package.json": "./package.json"
   },
   "dependencies": {
     "@sanity/icons": "^5.2.1",
-    "@sanity/ui": "^4.0.1",
+    "@sanity/ui": "^4.0.4",
     "@vanilla-extract/dynamic": "^2.1.5",
     "lodash-es": "^4.18.1",
     "tinycolor2": "^1.6.0"
   },
   "devDependencies": {
     "@sanity/tsconfig": "^2.2.1",
-    "@sanity/tsdown-config": "^0.24.0",
-    "@sanity/vanilla-extract-vite-plugin": "^0.2.11",
+    "@sanity/tsdown-config": "^0.26.0",
+    "@sanity/vanilla-extract-vite-plugin": "^0.2.13",
     "@types/lodash-es": "^4.17.12",
     "@types/node": "^24.13.3",
     "@types/react": "^19.2.18",
     "@types/tinycolor2": "^1.4.6",
     "@vanilla-extract/css": "^1.21.2",
-    "babel-plugin-react-compiler": "^1.0.0",
+    "oxc-transform-react": "^0.145.0",
     "react": "^19.2.8",
-    "sanity": "^6.9.1",
+    "sanity": "^6.10.1",
     "tsdown": "^0.22.14"
   },
   "peerDependencies": {
     "react": "^19.2",
Index: package/dist/index.js.map
===================================================================
--- package/dist/index.js.map
+++ package/dist/index.js.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"index.js","names":["lazy","ColorInput","assignInlineVars","defineType","ObjectDefinition","ColorInput","ColorOptions","backgroundColorVar","colorPreview","opacityVar","round","val","Math","colorTypeName","ColorDefinition","Omit","type","options","IntrinsicDefinitions","color","ColorPreviewMedia","t0","$","_c","hex","alpha","t1","t2","String","t3","t4","name","title","components","input","fields","preview","select","hsl","prepare","h","s","l","subtitle","media","defineType","hslaColor","title","name","type","fields","defineType","hsvaColor","title","name","type","fields","defineType","rgbaColor","title","name","type","fields","definePlugin","color","ColorDefinition","hslaColor","hsvaColor","rgbaColor","colorInput","name","schema","types","ColorInput","ColorInputProps","ColorOptions","ColorSchemaType","ColorValue"],"sources":["../src/LazyColorInput.tsx","../src/schemas/colorPreview.css.ts","../src/schemas/color.tsx","../src/schemas/hslaColor.ts","../src/schemas/hsvaColor.ts","../src/schemas/rgbaColor.ts","../src/index.ts"],"sourcesContent":["import {lazy} from 'react'\n\nexport const ColorInput = lazy(() => import('./ColorInput'))\n","import {createVar, style} from '@vanilla-extract/css'\n\nexport const backgroundColorVar = createVar()\nexport const opacityVar = createVar()\n\nexport const colorPreview = style({\n  backgroundColor: backgroundColorVar,\n  opacity: opacityVar,\n  position: 'absolute',\n  height: '100%',\n  width: '100%',\n  top: 0,\n  left: 0,\n})\n","import {assignInlineVars} from '@vanilla-extract/dynamic'\nimport {defineType, type ObjectDefinition} from 'sanity'\n\nimport {ColorInput} from '../LazyColorInput'\nimport {type ColorOptions} from '../types'\n\nimport {backgroundColorVar, colorPreview, opacityVar} from './colorPreview.css'\n\nconst round = (val: number = 1) => Math.round(val * 100)\n\nconst colorTypeName = 'color'\n\n/**\n * @public\n */\nexport interface ColorDefinition extends Omit<ObjectDefinition, 'type' | 'fields' | 'options'> {\n  type: typeof colorTypeName\n  options?: ColorOptions\n}\n\ndeclare module 'sanity' {\n  // makes type: 'color' narrow correctly when using defineType/defineField/defineArrayMember\n  export interface IntrinsicDefinitions {\n    color: ColorDefinition\n  }\n}\n\nfunction ColorPreviewMedia({hex, alpha}: {hex?: string; alpha?: number}) {\n  return (\n    <div\n      className={colorPreview}\n      style={assignInlineVars({\n        [backgroundColorVar]: hex ?? '#000',\n        [opacityVar]: String(alpha ?? 1),\n      })}\n    />\n  )\n}\n\nexport const color = defineType({\n  name: colorTypeName,\n  type: 'object',\n  title: 'Color',\n  components: {input: ColorInput},\n  fields: [\n    {\n      title: 'Hex',\n      name: 'hex',\n      type: 'string',\n    },\n    {\n      title: 'Alpha',\n      name: 'alpha',\n      type: 'number',\n    },\n    {\n      title: 'Hue Saturation Lightness',\n      name: 'hsl',\n      type: 'hslaColor',\n    },\n    {\n      title: 'Hue Saturation Value',\n      name: 'hsv',\n      type: 'hsvaColor',\n    },\n    {\n      title: 'Red Green Blue (rgb)',\n      name: 'rgb',\n      type: 'rgbaColor',\n    },\n  ],\n  preview: {\n    select: {\n      title: 'hex',\n      alpha: 'alpha',\n      hex: 'hex',\n      hsl: 'hsl',\n    },\n    prepare({\n      title,\n      hex,\n      hsl,\n      alpha,\n    }: {\n      title?: string\n      alpha?: number\n      hex?: string\n      hsl?: {h: number; s: number; l: number}\n    }) {\n      let subtitle = hex || 'No color set'\n      if (hsl) {\n        subtitle = `H:${round(hsl.h)} S:${round(hsl.s)} L:${round(hsl.l)} A:${round(alpha)}`\n      }\n      return {\n        title: title || 'Color',\n        subtitle: subtitle,\n        media: () => <ColorPreviewMedia hex={hex} alpha={alpha} />,\n      }\n    },\n  },\n})\n","import {defineType} from 'sanity'\n\nexport const hslaColor = defineType({\n  title: 'Hue Saturation Lightness',\n  name: 'hslaColor',\n  type: 'object',\n  fields: [\n    {name: 'h', type: 'number', title: 'Hue'},\n    {name: 's', type: 'number', title: 'Saturation'},\n    {name: 'l', type: 'number', title: 'Lightness'},\n    {name: 'a', type: 'number', title: 'Alpha'},\n  ],\n})\n","import {defineType} from 'sanity'\n\nexport const hsvaColor = defineType({\n  title: 'Hue Saturation Value',\n  name: 'hsvaColor',\n  type: 'object',\n  fields: [\n    {name: 'h', type: 'number', title: 'Hue'},\n    {name: 's', type: 'number', title: 'Saturation'},\n    {name: 'v', type: 'number', title: 'Value'},\n    {name: 'a', type: 'number', title: 'Alpha'},\n  ],\n})\n","import {defineType} from 'sanity'\n\nexport const rgbaColor = defineType({\n  title: 'Red Green Blue (rgb)',\n  name: 'rgbaColor',\n  type: 'object',\n  fields: [\n    {name: 'r', type: 'number', title: 'Red'},\n    {name: 'g', type: 'number', title: 'Green'},\n    {name: 'b', type: 'number', title: 'Blue'},\n    {name: 'a', type: 'number', title: 'Alpha'},\n  ],\n})\n","import '@sanity/ui/styles.css'\nimport {definePlugin} from 'sanity'\n\nimport {color, type ColorDefinition} from './schemas/color'\nimport {hslaColor} from './schemas/hslaColor'\nimport {hsvaColor} from './schemas/hsvaColor'\nimport {rgbaColor} from './schemas/rgbaColor'\n\nexport const colorInput = definePlugin({\n  name: '@sanity/color-input',\n  schema: {\n    types: [hslaColor, hsvaColor, rgbaColor, color],\n  },\n})\n\nexport {color, hslaColor, hsvaColor, rgbaColor}\nexport {ColorInput} from './LazyColorInput'\nexport type {ColorDefinition}\nexport type {ColorInputProps, ColorOptions, ColorSchemaType, ColorValue} from './types'\n"],"mappings":";;;;;;;AAEA,MAAA,aAAA,WAAA,OAAA,2BAAA;;AEMA,MAAA,SAAA,MAAA,MAAA,KAAA,MAAA,MAAA,GAAA;AAmBA,SAAA,kBAAA,IAAA;CAAA,IAAA,IAAA,EAAA,CAAA,GAA2B,EAAA,KAAA,UAAA,IAKG,KAAA,OAAA,QACR,KAAA,OAAA,SAAA,CAAA,GAAkB;CAAA,AAAA,EAAA,OAAA,MAAA,EAAA,OAAA,MAF3B6B,KAAAA,iBAAAA;GACJtB,qBAAAA;GACAE,aAAAA;CACH,CAAA,GAAEa,EAAAA,KAAAA,IAAAA,EAAAA,KAAAA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;EAC9C;GAACC,MAAAA;GAAWC,MAAAA;GAAgBF,OAAAA;EAAc;CAAC;AAE/C,CAAA,GCVA,YAAA,WAAA;CACEM,OAAAA;CACAC,MAAAA;CACAC,MAAAA;CACAC,QAAAA;EACE;GAACF,MAAAA;GAAWC,MAAAA;GAAgBF,OAAAA;EAAY;EACxC;GAACC,MAAAA;GAAWC,MAAAA;GAAgBF,OAAAA;EAAmB;EAC/C;GAACC,MAAAA;GAAWC,MAAAA;GAAgBF,OAAAA;EAAc;EAC1C;GAACC,MAAAA;GAAWC,MAAAA;GAAgBF,OAAAA;EAAc;CAAC;AAE/C,CAAA,GCVA,YAAA,WAAA;CACEM,OAAAA;CACAC,MAAAA;CACAC,MAAAA;CACAC,QAAAA;EACE;GAACF,MAAAA;GAAWC,MAAAA;GAAgBF,OAAAA;EAAY;EACxC;GAACC,MAAAA;GAAWC,MAAAA;GAAgBF,OAAAA;EAAc;EAC1C;GAACC,MAAAA;GAAWC,MAAAA;GAAgBF,OAAAA;EAAa;EACzC;GAACC,MAAAA;GAAWC,MAAAA;GAAgBF,OAAAA;EAAc;CAAC;AAE/C,CAAA,GCJA,aAAA,aAAA;CACEW,MAAAA;CACAC,QAAAA,EAAAA,OAAAA;EACUL;EAAWC;EAAWC;EAAWJ;CAAK,EAAA;AAElD,CAAA"}
\ No newline at end of file
+{"version":3,"file":"index.js","names":["{hex, alpha}: {hex?: string; alpha?: number}","assignInlineVars({\n        [backgroundColorVar]: hex ?? '#000',\n        [opacityVar]: String(alpha ?? 1),\n      })","hex ?? '#000'","String(alpha ?? 1)","<div\n      className={colorPreview}\n      style={assignInlineVars({\n        [backgroundColorVar]: hex ?? '#000',\n        [opacityVar]: String(alpha ?? 1),\n      })}\n    />"],"sources":["../src/LazyColorInput.tsx","../src/schemas/colorPreview.css.ts","../src/schemas/color.tsx","../src/schemas/hslaColor.ts","../src/schemas/hsvaColor.ts","../src/schemas/rgbaColor.ts","../src/index.ts"],"sourcesContent":["import {lazy} from 'react'\n\nexport const ColorInput = lazy(() => import('./ColorInput'))\n","import {createVar, style} from '@vanilla-extract/css'\n\nexport const backgroundColorVar = createVar()\nexport const opacityVar = createVar()\n\nexport const colorPreview = style({\n  backgroundColor: backgroundColorVar,\n  opacity: opacityVar,\n  position: 'absolute',\n  height: '100%',\n  width: '100%',\n  top: 0,\n  left: 0,\n})\n","import {assignInlineVars} from '@vanilla-extract/dynamic'\nimport {defineType, type ObjectDefinition} from 'sanity'\n\nimport {ColorInput} from '../LazyColorInput'\nimport {type ColorOptions} from '../types'\n\nimport {backgroundColorVar, colorPreview, opacityVar} from './colorPreview.css'\n\nconst round = (val: number = 1) => Math.round(val * 100)\n\nconst colorTypeName = 'color'\n\n/**\n * @public\n */\nexport interface ColorDefinition extends Omit<ObjectDefinition, 'type' | 'fields' | 'options'> {\n  type: typeof colorTypeName\n  options?: ColorOptions\n}\n\ndeclare module 'sanity' {\n  // makes type: 'color' narrow correctly when using defineType/defineField/defineArrayMember\n  export interface IntrinsicDefinitions {\n    color: ColorDefinition\n  }\n}\n\nfunction ColorPreviewMedia({hex, alpha}: {hex?: string; alpha?: number}) {\n  return (\n    <div\n      className={colorPreview}\n      style={assignInlineVars({\n        [backgroundColorVar]: hex ?? '#000',\n        [opacityVar]: String(alpha ?? 1),\n      })}\n    />\n  )\n}\n\nexport const color = defineType({\n  name: colorTypeName,\n  type: 'object',\n  title: 'Color',\n  components: {input: ColorInput},\n  fields: [\n    {\n      title: 'Hex',\n      name: 'hex',\n      type: 'string',\n    },\n    {\n      title: 'Alpha',\n      name: 'alpha',\n      type: 'number',\n    },\n    {\n      title: 'Hue Saturation Lightness',\n      name: 'hsl',\n      type: 'hslaColor',\n    },\n    {\n      title: 'Hue Saturation Value',\n      name: 'hsv',\n      type: 'hsvaColor',\n    },\n    {\n      title: 'Red Green Blue (rgb)',\n      name: 'rgb',\n      type: 'rgbaColor',\n    },\n  ],\n  preview: {\n    select: {\n      title: 'hex',\n      alpha: 'alpha',\n      hex: 'hex',\n      hsl: 'hsl',\n    },\n    prepare({\n      title,\n      hex,\n      hsl,\n      alpha,\n    }: {\n      title?: string\n      alpha?: number\n      hex?: string\n      hsl?: {h: number; s: number; l: number}\n    }) {\n      let subtitle = hex || 'No color set'\n      if (hsl) {\n        subtitle = `H:${round(hsl.h)} S:${round(hsl.s)} L:${round(hsl.l)} A:${round(alpha)}`\n      }\n      return {\n        title: title || 'Color',\n        subtitle: subtitle,\n        media: () => <ColorPreviewMedia hex={hex} alpha={alpha} />,\n      }\n    },\n  },\n})\n","import {defineType} from 'sanity'\n\nexport const hslaColor = defineType({\n  title: 'Hue Saturation Lightness',\n  name: 'hslaColor',\n  type: 'object',\n  fields: [\n    {name: 'h', type: 'number', title: 'Hue'},\n    {name: 's', type: 'number', title: 'Saturation'},\n    {name: 'l', type: 'number', title: 'Lightness'},\n    {name: 'a', type: 'number', title: 'Alpha'},\n  ],\n})\n","import {defineType} from 'sanity'\n\nexport const hsvaColor = defineType({\n  title: 'Hue Saturation Value',\n  name: 'hsvaColor',\n  type: 'object',\n  fields: [\n    {name: 'h', type: 'number', title: 'Hue'},\n    {name: 's', type: 'number', title: 'Saturation'},\n    {name: 'v', type: 'number', title: 'Value'},\n    {name: 'a', type: 'number', title: 'Alpha'},\n  ],\n})\n","import {defineType} from 'sanity'\n\nexport const rgbaColor = defineType({\n  title: 'Red Green Blue (rgb)',\n  name: 'rgbaColor',\n  type: 'object',\n  fields: [\n    {name: 'r', type: 'number', title: 'Red'},\n    {name: 'g', type: 'number', title: 'Green'},\n    {name: 'b', type: 'number', title: 'Blue'},\n    {name: 'a', type: 'number', title: 'Alpha'},\n  ],\n})\n","import '@sanity/ui/styles.css'\nimport {definePlugin} from 'sanity'\n\nimport {color, type ColorDefinition} from './schemas/color'\nimport {hslaColor} from './schemas/hslaColor'\nimport {hsvaColor} from './schemas/hsvaColor'\nimport {rgbaColor} from './schemas/rgbaColor'\n\nexport const colorInput = definePlugin({\n  name: '@sanity/color-input',\n  schema: {\n    types: [hslaColor, hsvaColor, rgbaColor, color],\n  },\n})\n\nexport {color, hslaColor, hsvaColor, rgbaColor}\nexport {ColorInput} from './LazyColorInput'\nexport type {ColorDefinition}\nexport type {ColorInputProps, ColorOptions, ColorSchemaType, ColorValue} from './types'\n"],"mappings":";;;;;;;AAEA,MAAA,aAAA,WAAA,OAAA,2BAAA;;AEMA,MAAA,SAAA,MAAA,MAAA,KAAA,MAAA,MAAA,GAAA;AAmBA,SAAA,kBAAA,IAAA;eAA2B,EAAA,KAAA,UAAA,IAKG,KAAA,OAAA,QACR,KAAA,OAAA,SAAA,CAAA,GAFTC;CACiBC,AAAAA,EAAAA,OAAAA,MAAAA,EAAAA,OAAAA,MADjB,KAAA,iBAAA;GACJ,qBAAA;GACA,aAAA;CACH,CAAA,GAFwBA,EAAAA,KAAAA,IACRC,EAAAA,KAAAA;CAJlBC,IAAAA;CADF,OAGWH,EAAAA,OAAAA,kBAFT,KAAA,oBAAA,OAAA;EACE,WAAA;EACA,OAAA;CAID,CAAA,GAJQA,EAAAA,KAAAA,gBAHX;AASF;AAEA,MAAA,QAAA,WAAA;CACE,MAAA;CACA,MAAA;CACA,OAAA;CACA,YAAA,EAAA,OAAA,WAAA;CACA,QAAA;EACE;GACE,OAAA;GACA,MAAA;GACA,MAAA;EACF;EACA;GACE,OAAA;GACA,MAAA;GACA,MAAA;EACF;EACA;GACE,OAAA;GACA,MAAA;GACA,MAAA;EACF;EACA;GACE,OAAA;GACA,MAAA;GACA,MAAA;EACF;EACA;GACE,OAAA;GACA,MAAA;GACA,MAAA;EACF;CACF;CACA,SAAA;EACE,QAAA;GACE,OAAA;GACA,OAAA;GACA,KAAA;GACA,KAAA;EACF;EACA,QAAA,EAAA,OAAA,KAAA,KAAA,SAAA;GAWE,IAAA,WAAA,OAAA;GAIA,OAHA,QAAA,WAAA,KAAA,MAAA,IAAA,CAAA,EAAA,KAAA,MAAA,IAAA,CAAA,EAAA,KAAA,MAAA,IAAA,CAAA,EAAA,KAAA,MAAA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