@sisense/sdk-shared-ui 0.1.0 → 1.26.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 (119) hide show
  1. package/.storybook/main.ts +44 -0
  2. package/.storybook/preview-head.html +4 -0
  3. package/.storybook/preview.tsx +34 -0
  4. package/dist/index.js +40 -2
  5. package/package.json +99 -2
  6. package/src/lib/CheckableList/CheckableList.module.scss +13 -0
  7. package/src/lib/CheckableList/CheckableList.test.tsx +61 -0
  8. package/src/lib/CheckableList/CheckableList.tsx +41 -0
  9. package/src/lib/CheckableList/index.ts +4 -0
  10. package/src/lib/Checkbox/Checkbox.tsx +28 -0
  11. package/src/lib/Checkbox/index.ts +4 -0
  12. package/src/lib/Checkbox/themes/checkboxTheme.ts +42 -0
  13. package/src/lib/Checkbox/themes/index.ts +1 -0
  14. package/src/lib/Checkbox/themes/uiCustomization.ts +28 -0
  15. package/src/lib/DEPRECATED_Button/DEPRECATED_Button.module.scss +57 -0
  16. package/src/lib/DEPRECATED_Button/DEPRECATED_Button.stories.tsx +169 -0
  17. package/src/lib/DEPRECATED_Button/DEPRECATED_Button.test.tsx +154 -0
  18. package/src/lib/DEPRECATED_Button/DEPRECATED_Button.tsx +129 -0
  19. package/src/lib/DEPRECATED_Button/index.ts +4 -0
  20. package/src/lib/DEPRECATED_Checkbox/Checkbox.module.scss +49 -0
  21. package/src/lib/DEPRECATED_Checkbox/DEPRECATED_Checkbox.test.tsx +131 -0
  22. package/src/lib/DEPRECATED_Checkbox/DEPRECATED_Checkbox.tsx +103 -0
  23. package/src/lib/DEPRECATED_Checkbox/index.ts +4 -0
  24. package/src/lib/DEPRECATED_Icon/DEPRECATED_Icon.stories.tsx +27 -0
  25. package/src/lib/DEPRECATED_Icon/DEPRECATED_Icon.tsx +2 -0
  26. package/src/lib/DEPRECATED_Toggle/DEPRECATED_Toggle.tsx +49 -0
  27. package/src/lib/DEPRECATED_Toggle/index.ts +4 -0
  28. package/src/lib/DEPRECATED_Tooltip/DEPRECATED_Tooltip.module.scss +115 -0
  29. package/src/lib/DEPRECATED_Tooltip/DEPRECATED_Tooltip.tsx +68 -0
  30. package/src/lib/DEPRECATED_Tooltip/index.ts +4 -0
  31. package/src/lib/Dropdown/Dropdown.module.scss +9 -0
  32. package/src/lib/Dropdown/Dropdown.tsx +150 -0
  33. package/src/lib/Dropdown/DropdownButton/DropdownButton.module.scss +49 -0
  34. package/src/lib/Dropdown/DropdownButton/DropdownButton.tsx +81 -0
  35. package/src/lib/Dropdown/DropdownButton/DropdownButtonBody/DropdownButtonBody.test.tsx +121 -0
  36. package/src/lib/Dropdown/DropdownButton/DropdownButtonBody/DropdownButtonBody.tsx +39 -0
  37. package/src/lib/Dropdown/DropdownButton/DropdownButtonBody/index.ts +2 -0
  38. package/src/lib/Dropdown/DropdownButton/DropdownButtonSearch/DropdownButtonSearch.module.scss +20 -0
  39. package/src/lib/Dropdown/DropdownButton/DropdownButtonSearch/DropdownButtonSearch.tsx +44 -0
  40. package/src/lib/Dropdown/DropdownButton/DropdownButtonSearch/constants.ts +1 -0
  41. package/src/lib/Dropdown/DropdownButton/DropdownButtonSearch/index.ts +2 -0
  42. package/src/lib/Dropdown/DropdownButton/hooks/index.tsx +1 -0
  43. package/src/lib/Dropdown/DropdownButton/hooks/useDropdownButtonSearch.ts +51 -0
  44. package/src/lib/Dropdown/DropdownButton/index.ts +1 -0
  45. package/src/lib/Dropdown/hooks/index.tsx +1 -0
  46. package/src/lib/Dropdown/hooks/useDropdown.ts +29 -0
  47. package/src/lib/Dropdown/index.ts +5 -0
  48. package/src/lib/Dropdown/types.ts +17 -0
  49. package/src/lib/Icon/Icon.tsx +118 -0
  50. package/src/lib/Icon/index.ts +4 -0
  51. package/src/lib/Icon/themes/iconTheme.tsx +38 -0
  52. package/src/lib/Icon/themes/index.ts +1 -0
  53. package/src/lib/Icon/themes/uiCustomization.ts +9 -0
  54. package/src/lib/Input/Input.module.scss +97 -0
  55. package/src/lib/Input/Input.test.tsx +177 -0
  56. package/src/lib/Input/Input.tsx +134 -0
  57. package/src/lib/Input/index.ts +4 -0
  58. package/src/lib/LazyLoader/LazyLoader.module.scss +18 -0
  59. package/src/lib/LazyLoader/LazyLoader.tsx +42 -0
  60. package/src/lib/LazyLoader/index.ts +4 -0
  61. package/src/lib/Menu/Confirmation/Confirmation.module.scss +48 -0
  62. package/src/lib/Menu/Confirmation/Confirmation.tsx +45 -0
  63. package/src/lib/Menu/Confirmation/index.ts +1 -0
  64. package/src/lib/Menu/Confirmation/translation.ts +17 -0
  65. package/src/lib/Menu/Menu.module.scss +178 -0
  66. package/src/lib/Menu/Menu.tsx +363 -0
  67. package/src/lib/Menu/MenuItem/MenuItem.test.tsx +241 -0
  68. package/src/lib/Menu/MenuItem/MenuItem.tsx +186 -0
  69. package/src/lib/Menu/MenuItem/index.ts +2 -0
  70. package/src/lib/Menu/index.ts +6 -0
  71. package/src/lib/Menu/utils.ts +13 -0
  72. package/src/lib/Popover/Popover.module.scss +15 -0
  73. package/src/lib/Popover/Popover.tsx +92 -0
  74. package/src/lib/Popover/align.interface.ts +20 -0
  75. package/src/lib/Popover/index.ts +6 -0
  76. package/src/lib/RadioButton/RadioButton.module.scss +22 -0
  77. package/src/lib/RadioButton/RadioButton.tsx +89 -0
  78. package/src/lib/RadioButton/index.ts +4 -0
  79. package/src/lib/TablePagination/PaginationActionsComponent/PaginationActionsComponent.tsx +87 -0
  80. package/src/lib/TablePagination/PaginationActionsComponent/index.ts +4 -0
  81. package/src/lib/TablePagination/PaginationActionsComponent/themes/index.ts +4 -0
  82. package/src/lib/TablePagination/PaginationActionsComponent/themes/paginationActionsComponentTheme.tsx +70 -0
  83. package/src/lib/TablePagination/PaginationActionsComponent/themes/uiCustomization.ts +17 -0
  84. package/src/lib/TablePagination/TablePagination.tsx +148 -0
  85. package/src/lib/TablePagination/TablePaginationContext.ts +4 -0
  86. package/src/lib/TablePagination/index.ts +4 -0
  87. package/src/lib/TablePagination/themes/index.ts +1 -0
  88. package/src/lib/TablePagination/themes/tablePaginationResponsiveDesign.ts +33 -0
  89. package/src/lib/TablePagination/themes/tablePaginationTheme.tsx +128 -0
  90. package/src/lib/TablePagination/themes/uiCustomization.ts +50 -0
  91. package/src/lib/Tooltip/Tooltip.module.scss +125 -0
  92. package/src/lib/Tooltip/Tooltip.tsx +34 -0
  93. package/src/lib/Tooltip/index.ts +5 -0
  94. package/src/lib/Tooltip/themes/index.ts +1 -0
  95. package/src/lib/Tooltip/themes/tooltipTheme.ts +30 -0
  96. package/src/lib/Typography/Typography.tsx +28 -0
  97. package/src/lib/Typography/index.ts +5 -0
  98. package/src/lib/Typography/themes/index.ts +1 -0
  99. package/src/lib/Typography/themes/typographyTheme.tsx +170 -0
  100. package/src/lib/Typography/themes/uiCustomization.ts +10 -0
  101. package/src/lib/constants/styleguideConstants.ts +8 -0
  102. package/src/lib/index.ts +16 -0
  103. package/src/lib/styles/colors.module.scss +10 -0
  104. package/src/lib/styles/sisenseStyleguideReactColors.scss +57 -0
  105. package/src/lib/styles/style_styleguide_react/_variables.deprecated.scss +107 -0
  106. package/src/lib/styles/style_styleguide_react/_variables.scss +100 -0
  107. package/src/lib/styles/style_styleguide_react/base.scss +9 -0
  108. package/src/lib/styles/style_styleguide_react/colors.scss +71 -0
  109. package/src/lib/styles/style_styleguide_react/exports/colors.exports.scss +69 -0
  110. package/src/lib/styles/style_styleguide_react/exports/fonts.exports.scss +33 -0
  111. package/src/lib/styles/style_styleguide_react/fonts.scss +27 -0
  112. package/src/lib/styles/style_styleguide_react/mixins.scss +90 -0
  113. package/src/lib/themes/colors/index.ts +1 -0
  114. package/src/lib/themes/colors/siColors.ts +143 -0
  115. package/src/lib/themes/index.ts +2 -0
  116. package/src/lib/themes/types/SisenseTheme.ts +12 -0
  117. package/src/lib/themes/types/index.ts +1 -0
  118. package/tsconfig.lib.json +2 -1
  119. package/vite.config.ts +18 -1
