@purpurds/color-dot 7.6.0 → 7.7.0

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,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime");function a(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var p={exports:{}};/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime");function f(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var p={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
5
- */var l;function f(){return l||(l=1,function(o){(function(){var u={}.hasOwnProperty;function e(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=s(r,i.call(this,n)))}return r}function i(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return e.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var t="";for(var n in r)u.call(r,n)&&r[n]&&(t=s(t,this&&this[n]||n));return t}function s(r,t){return t?r?r+" "+t:r+t:r}o.exports?(e.default=e,o.exports=e):window.classNames=e})()}(p)),p.exports}var _=f();const m=a(_),h={"purpur-color-dot":"_purpur-color-dot_1n98k_1","purpur-color-dot--xs":"_purpur-color-dot--xs_1n98k_6","purpur-color-dot--sm":"_purpur-color-dot--sm_1n98k_9","purpur-color-dot--md":"_purpur-color-dot--md_1n98k_12","purpur-color-dot--lg":"_purpur-color-dot--lg_1n98k_15","purpur-color-dot--with-border":"_purpur-color-dot--with-border_1n98k_18"},b=m.bind(h),c="purpur-color-dot",O=["xs","sm","md","lg"],y=({color:o,["data-testid"]:u,size:e,withBorder:i,className:s,...r})=>d.jsx("div",{...r,className:b([s,c,`${c}--${e}`,{[`${c}--with-border`]:i}]),"data-testid":u,style:{backgroundColor:o}});exports.COLOR_DOT_SIZE=O;exports.ColorDot=y;
5
+ */var l;function a(){return l||(l=1,function(o){(function(){var u={}.hasOwnProperty;function n(){for(var r="",t=0;t<arguments.length;t++){var e=arguments[t];e&&(r=s(r,i.call(this,e)))}return r}function i(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var t="";for(var e in r)u.call(r,e)&&r[e]&&(t=s(t,this&&this[e]||e));return t}function s(r,t){return t?r?r+" "+t:r+t:r}o.exports?(n.default=n,o.exports=n):window.classNames=n})()}(p)),p.exports}var _=a();const m=f(_),h={"purpur-color-dot":"_purpur-color-dot_1n98k_1","purpur-color-dot--xs":"_purpur-color-dot--xs_1n98k_6","purpur-color-dot--sm":"_purpur-color-dot--sm_1n98k_9","purpur-color-dot--md":"_purpur-color-dot--md_1n98k_12","purpur-color-dot--lg":"_purpur-color-dot--lg_1n98k_15","purpur-color-dot--with-border":"_purpur-color-dot--with-border_1n98k_18"},b=m.bind(h),c="purpur-color-dot",O=["xs","sm","md","lg"],y=({color:o,size:u,withBorder:n,className:i,style:s={},...r})=>d.jsx("div",{...r,className:b(i,c,`${c}--${u}`,{[`${c}--with-border`]:n}),style:{...s,backgroundColor:o}});exports.COLOR_DOT_SIZE=O;exports.ColorDot=y;
6
6
  //# sourceMappingURL=color-dot.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"color-dot.cjs.js","sources":["../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/color-dot.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { type DetailedHTMLProps, type HTMLAttributes } from \"react\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./color-dot.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-color-dot\";\n\nexport const COLOR_DOT_SIZE = [\"xs\", \"sm\", \"md\", \"lg\"] as const;\n\nexport type ColorDotSize = (typeof COLOR_DOT_SIZE)[number];\n\ntype InheritedProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n\nexport type ColorDotProps = {\n color: string;\n [\"data-testid\"]?: string;\n size: ColorDotSize;\n withBorder?: boolean;\n} & InheritedProps;\n\nexport const ColorDot = ({\n color,\n [\"data-testid\"]: dataTestid,\n size,\n withBorder,\n className,\n ...props\n}: ColorDotProps) => (\n <div\n {...props}\n className={cx([\n className,\n rootClassName,\n `${rootClassName}--${size}`,\n { [`${rootClassName}--with-border`]: withBorder },\n ])}\n data-testid={dataTestid}\n style={{\n backgroundColor: color,\n }}\n />\n);\n"],"names":["hasOwn","classNames","classes","i","arg","appendClass","parseValue","key","value","newClass","module","cx","c","styles","rootClassName","COLOR_DOT_SIZE","ColorDot","color","dataTestid","size","withBorder","className","props","jsx"],"mappings":";;;;iDAOC,UAAY,CAGZ,IAAIA,EAAS,CAAA,EAAG,eAEhB,SAASC,GAAc,CAGtB,QAFIC,EAAU,GAELC,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAAK,CAC1C,IAAIC,EAAM,UAAUD,CAAC,EACjBC,IACHF,EAAUG,EAAYH,EAASI,EAAW,KAAK,KAAMF,CAAG,CAAC,EAE7D,CAEE,OAAOF,CACT,CAEC,SAASI,EAAYF,EAAK,CACzB,GAAI,OAAOA,GAAQ,UAAY,OAAOA,GAAQ,SAC7C,OAAO,MAAQ,KAAKA,CAAG,GAAKA,EAG7B,GAAI,OAAOA,GAAQ,SAClB,MAAO,GAGR,GAAI,MAAM,QAAQA,CAAG,EACpB,OAAOH,EAAW,MAAM,KAAMG,CAAG,EAGlC,GAAIA,EAAI,WAAa,OAAO,UAAU,UAAY,CAACA,EAAI,SAAS,SAAQ,EAAG,SAAS,eAAe,EAClG,OAAOA,EAAI,SAAU,EAGtB,IAAIF,EAAU,GAEd,QAASK,KAAOH,EACXJ,EAAO,KAAKI,EAAKG,CAAG,GAAKH,EAAIG,CAAG,IACnCL,EAAUG,EAAYH,EAAS,MAAQ,KAAKK,CAAG,GAAKA,CAAG,GAIzD,OAAOL,CACT,CAEC,SAASG,EAAaG,EAAOC,EAAU,CACtC,OAAKA,EAIDD,EACIA,EAAQ,IAAMC,EAGfD,EAAQC,EAPPD,CAQV,CAEsCE,EAAO,SAC3CT,EAAW,QAAUA,EACrBS,UAAiBT,GAOjB,OAAO,WAAaA,CAEtB,sYCvEMU,EAAKC,EAAE,KAAKC,CAAM,EAClBC,EAAgB,mBAETC,EAAiB,CAAC,KAAM,KAAM,KAAM,IAAI,EAaxCC,EAAW,CAAC,CACvB,MAAAC,EACA,CAAC,eAAgBC,EACjB,KAAAC,EACA,WAAAC,EACA,UAAAC,EACA,GAAGC,CACL,IACEC,EAAA,IAAC,MAAA,CACE,GAAGD,EACJ,UAAWX,EAAG,CACZU,EACAP,EACA,GAAGA,CAAa,KAAKK,CAAI,GACzB,CAAE,CAAC,GAAGL,CAAa,eAAe,EAAGM,CAAW,CAAA,CACjD,EACD,cAAaF,EACb,MAAO,CACL,gBAAiBD,CAAA,CACnB,CACF","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"color-dot.cjs.js","sources":["../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/color-dot.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./color-dot.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-color-dot\";\n\nexport const COLOR_DOT_SIZE = [\"xs\", \"sm\", \"md\", \"lg\"] as const;\n\nexport type ColorDotSize = (typeof COLOR_DOT_SIZE)[number];\n\nexport type ColorDotProps = Omit<BaseProps, \"children\"> & {\n color: string;\n size: ColorDotSize;\n withBorder?: boolean;\n};\n\nexport const ColorDot = ({\n color,\n size,\n withBorder,\n className,\n style = {},\n ...props\n}: ColorDotProps) => (\n <div\n {...props}\n className={cx(className, rootClassName, `${rootClassName}--${size}`, {\n [`${rootClassName}--with-border`]: withBorder,\n })}\n style={{\n ...style,\n backgroundColor: color,\n }}\n />\n);\n"],"names":["hasOwn","classNames","classes","i","arg","appendClass","parseValue","key","value","newClass","module","cx","c","styles","rootClassName","COLOR_DOT_SIZE","ColorDot","color","size","withBorder","className","style","props","jsx"],"mappings":";;;;iDAOC,UAAY,CAGZ,IAAIA,EAAS,CAAA,EAAG,eAEhB,SAASC,GAAc,CAGtB,QAFIC,EAAU,GAELC,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAAK,CAC1C,IAAIC,EAAM,UAAUD,CAAC,EACjBC,IACHF,EAAUG,EAAYH,EAASI,EAAW,KAAK,KAAMF,CAAG,CAAC,EAE7D,CAEE,OAAOF,CACT,CAEC,SAASI,EAAYF,EAAK,CACzB,GAAI,OAAOA,GAAQ,UAAY,OAAOA,GAAQ,SAC7C,OAAO,MAAQ,KAAKA,CAAG,GAAKA,EAG7B,GAAI,OAAOA,GAAQ,SAClB,MAAO,GAGR,GAAI,MAAM,QAAQA,CAAG,EACpB,OAAOH,EAAW,MAAM,KAAMG,CAAG,EAGlC,GAAIA,EAAI,WAAa,OAAO,UAAU,UAAY,CAACA,EAAI,SAAS,SAAQ,EAAG,SAAS,eAAe,EAClG,OAAOA,EAAI,SAAU,EAGtB,IAAIF,EAAU,GAEd,QAASK,KAAOH,EACXJ,EAAO,KAAKI,EAAKG,CAAG,GAAKH,EAAIG,CAAG,IACnCL,EAAUG,EAAYH,EAAS,MAAQ,KAAKK,CAAG,GAAKA,CAAG,GAIzD,OAAOL,CACT,CAEC,SAASG,EAAaG,EAAOC,EAAU,CACtC,OAAKA,EAIDD,EACIA,EAAQ,IAAMC,EAGfD,EAAQC,EAPPD,CAQV,CAEsCE,EAAO,SAC3CT,EAAW,QAAUA,EACrBS,UAAiBT,GAOjB,OAAO,WAAaA,CAEtB,sYCtEMU,EAAKC,EAAE,KAAKC,CAAM,EAClBC,EAAgB,mBAETC,EAAiB,CAAC,KAAM,KAAM,KAAM,IAAI,EAUxCC,EAAW,CAAC,CACvB,MAAAC,EACA,KAAAC,EACA,WAAAC,EACA,UAAAC,EACA,MAAAC,EAAQ,CAAC,EACT,GAAGC,CACL,IACEC,EAAA,IAAC,MAAA,CACE,GAAGD,EACJ,UAAWX,EAAGS,EAAWN,EAAe,GAAGA,CAAa,KAAKI,CAAI,GAAI,CACnE,CAAC,GAAGJ,CAAa,eAAe,EAAGK,CAAA,CACpC,EACD,MAAO,CACL,GAAGE,EACH,gBAAiBJ,CAAA,CACnB,CACF","x_google_ignoreList":[0]}
