@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.
- package/dist/components/Accordion/getProps.d.ts +2 -2
- package/dist/components/Accordion/getProps.js +10 -10
- package/dist/components/Accordion/react/Accordion.js +4 -4
- package/dist/components/Details/getProps.d.ts +1 -1
- package/dist/components/Details/getProps.js +11 -11
- package/dist/components/Modal/getProps.d.ts +3 -4
- package/dist/components/Modal/getProps.js +19 -19
- package/dist/components/Tabs/getProps.d.ts +1 -1
- package/dist/components/Tabs/getProps.js +8 -8
- package/dist/lism-css/dist/config/default-config.js +6 -6
- package/dist/lism-css/dist/config/defaults/{states.js → traits.js} +4 -3
- package/dist/lism-css/dist/config/index.js +9 -9
- package/dist/lism-css/dist/lib/getLismProps.js +108 -98
- package/dist/lism-css/dist/lib/helper/mergeSet.js +10 -10
- package/dist/style.css +1 -1
- package/dist/ui.css +1 -1
- package/package.json +2 -2
- package/src/components/Accordion/_style.css +1 -1
- package/src/components/Accordion/getProps.ts +4 -4
- package/src/components/Badge/_style.css +1 -1
- package/src/components/Button/_style.css +1 -1
- package/src/components/Chat/_style.css +1 -1
- package/src/components/Details/_style.css +1 -1
- package/src/components/Details/getProps.ts +2 -2
- package/src/components/Modal/_style.css +1 -1
- package/src/components/Modal/getProps.ts +6 -7
- package/src/components/NavMenu/_style.css +1 -1
- package/src/components/ShapeDivider/_style.css +1 -1
- package/src/components/Tabs/_style.css +1 -1
- package/src/components/Tabs/getProps.ts +2 -2
|
@@ -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,
|
|
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,
|
|
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
|
|
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,
|
|
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:
|
|
14
|
-
...
|
|
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,
|
|
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:
|
|
23
|
+
set: c("plain", o),
|
|
24
24
|
g: "10",
|
|
25
25
|
w: "100%",
|
|
26
26
|
ai: "center",
|
|
27
27
|
jc: "between",
|
|
28
|
-
...
|
|
28
|
+
...n
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
function _({ lismClass: o, _contextID: n, accID: t = "__LISM_ACC_ID__", isOpen: s = !1, ...a }) {
|
|
32
|
-
const
|
|
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
|
-
},
|
|
39
|
-
return { panelProps:
|
|
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
|
|
12
|
+
function S({ children: t, ...r }) {
|
|
13
13
|
const o = _(r);
|
|
14
14
|
return /* @__PURE__ */ n(P, { ...o, children: t });
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function 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
|
-
|
|
42
|
-
|
|
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,
|
|
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
|
|
2
|
-
import
|
|
3
|
-
function
|
|
4
|
-
return s.lismClass =
|
|
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
|
|
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:
|
|
12
|
-
...
|
|
11
|
+
set: a("plain", t),
|
|
12
|
+
...s
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
const
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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:
|
|
4
|
-
const
|
|
5
|
-
lismClass:
|
|
6
|
-
set: r("plain",
|
|
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
|
|
8
|
+
return t && (s["--duration"] = t), { as: "dialog", ...l, style: s, ...i };
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
12
|
-
lismClass:
|
|
13
|
-
style:
|
|
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
|
|
17
|
+
function m({ set: n, ...o }) {
|
|
18
18
|
return {
|
|
19
19
|
as: "button",
|
|
20
|
-
set: r("plain",
|
|
20
|
+
set: r("plain", n),
|
|
21
21
|
hov: "o",
|
|
22
22
|
d: "inline-flex",
|
|
23
23
|
...o
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function c({ set: n, ...o }) {
|
|
27
27
|
return {
|
|
28
28
|
as: "button",
|
|
29
|
-
set: r("plain",
|
|
29
|
+
set: r("plain", n),
|
|
30
30
|
hov: "o",
|
|
31
31
|
d: "inline-flex",
|
|
32
32
|
...o
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
const
|
|
35
|
+
const d = {
|
|
36
36
|
body: { lismClass: "c--modal_body" }
|
|
37
37
|
};
|
|
38
38
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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,
|
|
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
|
|
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
|
|
3
|
+
function e({ lismClass: t, ...s }) {
|
|
4
4
|
return {
|
|
5
|
-
lismClass:
|
|
5
|
+
lismClass: a(t, "c--tabs"),
|
|
6
6
|
...s
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function i({ set: t, ...s }) {
|
|
10
10
|
return {
|
|
11
11
|
as: "button",
|
|
12
12
|
lismClass: "c--tabs_tab",
|
|
13
|
-
set: o("plain", t
|
|
14
|
-
...
|
|
13
|
+
set: o("plain", t),
|
|
14
|
+
...s
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
e as default,
|
|
19
|
+
i as getTabProps
|
|
20
20
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import o from "./defaults/tokens.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
2
|
+
import r from "./defaults/props.js";
|
|
3
|
+
import t from "./defaults/traits.js";
|
|
4
|
+
const s = {
|
|
5
5
|
tokens: o,
|
|
6
|
-
props:
|
|
7
|
-
|
|
6
|
+
props: r,
|
|
7
|
+
traits: t
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
s as default
|
|
11
11
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
4
|
-
let
|
|
5
|
-
typeof window < "u" && window._LISM_CSS_CONFIG_ && (
|
|
6
|
-
const S =
|
|
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
|
-
},
|
|
9
|
+
}, u = t(structuredClone(p)), I = t(structuredClone(_)), c = l, i = ["sm", "md", "lg", "xl"], O = ["base", ...i];
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
i as BREAK_POINTS,
|
|
12
12
|
O as BREAK_POINTS_ALL,
|
|
13
13
|
S as CONFIG,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
c as
|
|
14
|
+
I as PROPS,
|
|
15
|
+
u as TOKENS,
|
|
16
|
+
c as TRAITS
|
|
17
17
|
};
|
|
@@ -1,123 +1,133 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TRAITS as C, PROPS as u } from "../config/index.js";
|
|
2
2
|
import j from "./getLayoutProps.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
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
|
|
14
|
-
const
|
|
15
|
-
return
|
|
13
|
+
const z = (o) => {
|
|
14
|
+
const r = u[o];
|
|
15
|
+
return r && r?.token || "";
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
|
|
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(
|
|
26
|
-
const { forwardedRef: t, class: s, className:
|
|
27
|
-
this.styles = { ...l }, this._propConfig = { ...
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
|
42
|
-
Object.keys(this.attrs).forEach((s) => {
|
|
43
|
-
if (Object.hasOwn(
|
|
44
|
-
const
|
|
45
|
-
typeof
|
|
46
|
-
} else if (Object.hasOwn(
|
|
47
|
-
const
|
|
48
|
-
delete this.attrs[s], this.analyzeLismProp(s,
|
|
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
|
|
51
|
-
this.setHovProps(
|
|
60
|
+
const e = this.extractProp(s);
|
|
61
|
+
this.setHovProps(e);
|
|
52
62
|
} else if (s === "css") {
|
|
53
|
-
const
|
|
54
|
-
this.addStyles(
|
|
63
|
+
const e = this.extractProp("css");
|
|
64
|
+
this.addStyles(e);
|
|
55
65
|
}
|
|
56
|
-
})
|
|
66
|
+
});
|
|
57
67
|
}
|
|
58
68
|
// Lism Prop 解析
|
|
59
|
-
analyzeLismProp(
|
|
69
|
+
analyzeLismProp(r, t) {
|
|
60
70
|
if (t == null) return;
|
|
61
|
-
let s =
|
|
71
|
+
let s = u[r] || null;
|
|
62
72
|
if (s === null) return;
|
|
63
|
-
this._propConfig?.[
|
|
64
|
-
const { base:
|
|
65
|
-
this.setAttrs(
|
|
66
|
-
s && this.setAttrs(
|
|
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(
|
|
70
|
-
this.uClasses.push(
|
|
79
|
+
addUtil(r) {
|
|
80
|
+
this.uClasses.push(r);
|
|
71
81
|
}
|
|
72
|
-
addUtils(
|
|
73
|
-
this.uClasses.push(...
|
|
82
|
+
addUtils(r) {
|
|
83
|
+
this.uClasses.push(...r);
|
|
74
84
|
}
|
|
75
85
|
// addState(state) {
|
|
76
86
|
// this.stateClasses.push(state);
|
|
77
87
|
// }
|
|
78
|
-
addStyle(
|
|
79
|
-
this.styles[
|
|
88
|
+
addStyle(r, t) {
|
|
89
|
+
this.styles[r] = t;
|
|
80
90
|
}
|
|
81
|
-
addStyles(
|
|
82
|
-
this.styles = { ...this.styles, ...
|
|
91
|
+
addStyles(r) {
|
|
92
|
+
this.styles = { ...this.styles, ...r };
|
|
83
93
|
}
|
|
84
|
-
addAttrs(
|
|
85
|
-
this.addStyles(
|
|
94
|
+
addAttrs(r) {
|
|
95
|
+
this.addStyles(r.styles || {}), this.addUtils(r.utils || []);
|
|
86
96
|
}
|
|
87
|
-
extractProp(
|
|
88
|
-
const t = this.attrs[
|
|
89
|
-
return this.attrs[
|
|
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(
|
|
101
|
+
extractProps(r) {
|
|
92
102
|
const t = {};
|
|
93
|
-
return
|
|
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(
|
|
109
|
+
setAttrs(r, t, s = {}, e = "") {
|
|
100
110
|
if (t == null || t === "" || t === !1) return;
|
|
101
|
-
let
|
|
102
|
-
if (
|
|
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 (!
|
|
107
|
-
const { presets:
|
|
108
|
-
if (
|
|
109
|
-
const
|
|
110
|
-
|
|
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 (
|
|
114
|
-
const
|
|
115
|
-
|
|
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
|
|
119
|
-
if (g && typeof t == "string" && (
|
|
120
|
-
this.addUtil(`${i}:${
|
|
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:
|
|
129
|
-
let
|
|
130
|
-
if (
|
|
131
|
-
if (
|
|
132
|
-
this.addStyle(`--${
|
|
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 (!
|
|
135
|
-
this.addStyle(l,
|
|
144
|
+
} else if (!O && !p) {
|
|
145
|
+
this.addStyle(l, n);
|
|
136
146
|
return;
|
|
137
147
|
}
|
|
138
148
|
}
|
|
139
|
-
this.addUtil(i), this.addStyle(
|
|
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(
|
|
155
|
-
|
|
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
|
|
158
|
-
const s =
|
|
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((
|
|
164
|
-
this.addUtil(`-hov:${
|
|
173
|
+
k(s).forEach((e) => {
|
|
174
|
+
this.addUtil(`-hov:${e}`);
|
|
165
175
|
});
|
|
166
176
|
else if (typeof s == "string" || typeof s == "number") {
|
|
167
|
-
const
|
|
168
|
-
this.addUtil(`-hov:${t}`), this.addStyle(`--hov-${t}`,
|
|
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(
|
|
175
|
-
if (Object.keys(
|
|
184
|
+
function B(o) {
|
|
185
|
+
if (Object.keys(o).length === 0)
|
|
176
186
|
return {};
|
|
177
|
-
const { layout:
|
|
187
|
+
const { layout: r, ...t } = o, s = new A(j(r, t));
|
|
178
188
|
return {
|
|
179
|
-
...
|
|
189
|
+
...U({
|
|
180
190
|
className: s.className,
|
|
181
|
-
style:
|
|
191
|
+
style: U(s.styles)
|
|
182
192
|
}),
|
|
183
193
|
...s.attrs
|
|
184
194
|
// data-* などHTMLの標準属性はそのまま渡す
|
|
185
195
|
};
|
|
186
196
|
}
|
|
187
197
|
export {
|
|
188
|
-
|
|
198
|
+
A as LismPropsData,
|
|
189
199
|
B as default
|
|
190
200
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
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
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return
|
|
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
|
-
|
|
13
|
+
a as default
|
|
14
14
|
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer lism-
|
|
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-
|
|
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.
|
|
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.
|
|
41
|
+
"lism-css": "0.13.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@storybook/react-vite": "^10.3.3",
|
|
@@ -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,
|
|
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
|
|
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,
|
|
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
|
|
60
|
+
set: mergeSet('plain', set),
|
|
61
61
|
g: '10',
|
|
62
62
|
w: '100%',
|
|
63
63
|
ai: 'center',
|
|
@@ -15,12 +15,12 @@ export function getDetailsProps({ lismClass, ...props }: DetailsProps): LismProp
|
|
|
15
15
|
return props;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export function getTitleProps({ set,
|
|
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
|
|
23
|
+
set: mergeSet('plain', set),
|
|
24
24
|
...props,
|
|
25
25
|
};
|
|
26
26
|
}
|
|
@@ -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,
|
|
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
|
|
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,
|
|
42
|
+
export function getOpenBtnProps({ set, ...props }: Record<string, unknown>) {
|
|
44
43
|
return {
|
|
45
44
|
as: 'button',
|
|
46
|
-
set: mergeSet('plain', set
|
|
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,
|
|
52
|
+
export function getCloseBtnProps({ set, ...props }: Record<string, unknown>) {
|
|
54
53
|
return {
|
|
55
54
|
as: 'button',
|
|
56
|
-
set: mergeSet('plain', set
|
|
55
|
+
set: mergeSet('plain', set),
|
|
57
56
|
hov: 'o',
|
|
58
57
|
d: 'inline-flex',
|
|
59
58
|
...props,
|
|
@@ -13,11 +13,11 @@ export default function getTabsProps({ lismClass, ...props }: TabsProps) {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export function getTabProps({ set,
|
|
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
|
|
20
|
+
set: mergeSet('plain', set),
|
|
21
21
|
...props,
|
|
22
22
|
};
|
|
23
23
|
}
|