lism-css 0.9.4 → 0.10.1
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.md +5 -5
- package/bin/__build-css.cjs +54 -54
- package/bin/build-config.js +120 -120
- package/bin/build-css.js +52 -52
- package/bin/cli.mjs +33 -33
- package/config/__prop_list.js +42 -42
- package/config/__props.scss +20 -20
- package/config/default-config.ts +3 -3
- package/config/defaults/props.ts +326 -326
- package/config/defaults/states.ts +38 -38
- package/config/defaults/tokens.ts +25 -25
- package/config/helper/getSvgUrl.ts +16 -16
- package/config/helper/minifyHtml.ts +11 -11
- package/config/helper.test.ts +231 -231
- package/config/helper.ts +43 -49
- package/config/index.ts +4 -4
- package/config/tsconfig.json +16 -16
- package/dist/components/Dummy/Dummy.d.ts +6 -9
- package/dist/components/Dummy/index.js +5 -10
- package/dist/components/Group/Group.d.ts +3 -0
- package/dist/components/Group/index.d.ts +1 -0
- package/dist/components/Group/index.js +8 -0
- package/dist/components/HTML/HTML.d.ts +10 -0
- package/dist/components/Heading/Heading.d.ts +7 -0
- package/dist/components/Heading/index.d.ts +1 -0
- package/dist/components/Heading/index.js +9 -0
- package/dist/components/Inline/Inline.d.ts +3 -0
- package/dist/components/Inline/index.d.ts +1 -0
- package/dist/components/Inline/index.js +8 -0
- package/dist/components/Layer/Layer.d.ts +1 -2
- package/dist/components/Layer/index.js +3 -4
- package/dist/components/Link/Link.d.ts +2 -0
- package/dist/components/Link/index.d.ts +1 -0
- package/dist/components/Link/index.js +8 -0
- package/dist/components/LinkBox/LinkBox.d.ts +3 -2
- package/dist/components/LinkBox/index.js +5 -5
- package/dist/components/Lism/Lism.d.ts +7 -8
- package/dist/components/List/List.d.ts +3 -0
- package/dist/components/List/ListItem.d.ts +3 -0
- package/dist/components/List/ListItem.js +8 -0
- package/dist/components/List/index.d.ts +2 -0
- package/dist/components/List/index.js +8 -0
- package/dist/components/Text/Text.d.ts +3 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/components/Text/index.js +8 -0
- package/dist/components/atomic/Decorator/getProps.d.ts +1 -3
- package/dist/components/atomic/Decorator/getProps.js +10 -10
- package/dist/components/atomic/Icon/getProps.d.ts +1 -2
- package/dist/components/atomic/Icon/getProps.js +35 -34
- package/dist/components/atomic/Media/Media.d.ts +1 -4
- package/dist/components/atomic/Media/Media.stories.d.ts +1 -2
- package/dist/components/atomic/Media/index.js +4 -5
- package/dist/components/index.d.ts +8 -1
- package/dist/components/index.js +50 -36
- package/dist/config/helper.d.ts +1 -1
- package/dist/css/main.css +1 -1
- package/dist/css/main_no_layer.css +1 -1
- package/dist/css/modules/atomic.css +1 -1
- package/dist/css/modules/layout.css +1 -1
- package/dist/lib/getLismProps.d.ts +3 -2
- package/dist/lib/getMaybeCssVar.js +15 -10
- package/package.json +2 -1
- package/packages/astro/Box/Box.astro +6 -4
- package/packages/astro/Center/Center.astro +6 -3
- package/packages/astro/Cluster/Cluster.astro +6 -3
- package/packages/astro/Columns/Columns.astro +6 -3
- package/packages/astro/Container/Container.astro +7 -5
- package/packages/astro/Decorator/Decorator.astro +8 -5
- package/packages/astro/Divider/Divider.astro +5 -4
- package/packages/astro/Dummy/Dummy.astro +9 -12
- package/packages/astro/Flex/Flex.astro +6 -3
- package/packages/astro/Flow/Flow.astro +7 -3
- package/packages/astro/FluidCols/FluidCols.astro +7 -3
- package/packages/astro/Frame/Frame.astro +6 -3
- package/packages/astro/Grid/Grid.astro +6 -3
- package/packages/astro/Group/Group.astro +11 -0
- package/packages/astro/Group/index.ts +1 -0
- package/packages/astro/HTML/_index_memo.js +7 -7
- package/packages/astro/HTML/a.astro +5 -4
- package/packages/astro/HTML/button.astro +5 -4
- package/packages/astro/HTML/div.astro +5 -4
- package/packages/astro/HTML/h.astro +5 -4
- package/packages/astro/HTML/img.astro +5 -4
- package/packages/astro/HTML/li.astro +5 -4
- package/packages/astro/HTML/ol.astro +5 -4
- package/packages/astro/HTML/p.astro +5 -4
- package/packages/astro/HTML/span.astro +5 -4
- package/packages/astro/HTML/ul.astro +5 -4
- package/packages/astro/Heading/Heading.astro +13 -0
- package/packages/astro/Heading/index.ts +1 -0
- package/packages/astro/Icon/Icon.astro +13 -10
- package/packages/astro/Icon/SVG.astro +16 -16
- package/packages/astro/Inline/Inline.astro +11 -0
- package/packages/astro/Inline/index.ts +1 -0
- package/packages/astro/Layer/Layer.astro +6 -6
- package/packages/astro/Link/Link.astro +10 -0
- package/packages/astro/Link/index.ts +1 -0
- package/packages/astro/LinkBox/LinkBox.astro +9 -9
- package/packages/astro/Lism/Lism.astro +5 -7
- package/packages/astro/List/List.astro +11 -0
- package/packages/astro/List/ListItem.astro +11 -0
- package/packages/astro/List/index.ts +2 -0
- package/packages/astro/Media/Media.astro +6 -9
- package/packages/astro/SideMain/SideMain.astro +7 -3
- package/packages/astro/Spacer/Spacer.astro +6 -4
- package/packages/astro/Stack/Stack.astro +6 -3
- package/packages/astro/SwitchCols/SwitchCols.astro +7 -3
- package/packages/astro/Text/Text.astro +11 -0
- package/packages/astro/Text/index.ts +1 -0
- package/packages/astro/Wrapper/Wrapper.astro +8 -5
- package/packages/astro/env.d.ts +3 -3
- package/packages/astro/index.ts +9 -0
- package/packages/astro/tsconfig.json +10 -10
- package/packages/astro/types.ts +10 -42
- package/src/scss/__memo/_lh-auto-all.scss +12 -12
- package/src/scss/__memo/_lh-auto-h.scss +17 -17
- package/src/scss/__memo/_lh-manual.scss +27 -27
- package/src/scss/_auto_output.scss +174 -174
- package/src/scss/_mixin.scss +32 -32
- package/src/scss/_prop-config.scss +850 -850
- package/src/scss/_query.scss +26 -26
- package/src/scss/_setting.scss +6 -6
- package/src/scss/_with_layer.scss +13 -13
- package/src/scss/base/_html.scss +47 -47
- package/src/scss/base/set/_bp.scss +8 -8
- package/src/scss/base/set/_cqUnit.scss +22 -22
- package/src/scss/base/set/_gutter.scss +1 -1
- package/src/scss/base/set/_hov.scss +10 -10
- package/src/scss/base/set/_innerRs.scss +1 -1
- package/src/scss/base/set/_plain.scss +15 -15
- package/src/scss/base/set/_transition.scss +2 -2
- package/src/scss/base/tokens/_property.scss +3 -3
- package/src/scss/base/tokens/_shadow.scss +12 -12
- package/src/scss/base/tokens/_tokens.scss +77 -77
- package/src/scss/base/tokens/_typography.scss +69 -69
- package/src/scss/main_no_layer.scss +1 -1
- package/src/scss/modules/atomic/_divider.scss +4 -4
- package/src/scss/modules/atomic/_icon.scss +4 -4
- package/src/scss/modules/atomic/_spacer.scss +2 -2
- package/src/scss/modules/atomic/index.scss +0 -1
- package/src/scss/modules/layout/_center.scss +3 -3
- package/src/scss/modules/layout/_cluster.scss +3 -3
- package/src/scss/modules/layout/_columns.scss +3 -3
- package/src/scss/modules/layout/_flex.scss +4 -4
- package/src/scss/modules/layout/_flow.scss +16 -16
- package/src/scss/modules/layout/_fluidCols.scss +4 -4
- package/src/scss/modules/layout/_frame.scss +8 -8
- package/src/scss/modules/layout/_grid.scss +9 -9
- package/src/scss/modules/layout/_sideMain.scss +12 -12
- package/src/scss/modules/layout/_stack.scss +2 -2
- package/src/scss/modules/layout/_switchCols.scss +5 -5
- package/src/scss/modules/state/_container.scss +4 -4
- package/src/scss/modules/state/_layer.scss +3 -3
- package/src/scss/modules/state/_linkbox.scss +9 -9
- package/src/scss/modules/state/_vertical.scss +3 -3
- package/src/scss/modules/state/_wrapper.scss +8 -8
- package/src/scss/props/_border.scss +18 -18
- package/src/scss/props/_hover.scss +26 -26
- package/src/scss/props/_lh.scss +6 -6
- package/src/scss/props/_size.scss +7 -7
- package/src/scss/reset.scss +137 -137
- package/src/scss/utility/_cbox.scss +10 -10
- package/src/scss/utility/_clipText.scss +2 -2
- package/src/scss/utility/_hidden.scss +9 -9
- package/src/scss/utility/_itemDivider.scss +7 -7
- package/src/scss/utility/_linkExpand.scss +9 -9
- package/src/scss/utility/_snap.scss +5 -5
- package/src/scss/utility/_trimHL.scss +11 -11
- package/dist/components/Dummy/getContent.d.ts +0 -12
- package/dist/components/Dummy/getContent.js +0 -9
- package/dist/components/Dummy/texts.d.ts +0 -22
- package/dist/components/Dummy/texts.js +0 -39
- package/dist/components/Layer/getProps.d.ts +0 -5
- package/dist/components/atomic/Media/getProps.d.ts +0 -9
- package/dist/components/atomic/Media/getProps.js +0 -8
- package/dist/components/getFilterProps.d.ts +0 -10
- package/dist/components/getFilterProps.js +0 -23
- package/dist/components/getFilterProps.test.d.ts +0 -1
- package/dist/components/setMaybeTransformStyles.d.ts +0 -12
- package/dist/components/setMaybeTransformStyles.js +0 -7
- package/dist/components/setMaybeTransformStyles.test.d.ts +0 -1
- package/src/scss/modules/atomic/_media.scss +0 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
|
+
import Lism from '../Lism/Lism.astro';
|
|
5
|
+
|
|
6
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
|
+
|
|
8
|
+
const { as: Tag = 'div', ...props } = Astro.props;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<Lism as={Tag} {...props}><slot /></Lism>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Group } from './Group.astro';
|
|
@@ -5,16 +5,16 @@ import Lism from '../Lism/Lism.astro';
|
|
|
5
5
|
|
|
6
6
|
// <Lism as="*"> の薄いラッパーを動的に生成するユーティリティ
|
|
7
7
|
const createHTMLComponent = (tag, baseProps = {}) =>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
createComponent((result, props = {}, slots = {}) => {
|
|
9
|
+
return renderComponent(result, 'Lism', Lism, { as: tag, ...baseProps, ...props }, slots);
|
|
10
|
+
});
|
|
11
11
|
|
|
12
12
|
// 見出しだけ lv でタグ名を変える
|
|
13
13
|
const createHeadingComponent = () =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
createComponent((result, props = {}, slots = {}) => {
|
|
15
|
+
const { lv = '1', ...rest } = props;
|
|
16
|
+
return renderComponent(result, 'Lism', Lism, { as: `h${lv}`, ...rest }, slots);
|
|
17
|
+
});
|
|
18
18
|
|
|
19
19
|
// よく使うタグをまとめてラップ
|
|
20
20
|
const tags = ['div', 'p', 'span', 'a', 'img', 'ul', 'ol', 'li'];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
4
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
5
|
+
type Props = AstroLismBaseProps & Omit<astroHTML.JSX.AnchorHTMLAttributes, keyof AstroLismBaseProps>;
|
|
6
|
+
|
|
7
|
+
const props = Astro.props;
|
|
7
8
|
---
|
|
8
9
|
|
|
9
|
-
<Lism as=
|
|
10
|
+
<Lism as="a" {...props}><slot /></Lism>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
4
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
5
|
+
type Props = AstroLismBaseProps & Omit<astroHTML.JSX.ButtonHTMLAttributes, keyof AstroLismBaseProps>;
|
|
6
|
+
|
|
7
|
+
const props = Astro.props;
|
|
7
8
|
---
|
|
8
9
|
|
|
9
|
-
<Lism as=
|
|
10
|
+
<Lism as="button" {...props}><slot /></Lism>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
4
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
5
|
+
type Props = AstroLismBaseProps & Omit<astroHTML.JSX.HTMLAttributes, keyof AstroLismBaseProps>;
|
|
6
|
+
|
|
7
|
+
const props = Astro.props;
|
|
7
8
|
---
|
|
8
9
|
|
|
9
|
-
<Lism as=
|
|
10
|
+
<Lism as="div" {...props}><slot /></Lism>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
4
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
type Props = AstroLismBaseProps &
|
|
6
|
+
Omit<astroHTML.JSX.HTMLAttributes, keyof AstroLismBaseProps> & {
|
|
7
|
+
lv?: '1' | '2' | '3' | '4' | '5' | '6';
|
|
8
|
+
};
|
|
8
9
|
|
|
9
10
|
const { lv = '1', ...props } = Astro.props;
|
|
10
11
|
---
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
4
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
5
|
+
type Props = AstroLismBaseProps & Omit<astroHTML.JSX.ImgHTMLAttributes, keyof AstroLismBaseProps>;
|
|
6
|
+
|
|
7
|
+
const props = Astro.props;
|
|
7
8
|
---
|
|
8
9
|
|
|
9
|
-
<Lism as=
|
|
10
|
+
<Lism as="img" {...props}><slot /></Lism>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
4
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
5
|
+
type Props = AstroLismBaseProps & Omit<astroHTML.JSX.LiHTMLAttributes, keyof AstroLismBaseProps>;
|
|
6
|
+
|
|
7
|
+
const props = Astro.props;
|
|
7
8
|
---
|
|
8
9
|
|
|
9
|
-
<Lism as=
|
|
10
|
+
<Lism as="li" {...props}><slot /></Lism>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
4
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
5
|
+
type Props = AstroLismBaseProps & Omit<astroHTML.JSX.OlHTMLAttributes, keyof AstroLismBaseProps>;
|
|
6
|
+
|
|
7
|
+
const props = Astro.props;
|
|
7
8
|
---
|
|
8
9
|
|
|
9
|
-
<Lism as=
|
|
10
|
+
<Lism as="ol" {...props}><slot /></Lism>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
4
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
5
|
+
type Props = AstroLismBaseProps & Omit<astroHTML.JSX.HTMLAttributes, keyof AstroLismBaseProps>;
|
|
6
|
+
|
|
7
|
+
const props = Astro.props;
|
|
7
8
|
---
|
|
8
9
|
|
|
9
|
-
<Lism as=
|
|
10
|
+
<Lism as="p" {...props}><slot /></Lism>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
4
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
5
|
+
type Props = AstroLismBaseProps & Omit<astroHTML.JSX.HTMLAttributes, keyof AstroLismBaseProps>;
|
|
6
|
+
|
|
7
|
+
const props = Astro.props;
|
|
7
8
|
---
|
|
8
9
|
|
|
9
|
-
<Lism as=
|
|
10
|
+
<Lism as="span" {...props}><slot /></Lism>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
4
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
5
|
+
type Props = AstroLismBaseProps & Omit<astroHTML.JSX.HTMLAttributes, keyof AstroLismBaseProps>;
|
|
6
|
+
|
|
7
|
+
const props = Astro.props;
|
|
7
8
|
---
|
|
8
9
|
|
|
9
|
-
<Lism as=
|
|
10
|
+
<Lism as="ul" {...props}><slot /></Lism>
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
level?: '1' | '2' | '3' | '4' | '5' | '6';
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const { level = '2', ...props } = Astro.props;
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<Lism as={`h${level}`} {...props}><slot /></Lism>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Heading } from './Heading.astro';
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { ElementType } from 'react';
|
|
4
|
+
import type { IconProps, IconOwnProps } from 'lism-css/react/atomic/Icon/getProps';
|
|
5
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
6
|
import getLismProps from 'lism-css/lib/getLismProps';
|
|
5
7
|
import getProps from 'lism-css/react/atomic/Icon/getProps';
|
|
6
8
|
import SVG from './SVG.astro';
|
|
7
9
|
|
|
8
|
-
type
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
type Props<Tag extends HTMLTag = 'svg'> = Omit<Polymorphic<{ as: Tag }>, 'as'> & {
|
|
11
|
+
as?: Tag | ElementType;
|
|
12
|
+
} & AstroLismBaseProps &
|
|
13
|
+
Omit<IconOwnProps, 'as' | keyof AstroLismBaseProps>;
|
|
11
14
|
|
|
12
15
|
// const hasChildren = Astro.slots.has('default');
|
|
13
16
|
// let { IconTag, iconProps, otherProps } = getProps(props, hasChildren);
|
|
14
17
|
// if (IconTag === '_SVG_') IconTag = SVG;
|
|
15
18
|
|
|
16
|
-
let { Component, lismProps, exProps = {}, content } = getProps(Astro.props);
|
|
19
|
+
let { Component, lismProps, exProps = {}, content } = getProps(Astro.props as unknown as IconProps);
|
|
17
20
|
|
|
18
21
|
if (Component === '_SVG_') {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
Component = SVG;
|
|
23
|
+
if (content) {
|
|
24
|
+
exProps.__html = content;
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
---
|
|
25
28
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
// Propsの定義
|
|
3
3
|
interface Props {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
size?: string | number;
|
|
5
|
+
fill?: string;
|
|
6
|
+
viewBox?: string;
|
|
7
|
+
path?: string;
|
|
8
|
+
__html?: string;
|
|
9
|
+
[key: string]: any;
|
|
10
10
|
}
|
|
11
11
|
let { size = '1em', fill = 'currentColor', viewBox = '0 0 24 24', path, __html, ...props } = Astro.props || {};
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
__html ? (
|
|
16
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox={viewBox} width={size} height={size} fill={fill} focusable="false" {...props}>
|
|
17
|
+
<Fragment set:html={__html} />
|
|
18
|
+
</svg>
|
|
19
|
+
) : (
|
|
20
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox={viewBox} width={size} height={size} fill={fill} focusable="false" {...props}>
|
|
21
|
+
{path && <path d={path} />}
|
|
22
|
+
<slot />
|
|
23
|
+
</svg>
|
|
24
|
+
)
|
|
25
25
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
|
+
import Lism from '../Lism/Lism.astro';
|
|
5
|
+
|
|
6
|
+
type Props<Tag extends HTMLTag = 'span'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
|
+
|
|
8
|
+
const { as: Tag = 'span', ...props } = Astro.props;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<Lism as={Tag} {...props}><slot /></Lism>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Inline } from './Inline.astro';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
4
|
import { Lism } from '../Lism';
|
|
4
|
-
import getFilterProps, { type FilterProps } from 'lism-css/react/getFilterProps';
|
|
5
5
|
|
|
6
|
-
type Props =
|
|
6
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
|
+
|
|
8
|
+
const { as: Tag = 'div', exProps, ...props } = Astro.props;
|
|
7
9
|
---
|
|
8
10
|
|
|
9
|
-
<Lism isLayer {...
|
|
10
|
-
<slot />
|
|
11
|
-
</Lism>
|
|
11
|
+
<Lism isLayer as={Tag} {...props} {...exProps}><slot /></Lism>
|
|
@@ -0,0 +1,10 @@
|
|
|
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>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Link } from './Link.astro';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
4
|
import { Lism } from '../Lism';
|
|
4
5
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
const props = Astro.props || {};
|
|
6
|
+
type Props<Tag extends HTMLTag = 'a'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
|
+
|
|
8
|
+
const { as, exProps, ...props } = Astro.props;
|
|
9
9
|
|
|
10
10
|
const hasHref = !!props.href;
|
|
11
|
-
|
|
11
|
+
// LinkBoxは基本的にリンク要素(aタグ)として機能するため、
|
|
12
|
+
// hrefがないかつ、aタグとしてレンダリングする場合はdivタグに置き換える
|
|
13
|
+
const tag: HTMLTag = !hasHref && (as ?? 'a') === 'a' ? 'div' : (as ?? 'a');
|
|
12
14
|
---
|
|
13
15
|
|
|
14
|
-
<Lism isLinkBox as={tag} {...props}>
|
|
15
|
-
<slot />
|
|
16
|
-
</Lism>
|
|
16
|
+
<Lism isLinkBox as={tag} {...props} {...exProps}><slot /></Lism>
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
4
|
import getLismProps from 'lism-css/lib/getLismProps';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
6
7
|
|
|
7
|
-
const { as, exProps, ...props } = Astro.props;
|
|
8
|
-
const JSX = as || 'div';
|
|
8
|
+
const { as: Tag = 'div', exProps, ...props } = Astro.props;
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
<
|
|
12
|
-
<slot />
|
|
13
|
-
</JSX>
|
|
11
|
+
<Tag {...getLismProps(props)} {...exProps}><slot /></Tag>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
|
+
import Lism from '../Lism/Lism.astro';
|
|
5
|
+
|
|
6
|
+
type Props<Tag extends HTMLTag = 'ul'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
|
+
|
|
8
|
+
const { as: Tag = 'ul', ...props } = Astro.props;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<Lism as={Tag} {...props}><slot /></Lism>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
|
+
import Lism from '../Lism/Lism.astro';
|
|
5
|
+
|
|
6
|
+
type Props<Tag extends HTMLTag = 'li'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
|
+
|
|
8
|
+
const { as: Tag = 'li', ...props } = Astro.props;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<Lism as={Tag} {...props}><slot /></Lism>
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
4
|
import getLismProps from 'lism-css/lib/getLismProps';
|
|
5
|
-
import getMediaProps from 'lism-css/react/atomic/Media/getProps';
|
|
6
5
|
import { Image } from 'astro:assets';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
type Props<Tag extends HTMLTag = 'img'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
9
8
|
|
|
10
|
-
const { as, exProps, ...props } = Astro.props
|
|
9
|
+
const { as, exProps, ...props } = Astro.props;
|
|
11
10
|
|
|
12
11
|
let JSX: any = as || 'img';
|
|
13
12
|
if (JSX === 'AstroImage') {
|
|
14
|
-
|
|
13
|
+
JSX = Image;
|
|
15
14
|
}
|
|
16
15
|
---
|
|
17
16
|
|
|
18
|
-
<JSX {...getLismProps(
|
|
19
|
-
<slot />
|
|
20
|
-
</JSX>
|
|
17
|
+
<JSX {...getLismProps(props)} {...exProps}><slot /></JSX>
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../types';
|
|
4
|
+
import type { SideMainProps } from 'lism-css/lib/types/LayoutProps';
|
|
3
5
|
import { Lism } from '../Lism';
|
|
4
6
|
|
|
5
|
-
type Props =
|
|
7
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps & Omit<SideMainProps, 'layout'>;
|
|
8
|
+
|
|
9
|
+
const props = Astro.props;
|
|
6
10
|
---
|
|
7
11
|
|
|
8
|
-
<Lism layout=
|
|
12
|
+
<Lism layout="sideMain" {...props}><slot /></Lism>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
4
|
import { Lism } from '../Lism';
|
|
4
5
|
import getProps from 'lism-css/react/atomic/Spacer/getProps';
|
|
5
6
|
|
|
6
|
-
type Props =
|
|
7
|
-
|
|
7
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
8
|
+
|
|
9
|
+
const { as: Tag = 'div', exProps, ...props } = Astro.props;
|
|
8
10
|
---
|
|
9
11
|
|
|
10
|
-
<Lism {...getProps(props)} />
|
|
12
|
+
<Lism as={Tag} {...getProps(props)} {...exProps} />
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../types';
|
|
3
4
|
import { Lism } from '../Lism';
|
|
4
5
|
|
|
5
|
-
type Props =
|
|
6
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps;
|
|
7
|
+
|
|
8
|
+
const props = Astro.props;
|
|
6
9
|
---
|
|
7
10
|
|
|
8
|
-
<Lism layout=
|
|
11
|
+
<Lism layout="stack" {...props}><slot /></Lism>
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../types';
|
|
4
|
+
import type { SwitchColsProps } from 'lism-css/lib/types/LayoutProps';
|
|
3
5
|
import { Lism } from '../Lism';
|
|
4
6
|
|
|
5
|
-
type Props =
|
|
7
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps & Omit<SwitchColsProps, 'layout'>;
|
|
8
|
+
|
|
9
|
+
const props = Astro.props;
|
|
6
10
|
---
|
|
7
11
|
|
|
8
|
-
<Lism layout=
|
|
12
|
+
<Lism layout="switchCols" {...props}><slot /></Lism>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
|
+
import Lism from '../Lism/Lism.astro';
|
|
5
|
+
|
|
6
|
+
type Props<Tag extends HTMLTag = 'p'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
|
+
|
|
8
|
+
const { as: Tag = 'p', ...props } = Astro.props;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<Lism as={Tag} {...props}><slot /></Lism>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Text } from './Text.astro';
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
|
+
import type { LismProps } from 'lism-css/lib/getLismProps';
|
|
3
5
|
import { Lism } from '../Lism';
|
|
4
6
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> &
|
|
8
|
+
AstroLismBaseProps & {
|
|
9
|
+
contentSize?: LismProps['isWrapper'];
|
|
10
|
+
};
|
|
8
11
|
|
|
9
|
-
const { contentSize = true, ...props } = Astro.props
|
|
12
|
+
const { contentSize = true, ...props } = Astro.props;
|
|
10
13
|
---
|
|
11
14
|
|
|
12
15
|
<Lism isWrapper={contentSize} {...props}><slot /></Lism>
|
package/packages/astro/env.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="astro/client" />
|
|
2
2
|
|
|
3
3
|
declare module '*.astro' {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const component: (props: Record<string, unknown>) => unknown;
|
|
5
|
+
export default component;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
declare module 'astro:assets' {
|
|
9
|
-
|
|
9
|
+
export const Image: typeof import('astro/components/Image.astro').default;
|
|
10
10
|
}
|
package/packages/astro/index.ts
CHANGED
|
@@ -4,7 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
export * from './Lism';
|
|
6
6
|
export { default as HTML } from './HTML';
|
|
7
|
+
/** @deprecated DummyText / DummyImage (@lism-css/ui) を使用してください */
|
|
7
8
|
export * from './Dummy';
|
|
9
|
+
|
|
10
|
+
// semantic wrappers
|
|
11
|
+
export * from './Text';
|
|
12
|
+
export * from './Inline';
|
|
13
|
+
export * from './Group';
|
|
14
|
+
export * from './Heading';
|
|
15
|
+
export * from './Link';
|
|
16
|
+
export * from './List';
|
|
8
17
|
export * from './Box';
|
|
9
18
|
export * from './Flow';
|
|
10
19
|
export * from './Flex';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
"extends": "astro/tsconfigs/strict",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"checkJs": false,
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"skipLibCheck": true
|
|
10
|
+
},
|
|
11
|
+
"include": ["./**/*.astro", "./**/*.ts"]
|
|
12
12
|
}
|