@@ -0,0 +1,90 @@
1
+ @import '_variables';
2
+ @import 'colors';
3
+ @import 'fonts';
4
+
5
+ @mixin ellipsis($whiteSpace: nowrap) {
6
+ text-overflow: ellipsis;
7
+ white-space: $whiteSpace;
8
+ overflow: hidden;
9
+ }
10
+
11
+ @mixin smallBold {
12
+ font-size: $sizeSmall;
13
+ font-family: $fontFamily;
14
+ font-weight: bold;
15
+ }
16
+
17
+ @mixin mediumBold {
18
+ font-size: $sizeMedium;
19
+ font-family: $fontFamily;
20
+ font-weight: bold;
21
+ }
22
+
23
+ @mixin largeBold {
24
+ font-size: $sizeLarge;
25
+ font-family: $fontFamily;
26
+ font-weight: bold;
27
+ }
28
+
29
+ @mixin smallText {
30
+ font-size: $sizeSmall;
31
+ font-family: $fontFamily;
32
+ }
33
+
34
+ @mixin mediumText {
35
+ font-size: $sizeMedium;
36
+ font-family: $fontFamily;
37
+ }
38
+
39
+ @mixin largeText {
40
+ font-size: $sizeLarge;
41
+ font-family: $fontFamily;
42
+ }
43
+
44
+ @mixin smallHeader {
45
+ font-size: $sizeSmall;
46
+ font-family: $fontHeader;
47
+ }
48
+
49
+ @mixin mediumHeader {
50
+ font-size: $sizeMedium;
51
+ font-family: $fontHeader;
52
+ }
53
+
54
+ @mixin largeHeader {
55
+ font-size: $sizeLarge;
56
+ font-family: $fontHeader;
57
+ }
58
+
59
+ @mixin flexCenter {
60
+ display: flex;
61
+ justify-content: center;
62
+ align-items: center;
63
+ }
64
+
65
+ // A workaround for Safari where there is a system tooltip enable by default
66
+ // https://stackoverflow.com/questions/20974276/prevent-safari-from-showing-tooltip-when-text-overflow-is-hidden-with-ellipsis
67
+ @mixin disabledSafariSystemTooltip {
68
+ &:after {
69
+ content: '';
70
+ display: block;
71
+ }
72
+ }
73
+
74
+ @mixin boxShadow($opacity: 0.2) {
75
+ box-shadow: 0 -1px 5px 1px rgba(58, 67, 86, $opacity);
76
+ }
77
+
78
+ @mixin CSS_ANIMATE($properties, $duration: $NORMAL_ANIMATION_TIME) {
79
+ -webkit-transition-duration: $duration;
80
+ -moz-transition-duration: $duration;
81
+ transition-duration: $duration;
82
+ -webkit-transition-property: $properties;
83
+ -moz-transition-property: $properties;
84
+ transition-property: $properties;
85
+ }
86
+
87
+ @mixin disabled($color: $lineSeparator, $background: $color-gray-4) {
88
+ color: $color;
89
+ background: $background;
90
+ }
@@ -0,0 +1 @@
1
+ export { sfColors, siColors, stEffects } from './siColors';
@@ -0,0 +1,143 @@
1
+ const sfColors = {
2
+ $ABBEY: ' #45464a',
3
+ $ALABASTER: ' #f7f7f7',
4
+ $ALTO: ' #d3d3d3',
5
+ $ALTO2: ' #dadada',
6
+ $ALUMINIUM: ' #a4a8b0',
7
+ $ATHENS_GRAY_DARK: ' #edeef1',
8
+ $ATHENS_GRAY_DARK2: ' #e3e5ea',
9
+ $ATHENS_GRAY_LIGHT: ' #f9f9fb',
10
+ $ATHENS_GRAY: ' #f4f4f8',
11
+ $BLACK: ' #000000',
12
+ $BRIGHT_GRAY: ' #373c48',
13
+ $CARNATION: ' #fa5556',
14
+ $CHARADE: ' #272a34',
15
+ $DODGER_BLUE: ' #1faff3',
16
+ $EMPEROR: ' #4f4f4f',
17
+ $EBONY: ' #080e18',
18
+ $EBONY_CLAY: ' #272d39',
19
+ $FRENCH_GRAY: ' #bdc1c7',
20
+ $GALLERY_DARK: ' #ebebeb',
21
+ $GALLERY: ' #efefef',
22
+ $GHOST2: ' #c6c9ce',
23
+ $GRAY_CHATEAU: ' #9ea2ab',
24
+ $HALF_AND_HALF: ' #ffffde',
25
+ $MAKO: ' #444a55',
26
+ $MERCURY: ' #e5e5e5',
27
+ $MISCHKA: ' #d1d1d7',
28
+ $NEVADA: ' #686a6c',
29
+ $NOBEL: ' #b6b6b6',
30
+ $OSLO_GRAY: ' #888c92',
31
+ $OXFORD_BLUE: ' #3a4356',
32
+ $PALE_CANERY: ' #ffff9c',
33
+ $PALE_SKY: ' #6e7785',
34
+ $PORCELAIN: 'rgba(165, 168, 173, 0.25)',
35
+ $PROCELAIN_GRAY: ' #e7e8ea',
36
+ $POWDER_BLUE: ' #b1e4d7',
37
+ $REGENT_GREY: ' #7f899c',
38
+ $SEASHELL: ' #f1f1f1',
39
+ $SELECTIVE_YELLOW: ' #fbbc04',
40
+ $SELECTIVE_YELLOW2: ' #f2b900',
41
+ $SHARK: ' #23252d',
42
+ $SHUTTLE_GRAY_DARK: ' #5b6372',
43
+ $SHUTTLE_GRAY: ' #5c6372',
44
+ $SILVER: ' #bbbbbb',
45
+ $SILVER2: ' #c5c5c5',
46
+ $SILVER_CHALICE: ' #acacac',
47
+ $SUPERNOVA_YELLOW: ' #ffcb05',
48
+ $TURQUOISE: ' #35d7be',
49
+ $TROPICAL_BLUE: ' #c1e1f6',
50
+ $TROUT: ' #515866',
51
+ $WILD_SAND: ' #f5f5f5',
52
+ $WISTFUL: ' #a4a4d5',
53
+ $WHITE: ' #ffffff',
54
+ $GHOST: ' #c7c9d5',
55
+ $SCIENCE_BLUE: ' #0065e3',
56
+ $ALABASTER_DARK: '#f7f7f7',
57
+ $EASTERN_BLUE: '#22ab9f',
58
+ $HONEY_FLOWER: '#53206b',
59
+ $MANATEE: '#9898a4',
60
+ $MIRAGE: '#131326',
61
+ $RUM: '#735482',
62
+ $STORM_GRAY: '#6a6a7c',
63
+ $TUNA: '#363649',
64
+ $MORTAR: '#463a4c',
65
+ $SPARTAN_GRAY: '#e0e1eb',
66
+ $LIGHT_WISTERIA: '#bface1',
67
+ $EAST_SIDE: '#a087cd',
68
+ $MOON_RAKER: '#cbb7ef',
69
+ $DULL_LAVENDAR: '#b297e3',
70
+ };
71
+
72
+ const siColors = {
73
+ StTextColors: {
74
+ active: 'rgba(38, 46, 61, 1)',
75
+ content: 'rgba(38, 46, 61, 0.8)',
76
+ secondary: 'rgba(38, 46, 61, 0.55)',
77
+ link: 'rgba(54, 163, 217, 1)',
78
+ accented: 'rgba(12, 14, 18, 1)',
79
+ disabled: 'rgba(38, 46, 61, 0.3)',
80
+ },
81
+ StTextColorsDark: {
82
+ active: 'rgba(235, 239, 247, 1)',
83
+ content: 'rgba(235, 239, 247, 0.8)',
84
+ secondary: 'rgba(235, 239, 247, 0.55)',
85
+ disabled: 'rgba(235, 239, 247, 0.3)',
86
+ accented: 'rgba(255, 255, 255, 1)',
87
+ },
88
+ StUiColors: {
89
+ default: 'rgba(38, 46, 61, 0.67)',
90
+ additional: 'rgba(38, 46, 61, 0.4)',
91
+ guiding: 'rgba(38, 46, 61, 0.1)',
92
+ },
93
+ StUiColorsDark: {
94
+ default: 'rgba(235, 239, 247, 0.67)',
95
+ additional: 'rgba(235, 239, 247, 0.35)',
96
+ guiding: 'rgba(235, 239, 247, 0.17)',
97
+ },
98
+ StBackgroundColors: {
99
+ workspace: '#FFFFFF',
100
+ supporting: '#F9F9FB',
101
+ priority: '#F4F4F8',
102
+ themeAgnostic: 'rgba(174, 174, 180, 0.3)',
103
+ },
104
+ StBackgroundColorsDark: {
105
+ workspace: 'rgba(20, 21, 23, 1)',
106
+ supporting: 'rgba(10, 10, 11, 1)',
107
+ priority: 'rgba(9, 9, 10, 1)',
108
+ },
109
+ StPrimaryColors: {
110
+ primary: '#FFC805',
111
+ },
112
+ StInteractionColors: {
113
+ defaultHover: 'rgba(12, 14, 18, 0.07)',
114
+ guidingHover: 'rgba(38, 46, 61, 0.17)',
115
+ linkHovered: 'rgba(50, 147, 197, 1)',
116
+ primaryHovered: 'rgba(242, 185, 0, 1)',
117
+ },
118
+ StInteractionColorsDark: {
119
+ defaultHover: 'rgba(255, 255, 255, 0.15)',
120
+ guidingHover: 'rgba(235, 239, 247, 0.17)',
121
+ linkHovered: 'rgba(54, 163, 217, 1)',
122
+ },
123
+ StSemanticColors: {
124
+ info: 'rgba(52, 150, 200, 1)',
125
+ success: 'rgba(34, 195, 195, 1)',
126
+ warning: 'rgba(242, 185, 0, 1)',
127
+ error: 'rgba(231, 71, 39, 1)',
128
+ infoBG: 'rgba(52, 150, 200, 0.1)',
129
+ successBG: 'rgba(34, 195, 195, 0.1)',
130
+ warningBG: 'rgba(242, 185, 0, 0.1)',
131
+ errorBG: 'rgba(231, 71, 39, 0.1)',
132
+ },
133
+ };
134
+
135
+ const stEffects = {
136
+ Shadows: {
137
+ level1: '0px 1px 2px rgba(9, 9, 10, 0.1), 0px 2px 4px rgba(9, 9, 10, 0.1)',
138
+ level2:
139
+ 'drop-shadow(0px 1px 4px rgba(9, 9, 10, 0.1)) drop-shadow(0px 1px 8px rgba(9, 9, 10, 0.15))',
140
+ },
141
+ };
142
+
143
+ export { siColors, sfColors, stEffects };
@@ -0,0 +1,2 @@
1
+ export { siColors, sfColors, stEffects } from './colors/siColors';
2
+ export type { SisenseTheme } from './types';
@@ -0,0 +1,12 @@
1
+ import { sfColors } from '../colors';
2
+
3
+ export type SisenseTheme = {
4
+ gray: string;
5
+ brand: string;
6
+ faded: string;
7
+ border: string;
8
+ grayText: string;
9
+ shadow: string;
10
+ shadowHover: string;
11
+ sf: typeof sfColors;
12
+ };
@@ -0,0 +1 @@
1
+ export type { SisenseTheme } from './SisenseTheme';
package/tsconfig.lib.json CHANGED
@@ -15,7 +15,8 @@
15
15
  "**/*.spec.jsx",
