@nextui-org/react 1.0.2-beta.2 → 1.0.2-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  <p align="center">
2
2
  <a href="https://nextui.org">
3
- <img width="20%" src="https://raw.githubusercontent.com/jrgarciadev/nextui/main/apps/docs/public/isotipo.png" alt="nextui" />
3
+ <img width="20%" src="https://raw.githubusercontent.com/nextui-org/nextui/main/apps/docs/public/isotipo.png" alt="nextui" />
4
4
  <h1 align="center">NextUI</h1>
5
5
  </a>
6
6
  </p>
7
7
  </br>
8
8
  <p align="center">
9
9
  <a href="https://github.com/jrgarciadev/nextui/blob/main/LICENSE">
10
- <img src="https://img.shields.io/apm/l/atomic-design-ui.svg?" alt="License">
10
+ <img src="https://img.shields.io/apm/l/atomic-design-ui.svg?style=flat" alt="License">
11
11
  </a>
12
12
  <a href="https://codecov.io/gh/jrgarciadev/nextui">
13
13
  <img src="https://codecov.io/gh/jrgarciadev/nextui/branch/main/graph/badge.svg?token=QJF2QKR5N4" alt="codecov badge">
@@ -20,6 +20,12 @@
20
20
  </a>
21
21
  </p>
22
22
 
23
+ <p align="center">
24
+ <a rel="noopener noreferrer" target="_blank" href="https://www.vercel.com?utm_source=nextui&utm_marketing=oss">
25
+ <img height="34px" src="https://raw.githubusercontent.com/nextui-org/nextui/main/apps/docs/public/powered-by-vercel.svg" alt="Powered by vercel">
26
+ </a>
27
+ </p>
28
+
23
29
  ## Getting Started
24
30
 
25
31
  Visit <a aria-label="nextui learn" href="https://nextui.org/learn">https://nextui.org/guide</a> to get started with NextUI.
