lism-css 0.0.1 → 0.0.3

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 (234) hide show
  1. package/README.md +52 -0
  2. package/dist/_virtual/jsx-runtime.js +5 -0
  3. package/dist/_virtual/jsx-runtime2.js +4 -0
  4. package/dist/_virtual/react-jsx-runtime.development.js +4 -0
  5. package/dist/_virtual/react-jsx-runtime.production.min.js +4 -0
  6. package/dist/components/Accordion/AccIcon.js +10 -0
  7. package/dist/components/Accordion/getProps.js +29 -0
  8. package/dist/components/Accordion/index.js +6 -0
  9. package/dist/components/Accordion/index2.js +32 -0
  10. package/dist/components/Accordion/setAccordion.js +37 -0
  11. package/dist/components/Accordion/style.css +1 -0
  12. package/dist/components/Box/getProps.js +7 -0
  13. package/dist/components/Box/index.js +9 -0
  14. package/dist/components/Center/index.js +8 -0
  15. package/dist/components/Columns/getProps.js +6 -0
  16. package/dist/components/Columns/index.js +9 -0
  17. package/dist/components/Container/index.js +9 -0
  18. package/dist/components/Decorator/getProps.js +15 -0
  19. package/dist/components/Decorator/index.js +9 -0
  20. package/dist/components/Divider/getProps.js +11 -0
  21. package/dist/components/Divider/index.js +9 -0
  22. package/dist/components/Dummy/getContent.js +9 -0
  23. package/dist/components/Dummy/index.js +17 -0
  24. package/dist/components/Dummy/texts.js +24 -0
  25. package/dist/components/Flex/Cluster.js +8 -0
  26. package/dist/components/Flex/FlexItem.js +9 -0
  27. package/dist/components/Flex/getProps.js +13 -0
  28. package/dist/components/Flex/index.js +9 -0
  29. package/dist/components/Frame/getProps.js +7 -0
  30. package/dist/components/Frame/index.js +9 -0
  31. package/dist/components/Grid/GridItem.js +10 -0
  32. package/dist/components/Grid/getProps.js +28 -0
  33. package/dist/components/Grid/index.js +9 -0
  34. package/dist/components/Icon/SVG.js +29 -0
  35. package/dist/components/Icon/getProps.js +34 -0
  36. package/dist/components/Icon/index.js +11 -0
  37. package/dist/components/Icon/presets.js +193 -0
  38. package/dist/components/Layer/getProps.js +9 -0
  39. package/dist/components/Layer/index.js +10 -0
  40. package/dist/components/LinkBox/index.js +9 -0
  41. package/dist/components/Lism/Link.js +8 -0
  42. package/dist/components/Lism/Media.js +10 -0
  43. package/dist/components/Lism/Text.js +8 -0
  44. package/dist/components/Lism/index.js +9 -0
  45. package/dist/components/Modal/Body.js +10 -0
  46. package/dist/components/Modal/CloseIconBtn.js +19 -0
  47. package/dist/components/Modal/Footer.js +10 -0
  48. package/dist/components/Modal/Header.js +10 -0
  49. package/dist/components/Modal/Inner.js +9 -0
  50. package/dist/components/Modal/getProps.js +19 -0
  51. package/dist/components/Modal/index.js +10 -0
  52. package/dist/components/Modal/index2.js +17 -0
  53. package/dist/components/Modal/setModal.js +37 -0
  54. package/dist/components/Modal/style.css +1 -0
  55. package/dist/components/Spacer/getProps.js +21 -0
  56. package/dist/components/Spacer/index.js +9 -0
  57. package/dist/components/Stack/index.js +8 -0
  58. package/dist/components/Tabs/Tab.js +22 -0
  59. package/dist/components/Tabs/TabItem.js +7 -0
  60. package/dist/components/Tabs/TabList.js +8 -0
  61. package/dist/components/Tabs/TabPanel.js +19 -0
  62. package/dist/components/Tabs/getProps.js +17 -0
  63. package/dist/components/Tabs/index.js +9 -0
  64. package/dist/components/Tabs/index2.js +55 -0
  65. package/dist/components/Tabs/setEvent.js +29 -0
  66. package/dist/components/Tabs/style.css +1 -0
  67. package/dist/components/WithSide/getProps.js +14 -0
  68. package/dist/components/WithSide/index.js +9 -0
  69. package/dist/components/getFilterProps.js +23 -0
  70. package/dist/components/getInsetProps.js +8 -0
  71. package/dist/components/getMediaProps.js +14 -0
  72. package/dist/components/getTransformProps.js +8 -0
  73. package/dist/config/prop_list.js +395 -0
  74. package/dist/config/tokens.js +67 -0
  75. package/dist/config.js +9 -0
  76. package/dist/css/all.css +1 -0
  77. package/dist/css/all_no_layer.css +1 -0
  78. package/dist/css/base.css +1 -0
  79. package/dist/css/dynamic.css +1 -0
  80. package/dist/css/layout.css +1 -0
  81. package/dist/css/props.css +1 -0
  82. package/dist/css/reset.css +1 -0
  83. package/dist/css/state.css +1 -0
  84. package/dist/css/utility.css +1 -0
  85. package/dist/css/with_layer.css +1 -0
  86. package/dist/index.js +54 -0
  87. package/dist/lib/getBpData.js +13 -0
  88. package/dist/lib/getLismProps.js +239 -0
  89. package/dist/lib/getMaybeCssVar.js +61 -0
  90. package/dist/lib/getMaybeUtilValue.js +6 -0
  91. package/dist/lib/helper/atts.js +11 -0
  92. package/dist/lib/helper/filterEmptyObj.js +9 -0
  93. package/dist/lib/helper/hasKeys.js +6 -0
  94. package/dist/lib/helper/isEmptyObj.js +6 -0
  95. package/dist/lib/helper/isNumStr.js +6 -0
  96. package/dist/lib/helper/splitWithComma.js +6 -0
  97. package/dist/lib/isPresetValue.js +6 -0
  98. package/dist/lib/isTokenValue.js +9 -0
  99. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js +604 -0
  100. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js +28 -0
  101. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js +10 -0
  102. package/dist/scripts/accordion.js +4 -0
  103. package/dist/scripts/modal.js +4 -0
  104. package/dist/scripts/tabs.js +6 -0
  105. package/package.json +22 -22
  106. package/packages/astro/Accordion/AccBody.astro +15 -0
  107. package/packages/astro/Accordion/AccHeader.astro +13 -0
  108. package/packages/astro/Accordion/AccIcon.astro +19 -0
  109. package/packages/astro/Accordion/AccLabel.astro +12 -0
  110. package/packages/astro/Accordion/Accordion.astro +21 -0
  111. package/packages/astro/Accordion/__setEvent.js +2 -0
  112. package/packages/astro/Accordion/index.js +7 -0
  113. package/packages/astro/Box/Box.astro +11 -0
  114. package/packages/astro/Box/index.js +1 -0
  115. package/packages/astro/Center/Center.astro +11 -0
  116. package/packages/astro/Center/index.js +1 -0
  117. package/packages/astro/Columns/Columns.astro +11 -0
  118. package/packages/astro/Columns/index.js +1 -0
  119. package/packages/astro/Container/Container.astro +11 -0
  120. package/packages/astro/Container/index.js +1 -0
  121. package/packages/astro/Decorator/Decorator.astro +13 -0
  122. package/packages/astro/Decorator/index.js +1 -0
  123. package/packages/astro/Divider/Divider.astro +12 -0
  124. package/packages/astro/Divider/index.js +1 -0
  125. package/packages/astro/Dummy/Dummy.astro +12 -0
  126. package/packages/astro/Dummy/index.js +1 -0
  127. package/packages/astro/Flex/Cluster.astro +11 -0
  128. package/packages/astro/Flex/Flex.astro +14 -0
  129. package/packages/astro/Flex/index.js +2 -0
  130. package/packages/astro/Frame/Frame.astro +12 -0
  131. package/packages/astro/Frame/index.js +1 -0
  132. package/packages/astro/Grid/Grid.astro +13 -0
  133. package/packages/astro/Grid/GridItem.astro +15 -0
  134. package/packages/astro/Grid/index.js +2 -0
  135. package/packages/astro/Icon/Icon.astro +25 -0
  136. package/packages/astro/Icon/SVG.astro +30 -0
  137. package/packages/astro/Icon/index.js +2 -0
  138. package/packages/astro/Layer/Layer.astro +15 -0
  139. package/packages/astro/Layer/index.js +1 -0
  140. package/packages/astro/LinkBox/LinkBox.astro +16 -0
  141. package/packages/astro/LinkBox/index.js +1 -0
  142. package/packages/astro/Lism/Link.astro +10 -0
  143. package/packages/astro/Lism/Lism.astro +14 -0
  144. package/packages/astro/Lism/Media.astro +24 -0
  145. package/packages/astro/Lism/Text.astro +10 -0
  146. package/packages/astro/Lism/index.js +4 -0
  147. package/packages/astro/Modal/Body.astro +14 -0
  148. package/packages/astro/Modal/CloseIconBtn.astro +24 -0
  149. package/packages/astro/Modal/Footer.astro +14 -0
  150. package/packages/astro/Modal/Header.astro +14 -0
  151. package/packages/astro/Modal/Inner.astro +13 -0
  152. package/packages/astro/Modal/Modal.astro +20 -0
  153. package/packages/astro/Modal/index.js +8 -0
  154. package/packages/astro/OverlayLink/OverlayLink.astro +10 -0
  155. package/packages/astro/OverlayLink/index.js +1 -0
  156. package/packages/astro/Spacer/Spacer.astro +11 -0
  157. package/packages/astro/Spacer/index.js +1 -0
  158. package/packages/astro/Stack/Stack.astro +7 -0
  159. package/packages/astro/Stack/index.js +1 -0
  160. package/packages/astro/Tabs/Tab.astro +26 -0
  161. package/packages/astro/Tabs/TabItem.astro +8 -0
  162. package/packages/astro/Tabs/TabList.astro +8 -0
  163. package/packages/astro/Tabs/TabPanel.astro +22 -0
  164. package/packages/astro/Tabs/Tabs.astro +60 -0
  165. package/packages/astro/Tabs/index.js +7 -0
  166. package/packages/astro/Tabs/transformTabitems.js +40 -0
  167. package/packages/astro/Test/Test.astro +14 -0
  168. package/packages/astro/Test/TestItem.astro +14 -0
  169. package/packages/astro/Test/index.js +4 -0
  170. package/packages/astro/WithSide/WithSide.astro +12 -0
  171. package/packages/astro/WithSide/index.js +1 -0
  172. package/packages/astro/helper/index.js +6 -0
  173. package/packages/astro/index.js +29 -0
  174. package/packages/astro/types.ts +28 -0
  175. package/packages/next-js/Accordion/Accordion.jsx +19 -0
  176. package/packages/next-js/Accordion/index.js +2 -0
  177. package/src/scss/__memo/_lh-auto-all.scss +46 -0
  178. package/src/scss/__memo/_lh-auto-h.scss +50 -0
  179. package/src/scss/__memo/_lh-manual.scss +58 -0
  180. package/src/scss/_auto_output.scss +194 -0
  181. package/src/scss/_mixin.scss +38 -0
  182. package/src/scss/_props.scss +771 -0
  183. package/src/scss/_query.scss +40 -0
  184. package/src/scss/_setting.scss +22 -0
  185. package/src/scss/all.scss +10 -0
  186. package/src/scss/all_no_layer.scss +26 -0
  187. package/src/scss/base/_dom.scss +140 -0
  188. package/src/scss/base/_tokens.scss +307 -0
  189. package/src/scss/base/index.scss +70 -0
  190. package/src/scss/dynamic/index.scss +4 -0
  191. package/src/scss/layout/__switcher.scss +11 -0
  192. package/src/scss/layout/_center.scss +5 -0
  193. package/src/scss/layout/_columns.scss +18 -0
  194. package/src/scss/layout/_divider.scss +6 -0
  195. package/src/scss/layout/_flex.scss +12 -0
  196. package/src/scss/layout/_frame.scss +13 -0
  197. package/src/scss/layout/_grid.scss +16 -0
  198. package/src/scss/layout/_icon.scss +19 -0
  199. package/src/scss/layout/_spacer.scss +3 -0
  200. package/src/scss/layout/_stack.scss +4 -0
  201. package/src/scss/layout/_withSide.scss +20 -0
  202. package/src/scss/layout/index.scss +12 -0
  203. package/src/scss/props/__/__aspect.bkup.scss +36 -0
  204. package/src/scss/props/__/__border.bkup.scss +197 -0
  205. package/src/scss/props/__/__color.bkup.scss +67 -0
  206. package/src/scss/props/__/__display.bukup.scss +11 -0
  207. package/src/scss/props/__/__flex-props.bkup.scss +66 -0
  208. package/src/scss/props/__/__gap.bkup.scss +18 -0
  209. package/src/scss/props/__/__grid-props.bkup.scss +158 -0
  210. package/src/scss/props/__/__margin.bkup.scss +92 -0
  211. package/src/scss/props/__/__padding.bkup.scss +93 -0
  212. package/src/scss/props/__/__place.bkup.scss +74 -0
  213. package/src/scss/props/__/__radius.bkup.scss +27 -0
  214. package/src/scss/props/__/__sizing.bkup.scss +45 -0
  215. package/src/scss/props/__/__typography.bkup.scss +146 -0
  216. package/src/scss/props/__memo.scss +15 -0
  217. package/src/scss/props/_border.scss +67 -0
  218. package/src/scss/props/_color.scss +16 -0
  219. package/src/scss/props/_hover.scss +73 -0
  220. package/src/scss/props/_transition.scss +20 -0
  221. package/src/scss/props/index.scss +12 -0
  222. package/src/scss/reset.scss +99 -0
  223. package/src/scss/state/__container.bkup.scss +145 -0
  224. package/src/scss/state/__flow.bkup.scss +52 -0
  225. package/src/scss/state/_container.scss +45 -0
  226. package/src/scss/state/_flow.scss +45 -0
  227. package/src/scss/state/_gutter.scss +3 -0
  228. package/src/scss/state/_has-divider.scss +30 -0
  229. package/src/scss/state/_layer.scss +7 -0
  230. package/src/scss/state/_linkbox.scss +18 -0
  231. package/src/scss/state/_size.scss +60 -0
  232. package/src/scss/state/index.scss +8 -0
  233. package/src/scss/utility/index.scss +76 -0
  234. package/src/scss/with_layer.scss +28 -0
