@yamada-ui/color-picker 1.2.8-dev-20240409121247 → 1.2.8

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,7 @@
1
1
  "use client"
2
2
  import {
3
3
  ColorSwatch
4
- } from "./chunk-AHRE6CA3.mjs";
4
+ } from "./chunk-UQWAM6TA.mjs";
5
5
  import {
6
6
  useColorSelectorContext
7
7
  } from "./chunk-L2ILNXB4.mjs";
@@ -67,4 +67,4 @@ var ColorSelectorSwatches = forwardRef(
67
67
  export {
68
68
  ColorSelectorSwatches
69
69
  };
70
- //# sourceMappingURL=chunk-COT3GJN4.mjs.map
70
+ //# sourceMappingURL=chunk-DSAPB5E3.mjs.map
@@ -6,13 +6,13 @@ import {
6
6
  } from "./chunk-CR3JRFXA.mjs";
7
7
  import {
8
8
  ColorSelector
9
- } from "./chunk-SV347E5S.mjs";
9
+ } from "./chunk-VBH7AXVT.mjs";
10
10
  import {
11
11
  EyeDropperIcon
12
12
  } from "./chunk-JLVD63SI.mjs";
13
13
  import {
14
14
  ColorSwatch
15
- } from "./chunk-AHRE6CA3.mjs";
15
+ } from "./chunk-UQWAM6TA.mjs";
16
16
 
17
17
  // src/color-picker.tsx
