@selfdecode/sd-component-library 3.0.15 → 3.0.18

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.
@@ -33,10 +33,11 @@ export declare type InputProps = BaseComponentProps & Pick<RebassInputProps, "ma
33
33
  /**
34
34
  * An object that contains the key we
35
35
  * want to listen to, and the callback
36
+ *
37
+ * Default value: {}
36
38
  */
37
39
  onKeyPress?: {
38
- key: string;
39
- callback: () => void;
40
+ [key: string]: () => void;
40
41
  };
41
42
  /**
42
43
  * If true the component will focus
@@ -0,0 +1,5 @@
1
+ export declare const htmlSpace = "&nbsp;";
2
+ export declare const wrapByDiv: (s: string) => string;
3
+ export declare const lineToHtml: (line: string, idx: number) => string;
4
+ export declare const unescapeWrapper: (s: string) => string;
5
+ export declare const escapeWrapper: (s: string) => string;
@@ -12,17 +12,12 @@ export declare type SecondaryTextInputProps = Pick<PrimaryTextInputProps, "onCha
12
12
  /**
13
13
  * Label shown to the right of the label
14
14
  */
15
- secondLabel?: {
15
+ secondLabel?: Omit<ResponsiveTextV2Props, "children" | "fontSizeWeight"> & {
16
16
  text: string;
17
17
  /**
18
18
  * Default value: ["3px"]
19
19
  */
20
20
  ml?: ResponsiveTextV2Props["ml"];
21
- /**
22
- * You can use negative values to show the content
23
- * a little bit above the label. Default value: undefined
24
- */
25
- mt?: ResponsiveTextV2Props["mt"];
26
21
  /**
27
22
  * Default value: "#9BA2B4", "cl_grey", "grey"
28
23
  */
@@ -1,8 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { TextProps } from "rebass";
3
- export interface BaseTextV2Props extends Omit<TextProps, "color"> {
3
+ import { SDWeight } from "../responsive-text/interfaces";
4
+ export interface BaseTextV2Props extends Omit<TextProps, "color" | "fontWeight"> {
4
5
  color?: string | string[];
5
6
  textTransform?: React.CSSProperties["textTransform"];
7
+ fontWeight?: TextProps["fontWeight"] | SDWeight;
6
8
  /**
7
9
  * Whether to apply "no-translate" class to text block.
8
10
  */
@@ -1,2 +1,2 @@
1
- export type { ResponsiveTextProps, SDFontSizeWeight } from "./interfaces";
1
+ export * from "./interfaces";
2
2
  export { ResponsiveText } from "./responsive-text";
@@ -3,10 +3,15 @@ import { BaseTextProps } from "../base-text";
3
3
  * Props we want from the base text.
4
4
  */
5
5
  declare type PropsFromBaseText = Pick<BaseTextProps, "children" | "color" | "display" | "cursor" | "textAlign" | "textDecoration" | "textTransform" | "letterSpacing" | "lineHeight" | "backgroundColor" | "width" | "height" | "onClick" | "m" | "mt" | "mr" | "mb" | "ml" | "dontTranslate">;
6
+ export declare const fontWeights: readonly ["semi-bold", "regular", "bold"];
7
+ export declare type SDWeight = typeof fontWeights[number];
8
+ export declare const SD_WEIGHT_TO_WEIGHT_MAP: {
9
+ [key in SDWeight]: number;
10
+ };
6
11
  /**
7
12
  * SelfDecode's combinations of fontSize and fontWeight.
8
13
  */
9
- export declare type SDFontSizeWeight = [number, "semi-bold" | "regular" | "bold"];
14
+ export declare type SDFontSizeWeight = [number, SDWeight];
10
15
  export interface ResponsiveTextProps extends PropsFromBaseText {
11
16
  fontSizeWeight: SDFontSizeWeight[] | SDFontSizeWeight;
12
17
  /**
@@ -1,5 +1,5 @@
1
1
  import { BaseTextV2Props } from "../base-text-v2";
2
- import { SDFontSizeWeight } from "../responsive-text/interfaces";
2
+ import { SDFontSizeWeight } from "../responsive-text";
3
3
  export interface ResponsiveTextV2Props extends Omit<BaseTextV2Props, "variant"> {
4
4
  fontSizeWeight: SDFontSizeWeight[] | SDFontSizeWeight;
5
5
  }