@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.
Files changed (124) hide show
  1. package/README.ja.md +137 -0
  2. package/README.md +93 -5
  3. package/dist/components/Chat/getProps.js +1 -6
  4. package/dist/components/DummyImage/astro/index.d.ts +1 -0
  5. package/dist/components/DummyImage/react/DummyImage.d.ts +2 -0
  6. package/dist/components/DummyImage/react/DummyImage.js +8 -0
  7. package/dist/components/DummyImage/react/index.d.ts +1 -0
  8. package/dist/components/DummyText/astro/index.d.ts +1 -0
  9. package/dist/components/DummyText/getContent.d.ts +11 -0
  10. package/dist/components/DummyText/getContent.js +9 -0
  11. package/dist/components/DummyText/react/DummyText.d.ts +10 -0
  12. package/dist/components/DummyText/react/DummyText.js +10 -0
  13. package/dist/components/DummyText/react/index.d.ts +1 -0
  14. package/dist/components/DummyText/texts.d.ts +22 -0
  15. package/dist/components/DummyText/texts.js +39 -0
  16. package/dist/components/NavMenu/getProps.js +2 -2
  17. package/dist/components/Tabs/react/Tab.js +1 -12
  18. package/dist/components/Tabs/react/Tabs.js +1 -3
  19. package/dist/components/astro.d.ts +2 -0
  20. package/dist/components/react.d.ts +2 -0
  21. package/dist/components/react.js +20 -16
  22. package/dist/lism-css/dist/components/atomic/Decorator/getProps.js +10 -10
  23. package/dist/lism-css/dist/components/atomic/Icon/getProps.js +28 -27
  24. package/dist/lism-css/dist/config/defaults/props.js +6 -1
  25. package/dist/lism-css/dist/config/defaults/tokens.js +1 -1
  26. package/dist/lism-css/dist/lib/getMaybeCssVar.js +26 -21
  27. package/dist/style.css +1 -1
  28. package/dist/ui.css +1 -1
  29. package/package.json +5 -4
  30. package/src/components/Accordion/_style.css +69 -69
  31. package/src/components/Accordion/astro/Button.astro +2 -2
  32. package/src/components/Accordion/astro/Heading.astro +1 -1
  33. package/src/components/Accordion/astro/Item.astro +7 -7
  34. package/src/components/Accordion/astro/Panel.astro +3 -3
  35. package/src/components/Accordion/astro/Root.astro +3 -3
  36. package/src/components/Accordion/getProps.js +54 -54
  37. package/src/components/Accordion/react/AccIcon.jsx +1 -1
  38. package/src/components/Accordion/react/Accordion.jsx +34 -34
  39. package/src/components/Accordion/script.js +1 -1
  40. package/src/components/Accordion/setAccordion.js +93 -93
  41. package/src/components/Alert/astro/Alert.astro +6 -6
  42. package/src/components/Alert/getProps.ts +22 -22
  43. package/src/components/Alert/presets.ts +26 -26
  44. package/src/components/Alert/react/Alert.tsx +9 -9
  45. package/src/components/Avatar/astro/Avatar.astro +2 -2
  46. package/src/components/Avatar/react/Avatar.jsx +5 -5
  47. package/src/components/Badge/_style.css +14 -14
  48. package/src/components/Badge/astro/Badge.astro +4 -4
  49. package/src/components/Badge/react/Badge.jsx +6 -6
  50. package/src/components/Button/_style.css +29 -29
  51. package/src/components/Button/astro/Button.astro +4 -4
  52. package/src/components/Button/react/Button.jsx +6 -6
  53. package/src/components/Callout/astro/Callout.astro +13 -13
  54. package/src/components/Callout/getProps.ts +24 -24
  55. package/src/components/Callout/presets.ts +26 -26
  56. package/src/components/Callout/react/Callout.tsx +16 -16
  57. package/src/components/Chat/_style.css +49 -49
  58. package/src/components/Chat/astro/Chat.astro +27 -27
  59. package/src/components/Chat/getProps.js +40 -45
  60. package/src/components/Chat/react/Chat.jsx +17 -17
  61. package/src/components/Details/_style.css +39 -39
  62. package/src/components/Details/astro/Content.astro +3 -3
  63. package/src/components/Details/astro/Details.astro +1 -1
  64. package/src/components/Details/astro/Icon.astro +1 -1
  65. package/src/components/Details/astro/Summary.astro +2 -2
  66. package/src/components/Details/astro/Title.astro +1 -1
  67. package/src/components/Details/getProps.js +7 -7
  68. package/src/components/Details/react/Details.jsx +24 -24
  69. package/src/components/DummyImage/astro/DummyImage.astro +7 -0
  70. package/src/components/DummyImage/astro/index.ts +1 -0
  71. package/src/components/DummyImage/react/DummyImage.tsx +5 -0
  72. package/src/components/DummyImage/react/index.ts +1 -0
  73. package/src/components/DummyText/astro/DummyText.astro +9 -0
  74. package/src/components/DummyText/astro/index.ts +1 -0
  75. package/src/components/DummyText/getContent.ts +39 -0
  76. package/src/components/DummyText/react/DummyText.tsx +15 -0
  77. package/src/components/DummyText/react/index.ts +1 -0
  78. package/src/components/DummyText/texts.ts +39 -0
  79. package/src/components/Modal/_style.css +34 -34
  80. package/src/components/Modal/astro/Body.astro +1 -1
  81. package/src/components/Modal/astro/CloseBtn.astro +10 -10
  82. package/src/components/Modal/astro/Inner.astro +1 -1
  83. package/src/components/Modal/astro/Modal.astro +3 -3
  84. package/src/components/Modal/astro/OpenBtn.astro +1 -1
  85. package/src/components/Modal/getProps.js +19 -19
  86. package/src/components/Modal/react/Body.jsx +5 -5
  87. package/src/components/Modal/react/CloseBtn.jsx +13 -13
  88. package/src/components/Modal/react/Inner.jsx +1 -1
  89. package/src/components/Modal/react/Modal.jsx +10 -10
  90. package/src/components/Modal/react/OpenBtn.jsx +5 -5
  91. package/src/components/Modal/script.js +1 -1
  92. package/src/components/Modal/setModal.ts +92 -92
  93. package/src/components/NavMenu/_style.css +17 -17
  94. package/src/components/NavMenu/astro/Item.astro +1 -1
  95. package/src/components/NavMenu/astro/Link.astro +1 -1
  96. package/src/components/NavMenu/astro/Nest.astro +1 -1
  97. package/src/components/NavMenu/astro/Root.astro +1 -1
  98. package/src/components/NavMenu/getProps.js +28 -28
  99. package/src/components/NavMenu/react/NavMenu.jsx +4 -4
  100. package/src/components/ShapeDivider/_style.css +51 -51
  101. package/src/components/ShapeDivider/astro/ShapeDivider.astro +20 -20
  102. package/src/components/ShapeDivider/getProps.js +23 -23
  103. package/src/components/ShapeDivider/react/ShapeDivider.jsx +24 -24
  104. package/src/components/Tabs/_style.css +29 -29
  105. package/src/components/Tabs/astro/Tab.astro +2 -2
  106. package/src/components/Tabs/astro/TabItem.astro +1 -1
  107. package/src/components/Tabs/astro/TabList.astro +2 -2
  108. package/src/components/Tabs/astro/TabPanel.astro +2 -2
  109. package/src/components/Tabs/astro/Tabs.astro +20 -20
  110. package/src/components/Tabs/astro/transformTabitems.js +30 -30
  111. package/src/components/Tabs/getProps.js +4 -4
  112. package/src/components/Tabs/react/Tab.jsx +4 -12
  113. package/src/components/Tabs/react/TabItem.jsx +1 -1
  114. package/src/components/Tabs/react/TabList.jsx +2 -2
  115. package/src/components/Tabs/react/TabPanel.jsx +2 -2
  116. package/src/components/Tabs/react/Tabs.jsx +44 -46
  117. package/src/components/Tabs/script.js +4 -4
  118. package/src/components/Tabs/setTabs.js +70 -70
  119. package/src/components/astro.ts +2 -0
  120. package/src/components/react.ts +2 -0
  121. package/src/helper/animation.ts +10 -10
  122. package/src/helper/uuid.js +3 -3
  123. package/dist/lism-css/dist/components/getFilterProps.js +0 -23
  124. package/dist/lism-css/dist/components/setMaybeTransformStyles.js +0 -7
