@lism-css/ui 0.9.3 → 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/Chat/getProps.js +1 -6
- 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/NavMenu/getProps.js +2 -2
- package/dist/components/Tabs/react/Tab.js +1 -12
- package/dist/components/Tabs/react/Tabs.js +1 -3
- package/dist/components/astro.d.ts +2 -0
- package/dist/components/react.d.ts +2 -0
- package/dist/components/react.js +20 -16
- package/dist/lism-css/dist/components/atomic/Decorator/getProps.js +10 -10
- package/dist/lism-css/dist/components/atomic/Icon/getProps.js +28 -27
- package/dist/lism-css/dist/config/defaults/props.js +6 -1
- package/dist/lism-css/dist/config/defaults/tokens.js +1 -1
- package/dist/lism-css/dist/lib/getMaybeCssVar.js +26 -21
- package/dist/style.css +1 -1
- package/dist/ui.css +1 -1
- package/package.json +5 -4
- 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 +34 -34
- 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 +10 -10
- 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 +44 -46
- 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
- package/dist/lism-css/dist/components/getFilterProps.js +0 -23
- package/dist/lism-css/dist/components/setMaybeTransformStyles.js +0 -7
|
@@ -4,100 +4,100 @@ import { waitAnimation } from '../../helper/animation';
|
|
|
4
4
|
* モーダルの開閉イベントを設定する
|
|
5
5
|
*/
|
|
6
6
|
export function setEvent(modal: HTMLDialogElement): void {
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
7
|
+
// modalがない、またはidがない場合は処理を終了
|
|
8
|
+
if (!modal || !modal.id) return;
|
|
9
|
+
|
|
10
|
+
// オープンした時のトリガー要素を記憶する(data属性を戻すため)
|
|
11
|
+
let theTrigger: HTMLElement | null = null;
|
|
12
|
+
|
|
13
|
+
// モーダルを開くトリガーと閉じるトリガーを取得
|
|
14
|
+
const openTriggers = document.querySelectorAll<HTMLElement>(`[data-modal-open="${modal.id}"]`);
|
|
15
|
+
const closeTriggers = modal.querySelectorAll<HTMLElement>(`[data-modal-close="${modal.id}"]`);
|
|
16
|
+
|
|
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;
|
|
24
|
+
|
|
25
|
+
// showModal() でモーダルを開く( open 属性の付与)
|
|
26
|
+
modal.showModal();
|
|
27
|
+
|
|
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;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// data-is-open 属性を削除(CSS側でフェードアウトアニメーション開始)
|
|
45
|
+
modal.removeAttribute('data-is-open');
|
|
46
|
+
|
|
47
|
+
// アニメーション完了を待機
|
|
48
|
+
await waitAnimation(modal);
|
|
49
|
+
|
|
50
|
+
// アニメーション終了後、dialog を閉じる(open属性の削除)
|
|
51
|
+
modal.close();
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// openボタンにイベント登録
|
|
55
|
+
openTriggers.forEach((trigger) => {
|
|
56
|
+
trigger?.addEventListener('click', () => {
|
|
57
|
+
// button側にもdata属性付与
|
|
58
|
+
trigger.dataset.targetOpened = '1';
|
|
59
|
+
theTrigger = trigger; // close() 時にdata属性削除するために記憶
|
|
60
|
+
|
|
61
|
+
// モーダルを開く
|
|
62
|
+
openDialog();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// closeボタンにイベント登録
|
|
67
|
+
closeTriggers.forEach((trigger) => {
|
|
68
|
+
trigger?.addEventListener('click', () => {
|
|
69
|
+
void closeDialog();
|
|
70
|
+
});
|
|
71
|
+
});
|
|
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
|
+
|
|
88
|
+
/**
|
|
89
|
+
* ESCキーで閉じた時もアニメーションを実行する処理
|
|
90
|
+
*/
|
|
91
|
+
modal.addEventListener('cancel', (e) => {
|
|
92
|
+
e.preventDefault(); // デフォルトの即時 close() を防ぐ
|
|
93
|
+
void closeDialog(); // 自分で用意したクローズ処理
|
|
94
|
+
});
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
const setModal = () => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
const modals = document.querySelectorAll('.c--modal');
|
|
99
|
+
modals?.forEach((target) => {
|
|
100
|
+
setEvent(target as HTMLDialogElement);
|
|
101
|
+
});
|
|
102
102
|
};
|
|
103
103
|
export default setModal;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
@layer lism
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
@layer lism-modules {
|
|
2
|
+
.c--navMenu {
|
|
3
|
+
--link-td: none;
|
|
4
|
+
--hl: var(--hl--s);
|
|
5
|
+
--_item-p: var(--s20);
|
|
6
|
+
--focus-offset: -1px; /* アコーディオン化した時にoutlineが一部見えなくなるのを防ぐ */
|
|
7
|
+
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
.c--navMenu_nest {
|
|
10
|
+
--_item-p: inherit;
|
|
11
|
+
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
.c--navMenu_link {
|
|
14
|
+
padding: var(--_item-p);
|
|
15
|
+
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
.c--navMenu_nest,
|
|
18
|
+
.c--navMenu_item {
|
|
19
|
+
--bdc: inherit;
|
|
20
|
+
}
|
|
21
21
|
}
|
|
@@ -12,41 +12,41 @@ import getMaybeCssVar from 'lism-css/lib/getMaybeCssVar';
|
|
|
12
12
|
* @param {object} [props.style] - スタイルオブジェクト
|
|
13
13
|
*/
|
|
14
14
|
export function getRootProps({ hovC, hovBgc, itemP, style = {}, ...props }) {
|
|
15
|
-
|
|
15
|
+
const computedStyle = { ...style };
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
if (hovBgc) computedStyle['--hov-bgc'] = getMaybeCssVar(hovBgc, 'color');
|
|
18
|
+
if (hovC) computedStyle['--hov-c'] = getMaybeCssVar(hovC, 'color');
|
|
19
|
+
if (itemP) computedStyle['--_item-p'] = getMaybeCssVar(itemP, 'space');
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
return {
|
|
22
|
+
lismClass: 'c--navMenu',
|
|
23
|
+
as: 'ul',
|
|
24
|
+
style: computedStyle,
|
|
25
|
+
...props,
|
|
26
|
+
};
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* NavMenu.Nest のプロパティを処理
|
|
31
31
|
*/
|
|
32
32
|
export function getNestProps(props) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
return {
|
|
34
|
+
lismClass: 'c--navMenu_nest',
|
|
35
|
+
as: 'ul',
|
|
36
|
+
'px-s': '20',
|
|
37
|
+
...props,
|
|
38
|
+
};
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* NavMenu.Item のプロパティを処理
|
|
43
43
|
*/
|
|
44
44
|
export function getItemProps(props) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
return {
|
|
46
|
+
lismClass: 'c--navMenu_item',
|
|
47
|
+
as: 'li',
|
|
48
|
+
...props,
|
|
49
|
+
};
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|
|
@@ -55,11 +55,11 @@ export function getItemProps(props) {
|
|
|
55
55
|
* @param {string} [props.as='span'] - HTML タグ
|
|
56
56
|
*/
|
|
57
57
|
export function getLinkProps({ href, as = 'span', ...props }) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
return {
|
|
59
|
+
lismClass: 'c--navMenu_link',
|
|
60
|
+
as: href ? 'a' : as,
|
|
61
|
+
href,
|
|
62
|
+
c: 'inherit',
|
|
63
|
+
...props,
|
|
64
|
+
};
|
|
65
65
|
}
|
|
@@ -3,17 +3,17 @@ import { getRootProps, getNestProps, getItemProps, getLinkProps } from '../getPr
|
|
|
3
3
|
import '../_style.css';
|
|
4
4
|
|
|
5
5
|
export function Root({ children, ...props }) {
|
|
6
|
-
|
|
6
|
+
return <Stack {...getRootProps(props)}>{children}</Stack>;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function Nest({ children, ...props }) {
|
|
10
|
-
|
|
10
|
+
return <Stack {...getNestProps(props)}>{children}</Stack>;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function Item({ children, ...props }) {
|
|
14
|
-
|
|
14
|
+
return <Lism {...getItemProps(props)}>{children}</Lism>;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export function Link({ children, ...props }) {
|
|
18
|
-
|
|
18
|
+
return <Flex {...getLinkProps(props)}>{children}</Flex>;
|
|
19
19
|
}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
/* Note: scale 反転は、__inner に対して行う。shapeDivider自身を反転させると、X方向に隙間ができてしまう。 */
|
|
2
|
-
@layer lism
|
|
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
|
-
|
|
2
|
+
@layer lism-modules {
|
|
3
|
+
.c--shapeDivider {
|
|
4
|
+
--level: 0;
|
|
5
|
+
|
|
6
|
+
/* svg配置調整用 */
|
|
7
|
+
--_inner-offset: 0px;
|
|
8
|
+
--_inner-stretch: 1;
|
|
9
|
+
|
|
10
|
+
/* flip がオンなら -1 にセット */
|
|
11
|
+
--_flipX: 1;
|
|
12
|
+
--_flipY: 1;
|
|
13
|
+
|
|
14
|
+
/* 500px時点を最小値, 1200px時点を最大値にして、clampで高さを変動させる */
|
|
15
|
+
height: clamp(calc(5px * var(--level)), calc(1cqw * var(--level)), calc(12px * var(--level)));
|
|
16
|
+
overflow: visible;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.c--shapeDivider:where([data-flip^='X']) {
|
|
20
|
+
--_flipX: -1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.c--shapeDivider:where([data-flip$='Y']) {
|
|
24
|
+
--_flipY: -1;
|
|
25
|
+
}
|
|
26
|
+
.c--shapeDivider_inner {
|
|
27
|
+
/* 隙間ができるのを防ぐ */
|
|
28
|
+
--offsetY: 0.5px;
|
|
29
|
+
--offsetX: -0.5px;
|
|
30
|
+
height: 100%;
|
|
31
|
+
width: calc(100% + 1px);
|
|
32
|
+
scale: calc(var(--_flipX) * var(--_inner-stretch)) var(--_flipY);
|
|
33
|
+
translate: calc(var(--offsetX) + var(--_inner-offset)) calc(var(--offsetY) * var(--_flipY));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.c--shapeDivider_svg {
|
|
37
|
+
/* 位置ずれ防止 */
|
|
38
|
+
display: block;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* 左右にスライドするアニメーション */
|
|
42
|
+
:where([data-has-animation='true']) .c--shapeDivider_svg {
|
|
43
|
+
/* ↓ X 100% にしてるのは translateXのcalc計算で * -1 をしなくていいように。*/
|
|
44
|
+
transform-origin: 100% 0;
|
|
45
|
+
animation: lism--slideShape 12s infinite alternate linear;
|
|
46
|
+
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
@keyframes lism--slideShape {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
0% {
|
|
51
|
+
transform: scaleX(4);
|
|
52
|
+
}
|
|
53
|
+
100% {
|
|
54
|
+
transform: scaleX(4) translateX(calc(100% - 25%));
|
|
55
|
+
}
|
|
56
56
|
}
|
|
@@ -8,24 +8,24 @@ const { viewBox, isAnimation, isEmpty, ...lismProps } = componentProps || {};
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
componentProps && (
|
|
12
|
+
<Lism {...lismProps}>
|
|
13
|
+
{isEmpty ? null : (
|
|
14
|
+
<div class="c--shapeDivider_inner">
|
|
15
|
+
<svg
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
class="c--shapeDivider_svg"
|
|
18
|
+
viewBox={viewBox}
|
|
19
|
+
width="100%"
|
|
20
|
+
height="100%"
|
|
21
|
+
fill="currentColor"
|
|
22
|
+
focusable="false"
|
|
23
|
+
preserveAspectRatio="none"
|
|
24
|
+
>
|
|
25
|
+
<slot />
|
|
26
|
+
</svg>
|
|
27
|
+
</div>
|
|
28
|
+
)}
|
|
29
|
+
</Lism>
|
|
30
|
+
)
|
|
31
31
|
}
|
|
@@ -9,32 +9,32 @@
|
|
|
9
9
|
* @param {string} [props.flip] - X/Y/XY で反転方向を指定
|
|
10
10
|
*/
|
|
11
11
|
export default function getProps({ viewBox, isAnimation, isEmpty, level = 5, stretch, offset, flip, style = {}, ...restProps }) {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// level が 0 の場合は非表示
|
|
13
|
+
if (level === 0) return null;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
// CSS変数をセット
|
|
16
|
+
const computedStyle = { ...style };
|
|
17
|
+
computedStyle['--level'] = level || null;
|
|
18
|
+
computedStyle['--_inner-offset'] = offset || null;
|
|
19
|
+
computedStyle['--_inner-stretch'] = stretch || null;
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
const _props = {
|
|
22
|
+
lismClass: 'c--shapeDivider',
|
|
23
|
+
'max-sz': 'full',
|
|
24
|
+
'aria-hidden': 'true',
|
|
25
|
+
};
|
|
26
|
+
if (flip) _props['data-flip'] = flip;
|
|
27
|
+
if (isAnimation) _props['data-has-animation'] = 'true';
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
return {
|
|
30
|
+
..._props,
|
|
31
|
+
style: computedStyle,
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
// SVG用のprops
|
|
34
|
+
viewBox,
|
|
35
|
+
isEmpty,
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
// その他のprops
|
|
38
|
+
...restProps,
|
|
39
|
+
};
|
|
40
40
|
}
|
|
@@ -3,31 +3,31 @@ import getProps from '../getProps';
|
|
|
3
3
|
import '../_style.css';
|
|
4
4
|
|
|
5
5
|
export default function ShapeDivider({ children, ...props }) {
|
|
6
|
-
|
|
6
|
+
const componentProps = getProps(props);
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
// level が 0 の場合は非表示
|
|
9
|
+
if (!componentProps) return null;
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const { viewBox, isAnimation, isEmpty, ...lismProps } = componentProps;
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
return (
|
|
14
|
+
<Lism {...lismProps}>
|
|
15
|
+
{isEmpty ? null : (
|
|
16
|
+
<div className="c--shapeDivider_inner">
|
|
17
|
+
<svg
|
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
+
className="c--shapeDivider_svg"
|
|
20
|
+
viewBox={viewBox}
|
|
21
|
+
width="100%"
|
|
22
|
+
height="100%"
|
|
23
|
+
fill="currentColor"
|
|
24
|
+
focusable="false"
|
|
25
|
+
preserveAspectRatio="none"
|
|
26
|
+
>
|
|
27
|
+
{children}
|
|
28
|
+
</svg>
|
|
29
|
+
</div>
|
|
30
|
+
)}
|
|
31
|
+
</Lism>
|
|
32
|
+
);
|
|
33
33
|
}
|