@liner-fe/prism 1.8.7 → 1.8.9

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.
@@ -3,4 +3,4 @@ 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: ({ size, children, type, className, style, color, ...rest }: IHeadingProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const Heading: ({ size, children, type, className, color, ...rest }: IHeadingProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { SystemKeys } from '@liner-fe/design-token';
2
2
  import { HTMLAttributes } from 'react';
3
- export interface ITypographyCommon<T extends HTMLElement = HTMLParagraphElement> extends HTMLAttributes<T> {
3
+ export interface ITypographyCommon<T extends HTMLElement = HTMLParagraphElement> extends Omit<HTMLAttributes<T>, 'color'> {
4
4
  color?: SystemKeys;
5
5
  }
6
6
  export type BLACK = 'black';
@@ -0,0 +1,3 @@
1
+ import { SystemKeys } from '@liner-fe/design-token';
2
+ import { CSSProperties } from 'react';
3
+ export declare const getStyle: (color?: SystemKeys) => CSSProperties;
package/lib/index.mjs CHANGED
@@ -4667,9 +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
4681
  var Paragraph = /* @__PURE__ */ __name(({ size, type, weight, className, children, color, ...rest }) => {
4672
- return /* @__PURE__ */ jsx92("p", { ...rest, className: clsx3(`lp-sys-typo-paragraph${size}-${type}-${weight}`, className), style: { color }, children });
4682
+ return /* @__PURE__ */ jsx92("p", { ...rest, className: clsx3(`lp-sys-typo-paragraph${size}-${type}-${weight}`, className), style: getStyle(color), children });
4673
4683
  }, "Paragraph");
4674
4684
 
4675
4685
  // src/components/Toast/index.tsx
@@ -4732,30 +4742,46 @@ var SingleToast = /* @__PURE__ */ __name((props) => {
4732
4742
  // src/components/Typography/Heading.tsx
4733
4743
  import clsx4 from "clsx";
4734
4744
  import { jsx as jsx94 } from "react/jsx-runtime";
4735
- var Heading = /* @__PURE__ */ __name(({ size, children, type, className, style, color, ...rest }) => {
4745
+ var Heading = /* @__PURE__ */ __name(({ size, children, type, className, color, ...rest }) => {
4736
4746
  const Element = `h${size}`;
4737
- return /* @__PURE__ */ jsx94(Element, { ...rest, className: clsx4(`lp-sys-typo-heading${size}-${type}`, className), style: { color }, children });
4747
+ return /* @__PURE__ */ jsx94(Element, { ...rest, className: clsx4(`lp-sys-typo-heading${size}-${type}`, className), style: getStyle(color), children });
4738
4748
  }, "Heading");
4739
4749
 
4740
4750
  // src/components/Typography/Display.tsx
4741
4751
  import clsx5 from "clsx";
4742
4752
  import { jsx as jsx95 } from "react/jsx-runtime";
4743
4753
  var Display = /* @__PURE__ */ __name(({ size, type, weight, className, children, color, ...rest }) => {
4744
- return /* @__PURE__ */ jsx95("p", { ...rest, className: clsx5(`lp-sys-typo-display${size}-${type}-${weight}`, className), style: { color }, children });
4754
+ return /* @__PURE__ */ jsx95("p", { ...rest, className: clsx5(`lp-sys-typo-display${size}-${type}-${weight}`, className), style: getStyle(color), children });
4745
4755
  }, "Display");
4746
4756
 
4747
4757
  // src/components/Typography/Title.tsx
4758
+ import { vars as vars2 } from "@liner-fe/design-token";
4748
4759
  import clsx6 from "clsx";
4749
4760
  import { jsx as jsx96 } from "react/jsx-runtime";
4750
4761
  var Title2 = /* @__PURE__ */ __name(({ weight, size, type, className, children, color, ...rest }) => {
4751
- return /* @__PURE__ */ jsx96("p", { ...rest, className: clsx6(`lp-sys-typo-title${size}-${type}-${weight}`, className), style: { color }, children });
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 });
4752
4770
  }, "Title");
4753
4771
 
4754
4772
  // src/components/Typography/Caption.tsx
4755
4773
  import clsx7 from "clsx";
4756
4774
  import { jsx as jsx97 } from "react/jsx-runtime";
4757
4775
  var Caption = /* @__PURE__ */ __name(({ children, size, weight, type, className, color, ...rest }) => {
4758
- return /* @__PURE__ */ jsx97("caption", { ...rest, className: clsx7(`lp-sys-typo-caption${size}-${type}-${weight}`, className), style: { color }, children });
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
+ );
4759
4785
  }, "Caption");
4760
4786
 
4761
4787
  // src/components/Popover/index.tsx