@nextui-org/react 1.0.1-alpha.53 → 1.0.1-alpha.54

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 (67) hide show
  1. package/cjs/button/button.js +1 -1
  2. package/cjs/card/card.js +1 -1
  3. package/cjs/collapse/collapse-context.d.ts +9 -0
  4. package/cjs/collapse/collapse-context.js +20 -0
  5. package/cjs/collapse/collapse-group.d.ts +32 -0
  6. package/cjs/collapse/collapse-group.js +111 -0
  7. package/cjs/collapse/collapse-icon.d.ts +3 -0
  8. package/cjs/collapse/collapse-icon.js +39 -0
  9. package/cjs/collapse/collapse.d.ts +39 -0
  10. package/cjs/collapse/collapse.js +174 -0
  11. package/cjs/collapse/index.d.ts +2 -0
  12. package/cjs/collapse/index.js +15 -0
  13. package/cjs/css-baseline/css-baseline.js +3 -3
  14. package/cjs/index.d.ts +1 -0
  15. package/cjs/index.js +6 -1
  16. package/cjs/input/input-icon-clear.js +1 -1
  17. package/cjs/modal/modal-close-button.js +1 -1
  18. package/cjs/text/text.d.ts +1 -3
  19. package/cjs/text/text.js +0 -1
  20. package/cjs/theme/dark.js +2 -1
  21. package/cjs/theme/default.js +2 -1
  22. package/cjs/{shared → utils}/clear-icon.d.ts +0 -0
  23. package/cjs/{shared → utils}/clear-icon.js +1 -1
  24. package/cjs/utils/collections.d.ts +1 -0
  25. package/cjs/utils/collections.js +26 -2
  26. package/cjs/utils/css-transition.js +1 -1
  27. package/cjs/{shared → utils}/drip.d.ts +0 -0
  28. package/cjs/{shared → utils}/drip.js +0 -0
  29. package/cjs/utils/expand.d.ts +18 -0
  30. package/cjs/utils/expand.js +97 -0
  31. package/cjs/utils/icons.js +60 -2
  32. package/collapse/package.json +6 -0
  33. package/esm/button/button.js +1 -1
  34. package/esm/card/card.js +1 -1
  35. package/esm/collapse/collapse-context.d.ts +9 -0
  36. package/esm/collapse/collapse-context.js +6 -0
  37. package/esm/collapse/collapse-group.d.ts +32 -0
  38. package/esm/collapse/collapse-group.js +87 -0
  39. package/esm/collapse/collapse-icon.d.ts +3 -0
  40. package/esm/collapse/collapse-icon.js +27 -0
  41. package/esm/collapse/collapse.d.ts +39 -0
  42. package/esm/collapse/collapse.js +150 -0
  43. package/esm/collapse/index.d.ts +2 -0
  44. package/esm/collapse/index.js +4 -0
  45. package/esm/css-baseline/css-baseline.js +3 -3
  46. package/esm/index.d.ts +1 -0
  47. package/esm/index.js +2 -1
  48. package/esm/input/input-icon-clear.js +1 -1
  49. package/esm/modal/modal-close-button.js +1 -1
  50. package/esm/text/text.d.ts +1 -3
  51. package/esm/text/text.js +0 -1
  52. package/esm/theme/dark.js +2 -1
  53. package/esm/theme/default.js +2 -1
  54. package/esm/{shared → utils}/clear-icon.d.ts +0 -0
  55. package/esm/{shared → utils}/clear-icon.js +1 -1
  56. package/esm/utils/collections.d.ts +1 -0
  57. package/esm/utils/collections.js +21 -0
  58. package/esm/utils/css-transition.js +1 -1
  59. package/esm/{shared → utils}/drip.d.ts +0 -0
  60. package/esm/{shared → utils}/drip.js +0 -0
  61. package/esm/utils/expand.d.ts +18 -0
  62. package/esm/utils/expand.js +78 -0
  63. package/esm/utils/icons.js +52 -0
  64. package/package.json +1 -1
  65. package/umd/nextui.js +467 -16
  66. package/umd/nextui.min.js +1 -1
  67. package/shared/package.json +0 -6
