@wonderflow/react-components 2.37.4 → 2.38.0-next.12

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,3 +1,5 @@
1
+ @import '../core/vibrancy.css';
2
+
1
3
  .Button {
2
4
  box-sizing: border-box;
3
5
  user-select: none;
@@ -59,12 +61,14 @@
59
61
  }
60
62
 
61
63
  &[data-button-kind='secondary'] {
64
+
65
+ @mixin vibrancy;
66
+
62
67
  color: var(--global-vibrancy-foreground);
63
- backdrop-filter: blur(32px);
64
- background-color: var(--global-vibrancy-background);
65
68
 
66
69
  &:is(:active) {
67
- background-color: var(--global-vibrancy-background-hover);
70
+
71
+ @mixin vibrancy-hover;
68
72
  }
69
73
 
70
74
  &[aria-pressed='true'],
@@ -78,13 +82,15 @@
78
82
  color: var(--global-foreground);
79
83
 
80
84
  &:is(:active) {
81
- backdrop-filter: blur(32px);
82
- background-color: var(--global-vibrancy-background-hover);
85
+
86
+ @mixin vibrancy-hover;
83
87
  }
84
88
 
85
89
  &:is(:hover, :focus):not(:active) {
86
- backdrop-filter: blur(32px);
87
- background-color: var(--global-vibrancy-background);
90
+
91
+ @mixin vibrancy;
92
+
93
+ color: var(--global-vibrancy-foreground);
88
94
  }
89
95
 
90
96
  &[aria-pressed='true'],
@@ -105,9 +111,9 @@
105
111
 
106
112
  &[data-button-disabled='true'],
107
113
  &[data-button-disabled='true']:is(:hover, :focus) {
108
- background-color: var(--global-disabled-background);
109
- backdrop-filter: blur(32px);
110
- color: var(--global-disabled-foreground);
114
+
115
+ @mixin vibrancy-disabled;
116
+
111
117
  cursor: not-allowed;
112
118
  }
113
119
 
package/card/card.d.ts CHANGED
@@ -8,6 +8,8 @@ export declare type CardProps = PropsWithClass & Pick<StackProps, 'wrap' | 'colu
8
8
  bordered?: boolean;
9
9
  radius?: false | TokensTypes['radius'];
10
10
  dimmed?: 1 | 2 | 3;
11
+ vibrant?: boolean;
12
+ hoverable?: boolean;
11
13
  };
12
14
  declare type PolymorphicCard = Polymorphic.ForwardRefComponent<'div', CardProps>;
13
15
  export declare const Card: PolymorphicCard;
package/card/card.js CHANGED
@@ -3,14 +3,14 @@ import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
3
3
  import { Stack } from '../';
4
4
  import clsx from 'clsx';
5
5
  import { Card as CardClass, Left, Content, Right } from './card.module.css';
6
- export const Card = forwardRef(({ as: Wrapper = 'div', children, className, padding = 24, radius = 8, left, right, dimmed, bordered, columnGap = 24, rowGap = 24, verticalAlign = 'start', horizontalAlign = 'space-between', wrap, style, ...props }, forwardedRef) => {
6
+ export const Card = forwardRef(({ as: Wrapper = 'div', children, className, padding = 24, radius = 8, left, right, dimmed, bordered, columnGap = 24, rowGap = 24, verticalAlign = 'start', horizontalAlign = 'space-between', vibrant = false, hoverable = false, wrap, style, ...props }, forwardedRef) => {
7
7
  const dynamicStyle = {
8
8
  '--padding': padding && tkns.space[padding],
9
9
  '--radius': radius && tkns.radius[radius]
10
10
  };
11
- return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(CardClass, className), style: { ...dynamicStyle, ...style }, "data-card-dimmed": dimmed, "data-card-bordered": bordered, ...props },
11
+ return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(CardClass, className), style: { ...dynamicStyle, ...style }, "data-card-dimmed": dimmed, "data-card-bordered": bordered, "data-card-vibrant": vibrant, "data-card-hoverable": hoverable, ...props },
12
12
  React.createElement(Stack, { direction: "row", fill: false, verticalAlign: verticalAlign, horizontalAlign: horizontalAlign, columnGap: columnGap, rowGap: rowGap, wrap: wrap },
13
13
  left && React.createElement("div", { className: Left }, left),
14
- children && (React.createElement(Stack, { className: Content }, children)),
14
+ children && (React.createElement("div", { className: Content }, children)),
15
15
  right && (React.createElement(Stack, { className: Right }, right)))));
