@wonderflow/react-components 2.39.2 → 2.39.5-next.2

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.
Files changed (86) hide show
  1. package/avatar/avatar.js +2 -3
  2. package/button/button.d.ts +4 -4
  3. package/button/button.js +4 -5
  4. package/button/button.module.css +6 -6
  5. package/card/card.d.ts +1 -1
  6. package/card/card.js +2 -2
  7. package/chip/chip.d.ts +2 -2
  8. package/chip/chip.js +2 -3
  9. package/circular-progress/circular-progress.js +2 -3
  10. package/clamp-text/clamp-text.d.ts +1 -1
  11. package/clamp-text/clamp-text.js +2 -3
  12. package/container/container.js +2 -3
  13. package/core/typography.css +1 -6
  14. package/core.css +5 -1
  15. package/disclosure/disclosure.js +3 -4
  16. package/dropdown/dropdown-item.d.ts +1 -1
  17. package/dropdown/dropdown-item.js +0 -2
  18. package/dropdown/dropdown-menu.d.ts +3 -3
  19. package/dropdown/dropdown-menu.js +11 -10
  20. package/dropdown/dropdown.js +2 -2
  21. package/elevator/elevator.d.ts +2 -2
  22. package/grid/grid-item.js +2 -2
  23. package/grid/grid.js +2 -3
  24. package/icon/icon.js +2 -2
  25. package/icon-button/icon-button.d.ts +1 -1
  26. package/icon-button/icon-button.js +1 -2
  27. package/index.d.ts +1 -1
  28. package/index.js +1 -1
  29. package/info-state/info-state.d.ts +2 -2
  30. package/info-state/info-state.js +2 -3
  31. package/input-group/input-group.js +3 -4
  32. package/input-group/input-group.module.css +0 -3
  33. package/linear-progress/linear-progress.d.ts +4 -4
  34. package/linear-progress/linear-progress.js +3 -4
  35. package/list/list.d.ts +1 -1
  36. package/list/list.js +2 -3
  37. package/masonry/masonry.d.ts +2 -2
  38. package/masonry/masonry.js +2 -2
  39. package/modal/modal-content.js +2 -3
  40. package/modal/modal.d.ts +2 -2
  41. package/modal/modal.js +6 -8
  42. package/package.json +19 -20
  43. package/pagination/pagination.d.ts +2 -4
  44. package/pagination/pagination.js +2 -2
  45. package/prose/prose.js +2 -3
  46. package/select/select.js +2 -3
  47. package/selection-controls/checkbox.js +2 -3
  48. package/selection-controls/radio.js +2 -3
  49. package/selection-controls/toggle.js +2 -3
  50. package/separator/index.d.ts +2 -1
  51. package/separator/index.js +1 -1
  52. package/separator/separator.d.ts +3 -3
  53. package/separator/separator.js +2 -4
  54. package/skeleton-block/skeleton-block.d.ts +1 -1
  55. package/skeleton-block/skeleton-block.js +2 -2
  56. package/slider/slider.js +2 -3
  57. package/snackbar/snackbar.js +2 -3
  58. package/spinner/spinner.d.ts +5 -2
  59. package/spinner/spinner.js +4 -4
  60. package/split-button/split-button.js +2 -3
  61. package/stack/stack.js +2 -3
  62. package/star-meter/star-meter.d.ts +1 -1
  63. package/star-meter/star-meter.js +2 -3
  64. package/tab/tab-item.js +2 -3
  65. package/tab/tab-list.js +1 -2
  66. package/tab/tab-panel.js +2 -2
  67. package/tab/tab.js +2 -2
  68. package/table/table.d.ts +3 -3
  69. package/table/table.js +8 -9
  70. package/table/table.module.css +0 -4
  71. package/text/text.d.ts +0 -1
  72. package/text/text.js +2 -3
  73. package/text/text.module.css +13 -20
  74. package/textfield/base-field/base-field.d.ts +1 -0
  75. package/textfield/base-field/base-field.js +2 -2
  76. package/textfield/base-field/index.d.ts +1 -1
  77. package/textfield/textfield.d.ts +4 -4
  78. package/textfield/textfield.js +3 -4
  79. package/themes/dark.css +1 -1
  80. package/themes/light.css +1 -1
  81. package/themes.css +3 -3
  82. package/title/title.d.ts +0 -1
  83. package/title/title.js +2 -3
  84. package/title/title.module.css +30 -33
  85. package/toggle-button/toggle-button.js +2 -3
  86. package/tooltip/tooltip.d.ts +2 -2
package/avatar/avatar.js CHANGED
@@ -1,11 +1,10 @@
1
1
  import clsx from 'clsx';
2
2
  import React, { forwardRef } from 'react';
3
3
  import { Avatar as AvatarClass, Placeholder } from './avatar.module.css';
