@wonderflow/react-components 3.0.0-next.1 → 3.0.0-next.5

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 (111) hide show
  1. package/avatar/avatar.js +2 -2
  2. package/button/button.d.ts +4 -4
  3. package/button/button.js +4 -5
  4. package/button/button.module.css +22 -19
  5. package/card/card.d.ts +1 -1
  6. package/card/card.js +2 -2
  7. package/chip/chip.d.ts +10 -3
  8. package/chip/chip.js +2 -2
  9. package/circular-progress/circular-progress.js +2 -2
  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 -3
  16. package/dropdown/dropdown-item.d.ts +1 -1
  17. package/dropdown/dropdown-item.js +2 -2
  18. package/dropdown/dropdown-menu.d.ts +3 -3
  19. package/dropdown/dropdown-menu.js +11 -5
  20. package/dropdown/dropdown.d.ts +9 -19
  21. package/dropdown/dropdown.js +7 -5
  22. package/elevator/elevator.d.ts +2 -2
  23. package/grid/grid-item.d.ts +5 -1
  24. package/grid/grid-item.js +5 -4
  25. package/grid/grid.d.ts +5 -21
  26. package/grid/grid.js +3 -3
  27. package/grid/index.d.ts +1 -1
  28. package/grid/index.js +1 -1
  29. package/icon/icon.js +2 -2
  30. package/icon-button/icon-button.d.ts +1 -1
  31. package/icon-button/icon-button.js +1 -2
  32. package/icons/all.svg +15 -7
  33. package/icons/structure.json +2 -0
  34. package/icons/types.d.ts +4 -0
  35. package/index.d.ts +3 -3
  36. package/index.js +2 -2
  37. package/info-state/info-state.d.ts +12 -3
  38. package/info-state/info-state.js +2 -2
  39. package/input-group/input-group.js +3 -3
  40. package/input-group/input-group.module.css +0 -3
  41. package/linear-progress/linear-progress.d.ts +4 -4
  42. package/linear-progress/linear-progress.js +3 -3
  43. package/list/list.d.ts +2 -1
  44. package/list/list.js +2 -3
  45. package/list/list.module.css +7 -0
  46. package/masonry/masonry.d.ts +2 -2
  47. package/masonry/masonry.js +2 -2
  48. package/modal/{modal-content.d.ts → content/modal-content.d.ts} +0 -0
  49. package/modal/{modal-content.js → content/modal-content.js} +5 -5
  50. package/modal/{modal-content.module.css → content/modal-content.module.css} +1 -1
  51. package/modal/index.d.ts +1 -1
  52. package/modal/index.js +1 -1
  53. package/modal/modal-context.d.ts +5 -5
  54. package/modal/modal-context.js +10 -1
  55. package/modal/modal.d.ts +5 -8
  56. package/modal/modal.js +10 -24
  57. package/overlay-container/index.d.ts +2 -0
  58. package/overlay-container/index.js +1 -0
  59. package/overlay-container/overlay-container.d.ts +6 -0
  60. package/overlay-container/overlay-container.js +15 -0
  61. package/package.json +30 -30
  62. package/pagination/pagination.d.ts +2 -4
  63. package/pagination/pagination.js +2 -2
  64. package/prose/prose.js +2 -3
  65. package/select/select.js +2 -2
  66. package/selection-controls/checkbox.js +2 -2
  67. package/selection-controls/radio.js +2 -2
  68. package/selection-controls/toggle.js +2 -2
  69. package/separator/index.d.ts +1 -0
  70. package/separator/separator.d.ts +3 -2
  71. package/separator/separator.js +2 -2
  72. package/skeleton-block/skeleton-block.d.ts +1 -1
  73. package/skeleton-block/skeleton-block.js +2 -2
  74. package/slider/slider.js +2 -2
  75. package/snackbar/snackbar.js +2 -3
  76. package/spinner/spinner.d.ts +5 -2
  77. package/spinner/spinner.js +5 -4
  78. package/split-button/split-button.js +2 -3
  79. package/stack/stack.js +2 -3
  80. package/star-meter/star-meter.d.ts +1 -1
  81. package/star-meter/star-meter.js +2 -3
  82. package/tab/index.d.ts +1 -1
  83. package/tab/index.js +1 -1
  84. package/tab/tab-item.d.ts +3 -1
  85. package/tab/tab-item.js +5 -5
  86. package/tab/tab-list.d.ts +3 -2
  87. package/tab/tab-list.js +2 -1
  88. package/tab/tab-panel.d.ts +4 -1
  89. package/tab/tab-panel.js +3 -2
  90. package/tab/tab.d.ts +10 -8
  91. package/tab/tab.js +6 -7
  92. package/table/table.d.ts +3 -3
  93. package/table/table.js +8 -9
  94. package/table/table.module.css +0 -4
  95. package/text/text.d.ts +1 -1
  96. package/text/text.js +2 -3
  97. package/text/text.module.css +22 -24
  98. package/textfield/base-field/base-field.d.ts +1 -0
  99. package/textfield/base-field/base-field.js +2 -2
  100. package/textfield/base-field/index.d.ts +1 -1
  101. package/textfield/textfield.d.ts +4 -4
  102. package/textfield/textfield.js +3 -3
  103. package/themes/dark.css +1 -1
  104. package/themes/light.css +1 -1
  105. package/themes.css +3 -3
  106. package/title/title.d.ts +1 -1
  107. package/title/title.js +2 -3
  108. package/title/title.module.css +60 -35
  109. package/toggle-button/toggle-button.js +2 -3
  110. package/toggle-button/toggle-button.module.css +16 -2
  111. package/tooltip/tooltip.d.ts +2 -2
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": "3.0.0-next.1",
4
+ "version": "3.0.0-next.5",
5
5
  "author": "Wonderflow",
