@liner-fe/prism 1.8.6 → 1.8.8
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/lib/components/Typography/Caption.d.ts +5 -6
- package/lib/components/Typography/Display.d.ts +3 -3
- package/lib/components/Typography/Heading.d.ts +3 -3
- package/lib/components/Typography/Paragraph.d.ts +5 -6
- package/lib/components/Typography/Title.d.ts +3 -4
- package/lib/components/Typography/types.d.ts +5 -0
- package/lib/components/Typography/utils.d.ts +3 -0
- package/lib/index.mjs +37 -17
- package/lib/index.mjs.map +4 -4
- package/package.json +1 -1
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
interface IPropsNormalBold extends HTMLAttributes<HTMLDivElement> {
|
|
1
|
+
import { BOLD, ITypographyCommon, MEDIUM, NORMAL, REGULAR } from './types';
|
|
2
|
+
interface IPropsNormalBold extends ITypographyCommon<HTMLElement> {
|
|
4
3
|
type: NORMAL;
|
|
5
4
|
size: 1 | 2 | 3;
|
|
6
5
|
weight: BOLD;
|
|
7
6
|
}
|
|
8
|
-
interface IPropsNormalRegular extends
|
|
7
|
+
interface IPropsNormalRegular extends ITypographyCommon<HTMLElement> {
|
|
9
8
|
type: NORMAL;
|
|
10
9
|
size: 1 | 2 | 3;
|
|
11
10
|
weight: REGULAR;
|
|
12
11
|
}
|
|
13
|
-
interface IPropsNormalMedium extends
|
|
12
|
+
interface IPropsNormalMedium extends ITypographyCommon<HTMLElement> {
|
|
14
13
|
type: NORMAL;
|
|
15
14
|
size: 1;
|
|
16
15
|
weight: MEDIUM;
|
|
17
16
|
}
|
|
18
17
|
export type ICaptionProps = IPropsNormalBold | IPropsNormalRegular | IPropsNormalMedium;
|
|
19
|
-
export declare const Caption: ({ children, size, weight, type, className, ...rest }: ICaptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const Caption: ({ children, size, weight, type, className, color, ...rest }: ICaptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
19
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface IDisplayProps extends
|
|
1
|
+
import { ITypographyCommon } from './types';
|
|
2
|
+
export interface IDisplayProps extends ITypographyCommon {
|
|
3
3
|
size: 1 | 2 | 3;
|
|
4
4
|
type: 'accent' | 'normal';
|
|
5
5
|
weight: 'black';
|
|
6
6
|
}
|
|
7
|
-
export declare const Display: (
|
|
7
|
+
export declare const Display: ({ size, type, weight, className, children, color, ...rest }: IDisplayProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface IHeadingProps extends
|
|
1
|
+
import { ITypographyCommon } from './types';
|
|
2
|
+
export interface IHeadingProps extends ITypographyCommon<HTMLHeadingElement> {
|
|
3
3
|
type: 'answer';
|
|
4
4
|
size: 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
5
|
}
|
|
6
|
-
export declare const Heading: (
|
|
6
|
+
export declare const Heading: ({ size, children, type, className, color, ...rest }: IHeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface IPropsNormal extends HTMLAttributes<HTMLDivElement> {
|
|
1
|
+
import { ACCENT, BOLD, ITypographyCommon, MEDIUM, NORMAL, POST, REGULAR } from './types';
|
|
2
|
+
export interface IPropsNormal extends ITypographyCommon {
|
|
4
3
|
type: NORMAL;
|
|
5
4
|
size: 1 | 2 | 3 | 4;
|
|
6
5
|
weight: REGULAR | MEDIUM | BOLD;
|
|
7
6
|
}
|
|
8
|
-
export interface IPropsPost extends
|
|
7
|
+
export interface IPropsPost extends ITypographyCommon {
|
|
9
8
|
type: POST;
|
|
10
9
|
size: 1 | 3;
|
|
11
10
|
weight: REGULAR;
|
|
12
11
|
}
|
|
13
|
-
export interface IPropsAccent extends
|
|
12
|
+
export interface IPropsAccent extends ITypographyCommon {
|
|
14
13
|
type: ACCENT;
|
|
15
14
|
size: 1 | 2 | 3;
|
|
16
15
|
weight: REGULAR | MEDIUM | BOLD;
|
|
17
16
|
}
|
|
18
17
|
export type ParagraphProps = IPropsNormal | IPropsPost | IPropsAccent;
|
|
19
|
-
export declare const Paragraph: (
|
|
18
|
+
export declare const Paragraph: ({ size, type, weight, className, children, color, ...rest }: ParagraphProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface ITitleProps extends HTMLAttributes<HTMLDivElement> {
|
|
1
|
+
import { ACCENT, BOLD, ITypographyCommon, MEDIUM, NORMAL } from './types';
|
|
2
|
+
export interface ITitleProps extends ITypographyCommon {
|
|
4
3
|
type: ACCENT | NORMAL;
|
|
5
4
|
weight: BOLD | MEDIUM;
|
|
6
5
|
size: 1 | 2 | 3 | 4;
|
|
7
6
|
}
|
|
8
|
-
export declare const Title: (
|
|
7
|
+
export declare const Title: ({ weight, size, type, className, children, color, ...rest }: ITitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { SystemKeys } from '@liner-fe/design-token';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
export interface ITypographyCommon<T extends HTMLElement = HTMLParagraphElement> extends HTMLAttributes<T> {
|
|
4
|
+
color?: SystemKeys;
|
|
5
|
+
}
|
|
1
6
|
export type BLACK = 'black';
|
|
2
7
|
export type BOLD = 'bold';
|
|
3
8
|
export type MEDIUM = 'medium';
|
package/lib/index.mjs
CHANGED
|
@@ -4667,16 +4667,19 @@ import { useEffect, useRef, useState } from "react";
|
|
|
4667
4667
|
|
|
4668
4668
|
// src/components/Typography/Paragraph.tsx
|
|
4669
4669
|
import clsx3 from "clsx";
|
|
4670
|
+
|
|
4671
|
+
// src/components/Typography/utils.ts
|
|
4672
|
+
import { vars } from "@liner-fe/design-token";
|
|
4673
|
+
var getStyle = /* @__PURE__ */ __name((color) => {
|
|
4674
|
+
const style = {};
|
|
4675
|
+
style.color = color ? vars.color[color] : vars.color["neutral-label-primary"];
|
|
4676
|
+
return style;
|
|
4677
|
+
}, "getStyle");
|
|
4678
|
+
|
|
4679
|
+
// src/components/Typography/Paragraph.tsx
|
|
4670
4680
|
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
4671
|
-
var Paragraph = /* @__PURE__ */ __name((
|
|
4672
|
-
return /* @__PURE__ */ jsx92(
|
|
4673
|
-
"div",
|
|
4674
|
-
{
|
|
4675
|
-
...props,
|
|
4676
|
-
className: clsx3(`lp-sys-typo-paragraph${props.size}-${props.type}-${props.weight}`, props.className),
|
|
4677
|
-
children: props.children
|
|
4678
|
-
}
|
|
4679
|
-
);
|
|
4681
|
+
var Paragraph = /* @__PURE__ */ __name(({ size, type, weight, className, children, color, ...rest }) => {
|
|
4682
|
+
return /* @__PURE__ */ jsx92("p", { ...rest, className: clsx3(`lp-sys-typo-paragraph${size}-${type}-${weight}`, className), style: getStyle(color), children });
|
|
4680
4683
|
}, "Paragraph");
|
|
4681
4684
|
|
|
4682
4685
|
// src/components/Toast/index.tsx
|
|
@@ -4739,29 +4742,46 @@ var SingleToast = /* @__PURE__ */ __name((props) => {
|
|
|
4739
4742
|
// src/components/Typography/Heading.tsx
|
|
4740
4743
|
import clsx4 from "clsx";
|
|
4741
4744
|
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
4742
|
-
var Heading = /* @__PURE__ */ __name((
|
|
4743
|
-
|
|
4745
|
+
var Heading = /* @__PURE__ */ __name(({ size, children, type, className, color, ...rest }) => {
|
|
4746
|
+
const Element = `h${size}`;
|
|
4747
|
+
return /* @__PURE__ */ jsx94(Element, { ...rest, className: clsx4(`lp-sys-typo-heading${size}-${type}`, className), style: getStyle(color), children });
|
|
4744
4748
|
}, "Heading");
|
|
4745
4749
|
|
|
4746
4750
|
// src/components/Typography/Display.tsx
|
|
4747
4751
|
import clsx5 from "clsx";
|
|
4748
4752
|
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
4749
|
-
var Display = /* @__PURE__ */ __name((
|
|
4750
|
-
return /* @__PURE__ */ jsx95("
|
|
4753
|
+
var Display = /* @__PURE__ */ __name(({ size, type, weight, className, children, color, ...rest }) => {
|
|
4754
|
+
return /* @__PURE__ */ jsx95("p", { ...rest, className: clsx5(`lp-sys-typo-display${size}-${type}-${weight}`, className), style: getStyle(color), children });
|
|
4751
4755
|
}, "Display");
|
|
4752
4756
|
|
|
4753
4757
|
// src/components/Typography/Title.tsx
|
|
4758
|
+
import { vars as vars2 } from "@liner-fe/design-token";
|
|
4754
4759
|
import clsx6 from "clsx";
|
|
4755
4760
|
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
4756
|
-
var Title2 = /* @__PURE__ */ __name((
|
|
4757
|
-
|
|
4761
|
+
var Title2 = /* @__PURE__ */ __name(({ weight, size, type, className, children, color, ...rest }) => {
|
|
4762
|
+
const style = (() => {
|
|
4763
|
+
const style2 = {};
|
|
4764
|
+
if (color) {
|
|
4765
|
+
style2.color = vars2.color[color];
|
|
4766
|
+
}
|
|
4767
|
+
return style2;
|
|
4768
|
+
})();
|
|
4769
|
+
return /* @__PURE__ */ jsx96("p", { ...rest, className: clsx6(`lp-sys-typo-title${size}-${type}-${weight}`, className), style: getStyle(color), children });
|
|
4758
4770
|
}, "Title");
|
|
4759
4771
|
|
|
4760
4772
|
// src/components/Typography/Caption.tsx
|
|
4761
4773
|
import clsx7 from "clsx";
|
|
4762
4774
|
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
4763
|
-
var Caption = /* @__PURE__ */ __name(({ children, size, weight, type, className, ...rest }) => {
|
|
4764
|
-
return /* @__PURE__ */ jsx97(
|
|
4775
|
+
var Caption = /* @__PURE__ */ __name(({ children, size, weight, type, className, color, ...rest }) => {
|
|
4776
|
+
return /* @__PURE__ */ jsx97(
|
|
4777
|
+
"caption",
|
|
4778
|
+
{
|
|
4779
|
+
...rest,
|
|
4780
|
+
className: clsx7(`lp-sys-typo-caption${size}-${type}-${weight}`, className),
|
|
4781
|
+
style: getStyle(color),
|
|
4782
|
+
children
|
|
4783
|
+
}
|
|
4784
|
+
);
|
|
4765
4785
|
}, "Caption");
|
|
4766
4786
|
|
|
4767
4787
|
// src/components/Popover/index.tsx
|