@wonderflow/react-components 10.0.0 → 10.1.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.
@@ -1 +1 @@
1
- .OverlayContainer{bottom:0;display:block;left:0;position:fixed;right:0;top:0}.OverlayContainer[data-overlay-container-obfuscate=false]{pointer-events:none}.Backdrop{background-color:var(--dimmed-0);bottom:0;left:0;position:fixed;right:0;top:0;z-index:-1}.Backdrop[data-overlay-color=light]{background-color:#f9fafb}.Backdrop[data-overlay-color=dark]{background-color:#202328}
1
+ .OverlayContainer{bottom:0;display:block;left:0;position:fixed;right:0;top:0}.OverlayContainer[data-overlay-container-obfuscate=false]{pointer-events:none}.OverlayContainer[data-overlay-container-obfuscate=false]>*{pointer-events:auto}.Backdrop{background-color:var(--dimmed-0);bottom:0;left:0;position:fixed;right:0;top:0;z-index:-1}.Backdrop[data-overlay-color=light]{background-color:#f9fafb}.Backdrop[data-overlay-color=dark]{background-color:#202328}
@@ -1,4 +1,3 @@
1
1
  export type { PopoverProps } from './popover';
2
- export { Popover as Dropdown } from './popover';
3
2
  export { Popover } from './popover';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popover/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popover/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -1,2 +1 @@
1
- export { Popover as Dropdown } from './popover';
2
1
  export { Popover } from './popover';
@@ -1,5 +1,5 @@
1
1
  import { ComponentType, ReactNode } from 'react';
2
- import { IdType, SortingRule } from 'react-table';
2
+ import { IdType, Row, SortingRule } from 'react-table';
3
3
  import { TableHeaderProps } from './table-header';
4
4
  import { TablePaginationProps } from './table-pagination';
5
5
  import { CustomColumnsType, CustomSortingRule, OptionalDataTypes, PaginationPageType } from './types';
@@ -131,6 +131,10 @@ export declare type TableProps<T extends Record<string, unknown>> = PropsWithCla
131
131
  * Callback run when a column is sorted
132
132
  */
133
133
  onSortChange?: (sorting: Array<CustomSortingRule<T>>) => void;
134
+ /**
135
+ * Callback run on row expansion. Returns the expanded row data.
136
+ */
137
+ onRowExpandChange?: (row: Row<T>) => void;
134
138
  };
135
- export declare const Table: <T extends Record<string, unknown>>({ className, style, columns, data, selectableRows, selectedRowIds, onSelectedRowsChange, stripes, showSeparators, title, actions, selectedActions, selectedLabel, showHeader, showTableHead, columnsControl, defaultHiddenColumns, height, loading, background, expandableRowComponent, emptyComponent, showPagination, isManualSorted, itemsPerPage, totalRows, initialPageIndex, onPaginationChange, onSortChange, pageClusters, initialSortBy, ...otherProps }: TableProps<T>) => JSX.Element;
139
+ export declare const Table: <T extends Record<string, unknown>>({ className, style, columns, data, selectableRows, selectedRowIds, onSelectedRowsChange, stripes, showSeparators, title, actions, selectedActions, selectedLabel, showHeader, showTableHead, columnsControl, defaultHiddenColumns, height, loading, background, expandableRowComponent, emptyComponent, showPagination, isManualSorted, itemsPerPage, totalRows, initialPageIndex, onPaginationChange, onSortChange, pageClusters, initialSortBy, onRowExpandChange, ...otherProps }: TableProps<T>) => JSX.Element;
136
140
  //# sourceMappingURL=table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,EAA2B,SAAS,EAClD,MAAM,OAAO,CAAC;AACf,OAAO,EACE,MAAM,EACb,WAAW,EAGZ,MAAM,aAAa,CAAC;AAarB,OAAO,EAAe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GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CAC3C,CAAA;AAED,eAAO,MAAM,KAAK,yhBAwXjB,CAAC"}
@@ -14,7 +14,7 @@ import { TableExpand } from './table-expand';
14
14
  import { TableHeader } from './table-header';
15
15
  import { TablePagination } from './table-pagination';
16
16
  import { TableRow } from './table-row';
17
- export const Table = ({ className, style, columns, data = [], selectableRows, selectedRowIds = [], onSelectedRowsChange, stripes, showSeparators = true, title, actions, selectedActions, selectedLabel = selectedRowIds => `Selected items: ${selectedRowIds.length}`, showHeader = false, showTableHead = true, columnsControl = false, defaultHiddenColumns, height, loading, background, expandableRowComponent, emptyComponent, showPagination, isManualSorted, itemsPerPage = 10, totalRows, initialPageIndex = 0, onPaginationChange, onSortChange, pageClusters, initialSortBy = [], ...otherProps }) => {
17
+ export const Table = ({ className, style, columns, data = [], selectableRows, selectedRowIds = [], onSelectedRowsChange, stripes, showSeparators = true, title, actions, selectedActions, selectedLabel = selectedRowIds => `Selected items: ${selectedRowIds.length}`, showHeader = false, showTableHead = true, columnsControl = false, defaultHiddenColumns, height, loading, background, expandableRowComponent, emptyComponent, showPagination, isManualSorted, itemsPerPage = 10, totalRows, initialPageIndex = 0, onPaginationChange, onSortChange, pageClusters, initialSortBy = [], onRowExpandChange, ...otherProps }) => {
18
18
  const uid = useUIDSeed();
19
19
  const hasSomeExpandableRows = useMemo(() => data.some(d => d.subRows), [data]);
20
20
  const isManualPaginated = useMemo(() => Boolean(showPagination && onPaginationChange && totalRows), [showPagination, totalRows, onPaginationChange]);
@@ -75,6 +75,7 @@ export const Table = ({ className, style, columns, data = [], selectableRows, se
75
75
  const subRowsExpanded = row.subRows.filter(r => r.isExpanded);
76
76
  subRowsExpanded.forEach(r => r.toggleRowExpanded(!r.isExpanded));
77
77
  row.toggleRowExpanded(!row.isExpanded);
78
+ onRowExpandChange?.(row);
78
79
  } }))
79
80
  : null),
80
81
  }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wonderflow/react-components",
3
- "version": "10.0.0",
3
+ "version": "10.1.0",
4
4
  "description": "UI components from Wonderflow's Wanda design system",
5
5
  "author": "Wonderflow",
6
6
  "license": "MIT",
@@ -70,8 +70,8 @@
70
70
  "@types/react": "17.0.43",
71
71
  "@types/react-dom": "17.0.14",
72
72
  "@types/react-table": "7.7.12",
73
- "@wonderflow/config": "10.0.0",
74
- "@wonderflow/tokens": "10.0.0",
73
+ "@wonderflow/config": "10.1.0",
74
+ "@wonderflow/tokens": "10.1.0",
75
75
  "babel-loader": "8.2.5",
76
76
  "cpy-cli": "3.1.1",
77
77
  "postcss": "8.4.14",
@@ -87,8 +87,8 @@
87
87
  "dependencies": {
88
88
  "@radix-ui/react-tabs": "0.1.5",
89
89
  "ahooks": "3.5.0",
90
- "clsx": "1.2.0",
91
- "framer-motion": "6.3.16",
90
+ "clsx": "1.2.1",
91
+ "framer-motion": "6.4.2",
92
92
  "react-focus-on": "3.6.0",
93
93
  "react-masonry-css": "1.0.16",
94
94
  "react-merge-refs": "2.0.1",