@lism-css/ui 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,12 +26,12 @@ export declare function getRootProps({ lismClass, allowMultiple, ...props }: Acc
26
26
  export declare function getItemProps({ lismClass, ...props }: AccordionItemProps): {
27
27
  [key: string]: unknown;
28
28
  };
29
- export declare function getHeadingProps({ as, role, lismClass, set, unset, ...props }: AccordionHeadingProps): {
29
+ export declare function getHeadingProps({ as, role, lismClass, set, ...props }: AccordionHeadingProps): {
30
30
  lismClass: string;
31
31
  as: string;
32
32
  set: string[];
33
33
  };
34
- export declare function getButtonProps({ set, unset, ...props }: Record<string, unknown>): {
34
+ export declare function getButtonProps({ set, ...props }: Record<string, unknown>): {
35
35
  lismClass: string;
36
36
  as: string;
37
37
  layout: string;
@@ -1,42 +1,42 @@
1
1
  import e from "../../lism-css/dist/lib/helper/atts.js";
2
- import r from "../../lism-css/dist/lib/helper/mergeSet.js";
2
+ import c from "../../lism-css/dist/lib/helper/mergeSet.js";
3
3
  function u({ lismClass: o, allowMultiple: n, ...t }) {
4
4
  return t.lismClass = e(o, "c--accordion"), n && (t["data-allow-multiple"] = ""), t;
5
5
  }
6
6
  function f({ lismClass: o, ...n }) {
7
7
  return n.lismClass = e(o, "c--accordion_item"), n;
8
8
  }
9
- function m({ as: o = "div", role: n, lismClass: t, set: s, unset: a, ...c }) {
9
+ function m({ as: o = "div", role: n, lismClass: t, set: s, ...a }) {
10
10
  const i = {
11
11
  lismClass: e(t, "c--accordion_heading"),
12
12
  as: o,
13
- set: r("plain", s, a),
14
- ...c
13
+ set: c("plain", s),
14
+ ...a
15
15
  };
16
16
  return i.as === "div" && (i.role = n ?? "heading"), i;
17
17
  }
18
- function p({ set: o, unset: n, ...t }) {
18
+ function p({ set: o, ...n }) {
19
19
  return {
20
20
  lismClass: "c--accordion_button",
21
21
  as: "button",
22
22
  layout: "flex",
23
- set: r("plain", o, n),
23
+ set: c("plain", o),
24
24
  g: "10",
25
25
  w: "100%",
26
26
  ai: "center",
27
27
  jc: "between",
28
- ...t
28
+ ...n
29
29
  };
30
30
  }
31
31
  function _({ lismClass: o, _contextID: n, accID: t = "__LISM_ACC_ID__", isOpen: s = !1, ...a }) {
32
- const c = {
32
+ const i = {
33
33
  lismClass: e(o, "c--accordion_panel"),
34
34
  id: n || t,
35
35
  hidden: s ? void 0 : "until-found",
36
36
  pos: "relative",
37
37
  ov: "hidden"
38
- }, i = { lismClass: "c--accordion_content", layout: "flow", ...a };
39
- return { panelProps: c, contentProps: i };
38
+ }, r = { lismClass: "c--accordion_content", layout: "flow", ...a };
39
+ return { panelProps: i, contentProps: r };
40
40
  }
41
41
  const P = {
42
42
  icon: {
@@ -9,11 +9,11 @@ import { setEvent as A } from "../setAccordion.js";
9
9
  import h from "./AccIcon.js";
10
10
  /* empty css */
11
11
  const i = d(null);
12
- function Q({ children: t, ...r }) {
12
+ function S({ children: t, ...r }) {
13
13
  const o = _(r);
14
14
  return /* @__PURE__ */ n(P, { ...o, children: t });
15
15
  }
16
- function S({ children: t, ...r }) {
16
+ function X({ children: t, ...r }) {
17
17
  const o = p(null), e = f();
18
18
  m(() => {
19
19
  if (o.current)
@@ -38,8 +38,8 @@ 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
- S as AccordionItem,
42
- Q as AccordionRoot,
41
+ X as AccordionItem,
42
+ S as AccordionRoot,
43
43
  b as Button,
44
44
  $ as Heading,
45
45
  k as Panel
@@ -7,7 +7,7 @@ export type DetailsProps = {
7
7
  * Detailsコンポーネントのルート要素用プロパティを生成
8
8
  */
9
9
  export declare function getDetailsProps({ lismClass, ...props }: DetailsProps): LismProps;
10
- export declare function getTitleProps({ set, unset, ...props }: Record<string, unknown>): {
10
+ export declare function getTitleProps({ set, ...props }: Record<string, unknown>): {
11
11
  lismClass: string;
12
12
  as: string;
13
13
  fx: string;
@@ -1,25 +1,25 @@
1
- import a from "../../lism-css/dist/lib/helper/atts.js";
2
- import i from "../../lism-css/dist/lib/helper/mergeSet.js";
3
- function n({ lismClass: t, ...s }) {
4
- return s.lismClass = a(t, "c--details"), s;
1
+ import l from "../../lism-css/dist/lib/helper/atts.js";
2
+ import a from "../../lism-css/dist/lib/helper/mergeSet.js";
3
+ function o({ lismClass: t, ...s }) {
4
+ return s.lismClass = l(t, "c--details"), s;
5
5
  }
6
- function r({ set: t, unset: s, ...l }) {
6
+ function n({ set: t, ...s }) {
7
7
  return {
8
8
  lismClass: "c--details_title",
9
9
  as: "span",
10
10
  fx: "1",
11
- set: i("plain", t, s),
12
- ...l
11
+ set: a("plain", t),
12
+ ...s
13
13
  };
14
14
  }
15
- const c = {
15
+ const r = {
16
16
  summary: { lismClass: "c--details_summary", layout: "flex", g: "10", ai: "center" },
17
17
  icon: { lismClass: "c--details_icon a--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
- c as defaultProps,
23
- n as getDetailsProps,
24
- r as getTitleProps
22
+ r as defaultProps,
23
+ o as getDetailsProps,
24
+ n as getTitleProps
25
25
  };
@@ -1,7 +1,6 @@
1
1
  export type ModalRootProps = {
2
2
  lismClass?: string;
3
3
  set?: string;
4
- unset?: string;
5
4
  duration?: string;
6
5
  style?: Record<string, string>;
7
6
  [key: string]: unknown;
@@ -12,7 +11,7 @@ export type ModalInnerProps = {
12
11
  style?: Record<string, string>;
13
12
  [key: string]: unknown;
14
13
  };
15
- export declare function getProps({ lismClass, set, unset, duration, style, ...props }: ModalRootProps): {
14
+ export declare function getProps({ lismClass, set, duration, style, ...props }: ModalRootProps): {
16
15
  style: Record<string, string>;
17
16
  lismClass: string;
18
17
  set: string[];
@@ -22,13 +21,13 @@ export declare function getInnerProps({ lismClass, offset, style, ...props }: Mo
22
21
  lismClass: string;
23
22
  style: Record<string, string>;
24
23
  };
25
- export declare function getOpenBtnProps({ set, unset, ...props }: Record<string, unknown>): {
24
+ export declare function getOpenBtnProps({ set, ...props }: Record<string, unknown>): {
26
25
  as: string;
27
26
  set: string[];
28
27
  hov: string;
29
28
  d: string;
30
29
  };
31
- export declare function getCloseBtnProps({ set, unset, ...props }: Record<string, unknown>): {
30
+ export declare function getCloseBtnProps({ set, ...props }: Record<string, unknown>): {
32
31
  as: string;
33
32
  set: string[];
34
33
  hov: string;
@@ -1,44 +1,44 @@
1
- import i from "../../lism-css/dist/lib/helper/atts.js";
1
+ import e from "../../lism-css/dist/lib/helper/atts.js";
2
2
  import r from "../../lism-css/dist/lib/helper/mergeSet.js";
3
- function f({ lismClass: t = "", set: n, unset: o, duration: s, style: e = {}, ...l }) {
4
- const a = {
5
- lismClass: i(t, "c--modal"),
6
- set: r("plain", n, o)
3
+ function f({ lismClass: n = "", set: o, duration: t, style: s = {}, ...i }) {
4
+ const l = {
5
+ lismClass: e(n, "c--modal"),
6
+ set: r("plain", o)
7
7
  };
8
- return s && (e["--duration"] = s), { as: "dialog", ...a, style: e, ...l };
8
+ return t && (s["--duration"] = t), { as: "dialog", ...l, style: s, ...i };
9
9
  }
10
- function m({ lismClass: t = "", offset: n, style: o = {}, ...s }) {
11
- return n && (o["--offset"] = n), {
12
- lismClass: i(t, "c--modal_inner"),
13
- style: o,
10
+ function u({ lismClass: n = "", offset: o, style: t = {}, ...s }) {
11
+ return o && (t["--offset"] = o), {
12
+ lismClass: e(n, "c--modal_inner"),
13
+ style: t,
14
14
  ...s
15
15
  };
16
16
  }
17
- function c({ set: t, unset: n, ...o }) {
17
+ function m({ set: n, ...o }) {
18
18
  return {
19
19
  as: "button",
20
- set: r("plain", t, n),
20
+ set: r("plain", n),
21
21
  hov: "o",
22
22
  d: "inline-flex",
23
23
  ...o
24
24
  };
25
25
  }
26
- function d({ set: t, unset: n, ...o }) {
26
+ function c({ set: n, ...o }) {
27
27
  return {
28
28
  as: "button",
29
- set: r("plain", t, n),
29
+ set: r("plain", n),
30
30
  hov: "o",
31
31
  d: "inline-flex",
32
32
  ...o
33
33
  };
34
34
  }
35
- const P = {
35
+ const d = {
36
36
  body: { lismClass: "c--modal_body" }
37
37
  };
38
38
  export {
39
- P as defaultProps,
40
- d as getCloseBtnProps,
41
- m as getInnerProps,
42
- c as getOpenBtnProps,
39
+ d as defaultProps,
40
+ c as getCloseBtnProps,
41
+ u as getInnerProps,
42
+ m as getOpenBtnProps,
43
43
  f as getProps
44
44
  };
@@ -5,7 +5,7 @@ type TabsProps = {
5
5
  export default function getTabsProps({ lismClass, ...props }: TabsProps): {
6
6
  lismClass: string;
7
7
  };
8
- export declare function getTabProps({ set, unset, ...props }: Record<string, unknown>): {
8
+ export declare function getTabProps({ set, ...props }: Record<string, unknown>): {
9
9
  as: string;
10
10
  lismClass: string;
11
11
  set: string[];
@@ -1,20 +1,20 @@
1
- import r from "../../lism-css/dist/lib/helper/atts.js";
1
+ import a from "../../lism-css/dist/lib/helper/atts.js";
2
2
  import o from "../../lism-css/dist/lib/helper/mergeSet.js";
3
- function i({ lismClass: t, ...s }) {
3
+ function e({ lismClass: t, ...s }) {
4
4
  return {
5
- lismClass: r(t, "c--tabs"),
5
+ lismClass: a(t, "c--tabs"),
6
6
  ...s
7
7
  };
8
8
  }
9
- function l({ set: t, unset: s, ...a }) {
9
+ function i({ set: t, ...s }) {
10
10
  return {
11
11
  as: "button",
12
12
  lismClass: "c--tabs_tab",
13
- set: o("plain", t, s),
14
- ...a
13
+ set: o("plain", t),
14
+ ...s
15
15
  };
16
16
  }
17
17
  export {
18
- i as default,
19
- l as getTabProps
18
+ e as default,
19
+ i as getTabProps
20
20
  };
@@ -1,11 +1,11 @@
1
1
  import o from "./defaults/tokens.js";
2
- import t from "./defaults/props.js";
3
- import r from "./defaults/states.js";
4
- const e = {
2
+ import r from "./defaults/props.js";
3
+ import t from "./defaults/traits.js";
4
+ const s = {
5
5
  tokens: o,
6
- props: t,
7
- states: r
6
+ props: r,
7
+ traits: t
8
8
  };
9
9
  export {
10
- e as default
10
+ s as default
11
11
  };
@@ -1,4 +1,4 @@
1
- const s = {
1
+ const i = {
2
2
  isContainer: "is--container",
3
3
  isWrapper: {
4
4
  className: "is--wrapper",
@@ -8,11 +8,12 @@ const s = {
8
8
  tokenKey: "sz"
9
9
  },
10
10
  isLayer: "is--layer",
11
- isLinkBox: "is--linkBox",
11
+ isBoxLink: "is--boxLink",
12
+ isCoverLink: "is--coverLink",
12
13
  isSide: "is--side",
13
14
  isSkipFlow: "is--skipFlow",
14
15
  isVertical: "is--vertical"
15
16
  };
16
17
  export {
17
- s as default
18
+ i as default
18
19
  };
@@ -1,17 +1,17 @@
1
1
  import r from "./default-config.js";
2
2
  import a from "lism-css/config.js";
3
- import { objDeepMerge as e, arrayConvertToSet as t } from "./helper.js";
4
- let s = e(r, a);
5
- typeof window < "u" && window._LISM_CSS_CONFIG_ && (s = e(s, window._LISM_CSS_CONFIG_));
6
- const S = s, { tokens: o, props: _, states: l } = S, p = {
3
+ import { objDeepMerge as s, arrayConvertToSet as t } from "./helper.js";
4
+ let e = s(r, a);
5
+ typeof window < "u" && window._LISM_CSS_CONFIG_ && (e = s(e, window._LISM_CSS_CONFIG_));
6
+ const S = e, { tokens: o, props: _, traits: l } = S, p = {
7
7
  color: [...o.c.values, ...o.palette.values],
8
8
  ...o
9
- }, c = t(structuredClone(p)), i = t(structuredClone(_)), I = l, m = ["sm", "md", "lg", "xl"], O = ["base", ...m];
9
+ }, u = t(structuredClone(p)), I = t(structuredClone(_)), c = l, i = ["sm", "md", "lg", "xl"], O = ["base", ...i];
10
10
  export {
11
- m as BREAK_POINTS,
11
+ i as BREAK_POINTS,
12
12
  O as BREAK_POINTS_ALL,
13
13
  S as CONFIG,
14
- i as PROPS,
15
- I as STATES,
16
- c as TOKENS
14
+ I as PROPS,
15
+ u as TOKENS,
16
+ c as TRAITS
17
17
  };
@@ -1,123 +1,133 @@
1
- import { STATES as b, PROPS as S } from "../config/index.js";
1
+ import { TRAITS as C, PROPS as u } from "../config/index.js";
2
2
  import j from "./getLayoutProps.js";
3
- import U from "./isPresetValue.js";
4
- import x from "./isTokenValue.js";
5
- import v from "./getUtilKey.js";
6
- import m from "./getMaybeCssVar.js";
7
- import E from "./getBpData.js";
8
- import z from "./helper/atts.js";
9
- import N from "./helper/isEmptyObj.js";
10
- import C from "./helper/filterEmptyObj.js";
11
- import _ from "./helper/mergeSet.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";
12
12
  import k from "./helper/splitWithComma.js";
13
- const A = (n) => {
14
- const e = S[n];
15
- return e && e?.token || "";
13
+ const z = (o) => {
14
+ const r = u[o];
15
+ return r && r?.token || "";
16
16
  };
17
- class w {
18
- // propList = {};
17
+ function w(o, r) {
18
+ 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(" ");
22
+ }
23
+ class A {
24
+ // 最終出力 className
19
25
  className = "";
26
+ // 出力順のためのクラスバケット: [lismClass] [lismTrait] [uClasses]
27
+ // - lismClass : コンポーネント基底クラス + variant + l--{layout}(getLayoutProps 側で付与済み)
28
+ // - lismTrait : is--* 等の trait クラス
29
+ // - uClasses : set--* → u--* → -property の順で push される utility クラス
30
+ lismClass = "";
31
+ lismTrait = [];
20
32
  uClasses = [];
21
- lismState = [];
22
33
  styles = {};
23
34
  attrs = {};
24
35
  _propConfig;
25
- constructor(e) {
26
- const { forwardedRef: t, class: s, className: r, lismClass: o, variant: i, style: l = {}, _propConfig: y = {}, ...c } = e;
27
- this.styles = { ...l }, this._propConfig = { ...y };
28
- let h = o || "";
29
- if (i && o) {
30
- const d = o.split(" "), a = d[0], u = `${a}--${i}`;
31
- h = [a, u, ...d.slice(1)].join(" ");
32
- }
33
- N(c) || (this.attrs = { ...c }, this.analyzeProps()), t && (this.attrs.ref = t), this.className = z(r || s, h, this.lismState, this.uClasses);
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);
34
39
  }
35
- analyzeState(e, t) {
36
- const { className: s, preset: r, presetClass: o, customVar: i, tokenKey: l } = e;
37
- t === !0 ? this.lismState.push(s) : r && U(r, t) ? this.lismState.push(`${s} ${o}:${String(t)}`) : t && (this.lismState.push(s), l && i && this.addStyle(i, m(t, l)));
40
+ // 最終クラス文字列の組み立て(出力順の唯一の確定地点)
41
+ // 出力順: [user/astro className] [lismClass] [lismTrait] [uClasses]
42
+ buildClassName(r, t) {
43
+ return E(r || t, this.lismClass, this.lismTrait, this.uClasses);
44
+ }
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)));
38
48
  }
39
49
  // prop解析
40
50
  analyzeProps() {
41
- const e = this.extractProp("set"), t = this.extractProp("unset");
42
- Object.keys(this.attrs).forEach((s) => {
43
- if (Object.hasOwn(b, s)) {
44
- const r = this.extractProp(s), o = b[s];
45
- typeof o == "string" ? r && this.lismState.push(o) : this.analyzeState(o, r);
46
- } else if (Object.hasOwn(S, s)) {
47
- const r = this.attrs[s];
48
- delete this.attrs[s], this.analyzeLismProp(s, r);
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);
49
59
  } else if (s === "hov") {
50
- const r = this.extractProp(s);
51
- this.setHovProps(r);
60
+ const e = this.extractProp(s);
61
+ this.setHovProps(e);
52
62
  } else if (s === "css") {
53
- const r = this.extractProp("css");
54
- this.addStyles(r);
63
+ const e = this.extractProp("css");
64
+ this.addStyles(e);
55
65
  }
56
- }), _(void 0, e, t).forEach((s) => this.lismState.push(`set--${s}`));
66
+ });
57
67
  }
58
68
  // Lism Prop 解析
59
- analyzeLismProp(e, t) {
69
+ analyzeLismProp(r, t) {
60
70
  if (t == null) return;
61
- let s = S[e] || null;
71
+ let s = u[r] || null;
62
72
  if (s === null) return;
63
- this._propConfig?.[e] && (s = Object.assign({}, s, this._propConfig[e]));
64
- const { base: r, ...o } = E(t);
65
- this.setAttrs(e, r, s), Object.keys(o).forEach((i) => {
66
- s && this.setAttrs(e, o[i], s, i);
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);
67
77
  });
68
78
  }
69
- addUtil(e) {
70
- this.uClasses.push(e);
79
+ addUtil(r) {
80
+ this.uClasses.push(r);
71
81
  }
72
- addUtils(e) {
73
- this.uClasses.push(...e);
82
+ addUtils(r) {
83
+ this.uClasses.push(...r);
74
84
  }
75
85
  // addState(state) {
76
86
  // this.stateClasses.push(state);
77
87
  // }
78
- addStyle(e, t) {
79
- this.styles[e] = t;
88
+ addStyle(r, t) {
89
+ this.styles[r] = t;
80
90
  }
81
- addStyles(e) {
82
- this.styles = { ...this.styles, ...e };
91
+ addStyles(r) {
92
+ this.styles = { ...this.styles, ...r };
83
93
  }
84
- addAttrs(e) {
85
- this.addStyles(e.styles || {}), this.addUtils(e.utils || []);
94
+ addAttrs(r) {
95
+ this.addStyles(r.styles || {}), this.addUtils(r.utils || []);
86
96
  }
87
- extractProp(e) {
88
- const t = this.attrs[e];
89
- return this.attrs[e] === void 0 ? null : (delete this.attrs[e], t);
97
+ extractProp(r) {
98
+ const t = this.attrs[r];
99
+ return this.attrs[r] === void 0 ? null : (delete this.attrs[r], t);
90
100
  }
91
- extractProps(e) {
101
+ extractProps(r) {
92
102
  const t = {};
93
- return e.forEach((s) => {
103
+ return r.forEach((s) => {
94
104
  this.attrs[s] !== void 0 && (t[s] = this.attrs[s], delete this.attrs[s]);
95
105
  }), t;
96
106
  }
97
107
  // utilクラスを追加するか、styleにセットするかの分岐処理 @base
98
108
  // 値が null, undefined, '', false の時はスキップ
99
- setAttrs(e, t, s = {}, r = "") {
109
+ setAttrs(r, t, s = {}, e = "") {
100
110
  if (t == null || t === "" || t === !1) return;
101
- let o = `--${e}`, i = `-${String(s.utilKey || e)}`;
102
- if (r && (o = `--${e}_${r}`, i += `_${r}`), typeof t == "string" && t.startsWith(":")) {
111
+ let a = `--${r}`, i = `-${String(s.utilKey || r)}`;
112
+ if (e && (a = `--${r}_${e}`, i += `_${e}`), typeof t == "string" && t.startsWith(":")) {
103
113
  this.addUtil(`${i}:${t.replace(":", "")}`);
104
114
  return;
105
115
  }
106
- if (!r) {
107
- const { presets: u, tokenClass: O, utils: g, shorthands: P } = s;
108
- if (u && U(u, t)) {
109
- const p = typeof t == "string" || typeof t == "number" ? String(t) : "";
110
- p && this.addUtil(`${i}:${p}`);
116
+ if (!e) {
117
+ const { presets: y, tokenClass: T, utils: g, shorthands: b } = s;
118
+ if (y && P(y, t)) {
119
+ const f = typeof t == "string" || typeof t == "number" ? String(t) : "";
120
+ f && this.addUtil(`${i}:${f}`);
111
121
  return;
112
122
  }
113
- if (O && s.token && x(s.token, t)) {
114
- const p = typeof t == "string" || typeof t == "number" ? String(t) : "";
115
- p && this.addUtil(`${i}:${p}`);
123
+ if (T && s.token && N(s.token, t)) {
124
+ const f = typeof t == "string" || typeof t == "number" ? String(t) : "";
125
+ f && this.addUtil(`${i}:${f}`);
116
126
  return;
117
127
  }
118
- let f = "";
119
- if (g && typeof t == "string" && (f = v(g, t)), !f && P && typeof t == "string" && (f = v(P, t, !0)), f) {
120
- this.addUtil(`${i}:${f}`);
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}`);
121
131
  return;
122
132
  }
123
133
  }
@@ -125,18 +135,18 @@ class w {
125
135
  this.addUtil(i);
126
136
  return;
127
137
  }
128
- const { prop: l, isVar: y, alwaysVar: c, token: h, bp: d } = s;
129
- let a;
130
- if (h && (typeof t == "string" || typeof t == "number") ? a = m(t, h) : typeof t == "string" || typeof t == "number" ? a = t : a = JSON.stringify(t), !r) {
131
- if (y) {
132
- this.addStyle(`--${e}`, a);
138
+ const { prop: l, isVar: d, alwaysVar: p, token: m, bp: O } = s;
139
+ 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) {
141
+ if (d) {
142
+ this.addStyle(`--${r}`, n);
133
143
  return;
134
- } else if (!d && !c) {
135
- this.addStyle(l, a);
144
+ } else if (!O && !p) {
145
+ this.addStyle(l, n);
136
146
  return;
137
147
  }
138
148
  }
139
- this.addUtil(i), this.addStyle(o, a);
149
+ this.addUtil(i), this.addStyle(a, n);
140
150
  }
141
151
  // setPassProps(passVars) {
142
152
  // let dataList = [];
@@ -151,40 +161,40 @@ class w {
151
161
  // this.addStyle(`--pass_${propName}`, value);
152
162
  // });
153
163
  // }
154
- setHovProps(e) {
155
- e && (e === "-" || e === !0 ? this.addUtil("-hov") : typeof e == "string" ? k(e).forEach((t) => {
164
+ setHovProps(r) {
165
+ r && (r === "-" || r === !0 ? this.addUtil("-hov") : typeof r == "string" ? k(r).forEach((t) => {
156
166
  this.addUtil(`-hov:${t}`);
157
- }) : typeof e == "object" && Object.keys(e).forEach((t) => {
158
- const s = e[t];
167
+ }) : typeof r == "object" && Object.keys(r).forEach((t) => {
168
+ const s = r[t];
159
169
  if (!(s == null || s === "" || s === !1)) {
160
170
  if (s === "-" || s === !0)
161
171
  this.addUtil(`-hov:${t}`);
162
172
  else if (t === "class")
163
- k(s).forEach((r) => {
164
- this.addUtil(`-hov:${r}`);
173
+ k(s).forEach((e) => {
174
+ this.addUtil(`-hov:${e}`);
165
175
  });
166
176
  else if (typeof s == "string" || typeof s == "number") {
167
- const r = m(s, A(t));
168
- this.addUtil(`-hov:${t}`), this.addStyle(`--hov-${t}`, r);
177
+ const e = c(s, z(t));
178
+ this.addUtil(`-hov:${t}`), this.addStyle(`--hov-${t}`, e);
169
179
  }
170
180
  }
171
181
  }));
172
182
  }
173
183
  }
174
- function B(n) {
175
- if (Object.keys(n).length === 0)
184
+ function B(o) {
185
+ if (Object.keys(o).length === 0)
176
186
  return {};
177
- const { layout: e, ...t } = n, s = new w(j(e, t));
187
+ const { layout: r, ...t } = o, s = new A(j(r, t));
178
188
  return {
179
- ...C({
189
+ ...U({
180
190
  className: s.className,
181
- style: C(s.styles)
191
+ style: U(s.styles)
182
192
  }),
183
193
  ...s.attrs
184
194
  // data-* などHTMLの標準属性はそのまま渡す
185
195
  };
186
196
  }
187
197
  export {
188
- w as LismPropsData,
198
+ A as LismPropsData,
189
199
  B as default
190
200
  };
@@ -1,14 +1,14 @@
1
- function t(n) {
2
- return n ? Array.isArray(n) ? n.flatMap((r) => t(r)) : typeof n == "string" ? n.split(/[,\s]+/).map((r) => r.trim()).filter(Boolean) : [] : [];
1
+ function e(r) {
2
+ return r ? Array.isArray(r) ? r.flatMap((n) => e(n)) : typeof r != "string" ? [] : r.split(/[,\s]+/).map((n) => n.trim()).filter(Boolean) : [];
3
3
  }
4
- function o(n, r, s) {
5
- const e = [.../* @__PURE__ */ new Set([...t(n), ...t(r)])];
6
- if (e.length === 0) return [];
7
- const i = t(s);
8
- if (i.length === 0) return e;
9
- const a = new Set(i);
10
- return e.filter((f) => !a.has(f));
4
+ function a(r, n) {
5
+ const i = [...e(r), ...e(n)];
6
+ if (i.length === 0) return [];
7
+ const s = [], o = /* @__PURE__ */ new Set();
8
+ for (const t of i)
9
+ t.startsWith("-") ? o.add(t.slice(1)) : s.includes(t) || s.push(t);
10
+ return s.filter((t) => !o.has(t));
11
11
  }
12
12
  export {
13
- o as default
13
+ a as default
14
14
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- @layer lism-modules{.c--accordion{--duration:var(--acc-duration,0.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;height:1em;width:1em;&:after,&:before{background-color:currentColor;content:"";display:block;grid-area:1/1}&:before{height:100%;transform:var(--_icon-transform);transition:transform var(--duration);width:.1em}&:after{height:.1em;width:100%}}.c--accordion_button:focus-visible{outline:2px solid currentColor;outline-color:revert;outline-offset:-3px}@media (prefers-reduced-motion:reduce){.c--accordion_item{--duration:0s}}@media (scripting:none){.c--accordion_panel{content-visibility:visible!important;height:auto!important}.c--accordion_content{position:static!important}}}@layer lism-modules{.c--badge{--c:var(--base);--bgc:var(--text);--bdc:transparent;background-color:var(--bgc);border:1px solid var(--bdc);color:var(--c)}.c--badge--outline{--c:var(--text);--bgc:transparent;--bdc:currentColor}.c--button{--c:var(--base);--bgc:var(--text);--bdc:var(--bgc);background-color:var(--bgc);border:1px solid var(--bdc);color:var(--c);gap:var(--s10);place-content:center;place-items:center;text-decoration:none}.c--button--outline{--c:var(--text);--bgc:transparent;--bdc:var(--c)}}@layer lism-modules{: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-modules{.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 + 0.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{height:var(--_deco-size);top:var(--_deco-t);inset-inline:var(--_deco-inset-x);-webkit-mask:var(--_deco-mask) center/contain no-repeat;mask:var(--_deco-mask) center/contain no-repeat;scale:var(--_deco-scale);width:var(--_deco-size)}.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-modules{.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_item,.c--navMenu_nest{--bdc:inherit}.c--shapeDivider{--level:0;--_inner-offset:0px;--_inner-stretch:1;--_flipX:1;--_flipY:1;height:clamp(5px * var(--level),1cqw * var(--level),12px * var(--level));overflow:visible}}@layer lism-modules{.c--shapeDivider:where([data-flip^=X]){--_flipX:-1}.c--shapeDivider:where([data-flip$=Y]){--_flipY:-1}.c--shapeDivider_inner{--offsetY:0.5px;--offsetX:-0.5px;height:100%;scale:calc(var(--_flipX)*var(--_inner-stretch)) var(--_flipY);translate:calc(var(--offsetX) + var(--_inner-offset)) calc(var(--offsetY)*var(--_flipY));width:calc(100% + 1px)}.c--shapeDivider_svg{display:block}:where([data-has-animation=true]) .c--shapeDivider_svg{animation:lism--slideShape 12s linear infinite alternate;transform-origin:100% 0}}@keyframes lism--slideShape{0%{transform:scaleX(4)}to{transform:scaleX(4) translateX(75%)}}
1
+ @layer lism-component{.c--accordion{--duration:var(--acc-duration,0.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;height:1em;width:1em;&:after,&:before{background-color:currentColor;content:"";display:block;grid-area:1/1}&:before{height:100%;transform:var(--_icon-transform);transition:transform var(--duration);width:.1em}&:after{height:.1em;width:100%}}.c--accordion_button:focus-visible{outline:2px solid currentColor;outline-color:revert;outline-offset:-3px}@media (prefers-reduced-motion:reduce){.c--accordion_item{--duration:0s}}@media (scripting:none){.c--accordion_panel{content-visibility:visible!important;height:auto!important}.c--accordion_content{position:static!important}}}@layer lism-component{.c--badge{--c:var(--base);--bgc:var(--text);--bdc:transparent;background-color:var(--bgc);border:1px solid var(--bdc);color:var(--c)}.c--badge--outline{--c:var(--text);--bgc:transparent;--bdc:currentColor}.c--button{--c:var(--base);--bgc:var(--text);--bdc:var(--bgc);background-color:var(--bgc);border:1px solid var(--bdc);color:var(--c);gap:var(--s10);place-content:center;place-items:center;text-decoration:none}.c--button--outline{--c:var(--text);--bgc:transparent;--bdc:var(--c)}}@layer lism-component{: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 + 0.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{height:var(--_deco-size);top:var(--_deco-t);inset-inline:var(--_deco-inset-x);-webkit-mask:var(--_deco-mask) center/contain no-repeat;mask:var(--_deco-mask) center/contain no-repeat;scale:var(--_deco-scale);width:var(--_deco-size)}.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--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_item,.c--navMenu_nest{--bdc:inherit}.c--shapeDivider{--level:0;--_inner-offset:0px;--_inner-stretch:1;--_flipX:1;--_flipY:1;height:clamp(5px * var(--level),1cqw * var(--level),12px * var(--level));overflow:visible}}@layer lism-component{.c--shapeDivider:where([data-flip^=X]){--_flipX:-1}.c--shapeDivider:where([data-flip$=Y]){--_flipY:-1}.c--shapeDivider_inner{--offsetY:0.5px;--offsetX:-0.5px;height:100%;scale:calc(var(--_flipX)*var(--_inner-stretch)) var(--_flipY);translate:calc(var(--offsetX) + var(--_inner-offset)) calc(var(--offsetY)*var(--_flipY));width:calc(100% + 1px)}.c--shapeDivider_svg{display:block}:where([data-has-animation=true]) .c--shapeDivider_svg{animation:lism--slideShape 12s linear infinite alternate;transform-origin:100% 0}}@keyframes lism--slideShape{0%{transform:scaleX(4)}to{transform:scaleX(4) translateX(75%)}}
package/dist/ui.css CHANGED
@@ -1 +1 @@
1
- @layer lism-modules{.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-modules{.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-modules{.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-modules{.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-modules{.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-modules{.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-modules{.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-modules{.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-modules{.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%}.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%)}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lism-css/ui",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
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.12.0"
41
+ "lism-css": "0.13.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@storybook/react-vite": "^10.3.3",
@@ -1,4 +1,4 @@
1
- @layer lism-modules {
1
+ @layer lism-component {
2
2
  .c--accordion {
3
3
  --duration: var(--acc-duration, 0.25s);
4
4
  }
@@ -38,11 +38,11 @@ export function getItemProps({ lismClass, ...props }: AccordionItemProps) {
38
38
  return props;
39
39
  }
40
40
 
41
- export function getHeadingProps({ as = 'div', role, lismClass, set, unset, ...props }: AccordionHeadingProps) {
41
+ export function getHeadingProps({ as = 'div', role, lismClass, set, ...props }: AccordionHeadingProps) {
42
42
  const returnProps = {
43
43
  lismClass: atts(lismClass, 'c--accordion_heading'),
44
44
  as,
45
- set: mergeSet('plain', set, unset),
45
+ set: mergeSet('plain', set),
46
46
  ...props,
47
47
  };
48
48
 
@@ -52,12 +52,12 @@ export function getHeadingProps({ as = 'div', role, lismClass, set, unset, ...pr
52
52
  return returnProps;
53
53
  }
54
54
 
55
- export function getButtonProps({ set, unset, ...props }: Record<string, unknown>) {
55
+ export function getButtonProps({ set, ...props }: Record<string, unknown>) {
56
56
  return {
57
57
  lismClass: 'c--accordion_button',
58
58
  as: 'button',
59
59
  layout: 'flex',
60
- set: mergeSet('plain', set, unset),
60
+ set: mergeSet('plain', set),
61
61
  g: '10',
62
62
  w: '100%',
63
63
  ai: 'center',
@@ -1,4 +1,4 @@
1
- @layer lism-modules {
1
+ @layer lism-component {
2
2
  .c--badge {
3
3
  --c: var(--base);
4
4
  --bgc: var(--text);
@@ -1,4 +1,4 @@
1
- @layer lism-modules {
1
+ @layer lism-component {
2
2
  .c--button {
3
3
  --c: var(--base);
4
4
  --bgc: var(--text);
@@ -1,4 +1,4 @@
1
- @layer lism-modules {
1
+ @layer lism-component {
2
2
  .c--chat {
3
3
  --cbox-bgPct: 8%;
4
4
  grid-template-areas: 'avatar name' 'avatar body';
@@ -1,6 +1,6 @@
1
1
  /* Details コンポーネント用スタイル */
2
2
  /* ::details-content と grid-template-rows: 0fr → 1fr のトランジションでアニメーション */
3
- @layer lism-modules {
3
+ @layer lism-component {
4
4
  .c--details {
5
5
  --duration: var(--acc-duration, 0.25s); /* transition時間 */
6
6
  --_icon-scale: 1.1;
@@ -15,12 +15,12 @@ export function getDetailsProps({ lismClass, ...props }: DetailsProps): LismProp
15
15
  return props;
16
16
  }
17
17
 
18
- export function getTitleProps({ set, unset, ...props }: Record<string, unknown>) {
18
+ export function getTitleProps({ set, ...props }: Record<string, unknown>) {
19
19
  return {
20
20
  lismClass: 'c--details_title',
21
21
  as: 'span',
22
22
  fx: '1',
23
- set: mergeSet('plain', set, unset),
23
+ set: mergeSet('plain', set),
24
24
  ...props,
25
25
  };
26
26
  }
@@ -2,7 +2,7 @@
2
2
  * dialog で実装.
3
3
  * Memo: ::backdrop のアニメーションはFirefoxで動かない
4
4
  */
5
- @layer lism-modules {
5
+ @layer lism-component {
6
6
  .c--modal {
7
7
  --flow: 0; /* flow直下にきても影響しないように */
8
8
  --duration: var(--modal-duration, 0.4s);
@@ -4,7 +4,6 @@ import mergeSet from 'lism-css/lib/helper/mergeSet';
4
4
  export type ModalRootProps = {
5
5
  lismClass?: string;
6
6
  set?: string;
7
- unset?: string;
8
7
  duration?: string;
9
8
  style?: Record<string, string>;
10
9
  [key: string]: unknown;
@@ -17,10 +16,10 @@ export type ModalInnerProps = {
17
16
  [key: string]: unknown;
18
17
  };
19
18
 
20
- export function getProps({ lismClass = '', set, unset, duration, style = {}, ...props }: ModalRootProps) {
19
+ export function getProps({ lismClass = '', set, duration, style = {}, ...props }: ModalRootProps) {
21
20
  const theProps = {
22
21
  lismClass: atts(lismClass, 'c--modal'),
23
- set: mergeSet('plain', set, unset),
22
+ set: mergeSet('plain', set),
24
23
  };
25
24
  if (duration) {
26
25
  style['--duration'] = duration;
@@ -40,20 +39,20 @@ export function getInnerProps({ lismClass = '', offset, style = {}, ...props }:
40
39
  };
41
40
  }
42
41
 
43
- export function getOpenBtnProps({ set, unset, ...props }: Record<string, unknown>) {
42
+ export function getOpenBtnProps({ set, ...props }: Record<string, unknown>) {
44
43
  return {
45
44
  as: 'button',
46
- set: mergeSet('plain', set, unset),
45
+ set: mergeSet('plain', set),
47
46
  hov: 'o',
48
47
  d: 'inline-flex',
49
48
  ...props,
50
49
  };
51
50
  }
52
51
 
53
- export function getCloseBtnProps({ set, unset, ...props }: Record<string, unknown>) {
52
+ export function getCloseBtnProps({ set, ...props }: Record<string, unknown>) {
54
53
  return {
55
54
  as: 'button',
56
- set: mergeSet('plain', set, unset),
55
+ set: mergeSet('plain', set),
57
56
  hov: 'o',
58
57
  d: 'inline-flex',
59
58
  ...props,
@@ -1,4 +1,4 @@
1
- @layer lism-modules {
1
+ @layer lism-component {
2
2
  .c--navMenu {
3
3
  --link-td: none;
4
4
  --hl: var(--hl--s);
@@ -1,5 +1,5 @@
1
1
  /* Note: scale 反転は、__inner に対して行う。shapeDivider自身を反転させると、X方向に隙間ができてしまう。 */
2
- @layer lism-modules {
2
+ @layer lism-component {
3
3
  .c--shapeDivider {
4
4
  --level: 0;
5
5
 
@@ -1,4 +1,4 @@
1
- @layer lism-modules {
1
+ @layer lism-component {
2
2
  .c--tabs {
3
3
  display: grid;
4
4
  grid: 'list' 'panel' / 100%;
@@ -13,11 +13,11 @@ export default function getTabsProps({ lismClass, ...props }: TabsProps) {
13
13
  };
14
14
  }
15
15
 
16
- export function getTabProps({ set, unset, ...props }: Record<string, unknown>) {
16
+ export function getTabProps({ set, ...props }: Record<string, unknown>) {
17
17
  return {
18
18
  as: 'button',
19
19
  lismClass: 'c--tabs_tab',
20
- set: mergeSet('plain', set, unset),
20
+ set: mergeSet('plain', set),
21
21
  ...props,
22
22
  };
23
23
  }