6
6
  "license": "MIT",
7
7
  "main": "index.js",
@@ -9,7 +9,8 @@
9
9
  "access": "public"
10
10
  },
11
11
  "engines": {
12
- "node": "16.x"
12
+ "node": ">=14.x",
13
+ "npm": ">=8.x.x"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -57,52 +58,51 @@
57
58
  },
58
59
  "dependencies": {
59
60
  "@react-aria/interactions": "3.7.0",
60
- "@wonderflow/eslint-config": "1.1.5",
61
- "@wonderflow/stylelint-config": "1.0.3",
62
- "@wonderflow/tokens": "1.3.6",
61
+ "@wonderflow/eslint-config": "1.1.7",
62
+ "@wonderflow/stylelint-config": "1.1.3",
63
+ "@wonderflow/tokens": "1.3.7",
63
64
  "clsx": "1.1.1",
64
- "flat": "5.0.2",
65
65
  "framer-motion": "4.1.17",
66
- "postcss": "8.4.1",
67
- "react": ">=17.0.2",
66
+ "postcss": "^8.4.5",
67
+ "react": "^17.0",
68
68
  "react-data-table-component": "7.4.5",
69
- "react-dom": ">=17.0.2",
69
+ "react-dom": "^17.0",
70
70
  "react-focus-on": "3.5.4",
71
71
  "react-loading-skeleton": "3.0.1",
72
72
  "react-masonry-css": "1.0.16",
73
- "react-paginate": "github:AdeleD/react-paginate",
73
+ "react-paginate": "8.1.0",
74
74
  "react-popper-tooltip": "4.3.1",
75
75
  "react-roving-tabindex": "3.1.1",
76
76
  "react-uid": "2.3.1",
77
77
  "react-use": "17.3.1",
78
78
  "style-dictionary": "3.0.3",
79
- "type-fest": "2.6.0"
79
+ "type-fest": "2.8.0"
80
80
  },
81
81
  "peerDependencies": {
82
- "react": ">=17.0.2",
83
- "react-dom": ">=17.0.2"
82
+ "postcss": "^8.4.5",
83
+ "react": "^17.0",
84
+ "react-dom": "^17.0"
84
85
  },
85
86
  "devDependencies": {
86
- "@babel/core": "7.16.0",
87
- "@commitlint/cli": "14.1.0",
88
- "@commitlint/config-conventional": "14.1.0",
87
+ "@babel/core": "7.16.5",
88
+ "@commitlint/cli": "15.0.0",
89
+ "@commitlint/config-conventional": "15.0.0",
89
90
  "@semantic-release/exec": "6.0.2",
90
91
  "@semantic-release/git": "10.0.1",
91
92
  "@semantic-release/github": "8.0.2",
92
93
  "@semantic-release/npm": "8.0.3",
93
94
  "@semantic-release/release-notes-generator": "10.0.3",
94
- "@storybook/addon-actions": "6.3.12",
95
- "@storybook/addon-essentials": "6.3.12",
96
- "@storybook/addon-links": "6.3.12",
95
+ "@storybook/addon-actions": "6.4.9",
96
+ "@storybook/addon-essentials": "6.4.9",
97
+ "@storybook/addon-links": "6.4.9",
97
98
  "@storybook/addon-postcss": "2.0.0",
98
- "@storybook/addons": "6.3.12",
99
- "@storybook/react": "6.3.12",
100
- "@storybook/theming": "6.3.12",
101
- "@types/flat": "5.0.2",
99
+ "@storybook/addons": "6.4.9",
100
+ "@storybook/react": "6.4.9",
101
+ "@storybook/theming": "6.4.9",
102
102
  "@types/react-dom": "17.0.11",
103
- "@typescript-eslint/eslint-plugin": "5.4.0",
104
- "@typescript-eslint/parser": "5.4.0",
105
- "@wonderflow/config": "1.5.5",
103
+ "@typescript-eslint/eslint-plugin": "5.7.0",
104
+ "@typescript-eslint/parser": "5.7.0",
105
+ "@wonderflow/config": "1.6.3",
106
106
  "babel-loader": "8.2.3",
107
107
  "commit-analyzer-fail-on-no-release": "1.0.0",
108
108
  "commitizen": "4.2.4",
@@ -110,13 +110,13 @@
110
110
  "cz-conventional-changelog": "3.3.0",
111
111
  "directory-tree": "3.0.1",
112
112
  "eslint": "7.32.0",
113
+ "eslint-plugin-react": "7.27.1",
113
114
  "fs-extra": "10.0.0",
114
115
  "husky": "7.0.4",
115
116
  "is-ci": "3.0.1",
116
- "nanospinner": "0.4.0",
117
+ "nanospinner": "0.6.0",
117
118
  "npm-run-all": "4.1.5",
118
119
  "picocolors": "1.0.0",
119
- "postcss-mixins": "8.1.0",
120
120
  "rimraf": "3.0.2",
121
121
  "semantic-release": "18.0.1",
122
122
  "storybook-addon-themes": "6.1.0",
@@ -124,9 +124,9 @@
124
124
  "stylelint": "14.1.0",
125
125
  "svgo": "2.8.0",
126
126
  "svgstore": "3.0.1",
127
- "typescript": "4.5.2",
127
+ "typescript": "4.5.4",
128
128
  "typescript-plugin-css-modules": "3.4.0",
129
- "yargs": "17.2.1"
129
+ "yargs": "17.3.0"
130
130
  },
