@lism-css/ui 0.2.2 → 0.8.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/LICENSE +21 -0
- package/dist/components/Accordion/astro/index.d.ts +10 -10
- package/dist/components/Accordion/getProps.d.ts +40 -19
- package/dist/components/Accordion/react/AccIcon.d.ts +1 -6
- package/dist/components/Accordion/react/Accordion.d.ts +23 -7
- package/dist/components/Accordion/react/index.d.ts +6 -4
- package/dist/components/Accordion/setAccordion.d.ts +4 -1
- package/dist/components/Accordion/setAccordion.js +39 -42
- package/dist/components/Callout/getProps.d.ts +1 -1
- package/dist/components/Details/astro/index.d.ts +13 -0
- package/dist/components/Details/getProps.d.ts +40 -0
- package/dist/components/Details/react/Details.d.ts +37 -0
- package/dist/components/Details/react/index.d.ts +9 -0
- package/dist/components/Modal/getProps.d.ts +2 -2
- package/dist/components/Modal/setModal.d.ts +3 -0
- package/dist/components/Modal/setModal.js +25 -30
- package/dist/components/Tabs/getProps.d.ts +1 -1
- package/dist/components/astro.d.ts +1 -0
- package/dist/components/react.d.ts +1 -0
- package/dist/helper/animation.d.ts +18 -0
- package/dist/helper/animation.js +12 -0
- package/dist/helper/uuid.d.ts +1 -0
- package/dist/scripts/tabs.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +68 -68
- package/src/components/Accordion/_style.css +61 -36
- package/src/components/Accordion/astro/Button.astro +13 -0
- package/src/components/Accordion/astro/Heading.astro +10 -0
- package/src/components/Accordion/astro/Icon.astro +15 -0
- package/src/components/Accordion/astro/Item.astro +31 -0
- package/src/components/Accordion/astro/Panel.astro +14 -0
- package/src/components/Accordion/astro/Root.astro +17 -0
- package/src/components/Accordion/astro/index.js +10 -7
- package/src/components/Accordion/getProps.js +61 -16
- package/src/components/Accordion/react/AccIcon.jsx +5 -4
- package/src/components/Accordion/react/Accordion.jsx +56 -28
- package/src/components/Accordion/react/index.js +6 -3
- package/src/components/Accordion/setAccordion.js +114 -88
- package/src/components/Callout/getProps.ts +1 -1
- package/src/components/Details/_style.css +48 -0
- package/src/components/Details/astro/Content.astro +17 -0
- package/src/components/Details/astro/Details.astro +18 -0
- package/src/components/Details/astro/Icon.astro +14 -0
- package/src/components/{Accordion/astro/AccLabel.astro → Details/astro/Summary.astro} +1 -2
- package/src/components/Details/astro/Title.astro +10 -0
- package/src/components/Details/astro/index.js +10 -0
- package/src/components/Details/getProps.js +23 -0
- package/src/components/Details/react/Details.jsx +66 -0
- package/src/components/Details/react/index.js +6 -0
- package/src/components/Modal/_style.css +7 -7
- package/src/components/Modal/getProps.js +3 -3
- package/src/components/Modal/script.js +1 -0
- package/src/components/Modal/setModal.ts +65 -69
- package/src/components/Tabs/_style.css +4 -4
- package/src/components/Tabs/astro/Tab.astro +1 -1
- package/src/components/Tabs/astro/TabList.astro +1 -1
- package/src/components/Tabs/astro/TabPanel.astro +1 -1
- package/src/components/Tabs/astro/Tabs.astro +4 -3
- package/src/components/Tabs/getProps.js +1 -1
- package/src/components/Tabs/react/Tab.jsx +1 -1
- package/src/components/Tabs/react/TabList.jsx +1 -1
- package/src/components/Tabs/react/TabPanel.jsx +1 -1
- package/src/components/Tabs/script.js +1 -1
- package/src/components/astro.ts +1 -0
- package/src/components/react.ts +1 -0
- package/src/helper/animation.ts +36 -0
- package/src/{components/Tabs/astro/helper.js → helper/uuid.js} +1 -1
- package/dist/components/Tabs/astro/helper.d.ts +0 -1
- package/src/components/Accordion/astro/AccBody.astro +0 -13
- package/src/components/Accordion/astro/AccHeader.astro +0 -13
- package/src/components/Accordion/astro/AccHeaderLabel.astro +0 -12
- package/src/components/Accordion/astro/AccIcon.astro +0 -17
- package/src/components/Accordion/astro/Accordion.astro +0 -22
|
@@ -1,105 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
let THE_TRIGGER: HTMLElement | null = null;
|
|
3
|
-
|
|
4
|
-
// モーダルのアニメーションが完了するのを待つ.
|
|
5
|
-
const waitAnimation = async (element: HTMLElement): Promise<void> => {
|
|
6
|
-
// (子要素も取得する場合は { subtree: true } を指定)
|
|
7
|
-
const animations = element.getAnimations();
|
|
8
|
-
|
|
9
|
-
if (animations.length > 0) {
|
|
10
|
-
// allSettled を使うことで、キャンセルされた場合もrejectせずに完了扱いになる
|
|
11
|
-
await Promise.allSettled(animations.map((a) => a.finished));
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
async function modalOpen(modal: HTMLDialogElement): Promise<void> {
|
|
16
|
-
// すでに open & data-is-open が付いていれば何もしない(連打防止)
|
|
17
|
-
if (modal.open && modal.dataset.isOpen) return;
|
|
18
|
-
|
|
19
|
-
// showModal() でモーダルを開く( open 属性の付与)
|
|
20
|
-
modal.showModal();
|
|
21
|
-
|
|
22
|
-
// 次フレームで data-is-open を付与(CSS側でフェードインアニメーション開始)
|
|
23
|
-
requestAnimationFrame(() => {
|
|
24
|
-
modal.dataset.isOpen = '1';
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
async function modalClose(modal: HTMLDialogElement): Promise<void> {
|
|
28
|
-
// すでに閉じている場合は何もしない
|
|
29
|
-
if (undefined === modal.dataset.isOpen) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// data-open 属性を削除(CSS側でフェードアウトアニメーション開始)
|
|
34
|
-
delete modal.dataset.isOpen;
|
|
35
|
-
|
|
36
|
-
// アニメーション完了を待機
|
|
37
|
-
await waitAnimation(modal);
|
|
38
|
-
|
|
39
|
-
// アニメーション終了後、dialog を閉じる(open属性の削除)
|
|
40
|
-
modal.close();
|
|
41
|
-
}
|
|
1
|
+
import { waitAnimation } from '../../helper/animation';
|
|
42
2
|
|
|
3
|
+
/**
|
|
4
|
+
* モーダルの開閉イベントを設定する
|
|
5
|
+
*/
|
|
43
6
|
export function setEvent(modal: HTMLDialogElement): void {
|
|
44
7
|
// modalがない、またはidがない場合は処理を終了
|
|
45
8
|
if (!modal || !modal.id) return;
|
|
46
9
|
|
|
10
|
+
// オープンした時のトリガー要素を記憶する(data属性を戻すため)
|
|
11
|
+
let theTrigger: HTMLElement | null = null;
|
|
12
|
+
|
|
47
13
|
// モーダルを開くトリガーと閉じるトリガーを取得
|
|
48
|
-
const openTriggers
|
|
49
|
-
const closeTriggers
|
|
14
|
+
const openTriggers = document.querySelectorAll<HTMLElement>(`[data-modal-open="${modal.id}"]`);
|
|
15
|
+
const closeTriggers = modal.querySelectorAll<HTMLElement>(`[data-modal-close="${modal.id}"]`);
|
|
50
16
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
17
|
+
/**
|
|
18
|
+
* ダイアログを開く処理
|
|
19
|
+
* Point: showModal() してから、CSSアニメーション用の data-is-open属性を付与する
|
|
20
|
+
*/
|
|
21
|
+
const openDialog = () => {
|
|
22
|
+
// すでに open & data-is-open が付いていれば何もしない(連打防止)
|
|
23
|
+
if (modal.open && modal.hasAttribute('data-is-open')) return;
|
|
57
24
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (THE_TRIGGER) {
|
|
61
|
-
// THE_TRIGGER.focus(); // showModal()ではフォーカス戻す必要なし
|
|
25
|
+
// showModal() でモーダルを開く( open 属性の付与)
|
|
26
|
+
modal.showModal();
|
|
62
27
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
28
|
+
// 次フレームで data-is-open を付与(CSS側でフェードインアニメーション開始)
|
|
29
|
+
requestAnimationFrame(() => {
|
|
30
|
+
modal.dataset.isOpen = '1';
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* ダイアログを閉じる処理
|
|
36
|
+
* Point: data-is-open属性を削除してCSSアニメーションが終わってから、close() を実行する
|
|
37
|
+
*/
|
|
38
|
+
const closeDialog = async (): Promise<void> => {
|
|
39
|
+
// すでに閉じている場合は何もしない
|
|
40
|
+
if (!modal.hasAttribute('data-is-open')) {
|
|
41
|
+
return;
|
|
66
42
|
}
|
|
67
43
|
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
});
|
|
44
|
+
// data-is-open 属性を削除(CSS側でフェードアウトアニメーション開始)
|
|
45
|
+
modal.removeAttribute('data-is-open');
|
|
71
46
|
|
|
72
|
-
|
|
47
|
+
// アニメーション完了を待機
|
|
48
|
+
await waitAnimation(modal);
|
|
49
|
+
|
|
50
|
+
// アニメーション終了後、dialog を閉じる(open属性の削除)
|
|
51
|
+
modal.close();
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// openボタンにイベント登録
|
|
73
55
|
openTriggers.forEach((trigger) => {
|
|
74
|
-
trigger?.addEventListener('click', (
|
|
56
|
+
trigger?.addEventListener('click', () => {
|
|
75
57
|
// button側にもdata属性付与
|
|
76
58
|
trigger.dataset.targetOpened = '1';
|
|
77
|
-
|
|
59
|
+
theTrigger = trigger; // close() 時にdata属性削除するために記憶
|
|
78
60
|
|
|
79
61
|
// モーダルを開く
|
|
80
|
-
|
|
62
|
+
openDialog();
|
|
81
63
|
});
|
|
82
64
|
});
|
|
83
65
|
|
|
84
|
-
//
|
|
66
|
+
// closeボタンにイベント登録
|
|
85
67
|
closeTriggers.forEach((trigger) => {
|
|
86
|
-
trigger?.addEventListener('click', (
|
|
87
|
-
|
|
68
|
+
trigger?.addEventListener('click', () => {
|
|
69
|
+
void closeDialog();
|
|
88
70
|
});
|
|
89
71
|
});
|
|
90
72
|
|
|
73
|
+
// 余白クリックで閉じる
|
|
74
|
+
modal.addEventListener('click', (e) => {
|
|
75
|
+
if (e.target === modal) {
|
|
76
|
+
void closeDialog();
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// close() 完了時にトリガーのdata属性をリセット
|
|
81
|
+
modal.addEventListener('close', () => {
|
|
82
|
+
if (theTrigger) {
|
|
83
|
+
theTrigger.removeAttribute('data-target-opened');
|
|
84
|
+
theTrigger = null;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
91
88
|
/**
|
|
92
89
|
* ESCキーで閉じた時もアニメーションを実行する処理
|
|
93
90
|
*/
|
|
94
91
|
modal.addEventListener('cancel', (e) => {
|
|
95
92
|
e.preventDefault(); // デフォルトの即時 close() を防ぐ
|
|
96
|
-
|
|
93
|
+
void closeDialog(); // 自分で用意したクローズ処理
|
|
97
94
|
});
|
|
98
95
|
}
|
|
99
96
|
|
|
100
97
|
const setModal = () => {
|
|
101
|
-
const modals = document.querySelectorAll('.
|
|
102
|
-
|
|
98
|
+
const modals = document.querySelectorAll('.c--modal');
|
|
103
99
|
modals?.forEach((target) => {
|
|
104
100
|
setEvent(target as HTMLDialogElement);
|
|
105
101
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
@layer lism.modules {
|
|
2
|
-
.
|
|
2
|
+
.c--tabs {
|
|
3
3
|
display: grid;
|
|
4
4
|
grid: 'list' 'panel' / 100%;
|
|
5
5
|
}
|
|
6
|
-
.
|
|
6
|
+
.c--tabs_list {
|
|
7
7
|
grid-area: list;
|
|
8
8
|
display: flex;
|
|
9
9
|
overflow-x: auto;
|
|
10
10
|
}
|
|
11
|
-
.
|
|
11
|
+
.c--tabs_tab {
|
|
12
12
|
&[aria-selected='true'] {
|
|
13
13
|
--_notSelected: ;
|
|
14
14
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.
|
|
24
|
+
.c--tabs_panel {
|
|
25
25
|
grid-area: panel;
|
|
26
26
|
width: 100%;
|
|
27
27
|
|
|
@@ -12,6 +12,6 @@ const { tabId = 'tab', index = 0, isActive, ...props } = Astro.props;
|
|
|
12
12
|
const controlId = `${tabId}-${index}`;
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
<Lism tag='button' lismClass='
|
|
15
|
+
<Lism tag='button' lismClass='c--tabs_tab' setPlain role='tab' aria-controls={controlId} aria-selected={isActive ? 'true' : 'false'} {...props}>
|
|
16
16
|
<slot />
|
|
17
17
|
</Lism>
|
|
@@ -11,6 +11,6 @@ const { tabId = 'tab', index = 0, isActive = false, ...props } = Astro.props;
|
|
|
11
11
|
const controlId = `${tabId}-${index}`;
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
<Lism id={controlId} role='tabpanel' aria-hidden={isActive ? 'false' : 'true'} lismClass='
|
|
14
|
+
<Lism id={controlId} role='tabpanel' aria-hidden={isActive ? 'false' : 'true'} lismClass='c--tabs_panel' {...props}>
|
|
15
15
|
<slot />
|
|
16
16
|
</Lism>
|
|
@@ -4,7 +4,8 @@ import { Lism } from 'lism-css/astro';
|
|
|
4
4
|
// import Tab from './Tab.astro';
|
|
5
5
|
// import TabPanel from './TabPanel.astro';
|
|
6
6
|
import TabList from './TabList.astro';
|
|
7
|
-
import
|
|
7
|
+
import uuid from '../../../helper/uuid.js';
|
|
8
|
+
|
|
8
9
|
import transformTabitems from './transformTabitems.js';
|
|
9
10
|
import getTabsProps from '../getProps';
|
|
10
11
|
|
|
@@ -22,7 +23,7 @@ import '../_style.css';
|
|
|
22
23
|
const { defaultIndex = 1, tabId = '', listProps = {}, ...props } = Astro.props || {};
|
|
23
24
|
|
|
24
25
|
// tabID生成
|
|
25
|
-
const theTabID = tabId ? tabId :
|
|
26
|
+
const theTabID = tabId ? tabId : uuid();
|
|
26
27
|
|
|
27
28
|
// 子要素の方から順番に処理されていくので、文字列処理でデータを抽出
|
|
28
29
|
const { btns, panels } = transformTabitems(await Astro.slots.render('default'), theTabID, defaultIndex);
|
|
@@ -50,7 +51,7 @@ const hasItems = btns.length > 0;
|
|
|
50
51
|
|
|
51
52
|
<script>
|
|
52
53
|
import setTabs from '../setTabs';
|
|
53
|
-
const tabsAll = document.querySelectorAll('.
|
|
54
|
+
const tabsAll = document.querySelectorAll('.c--tabs');
|
|
54
55
|
tabsAll.forEach((tabs) => {
|
|
55
56
|
setTabs(tabs);
|
|
56
57
|
});
|
|
@@ -4,5 +4,5 @@ import { Lism } from 'lism-css/react';
|
|
|
4
4
|
export default function TabPanel({ tabId = 'tab', isActive = false, index = 0, ...props }) {
|
|
5
5
|
const controlId = `${tabId}-${index}`;
|
|
6
6
|
|
|
7
|
-
return <Lism id={controlId} role='tabpanel' aria-hidden={isActive ? 'false' : 'true'} lismClass='
|
|
7
|
+
return <Lism id={controlId} role='tabpanel' aria-hidden={isActive ? 'false' : 'true'} lismClass='c--tabs_panel' {...props} />;
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import setTabs from './setTabs.js';
|
|
2
2
|
|
|
3
3
|
document.addEventListener('DOMContentLoaded', function () {
|
|
4
|
-
const tabsAll = document.querySelectorAll('.
|
|
4
|
+
const tabsAll = document.querySelectorAll('.c--tabs');
|
|
5
5
|
tabsAll.forEach((tabs) => {
|
|
6
6
|
setTabs(tabs);
|
|
7
7
|
});
|
package/src/components/astro.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { default as Badge } from './Badge/astro';
|
|
|
5
5
|
export { default as Button } from './Button/astro';
|
|
6
6
|
export { default as Callout } from './Callout/astro';
|
|
7
7
|
export { default as Chat } from './Chat/astro';
|
|
8
|
+
export { default as Details } from './Details/astro';
|
|
8
9
|
export { default as Modal } from './Modal/astro';
|
|
9
10
|
export { default as NavMenu } from './NavMenu/astro';
|
|
10
11
|
export { default as ShapeDivider } from './ShapeDivider/astro';
|
package/src/components/react.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { default as Badge } from './Badge/react';
|
|
|
5
5
|
export { default as Button } from './Button/react';
|
|
6
6
|
export { default as Callout } from './Callout/react';
|
|
7
7
|
export { default as Chat } from './Chat/react';
|
|
8
|
+
export { default as Details } from './Details/react';
|
|
8
9
|
export { default as Modal } from './Modal/react';
|
|
9
10
|
export { default as NavMenu } from './NavMenu/react';
|
|
10
11
|
export { default as ShapeDivider } from './ShapeDivider/react';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// アニメーション完了時のステータス
|
|
2
|
+
type AnimationStatus = 'none' | 'finished' | 'canceled';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 1フレーム待機する(requestAnimationFrame のPromiseラッパー)
|
|
6
|
+
*/
|
|
7
|
+
export const waitFrame = (): Promise<number> => new Promise((resolve) => requestAnimationFrame(resolve));
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 要素のアニメーションが完了するのを待つ
|
|
11
|
+
* @returns アニメーションの結果ステータス
|
|
12
|
+
* - 'none': アニメーションが実行されていなかった
|
|
13
|
+
* - 'finished': すべてのアニメーションが正常に完了
|
|
14
|
+
* - 'canceled': pause() 等でキャンセルされたアニメーションがあった
|
|
15
|
+
*/
|
|
16
|
+
export const waitAnimation = async (el: HTMLElement): Promise<AnimationStatus> => {
|
|
17
|
+
const animations = el.getAnimations();
|
|
18
|
+
|
|
19
|
+
// アニメーションがなければ 'none' を返す
|
|
20
|
+
if (animations.length === 0) return 'none';
|
|
21
|
+
|
|
22
|
+
// allSettled を使うことで、キャンセル時も例外にならずに結果を取得できる
|
|
23
|
+
const results = await Promise.allSettled(animations.map((a) => a.finished));
|
|
24
|
+
|
|
25
|
+
// ( pause()で止めた時用 )rejected があれば 'canceled'
|
|
26
|
+
return results.every((r) => r.status === 'fulfilled') ? 'finished' : 'canceled';
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 実行中のアニメーションがあれば一旦停止させる
|
|
31
|
+
*/
|
|
32
|
+
export const maybePauseAnimation = (el: HTMLElement): void => {
|
|
33
|
+
const animations = el.getAnimations();
|
|
34
|
+
if (animations.length === 0) return;
|
|
35
|
+
animations.forEach((a) => a.pause());
|
|
36
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid
|
|
2
|
-
export function uuidv4() {
|
|
2
|
+
export default function uuidv4() {
|
|
3
3
|
return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) =>
|
|
4
4
|
(c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
|
|
5
5
|
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function uuidv4(): string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
// import type { LismProps } from 'lism-css/types';
|
|
3
|
-
import { Lism } from 'lism-css/astro';
|
|
4
|
-
import { defaultProps } from '../getProps';
|
|
5
|
-
|
|
6
|
-
const { flow, innerProps, ...props } = Astro.props || {};
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
<Lism {...defaultProps.body} {...props}>
|
|
10
|
-
<Lism layout='flow' flow={flow} {...defaultProps.inner} {...innerProps}>
|
|
11
|
-
<slot />
|
|
12
|
-
</Lism>
|
|
13
|
-
</Lism>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
// import type { LismProps } from 'lism-css/types';
|
|
3
|
-
import { Lism } from 'lism-css/astro';
|
|
4
|
-
import { defaultProps } from '../getProps';
|
|
5
|
-
|
|
6
|
-
// interface Props extends LismProps {}
|
|
7
|
-
|
|
8
|
-
const props = Astro.props || {};
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<Lism tag='summary' {...defaultProps.header} {...props}>
|
|
12
|
-
<slot />
|
|
13
|
-
</Lism>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { Lism, Icon } from 'lism-css/astro';
|
|
3
|
-
import { getAccIconProps } from '../getProps';
|
|
4
|
-
|
|
5
|
-
// Propsの定義
|
|
6
|
-
// interface Props extends LismProps {
|
|
7
|
-
// icon?: string;
|
|
8
|
-
// size?: string;
|
|
9
|
-
// iconProps?: Object;
|
|
10
|
-
// }
|
|
11
|
-
|
|
12
|
-
const { viewBox, icon = 'caret-down', ...props } = Astro.props || {};
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
<Lism {...getAccIconProps(props)}>
|
|
16
|
-
{Astro.slots.has('default') ? <slot /> : <Icon viewBox={viewBox} icon={icon} />}
|
|
17
|
-
</Lism>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
// import type { LismProps } from 'lism-css/types';
|
|
3
|
-
import getLismProps from 'lism-css/lib/getLismProps';
|
|
4
|
-
import { getAccProps } from '../getProps';
|
|
5
|
-
|
|
6
|
-
import '../_style.css';
|
|
7
|
-
|
|
8
|
-
// Propsの定義
|
|
9
|
-
// interface Props extends LismProps {
|
|
10
|
-
// duration?: string | number;
|
|
11
|
-
// }
|
|
12
|
-
const props = Astro.props || {};
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
<details {...getLismProps(getAccProps(props))}>
|
|
16
|
-
<slot />
|
|
17
|
-
</details>
|
|
18
|
-
|
|
19
|
-
<script>
|
|
20
|
-
import setAccordion from '../setAccordion';
|
|
21
|
-
setAccordion();
|
|
22
|
-
</script>
|