@lism-css/ui 0.9.2 → 0.10.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/README.ja.md +137 -0
- package/README.md +93 -5
- package/dist/components/Accordion/getProps.js +53 -0
- package/dist/components/Accordion/react/AccIcon.js +9 -0
- package/dist/components/Accordion/react/Accordion.d.ts +5 -6
- package/dist/components/Accordion/react/Accordion.js +45 -0
- package/dist/components/Accordion/react/index.js +6 -0
- package/dist/components/Alert/getProps.js +20 -0
- package/dist/components/Alert/presets.js +29 -0
- package/dist/components/Alert/react/Alert.js +16 -0
- package/dist/components/Avatar/react/Avatar.js +8 -0
- package/dist/components/Badge/react/Badge.js +12 -0
- package/dist/components/Button/react/Button.js +12 -0
- package/dist/components/Callout/getProps.js +22 -0
- package/dist/components/Callout/presets.js +29 -0
- package/dist/components/Callout/react/Callout.js +20 -0
- package/dist/components/Chat/getProps.js +47 -0
- package/dist/components/Chat/react/Chat.js +22 -0
- package/dist/components/Details/getProps.js +15 -0
- package/dist/components/Details/react/Details.js +28 -0
- package/dist/components/Details/react/index.js +5 -0
- package/dist/components/DummyImage/astro/index.d.ts +1 -0
- package/dist/components/DummyImage/react/DummyImage.d.ts +2 -0
- package/dist/components/DummyImage/react/DummyImage.js +8 -0
- package/dist/components/DummyImage/react/index.d.ts +1 -0
- package/dist/components/DummyText/astro/index.d.ts +1 -0
- package/dist/components/DummyText/getContent.d.ts +11 -0
- package/dist/components/DummyText/getContent.js +9 -0
- package/dist/components/DummyText/react/DummyText.d.ts +10 -0
- package/dist/components/DummyText/react/DummyText.js +10 -0
- package/dist/components/DummyText/react/index.d.ts +1 -0
- package/dist/components/DummyText/texts.d.ts +22 -0
- package/dist/components/DummyText/texts.js +39 -0
- package/dist/components/Modal/getProps.js +25 -0
- package/dist/components/Modal/react/Body.js +9 -0
- package/dist/components/Modal/react/CloseBtn.js +13 -0
- package/dist/components/Modal/react/Inner.js +9 -0
- package/dist/components/Modal/react/Modal.d.ts +1 -2
- package/dist/components/Modal/react/Modal.js +17 -0
- package/dist/components/Modal/react/OpenBtn.js +9 -0
- package/dist/components/Modal/react/index.js +9 -0
- package/dist/components/Modal/setModal.js +16 -17
- package/dist/components/NavMenu/getProps.js +40 -0
- package/dist/components/NavMenu/react/NavMenu.js +24 -0
- package/dist/components/NavMenu/react/index.js +5 -0
- package/dist/components/ShapeDivider/getProps.js +22 -0
- package/dist/components/ShapeDivider/react/ShapeDivider.js +26 -0
- package/dist/components/Tabs/getProps.js +10 -0
- package/dist/components/Tabs/react/Tab.js +9 -0
- package/dist/components/Tabs/react/TabItem.js +7 -0
- package/dist/components/Tabs/react/TabList.js +8 -0
- package/dist/components/Tabs/react/TabPanel.js +9 -0
- package/dist/components/Tabs/react/Tabs.d.ts +1 -2
- package/dist/components/Tabs/react/Tabs.js +48 -0
- package/dist/components/Tabs/react/index.js +9 -0
- package/dist/components/Tabs/setTabs.js +10 -11
- package/dist/components/astro.d.ts +2 -0
- package/dist/components/react.d.ts +2 -0
- package/dist/components/react.js +30 -0
- package/dist/lism-css/dist/components/Center/index.js +8 -0
- package/dist/lism-css/dist/components/Flex/index.js +8 -0
- package/dist/lism-css/dist/components/Flow/index.js +8 -0
- package/dist/lism-css/dist/components/Frame/index.js +8 -0
- package/dist/lism-css/dist/components/Grid/index.js +8 -0
- package/dist/lism-css/dist/components/Lism/index.js +8 -0
- package/dist/lism-css/dist/components/Stack/index.js +8 -0
- package/dist/lism-css/dist/components/atomic/Decorator/getProps.js +15 -0
- package/dist/lism-css/dist/components/atomic/Decorator/index.js +9 -0
- package/dist/lism-css/dist/components/atomic/Icon/SVG.js +22 -0
- package/dist/lism-css/dist/components/atomic/Icon/getProps.js +56 -0
- package/dist/lism-css/dist/components/atomic/Icon/index.js +12 -0
- package/dist/lism-css/dist/components/atomic/Icon/presets.js +276 -0
- package/dist/lism-css/dist/config/default-config.js +11 -0
- package/dist/lism-css/dist/config/defaults/props.js +340 -0
- package/dist/lism-css/dist/config/defaults/states.js +39 -0
- package/dist/lism-css/dist/config/defaults/tokens.js +30 -0
- package/dist/lism-css/dist/config/helper/getSvgUrl.js +4 -0
- package/dist/lism-css/dist/config/helper.js +27 -0
- package/dist/lism-css/dist/config/index.js +17 -0
- package/dist/lism-css/dist/lib/getBpData.js +19 -0
- package/dist/lism-css/dist/lib/getLayoutProps.js +30 -0
- package/dist/lism-css/dist/lib/getLismProps.js +188 -0
- package/dist/lism-css/dist/lib/getMaybeCssVar.js +42 -0
- package/dist/lism-css/dist/lib/getMaybeTokenValue.js +26 -0
- package/dist/lism-css/dist/lib/getUtilKey.js +13 -0
- package/dist/lism-css/dist/lib/helper/atts.js +11 -0
- package/dist/lism-css/dist/lib/helper/filterEmptyObj.js +10 -0
- package/dist/lism-css/dist/lib/helper/hasSomeKeys.js +6 -0
- package/dist/lism-css/dist/lib/helper/isEmptyObj.js +6 -0
- package/dist/lism-css/dist/lib/helper/isNumStr.js +6 -0
- package/dist/lism-css/dist/lib/helper/splitWithComma.js +6 -0
- package/dist/lism-css/dist/lib/isPresetValue.js +13 -0
- package/dist/lism-css/dist/lib/isTokenValue.js +27 -0
- package/dist/style.css +1 -1
- package/dist/ui.css +1 -0
- package/package.json +9 -7
- package/src/components/Accordion/_style.css +69 -69
- package/src/components/Accordion/astro/Button.astro +2 -2
- package/src/components/Accordion/astro/Heading.astro +1 -1
- package/src/components/Accordion/astro/Item.astro +7 -7
- package/src/components/Accordion/astro/Panel.astro +3 -3
- package/src/components/Accordion/astro/Root.astro +3 -3
- package/src/components/Accordion/getProps.js +54 -54
- package/src/components/Accordion/react/AccIcon.jsx +1 -1
- package/src/components/Accordion/react/Accordion.jsx +37 -36
- package/src/components/Accordion/script.js +1 -1
- package/src/components/Accordion/setAccordion.js +93 -93
- package/src/components/Alert/astro/Alert.astro +6 -6
- package/src/components/Alert/getProps.ts +22 -22
- package/src/components/Alert/presets.ts +26 -26
- package/src/components/Alert/react/Alert.tsx +9 -9
- package/src/components/Avatar/astro/Avatar.astro +2 -2
- package/src/components/Avatar/react/Avatar.jsx +5 -5
- package/src/components/Badge/_style.css +14 -14
- package/src/components/Badge/astro/Badge.astro +4 -4
- package/src/components/Badge/react/Badge.jsx +6 -6
- package/src/components/Button/_style.css +29 -29
- package/src/components/Button/astro/Button.astro +4 -4
- package/src/components/Button/react/Button.jsx +6 -6
- package/src/components/Callout/astro/Callout.astro +13 -13
- package/src/components/Callout/getProps.ts +24 -24
- package/src/components/Callout/presets.ts +26 -26
- package/src/components/Callout/react/Callout.tsx +16 -16
- package/src/components/Chat/_style.css +49 -49
- package/src/components/Chat/astro/Chat.astro +27 -27
- package/src/components/Chat/getProps.js +40 -45
- package/src/components/Chat/react/Chat.jsx +17 -17
- package/src/components/Details/_style.css +39 -39
- package/src/components/Details/astro/Content.astro +3 -3
- package/src/components/Details/astro/Details.astro +1 -1
- package/src/components/Details/astro/Icon.astro +1 -1
- package/src/components/Details/astro/Summary.astro +2 -2
- package/src/components/Details/astro/Title.astro +1 -1
- package/src/components/Details/getProps.js +7 -7
- package/src/components/Details/react/Details.jsx +24 -24
- package/src/components/DummyImage/astro/DummyImage.astro +7 -0
- package/src/components/DummyImage/astro/index.ts +1 -0
- package/src/components/DummyImage/react/DummyImage.tsx +5 -0
- package/src/components/DummyImage/react/index.ts +1 -0
- package/src/components/DummyText/astro/DummyText.astro +9 -0
- package/src/components/DummyText/astro/index.ts +1 -0
- package/src/components/DummyText/getContent.ts +39 -0
- package/src/components/DummyText/react/DummyText.tsx +15 -0
- package/src/components/DummyText/react/index.ts +1 -0
- package/src/components/DummyText/texts.ts +39 -0
- package/src/components/Modal/_style.css +34 -34
- package/src/components/Modal/astro/Body.astro +1 -1
- package/src/components/Modal/astro/CloseBtn.astro +10 -10
- package/src/components/Modal/astro/Inner.astro +1 -1
- package/src/components/Modal/astro/Modal.astro +3 -3
- package/src/components/Modal/astro/OpenBtn.astro +1 -1
- package/src/components/Modal/getProps.js +19 -19
- package/src/components/Modal/react/Body.jsx +5 -5
- package/src/components/Modal/react/CloseBtn.jsx +13 -13
- package/src/components/Modal/react/Inner.jsx +1 -1
- package/src/components/Modal/react/Modal.jsx +12 -11
- package/src/components/Modal/react/OpenBtn.jsx +5 -5
- package/src/components/Modal/script.js +1 -1
- package/src/components/Modal/setModal.ts +92 -92
- package/src/components/NavMenu/_style.css +17 -17
- package/src/components/NavMenu/astro/Item.astro +1 -1
- package/src/components/NavMenu/astro/Link.astro +1 -1
- package/src/components/NavMenu/astro/Nest.astro +1 -1
- package/src/components/NavMenu/astro/Root.astro +1 -1
- package/src/components/NavMenu/getProps.js +28 -28
- package/src/components/NavMenu/react/NavMenu.jsx +4 -4
- package/src/components/ShapeDivider/_style.css +51 -51
- package/src/components/ShapeDivider/astro/ShapeDivider.astro +20 -20
- package/src/components/ShapeDivider/getProps.js +23 -23
- package/src/components/ShapeDivider/react/ShapeDivider.jsx +24 -24
- package/src/components/Tabs/_style.css +29 -29
- package/src/components/Tabs/astro/Tab.astro +2 -2
- package/src/components/Tabs/astro/TabItem.astro +1 -1
- package/src/components/Tabs/astro/TabList.astro +2 -2
- package/src/components/Tabs/astro/TabPanel.astro +2 -2
- package/src/components/Tabs/astro/Tabs.astro +20 -20
- package/src/components/Tabs/astro/transformTabitems.js +30 -30
- package/src/components/Tabs/getProps.js +4 -4
- package/src/components/Tabs/react/Tab.jsx +4 -12
- package/src/components/Tabs/react/TabItem.jsx +1 -1
- package/src/components/Tabs/react/TabList.jsx +2 -2
- package/src/components/Tabs/react/TabPanel.jsx +2 -2
- package/src/components/Tabs/react/Tabs.jsx +46 -47
- package/src/components/Tabs/script.js +4 -4
- package/src/components/Tabs/setTabs.js +70 -70
- package/src/components/astro.ts +2 -0
- package/src/components/react.ts +2 -0
- package/src/helper/animation.ts +10 -10
- package/src/helper/uuid.js +3 -3
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { STATES as P, PROPS as S } from "../config/index.js";
|
|
2
|
+
import j from "./getLayoutProps.js";
|
|
3
|
+
import U from "./isPresetValue.js";
|
|
4
|
+
import w from "./isTokenValue.js";
|
|
5
|
+
import v from "./getUtilKey.js";
|
|
6
|
+
import m from "./getMaybeCssVar.js";
|
|
7
|
+
import z from "./getBpData.js";
|
|
8
|
+
import E from "./helper/atts.js";
|
|
9
|
+
import N from "./helper/isEmptyObj.js";
|
|
10
|
+
import C from "./helper/filterEmptyObj.js";
|
|
11
|
+
import k from "./helper/splitWithComma.js";
|
|
12
|
+
const _ = (h) => {
|
|
13
|
+
const s = S[h];
|
|
14
|
+
return s && s?.token || "";
|
|
15
|
+
};
|
|
16
|
+
class x {
|
|
17
|
+
// propList = {};
|
|
18
|
+
className = "";
|
|
19
|
+
uClasses = [];
|
|
20
|
+
lismState = [];
|
|
21
|
+
styles = {};
|
|
22
|
+
attrs = {};
|
|
23
|
+
_propConfig;
|
|
24
|
+
constructor(s) {
|
|
25
|
+
const { forwardedRef: t, class: e, className: i, lismClass: o, variant: r, style: l = {}, _propConfig: n = {}, ...c } = s;
|
|
26
|
+
this.styles = { ...l }, this._propConfig = { ...n };
|
|
27
|
+
let f = o || "";
|
|
28
|
+
if (r && o) {
|
|
29
|
+
const y = o.split(" "), a = y[0], u = `${a}--${r}`;
|
|
30
|
+
f = [a, u, ...y.slice(1)].join(" ");
|
|
31
|
+
}
|
|
32
|
+
N(c) || (this.attrs = { ...c }, this.analyzeProps()), t && (this.attrs.ref = t), this.className = E(i || e, f, this.lismState, this.uClasses);
|
|
33
|
+
}
|
|
34
|
+
analyzeState(s, t) {
|
|
35
|
+
const { className: e, preset: i, presetClass: o, customVar: r, tokenKey: l, setStyles: n } = s;
|
|
36
|
+
t === !0 ? this.lismState.push(e) : i && U(i, t) ? this.lismState.push(`${e} ${o}:${String(t)}`) : t && (this.lismState.push(e), l && r ? this.addStyle(r, m(t, l)) : n && typeof t == "string" && this.addStyles(n(t)));
|
|
37
|
+
}
|
|
38
|
+
// prop解析
|
|
39
|
+
analyzeProps() {
|
|
40
|
+
Object.keys(this.attrs).forEach((s) => {
|
|
41
|
+
if (Object.hasOwn(P, s)) {
|
|
42
|
+
const t = this.extractProp(s), e = P[s];
|
|
43
|
+
typeof e == "string" ? t && this.lismState.push(e) : this.analyzeState(e, t);
|
|
44
|
+
} else if (Object.hasOwn(S, s)) {
|
|
45
|
+
const t = this.attrs[s];
|
|
46
|
+
delete this.attrs[s], this.analyzeLismProp(s, t);
|
|
47
|
+
} else if (s === "hov") {
|
|
48
|
+
const t = this.extractProp(s);
|
|
49
|
+
this.setHovProps(t);
|
|
50
|
+
} else if (s === "css") {
|
|
51
|
+
const t = this.extractProp("css");
|
|
52
|
+
this.addStyles(t);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
// Lism Prop 解析
|
|
57
|
+
analyzeLismProp(s, t) {
|
|
58
|
+
if (t == null) return;
|
|
59
|
+
let e = S[s] || null;
|
|
60
|
+
if (e === null) return;
|
|
61
|
+
this._propConfig?.[s] && (e = Object.assign({}, e, this._propConfig[s]));
|
|
62
|
+
const { base: i, ...o } = z(t);
|
|
63
|
+
this.setAttrs(s, i, e), Object.keys(o).forEach((r) => {
|
|
64
|
+
e && this.setAttrs(s, o[r], e, r);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
addUtil(s) {
|
|
68
|
+
this.uClasses.push(s);
|
|
69
|
+
}
|
|
70
|
+
addUtils(s) {
|
|
71
|
+
this.uClasses.push(...s);
|
|
72
|
+
}
|
|
73
|
+
// addState(state) {
|
|
74
|
+
// this.stateClasses.push(state);
|
|
75
|
+
// }
|
|
76
|
+
addStyle(s, t) {
|
|
77
|
+
this.styles[s] = t;
|
|
78
|
+
}
|
|
79
|
+
addStyles(s) {
|
|
80
|
+
this.styles = { ...this.styles, ...s };
|
|
81
|
+
}
|
|
82
|
+
addAttrs(s) {
|
|
83
|
+
this.addStyles(s.styles || {}), this.addUtils(s.utils || []);
|
|
84
|
+
}
|
|
85
|
+
extractProp(s) {
|
|
86
|
+
const t = this.attrs[s];
|
|
87
|
+
return this.attrs[s] === void 0 ? null : (delete this.attrs[s], t);
|
|
88
|
+
}
|
|
89
|
+
extractProps(s) {
|
|
90
|
+
const t = {};
|
|
91
|
+
return s.forEach((e) => {
|
|
92
|
+
this.attrs[e] !== void 0 && (t[e] = this.attrs[e], delete this.attrs[e]);
|
|
93
|
+
}), t;
|
|
94
|
+
}
|
|
95
|
+
// utilクラスを追加するか、styleにセットするかの分岐処理 @base
|
|
96
|
+
// 値が null, undefined, '', false の時はスキップ
|
|
97
|
+
setAttrs(s, t, e = {}, i = "") {
|
|
98
|
+
if (t == null || t === "" || t === !1) return;
|
|
99
|
+
let o = `--${s}`, r = `-${String(e.utilKey || s)}`;
|
|
100
|
+
if (i && (o = `--${s}_${i}`, r += `_${i}`), typeof t == "string" && t.startsWith(":")) {
|
|
101
|
+
this.addUtil(`${r}:${t.replace(":", "")}`);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (!i) {
|
|
105
|
+
const { presets: u, tokenClass: O, utils: g, shorthands: b } = e;
|
|
106
|
+
if (u && U(u, t)) {
|
|
107
|
+
const d = typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
108
|
+
d && this.addUtil(`${r}:${d}`);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (O && e.token && w(e.token, t)) {
|
|
112
|
+
const d = typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
113
|
+
d && this.addUtil(`${r}:${d}`);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
let p = "";
|
|
117
|
+
if (g && typeof t == "string" && (p = v(g, t)), !p && b && typeof t == "string" && (p = v(b, t, !0)), p) {
|
|
118
|
+
this.addUtil(`${r}:${p}`);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (t === !0 || t === "-") {
|
|
123
|
+
this.addUtil(r);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const { prop: l, isVar: n, alwaysVar: c, token: f, bp: y } = e;
|
|
127
|
+
let a;
|
|
128
|
+
if (f && (typeof t == "string" || typeof t == "number") ? a = m(t, f) : typeof t == "string" || typeof t == "number" ? a = t : a = JSON.stringify(t), !i) {
|
|
129
|
+
if (n) {
|
|
130
|
+
this.addStyle(`--${s}`, a);
|
|
131
|
+
return;
|
|
132
|
+
} else if (!y && !c) {
|
|
133
|
+
this.addStyle(l, a);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
this.addUtil(r), this.addStyle(o, a);
|
|
138
|
+
}
|
|
139
|
+
// setPassProps(passVars) {
|
|
140
|
+
// let dataList = [];
|
|
141
|
+
// Object.keys(passVars).forEach((propName) => {
|
|
142
|
+
// // プロバイダーリストに追加
|
|
143
|
+
// dataList.push(propName);
|
|
144
|
+
// // 渡す値
|
|
145
|
+
// let value = passVars[propName];
|
|
146
|
+
// if (null === value) return;
|
|
147
|
+
// // トークン値であれば変換
|
|
148
|
+
// value = getMaybeCssVar(value, getTokenKey(propName));
|
|
149
|
+
// this.addStyle(`--pass_${propName}`, value);
|
|
150
|
+
// });
|
|
151
|
+
// }
|
|
152
|
+
setHovProps(s) {
|
|
153
|
+
s && (s === "-" || s === !0 ? this.addUtil("-hov") : typeof s == "string" ? k(s).forEach((t) => {
|
|
154
|
+
this.addUtil(`-hov:${t}`);
|
|
155
|
+
}) : typeof s == "object" && Object.keys(s).forEach((t) => {
|
|
156
|
+
const e = s[t];
|
|
157
|
+
if (!(e == null || e === "" || e === !1)) {
|
|
158
|
+
if (e === "-" || e === !0)
|
|
159
|
+
this.addUtil(`-hov:${t}`);
|
|
160
|
+
else if (t === "class")
|
|
161
|
+
k(e).forEach((i) => {
|
|
162
|
+
this.addUtil(`-hov:${i}`);
|
|
163
|
+
});
|
|
164
|
+
else if (typeof e == "string" || typeof e == "number") {
|
|
165
|
+
const i = m(e, _(t));
|
|
166
|
+
this.addUtil(`-hov:${t}`), this.addStyle(`--hov-${t}`, i);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function q(h) {
|
|
173
|
+
if (Object.keys(h).length === 0)
|
|
174
|
+
return {};
|
|
175
|
+
const { layout: s, ...t } = h, e = new x(j(s, t));
|
|
176
|
+
return {
|
|
177
|
+
...C({
|
|
178
|
+
className: e.className,
|
|
179
|
+
style: C(e.styles)
|
|
180
|
+
}),
|
|
181
|
+
...e.attrs
|
|
182
|
+
// data-* などHTMLの標準属性はそのまま渡す
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
export {
|
|
186
|
+
x as LismPropsData,
|
|
187
|
+
q as default
|
|
188
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { TOKENS as n } from "../config/index.js";
|
|
2
|
+
import a from "./helper/isNumStr.js";
|
|
3
|
+
import o from "./getMaybeTokenValue.js";
|
|
4
|
+
function m(t, e) {
|
|
5
|
+
if (!e) return String(t);
|
|
6
|
+
switch (e) {
|
|
7
|
+
case "space":
|
|
8
|
+
return c(t);
|
|
9
|
+
case "color":
|
|
10
|
+
return u(t);
|
|
11
|
+
case "bxsh":
|
|
12
|
+
return t === "0" || t === 0 ? "none" : o(e, t, n);
|
|
13
|
+
default:
|
|
14
|
+
return o(e, t, n);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function c(t) {
|
|
18
|
+
if (t === 0 || t === "0") return "0";
|
|
19
|
+
if (typeof t == "number" || a(t)) {
|
|
20
|
+
const e = typeof t == "number" ? t : Number(t);
|
|
21
|
+
return e < 0 ? `calc(-1 * var(--s${Math.abs(e)}))` : `var(--s${t})`;
|
|
22
|
+
}
|
|
23
|
+
return typeof t == "string" && t.includes(" ") && !t.includes("calc(") && !t.includes("var(") && !t.includes(",") ? t.split(" ").map((e) => c(e)).join(" ") : String(t);
|
|
24
|
+
}
|
|
25
|
+
function u(t) {
|
|
26
|
+
if (typeof t == "string" && t.endsWith("%")) {
|
|
27
|
+
const e = t.split(":");
|
|
28
|
+
if (e.length === 3) {
|
|
29
|
+
const [i, s, r] = e;
|
|
30
|
+
return `color-mix(in srgb, ${o("color", i, n)} ${r}, ${o("color", s, n)})`;
|
|
31
|
+
} else if (e.length === 2) {
|
|
32
|
+
const [i, s] = e;
|
|
33
|
+
return `color-mix(in srgb, ${o("color", i, n)} ${s}, transparent)`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return o("color", t, n);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
m as default,
|
|
40
|
+
u as getMaybeColorVar,
|
|
41
|
+
c as getMaybeSpaceVar
|
|
42
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function u(n, e, a) {
|
|
2
|
+
if (n === "color") {
|
|
3
|
+
let t = u("c", e, a);
|
|
4
|
+
return t === String(e) && (t = u("palette", e, a)), t;
|
|
5
|
+
}
|
|
6
|
+
const i = a[n];
|
|
7
|
+
if (!i) return String(e);
|
|
8
|
+
let r = typeof e == "number" ? `${e}` : e;
|
|
9
|
+
if (i instanceof Set) {
|
|
10
|
+
if (i.has(r))
|
|
11
|
+
return r.startsWith("-") && (r = `n${r.slice(1)}`), `var(--${n}--${r})`;
|
|
12
|
+
} else if (Array.isArray(i)) {
|
|
13
|
+
if (i.includes(r))
|
|
14
|
+
return r.startsWith("-") && (r = `n${r.slice(1)}`), `var(--${n}--${r})`;
|
|
15
|
+
} else if ("pre" in i || "values" in i) {
|
|
16
|
+
const { pre: t = "", values: s = [] } = i;
|
|
17
|
+
if (s instanceof Set && s.has(r))
|
|
18
|
+
return `var(${t}${r})`;
|
|
19
|
+
if (Array.isArray(s) && s.includes(r))
|
|
20
|
+
return `var(${t}${r})`;
|
|
21
|
+
}
|
|
22
|
+
return String(e);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
u as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function i(t, f, n = !1) {
|
|
2
|
+
if (t == null || typeof t != "object") return "";
|
|
3
|
+
if (f in t)
|
|
4
|
+
return n ? String(t[f]) : f;
|
|
5
|
+
if (n) return "";
|
|
6
|
+
for (const [r, e] of Object.entries(t))
|
|
7
|
+
if (e === f)
|
|
8
|
+
return r;
|
|
9
|
+
return "";
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
i as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function i(...s) {
|
|
2
|
+
let e = [];
|
|
3
|
+
for (let r = 0; r < s.length; r++) {
|
|
4
|
+
const t = s[r];
|
|
5
|
+
t && (typeof t == "string" ? e.push(...t.trim().split(" ")) : typeof t == "number" ? e.push(t) : Array.isArray(t) ? e.push(...t.filter((n) => n != null)) : t instanceof Set ? e.push(...t) : typeof t == "object" && e.push(...Object.keys(t).filter((n) => !!t[n])));
|
|
6
|
+
}
|
|
7
|
+
return e = [...new Set(e)], e.join(" ").trim();
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
i as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TOKENS as f } from "../config/index.js";
|
|
2
|
+
function s(i, n) {
|
|
3
|
+
let e;
|
|
4
|
+
if (typeof n == "number")
|
|
5
|
+
e = `${n}`;
|
|
6
|
+
else if (typeof n == "string")
|
|
7
|
+
e = n;
|
|
8
|
+
else
|
|
9
|
+
return !1;
|
|
10
|
+
if (!(i in f)) return !1;
|
|
11
|
+
const r = f[i];
|
|
12
|
+
if (r instanceof Set)
|
|
13
|
+
return r.has(e);
|
|
14
|
+
if (Array.isArray(r))
|
|
15
|
+
return r.includes(e);
|
|
16
|
+
if ("values" in r) {
|
|
17
|
+
const t = r.values;
|
|
18
|
+
if (t instanceof Set)
|
|
19
|
+
return t.has(e);
|
|
20
|
+
if (Array.isArray(t))
|
|
21
|
+
return t.includes(e);
|
|
22
|
+
}
|
|
23
|
+
return !1;
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
s as default
|
|
27
|
+
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer lism
|
|
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%;--gta:"avatar name" "avatar body";--gtc:auto 1fr;--gtr: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;--gta:"name avatar" "body avatar";--gtc: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%)}}
|
package/dist/ui.css
ADDED
|
@@ -0,0 +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%;--gta: "avatar name" "avatar body";--gtc: auto 1fr;--gtr: 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;--gta: "name avatar" "body avatar";--gtc: 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%)}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lism-css/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "UI components by lism-css.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "ddryo",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"exports": {
|
|
22
22
|
"./react": {
|
|
23
|
-
"import": "./
|
|
23
|
+
"import": "./dist/components/react.js",
|
|
24
24
|
"types": "./dist/components/index.d.ts"
|
|
25
25
|
},
|
|
26
26
|
"./astro": {
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"./scripts/*": "./dist/scripts/*.js",
|
|
31
31
|
"./style.css": "./dist/style.css"
|
|
32
32
|
},
|
|
33
|
-
"homepage": "https://
|
|
33
|
+
"homepage": "https://lism-css.com",
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
36
|
-
"url": "https://github.com/lism-css/lism-css/tree/main/packages/lism-
|
|
36
|
+
"url": "https://github.com/lism-css/lism-css/tree/main/packages/lism-ui"
|
|
37
37
|
},
|
|
38
38
|
"bugs": {
|
|
39
39
|
"url": "https://github.com/lism-css/lism-css/issues"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"lism-css": "0.
|
|
42
|
+
"lism-css": "0.10.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@babel/cli": "^7.28.6",
|
|
@@ -51,9 +51,10 @@
|
|
|
51
51
|
"@vitejs/plugin-react-swc": "^3.11.0",
|
|
52
52
|
"glob": "^13.0.6",
|
|
53
53
|
"rollup": "^4.59.0",
|
|
54
|
-
"
|
|
54
|
+
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
55
|
+
"typescript": "^5.8.3",
|
|
55
56
|
"unplugin-dts": "1.0.0-beta.6",
|
|
56
|
-
"vite": "^
|
|
57
|
+
"vite": "^7.3.1"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
60
|
"@types/react": "*",
|
|
@@ -63,6 +64,7 @@
|
|
|
63
64
|
},
|
|
64
65
|
"sideEffects": false,
|
|
65
66
|
"scripts": {
|
|
67
|
+
"format": "prettier --write . --ignore-path ../../.prettierignore",
|
|
66
68
|
"dev": "vite",
|
|
67
69
|
"build": "vite build && pnpm build:css",
|
|
68
70
|
"build:css": "node build-css.js"
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
@layer lism
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
@layer lism-modules {
|
|
2
|
+
.c--accordion {
|
|
3
|
+
--duration: var(--acc-duration, 0.25s);
|
|
4
|
+
}
|
|
5
|
+
.c--accordion_item {
|
|
6
|
+
--_panel-h: 0px;
|
|
7
|
+
--_icon-transform: rotate(0deg);
|
|
8
|
+
}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
/* 開いている時 */
|
|
11
|
+
.c--accordion_item[data-opened] {
|
|
12
|
+
--_icon-transform: rotate(90deg);
|
|
13
|
+
--_panel-h: auto; /* Note: アニメーション時、jsでセットされる */
|
|
14
|
+
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
/* .c--accordion_button {} */
|
|
17
|
+
.c--accordion_panel {
|
|
18
|
+
height: var(--_panel-h);
|
|
19
|
+
transition: height var(--duration);
|
|
20
|
+
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
/* コンテンツの paddingは __panel ではなくこっちにつける */
|
|
23
|
+
/* .c--accordion_content {} */
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
/* パネルが完全に閉じている時にabsoluteで飛ばしておくと、Chromeでも検索時に正常にハイライトされるようになる(なぜかは不明) */
|
|
26
|
+
[hidden] > .c--accordion_content {
|
|
27
|
+
position: absolute;
|
|
28
|
+
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
/* アイコンの描画 */
|
|
31
|
+
.c--accordion_icon {
|
|
32
|
+
display: grid;
|
|
33
|
+
width: 1em;
|
|
34
|
+
height: 1em;
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
&::before,
|
|
37
|
+
&::after {
|
|
38
|
+
content: '';
|
|
39
|
+
display: block;
|
|
40
|
+
grid-area: 1 / 1;
|
|
41
|
+
background-color: currentColor;
|
|
42
|
+
}
|
|
43
|
+
&::before {
|
|
44
|
+
width: 0.1em;
|
|
45
|
+
height: 100%;
|
|
46
|
+
transition: transform var(--duration);
|
|
47
|
+
transform: var(--_icon-transform);
|
|
48
|
+
}
|
|
49
|
+
&::after {
|
|
50
|
+
height: 0.1em;
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
/* フォーカス時のアウトラインを少し内側に寄せる( overflow:hidden によって途切れてしまうので) */
|
|
56
|
+
.c--accordion_button:focus-visible {
|
|
57
|
+
outline: solid 2px currentColor;
|
|
58
|
+
outline-color: revert;
|
|
59
|
+
outline-offset: -3px; /* offset 調整だけだとブラウザ間の差が大きい */
|
|
60
|
+
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
/* --- 「視差効果を減らす」設定を考慮 --- */
|
|
63
|
+
@media (prefers-reduced-motion: reduce) {
|
|
64
|
+
.c--accordion_item {
|
|
65
|
+
--duration: 0s;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
69
|
+
/* --- JSオフ環境の考慮 --- */
|
|
70
|
+
@media (scripting: none) {
|
|
71
|
+
.c--accordion_panel {
|
|
72
|
+
height: auto !important;
|
|
73
|
+
content-visibility: visible !important;
|
|
74
|
+
}
|
|
75
|
+
.c--accordion_content {
|
|
76
|
+
position: static !important;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
79
|
}
|
|
@@ -21,11 +21,11 @@ const slotHtml = rendered.includes('__LISM_ACC_ID__') ? rendered.replaceAll('__L
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
23
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
slotHtml !== null ? (
|
|
25
|
+
<div {...lismProps} set:html={slotHtml} />
|
|
26
|
+
) : (
|
|
27
|
+
<div {...lismProps}>
|
|
28
|
+
<slot />
|
|
29
|
+
</div>
|
|
30
|
+
)
|
|
31
31
|
}
|