@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.
@@ -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 a--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 c from "../../lism-css/dist/lib/helper/mergeSet.js";
3
- function u({ lismClass: o, allowMultiple: n, ...t }) {
4
- return t.lismClass = e(o, "c--accordion"), n && (t["data-allow-multiple"] = ""), t;
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: o, ...n }) {
7
- return n.lismClass = e(o, "c--accordion_item"), n;
6
+ function f({ lismClass: n, ...o }) {
7
+ return o.lismClass = e(n, "c--accordion_item"), o;
8
8
  }
9
- function m({ as: o = "div", role: n, lismClass: t, set: s, ...a }) {
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: o,
13
- set: c("plain", s),
14
- ...a
12
+ as: n,
13
+ set: a("plain", s),
14
+ ...c
15
15
  };
16
- return i.as === "div" && (i.role = n ?? "heading"), i;
16
+ return i.as === "div" && (i.role = o ?? "heading"), i;
17
17
  }
18
- function p({ set: o, ...n }) {
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: c("plain", o),
23
+ set: a("plain", n),
24
24
  g: "10",
25
25
  w: "100%",
26
26
  ai: "center",
27
27
  jc: "between",
28
- ...n
28
+ ...o
29
29
  };
30
30
  }
31
- function _({ lismClass: o, _contextID: n, accID: t = "__LISM_ACC_ID__", isOpen: s = !1, ...a }) {
31
+ function _({ lismClass: n, _contextID: o, accID: t = "__LISM_ACC_ID__", isOpen: s = !1, ...c }) {
32
32
  const i = {
33
- lismClass: e(o, "c--accordion_panel"),
34
- id: n || t,
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", ...a };
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 a--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 X({ children: t, ...r }) {
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
- X as AccordionItem,
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: c = "flex", icon: e, flow: l = "s", ...n }) {
3
- const r = o ? i[o] : null, s = e || r?.icon || "info", a = t || r?.color || "currentColor";
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: s,
6
- layout: c,
5
+ icon: n,
6
+ layout: e,
7
7
  flow: l,
8
- lismClass: "c--alert u--cbox",
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
- ...n
17
+ bxsh: "10",
18
+ ...s
16
19
  };
17
20
  }
18
21
  export {
@@ -12,6 +12,8 @@ export default function getCalloutProps({ type, keycolor, icon, title, flow, ...
12
12
  title: string | undefined;
13
13
  flow: string;
14
14
  lismClass: string;
15
+ util: string;
16
+ set: string;
15
17
  keycolor: string | null;
16
18
  p: string;
17
19
  g: string;
@@ -1,11 +1,13 @@
1
1
  import u from "./presets.js";
2
- function b({ type: o = "note", keycolor: l, icon: t, title: s, flow: n = "s", ...e }) {
3
- const c = o ? u[o] : null, r = t || c?.icon || "note", a = l || c?.color || null;
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 u--cbox set--shadow",
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";
@@ -22,10 +22,13 @@ const l = {
22
22
  },
23
23
  deco: {
24
24
  lismClass: "c--chat_deco",
25
+ util: "cbox",
26
+ isSkipFlow: !0,
25
27
  pos: "absolute"
26
28
  },
27
29
  content: {
28
30
  lismClass: "c--chat_content",
31
+ util: "cbox",
29
32
  bdrs: "30",
30
33
  p: "20",
31
34
  lh: "s"
@@ -1,22 +1,22 @@
1
- import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
- import f from "../../../lism-css/dist/components/atomic/Decorator/index.js";
3
- import n from "../../../lism-css/dist/components/layout/Flow/index.js";
4
- import h from "../../../lism-css/dist/components/layout/Frame/index.js";
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 m from "../../../lism-css/dist/components/Lism/index.js";
7
- import u, { defaultProps as r } from "../getProps.js";
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 N({ name: t, avatar: i, flow: s = "s", children: e, ...d }) {
10
- const { "data-chat-dir": c, ...p } = u(d);
11
- return /* @__PURE__ */ a(l, { "data-chat-dir": c, ...p, children: [
12
- i && /* @__PURE__ */ o(h, { ...r.avatar, children: /* @__PURE__ */ o("img", { src: i, alt: "", width: "60", height: "60", decoding: "async" }) }),
13
- t && /* @__PURE__ */ o(m, { ...r.name, children: t }),
14
- /* @__PURE__ */ a(m, { ...r.body, children: [
15
- /* @__PURE__ */ o(f, { ...r.deco, className: "u--cbox is--skipFlow" }),
16
- /* @__PURE__ */ o(n, { ...r.content, className: "u--cbox", flow: s, jslf: c, children: e })
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
- N as default
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 a--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 r = {
15
+ const c = {
16
16
  summary: { lismClass: "c--details_summary", layout: "flex", g: "10", ai: "center" },
17
- icon: { lismClass: "c--details_icon a--icon", as: "span", "aria-hidden": "true" },
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
- r as defaultProps,
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 "./getProps.js";
3
- import f from "../../Lism/index.js";
2
+ import t from "../../Lism/index.js";
4
3
  function e(r) {
5
- return /* @__PURE__ */ o(f, { ...t(r) });
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
- import h from "../../../lib/helper/atts.js";
3
- function x(m) {
4
- const a = {}, s = m.match(/<svg([^>]*?)>([\s\S]*?)<\/svg>/i);
5
- if (s) {
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 [, i, f] = o;
10
- if (i === "style") {
8
+ const [, n, f] = o;
9
+ if (n === "style") {
11
10
  const g = {};
12
- f.split(";").forEach((l) => {
13
- const [n, r] = l.split(":").map((t) => t.trim());
14
- n && r && (g[n] = r);
15
- }), a[i] = g;
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[i] = f;
16
+ a[n] = f;
18
17
  }
19
- return { svgProps: a, svgContent: e };
18
+ return { svgProps: a, svgContent: s };
20
19
  }
21
20
  return {};
22
21
  }
23
- function b({ lismClass: m, as: a, icon: s, label: c, exProps: e = {}, ...p }) {
24
- let o = a || "span", i = "";
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
- ...l
27
+ ...e
29
28
  } = p;
30
- let n = f, r = g;
31
- if (l.viewBox) {
29
+ let r = f, i = g;
30
+ if (e.viewBox) {
32
31
  o = "svg";
33
- const t = l.size;
34
- t && delete l.size, l.width || (e.width = t || "1em"), l.height || (e.height = t || "1em");
35
- } else if (l.src)
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 (s)
38
- if (typeof s == "string")
39
- if (s.startsWith("<svg")) {
36
+ else if (l)
37
+ if (typeof l == "string")
38
+ if (l.startsWith("<svg")) {
40
39
  o = "_SVG_";
41
- const { svgProps: t = {}, svgContent: u = "" } = x(s), { class: v, style: d, ...y } = t;
42
- r = h(r, v), n = { ...n, ...d }, e = { ...e, ...y, fill: "currentColor" }, i = u;
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[s] || null;
45
- t != null && (o = "_SVG_", e = { ...e, ...t });
43
+ const t = C[l] || null;
44
+ t != null && (o = "_SVG_", s = { ...s, ...t });
46
45
  }
47
- else if (typeof s == "object" && s.as) {
48
- const { as: t, ...u } = s;
49
- o = t, e = { ...e, ...u };
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 = s;
52
- return c ? (e["aria-label"] = c, e.role = "img") : e["aria-hidden"] = "true", l.lismClass = h(m, "a--icon", r), l.style = { ...n }, { Component: o, lismProps: l, exProps: e, content: i };
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
- b as default
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 i from "./helper/atts.js";
2
- import a from "./isTokenValue.js";
3
- import o from "./getMaybeCssVar.js";
4
- function w(l, t) {
5
- if (!l) return t;
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
- ...t,
8
- lismClass: i(t.lismClass, `l--${l}`)
9
+ ...l,
10
+ primitiveClass: o(l.primitiveClass, `l--${t}`)
9
11
  };
10
- return l === "flow" ? e(s) : l === "sideMain" ? u(s) : l === "fluidCols" ? f(s) : l === "switchCols" ? m(s) : s;
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: l, mainW: t, style: s, ...r }) {
14
+ function u({ sideW: t, mainW: l, style: s, ...i }) {
13
15
  const n = { ...s };
14
- return l != null && (n["--sideW"] = o(l, "sz")), t != null && (n["--mainW"] = o(t, "sz")), { ...r, style: n };
16
+ return t != null && (n["--sideW"] = e(t, "sz")), l != null && (n["--mainW"] = e(l, "sz")), { ...i, style: n };
15
17
  }
16
- function f({ autoFill: l, style: t, ...s }) {
17
- return l ? { ...s, style: { ...t, "--autoMode": "auto-fill" } } : { ...s, style: t };
18
+ function a({ autoFill: t, style: l, ...s }) {
19
+ return t ? { ...s, style: { ...l, "--autoMode": "auto-fill" } } : { ...s, style: l };
18
20
  }
19
- function e({ flow: l, style: t, ...s }) {
20
- return a("flow", l) ? s.lismClass = i(s.lismClass, `-flow:${l}`) : l && (s.lismClass = i(s.lismClass, "-flow:"), t = { ...t, "--flow": o(l, "space") }), { ...s, style: t };
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: l, style: t, ...s }) {
23
- return l ? { ...s, style: { ...t, "--breakSize": o(l, "sz") } } : { ...s, style: t };
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
- w as default
36
+ p as default
27
37
  };
@@ -1,152 +1,163 @@
1
- import { TRAITS as C, PROPS as u } from "../config/index.js";
2
- import j from "./getLayoutProps.js";
3
- import P from "./isPresetValue.js";
4
- import N from "./isTokenValue.js";
5
- import S from "./getUtilKey.js";
6
- import c from "./getMaybeCssVar.js";
7
- import x from "./getBpData.js";
8
- import E from "./helper/atts.js";
9
- import _ from "./helper/isEmptyObj.js";
10
- import U from "./helper/filterEmptyObj.js";
11
- import v from "./helper/mergeSet.js";
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 z = (o) => {
14
- const r = u[o];
15
- return r && r?.token || "";
14
+ const A = (o) => {
15
+ const s = m[o];
16
+ return s && s?.token || "";
16
17
  };
17
- function w(o, r) {
18
+ function T(o, s) {
18
19
  if (!o) return "";
19
- if (!r) return o;
20
- const t = o.split(" "), s = t[0];
21
- return [s, `${s}--${r}`, ...t.slice(1)].join(" ");
20
+ if (!s) return o;
21
+ const t = o.split(" ")[0];
22
+ return `${o} ${t}--${s}`;
22
23
  }
23
- class A {
24
+ class $ {
24
25
  // 最終出力 className
25
26
  className = "";
26
- // 出力順のためのクラスバケット: [lismClass] [lismTrait] [uClasses]
27
- // - lismClass : コンポーネント基底クラス + variant + l--{layout}(getLayoutProps 側で付与済み)
28
- // - lismTrait : is--* 等の trait クラス
29
- // - uClasses : set--* → u--* → -property の順で push される utility クラス
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
- lismTrait = [];
32
+ primitiveClass = [];
32
33
  uClasses = [];
33
34
  styles = {};
34
35
  attrs = {};
35
36
  _propConfig;
36
- constructor(r) {
37
- const { forwardedRef: t, class: s, className: e, lismClass: a, variant: i, style: l = {}, _propConfig: d = {}, ...p } = r;
38
- this.styles = { ...l }, this._propConfig = { ...d }, this.lismClass = w(a, i), _(p) || (this.attrs = { ...p }, this.analyzeProps()), t && (this.attrs.ref = t), this.className = this.buildClassName(e, s);
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] [lismTrait] [uClasses]
42
- buildClassName(r, t) {
43
- return E(r || t, this.lismClass, this.lismTrait, this.uClasses);
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(r, t) {
46
- const { className: s, preset: e, presetClass: a, customVar: i, tokenKey: l } = r;
47
- t === !0 ? this.lismTrait.push(s) : e && P(e, t) ? this.lismTrait.push(`${s} ${a}:${String(t)}`) : t && (this.lismTrait.push(s), l && i && this.addStyle(i, c(t, l)));
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 r = this.extractProp("set"), t = this.extractProp("util");
52
- v(void 0, r).forEach((s) => this.addUtil(`set--${s}`)), v(void 0, t).forEach((s) => this.addUtil(`u--${s}`)), Object.keys(this.attrs).forEach((s) => {
53
- if (Object.hasOwn(C, s)) {
54
- const e = this.extractProp(s), a = C[s];
55
- typeof a == "string" ? e && this.lismTrait.push(a) : this.analyzeTrait(a, e);
56
- } else if (Object.hasOwn(u, s)) {
57
- const e = this.attrs[s];
58
- delete this.attrs[s], this.analyzeLismProp(s, e);
59
- } else if (s === "hov") {
60
- const e = this.extractProp(s);
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 (s === "css") {
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(r, t) {
80
+ analyzeLismProp(s, t) {
70
81
  if (t == null) return;
71
- let s = u[r] || null;
72
- if (s === null) return;
73
- this._propConfig?.[r] && (s = Object.assign({}, s, this._propConfig[r]));
74
- const { base: e, ...a } = x(t);
75
- this.setAttrs(r, e, s), Object.keys(a).forEach((i) => {
76
- s && this.setAttrs(r, a[i], s, i);
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(r) {
80
- this.uClasses.push(r);
90
+ addUtil(s) {
91
+ this.uClasses.push(s);
81
92
  }
82
- addUtils(r) {
83
- this.uClasses.push(...r);
93
+ addUtils(s) {
94
+ this.uClasses.push(...s);
84
95
  }
85
96
  // addState(state) {
86
97
  // this.stateClasses.push(state);
87
98
  // }
88
- addStyle(r, t) {
89
- this.styles[r] = t;
99
+ addStyle(s, t) {
100
+ this.styles[s] = t;
90
101
  }
91
- addStyles(r) {
92
- this.styles = { ...this.styles, ...r };
102
+ addStyles(s) {
103
+ this.styles = { ...this.styles, ...s };
93
104
  }
94
- addAttrs(r) {
95
- this.addStyles(r.styles || {}), this.addUtils(r.utils || []);
105
+ addAttrs(s) {
106
+ this.addStyles(s.styles || {}), this.addUtils(s.utils || []);
96
107
  }
97
- extractProp(r) {
98
- const t = this.attrs[r];
99
- return this.attrs[r] === void 0 ? null : (delete this.attrs[r], t);
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(r) {
112
+ extractProps(s) {
102
113
  const t = {};
103
- return r.forEach((s) => {
104
- this.attrs[s] !== void 0 && (t[s] = this.attrs[s], delete this.attrs[s]);
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(r, t, s = {}, e = "") {
120
+ setAttrs(s, t, i = {}, e = "") {
110
121
  if (t == null || t === "" || t === !1) return;
111
- let a = `--${r}`, i = `-${String(s.utilKey || r)}`;
112
- if (e && (a = `--${r}_${e}`, i += `_${e}`), typeof t == "string" && t.startsWith(":")) {
113
- this.addUtil(`${i}:${t.replace(":", "")}`);
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: T, utils: g, shorthands: b } = s;
118
- if (y && P(y, t)) {
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(`${i}:${f}`);
131
+ f && this.addUtil(`${r}:${f}`);
121
132
  return;
122
133
  }
123
- if (T && s.token && N(s.token, t)) {
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(`${i}:${f}`);
136
+ f && this.addUtil(`${r}:${f}`);
126
137
  return;
127
138
  }
128
- let h = "";
129
- if (g && typeof t == "string" && (h = S(g, t)), !h && b && typeof t == "string" && (h = S(b, t, !0)), h) {
130
- this.addUtil(`${i}:${h}`);
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(i);
146
+ this.addUtil(r);
136
147
  return;
137
148
  }
138
- const { prop: l, isVar: d, alwaysVar: p, token: m, bp: O } = s;
149
+ const { prop: l, isVar: d, alwaysVar: c, token: h, bp: O } = i;
139
150
  let n;
140
- if (m && (typeof t == "string" || typeof t == "number") ? n = c(t, m) : typeof t == "string" || typeof t == "number" ? n = t : n = JSON.stringify(t), !e) {
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(`--${r}`, n);
153
+ this.addStyle(`--${s}`, n);
143
154
  return;
144
- } else if (!O && !p) {
155
+ } else if (!O && !c) {
145
156
  this.addStyle(l, n);
146
157
  return;
147
158
  }
148
159
  }
149
- this.addUtil(i), this.addStyle(a, n);
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(r) {
165
- r && (r === "-" || r === !0 ? this.addUtil("-hov") : typeof r == "string" ? k(r).forEach((t) => {
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 r == "object" && Object.keys(r).forEach((t) => {
168
- const s = r[t];
169
- if (!(s == null || s === "" || s === !1)) {
170
- if (s === "-" || s === !0)
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(s).forEach((e) => {
184
+ k(i).forEach((e) => {
174
185
  this.addUtil(`-hov:${e}`);
175
186
  });
176
- else if (typeof s == "string" || typeof s == "number") {
177
- const e = c(s, z(t));
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 B(o) {
195
+ function G(o) {
185
196
  if (Object.keys(o).length === 0)
186
197
  return {};
187
- const { layout: r, ...t } = o, s = new A(j(r, t));
198
+ const { atomic: s, layout: t, ...i } = o, e = x(s, i), a = N(t, e), r = new $(a);
188
199
  return {
189
- ...U({
190
- className: s.className,
191
- style: U(s.styles)
200
+ ...S({
201
+ className: r.className,
202
+ style: S(r.styles)
192
203
  }),
193
- ...s.attrs
204
+ ...r.attrs
194
205
  // data-* などHTMLの標準属性はそのまま渡す
195
206
  };
196
207
  }
197
208
  export {
198
- A as LismPropsData,
199
- B as default
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%}.c--tabs_list{grid-area:list;display:flex;overflow-x:auto}.c--tabs_tab[aria-selected=true]{--_notSelected: }.c--tabs_tab[aria-selected=false]{--_isSelected: }:where(.c--tabs_tab){color:var(--_notSelected, var(--text-2))}.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%)}}
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.0",
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.0"
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 a--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 u--cbox',
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 u--cbox set--shadow',
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} class="u--cbox is--skipFlow" />
37
- <Flow {...defaultProps.content} class="u--cbox" flow={flow} jslf={direction}>
36
+ <Decorator {...defaultProps.deco} />
37
+ <Flow {...defaultProps.content} flow={flow} jslf={direction}>
38
38
  <slot />
39
39
  </Flow>
40
40
  </Lism>
@@ -26,10 +26,13 @@ export const defaultProps = {
26
26
  },
27
27
  deco: {
28
28
  lismClass: 'c--chat_deco',
29
+ util: 'cbox',
30
+ isSkipFlow: true,
29
31
  pos: 'absolute',
30
32
  },
31
33
  content: {
32
34
  lismClass: 'c--chat_content',
35
+ util: 'cbox',
33
36
  bdrs: '30',
34
37
  p: '20',
35
38
  lh: 's',
@@ -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} className="u--cbox is--skipFlow" />
28
- <Flow {...defaultProps.content} className="u--cbox" flow={flow} jslf={direction}>
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 a--icon', as: 'span', 'aria-hidden': 'true' },
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
- &[aria-selected='true'] {
13
- --_notSelected: ;
14
- }
15
- &[aria-selected='false'] {
16
- --_isSelected: ;
17
- }
18
- /* 非アクティブの時、薄いカラーに */
19
- :where(&) {
20
- color: var(--_notSelected, var(--text-2));
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
- &:where([aria-hidden='true']) {
29
- display: none;
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
- };