@selfdecode/sd-component-library 3.1.0 → 4.0.0

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.
Files changed (74) hide show
  1. package/lib/2475490b1273c89fe9c25a6737e253ed.svg +26 -0
  2. package/lib/components/buttons/partials/goto-button/assets/arrow-right.svg +10 -3
  3. package/lib/components/containers/flex-center/flex-center.d.ts +1 -1
  4. package/lib/components/containers/flex-center-space-between/flex-center-space-between.d.ts +3 -0
  5. package/lib/components/containers/flex-center-space-between/index.d.ts +1 -0
  6. package/lib/components/containers/flex-items-center/flex-items-center.d.ts +3 -0
  7. package/lib/components/containers/flex-items-center/index.d.ts +1 -0
  8. package/lib/components/containers/grid-containers/grid-center/grid-center.d.ts +3 -0
  9. package/lib/components/containers/grid-containers/grid-center/index.d.ts +1 -0
  10. package/lib/components/containers/grid-containers/grid-container-v2/grid-container-v2.d.ts +1 -1
  11. package/lib/components/containers/grid-containers/grid-container-v2/interfaces.d.ts +1 -1
  12. package/lib/components/containers/grid-containers/index.d.ts +1 -0
  13. package/lib/components/containers/index.d.ts +3 -0
  14. package/lib/components/containers/max-width-container-v2/max-width-container-v2.d.ts +2 -1
  15. package/lib/components/containers/underlined-max-width-container/index.d.ts +1 -0
  16. package/lib/components/containers/underlined-max-width-container/underlined-max-width-container.d.ts +3 -0
  17. package/lib/components/icons/index.d.ts +1 -0
  18. package/lib/components/icons/thin-arrow-left.svg +26 -0
  19. package/lib/components/inputs/client-portal-input/client-portal-input.d.ts +3 -0
  20. package/lib/components/inputs/client-portal-input/index.d.ts +1 -0
  21. package/lib/components/inputs/client-portal-input/interfaces.d.ts +6 -0
  22. package/lib/components/inputs/index.d.ts +2 -0
  23. package/lib/components/inputs/input/interfaces.d.ts +3 -2
  24. package/lib/components/inputs/multi-row-secondary-text-input/utils.d.ts +5 -0
  25. package/lib/components/inputs/search-input/index.d.ts +1 -1
  26. package/lib/components/inputs/search-input/presentational/index.d.ts +1 -2
  27. package/lib/components/inputs/search-input-v2/index.d.ts +1 -0
  28. package/lib/components/inputs/search-input-v2/interfaces.d.ts +8 -0
  29. package/lib/components/inputs/search-input-v2/search-input-v2.d.ts +3 -0
  30. package/lib/components/inputs/secondary-number-input/interfaces.d.ts +3 -10
  31. package/lib/components/inputs/secondary-text-input/interfaces.d.ts +11 -8
  32. package/lib/components/inputs/secondary-text-input/partials/secondary-input-labels/interfaces.d.ts +1 -1
  33. package/lib/components/labels/base-label/interfaces.d.ts +2 -1
  34. package/lib/components/meters/common-outline-meter-partials/label-pointer/interfaces.d.ts +1 -0
  35. package/lib/components/meters/smiley-meter-v2/interfaces.d.ts +1 -1
  36. package/lib/components/meters/smiley-meter-v2/partials/matched-range-label-box/interfaces.d.ts +1 -1
  37. package/lib/components/meters/smiley-meter-v2/partials/smiley-meter-ranges/interfaces.d.ts +1 -1
  38. package/lib/components/modals/modal/interfaces.d.ts +2 -0
  39. package/lib/components/modals/primary-modal/interfaces.d.ts +1 -1
  40. package/lib/components/pagination-bars/index.d.ts +1 -0
  41. package/lib/components/pagination-bars/pagination-bar/interfaces.d.ts +1 -1
  42. package/lib/components/pagination-bars/pagination-bar-mobile/index.d.ts +1 -0
  43. package/lib/components/pagination-bars/pagination-bar-mobile/interfaces.d.ts +5 -0
  44. package/lib/components/pagination-bars/pagination-bar-mobile/pagination-bar-mobile.d.ts +3 -0
  45. package/lib/components/pagination-bars/pagination-bar-mobile/partials/index.d.ts +2 -0
  46. package/lib/components/pagination-bars/pagination-bar-mobile/partials/pagination-bar-button/index.d.ts +1 -0
  47. package/lib/components/pagination-bars/pagination-bar-mobile/partials/pagination-bar-button/interfaces.d.ts +4 -0
  48. package/lib/components/pagination-bars/pagination-bar-mobile/partials/pagination-bar-button/pagination-bar-button.d.ts +3 -0
  49. package/lib/components/pagination-bars/pagination-bar-mobile/partials/pagination-bar-current-page/index.d.ts +1 -0
  50. package/lib/components/pagination-bars/pagination-bar-mobile/partials/pagination-bar-current-page/pagination-bar-current-page.d.ts +2 -0
  51. package/lib/components/tabs/tab-bar/interfaces.d.ts +8 -1
  52. package/lib/components/tabs/tab-bar/partials/arrow-button/arrow-button.d.ts +3 -0
  53. package/lib/components/tabs/tab-bar/partials/arrow-button/index.d.ts +1 -0
  54. package/lib/components/tabs/tab-bar/partials/arrow-button/interfaces.d.ts +5 -0
  55. package/lib/components/tabs/tab-bar/partials/index.d.ts +3 -0
  56. package/lib/components/tabs/tab-bar/partials/mask/index.d.ts +1 -0
  57. package/lib/components/tabs/tab-bar/partials/mask/interfaces.d.ts +5 -0
  58. package/lib/components/tabs/tab-bar/partials/mask/mask.d.ts +3 -0
  59. package/lib/components/tabs/tab-bar/partials/tab/interfaces.d.ts +3 -0
  60. package/lib/components/tabs/tab-bar/partials/tab/tab.d.ts +1 -1
  61. package/lib/components/tabs/tab-bar/tab-bar.d.ts +1 -1
  62. package/lib/components/texts/base-text-v2/interfaces.d.ts +3 -1
  63. package/lib/components/texts/responsive-text/index.d.ts +1 -1
  64. package/lib/components/texts/responsive-text/interfaces.d.ts +6 -1
  65. package/lib/components/texts/responsive-text-v2/interfaces.d.ts +1 -1
  66. package/lib/components/tooltips/tooltip-with-pointer/interfaces.d.ts +5 -0
  67. package/lib/core/custom-hooks.d.ts +1 -1
  68. package/lib/core/functions.d.ts +7 -0
  69. package/lib/core/theme.d.ts +27 -0
  70. package/lib/e986409f719ff9bf4d159ad2929c4590.svg +13 -0
  71. package/lib/index.js +1 -1
  72. package/package.json +1 -1
  73. package/lib/components/containers/max-width-container-v2/interfaces.d.ts +0 -2
  74. package/lib/e75b99f7d1b7c672b9a629cbc3ca8165.svg +0 -6