@@ -1,32 +1,32 @@
1
1
  import PRESETS from './presets';
2
2
 
3
3
  export type CalloutProps = {
4
- type?: string;
5
- keycolor?: string;
6
- icon?: string;
7
- title?: string;
8
- flow?: string;
9
- [key: string]: unknown;
4
+ type?: string;
5
+ keycolor?: string;
6
+ icon?: string;
7
+ title?: string;
8
+ flow?: string;
9
+ [key: string]: unknown;
10
10
  };
11
11
 
12
12
  export default function getCalloutProps({ type = 'note', keycolor, icon, title, flow = 's', ...props }: CalloutProps) {
13
- const presetData = type ? PRESETS[type] : null;
14
- const _icon = icon || presetData?.icon || 'note';
15
- const _keycolor = keycolor || presetData?.color || null;
13
+ const presetData = type ? PRESETS[type] : null;
14
+ const _icon = icon || presetData?.icon || 'note';
15
+ const _keycolor = keycolor || presetData?.color || null;
16
16
 
17
- return {
18
- icon: _icon,
19
- title,
20
- flow,
21
- lismClass: 'c--callout u--cbox',
22
- keycolor: _keycolor,
23
- p: '20',
24
- g: '10',
25
- bdc: 'keycolor',
26
- 'bd-x-s': '-',
27
- bdw: '4px',
28
- bxsh: '10',
29
- bdrs: '5',
30
- ...props,
31
- };
17
+ return {
18
+ icon: _icon,
19
+ title,
20
+ flow,
21
+ lismClass: 'c--callout u--cbox',
22
+ keycolor: _keycolor,
23
+ p: '20',
24
+ g: '10',
25
+ bdc: 'keycolor',
26
+ 'bd-x-s': '-',
27
+ bdw: '4px',
28
+ bxsh: '10',
29
+ bdrs: '5',
30
+ ...props,
31
+ };
32
32
  }
