@wonderflow/react-components 2.37.4-next.1 → 2.38.0-next.3

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/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export { Chip, ChipProps } from './chip';
9
9
  export { CircularProgress, CircularProgressProps } from './circular-progress';
10
10
  export { ClampText, ClampTextProps } from './clamp-text';
11
11
  export { Container, ContainerProps } from './container';
12
+ export { Table, TableProps } from './table';
12
13
  export { Disclosure, DisclosureProps } from './disclosure';
13
14
  export { Dropdown, DropdownProps } from './dropdown';
14
15
  export { Elevator, ElevatorProps } from './elevator';
package/index.js CHANGED
@@ -9,6 +9,7 @@ export { Chip } from './chip';
9
9
  export { CircularProgress } from './circular-progress';
10
10
  export { ClampText } from './clamp-text';
11
11
  export { Container } from './container';
12
+ export { Table } from './table';
12
13
  export { Disclosure } from './disclosure';
13
14
  export { Dropdown } from './dropdown';
14
15
  export { Elevator } from './elevator';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wonderflow/react-components",
3
3
  "description": "UI components from Wonderflow's Wanda design system",
4
- "version": "2.37.4-next.1",
4
+ "version": "2.38.0-next.3",
5
5
  "author": "Wonderflow",
6
6
  "license": "MIT",
7
7
  "main": "index.js",
@@ -45,7 +45,7 @@
45
45
  "prebuild": "rimraf dist",
46
46
  "copy:css": "copyfiles -u 1 \"src/**/*.css\" \"src/*.css\" dist/",
47
47
  "optimize:svg": "svgo ./src/icons/svgs/**/* --config=src/icons/svgo.config.js --quiet",
48
- "generate:sprites": "node src/icons/sprites.js",
48
+ "generate:sprites": "node src/icons/sprites.cjs",
49
49
  "build": "run-s build:icons build:components copy:css build:themes",
50
50
  "build:components": "tsc",
51
51
  "build:themes": "run-p build:light build:dark && run-s prepare:themes",
@@ -57,25 +57,26 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@react-aria/interactions": "3.6.0",
60
- "@wonderflow/eslint-config": "1.1.2",
60
+ "@wonderflow/eslint-config": "1.1.5",
61
61
  "@wonderflow/stylelint-config": "1.0.3",
62
- "@wonderflow/tokens": "1.3.5",
62
+ "@wonderflow/tokens": "1.3.6",
63
63
  "clsx": "1.1.1",
64
64
  "flat": "5.0.2",
65
65
  "framer-motion": "4.1.17",
66
- "postcss": "8.3.11",
66
+ "postcss": "8.4.0",
67
67
  "react": ">=17.0.2",
68
+ "react-data-table-component": "7.4.5",
68
69
  "react-dom": ">=17.0.2",
69
70
  "react-focus-on": "3.5.4",
70
71
  "react-loading-skeleton": "3.0.1",
71
72
  "react-masonry-css": "1.0.16",
72
- "react-paginate": "8.0.0",
73
+ "react-paginate": "8.0.1",
73
74
  "react-popper-tooltip": "4.3.1",
74
75
  "react-roving-tabindex": "3.1.1",
75
76
  "react-uid": "2.3.1",
76
77
  "react-use": "17.3.1",
77
78
  "style-dictionary": "3.0.3",
78
- "type-fest": "2.5.4"
79
+ "type-fest": "2.6.0"
79
80
  },