16
16
  });
@@ -1,3 +1,5 @@
1
+ @import '../core/vibrancy.css';
2
+
1
3
  :where(.Card) {
2
4
  background: var(--global-background);
3
5
  padding: var(--padding);
@@ -9,16 +11,31 @@
9
11
  }
10
12
 
11
13
  &[data-card-dimmed='2'] {
12
- background: var(--dimmed-0);
14
+ background: var(--dimmed-1);
13
15
  }
14
16
 
15
17
  &[data-card-dimmed='3'] {
16
18
  background: var(--dimmed-2);
17
19
  }
18
20
 
21
+ &[data-card-vibrant='true'] {
22
+
23
+ @mixin vibrancy;
24
+ }
25
+
26
+ &[data-card-hoverable='true']:hover,
27
+ &[data-card-hoverable='true']:focus-visible {
28
+
29
+ @mixin vibrancy-hover;
30
+ }
31
+
19
32
  &[data-card-bordered='true'] {
20
33
  border: solid 1px var(--dimmed-1);
21
34
  }
35
+
36
+ &[data-card-vibrant='true'][data-card-bordered='true'] {
37
+ border: solid 1px var(--dimmed-2);
38
+ }
22
39
  }
23
40
 
24
41
  .Left {
@@ -0,0 +1,27 @@
1
+ @define-mixin vibrancy {
2
+ backdrop-filter: saturate(180%) blur(62px);
3
+ background:
4
+ linear-gradient(
5
+ to bottom,
6
+ var(--global-vibrancy-background),
7
+ var(--global-vibrancy-background)
8
+ );
9
+ }
10
+ @define-mixin vibrancy-hover {
11
+ background:
12
+ linear-gradient(
13
+ to bottom,
14
+ var(--global-vibrancy-background-hover),
15
+ var(--global-vibrancy-background-hover)
16
+ );
17
+ }
18
+ @define-mixin vibrancy-disabled {
19
+ color: var(--global-disabled-foreground);
20
+ backdrop-filter: saturate(180%) blur(62px);
21
+ background:
22
+ linear-gradient(
23
+ to bottom,
24
+ var(--global-disabled-background),
25
+ var(--global-disabled-background)
26
+ );
27
+ }
package/grid/grid.d.ts CHANGED
@@ -10,4 +10,25 @@ export declare type GridProps = PropsWithClass & {
10
10
  colMinWidth?: string;
11
11
  rowMinHeight?: string;
12
12
  };
13
- export declare const Grid: React.FC<GridProps>;
13
+ export declare const Grid: React.ForwardRefExoticComponent<PropsWithClass & {
14
+ children: ReactNode;
15
+ columns?: number | undefined;
16
+ rows?: number | undefined;
17
+ rowGap?: 0 | 24 | 16 | 32 | 40 | 48 | 56 | 2 | 4 | 8 | 64 | 72 | 80 | 88 | 96 | 104 | 112 | 120 | 128 | 136 | 144 | 152 | 160 | 168 | 176 | 184 | 192 | 200 | undefined;
18
+ columnGap?: 0 | 24 | 16 | 32 | 40 | 48 | 56 | 2 | 4 | 8 | 64 | 72 | 80 | 88 | 96 | 104 | 112 | 120 | 128 | 136 | 144 | 152 | 160 | 168 | 176 | 184 | 192 | 200 | undefined;
19
+ filling?: false | "fill" | "fit" | undefined;
20
+ colMinWidth?: string | undefined;
21
+ rowMinHeight?: string | undefined;
22
+ } & React.RefAttributes<HTMLUListElement>>;
23
+ export declare const GridRoot: React.ForwardRefExoticComponent<PropsWithClass & {
24
+ children: ReactNode;
25
+ columns?: number | undefined;
26
+ rows?: number | undefined;
27
+ rowGap?: 0 | 24 | 16 | 32 | 40 | 48 | 56 | 2 | 4 | 8 | 64 | 72 | 80 | 88 | 96 | 104 | 112 | 120 | 128 | 136 | 144 | 152 | 160 | 168 | 176 | 184 | 192 | 200 | undefined;
28
+ columnGap?: 0 | 24 | 16 | 32 | 40 | 48 | 56 | 2 | 4 | 8 | 64 | 72 | 80 | 88 | 96 | 104 | 112 | 120 | 128 | 136 | 144 | 152 | 160 | 168 | 176 | 184 | 192 | 200 | undefined;
29
+ filling?: false | "fill" | "fit" | undefined;
30
+ colMinWidth?: string | undefined;
31
+ rowMinHeight?: string | undefined;
32
+ } & React.RefAttributes<HTMLUListElement>> & {
33
+ Item: React.FC<import("./grid-item").GridItemProps>;
34
+ };
package/grid/grid.js CHANGED
@@ -15,4 +15,4 @@ export const Grid = forwardRef(({ className, children, columns, rows, rowGap = 8
15
15
  return (React.createElement("ul", { className: clsx(GridClass, className), style: { ...computedStyle, ...style }, "data-grid-filling-type": filling, ref: forwardedRef, ...props }, children));
16
16
  });
17
17
  Grid.displayName = 'Grid';
18
- Grid.Item = GridItem;
18
+ export const GridRoot = Object.assign(Grid, { Item: GridItem });
package/grid/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export { Grid } from './grid';
2
- export { GridItem } from './grid-item';
1
+ export { GridRoot as Grid } from './grid';
3
2
  export type { GridProps } from './grid';
4
3
  export type { GridItemProps } from './grid-item';
package/grid/index.js CHANGED
@@ -1,2 +1 @@
1
- export { Grid } from './grid';
2
- export { GridItem } from './grid-item';
1
+ export { GridRoot as Grid } from './grid';
package/icons/all.svg CHANGED
@@ -50,6 +50,8 @@
50
50
  <path d="M3 4v7a1 1 0 1 0 2 0V6.416l6.294 6.293a.998.998 0 0 0 1.413-.002 1 1 0 0 0 0-1.414L6.413 5H11a1 1 0 1 0 0-2H4a1 1 0 0 0-1 1Z"/>
51
51
  </symbol><symbol id="16/arrow-up-right" viewBox="0 0 16 16">
52
52
  <path d="M13 4v7a1 1 0 1 1-2 0V6.416l-6.294 6.293a.998.998 0 0 1-1.413-.002 1 1 0 0 1 0-1.414L9.587 5H5a1 1 0 1 1 0-2h7a1 1 0 0 1 1 1Z"/>
53
+ </symbol><symbol id="16/backward-step" viewBox="0 0 16 16">
54
+ <path d="M3.972 2.002c-.552 0-.972.447-.972 1V13a1 1 0 0 0 1 1c.552-.026 1-.448 1-1.026V3.002c0-.553-.448-1-1.028-1Zm7.389.23L5.36 7.205C5.12 7.433 5 7.717 5 8c0 .285.12.569.358.77l6 4.972c.646.535 1.642.086 1.642-.77V2.977c-.027-.83-.995-1.28-1.64-.744Z"/>
53
55
  </symbol><symbol id="16/ban" viewBox="0 0 16 16">
54
56
  <path d="M8 1a7 7 0 0 0-7 7 7 7 0 0 0 7 7 7 7 0 0 0 7-7 7 7 0 0 0-7-7ZM2.75 8c0-1.132.364-2.179.976-3.038l7.311 7.312A5.21 5.21 0 0 1 8 13.25 5.255 5.255 0 0 1 2.75 8Zm9.524 3.038L4.962 3.726A5.217 5.217 0 0 1 8 2.75 5.255 5.255 0 0 1 13.25 8c0 1.132-.364 2.18-.976 3.038Z"/>
55
57
  </symbol><symbol id="16/bars" viewBox="0 0 16 16">
@@ -125,6 +127,8 @@
125
127
  <path d="M9.667 1v3.25H13L9.667 1Zm-.834 3.25V1H4.25C3.56 1 3 1.546 3 2.219V12.78c0 .674.56 1.22 1.25 1.22h7.5c.69 0 1.25-.546 1.25-1.219V5.062H9.69c-.484 0-.857-.363-.857-.812Zm1.253 3.659L8.883 9.125l1.225 1.194a.599.599 0 0 1 0 .862.636.636 0 0 1-.884 0L8 9.986 6.775 11.18a.636.636 0 0 1-.884 0 .599.599 0 0 1 0-.862l1.226-1.193-1.226-1.216a.599.599 0 0 1 0-.862.636.636 0 0 1 .883 0L8 8.264 9.225 7.07a.636.636 0 0 1 .884 0c.244.238.243.623-.023.839Z"/>
126
128
  </symbol><symbol id="16/filter" viewBox="0 0 16 16">
127
129
  <path d="m13.835 4.165-4.33 4.969v3.33c0 .436-.515.685-.885.439l-1.876-1.25a.528.528 0 0 1-.24-.439v-2.08l-4.331-4.97C1.766 3.699 2.123 3 2.767 3h10.475c.645 0 .98.698.593 1.165Z"/>
130
+ </symbol><symbol id="16/forward-step" viewBox="0 0 16 16">
131
+ <path d="M12.023 13.972c.555 0 .977-.447.977-1V3c0-.552-.45-1-1.006-1a.973.973 0 0 0-.977.972v9.998c0 .58.478 1.002 1.006 1.002ZM4.65 13.77l6.034-4.972a1 1 0 0 0 .36-.77 1 1 0 0 0-.36-.77L4.65 2.286A.978.978 0 0 0 3 3v9.998c0 .856 1.002 1.306 1.65.771Z"/>
128
132
  </symbol><symbol id="16/frown" viewBox="0 0 16 16">
129
133
  <path d="M8 1a7 7 0 0 0-7 7 7 7 0 0 0 7 7 7 7 0 0 0 7-7 7 7 0 0 0-7-7Zm2.188 4.813a.874.874 0 1 1 0 1.75.875.875 0 1 1 0-1.75Zm-4.4 0a.875.875 0 1 1-.875.875.89.89 0 0 1 .875-.875Zm4.678 5.966a3.221 3.221 0 0 0-2.49-1.154 3.17 3.17 0 0 0-2.467 1.155c-.37.445-1.041-.115-.672-.561A4.169 4.169 0 0 1 8 9.75a4.06 4.06 0 0 1 3.134 1.47c.374.42-.299 1.005-.668.559Z"/>
130
134
  </symbol><symbol id="16/github" viewBox="0 0 16 16">
@@ -261,6 +265,8 @@
261
265
  <path d="M4 5.2v12a1.2 1.2 0 0 0 2.4 0V8.095l11.55 11.55a1.196 1.196 0 0 0 1.698.003 1.2 1.2 0 0 0 0-1.697L8.095 6.4H17.2a1.199 1.199 0 1 0 0-2.4h-12A1.2 1.2 0 0 0 4 5.2Z"/>
262
266
  </symbol><symbol id="24/arrow-up-right" viewBox="0 0 24 24">
263
267
  <path d="M20 5.2v12a1.2 1.2 0 0 1-2.4 0V8.095L6.05 19.645a1.196 1.196 0 0 1-1.698.003 1.2 1.2 0 0 1 0-1.697L15.905 6.4H6.8a1.199 1.199 0 1 1 0-2.4h12c.665 0 1.2.54 1.2 1.2Z"/>
268
+ </symbol><symbol id="24/backward-step" viewBox="0 0 24 24">
269
+ <path d="M16.566 3c-.317 0-.629.11-.887.322L7.5 10.041V3.75a.75.75 0 1 0-1.5 0v16.5a.751.751 0 0 0 1.5 0v-6.29l8.18 6.717c.215.215.567.323.886.323.482 0 1.434-.38 1.434-1.542V4.5c0-1.119-.952-1.5-1.434-1.5ZM16.5 19.519 7.524 12 16.5 4.48v15.04Z"/>
264
270
  </symbol><symbol id="24/ban" viewBox="0 0 24 24">
265
271
  <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM3.875 12c0-1.903.662-3.651 1.762-5.004L17.04 18.398A8.287 8.287 0 0 1 12 20.125c-4.48 0-8.125-3.645-8.125-8.125Zm14.488 5.004L6.961 5.637A8.084 8.084 0 0 1 12 3.875c4.48 0 8.125 3.645 8.125 8.125a7.926 7.926 0 0 1-1.762 5.004Z"/>
266
272
  </symbol><symbol id="24/bars" viewBox="0 0 24 24">
@@ -333,6 +339,8 @@
333
339
  <path d="m19.22 5.465-3.109-2.77A2.855 2.855 0 0 0 14.225 2H6.667C5.194 2 4 3.063 4 4.375v14.25C4 19.936 5.194 21 6.667 21h10.666C18.8 21 20 19.931 20 18.625V7.143c0-.627-.28-1.232-.78-1.678ZM18 18.625c0 .328-.299.594-.667.594H6.668c-.369 0-.667-.266-.667-.594L6 4.38c0-.328.298-.594.667-.594h6.666V6.75c0 .656.597 1.188 1.334 1.188H18v10.687Zm-4.042-7.756L12 12.617l-1.996-1.748a1.089 1.089 0 0 0-1.414 0 .823.823 0 0 0 0 1.26l1.998 1.746-1.96 1.745a.823.823 0 0 0 0 1.26c.39.348 1.023.348 1.414 0L12 15.133l1.96 1.745c.39.348 1.022.348 1.414 0a.823.823 0 0 0 0-1.26l-1.962-1.743 1.96-1.745a.823.823 0 0 0 0-1.26 1.091 1.091 0 0 0-1.414 0Z"/>
334
340
  </symbol><symbol id="24/filter" viewBox="0 0 24 24">
335
341
  <path d="M20.849 5.064c-.27-.58-.84-.939-1.49-.939H4.64c-.648 0-1.22.36-1.49.939a1.575 1.575 0 0 0 .224 1.69l5.815 7.14v2.381c0 .442.217.855.58 1.106l2.895 2.234c.218.176.517.26.791.26.749 0 1.357-.604 1.357-1.348v-4.632l5.819-7.147c.397-.473.482-1.12.218-1.684Zm-7.47 7.889a1.127 1.127 0 0 0-.254.71v4.177l-2.25-1.737v-2.409c0-.259-.089-.51-.252-.71l-5.838-7.17h14.428l-5.835 7.139Z"/>
342
+ </symbol><symbol id="24/forward-step" viewBox="0 0 24 24">
343
+ <path d="M17.25 3a.751.751 0 0 0-.75.75v6.29L8.322 3.324A1.388 1.388 0 0 0 7.436 3C6.95 3 6 3.381 6 4.501v14.996C6 20.62 6.95 21 7.436 21c.316 0 .628-.11.886-.322l8.178-6.719v6.291a.75.75 0 1 0 1.5 0V3.75a.751.751 0 0 0-.75-.75ZM7.5 19.519V4.48L16.477 12 7.5 19.519Z"/>
336
344
  </symbol><symbol id="24/frown" viewBox="0 0 24 24">
337
345
  <path d="M12 13.875c-1.57 0-3.046.693-4.055 1.9a.936.936 0 0 0 .119 1.318.944.944 0 0 0 1.324-.122 3.376 3.376 0 0 1 2.577-1.221c.976 0 1.964.44 2.612 1.22a.936.936 0 1 0 1.443-1.196c-1.008-1.204-2.45-1.899-4.02-1.899Zm-3.16-2.5c.695 0 1.25-.557 1.25-1.25s-.555-1.25-1.25-1.25c-.69 0-1.25.557-1.25 1.25s.594 1.25 1.25 1.25ZM12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18.125c-4.48 0-8.125-3.645-8.125-8.125S7.52 3.875 12 3.875 20.125 7.52 20.125 12 16.48 20.125 12 20.125Zm3.125-11.25c-.695 0-1.25.557-1.25 1.25s.555 1.25 1.25 1.25c.69 0 1.25-.557 1.25-1.25s-.559-1.25-1.25-1.25Z"/>
338
346
  </symbol><symbol id="24/github" viewBox="0 0 24 24">
@@ -11,6 +11,7 @@
11
11
  "arrow-up",
12
12
  "arrow-up-left",
13
13
  "arrow-up-right",
14
+ "backward-step",
14
15
  "ban",
15
16
  "bars",
16
17
  "bars-sort-down",
@@ -47,6 +48,7 @@
47
48
  "file-pdf",
48
49
  "file-xmark",
49
50
  "filter",
51
+ "forward-step",
50
52
  "frown",
51
53
  "github",
52
54
  "graduation-cap",
package/icons/types.d.ts CHANGED
@@ -11,6 +11,7 @@ export type IconNames = 'arrow-down' |
11
11
  'arrow-up' |
12
12
  'arrow-up-left' |
13
13
  'arrow-up-right' |
14
+ 'backward-step' |
14
15
  'ban' |
15
16
  'bars' |
16
17
  'bars-sort-down' |
@@ -47,6 +48,7 @@ export type IconNames = 'arrow-down' |
47
48
  'file-pdf' |
48
49
  'file-xmark' |
49
50
  'filter' |
51
+ 'forward-step' |
50
52
  'frown' |
51
53
  'github' |
52
54
  'graduation-cap' |
@@ -106,6 +108,7 @@ export type IconNames = 'arrow-down' |
106
108
  'arrow-up' |
107
109
  'arrow-up-left' |
108
110
  'arrow-up-right' |
111
+ 'backward-step' |
109
112
  'ban' |
110
113
  'bars' |
111
114
  'bars-sort-down' |
@@ -142,6 +145,7 @@ export type IconNames = 'arrow-down' |
142
145
  'file-pdf' |
143
146
  'file-xmark' |
144
147
  'filter' |
148
+ 'forward-step' |
145
149
  'frown' |
146
150
  'github' |
147
151
  'graduation-cap' |
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",
4
+ "version": "2.38.0-next.12",
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",
@@ -56,26 +56,27 @@
56
56
  "postbuild": "copyfiles package.json dist"
57
57
  },
58
58
  "dependencies": {
59
- "@react-aria/interactions": "3.6.0",
60
- "@wonderflow/eslint-config": "1.1.2",
59
+ "@react-aria/interactions": "3.7.0",
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.1",
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": "github:AdeleD/react-paginate",
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",
@@ -89,7 +90,7 @@
89
90
  "@semantic-release/git": "10.0.1",
90
91
  "@semantic-release/github": "8.0.2",
91
92
  "@semantic-release/npm": "8.0.3",
92
- "@semantic-release/release-notes-generator": "10.0.2",
93
+ "@semantic-release/release-notes-generator": "10.0.3",
93
94
  "@storybook/addon-actions": "6.3.12",
94
95
  "@storybook/addon-essentials": "6.3.12",
95
96
  "@storybook/addon-links": "6.3.12",
@@ -99,10 +100,9 @@
99
100
  "@storybook/theming": "6.3.12",
100
101
  "@types/flat": "5.0.2",
101
102
  "@types/react-dom": "17.0.11",
102
- "@types/react-paginate": "7.1.1",
103
103
  "@typescript-eslint/eslint-plugin": "5.4.0",
104
104
  "@typescript-eslint/parser": "5.4.0",
105
- "@wonderflow/config": "1.5.2",
105
+ "@wonderflow/config": "1.5.5",
106
106
  "babel-loader": "8.2.3",
107
107
  "commit-analyzer-fail-on-no-release": "1.0.0",
108
108
  "commitizen": "4.2.4",
@@ -113,11 +113,12 @@
113
113
  "fs-extra": "10.0.0",
114
114
  "husky": "7.0.4",
115
115
  "is-ci": "3.0.1",
116
+ "nanospinner": "0.4.0",
116
117
  "npm-run-all": "4.1.5",
117
- "ora": "5.4.1",
118
+ "picocolors": "1.0.0",
118
119
  "postcss-mixins": "8.1.0",
119
120
  "rimraf": "3.0.2",
120
- "semantic-release": "18.0.0",
121
+ "semantic-release": "18.0.1",
121
122
  "storybook-addon-themes": "6.1.0",
122
123
  "storybook-css-modules-preset": "1.1.1",
123
124
  "stylelint": "14.1.0",
@@ -1,3 +1,5 @@
1
+ @import '../core/vibrancy.css';
2
+
1
3
  .Select {
2
4
  appearance: none;
3
5
  position: relative;
@@ -33,6 +35,9 @@
33
35
  }
34
36
 
35
37
  .Field {
38
+
39
+ @mixin vibrancy;
40
+
36
41
  margin: 0;
37
42
  border: 0;
38
43
  text-overflow: ellipsis;
@@ -45,14 +50,7 @@
45
50
  inline-size: 100%;
46
51
  box-sizing: border-box;
47
52
  overflow: hidden;
48
- backdrop-filter: blur(32px);
49
53
  color: inherit;
50
- background:
51
- linear-gradient(
52
- to bottom,
53
- var(--global-vibrancy-background),
54
- var(--global-vibrancy-background)
55
- );
56
54
  block-size: var(--field-height);
57
55
  padding:
58
56
  0
@@ -61,9 +59,9 @@
61
59
  var(--field-padding);
62
60
 
63
61
  &:disabled {
64
- color: var(--global-disabled-foreground);
65
- background: var(--global-disabled-background);
66
- backdrop-filter: blur(32px);
62
+
63
+ @mixin vibrancy-disabled;
64
+
67
65
  cursor: not-allowed;
68
66
  }
69
67
 
@@ -81,6 +79,7 @@
81
79
  overflow: auto;
82
80
 
83
81
  & option {
82
+ color: currentColor;
84
83
  padding: calc(var(--field-padding) / 2) var(--field-padding);
85
84
  }
86
85
 
@@ -91,6 +90,7 @@
91
90
  }
92
91
 
93
92
  & optgroup {
93
+ color: currentColor;
94
94
  margin: 0 0 1rem;
95
95
  font-family: inherit;
96
96
  font-size: inherit;
@@ -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';
@@ -1,14 +1,16 @@
1
+ @import '../core/vibrancy.css';
2
+
1
3
  .Checkbox {
2
4
  --w: 24px;
3
5
  --h: 24px;
4
6
 
7
+ @mixin vibrancy;
8
+
5
9
  appearance: none;
6
10
  inline-size: var(--w);
7
11
  block-size: var(--h);
8
12
  max-inline-size: var(--w);
9
13
  max-block-size: var(--h);
10
- backdrop-filter: blur(32px);
11
- background-color: var(--global-vibrancy-background);
12
14
  color: var(--global-background);
13
15
  border-radius: env(--radius-4);
14
16
  position: relative;
@@ -30,8 +32,9 @@
30
32
  background-color: var(--global-vibrancy-background-hover);
31
33
  }
32
34
 
33
- &:checked {
34
- background-color: var(--dimmed-7);
35
+ &:checked,
36
+ &[data-control-indeterminate='true'] {
37
+ background: var(--dimmed-7);
35
38
 
36
39
  &::after {
37
40
  display: block;
@@ -39,8 +42,9 @@
39
42
  }
40
43
 
41
44
  &:disabled {
42
- background: var(--global-disabled-background);
43
- color: var(--global-disabled-foreground);
45
+
46
+ @mixin vibrancy-disabled;
47
+
44
48
  cursor: not-allowed;
45
49
  }
46
50
 
@@ -48,6 +52,12 @@
48
52
  --w: 16px;
49
53
  --h: 16px;
50
54
  }
55
+
56
+ &[data-control-indeterminate='true']::after {
57
+ border-left: 0;
58
+ block-size: 2px;
59
+ transform: translate(-50%, -50%);
60
+ }
51
61
  }
52
62
 
53
63
  .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
+ }, paginationIconFirstPage: React.createElement(Icon, { name: "backward-step", dimension: 24 }), paginationIconPrevious: React.createElement(Icon, { name: "chevron-left", dimension: 24 }), paginationIconNext: React.createElement(Icon, { name: "chevron-right", dimension: 24 }), paginationIconLastPage: React.createElement(Icon, { name: "forward-step", dimension: 24 }), 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,77 @@
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
+ pageButtonsStyle: {
68
+ color: 'var(--global-foreground)'
69
+ }
70
+ },
71
+ contextMenu: {
72
+ style: {
73
+ backdropFilter: 'blur(32px)',
74
+ borderRadius: '4px'
75
+ }
76
+ }
77
+ });
@@ -1,3 +1,5 @@
1
+ @import '../../core/vibrancy.css';
2
+
1
3
  .BaseField {
2
4
  margin: 0;
3
5
  text-overflow: ellipsis;
@@ -37,9 +39,9 @@
37
39
  }
38
40
 
39
41
  &:disabled {
40
- color: var(--global-disabled-foreground);
41
- background: var(--global-disabled-background);
42
- backdrop-filter: blur(32px);
42
+
43
+ @mixin vibrancy-disabled;
44
+
43
45
  cursor: not-allowed;
44
46
  border-color: transparent;
45
47
 
package/themes/dark.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 23 Nov 2021 14:26:44 GMT
3
+ * Generated on Fri, 26 Nov 2021 16:40:31 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 Tue, 23 Nov 2021 14:26:44 GMT
3
+ * Generated on Fri, 26 Nov 2021 16:40:31 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 Tue, 23 Nov 2021 14:26:44 GMT
7
+ * Generated on Fri, 26 Nov 2021 16:40:31 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 Tue, 23 Nov 2021 14:26:44 GMT
54
+ * Generated on Fri, 26 Nov 2021 16:40:31 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 Tue, 23 Nov 2021 14:26:44 GMT
102
+ * Generated on Fri, 26 Nov 2021 16:40:31 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%);