@paygreen/pgui 2.1.0 → 2.1.1

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.
@@ -1,6 +1,12 @@
1
1
  import React, { FC } from 'react';
2
2
  import { AccordionProps, FlexProps } from '@chakra-ui/react';
3
- export declare const DataListContext: React.Context<any>;
3
+ declare type DataListColumns = Record<string, DataListCellProps>;
4
+ declare type DataListContextValue = {
5
+ setColumns: React.Dispatch<React.SetStateAction<DataListColumns>>;
6
+ columns: DataListColumns;
7
+ isHover: boolean;
8
+ };
9
+ export declare const DataListContext: React.Context<DataListContextValue>;
4
10
  export declare const DataListHeaderContext: React.Context<boolean>;
5
11
  export declare type DataListCellProps = FlexProps & {
6
12
  colName?: string;
@@ -33,3 +39,4 @@ export declare type DataListProps = AccordionProps & {
33
39
  isHover?: boolean;
34
40
  };
35
41
  export declare const DataList: FC<React.PropsWithChildren<DataListProps>>;
42
+ export {};
@@ -4,7 +4,7 @@ export declare type FormGroupProps = Omit<FormControlProps, 'onChange' | 'defaul
4
4
  children?: ReactNode;
5
5
  errorMessage?: ReactNode;
6
6
  helper?: ReactNode;
7
- id?: string;
7
+ id: string;
8
8
  isRequired?: boolean;
9
9
  label?: ReactNode;
10
10
  showError?: boolean;
package/dist/esm/index.js CHANGED
@@ -2941,13 +2941,11 @@ var ActionsButton = forwardRef(function (_a, ref) {
2941
2941
  });
2942
2942
  ActionsButton.displayName = 'ActionsButton';
2943
2943
 
2944
- // TODO: DataListcontext
2945
- // type DataListContextValue = {
2946
- // setColumns: React.Dispatch<React.SetStateAction<DataListColumns>>;
2947
- // columns: DataListColumns;
2948
- // isHover: boolean;
2949
- // };
2950
- var DataListContext = React.createContext({});
2944
+ var DataListContext = React.createContext({
2945
+ setColumns: function () { },
2946
+ columns: {},
2947
+ isHover: false
2948
+ });
2951
2949
  var DataListHeaderContext = React.createContext(false);
2952
2950
  var DataListCell = function (_a) {
2953
2951
  var _b, _c;
@@ -2965,9 +2963,9 @@ var DataListCell = function (_a) {
2965
2963
  }
2966
2964
  }, [isInHeader, colName, colWidth, isVisible, setColumns]);
2967
2965
  var headerProps = !isInHeader ? (_b = columns === null || columns === void 0 ? void 0 : columns[colName !== null && colName !== void 0 ? colName : '']) !== null && _b !== void 0 ? _b : {} : {};
2968
- var _g = __assign$1(__assign$1({ colWidth: colWidth, isVisible: isVisible }, headerProps), rest), _h = _g.isVisible, _isVisible = _h === void 0 ? true : _h, _j = _g.colWidth, _colWidth = _j === void 0 ? true : _j, cellProps = __rest$1(_g, ["isVisible", "colWidth"]);
2969
- var showCell = useBreakpointValue(typeof _isVisible === 'object' ? _isVisible : { base: _isVisible });
2970
- var cellWidth = (_c = useBreakpointValue(typeof _colWidth === 'object' ? _colWidth : { base: _colWidth })) !== null && _c !== void 0 ? _c : 0;
2966
+ var _g = __assign$1(__assign$1({ colWidth: colWidth, isVisible: isVisible }, headerProps), rest), _h = _g.isVisible, isCellVisible = _h === void 0 ? true : _h, _j = _g.colWidth, columnWidth = _j === void 0 ? true : _j, cellProps = __rest$1(_g, ["isVisible", "colWidth"]);
2967
+ var showCell = useBreakpointValue(typeof isCellVisible === 'object' ? isCellVisible : { base: isCellVisible });
2968
+ var cellWidth = (_c = useBreakpointValue(typeof columnWidth === 'object' ? columnWidth : { base: columnWidth })) !== null && _c !== void 0 ? _c : 0;
2971
2969
  if (!showCell)
2972
2970
  return null;
2973
2971
  var isWidthUnitless = /^[0-9.]+$/.test(String(cellWidth));
@@ -2975,7 +2973,7 @@ var DataListCell = function (_a) {
2975
2973
  };
2976
2974
  var DataListAccordion = function (_a) {
2977
2975
  var rest = __rest$1(_a, []);
2978
- return React.createElement(AccordionItem, __assign$1({ border: "none" }, rest));
2976
+ return (React.createElement(AccordionItem, __assign$1({ border: "none" }, rest)));
2979
2977
  };
2980
2978
  var DataListAccordionButton = function (_a) {
2981
2979
  var rest = __rest$1(_a, []);