@selfdecode/sd-component-library 3.1.0 → 4.0.2

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 (80) 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/carousels/carousel-section-container/interfaces.d.ts +3 -1
  4. package/lib/components/complex/navbar/partials/navbar-v1/partials/navbar-desktop-v1/partials/navbar-item/navbar-item.d.ts +3 -1
  5. package/lib/components/complex/navbar/partials/navbar-v1/partials/navbar-mobile-v1/partials/navbar-mobile-unfolded-box/interfaces.d.ts +2 -0
  6. package/lib/components/complex/navbar/partials/navbar-v1/partials/navbar-mobile-v1/partials/navigation-item-text/navigation-item-text.d.ts +3 -1
  7. package/lib/components/complex/navbar/presentational/url-utils.d.ts +0 -6
  8. package/lib/components/containers/flex-center/flex-center.d.ts +1 -1
  9. package/lib/components/containers/flex-center-space-between/flex-center-space-between.d.ts +3 -0
  10. package/lib/components/containers/flex-center-space-between/index.d.ts +1 -0
  11. package/lib/components/containers/flex-items-center/flex-items-center.d.ts +3 -0
  12. package/lib/components/containers/flex-items-center/index.d.ts +1 -0
  13. package/lib/components/containers/grid-containers/grid-center/grid-center.d.ts +3 -0
  14. package/lib/components/containers/grid-containers/grid-center/index.d.ts +1 -0
  15. package/lib/components/containers/grid-containers/grid-container-v2/grid-container-v2.d.ts +1 -1
  16. package/lib/components/containers/grid-containers/grid-container-v2/interfaces.d.ts +1 -1
  17. package/lib/components/containers/grid-containers/index.d.ts +1 -0
  18. package/lib/components/containers/index.d.ts +3 -0
  19. package/lib/components/containers/max-width-container-v2/max-width-container-v2.d.ts +2 -1
  20. package/lib/components/containers/underlined-max-width-container/index.d.ts +1 -0
  21. package/lib/components/containers/underlined-max-width-container/underlined-max-width-container.d.ts +3 -0
  22. package/lib/components/icons/index.d.ts +1 -0
  23. package/lib/components/icons/thin-arrow-left.svg +26 -0
  24. package/lib/components/inputs/client-portal-input/client-portal-input.d.ts +3 -0
  25. package/lib/components/inputs/client-portal-input/index.d.ts +1 -0
  26. package/lib/components/inputs/client-portal-input/interfaces.d.ts +6 -0
  27. package/lib/components/inputs/index.d.ts +2 -0
  28. package/lib/components/inputs/input/interfaces.d.ts +3 -2
  29. package/lib/components/inputs/multi-row-secondary-text-input/utils.d.ts +5 -0
  30. package/lib/components/inputs/search-input/index.d.ts +1 -1
  31. package/lib/components/inputs/search-input/presentational/index.d.ts +1 -2
  32. package/lib/components/inputs/search-input-v2/index.d.ts +1 -0
  33. package/lib/components/inputs/search-input-v2/interfaces.d.ts +8 -0
  34. package/lib/components/inputs/search-input-v2/search-input-v2.d.ts +3 -0
  35. package/lib/components/inputs/secondary-number-input/interfaces.d.ts +3 -10
  36. package/lib/components/inputs/secondary-text-input/interfaces.d.ts +11 -8
  37. package/lib/components/inputs/secondary-text-input/partials/secondary-input-labels/interfaces.d.ts +1 -1
  38. package/lib/components/labels/base-label/interfaces.d.ts +2 -1
  39. package/lib/components/meters/common-outline-meter-partials/label-pointer/interfaces.d.ts +1 -0
  40. package/lib/components/meters/smiley-meter-v2/interfaces.d.ts +1 -1
  41. package/lib/components/meters/smiley-meter-v2/partials/matched-range-label-box/interfaces.d.ts +1 -1
  42. package/lib/components/meters/smiley-meter-v2/partials/smiley-meter-ranges/interfaces.d.ts +1 -1
  43. package/lib/components/modals/modal/interfaces.d.ts +2 -0
  44. package/lib/components/modals/primary-modal/interfaces.d.ts +1 -1
  45. package/lib/components/pagination-bars/index.d.ts +1 -0
  46. package/lib/components/pagination-bars/pagination-bar/interfaces.d.ts +1 -1
  47. package/lib/components/pagination-bars/pagination-bar-mobile/index.d.ts +1 -0
  48. package/lib/components/pagination-bars/pagination-bar-mobile/interfaces.d.ts +5 -0
  49. package/lib/components/pagination-bars/pagination-bar-mobile/pagination-bar-mobile.d.ts +3 -0
  50. package/lib/components/pagination-bars/pagination-bar-mobile/partials/index.d.ts +2 -0
  51. package/lib/components/pagination-bars/pagination-bar-mobile/partials/pagination-bar-button/index.d.ts +1 -0
  52. package/lib/components/pagination-bars/pagination-bar-mobile/partials/pagination-bar-button/interfaces.d.ts +4 -0
  53. package/lib/components/pagination-bars/pagination-bar-mobile/partials/pagination-bar-button/pagination-bar-button.d.ts +3 -0
  54. package/lib/components/pagination-bars/pagination-bar-mobile/partials/pagination-bar-current-page/index.d.ts +1 -0
  55. package/lib/components/pagination-bars/pagination-bar-mobile/partials/pagination-bar-current-page/pagination-bar-current-page.d.ts +2 -0
  56. package/lib/components/tabs/tab-bar/interfaces.d.ts +8 -1
  57. package/lib/components/tabs/tab-bar/partials/arrow-button/arrow-button.d.ts +3 -0
  58. package/lib/components/tabs/tab-bar/partials/arrow-button/index.d.ts +1 -0
  59. package/lib/components/tabs/tab-bar/partials/arrow-button/interfaces.d.ts +5 -0
  60. package/lib/components/tabs/tab-bar/partials/index.d.ts +3 -0
  61. package/lib/components/tabs/tab-bar/partials/mask/index.d.ts +1 -0
  62. package/lib/components/tabs/tab-bar/partials/mask/interfaces.d.ts +5 -0
  63. package/lib/components/tabs/tab-bar/partials/mask/mask.d.ts +3 -0
  64. package/lib/components/tabs/tab-bar/partials/tab/interfaces.d.ts +3 -0
  65. package/lib/components/tabs/tab-bar/partials/tab/tab.d.ts +1 -1
  66. package/lib/components/tabs/tab-bar/tab-bar.d.ts +1 -1
  67. package/lib/components/texts/base-text-v2/interfaces.d.ts +3 -1
  68. package/lib/components/texts/responsive-text/index.d.ts +1 -1
  69. package/lib/components/texts/responsive-text/interfaces.d.ts +6 -1
  70. package/lib/components/texts/responsive-text-v2/interfaces.d.ts +1 -1
  71. package/lib/components/tooltips/tooltip-with-pointer/interfaces.d.ts +5 -0
  72. package/lib/core/custom-hooks.d.ts +1 -1
  73. package/lib/core/functions.d.ts +7 -0
  74. package/lib/core/theme.d.ts +32 -5
  75. package/lib/e986409f719ff9bf4d159ad2929c4590.svg +13 -0
  76. package/lib/index.js +1 -1
  77. package/lib/setupTests.d.ts +1 -0
  78. package/package.json +10 -12
  79. package/lib/components/containers/max-width-container-v2/interfaces.d.ts +0 -2
  80. package/lib/e75b99f7d1b7c672b9a629cbc3ca8165.svg +0 -6