@@ -1,14 +1,12 @@
1
- import { default as React, DetailedHTMLProps, HTMLAttributes } from 'react';
1
+ import { default as React } from 'react';
2
+ import { BaseProps } from '@purpurds/common-types';
2
3
 
3
4
  export declare const COLOR_DOT_SIZE: readonly ["xs", "sm", "md", "lg"];
4
5
  export type ColorDotSize = (typeof COLOR_DOT_SIZE)[number];
5
- type InheritedProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
6
- export type ColorDotProps = {
6
+ export type ColorDotProps = Omit<BaseProps, "children"> & {
7
7
  color: string;
8
- ["data-testid"]?: string;
9
8
  size: ColorDotSize;
10
9
  withBorder?: boolean;
11
- } & InheritedProps;
12
- export declare const ColorDot: ({ color, ["data-testid"]: dataTestid, size, withBorder, className, ...props }: ColorDotProps) => React.JSX.Element;
13
- export {};
10
+ };
11
+ export declare const ColorDot: ({ color, size, withBorder, className, style, ...props }: ColorDotProps) => React.JSX.Element;
14
12
  //# sourceMappingURL=color-dot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"color-dot.d.ts","sourceRoot":"","sources":["../src/color-dot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAQ3E,eAAO,MAAM,cAAc,mCAAoC,CAAC;AAEhE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,KAAK,cAAc,GAAG,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,CAAC;AAExF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,cAAc,CAAC;AAEnB,eAAO,MAAM,QAAQ,kFAOlB,aAAa,sBAcf,CAAC"}