18
18
  import {
@@ -232,4 +232,4 @@ var ColorPickerEyeDropper = forwardRef(
232
232
  export {
233
233
  ColorPicker
234
234
  };
235
- //# sourceMappingURL=chunk-XGYPDUD6.mjs.map
235
+ //# sourceMappingURL=chunk-MVCNJELN.mjs.map
@@ -81,10 +81,10 @@ var ColorSwatch = forwardRef((props, ref) => {
81
81
  {
82
82
  ref,
83
83
  className: cx("ui-color-swatch", className),
84
- ...isRounded ? { rounded: "9999px" } : {},
84
+ ...isRounded ? { rounded: "fallback(full, 9999px)" } : {},
85
85
  __css: css,
86
86
  ...rest,
87
- children: /* @__PURE__ */ jsx(ui.div, { ...isRounded ? { rounded: "9999px" } : {}, children: overlays.map((props2, index) => /* @__PURE__ */ jsx(
87
+ children: /* @__PURE__ */ jsx(ui.div, { ...isRounded ? { rounded: "fallback(full, 9999px)" } : {}, children: overlays.map((props2, index) => /* @__PURE__ */ jsx(
88
88
  ui.div,
89
89
  {
90
90
  __css: {
@@ -95,7 +95,7 @@ var ColorSwatch = forwardRef((props, ref) => {
95
95
  bottom: 0,
96
96
  ...styles.overlay
97
97
  },
98
- ...isRounded ? { rounded: "9999px" } : {},
98
+ ...isRounded ? { rounded: "fallback(full, 9999px)" } : {},
99
99
  ...props2
100
100
  },
101
101
  index
@@ -107,4 +107,4 @@ var ColorSwatch = forwardRef((props, ref) => {
107
107
  export {
108
108
  ColorSwatch
109
109
  };
110
- //# sourceMappingURL=chunk-AHRE6CA3.mjs.map
110
+ //# sourceMappingURL=chunk-UQWAM6TA.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/color-swatch.tsx"],"sourcesContent":["import {\n ui,\n forwardRef,\n omitThemeProps,\n useMultiComponentStyle,\n} from \"@yamada-ui/core\"\nimport type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\n\nconst defaultOverlays = (\n background: string,\n withShadow: boolean,\n): HTMLUIProps<\"div\">[] => {\n let overlays: HTMLUIProps<\"div\">[] = [\n {\n bgImage:\n \"linear-gradient(45deg, var(--ui-checkers) 25%, transparent 25%), linear-gradient(-45deg, var(--ui-checkers) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--ui-checkers) 75%), linear-gradient(-45deg, var(--ui-body) 75%, var(--ui-checkers) 75%)\",\n bgSize: `8px 8px`,\n bgPosition: `0 0, 0 4px, 4px -4px, -4px 0`,\n var: [\n {\n __prefix: \"ui\",\n name: \"checkers\",\n token: \"colors\",\n value: [\"blackAlpha.300\", \"whiteAlpha.300\"],\n },\n {\n __prefix: \"ui\",\n name: \"body\",\n token: \"colors\",\n value: [\"whiteAlpha.500\", \"blackAlpha.500\"],\n },\n ],\n },\n { background },\n ]\n\n if (withShadow)\n overlays = [\n ...overlays,\n {\n boxShadow: `rgba(0, 0, 0, .1) 0 0 0 1px inset, rgb(0, 0, 0, .15) 0 0 4px inset`,\n },\n ]\n\n return overlays\n}\n\ntype ColorSwatchOptions = {\n /**\n * The color used for the swatch element.\n *\n * @default \"#ffffff00\"\n */\n color?: string\n /**\n * The overlay used for the swatch element.\n */\n overlays?: HTMLUIProps<\"div\">[]\n /**\n * If `true`, the swatch element has an inner `box-shadow`.\n *\n * @default true\n */\n withShadow?: boolean\n /**\n * If `true`, the color swatch will be perfectly round. Else, it'll be slightly round.\n *\n * @default false\n */\n isRounded?: boolean\n}\n\nexport type ColorSwatchProps = Omit<HTMLUIProps<\"div\">, \"color\"> &\n ThemeProps<\"ColorSwatch\"> &\n ColorSwatchOptions\n\n/**\n * `ColorSwatch` is a component that displays color samples.\n *\n * @see Docs https://yamada-ui.com/components/data-display/color-swatch\n */\nexport const ColorSwatch = forwardRef<ColorSwatchProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"ColorSwatch\", props)\n const {\n className,\n color = \"#ffffff00\",\n withShadow = true,\n overlays = defaultOverlays(color, withShadow),\n isRounded,\n __css,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const css: CSSUIObject = {\n position: \"relative\",\n _before: {\n content: `\"\"`,\n display: \"block\",\n h: 0,\n pb: \"100%\",\n },\n \"& > *\": {\n overflow: \"hidden\",\n position: \"absolute\",\n top: \"0\",\n right: \"0\",\n bottom: \"0\",\n left: \"0\",\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n w: \"100%\",\n h: \"100%\",\n },\n ...styles.container,\n ...__css,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-color-swatch\", className)}\n {...(isRounded ? { rounded: \"9999px\" } : {})}\n __css={css}\n {...rest}\n >\n <ui.div {...(isRounded ? { rounded: \"9999px\" } : {})}>\n {overlays.map((props, index) => (\n <ui.div\n key={index}\n __css={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n ...styles.overlay,\n }}\n {...(isRounded ? { rounded: \"9999px\" } : {})}\n {...props}\n />\n ))}\n </ui.div>\n </ui.div>\n )\n})\n"],"mappings":";;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,UAAU;AA0HT;AAxHV,IAAM,kBAAkB,CACtB,YACA,eACyB;AACzB,MAAI,WAAiC;AAAA,IACnC;AAAA,MACE,SACE;AAAA,MACF,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,KAAK;AAAA,QACH;AAAA,UACE,UAAU;AAAA,UACV,MAAM;AAAA,UACN,OAAO;AAAA,UACP,OAAO,CAAC,kBAAkB,gBAAgB;AAAA,QAC5C;AAAA,QACA;AAAA,UACE,UAAU;AAAA,UACV,MAAM;AAAA,UACN,OAAO;AAAA,UACP,OAAO,CAAC,kBAAkB,gBAAgB;AAAA,QAC5C;AAAA,MACF;AAAA,IACF;AAAA,IACA,EAAE,WAAW;AAAA,EACf;AAEA,MAAI;AACF,eAAW;AAAA,MACT,GAAG;AAAA,MACH;AAAA,QACE,WAAW;AAAA,MACb;AAAA,IACF;AAEF,SAAO;AACT;AAoCO,IAAM,cAAc,WAAoC,CAAC,OAAO,QAAQ;AAC7E,QAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,eAAe,KAAK;AACzE,QAAM;AAAA,IACJ;AAAA,IACA,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,WAAW,gBAAgB,OAAO,UAAU;AAAA,IAC5C;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI,eAAe,WAAW;AAE9B,QAAM,MAAmB;AAAA,IACvB,UAAU;AAAA,IACV,SAAS;AAAA,MACP,SAAS;AAAA,MACT,SAAS;AAAA,MACT,GAAG;AAAA,MACH,IAAI;AAAA,IACN;AAAA,IACA,SAAS;AAAA,MACP,UAAU;AAAA,MACV,UAAU;AAAA,MACV,KAAK;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,GAAG,OAAO;AAAA,IACV,GAAG;AAAA,EACL;AAEA,SACE;AAAA,IAAC,GAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,WAAW,GAAG,mBAAmB,SAAS;AAAA,MACzC,GAAI,YAAY,EAAE,SAAS,SAAS,IAAI,CAAC;AAAA,MAC1C,OAAO;AAAA,MACN,GAAG;AAAA,MAEJ,8BAAC,GAAG,KAAH,EAAQ,GAAI,YAAY,EAAE,SAAS,SAAS,IAAI,CAAC,GAC/C,mBAAS,IAAI,CAACA,QAAO,UACpB;AAAA,QAAC,GAAG;AAAA,QAAH;AAAA,UAEC,OAAO;AAAA,YACL,UAAU;AAAA,YACV,KAAK;AAAA,YACL,MAAM;AAAA,YACN,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,GAAG,OAAO;AAAA,UACZ;AAAA,UACC,GAAI,YAAY,EAAE,SAAS,SAAS,IAAI,CAAC;AAAA,UACzC,GAAGA;AAAA;AAAA,QAVC;AAAA,MAWP,CACD,GACH;AAAA;AAAA,EACF;AAEJ,CAAC;","names":["props"]}
1
+ {"version":3,"sources":["../src/color-swatch.tsx"],"sourcesContent":["import {\n ui,\n forwardRef,\n omitThemeProps,\n useMultiComponentStyle,\n} from \"@yamada-ui/core\"\nimport type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\n\nconst defaultOverlays = (\n background: string,\n withShadow: boolean,\n): HTMLUIProps<\"div\">[] => {\n let overlays: HTMLUIProps<\"div\">[] = [\n {\n bgImage:\n \"linear-gradient(45deg, var(--ui-checkers) 25%, transparent 25%), linear-gradient(-45deg, var(--ui-checkers) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--ui-checkers) 75%), linear-gradient(-45deg, var(--ui-body) 75%, var(--ui-checkers) 75%)\",\n bgSize: `8px 8px`,\n bgPosition: `0 0, 0 4px, 4px -4px, -4px 0`,\n var: [\n {\n __prefix: \"ui\",\n name: \"checkers\",\n token: \"colors\",\n value: [\"blackAlpha.300\", \"whiteAlpha.300\"],\n },\n {\n __prefix: \"ui\",\n name: \"body\",\n token: \"colors\",\n value: [\"whiteAlpha.500\", \"blackAlpha.500\"],\n },\n ],\n },\n { background },\n ]\n\n if (withShadow)\n overlays = [\n ...overlays,\n {\n boxShadow: `rgba(0, 0, 0, .1) 0 0 0 1px inset, rgb(0, 0, 0, .15) 0 0 4px inset`,\n },\n ]\n\n return overlays\n}\n\ntype ColorSwatchOptions = {\n /**\n * The color used for the swatch element.\n *\n * @default \"#ffffff00\"\n */\n color?: string\n /**\n * The overlay used for the swatch element.\n */\n overlays?: HTMLUIProps<\"div\">[]\n /**\n * If `true`, the swatch element has an inner `box-shadow`.\n *\n * @default true\n */\n withShadow?: boolean\n /**\n * If `true`, the color swatch will be perfectly round. Else, it'll be slightly round.\n *\n * @default false\n */\n isRounded?: boolean\n}\n\nexport type ColorSwatchProps = Omit<HTMLUIProps<\"div\">, \"color\"> &\n ThemeProps<\"ColorSwatch\"> &\n ColorSwatchOptions\n\n/**\n * `ColorSwatch` is a component that displays color samples.\n *\n * @see Docs https://yamada-ui.com/components/data-display/color-swatch\n */\nexport const ColorSwatch = forwardRef<ColorSwatchProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"ColorSwatch\", props)\n const {\n className,\n color = \"#ffffff00\",\n withShadow = true,\n overlays = defaultOverlays(color, withShadow),\n isRounded,\n __css,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const css: CSSUIObject = {\n position: \"relative\",\n _before: {\n content: `\"\"`,\n display: \"block\",\n h: 0,\n pb: \"100%\",\n },\n \"& > *\": {\n overflow: \"hidden\",\n position: \"absolute\",\n top: \"0\",\n right: \"0\",\n bottom: \"0\",\n left: \"0\",\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n w: \"100%\",\n h: \"100%\",\n },\n ...styles.container,\n ...__css,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-color-swatch\", className)}\n {...(isRounded ? { rounded: \"fallback(full, 9999px)\" } : {})}\n __css={css}\n {...rest}\n >\n <ui.div {...(isRounded ? { rounded: \"fallback(full, 9999px)\" } : {})}>\n {overlays.map((props, index) => (\n <ui.div\n key={index}\n __css={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n ...styles.overlay,\n }}\n {...(isRounded ? { rounded: \"fallback(full, 9999px)\" } : {})}\n {...props}\n />\n ))}\n </ui.div>\n </ui.div>\n )\n})\n"],"mappings":";;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,UAAU;AA0HT;AAxHV,IAAM,kBAAkB,CACtB,YACA,eACyB;AACzB,MAAI,WAAiC;AAAA,IACnC;AAAA,MACE,SACE;AAAA,MACF,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,KAAK;AAAA,QACH;AAAA,UACE,UAAU;AAAA,UACV,MAAM;AAAA,UACN,OAAO;AAAA,UACP,OAAO,CAAC,kBAAkB,gBAAgB;AAAA,QAC5C;AAAA,QACA;AAAA,UACE,UAAU;AAAA,UACV,MAAM;AAAA,UACN,OAAO;AAAA,UACP,OAAO,CAAC,kBAAkB,gBAAgB;AAAA,QAC5C;AAAA,MACF;AAAA,IACF;AAAA,IACA,EAAE,WAAW;AAAA,EACf;AAEA,MAAI;AACF,eAAW;AAAA,MACT,GAAG;AAAA,MACH;AAAA,QACE,WAAW;AAAA,MACb;AAAA,IACF;AAEF,SAAO;AACT;AAoCO,IAAM,cAAc,WAAoC,CAAC,OAAO,QAAQ;AAC7E,QAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,eAAe,KAAK;AACzE,QAAM;AAAA,IACJ;AAA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
6
6
  ColorSelectorBody
7
- } from "./chunk-XL4TKXTI.mjs";
7
+ } from "./chunk-VO2YWPCO.mjs";
8
8
  import {
9
9
  ColorSelectorChannels
10
10
  } from "./chunk-2PW2Z2XD.mjs";
11
11
  import {
12
12
  ColorSelectorSwatches
13
- } from "./chunk-COT3GJN4.mjs";
13
+ } from "./chunk-DSAPB5E3.mjs";
14
14
  import {
15
15
  ColorSelectorProvider,
16
16
  useColorSelector
@@ -127,4 +127,4 @@ var ColorSelector = forwardRef(
127
127
  export {
128
128
  ColorSelector
129
129
  };
130
- //# sourceMappingURL=chunk-SV347E5S.mjs.map
130
+ //# sourceMappingURL=chunk-VBH7AXVT.mjs.map
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-JFTUHZYL.mjs";
8
8
  import {
9
9
  ColorSwatch
10
- } from "./chunk-AHRE6CA3.mjs";
10
+ } from "./chunk-UQWAM6TA.mjs";
11
11
  import {
12
12
  useColorSelectorContext
13
13
  } from "./chunk-L2ILNXB4.mjs";
@@ -72,4 +72,4 @@ var ColorSelectorBody = forwardRef(
72
72
  export {
73
73
  ColorSelectorBody
74
74
  };
75
- //# sourceMappingURL=chunk-XL4TKXTI.mjs.map
75
+ //# sourceMappingURL=chunk-VO2YWPCO.mjs.map
@@ -1081,10 +1081,10 @@ var ColorSwatch = (0, import_core5.forwardRef)((props, ref) => {
1081
1081
  {
1082
1082
  ref,
1083
1083
  className: (0, import_utils7.cx)("ui-color-swatch", className),
1084
- ...isRounded ? { rounded: "9999px" } : {},
1084
+ ...isRounded ? { rounded: "fallback(full, 9999px)" } : {},
1085
1085
  __css: css,
1086
1086
  ...rest,
1087
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core5.ui.div, { ...isRounded ? { rounded: "9999px" } : {}, children: overlays.map((props2, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1087
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core5.ui.div, { ...isRounded ? { rounded: "fallback(full, 9999px)" } : {}, children: overlays.map((props2, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1088
1088
  import_core5.ui.div,
1089
1089
  {
1090
1090
  __css: {
@@ -1095,7 +1095,7 @@ var ColorSwatch = (0, import_core5.forwardRef)((props, ref) => {
1095
1095
  bottom: 0,
1096
1096
  ...styles.overlay
1097
1097
  },
1098
- ...isRounded ? { rounded: "9999px" } : {},
1098
+ ...isRounded ? { rounded: "fallback(full, 9999px)" } : {},
1099
1099
  ...props2
1100
1100
  },
1101
1101
  index