@lism-css/ui 0.9.2 → 0.9.3
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/components/Accordion/getProps.js +53 -0
- package/dist/components/Accordion/react/AccIcon.js +9 -0
- package/dist/components/Accordion/react/Accordion.d.ts +5 -6
- package/dist/components/Accordion/react/Accordion.js +45 -0
- package/dist/components/Accordion/react/index.js +6 -0
- package/dist/components/Alert/getProps.js +20 -0
- package/dist/components/Alert/presets.js +29 -0
- package/dist/components/Alert/react/Alert.js +16 -0
- package/dist/components/Avatar/react/Avatar.js +8 -0
- package/dist/components/Badge/react/Badge.js +12 -0
- package/dist/components/Button/react/Button.js +12 -0
- package/dist/components/Callout/getProps.js +22 -0
- package/dist/components/Callout/presets.js +29 -0
- package/dist/components/Callout/react/Callout.js +20 -0
- package/dist/components/Chat/getProps.js +52 -0
- package/dist/components/Chat/react/Chat.js +22 -0
- package/dist/components/Details/getProps.js +15 -0
- package/dist/components/Details/react/Details.js +28 -0
- package/dist/components/Details/react/index.js +5 -0
- package/dist/components/Modal/getProps.js +25 -0
- package/dist/components/Modal/react/Body.js +9 -0
- package/dist/components/Modal/react/CloseBtn.js +13 -0
- package/dist/components/Modal/react/Inner.js +9 -0
- package/dist/components/Modal/react/Modal.d.ts +1 -2
- package/dist/components/Modal/react/Modal.js +17 -0
- package/dist/components/Modal/react/OpenBtn.js +9 -0
- package/dist/components/Modal/react/index.js +9 -0
- package/dist/components/Modal/setModal.js +16 -17
- package/dist/components/NavMenu/getProps.js +40 -0
- package/dist/components/NavMenu/react/NavMenu.js +24 -0
- package/dist/components/NavMenu/react/index.js +5 -0
- package/dist/components/ShapeDivider/getProps.js +22 -0
- package/dist/components/ShapeDivider/react/ShapeDivider.js +26 -0
- package/dist/components/Tabs/getProps.js +10 -0
- package/dist/components/Tabs/react/Tab.js +20 -0
- package/dist/components/Tabs/react/TabItem.js +7 -0
- package/dist/components/Tabs/react/TabList.js +8 -0
- package/dist/components/Tabs/react/TabPanel.js +9 -0
- package/dist/components/Tabs/react/Tabs.d.ts +1 -2
- package/dist/components/Tabs/react/Tabs.js +50 -0
- package/dist/components/Tabs/react/index.js +9 -0
- package/dist/components/Tabs/setTabs.js +10 -11
- package/dist/components/react.js +26 -0
- package/dist/lism-css/dist/components/Center/index.js +8 -0
- package/dist/lism-css/dist/components/Flex/index.js +8 -0
- package/dist/lism-css/dist/components/Flow/index.js +8 -0
- package/dist/lism-css/dist/components/Frame/index.js +8 -0
- package/dist/lism-css/dist/components/Grid/index.js +8 -0
- package/dist/lism-css/dist/components/Lism/index.js +8 -0
- package/dist/lism-css/dist/components/Stack/index.js +8 -0
- package/dist/lism-css/dist/components/atomic/Decorator/getProps.js +15 -0
- package/dist/lism-css/dist/components/atomic/Decorator/index.js +9 -0
- package/dist/lism-css/dist/components/atomic/Icon/SVG.js +22 -0
- package/dist/lism-css/dist/components/atomic/Icon/getProps.js +55 -0
- package/dist/lism-css/dist/components/atomic/Icon/index.js +12 -0
- package/dist/lism-css/dist/components/atomic/Icon/presets.js +276 -0
- package/dist/lism-css/dist/components/getFilterProps.js +23 -0
- package/dist/lism-css/dist/components/setMaybeTransformStyles.js +7 -0
- package/dist/lism-css/dist/config/default-config.js +11 -0
- package/dist/lism-css/dist/config/defaults/props.js +335 -0
- package/dist/lism-css/dist/config/defaults/states.js +39 -0
- package/dist/lism-css/dist/config/defaults/tokens.js +30 -0
- package/dist/lism-css/dist/config/helper/getSvgUrl.js +4 -0
- package/dist/lism-css/dist/config/helper.js +27 -0
- package/dist/lism-css/dist/config/index.js +17 -0
- package/dist/lism-css/dist/lib/getBpData.js +19 -0
- package/dist/lism-css/dist/lib/getLayoutProps.js +30 -0
- package/dist/lism-css/dist/lib/getLismProps.js +188 -0
- package/dist/lism-css/dist/lib/getMaybeCssVar.js +37 -0
- package/dist/lism-css/dist/lib/getMaybeTokenValue.js +26 -0
- package/dist/lism-css/dist/lib/getUtilKey.js +13 -0
- package/dist/lism-css/dist/lib/helper/atts.js +11 -0
- package/dist/lism-css/dist/lib/helper/filterEmptyObj.js +10 -0
- package/dist/lism-css/dist/lib/helper/hasSomeKeys.js +6 -0
- package/dist/lism-css/dist/lib/helper/isEmptyObj.js +6 -0
- package/dist/lism-css/dist/lib/helper/isNumStr.js +6 -0
- package/dist/lism-css/dist/lib/helper/splitWithComma.js +6 -0
- package/dist/lism-css/dist/lib/isPresetValue.js +13 -0
- package/dist/lism-css/dist/lib/isTokenValue.js +27 -0
- package/dist/ui.css +1 -0
- package/package.json +6 -5
- package/src/components/Accordion/react/Accordion.jsx +8 -7
- package/src/components/Modal/react/Modal.jsx +4 -3
- package/src/components/Tabs/react/Tabs.jsx +9 -8
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import o from "../../lism-css/dist/lib/getMaybeCssVar.js";
|
|
2
|
+
function a({ hovC: s, hovBgc: n, itemP: t, style: i = {}, ...r }) {
|
|
3
|
+
const e = { ...i };
|
|
4
|
+
return n && (e["--hov-bgc"] = o(n, "color")), s && (e["--hov-c"] = o(s, "color")), t && (e["--_item-p"] = o(t, "space")), {
|
|
5
|
+
lismClass: "c--navMenu",
|
|
6
|
+
as: "ul",
|
|
7
|
+
style: e,
|
|
8
|
+
...r
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function c(s) {
|
|
12
|
+
return {
|
|
13
|
+
lismClass: "c--navMenu_nest",
|
|
14
|
+
as: "ul",
|
|
15
|
+
"px-s": "20",
|
|
16
|
+
...s
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function u(s) {
|
|
20
|
+
return {
|
|
21
|
+
lismClass: "c--navMenu_item",
|
|
22
|
+
as: "li",
|
|
23
|
+
...s
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function p({ href: s, as: n = "span", ...t }) {
|
|
27
|
+
return {
|
|
28
|
+
lismClass: "c--navMenu_link",
|
|
29
|
+
as: s ? "a" : n,
|
|
30
|
+
href: s,
|
|
31
|
+
c: "inherit",
|
|
32
|
+
...t
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
u as getItemProps,
|
|
37
|
+
p as getLinkProps,
|
|
38
|
+
c as getNestProps,
|
|
39
|
+
a as getRootProps
|
|
40
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import n from "../../../lism-css/dist/components/Flex/index.js";
|
|
3
|
+
import e from "../../../lism-css/dist/components/Lism/index.js";
|
|
4
|
+
import m from "../../../lism-css/dist/components/Stack/index.js";
|
|
5
|
+
import { getNestProps as i, getLinkProps as f, getItemProps as p, getRootProps as u } from "../getProps.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
function I({ children: t, ...o }) {
|
|
8
|
+
return /* @__PURE__ */ r(m, { ...u(o), children: t });
|
|
9
|
+
}
|
|
10
|
+
function L({ children: t, ...o }) {
|
|
11
|
+
return /* @__PURE__ */ r(m, { ...i(o), children: t });
|
|
12
|
+
}
|
|
13
|
+
function N({ children: t, ...o }) {
|
|
14
|
+
return /* @__PURE__ */ r(e, { ...p(o), children: t });
|
|
15
|
+
}
|
|
16
|
+
function R({ children: t, ...o }) {
|
|
17
|
+
return /* @__PURE__ */ r(n, { ...f(o), children: t });
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
N as Item,
|
|
21
|
+
R as Link,
|
|
22
|
+
L as Nest,
|
|
23
|
+
I as Root
|
|
24
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function d({ viewBox: a, isAnimation: r, isEmpty: s, level: n = 5, stretch: i, offset: u, flip: l, style: o = {}, ...f }) {
|
|
2
|
+
if (n === 0) return null;
|
|
3
|
+
const t = { ...o };
|
|
4
|
+
t["--level"] = n || null, t["--_inner-offset"] = u || null, t["--_inner-stretch"] = i || null;
|
|
5
|
+
const e = {
|
|
6
|
+
lismClass: "c--shapeDivider",
|
|
7
|
+
"max-sz": "full",
|
|
8
|
+
"aria-hidden": "true"
|
|
9
|
+
};
|
|
10
|
+
return l && (e["data-flip"] = l), r && (e["data-has-animation"] = "true"), {
|
|
11
|
+
...e,
|
|
12
|
+
style: t,
|
|
13
|
+
// SVG用のprops
|
|
14
|
+
viewBox: a,
|
|
15
|
+
isEmpty: s,
|
|
16
|
+
// その他のprops
|
|
17
|
+
...f
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
d as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import l from "../../../lism-css/dist/components/Lism/index.js";
|
|
3
|
+
import p from "../getProps.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
function v({ children: i, ...o }) {
|
|
6
|
+
const r = p(o);
|
|
7
|
+
if (!r) return null;
|
|
8
|
+
const { viewBox: s, isAnimation: m, isEmpty: t, ...n } = r;
|
|
9
|
+
return /* @__PURE__ */ e(l, { ...n, children: t ? null : /* @__PURE__ */ e("div", { className: "c--shapeDivider_inner", children: /* @__PURE__ */ e(
|
|
10
|
+
"svg",
|
|
11
|
+
{
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
className: "c--shapeDivider_svg",
|
|
14
|
+
viewBox: s,
|
|
15
|
+
width: "100%",
|
|
16
|
+
height: "100%",
|
|
17
|
+
fill: "currentColor",
|
|
18
|
+
focusable: "false",
|
|
19
|
+
preserveAspectRatio: "none",
|
|
20
|
+
children: i
|
|
21
|
+
}
|
|
22
|
+
) }) });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
v as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import l from "../../../lism-css/dist/components/Lism/index.js";
|
|
3
|
+
function i({ tabId: t = "tab", index: a = 0, isActive: r = !1, ...o }) {
|
|
4
|
+
const s = `${t}-${a}`;
|
|
5
|
+
return /* @__PURE__ */ e(
|
|
6
|
+
l,
|
|
7
|
+
{
|
|
8
|
+
as: "button",
|
|
9
|
+
lismClass: "c--tabs_tab",
|
|
10
|
+
setPlain: !0,
|
|
11
|
+
role: "tab",
|
|
12
|
+
"aria-controls": s,
|
|
13
|
+
"aria-selected": r ? "true" : "false",
|
|
14
|
+
...o
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
i as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import n from "../../../lism-css/dist/components/Lism/index.js";
|
|
3
|
+
function i({ tabId: a = "tab", isActive: t = !1, index: e = 0, ...r }) {
|
|
4
|
+
const l = `${a}-${e}`;
|
|
5
|
+
return /* @__PURE__ */ o(n, { id: l, role: "tabpanel", "aria-hidden": t ? "false" : "true", lismClass: "c--tabs_panel", ...r });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
i as default
|
|
9
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
export default function Tabs({ tabId, defaultIndex, listProps, children, ...props }: {
|
|
3
2
|
[x: string]: any;
|
|
4
3
|
tabId?: string | undefined;
|
|
5
4
|
defaultIndex?: number | undefined;
|
|
6
5
|
listProps?: {} | undefined;
|
|
7
6
|
children: any;
|
|
8
|
-
}):
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m, jsxs as v, Fragment as E } from "react/jsx-runtime";
|
|
3
|
+
import { useState as P, useId as g, Children as c, isValidElement as f, createElement as b } from "react";
|
|
4
|
+
import k from "../../../lism-css/dist/components/Lism/index.js";
|
|
5
|
+
import l from "./Tab.js";
|
|
6
|
+
import A from "./TabItem.js";
|
|
7
|
+
import j from "./TabList.js";
|
|
8
|
+
import x from "./TabPanel.js";
|
|
9
|
+
import F from "../getProps.js";
|
|
10
|
+
/* empty css */
|
|
11
|
+
function H({ tabId: I = "", defaultIndex: u = 1, listProps: T = {}, children: p, ...d }) {
|
|
12
|
+
const [i, y] = P(u), n = I || g(), r = [], a = [];
|
|
13
|
+
return c.forEach(p, (e, h) => {
|
|
14
|
+
const t = h + 1;
|
|
15
|
+
f(e) && e.type === A && c.forEach(e.props.children, (o) => {
|
|
16
|
+
if (f(o)) {
|
|
17
|
+
if (o.type === l) {
|
|
18
|
+
const s = o.props;
|
|
19
|
+
r.push(
|
|
20
|
+
/* @__PURE__ */ b(
|
|
21
|
+
l,
|
|
22
|
+
{
|
|
23
|
+
...s,
|
|
24
|
+
tabId: n,
|
|
25
|
+
index: t,
|
|
26
|
+
key: t,
|
|
27
|
+
isActive: t === i,
|
|
28
|
+
onClick: () => y(t)
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
} else if (o.type === x) {
|
|
33
|
+
const s = o.props;
|
|
34
|
+
a.push(
|
|
35
|
+
/* @__PURE__ */ b(x, { ...s, tabId: n, index: t, key: t, isActive: t === i })
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}), /* @__PURE__ */ m(k, { ...F(d), children: r.length === 0 ? (
|
|
41
|
+
// TabItemを使わず直接TabListなどを子要素に配置する場合
|
|
42
|
+
p
|
|
43
|
+
) : /* @__PURE__ */ v(E, { children: [
|
|
44
|
+
/* @__PURE__ */ m(j, { ...T, children: r }),
|
|
45
|
+
a
|
|
46
|
+
] }) });
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
H as default
|
|
50
|
+
};
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
function
|
|
1
|
+
function u(t) {
|
|
2
2
|
t.preventDefault();
|
|
3
3
|
const r = t.currentTarget;
|
|
4
|
-
|
|
4
|
+
i(r);
|
|
5
5
|
}
|
|
6
|
-
const
|
|
6
|
+
const i = (t) => {
|
|
7
7
|
if (t.getAttribute("aria-selected") === "true") return;
|
|
8
8
|
const e = t.getAttribute("aria-controls"), n = document.getElementById(e);
|
|
9
9
|
if (n === null) return;
|
|
10
10
|
const s = t.parentNode.parentNode.querySelector('[aria-selected="true"]'), o = s.getAttribute("aria-controls"), a = document.getElementById(o);
|
|
11
11
|
t.setAttribute("aria-selected", "true"), s.setAttribute("aria-selected", "false"), a.setAttribute("aria-hidden", "true"), n.setAttribute("aria-hidden", "false");
|
|
12
12
|
};
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
b(u);
|
|
13
|
+
function b(t) {
|
|
14
|
+
t.querySelectorAll('button[role="tab"]').forEach((l) => {
|
|
15
|
+
l.addEventListener("click", function(d) {
|
|
16
|
+
u(d);
|
|
18
17
|
});
|
|
19
18
|
});
|
|
20
|
-
const e =
|
|
19
|
+
const e = window?.location?.href;
|
|
21
20
|
if (!e || !(e.indexOf("?lism-tab=") !== -1)) return;
|
|
22
21
|
const o = new URL(e).searchParams.get("lism-tab"), a = t.querySelector(`[aria-controls="${o}"]`);
|
|
23
|
-
a && (t.dataset.hasTabLink = "1",
|
|
22
|
+
a && (t.dataset.hasTabLink = "1", i(a), setTimeout(() => {
|
|
24
23
|
delete t.dataset.hasTabLink;
|
|
25
24
|
}, 10));
|
|
26
25
|
}
|
|
27
26
|
export {
|
|
28
|
-
|
|
27
|
+
b as default
|
|
29
28
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as e } from "./Accordion/react/index.js";
|
|
2
|
+
import { default as r } from "./Details/react/index.js";
|
|
3
|
+
import { default as l } from "./Modal/react/index.js";
|
|
4
|
+
import { default as u } from "./NavMenu/react/index.js";
|
|
5
|
+
import { default as p } from "./Tabs/react/index.js";
|
|
6
|
+
import { default as x } from "./Alert/react/Alert.js";
|
|
7
|
+
import { default as n } from "./Avatar/react/Avatar.js";
|
|
8
|
+
import { default as A } from "./Badge/react/Badge.js";
|
|
9
|
+
import { default as h } from "./Button/react/Button.js";
|
|
10
|
+
import { default as C } from "./Callout/react/Callout.js";
|
|
11
|
+
import { default as M } from "./Chat/react/Chat.js";
|
|
12
|
+
import { default as g } from "./ShapeDivider/react/ShapeDivider.js";
|
|
13
|
+
export {
|
|
14
|
+
e as Accordion,
|
|
15
|
+
x as Alert,
|
|
16
|
+
n as Avatar,
|
|
17
|
+
A as Badge,
|
|
18
|
+
h as Button,
|
|
19
|
+
C as Callout,
|
|
20
|
+
M as Chat,
|
|
21
|
+
r as Details,
|
|
22
|
+
l as Modal,
|
|
23
|
+
u as NavMenu,
|
|
24
|
+
g as ShapeDivider,
|
|
25
|
+
p as Tabs
|
|
26
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import m from "../../../lib/helper/atts.js";
|
|
2
|
+
import c from "../../getFilterProps.js";
|
|
3
|
+
import p from "../../setMaybeTransformStyles.js";
|
|
4
|
+
function b({ lismClass: a, size: r, clipPath: o, boxSizing: s, style: l, ...e }) {
|
|
5
|
+
const i = l ?? {}, t = c(p(e));
|
|
6
|
+
o && (i.clipPath = o), s && (i.boxSizing = s), r && (t.ar = "1/1", t.w = r), t.style = i;
|
|
7
|
+
const n = {
|
|
8
|
+
lismClass: m(a, "a--decorator"),
|
|
9
|
+
"aria-hidden": "true"
|
|
10
|
+
};
|
|
11
|
+
return Object.assign(n, t);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
b as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as o, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
function f({ size: e = "1em", fill: l = "currentColor", viewBox: t = "0 0 24 24", path: i, children: r, __html: s, ...h }) {
|
|
3
|
+
return s ? /* @__PURE__ */ o(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
dangerouslySetInnerHTML: { __html: s },
|
|
7
|
+
...h,
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
viewBox: t,
|
|
10
|
+
width: e,
|
|
11
|
+
height: e,
|
|
12
|
+
fill: l,
|
|
13
|
+
focusable: "false"
|
|
14
|
+
}
|
|
15
|
+
) : /* @__PURE__ */ w("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: t, width: e, height: e, fill: l, focusable: "false", ...h, children: [
|
|
16
|
+
i && /* @__PURE__ */ o("path", { d: i }),
|
|
17
|
+
r
|
|
18
|
+
] });
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
f as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import d from "./presets.js";
|
|
2
|
+
import h from "../../../lib/helper/atts.js";
|
|
3
|
+
import x from "../../setMaybeTransformStyles.js";
|
|
4
|
+
function P(p) {
|
|
5
|
+
const a = {}, s = p.match(/<svg([^>]*?)>([\s\S]*?)<\/svg>/i);
|
|
6
|
+
if (s) {
|
|
7
|
+
const [, c, e] = s, g = /([\w-]+)=["']([^"']*)["']/g;
|
|
8
|
+
let o;
|
|
9
|
+
for (; (o = g.exec(c)) !== null; ) {
|
|
10
|
+
const [, i, f] = o;
|
|
11
|
+
if (i === "style") {
|
|
12
|
+
const m = {};
|
|
13
|
+
f.split(";").forEach((t) => {
|
|
14
|
+
const [n, r] = t.split(":").map((l) => l.trim());
|
|
15
|
+
n && r && (m[n] = r);
|
|
16
|
+
}), a[i] = m;
|
|
17
|
+
} else
|
|
18
|
+
a[i] = f;
|
|
19
|
+
}
|
|
20
|
+
return { svgProps: a, svgContent: e };
|
|
21
|
+
}
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
24
|
+
function S({ lismClass: p, as: a, icon: s, label: c, exProps: e = {}, ...g }) {
|
|
25
|
+
let o = a || "span", i = "";
|
|
26
|
+
const {
|
|
27
|
+
style: f = {},
|
|
28
|
+
className: m = "",
|
|
29
|
+
...t
|
|
30
|
+
} = x(g);
|
|
31
|
+
let n = f, r = m;
|
|
32
|
+
if (t.viewBox)
|
|
33
|
+
o = "svg", t.width || (e.width = "1em"), t.height || (e.height = "1em");
|
|
34
|
+
else if (t.src)
|
|
35
|
+
o = "img";
|
|
36
|
+
else if (s)
|
|
37
|
+
if (typeof s == "string")
|
|
38
|
+
if (s.startsWith("<svg")) {
|
|
39
|
+
o = "_SVG_";
|
|
40
|
+
const { svgProps: l = {}, svgContent: u = "" } = P(s), { class: v, style: y, ...C } = l;
|
|
41
|
+
r = h(r, v), n = { ...n, ...y }, e = { ...e, ...C, fill: "currentColor" }, i = u;
|
|
42
|
+
} else {
|
|
43
|
+
const l = d[s] || null;
|
|
44
|
+
l != null && (o = "_SVG_", e = { ...e, ...l });
|
|
45
|
+
}
|
|
46
|
+
else if (typeof s == "object" && s.as) {
|
|
47
|
+
const { as: l, ...u } = s;
|
|
48
|
+
o = l, e = { ...e, ...u };
|
|
49
|
+
} else
|
|
50
|
+
o = s;
|
|
51
|
+
return c ? (e["aria-label"] = c, e.role = "img") : e["aria-hidden"] = "true", t.lismClass = h(p, "a--icon", r), t.style = { ...n }, { Component: o, lismProps: t, exProps: e, content: i };
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
S as default
|
|
55
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import f from "../../../lib/getLismProps.js";
|
|
3
|
+
import l from "./getProps.js";
|
|
4
|
+
import s from "./SVG.js";
|
|
5
|
+
function d({ children: e, ...n }) {
|
|
6
|
+
const { Component: r, lismProps: p, exProps: t = {}, content: m } = l(n);
|
|
7
|
+
let o;
|
|
8
|
+
return r === "_SVG_" ? (o = s, m && (t.__html = m)) : o = r, /* @__PURE__ */ i(o, { ...f(p), ...t, children: e });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
d as default
|
|
12
|
+
};
|