@@ -0,0 +1,20 @@
1
+ ---
2
+ import type { LismProps } from '../types';
3
+ import { getProps } from '../../../dist/components/Modal/getProps';
4
+ import { Lism } from '../Lism';
5
+
6
+ // Propsの定義
7
+ interface Props extends LismProps {}
8
+ const { layout, ...props } = Astro.props || {};
9
+ const Layout = layout || Lism;
10
+ ---
11
+
12
+ <Layout tag='dialog' {...getProps(props)}>
13
+ <slot />
14
+ </Layout>
15
+
16
+ <script>
17
+ import setModal from '../../../dist/components/Modal/setModal';
18
+ console.log('modal.astro');
19
+ setModal();
20
+ </script>
@@ -0,0 +1,8 @@
1
+ import Root from './Modal.astro';
2
+ import Inner from './Inner.astro';
3
+ import Body from './Body.astro';
4
+ import CloseIconBtn from './CloseIconBtn.astro';
5
+ import Header from './Header.astro';
6
+ import Footer from './Footer.astro';
7
+
8
+ export default { Root, Inner, Body, CloseIconBtn, Header, Footer };
@@ -0,0 +1,10 @@
1
+ ---
2
+ import type { LismProps } from '../types';
3
+ import { Lism } from '../Lism';
4
+ import getOverlayLinkProps from '../../../dist/components/OverlayLink/getProps';
5
+
6
+ interface Props extends LismProps {}
7
+ const props = Astro.props || {};
8
+ ---
9
+
10
+ <Lism {...getOverlayLinkProps(props)}><slot /></Lism>
@@ -0,0 +1 @@
1
+ export { default as OverlayLink } from './OverlayLink.astro';
@@ -0,0 +1,11 @@
1
+ ---
2
+ import type { LismProps } from '../types';
3
+ import { Lism } from '../Lism';
4
+ import getProps from '../../../dist/components/Spacer/getProps';
5
+
6
+ // Propsの定義
7
+ interface Props extends LismProps {}
8
+ const props = Astro.props || {};
9
+ ---
10
+
11
+ <Lism skipState {...getProps(props)} />
@@ -0,0 +1 @@
1
+ export { default as Spacer } from './Spacer.astro';
@@ -0,0 +1,7 @@
1
+ ---
2
+ import Flex from '../Flex/Flex.astro';
3
+ ---
4
+
5
+ <Flex _flex='stack' {...Astro.props}>
6
+ <slot />
7
+ </Flex>
@@ -0,0 +1 @@
1
+ export { default as Stack } from './Stack.astro';
@@ -0,0 +1,26 @@
1
+ ---
2
+ import type { LismProps } from '../types';
3
+ import { Lism } from '../Lism';
4
+
5
+ export interface Props extends LismProps {
6
+ // controlId: string;
7
+ isActive?: boolean;
8
+ tabId?: string | number;
9
+ index?: number;
10
+ }
11
+ const { tabId = 'tab', index = 0, isActive, ...props } = Astro.props;
12
+ const controlId = `${tabId}-${index}`;
13
+ ---
14
+
15
+ <Lism
16
+ tag='button'
17
+ lismClass='d--tabs__tab'
18
+ className='re--style'
19
+ role='tab'
20
+ aria-controls={controlId}
21
+ aria-selected={isActive ? 'true' : 'false'}
22
+ skipState
23
+ {...props}
24
+ >
25
+ <slot />
26
+ </Lism>
@@ -0,0 +1,8 @@
1
+ ---
2
+ // memo: タブボタンが <button ~ button> で取得できることを前提にして<slot />だけにしている。
3
+ // <slot name='tab' />,<slot name='panel' />に分け、それぞれをカスタムDOMで囲んだ方が確実にそれぞれの内容は取れるが、わざわざslot指定が必要になってしまう。
4
+ ---
5
+
6
+ <lism-placeholder-tabitem>
7
+ <slot />
8
+ </lism-placeholder-tabitem>
@@ -0,0 +1,8 @@
1
+ ---
2
+ // import type { LismProps } from '../types';
3
+ import { Flex } from '../Flex';
4
+ ---
5
+
6
+ <Flex lismClass='d--tabs__list' role='tablist' {...Astro.props}>
7
+ <slot />
8
+ </Flex>
@@ -0,0 +1,22 @@
1
+ ---
2
+ import type { LismProps } from '../types';
3
+ import { GridItem } from '../Grid';
4
+
5
+ export interface Props extends LismProps {
6
+ isActive?: boolean;
7
+ tabId?: string | number;
8
+ index?: number;
9
+ }
10
+ const { tabId = 'tab', index = 0, isActive = false, ...props } = Astro.props;
11
+ const controlId = `${tabId}-${index}`;
12
+ ---
13
+
14
+ <GridItem
15
+ id={controlId}
16
+ role='tabpanel'
17
+ aria-hidden={isActive ? 'false' : 'true'}
18
+ lismClass='d--tabs__panel'
19
+ {...props}
20
+ >
21
+ <slot />
22
+ </GridItem>
@@ -0,0 +1,60 @@
1
+ ---
2
+ import type { LismProps } from '../types';
3
+ import { Grid } from '../Grid';
4
+ // import Tab from './Tab.astro';
5
+ // import TabPanel from './TabPanel.astro';
6
+ import TabList from './TabList.astro';
7
+ import { uuidv4 } from '../helper/index.js';
8
+ import transformTabitems from './transformTabitems.js';
9
+ import getTabsProps from '../../../dist/components/Tabs/getProps';
10
+
11
+ // import TheTab from './TheTab.astro';}
12
+ // slotsについて: https://docs.astro.build/ja/reference/api-reference/#astroslots
13
+
14
+ // Propsの定義
15
+ interface Props extends LismProps {
16
+ uid?: string | number;
17
+ defaultIndex?: string | number;
18
+ }
19
+ // propsの取得
20
+ const { defaultIndex = 1, tabId = '', listProps = {}, ...props } = Astro.props || {};
21
+
22
+ // tabID生成
23
+ const theTabID = tabId ? tabId : uuidv4();
24
+
25
+ // 子要素の方から順番に処理されていくので、文字列処理でデータを抽出
26
+ const { btns, panels } = transformTabitems(
27
+ await Astro.slots.render('default'),
28
+ theTabID,
29
+ defaultIndex
30
+ );
31
+
32
+ const hasItems = btns.length > 0;
33
+ ---
34
+
35
+ <Grid {...getTabsProps(props)}>
36
+ {
37
+ btns && (
38
+ <TabList {...listProps}>
39
+ {btns.map((btn, index) => {
40
+ return <Fragment key={index} set:html={btn} />;
41
+ })}
42
+ </TabList>
43
+ )
44
+ }
45
+ {
46
+ panels.map((panel, index) => {
47
+ return <Fragment key={index} set:html={panel} />;
48
+ })
49
+ }
50
+ {!hasItems && <slot />}
51
+ </Grid>
52
+
53
+ <script>
54
+ // import setEvent from './setEvent';
55
+ import setEvent from '../../../dist/components/Tabs/setEvent';
56
+ const tabsAll = document.querySelectorAll('.d--tabs');
57
+ tabsAll.forEach((tabs) => {
58
+ setEvent(tabs);
59
+ });
60
+ </script>
@@ -0,0 +1,7 @@
1
+ import { default as Root } from './Tabs.astro';
2
+ import { default as Item } from './TabItem.astro';
3
+ import { default as List } from './TabList.astro';
4
+ import { default as Panel } from './TabPanel.astro';
5
+ import { default as Tab } from './Tab.astro';
6
+
7
+ export default { Root, List, Panel, Item, Tab };
@@ -0,0 +1,40 @@
1
+ // <lism-placeholder-tabitem> → div.tabitem へ 変換
2
+ export default function transformHTML(htmlString, tabID, defaultIndex) {
3
+ let index = 1; // 1スタート
4
+ let btns = [];
5
+ let panels = [];
6
+
7
+ // <lism-placeholder-tabitem>でコンテンツを囲んでいるので中身を解析する。
8
+ const regex = /<lism-placeholder-tabitem(.*?)>(.*?)<\/lism-placeholder-tabitem>/gs;
9
+ const matches = [...htmlString.matchAll(regex)];
10
+
11
+ // console.log(matches);
12
+ matches.forEach((match) => {
13
+ // const tabItemAttrs = match[1]; // 使わないがdata-astro-source-file属性が自動でついてきたりするので、属性値があっても問題ないようにしている。
14
+ const tabItemContent = match[2];
15
+
16
+ const controlId = `${tabID}-${index}`;
17
+ const isActive = index === defaultIndex;
18
+ index++;
19
+
20
+ // <lism-placeholder-tabtbn>からタブボタンを生成
21
+ const btnMatch = tabItemContent.match(/<button(.*?)>(.*?)<\/button>(.*)/s);
22
+ if (!btnMatch) return;
23
+ let btnAtts = btnMatch[1];
24
+ let btnContent = btnMatch[2];
25
+ let panel = btnMatch[3];
26
+
27
+ // btnContent = btnContent.replace(` slot="tab"`, '');
28
+ btnAtts = btnAtts.replace(`aria-controls="tab-0"`, `aria-controls="${controlId}"`);
29
+ panel = panel.replace(`id="tab-0"`, `id="${controlId}"`);
30
+ if (isActive) {
31
+ btnAtts = btnAtts.replace(/aria-selected="false"/, 'aria-selected="true"');
32
+ panel = panel.replace(/aria-hidden="true"/, 'aria-hidden="false"');
33
+ }
34
+
35
+ btns.push(`<button${btnAtts}>${btnContent}</button>`);
36
+ panels.push(panel);
37
+ });
38
+
39
+ return { btns, panels };
40
+ }
@@ -0,0 +1,14 @@
1
+ ---
2
+ import type { LismProps } from '../types';
3
+ import { Lism } from '../Lism';
4
+
5
+ // Propsの定義
6
+ interface Props extends LismProps {
7
+ duration?: string | number;
8
+ }
9
+ const props = Astro.props || {};
10
+ ---
11
+
12
+ <Lism data-lism='test' bd p='20' {...props}>
13
+ <slot />
14
+ </Lism>
@@ -0,0 +1,14 @@
1
+ ---
2
+ import type { LismProps } from '../types';
3
+ import { Lism } from '../Lism';
4
+
5
+ // Propsの定義
6
+ interface Props extends LismProps {
7
+ duration?: string | number;
8
+ }
9
+ const props = Astro.props || {};
10
+ ---
11
+
12
+ <Lism data-lism='test-item' bd bds='dashed' {...props}>
13
+ <slot />
14
+ </Lism>
@@ -0,0 +1,4 @@
1
+ import { default as Root } from './Test.astro';
2
+ import { default as Item } from './TestItem.astro';
3
+
4
+ export default { Root, Item };
@@ -0,0 +1,12 @@
1
+ ---
2
+ import type { LismProps } from '../types';
3
+ import { Lism } from '../Lism';
4
+ import { getWithSideProps } from '../../../dist/components/WithSide/getProps';
5
+
6
+ // Propsの定義
7
+ interface Props extends LismProps {}
8
+
9
+ const props = Astro.props || {};
10
+ ---
11
+
12
+ <Lism {...getWithSideProps(props)}><slot /></Lism>
@@ -0,0 +1 @@
1
+ export { default as WithSide } from './WithSide.astro';
@@ -0,0 +1,6 @@
1
+ // https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid
2
+ export function uuidv4() {
3
+ return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) =>
4
+ (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
5
+ );
6
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * .astro でLismコンポーネントを配布
3
+ */
4
+
5
+ // export { default as Lism } from './Lism/Lism.astro';
6
+ // export { Lism, Text, Media, Link } from './Lism';
7
+ export * from './Lism';
8
+ export * from './Dummy';
9
+ export * from './Box';
10
+ export * from './Flex';
11
+ export * from './Stack';
12
+ export * from './Grid';
13
+ export * from './Columns';
14
+ export * from './Center';
15
+ export * from './WithSide';
16
+ export * from './Frame';
17
+
18
+ export * from './Container';
19
+ export * from './Layer';
20
+ export * from './LinkBox';
21
+
22
+ export * from './Spacer';
23
+ export * from './Decorator';
24
+ export * from './Divider';
25
+ export * from './Icon';
26
+
27
+ export { default as Accordion } from './Accordion';
28
+ export { default as Modal } from './Modal';
29
+ export { default as Tabs } from './Tabs';
@@ -0,0 +1,28 @@
1
+ // export interface LismClass {
2
+ // b?: string;
3
+ // c?: string;
4
+ // l?: string;
5
+ // e?: string;
6
+ // }
7
+ export interface LismStyle {
8
+ [key: string]: number | string; // 任意のプロパティを受け取る
9
+ }
10
+
11
+ export interface exProps {
12
+ [key: string]: any;
13
+ }
14
+
15
+ export interface LismProps {
16
+ lismClass?: string;
17
+ _lismClass?: string[];
18
+ lismStyle?: LismStyle;
19
+ lismState?: string[];
20
+ skipState?: boolean;
21
+ as?: any;
22
+ tag?: string;
23
+ variant?: string;
24
+ // lismState?: ;
25
+ // style
26
+ exProps?: exProps;
27
+ [key: string]: any;
28
+ }
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ import Accordion from '../../../dist/components/Accordion';
3
+ // import 'style';
4
+
5
+ export function Root(props) {
6
+ return <Accordion.Root {...props} />;
7
+ }
8
+ export function Header(props) {
9
+ return <Accordion.Header {...props} />;
10
+ }
11
+ export function Label(props) {
12
+ return <Accordion.Label {...props} />;
13
+ }
14
+ export function Body(props) {
15
+ return <Accordion.Body {...props} />;
16
+ }
17
+ export function Icon(props) {
18
+ return <Accordion.Icon {...props} />;
19
+ }
@@ -0,0 +1,2 @@
1
+ import { Root, Header, Label, Body, Icon } from './Accordion';
2
+ export default { Root, Header, Label, Body, Icon };
@@ -0,0 +1,46 @@
1
+ /*
2
+ * タイポグラフィオート計算でを * に対して指定するケース
3
+ * 親要素の --lh の引き継ぎに問題が発生する。
4
+ → 下限・上限を超える値がセットされている時、その値を継承できない。
5
+ */
6
+ :root{
7
+ --lh--min: 1.3em;
8
+ --lh--max: 1.9em;
9
+ }
10
+ // ---------------------------------------------------------------------
11
+
12
+ // 全要素で --fz, --lh を受け取れるように
13
+ :where(body *){
14
+ font-size: var(--fz, inherit);
15
+ line-height: var(--lh, inherit);
16
+ }
17
+
18
+ // [style*="--fz:"]{
19
+ // font-size: var(--fz);
20
+ // }
21
+
22
+
23
+ // :not([style*="font-size"]) にしてても、* によって親要素側で計算されはじめたりするので、多少影響は受ける
24
+ *:not([style*="font-size"]),
25
+ [style*="--fz:"], // --fzでフォントサイズ指定されているもの
26
+ [class*="-fz\:"], {
27
+
28
+ --slope: 0.35; // 自動計算用の傾き
29
+ --base: calc(var(--lh, var(--root--lh)) * 1em); // 計算ように単位をつけておく
30
+
31
+ // 上限値を var(--base) にすることで、フォントサイズが大きい場合にのみ計算を適用することも可能
32
+ line-height: clamp(
33
+ min(var(--lh--min), var(--base)),
34
+ calc((var(--slope) * 1em) + var(--base) - (var(--slope) * var(--fz, 1em)) ),
35
+ max(var(--lh--max), var(--base))
36
+ );
37
+ }
38
+
39
+ // .-fz:などに対して--lh指定されてあった場合に上書きできる位置で
40
+ // [style*="--lh:"]{
41
+ // line-height: var(--lh);
42
+ // --lh--min: min(var(--lh--min), var(--base));
43
+ // --lh--max: max(var(--lh--min), var(--base));
44
+ // }
45
+
46
+ // ---------------------------------------------------------------------
@@ -0,0 +1,50 @@
1
+ /*
2
+ * タイポグラフィ
3
+ */
4
+ :root {
5
+ --lh--min: 1.3em;
6
+ --lh--max: 1.9em;
7
+ }
8
+
9
+ // ---------------------------------------------------------------------
10
+ body {
11
+ --fz: 1em; // 計算用に --fz の単位をem化しておく
12
+ --lh: var(--root--lh); // 任意の値
13
+ }
14
+
15
+ // :where(body *),
16
+ :where(:is(h1, h2, h3, h4, h5, h6, p)) {
17
+ font-size: var(--fz, inherit);
18
+ line-height: var(--lh, inherit);
19
+ }
20
+
21
+ // [style*="--fz:"]{
22
+ // font-size: var(--fz);
23
+ // }
24
+
25
+ // :where(:is(h1, h2, h3, h4, h5, h6, p)):not([style*="font-size"]){
26
+ // color: red;
27
+ // }
28
+
29
+ .-typoCalc, // (仮名) 自動計算対象にするというユーティリティクラス合ったほうが便利かも...?
30
+ [style*="--fz:"], // --fzでフォントサイズ指定されているもの
31
+ :where(:is(h1, h2, h3, h4, h5, h6, p)):not([style*="font-size"]),
32
+ [class*="-fz\:"] {
33
+ --slope: 0.35; // 自動計算用の傾き
34
+ --base: calc(var(--lh) * 1em); // 計算ように単位をつけておく
35
+
36
+ // 上限値を var(--base) にすることで、フォントサイズが大きい場合にのみ計算を適用することも可能
37
+ line-height: clamp(
38
+ min(var(--lh--min), var(--base)),
39
+ calc((var(--slope) * 1em) + var(--base) - (var(--slope) * var(--fz))),
40
+ max(var(--lh--max), var(--base))
41
+ );
42
+ font-size: var(--fz);
43
+ }
44
+
45
+ // --lh指定されている要素自身はその値で上書き。→ .-lh: 使ってもらう?
46
+ [style*='--lh:'] {
47
+ line-height: var(--lh);
48
+ }
49
+
50
+ // ---------------------------------------------------------------------
@@ -0,0 +1,58 @@
1
+ :root {
2
+ // 各fzサイズ用のline-height
3
+ --ls--6L--lh: 1.2;
4
+ --ls--5L--lh: 1.4;
5
+ --ls--4L--lh: 1.4;
6
+ --ls--3L--lh: 1.5;
7
+ --ls--2L--lh: 1.6;
8
+ --ls--L--lh: 1.6;
9
+
10
+ // 1,
11
+ // 1.25, 5XL
12
+ // 1.4 4XL
13
+ // 1.5, 2XL, 3XL,
14
+ // 1.6, L XL
15
+ // 1.75 base
16
+ // 2,
17
+ // 2.5
18
+
19
+ // 1, xs sm md, lg xl
20
+ // 1, 1.25, 1.5. 1.75, 2, 2.5
21
+ }
22
+
23
+ h1 {
24
+ --lh: var(--ls--4L--lh);
25
+ }
26
+ h2 {
27
+ --lh: var(--ls--3L--lh);
28
+ }
29
+ h3 {
30
+ --lh: var(--ls--2L--lh);
31
+ }
32
+ h4 {
33
+ --lh: var(--ls--L--lh);
34
+ }
35
+ // h5 {}
36
+ // h6 {}
37
+
38
+ // .-fz\:xs {}
39
+ // .-fz\:s {}
40
+ // .-fz\:m {}
41
+ .-fz\:l {
42
+ --lh: var(--ls--L--lh);
43
+ }
44
+ .-fz\:xl {
45
+ --lh: var(--ls--2L--lh);
46
+ }
47
+ .-fz\:2xl {
48
+ --lh: var(--ls--3L--lh);
49
+ }
50
+ .-fz\:3xl {
51
+ --lh: var(--ls--4L--lh);
52
+ }
53
+ .-fz\:4xl {
54
+ --lh: var(--ls--5L--lh);
55
+ }
56
+ .-fz\:5xl {
57
+ --lh: var(--ls--6L--lh);
58
+ }