@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.
- package/dist/color-dot.cjs.js +2 -2
- package/dist/color-dot.cjs.js.map +1 -1
- package/dist/color-dot.d.ts +5 -7
- package/dist/color-dot.d.ts.map +1 -1
- package/dist/color-dot.es.js +29 -32
- package/dist/color-dot.es.js.map +1 -1
- package/package.json +3 -2
- package/src/color-dot.tsx +9 -14
package/dist/color-dot.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime");function
|
|
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
|
|
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
|
|
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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oreList":[0]}
|
package/dist/color-dot.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { default as 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
|
|
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
|
-
}
|
|
12
|
-
export declare const ColorDot: ({ color,
|
|
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
|
package/dist/color-dot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-dot.d.ts","sourceRoot":"","sources":["../src/color-dot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
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"}
|
package/dist/color-dot.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
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
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
var l;
|
|
12
|
+
function a() {
|
|
13
|
+
return l || (l = 1, function(t) {
|
|
14
14
|
(function() {
|
|
15
|
-
var
|
|
15
|
+
var e = {}.hasOwnProperty;
|
|
16
16
|
function n() {
|
|
17
|
-
for (var r = "",
|
|
18
|
-
var s = arguments[
|
|
19
|
-
s && (r =
|
|
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
|
|
32
|
+
var o = "";
|
|
33
33
|
for (var s in r)
|
|
34
|
-
|
|
35
|
-
return
|
|
34
|
+
e.call(r, s) && r[s] && (o = u(o, this && this[s] || s));
|
|
35
|
+
return o;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function u(r, o) {
|
|
38
|
+
return o ? r ? r + " " + o : r + o : r;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
41
41
|
})();
|
|
42
42
|
}(i)), i.exports;
|
|
43
43
|
}
|
|
44
|
-
var _ =
|
|
45
|
-
const m = /* @__PURE__ */
|
|
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:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
color: t,
|
|
54
|
+
size: e,
|
|
55
|
+
withBorder: n,
|
|
56
|
+
className: p,
|
|
57
|
+
style: u = {},
|
|
58
58
|
...r
|
|
59
|
-
}) => /* @__PURE__ */
|
|
59
|
+
}) => /* @__PURE__ */ d(
|
|
60
60
|
"div",
|
|
61
61
|
{
|
|
62
62
|
...r,
|
|
63
|
-
className: b(
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
67
|
+
...u,
|
|
68
|
+
backgroundColor: t
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
71
|
);
|
package/dist/color-dot.es.js.map
CHANGED
|
@@ -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
|
|
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,eAASI,EAAYF,GAAK;AACzB,YAAI,OAAOA,KAAQ,YAAY,OAAOA,KAAQ;AAC7C,iBAAO,QAAQ,KAAKA,CAAG,KAAKA;AAG7B,YAAI,OAAO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
|
3
|
-
"version": "7.
|
|
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/
|
|
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
|
|
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
|
|
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
|
-
}
|
|
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
|
-
|
|
34
|
-
|
|
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
|
/>
|