lism-css 0.11.0 → 0.13.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 (220) hide show
  1. package/README.ja.md +9 -9
  2. package/README.md +12 -12
  3. package/config/default-config.ts +2 -2
  4. package/config/defaults/props.ts +16 -26
  5. package/config/defaults/traits.ts +16 -0
  6. package/config/index.ts +3 -3
  7. package/dist/components/{atomic/Media → Media}/Media.d.ts +2 -2
  8. package/dist/components/{atomic/Media → Media}/index.js +1 -1
  9. package/dist/components/atomic/Icon/getProps.d.ts +1 -1
  10. package/dist/components/atomic/Icon/index.d.ts +1 -1
  11. package/dist/components/index.d.ts +18 -18
  12. package/dist/components/index.js +45 -45
  13. package/dist/components/{Box → layout/Box}/Box.d.ts +2 -2
  14. package/dist/components/{Box → layout/Box}/index.js +1 -1
  15. package/dist/components/{Center → layout/Center}/Center.d.ts +2 -2
  16. package/dist/components/{Center → layout/Center}/index.js +1 -1
  17. package/dist/components/{Cluster → layout/Cluster}/Cluster.d.ts +2 -2
  18. package/dist/components/{Cluster → layout/Cluster}/index.js +1 -1
  19. package/dist/components/{Columns → layout/Columns}/Columns.d.ts +2 -2
  20. package/dist/components/{Columns → layout/Columns}/index.js +1 -1
  21. package/dist/components/{Flex → layout/Flex}/Flex.d.ts +2 -2
  22. package/dist/components/{Flex → layout/Flex}/index.js +1 -1
  23. package/dist/components/{Flow → layout/Flow}/Flow.d.ts +2 -2
  24. package/dist/components/{Flow → layout/Flow}/index.js +1 -1
  25. package/dist/components/{FluidCols → layout/FluidCols}/FluidCols.d.ts +2 -2
  26. package/dist/components/{FluidCols → layout/FluidCols}/index.js +1 -1
  27. package/dist/components/{Frame → layout/Frame}/Frame.d.ts +2 -2
  28. package/dist/components/{Frame → layout/Frame}/index.js +1 -1
  29. package/dist/components/{Grid → layout/Grid}/Grid.d.ts +2 -2
  30. package/dist/components/{Grid → layout/Grid}/index.js +1 -1
  31. package/dist/components/{SideMain → layout/SideMain}/SideMain.d.ts +2 -2
  32. package/dist/components/{SideMain → layout/SideMain}/index.js +1 -1
  33. package/dist/components/{Stack → layout/Stack}/Stack.d.ts +2 -2
  34. package/dist/components/{Stack → layout/Stack}/index.js +1 -1
  35. package/dist/components/{SwitchCols → layout/SwitchCols}/SwitchCols.d.ts +2 -2
  36. package/dist/components/{SwitchCols → layout/SwitchCols}/index.js +1 -1
  37. package/dist/components/layout/TileGrid/TileGrid.d.ts +4 -0
  38. package/dist/components/layout/TileGrid/index.d.ts +1 -0
  39. package/dist/components/layout/TileGrid/index.js +8 -0
  40. package/dist/components/state/BoxLink/BoxLink.d.ts +5 -0
  41. package/dist/components/{LinkBox/LinkBox.stories.d.ts → state/BoxLink/BoxLink.stories.d.ts} +3 -3
  42. package/dist/components/state/BoxLink/index.d.ts +1 -0
  43. package/dist/components/{LinkBox → state/BoxLink}/index.js +2 -2
  44. package/dist/components/state/BoxLink/script.d.ts +4 -0
  45. package/dist/components/state/Container/Container.d.ts +2 -0
  46. package/dist/components/{Container → state/Container}/Container.stories.d.ts +2 -2
  47. package/dist/components/state/Container/index.js +8 -0
  48. package/dist/components/{Layer → state/Layer}/Layer.d.ts +1 -1
  49. package/dist/components/{Layer → state/Layer}/index.js +1 -1
  50. package/dist/components/{Wrapper → state/Wrapper}/Wrapper.d.ts +1 -1
  51. package/dist/components/{Wrapper → state/Wrapper}/index.js +1 -1
  52. package/dist/config/default-config.d.ts +27 -73
  53. package/dist/config/default-config.js +4 -4
  54. package/dist/config/defaults/props.d.ts +24 -58
  55. package/dist/config/defaults/props.js +16 -26
  56. package/dist/config/defaults/{states.d.ts → traits.d.ts} +2 -14
  57. package/dist/config/defaults/traits.js +19 -0
  58. package/dist/config/index.d.ts +54 -146
  59. package/dist/config/index.js +5 -5
  60. package/dist/css/base.css +1 -1
  61. package/dist/css/main.css +1 -1
  62. package/dist/css/main_no_layer.css +1 -1
  63. package/dist/css/primitives/layout.css +1 -0
  64. package/dist/css/primitives/trait.css +1 -0
  65. package/dist/css/props.css +1 -1
  66. package/dist/css/utility.css +1 -1
  67. package/dist/lib/getLayoutProps.js +12 -15
  68. package/dist/lib/getLismProps.d.ts +9 -6
  69. package/dist/lib/getLismProps.js +113 -101
  70. package/dist/lib/helper/mergeSet.d.ts +10 -0
  71. package/dist/lib/helper/mergeSet.js +14 -0
  72. package/dist/lib/types/LayoutProps.d.ts +4 -1
  73. package/dist/lib/types/TraitProps.d.ts +47 -0
  74. package/dist/lib/types/TraitProps.spec-d.d.ts +1 -0
  75. package/package.json +1 -1
  76. package/packages/astro/{Decorator → atomic/Decorator}/Decorator.astro +1 -1
  77. package/packages/astro/{Divider → atomic/Divider}/Divider.astro +2 -2
  78. package/packages/astro/{Icon → atomic/Icon}/Icon.astro +1 -1
  79. package/packages/astro/{Spacer → atomic/Spacer}/Spacer.astro +2 -2
  80. package/packages/astro/index.ts +26 -22
  81. package/packages/astro/{Box → layout/Box}/Box.astro +2 -2
  82. package/packages/astro/{Center → layout/Center}/Center.astro +2 -2
  83. package/packages/astro/{Cluster → layout/Cluster}/Cluster.astro +2 -2
  84. package/packages/astro/{Columns → layout/Columns}/Columns.astro +2 -2
  85. package/packages/astro/{Flex → layout/Flex}/Flex.astro +2 -2
  86. package/packages/astro/{Flow → layout/Flow}/Flow.astro +2 -2
  87. package/packages/astro/{FluidCols → layout/FluidCols}/FluidCols.astro +2 -2
  88. package/packages/astro/{Frame → layout/Frame}/Frame.astro +2 -2
  89. package/packages/astro/{Grid → layout/Grid}/Grid.astro +2 -2
  90. package/packages/astro/{SideMain → layout/SideMain}/SideMain.astro +2 -2
  91. package/packages/astro/{Stack → layout/Stack}/Stack.astro +2 -2
  92. package/packages/astro/{SwitchCols → layout/SwitchCols}/SwitchCols.astro +2 -2
  93. package/packages/astro/layout/TileGrid/TileGrid.astro +11 -0
  94. package/packages/astro/layout/TileGrid/index.ts +1 -0
  95. package/packages/astro/{LinkBox/LinkBox.astro → state/BoxLink/BoxLink.astro} +4 -4
  96. package/packages/astro/state/BoxLink/index.ts +1 -0
  97. package/packages/astro/state/Container/Container.astro +11 -0
  98. package/packages/astro/{Layer → state/Layer}/Layer.astro +2 -2
  99. package/packages/astro/{Wrapper → state/Wrapper}/Wrapper.astro +2 -2
  100. package/src/scss/_auto_output.scss +1 -1
  101. package/src/scss/_prop-config.scss +24 -26
  102. package/src/scss/_with_layer.scss +15 -8
  103. package/src/scss/base/_html.scss +8 -8
  104. package/src/scss/base/tokens/_tokens.scss +1 -3
  105. package/src/scss/main_no_layer.scss +4 -4
  106. package/src/scss/primitives/layout/_grid.scss +7 -0
  107. package/src/scss/primitives/layout/_tileGrid.scss +4 -0
  108. package/src/scss/{modules → primitives}/layout/index.scss +2 -1
  109. package/src/scss/{modules/state/_linkbox.scss → primitives/trait/_boxLink.scss} +4 -4
  110. package/src/scss/{utility/_linkExpand.scss → primitives/trait/_coverLink.scss} +1 -1
  111. package/src/scss/primitives/trait/index.scss +7 -0
  112. package/src/scss/props/index.scss +1 -1
  113. package/src/scss/utility/_cbox.scss +1 -1
  114. package/src/scss/utility/_clipText.scss +1 -1
  115. package/src/scss/utility/index.scss +0 -1
  116. package/config/defaults/states.ts +0 -43
  117. package/config/helper/getSvgUrl.ts +0 -26
  118. package/dist/components/Container/Container.d.ts +0 -6
  119. package/dist/components/Container/index.js +0 -8
  120. package/dist/components/HTML/HTML.d.ts +0 -26
  121. package/dist/components/HTML/index.d.ts +0 -14
  122. package/dist/components/HTML/index.js +0 -5
  123. package/dist/components/HTML/index2.js +0 -45
  124. package/dist/components/LinkBox/LinkBox.d.ts +0 -5
  125. package/dist/components/LinkBox/index.d.ts +0 -1
  126. package/dist/components/LinkBox/script.d.ts +0 -4
  127. package/dist/config/defaults/states.js +0 -38
  128. package/dist/config/helper/getSvgUrl.d.ts +0 -5
  129. package/dist/config/helper/getSvgUrl.js +0 -4
  130. package/dist/css/modules/layout.css +0 -1
  131. package/dist/css/modules/state.css +0 -1
  132. package/dist/lib/types/StateProps.d.ts +0 -27
  133. package/packages/astro/Container/Container.astro +0 -14
  134. package/packages/astro/HTML/_index_memo.js +0 -29
  135. package/packages/astro/HTML/a.astro +0 -10
  136. package/packages/astro/HTML/button.astro +0 -10
  137. package/packages/astro/HTML/div.astro +0 -10
  138. package/packages/astro/HTML/h.astro +0 -13
  139. package/packages/astro/HTML/img.astro +0 -10
  140. package/packages/astro/HTML/index.ts +0 -12
  141. package/packages/astro/HTML/li.astro +0 -10
  142. package/packages/astro/HTML/ol.astro +0 -10
  143. package/packages/astro/HTML/p.astro +0 -10
  144. package/packages/astro/HTML/span.astro +0 -10
  145. package/packages/astro/HTML/ul.astro +0 -10
  146. package/packages/astro/LinkBox/index.ts +0 -1
  147. package/src/scss/modules/layout/_grid.scss +0 -12
  148. package/src/scss/modules/state/index.scss +0 -6
  149. /package/dist/components/{atomic/Media → Media}/Media.stories.d.ts +0 -0
  150. /package/dist/components/{atomic/Media → Media}/index.d.ts +0 -0
  151. /package/dist/components/{Box → layout/Box}/Box.stories.d.ts +0 -0
  152. /package/dist/components/{Box → layout/Box}/index.d.ts +0 -0
  153. /package/dist/components/{Center → layout/Center}/Center.stories.d.ts +0 -0
  154. /package/dist/components/{Center → layout/Center}/index.d.ts +0 -0
  155. /package/dist/components/{Cluster → layout/Cluster}/Cluster.stories.d.ts +0 -0
  156. /package/dist/components/{Cluster → layout/Cluster}/index.d.ts +0 -0
  157. /package/dist/components/{Columns → layout/Columns}/Columns.stories.d.ts +0 -0
  158. /package/dist/components/{Columns → layout/Columns}/index.d.ts +0 -0
  159. /package/dist/components/{Flex → layout/Flex}/Flex.stories.d.ts +0 -0
  160. /package/dist/components/{Flex → layout/Flex}/index.d.ts +0 -0
  161. /package/dist/components/{Flow → layout/Flow}/Flow.stories.d.ts +0 -0
  162. /package/dist/components/{Flow → layout/Flow}/index.d.ts +0 -0
  163. /package/dist/components/{FluidCols → layout/FluidCols}/FluidCols.stories.d.ts +0 -0
  164. /package/dist/components/{FluidCols → layout/FluidCols}/index.d.ts +0 -0
  165. /package/dist/components/{Frame → layout/Frame}/Frame.stories.d.ts +0 -0
  166. /package/dist/components/{Frame → layout/Frame}/index.d.ts +0 -0
  167. /package/dist/components/{Grid → layout/Grid}/Grid.stories.d.ts +0 -0
  168. /package/dist/components/{Grid → layout/Grid}/index.d.ts +0 -0
  169. /package/dist/components/{SideMain → layout/SideMain}/SideMain.stories.d.ts +0 -0
  170. /package/dist/components/{SideMain → layout/SideMain}/index.d.ts +0 -0
  171. /package/dist/components/{Stack → layout/Stack}/Stack.stories.d.ts +0 -0
  172. /package/dist/components/{Stack → layout/Stack}/index.d.ts +0 -0
  173. /package/dist/components/{SwitchCols → layout/SwitchCols}/SwitchCols.stories.d.ts +0 -0
  174. /package/dist/components/{SwitchCols → layout/SwitchCols}/index.d.ts +0 -0
  175. /package/dist/components/{Container → state/Container}/index.d.ts +0 -0
  176. /package/dist/components/{Layer → state/Layer}/Layer.stories.d.ts +0 -0
  177. /package/dist/components/{Layer → state/Layer}/Layer.test.d.ts +0 -0
  178. /package/dist/components/{Layer → state/Layer}/index.d.ts +0 -0
  179. /package/dist/components/{Wrapper → state/Wrapper}/Wrapper.stories.d.ts +0 -0
  180. /package/dist/components/{Wrapper → state/Wrapper}/index.d.ts +0 -0
  181. /package/dist/css/{modules → primitives}/atomic.css +0 -0
  182. /package/dist/lib/{types/StateProps.spec-d.d.ts → helper/mergeSet.test.d.ts} +0 -0
  183. /package/packages/astro/{Decorator → atomic/Decorator}/index.ts +0 -0
  184. /package/packages/astro/{Divider → atomic/Divider}/index.ts +0 -0
  185. /package/packages/astro/{Icon → atomic/Icon}/SVG.astro +0 -0
  186. /package/packages/astro/{Icon → atomic/Icon}/index.ts +0 -0
  187. /package/packages/astro/{Spacer → atomic/Spacer}/index.ts +0 -0
  188. /package/packages/astro/{Box → layout/Box}/index.ts +0 -0
  189. /package/packages/astro/{Center → layout/Center}/index.ts +0 -0
  190. /package/packages/astro/{Cluster → layout/Cluster}/index.ts +0 -0
  191. /package/packages/astro/{Columns → layout/Columns}/index.ts +0 -0
  192. /package/packages/astro/{Flex → layout/Flex}/index.ts +0 -0
  193. /package/packages/astro/{Flow → layout/Flow}/index.ts +0 -0
  194. /package/packages/astro/{FluidCols → layout/FluidCols}/index.ts +0 -0
  195. /package/packages/astro/{Frame → layout/Frame}/index.ts +0 -0
  196. /package/packages/astro/{Grid → layout/Grid}/index.ts +0 -0
  197. /package/packages/astro/{SideMain → layout/SideMain}/index.ts +0 -0
  198. /package/packages/astro/{Stack → layout/Stack}/index.ts +0 -0
  199. /package/packages/astro/{SwitchCols → layout/SwitchCols}/index.ts +0 -0
  200. /package/packages/astro/{Container → state/Container}/index.ts +0 -0
  201. /package/packages/astro/{Layer → state/Layer}/index.ts +0 -0
  202. /package/packages/astro/{Wrapper → state/Wrapper}/index.ts +0 -0
  203. /package/src/scss/{modules → primitives}/atomic/_divider.scss +0 -0
  204. /package/src/scss/{modules → primitives}/atomic/_icon.scss +0 -0
  205. /package/src/scss/{modules → primitives}/atomic/_spacer.scss +0 -0
  206. /package/src/scss/{modules → primitives}/atomic/index.scss +0 -0
  207. /package/src/scss/{modules → primitives}/layout/_center.scss +0 -0
  208. /package/src/scss/{modules → primitives}/layout/_cluster.scss +0 -0
  209. /package/src/scss/{modules → primitives}/layout/_columns.scss +0 -0
  210. /package/src/scss/{modules → primitives}/layout/_flex.scss +0 -0
  211. /package/src/scss/{modules → primitives}/layout/_flow.scss +0 -0
  212. /package/src/scss/{modules → primitives}/layout/_fluidCols.scss +0 -0
  213. /package/src/scss/{modules → primitives}/layout/_frame.scss +0 -0
  214. /package/src/scss/{modules → primitives}/layout/_sideMain.scss +0 -0
  215. /package/src/scss/{modules → primitives}/layout/_stack.scss +0 -0
  216. /package/src/scss/{modules → primitives}/layout/_switchCols.scss +0 -0
  217. /package/src/scss/{modules/state → primitives/trait}/_container.scss +0 -0
  218. /package/src/scss/{modules/state → primitives/trait}/_layer.scss +0 -0
  219. /package/src/scss/{modules/state → primitives/trait}/_vertical.scss +0 -0
  220. /package/src/scss/{modules/state → primitives/trait}/_wrapper.scss +0 -0