@@ -1,33 +1,33 @@
1
1
  type PresetData = {
2
- icon: string;
3
- color: string;
2
+ icon: string;
3
+ color: string;
4
4
  };
5
5
 
6
6
  const PRESETS: Record<string, PresetData> = {
7
- alert: {
8
- icon: 'alert',
9
- color: 'red',
10
- },
11
- point: {
12
- icon: 'lightbulb',
13
- color: 'orange',
14
- },
15
- warning: {
16
- icon: 'warning',
17
- color: 'yellow',
18
- },
19
- check: {
20
- icon: 'check-circle',
21
- color: 'green',
22
- },
23
- help: {
24
- icon: 'question',
25
- color: 'purple',
26
- },
27
- note: {
28
- icon: 'note',
29
- color: 'blue',
30
- },
7
+ alert: {
8
+ icon: 'alert',
9
+ color: 'red',
10
+ },
11
+ point: {
12
+ icon: 'lightbulb',
13
+ color: 'orange',
14
+ },
15
+ warning: {
16
+ icon: 'warning',
17
+ color: 'yellow',
18
+ },
19
+ check: {
20
+ icon: 'check-circle',
21
+ color: 'green',
22
+ },
23
+ help: {
24
+ icon: 'question',
25
+ color: 'purple',
26
+ },
27
+ note: {
28
+ icon: 'note',
29
+ color: 'blue',
30
+ },
31
31
  };
32
32
 
33
33
  export default PRESETS;
@@ -3,21 +3,21 @@ import { Flow, Flex, Stack, Icon, Center } from 'lism-css/react';
3
3
  import getCalloutProps, { type CalloutProps } from '../getProps';
4
4
 
