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
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { ElementType } from 'react';
|
|
2
1
|
import { LismComponentProps } from '../Lism';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
export default function Dummy<T extends ElementType = 'p'>({ pre, length, lang, offset, ...props }: DummyProps<T>): import("react").JSX.Element;
|
|
10
|
-
export {};
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated DummyText / DummyImage (@lism-css/ui) を使用してください。
|
|
4
|
+
*/
|
|
5
|
+
export default function Dummy({ lang, ...props }: LismComponentProps & {
|
|
6
|
+
lang?: string;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const m = t.as || "p";
|
|
6
|
-
if (m === "img")
|
|
7
|
-
return /* @__PURE__ */ n(e, { as: "img", src: "https://cdn.lism-css.com/dummy-image.jpg", width: 600, height: 400, alt: "", ...t });
|
|
8
|
-
const a = g({ tag: m, pre: i, lang: r, length: o, offset: s });
|
|
9
|
-
return /* @__PURE__ */ n(e, { ...t, dangerouslySetInnerHTML: { __html: a } });
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import i from "../Lism/index.js";
|
|
3
|
+
function u({ lang: m = "en", ...s }) {
|
|
4
|
+
return /* @__PURE__ */ e(i, { as: "p", ...s, children: m === "ja" ? "Lorem ipsum dolor sit amet... ⚠️Dummy は非推奨コンポーネントです。@lism-css/ui のDummyTextをご利用ください" : "Lorem ipsum dolor sit amet... ⚠️Dummy is deprecated. Please use DummyText from @lism-css/ui" });
|
|
10
5
|
}
|
|
11
6
|
export {
|
|
12
|
-
|
|
7
|
+
u as default
|
|
13
8
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Group } from './Group';
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import { LismComponentProps } from '../Lism';
|
|
2
|
+
/** @deprecated Group を使用してください */
|
|
2
3
|
export declare function div(props: LismComponentProps<'div'>): import("react").JSX.Element;
|
|
4
|
+
/** @deprecated Text を使用してください */
|
|
3
5
|
export declare function p(props: LismComponentProps<'p'>): import("react").JSX.Element;
|
|
6
|
+
/** @deprecated Inline を使用してください */
|
|
4
7
|
export declare function span(props: LismComponentProps<'span'>): import("react").JSX.Element;
|
|
8
|
+
/** @deprecated Link を使用してください */
|
|
5
9
|
export declare function a(props: LismComponentProps<'a'>): import("react").JSX.Element;
|
|
6
10
|
type HeadingLevel = '1' | '2' | '3' | '4' | '5' | '6';
|
|
7
11
|
type HeadingProps = LismComponentProps<'h1'> & {
|
|
8
12
|
lv?: HeadingLevel;
|
|
9
13
|
};
|
|
14
|
+
/** @deprecated Heading を使用してください */
|
|
10
15
|
export declare function h({ lv, ...props }: HeadingProps): import("react").JSX.Element;
|
|
16
|
+
/** @deprecated Media を使用してください */
|
|
11
17
|
export declare function img(props: LismComponentProps<'img'>): import("react").JSX.Element;
|
|
18
|
+
/** @deprecated List を使用してください */
|
|
12
19
|
export declare function ul(props: LismComponentProps<'ul'>): import("react").JSX.Element;
|
|
20
|
+
/** @deprecated List as="ol" を使用してください */
|
|
13
21
|
export declare function ol(props: LismComponentProps<'ol'>): import("react").JSX.Element;
|
|
22
|
+
/** @deprecated ListItem を使用してください */
|
|
14
23
|
export declare function li(props: LismComponentProps<'li'>): import("react").JSX.Element;
|
|
24
|
+
/** @deprecated Lism as="button" を使用してください */
|
|
15
25
|
export declare function button(props: LismComponentProps<'button'>): import("react").JSX.Element;
|
|
16
26
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LismComponentProps } from '../Lism';
|
|
2
|
+
type HeadingLevel = '1' | '2' | '3' | '4' | '5' | '6';
|
|
3
|
+
type HeadingProps = LismComponentProps<'h1'> & {
|
|
4
|
+
level?: HeadingLevel;
|
|
5
|
+
};
|
|
6
|
+
export default function Heading({ level, ...props }: HeadingProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Heading } from './Heading';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Inline } from './Inline';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { LismComponentProps } from '../Lism';
|
|
3
|
-
|
|
4
|
-
type LayerProps<T extends ElementType = 'div'> = LismComponentProps<T> & FilterProps;
|
|
3
|
+
type LayerProps<T extends ElementType = 'div'> = LismComponentProps<T>;
|
|
5
4
|
export default function Layer<T extends ElementType = 'div'>(props: LayerProps<T>): import("react").JSX.Element;
|
|
6
5
|
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import o from "../getFilterProps.js";
|
|
3
2
|
import e from "../Lism/index.js";
|
|
4
|
-
function
|
|
5
|
-
return /* @__PURE__ */ t(e, { isLayer: !0, ...
|
|
3
|
+
function m(r) {
|
|
4
|
+
return /* @__PURE__ */ t(e, { isLayer: !0, ...r });
|
|
6
5
|
}
|
|
7
6
|
export {
|
|
8
|
-
|
|
7
|
+
m as default
|
|
9
8
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Link } from './Link';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
1
2
|
import { LismComponentProps } from '../Lism';
|
|
2
|
-
type LinkBoxProps =
|
|
3
|
-
export default function LinkBox({ children, ...props }: LinkBoxProps): import("react").JSX.Element;
|
|
3
|
+
type LinkBoxProps<T extends ElementType = 'a'> = LismComponentProps<T>;
|
|
4
|
+
export default function LinkBox<T extends ElementType = 'a'>({ as, children, ...props }: LinkBoxProps<T>): import("react").JSX.Element;
|
|
4
5
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
return /* @__PURE__ */ i(
|
|
2
|
+
import e from "../Lism/index.js";
|
|
3
|
+
function m({ as: r, children: o, ...t }) {
|
|
4
|
+
const a = !!!t.href && (r ?? "a") === "a" ? "div" : r ?? "a";
|
|
5
|
+
return /* @__PURE__ */ i(e, { isLinkBox: !0, as: a, ...t, children: o });
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
m as default
|
|
9
9
|
};
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, CSSProperties, ElementType, ReactNode } from 'react';
|
|
1
|
+
import { ComponentPropsWithoutRef, CSSProperties, ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { LismProps } from '../../lib/getLismProps';
|
|
3
3
|
import { LayoutSpecificProps } from '../../lib/types/LayoutProps';
|
|
4
4
|
type ReactStyleWithCustomProps = CSSProperties & Record<`--${string}`, string | number | undefined>;
|
|
5
|
-
/** HTML
|
|
6
|
-
type
|
|
7
|
-
/** レンダリングするコンポーネントまたは要素 */
|
|
5
|
+
/** 要素固有の HTML Props + 共通オプション */
|
|
6
|
+
type LismElementProps<T extends ElementType> = Omit<ComponentPropsWithoutRef<T>, 'style'> & {
|
|
8
7
|
as?: T;
|
|
9
|
-
/** 子要素 */
|
|
10
8
|
children?: ReactNode;
|
|
11
|
-
/** getLismProps を経由せずに直接渡す追加の props */
|
|
12
9
|
exProps?: Record<string, unknown>;
|
|
13
10
|
/** React では camelCase のみ有効(kebab-case は実行時に無視される) */
|
|
14
11
|
style?: ReactStyleWithCustomProps;
|
|
15
12
|
};
|
|
13
|
+
/** HTML 属性のベースライン(T がジェネリクスのままでも id 等が補完される) */
|
|
14
|
+
type LismHtmlBaseProps = Omit<HTMLAttributes<HTMLElement>, 'style'>;
|
|
16
15
|
/**
|
|
17
16
|
* Lism コンポーネントの Props 型
|
|
18
17
|
* @template T - レンダリングする要素の型(デフォルトは 'div')
|
|
19
18
|
*/
|
|
20
|
-
export type LismComponentProps<T extends ElementType = 'div'> = Omit<LismProps, 'style'> & LayoutSpecificProps &
|
|
19
|
+
export type LismComponentProps<T extends ElementType = 'div'> = Omit<LismProps, 'style'> & LismHtmlBaseProps & LayoutSpecificProps & LismElementProps<T>;
|
|
21
20
|
/**
|
|
22
21
|
* layout が固定されたレイアウトコンポーネントの Props 型
|
|
23
22
|
* layout プロパティは固定されるため受け付けない
|
|
24
23
|
* @template T - レンダリングする要素の型(デフォルトは 'div')
|
|
25
24
|
* @template L - レイアウト固有の追加 Props 型
|
|
26
25
|
*/
|
|
27
|
-
export type LayoutComponentProps<T extends ElementType = 'div', L = object> = Omit<LismProps, 'layout' | 'style'> & Omit<L, 'layout'> &
|
|
26
|
+
export type LayoutComponentProps<T extends ElementType = 'div', L = object> = Omit<LismProps, 'layout' | 'style'> & LismHtmlBaseProps & Omit<L, 'layout'> & LismElementProps<T>;
|
|
28
27
|
/**
|
|
29
28
|
* Lism Propsを処理できるだけのコンポーネント
|
|
30
29
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Text } from './Text';
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { FilterProps } from '../../getFilterProps';
|
|
2
|
-
import { TransformStyleProps } from '../../setMaybeTransformStyles';
|
|
3
1
|
import { LismProps } from '../../../lib/getLismProps';
|
|
4
2
|
export interface DecoratorOwnProps {
|
|
5
3
|
size?: string;
|
|
6
4
|
clipPath?: string;
|
|
7
5
|
boxSizing?: string;
|
|
8
6
|
}
|
|
9
|
-
export type DecoratorProps = LismProps &
|
|
7
|
+
export type DecoratorProps = LismProps & DecoratorOwnProps;
|
|
10
8
|
export default function getDecoratorProps({ lismClass, size, clipPath, boxSizing, style: outerStyle, ...rest }: DecoratorProps): LismProps;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
s && (
|
|
7
|
-
const
|
|
8
|
-
lismClass:
|
|
1
|
+
import f from "../../../lib/helper/atts.js";
|
|
2
|
+
function p({ lismClass: e, size: s, clipPath: o, boxSizing: a, style: i, ...n }) {
|
|
3
|
+
const r = i ?? {};
|
|
4
|
+
o && (r.clipPath = o), a && (r.boxSizing = a);
|
|
5
|
+
const t = { ...n };
|
|
6
|
+
s && (t.ar = "1/1", t.w = s), t.style = r;
|
|
7
|
+
const c = {
|
|
8
|
+
lismClass: f(e, "a--decorator"),
|
|
9
9
|
"aria-hidden": "true"
|
|
10
10
|
};
|
|
11
|
-
return Object.assign(
|
|
11
|
+
return Object.assign(c, t);
|
|
12
12
|
}
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
p as default
|
|
15
15
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as presets } from './presets';
|
|
2
2
|
import { LismProps } from '../../../lib/getLismProps';
|
|
3
|
-
import { TransformStyleProps } from '../../setMaybeTransformStyles';
|
|
4
3
|
import { ElementType } from 'react';
|
|
5
4
|
export type PresetIconName = keyof typeof presets;
|
|
6
5
|
interface IconObject {
|
|
@@ -15,7 +14,7 @@ export interface IconOwnProps {
|
|
|
15
14
|
size?: string;
|
|
16
15
|
exProps?: Record<string, unknown>;
|
|
17
16
|
}
|
|
18
|
-
export type IconProps = LismProps &
|
|
17
|
+
export type IconProps = LismProps & IconOwnProps;
|
|
19
18
|
export default function getProps({ lismClass, as, icon, label, exProps, ..._props }: IconProps): {
|
|
20
19
|
Component: ElementType | "_SVG_";
|
|
21
20
|
lismProps: {
|
|
@@ -1,55 +1,56 @@
|
|
|
1
1
|
import S from "./presets.js";
|
|
2
2
|
import h from "../../../lib/helper/atts.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const f = {}, s = g.match(/<svg([^>]*?)>([\s\S]*?)<\/svg>/i);
|
|
3
|
+
function d(m) {
|
|
4
|
+
const f = {}, s = m.match(/<svg([^>]*?)>([\s\S]*?)<\/svg>/i);
|
|
6
5
|
if (s) {
|
|
7
|
-
const [,
|
|
8
|
-
let
|
|
9
|
-
for (; (
|
|
10
|
-
const [,
|
|
11
|
-
if (
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const [
|
|
15
|
-
|
|
16
|
-
}), f[
|
|
6
|
+
const [, c, t] = s, u = /([\w-]+)=["']([^"']*)["']/g;
|
|
7
|
+
let a;
|
|
8
|
+
for (; (a = u.exec(c)) !== null; ) {
|
|
9
|
+
const [, i, o] = a;
|
|
10
|
+
if (i === "style") {
|
|
11
|
+
const g = {};
|
|
12
|
+
o.split(";").forEach((l) => {
|
|
13
|
+
const [n, r] = l.split(":").map((e) => e.trim());
|
|
14
|
+
n && r && (g[n] = r);
|
|
15
|
+
}), f[i] = g;
|
|
17
16
|
} else
|
|
18
|
-
f[
|
|
17
|
+
f[i] = o;
|
|
19
18
|
}
|
|
20
19
|
return { svgProps: f, svgContent: t };
|
|
21
20
|
}
|
|
22
21
|
return {};
|
|
23
22
|
}
|
|
24
|
-
function
|
|
25
|
-
let
|
|
23
|
+
function b({ lismClass: m, as: f, icon: s, label: c, exProps: t = {}, ...u }) {
|
|
24
|
+
let a = f || "span", i = "";
|
|
26
25
|
const {
|
|
27
|
-
style:
|
|
28
|
-
className:
|
|
26
|
+
style: o = {},
|
|
27
|
+
className: g = "",
|
|
29
28
|
...l
|
|
30
|
-
} =
|
|
31
|
-
let
|
|
32
|
-
if (l.viewBox)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
e = "
|
|
29
|
+
} = u;
|
|
30
|
+
let n = o, r = g;
|
|
31
|
+
if (l.viewBox) {
|
|
32
|
+
a = "svg";
|
|
33
|
+
const e = l.size;
|
|
34
|
+
e && delete l.size, l.width || (t.width = e || "1em"), l.height || (t.height = e || "1em");
|
|
35
|
+
} else if (l.src)
|
|
36
|
+
a = "img";
|
|
36
37
|
else if (s)
|
|
37
38
|
if (typeof s == "string")
|
|
38
39
|
if (s.startsWith("<svg")) {
|
|
39
|
-
|
|
40
|
-
const { svgProps:
|
|
41
|
-
|
|
40
|
+
a = "_SVG_";
|
|
41
|
+
const { svgProps: e = {}, svgContent: v = "" } = d(s), { class: y, style: _, ...p } = e;
|
|
42
|
+
r = h(r, y), n = { ...n, ..._ }, t = { ...t, ...p, fill: "currentColor" }, i = v;
|
|
42
43
|
} else {
|
|
43
|
-
const
|
|
44
|
-
|
|
44
|
+
const e = S[s] || null;
|
|
45
|
+
e != null && (a = "_SVG_", t = { ...t, ...e });
|
|
45
46
|
}
|
|
46
47
|
else if (typeof s == "object" && s.as) {
|
|
47
|
-
const { as:
|
|
48
|
-
|
|
48
|
+
const { as: e, ...v } = s;
|
|
49
|
+
a = e, t = { ...t, ...v };
|
|
49
50
|
} else
|
|
50
|
-
|
|
51
|
-
return
|
|
51
|
+
a = s;
|
|
52
|
+
return c ? (t["aria-label"] = c, t.role = "img") : t["aria-hidden"] = "true", l.lismClass = h(m, "a--icon", r), l.style = { ...n }, { Component: a, lismProps: l, exProps: t, content: i };
|
|
52
53
|
}
|
|
53
54
|
export {
|
|
54
|
-
|
|
55
|
+
b as default
|
|
55
56
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { LismComponentProps } from '../../Lism';
|
|
3
|
-
|
|
4
|
-
type MediaComponentProps<T extends ElementType = 'img'> = LismComponentProps<T> & MediaOwnProps;
|
|
5
|
-
export default function Media<T extends ElementType = 'img'>(props: MediaComponentProps<T>): import("react").JSX.Element;
|
|
6
|
-
export {};
|
|
3
|
+
export default function Media<T extends ElementType = 'img'>(props: LismComponentProps<T>): import("react").JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Media } from './index';
|
|
3
2
|
declare const meta: Meta;
|
|
4
3
|
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof
|
|
4
|
+
type Story = StoryObj<typeof meta>;
|
|
6
5
|
export declare const Default: Story;
|
|
7
6
|
export declare const WithObjectFitCover: Story;
|
|
8
7
|
export declare const WithObjectFitContain: Story;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import i from "./getProps.js";
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
2
|
import m from "../../Lism/index.js";
|
|
4
|
-
function
|
|
5
|
-
return /* @__PURE__ */
|
|
3
|
+
function a(r) {
|
|
4
|
+
return /* @__PURE__ */ i(m, { as: "img", ...r });
|
|
6
5
|
}
|
|
7
6
|
export {
|
|
8
|
-
|
|
7
|
+
a as default
|
|
9
8
|
};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export * from './Lism';
|
|
2
|
-
export * from './Dummy';
|
|
3
2
|
export { default as HTML } from './HTML';
|
|
3
|
+
/** @deprecated DummyText / DummyImage (@lism-css/ui) を使用してください */
|
|
4
|
+
export * from './Dummy';
|
|
5
|
+
export * from './Text';
|
|
6
|
+
export * from './Inline';
|
|
7
|
+
export * from './Group';
|
|
8
|
+
export * from './Heading';
|
|
9
|
+
export * from './Link';
|
|
10
|
+
export * from './List';
|
|
4
11
|
export * from './Container';
|
|
5
12
|
export * from './Wrapper';
|
|
6
13
|
export * from './Layer';
|
package/dist/components/index.js
CHANGED
|
@@ -1,50 +1,64 @@
|
|
|
1
1
|
import { default as o } from "./HTML/index.js";
|
|
2
2
|
import { default as t } from "./Box/index.js";
|
|
3
3
|
import { default as l } from "./Center/index.js";
|
|
4
|
-
import { default as
|
|
4
|
+
import { default as d } from "./Cluster/index.js";
|
|
5
5
|
import { default as u } from "./Columns/index.js";
|
|
6
6
|
import { default as x } from "./Container/index.js";
|
|
7
7
|
import { default as n } from "./atomic/Decorator/index.js";
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as q } from "./
|
|
19
|
-
import { default as A } from "./
|
|
20
|
-
import { default as J } from "./
|
|
21
|
-
import { default as N } from "./
|
|
22
|
-
import { default as P } from "./
|
|
23
|
-
import { default as R } from "./
|
|
24
|
-
import { default as V } from "./
|
|
8
|
+
import { default as C } from "./atomic/Divider/index.js";
|
|
9
|
+
import { default as F } from "./Dummy/index.js";
|
|
10
|
+
import { default as k } from "./Flex/index.js";
|
|
11
|
+
import { default as I } from "./Flow/index.js";
|
|
12
|
+
import { default as w } from "./FluidCols/index.js";
|
|
13
|
+
import { default as B } from "./Frame/index.js";
|
|
14
|
+
import { default as H } from "./Grid/index.js";
|
|
15
|
+
import { default as g } from "./Group/index.js";
|
|
16
|
+
import { default as v } from "./Heading/index.js";
|
|
17
|
+
import { default as b } from "./atomic/Icon/index.js";
|
|
18
|
+
import { default as q } from "./Inline/index.js";
|
|
19
|
+
import { default as A } from "./Layer/index.js";
|
|
20
|
+
import { default as J } from "./Link/index.js";
|
|
21
|
+
import { default as N } from "./LinkBox/index.js";
|
|
22
|
+
import { default as P } from "./Lism/index.js";
|
|
23
|
+
import { default as R } from "./List/index.js";
|
|
24
|
+
import { default as V } from "./List/ListItem.js";
|
|
25
|
+
import { default as Y } from "./atomic/Media/index.js";
|
|
26
|
+
import { default as _ } from "./SideMain/index.js";
|
|
27
|
+
import { default as ee } from "./atomic/Spacer/index.js";
|
|
28
|
+
import { default as oe } from "./Stack/index.js";
|
|
29
|
+
import { default as te } from "./SwitchCols/index.js";
|
|
30
|
+
import { default as le } from "./Text/index.js";
|
|
31
|
+
import { default as de } from "./Wrapper/index.js";
|
|
25
32
|
export {
|
|
26
33
|
t as Box,
|
|
27
34
|
l as Center,
|
|
28
|
-
|
|
35
|
+
d as Cluster,
|
|
29
36
|
u as Columns,
|
|
30
37
|
x as Container,
|
|
31
38
|
n as Decorator,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
C as Divider,
|
|
40
|
+
F as Dummy,
|
|
41
|
+
k as Flex,
|
|
42
|
+
I as Flow,
|
|
43
|
+
w as FluidCols,
|
|
44
|
+
B as Frame,
|
|
45
|
+
H as Grid,
|
|
46
|
+
g as Group,
|
|
39
47
|
o as HTML,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
v as Heading,
|
|
49
|
+
b as Icon,
|
|
50
|
+
q as Inline,
|
|
51
|
+
A as Layer,
|
|
52
|
+
J as Link,
|
|
53
|
+
N as LinkBox,
|
|
54
|
+
P as Lism,
|
|
55
|
+
R as List,
|
|
56
|
+
V as ListItem,
|
|
57
|
+
Y as Media,
|
|
58
|
+
_ as SideMain,
|
|
59
|
+
ee as Spacer,
|
|
60
|
+
oe as Stack,
|
|
61
|
+
te as SwitchCols,
|
|
62
|
+
le as Text,
|
|
63
|
+
de as Wrapper
|
|
50
64
|
};
|
package/dist/config/helper.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type PlainObject = Record<string, unknown>;
|
|
2
2
|
type DeepMergeResult<T, U> = T extends PlainObject ? U extends PlainObject ? {
|
|
3
|
-
[K in keyof T | keyof U]: K extends keyof U ? K extends keyof T ? DeepMergeResult<T[K], U[K]> : U[K] : K extends keyof T ? T[K] : never;
|
|
3
|
+
[K in keyof T | keyof U]: K extends keyof U ? (K extends keyof T ? DeepMergeResult<T[K], U[K]> : U[K]) : K extends keyof T ? T[K] : never;
|
|
4
4
|
} : T : U extends PlainObject ? U : T;
|
|
5
5
|
/**
|
|
6
6
|
* 深いマージを行う関数
|