1
+ {"version":3,"file":"color-dot.d.ts","sourceRoot":"","sources":["../src/color-dot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAQxD,eAAO,MAAM,cAAc,mCAAoC,CAAC;AAEhE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,QAAQ,4DAOlB,aAAa,sBAWf,CAAC"}
@@ -1,6 +1,6 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- function a(o) {
3
- return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ function f(t) {
3
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
4
4
  }
5
5
  var i = { exports: {} };
6
6
  /*!
@@ -8,15 +8,15 @@ var i = { exports: {} };
8
8
  Licensed under the MIT License (MIT), see
9
9
  http://jedwatson.github.io/classnames
10
10
  */
11
- var d;
12
- function f() {
13
- return d || (d = 1, function(o) {
11
+ var l;
12
+ function a() {
13
+ return l || (l = 1, function(t) {
14
14
  (function() {
15
- var u = {}.hasOwnProperty;
15
+ var e = {}.hasOwnProperty;
16
16
  function n() {
17
- for (var r = "", t = 0; t < arguments.length; t++) {
18
- var s = arguments[t];
19
- s && (r = e(r, p.call(this, s)));
17
+ for (var r = "", o = 0; o < arguments.length; o++) {
18
+ var s = arguments[o];
19
+ s && (r = u(r, p.call(this, s)));
20
20
  }
21
21
  return r;
22
22
  }
@@ -29,20 +29,20 @@ function f() {
29
29
  return n.apply(this, r);
30
30
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
31
31
  return r.toString();
32
- var t = "";
32
+ var o = "";
33
33
  for (var s in r)
34
- u.call(r, s) && r[s] && (t = e(t, this && this[s] || s));
35
- return t;
34
+ e.call(r, s) && r[s] && (o = u(o, this && this[s] || s));
35
+ return o;
36
36
  }
37
- function e(r, t) {
38
- return t ? r ? r + " " + t : r + t : r;
37
+ function u(r, o) {
38
+ return o ? r ? r + " " + o : r + o : r;
39
39
  }
40
- o.exports ? (n.default = n, o.exports = n) : window.classNames = n;
40
+ t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
41
41
  })();
42
42
  }(i)), i.exports;
43
43
  }
44
- var _ = f();
45
- const m = /* @__PURE__ */ a(_), h = {
44
+ var _ = a();
45
+ const m = /* @__PURE__ */ f(_), h = {
46
46
  "purpur-color-dot": "_purpur-color-dot_1n98k_1",
47
47
  "purpur-color-dot--xs": "_purpur-color-dot--xs_1n98k_6",
48
48
  "purpur-color-dot--sm": "_purpur-color-dot--sm_1n98k_9",
@@ -50,25 +50,22 @@ const m = /* @__PURE__ */ a(_), h = {
50
50
  "purpur-color-dot--lg": "_purpur-color-dot--lg_1n98k_15",
51
51
  "purpur-color-dot--with-border": "_purpur-color-dot--with-border_1n98k_18"
52
52
  }, b = m.bind(h), c = "purpur-color-dot", y = ["xs", "sm", "md", "lg"], v = ({
53
- color: o,
54
- ["data-testid"]: u,
55
- size: n,
56
- withBorder: p,
57
- className: e,
53
+ color: t,
54
+ size: e,
55
+ withBorder: n,
56
+ className: p,
57
+ style: u = {},
58
58
  ...r
59
- }) => /* @__PURE__ */ l(
59
+ }) => /* @__PURE__ */ d(
60
60
  "div",
61
61
  {
62
62
  ...r,
63
- className: b([
64
- e,
65
- c,
66
- `${c}--${n}`,
67
- { [`${c}--with-border`]: p }
68
- ]),
69
- "data-testid": u,
63
+ className: b(p, c, `${c}--${e}`, {
64
+ [`${c}--with-border`]: n
65
+ }),
70
66
  style: {
71
- backgroundColor: o
67
+ ...u,
68
+ backgroundColor: t
72
69
  }
73
70
  }
74
71
  );
@@ -1 +1 @@
1
- {"version":3,"file":"color-dot.es.js","sources":["../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/color-dot.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { type DetailedHTMLProps, type HTMLAttributes } from \"react\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./color-dot.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-color-dot\";\n\nexport const COLOR_DOT_SIZE = [\"xs\", \"sm\", \"md\", \"lg\"] as const;\n\nexport type ColorDotSize = (typeof COLOR_DOT_SIZE)[number];\n\ntype InheritedProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n\nexport type ColorDotProps = {\n color: string;\n [\"data-testid\"]?: string;\n size: ColorDotSize;\n withBorder?: boolean;\n} & InheritedProps;\n\nexport const ColorDot = ({\n color,\n [\"data-testid\"]: dataTestid,\n size,\n withBorder,\n className,\n ...props\n}: ColorDotProps) => (\n <div\n {...props}\n className={cx([\n className,\n rootClassName,\n `${rootClassName}--${size}`,\n { [`${rootClassName}--with-border`]: withBorder },\n ])}\n data-testid={dataTestid}\n style={{\n backgroundColor: color,\n }}\n />\n);\n"],"names":["hasOwn","classNames","classes","i","arg","appendClass","parseValue","key","value","newClass","module","cx","c","styles","rootClassName","COLOR_DOT_SIZE","ColorDot","color","dataTestid","size","withBorder","className","props","jsx"],"mappings":";;;;;;;;;;;;;AAOA,KAAC,WAAY;AAGZ,UAAIA,IAAS,CAAA,EAAG;AAEhB,eAASC,IAAc;AAGtB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D;AAAA,IACJ,WAAWX,EAAG;AAAA,MACZU;AAAA,MACAP;AAAA,MACA,GAAGA,CAAa,KAAKK,CAAI;AAAA,MACzB,EAAE,CAAC,GAAGL,CAAa,eAAe,GAAGM,EAAW;AAAA,IAAA,CACjD;AAAA,IACD,eAAaF;AAAA,IACb,OAAO;AAAA,MACL,iBAAiBD;AAAA,IAAA;AAAA,EACnB;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"color-dot.es.js","sources":["../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/color-dot.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./color-dot.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-color-dot\";\n\nexport const COLOR_DOT_SIZE = [\"xs\", \"sm\", \"md\", \"lg\"] as const;\n\nexport type ColorDotSize = (typeof COLOR_DOT_SIZE)[number];\n\nexport type ColorDotProps = Omit<BaseProps, \"children\"> & {\n color: string;\n size: ColorDotSize;\n withBorder?: boolean;\n};\n\nexport const ColorDot = ({\n color,\n size,\n withBorder,\n className,\n style = {},\n ...props\n}: ColorDotProps) => (\n <div\n {...props}\n className={cx(className, rootClassName, `${rootClassName}--${size}`, {\n [`${rootClassName}--with-border`]: withBorder,\n })}\n style={{\n ...style,\n backgroundColor: color,\n }}\n />\n);\n"],"names":["hasOwn","classNames","classes","i","arg","appendClass","parseValue","key","value","newClass","module","cx","c","styles","rootClassName","COLOR_DOT_SIZE","ColorDot","color","size","withBorder","className","style","props","jsx"],"mappings":";;;;;;;;;;;;;AAOA,KAAC,WAAY;AAGZ,UAAIA,IAAS,CAAA,EAAG;AAEhB,eAASC,IAAc;AAGtB,iBAFIC,IAAU,IAELC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AAC1C,cAAIC,IAAM,UAAUD,CAAC;AACrB,UAAIC,MACHF,IAAUG,EAAYH,GAASI,EAAW,KAAK,MAAMF,CAAG,CAAC;AAAA,QAE7D;AAEE,eAAOF;AAAA,MACT;AAEC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AA;AAAA,EACnB;AACF;","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpurds/color-dot",
3
- "version": "7.6.0",
3
+ "version": "7.7.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "main": "./dist/color-dot.cjs.js",
6
6
  "types": "./dist/color-dot.d.ts",
@@ -16,7 +16,8 @@
16
16
  "source": "src/color-dot.tsx",
17
17
  "dependencies": {
18
18
  "classnames": "~2.5.0",
19
- "@purpurds/tokens": "7.6.0"
19
+ "@purpurds/common-types": "7.7.0",
20
+ "@purpurds/tokens": "7.7.0"
20
21
  },
21
22
  "devDependencies": {
22
23
  "eslint": "9.24.0",
package/src/color-dot.tsx CHANGED
@@ -1,4 +1,5 @@
1
- import React, { type DetailedHTMLProps, type HTMLAttributes } from "react";
1
+ import React from "react";
2
+ import type { BaseProps } from "@purpurds/common-types";
2
3
  import c from "classnames/bind";
3
4
 
4
5
  import styles from "./color-dot.module.scss";
@@ -10,33 +11,27 @@ export const COLOR_DOT_SIZE = ["xs", "sm", "md", "lg"] as const;
10
11
 
11
12
  export type ColorDotSize = (typeof COLOR_DOT_SIZE)[number];
12
13
 
13
- type InheritedProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
14
-
15
- export type ColorDotProps = {
14
+ export type ColorDotProps = Omit<BaseProps, "children"> & {
16
15
  color: string;
17
- ["data-testid"]?: string;
18
16
  size: ColorDotSize;
19
17
  withBorder?: boolean;
20
- } & InheritedProps;
18
+ };
21
19
 
22
20
  export const ColorDot = ({
23
21
  color,
24
- ["data-testid"]: dataTestid,
25
22
  size,
26
23
  withBorder,
27
24
  className,
25
+ style = {},
28
26
  ...props
29
27
  }: ColorDotProps) => (
30
28
  <div
31
29
  {...props}
32
- className={cx([
33
- className,
34
- rootClassName,
35
- `${rootClassName}--${size}`,
36
- { [`${rootClassName}--with-border`]: withBorder },
37
- ])}
38
- data-testid={dataTestid}
30
+ className={cx(className, rootClassName, `${rootClassName}--${size}`, {
31
+ [`${rootClassName}--with-border`]: withBorder,
32
+ })}
39
33
  style={{
34
+ ...style,
40
35
  backgroundColor: color,
41
36
  }}
42
37
  />