5
5
  export default function Callout({ children, ...inputProps }: CalloutProps & { children?: ReactNode }) {
6
- const { icon, title, flow, ...calloutProps } = getCalloutProps(inputProps);
6
+ const { icon, title, flow, ...calloutProps } = getCalloutProps(inputProps);
7
7
 
8
- return (
9
- <Stack {...calloutProps}>
10
- {title && (
11
- <Flex className='c--callout_head' c='keycolor' fw='bold' ai='center' g='10'>
12
- <Center className='c--callout_icon' fz='xl'>
13
- <Icon icon={icon} />
14
- </Center>
15
- <span className='c--callout_title'>{title}</span>
16
- </Flex>
17
- )}
18
- <Flow className='c--callout_body' flow={flow}>
19
- {children}
20
- </Flow>
21
- </Stack>
22
- );
8
+ return (
9
+ <Stack {...calloutProps}>
10
+ {title && (
11
+ <Flex className="c--callout_head" c="keycolor" fw="bold" ai="center" g="10">
12
+ <Center className="c--callout_icon" fz="xl">
13
+ <Icon icon={icon} />
14
+ </Center>
15
+ <span className="c--callout_title">{title}</span>
16
+ </Flex>
17
+ )}
18
+ <Flow className="c--callout_body" flow={flow}>
19
+ {children}
20
+ </Flow>
21
+ </Stack>
22
+ );
23
23
  }