131
131
  "resolutions": {
132
132
  "rc": "1.2.8"
@@ -1,12 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { ReactPaginateProps } from 'react-paginate';
3
- import { Except } from 'type-fest';
4
- export declare type PaginationProps = PropsWithClass & Except<ReactPaginateProps, 'pageCount' | 'pageRangeDisplayed' | 'marginPagesDisplayed'> & {
3
+ export declare type PaginationProps = ReactPaginateProps & {
5
4
  itemsCount: number;
6
5
  itemsPerPage?: number;
7
6
  onPageClick?(offset: Record<string, number>): void;
8
- pageCount?: ReactPaginateProps['pageCount'];
9
7
  pageRangeDisplayed?: ReactPaginateProps['pageRangeDisplayed'];
10
8
  marginPagesDisplayed?: ReactPaginateProps['marginPagesDisplayed'];
11
9
  };
12
- export declare const Pagination: ({ className, itemsCount, itemsPerPage, onPageClick, pageCount, pageRangeDisplayed, marginPagesDisplayed, ...props }: PaginationProps) => JSX.Element;
10
+ export declare const Pagination: ({ className, itemsCount, itemsPerPage, onPageClick, pageCount, pageRangeDisplayed, marginPagesDisplayed, ...otherProps }: PaginationProps) => JSX.Element;
@@ -3,7 +3,7 @@ import React, { useCallback, useEffect, useState } from 'react';
3
3
  import ReactPaginate from 'react-paginate';
4
4
  import { Icon } from '../';
5
5
  import { Pagination as PaginationClass } from './pagination.module.css';
6
- export const Pagination = ({ className, itemsCount, itemsPerPage = 10, onPageClick, pageCount, pageRangeDisplayed = 3, marginPagesDisplayed = 1, ...props }) => {
6
+ export const Pagination = ({ className, itemsCount, itemsPerPage = 10, onPageClick, pageCount, pageRangeDisplayed = 3, marginPagesDisplayed = 1, ...otherProps }) => {
7
7
  const [computedPageCount, setComputedPageCount] = useState(0);
8
8
  useEffect(() => {
9
9
  itemsCount && setComputedPageCount(Math.ceil(itemsCount / itemsPerPage));
@@ -12,5 +12,5 @@ export const Pagination = ({ className, itemsCount, itemsPerPage = 10, onPageCli
12
12
  const newOffset = (event.selected * itemsPerPage) % itemsCount;
13
13
  onPageClick && onPageClick({ ...event, offset: newOffset });
14
14
  }, [itemsPerPage, onPageClick, itemsCount]);
15
- return (React.createElement(ReactPaginate, { containerClassName: clsx(PaginationClass, className), breakLabel: "...", nextLabel: React.createElement(Icon, { dimension: 16, name: "chevron-right" }), previousLabel: React.createElement(Icon, { dimension: 16, name: "chevron-left" }), onPageChange: handlePageClick, pageRangeDisplayed: pageRangeDisplayed, pageCount: pageCount || computedPageCount, marginPagesDisplayed: marginPagesDisplayed, ...props }));
15
+ return (React.createElement(ReactPaginate, { containerClassName: clsx(PaginationClass, className), breakLabel: "...", nextLabel: React.createElement(Icon, { dimension: 16, name: "chevron-right" }), previousLabel: React.createElement(Icon, { dimension: 16, name: "chevron-left" }), onPageChange: handlePageClick, pageRangeDisplayed: pageRangeDisplayed, pageCount: pageCount || computedPageCount, marginPagesDisplayed: marginPagesDisplayed, ...otherProps }));
16
16
  };
package/prose/prose.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { Prose as ProseClass } from './prose.module.css';
3
3
  import clsx from 'clsx';
4
- export const Prose = forwardRef(({ children, className, as: Wrapper = 'div', ...props }, forwardedRef) => {
5
- return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(ProseClass, className), ...props }, children));
4
+ export const Prose = forwardRef(({ children, className, as: Wrapper = 'div', ...otherProps }, forwardedRef) => {
5
+ return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(ProseClass, className), ...otherProps }, children));
6
6
  });
7
- Prose.displayName = 'Prose';
package/select/select.js CHANGED
@@ -3,7 +3,7 @@ import { Text, Stack, Icon } from '../';
3
3
  import { Select as SelectClass, FieldContainer, Icon as IconClass, Field } from './select.module.css';
4
4
  import clsx from 'clsx';
5
5
  import { useUIDSeed } from 'react-uid';
6
- export const Select = forwardRef(({ children, className, disabled = false, icon = 'sort-alt', label, kind = 'single', dimension = 'regular', onChange, ...props }, forwardedRef) => {
6
+ export const Select = forwardRef(({ children, className, disabled = false, icon = 'sort-alt', label, kind = 'single', dimension = 'regular', onChange, ...otherProps }, forwardedRef) => {
7
7
  const uid = useUIDSeed();
8
8
  const iconSizes = {
9
9
  small: 14,
@@ -13,7 +13,7 @@ export const Select = forwardRef(({ children, className, disabled = false, icon
13
13
  return (React.createElement(Stack, { as: "fieldset", rowGap: 4, className: clsx(SelectClass, className), "data-select-is-multiple": kind === 'multiple', "data-select-has-label": Boolean(label), "data-select-dimension": dimension, "aria-disabled": disabled, horizontalAlign: "start", verticalAlign: "start", inline: true, tabIndex: disabled ? 0 : undefined },
14
14
  label && React.createElement(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: uid('select') }, label),
15
15
  React.createElement("div", { className: FieldContainer },
16
- React.createElement("select", { disabled: disabled, className: Field, id: uid('select'), multiple: kind === 'multiple', onChange: onChange, ref: forwardedRef, ...props }, children),
16
+ React.createElement("select", { disabled: disabled, className: Field, id: uid('select'), multiple: kind === 'multiple', onChange: onChange, ref: forwardedRef, ...otherProps }, children),
17
17
  kind === 'single' && (React.createElement(Icon, { className: IconClass, name: icon, dimension: iconSizes[dimension] })))));
18
18
  });
19
19
  Select.displayName = 'Select';
@@ -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, 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 }));
4
+ export const Checkbox = forwardRef(({ className, disabled, dimension = 'regular', onChange, indeterminate, ...otherProps }, 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, ...otherProps }));
6
6
  });
