@pushwoosh/dumb-components 1.0.5 → 1.0.7
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.
- package/DropdownMenu/components/DropdownMenuItem/index.d.ts +1 -0
- package/DropdownMenu/index.d.ts +1 -1
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +5 -2
- package/Select/Select.d.ts +6 -0
- package/Select/Select.js +39 -0
- package/Select/constants.d.ts +1 -0
- package/Select/constants.js +1 -0
- package/Select/index.d.ts +3 -0
- package/Select/index.js +2 -0
- package/Select/styles.d.ts +6 -0
- package/Select/styles.js +31 -0
- package/Select/types.d.ts +15 -0
- package/Select/types.js +1 -0
- package/Table/assets/box.svg +1 -0
- package/Table/assets/error.svg +1 -0
- package/Table/assets/notfound.svg +1 -0
- package/Table/components/ClearableInput/ClearableInput.d.ts +3 -0
- package/Table/components/ClearableInput/ClearableInput.js +20 -0
- package/Table/components/ClearableInput/index.d.ts +1 -0
- package/Table/components/ClearableInput/index.js +1 -0
- package/Table/components/ClearableInput/styles.d.ts +14 -0
- package/Table/components/ClearableInput/styles.js +10 -0
- package/Table/components/ClearableInput/types.d.ts +5 -0
- package/Table/components/ClearableInput/types.js +1 -0
- package/Table/components/DataTable/DataTable.d.ts +4 -0
- package/Table/components/DataTable/DataTable.js +74 -0
- package/Table/components/DataTable/index.d.ts +1 -0
- package/Table/components/DataTable/index.js +1 -0
- package/Table/components/DataTable/types.d.ts +22 -0
- package/Table/components/DataTable/types.js +1 -0
- package/Table/components/DataTableGetContext/DataTableGetContext.d.ts +4 -0
- package/Table/components/DataTableGetContext/DataTableGetContext.js +8 -0
- package/Table/components/DataTableGetContext/index.d.ts +1 -0
- package/Table/components/DataTableGetContext/index.js +1 -0
- package/Table/components/DataTableGetContext/types.d.ts +5 -0
- package/Table/components/DataTableGetContext/types.js +1 -0
- package/Table/components/DataTableList/DataTableList.d.ts +3 -0
- package/Table/components/DataTableList/DataTableList.js +77 -0
- package/Table/components/DataTableList/index.d.ts +1 -0
- package/Table/components/DataTableList/index.js +1 -0
- package/Table/components/DataTableList/types.d.ts +4 -0
- package/Table/components/DataTableList/types.js +1 -0
- package/Table/components/DataTablePagination/DataTablePagination.d.ts +3 -0
- package/Table/components/DataTablePagination/DataTablePagination.js +33 -0
- package/Table/components/DataTablePagination/index.d.ts +1 -0
- package/Table/components/DataTablePagination/index.js +1 -0
- package/Table/components/DataTablePagination/types.d.ts +4 -0
- package/Table/components/DataTablePagination/types.js +1 -0
- package/Table/components/DataTableSearchInput/DataTableSearchInput.d.ts +3 -0
- package/Table/components/DataTableSearchInput/DataTableSearchInput.js +31 -0
- package/Table/components/DataTableSearchInput/index.d.ts +1 -0
- package/Table/components/DataTableSearchInput/index.js +1 -0
- package/Table/components/DataTableSearchInput/types.d.ts +3 -0
- package/Table/components/DataTableSearchInput/types.js +1 -0
- package/Table/components/DataTableSortableCell/DataTableSortableCell.d.ts +3 -0
- package/Table/components/DataTableSortableCell/DataTableSortableCell.js +25 -0
- package/Table/components/DataTableSortableCell/index.d.ts +1 -0
- package/Table/components/DataTableSortableCell/index.js +1 -0
- package/Table/components/DataTableSortableCell/types.d.ts +4 -0
- package/Table/components/DataTableSortableCell/types.js +1 -0
- package/Table/components/Loading/Loading.d.ts +2 -0
- package/Table/components/Loading/Loading.js +20 -0
- package/Table/components/Loading/index.d.ts +1 -0
- package/Table/components/Loading/index.js +1 -0
- package/Table/components/Loading/styles.d.ts +1 -0
- package/Table/components/Loading/styles.js +6 -0
- package/Table/components/TableList/TableList.d.ts +3 -0
- package/Table/components/TableList/TableList.js +15 -0
- package/Table/components/TableList/index.d.ts +1 -0
- package/Table/components/TableList/index.js +1 -0
- package/Table/components/TableList/types.d.ts +9 -0
- package/Table/components/TableList/types.js +1 -0
- package/Table/components/TablePagination/TablePagination.d.ts +3 -0
- package/Table/components/TablePagination/TablePagination.js +38 -0
- package/Table/components/TablePagination/index.d.ts +1 -0
- package/Table/components/TablePagination/index.js +1 -0
- package/Table/components/TablePagination/types.d.ts +9 -0
- package/Table/components/TablePagination/types.js +1 -0
- package/Table/context.d.ts +2 -0
- package/Table/context.js +2 -0
- package/Table/hooks/index.d.ts +2 -0
- package/Table/hooks/index.js +2 -0
- package/Table/hooks/useDataTableContext.d.ts +11 -0
- package/Table/hooks/useDataTableContext.js +23 -0
- package/Table/hooks/useDataTableParams.d.ts +10 -0
- package/Table/hooks/useDataTableParams.js +39 -0
- package/Table/index.d.ts +13 -0
- package/Table/index.js +12 -0
- package/Table/styles.d.ts +73 -0
- package/Table/styles.js +60 -0
- package/Table/types.d.ts +20 -0
- package/Table/types.js +1 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +14 -12
package/Table/styles.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
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-1kwcslm-0"
|
|
7
|
+
})(["--table-columns:", ";border:1px solid ", ";border-radius:", ";background-color:", ";", " & > *:not(:last-child){border-bottom:1px solid ", ";}"], ({
|
|
8
|
+
columns
|
|
9
|
+
}) => columns, Color.DIVIDER, ShapeRadius.SECTION, Color.CLEAR, ({
|
|
10
|
+
width
|
|
11
|
+
}) => width ? `width: ${toCssValue(width)};` : '', Color.DIVIDER);
|
|
12
|
+
export const Td = styled(GridContainer).attrs({
|
|
13
|
+
$padding: 12
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "Td",
|
|
16
|
+
componentId: "sc-1kwcslm-1"
|
|
17
|
+
})(["", ""], ({
|
|
18
|
+
$color
|
|
19
|
+
}) => $color ? `color: ${$color};` : '');
|
|
20
|
+
export const ElementHover = styled.div.withConfig({
|
|
21
|
+
displayName: "ElementHover",
|
|
22
|
+
componentId: "sc-1kwcslm-2"
|
|
23
|
+
})(["display:none;position:relative;& > *{position:absolute;right:0;transform:translateY(-50%);}"]);
|
|
24
|
+
export const Tr = styled(Horizontal).attrs({
|
|
25
|
+
$padding: '0 12px'
|
|
26
|
+
}).withConfig({
|
|
27
|
+
displayName: "Tr",
|
|
28
|
+
componentId: "sc-1kwcslm-3"
|
|
29
|
+
})(["grid-template-columns:var(--table-columns);&:hover{background-color:#89A4BF0D;}&:hover ", "{display:block;}"], ElementHover);
|
|
30
|
+
export const Th = styled(Td).withConfig({
|
|
31
|
+
displayName: "Th",
|
|
32
|
+
componentId: "sc-1kwcslm-4"
|
|
33
|
+
})(["padding:8px 12px;color:#969ca3;font-weight:", ";font-size:", ";line-height:1;text-transform:uppercase;"], FontWeight.MEDIUM, FontSize.SMALL);
|
|
34
|
+
export const ItemDetailLink = styled.a.withConfig({
|
|
35
|
+
displayName: "ItemDetailLink",
|
|
36
|
+
componentId: "sc-1kwcslm-5"
|
|
37
|
+
})(["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);
|
|
38
|
+
export const ItemName = styled.div.withConfig({
|
|
39
|
+
displayName: "ItemName",
|
|
40
|
+
componentId: "sc-1kwcslm-6"
|
|
41
|
+
})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
42
|
+
const overflowStyles = css(["overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:", ";"], ({
|
|
43
|
+
$maxLines
|
|
44
|
+
}) => $maxLines);
|
|
45
|
+
export const Description = styled.div.withConfig({
|
|
46
|
+
displayName: "Description",
|
|
47
|
+
componentId: "sc-1kwcslm-7"
|
|
48
|
+
})(["color:", ";font-size:", ";font-style:normal;font-weight:", ";line-height:130%;", ""], Color.LOCKED, FontSize.SMALL, FontWeight.REGULAR, ({
|
|
49
|
+
$maxLines
|
|
50
|
+
}) => $maxLines ? overflowStyles : undefined);
|
|
51
|
+
export const LockedText = styled.div.withConfig({
|
|
52
|
+
displayName: "LockedText",
|
|
53
|
+
componentId: "sc-1kwcslm-8"
|
|
54
|
+
})(["color:", ";font-size:", ";font-weight:", ";max-width:", ";"], Color.LOCKED, ({
|
|
55
|
+
$fontSize
|
|
56
|
+
}) => $fontSize || FontSize.REGULAR, ({
|
|
57
|
+
$fontWeight
|
|
58
|
+
}) => $fontWeight || FontWeight.REGULAR, ({
|
|
59
|
+
$maxWidth
|
|
60
|
+
}) => $maxWidth || 'initial');
|
package/Table/types.d.ts
ADDED
|
@@ -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 {};
|
package/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { Radio } from './Radio';
|
|
|
16
16
|
export { ReCaptcha, useRecaptcha, asyncScriptLoad } from './ReCaptcha';
|
|
17
17
|
export { Spinner } from './Spinner';
|
|
18
18
|
export { SortButton } from './SortButton';
|
|
19
|
+
export { Select, SelectAsync, CreatableSelect, CLASS_NAME_PREFIX, type SelectBase, type MultiSelectOptions, } from './Select';
|
|
19
20
|
export { Switch } from './Switch';
|
|
20
21
|
export { TextSkeleton, RectangularSkeleton, CircularSkeleton } from './Skeleton';
|
|
21
22
|
export { Tooltip, type TooltipPosition } from './Tooltip';
|
|
@@ -25,6 +26,7 @@ export { StatisticCard } from './StatisticCard';
|
|
|
25
26
|
export { EmailTemplatePreview, NoEmailTemplatePreview } from './EmailTemplatePreview';
|
|
26
27
|
export { PushPreview } from './PushPreview';
|
|
27
28
|
export { Toast, ToastProvider, useToast } from './Toast';
|
|
29
|
+
export { ClearableInput, DataTable, DataTableList, DataTableGetContext, DataTablePagination, DataTableSearchInput, DataTableSortableCell, Loading, TableList, TablePagination, useDataTableContext, useDataTableParams, Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description, type DataTableParams, type DataTableData, type DataTableContextType, } from './Table';
|
|
28
30
|
export { AutosizeInput, PageHeader, PageHeaderEditable } from './PageHeader';
|
|
29
31
|
export { ExportResult } from './ExportResult';
|
|
30
32
|
export { NativeInput, NativeTextarea, NativeSelect } from './native';
|
package/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export { Radio } from './Radio';
|
|
|
16
16
|
export { ReCaptcha, useRecaptcha, asyncScriptLoad } from './ReCaptcha';
|
|
17
17
|
export { Spinner } from './Spinner';
|
|
18
18
|
export { SortButton } from './SortButton';
|
|
19
|
+
export { Select, SelectAsync, CreatableSelect, CLASS_NAME_PREFIX } from './Select';
|
|
19
20
|
export { Switch } from './Switch';
|
|
20
21
|
export { TextSkeleton, RectangularSkeleton, CircularSkeleton } from './Skeleton';
|
|
21
22
|
export { Tooltip } from './Tooltip';
|
|
@@ -25,6 +26,7 @@ export { StatisticCard } from './StatisticCard';
|
|
|
25
26
|
export { EmailTemplatePreview, NoEmailTemplatePreview } from './EmailTemplatePreview';
|
|
26
27
|
export { PushPreview } from './PushPreview';
|
|
27
28
|
export { Toast, ToastProvider, useToast } from './Toast';
|
|
29
|
+
export { ClearableInput, DataTable, DataTableList, DataTableGetContext, DataTablePagination, DataTableSearchInput, DataTableSortableCell, Loading, TableList, TablePagination, useDataTableContext, useDataTableParams, Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description } from './Table';
|
|
28
30
|
export { AutosizeInput, PageHeader, PageHeaderEditable } from './PageHeader';
|
|
29
31
|
export { ExportResult } from './ExportResult';
|
|
30
32
|
export { NativeInput, NativeTextarea, NativeSelect } from './native';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushwoosh/dumb-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "React components to build Pushwoosh products",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -15,8 +15,12 @@
|
|
|
15
15
|
"check:types": "echo \"Run check:types\" && pushwoosh-engine lib:check-types"
|
|
16
16
|
},
|
|
17
17
|
"pre-commit": "check",
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">= 18",
|
|
20
|
+
"npm": ">= 7"
|
|
21
|
+
},
|
|
18
22
|
"devDependencies": {
|
|
19
|
-
"@pushwoosh/frontend-builder-engine": "^1.0.
|
|
23
|
+
"@pushwoosh/frontend-builder-engine": "^1.0.15",
|
|
20
24
|
"@pushwoosh/kit-constants": "^1.6.7",
|
|
21
25
|
"@svgr/webpack": "^8.1.0",
|
|
22
26
|
"@types/lodash": "^4.17.13",
|
|
@@ -24,21 +28,12 @@
|
|
|
24
28
|
"@types/react-dom": "^18.2.22",
|
|
25
29
|
"@types/react-transition-group": "^4.4.12",
|
|
26
30
|
"@types/styled-components": "^5.1.34",
|
|
31
|
+
"@types/react-router-dom": "^5.3.3",
|
|
27
32
|
"pre-commit": "^1.2.2",
|
|
28
33
|
"react": "^18.2.0",
|
|
29
34
|
"react-dom": "^18.2.0",
|
|
30
|
-
"react-router-dom": "^6.22.3",
|
|
31
35
|
"styled-components": "^5.3.11"
|
|
32
36
|
},
|
|
33
|
-
"peerDependencies": {
|
|
34
|
-
"@pushwoosh/kit-constants": "^1.6.0",
|
|
35
|
-
"react": ">= 16.14.0",
|
|
36
|
-
"styled-components": "^5.3.3 || ^6.0.0"
|
|
37
|
-
},
|
|
38
|
-
"engines": {
|
|
39
|
-
"node": ">= 18",
|
|
40
|
-
"npm": ">= 7"
|
|
41
|
-
},
|
|
42
37
|
"dependencies": {
|
|
43
38
|
"@pushwoosh/kit-helpers": "^4.6.2",
|
|
44
39
|
"@pushwoosh/kit-icons": "^2.1.1",
|
|
@@ -47,6 +42,13 @@
|
|
|
47
42
|
"liquidjs": "^10.18.0",
|
|
48
43
|
"lodash": "^4.17.21",
|
|
49
44
|
"polished": "^4.3.1",
|
|
45
|
+
"react-select": "^5.10.0",
|
|
50
46
|
"react-transition-group": "^4.4.5"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@pushwoosh/kit-constants": "^1.6.0",
|
|
50
|
+
"react": ">= 16.14.0",
|
|
51
|
+
"react-router-dom": "^5.3.4",
|
|
52
|
+
"styled-components": "^5.3.3 || ^6.0.0"
|
|
51
53
|
}
|
|
52
54
|
}
|