@@ -1,64 +1,64 @@
1
- @layer lism.modules {
2
- .c--chat {
3
- --cbox-bgPct: 8%;
4
- --gta: 'avatar name' 'avatar body';
5
- --gtc: auto 1fr;
6
- --gtr: minmax(1.5rem, auto) auto;
7
- --_avator-size: clamp(48px, 32px + 5cqw, 64px); /* @320px:40px ~ @640:64px */
8
- --_deco-size: calc(min(var(--_avator-size), 80px) / 4 + 0.25rem);
9
- --_deco-mask: none;
10
- --_deco-t: 0;
11
- --_deco-scale: 1;
12
- --_deco-inset-x: 0;
1
+ @layer lism-modules {
2
+ .c--chat {
3
+ --cbox-bgPct: 8%;
4
+ --gta: 'avatar name' 'avatar body';
5
+ --gtc: auto 1fr;
6
+ --gtr: minmax(1.5rem, auto) auto;
7
+ --_avator-size: clamp(48px, 32px + 5cqw, 64px); /* @320px:40px ~ @640:64px */
8
+ --_deco-size: calc(min(var(--_avator-size), 80px) / 4 + 0.25rem);
9
+ --_deco-mask: none;
10
+ --_deco-t: 0;
11
+ --_deco-scale: 1;
12
+ --_deco-inset-x: 0;
13
13
 
14
- gap: 0 calc(var(--_deco-size) + 1px);
15
- }
14
+ gap: 0 calc(var(--_deco-size) + 1px);
15
+ }
16
16
 
17
- .c--chat_avatar {
18
- grid-area: avatar;
19
- width: var(--_avator-size);
20
- }
21
- .c--chat_name {
22
- grid-area: name;
23
- }
24
- .c--chat_body {
25
- grid-area: body;
26
- }
27
- .c--chat_content {
28
- max-width: var(--sz--s);
29
- }
17
+ .c--chat_avatar {
18
+ grid-area: avatar;
19
+ width: var(--_avator-size);
20
+ }
21
+ .c--chat_name {
22
+ grid-area: name;
23
+ }
24
+ .c--chat_body {
25
+ grid-area: body;
26
+ }
27
+ .c--chat_content {
28
+ max-width: var(--sz--s);
29
+ }
30
30
 
31
- .c--chat_deco {
32
- top: var(--_deco-t);
33
- inset-inline: var(--_deco-inset-x);
34
- width: var(--_deco-size);
35
- height: var(--_deco-size);
36
- scale: var(--_deco-scale);
37
- mask: var(--_deco-mask) center / contain no-repeat;
38
- }
39
- .c--chat--speak {
40
- --_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>');
41
- }
31
+ .c--chat_deco {
32
+ top: var(--_deco-t);
33
+ inset-inline: var(--_deco-inset-x);
34
+ width: var(--_deco-size);
35
+ height: var(--_deco-size);
36
+ scale: var(--_deco-scale);
37
+ mask: var(--_deco-mask) center / contain no-repeat;
38
+ }
39
+ .c--chat--speak {
40
+ --_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>');
41
+ }
42
42
 
43
- [data-chat-dir='start'] {
44
- --_deco-inset-x: auto calc(100% - 1px);
45
- }
46
- [data-chat-dir='end'] {
47
- --_deco-scale: -1 1;
48
- --_deco-inset-x: calc(100% - 1px) auto;
49
- --gta: 'name avatar' 'body avatar';
50
- --gtc: 1fr auto;
51
- }
43
+ [data-chat-dir='start'] {
44
+ --_deco-inset-x: auto calc(100% - 1px);
45
+ }
46
+ [data-chat-dir='end'] {
47
+ --_deco-scale: -1 1;
48
+ --_deco-inset-x: calc(100% - 1px) auto;
49
+ --gta: 'name avatar' 'body avatar';
50
+ --gtc: 1fr auto;
51
+ }
52
52
  }
53
53
 
54
54
  /* NOTE: 以下は @layer 外に配置(セレクタの詳細度を確保するため) */
55
55
 
56
56
  /* speak バリアントの角丸調整: 左側 */
57
57
  .c--chat--speak[data-chat-dir='start'] > div > .c--chat_content {
58
- border-start-start-radius: 0;
58
+ border-start-start-radius: 0;
59
59
  }
60
60
 
61
61
  /* speak バリアントの角丸調整: 右側 */
62
62
  .c--chat--speak[data-chat-dir='end'] > div > .c--chat_content {
63
- border-start-end-radius: 0;
63
+ border-start-end-radius: 0;
64
64
  }
@@ -4,19 +4,19 @@ import getChatProps, { defaultProps } from '../getProps';
4
4
  import '../_style.css';
5
5
 
6
6
  interface Props {
7
- /** 吹き出しスタイル */
8
- variant?: 'speak' | 'think';
9
- /** 吹き出しの方向 */
10
- direction?: 'start' | 'end';
11
- /** 発言者名 */
12
- name?: string;
13
- /** アバター画像URL */
14
- avatar?: string;
15
- /** キーカラー */
16
- keycolor?: string;
17
- /** コンテンツのフロー間隔 */
18
- flow?: string;
19
- [key: string]: unknown;
7
+ /** 吹き出しスタイル */
8
+ variant?: 'speak' | 'think';
9
+ /** 吹き出しの方向 */
10
+ direction?: 'start' | 'end';
11
+ /** 発言者名 */
12
+ name?: string;
13
+ /** アバター画像URL */
14
+ avatar?: string;
15
+ /** キーカラー */
16
+ keycolor?: string;
17
+ /** コンテンツのフロー間隔 */
18
+ flow?: string;
19
+ [key: string]: unknown;
20
20
  }
21
21
 
22
22
  const { name, avatar, flow = 's', ...inputProps } = Astro.props;
@@ -24,18 +24,18 @@ const { 'data-chat-dir': direction, ...chatProps } = getChatProps(inputProps);
24
24
  ---
25
25
 
26
26
  <Grid data-chat-dir={direction} {...chatProps}>
27
- {
28
- avatar && (
29
- <Frame {...defaultProps.avatar} src={avatar} alt=''>
30
- <img src={avatar} alt='' width='60' height='60' decoding='async' />
31
- </Frame>
32
- )
33
- }
34
- {name && <Lism {...defaultProps.name}>{name}</Lism>}
35
- <Lism {...defaultProps.body}>
36
- <Decorator {...defaultProps.deco} class='u--cbox is--skipFlow' />
37
- <Flow {...defaultProps.content} class='u--cbox' flow={flow} jslf={direction}>
38
- <slot />
39
- </Flow>
40
- </Lism>
27
+ {
28
+ avatar && (
29
+ <Frame {...defaultProps.avatar} src={avatar} alt="">
30
+ <img src={avatar} alt="" width="60" height="60" decoding="async" />
31
+ </Frame>
32
+ )
33
+ }
34
+ {name && <Lism {...defaultProps.name}>{name}</Lism>}
35
+ <Lism {...defaultProps.body}>
36
+ <Decorator {...defaultProps.deco} class="u--cbox is--skipFlow" />
37
+ <Flow {...defaultProps.content} class="u--cbox" flow={flow} jslf={direction}>
38
+ <slot />
39
+ </Flow>
40
+ </Lism>
41
41
  </Grid>
@@ -4,54 +4,49 @@
4
4
 
5
5
  // 各サブ要素のデフォルトプロパティ
6
6
  export const defaultProps = {
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
- },
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
- variant = 'speak',
45
- direction = 'start',
46
- keycolor = 'gray',
47
- ...props
48
- }) {
49
- return {
50
- lismClass: 'c--chat',
51
- variant,
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
- const { 'data-chat-dir': direction, ...chatProps } = getChatProps(props);
6
+ const { 'data-chat-dir': direction, ...chatProps } = getChatProps(props);
7
7
 
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
- );
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.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
- }
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
- /* Safariで表示されるデフォルトの三角形アイコンを削除 */
16
- .c--details_summary::-webkit-details-marker {
17
- display: none;
18
- }
15
+ /* Safariで表示されるデフォルトの三角形アイコンを削除 */
16
+ .c--details_summary::-webkit-details-marker {
17
+ display: none;
18
+ }
19
19
 