@@ -1,4 +0,0 @@
1
- /**
2
- * altKey押下時の処理 テスト用
3
- */
4
- export default function enableSelectTextWithAltKeyAtLinkBox(): void;
@@ -1,38 +0,0 @@
1
- import t from "../helper/getSvgUrl.js";
2
- const a = {
3
- isContainer: "is--container",
4
- isWrapper: {
5
- className: "is--wrapper",
6
- preset: ["s", "l"],
7
- presetClass: "-contentSize",
8
- customVar: "--contentSize",
9
- tokenKey: "sz"
10
- },
11
- isLayer: "is--layer",
12
- isLinkBox: "is--linkBox",
13
- isSide: "is--side",
14
- isSkipFlow: "is--skipFlow",
15
- isVertical: "is--vertical",
16
- setGutter: "set--gutter",
17
- // set class
18
- setShadow: "set--shadow",
19
- setHov: "set--hov",
20
- setTransition: "set--transition",
21
- setMask: {
22
- // 'set--mask',
23
- className: "set--mask",
24
- setStyles: (e) => {
25
- let s = e;
26
- return s.startsWith("<svg") && (s = t(e, "base64")), {
27
- "--maskImg": s
28
- };
29
- }
30
- },
31
- setPlain: "set--plain",
32
- // setRevert: 'set--revert',
33
- setInnerRs: "set--innerRs",
34
- setBp: "set--bp"
35
- };
36
- export {
37
- a as default
38
- };
@@ -1,5 +0,0 @@
1
- /**
2
- * svgをcssの image url に変換
3
- */
4
- declare const getSvgUrl: (svg: string, encode?: string) => string;
5
- export default getSvgUrl;
@@ -1,4 +0,0 @@
1
- const a = (e, r = "") => e ? r === "base64" ? (e = Buffer.from(e).toString("base64"), `url(data:image/svg+xml;base64,${e})`) : (e = e.replace(/'/g, '"'), e = e.replace(/="#/g, '="%23'), `url('data:image/svg+xml,${e}')`) : "";
2
- export {
3
- a as default
4
- };
@@ -1 +0,0 @@
1
- .l--flow{--flow--base:var(--s30);--flow--s:var(--s20);display:flow-root}.l--flow>*+*{--flow:var(--flow--base);margin-block-start:var(--flow)}.l--flow>:where(img,video,iframe){display:block}.-flow\:s>*{--flow:var(--flow--s)}.-flow\:>*{--flow:inherit}.l--flow>:where(h1,h2,h3,h4,h5,h6){margin-block-start:calc(var(--flow)*var(--flow-hScale, 2))}.is--skipFlow+*,.l--flow>:first-child{--flow:0px}.l--flex{display:flex}.l--flex>*{min-width:0}.l--cluster{align-items:center;display:flex;flex-wrap:wrap}.l--stack{display:flex;flex-direction:column}.l--grid{--gtr:none;--gtc:none;--gta:none;display:grid;grid-template:var(--gtr)/var(--gtc);grid-template-areas:var(--gta)}.l--grid>*{min-width:0}.l--center{display:grid;place-content:center;place-items:center}.l--fluidCols{--cols:var(--sz--min);--autoMode:auto-fit;display:grid;grid-template-columns:repeat(var(--autoMode),minmax(min(var(--cols),100%),1fr))}.l--columns{--cols:2;display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr))}.l--sideMain{--sideW:auto;--mainW:max(var(--sz--min),50%);display:flex;flex-wrap:wrap}.l--sideMain>.is--side{flex-basis:var(--sideW);flex-grow:1}.l--sideMain>:not(.is--side){flex-basis:min(100%,var(--mainW));flex-grow:9999999}.l--switchCols{--breakSize:var(--sz--xs);display:flex;flex-wrap:wrap}.l--switchCols>*{flex-basis:calc((var(--breakSize) - 100%)*9999);flex-grow:1}.l--frame{overflow:hidden}.l--frame>:where(img,video,iframe){display:block;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}
@@ -1 +0,0 @@
1
- .is--container{container-type:inline-size}.is--container>*{--sz--container:100cqi}.is--container.set--gutter>*{--sz--container:calc(100cqi + var(--gutter-size)*2)}.is--wrapper{--contentSize:var(--sz--m,100%)}.is--wrapper>*{margin-inline:auto;max-inline-size:min(100%,var(--contentSize))}.-contentSize\:s{--contentSize:var(--sz--s)}.-contentSize\:l{--contentSize:var(--sz--l)}.is--linkBox{color:inherit;cursor:pointer;display:block;isolation:isolate;pointer-events:auto;position:relative;text-decoration:none}.is--linkBox a{position:relative;z-index:2}.is--layer{inset:0;overflow:hidden;position:absolute}.is--vertical{writing-mode:var(--vertical-mode)}.is--vertical\@sm{writing-mode:var(--_is_sm) var(--vertical-mode)}.is--vertical\@md{writing-mode:var(--_is_md) var(--vertical-mode)}
@@ -1,27 +0,0 @@
1
- import { STATES } from '../../../config/index';
2
- import { WithArbitraryString, ArrayElement } from './utils';
3
- /**
4
- * config/index.ts から STATES の型を取得
5
- * objDeepMerge の DeepMergeResult 型により literal types が保持される
6
- */
7
- type StatesConfig = typeof STATES;
8
- /** preset を持つ State の値の型を抽出 */
9
- type PresetElement<T> = T extends {
10
- preset: readonly unknown[];
11
- } ? ArrayElement<T['preset']> : never;
12
- /**
13
- * State 設定から Props の値の型を抽出するユーティリティ型
14
- */
15
- type ExtractStateValue<T> = T extends string ? boolean : T extends {
16
- preset: readonly unknown[];
17
- } ? WithArbitraryString<PresetElement<T>> | boolean : T extends {
18
- setStyles: unknown;
19
- } ? string : never;
20
- /**
21
- * config/index.ts の STATES から自動生成される State Props の型
22
- * config/index.ts の STATES に新しいステートを追加すると自動的に反映される
23
- */
24
- export type StateProps = {
25
- [K in keyof StatesConfig]?: ExtractStateValue<StatesConfig[K]>;
26
- };
27
- export {};
@@ -1,14 +0,0 @@
1
- ---
2
- import type { HTMLTag, Polymorphic } from 'astro/types';
3
- import type { AstroLismBaseProps } from '../types';
4
- import { Lism } from '../Lism';
5
-
6
- type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> &
7
- AstroLismBaseProps & {
8
- size?: string;
9
- };
10
-
11
- const { size, ...props } = Astro.props;
12
- ---
13
-
14
- <Lism isContainer isWrapper={size} {...props}><slot /></Lism>
@@ -1,29 +0,0 @@
1
- // コンポーネントを動的に生成するユーティリティを使った方法.( Astro アプデで動かなくなるリスクあり)
2
-
3
- import { createComponent, renderComponent } from 'astro/runtime/server/index.js';
4
- import Lism from '../Lism/Lism.astro';
5
-
6
- // <Lism as="*"> の薄いラッパーを動的に生成するユーティリティ
7
- const createHTMLComponent = (tag, baseProps = {}) =>
8
- createComponent((result, props = {}, slots = {}) => {
9
- return renderComponent(result, 'Lism', Lism, { as: tag, ...baseProps, ...props }, slots);
10
- });
11
-
12
- // 見出しだけ lv でタグ名を変える
13
- const createHeadingComponent = () =>
14
- createComponent((result, props = {}, slots = {}) => {
15
- const { lv = '1', ...rest } = props;
16
- return renderComponent(result, 'Lism', Lism, { as: `h${lv}`, ...rest }, slots);
17
- });
18
-
19
- // よく使うタグをまとめてラップ
20
- const tags = ['div', 'p', 'span', 'a', 'img', 'ul', 'ol', 'li'];
21
- const HTML = Object.fromEntries(tags.map((tag) => [tag, createHTMLComponent(tag)]));
22
-
23
- // button だけ setPlain を付与
24
- HTML.button = createHTMLComponent('button', { setPlain: true });
25
-
26
- // h1~h6 を lv で分岐
27
- HTML.h = createHeadingComponent();
28
-
29
- export default HTML;
@@ -1,10 +0,0 @@
1
- ---
2
- import type { AstroLismBaseProps } from '../types';
3
- import Lism from '../Lism/Lism.astro';
4
-
5
- type Props = AstroLismBaseProps & Omit<astroHTML.JSX.AnchorHTMLAttributes, keyof AstroLismBaseProps>;
6
-
7
- const props = Astro.props;
8
- ---
9
-
10
- <Lism as="a" {...props}><slot /></Lism>
@@ -1,10 +0,0 @@
1
- ---
2
- import type { AstroLismBaseProps } from '../types';
3
- import Lism from '../Lism/Lism.astro';
4
-
5
- type Props = AstroLismBaseProps & Omit<astroHTML.JSX.ButtonHTMLAttributes, keyof AstroLismBaseProps>;
6
-
7
- const props = Astro.props;
8
- ---
9
-
10
- <Lism as="button" {...props}><slot /></Lism>
@@ -1,10 +0,0 @@
1
- ---
2
- import type { AstroLismBaseProps } from '../types';
3
- import Lism from '../Lism/Lism.astro';
4
-
5
- type Props = AstroLismBaseProps & Omit<astroHTML.JSX.HTMLAttributes, keyof AstroLismBaseProps>;
6
-
7
- const props = Astro.props;
8
- ---
9
-
10
- <Lism as="div" {...props}><slot /></Lism>
@@ -1,13 +0,0 @@
1
- ---
2
- import type { AstroLismBaseProps } from '../types';
3
- import Lism from '../Lism/Lism.astro';
4
-
5
- type Props = AstroLismBaseProps &
6
- Omit<astroHTML.JSX.HTMLAttributes, keyof AstroLismBaseProps> & {
7
- lv?: '1' | '2' | '3' | '4' | '5' | '6';
8
- };
9
-
10
- const { lv = '1', ...props } = Astro.props;
11
- ---
12
-
13
- <Lism as={`h${lv}`} {...props}><slot /></Lism>
@@ -1,10 +0,0 @@
1
- ---
2
- import type { AstroLismBaseProps } from '../types';
3
- import Lism from '../Lism/Lism.astro';
4
-
5
- type Props = AstroLismBaseProps & Omit<astroHTML.JSX.ImgHTMLAttributes, keyof AstroLismBaseProps>;
6
-
7
- const props = Astro.props;
8
- ---
9
-
10
- <Lism as="img" {...props}><slot /></Lism>
@@ -1,12 +0,0 @@
1
- import div from './div.astro';
2
- import p from './p.astro';
3
- import h from './h.astro';
4
- import span from './span.astro';
5
- import a from './a.astro';
6
- import button from './button.astro';
7
- import img from './img.astro';
8
- import ul from './ul.astro';
9
- import ol from './ol.astro';
10
- import li from './li.astro';
11
-
12
- export default { div, p, h, span, img, a, button, ul, ol, li };
@@ -1,10 +0,0 @@
1
- ---
2
- import type { AstroLismBaseProps } from '../types';
3
- import Lism from '../Lism/Lism.astro';
4
-
5
- type Props = AstroLismBaseProps & Omit<astroHTML.JSX.LiHTMLAttributes, keyof AstroLismBaseProps>;
6
-
7
- const props = Astro.props;
8
- ---
9
-
10
- <Lism as="li" {...props}><slot /></Lism>
@@ -1,10 +0,0 @@
1
- ---
2
- import type { AstroLismBaseProps } from '../types';
3
- import Lism from '../Lism/Lism.astro';
4
-
5
- type Props = AstroLismBaseProps & Omit<astroHTML.JSX.OlHTMLAttributes, keyof AstroLismBaseProps>;
6
-
7
- const props = Astro.props;
8
- ---
9
-
10
- <Lism as="ol" {...props}><slot /></Lism>
@@ -1,10 +0,0 @@
1
- ---
2
- import type { AstroLismBaseProps } from '../types';
3
- import Lism from '../Lism/Lism.astro';
4
-
5
- type Props = AstroLismBaseProps & Omit<astroHTML.JSX.HTMLAttributes, keyof AstroLismBaseProps>;
6
-
7
- const props = Astro.props;
8
- ---
9
-
10
- <Lism as="p" {...props}><slot /></Lism>
@@ -1,10 +0,0 @@
1
- ---
2
- import type { AstroLismBaseProps } from '../types';
3
- import Lism from '../Lism/Lism.astro';
4
-
5
- type Props = AstroLismBaseProps & Omit<astroHTML.JSX.HTMLAttributes, keyof AstroLismBaseProps>;
6
-
7
- const props = Astro.props;
8
- ---
9
-
10
- <Lism as="span" {...props}><slot /></Lism>
@@ -1,10 +0,0 @@
1
- ---
2
- import type { AstroLismBaseProps } from '../types';
3
- import Lism from '../Lism/Lism.astro';
4
-
5
- type Props = AstroLismBaseProps & Omit<astroHTML.JSX.HTMLAttributes, keyof AstroLismBaseProps>;
6
-
7
- const props = Astro.props;
8
- ---
9
-
10
- <Lism as="ul" {...props}><slot /></Lism>
@@ -1 +0,0 @@
1
- export { default as LinkBox } from './LinkBox.astro';
@@ -1,12 +0,0 @@
1
- .l--grid {
2
- --gtr: none;
3
- --gtc: none;
4
- --gta: none;
5
- display: grid;
6
- grid-template: var(--gtr) / var(--gtc);
7
- grid-template-areas: var(--gta);
8
-
9
- > * {
10
- min-width: 0;
11
- }
12
- }
@@ -1,6 +0,0 @@
1
- // state
2
- @forward './container';
3
- @forward './wrapper';
4
- @forward './linkbox';
5
- @forward './layer'; // Note: position の関係で、linkbox より後で読み込む
6
- @forward './vertical';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes