@pushwoosh/smart-components-kit 1.0.40 → 1.0.42

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 (75) hide show
  1. package/PlatformsConfigurationDrawer/components/DesktopPage/DesktopPage.js +7 -7
  2. package/PlatformsConfigurationDrawer/components/MainPage/MainPage.js +6 -6
  3. package/PlatformsConfigurationDrawer/components/MobilePage/MobilePage.js +7 -7
  4. package/PlatformsConfigurationDrawer/styled.js +6 -6
  5. package/Table/assets/box.svg +1 -0
  6. package/Table/assets/error.svg +1 -0
  7. package/Table/assets/notfound.svg +1 -0
  8. package/Table/components/DataTable/DataTable.d.ts +4 -0
  9. package/Table/components/DataTable/DataTable.js +78 -0
  10. package/Table/components/DataTable/index.d.ts +1 -0
  11. package/Table/components/DataTable/index.js +1 -0
  12. package/Table/components/DataTable/types.d.ts +26 -0
  13. package/Table/components/DataTable/types.js +1 -0
  14. package/Table/components/DataTableGetContext/DataTableGetContext.d.ts +4 -0
  15. package/Table/components/DataTableGetContext/DataTableGetContext.js +8 -0
  16. package/Table/components/DataTableGetContext/index.d.ts +1 -0
  17. package/Table/components/DataTableGetContext/index.js +1 -0
  18. package/Table/components/DataTableGetContext/types.d.ts +5 -0
  19. package/Table/components/DataTableGetContext/types.js +1 -0
  20. package/Table/components/DataTableList/DataTableList.d.ts +3 -0
  21. package/Table/components/DataTableList/DataTableList.js +80 -0
  22. package/Table/components/DataTableList/index.d.ts +1 -0
  23. package/Table/components/DataTableList/index.js +1 -0
  24. package/Table/components/DataTableList/types.d.ts +4 -0
  25. package/Table/components/DataTableList/types.js +1 -0
  26. package/Table/components/DataTablePagination/DataTablePagination.d.ts +3 -0
  27. package/Table/components/DataTablePagination/DataTablePagination.js +35 -0
  28. package/Table/components/DataTablePagination/index.d.ts +1 -0
  29. package/Table/components/DataTablePagination/index.js +1 -0
  30. package/Table/components/DataTablePagination/types.d.ts +5 -0
  31. package/Table/components/DataTablePagination/types.js +1 -0
  32. package/Table/components/DataTableSearchInput/DataTableSearchInput.d.ts +3 -0
  33. package/Table/components/DataTableSearchInput/DataTableSearchInput.js +40 -0
  34. package/Table/components/DataTableSearchInput/index.d.ts +1 -0
  35. package/Table/components/DataTableSearchInput/index.js +1 -0
  36. package/Table/components/DataTableSearchInput/types.d.ts +3 -0
  37. package/Table/components/DataTableSearchInput/types.js +1 -0
  38. package/Table/components/DataTableSortableCell/DataTableSortableCell.d.ts +3 -0
  39. package/Table/components/DataTableSortableCell/DataTableSortableCell.js +25 -0
  40. package/Table/components/DataTableSortableCell/index.d.ts +1 -0
  41. package/Table/components/DataTableSortableCell/index.js +1 -0
  42. package/Table/components/DataTableSortableCell/types.d.ts +4 -0
  43. package/Table/components/DataTableSortableCell/types.js +1 -0
  44. package/Table/components/Loading/Loading.d.ts +2 -0
  45. package/Table/components/Loading/Loading.js +20 -0
  46. package/Table/components/Loading/index.d.ts +1 -0
  47. package/Table/components/Loading/index.js +1 -0
  48. package/Table/components/Loading/styles.d.ts +1 -0
  49. package/Table/components/Loading/styles.js +6 -0
  50. package/Table/components/TablePagination/TablePagination.d.ts +3 -0
  51. package/Table/components/TablePagination/TablePagination.js +38 -0
  52. package/Table/components/TablePagination/index.d.ts +1 -0
  53. package/Table/components/TablePagination/index.js +1 -0
  54. package/Table/components/TablePagination/types.d.ts +10 -0
  55. package/Table/components/TablePagination/types.js +1 -0
  56. package/Table/context.d.ts +2 -0
  57. package/Table/context.js +2 -0
  58. package/Table/hooks/helpers.d.ts +2 -0
  59. package/Table/hooks/helpers.js +6 -0
  60. package/Table/hooks/index.d.ts +2 -0
  61. package/Table/hooks/index.js +2 -0
  62. package/Table/hooks/useDataTableContext.d.ts +11 -0
  63. package/Table/hooks/useDataTableContext.js +23 -0
  64. package/Table/hooks/useDataTableGetParams.d.ts +11 -0
  65. package/Table/hooks/useDataTableGetParams.js +53 -0
  66. package/Table/index.d.ts +10 -0
  67. package/Table/index.js +9 -0
  68. package/Table/styles.d.ts +247 -0
  69. package/Table/styles.js +62 -0
  70. package/Table/types.d.ts +20 -0
  71. package/Table/types.js +1 -0
  72. package/context/types.d.ts +5 -2
  73. package/index.d.ts +5 -3
  74. package/index.js +5 -3
  75. package/package.json +8 -10
