@baseline-ui/icons 0.8.0 → 0.8.2
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/12/index.d.mts +15 -1
- package/12/index.d.ts +15 -1
- package/12/index.js +16 -229
- package/12/index.mjs +3 -198
- package/16/index.d.mts +113 -1
- package/16/index.d.ts +113 -1
- package/16/index.js +82 -719
- package/16/index.mjs +3 -671
- package/20/index.d.mts +131 -1
- package/20/index.d.ts +131 -1
- package/20/index.js +86 -591
- package/20/index.mjs +3 -548
- package/24/index.d.mts +489 -1
- package/24/index.d.ts +489 -1
- package/24/index.js +262 -543
- package/24/index.mjs +3 -503
- package/8/index.d.mts +11 -1
- package/8/index.d.ts +11 -1
- package/8/index.js +18 -258
- package/8/index.mjs +3 -223
- package/dist/index.css +1 -4
- package/dist/index.js +31 -114
- package/dist/index.mjs +8 -79
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,118 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
3
|
+
var utils = require('@react-aria/utils');
|
|
4
|
+
var g = require('dompurify');
|
|
5
|
+
var m = require('react');
|
|
6
|
+
var reactAria = require('react-aria');
|
|
7
|
+
var utils$1 = require('@baseline-ui/utils');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
36
9
|
|
|
37
|
-
|
|
38
|
-
var import_utils = require("@react-aria/utils");
|
|
39
|
-
var Dompurify = __toESM(require("dompurify"));
|
|
40
|
-
var import_react = __toESM(require("react"));
|
|
41
|
-
var import_react_aria = require("react-aria");
|
|
42
|
-
var import_utils2 = require("@baseline-ui/utils");
|
|
10
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
43
11
|
|
|
44
|
-
|
|
45
|
-
|
|
12
|
+
function _interopNamespace(e) {
|
|
13
|
+
if (e && e.__esModule) return e;
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
46
29
|
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
);
|
|
54
|
-
svgElement.setAttribute(
|
|
55
|
-
"width",
|
|
56
|
-
typeof size === "number" ? `${size}px` : size
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
var updateSvgTitle = (svgElement, title, id) => {
|
|
60
|
-
const titleElement = svgElement.querySelector("title");
|
|
61
|
-
const ownerDocument = (0, import_utils.getOwnerDocument)(svgElement);
|
|
62
|
-
if (titleElement) {
|
|
63
|
-
titleElement.textContent = title;
|
|
64
|
-
titleElement.setAttribute("id", id);
|
|
65
|
-
} else {
|
|
66
|
-
const newTitleElement = ownerDocument.createElement("title");
|
|
67
|
-
newTitleElement.textContent = title;
|
|
68
|
-
newTitleElement.setAttribute("id", id);
|
|
69
|
-
svgElement.prepend(newTitleElement);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
var setClassName = (svgElement, className) => {
|
|
73
|
-
if (className) {
|
|
74
|
-
svgElement.classList.add(className);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
var getSanitizedSvgElement = (_svg, ownerDocument) => {
|
|
78
|
-
const span = ownerDocument.createElement("span");
|
|
79
|
-
span.innerHTML = Dompurify.default.sanitize(_svg);
|
|
80
|
-
const svgElement = span.querySelector("svg");
|
|
81
|
-
(0, import_utils2.invariant)(svgElement, "Icon: svg prop must be a valid svg string");
|
|
82
|
-
return svgElement;
|
|
83
|
-
};
|
|
84
|
-
var Icon = import_react.default.forwardRef(
|
|
85
|
-
({ size, title, className, style, ...rest }, ref) => {
|
|
86
|
-
const id = (0, import_react_aria.useId)();
|
|
87
|
-
const svgRef = import_react.default.useRef(null);
|
|
88
|
-
const _svg = "svg" in rest ? rest.svg : void 0;
|
|
89
|
-
const svgString = import_react.default.useMemo(() => {
|
|
90
|
-
if (_svg) {
|
|
91
|
-
const ownerDocument = (0, import_utils.getOwnerDocument)(svgRef.current);
|
|
92
|
-
const svgElement = getSanitizedSvgElement(_svg, ownerDocument);
|
|
93
|
-
if (size) {
|
|
94
|
-
setSizeAttributes(svgElement, size);
|
|
95
|
-
}
|
|
96
|
-
if (title) {
|
|
97
|
-
updateSvgTitle(svgElement, title, id);
|
|
98
|
-
}
|
|
99
|
-
setClassName(svgElement, className);
|
|
100
|
-
return svgElement.outerHTML;
|
|
101
|
-
}
|
|
102
|
-
}, [_svg, size, title, className, id]);
|
|
103
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
104
|
-
"span",
|
|
105
|
-
{
|
|
106
|
-
className: (0, import_utils2.classNames)(iconWrapper, className),
|
|
107
|
-
ref: (0, import_utils.mergeRefs)(ref, svgRef),
|
|
108
|
-
style,
|
|
109
|
-
dangerouslySetInnerHTML: svgString ? { __html: svgString } : void 0
|
|
110
|
-
}
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
);
|
|
114
|
-
Icon.displayName = "Icon";
|
|
115
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
116
|
-
0 && (module.exports = {
|
|
117
|
-
Icon
|
|
118
|
-
});
|
|
30
|
+
var g__namespace = /*#__PURE__*/_interopNamespace(g);
|
|
31
|
+
var m__default = /*#__PURE__*/_interopDefault(m);
|
|
32
|
+
|
|
33
|
+
var a="_1rl8ope0";var E=(e,t)=>{e.setAttribute("height",typeof t=="number"?`${t}px`:t),e.setAttribute("width",typeof t=="number"?`${t}px`:t);},x=(e,t,n)=>{let o=e.querySelector("title"),s=utils.getOwnerDocument(e);if(o)o.textContent=t,o.setAttribute("id",n);else {let r=s.createElement("title");r.textContent=t,r.setAttribute("id",n),e.prepend(r);}},T=(e,t)=>{t&&e.classList.add(t);},w=(e,t)=>{let n=t.createElement("span");n.innerHTML=g__namespace.default.sanitize(e);let o=n.querySelector("svg");return utils$1.invariant(o,"Icon: svg prop must be a valid svg string"),o},d=m__default.default.forwardRef(({size:e,title:t,className:n,style:o,...s},r)=>{let c=reactAria.useId(),u=m__default.default.useRef(null),i="svg"in s?s.svg:void 0,f=m__default.default.useMemo(()=>{if(i){let y=utils.getOwnerDocument(u.current),p=w(i,y);return e&&E(p,e),t&&x(p,t,c),T(p,n),p.outerHTML}},[i,e,t,n,c]);return jsxRuntime.jsx("span",{className:utils$1.classNames(a,n),ref:utils.mergeRefs(r,u),style:o,dangerouslySetInnerHTML:f?{__html:f}:void 0})});d.displayName="Icon";
|
|
34
|
+
|
|
35
|
+
exports.Icon = d;
|
package/dist/index.mjs
CHANGED
|
@@ -1,81 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { getOwnerDocument, mergeRefs } from '@react-aria/utils';
|
|
2
|
+
import * as g from 'dompurify';
|
|
3
|
+
import m from 'react';
|
|
4
|
+
import { useId } from 'react-aria';
|
|
5
|
+
import { classNames, invariant } from '@baseline-ui/utils';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
var iconWrapper = "Icon_iconWrapper__1rl8ope0";
|
|
8
|
+
var a="_1rl8ope0";var E=(e,t)=>{e.setAttribute("height",typeof t=="number"?`${t}px`:t),e.setAttribute("width",typeof t=="number"?`${t}px`:t);},x=(e,t,n)=>{let o=e.querySelector("title"),s=getOwnerDocument(e);if(o)o.textContent=t,o.setAttribute("id",n);else {let r=s.createElement("title");r.textContent=t,r.setAttribute("id",n),e.prepend(r);}},T=(e,t)=>{t&&e.classList.add(t);},w=(e,t)=>{let n=t.createElement("span");n.innerHTML=g.default.sanitize(e);let o=n.querySelector("svg");return invariant(o,"Icon: svg prop must be a valid svg string"),o},d=m.forwardRef(({size:e,title:t,className:n,style:o,...s},r)=>{let c=useId(),u=m.useRef(null),i="svg"in s?s.svg:void 0,f=m.useMemo(()=>{if(i){let y=getOwnerDocument(u.current),p=w(i,y);return e&&E(p,e),t&&x(p,t,c),T(p,n),p.outerHTML}},[i,e,t,n,c]);return jsx("span",{className:classNames(a,n),ref:mergeRefs(r,u),style:o,dangerouslySetInnerHTML:f?{__html:f}:void 0})});d.displayName="Icon";
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
import { jsx } from "react/jsx-runtime";
|
|
13
|
-
var setSizeAttributes = (svgElement, size) => {
|
|
14
|
-
svgElement.setAttribute(
|
|
15
|
-
"height",
|
|
16
|
-
typeof size === "number" ? `${size}px` : size
|
|
17
|
-
);
|
|
18
|
-
svgElement.setAttribute(
|
|
19
|
-
"width",
|
|
20
|
-
typeof size === "number" ? `${size}px` : size
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
var updateSvgTitle = (svgElement, title, id) => {
|
|
24
|
-
const titleElement = svgElement.querySelector("title");
|
|
25
|
-
const ownerDocument = getOwnerDocument(svgElement);
|
|
26
|
-
if (titleElement) {
|
|
27
|
-
titleElement.textContent = title;
|
|
28
|
-
titleElement.setAttribute("id", id);
|
|
29
|
-
} else {
|
|
30
|
-
const newTitleElement = ownerDocument.createElement("title");
|
|
31
|
-
newTitleElement.textContent = title;
|
|
32
|
-
newTitleElement.setAttribute("id", id);
|
|
33
|
-
svgElement.prepend(newTitleElement);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var setClassName = (svgElement, className) => {
|
|
37
|
-
if (className) {
|
|
38
|
-
svgElement.classList.add(className);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var getSanitizedSvgElement = (_svg, ownerDocument) => {
|
|
42
|
-
const span = ownerDocument.createElement("span");
|
|
43
|
-
span.innerHTML = Dompurify.default.sanitize(_svg);
|
|
44
|
-
const svgElement = span.querySelector("svg");
|
|
45
|
-
invariant(svgElement, "Icon: svg prop must be a valid svg string");
|
|
46
|
-
return svgElement;
|
|
47
|
-
};
|
|
48
|
-
var Icon = React.forwardRef(
|
|
49
|
-
({ size, title, className, style, ...rest }, ref) => {
|
|
50
|
-
const id = useId();
|
|
51
|
-
const svgRef = React.useRef(null);
|
|
52
|
-
const _svg = "svg" in rest ? rest.svg : void 0;
|
|
53
|
-
const svgString = React.useMemo(() => {
|
|
54
|
-
if (_svg) {
|
|
55
|
-
const ownerDocument = getOwnerDocument(svgRef.current);
|
|
56
|
-
const svgElement = getSanitizedSvgElement(_svg, ownerDocument);
|
|
57
|
-
if (size) {
|
|
58
|
-
setSizeAttributes(svgElement, size);
|
|
59
|
-
}
|
|
60
|
-
if (title) {
|
|
61
|
-
updateSvgTitle(svgElement, title, id);
|
|
62
|
-
}
|
|
63
|
-
setClassName(svgElement, className);
|
|
64
|
-
return svgElement.outerHTML;
|
|
65
|
-
}
|
|
66
|
-
}, [_svg, size, title, className, id]);
|
|
67
|
-
return /* @__PURE__ */ jsx(
|
|
68
|
-
"span",
|
|
69
|
-
{
|
|
70
|
-
className: classNames(iconWrapper, className),
|
|
71
|
-
ref: mergeRefs(ref, svgRef),
|
|
72
|
-
style,
|
|
73
|
-
dangerouslySetInnerHTML: svgString ? { __html: svgString } : void 0
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
Icon.displayName = "Icon";
|
|
79
|
-
export {
|
|
80
|
-
Icon
|
|
81
|
-
};
|
|
10
|
+
export { d as Icon };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baseline-ui/icons",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@react-aria/utils": "^3.23.0",
|
|
22
22
|
"dompurify": "^3.0.8",
|
|
23
23
|
"react-aria": "^3.31.1",
|
|
24
|
-
"@baseline-ui/utils": "0.8.
|
|
24
|
+
"@baseline-ui/utils": "0.8.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@svgr/cli": "^8.1.0",
|