package/umd/nextui.js CHANGED
@@ -971,6 +971,7 @@ __webpack_require__.d(__webpack_exports__, {
971
971
  "Checkbox": () => (/* reexport */ src_checkbox),
972
972
  "Code": () => (/* reexport */ src_code),
973
973
  "Col": () => (/* reexport */ src_col),
974
+ "Collapse": () => (/* reexport */ src_collapse),
974
975
  "Container": () => (/* reexport */ src_container),
975
976
  "CssBaseline": () => (/* reexport */ css_baseline),
976
977
  "Divider": () => (/* reexport */ src_divider),
@@ -1101,7 +1102,8 @@ const palette = { ...common,
1101
1102
  background: '#fff',
1102
1103
  foreground: '#000',
1103
1104
  code: '#f81ce5',
1104
- border: '#eaeaea'
1105
+ border: '#eaeaea',
1106
+ selection: '#0070f3'
1105
1107
  };
1106
1108
  const expressiveness = {
1107
1109
  linkStyle: 'none',
@@ -1224,7 +1226,8 @@ const dark_palette = { ...common,
1224
1226
  background: '#000',
1225
1227
  foreground: '#fff',
1226
1228
  code: '#77C8E6',
1227
- border: '#333'
1229
+ border: '#333',
1230
+ selection: '#ff4ecd'
1228
1231
  };
1229
1232
  const dark_expressiveness = {
1230
1233
  linkStyle: 'none',
@@ -1480,6 +1483,27 @@ const isMac = () => {
1480
1483
  if (!collections_isBrowser()) return false;
1481
1484
  return navigator.platform.toUpperCase().indexOf('MAC') >= 0;
1482
1485
  };
1486
+ const setChildrenIndex = (children, targetComponents = []) => {
1487
+ if (external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(children) === 0) return [];
1488
+ const allowAll = targetComponents.length === 0;
1489
+
1490
+ const clone = (child, props = {}) => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(child, props);
1491
+
1492
+ let index = 0;
1493
+ return external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.map(children, item => {
1494
+ if (! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(item)) return item;
1495
+ index = index + 1;
1496
+ if (allowAll) return clone(item, {
1497
+ index
1498
+ });
1499
+ const isAllowed = targetComponents.find(child => child === item.type);
1500
+ if (isAllowed) return clone(item, {
1501
+ index
1502
+ });
1503
+ index = index - 1;
1504
+ return item;
1505
+ });
1506
+ };
1483
1507
  ;// CONCATENATED MODULE: ./src/use-portal/use-portal.ts
1484
1508
 
1485
1509
 
@@ -2326,9 +2350,9 @@ const CssBaseline = ({
2326
2350
  const theme = src_use_theme();
2327
2351
  return /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
2328
2352
  children: [children, /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(styled_jsx_style["default"], {
2329
- id: "3069620932",
2330
- dynamic: [theme.palette.background, theme.palette.text, theme.palette.background, theme.font.sans, theme.font.sans, theme.palette.link, theme.expressiveness.linkStyle, theme.expressiveness.linkHoverStyle, theme.layout.gapHalf, theme.layout.gapHalf, theme.layout.gapHalf, theme.layout.gap, theme.palette.foreground, theme.palette.code, theme.layout.gapQuarter, theme.layout.gapQuarter, addColorAlpha(theme.palette.code, 0.2), theme.font.mono, addColorAlpha(theme.palette.code, 0.3), theme.layout.radius, theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.font.mono, theme.palette.foreground, theme.palette.accents_2, theme.palette.accents_1, theme.layout.gap, theme.layout.gap, theme.palette.accents_5, theme.palette.accents_1, theme.layout.radius, theme.palette.selection, theme.palette.foreground],
2331
- children: `html,body{background-color:${theme.palette.background};color:${theme.palette.text};}html{font-size:16px;--nextui-icons-background:${theme.palette.background};}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-size:1rem;line-height:1.5;margin:0;padding:0;min-height:100%;position:relative;overflow-x:hidden;font-family:${theme.font.sans};}*,*:before,*:after{box-sizing:border-box;text-rendering:geometricPrecision;-webkit-tap-highlight-color:transparent;}p,small{font-weight:400;color:inherit;-webkit-letter-spacing:-0.005625rem;-moz-letter-spacing:-0.005625rem;-ms-letter-spacing:-0.005625rem;letter-spacing:-0.005625rem;font-family:${theme.font.sans};}p{margin:1rem 0;font-size:1em;line-height:1.625em;}small{margin:0;line-height:1.5;font-size:0.875rem;}b{font-weight:600;}span{font-size:inherit;color:inherit;font-weight:inherit;}img{max-width:100%;}a{cursor:pointer;font-size:inherit;-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:${theme.palette.link};-webkit-text-decoration:${theme.expressiveness.linkStyle};text-decoration:${theme.expressiveness.linkStyle};}a:hover{-webkit-text-decoration:${theme.expressiveness.linkHoverStyle};text-decoration:${theme.expressiveness.linkHoverStyle};}ul,ol{padding:0;list-style-type:none;margin:${theme.layout.gapHalf} ${theme.layout.gapHalf} ${theme.layout.gapHalf} ${theme.layout.gap};color:${theme.palette.foreground};}ol{list-style-type:decimal;}li{margin-bottom:0.625rem;font-size:1em;line-height:1.625em;}h1,h2,h3,h4,h5,h6{color:inherit;margin:0 0 0.625rem 0;}h1{font-size:3rem;-webkit-letter-spacing:-0.066875rem;-moz-letter-spacing:-0.066875rem;-ms-letter-spacing:-0.066875rem;letter-spacing:-0.066875rem;line-height:1.5;font-weight:700;}h2{font-size:2.25rem;-webkit-letter-spacing:-0.020625rem;-moz-letter-spacing:-0.020625rem;-ms-letter-spacing:-0.020625rem;letter-spacing:-0.020625rem;font-weight:600;}h3{font-size:1.5rem;-webkit-letter-spacing:-0.029375rem;-moz-letter-spacing:-0.029375rem;-ms-letter-spacing:-0.029375rem;letter-spacing:-0.029375rem;font-weight:600;}h4{font-size:1.25rem;-webkit-letter-spacing:-0.020625rem;-moz-letter-spacing:-0.020625rem;-ms-letter-spacing:-0.020625rem;letter-spacing:-0.020625rem;font-weight:600;}h5{font-size:1rem;-webkit-letter-spacing:-0.01125rem;-moz-letter-spacing:-0.01125rem;-ms-letter-spacing:-0.01125rem;letter-spacing:-0.01125rem;font-weight:600;}h6{font-size:0.875rem;-webkit-letter-spacing:-0.005625rem;-moz-letter-spacing:-0.005625rem;-ms-letter-spacing:-0.005625rem;letter-spacing:-0.005625rem;font-weight:600;}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;margin:0;}button:focus,input:focus,select:focus,textarea:focus{outline:none;}code{color:${theme.palette.code};padding:calc(${theme.layout.gapQuarter} * 0.5) ${theme.layout.gapQuarter};border-radius:0.375rem;background-color:${addColorAlpha(theme.palette.code, 0.2)};font-family:${theme.font.mono};font-size:0.8rem;white-space:pre-wrap;-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;}code:hover{background-color:${addColorAlpha(theme.palette.code, 0.3)};}pre{border-radius:${theme.layout.radius};padding:calc(${theme.layout.gap} * 0.75) ${theme.layout.gap};margin:${theme.layout.gap} 0;font-family:${theme.font.mono};white-space:pre;overflow:auto;line-height:1.5;text-align:left;font-size:0.875rem;-webkit-overflow-scrolling:touch;}pre code{color:${theme.palette.foreground};font-size:0.8125rem;line-height:1.25rem;white-space:pre;}pre code:before,pre code:after{display:none;}pre p{margin:0;}pre::-webkit-scrollbar{display:none;width:0;height:0;background:transparent;}hr{border-color:${theme.palette.accents_2};}details{background-color:${theme.palette.accents_1};border:none;}details:focus,details:hover,details:active{outline:none;}summary{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;outline:none;}summary::-webkit-details-marker,summary::before{display:none;}summary::-moz-list-bullet{font-size:0;}summary:focus,summary:hover,summary:active{outline:none;list-style:none;}blockquote{padding:calc(0.667 * ${theme.layout.gap}) ${theme.layout.gap};color:${theme.palette.accents_5};background-color:${theme.palette.accents_1};border-radius:${theme.layout.radius};margin:1.5rem 0;}blockquote *:first-child{margin-top:0;}blockquote *:last-child{margin-bottom:0;}::selection{background-color:${theme.palette.selection};color:${theme.palette.foreground};}`
2353
+ id: "2908832453",
2354
+ dynamic: [theme.palette.background, theme.palette.text, theme.palette.background, theme.font.sans, theme.font.sans, theme.palette.link, theme.expressiveness.linkStyle, theme.expressiveness.linkHoverStyle, theme.layout.gapHalf, theme.layout.gapHalf, theme.layout.gapHalf, theme.layout.gap, theme.palette.foreground, theme.palette.code, theme.layout.gapQuarter, theme.layout.gapQuarter, addColorAlpha(theme.palette.code, 0.2), theme.font.mono, addColorAlpha(theme.palette.code, 0.3), theme.layout.radius, theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.font.mono, theme.palette.foreground, theme.palette.accents_2, theme.palette.accents_1, theme.layout.gap, theme.layout.gap, theme.palette.accents_5, theme.palette.accents_1, theme.layout.radius, theme.palette.selection, theme.palette.background],
2355
+ children: `html,body{background-color:${theme.palette.background};color:${theme.palette.text};}html{font-size:16px;--nextui-icons-background:${theme.palette.background};}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-size:1rem;line-height:1.5;margin:0;padding:0;min-height:100%;position:relative;overflow-x:hidden;font-family:${theme.font.sans};}*,*:before,*:after{box-sizing:border-box;text-rendering:geometricPrecision;-webkit-tap-highlight-color:transparent;}p,small{font-weight:400;color:inherit;-webkit-letter-spacing:-0.005625rem;-moz-letter-spacing:-0.005625rem;-ms-letter-spacing:-0.005625rem;letter-spacing:-0.005625rem;font-family:${theme.font.sans};}p{margin:1rem 0;font-size:1em;line-height:1.625em;}small{margin:0;line-height:1.5;font-size:0.875rem;}b{font-weight:600;}span{font-size:inherit;color:inherit;font-weight:inherit;}img{max-width:100%;}a{cursor:pointer;font-size:inherit;-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:${theme.palette.link};-webkit-text-decoration:${theme.expressiveness.linkStyle};text-decoration:${theme.expressiveness.linkStyle};}a:hover{-webkit-text-decoration:${theme.expressiveness.linkHoverStyle};text-decoration:${theme.expressiveness.linkHoverStyle};}ul,ol{padding:0;list-style-type:none;margin:${theme.layout.gapHalf} ${theme.layout.gapHalf} ${theme.layout.gapHalf} ${theme.layout.gap};color:${theme.palette.foreground};}ol{list-style-type:decimal;}li{margin-bottom:0.625rem;font-size:1em;line-height:1.625em;}h1,h2,h3,h4,h5,h6{color:inherit;margin:0 0 0.625rem 0;}h1{font-size:3rem;-webkit-letter-spacing:-0.066875rem;-moz-letter-spacing:-0.066875rem;-ms-letter-spacing:-0.066875rem;letter-spacing:-0.066875rem;line-height:1.5;font-weight:700;}h2{font-size:2.25rem;-webkit-letter-spacing:-0.020625rem;-moz-letter-spacing:-0.020625rem;-ms-letter-spacing:-0.020625rem;letter-spacing:-0.020625rem;font-weight:600;}h3{font-size:1.5rem;-webkit-letter-spacing:-0.029375rem;-moz-letter-spacing:-0.029375rem;-ms-letter-spacing:-0.029375rem;letter-spacing:-0.029375rem;font-weight:600;}h4{font-size:1.25rem;-webkit-letter-spacing:-0.020625rem;-moz-letter-spacing:-0.020625rem;-ms-letter-spacing:-0.020625rem;letter-spacing:-0.020625rem;font-weight:600;}h5{font-size:1rem;-webkit-letter-spacing:-0.01125rem;-moz-letter-spacing:-0.01125rem;-ms-letter-spacing:-0.01125rem;letter-spacing:-0.01125rem;font-weight:600;}h6{font-size:0.875rem;-webkit-letter-spacing:-0.005625rem;-moz-letter-spacing:-0.005625rem;-ms-letter-spacing:-0.005625rem;letter-spacing:-0.005625rem;font-weight:600;}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;margin:0;}button:focus,input:focus,select:focus,textarea:focus{outline:none;}code{color:${theme.palette.code};padding:calc(${theme.layout.gapQuarter} * 0.5) ${theme.layout.gapQuarter};border-radius:0.375rem;background-color:${addColorAlpha(theme.palette.code, 0.2)};font-family:${theme.font.mono};font-size:0.8rem;white-space:pre-wrap;-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;}code:hover{background-color:${addColorAlpha(theme.palette.code, 0.3)};}pre{border-radius:${theme.layout.radius};padding:calc(${theme.layout.gap} * 0.75) ${theme.layout.gap};margin:${theme.layout.gap} 0;font-family:${theme.font.mono};white-space:pre;overflow:auto;line-height:1.5;text-align:left;font-size:0.875rem;-webkit-overflow-scrolling:touch;}pre code{color:${theme.palette.foreground};font-size:0.8125rem;line-height:1.25rem;white-space:pre;}pre code:before,pre code:after{display:none;}pre p{margin:0;}pre::-webkit-scrollbar{display:none;width:0;height:0;background:transparent;}hr{border-color:${theme.palette.accents_2};}details{background-color:${theme.palette.accents_1};border:none;}details:focus,details:hover,details:active{outline:none;}summary{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;outline:none;}summary::-webkit-details-marker,summary::before{display:none;}summary::-moz-list-bullet{font-size:0;}summary:focus,summary:hover,summary:active{outline:none;list-style:none;}blockquote{padding:calc(0.667 * ${theme.layout.gap}) ${theme.layout.gap};color:${theme.palette.accents_5};background-color:${theme.palette.accents_1};border-radius:${theme.layout.radius};margin:1.5rem 0;}blockquote *:first-child{margin-top:0;}blockquote *:last-child{margin-bottom:0;}::selection{background-color:${theme.palette.selection};color:${theme.palette.background};}`
2332
2356
  }, void 0, false, void 0, undefined)]
2333
2357
  }, void 0, true, {
2334
2358
  fileName: css_baseline_jsxFileName,
@@ -2751,7 +2775,6 @@ const text_defaultProps = {
2751
2775
  b: false,
2752
2776
  small: false,
2753
2777
  transform: 'none',
2754
- upperCase: false,
2755
2778
  i: false,
2756
2779
  span: false,
2757
2780
  del: false,
@@ -2772,7 +2795,7 @@ const getModifierChild = (tags, children, size, transform) => {
2772
2795
  children: getModifierChild(nextTag, children, size)
2773
2796
  }, void 0, false, {
2774
2797
  fileName: text_jsxFileName,
2775
- lineNumber: 67,
2798
+ lineNumber: 66,
2776
2799
  columnNumber: 5
2777
2800
  }, undefined);
2778
2801
  };
@@ -2851,7 +2874,7 @@ const Text = ({
2851
2874
  children: modifers
2852
2875
  }, void 0, false, {
2853
2876
  fileName: text_jsxFileName,
2854
- lineNumber: 130,
2877
+ lineNumber: 129,
2855
2878
  columnNumber: 5
2856
2879
  }, undefined);
2857
2880
  };
@@ -3903,8 +3926,8 @@ const MemoLoading = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_re
3903
3926
  ;// CONCATENATED MODULE: ./src/loading/index.ts
3904
3927
 
3905
3928
  /* harmony default export */ const src_loading = (loading);
3906
- ;// CONCATENATED MODULE: ./src/shared/drip.tsx
3907
- var drip_jsxFileName = "/home/runner/work/nextui/nextui/packages/nextui/src/shared/drip.tsx";
3929
+ ;// CONCATENATED MODULE: ./src/utils/drip.tsx
3930
+ var drip_jsxFileName = "/home/runner/work/nextui/nextui/packages/nextui/src/utils/drip.tsx";
3908
3931
 
3909
3932
 
3910
3933
 
@@ -6767,8 +6790,8 @@ const InputContent = ({
6767
6790
 
6768
6791
  const MemoContentIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().memo(InputContent);
6769
6792
  /* harmony default export */ const input_content = (MemoContentIcon);
6770
- ;// CONCATENATED MODULE: ./src/shared/clear-icon.tsx
6771
- var clear_icon_jsxFileName = "/home/runner/work/nextui/nextui/packages/nextui/src/shared/clear-icon.tsx";
6793
+ ;// CONCATENATED MODULE: ./src/utils/clear-icon.tsx
6794
+ var clear_icon_jsxFileName = "/home/runner/work/nextui/nextui/packages/nextui/src/utils/clear-icon.tsx";
6772
6795
 
6773
6796
 
6774
6797
 
@@ -7978,7 +8001,7 @@ const Backdrop = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react
7978
8001
  className: styled_jsx_style["default"].dynamic([["903909204", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.breakpoints.sm.max]]]) + " " + (clsx('layer', blur ? 'layer-blur' : 'layer-default') || "")
7979
8002
  }, void 0, false, {
7980
8003
  fileName: backdrop_jsxFileName,
7981
- lineNumber: 72,
8004
+ lineNumber: 71,
7982
8005
  columnNumber: 11
7983
8006
  }, undefined), /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
7984
8007
  onClick: childrenClickHandler,
@@ -7987,7 +8010,7 @@ const Backdrop = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react
7987
8010
  children: children
7988
8011
  }, void 0, false, {
7989
8012
  fileName: backdrop_jsxFileName,
7990
- lineNumber: 75,
8013
+ lineNumber: 74,
7991
8014
  columnNumber: 11
7992
8015
  }, undefined), /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(styled_jsx_style["default"], {
7993
8016
  id: "903909204",
@@ -7996,7 +8019,7 @@ const Backdrop = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react
7996
8019
  }, void 0, false, void 0, undefined)]