80
81
  "peerDependencies": {
81
82
  "react": ">=17.0.2",
@@ -102,7 +103,7 @@
102
103
  "@types/react-paginate": "7.1.1",
103
104
  "@typescript-eslint/eslint-plugin": "5.4.0",
104
105
  "@typescript-eslint/parser": "5.4.0",
105
- "@wonderflow/config": "1.5.2",
106
+ "@wonderflow/config": "1.5.4",
106
107
  "babel-loader": "8.2.3",
107
108
  "commit-analyzer-fail-on-no-release": "1.0.0",
108
109
  "commitizen": "4.2.4",
@@ -113,11 +114,12 @@
113
114
  "fs-extra": "10.0.0",
114
115
  "husky": "7.0.4",
115
116
  "is-ci": "3.0.1",
117
+ "nanospinner": "0.4.0",
116
118
  "npm-run-all": "4.1.5",
117
- "ora": "5.4.1",
119
+ "picocolors": "1.0.0",
118
120
  "postcss-mixins": "8.1.0",
119
121
  "rimraf": "3.0.2",
120
- "semantic-release": "18.0.0",
122
+ "semantic-release": "18.0.1",
121
123
  "storybook-addon-themes": "6.1.0",
122
124
  "storybook-css-modules-preset": "1.1.1",
123
125
  "stylelint": "14.1.0",
@@ -1,11 +1,13 @@
1
1
  import React, { ChangeEvent, InputHTMLAttributes } from 'react';
2
2
  export declare type CheckboxProps = InputHTMLAttributes<HTMLInputElement> & {
3
3
  disabled?: boolean;
4
+ indeterminate?: boolean;
4
5
  dimension?: 'regular' | 'small';
5
6
  onChange?(event: ChangeEvent<HTMLInputElement>): void;
6
7
  };
7
8
  export declare const Checkbox: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
8
9
  disabled?: boolean | undefined;
10
+ indeterminate?: boolean | undefined;
9
11
  dimension?: "small" | "regular" | undefined;
10
12
  onChange?(event: ChangeEvent<HTMLInputElement>): void;
11
13
  } & React.RefAttributes<HTMLInputElement>>;
@@ -1,7 +1,7 @@
1
1
  import clsx from 'clsx';
2
2
  import React, { forwardRef } from 'react';
3
3
  import { Checkbox as CheckboxClass } from './selection-controls.module.css';