@@ -0,0 +1,62 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { Color, FontSize, FontWeight, ShapeRadius } from '@pushwoosh/kit-constants';
3
+ import { GridContainer, Horizontal, Vertical, toCssValue } from '@pushwoosh/kit-helpers';
4
+ export const Table = styled(Vertical).withConfig({
5
+ displayName: "Table",
6
+ componentId: "sc-1vdjaze-0"
7
+ })(["--table-columns:", ";border:", ";border-radius:", ";background-color:", ";", " & > *:not(:last-child){border-bottom:1px solid ", ";}"], ({
8
+ columns
9
+ }) => columns, ({
10
+ isBordered
11
+ }) => isBordered ? `1px solid ${Color.DIVIDER}` : 'none', ShapeRadius.SECTION, Color.CLEAR, ({
12
+ width
13
+ }) => width ? `width: ${toCssValue(width)};` : '', Color.DIVIDER);
14
+ export const Td = styled(GridContainer).attrs({
15
+ $padding: 12
16
+ }).withConfig({
17
+ displayName: "Td",
18
+ componentId: "sc-1vdjaze-1"
19
+ })(["", ""], ({
20
+ $color
21
+ }) => $color ? `color: ${$color};` : '');
22
+ export const ElementHover = styled.div.withConfig({
23
+ displayName: "ElementHover",
24
+ componentId: "sc-1vdjaze-2"
25
+ })(["display:none;position:relative;& > *{position:absolute;right:0;transform:translateY(-50%);}"]);
26
+ export const Tr = styled(Horizontal).attrs({
27
+ $padding: '0 12px'
28
+ }).withConfig({
29
+ displayName: "Tr",
30
+ componentId: "sc-1vdjaze-3"
31
+ })(["grid-template-columns:var(--table-columns);&:hover{background-color:#89A4BF0D;}&:hover ", "{display:block;}"], ElementHover);
32
+ export const Th = styled(Td).withConfig({
33
+ displayName: "Th",
34
+ componentId: "sc-1vdjaze-4"
35
+ })(["padding:8px 12px;color:#969ca3;font-weight:", ";font-size:", ";line-height:1;text-transform:uppercase;"], FontWeight.MEDIUM, FontSize.SMALL);
36
+ export const ItemDetailLink = styled.a.withConfig({
37
+ displayName: "ItemDetailLink",
38
+ componentId: "sc-1vdjaze-5"
39
+ })(["display:flex;align-items:center;text-decoration:none;font-weight:", ";color:", ";width:100%;&:hover{text-decoration:none;color:", ";}"], FontWeight.MEDIUM, Color.MAIN, Color.PRIMARY_HOVER);
40
+ export const ItemName = styled.div.withConfig({
41
+ displayName: "ItemName",
42
+ componentId: "sc-1vdjaze-6"
43
+ })(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
44
+ const overflowStyles = css(["overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:", ";"], ({
45
+ $maxLines
46
+ }) => $maxLines);
47
+ export const Description = styled.div.withConfig({
48
+ displayName: "Description",
49
+ componentId: "sc-1vdjaze-7"
50
+ })(["color:", ";font-size:", ";font-style:normal;font-weight:", ";line-height:130%;", ""], Color.LOCKED, FontSize.SMALL, FontWeight.REGULAR, ({
51
+ $maxLines
52
+ }) => $maxLines ? overflowStyles : undefined);
53
+ export const LockedText = styled.div.withConfig({
54
+ displayName: "LockedText",
55
+ componentId: "sc-1vdjaze-8"
56
+ })(["color:", ";font-size:", ";font-weight:", ";max-width:", ";"], Color.LOCKED, ({
57
+ $fontSize
58
+ }) => $fontSize || FontSize.REGULAR, ({
59
+ $fontWeight
60
+ }) => $fontWeight || FontWeight.REGULAR, ({
61
+ $maxWidth
62
+ }) => $maxWidth || 'initial');
@@ -0,0 +1,20 @@
1
+ import type { AsyncState } from '@pushwoosh/kit-helpers/hooks/useAsyncFn';
2
+ export type DataTableParams = {
3
+ readonly search: string;
4
+ readonly order: string;
5
+ readonly direction: 'asc' | 'desc';
6
+ readonly page: number;
7
+ readonly perPage: number;
8
+ };
9
+ export type DataTableData<T> = {
10
+ items: T[];
11
+ total?: number;
12
+ totalPages: number;
13
+ isFiltered?: boolean;
14
+ };
15
+ export type DataTableContextType<T, P extends DataTableParams> = {
16
+ data: AsyncState<DataTableData<T>>;
17
+ reload: () => void;
18
+ params: P;
19
+ onChangeParams: (params: P) => void;
20
+ };
package/Table/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,4 @@
1
1
  import { type History } from 'history';
2
- import type { GrpcBridge } from '@pushwoosh/grpc-bridge';
3
2
  import type { GrpcClient, HttpClient, RpcClient } from '@pushwoosh/http-client';
4
3
  import type { API as RpcGatewayJourneyAPI } from '@pushwoosh/rpc-gateway-journey-data';
5
4
  import type { API as RpcGatewayAPI } from '@pushwoosh/rpc-v2-http-api-data';
@@ -9,7 +8,11 @@ export type SPAContextType = {
9
8
  readonly httpClient: HttpClient;
10
9
  readonly rpcClient: RpcClient;
11
10
  readonly grpcClient: GrpcClient;
12
- readonly grpcBridge: GrpcBridge;
11
+ readonly grpcBridge: {
12
+ clients: {
13
+ billingGrpcClient: GrpcClient;
14
+ };
15
+ };
13
16
  readonly sessionStore: SessionStore;
14
17
  readonly rpcGateway: RpcGatewayAPI;
15
18
  readonly rpcGatewayJourney: RpcGatewayJourneyAPI;
package/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
- export * from './EmailTemplatePreview';
2
1
  export * from './context';
2
+ export * from './hooks';
3
+ export * from './CampaignsConfigurationDrawer';
3
4
  export * from './DynamicContentPicker';
4
5
  export * from './DynamicContentPickerForm';
6
+ export * from './EmailTemplatePreview';
7
+ export * from './ExportCSV';
5
8
  export * from './PlatformsConfigurationDrawer';
6
9
  export * from './LanguagesSelector';
7
10
  export * from './RichMessageEditorSmart';
8
- export * from './CampaignsConfigurationDrawer';
9
- export * from './ExportCSV';
11
+ export * from './Table';
10
12
  export * from './OpenActions';
package/index.js CHANGED
@@ -1,10 +1,12 @@
1
- export * from './EmailTemplatePreview';
2
1
  export * from './context';
2
+ export * from './hooks';
3
+ export * from './CampaignsConfigurationDrawer';
3
4
  export * from './DynamicContentPicker';
4
5
  export * from './DynamicContentPickerForm';
6
+ export * from './EmailTemplatePreview';
7
+ export * from './ExportCSV';
5
8
  export * from './PlatformsConfigurationDrawer';
6
9
  export * from './LanguagesSelector';
7
10
  export * from './RichMessageEditorSmart';
8
- export * from './CampaignsConfigurationDrawer';
9
- export * from './ExportCSV';
11
+ export * from './Table';
10
12
  export * from './OpenActions';
package/package.json CHANGED
@@ -10,37 +10,35 @@
10
10
  "build": "pushwoosh-engine lib:build",
11
11
  "playground": "`pushwoosh-engine lib:command:playground`",
12
12
  "check": "npm run check:lint && npm run check:types",
13
- "check:lint": "echo \"Run check:lint\" && NODE_ENV=production eslint ./src",
13
+ "check:lint": "echo \"Run check:lint\" && NODE_ENV=production eslint src",
14
14
  "check:lint-fix": "echo \"Run check:lint\" && NODE_ENV=production eslint . --fix",
15
- "check:types": "echo \"Run check:types\" && tsc --project tsconfig.json --skipLibCheck --emitDeclarationOnly false --noEmit"
15
+ "check:types": "echo \"Run check:types\" && pushwoosh-engine lib:check-types"
16
16
  },
17
17
  "pre-commit": "check",
18
18
  "dependencies": {
19
- "@emoji-mart/react": "^1.1.1",
20
19
  "@floating-ui/react-dom": "^2.1.2",
21
- "@pushwoosh/dumb-components": "^1.1.2",
20
+ "@pushwoosh/dumb-components": "^1.1.27",
22
21
  "@pushwoosh/kit-constants": "^1.6.9",
23
22
  "@pushwoosh/kit-helpers": "^4.8.1",
24
23
  "@pushwoosh/kit-icons": "^2.1.6",
25
24
  "@pushwoosh/kit-typography": "^1.7.3"
26
25
  },
27
26
  "devDependencies": {
28
- "@pushwoosh/frontend-builder-engine": "^1.0.17",
29
- "@pushwoosh/grpc-bridge": "^1.5.36",
27
+ "@pushwoosh/frontend-builder-engine": "^1.0.18",
30
28
  "@pushwoosh/http-client": "^2.5.0",
31
29
  "@pushwoosh/session-store": "^2.5.0",
30
+ "@svgr/webpack": "^8.1.0",
32
31
  "@types/react": "^18.3.5",
33
32
  "@types/react-dom": "^18.3.0",
34
33
  "@types/react-router-dom": "^5.3.3",
35
34
  "@types/styled-components": "^5.1.34",
35
+ "pre-commit": "^1.2.2",
36
36
  "react": "^18.3.1",
37
37
  "react-dom": "^18.3.1",
38
38
  "react-router-dom": "^5.3.4",
39
- "styled-components": "^5.3.11",
40
- "typescript": "^5.8.2"
39
+ "styled-components": "^5.3.11"
41
40
  },
42
41
  "peerDependencies": {
43
- "@pushwoosh/grpc-bridge": "^1.5.36",
44
42
  "@pushwoosh/http-client": "^2.5.0",
45
43
  "@pushwoosh/rpc-gateway-journey-data": "^0.26.206",
46
44
  "@pushwoosh/rpc-v2-http-api-data": "^0.1.566",
@@ -51,5 +49,5 @@
51
49
  "engines": {
52
50
  "node": ">= 18"
53
51
  },
54
- "version": "1.0.40"
52
+ "version": "1.0.42"
55
53
  }