7997
8020
  }, void 0, true, {
7998
8021
  fileName: backdrop_jsxFileName,
7999
- lineNumber: 64,
8022
+ lineNumber: 63,
8000
8023
  columnNumber: 9
8001
8024
  }, undefined);
8002
8025
  }, [children]);
@@ -8010,7 +8033,7 @@ const Backdrop = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react
8010
8033
  children: renderChildren
8011
8034
  }, void 0, false, {
8012
8035
  fileName: backdrop_jsxFileName,
8013
- lineNumber: 180,
8036
+ lineNumber: 179,
8014
8037
  columnNumber: 11
8015
8038
  }, undefined) : visible ? renderChildren : null
8016
8039
  }, void 0, false);
@@ -8346,6 +8369,433 @@ const useModal = (initialVisible = false) => {
8346
8369
  };
8347
8370
 
8348
8371
  /* harmony default export */ const use_modal = (useModal);
8372
+ ;// CONCATENATED MODULE: ./src/collapse/collapse-icon.tsx
8373
+ var collapse_icon_jsxFileName = "/home/runner/work/nextui/nextui/packages/nextui/src/collapse/collapse-icon.tsx";
8374
+
8375
+
8376
+
8377
+
8378
+ const CollapseIcon = ({ ...props
8379
+ }) => {
8380
+ const theme = src_use_theme();
8381
+ return /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("svg", {
8382
+ xmlns: "http://www.w3.org/2000/svg",
8383
+ className: "collapse-icon",
8384
+ width: "20",
8385
+ height: "20",
8386
+ viewBox: "0 0 24 24",
8387
+ ...props,
8388
+ children: /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("path", {
8389
+ d: "M15.002 19.92L8.479 13.4a1.986 1.986 0 010-2.8l6.523-6.52",
8390
+ fill: "none",
8391
+ stroke: theme.palette.accents_5,
8392
+ strokeLinecap: "round",
8393
+ strokeLinejoin: "round",
8394
+ strokeWidth: 1.5
8395
+ }, void 0, false, {
8396
+ fileName: collapse_icon_jsxFileName,
8397
+ lineNumber: 15,
8398
+ columnNumber: 7
8399
+ }, undefined)
8400
+ }, void 0, false, {
8401
+ fileName: collapse_icon_jsxFileName,
8402
+ lineNumber: 7,
8403
+ columnNumber: 5
8404
+ }, undefined);
8405
+ };
8406
+
8407
+ const MemoCollapseIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().memo(CollapseIcon);
8408
+ /* harmony default export */ const collapse_icon = (MemoCollapseIcon);
8409
+ ;// CONCATENATED MODULE: ./src/utils/expand.tsx
8410
+ var expand_jsxFileName = "/home/runner/work/nextui/nextui/packages/nextui/src/utils/expand.tsx";
8411
+
8412
+
8413
+
8414
+
8415
+
8416
+
8417
+ const expand_defaultProps = {
8418
+ isExpanded: false,
8419
+ animated: true,
8420
+ delay: 200
8421
+ };
8422
+
8423
+ const Expand = ({
8424
+ isExpanded,
8425
+ delay,
8426
+ animated,
8427
+ children
8428
+ }) => {
8429
+ const [height, setHeight] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(isExpanded ? 'auto' : '0');
8430
+ const [selfExpanded, setSelfExpanded] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(isExpanded);
8431
+ const contentRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
8432
+ const entryTimer = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
8433
+ const leaveTimer = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
8434
+ const resetTimer = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
8435
+ const [state, updateShape] = src_use_real_shape(contentRef);
8436
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => setHeight(`${state.height}px`), [state.height]);
8437
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
8438
+ if (isExpanded === selfExpanded) return; // show element or reset height.
8439
+ // force an update once manually, even if the element does not change.
8440
+ // (the height of the element might be "auto")
8441
+
8442
+ if (!isExpanded) {
8443
+ updateShape();
8444
+ setHeight(`${state.height}px`);
8445
+ } // show expand animation
8446
+
8447
+
8448
+ entryTimer.current = window.setTimeout(() => {
8449
+ setSelfExpanded(isExpanded);
8450
+ clearTimeout(entryTimer.current);
8451
+ }, 30); // Reset height after animation
8452
+
8453
+ if (isExpanded) {
8454
+ resetTimer.current = window.setTimeout(() => {
8455
+ setHeight('auto');
8456
+ clearTimeout(resetTimer.current);
8457
+ }, delay);
8458
+ } else {
8459
+ leaveTimer.current = window.setTimeout(() => {
8460
+ clearTimeout(leaveTimer.current);
8461
+ }, delay / 2);
8462
+ }
8463
+
8464
+ return () => {
8465
+ clearTimeout(entryTimer.current);
8466
+ clearTimeout(leaveTimer.current);
8467
+ clearTimeout(resetTimer.current);
8468
+ };
8469
+ }, [isExpanded]);
8470
+ return /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
8471
+ className: styled_jsx_style["default"].dynamic([["2028774268", [delay, delay * 1.5, height]]]) + " " + (clsx('container', {
8472
+ expanded: selfExpanded,
8473
+ animated
8474
+ }) || ""),
8475
+ children: [/*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
8476
+ ref: contentRef,
8477
+ className: styled_jsx_style["default"].dynamic([["2028774268", [delay, delay * 1.5, height]]]) + " " + "content",
8478
+ children: children
8479
+ }, void 0, false, {
8480
+ fileName: expand_jsxFileName,
8481
+ lineNumber: 72,
8482
+ columnNumber: 7
8483
+ }, undefined), /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(styled_jsx_style["default"], {
8484
+ id: "2028774268",
8485
+ dynamic: [delay, delay * 1.5, height],
8486
+ children: `.container.__jsx-style-dynamic-selector{padding:0;margin:0;height:0;opacity:0;overflow:hidden;}.animated.__jsx-style-dynamic-selector{-webkit-transition:height ${delay}ms ease 0ms, opacity ${delay * 1.5}ms ease 0ms;transition:height ${delay}ms ease 0ms, opacity ${delay * 1.5}ms ease 0ms;}.expanded.__jsx-style-dynamic-selector{height:${height};opacity:1;}`
8487
+ }, void 0, false, void 0, undefined)]
8488
+ }, void 0, true, {
8489
+ fileName: expand_jsxFileName,
8490
+ lineNumber: 71,
8491
+ columnNumber: 5
8492
+ }, undefined);
8493
+ };
8494
+
8495
+ /* harmony default export */ const expand = (with_defaults(Expand, expand_defaultProps));
8496
+ ;// CONCATENATED MODULE: ./src/collapse/collapse-context.ts
8497
+
8498
+ const collapse_context_defaultContext = {
8499
+ values: []
8500
+ };
8501
+ const CollapseContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext(collapse_context_defaultContext);
8502
+ const useCollapseContext = () => external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(CollapseContext);
8503
+ ;// CONCATENATED MODULE: ./src/collapse/collapse.tsx
8504
+ var collapse_jsxFileName = "/home/runner/work/nextui/nextui/packages/nextui/src/collapse/collapse.tsx";
8505
+
8506
+
8507
+
8508
+
8509
+
8510
+
8511
+
8512
+
8513
+
8514
+
8515
+
8516
+
8517
+ const collapse_defaultProps = {
8518
+ className: '',
8519
+ shadow: false,
8520
+ divider: true,
8521
+ bordered: false,
8522
+ showArrow: true,
8523
+ animated: true,
8524
+ disabled: false,
8525
+ borderWeight: 'light',
8526
+ initialExpanded: false
8527
+ };
8528
+
8529
+ const Collapse = ({
8530
+ children,
8531
+ title,
8532
+ subtitle,
8533
+ initialExpanded,
8534
+ shadow,
8535
+ className,
8536
+ divider,
8537
+ arrowIcon,
8538
+ showArrow,
8539
+ disabled,
8540
+ onChange,
8541
+ bordered,
8542
+ contentLeft,
8543
+ animated: animatedProp,
8544
+ borderWeight: borderWeightProp,
8545
+ index,
8546
+ ...props
8547
+ }) => {
8548
+ const theme = src_use_theme();
8549
+ const [visible, setVisible, visibleRef] = src_use_current_state(initialExpanded);
8550
+ const {
8551
+ values,
8552
+ divider: groupDivider,
8553
+ animated: groupAnimated,
8554
+ updateValues
8555
+ } = useCollapseContext();
8556
+
8557
+ if (!title) {
8558
+ src_use_warning('"title" is required.', 'Collapse');
8559
+ }
8560
+
8561
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
8562
+ if (!values.length) return;
8563
+ const isActive = !!values.find(item => item === index);
8564
+ setVisible(isActive);
8565
+ }, [values.join(',')]);
8566
+ const arrowComponent = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
8567
+ if (!showArrow) return null;
8568
+ return arrowIcon ? arrowIcon : /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(collapse_icon, {}, void 0, false, {
8569
+ fileName: collapse_jsxFileName,
8570
+ lineNumber: 93,
8571
+ columnNumber: 36
8572
+ }, undefined);
8573
+ }, [arrowIcon, showArrow]);
8574
+ const borderWeight = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
8575
+ const withDivider = groupDivider === undefined ? divider : groupDivider;
8576
+ return withDivider ? getNormalWeight(borderWeightProp) : '0px';
8577
+ }, [divider, groupDivider, borderWeightProp]);
8578
+ const animated = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
8579
+ return groupAnimated === undefined ? animatedProp : groupAnimated;
8580
+ }, [groupAnimated, animatedProp]);
8581
+ const bgColor = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => theme.type === 'dark' ? theme.palette.accents_1 : theme.palette.background, [theme.type]);
8582
+ const {
8583
+ ariaLabelledById,
8584
+ ariaControlId
8585
+ } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
8586
+ const nextuiId = getId();
8587
+ return {
8588
+ ariaLabelledById: `collapse-button-next-ui-${nextuiId}`,
8589
+ ariaControlId: `collapse-next-ui-${nextuiId}`
8590
+ };
8591
+ }, []);
8592
+
8593
+ const clickHandler = event => {
8594
+ if (disabled) return;
8595
+ const next = !visibleRef.current;
8596
+ setVisible(next);
8597
+ updateValues && updateValues(index, next);
8598
+ onChange && onChange(event, index, next);
8599
+ };
8600
+
8601
+ return /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", { ...props,
8602
+ className: styled_jsx_style["default"].dynamic([["1757461102", [borderWeight, theme.palette.border, borderWeight, theme.palette.border, bgColor, theme.expressiveness.shadowMedium, theme.layout.radius, theme.layout.gap, theme.layout.gap, theme.layout.radius, borderWeight, theme.palette.border, theme.layout.gap, theme.layout.gapHalf, theme.palette.foreground, visible ? '-90deg' : '0', theme.palette.accents_5, theme.layout.gap]]]) + " " + (props && props.className != null && props.className || clsx('collapse', {
8603
+ shadow,
8604
+ bordered
8605
+ }, className) || ""),
8606
+ children: [/*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
8607
+ role: "button",
8608
+ id: ariaLabelledById,
8609
+ "aria-disabled": disabled,
8610
+ "aria-expanded": visible,
8611
+ "aria-controls": ariaControlId,
8612
+ onClick: clickHandler,
8613
+ className: styled_jsx_style["default"].dynamic([["1757461102", [borderWeight, theme.palette.border, borderWeight, theme.palette.border, bgColor, theme.expressiveness.shadowMedium, theme.layout.radius, theme.layout.gap, theme.layout.gap, theme.layout.radius, borderWeight, theme.palette.border, theme.layout.gap, theme.layout.gapHalf, theme.palette.foreground, visible ? '-90deg' : '0', theme.palette.accents_5, theme.layout.gap]]]) + " " + (clsx('view', {
8614
+ disabled
8615
+ }) || ""),
8616
+ children: /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
8617
+ className: styled_jsx_style["default"].dynamic([["1757461102", [borderWeight, theme.palette.border, borderWeight, theme.palette.border, bgColor, theme.expressiveness.shadowMedium, theme.layout.radius, theme.layout.gap, theme.layout.gap, theme.layout.radius, borderWeight, theme.palette.border, theme.layout.gap, theme.layout.gapHalf, theme.palette.foreground, visible ? '-90deg' : '0', theme.palette.accents_5, theme.layout.gap]]]) + " " + (clsx('title', {
8618
+ animated
8619
+ }) || ""),
8620
+ children: [contentLeft && /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
8621
+ className: styled_jsx_style["default"].dynamic([["1757461102", [borderWeight, theme.palette.border, borderWeight, theme.palette.border, bgColor, theme.expressiveness.shadowMedium, theme.layout.radius, theme.layout.gap, theme.layout.gap, theme.layout.radius, borderWeight, theme.palette.border, theme.layout.gap, theme.layout.gapHalf, theme.palette.foreground, visible ? '-90deg' : '0', theme.palette.accents_5, theme.layout.gap]]]) + " " + "title-content-left",
8622
+ children: contentLeft
8623
+ }, void 0, false, {
8624
+ fileName: collapse_jsxFileName,
8625
+ lineNumber: 147,
8626
+ columnNumber: 13
8627
+ }, undefined), /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
8628
+ className: styled_jsx_style["default"].dynamic([["1757461102", [borderWeight, theme.palette.border, borderWeight, theme.palette.border, bgColor, theme.expressiveness.shadowMedium, theme.layout.radius, theme.layout.gap, theme.layout.gap, theme.layout.radius, borderWeight, theme.palette.border, theme.layout.gap, theme.layout.gapHalf, theme.palette.foreground, visible ? '-90deg' : '0', theme.palette.accents_5, theme.layout.gap]]]) + " " + "title-content",
8629
+ children: [/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(title) ? title : /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("h3", {
8630
+ className: styled_jsx_style["default"].dynamic([["1757461102", [borderWeight, theme.palette.border, borderWeight, theme.palette.border, bgColor, theme.expressiveness.shadowMedium, theme.layout.radius, theme.layout.gap, theme.layout.gap, theme.layout.radius, borderWeight, theme.palette.border, theme.layout.gap, theme.layout.gapHalf, theme.palette.foreground, visible ? '-90deg' : '0', theme.palette.accents_5, theme.layout.gap]]]),
8631
+ children: title
8632
+ }, void 0, false, {
8633
+ fileName: collapse_jsxFileName,
8634
+ lineNumber: 150,
8635
+ columnNumber: 52
8636
+ }, undefined), subtitle && /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
8637
+ className: styled_jsx_style["default"].dynamic([["1757461102", [borderWeight, theme.palette.border, borderWeight, theme.palette.border, bgColor, theme.expressiveness.shadowMedium, theme.layout.radius, theme.layout.gap, theme.layout.gap, theme.layout.radius, borderWeight, theme.palette.border, theme.layout.gap, theme.layout.gapHalf, theme.palette.foreground, visible ? '-90deg' : '0', theme.palette.accents_5, theme.layout.gap]]]) + " " + "subtitle",
8638
+ children: subtitle
8639
+ }, void 0, false, {
8640
+ fileName: collapse_jsxFileName,
8641
+ lineNumber: 151,
8642
+ columnNumber: 26
8643
+ }, undefined)]
8644
+ }, void 0, true, {
8645
+ fileName: collapse_jsxFileName,
8646
+ lineNumber: 149,
8647
+ columnNumber: 11
8648
+ }, undefined), /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
8649
+ className: styled_jsx_style["default"].dynamic([["1757461102", [borderWeight, theme.palette.border, borderWeight, theme.palette.border, bgColor, theme.expressiveness.shadowMedium, theme.layout.radius, theme.layout.gap, theme.layout.gap, theme.layout.radius, borderWeight, theme.palette.border, theme.layout.gap, theme.layout.gapHalf, theme.palette.foreground, visible ? '-90deg' : '0', theme.palette.accents_5, theme.layout.gap]]]) + " " + "title-content-right",
8650
+ children: arrowComponent
8651
+ }, void 0, false, {
8652
+ fileName: collapse_jsxFileName,
8653
+ lineNumber: 153,
8654
+ columnNumber: 11
8655
+ }, undefined)]
8656
+ }, void 0, true, {
8657
+ fileName: collapse_jsxFileName,
8658
+ lineNumber: 145,
8659
+ columnNumber: 9
8660
+ }, undefined)
8661
+ }, void 0, false, {
8662
+ fileName: collapse_jsxFileName,
8663
+ lineNumber: 136,
8664
+ columnNumber: 7
8665
+ }, undefined), /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(expand, {
8666
+ isExpanded: visible,
8667
+ animated: animated,
8668
+ children: /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", {
8669
+ role: "region",
8670
+ tabIndex: -1,
8671
+ id: ariaControlId,
8672
+ "aria-labelledby": ariaLabelledById,
8673
+ className: styled_jsx_style["default"].dynamic([["1757461102", [borderWeight, theme.palette.border, borderWeight, theme.palette.border, bgColor, theme.expressiveness.shadowMedium, theme.layout.radius, theme.layout.gap, theme.layout.gap, theme.layout.radius, borderWeight, theme.palette.border, theme.layout.gap, theme.layout.gapHalf, theme.palette.foreground, visible ? '-90deg' : '0', theme.palette.accents_5, theme.layout.gap]]]) + " " + "content",
8674
+ children: children
8675
+ }, void 0, false, {
8676
+ fileName: collapse_jsxFileName,
8677
+ lineNumber: 157,
8678
+ columnNumber: 9
8679
+ }, undefined)
8680
+ }, void 0, false, {
8681
+ fileName: collapse_jsxFileName,
8682
+ lineNumber: 156,
8683
+ columnNumber: 7
8684
+ }, undefined), /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(styled_jsx_style["default"], {
8685
+ id: "1757461102",
8686
+ dynamic: [borderWeight, theme.palette.border, borderWeight, theme.palette.border, bgColor, theme.expressiveness.shadowMedium, theme.layout.radius, theme.layout.gap, theme.layout.gap, theme.layout.radius, borderWeight, theme.palette.border, theme.layout.gap, theme.layout.gapHalf, theme.palette.foreground, visible ? '-90deg' : '0', theme.palette.accents_5, theme.layout.gap],
8687
+ children: `.collapse.__jsx-style-dynamic-selector{border-top:${borderWeight} solid ${theme.palette.border};border-bottom:${borderWeight} solid ${theme.palette.border};}.shadow.__jsx-style-dynamic-selector{border:none;background:${bgColor};box-shadow:${theme.expressiveness.shadowMedium};border-radius:${theme.layout.radius};padding:0 ${theme.layout.gap};}.bordered.__jsx-style-dynamic-selector{padding:0 ${theme.layout.gap};border-radius:${theme.layout.radius};border:${borderWeight} solid ${theme.palette.border};}.view.__jsx-style-dynamic-selector{cursor:pointer;outline:none;padding:${theme.layout.gap} 0;}.view.disabled.__jsx-style-dynamic-selector{cursor:not-allowed;}.view.disabled.__jsx-style-dynamic-selector .title.__jsx-style-dynamic-selector,.view.disabled.__jsx-style-dynamic-selector .subtitle.__jsx-style-dynamic-selector{opacity:0.5;}.title-content-left.__jsx-style-dynamic-selector,.title-content-right.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.title-content-left.__jsx-style-dynamic-selector{margin-right:${theme.layout.gapHalf};}.title-content.__jsx-style-dynamic-selector{width:100%;}.title.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:${theme.palette.foreground};}.title-content-right.__jsx-style-dynamic-selector svg{-webkit-transform:rotateZ(${visible ? '-90deg' : '0'});-ms-transform:rotateZ(${visible ? '-90deg' : '0'});transform:rotateZ(${visible ? '-90deg' : '0'});}.animated.__jsx-style-dynamic-selector .title-content-right.__jsx-style-dynamic-selector svg{-webkit-transition:-webkit-transform 200ms ease;-webkit-transition:transform 200ms ease;transition:transform 200ms ease;}.title-content.__jsx-style-dynamic-selector h1,.title-content.__jsx-style-dynamic-selector h2,.title-content.__jsx-style-dynamic-selector h3,.title-content.__jsx-style-dynamic-selector h4,.title-content.__jsx-style-dynamic-selector h5,.title-content.__jsx-style-dynamic-selector h6,.title-content.__jsx-style-dynamic-selector p,.title-content.__jsx-style-dynamic-selector span,.title-content.__jsx-style-dynamic-selector b{margin:0 !important;}.subtitle.__jsx-style-dynamic-selector{color:${theme.palette.accents_5};margin:0;}.subtitle.__jsx-style-dynamic-selector>*{margin:0;}.content.__jsx-style-dynamic-selector{font-size:1rem;line-height:1.625rem;padding-bottom:${theme.layout.gap};}.content.__jsx-style-dynamic-selector>*:first-child{margin-top:0;}.content.__jsx-style-dynamic-selector>*:last-child{margin-bottom:0;}`
8688
+ }, void 0, false, void 0, undefined)]
8689
+ }, void 0, true, {
8690
+ fileName: collapse_jsxFileName,
8691
+ lineNumber: 132,
8692
+ columnNumber: 5
8693
+ }, undefined);
8694
+ };
8695
+
8696
+ Collapse.defaultProps = collapse_defaultProps;
8697
+ /* harmony default export */ const collapse = (Collapse);
8698
+ ;// CONCATENATED MODULE: ./src/collapse/collapse-group.tsx
8699
+ var collapse_group_jsxFileName = "/home/runner/work/nextui/nextui/packages/nextui/src/collapse/collapse-group.tsx";
8700
+
8701
+
8702
+
8703
+
8704
+
8705
+
8706
+
8707
+
8708
+
8709
+
8710
+
8711
+ const collapse_group_defaultProps = {
8712
+ accordion: true,
8713
+ shadow: false,
8714
+ bordered: false,
8715
+ splitted: false,
8716
+ borderWeight: 'light',
8717
+ className: ''
8718
+ };
8719
+
8720
+ const CollapseGroup = ({
8721
+ children,
8722
+ accordion,
8723
+ shadow,
8724
+ className,
8725
+ animated,
8726
+ bordered,
8727
+ splitted,
8728
+ divider,
8729
+ borderWeight: borderWeightProp,
8730
+ onChange,
8731
+ ...props
8732
+ }) => {
8733
+ const theme = src_use_theme();
8734
+ const [state, setState, stateRef] = src_use_current_state([]);
8735
+
8736
+ const updateValues = (currentIndex, nextState) => {
8737
+ const hasChild = stateRef.current.find(val => val === currentIndex);
8738
+ onChange && onChange(currentIndex, nextState);
8739
+
8740
+ if (accordion) {
8741
+ if (nextState) return setState([currentIndex]);
8742
+ return setState([]);
8743
+ }
8744
+
8745
+ if (nextState) {
8746
+ // In a few cases, the user will set Collapse Component state manually.
8747
+ // If the user incorrectly set the state, Group component should ignore it.
8748
+
8749
+ /* istanbul ignore if */
8750
+ if (hasChild) return;
8751
+ return setState([...stateRef.current, currentIndex]);
8752
+ }
8753
+
8754
+ setState(stateRef.current.filter(item => item !== currentIndex));
8755
+ };
8756
+
8757
+ const bgColor = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => theme.type === 'dark' ? theme.palette.accents_1 : theme.palette.background, [theme.type]);
8758
+ const initialValue = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
8759
+ values: state,
8760
+ updateValues,
8761
+ divider,
8762
+ animated
8763
+ }), [state.join(',')]);
8764
+ const hasIndexChildren = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => setChildrenIndex(children, [collapse]), [children]);
8765
+ const borderWeight = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
8766
+ return bordered ? getNormalWeight(borderWeightProp) : '0px';
8767
+ }, [bordered, borderWeightProp]);
8768
+ return /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(CollapseContext.Provider, {
8769
+ value: initialValue,
8770
+ children: /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)("div", { ...props,
8771
+ className: styled_jsx_style["default"].dynamic([["2642035014", [theme.layout.gapHalf, theme.layout.radius, theme.layout.gap, bgColor, theme.expressiveness.shadowMedium, bgColor, theme.expressiveness.shadowMedium, theme.layout.gapHalf, borderWeight, theme.palette.border]]]) + " " + (props && props.className != null && props.className || clsx('collapse-group', {
8772
+ shadow,
8773
+ bordered,
8774
+ splitted
8775
+ }, className) || ""),
8776
+ children: [hasIndexChildren, /*#__PURE__*/(0,jsx_dev_runtime.jsxDEV)(styled_jsx_style["default"], {
8777
+ id: "2642035014",
8778
+ dynamic: [theme.layout.gapHalf, theme.layout.radius, theme.layout.gap, bgColor, theme.expressiveness.shadowMedium, bgColor, theme.expressiveness.shadowMedium, theme.layout.gapHalf, borderWeight, theme.palette.border],
8779
+ children: `.collapse-group.__jsx-style-dynamic-selector{width:auto;padding:0 ${theme.layout.gapHalf};}.collapse-group.__jsx-style-dynamic-selector>div + div{border-top:none;}.shadow.__jsx-style-dynamic-selector,.bordered.__jsx-style-dynamic-selector,.collapse-group.splitted.__jsx-style-dynamic-selector .collapse{border-radius:${theme.layout.radius};padding:0 ${theme.layout.gap};}.shadow.__jsx-style-dynamic-selector{border:none;background:${bgColor};box-shadow:${theme.expressiveness.shadowMedium};}.collapse-group.splitted.__jsx-style-dynamic-selector .collapse{border:none;background:${bgColor};box-shadow:${theme.expressiveness.shadowMedium};margin:${theme.layout.gapHalf} 0;}.bordered.__jsx-style-dynamic-selector{border:${borderWeight} solid ${theme.palette.border};}.collapse-group.__jsx-style-dynamic-selector .collapse:last-child{border-bottom:none;}.collapse-group.__jsx-style-dynamic-selector .collapse:first-child{border-top:none;}.gradient.vertical.__jsx-style-dynamic-selector .button:not(:last-child):not(:first-child){padding-top:0 !important;}`
8780
+ }, void 0, false, void 0, undefined)]
8781
+ }, void 0, true, {
8782
+ fileName: collapse_group_jsxFileName,
8783
+ lineNumber: 98,
8784
+ columnNumber: 7
8785
+ }, undefined)
8786
+ }, void 0, false, {
8787
+ fileName: collapse_group_jsxFileName,
8788
+ lineNumber: 97,
8789
+ columnNumber: 5
8790
+ }, undefined);
8791
+ };
8792
+
8793
+ /* harmony default export */ const collapse_group = (with_defaults(CollapseGroup, collapse_group_defaultProps));
8794
+ ;// CONCATENATED MODULE: ./src/collapse/index.ts
8795
+
8796
+
8797
+ collapse.Group = collapse_group;
8798
+ /* harmony default export */ const src_collapse = (collapse);
8349
8799
  ;// CONCATENATED MODULE: ./src/index.ts
8350
8800
  /// <reference types="styled-jsx" />
8351
8801
 
@@ -8393,6 +8843,7 @@ const useModal = (initialVisible = false) => {
8393
8843
 
8394
8844
 
8395
8845
 
8846
+
8396
8847
 
8397
8848
 
8398
8849
  })();