20
- /* 見出しタグでもフォントを揃える */
21
- /* .c--details_title {} */
20
+ /* 見出しタグでもフォントを揃える */
21
+ /* .c--details_title {} */
22
22
 
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);
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
- transition: transform var(--duration);
32
- transform: var(--_icon-transform);
33
- }
31
+ transition: transform var(--duration);
32
+ transform: var(--_icon-transform);
33
+ }
34
34
 
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
- }
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
- /* コンテンツ内部のラッパー(grid-template-rows: 0frのアニメーションに必須) */
45
- .c--details_body {
46
- overflow: hidden;
47
- }
44
+ /* コンテンツ内部のラッパー(grid-template-rows: 0frのアニメーションに必須) */
45
+ .c--details_body {
46
+ overflow: hidden;
47
+ }
48
48
  }
@@ -11,7 +11,7 @@ const props = Astro.props || {};
11
11
  ---
12
12
 
13
13
  <Lism {...defaultProps.body}>
14
- <Lism {...defaultProps.content} {...props}>
15
- <slot />
16
- </Lism>
14
+ <Lism {...defaultProps.content} {...props}>
15
+ <slot />
16
+ </Lism>
17
17
  </Lism>
@@ -14,5 +14,5 @@ const props = Astro.props || {};
14
14
  ---
15
15
 
16
16
  <details {...getLismProps(getDetailsProps(props))}>
17
- <slot />
17
+ <slot />
18
18
  </details>
@@ -10,5 +10,5 @@ const props = Astro.props || {};
10
10
  ---
11
11
 
12
12
  <Lism {...defaultProps.icon} {...props}>
13
- <slot />
13
+ <slot />
14
14
  </Lism>
@@ -5,6 +5,6 @@ import { defaultProps } from '../getProps';
5
5
  const props = Astro.props || {};
6
6
  ---
7
7
 
8
- <Lism as='summary' {...defaultProps.summary} {...props}>
9
- <slot />
8
+ <Lism as="summary" {...defaultProps.summary} {...props}>
9
+ <slot />
10
10
  </Lism>
@@ -6,5 +6,5 @@ const props = Astro.props || {};
6
6
  ---
7
7
 
8
8
  <Lism {...defaultProps.title} {...props}>
9
- <slot />
9
+ <slot />
10
10
  </Lism>
@@ -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
- props.lismClass = atts(lismClass, 'c--details');
11
- return props;
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
- 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' },
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
  };