@lism-css/ui 0.0.0-dev.2 → 0.0.0-dev.4
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/astro/__setEvent.d.ts +1 -0
- package/dist/components/Accordion/astro/index.d.ts +9 -0
- package/dist/components/Accordion/getProps.d.ts +31 -0
- package/dist/components/Accordion/react/AccIcon.d.ts +6 -0
- package/dist/components/Accordion/react/Accordion.d.ts +23 -0
- package/dist/components/Accordion/react/index.d.ts +11 -0
- package/dist/components/Accordion/script.d.ts +1 -0
- package/dist/components/Accordion/setAccordion.d.ts +3 -0
- package/dist/components/Accordion/setAccordion.js +37 -0
- package/dist/components/Modal/astro/index.d.ts +8 -0
- package/dist/components/Modal/getProps.d.ts +41 -0
- package/dist/components/Modal/react/Body.d.ts +4 -0
- package/dist/components/Modal/react/CloseBtn.d.ts +7 -0
- package/dist/components/Modal/react/Inner.d.ts +4 -0
- package/dist/components/Modal/react/Modal.d.ts +6 -0
- package/dist/components/Modal/react/OpenBtn.d.ts +5 -0
- package/dist/components/Modal/react/index.d.ts +13 -0
- package/dist/components/Modal/script.d.ts +1 -0
- package/dist/components/Modal/setModal.d.ts +3 -0
- package/dist/components/Modal/setModal.js +42 -0
- package/dist/components/Tabs/astro/helper.d.ts +1 -0
- package/dist/components/Tabs/astro/index.d.ts +8 -0
- package/dist/components/Tabs/astro/transformTabitems.d.ts +4 -0
- package/dist/components/Tabs/getProps.d.ts +6 -0
- package/dist/components/Tabs/react/Tab.d.ts +6 -0
- package/dist/components/Tabs/react/TabItem.d.ts +4 -0
- package/dist/components/Tabs/react/TabList.d.ts +1 -0
- package/dist/components/Tabs/react/TabPanel.d.ts +6 -0
- package/dist/components/Tabs/react/Tabs.d.ts +8 -0
- package/dist/components/Tabs/react/index.d.ts +13 -0
- package/dist/components/Tabs/script.d.ts +1 -0
- package/dist/components/Tabs/setTabs.d.ts +2 -0
- package/dist/components/Tabs/setTabs.js +29 -0
- package/dist/components/__contexts.d.ts +2 -0
- package/dist/components/astro.d.ts +3 -0
- package/dist/components/react.d.ts +3 -0
- package/dist/scripts/accordion.js +4 -0
- package/dist/scripts/modal.js +4 -0
- package/dist/scripts/tabs.js +6 -0
- package/dist/style.css +1 -0
- package/package.json +68 -74
- package/src/components/Accordion/_style.css +54 -0
- package/src/components/Accordion/astro/Accordion.astro +2 -1
- package/src/components/Accordion/{AccIcon.jsx → react/AccIcon.jsx} +1 -1
- package/src/components/Accordion/{Accordion.jsx → react/Accordion.jsx} +4 -2
- package/src/components/Modal/_style.css +44 -0
- package/src/components/Modal/astro/Body.astro +13 -0
- package/src/components/Modal/astro/CloseBtn.astro +24 -0
- package/src/components/Modal/astro/Inner.astro +13 -0
- package/src/components/Modal/astro/Modal.astro +21 -0
- package/src/components/Modal/astro/OpenBtn.astro +14 -0
- package/src/components/Modal/astro/index.js +7 -0
- package/src/components/Modal/getProps.js +1 -1
- package/src/components/Modal/{Body.jsx → react/Body.jsx} +2 -2
- package/src/components/Modal/{CloseBtn.jsx → react/CloseBtn.jsx} +4 -3
- package/src/components/Modal/{Inner.jsx → react/Inner.jsx} +2 -2
- package/src/components/Modal/{Modal.jsx → react/Modal.jsx} +5 -3
- package/src/components/Modal/{OpenBtn.jsx → react/OpenBtn.jsx} +3 -2
- package/src/components/Tabs/_style.css +32 -0
- package/src/components/Tabs/astro/Tab.astro +17 -0
- package/src/components/Tabs/astro/TabItem.astro +8 -0
- package/src/components/Tabs/astro/TabList.astro +8 -0
- package/src/components/Tabs/astro/TabPanel.astro +16 -0
- package/src/components/Tabs/astro/Tabs.astro +57 -0
- package/src/components/Tabs/astro/helper.js +6 -0
- package/src/components/Tabs/astro/index.js +7 -0
- package/src/components/Tabs/astro/transformTabitems.js +40 -0
- package/src/components/Tabs/getProps.js +1 -1
- package/src/components/Tabs/{Tab.jsx → react/Tab.jsx} +1 -1
- package/src/components/Tabs/{TabList.jsx → react/TabList.jsx} +1 -1
- package/src/components/Tabs/{TabPanel.jsx → react/TabPanel.jsx} +1 -1
- package/src/components/Tabs/{Tabs.jsx → react/Tabs.jsx} +4 -2
- package/src/components/Tabs/script.js +2 -2
- package/src/components/Tabs/{setEvent.js → setTabs.js} +2 -2
- package/src/components/astro.ts +2 -2
- package/src/components/react.ts +3 -3
- package/src/style.scss +1 -0
- package/LICENSE +0 -21
- package/src/components/Accordion/_style.scss +0 -54
- /package/src/components/Accordion/{index.js → react/index.js} +0 -0
- /package/src/components/Modal/{index.js → react/index.js} +0 -0
- /package/src/components/Tabs/{TabItem.jsx → react/TabItem.jsx} +0 -0
- /package/src/components/Tabs/{index.js → react/index.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default setEvent;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function getAccProps({ lismClass, ...props }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
lismClass: any;
|
|
4
|
+
}): {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
};
|
|
7
|
+
export function getAccIconProps({ isTrigger, ...props }: {
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
isTrigger: any;
|
|
10
|
+
}): {
|
|
11
|
+
lismClass: string;
|
|
12
|
+
tag: string;
|
|
13
|
+
};
|
|
14
|
+
export namespace defaultProps {
|
|
15
|
+
namespace header {
|
|
16
|
+
let lismClass: string;
|
|
17
|
+
}
|
|
18
|
+
namespace label {
|
|
19
|
+
let lismClass_1: string;
|
|
20
|
+
export { lismClass_1 as lismClass };
|
|
21
|
+
export let tag: string;
|
|
22
|
+
}
|
|
23
|
+
namespace body {
|
|
24
|
+
let lismClass_2: string;
|
|
25
|
+
export { lismClass_2 as lismClass };
|
|
26
|
+
}
|
|
27
|
+
namespace inner {
|
|
28
|
+
let lismClass_3: string;
|
|
29
|
+
export { lismClass_3 as lismClass };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export function Accordion({ children, ...props }: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
children: any;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
export function Header({ children, ...props }: {
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
children: any;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export function Label({ children, ...props }: {
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
children: any;
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
export function Body({ children, flow, innerProps, ...props }: {
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
children: any;
|
|
17
|
+
flow: any;
|
|
18
|
+
innerProps: any;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
export function HeaderLabel({ children, ...props }: {
|
|
21
|
+
[x: string]: any;
|
|
22
|
+
children: any;
|
|
23
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Accordion as Root, Header, Label, Body, HeaderLabel } from './Accordion';
|
|
2
|
+
import { default as Icon } from './AccIcon';
|
|
3
|
+
declare namespace _default {
|
|
4
|
+
export { Root };
|
|
5
|
+
export { Header };
|
|
6
|
+
export { Label };
|
|
7
|
+
export { Icon };
|
|
8
|
+
export { Body };
|
|
9
|
+
export { HeaderLabel };
|
|
10
|
+
}
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const s = (t) => Promise.all(t.getAnimations().map((e) => e.finished)), d = async (t, e = !1) => {
|
|
2
|
+
if (t.dataset.animating && !e) return;
|
|
3
|
+
t.dataset.animating = "1";
|
|
4
|
+
const n = t.querySelector(".d--accordion_body");
|
|
5
|
+
t.open ? t.open && (t.removeAttribute("data-opened"), await s(n), delete t.dataset.animating, t.open = !1) : (t.open = !0, setTimeout(async () => {
|
|
6
|
+
t.setAttribute("data-opened", ""), await s(n), delete t.dataset.animating;
|
|
7
|
+
}, 5));
|
|
8
|
+
}, u = (t, e) => {
|
|
9
|
+
const n = e.open, o = e.hasAttribute("data-opened");
|
|
10
|
+
n && !o && e.setAttribute("data-opened", ""), !n && o && e.removeAttribute("data-opened");
|
|
11
|
+
}, p = (t) => {
|
|
12
|
+
const e = t, n = e.querySelector('[data-role="trigger"]') || e.querySelector("summary");
|
|
13
|
+
if (!n) return;
|
|
14
|
+
let o = !1;
|
|
15
|
+
const r = e.parentNode;
|
|
16
|
+
r != null && (o = r.dataset.accordionMultiple !== "disallow");
|
|
17
|
+
const c = (a) => {
|
|
18
|
+
if (a.preventDefault(), !o && !e.open) {
|
|
19
|
+
const l = r.querySelector("[data-opened]");
|
|
20
|
+
l != null && d(l, !0);
|
|
21
|
+
}
|
|
22
|
+
d(e);
|
|
23
|
+
}, i = (a) => {
|
|
24
|
+
u(a, e);
|
|
25
|
+
};
|
|
26
|
+
return n.addEventListener("click", c), e.addEventListener("toggle", i), () => {
|
|
27
|
+
n.removeEventListener("click", c), e.removeEventListener("toggle", i);
|
|
28
|
+
};
|
|
29
|
+
}, m = () => {
|
|
30
|
+
document.querySelectorAll(".d--accordion").forEach((e) => {
|
|
31
|
+
p(e);
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
m as default,
|
|
36
|
+
p as setEvent
|
|
37
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export function getProps({ lismClass, duration, style, ...props }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
lismClass?: string | undefined;
|
|
4
|
+
duration: any;
|
|
5
|
+
style?: {} | undefined;
|
|
6
|
+
}): {
|
|
7
|
+
style: {};
|
|
8
|
+
lismClass: any;
|
|
9
|
+
setPlain: boolean;
|
|
10
|
+
tag: string;
|
|
11
|
+
};
|
|
12
|
+
export function getInnerProps({ lismClass, offset, style, ...props }: {
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
lismClass?: string | undefined;
|
|
15
|
+
offset: any;
|
|
16
|
+
style?: {} | undefined;
|
|
17
|
+
}): {
|
|
18
|
+
lismClass: any;
|
|
19
|
+
style: {};
|
|
20
|
+
};
|
|
21
|
+
export namespace defaultProps {
|
|
22
|
+
namespace body {
|
|
23
|
+
let lismClass: string;
|
|
24
|
+
}
|
|
25
|
+
namespace closeBtn {
|
|
26
|
+
let tag: string;
|
|
27
|
+
let setPlain: boolean;
|
|
28
|
+
let hov: string;
|
|
29
|
+
let d: string;
|
|
30
|
+
}
|
|
31
|
+
namespace openBtn {
|
|
32
|
+
let tag_1: string;
|
|
33
|
+
export { tag_1 as tag };
|
|
34
|
+
let setPlain_1: boolean;
|
|
35
|
+
export { setPlain_1 as setPlain };
|
|
36
|
+
let hov_1: string;
|
|
37
|
+
export { hov_1 as hov };
|
|
38
|
+
let d_1: string;
|
|
39
|
+
export { d_1 as d };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as Root } from './Modal';
|
|
2
|
+
import { default as Inner } from './Inner';
|
|
3
|
+
import { default as Body } from './Body';
|
|
4
|
+
import { default as CloseBtn } from './CloseBtn';
|
|
5
|
+
import { default as OpenBtn } from './OpenBtn';
|
|
6
|
+
declare namespace _default {
|
|
7
|
+
export { Root };
|
|
8
|
+
export { Inner };
|
|
9
|
+
export { Body };
|
|
10
|
+
export { CloseBtn };
|
|
11
|
+
export { OpenBtn };
|
|
12
|
+
}
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
let s = null;
|
|
2
|
+
const o = async (e) => {
|
|
3
|
+
const n = e.getAnimations();
|
|
4
|
+
n.length > 0 && await Promise.allSettled(n.map((c) => c.finished));
|
|
5
|
+
};
|
|
6
|
+
async function d(e) {
|
|
7
|
+
e.open && e.dataset.isOpen || (e.showModal(), requestAnimationFrame(() => {
|
|
8
|
+
e.dataset.isOpen = "1";
|
|
9
|
+
}));
|
|
10
|
+
}
|
|
11
|
+
async function a(e) {
|
|
12
|
+
e.dataset.isOpen !== void 0 && (delete e.dataset.isOpen, await o(e), e.close());
|
|
13
|
+
}
|
|
14
|
+
function l(e) {
|
|
15
|
+
if (!e || !e.id) return;
|
|
16
|
+
const n = document.querySelectorAll(`[data-modal-open="${e.id}"]`), c = e.querySelectorAll(`[data-modal-close="${e.id}"]`);
|
|
17
|
+
e.addEventListener("click", (t) => {
|
|
18
|
+
t.target === e && a(e);
|
|
19
|
+
}), e.addEventListener("close", (t) => {
|
|
20
|
+
s && (delete s.dataset.targetOpened, s = null), a(e);
|
|
21
|
+
}), n.forEach((t) => {
|
|
22
|
+
t == null || t.addEventListener("click", (i) => {
|
|
23
|
+
t.dataset.targetOpened = "1", s = t, d(e);
|
|
24
|
+
});
|
|
25
|
+
}), c.forEach((t) => {
|
|
26
|
+
t == null || t.addEventListener("click", (i) => {
|
|
27
|
+
a(e);
|
|
28
|
+
});
|
|
29
|
+
}), e.addEventListener("cancel", (t) => {
|
|
30
|
+
t.preventDefault(), a(e);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const u = () => {
|
|
34
|
+
const e = document.querySelectorAll(".d--modal");
|
|
35
|
+
e == null || e.forEach((n) => {
|
|
36
|
+
l(n);
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
u as default,
|
|
41
|
+
l as setEvent
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function uuidv4(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function TabList(props: any): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export default function Tabs({ tabId, defaultIndex, listProps, children, ...props }: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
tabId?: string | undefined;
|
|
5
|
+
defaultIndex?: number | undefined;
|
|
6
|
+
listProps?: {} | undefined;
|
|
7
|
+
children: any;
|
|
8
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as Root } from './Tabs';
|
|
2
|
+
import { default as List } from './TabList';
|
|
3
|
+
import { default as Panel } from './TabPanel';
|
|
4
|
+
import { default as Item } from './TabItem';
|
|
5
|
+
import { default as Tab } from './Tab';
|
|
6
|
+
declare namespace _default {
|
|
7
|
+
export { Root };
|
|
8
|
+
export { List };
|
|
9
|
+
export { Panel };
|
|
10
|
+
export { Item };
|
|
11
|
+
export { Tab };
|
|
12
|
+
}
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function b(t) {
|
|
2
|
+
t.preventDefault();
|
|
3
|
+
const r = t.currentTarget;
|
|
4
|
+
c(r);
|
|
5
|
+
}
|
|
6
|
+
const c = (t) => {
|
|
7
|
+
if (t.getAttribute("aria-selected") === "true") return;
|
|
8
|
+
const e = t.getAttribute("aria-controls"), n = document.getElementById(e);
|
|
9
|
+
if (n === null) return;
|
|
10
|
+
const s = t.parentNode.parentNode.querySelector('[aria-selected="true"]'), o = s.getAttribute("aria-controls"), a = document.getElementById(o);
|
|
11
|
+
t.setAttribute("aria-selected", "true"), s.setAttribute("aria-selected", "false"), a.setAttribute("aria-hidden", "true"), n.setAttribute("aria-hidden", "false");
|
|
12
|
+
};
|
|
13
|
+
function f(t) {
|
|
14
|
+
var i;
|
|
15
|
+
t.querySelectorAll('button[role="tab"]').forEach((d) => {
|
|
16
|
+
d.addEventListener("click", function(u) {
|
|
17
|
+
b(u);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
const e = (i = window == null ? void 0 : window.location) == null ? void 0 : i.href;
|
|
21
|
+
if (!e || !(e.indexOf("?lism-tab=") !== -1)) return;
|
|
22
|
+
const o = new URL(e).searchParams.get("lism-tab"), a = t.querySelector(`[aria-controls="${o}"]`);
|
|
23
|
+
a && (t.dataset.hasTabLink = "1", c(a), setTimeout(() => {
|
|
24
|
+
delete t.dataset.hasTabLink;
|
|
25
|
+
}, 10));
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
f as default
|
|
29
|
+
};
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer lism.modules{.d--accordion{--duration:var(--acc-duration,0.4s)}.d--accordion[data-opened]{--_notOpen: }.d--accordion:not([data-opened]){--_isOpen: }.d--accordion_header{align-items:center;display:grid;gap:.5em;grid:auto/1fr auto;outline-offset:-1px;&::-webkit-details-marker{display:none}}.d--accordion_body{display:grid;grid:1fr/auto;transition-duration:var(--duration);transition-property:margin-block,padding-block,opacity,grid-template}.d--accordion_inner{overflow:hidden}.d--accordion:not([data-opened])>.d--accordion_body{grid:0fr/auto;margin-block:0!important;padding-block:0!important}.d--accordion_icon{display:grid}.d--accordion_icon .a--icon{rotate:var(--_isOpen,-180deg);transition-duration:var(--duration)}}
|
package/package.json
CHANGED
|
@@ -1,75 +1,69 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"build:css": "node bin/script-build-css.js",
|
|
71
|
-
"lint": "pnpm lint:style",
|
|
72
|
-
"lint:style": "stylelint '**/*.{css,scss}'",
|
|
73
|
-
"preview": "vite preview"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
2
|
+
"name": "@lism-css/ui",
|
|
3
|
+
"version": "0.0.0-dev.4",
|
|
4
|
+
"description": "UI components by lism-css.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "ddryo",
|
|
7
|
+
"url": "https://github.com/ddryo"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"css-framework",
|
|
12
|
+
"astro-component",
|
|
13
|
+
"react-component"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "vite",
|
|
17
|
+
"build": "vite build && pnpm build:css",
|
|
18
|
+
"build:css": "node build-css.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"src"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"exports": {
|
|
27
|
+
"./react": {
|
|
28
|
+
"import": "./src/components/react.js",
|
|
29
|
+
"types": "./dist/components/index.d.ts"
|
|
30
|
+
},
|
|
31
|
+
"./astro": {
|
|
32
|
+
"import": "./src/components/astro.js",
|
|
33
|
+
"types": "./dist/components/index.d.ts"
|
|
34
|
+
},
|
|
35
|
+
"./scripts/*": "./dist/scripts/*.js",
|
|
36
|
+
"./style.css": "./dist/style.css"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://www.lism.style",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/lism-css/lism-css/tree/main/packages/lism-css"
|
|
42
|
+
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/lism-css/lism-css/issues"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"lism-css": "workspace:*"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@babel/cli": "^7.27.2",
|
|
51
|
+
"@babel/core": "^7.27.3",
|
|
52
|
+
"@babel/preset-env": "^7.27.2",
|
|
53
|
+
"@babel/preset-react": "^7.27.1",
|
|
54
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
55
|
+
"@vitejs/plugin-react-swc": "^3.10.0",
|
|
56
|
+
"glob": "^11.0.2",
|
|
57
|
+
"rollup": "^4.41.1",
|
|
58
|
+
"typescript": "~5.8.3",
|
|
59
|
+
"unplugin-dts": "1.0.0-beta.6",
|
|
60
|
+
"vite": "^6.3.5"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"@types/react": "*",
|
|
64
|
+
"@types/react-dom": "*",
|
|
65
|
+
"react": "^18 || ^19",
|
|
66
|
+
"react-dom": "^18 || ^19"
|
|
67
|
+
},
|
|
68
|
+
"sideEffects": false
|
|
69
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@layer lism.modules {
|
|
2
|
+
.d--accordion {
|
|
3
|
+
--duration: var(--acc-duration, 0.4s);
|
|
4
|
+
}
|
|
5
|
+
.d--accordion[data-opened] {
|
|
6
|
+
--_notOpen: ;
|
|
7
|
+
}
|
|
8
|
+
.d--accordion:not([data-opened]) {
|
|
9
|
+
--_isOpen: ;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.d--accordion_header {
|
|
13
|
+
display: grid;
|
|
14
|
+
grid: auto / 1fr auto;
|
|
15
|
+
gap: 0.5em;
|
|
16
|
+
align-items: center;
|
|
17
|
+
outline-offset: -1px; /* overflow:clip|hidden; で見えなくなってしまうのを防ぐ */
|
|
18
|
+
|
|
19
|
+
/* Safariで表示されるデフォルトの三角形アイコンを消す */
|
|
20
|
+
&::-webkit-details-marker {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.d--accordion_body {
|
|
26
|
+
display: grid;
|
|
27
|
+
grid: 1fr / auto;
|
|
28
|
+
transition-property: margin-block, padding-block, opacity, grid-template;
|
|
29
|
+
transition-duration: var(--duration);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* ※ 正常な animation には必須 */
|
|
33
|
+
.d--accordion_inner {
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* 閉じている時 */
|
|
38
|
+
.d--accordion:not([data-opened]) > .d--accordion_body {
|
|
39
|
+
grid: 0fr / auto;
|
|
40
|
+
padding-block: 0 !important;
|
|
41
|
+
margin-block: 0 !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* アコーディオンブロックのネスト時、別のアイコンタイプにすると表示が崩れるがそこまでは考慮しない。 */
|
|
45
|
+
.d--accordion_icon {
|
|
46
|
+
display: grid;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* .d--accordion_icon 自体にborderつけたりすると回転が見えてしまうので、中にある .a--icon を回転させる。 */
|
|
50
|
+
.d--accordion_icon .a--icon {
|
|
51
|
+
transition-duration: var(--duration);
|
|
52
|
+
rotate: var(--_isOpen, -180deg);
|
|
53
|
+
}
|
|
54
|
+
}
|