@@ -1,3 +1,4 @@
1
+ import { SxProps } from "rebass";
1
2
  import { TabProps } from "./partials/tab/interfaces";
2
3
  /**
3
4
  * Configuration describing each tab
@@ -6,7 +7,7 @@ export declare type TabConfig<T> = Pick<TabProps<T>, "id" | "label" | "secondary
6
7
  /**
7
8
  * Props for TabBar
8
9
  */
9
- export interface TabBarProps<T> {
10
+ export interface TabBarProps<T> extends Pick<TabProps<T>, "labelSx" | "secondaryTextSx"> {
10
11
  /**
11
12
  * Array containing configuration for each tab.
12
13
  */
@@ -49,4 +50,10 @@ export interface TabBarProps<T> {
49
50
  * Max width of each tab.
50
51
  */
51
52
  tabMaxWidth?: string | string[];
53
+ /**
54
+ * Whether component should be scrollable.
55
+ * Otherwise, buttons for the manual scrolling will appear .
56
+ */
57
+ scrollable?: boolean;
58
+ containerSx?: SxProps["sx"];
52
59
  }
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { ArrowButtonProps as Props } from "./interfaces";
3
+ export declare const ArrowButton: React.FC<Props>;
@@ -0,0 +1 @@
1
+ export { ArrowButton } from "./arrow-button";
@@ -0,0 +1,5 @@
1
+ export interface ArrowButtonProps {
2
+ width: number | string | string[];
3
+ onClick: () => void;
4
+ direction: "left" | "right";
5
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./arrow-button";
2
+ export * from "./mask";
3
+ export * from "./tab";
@@ -0,0 +1 @@
1
+ export { Mask } from "./mask";
@@ -0,0 +1,5 @@
1
+ export interface MaskProps {
2
+ width: number | string | string[];
3
+ offset: number | string | string[];
4
+ direction: "left" | "right";
5
+ }
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { MaskProps as Props } from "./interfaces";
3
+ export declare const Mask: React.FC<Props>;
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { SxProps } from "rebass";
2
3
  export interface TabProps<T> {
3
4
  /**
4
5
  * Tab width.
@@ -12,10 +13,12 @@ export interface TabProps<T> {
12
13
  * This is the text to be displayed on the tab
13
14
  */
14
15
  label: string | React.ReactNode;
16
+ labelSx?: SxProps["sx"];
15
17
  /**
16
18
  * Secondary text to be displayed right after label.
17
19
  */
18
20
  secondaryText?: string;
21
+ secondaryTextSx?: SxProps["sx"];
19
22
  /**
20
23
  * Icon to be displayed right after label.
21
24
  */
@@ -5,4 +5,4 @@ export declare const Ribbon: ({ active, activeColor, color, }: {
5
5
  activeColor?: string | undefined;
6
6
  color?: string | undefined;
7
7
  }) => JSX.Element;
8
- export declare function Tab<T>({ width, height, label, secondaryText, icon, id, onClick, selected, activeColor, color, tabPadding, bg, activeBg, activeRibbonColor, borderRadius, tabHeaderComponent, elementId, maxWidth, }: TabProps<T>): JSX.Element;
8
+ export declare function Tab<T>({ width, height, label, secondaryText, icon, id, onClick, selected, activeColor, color, tabPadding, bg, activeBg, activeRibbonColor, borderRadius, tabHeaderComponent, elementId, maxWidth, labelSx, secondaryTextSx, }: TabProps<T>): JSX.Element;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { TabBarProps } from "./interfaces";
3
- export declare function TabBar<T>({ tabs, selectedTabId, onTabSelect, activeColor, color, displayBorder, tabPadding, tabWidth, tabHeight, tabMaxWidth, }: TabBarProps<T>): JSX.Element;
3
+ export declare function TabBar<T>({ tabs, selectedTabId, onTabSelect, activeColor, color, displayBorder, tabPadding, tabWidth, tabHeight, tabMaxWidth, labelSx, secondaryTextSx, scrollable, containerSx, }: TabBarProps<T>): JSX.Element;
@@ -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
  }
@@ -26,4 +26,9 @@ export interface TooltipWithPointerProps {
26
26
  * Whether to show mobile version of the tooltip.
27
27
  */
28
28
  showMobileVersion?: boolean;
29
+ /**
30
+ * Whether to prevent default behavior on tooltip click.
31
+ */
32
+ stopPropagation?: boolean;
33
+ zIndex?: number;
29
34
  }
@@ -81,4 +81,4 @@ export declare function useBoundingClientRect<T extends Element = HTMLElement>(s
81
81
  ref: RefObject<T>;
82
82
  rect: DOMRect | undefined;
83
83
  };
84
- export declare const useBodyScrollLock: (target: HTMLElement | null, shouldEnable?: boolean) => void;
84
+ export declare const useBodyScrollLock: <T extends HTMLElement = HTMLElement>(target: T | null, shouldEnable?: boolean) => void;
@@ -0,0 +1,7 @@
1
+ export declare const isIOS: () => boolean;
2
+ export declare const isTouchScreen: () => boolean;
3
+ export declare const getResponsiveClick: (callback: () => void) => {
4
+ shouldUseTouch: boolean;
5
+ onClick: (() => void) | undefined;
6
+ onTouchStart: (() => void) | undefined;
7
+ };
@@ -247,6 +247,27 @@ declare const _default: {
247
247
  fontWeight: string;
248
248
  };
249
249
  };
250
+ clientPortal: {
251
+ fontFamily: string;
252
+ color: string;
253
+ fontSize: number;
254
+ borderStyle: string;
255
+ outline: string;
256
+ borderBottomStyle: string;
257
+ borderBottomWidth: string;
258
+ borderBottomColor: string;
259
+ py: string;
260
+ px: number;
261
+ ":focus": {
262
+ outline: string;
263
+ borderStyle: string;
264
+ borderBottomStyle: string;
265
+ borderColor: string;
266
+ };
267
+ "::placeholder": {
268
+ color: string;
269
+ };
270
+ };
250
271
  };
251
272
  };
252
273
  _labels: {
@@ -271,6 +292,12 @@ declare const _default: {
271
292
  marginBottom: string[];
272
293
  color: string;
273
294
  };
295
+ clientPortal: {
296
+ fontSize: number;
297
+ fontWeight: number;
298
+ textTransform: string;
299
+ letterSpacing: string;
300
+ };
274
301
  };
275
302
  selectors: {
276
303
  secondary: {
@@ -0,0 +1,13 @@
1
+ <svg
2
+ xmlns="http://www.w3.org/2000/svg"
3
+ width="15"
4
+ height="16.243"
5
+ viewBox="0 0 15 16.243"
6
+ >
7
+ <g id="arrow_right" transform="translate(0.5 -9.879)">
8
+ <path id="Path_86" data-name="Path 86" d="M18,24l6-6-6-6" transform="translate(-11)" fill="none" stroke="#4568f9"
9
+ stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/>
10
+ <path id="Path_87" data-name="Path 87" d="M12,18H24" transform="translate(-11)" fill="none" stroke="#4568f9"
11
+ stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/>
12
+ </g>
13
+ </svg>