@lism-css/ui 0.13.0 → 0.13.1
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.d.ts +2 -1
- package/dist/components/Accordion/getProps.js +19 -18
- package/dist/components/Accordion/react/Accordion.js +2 -2
- package/dist/components/Alert/getProps.d.ts +3 -0
- package/dist/components/Alert/getProps.js +9 -6
- package/dist/components/Callout/getProps.d.ts +2 -0
- package/dist/components/Callout/getProps.js +5 -3
- package/dist/components/Chat/getProps.d.ts +3 -0
- package/dist/components/Chat/getProps.js +3 -0
- package/dist/components/Chat/react/Chat.js +15 -15
- package/dist/components/Details/getProps.d.ts +2 -1
- package/dist/components/Details/getProps.js +3 -3
- package/dist/lism-css/dist/components/atomic/Decorator/index.js +2 -3
- package/dist/lism-css/dist/components/atomic/Icon/getProps.js +33 -34
- package/dist/lism-css/dist/lib/getAtomicProps.js +32 -0
- package/dist/lism-css/dist/lib/getLayoutProps.js +27 -17
- package/dist/lism-css/dist/lib/getLismProps.js +113 -102
- package/dist/ui.css +1 -1
- package/package.json +2 -2
- package/src/components/Accordion/getProps.ts +2 -1
- package/src/components/Alert/getProps.ts +4 -1
- package/src/components/Callout/getProps.ts +3 -1
- package/src/components/Chat/astro/Chat.astro +2 -2
- package/src/components/Chat/getProps.ts +3 -0
- package/src/components/Chat/react/Chat.tsx +2 -2
- package/src/components/Details/getProps.ts +1 -1
- package/src/components/Tabs/_style.css +13 -15
- package/dist/lism-css/dist/components/atomic/Decorator/getProps.js +0 -15
|
@@ -56,7 +56,8 @@ export declare function getPanelProps({ lismClass, _contextID, accID, isOpen, ..
|
|
|
56
56
|
};
|
|
57
57
|
export declare const defaultProps: {
|
|
58
58
|
readonly icon: {
|
|
59
|
-
readonly lismClass: "c--accordion_icon
|
|
59
|
+
readonly lismClass: "c--accordion_icon";
|
|
60
|
+
readonly atomic: "icon";
|
|
60
61
|
readonly as: "span";
|
|
61
62
|
readonly pi: "center";
|
|
62
63
|
readonly fxsh: "0";
|
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
import e from "../../lism-css/dist/lib/helper/atts.js";
|
|
2
|
-
import
|
|
3
|
-
function u({ lismClass:
|
|
4
|
-
return t.lismClass = e(
|
|
2
|
+
import a from "../../lism-css/dist/lib/helper/mergeSet.js";
|
|
3
|
+
function u({ lismClass: n, allowMultiple: o, ...t }) {
|
|
4
|
+
return t.lismClass = e(n, "c--accordion"), o && (t["data-allow-multiple"] = ""), t;
|
|
5
5
|
}
|
|
6
|
-
function f({ lismClass:
|
|
7
|
-
return
|
|
6
|
+
function f({ lismClass: n, ...o }) {
|
|
7
|
+
return o.lismClass = e(n, "c--accordion_item"), o;
|
|
8
8
|
}
|
|
9
|
-
function m({ as:
|
|
9
|
+
function m({ as: n = "div", role: o, lismClass: t, set: s, ...c }) {
|
|
10
10
|
const i = {
|
|
11
11
|
lismClass: e(t, "c--accordion_heading"),
|
|
12
|
-
as:
|
|
13
|
-
set:
|
|
14
|
-
...
|
|
12
|
+
as: n,
|
|
13
|
+
set: a("plain", s),
|
|
14
|
+
...c
|
|
15
15
|
};
|
|
16
|
-
return i.as === "div" && (i.role =
|
|
16
|
+
return i.as === "div" && (i.role = o ?? "heading"), i;
|
|
17
17
|
}
|
|
18
|
-
function p({ set:
|
|
18
|
+
function p({ set: n, ...o }) {
|
|
19
19
|
return {
|
|
20
20
|
lismClass: "c--accordion_button",
|
|
21
21
|
as: "button",
|
|
22
22
|
layout: "flex",
|
|
23
|
-
set:
|
|
23
|
+
set: a("plain", n),
|
|
24
24
|
g: "10",
|
|
25
25
|
w: "100%",
|
|
26
26
|
ai: "center",
|
|
27
27
|
jc: "between",
|
|
28
|
-
...
|
|
28
|
+
...o
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function _({ lismClass:
|
|
31
|
+
function _({ lismClass: n, _contextID: o, accID: t = "__LISM_ACC_ID__", isOpen: s = !1, ...c }) {
|
|
32
32
|
const i = {
|
|
33
|
-
lismClass: e(
|
|
34
|
-
id:
|
|
33
|
+
lismClass: e(n, "c--accordion_panel"),
|
|
34
|
+
id: o || t,
|
|
35
35
|
hidden: s ? void 0 : "until-found",
|
|
36
36
|
pos: "relative",
|
|
37
37
|
ov: "hidden"
|
|
38
|
-
}, r = { lismClass: "c--accordion_content", layout: "flow", ...
|
|
38
|
+
}, r = { lismClass: "c--accordion_content", layout: "flow", ...c };
|
|
39
39
|
return { panelProps: i, contentProps: r };
|
|
40
40
|
}
|
|
41
41
|
const P = {
|
|
42
42
|
icon: {
|
|
43
|
-
lismClass: "c--accordion_icon
|
|
43
|
+
lismClass: "c--accordion_icon",
|
|
44
|
+
atomic: "icon",
|
|
44
45
|
as: "span",
|
|
45
46
|
pi: "center",
|
|
46
47
|
fxsh: "0",
|
|
@@ -13,7 +13,7 @@ function S({ children: t, ...r }) {
|
|
|
13
13
|
const o = _(r);
|
|
14
14
|
return /* @__PURE__ */ n(P, { ...o, children: t });
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function Z({ children: t, ...r }) {
|
|
17
17
|
const o = p(null), e = f();
|
|
18
18
|
m(() => {
|
|
19
19
|
if (o.current)
|
|
@@ -38,7 +38,7 @@ function k({ children: t, ...r }) {
|
|
|
38
38
|
return /* @__PURE__ */ n(s, { ...e, children: /* @__PURE__ */ n(s, { ...c, children: t }) });
|
|
39
39
|
}
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
Z as AccordionItem,
|
|
42
42
|
S as AccordionRoot,
|
|
43
43
|
b as Button,
|
|
44
44
|
$ as Heading,
|
|
@@ -13,10 +13,13 @@ export default function getAlertProps({ type, keycolor, layout, icon, flow, ...p
|
|
|
13
13
|
layout: "center" | "flex" | "grid" | "flow" | "frame" | "box" | "cluster" | "columns" | "fluidCols" | "stack" | "sideMain" | "switchCols" | "tileGrid";
|
|
14
14
|
flow: string;
|
|
15
15
|
lismClass: string;
|
|
16
|
+
util: string;
|
|
17
|
+
set: string;
|
|
16
18
|
keycolor: string;
|
|
17
19
|
ai: string;
|
|
18
20
|
p: string;
|
|
19
21
|
g: string;
|
|
20
22
|
bd: boolean;
|
|
21
23
|
bdrs: string;
|
|
24
|
+
bxsh: string;
|
|
22
25
|
};
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import i from "./presets.js";
|
|
2
|
-
function f({ type: o = "alert", keycolor: t, layout:
|
|
3
|
-
const r = o ? i[o] : null,
|
|
2
|
+
function f({ type: o = "alert", keycolor: t, layout: e = "flex", icon: c, flow: l = "s", ...s }) {
|
|
3
|
+
const r = o ? i[o] : null, n = c || r?.icon || "info", a = t || r?.color || "currentColor";
|
|
4
4
|
return {
|
|
5
|
-
icon:
|
|
6
|
-
layout:
|
|
5
|
+
icon: n,
|
|
6
|
+
layout: e,
|
|
7
7
|
flow: l,
|
|
8
|
-
lismClass: "c--alert
|
|
8
|
+
lismClass: "c--alert",
|
|
9
|
+
util: "cbox",
|
|
10
|
+
set: "shadow",
|
|
9
11
|
keycolor: a,
|
|
10
12
|
ai: "center",
|
|
11
13
|
p: "15",
|
|
12
14
|
g: "15",
|
|
13
15
|
bd: !0,
|
|
14
16
|
bdrs: "10",
|
|
15
|
-
|
|
17
|
+
bxsh: "10",
|
|
18
|
+
...s
|
|
16
19
|
};
|
|
17
20
|
}
|
|
18
21
|
export {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import u from "./presets.js";
|
|
2
|
-
function b({ type: o = "note", keycolor:
|
|
3
|
-
const
|
|
2
|
+
function b({ type: o = "note", keycolor: t, icon: c, title: s, flow: n = "s", ...e }) {
|
|
3
|
+
const l = o ? u[o] : null, r = c || l?.icon || "note", a = t || l?.color || null;
|
|
4
4
|
return {
|
|
5
5
|
icon: r,
|
|
6
6
|
title: s,
|
|
7
7
|
flow: n,
|
|
8
|
-
lismClass: "c--callout
|
|
8
|
+
lismClass: "c--callout",
|
|
9
|
+
util: "cbox",
|
|
10
|
+
set: "shadow",
|
|
9
11
|
keycolor: a,
|
|
10
12
|
p: "20",
|
|
11
13
|
g: "10",
|
|
@@ -25,10 +25,13 @@ export declare const defaultProps: {
|
|
|
25
25
|
};
|
|
26
26
|
readonly deco: {
|
|
27
27
|
readonly lismClass: "c--chat_deco";
|
|
28
|
+
readonly util: "cbox";
|
|
29
|
+
readonly isSkipFlow: true;
|
|
28
30
|
readonly pos: "absolute";
|
|
29
31
|
};
|
|
30
32
|
readonly content: {
|
|
31
33
|
readonly lismClass: "c--chat_content";
|
|
34
|
+
readonly util: "cbox";
|
|
32
35
|
readonly bdrs: "30";
|
|
33
36
|
readonly p: "20";
|
|
34
37
|
readonly lh: "s";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import h from "../../../lism-css/dist/components/atomic/Decorator/index.js";
|
|
3
|
+
import p from "../../../lism-css/dist/components/layout/Flow/index.js";
|
|
4
|
+
import s from "../../../lism-css/dist/components/layout/Frame/index.js";
|
|
5
5
|
import l from "../../../lism-css/dist/components/layout/Grid/index.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import c from "../../../lism-css/dist/components/Lism/index.js";
|
|
7
|
+
import g, { defaultProps as t } from "../getProps.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
function
|
|
10
|
-
const { "data-chat-dir":
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
i && /* @__PURE__ */
|
|
13
|
-
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
9
|
+
function w({ name: o, avatar: i, flow: e = "s", children: a, ...f }) {
|
|
10
|
+
const { "data-chat-dir": d, ...n } = g(f);
|
|
11
|
+
return /* @__PURE__ */ m(l, { "data-chat-dir": d, ...n, children: [
|
|
12
|
+
i && /* @__PURE__ */ r(s, { ...t.avatar, children: /* @__PURE__ */ r("img", { src: i, alt: "", width: "60", height: "60", decoding: "async" }) }),
|
|
13
|
+
o && /* @__PURE__ */ r(c, { ...t.name, children: o }),
|
|
14
|
+
/* @__PURE__ */ m(c, { ...t.body, children: [
|
|
15
|
+
/* @__PURE__ */ r(h, { ...t.deco }),
|
|
16
|
+
/* @__PURE__ */ r(p, { ...t.content, flow: e, jslf: d, children: a })
|
|
17
17
|
] })
|
|
18
18
|
] });
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
w as default
|
|
22
22
|
};
|
|
@@ -24,7 +24,8 @@ export declare const defaultProps: {
|
|
|
24
24
|
readonly ai: "center";
|
|
25
25
|
};
|
|
26
26
|
readonly icon: {
|
|
27
|
-
readonly lismClass: "c--details_icon
|
|
27
|
+
readonly lismClass: "c--details_icon";
|
|
28
|
+
readonly atomic: "icon";
|
|
28
29
|
readonly as: "span";
|
|
29
30
|
readonly 'aria-hidden': "true";
|
|
30
31
|
};
|
|
@@ -12,14 +12,14 @@ function n({ set: t, ...s }) {
|
|
|
12
12
|
...s
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const c = {
|
|
16
16
|
summary: { lismClass: "c--details_summary", layout: "flex", g: "10", ai: "center" },
|
|
17
|
-
icon: { lismClass: "c--details_icon
|
|
17
|
+
icon: { lismClass: "c--details_icon", atomic: "icon", as: "span", "aria-hidden": "true" },
|
|
18
18
|
body: { lismClass: "c--details_body" },
|
|
19
19
|
content: { lismClass: "c--details_content", layout: "flow", flow: "s" }
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
c as defaultProps,
|
|
23
23
|
o as getDetailsProps,
|
|
24
24
|
n as getTitleProps
|
|
25
25
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import t from "
|
|
3
|
-
import f from "../../Lism/index.js";
|
|
2
|
+
import t from "../../Lism/index.js";
|
|
4
3
|
function e(r) {
|
|
5
|
-
return /* @__PURE__ */ o(
|
|
4
|
+
return /* @__PURE__ */ o(t, { atomic: "decorator", "aria-hidden": "true", ...r });
|
|
6
5
|
}
|
|
7
6
|
export {
|
|
8
7
|
e as default
|
|
@@ -1,56 +1,55 @@
|
|
|
1
1
|
import C from "./presets.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const [, c, e] = s, p = /([\w-]+)=["']([^"']*)["']/g;
|
|
2
|
+
function d(m) {
|
|
3
|
+
const a = {}, l = m.match(/<svg([^>]*?)>([\s\S]*?)<\/svg>/i);
|
|
4
|
+
if (l) {
|
|
5
|
+
const [, c, s] = l, p = /([\w-]+)=["']([^"']*)["']/g;
|
|
7
6
|
let o;
|
|
8
7
|
for (; (o = p.exec(c)) !== null; ) {
|
|
9
|
-
const [,
|
|
10
|
-
if (
|
|
8
|
+
const [, n, f] = o;
|
|
9
|
+
if (n === "style") {
|
|
11
10
|
const g = {};
|
|
12
|
-
f.split(";").forEach((
|
|
13
|
-
const [
|
|
14
|
-
|
|
15
|
-
}), a[
|
|
11
|
+
f.split(";").forEach((e) => {
|
|
12
|
+
const [r, i] = e.split(":").map((t) => t.trim());
|
|
13
|
+
r && i && (g[r] = i);
|
|
14
|
+
}), a[n] = g;
|
|
16
15
|
} else
|
|
17
|
-
a[
|
|
16
|
+
a[n] = f;
|
|
18
17
|
}
|
|
19
|
-
return { svgProps: a, svgContent:
|
|
18
|
+
return { svgProps: a, svgContent: s };
|
|
20
19
|
}
|
|
21
20
|
return {};
|
|
22
21
|
}
|
|
23
|
-
function
|
|
24
|
-
let o = a || "span",
|
|
22
|
+
function P({ lismClass: m, as: a, icon: l, label: c, exProps: s = {}, ...p }) {
|
|
23
|
+
let o = a || "span", n = "";
|
|
25
24
|
const {
|
|
26
25
|
style: f = {},
|
|
27
26
|
className: g = "",
|
|
28
|
-
...
|
|
27
|
+
...e
|
|
29
28
|
} = p;
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
29
|
+
let r = f, i = g;
|
|
30
|
+
if (e.viewBox) {
|
|
32
31
|
o = "svg";
|
|
33
|
-
const t =
|
|
34
|
-
t && delete
|
|
35
|
-
} else if (
|
|
32
|
+
const t = e.size;
|
|
33
|
+
t && delete e.size, e.width || (s.width = t || "1em"), e.height || (s.height = t || "1em");
|
|
34
|
+
} else if (e.src)
|
|
36
35
|
o = "img";
|
|
37
|
-
else if (
|
|
38
|
-
if (typeof
|
|
39
|
-
if (
|
|
36
|
+
else if (l)
|
|
37
|
+
if (typeof l == "string")
|
|
38
|
+
if (l.startsWith("<svg")) {
|
|
40
39
|
o = "_SVG_";
|
|
41
|
-
const { svgProps: t = {}, svgContent:
|
|
42
|
-
|
|
40
|
+
const { svgProps: t = {}, svgContent: h = "" } = d(l), { class: u, style: v, ...y } = t;
|
|
41
|
+
u && (i = i ? `${i} ${u}` : u), r = { ...r, ...v }, s = { ...s, ...y, fill: "currentColor" }, n = h;
|
|
43
42
|
} else {
|
|
44
|
-
const t = C[
|
|
45
|
-
t != null && (o = "_SVG_",
|
|
43
|
+
const t = C[l] || null;
|
|
44
|
+
t != null && (o = "_SVG_", s = { ...s, ...t });
|
|
46
45
|
}
|
|
47
|
-
else if (typeof
|
|
48
|
-
const { as: t, ...
|
|
49
|
-
o = t,
|
|
46
|
+
else if (typeof l == "object" && l.as) {
|
|
47
|
+
const { as: t, ...h } = l;
|
|
48
|
+
o = t, s = { ...s, ...h };
|
|
50
49
|
} else
|
|
51
|
-
o =
|
|
52
|
-
return c ? (
|
|
50
|
+
o = l;
|
|
51
|
+
return c ? (s["aria-label"] = c, s.role = "img") : s["aria-hidden"] = "true", e.lismClass = m, e.atomic = "icon", i && (e.className = i), e.style = { ...r }, { Component: o, lismProps: e, exProps: s, content: n };
|
|
53
52
|
}
|
|
54
53
|
export {
|
|
55
|
-
|
|
54
|
+
P as default
|
|
56
55
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import u from "./getBpData.js";
|
|
2
|
+
import a from "./getMaybeCssVar.js";
|
|
3
|
+
function l(n, ...t) {
|
|
4
|
+
return [...n ?? [], ...t];
|
|
5
|
+
}
|
|
6
|
+
function s(n) {
|
|
7
|
+
const t = u(n), i = {};
|
|
8
|
+
return Object.entries(t).forEach(([o, r]) => {
|
|
9
|
+
i[o] = a(r, "space");
|
|
10
|
+
}), i;
|
|
11
|
+
}
|
|
12
|
+
function b(n, t) {
|
|
13
|
+
if (!n) return t;
|
|
14
|
+
const i = {
|
|
15
|
+
...t,
|
|
16
|
+
primitiveClass: l(t.primitiveClass, `a--${n}`)
|
|
17
|
+
};
|
|
18
|
+
return n === "spacer" ? f(i) : n === "decorator" ? p(i) : i;
|
|
19
|
+
}
|
|
20
|
+
function f(n) {
|
|
21
|
+
const t = { ...n };
|
|
22
|
+
return t.w != null && (t.w = s(t.w)), t.h != null && (t.h = s(t.h)), t;
|
|
23
|
+
}
|
|
24
|
+
function p({ size: n, clipPath: t, boxSizing: i, style: o, ...r }) {
|
|
25
|
+
const e = { ...o };
|
|
26
|
+
t && (e.clipPath = t), i && (e.boxSizing = i);
|
|
27
|
+
const c = { ...r, style: e };
|
|
28
|
+
return n && (c.ar = "1/1", c.w = n), c;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
b as default
|
|
32
|
+
};
|
|
@@ -1,27 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import r from "./isTokenValue.js";
|
|
2
|
+
import e from "./getMaybeCssVar.js";
|
|
3
|
+
function o(t, ...l) {
|
|
4
|
+
return [...t ?? [], ...l];
|
|
5
|
+
}
|
|
6
|
+
function p(t, l) {
|
|
7
|
+
if (!t) return l;
|
|
6
8
|
const s = {
|
|
7
|
-
...
|
|
8
|
-
|
|
9
|
+
...l,
|
|
10
|
+
primitiveClass: o(l.primitiveClass, `l--${t}`)
|
|
9
11
|
};
|
|
10
|
-
return
|
|
12
|
+
return t === "flow" ? f(s) : t === "sideMain" ? u(s) : t === "fluidCols" ? a(s) : t === "switchCols" ? m(s) : s;
|
|
11
13
|
}
|
|
12
|
-
function u({ sideW:
|
|
14
|
+
function u({ sideW: t, mainW: l, style: s, ...i }) {
|
|
13
15
|
const n = { ...s };
|
|
14
|
-
return
|
|
16
|
+
return t != null && (n["--sideW"] = e(t, "sz")), l != null && (n["--mainW"] = e(l, "sz")), { ...i, style: n };
|
|
15
17
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
18
|
+
function a({ autoFill: t, style: l, ...s }) {
|
|
19
|
+
return t ? { ...s, style: { ...l, "--autoMode": "auto-fill" } } : { ...s, style: l };
|
|
18
20
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
21
|
+
function f({ flow: t, style: l, primitiveClass: s, ...i }) {
|
|
22
|
+
return r("flow", t) ? {
|
|
23
|
+
...i,
|
|
24
|
+
primitiveClass: o(s, `-flow:${t}`),
|
|
25
|
+
style: l
|
|
26
|
+
} : t ? {
|
|
27
|
+
...i,
|
|
28
|
+
primitiveClass: o(s, "-flow:"),
|
|
29
|
+
style: { ...l, "--flow": e(t, "space") }
|
|
30
|
+
} : { ...i, primitiveClass: s, style: l };
|
|
21
31
|
}
|
|
22
|
-
function m({ breakSize:
|
|
23
|
-
return
|
|
32
|
+
function m({ breakSize: t, style: l, ...s }) {
|
|
33
|
+
return t ? { ...s, style: { ...l, "--breakSize": e(t, "sz") } } : { ...s, style: l };
|
|
24
34
|
}
|
|
25
35
|
export {
|
|
26
|
-
|
|
36
|
+
p as default
|
|
27
37
|
};
|
|
@@ -1,152 +1,163 @@
|
|
|
1
|
-
import { TRAITS as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
1
|
+
import { TRAITS as v, PROPS as m } from "../config/index.js";
|
|
2
|
+
import N from "./getLayoutProps.js";
|
|
3
|
+
import x from "./getAtomicProps.js";
|
|
4
|
+
import b from "./isPresetValue.js";
|
|
5
|
+
import E from "./isTokenValue.js";
|
|
6
|
+
import P from "./getUtilKey.js";
|
|
7
|
+
import u from "./getMaybeCssVar.js";
|
|
8
|
+
import _ from "./getBpData.js";
|
|
9
|
+
import z from "./helper/atts.js";
|
|
10
|
+
import w from "./helper/isEmptyObj.js";
|
|
11
|
+
import S from "./helper/filterEmptyObj.js";
|
|
12
|
+
import U from "./helper/mergeSet.js";
|
|
12
13
|
import k from "./helper/splitWithComma.js";
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
return
|
|
14
|
+
const A = (o) => {
|
|
15
|
+
const s = m[o];
|
|
16
|
+
return s && s?.token || "";
|
|
16
17
|
};
|
|
17
|
-
function
|
|
18
|
+
function T(o, s) {
|
|
18
19
|
if (!o) return "";
|
|
19
|
-
if (!
|
|
20
|
-
const t = o.split(" ")
|
|
21
|
-
return
|
|
20
|
+
if (!s) return o;
|
|
21
|
+
const t = o.split(" ")[0];
|
|
22
|
+
return `${o} ${t}--${s}`;
|
|
22
23
|
}
|
|
23
|
-
class
|
|
24
|
+
class $ {
|
|
24
25
|
// 最終出力 className
|
|
25
26
|
className = "";
|
|
26
|
-
// 出力順のためのクラスバケット: [lismClass] [
|
|
27
|
-
// - lismClass
|
|
28
|
-
// -
|
|
29
|
-
// - uClasses
|
|
27
|
+
// 出力順のためのクラスバケット: [lismClass] [primitiveClass] [uClasses]
|
|
28
|
+
// - lismClass : c--* 基底クラス(variant BEM 展開の対象)
|
|
29
|
+
// - primitiveClass : a--* / l--* / is--* の primitive クラス(getAtomicProps → getLayoutProps → analyzeTrait の順で push)
|
|
30
|
+
// - uClasses : set--* → u--* → -property の順で push される utility クラス
|
|
30
31
|
lismClass = "";
|
|
31
|
-
|
|
32
|
+
primitiveClass = [];
|
|
32
33
|
uClasses = [];
|
|
33
34
|
styles = {};
|
|
34
35
|
attrs = {};
|
|
35
36
|
_propConfig;
|
|
36
|
-
constructor(
|
|
37
|
-
const {
|
|
38
|
-
|
|
37
|
+
constructor(s) {
|
|
38
|
+
const {
|
|
39
|
+
forwardedRef: t,
|
|
40
|
+
class: i,
|
|
41
|
+
className: e,
|
|
42
|
+
lismClass: a,
|
|
43
|
+
primitiveClass: r,
|
|
44
|
+
variant: l,
|
|
45
|
+
style: d = {},
|
|
46
|
+
_propConfig: c = {},
|
|
47
|
+
...h
|
|
48
|
+
} = s;
|
|
49
|
+
this.styles = { ...d }, this._propConfig = { ...c }, this.lismClass = T(a, l), r && r.length && (this.primitiveClass = [...r]), w(h) || (this.attrs = { ...h }, this.analyzeProps()), t && (this.attrs.ref = t), this.className = this.buildClassName(e, i);
|
|
39
50
|
}
|
|
40
51
|
// 最終クラス文字列の組み立て(出力順の唯一の確定地点)
|
|
41
|
-
// 出力順: [user/astro className] [lismClass] [
|
|
42
|
-
buildClassName(
|
|
43
|
-
return
|
|
52
|
+
// 出力順: [user/astro className] [lismClass] [primitiveClass] [uClasses]
|
|
53
|
+
buildClassName(s, t) {
|
|
54
|
+
return z(s || t || void 0, this.lismClass, this.primitiveClass, this.uClasses);
|
|
44
55
|
}
|
|
45
|
-
analyzeTrait(
|
|
46
|
-
const { className:
|
|
47
|
-
t === !0 ? this.
|
|
56
|
+
analyzeTrait(s, t) {
|
|
57
|
+
const { className: i, preset: e, presetClass: a, customVar: r, tokenKey: l } = s;
|
|
58
|
+
t === !0 ? this.primitiveClass.push(i) : e && b(e, t) ? this.primitiveClass.push(`${i} ${a}:${String(t)}`) : t && (this.primitiveClass.push(i), l && r && this.addStyle(r, u(t, l)));
|
|
48
59
|
}
|
|
49
60
|
// prop解析
|
|
50
61
|
analyzeProps() {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
if (Object.hasOwn(
|
|
54
|
-
const e = this.extractProp(
|
|
55
|
-
typeof a == "string" ? e && this.
|
|
56
|
-
} else if (Object.hasOwn(
|
|
57
|
-
const e = this.attrs[
|
|
58
|
-
delete this.attrs[
|
|
59
|
-
} else if (
|
|
60
|
-
const e = this.extractProp(
|
|
62
|
+
const s = this.extractProp("set"), t = this.extractProp("util");
|
|
63
|
+
U(void 0, s).forEach((i) => this.addUtil(`set--${i}`)), U(void 0, t).forEach((i) => this.addUtil(`u--${i}`)), Object.keys(this.attrs).forEach((i) => {
|
|
64
|
+
if (Object.hasOwn(v, i)) {
|
|
65
|
+
const e = this.extractProp(i), a = v[i];
|
|
66
|
+
typeof a == "string" ? e && this.primitiveClass.push(a) : this.analyzeTrait(a, e);
|
|
67
|
+
} else if (Object.hasOwn(m, i)) {
|
|
68
|
+
const e = this.attrs[i];
|
|
69
|
+
delete this.attrs[i], this.analyzeLismProp(i, e);
|
|
70
|
+
} else if (i === "hov") {
|
|
71
|
+
const e = this.extractProp(i);
|
|
61
72
|
this.setHovProps(e);
|
|
62
|
-
} else if (
|
|
73
|
+
} else if (i === "css") {
|
|
63
74
|
const e = this.extractProp("css");
|
|
64
75
|
this.addStyles(e);
|
|
65
76
|
}
|
|
66
77
|
});
|
|
67
78
|
}
|
|
68
79
|
// Lism Prop 解析
|
|
69
|
-
analyzeLismProp(
|
|
80
|
+
analyzeLismProp(s, t) {
|
|
70
81
|
if (t == null) return;
|
|
71
|
-
let
|
|
72
|
-
if (
|
|
73
|
-
this._propConfig?.[
|
|
74
|
-
const { base: e, ...a } =
|
|
75
|
-
this.setAttrs(
|
|
76
|
-
|
|
82
|
+
let i = m[s] || null;
|
|
83
|
+
if (i === null) return;
|
|
84
|
+
this._propConfig?.[s] && (i = Object.assign({}, i, this._propConfig[s]));
|
|
85
|
+
const { base: e, ...a } = _(t);
|
|
86
|
+
this.setAttrs(s, e, i), Object.keys(a).forEach((r) => {
|
|
87
|
+
i && this.setAttrs(s, a[r], i, r);
|
|
77
88
|
});
|
|
78
89
|
}
|
|
79
|
-
addUtil(
|
|
80
|
-
this.uClasses.push(
|
|
90
|
+
addUtil(s) {
|
|
91
|
+
this.uClasses.push(s);
|
|
81
92
|
}
|
|
82
|
-
addUtils(
|
|
83
|
-
this.uClasses.push(...
|
|
93
|
+
addUtils(s) {
|
|
94
|
+
this.uClasses.push(...s);
|
|
84
95
|
}
|
|
85
96
|
// addState(state) {
|
|
86
97
|
// this.stateClasses.push(state);
|
|
87
98
|
// }
|
|
88
|
-
addStyle(
|
|
89
|
-
this.styles[
|
|
99
|
+
addStyle(s, t) {
|
|
100
|
+
this.styles[s] = t;
|
|
90
101
|
}
|
|
91
|
-
addStyles(
|
|
92
|
-
this.styles = { ...this.styles, ...
|
|
102
|
+
addStyles(s) {
|
|
103
|
+
this.styles = { ...this.styles, ...s };
|
|
93
104
|
}
|
|
94
|
-
addAttrs(
|
|
95
|
-
this.addStyles(
|
|
105
|
+
addAttrs(s) {
|
|
106
|
+
this.addStyles(s.styles || {}), this.addUtils(s.utils || []);
|
|
96
107
|
}
|
|
97
|
-
extractProp(
|
|
98
|
-
const t = this.attrs[
|
|
99
|
-
return this.attrs[
|
|
108
|
+
extractProp(s) {
|
|
109
|
+
const t = this.attrs[s];
|
|
110
|
+
return this.attrs[s] === void 0 ? null : (delete this.attrs[s], t);
|
|
100
111
|
}
|
|
101
|
-
extractProps(
|
|
112
|
+
extractProps(s) {
|
|
102
113
|
const t = {};
|
|
103
|
-
return
|
|
104
|
-
this.attrs[
|
|
114
|
+
return s.forEach((i) => {
|
|
115
|
+
this.attrs[i] !== void 0 && (t[i] = this.attrs[i], delete this.attrs[i]);
|
|
105
116
|
}), t;
|
|
106
117
|
}
|
|
107
118
|
// utilクラスを追加するか、styleにセットするかの分岐処理 @base
|
|
108
119
|
// 値が null, undefined, '', false の時はスキップ
|
|
109
|
-
setAttrs(
|
|
120
|
+
setAttrs(s, t, i = {}, e = "") {
|
|
110
121
|
if (t == null || t === "" || t === !1) return;
|
|
111
|
-
let a = `--${
|
|
112
|
-
if (e && (a = `--${
|
|
113
|
-
this.addUtil(`${
|
|
122
|
+
let a = `--${s}`, r = `-${String(i.utilKey || s)}`;
|
|
123
|
+
if (e && (a = `--${s}_${e}`, r += `_${e}`), typeof t == "string" && t.startsWith(":")) {
|
|
124
|
+
this.addUtil(`${r}:${t.replace(":", "")}`);
|
|
114
125
|
return;
|
|
115
126
|
}
|
|
116
127
|
if (!e) {
|
|
117
|
-
const { presets: y, tokenClass:
|
|
118
|
-
if (y &&
|
|
128
|
+
const { presets: y, tokenClass: j, utils: C, shorthands: g } = i;
|
|
129
|
+
if (y && b(y, t)) {
|
|
119
130
|
const f = typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
120
|
-
f && this.addUtil(`${
|
|
131
|
+
f && this.addUtil(`${r}:${f}`);
|
|
121
132
|
return;
|
|
122
133
|
}
|
|
123
|
-
if (
|
|
134
|
+
if (j && i.token && E(i.token, t)) {
|
|
124
135
|
const f = typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
125
|
-
f && this.addUtil(`${
|
|
136
|
+
f && this.addUtil(`${r}:${f}`);
|
|
126
137
|
return;
|
|
127
138
|
}
|
|
128
|
-
let
|
|
129
|
-
if (
|
|
130
|
-
this.addUtil(`${
|
|
139
|
+
let p = "";
|
|
140
|
+
if (C && typeof t == "string" && (p = P(C, t)), !p && g && typeof t == "string" && (p = P(g, t, !0)), p) {
|
|
141
|
+
this.addUtil(`${r}:${p}`);
|
|
131
142
|
return;
|
|
132
143
|
}
|
|
133
144
|
}
|
|
134
145
|
if (t === !0 || t === "-") {
|
|
135
|
-
this.addUtil(
|
|
146
|
+
this.addUtil(r);
|
|
136
147
|
return;
|
|
137
148
|
}
|
|
138
|
-
const { prop: l, isVar: d, alwaysVar:
|
|
149
|
+
const { prop: l, isVar: d, alwaysVar: c, token: h, bp: O } = i;
|
|
139
150
|
let n;
|
|
140
|
-
if (
|
|
151
|
+
if (h && (typeof t == "string" || typeof t == "number") ? n = u(t, h) : typeof t == "string" || typeof t == "number" ? n = t : n = JSON.stringify(t), !e) {
|
|
141
152
|
if (d) {
|
|
142
|
-
this.addStyle(`--${
|
|
153
|
+
this.addStyle(`--${s}`, n);
|
|
143
154
|
return;
|
|
144
|
-
} else if (!O && !
|
|
155
|
+
} else if (!O && !c) {
|
|
145
156
|
this.addStyle(l, n);
|
|
146
157
|
return;
|
|
147
158
|
}
|
|
148
159
|
}
|
|
149
|
-
this.addUtil(
|
|
160
|
+
this.addUtil(r), this.addStyle(a, n);
|
|
150
161
|
}
|
|
151
162
|
// setPassProps(passVars) {
|
|
152
163
|
// let dataList = [];
|
|
@@ -161,40 +172,40 @@ class A {
|
|
|
161
172
|
// this.addStyle(`--pass_${propName}`, value);
|
|
162
173
|
// });
|
|
163
174
|
// }
|
|
164
|
-
setHovProps(
|
|
165
|
-
|
|
175
|
+
setHovProps(s) {
|
|
176
|
+
s && (s === "-" || s === !0 ? this.addUtil("-hov") : typeof s == "string" ? k(s).forEach((t) => {
|
|
166
177
|
this.addUtil(`-hov:${t}`);
|
|
167
|
-
}) : typeof
|
|
168
|
-
const
|
|
169
|
-
if (!(
|
|
170
|
-
if (
|
|
178
|
+
}) : typeof s == "object" && Object.keys(s).forEach((t) => {
|
|
179
|
+
const i = s[t];
|
|
180
|
+
if (!(i == null || i === "" || i === !1)) {
|
|
181
|
+
if (i === "-" || i === !0)
|
|
171
182
|
this.addUtil(`-hov:${t}`);
|
|
172
183
|
else if (t === "class")
|
|
173
|
-
k(
|
|
184
|
+
k(i).forEach((e) => {
|
|
174
185
|
this.addUtil(`-hov:${e}`);
|
|
175
186
|
});
|
|
176
|
-
else if (typeof
|
|
177
|
-
const e =
|
|
187
|
+
else if (typeof i == "string" || typeof i == "number") {
|
|
188
|
+
const e = u(i, A(t));
|
|
178
189
|
this.addUtil(`-hov:${t}`), this.addStyle(`--hov-${t}`, e);
|
|
179
190
|
}
|
|
180
191
|
}
|
|
181
192
|
}));
|
|
182
193
|
}
|
|
183
194
|
}
|
|
184
|
-
function
|
|
195
|
+
function G(o) {
|
|
185
196
|
if (Object.keys(o).length === 0)
|
|
186
197
|
return {};
|
|
187
|
-
const { layout:
|
|
198
|
+
const { atomic: s, layout: t, ...i } = o, e = x(s, i), a = N(t, e), r = new $(a);
|
|
188
199
|
return {
|
|
189
|
-
...
|
|
190
|
-
className:
|
|
191
|
-
style:
|
|
200
|
+
...S({
|
|
201
|
+
className: r.className,
|
|
202
|
+
style: S(r.styles)
|
|
192
203
|
}),
|
|
193
|
-
...
|
|
204
|
+
...r.attrs
|
|
194
205
|
// data-* などHTMLの標準属性はそのまま渡す
|
|
195
206
|
};
|
|
196
207
|
}
|
|
197
208
|
export {
|
|
198
|
-
|
|
199
|
-
|
|
209
|
+
$ as LismPropsData,
|
|
210
|
+
G as default
|
|
200
211
|
};
|
package/dist/ui.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer lism-component{.c--accordion{--duration: var(--acc-duration, .25s)}.c--accordion_item{--_panel-h: 0px;--_icon-transform: rotate(0deg)}.c--accordion_item[data-opened]{--_icon-transform: rotate(90deg);--_panel-h: auto}.c--accordion_panel{height:var(--_panel-h);transition:height var(--duration)}[hidden]>.c--accordion_content{position:absolute}.c--accordion_icon{display:grid;width:1em;height:1em}.c--accordion_icon:before,.c--accordion_icon:after{content:"";display:block;grid-area:1 / 1;background-color:currentColor}.c--accordion_icon:before{width:.1em;height:100%;transition:transform var(--duration);transform:var(--_icon-transform)}.c--accordion_icon:after{height:.1em;width:100%}.c--accordion_button:focus-visible{outline:solid 2px currentColor;outline-color:revert;outline-offset:-3px}@media(prefers-reduced-motion:reduce){.c--accordion_item{--duration: 0s}}@media(scripting:none){.c--accordion_panel{height:auto!important;content-visibility:visible!important}.c--accordion_content{position:static!important}}}@layer lism-component{.c--details{--duration: var(--acc-duration, .25s);--_icon-scale: 1.1;--_icon-transform: rotate(0deg);--_content-gtr: 0fr}.c--details[open]{--_icon-transform: scaleY(-1);--_content-gtr: 1fr}.c--details_summary::-webkit-details-marker{display:none}.c--details_icon{--svg: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="1em" height="1em" fill="currentColor"><path d="M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"></path></svg>');display:inline-grid;background-color:currentColor;-webkit-mask:var(--svg) no-repeat center center / contain;mask:var(--svg) no-repeat center center / contain;scale:var(--_icon-scale);transition:transform var(--duration);transform:var(--_icon-transform)}.c--details::details-content{display:grid;grid-template-rows:var(--_content-gtr);transition-duration:var(--duration);transition-property:content-visibility,grid-template;transition-behavior:allow-discrete}.c--details_body{overflow:hidden}}@layer lism-component{.c--modal{--flow: 0;--duration: var(--modal-duration, .4s);width:100%;height:100%;max-width:100%;max-height:100%;overflow:unset;background:var(--backdrop-bg, rgb(0 0 0 / .6));transition-duration:var(--duration);transition-property:opacity}.c--modal::backdrop{background:none}.c--modal[open]{display:flex;flex-direction:column;justify-content:center}.c--modal_inner{--offset: 0 0;background-color:var(--base);transition:translate var(--duration);max-height:100%}.c--modal:not([data-is-open]){opacity:0}.c--modal:not([data-is-open])>.c--modal_inner{translate:var(--offset)}}@layer lism-component{.c--navMenu{--link-td: none;--hl: var(--hl--s);--_item-p: var(--s20);--focus-offset: -1px}.c--navMenu_nest{--_item-p: inherit}.c--navMenu_link{padding:var(--_item-p)}.c--navMenu_nest,.c--navMenu_item{--bdc: inherit}}@layer lism-component{.c--tabs{display:grid;grid:"list" "panel" / 100
|
|
1
|
+
@layer lism-component{.c--accordion{--duration: var(--acc-duration, .25s)}.c--accordion_item{--_panel-h: 0px;--_icon-transform: rotate(0deg)}.c--accordion_item[data-opened]{--_icon-transform: rotate(90deg);--_panel-h: auto}.c--accordion_panel{height:var(--_panel-h);transition:height var(--duration)}[hidden]>.c--accordion_content{position:absolute}.c--accordion_icon{display:grid;width:1em;height:1em}.c--accordion_icon:before,.c--accordion_icon:after{content:"";display:block;grid-area:1 / 1;background-color:currentColor}.c--accordion_icon:before{width:.1em;height:100%;transition:transform var(--duration);transform:var(--_icon-transform)}.c--accordion_icon:after{height:.1em;width:100%}.c--accordion_button:focus-visible{outline:solid 2px currentColor;outline-color:revert;outline-offset:-3px}@media(prefers-reduced-motion:reduce){.c--accordion_item{--duration: 0s}}@media(scripting:none){.c--accordion_panel{height:auto!important;content-visibility:visible!important}.c--accordion_content{position:static!important}}}@layer lism-component{.c--details{--duration: var(--acc-duration, .25s);--_icon-scale: 1.1;--_icon-transform: rotate(0deg);--_content-gtr: 0fr}.c--details[open]{--_icon-transform: scaleY(-1);--_content-gtr: 1fr}.c--details_summary::-webkit-details-marker{display:none}.c--details_icon{--svg: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="1em" height="1em" fill="currentColor"><path d="M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"></path></svg>');display:inline-grid;background-color:currentColor;-webkit-mask:var(--svg) no-repeat center center / contain;mask:var(--svg) no-repeat center center / contain;scale:var(--_icon-scale);transition:transform var(--duration);transform:var(--_icon-transform)}.c--details::details-content{display:grid;grid-template-rows:var(--_content-gtr);transition-duration:var(--duration);transition-property:content-visibility,grid-template;transition-behavior:allow-discrete}.c--details_body{overflow:hidden}}@layer lism-component{.c--modal{--flow: 0;--duration: var(--modal-duration, .4s);width:100%;height:100%;max-width:100%;max-height:100%;overflow:unset;background:var(--backdrop-bg, rgb(0 0 0 / .6));transition-duration:var(--duration);transition-property:opacity}.c--modal::backdrop{background:none}.c--modal[open]{display:flex;flex-direction:column;justify-content:center}.c--modal_inner{--offset: 0 0;background-color:var(--base);transition:translate var(--duration);max-height:100%}.c--modal:not([data-is-open]){opacity:0}.c--modal:not([data-is-open])>.c--modal_inner{translate:var(--offset)}}@layer lism-component{.c--navMenu{--link-td: none;--hl: var(--hl--s);--_item-p: var(--s20);--focus-offset: -1px}.c--navMenu_nest{--_item-p: inherit}.c--navMenu_link{padding:var(--_item-p)}.c--navMenu_nest,.c--navMenu_item{--bdc: inherit}}@layer lism-component{.c--tabs{display:grid;grid:"list" "panel" / 100%;gap:var(--s20)}.c--tabs_list{grid-area:list;display:flex;overflow-x:auto}.c--tabs_tab{color:var(--_notSelected, var(--text-2));background-color:var(--_isSelected, var(--base-2));padding:.25em .75em}.c--tabs_tab[aria-selected=true]{--_notSelected: }.c--tabs_tab[aria-selected=false]{--_isSelected: }.c--tabs_panel{grid-area:panel;width:100%}.c--tabs_panel:where([aria-hidden=true]){display:none}}@layer lism-component{.c--badge{--c: var(--base);--bgc: var(--text);--bdc: transparent;color:var(--c);background-color:var(--bgc);border:solid 1px var(--bdc)}.c--badge--outline{--c: var(--text);--bgc: transparent;--bdc: currentColor}}@layer lism-component{.c--button{--c: var(--base);--bgc: var(--text);--bdc: var(--bgc);color:var(--c);background-color:var(--bgc);border:solid 1px var(--bdc);gap:var(--s10);text-decoration:none;place-content:center;place-items:center}.c--button--outline{--c: var(--text);--bgc: transparent;--bdc: var(--c)}:where(.c--button)>.a--icon{scale:1.05}.c--button:where(.l--grid){grid-template-columns:minmax(1em,auto) 1fr minmax(1em,auto);justify-items:center}.c--button:where(.l--grid)>:not(.a--icon){grid-column:2}}@layer lism-component{.c--chat{--cbox-bgPct: 8%;grid-template-areas:"avatar name" "avatar body";grid-template-columns:auto 1fr;grid-template-rows:minmax(1.5rem,auto) auto;--_avator-size: clamp(48px, 32px + 5cqw, 64px);--_deco-size: calc(min(var(--_avator-size), 80px)/4 + .25rem) ;--_deco-mask: none;--_deco-t: 0;--_deco-scale: 1;--_deco-inset-x: 0;gap:0 calc(var(--_deco-size) + 1px)}.c--chat_avatar{grid-area:avatar;width:var(--_avator-size)}.c--chat_name{grid-area:name}.c--chat_body{grid-area:body}.c--chat_content{max-width:var(--sz--s)}.c--chat_deco{top:var(--_deco-t);inset-inline:var(--_deco-inset-x);width:var(--_deco-size);height:var(--_deco-size);scale:var(--_deco-scale);-webkit-mask:var(--_deco-mask) center / contain no-repeat;mask:var(--_deco-mask) center / contain no-repeat}.c--chat--speak{--_deco-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8"><path d="M8,8L8,8C7.4,4.8,5.4,2,2.6,0.4L2,0h6V8z"/></svg>')}[data-chat-dir=start]{--_deco-inset-x: auto calc(100% - 1px) }[data-chat-dir=end]{--_deco-scale: -1 1;--_deco-inset-x: calc(100% - 1px) auto;grid-template-areas:"name avatar" "body avatar";grid-template-columns:1fr auto}}.c--chat--speak[data-chat-dir=start]>div>.c--chat_content{border-start-start-radius:0}.c--chat--speak[data-chat-dir=end]>div>.c--chat_content{border-start-end-radius:0}@layer lism-component{.c--shapeDivider{--level: 0;--_inner-offset: 0px;--_inner-stretch: 1;--_flipX: 1;--_flipY: 1;height:clamp(calc(5px * var(--level)),calc(1cqw * var(--level)),calc(12px * var(--level)));overflow:visible}.c--shapeDivider:where([data-flip^=X]){--_flipX: -1}.c--shapeDivider:where([data-flip$=Y]){--_flipY: -1}.c--shapeDivider_inner{--offsetY: .5px;--offsetX: -.5px;height:100%;width:calc(100% + 1px);scale:calc(var(--_flipX) * var(--_inner-stretch)) var(--_flipY);translate:calc(var(--offsetX) + var(--_inner-offset)) calc(var(--offsetY) * var(--_flipY))}.c--shapeDivider_svg{display:block}:where([data-has-animation=true]) .c--shapeDivider_svg{transform-origin:100% 0;animation:lism--slideShape 12s infinite alternate linear}}@keyframes lism--slideShape{0%{transform:scaleX(4)}to{transform:scaleX(4) translate(75%)}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lism-css/ui",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "UI components for React and Astro, powered by Lism CSS.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "ddryo",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"url": "https://github.com/lism-css/lism-css/issues"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"lism-css": "0.13.
|
|
41
|
+
"lism-css": "0.13.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@storybook/react-vite": "^10.3.3",
|
|
@@ -82,7 +82,8 @@ export function getPanelProps({ lismClass, _contextID, accID = '__LISM_ACC_ID__'
|
|
|
82
82
|
|
|
83
83
|
export const defaultProps = {
|
|
84
84
|
icon: {
|
|
85
|
-
lismClass: 'c--accordion_icon
|
|
85
|
+
lismClass: 'c--accordion_icon',
|
|
86
|
+
atomic: 'icon',
|
|
86
87
|
as: 'span',
|
|
87
88
|
pi: 'center',
|
|
88
89
|
fxsh: '0',
|
|
@@ -20,13 +20,16 @@ export default function getAlertProps({ type = 'alert', keycolor, layout = 'flex
|
|
|
20
20
|
icon: _icon,
|
|
21
21
|
layout,
|
|
22
22
|
flow,
|
|
23
|
-
lismClass: 'c--alert
|
|
23
|
+
lismClass: 'c--alert',
|
|
24
|
+
util: 'cbox',
|
|
25
|
+
set: 'shadow',
|
|
24
26
|
keycolor: _color,
|
|
25
27
|
ai: 'center',
|
|
26
28
|
p: '15',
|
|
27
29
|
g: '15',
|
|
28
30
|
bd: true,
|
|
29
31
|
bdrs: '10',
|
|
32
|
+
bxsh: '10',
|
|
30
33
|
...props,
|
|
31
34
|
};
|
|
32
35
|
}
|
|
@@ -19,7 +19,9 @@ export default function getCalloutProps({ type = 'note', keycolor, icon, title,
|
|
|
19
19
|
icon: _icon,
|
|
20
20
|
title,
|
|
21
21
|
flow,
|
|
22
|
-
lismClass: 'c--callout
|
|
22
|
+
lismClass: 'c--callout',
|
|
23
|
+
util: 'cbox',
|
|
24
|
+
set: 'shadow',
|
|
23
25
|
keycolor: _keycolor,
|
|
24
26
|
p: '20',
|
|
25
27
|
g: '10',
|
|
@@ -33,8 +33,8 @@ const { 'data-chat-dir': direction, ...chatProps } = getChatProps(inputProps);
|
|
|
33
33
|
}
|
|
34
34
|
{name && <Lism {...defaultProps.name}>{name}</Lism>}
|
|
35
35
|
<Lism {...defaultProps.body}>
|
|
36
|
-
<Decorator {...defaultProps.deco}
|
|
37
|
-
<Flow {...defaultProps.content}
|
|
36
|
+
<Decorator {...defaultProps.deco} />
|
|
37
|
+
<Flow {...defaultProps.content} flow={flow} jslf={direction}>
|
|
38
38
|
<slot />
|
|
39
39
|
</Flow>
|
|
40
40
|
</Lism>
|
|
@@ -24,8 +24,8 @@ export default function Chat<T extends ElementType = 'div'>({ name, avatar, flow
|
|
|
24
24
|
)}
|
|
25
25
|
{name && <Lism {...defaultProps.name}>{name}</Lism>}
|
|
26
26
|
<Lism {...defaultProps.body}>
|
|
27
|
-
<Decorator {...defaultProps.deco}
|
|
28
|
-
<Flow {...defaultProps.content}
|
|
27
|
+
<Decorator {...defaultProps.deco} />
|
|
28
|
+
<Flow {...defaultProps.content} flow={flow} jslf={direction}>
|
|
29
29
|
{children}
|
|
30
30
|
</Flow>
|
|
31
31
|
</Lism>
|
|
@@ -30,7 +30,7 @@ export function getTitleProps({ set, ...props }: Record<string, unknown>) {
|
|
|
30
30
|
*/
|
|
31
31
|
export const defaultProps = {
|
|
32
32
|
summary: { lismClass: 'c--details_summary', layout: 'flex', g: '10', ai: 'center' },
|
|
33
|
-
icon: { lismClass: 'c--details_icon
|
|
33
|
+
icon: { lismClass: 'c--details_icon', atomic: 'icon', as: 'span', 'aria-hidden': 'true' },
|
|
34
34
|
body: { lismClass: 'c--details_body' },
|
|
35
35
|
content: { lismClass: 'c--details_content', layout: 'flow', flow: 's' },
|
|
36
36
|
} as const;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
.c--tabs {
|
|
3
3
|
display: grid;
|
|
4
4
|
grid: 'list' 'panel' / 100%;
|
|
5
|
+
gap: var(--s20);
|
|
5
6
|
}
|
|
6
7
|
.c--tabs_list {
|
|
7
8
|
grid-area: list;
|
|
@@ -9,24 +10,21 @@
|
|
|
9
10
|
overflow-x: auto;
|
|
10
11
|
}
|
|
11
12
|
.c--tabs_tab {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
13
|
+
color: var(--_notSelected, var(--text-2));
|
|
14
|
+
background-color: var(--_isSelected, var(--base-2));
|
|
15
|
+
padding: 0.25em 0.75em;
|
|
16
|
+
}
|
|
17
|
+
.c--tabs_tab[aria-selected='true'] {
|
|
18
|
+
--_notSelected: ;
|
|
19
|
+
}
|
|
20
|
+
.c--tabs_tab[aria-selected='false'] {
|
|
21
|
+
--_isSelected: ;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
23
|
.c--tabs_panel {
|
|
25
24
|
grid-area: panel;
|
|
26
25
|
width: 100%;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
26
|
+
}
|
|
27
|
+
.c--tabs_panel:where([aria-hidden='true']) {
|
|
28
|
+
display: none;
|
|
31
29
|
}
|
|
32
30
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import c from "../../../lib/helper/atts.js";
|
|
2
|
-
function d({ lismClass: e, size: s, clipPath: a, boxSizing: r, style: l, ...n }) {
|
|
3
|
-
const i = l ?? {};
|
|
4
|
-
a && (i.clipPath = a), r && (i.boxSizing = r);
|
|
5
|
-
const t = { ...n };
|
|
6
|
-
s && (t.ar = "1/1", t.w = s), t.style = i;
|
|
7
|
-
const o = {
|
|
8
|
-
lismClass: c(e, "a--decorator"),
|
|
9
|
-
"aria-hidden": "true"
|
|
10
|
-
};
|
|
11
|
-
return Object.assign(o, t);
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
d as default
|
|
15
|
-
};
|