16
16
  "**/*.test.jsx",
17
17
  "dist",
18
- "node_modules"
18
+ "node_modules",
19
+ "**/*.stories.tsx"
19
20
  ],
20
21
  "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
21
22
  }
package/vite.config.ts CHANGED
@@ -10,7 +10,6 @@ import { configDefaults } from 'vitest/config';
10
10
  import * as fs from 'fs';
11
11
  import { join, resolve, relative } from 'path';
12
12
  import { env } from 'process';
13
- import { c } from 'vite/dist/node/types.d-aGj9QkWt';
14
13
 
15
14
  const THRESHOLD_LINES = parseInt(env.DEV_APP_THRESHOLD_LINES || '70', 10);
16
15
  const THRESHOLD_FUNCTIONS = parseInt(env.DEV_APP_THRESHOLD_FUNCTIONS || '50', 10);
@@ -117,6 +116,24 @@ export default defineConfig(({ mode }) => ({
117
116
  'src/lib/index.ts',
118
117
  'src/lib/**/index.ts',
119
118
  'src/lib/@types/**/*',
119
+ 'src/**/*.stories.tsx',
120
+ '.storybook/**/*',
121
+ 'src/lib/Checkbox/**/*',
122
+ 'src/lib/themes/**/*',
123
+ 'src/lib/DEPRECATED_Toggle/**/*',
124
+ 'src/lib/DEPRECATED_Tooltip/**/*',
125
+ 'src/lib/constants/**/*',
126
+ 'src/lib/Icon/**/*',
127
+ 'src/lib/LazyLoader/**/*',
128
+ 'src/lib/Popover/**/*',
129
+ 'src/lib/RadioButton/**/*',
130
+ 'src/lib/Tooltip/**/*',
131
+ 'src/lib/Typography/**/*',
132
+ 'src/lib/TablePagination/**/*',
133
+ 'src/lib/Menu/**/*',
134
+ '!src/lib/Menu/**/MenuItem/MenuItem.test.tsx',
135
+ 'src/lib/Dropdown/**/*',
136
+ '!src/lib/Dropdown/**/DropdownButtonBody/DropdownButtonBody.test.tsx',
120
137
  ],
121
138
  },
122
139
  },