@@ -0,0 +1,5 @@
1
+ import { GridProps } from "../../containers";
2
+ import { PaginationBarProps } from "../pagination-bar";
3
+ export declare type PaginationBarMobileProps = Omit<GridProps, "onChange"> & Omit<PaginationBarProps, "onChange" | "bgSx" | "innerSx"> & {
4
+ onChange: (newValue: number) => void;
5
+ };
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { PaginationBarMobileProps as Props } from "./interfaces";
3
+ export declare const PaginationBarMobile: React.FC<Props>;
@@ -0,0 +1,2 @@
1
+ export * from "./pagination-bar-button";
2
+ export * from "./pagination-bar-current-page";
@@ -0,0 +1 @@
1
+ export { PaginationBarButton } from "./pagination-bar-button";
@@ -0,0 +1,4 @@
1
+ export interface PaginationBarButtonProps {
2
+ disabled: boolean;
3
+ onClick: () => void;
4
+ }
@@ -0,0 +1,3 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ import { PaginationBarButtonProps as Props } from "./interfaces";
3
+ export declare const PaginationBarButton: React.FC<PropsWithChildren<Props>>;
@@ -0,0 +1 @@
1
+ export { PaginationBarCurrentPage } from "./pagination-bar-current-page";
@@ -0,0 +1,2 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ export declare const PaginationBarCurrentPage: React.FC<PropsWithChildren<{}>>;
@@ -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
+ };
@@ -1,4 +1,7 @@
1
- declare const _default: {
1
+ /**
2
+ * The theme for the application.
3
+ */
4
+ declare const theme: {
2
5
  breakpoints: string[];
3
6
  colors: {
4
7
  cl_transparent: string;
@@ -247,6 +250,27 @@ declare const _default: {
247
250
  fontWeight: string;
248
251
  };
249
252
  };
253
+ clientPortal: {
254
+ fontFamily: string;
255
+ color: string;
256
+ fontSize: number;
257
+ borderStyle: string;
258
+ outline: string;
259
+ borderBottomStyle: string;
260
+ borderBottomWidth: string;
261
+ borderBottomColor: string;
262
+ py: string;
263
+ px: number;
264
+ ":focus": {
265
+ outline: string;
266
+ borderStyle: string;
267
+ borderBottomStyle: string;
268
+ borderColor: string;
269
+ };
270
+ "::placeholder": {
271
+ color: string;
272
+ };
273
+ };
250
274
  };
251
275
  };
252
276
  _labels: {
@@ -271,6 +295,12 @@ declare const _default: {
271
295
  marginBottom: string[];
272
296
  color: string;
273
297
  };
298
+ clientPortal: {
299
+ fontSize: number;
300
+ fontWeight: number;
301
+ textTransform: string;
302
+ letterSpacing: string;
303
+ };
274
304
  };
275
305
  selectors: {
276
306
  secondary: {
@@ -739,7 +769,4 @@ declare const _default: {
739
769
  };
740
770
  };
741
771
  };
742
- /**
743
- * The theme for the application.
744
- */
745
- export default _default;
772
+ export default theme;
@@ -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>