4
- export const Avatar = forwardRef(({ className, src, dimension = 'regular', ...props }, forwardedRef) => {
4
+ export const Avatar = forwardRef(({ className, src, dimension = 'regular', ...otherProps }, forwardedRef) => {
5
5
  return (React.createElement("picture", { className: clsx(AvatarClass, className), "data-avatar-dimension": dimension },
6
6
  React.createElement("svg", { "aria-hidden": "true", className: Placeholder, height: 18, viewBox: "0 0 12 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
7
7
  React.createElement("path", { opacity: 0.7, d: "M6 0C3.795 0 2 1.794 2 4s1.795 4 4 4 4-1.794 4-4-1.795-4-4-4z", fill: "var(--highlight-blue-foreground)" }),
8
8
  React.createElement("path", { d: "M8.4 9H3.6C1.612 9 0 10.575 0 12.531v5.126C1.814 18.517 3.85 19 6 19s4.186-.483 6-1.343v-5.126C12 10.581 10.394 9 8.4 9z", fill: "var(--highlight-blue-foreground)" })),
9
- src && (React.createElement("img", { ref: forwardedRef, alt: "", src: src, ...props }))));
9
+ src && (React.createElement("img", { ref: forwardedRef, alt: "", src: src, ...otherProps }))));
10
10
  });
11
- Avatar.displayName = 'Avatar';
@@ -1,7 +1,7 @@
1
- import React, { MouseEvent } from 'react';
1
+ import { FC, MouseEvent } from 'react';
2
2
  import { IconNames } from '../icons/types';
3
3
  import { Polymorphic } from '../';
4
- export declare type ButtonProps = PropsWithClass & {
4
+ export declare type ButtonProps = {
5
5
  kind?: 'primary' | 'secondary' | 'flat';
6
6
  dimension?: 'regular' | 'small' | 'big';
7
7
  fullWidth?: boolean;
@@ -10,12 +10,12 @@ export declare type ButtonProps = PropsWithClass & {
10
10
  iconColor?: string;
11
11
  disabled?: boolean;
12
12
  type?: 'submit' | 'reset' | 'button';
13
- loading?: boolean;
13
+ busy?: boolean;
14
14
  pressed?: boolean;
15
15
  onClick?(event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>): void;
16
16
  };
17
17
  declare type PolymorphicButton = Polymorphic.ForwardRefComponent<'button', ButtonProps>;
18
18
  export declare const Button: PolymorphicButton;
19
19
  export declare type ButtonsGroupProps = PropsWithClass & Pick<ButtonProps, 'dimension' | 'kind'>;
20
- export declare const ButtonsGroup: React.FC<ButtonsGroupProps>;
20
+ export declare const ButtonsGroup: FC<ButtonsGroupProps>;
21
21
  export {};
package/button/button.js CHANGED
@@ -2,7 +2,7 @@ import clsx from 'clsx';
2
2
  import React, { Children, cloneElement, forwardRef, useCallback } from 'react';
3
3
  import { Icon, Spinner } from '../';
4
4
  import { Button as ButtonClass, SpinnerIndicator, ButtonsGroup as ButtonsGroupClass } from './button.module.css';
5
- export const Button = forwardRef(({ kind = 'primary', dimension = 'regular', className, children, fullWidth, icon, disabled, iconPosition = 'left', iconColor, type = 'button', pressed, onClick, loading, as: Wrapper = 'button', ...props }, forwardedRef) => {
5
+ export const Button = forwardRef(({ kind = 'primary', dimension = 'regular', className, children, fullWidth, icon, disabled, iconPosition = 'left', iconColor, type = 'button', pressed, onClick, busy, as: Wrapper = 'button', ...otherProps }, forwardedRef) => {
6
6
  const handleClick = useCallback(() => (event) => {
7
7
  if (!disabled && onClick)
8
8
  onClick(event);
@@ -14,14 +14,13 @@ export const Button = forwardRef(({ kind = 'primary', dimension = 'regular', cla
14
14
  regular: 16,
15
15
  small: 16
16
16
  };
17
- return (React.createElement(Wrapper, { ref: forwardedRef, type: Wrapper === 'button' ? type : undefined, className: clsx(ButtonClass, className), "data-button-icon-position": iconPosition, "data-button-dimension": dimension, "data-button-kind": kind, "data-button-fullwidth": fullWidth, "data-button-disabled": disabled, "data-button-is-loading": loading, "aria-disabled": disabled, "aria-busy": loading, "aria-pressed": Wrapper === 'button' ? pressed : undefined, "aria-live": loading ? 'polite' : undefined, onClick: handleClick(), ...props },
17
+ return (React.createElement(Wrapper, { ref: forwardedRef, type: Wrapper === 'button' ? type : undefined, className: clsx(ButtonClass, className), "data-button-icon-position": iconPosition, "data-button-dimension": dimension, "data-button-kind": kind, "data-button-fullwidth": fullWidth, "aria-disabled": disabled, "aria-busy": busy, "aria-pressed": Wrapper === 'button' ? pressed : undefined, "aria-live": busy ? 'polite' : undefined, onClick: handleClick(), ...otherProps },
18
18
  icon && (React.createElement(Icon, { name: icon, fill: iconColor, dimension: iconSize[dimension] })),
19
- children && React.createElement("span", null, children),
20
- loading && (React.createElement("span", { className: SpinnerIndicator },
19
+ (children && busy) ? React.createElement("span", null, children) : children,
20
+ busy && (React.createElement("span", { className: SpinnerIndicator },
21
21
  React.createElement(Spinner, { dimension: dimension })))));
22
22
  });
23
23
  export const ButtonsGroup = ({ children, className, kind, dimension = 'regular' }) => (React.createElement("div", { className: clsx(ButtonsGroupClass, className) }, Children.map(children, (child) => cloneElement(child, {
24
24
  kind,
25
25
  dimension
26
26
  }))));
27
- Button.displayName = 'Button';
@@ -49,7 +49,7 @@
49
49
  background: var(--cta-default);
50
50
  color: var(--cta-foreground);
51
51
 
52
- &:is(:active) {
52
+ &:not([aria-pressed='true'], [aria-disabled='true']):is(:active) {
53
53
  background: var(--cta-dark);
54
54
  }
55
55
 
@@ -66,7 +66,7 @@
66
66
 
67
67
  color: var(--global-vibrancy-foreground);
68
68
 
69
- &:is(:active) {
69
+ &:not([aria-pressed='true'], [aria-disabled='true']):is(:active) {
70
70
 
71
71
  @mixin vibrancy-hover;
72
72
 
@@ -83,7 +83,7 @@
83
83
  &[data-button-kind='flat'] {
84
84
  color: var(--global-vibrancy-foreground);
85
85
 
86
- &:is(:active) {
86
+ &:not([aria-pressed='true'], [aria-disabled='true']):is(:active) {
87
87
 
88
88
  @mixin vibrancy-hover;
89
89
  }
@@ -112,15 +112,15 @@
112
112
  flex-direction: row-reverse;
113
113
  }
114
114
 
115
- &[data-button-disabled='true'],
116
- &[data-button-disabled='true']:is(:hover, :focus) {
115
+ &[aria-disabled='true'],
116
+ &[aria-disabled='true']:is(:hover, :focus, :active) {
117
117
 
118
118
  @mixin vibrancy-disabled;
119
119
 
120
120
  cursor: not-allowed;
121
121
  }
122
122
 
123
- &[data-button-is-loading='true'] > :not(.SpinnerIndicator) {
123
+ &[aria-busy='true'] > :not(.SpinnerIndicator) {
124
124
  visibility: hidden;
125
125
  }
126
126
  }
package/card/card.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { StackProps, Polymorphic } from '../';
3
3
  import { TokensTypes } from '@wonderflow/tokens/platforms/web/types';
4
- export declare type CardProps = PropsWithClass & Pick<StackProps, 'wrap' | 'columnGap' | 'rowGap' | 'verticalAlign' | 'horizontalAlign'> & {
4
+ export declare type CardProps = Pick<StackProps, 'wrap' | 'columnGap' | 'rowGap' | 'verticalAlign' | 'horizontalAlign'> & {
5
5
  padding?: false | TokensTypes['space'];
6
6
  left?: ReactNode;
7
7
  right?: ReactNode;
package/card/card.js CHANGED
@@ -3,12 +3,12 @@ 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', vibrant = false, highlightOnHover = false, 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, highlightOnHover = false, wrap, style, ...otherProps }, 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, "data-card-vibrant": vibrant, "data-card-highlight-hover": highlightOnHover, ...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-highlight-hover": highlightOnHover, ...otherProps },
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
14
  children && (React.createElement("div", { className: Content }, children)),
package/chip/chip.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import React from 'react';
1
+ import { FC } from 'react';
2
2
  export declare type ChipProps = PropsWithClass & {
3
3
  dimension?: 'small' | 'regular' | 'big';
4
4
  color?: 'gray' | 'cyan' | 'green' | 'purple' | 'yellow' | 'red' | 'blue';
5
5
  interactive?: boolean;
6
6
  onDismissClick?(): void;
7
7
  };
8
- export declare const Chip: React.FC<ChipProps>;
8
+ export declare const Chip: FC<ChipProps>;
package/chip/chip.js CHANGED
@@ -2,7 +2,7 @@ import clsx from 'clsx';
2
2
  import React, { forwardRef } from 'react';
3
3
  import { Icon, Stack } from '../';
4
4
  import { Chip as ChipClass, Action } from './chip.module.css';
5
- export const Chip = forwardRef(({ children, className, dimension = 'regular', color = 'gray', interactive, onDismissClick, ...props }, forwardedRef) => {
5
+ export const Chip = forwardRef(({ children, className, dimension = 'regular', color = 'gray', interactive, onDismissClick, ...otherProps }, forwardedRef) => {
6
6
  const properties = {
7
7
  small: {
8
8
  iconSize: 14
@@ -14,9 +14,8 @@ export const Chip = forwardRef(({ children, className, dimension = 'regular', co
14
14
  iconSize: 16
15
15
  }
16
16
  };
17
- return (React.createElement(Stack, { as: "span", direction: "row", columnGap: 8, inline: true, "data-chip-color": color, "data-chip-dimension": dimension, className: clsx(ChipClass, className), verticalAlign: "center", ref: forwardedRef, ...props },
17
+ return (React.createElement(Stack, { as: "span", direction: "row", columnGap: 8, inline: true, "data-chip-color": color, "data-chip-dimension": dimension, className: clsx(ChipClass, className), verticalAlign: "center", ref: forwardedRef, ...otherProps },
18
18
  React.createElement("b", null, children),
19
19
  interactive && (React.createElement("button", { onClick: interactive && onDismissClick, className: Action, type: "button" },
20
20
  React.createElement(Icon, { name: "xmark", dimension: properties[dimension].iconSize })))));
21
21
  });
22
- Chip.displayName = 'Chip';
@@ -1,12 +1,11 @@
1
1
  import React, { forwardRef, useCallback } from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { CircularProgress as CircularProgressClass } from './circular-progress.module.css';
4
- export const CircularProgress = forwardRef(({ className, value, max = 100, dimension = 'regular', showProgress, style, ...props }, forwardedRef) => {
4
+ export const CircularProgress = forwardRef(({ className, value, max = 100, dimension = 'regular', showProgress, style, ...otherProps }, forwardedRef) => {
5
5
  const getPercentage = useCallback(() => value ? Math.round((100 * value) / max) : 0, [max, value]);
6
6
  const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
7
7
  const dynamicStyle = {
8
8
  '--progress': `${getPercentage()}%`
9
9
  };
10
- return (React.createElement("div", { ref: forwardedRef, role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max, className: clsx(CircularProgressClass, className), "data-circular-progress": clamp(getPercentage(), 0, 100), "data-circular-progress-dimension": dimension, "data-circular-progress-show-progress": showProgress, style: { ...dynamicStyle, ...style }, ...props }));
10
+ return (React.createElement("div", { ref: forwardedRef, role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max, className: clsx(CircularProgressClass, className), "data-circular-progress": clamp(getPercentage(), 0, 100), "data-circular-progress-dimension": dimension, "data-circular-progress-show-progress": showProgress, style: { ...dynamicStyle, ...style }, ...otherProps }));
11
11
  });
12
- CircularProgress.displayName = 'CircularProgress';
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Polymorphic } from '../';
3
- export declare type ClampTextProps = PropsWithClass & {
3
+ export declare type ClampTextProps = {
4
4
  children: ReactNode;
5
5
  rows?: number;
6
6
  };
@@ -1,10 +1,9 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { ClampText as ClampTextClass } from './clamp-text.module.css';
4
- export const ClampText = forwardRef(({ className, children, rows = 1, style, as: Wrapper = 'span', ...props }, forwardedRef) => {
4
+ export const ClampText = forwardRef(({ className, children, rows = 1, style, as: Wrapper = 'span', ...otherProps }, forwardedRef) => {
5
5
  const dynamicStyle = {
6
6
  '--r': rows
7
7
  };
8
- return (React.createElement(Wrapper, { ref: forwardedRef, style: { ...dynamicStyle, ...style }, className: clsx(ClampTextClass, className), ...props }, children));
8
+ return (React.createElement(Wrapper, { ref: forwardedRef, style: { ...dynamicStyle, ...style }, className: clsx(ClampTextClass, className), ...otherProps }, children));
9
9
  });
10
- ClampText.displayName = 'ClampText';
@@ -1,7 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { Container as ContainerClass } from './container.module.css';
3
3
  import clsx from 'clsx';
4
- export const Container = forwardRef(({ children, className, dimension = 'full', padding = true, as: Wrapper = 'div', ...props }, forwardedRef) => {
5
- return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(ContainerClass, className), "data-container-dimension": dimension, "data-container-padding": padding, ...props }, children));
4
+ export const Container = forwardRef(({ children, className, dimension = 'full', padding = true, as: Wrapper = 'div', ...otherProps }, forwardedRef) => {
5
+ return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(ContainerClass, className), "data-container-dimension": dimension, "data-container-padding": padding, ...otherProps }, children));
6
6
  });
7
- Container.displayName = 'Container';
@@ -1,12 +1,7 @@
1
1
  :where(p) {
2
2
  line-height: 1.5;
3
3
  min-block-size: 0.01vh;
4
- font-size:
5
- clamp(
6
- var(--fluid-type-min, env(--font-size-16)),
7
- calc(0.6rem + 0.92vw),
8
- var(--fluid-type-max, 1rem)
9
- );
4
+ font-size: 1rem;
10
5
  }
11
6
 
12
7
  small {
package/core.css CHANGED
@@ -1 +1,5 @@
1
- @import './core/*.css';
1
+ @import './core/basic.css';
2
+ @import './core/elevations.css';
3
+ @import './core/media.css';
4
+ @import './core/typography.css';
5
+ @import './core/vibrancy.css';
@@ -3,7 +3,7 @@ import clsx from 'clsx';
3
3
  import { Disclosure as DisclosureClass, Summary, ExpandIcon, Content } from './disclosure.module.css';
4
4
  import { Text, Icon } from '../';
5
5
  import { motion } from 'framer-motion';
6
- export const Disclosure = forwardRef(({ children, open = false, padding = true, className, summary, contentMaxHeight, dimension = 'regular', iconPosition = 'left', expandable = true, style, ...props }, forwardedRef) => {
6
+ export const Disclosure = forwardRef(({ children, open = false, padding = true, className, summary, contentMaxHeight, dimension = 'regular', iconPosition = 'left', expandable = true, style, ...otherProps }, forwardedRef) => {
7
7
  const [isOpen, setIsOpen] = useState(open);
8
8
  const handleOpen = useCallback(() => (event) => {
9
9
  event.preventDefault();
@@ -24,10 +24,9 @@ export const Disclosure = forwardRef(({ children, open = false, padding = true,
24
24
  }
25
25
  };
26
26
  const renderContent = useCallback(() => (React.createElement(motion.div, { className: Content, "data-disclosure-padding": padding, "data-disclosure-height": Boolean(contentMaxHeight), animate: isOpen ? { y: 5, opacity: 1 } : { y: 0, opacity: 0 }, transition: { ease: 'easeOut', duration: 0.1 }, initial: false }, children)), [children, contentMaxHeight, isOpen, padding]);
27
- return (React.createElement("details", { style: { ...dynamicStyle, ...style }, className: clsx(DisclosureClass, className), "data-disclosure-icon-position": iconPosition, "data-disclosure-dimension": dimension, "data-disclosure-expandable": expandable, "aria-expanded": isOpen ? 'true' : 'false', open: isOpen, ref: forwardedRef, ...props },
28
- React.createElement(Text, { as: "summary", onClick: handleOpen(), className: Summary, fluid: false, "aria-expanded": isOpen, tabIndex: !expandable ? -1 : 0, size: dimension ? sizes[dimension].summary : undefined, weight: "bold" },
27
+ return (React.createElement("details", { style: { ...dynamicStyle, ...style }, className: clsx(DisclosureClass, className), "data-disclosure-icon-position": iconPosition, "data-disclosure-dimension": dimension, "data-disclosure-expandable": expandable, "aria-expanded": isOpen ? 'true' : 'false', open: isOpen, ref: forwardedRef, ...otherProps },
28
+ React.createElement(Text, { as: "summary", onClick: handleOpen(), className: Summary, "aria-expanded": isOpen, tabIndex: !expandable ? -1 : 0, size: dimension ? sizes[dimension].summary : undefined, weight: "bold" },
29
29
  summary,
30
30
  expandable && (React.createElement(Icon, { className: ExpandIcon, name: "chevron-right", dimension: dimension !== 'big' ? 16 : 24 }))),
31
31
  renderContent()));
32
32
  });
33
- Disclosure.displayName = 'Disclosure';
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { IconNames } from '../icons/types';
3
3
  import { Polymorphic } from '../';
4
- export declare type DropdownItemProps = PropsWithClass & {
4
+ export declare type DropdownItemProps = {
5
5
  children: ReactNode;
6
6
  icon?: IconNames;
7
7
  dimension?: 'small' | 'regular';
@@ -22,5 +22,3 @@ export const DropdownItem = forwardRef(({ className, children, onClick, icon, di
22
22
  : InnerContent));
23
23
  });
24
24
  export const DropdownItemCheckbox = forwardRef(({ children, checked, ...props }, forwardedRef) => React.createElement(DropdownItem, { role: "menuitemcheckbox", "aria-checked": checked, ref: forwardedRef, ...props }, children));
25
- DropdownItem.displayName = 'Dropdown.Item';
26
- DropdownItemCheckbox.displayName = 'Dropdown.ItemChecbox';
@@ -1,7 +1,7 @@
1
- import React, { ReactNode } from 'react';
2
- export declare type DropdownMenuProps = PropsWithClass & {
1
+ import React, { ReactNode, HTMLAttributes } from 'react';
2
+ export declare type DropdownMenuProps = HTMLAttributes<HTMLUListElement> & {
3
3
  children: ReactNode;
4
4
  };
5
- export declare const DropdownMenu: React.ForwardRefExoticComponent<PropsWithClass & {
5
+ export declare const DropdownMenu: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLUListElement> & {
6
6
  children: ReactNode;
7
7
  } & React.RefAttributes<HTMLUListElement>>;
@@ -3,13 +3,14 @@ import { RovingTabIndexProvider } from 'react-roving-tabindex';
3
3
  import { Stack, Elevator } from '../';
4
4
  import clsx from 'clsx';
5
5
  import { DropdownMenu as DropdownMenuClass } from './dropdown-menu.module.css';
6
- import { NAME } from '../separator';
7
- export const DropdownMenu = forwardRef(({ className, children, ...props }, forwardedRef) => (React.createElement(Elevator, { resting: 2 },
8
- React.createElement(Stack, { as: "ul", ref: forwardedRef, className: clsx(DropdownMenuClass, className), role: "menu", ...props },
9
- React.createElement(RovingTabIndexProvider, { options: { direction: 'vertical', loopAround: true } }, Children.map(children, (child, index) => {
10
- var _a;
11
- return (React.createElement(Stack, { as: "li", role: "none", verticalPadding: ((_a = child.type) === null || _a === void 0 ? void 0 : _a.displayName) === NAME ? 8 : undefined }, cloneElement(child, {
12
- autoFocus: index === 0 && true
13
- })));
14
- }))))));
15
- DropdownMenu.displayName = 'Dropdown.Menu';
6
+ export const DropdownMenu = forwardRef(({ className, children, ...otherProps }, forwardedRef) => {
7
+ const renderedChildren = Children.toArray(children).filter(Boolean);
8
+ return (React.createElement(Elevator, { resting: 2 },
9
+ React.createElement(Stack, { as: "ul", ref: forwardedRef, className: clsx(DropdownMenuClass, className), role: "menu", ...otherProps },
10
+ React.createElement(RovingTabIndexProvider, { options: { direction: 'vertical', loopAround: true } }, Children.map(renderedChildren, (child, index) => {
11
+ var _a;
12
+ return (React.createElement(Stack, { as: "li", role: "none", verticalPadding: ((_a = child.type) === null || _a === void 0 ? void 0 : _a.displayName) === 'Separator' ? 8 : undefined }, cloneElement(child, {
13
+ autoFocus: index === 0 && true
14
+ })));
15
+ })))));
16
+ });
@@ -9,6 +9,7 @@ import { DropdownItem, DropdownItemCheckbox } from './dropdown-item';
9
9
  import { usePopperTooltip } from 'react-popper-tooltip';
10
10
  import { AnimatePresence, motion } from 'framer-motion';
11
11
  export const Dropdown = forwardRef(({ className, children, trigger, offset = 8, placement = 'auto-start' }, forwardedRef) => {
12
+ const renderedChildren = Children.toArray(children).filter(Boolean);
12
13
  const seedID = useUIDSeed();
13
14
  const popupRef = useRef(forwardedRef);
14
15
  const [isOpen, setIsOpen] = useState(false);
@@ -41,12 +42,11 @@ export const Dropdown = forwardRef(({ className, children, trigger, offset = 8,
41
42
  'aria-expanded': isOpen
42
43
  })),
43
44
  React.createElement(AnimatePresence, null, visible && (React.createElement("div", { ref: setTooltipRef, role: "tooltip", id: seedID('tooltip-content'), className: PopUp, ...getTooltipProps({ className: PopUp }) },
44
- React.createElement(motion.div, { animate: visible ? { y: 5, opacity: 1 } : { y: 0, opacity: 0 }, transition: { ease: 'easeOut', duration: 0.1 } }, Children.map(children, (child) => cloneElement(child, {
45
+ React.createElement(motion.div, { animate: visible ? { y: 5, opacity: 1 } : { y: 0, opacity: 0 }, transition: { ease: 'easeOut', duration: 0.1 } }, Children.map(renderedChildren, (child) => cloneElement(child, {
45
46
  id: seedID('dropdown-menu'),
46
47
  'aria-labelledby': seedID('dropdown-trigger')
47
48
  }))))))));
48
49
  });
49
- Dropdown.displayName = 'Dropdown';
50
50
  Dropdown.Menu = DropdownMenu;
51
51
  Dropdown.Item = DropdownItem;
52
52
  Dropdown.ItemCheckbox = DropdownItemCheckbox;
@@ -1,7 +1,7 @@
1
- import React, { ReactElement } from 'react';
1
+ import { FC, ReactElement } from 'react';
2
2
  export declare type ElevatorProps = {
3
3
  resting: 0 | 1 | 2 | 3 | 4;
4
4
  hover?: 0 | 1 | 2 | 3 | 4;
5
5
  children: ReactElement;
6
6
  };
7
- export declare const Elevator: React.FC<ElevatorProps>;
7
+ export declare const Elevator: FC<ElevatorProps>;
package/grid/grid-item.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { GridItem as GridItemClass } from './grid.module.css';
4
- export const GridItem = forwardRef(({ children, style, className, fullWidth = false, column, row, ...props }, forwardedRef) => {
4
+ export const GridItem = forwardRef(({ children, style, className, fullWidth = false, column, row, ...otherProps }, forwardedRef) => {
5
5
  const dynamicStyle = {
6
6
  '--column': column,
7
7
  '--row': row
8
8
  };
9
- return (React.createElement("li", { ref: forwardedRef, className: clsx(GridItemClass, className), style: { ...dynamicStyle, ...style }, "data-grid-item-fullwidth": fullWidth, ...props }, children));
9
+ return (React.createElement("li", { ref: forwardedRef, className: clsx(GridItemClass, className), style: { ...dynamicStyle, ...style }, "data-grid-item-fullwidth": fullWidth, ...otherProps }, children));
10
10
  });
11
11
  GridItem.displayName = 'Grid.Item';
package/grid/grid.js CHANGED
@@ -3,7 +3,7 @@ import clsx from 'clsx';
3
3
  import tksn from '@wonderflow/tokens/platforms/web/tokens.json';
4
4
  import { GridItem } from './grid-item';
5
5
  import { Grid as GridClass } from './grid.module.css';
6
- export const Grid = forwardRef(({ className, children, columns, rows, rowGap = 8, columnGap = 8, style, filling = 'fill', colMinWidth = '10rem', rowMinHeight = '1fr', ...props }, forwardedRef) => {
6
+ export const Grid = forwardRef(({ className, children, columns, rows, rowGap = 8, columnGap = 8, style, filling = 'fill', colMinWidth = '10rem', rowMinHeight = '1fr', ...otherProps }, forwardedRef) => {
7
7
  const computedStyle = {
8
8
  '--rGap': rowGap && tksn.space[rowGap],
9
9
  '--cGap': columnGap && tksn.space[columnGap],
@@ -12,7 +12,6 @@ export const Grid = forwardRef(({ className, children, columns, rows, rowGap = 8
12
12
  '--rows': rows,
13
13
  '--row-min-h': rowMinHeight
14
14
  };
15
- return (React.createElement("ul", { className: clsx(GridClass, className), style: { ...computedStyle, ...style }, "data-grid-filling-type": filling, ref: forwardedRef, ...props }, children));
15
+ return (React.createElement("ul", { className: clsx(GridClass, className), style: { ...computedStyle, ...style }, "data-grid-filling-type": filling, ref: forwardedRef, ...otherProps }, children));
16
16
  });
17
- Grid.displayName = 'Grid';
18
17
  Grid.Item = GridItem;
package/icon/icon.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import sprite from '../icons/all.svg';
3
- export const Icon = forwardRef(({ className, name, dimension = 16, fill, ...props }, forwardedRef) => {
3
+ export const Icon = forwardRef(({ className, name, dimension = 16, fill, ...otherProps }, forwardedRef) => {
4
4
  const computedSize = dimension < 24 ? 16 : 24;
5
- return (React.createElement("svg", { "aria-hidden": "true", width: dimension, height: dimension, fill: fill, className: className, ref: forwardedRef, ...props },
5
+ return (React.createElement("svg", { "aria-hidden": "true", width: dimension, height: dimension, fill: fill, className: className, ref: forwardedRef, ...otherProps },
6
6
  React.createElement("use", { href: `${sprite}#${computedSize}/${name}` })));
7
7
  });
8
8
  Icon.displayName = 'Icon';
@@ -1,5 +1,5 @@
1
1
  import { Button, ButtonProps, Polymorphic } from '../';
2
- export declare type IconButtonProps = PropsWithClass & Pick<ButtonProps, 'kind' | 'dimension' | 'icon' | 'disabled' | 'onClick' | 'loading'>;
2
+ export declare type IconButtonProps = Pick<ButtonProps, 'kind' | 'dimension' | 'icon' | 'disabled' | 'onClick' | 'busy'>;
3
3
  declare type PolymorphicIconButton = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Button>, Polymorphic.OwnProps<typeof Button> & IconButtonProps>;
4
4
  export declare const IconButton: PolymorphicIconButton;
5
5
  export {};
@@ -2,5 +2,4 @@ import React, { forwardRef } from 'react';
2
2
  import { IconButton as IconButtonClass } from './icon-button.module.css';
3
3
  import { Button } from '../';
4
4
  import clsx from 'clsx';
5
- export const IconButton = forwardRef(({ className, icon, dimension, kind, disabled, loading, ...props }, forwardedRef) => (React.createElement(Button, { ref: forwardedRef, icon: icon, dimension: dimension, kind: kind, disabled: disabled, loading: loading, className: clsx(IconButtonClass, className), ...props })));
6
- IconButton.displayName = 'IconButton';
5
+ export const IconButton = forwardRef(({ className, icon, dimension, kind, disabled, busy, ...otherProps }, forwardedRef) => (React.createElement(Button, { ref: forwardedRef, icon: icon, dimension: dimension, kind: kind, disabled: disabled, busy: busy, className: clsx(IconButtonClass, className), ...otherProps })));
package/index.d.ts CHANGED
@@ -24,7 +24,7 @@ export { LinearProgress, LinearProgressProps } from './linear-progress';
24
24
  export { Prose, ProseProps } from './prose';
25
25
  export { Pagination, PaginationProps } from './pagination';
26
26
  export { Select, SelectProps } from './select';
27
- export { Separator, NAME } from './separator';
27
+ export { Separator, SeparatorProps } from './separator';
28
28
  export { SkeletonBlock, SkeletonBlockProps } from './skeleton-block';
29
29
  export { Slider, SliderProps } from './slider';
30
30
  export { Snackbar, SnackbarProps } from './snackbar';
package/index.js CHANGED
@@ -24,7 +24,7 @@ export { LinearProgress } from './linear-progress';
24
24
  export { Prose } from './prose';
25
25
  export { Pagination } from './pagination';
26
26
  export { Select } from './select';
27
- export { Separator, NAME } from './separator';
27
+ export { Separator } from './separator';
28
28
  export { SkeletonBlock } from './skeleton-block';
29
29
  export { Slider } from './slider';
30
30
  export { Snackbar } from './snackbar';
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  import { IconNames } from '../icons/types';
3
3
  import { StackProps } from '../';
4
4
  export declare type InfoStateProps = PropsWithClass & {
@@ -9,4 +9,4 @@ export declare type InfoStateProps = PropsWithClass & {
9
9
  iconColor?: 'gray' | 'cyan' | 'green' | 'purple' | 'yellow' | 'red' | 'blue';
10
10
  actions?: ReactNode;
11
11
  };
12
- export declare const InfoState: React.FC<InfoStateProps>;
12
+ export declare const InfoState: FC<InfoStateProps>;
@@ -1,9 +1,9 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { Stack, Icon, Title, Text } from '../';
3
3
  import { IconWrapper, Image } from './info-state.module.css';
4
- export const InfoState = forwardRef(({ className, children, title, icon, image, direction = 'column', iconColor = 'blue', actions, ...props }, forwardedRef) => {
4
+ export const InfoState = forwardRef(({ className, children, title, icon, image, direction = 'column', iconColor = 'blue', actions, ...otherProps }, forwardedRef) => {
5
5
  const isHorizontal = direction === 'row';
6
- return (React.createElement(Stack, { ref: forwardedRef, direction: direction, rowGap: 24, columnGap: 32, className: className, horizontalAlign: isHorizontal ? 'start' : 'center', verticalAlign: (isHorizontal && image) ? 'center' : 'start', fill: false, wrap: !!image, ...props },
6
+ return (React.createElement(Stack, { ref: forwardedRef, direction: direction, rowGap: 24, columnGap: 32, className: className, horizontalAlign: isHorizontal ? 'start' : 'center', verticalAlign: (isHorizontal && image) ? 'center' : 'start', fill: false, wrap: !!image, ...otherProps },
7
7
  (!image && icon) && (React.createElement("span", { "data-info-state-icon-color": iconColor, className: IconWrapper },
8
8
  React.createElement(Icon, { name: icon, dimension: 48 }))),
9
9
  (image && !icon) && React.createElement("img", { className: Image, alt: "", width: "400", src: image, loading: "lazy", decoding: "async" }),
@@ -12,4 +12,3 @@ export const InfoState = forwardRef(({ className, children, title, icon, image,
12
12
  React.createElement(Text, { maxWidth: "60ch", dimmed: 6, textAlign: isHorizontal ? 'start' : 'center' }, children),
13
13
  actions && (React.createElement(Stack, { verticalPadding: 16, inline: true, direction: "row", columnGap: 16, rowGap: 16, wrap: true }, actions)))));
14
14
  });
15
- InfoState.displayName = 'InfoState';
@@ -3,11 +3,11 @@ import React, { Children, cloneElement, forwardRef } from 'react';
3
3
  import { Stack, Text } from '../';
4
4
  import { useUIDSeed } from 'react-uid';
5
5
  import { End, InputField, Start, InputGroup as InputGroupClass } from './input-group.module.css';
6
- export const InputGroup = forwardRef(({ className, input, end, start, label, dimension = 'regular', ...props }, forwardedRef) => {
6
+ export const InputGroup = forwardRef(({ className, input, end, start, label, dimension = 'regular', ...otherProps }, forwardedRef) => {
7
7
  const uid = useUIDSeed();
8
- return (React.createElement(Stack, { rowGap: 4, horizontalAlign: "stretch", verticalAlign: "start" },
8
+ return (React.createElement(Stack, { rowGap: 4, horizontalAlign: "stretch", verticalAlign: "start", fill: false },
9
9
  label && React.createElement(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: uid('field') }, label),
10
- React.createElement(Stack, { as: "fieldset", direction: "row", verticalAlign: "start", horizontalAlign: "start", fill: false, inline: true, ref: forwardedRef, className: clsx(InputGroupClass, className), "data-input-group-has-end": Boolean(end), "data-input-group-has-start": !!start, ...props },
10
+ React.createElement(Stack, { as: "fieldset", direction: "row", verticalAlign: "start", horizontalAlign: "start", fill: false, inline: true, ref: forwardedRef, className: clsx(InputGroupClass, className), "data-input-group-has-end": Boolean(end), "data-input-group-has-start": !!start, ...otherProps },
11
11
  React.createElement("div", { className: Start }, Children.map(start, (child) => cloneElement(child, {
12
12
  dimension
13
13
  }))),
@@ -19,4 +19,3 @@ export const InputGroup = forwardRef(({ className, input, end, start, label, dim
19
19
  dimension
20
20
  }))))));
21
21
  });
22
- InputGroup.displayName = 'InputGroup';
@@ -11,9 +11,6 @@
11
11
  }
12
12
 
13
13
  .InputField {
14
- & input {
15
- outline-offset: -3px;
16
- }
17
14
 
18
15
  @nest .InputGroup[data-input-group-has-end='true'] & input {
19
16
  border-top-right-radius: 0;
@@ -1,13 +1,13 @@
1
- import React from 'react';
2
- export declare type LinearProgressProps = PropsWithClass & {
1
+ import React, { ProgressHTMLAttributes } from 'react';
2
+ export declare type LinearProgressProps = ProgressHTMLAttributes<HTMLProgressElement> & {
3
3
  value?: number;
4
4
  max?: number;
5
5
  dimension?: 'regular' | 'big';
6
6
  showProgress?: boolean;
7
7
  };
8
- export declare const LinearProgress: React.ForwardRefExoticComponent<PropsWithClass & {
8
+ export declare const LinearProgress: React.ForwardRefExoticComponent<React.ProgressHTMLAttributes<HTMLProgressElement> & {
9
9
  value?: number | undefined;
10
10
  max?: number | undefined;
11
11
  dimension?: "big" | "regular" | undefined;
12
12
  showProgress?: boolean | undefined;
13
- } & React.RefAttributes<HTMLDivElement>>;
13
+ } & React.RefAttributes<HTMLProgressElement>>;
@@ -2,14 +2,13 @@ import React, { forwardRef, useCallback } from 'react';
2
2
  import { Text } from '../';
3
3
  import clsx from 'clsx';
4
4
  import { LinearProgress as LinearProgressClass, Progress, Percentage } from './linear-progress.module.css';
5
- export const LinearProgress = forwardRef(({ className, value, max = 100, dimension = 'regular', showProgress, ...props }, forwardedRef) => {
5
+ export const LinearProgress = forwardRef(({ className, value, max = 100, dimension = 'regular', showProgress, ...otherProps }, forwardedRef) => {
6
6
  const getPercentage = useCallback(() => value ? Math.round((100 * value) / max) : 0, [max, value]);
7
7
  const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
8
- return (React.createElement("div", { ref: forwardedRef, className: clsx(LinearProgressClass, className) },
9
- React.createElement("progress", { role: "progressbar", className: Progress, "data-progress-dimension": dimension, "aria-valuemin": 0, "aria-valuenow": value, "aria-valuemax": max, value: value, max: max, ...props }),
8
+ return (React.createElement("div", { className: clsx(LinearProgressClass, className) },
9
+ React.createElement("progress", { role: "progressbar", ref: forwardedRef, className: Progress, "data-progress-dimension": dimension, "aria-valuemin": 0, "aria-valuenow": value, "aria-valuemax": max, value: value, max: max, ...otherProps }),
10
10
  (showProgress) && (React.createElement(Text, { as: "span", className: Percentage, style: {
11
11
  '--offset': `${getPercentage()}%`,
12
12
  '--translation': value !== 0 ? '-100%' : '-50%'
13
13
  }, weight: "bold", size: dimension === 'regular' ? 16 : 18 }, value && clamp(getPercentage(), 0, 100)))));
14
14
  });
15
- LinearProgress.displayName = 'LinearProgress';
package/list/list.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IconNames } from '../icons/types';
2
2
  import { Polymorphic } from '../';
3
- export declare type ListProps = PropsWithClass & {
3
+ export declare type ListProps = {
4
4
  dimension?: 'small' | 'regular' | 'big';
5
5
  marker?: IconNames;
6
6
  markerColor?: string;
package/list/list.js CHANGED
@@ -2,7 +2,7 @@ import React, { Children, forwardRef, useMemo } from 'react';
2
2
  import { List as ListClass, Marker } from './list.module.css';
3
3
  import clsx from 'clsx';
4
4
  import { Text, Icon } from '../';
5
- export const List = forwardRef(({ as: Wrapper = 'ul', children, marker = 'circle', dimension = 'regular', className, markerColor, hideMarker = false, ...props }, forwardedRef) => {
5
+ export const List = forwardRef(({ as: Wrapper = 'ul', children, marker = 'circle', dimension = 'regular', className, markerColor, hideMarker = false, ...otherProps }, forwardedRef) => {
6
6
  const sizes = {
7
7
  small: {
8
8
  text: 16,
@@ -18,8 +18,7 @@ export const List = forwardRef(({ as: Wrapper = 'ul', children, marker = 'circle
18
18
  }
19
19
  };
20
20
  const isUnordered = useMemo(() => Wrapper === 'ul', [Wrapper]);
21
- return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(ListClass, className), "data-list-size": dimension, "data-list-ordered": !isUnordered, "data-list-no-marker": hideMarker, ...props }, Children.map(children, (child) => (React.createElement(Text, { as: "li", size: sizes[dimension].text },
21
+ return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(ListClass, className), "data-list-size": dimension, "data-list-ordered": !isUnordered, "data-list-no-marker": hideMarker, ...otherProps }, Children.map(children, (child) => (React.createElement(Text, { as: "li", size: sizes[dimension].text },
22
22
  isUnordered && (React.createElement(Icon, { name: marker, className: Marker, fill: markerColor, dimension: marker !== 'circle' ? sizes[dimension].icon : 16 })),
23
23
  child.props.children)))));
24
24
  });
25
- List.displayName = 'List';
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { FC } from 'react';
2
2
  import { TokensTypes } from '@wonderflow/tokens/platforms/web/types';
3
3
  export declare type MasonryProps = PropsWithClass & {
4
4
  gutter?: 0 | TokensTypes['space'];
@@ -11,4 +11,4 @@ export declare type MasonryProps = PropsWithClass & {
11
11
  extraLarge?: number;
12
12
  };
13
13
  };
14
- export declare const Masonry: React.FC<MasonryProps>;
14
+ export declare const Masonry: FC<MasonryProps>;