@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
|
@@ -4,54 +4,49 @@
|
|
|
4
4
|
|
|
5
5
|
// 各サブ要素のデフォルトプロパティ
|
|
6
6
|
export const defaultProps = {
|
|
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
|
-
|
|
7
|
+
avatar: {
|
|
8
|
+
lismClass: 'c--chat_avatar',
|
|
9
|
+
bgc: 'base',
|
|
10
|
+
ar: '1/1',
|
|
11
|
+
bdrs: '99',
|
|
12
|
+
'aria-hidden': 'true',
|
|
13
|
+
},
|
|
14
|
+
name: {
|
|
15
|
+
lismClass: 'c--chat_name',
|
|
16
|
+
c: 'text-2',
|
|
17
|
+
fs: 'italic',
|
|
18
|
+
fz: '2xs',
|
|
19
|
+
lh: '1',
|
|
20
|
+
py: '5',
|
|
21
|
+
px: '10',
|
|
22
|
+
aslf: 'end',
|
|
23
|
+
},
|
|
24
|
+
body: {
|
|
25
|
+
lismClass: 'c--chat_body',
|
|
26
|
+
pos: 'rel',
|
|
27
|
+
},
|
|
28
|
+
deco: {
|
|
29
|
+
lismClass: 'c--chat_deco',
|
|
30
|
+
pos: 'abs',
|
|
31
|
+
},
|
|
32
|
+
content: {
|
|
33
|
+
lismClass: 'c--chat_content',
|
|
34
|
+
bdrs: '30',
|
|
35
|
+
p: '20',
|
|
36
|
+
lh: 's',
|
|
37
|
+
},
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Chat コンポーネントのルートプロパティを生成
|
|
42
42
|
*/
|
|
43
|
-
export default function getChatProps({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
keycolor,
|
|
53
|
-
'data-chat-dir': direction,
|
|
54
|
-
ji: direction,
|
|
55
|
-
...props,
|
|
56
|
-
};
|
|
43
|
+
export default function getChatProps({ variant = 'speak', direction = 'start', keycolor = 'gray', ...props }) {
|
|
44
|
+
return {
|
|
45
|
+
lismClass: 'c--chat',
|
|
46
|
+
variant,
|
|
47
|
+
keycolor,
|
|
48
|
+
'data-chat-dir': direction,
|
|
49
|
+
ji: direction,
|
|
50
|
+
...props,
|
|
51
|
+
};
|
|
57
52
|
}
|
|
@@ -3,22 +3,22 @@ import getChatProps, { defaultProps } from '../getProps';
|
|
|
3
3
|
import '../_style.css';
|
|
4
4
|
|
|
5
5
|
export default function Chat({ name, avatar, flow = 's', children, ...props }) {
|
|
6
|
-
|
|
6
|
+
const { 'data-chat-dir': direction, ...chatProps } = getChatProps(props);
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
return (
|
|
9
|
+
<Grid data-chat-dir={direction} {...chatProps}>
|
|
10
|
+
{avatar && (
|
|
11
|
+
<Frame {...defaultProps.avatar} src={avatar} alt="">
|
|
12
|
+
<img src={avatar} alt="" width="60" height="60" decoding="async" />
|
|
13
|
+
</Frame>
|
|
14
|
+
)}
|
|
15
|
+
{name && <Lism {...defaultProps.name}>{name}</Lism>}
|
|
16
|
+
<Lism {...defaultProps.body}>
|
|
17
|
+
<Decorator {...defaultProps.deco} className="u--cbox is--skipFlow" />
|
|
18
|
+
<Flow {...defaultProps.content} className="u--cbox" flow={flow} jslf={direction}>
|
|
19
|
+
{children}
|
|
20
|
+
</Flow>
|
|
21
|
+
</Lism>
|
|
22
|
+
</Grid>
|
|
23
|
+
);
|
|
24
24
|
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
/* Details コンポーネント用スタイル */
|
|
2
2
|
/* ::details-content と grid-template-rows: 0fr → 1fr のトランジションでアニメーション */
|
|
3
|
-
@layer lism
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
@layer lism-modules {
|
|
4
|
+
.c--details {
|
|
5
|
+
--duration: var(--acc-duration, 0.25s); /* transition時間 */
|
|
6
|
+
--_icon-scale: 1.1;
|
|
7
|
+
--_icon-transform: rotate(0deg); /* icon操作用 */
|
|
8
|
+
--_content-gtr: 0fr; /* 開閉操作用 */
|
|
9
|
+
}
|
|
10
|
+
.c--details[open] {
|
|
11
|
+
--_icon-transform: scaleY(-1);
|
|
12
|
+
--_content-gtr: 1fr;
|
|
13
|
+
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/* Safariで表示されるデフォルトの三角形アイコンを削除 */
|
|
16
|
+
.c--details_summary::-webkit-details-marker {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
/* 見出しタグでもフォントを揃える */
|
|
21
|
+
/* .c--details_title {} */
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
/* アイコン */
|
|
24
|
+
.c--details_icon {
|
|
25
|
+
--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>');
|
|
26
|
+
display: inline-grid;
|
|
27
|
+
background-color: currentColor;
|
|
28
|
+
mask: var(--svg) no-repeat center center / contain;
|
|
29
|
+
scale: var(--_icon-scale);
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
transition: transform var(--duration);
|
|
32
|
+
transform: var(--_icon-transform);
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
/* ::details-content 擬似要素を使ったアニメーション */
|
|
36
|
+
.c--details::details-content {
|
|
37
|
+
display: grid;
|
|
38
|
+
grid-template-rows: var(--_content-gtr);
|
|
39
|
+
transition-duration: var(--duration);
|
|
40
|
+
transition-property: content-visibility, grid-template;
|
|
41
|
+
transition-behavior: allow-discrete;
|
|
42
|
+
}
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
/* コンテンツ内部のラッパー(grid-template-rows: 0frのアニメーションに必須) */
|
|
45
|
+
.c--details_body {
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
}
|
|
48
48
|
}
|
|
@@ -7,17 +7,17 @@ import atts from 'lism-css/lib/helper/atts';
|
|
|
7
7
|
* @returns {Object} 処理済みプロパティ
|
|
8
8
|
*/
|
|
9
9
|
export function getDetailsProps({ lismClass, ...props }) {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
props.lismClass = atts(lismClass, 'c--details');
|
|
11
|
+
return props;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* 各サブコンポーネント用のデフォルトプロパティ
|
|
16
16
|
*/
|
|
17
17
|
export const defaultProps = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
summary: { lismClass: 'c--details_summary', layout: 'flex', g: '10', ai: 'center' },
|
|
19
|
+
title: { lismClass: 'c--details_title', as: 'span', fx: '1', setPlain: 1 },
|
|
20
|
+
icon: { lismClass: 'c--details_icon a--icon', as: 'span', 'aria-hidden': 'true' },
|
|
21
|
+
body: { lismClass: 'c--details_body' },
|
|
22
|
+
content: { lismClass: 'c--details_content', layout: 'flow', flow: 's' },
|
|
23
23
|
};
|
|
@@ -13,9 +13,9 @@ import '../_style.css';
|
|
|
13
13
|
* details要素をレンダリング
|
|
14
14
|
*/
|
|
15
15
|
export function Details({ children, ...props }) {
|
|
16
|
-
|
|
16
|
+
const lismProps = getLismProps(getDetailsProps(props));
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
return <details {...lismProps}>{children}</details>;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -23,44 +23,44 @@ export function Details({ children, ...props }) {
|
|
|
23
23
|
* details要素のsummary部分
|
|
24
24
|
*/
|
|
25
25
|
export function Summary({ children, ...props }) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
return (
|
|
27
|
+
<Lism as="summary" {...defaultProps.summary} {...props}>
|
|
28
|
+
{children}
|
|
29
|
+
</Lism>
|
|
30
|
+
);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Title - タイトルコンポーネント
|
|
35
35
|
*/
|
|
36
36
|
export function Title({ children, ...props }) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
return (
|
|
38
|
+
<Lism {...defaultProps.title} {...props}>
|
|
39
|
+
{children}
|
|
40
|
+
</Lism>
|
|
41
|
+
);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Icon - アイコンコンポーネント
|
|
46
46
|
*/
|
|
47
47
|
export function Icon({ children, ...props }) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
return (
|
|
49
|
+
<Lism {...defaultProps.icon} {...props}>
|
|
50
|
+
{children}
|
|
51
|
+
</Lism>
|
|
52
|
+
);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Content - コンテンツコンポーネント
|
|
57
57
|
*/
|
|
58
58
|
export function Content({ children, ...props }) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
return (
|
|
60
|
+
<Lism {...defaultProps.body}>
|
|
61
|
+
<Lism {...defaultProps.content} {...props}>
|
|
62
|
+
{children}
|
|
63
|
+
</Lism>
|
|
64
|
+
</Lism>
|
|
65
|
+
);
|
|
66
66
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DummyImage.astro';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DummyImage';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Lism } from 'lism-css/astro';
|
|
3
|
+
import getContent from '../getContent';
|
|
4
|
+
|
|
5
|
+
const { as: tagName = 'p', pre = '', length = 'm', lang = 'en', offset = 0, ...props } = Astro.props;
|
|
6
|
+
const content = getContent({ pre, lang, length, offset });
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<Lism as={tagName} {...props} set:html={content} />
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DummyText.astro';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import TEXTS from './texts';
|
|
2
|
+
|
|
3
|
+
type Lang = keyof typeof TEXTS;
|
|
4
|
+
type Length = string;
|
|
5
|
+
|
|
6
|
+
// 句読点で split し、各文の末尾に句読点を残す
|
|
7
|
+
const splitByPunctuation = (content: string): string[] => {
|
|
8
|
+
return content
|
|
9
|
+
.split(/([,.、。])/)
|
|
10
|
+
.filter((item) => item !== '')
|
|
11
|
+
.reduce<string[]>((acc, curr, i, arr) => {
|
|
12
|
+
if (i % 2 === 0) {
|
|
13
|
+
acc.push(curr + (arr[i + 1] || ''));
|
|
14
|
+
}
|
|
15
|
+
return acc;
|
|
16
|
+
}, []);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
interface GetContentOptions {
|
|
20
|
+
pre?: string;
|
|
21
|
+
length?: Length;
|
|
22
|
+
lang?: Lang;
|
|
23
|
+
offset?: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default function getContent({ pre = '', length = 'm', lang = 'en', offset = 0 }: GetContentOptions): string {
|
|
27
|
+
const langTexts = TEXTS[lang] as Record<string, string> | undefined;
|
|
28
|
+
let content = langTexts?.[length] || '';
|
|
29
|
+
|
|
30
|
+
if (offset) {
|
|
31
|
+
content = splitByPunctuation(content).slice(offset).join('').trim();
|
|
32
|
+
content = content.charAt(0).toUpperCase() + content.slice(1);
|
|
33
|
+
}
|
|
34
|
+
if (pre) {
|
|
35
|
+
content = pre + content;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return content;
|
|
39
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import { Lism, type LismComponentProps } from 'lism-css/react';
|
|
3
|
+
import getContent from '../getContent';
|
|
4
|
+
|
|
5
|
+
type DummyTextProps<T extends ElementType = 'p'> = LismComponentProps<T> & {
|
|
6
|
+
pre?: string;
|
|
7
|
+
length?: string;
|
|
8
|
+
lang?: 'ja' | 'en' | 'ar';
|
|
9
|
+
offset?: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default function DummyText<T extends ElementType = 'p'>({ pre = '', length = 'm', lang = 'en', offset = 0, ...props }: DummyTextProps<T>) {
|
|
13
|
+
const content = getContent({ pre, lang, length, offset });
|
|
14
|
+
return <Lism {...(props as LismComponentProps)} dangerouslySetInnerHTML={{ __html: content }} />;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DummyText';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const LOREM_IPSUM = {
|
|
2
|
+
ja: [
|
|
3
|
+
`ロレム・イプサムの座り雨。`,
|
|
4
|
+
`目まぐるしい文章の流れの中で、それは静かに歩く仮の言葉です。`,
|
|
5
|
+
`Elitも穏やかに続いていきますが、積み重ねられてきた「LiberroyとFoogの取り組み」は、余白のようなものです。`,
|
|
6
|
+
`作業が進むにつれて、工夫や考えとともに関心が折り重なりながらも、必要以上に主張せず彼らの作品は私たちに一定の示唆を与えてくれます。`,
|
|
7
|
+
`内容の違いを比べるためのドラーとして、静かにそこにあります。選ばれた事実や、意味を限定しない言葉の並びは、全体の雰囲気を整える役割を果たします。時間の流れの中で、そうした文章は自然に形を変え、使う人の意図に委ねられていきます。`,
|
|
8
|
+
],
|
|
9
|
+
en: [
|
|
10
|
+
'Lorem ipsum dolor sit amet.',
|
|
11
|
+
'Consectetur adipiscing elit, sed do eiusmod tempor Incididunt ut.',
|
|
12
|
+
'Labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.',
|
|
13
|
+
'Aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint.',
|
|
14
|
+
'Occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis undeomnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.',
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
ja: {
|
|
20
|
+
xs: LOREM_IPSUM.ja[0],
|
|
21
|
+
s: LOREM_IPSUM.ja[0] + LOREM_IPSUM.ja[1],
|
|
22
|
+
m: LOREM_IPSUM.ja[0] + LOREM_IPSUM.ja[1] + LOREM_IPSUM.ja[2],
|
|
23
|
+
l: LOREM_IPSUM.ja[0] + LOREM_IPSUM.ja[1] + LOREM_IPSUM.ja[2] + LOREM_IPSUM.ja[3],
|
|
24
|
+
xl: LOREM_IPSUM.ja[0] + LOREM_IPSUM.ja[1] + LOREM_IPSUM.ja[2] + LOREM_IPSUM.ja[3] + LOREM_IPSUM.ja[4],
|
|
25
|
+
codes: `ロレム・イプサムの<i>座り雨</i>、それは<a href='###'>静かに歩く仮の言葉</a>です。長いあいだ積み重ねられてきた<code>Liberroy</code>と<code>Foog</code>の取り組み」は、私たちに<b>一定の示唆</b>を与えてくれます。`,
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
en: {
|
|
29
|
+
xs: LOREM_IPSUM.en[0],
|
|
30
|
+
s: LOREM_IPSUM.en[0] + ' ' + LOREM_IPSUM.en[1],
|
|
31
|
+
m: LOREM_IPSUM.en[0] + ' ' + LOREM_IPSUM.en[1] + ' ' + LOREM_IPSUM.en[2],
|
|
32
|
+
l: LOREM_IPSUM.en[0] + ' ' + LOREM_IPSUM.en[1] + ' ' + LOREM_IPSUM.en[2] + ' ' + LOREM_IPSUM.en[3],
|
|
33
|
+
xl: LOREM_IPSUM.en[0] + ' ' + LOREM_IPSUM.en[1] + ' ' + LOREM_IPSUM.en[2] + ' ' + LOREM_IPSUM.en[3] + ' ' + LOREM_IPSUM.en[4],
|
|
34
|
+
codes: `Lorem ipsum dolor <i>sit amet</i>. consectetur <a href='###'>adipisicing elit</a>, sed do eiusmod tempor. Non facere <code>Laudantium</code> ex eos <b>doloribus aut dolore</b> nisi provident.`,
|
|
35
|
+
},
|
|
36
|
+
ar: {
|
|
37
|
+
s: 'هذا نص وهمي أنا أكتب جمل ليس لها معنى معين.هذا نص وهمي أنا أكتب جمل ليس لها معنى معين.هذا نص وهمي أنا أكتب جمل ليس لها معنى معين.',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -2,43 +2,43 @@
|
|
|
2
2
|
* dialog で実装.
|
|
3
3
|
* Memo: ::backdrop のアニメーションはFirefoxで動かない
|
|
4
4
|
*/
|
|
5
|
-
@layer lism
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
@layer lism-modules {
|
|
6
|
+
.c--modal {
|
|
7
|
+
--flow: 0; /* flow直下にきても影響しないように */
|
|
8
|
+
--duration: var(--modal-duration, 0.4s);
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
max-width: 100%;
|
|
12
|
+
max-height: 100%;
|
|
13
|
+
overflow: unset;
|
|
14
|
+
background: var(--backdrop-bg, rgb(0 0 0 / 0.6));
|
|
15
|
+
transition-duration: var(--duration);
|
|
16
|
+
transition-property: opacity;
|
|
17
|
+
}
|
|
18
|
+
.c--modal::backdrop {
|
|
19
|
+
background: none;
|
|
20
|
+
}
|
|
21
|
+
.c--modal[open] {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
.c--modal_inner {
|
|
28
|
+
--offset: 0 0; /* アニメーション用 */
|
|
29
|
+
background-color: var(--base);
|
|
30
|
+
transition: translate var(--duration);
|
|
31
|
+
max-height: 100%;
|
|
32
|
+
}
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
/* .c--modal_body {
|
|
35
35
|
overscroll-behavior: contain;
|
|
36
36
|
} */
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
.c--modal:not([data-is-open]) {
|
|
39
|
+
opacity: 0;
|
|
40
|
+
}
|
|
41
|
+
.c--modal:not([data-is-open]) > .c--modal_inner {
|
|
42
|
+
translate: var(--offset);
|
|
43
|
+
}
|
|
44
44
|
}
|
|
@@ -10,14 +10,14 @@ const btnProps = { ...defaultProps.closeBtn, ...props };
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
Astro.slots.has('default') ? (
|
|
14
|
+
<Lism data-modal-close={modalId} {...btnProps}>
|
|
15
|
+
<slot />
|
|
16
|
+
</Lism>
|
|
17
|
+
) : (
|
|
18
|
+
<Lism data-modal-close={modalId} {...btnProps}>
|
|
19
|
+
<Icon icon={icon || 'x'} />
|
|
20
|
+
<span class="u--srOnly">{srText || 'Close'}</span>
|
|
21
|
+
</Lism>
|
|
22
|
+
)
|
|
23
23
|
}
|