@@ -10,7 +10,7 @@ interface Props {
10
10
  bordered?: boolean;
11
11
  arrowIcon?: React.ReactNode;
12
12
  contentLeft?: React.ReactNode;
13
- initialExpanded?: boolean;
13
+ expanded?: boolean;
14
14
  showArrow?: boolean;
15
15
  shadow?: boolean;
16
16
  index?: number;
@@ -27,7 +27,7 @@ declare const defaultProps: {
27
27
  animated: boolean;
28
28
  disabled: boolean;
29
29
  preventDefault: boolean;
30
- initialExpanded: boolean;
30
+ expanded: boolean;
31
31
  };
32
32
  declare type NativeAttrs = Omit<React.HTMLAttributes<unknown>, keyof Props>;
33
33
  export declare type CollapseProps = Props & typeof defaultProps & CollapseVariantsProps & NativeAttrs & {
@@ -43,7 +43,7 @@ const defaultProps = {
43
43
  animated: true,
44
44
  disabled: false,
45
45
  preventDefault: true,
46
- initialExpanded: false
46
+ expanded: false
47
47
  };
48
48
  const preClass = 'nextui-collapse';
49
49
 
@@ -51,7 +51,7 @@ const Collapse = ({
51
51
  children,
52
52
  title,
53
53
  subtitle,
54
- initialExpanded,
54
+ expanded,
55
55
  shadow,
56
56
  className,
57
57
  divider,
@@ -67,7 +67,7 @@ const Collapse = ({
67
67
  index,
68
68
  ...props
69
69
  }) => {
70
- const [visible, setVisible, visibleRef] = (0, _useCurrentState.default)(initialExpanded);
70
+ const [visible, setVisible, visibleRef] = (0, _useCurrentState.default)(expanded);
71
71
  const {
72
72
  isDark
73
73
  } = (0, _useTheme.default)();
@@ -82,6 +82,11 @@ const Collapse = ({
82
82
  (0, _useWarning.default)('"title" is required.', 'Collapse');
83
83
  }
84
84
 
85
+ (0, _react.useEffect)(() => {
86
+ if (visible !== expanded) {
87
+ setVisible(expanded);
88
+ }
89
+ }, [expanded]);
85
90
  (0, _react.useEffect)(() => {
86
91
  if (!values.length) return;
87
92
  const isActive = !!values.find(item => item === index);
@@ -1,5 +1,5 @@
1
1
  import Switch from './switch';
2
- export type { SwitchProps } from './switch';
2
+ export type { SwitchProps, SwitchEvent } from './switch';
3
3
  export { StyledSwitchContainer, StyledSwitchInput, StyledSwitchCircle, StyledSwitch } from './switch.styles';
4
4
  export type { SwitchVariantsProps, SwitchContainerVariantsProps } from './switch.styles';
5
5
  export default Switch;
@@ -28,7 +28,7 @@ declare const defaultProps: {
28
28
  h5: boolean;
29
29
  h6: boolean;
30
30
  b: boolean;
31
- sm: boolean;
31
+ small: boolean;
32
32
  transform: "inherit" | "initial" | "revert" | "unset" | "none" | "capitalize" | "uppercase" | "lowercase" | "full-width" | "full-size-kana";
33
33
  i: boolean;
34
34
  span: boolean;
@@ -47,7 +47,7 @@ declare const _default: React.ComponentType<Partial<{
47
47
  h5: boolean;
48
48
  h6: boolean;
49
49
  b: boolean;
50
- sm: boolean;
50
+ small: boolean;
51
51
  transform: "inherit" | "initial" | "revert" | "unset" | "none" | "capitalize" | "uppercase" | "lowercase" | "full-width" | "full-size-kana";
52
52
  i: boolean;
53
53
  span: boolean;
@@ -55,5 +55,5 @@ declare const _default: React.ComponentType<Partial<{
55
55
  em: boolean;
56
56
  blockquote: boolean;
57
57
  color: string;
58
- }> & Omit<TextProps, "sm" | "b" | "blockquote" | "del" | "em" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "i" | "span" | "color" | "transform">>;
58
+ }> & Omit<TextProps, "b" | "blockquote" | "del" | "em" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "i" | "small" | "span" | "color" | "transform">>;
59
59
  export default _default;
package/cjs/text/text.js CHANGED
@@ -25,7 +25,7 @@ const defaultProps = {
25
25
  h5: false,
26
26
  h6: false,
27
27
  b: false,
28
- sm: false,
28
+ small: false,
29
29
  transform: 'none',
30
30
  i: false,
31
31
  span: false,
@@ -10,7 +10,7 @@ interface Props {
10
10
  bordered?: boolean;
11
11
  arrowIcon?: React.ReactNode;
12
12
  contentLeft?: React.ReactNode;
13
- initialExpanded?: boolean;
13
+ expanded?: boolean;
14
14
  showArrow?: boolean;
15
15
  shadow?: boolean;
16
16
  index?: number;
@@ -27,7 +27,7 @@ declare const defaultProps: {
27
27
  animated: boolean;
28
28
  disabled: boolean;
29
29
  preventDefault: boolean;
30
- initialExpanded: boolean;
30
+ expanded: boolean;
31
31
  };
32
32
  declare type NativeAttrs = Omit<React.HTMLAttributes<unknown>, keyof Props>;
33
33
  export declare type CollapseProps = Props & typeof defaultProps & CollapseVariantsProps & NativeAttrs & {
@@ -43,7 +43,7 @@ const defaultProps = {
43
43
  animated: true,
44
44
  disabled: false,
45
45
  preventDefault: true,
46
- initialExpanded: false
46
+ expanded: false
47
47
  };
48
48
  const preClass = 'nextui-collapse';
49
49
 
@@ -51,7 +51,7 @@ const Collapse = ({
51
51
  children,
52
52
  title,
53
53
  subtitle,
54
- initialExpanded,
54
+ expanded,
55
55
  shadow,
56
56
  className,
57
57
  divider,
@@ -67,7 +67,7 @@ const Collapse = ({
67
67
  index,
68
68
  ...props
69
69
  }) => {
70
- const [visible, setVisible, visibleRef] = (0, _useCurrentState.default)(initialExpanded);
70
+ const [visible, setVisible, visibleRef] = (0, _useCurrentState.default)(expanded);
71
71
  const {
72
72
  isDark
73
73
  } = (0, _useTheme.default)();
@@ -82,6 +82,11 @@ const Collapse = ({
82
82
  (0, _useWarning.default)('"title" is required.', 'Collapse');
83
83
  }
84
84
 
85
+ (0, _react.useEffect)(() => {
86
+ if (visible !== expanded) {
87
+ setVisible(expanded);
88
+ }
89
+ }, [expanded]);
85
90
  (0, _react.useEffect)(() => {
86
91
  if (!values.length) return;
87
92
  const isActive = !!values.find(item => item === index);
@@ -1,5 +1,5 @@
1
1
  import Switch from './switch';
2
- export type { SwitchProps } from './switch';
2
+ export type { SwitchProps, SwitchEvent } from './switch';
3
3
  export { StyledSwitchContainer, StyledSwitchInput, StyledSwitchCircle, StyledSwitch } from './switch.styles';
4
4
  export type { SwitchVariantsProps, SwitchContainerVariantsProps } from './switch.styles';
5
5
  export default Switch;
@@ -28,7 +28,7 @@ declare const defaultProps: {
28
28
  h5: boolean;
29
29
  h6: boolean;
30
30
  b: boolean;
31
- sm: boolean;
31
+ small: boolean;
32
32
  transform: "inherit" | "initial" | "revert" | "unset" | "none" | "capitalize" | "uppercase" | "lowercase" | "full-width" | "full-size-kana";
33
33
  i: boolean;
34
34
  span: boolean;
@@ -47,7 +47,7 @@ declare const _default: React.ComponentType<Partial<{
47
47
  h5: boolean;
48
48
  h6: boolean;
49
49
  b: boolean;
50
- sm: boolean;
50
+ small: boolean;
51
51
  transform: "inherit" | "initial" | "revert" | "unset" | "none" | "capitalize" | "uppercase" | "lowercase" | "full-width" | "full-size-kana";
52
52
  i: boolean;
53
53
  span: boolean;
@@ -55,5 +55,5 @@ declare const _default: React.ComponentType<Partial<{
55
55
  em: boolean;
56
56
  blockquote: boolean;
57
57
  color: string;
58
- }> & Omit<TextProps, "sm" | "b" | "blockquote" | "del" | "em" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "i" | "span" | "color" | "transform">>;
58
+ }> & Omit<TextProps, "b" | "blockquote" | "del" | "em" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "i" | "small" | "span" | "color" | "transform">>;
59
59
  export default _default;
package/esm/text/text.js CHANGED
@@ -25,7 +25,7 @@ const defaultProps = {
25
25
  h5: false,
26
26
  h6: false,
27
27
  b: false,
28
- sm: false,
28
+ small: false,
29
29
  transform: 'none',
30
30
  i: false,
31
31
  span: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextui-org/react",
3
- "version": "1.0.2-beta.2",
3
+ "version": "1.0.2-beta.3",
4
4
  "license": "MIT",
5
5
  "description": "🚀 Beautiful and modern React UI library.",
6
6
  "homepage": "https://nextui.org",
package/umd/nextui.js CHANGED
@@ -6303,7 +6303,7 @@ const collapse_defaultProps = {
6303
6303
  animated: true,
6304
6304
  disabled: false,
6305
6305
  preventDefault: true,
6306
- initialExpanded: false
6306
+ expanded: false
6307
6307
  };
6308
6308
  const preClass = 'nextui-collapse';
6309
6309
 
@@ -6311,7 +6311,7 @@ const Collapse = ({
6311
6311
  children,
6312
6312
  title,
6313
6313
  subtitle,
6314
- initialExpanded,
6314
+ expanded,
6315
6315
  shadow,
6316
6316
  className,
6317
6317
  divider,
@@ -6327,7 +6327,7 @@ const Collapse = ({
6327
6327
  index,
6328
6328
  ...props
6329
6329
  }) => {
6330
- const [visible, setVisible, visibleRef] = src_use_current_state(initialExpanded);
6330
+ const [visible, setVisible, visibleRef] = src_use_current_state(expanded);
6331
6331
  const {
6332
6332
  isDark
6333
6333
  } = src_use_theme();
@@ -6342,6 +6342,11 @@ const Collapse = ({
6342
6342
  src_use_warning('"title" is required.', 'Collapse');
6343
6343
  }
6344
6344
 
6345
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
6346
+ if (visible !== expanded) {
6347
+ setVisible(expanded);
6348
+ }
6349
+ }, [expanded]);
6345
6350
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
6346
6351
  if (!values.length) return;
6347
6352
  const isActive = !!values.find(item => item === index);
@@ -6351,7 +6356,7 @@ const Collapse = ({
6351
6356
  if (!showArrow) return null;
6352
6357
  return arrowIcon ? arrowIcon : /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(collapse_icon, {}, void 0, false, {
6353
6358
  fileName: collapse_jsxFileName,
6354
- lineNumber: 107,
6359
+ lineNumber: 113,
6355
6360
  columnNumber: 36
6356
6361
  }, undefined);
6357
6362
  }, [arrowIcon, showArrow]);
@@ -6420,7 +6425,7 @@ const Collapse = ({
6420
6425
  children: contentLeft
6421
6426
  }, void 0, false, {
6422
6427
  fileName: collapse_jsxFileName,
6423
- lineNumber: 178,
6428
+ lineNumber: 184,
6424
6429
  columnNumber: 13
6425
6430
  }, undefined), /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
6426
6431
  className: `${preClass}-title-content`,
@@ -6429,36 +6434,36 @@ const Collapse = ({
6429
6434
  children: title
6430
6435
  }, void 0, false, {
6431
6436
  fileName: collapse_jsxFileName,
6432
- lineNumber: 186,
6437
+ lineNumber: 192,
6433
6438
  columnNumber: 15
6434
6439
  }, undefined), subtitle && /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
6435
6440
  className: `${preClass}-subtitle`,
6436
6441
  children: subtitle
6437
6442
  }, void 0, false, {
6438
6443
  fileName: collapse_jsxFileName,
6439
- lineNumber: 189,
6444
+ lineNumber: 195,
6440
6445
  columnNumber: 15
6441
6446
  }, undefined)]
6442
6447
  }, void 0, true, {
6443
6448
  fileName: collapse_jsxFileName,
6444
- lineNumber: 182,
6449
+ lineNumber: 188,
6445
6450
  columnNumber: 11
6446
6451
  }, undefined), /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
6447
6452
  className: `${preClass}-title-content-right`,
6448
6453
  children: arrowComponent
6449
6454
  }, void 0, false, {
6450
6455
  fileName: collapse_jsxFileName,
6451
- lineNumber: 192,
6456
+ lineNumber: 198,
6452
6457
  columnNumber: 11
6453
6458
  }, undefined)]
6454
6459
  }, void 0, true, {
6455
6460
  fileName: collapse_jsxFileName,
6456
- lineNumber: 176,
6461
+ lineNumber: 182,
6457
6462
  columnNumber: 9
6458
6463
  }, undefined)
6459
6464
  }, void 0, false, {
6460
6465
  fileName: collapse_jsxFileName,
6461
- lineNumber: 164,
6466
+ lineNumber: 170,
6462
6467
  columnNumber: 7
6463
6468
  }, undefined), /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(utils_expand, {
6464
6469
  isExpanded: visible,
@@ -6472,17 +6477,17 @@ const Collapse = ({
6472
6477
  children: children
6473
6478
  }, void 0, false, {
6474
6479
  fileName: collapse_jsxFileName,
6475
- lineNumber: 198,
6480
+ lineNumber: 204,
6476
6481
  columnNumber: 9
6477
6482
  }, undefined)
6478
6483
  }, void 0, false, {
6479
6484
  fileName: collapse_jsxFileName,
6480
- lineNumber: 197,
6485
+ lineNumber: 203,
6481
6486
  columnNumber: 7
6482
6487
  }, undefined)]
6483
6488
  }, void 0, true, {
6484
6489
  fileName: collapse_jsxFileName,
6485
- lineNumber: 150,
6490
+ lineNumber: 156,
6486
6491
  columnNumber: 5
6487
6492
  }, undefined);
6488
6493
  };
@@ -9529,7 +9534,7 @@ const text_defaultProps = {
9529
9534
  h5: false,
9530
9535
  h6: false,
9531
9536
  b: false,
9532
- sm: false,
9537
+ small: false,
9533
9538
  transform: 'none',
9534
9539
  i: false,
9535
9540
  span: false,