@pushwoosh/dumb-components 1.1.3 → 1.1.5

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.
@@ -9,6 +9,7 @@ export function ModalConfirm(props) {
9
9
  const {
10
10
  isOpen,
11
11
  title = 'Confirm action',
12
+ size = 'small',
12
13
  description = '',
13
14
  confirmButtonText = 'Confirm',
14
15
  cancelButtonText = 'Cancel',
@@ -32,7 +33,7 @@ export function ModalConfirm(props) {
32
33
  }
33
34
  }, [callback, onAccept]);
34
35
  return React.createElement(Modal, {
35
- size: "small",
36
+ size: size,
36
37
  isOpen: isOpen,
37
38
  onClose: onCancel
38
39
  }, React.createElement(ModalHeader, null, React.createElement(Vertical, {
@@ -1,8 +1,11 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type modalSizes } from '../Modal/maps';
1
3
  export type ConfirmButtonColor = 'primary' | 'secondary' | 'danger';
2
4
  export interface ModalConfirmProps {
3
5
  isOpen: boolean;
4
6
  title: string;
5
- description?: string;
7
+ size?: keyof typeof modalSizes;
8
+ description?: ReactNode;
6
9
  confirmButtonText?: string;
7
10
  confirmButtonColor?: ConfirmButtonColor;
8
11
  cancelButtonText?: string;
@@ -14,6 +14,7 @@ export function DataTable(props) {
14
14
  const {
15
15
  columns,
16
16
  width,
17
+ isBordered = true,
17
18
  context,
18
19
  renderTableTop,
19
20
  renderAfter,
@@ -28,7 +29,8 @@ export function DataTable(props) {
28
29
  value: context
29
30
  }, React.createElement(Table, {
30
31
  columns: columns,
31
- width: width
32
+ width: width,
33
+ isBordered: isBordered
32
34
  }, renderTableTop === null || renderTableTop === void 0 ? void 0 : renderTableTop(context), 'renderHead' in props && props.renderHead(), 'renderList' in props ? props.renderList(context) : React.createElement(DataTableList, {
33
35
  renderItem: props.renderItem
34
36
  }), !hidePagination && React.createElement(DataTablePagination, {
@@ -3,6 +3,7 @@ import type { DataTableParams, DataTableContextType } from '../../types';
3
3
  export type DataTableListProps<I, P extends DataTableParams> = {
4
4
  columns: string;
5
5
  width?: string | number;
6
+ isBordered?: boolean;
6
7
  context: DataTableContextType<I, P>;
7
8
  hidePagination?: boolean;
8
9
  renderTableTop?: (ctxValue: DataTableContextType<I, P>) => ReactNode;
@@ -12,6 +13,7 @@ export type DataTableListProps<I, P extends DataTableParams> = {
12
13
  export type DataTableItemProps<I, P extends DataTableParams> = {
13
14
  columns: string;
14
15
  width?: string | number;
16
+ isBordered?: boolean;
15
17
  context: DataTableContextType<I, P>;
16
18
  hidePagination?: boolean;
17
19
  renderTableTop?: (ctxValue: DataTableContextType<I, P>) => ReactNode;
package/Table/styles.d.ts CHANGED
@@ -2,6 +2,7 @@ import { FontSize, FontWeight } from '@pushwoosh/kit-constants';
2
2
  export type TableProps = {
3
3
  columns: string;
4
4
  width?: string | number;
5
+ isBordered?: boolean;
5
6
  };
6
7
  export declare const Table: import("styled-components").StyledComponent<"div", any, {
7
8
  $alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
package/Table/styles.js CHANGED
@@ -4,9 +4,11 @@ import { GridContainer, Horizontal, Vertical, toCssValue } from '@pushwoosh/kit-
4
4
  export const Table = styled(Vertical).withConfig({
5
5
  displayName: "Table",
6
6
  componentId: "sc-1kwcslm-0"
7
- })(["--table-columns:", ";border:1px solid ", ";border-radius:", ";background-color:", ";", " & > *:not(:last-child){border-bottom:1px solid ", ";}"], ({
7
+ })(["--table-columns:", ";border:", ";border-radius:", ";background-color:", ";", " & > *:not(:last-child){border-bottom:1px solid ", ";}"], ({
8
8
  columns
9
- }) => columns, Color.DIVIDER, ShapeRadius.SECTION, Color.CLEAR, ({
9
+ }) => columns, ({
10
+ isBordered
11
+ }) => isBordered ? `1px solid ${Color.DIVIDER}` : 'none', ShapeRadius.SECTION, Color.CLEAR, ({
10
12
  width
11
13
  }) => width ? `width: ${toCssValue(width)};` : '', Color.DIVIDER);
12
14
  export const Td = styled(GridContainer).attrs({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",