4
- export const Checkbox = forwardRef(({ className, disabled, dimension = 'regular', onChange, ...props }, forwardedRef) => {
5
- return (React.createElement("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(CheckboxClass, className), ref: forwardedRef, ...props }));
4
+ export const Checkbox = forwardRef(({ className, disabled, dimension = 'regular', onChange, indeterminate, ...props }, forwardedRef) => {
5
+ return (React.createElement("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, "data-control-indeterminate": indeterminate, onChange: onChange, className: clsx(CheckboxClass, className), ref: forwardedRef, ...props }));
6
6
  });
7
7
  Checkbox.displayName = 'Checkbox';
@@ -30,7 +30,8 @@
30
30
  background-color: var(--global-vibrancy-background-hover);
31
31
  }
32
32
 
33
- &:checked {
33
+ &:checked,
34
+ &[data-control-indeterminate='true'] {
34
35
  background-color: var(--dimmed-7);
35
36
 
36
37
  &::after {
@@ -48,6 +49,12 @@
48
49
  --w: 16px;
49
50
  --h: 16px;
50
51
  }
52
+
53
+ &[data-control-indeterminate='true']::after {
54
+ border-left: 0;
55
+ block-size: 2px;
56
+ transform: translate(-50%, -50%);
57
+ }
51
58
  }
52
59
 
53
60
  .Radio {
@@ -3,6 +3,6 @@ import { SkeletonProps } from 'react-loading-skeleton';
3
3
  import 'react-loading-skeleton/dist/skeleton.css';
4
4
  import { TokensTypes } from '@wonderflow/tokens/platforms/web/types';
5
5
  export declare type SkeletonBlockProps = SkeletonProps & {
6
- borderRadius: TokensTypes['radius'];
6
+ borderRadius?: TokensTypes['radius'];
7
7
  };
8
8
  export declare const SkeletonBlock: ({ className, borderRadius, ...props }: SkeletonBlockProps) => JSX.Element;
@@ -93,7 +93,7 @@ a.TabItem {
93
93
  @keyframes fade-in {
94
94
  0% {
95
95
  opacity: 0%;
96
- transform: translate(var(--fadeFromX, 0), var(--fadeFromY, 0));
96
+ transform: translate(var(--fade-from-x, 0), var(--fade-from-y, 0));
97
97
  }
98
98
 
99
99
  100% {
@@ -0,0 +1,2 @@
1
+ export { Table } from './table';
2
+ export type { TableProps } from './table';
package/table/index.js ADDED
@@ -0,0 +1 @@
1
+ export { Table } from './table';
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { TableProps as ReactTableProps } from 'react-data-table-component';
3
+ import { IconNames } from '../icons/types';
4
+ export declare type TableProps<T> = ReactTableProps<T> & {
5
+ ExpandableRowsComponent?: React.FC<{
6
+ data: T;
7
+ }>;
8
+ collapsedRowIcon?: IconNames;
9
+ expandedRowIcon?: IconNames;
10
+ minRowHeight?: string;
11
+ };
12
+ export declare const Table: <T>({ className, ExpandableRowsComponent, progressComponent, customStyles, pagination, responsive, fixedHeader, noHeader, paginationPerPage, striped, theme, collapsedRowIcon, expandedRowIcon, minRowHeight, ...props }: TableProps<T>) => JSX.Element;
package/table/table.js ADDED
@@ -0,0 +1,21 @@
1
+ import React, { useMemo } from 'react';
2
+ import ReactDataTable from 'react-data-table-component';
3
+ import { Icon, SkeletonBlock, Checkbox } from '..';
4
+ import { customStyle } from './theme';
5
+ import { TableWrapper, SortIcon, ExpandWrapper, ExpandContent } from './table.module.css';
6
+ import clsx from 'clsx';
7
+ export const Table = ({ className, ExpandableRowsComponent, progressComponent, customStyles, pagination = false, responsive = true, fixedHeader = false, noHeader = true, paginationPerPage = 8, striped = false, theme = 'default', collapsedRowIcon = 'chevron-right', expandedRowIcon = 'chevron-down', minRowHeight = '48px', ...props }) => {
8
+ const selectProps = {
9
+ indeterminate: (isIndeterminate) => isIndeterminate,
10
+ dimension: 'small'
11
+ };
12
+ const ExpandComponent = useMemo(() => ({ data: innerData }) => (React.createElement("div", { className: ExpandWrapper },
13
+ React.createElement("div", { className: ExpandContent }, ExpandableRowsComponent ? React.createElement(ExpandableRowsComponent, { data: innerData }) : null))), [ExpandableRowsComponent]);
14
+ return (React.createElement("div", { className: clsx(TableWrapper, className) },
15
+ React.createElement(ReactDataTable, { pagination: pagination, responsive: responsive, fixedHeader: fixedHeader, paginationPerPage: paginationPerPage, expandableRows: Boolean(ExpandableRowsComponent), expandOnRowClicked: Boolean(ExpandableRowsComponent), expandableRowsComponent: ExpandComponent, theme: theme, noHeader: noHeader, progressComponent: progressComponent || React.createElement("div", { style: { width: '100%' } },
16
+ React.createElement(SkeletonBlock, { height: 40, count: 8 })), striped: striped, customStyles: customStyles || customStyle(minRowHeight), selectableRowsComponent: Checkbox, selectableRowsComponentProps: selectProps, expandableIcon: {
17
+ collapsed: React.createElement(Icon, { name: collapsedRowIcon, fill: "var(--global-foreground)", dimension: 16 }),
18
+ expanded: React.createElement(Icon, { name: expandedRowIcon, fill: "var(--global-foreground)", dimension: 16 })
19
+ }, sortIcon: (React.createElement("span", { className: SortIcon },
20
+ React.createElement(Icon, { name: "arrow-up", dimension: 16 }))), ...props })));
21
+ };
@@ -0,0 +1,32 @@
1
+ .TableWrapper {
2
+ position: relative;
3
+ }
4
+
5
+ .SortIcon {
6
+ margin-left: 4px;
7
+ transform: scale(0.7);
8
+ display: block;
9
+ }
10
+
11
+ .ExpandWrapper {
12
+ overflow: hidden;
13
+ }
14
+
15
+ .ExpandContent {
16
+ --fade-from-y: -5px;
17
+
18
+ animation: fade-in env(--duration-200);
19
+ animation-timing-function: env(--easing-entrance);
20
+ }
21
+
22
+ @keyframes fade-in {
23
+ 0% {
24
+ opacity: 0%;
25
+ transform: translate(var(--fade-from-x, 0), var(--fade-from-y, 0));
26
+ }
27
+
28
+ 100% {
29
+ opacity: unset;
30
+ transform: none;
31
+ }
32
+ }
@@ -0,0 +1,2 @@
1
+ import { TableStyles } from 'react-data-table-component';
2
+ export declare const customStyle: (rowHeight: string) => TableStyles;
package/table/theme.js ADDED
@@ -0,0 +1,73 @@
1
+ import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
2
+ import { createTheme } from 'react-data-table-component';
3
+ createTheme('default', {
4
+ text: {
5
+ primary: 'var(--foreground-color)',
6
+ secondary: 'var(--dimmed-6)',
7
+ disabled: 'var(--global-disabled-foreground)'
8
+ },
9
+ background: {
10
+ default: 'transparent'
11
+ },
12
+ context: {
13
+ background: 'var(--global-vibrancy-background)',
14
+ text: 'var(--global-vibrancy-foreground)'
15
+ },
16
+ divider: {
17
+ default: 'transparent'
18
+ },
19
+ button: {
20
+ default: 'transparent',
21
+ focus: 'var(--dimmed-1)',
22
+ hover: 'transparent',
23
+ disabled: 'var(--global-disabled-foreground)'
24
+ },
25
+ selected: {
26
+ default: 'var(--highlight-blue-background)',
27
+ text: 'var(--highlight-blue-foreground)'
28
+ },
29
+ highlightOnHover: {
30
+ default: 'var(--dimmed-1)',
31
+ text: 'var(--global-foreground)'
32
+ },
33
+ striped: {
34
+ default: 'var(--dimmed-0)',
35
+ text: 'var(--global-foreground)'
36
+ }
37
+ });
38
+ export const customStyle = (rowHeight) => ({
39
+ rows: {
40
+ style: {
41
+ minHeight: rowHeight
42
+ },
43
+ highlightOnHoverStyle: {
44
+ outline: 'none'
45
+ }
46
+ },
47
+ headRow: {
48
+ style: {
49
+ borderBottom: '3px solid var(--dimmed-2)'
50
+ }
51
+ },
52
+ headCells: {
53
+ style: {
54
+ fontWeight: 800,
55
+ fontSize: tkns.font.size[16]
56
+ }
57
+ },
58
+ cells: {
59
+ style: {
60
+ fontSize: tkns.font.size[16]
61
+ }
62
+ },
63
+ pagination: {
64
+ style: {
65
+ fontSize: tkns.font.size[16]
66
+ }
67
+ },
68
+ contextMenu: {
69
+ style: {
70
+ backdropFilter: 'blur(32px)'
71
+ }
72
+ }
73
+ });
package/themes/dark.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 22 Nov 2021 08:53:42 GMT
3
+ * Generated on Thu, 25 Nov 2021 10:48:48 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -16,7 +16,7 @@
16
16
  --cta-default: hsl(0 100% 47%);
17
17
  --cta-dark: hsl(0 100% 41%);
18
18
  --cta-foreground: hsl(0 0% 100%);
19
- --dimmed-0: hsl(220 11% 5%);
19
+ --dimmed-0: hsl(225 11% 7%);
20
20
  --dimmed-1: hsl(218 11% 14%);
21
21
  --dimmed-2: hsl(219 13% 22%);
22
22
  --dimmed-3: hsl(221 10% 30%);
package/themes/dark.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "cta-default": "hsl(0 100% 47%)",
12
12
  "cta-dark": "hsl(0 100% 41%)",
13
13
  "cta-foreground": "hsl(0 0% 100%)",
14
- "dimmed-0": "hsl(220 11% 5%)",
14
+ "dimmed-0": "hsl(225 11% 7%)",
15
15
  "dimmed-1": "hsl(218 11% 14%)",
16
16
  "dimmed-2": "hsl(219 13% 22%)",
17
17
  "dimmed-3": "hsl(221 10% 30%)",
package/themes/light.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 22 Nov 2021 08:53:42 GMT
3
+ * Generated on Thu, 25 Nov 2021 10:48:48 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -11,7 +11,7 @@
11
11
  --global-vibrancy-foreground: hsl(0 0% 0%);
12
12
  --global-vibrancy-background: hsl(220 16% 85% / 40%);
13
13
  --global-vibrancy-background-hover: hsl(221 9% 49% / 30%);
14
- --global-disabled-background: hsl(220 11% 5% / 6%);
14
+ --global-disabled-background: hsl(225 11% 7% / 6%);
15
15
  --global-disabled-foreground: hsl(0 0% 0% / 20%);
16
16
  --cta-default: hsl(0 100% 47%);
17
17
  --cta-dark: hsl(0 100% 41%);
package/themes/light.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "global-vibrancy-foreground": "hsl(0 0% 0%)",
7
7
  "global-vibrancy-background": "hsl(220 16% 85% / 40%)",
8
8
  "global-vibrancy-background-hover": "hsl(221 9% 49% / 30%)",
9
- "global-disabled-background": "hsl(220 11% 5% / 6%)",
9
+ "global-disabled-background": "hsl(225 11% 7% / 6%)",
10
10
  "global-disabled-foreground": "hsl(0 0% 0% / 20%)",
11
11
  "cta-default": "hsl(0 100% 47%)",
12
12
  "cta-dark": "hsl(0 100% 41%)",
package/themes.css CHANGED
@@ -4,7 +4,7 @@
4
4
  color: var(--global-foreground);
5
5
  /**
6
6
  * Do not edit directly
7
- * Generated on Mon, 22 Nov 2021 08:53:42 GMT
7
+ * Generated on Thu, 25 Nov 2021 10:48:48 GMT
8
8
  */
9
9
 
10
10
 
@@ -15,7 +15,7 @@
15
15
  --global-vibrancy-foreground: hsl(0 0% 0%);
16
16
  --global-vibrancy-background: hsl(220 16% 85% / 40%);
17
17
  --global-vibrancy-background-hover: hsl(221 9% 49% / 30%);
18
- --global-disabled-background: hsl(220 11% 5% / 6%);
18
+ --global-disabled-background: hsl(225 11% 7% / 6%);
19
19
  --global-disabled-foreground: hsl(0 0% 0% / 20%);
20
20
  --cta-default: hsl(0 100% 47%);
21
21
  --cta-dark: hsl(0 100% 41%);
@@ -51,7 +51,7 @@
51
51
  color: var(--global-foreground);
52
52
  /**
53
53
  * Do not edit directly
54
- * Generated on Mon, 22 Nov 2021 08:53:42 GMT
54
+ * Generated on Thu, 25 Nov 2021 10:48:48 GMT
55
55
  */
56
56
 
57
57
 
@@ -67,7 +67,7 @@
67
67
  --cta-default: hsl(0 100% 47%);
68
68
  --cta-dark: hsl(0 100% 41%);
69
69
  --cta-foreground: hsl(0 0% 100%);
70
- --dimmed-0: hsl(220 11% 5%);
70
+ --dimmed-0: hsl(225 11% 7%);
71
71
  --dimmed-1: hsl(218 11% 14%);
72
72
  --dimmed-2: hsl(219 13% 22%);
73
73
  --dimmed-3: hsl(221 10% 30%);
@@ -99,7 +99,7 @@
99
99
  color: var(--global-foreground);
100
100
  /**
101
101
  * Do not edit directly
102
- * Generated on Mon, 22 Nov 2021 08:53:42 GMT
102
+ * Generated on Thu, 25 Nov 2021 10:48:48 GMT
103
103
  */
104
104
 
105
105
 
@@ -115,7 +115,7 @@
115
115
  --cta-default: hsl(0 100% 47%);
116
116
  --cta-dark: hsl(0 100% 41%);
117
117
  --cta-foreground: hsl(0 0% 100%);
118
- --dimmed-0: hsl(220 11% 5%);
118
+ --dimmed-0: hsl(225 11% 7%);
119
119
  --dimmed-1: hsl(218 11% 14%);
120
120
  --dimmed-2: hsl(219 13% 22%);
121
121
  --dimmed-3: hsl(221 10% 30%);
@@ -56,7 +56,7 @@
56
56
  --fluid-type-factor: calc(1.35rem + 2.37vw);
57
57
  --fluid-type-max: 2.37rem;
58
58
 
59
- font-weight: 900;
59
+ font-weight: 800;
60
60
  }
61
61
 
62
62
  &:is(.H2) {
@@ -64,7 +64,7 @@
64
64
  --fluid-type-factor: calc(1.8rem + 3.17vw);
65
65
  --fluid-type-max: 3.16rem;
66
66
 
67
- font-weight: 900;
67
+ font-weight: 800;
68
68
  }
69
69
 
70
70
  &:is(.H1) {
@@ -72,7 +72,7 @@
72
72
  --fluid-type-factor: calc(2.23rem + 4.17vw);
73
73
  --fluid-type-max: 4.2rem;
74
74
 
75
- font-weight: 900;
75
+ font-weight: 800;
76
76
  }
77
77
 
78
78
  &.Display {
@@ -80,6 +80,6 @@
80
80
  --fluid-type-factor: calc(3.19rem + 5.66vw);
81
81
  --fluid-type-max: 5.6rem;
82
82
 
83
- font-weight: 900;
83
+ font-weight: 800;
84
84
  }
85
85
  }