7
7
  Checkbox.displayName = 'Checkbox';
@@ -1,7 +1,7 @@
1
1
  import clsx from 'clsx';
2
2
  import React, { forwardRef } from 'react';
3
3
  import { Radio as RadioClass } from './selection-controls.module.css';
4
- export const Radio = forwardRef(({ className, disabled, dimension = 'regular', onChange, ...props }, forwardedRef) => {
5
- return (React.createElement("input", { type: "radio", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(RadioClass, className), ref: forwardedRef, ...props }));
4
+ export const Radio = forwardRef(({ className, disabled, dimension = 'regular', onChange, ...otherProps }, forwardedRef) => {
5
+ return (React.createElement("input", { type: "radio", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(RadioClass, className), ref: forwardedRef, ...otherProps }));
6
6
  });
7
7
  Radio.displayName = 'Radio';
@@ -1,7 +1,7 @@
1
1
  import clsx from 'clsx';
2
2
  import React, { forwardRef } from 'react';
3
3
  import { Toggle as ToggleClass } from './selection-controls.module.css';
4
- export const Toggle = 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(ToggleClass, className), ref: forwardedRef, ...props }));
4
+ export const Toggle = forwardRef(({ className, disabled, dimension = 'regular', onChange, ...otherProps }, forwardedRef) => {
5
+ return (React.createElement("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(ToggleClass, className), ref: forwardedRef, ...otherProps }));
6
6
  });
7
7
  Toggle.displayName = 'Toggle';
@@ -1 +1,2 @@
1
1
  export { Separator } from './separator';
2
+ export type { SeparatorProps } from './separator';
@@ -1,2 +1,3 @@
1
- import React from 'react';
2
- export declare const Separator: React.ForwardRefExoticComponent<React.RefAttributes<HTMLHRElement>>;
1
+ import React, { HTMLAttributes } from 'react';
2
+ export declare type SeparatorProps = HTMLAttributes<HTMLHRElement>;
3
+ export declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLHRElement>>;
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { Separator as SeparatorClass } from './separator.module.css';
4
- export const Separator = forwardRef(({ className, ...props }, forwardedRef) => {
5
- return (React.createElement("hr", { ref: forwardedRef, className: clsx(SeparatorClass, className), ...props }));
4
+ export const Separator = forwardRef(({ className, ...otherProps }, forwardedRef) => {
5
+ return (React.createElement("hr", { ref: forwardedRef, className: clsx(SeparatorClass, className), ...otherProps }));
6
6
  });
7
7
  Separator.displayName = 'Separator';
@@ -5,4 +5,4 @@ import { TokensTypes } from '@wonderflow/tokens/platforms/web/types';
5
5
  export declare type SkeletonBlockProps = SkeletonProps & {
6
6
  borderRadius?: TokensTypes['radius'];
7
7
  };
8
- export declare const SkeletonBlock: ({ className, borderRadius, ...props }: SkeletonBlockProps) => JSX.Element;
8
+ export declare const SkeletonBlock: ({ className, borderRadius, ...otherProps }: SkeletonBlockProps) => JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import Skeleton from 'react-loading-skeleton';
3
3
  import 'react-loading-skeleton/dist/skeleton.css';
4
- export const SkeletonBlock = ({ className, borderRadius = 4, ...props }) => {
5
- return (React.createElement(Skeleton, { className: className, borderRadius: borderRadius, baseColor: "var(--dimmed-1)", highlightColor: "var(--dimmed-0)", ...props }));
4
+ export const SkeletonBlock = ({ className, borderRadius = 4, ...otherProps }) => {
5
+ return (React.createElement(Skeleton, { className: className, borderRadius: borderRadius, baseColor: "var(--dimmed-1)", highlightColor: "var(--dimmed-0)", ...otherProps }));
6
6
  };
package/slider/slider.js CHANGED
@@ -2,7 +2,7 @@ import React, { forwardRef, useCallback, useState } from 'react';
2
2
  import { Stack, Text, Icon } from '..';
3
3
  import { Slider as SliderClass, Input, Value } from './slider.module.css';
4
4
  import clsx from 'clsx';
5
- export const Slider = forwardRef(({ min = 0, max = 100, step, onInput, className, defaultValue = 0, dimension = 'regular', showValues, iconMin, iconMax, ...props }, forwardedRef) => {
5
+ export const Slider = forwardRef(({ min = 0, max = 100, step, onInput, className, defaultValue = 0, dimension = 'regular', showValues, iconMin, iconMax, ...otherProps }, forwardedRef) => {
6
6
  const [value, setValue] = useState(defaultValue);
7
7
  const isSmall = dimension === 'small';
8
8
  const handleInput = useCallback(({ currentTarget }) => {
@@ -12,7 +12,7 @@ export const Slider = forwardRef(({ min = 0, max = 100, step, onInput, className
12
12
  return (React.createElement(Stack, { direction: "row", verticalAlign: "center", columnGap: 8, className: clsx(SliderClass, className), "data-slider-dimension": dimension },
13
13
  showValues && React.createElement(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", textAlign: "end", className: Value }, value),
14
14
  (iconMin && !showValues) && React.createElement(Icon, { name: iconMin, dimension: isSmall ? 16 : 24 }),
15
- React.createElement("input", { ref: forwardedRef, className: Input, type: "range", min: min, max: max, defaultValue: value, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, step: step, onInput: handleInput, ...props }),
15
+ React.createElement("input", { ref: forwardedRef, className: Input, type: "range", min: min, max: max, defaultValue: value, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, step: step, onInput: handleInput, ...otherProps }),
16
16
  showValues && React.createElement(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", className: Value }, max),
17
17
  (iconMax && !showValues) && React.createElement(Icon, { name: iconMax, dimension: isSmall ? 16 : 24 })));
18
18
  });
@@ -2,7 +2,7 @@ import React, { forwardRef } from 'react';
2
2
  import { Snackbar as SnackbarClass, Icon as IconClass, Action } from './snackbar.module.css';
3
3
  import clsx from 'clsx';
4
4
  import { Title, Stack, Icon, Button } from '../';
5
- export const Snackbar = forwardRef(({ children, className, title, icon, kind = 'neutral', as: Wrapper = 'div', dismissable, dismissLabel = 'Dismiss', onDismiss, ...props }, forwardedRef) => {
5
+ export const Snackbar = forwardRef(({ children, className, title, icon, kind = 'neutral', as: Wrapper = 'div', dismissable, dismissLabel = 'Dismiss', onDismiss, ...otherProps }, forwardedRef) => {
6
6
  const defaultIcons = {
7
7
  info: 'circle-info',
8
8
  warning: 'triangle-exclamation',
@@ -10,7 +10,7 @@ export const Snackbar = forwardRef(({ children, className, title, icon, kind = '
10
10
  positive: 'check',
11
11
  danger: 'circle-x'
12
12
  };
13
- return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(SnackbarClass, className), "data-snackbar-kind": kind, role: "alert", ...props },
13
+ return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(SnackbarClass, className), "data-snackbar-kind": kind, role: "alert", ...otherProps },
14
14
  React.createElement(Stack, { verticalAlign: "start", horizontalAlign: "start", direction: "row", columnGap: 16, fill: false },
15
15
  React.createElement(Icon, { className: IconClass, name: icon || defaultIcons[kind], dimension: 24 }),
16
16
  React.createElement(Stack, { rowGap: 16 },
@@ -20,4 +20,3 @@ export const Snackbar = forwardRef(({ children, className, title, icon, kind = '
20
20
  dismissable && (React.createElement(Stack, { horizontalAlign: "end" },
21
21
  React.createElement(Button, { onClick: onDismiss, className: Action }, dismissLabel)))))));
22
22
  });
23
- Snackbar.displayName = 'Snackbar';
@@ -1,6 +1,9 @@
1
- import { SVGAttributes } from 'react';
1
+ import React, { SVGAttributes } from 'react';
2
2
  export declare type SpinnerProps = SVGAttributes<SVGElement> & {
3
3
  dimension?: 'small' | 'regular' | 'big';
4
4
  color?: string;
5
5
  };
6
- export declare const Spinner: ({ className, style, color, dimension }: SpinnerProps) => JSX.Element;
6
+ export declare const Spinner: React.ForwardRefExoticComponent<React.SVGAttributes<SVGElement> & {
7
+ dimension?: "big" | "small" | "regular" | undefined;
8
+ color?: string | undefined;
9
+ } & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +1,7 @@
1
- import React from 'react';
1
+ import React, { forwardRef } from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { motion } from 'framer-motion';
4
- export const Spinner = ({ className, style, color, dimension = 'big' }) => {
4
+ export const Spinner = forwardRef(({ className, style, color, dimension = 'big' }, forwardedRef) => {
5
5
  const attributes = {
6
6
  small: {
7
7
  size: 14
@@ -13,7 +13,7 @@ export const Spinner = ({ className, style, color, dimension = 'big' }) => {
13
13
  size: 30
14
14
  }
15
15
  };
16
- return (React.createElement(motion.svg, { className: clsx(className), animate: { rotate: '2turn' }, transition: {
16
+ return (React.createElement(motion.svg, { ref: forwardedRef, className: clsx(className), animate: { rotate: '2turn' }, transition: {
17
17
  duration: 2,
18
18
  repeat: Infinity,
19
19
  repeatDelay: 2
@@ -22,4 +22,5 @@ export const Spinner = ({ className, style, color, dimension = 'big' }) => {
22
22
  React.createElement("circle", { strokeOpacity: 0.5, cx: 18, cy: 18, r: 18 }),
23
23
  React.createElement("path", { d: "M36 18c0-9.94-8.06-18-18-18" },
24
24
  React.createElement("animateTransform", { attributeName: "transform", type: "rotate", from: "0 18 18", to: "360 18 18", dur: "1s", repeatCount: "indefinite" })))));
25
- };
25
+ });
26
+ Spinner.displayName = 'Spinner';
@@ -2,13 +2,12 @@ import clsx from 'clsx';
2
2
  import React, { forwardRef } from 'react';
3
3
  import { Button, Dropdown, Stack } from '..';
4
4
  import { SplitButton as SplitButtonClass } from './split-button.module.css';
5
- export const SplitButton = forwardRef(({ className, label, icon = 'chevron-down', kind, dimension, fullWidth, disabled, loading, children, placement, dropdownOffset, onClick, pressed = false, iconPosition = 'left', ...props }, forwardedRef) => {
5
+ export const SplitButton = forwardRef(({ className, label, icon = 'chevron-down', kind, dimension, fullWidth, disabled, busy, children, placement, dropdownOffset, onClick, pressed = false, iconPosition = 'left', ...otherProps }, forwardedRef) => {
6
6
  const commonProps = {
7
7
  kind,
8
8
  dimension
9
9
  };
10
10
  return (React.createElement(Stack, { className: clsx(SplitButtonClass, className), direction: "row", columnGap: 0, inline: !fullWidth },
11
- React.createElement(Button, { loading: loading, disabled: disabled, fullWidth: fullWidth, onClick: onClick, pressed: pressed, iconPosition: iconPosition, ref: forwardedRef, ...commonProps, ...props }, label),
11
+ React.createElement(Button, { busy: busy, disabled: disabled, fullWidth: fullWidth, onClick: onClick, pressed: pressed, iconPosition: iconPosition, ref: forwardedRef, ...commonProps, ...otherProps }, label),
12
12
  React.createElement(Dropdown, { placement: placement, offset: dropdownOffset, trigger: React.createElement(Button, { icon: icon, ...commonProps }) }, children)));
13
13
  });
14
- SplitButton.displayName = 'SplitButton';
package/stack/stack.js CHANGED
@@ -2,7 +2,7 @@ import React, { forwardRef } from 'react';
2
2
  import tksn from '@wonderflow/tokens/platforms/web/tokens.json';
3
3
  import { Stack as StackClass } from './stack.module.css';
4
4
  import clsx from 'clsx';
5
- export const Stack = forwardRef(({ children, className, rowGap = 0, columnGap = 0, as: Wrapper = 'div', inline = false, direction = 'column', wrap = false, fill = true, verticalAlign = 'initial', horizontalAlign = 'initial', horizontalPadding = 0, verticalPadding = 0, style, ...props }, forwardedRef) => {
5
+ export const Stack = forwardRef(({ children, className, rowGap = 0, columnGap = 0, as: Wrapper = 'div', inline = false, direction = 'column', wrap = false, fill = true, verticalAlign = 'initial', horizontalAlign = 'initial', horizontalPadding = 0, verticalPadding = 0, style, ...otherProps }, forwardedRef) => {
6
6
  const alignmentTemplate = (prop) => {
7
7
  if (prop.includes('start') || prop.includes('end')) {
8
8
  return `flex-${prop}`;
@@ -17,6 +17,5 @@ export const Stack = forwardRef(({ children, className, rowGap = 0, columnGap =
17
17
  '--vPadding': verticalPadding && tksn.space[verticalPadding],
18
18
  '--hPadding': horizontalPadding && tksn.space[horizontalPadding]
19
19
  };
20
- return (React.createElement(Wrapper, { ref: forwardedRef, style: { ...computedStyle, ...style }, "data-stack-inline": inline, "data-stack-wrap": wrap, "data-stack-direction": direction, "data-stack-fill": fill, className: clsx(StackClass, className), ...props }, children));
20
+ return (React.createElement(Wrapper, { ref: forwardedRef, style: { ...computedStyle, ...style }, "data-stack-inline": inline, "data-stack-wrap": wrap, "data-stack-direction": direction, "data-stack-fill": fill, className: clsx(StackClass, className), ...otherProps }, children));
21
21
  });
22
- Stack.displayName = 'Stack';
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Stack, Polymorphic } from '../';
3
- export declare type StarMeterProps = PropsWithClass & {
3
+ export declare type StarMeterProps = {
4
4
  value: number;
5
5
  starCount?: number;
6
6
  label?: ReactNode;
@@ -3,7 +3,7 @@ import clsx from 'clsx';
3
3
  import { useUIDSeed } from 'react-uid';
4
4
  import { Text, Stack, Icon } from '../';
5
5
  import { StarMeter as StarMeterClass, Gradient, Icon as IconClass } from './star-meter.module.css';
6
- export const StarMeter = forwardRef(({ className, value = 0, starCount = 5, label, dimension = 'regular', ...props }, forwardedRef) => {
6
+ export const StarMeter = forwardRef(({ className, value = 0, starCount = 5, label, dimension = 'regular', ...otherProps }, forwardedRef) => {
7
7
  const uid = useUIDSeed();
8
8
  const labelSize = {
9
9
  small: 14,
@@ -38,7 +38,7 @@ export const StarMeter = forwardRef(({ className, value = 0, starCount = 5, labe
38
38
  return React.createElement(Icon, { name: "star", className: IconClass, dimension: 16, fill: fillType, key: starIndex });
39
39
  });
40
40
  };
41
- return (React.createElement(Stack, { inline: true, direction: "row", verticalAlign: "center", columnGap: 8, className: clsx(StarMeterClass, className), role: "meter", "aria-valuenow": clamp(value, 0, starCount), "aria-valuemin": 0, "aria-valuemax": starCount, "aria-labelledby": uid('star-meter'), "data-star-meter-dimension": dimension, ref: forwardedRef, ...props },
41
+ return (React.createElement(Stack, { inline: true, direction: "row", verticalAlign: "center", columnGap: 8, className: clsx(StarMeterClass, className), role: "meter", "aria-valuenow": clamp(value, 0, starCount), "aria-valuemin": 0, "aria-valuemax": starCount, "aria-labelledby": uid('star-meter'), "data-star-meter-dimension": dimension, ref: forwardedRef, ...otherProps },
42
42
  React.createElement("svg", { "aria-hidden": "true", className: Gradient, width: "100", height: "50", version: "1.1", xmlns: "http://www.w3.org/2000/svg" },
43
43
  React.createElement("defs", null,
44
44
  React.createElement("linearGradient", { id: "HalfStar" },
@@ -49,4 +49,3 @@ export const StarMeter = forwardRef(({ className, value = 0, starCount = 5, labe
49
49
  React.createElement(Stack, { direction: "row", columnGap: 2 }, starType(starCount, roundValue(value))),
50
50
  React.createElement(Text, { dimmed: 6, id: uid('star-meter'), size: labelSize[dimension], weight: "bold" }, label || value.toString())));
51
51
  });
52
- StarMeter.displayName = 'StarMeter';
package/tab/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { TabRoot as Tab } from './tab';
1
+ export { Tab } from './tab';
2
2
  export type { TabProps } from './tab';
package/tab/index.js CHANGED
@@ -1 +1 @@
1
- export { TabRoot as Tab } from './tab';
1
+ export { Tab } from './tab';
package/tab/tab-item.d.ts CHANGED
@@ -3,4 +3,6 @@ import { IconNames } from '../icons/types';
3
3
  export declare type TabItemProps = ButtonHTMLAttributes<HTMLButtonElement> & {
4
4
  icon?: IconNames;
5
5
  };
6
- export declare const TabItem: React.FC<TabItemProps>;
6
+ export declare const TabItem: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
7
+ icon?: IconNames | undefined;
8
+ } & React.RefAttributes<HTMLButtonElement>>;
package/tab/tab-item.js CHANGED
@@ -1,20 +1,20 @@
1
- import React, { useCallback, useRef } from 'react';
1
+ import React, { useCallback, useRef, forwardRef } from 'react';
2
2
  import { useRovingTabIndex, useFocusEffect } from 'react-roving-tabindex';
3
3
  import clsx from 'clsx';
4
4
  import { Stack, Icon } from '../';
5
5
  import { useTabState } from './primitive-tab';
6
6
  import { TabItem as TabItemClass } from './tab.module.css';
7
- export const TabItem = ({ children, className, icon, ...props }) => {
7
+ export const TabItem = forwardRef(({ children, className, icon, ...otherProps }, forwardedRef) => {
8
8
  const { onClick, isActive } = useTabState(children);
9
- const internalRef = useRef(null);
9
+ const internalRef = useRef(forwardedRef);
10
10
  const [, focused, handleKeyDown, handleClick] = useRovingTabIndex(internalRef, false);
11
11
  useFocusEffect(focused, internalRef);
12
12
  const fireClick = useCallback(() => {
13
13
  onClick();
14
14
  handleClick();
15
15
  }, [handleClick, onClick]);
16
- return (React.createElement(Stack, { as: "button", direction: "row", verticalAlign: "center", horizontalAlign: "start", fill: false, columnGap: 8, role: "tab", ref: internalRef, className: clsx(TabItemClass, className), "aria-selected": isActive, onClick: fireClick, onKeyDown: handleKeyDown, onFocus: fireClick, type: "button", tabIndex: isActive ? 0 : -1, ...props },
16
+ return (React.createElement(Stack, { as: "button", direction: "row", verticalAlign: "center", horizontalAlign: "start", fill: false, columnGap: 8, role: "tab", ref: internalRef, className: clsx(TabItemClass, className), "aria-selected": isActive, onClick: fireClick, onKeyDown: handleKeyDown, onFocus: fireClick, type: "button", tabIndex: isActive ? 0 : -1, ...otherProps },
17
17
  icon && React.createElement(Icon, { name: icon, dimension: 16 }),
18
18
  children));
19
- };
19
+ });
20
20
  TabItem.displayName = 'Tab.Item';
package/tab/tab-list.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- import React from 'react';
2
- export declare const TabList: React.FC<PropsWithClass>;
1
+ import React, { HTMLAttributes } from 'react';
2
+ export declare type TabListProps = HTMLAttributes<HTMLDivElement>;
3
+ export declare const TabList: React.ForwardRefExoticComponent<TabListProps & React.RefAttributes<HTMLDivElement>>;
package/tab/tab-list.js CHANGED
@@ -2,5 +2,6 @@ import React, { forwardRef } from 'react';
2
2
  import { RovingTabIndexProvider } from 'react-roving-tabindex';
3
3
  import clsx from 'clsx';
4
4
  import { TabList as TabListClass } from './tab.module.css';
5
- export const TabList = forwardRef(({ children, className, ...props }, forwardedRef) => (React.createElement("div", { ref: forwardedRef, role: "tablist", tabIndex: -1, className: clsx(TabListClass, className), ...props },
5
+ export const TabList = forwardRef(({ children, className, ...otherProps }, forwardedRef) => (React.createElement("div", { ref: forwardedRef, role: "tablist", tabIndex: -1, className: clsx(TabListClass, className), ...otherProps },
6
6
  React.createElement(RovingTabIndexProvider, null, children))));
7
+ TabList.displayName = 'Tab.List';
@@ -4,4 +4,7 @@ export declare type TabPanelProps = PropsWithClass & {
4
4
  label: ReactNode;
5
5
  icon?: IconNames;
6
6
  };
7
- export declare const TabPanel: React.FC<TabPanelProps>;
7
+ export declare const TabPanel: React.ForwardRefExoticComponent<PropsWithClass & {
8
+ label: ReactNode;
9
+ icon?: IconNames | undefined;
10
+ } & React.RefAttributes<HTMLDivElement>>;
package/tab/tab-panel.js CHANGED
@@ -2,9 +2,10 @@ import React, { forwardRef } from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { usePanelState } from './primitive-tab';
4
4
  import { TabPanel as TabPanelClass } from './tab.module.css';
5
- export const TabPanel = forwardRef(({ children, className, ...props }, forwardedRef) => {
5
+ export const TabPanel = forwardRef(({ children, className, ...otherProps }, forwardedRef) => {
6
6
  const isActive = usePanelState(children);
7
7
  return isActive
8
- ? (React.createElement("div", { ref: forwardedRef, tabIndex: 0, className: clsx(TabPanelClass, className), ...props }, children))
8
+ ? (React.createElement("div", { ref: forwardedRef, tabIndex: 0, className: clsx(TabPanelClass, className), ...otherProps }, children))
9
9
  : null;
10
10
  });
11
+ TabPanel.displayName = 'Tab.Panel';
package/tab/tab.d.ts CHANGED
@@ -1,15 +1,17 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import { TabItem } from './tab-item';
3
+ import { TabListProps } from './tab-list';
4
+ import { TabPanelProps } from './tab-panel';
5
+ import { Polymorphic } from '../';
2
6
  export declare type TabProps = PropsWithClass & {
3
7
  children: ReactNode;
4
8
  state?: [number, React.Dispatch<React.SetStateAction<number>>];
5
9
  onChange?(index: number): void;
6
10
  };
7
- export declare const TabRoot: React.ForwardRefExoticComponent<PropsWithClass & {
8
- children: ReactNode;
9
- state?: [number, React.Dispatch<React.SetStateAction<number>>] | undefined;
10
- onChange?(index: number): void;
11
- } & React.RefAttributes<HTMLDivElement>> & {
12
- Item: React.FC<import("./tab-item").TabItemProps>;
13
- List: React.FC<PropsWithClass>;
14
- Panel: React.FC<import("./tab-panel").TabPanelProps>;
11
+ declare type TabComponent = React.ForwardRefExoticComponent<TabProps> & {
12
+ Panel: React.ForwardRefExoticComponent<TabPanelProps>;
13
+ Item: React.ForwardRefExoticComponent<Polymorphic.OwnProps<typeof TabItem>>;
14
+ List: React.ForwardRefExoticComponent<TabListProps>;
15
15
  };
16
+ export declare const Tab: TabComponent;
17
+ export {};
package/tab/tab.js CHANGED
@@ -6,7 +6,7 @@ import { TabList } from './tab-list';
6
6
  import { TabPanel } from './tab-panel';
7
7
  import { Tabs as TabsWrapper } from './primitive-tab';
8
8
  import { Tab as TabClass } from './tab.module.css';
9
- const Tab = forwardRef(({ children, className, state, onChange, ...props }, forwardedRef) => {
9
+ export const Tab = forwardRef(({ children, className, state, onChange, ...otherProps }, forwardedRef) => {
10
10
  const renderedChildren = Children.toArray(children).filter(Boolean);
11
11
  const innerState = useState(0);
12
12
  const tabState = state || innerState;
@@ -17,7 +17,7 @@ const Tab = forwardRef(({ children, className, state, onChange, ...props }, forw
17
17
  onChange(currentTab);
18
18
  }
19
19
  }, [currentTab, onChange]);
20
- return (React.createElement("div", { ref: forwardedRef, className: clsx(TabClass, className), ...props },
20
+ return (React.createElement("div", { ref: forwardedRef, className: clsx(TabClass, className), ...otherProps },
21
21
  React.createElement(TabsWrapper, { state: tabState },
22
22
  React.createElement(TabList, null, Children.map(renderedChildren, (child, index) => (React.createElement(TabItem, { id: seedID(`tab-item-${index}`), "aria-controls": seedID(`tab-panel-${index}`), icon: child.props.icon }, child.props.label)))),
23
23
  Children.map(renderedChildren, (child, index) => cloneElement(child, {
@@ -25,8 +25,7 @@ const Tab = forwardRef(({ children, className, state, onChange, ...props }, forw
25
25
  'aria-labelledby': seedID(`tab-item-${index}`)
26
26
  })))));
27
27
  });
28
- export const TabRoot = Object.assign(Tab, {
29
- Item: TabItem,
30
- List: TabList,
31
- Panel: TabPanel
32
- });
28
+ Tab.displayName = 'Tab';
29
+ Tab.Panel = TabPanel;
30
+ Tab.Item = TabItem;
31
+ Tab.List = TabList;
package/table/table.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import React from 'react';
1
+ import { FC } from 'react';
2
2
  import { TableProps as ReactTableProps } from 'react-data-table-component';
3
3
  import { IconNames } from '../icons/types';
4
4
  export declare type TableProps<T> = ReactTableProps<T> & {
5
- ExpandableRowsComponent?: React.FC<{
5
+ ExpandableRowsComponent?: FC<{
6
6
  data: T;
7
7
  }>;
8
8
  collapsedRowIcon?: IconNames;
9
9
  expandedRowIcon?: IconNames;
10
10
  minRowHeight?: string;
11
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;
12
+ export declare const Table: <T>({ className, ExpandableRowsComponent, progressComponent, customStyles, pagination, responsive, fixedHeader, noHeader, paginationPerPage, striped, theme, collapsedRowIcon, expandedRowIcon, minRowHeight, ...otherProps }: TableProps<T>) => JSX.Element;