@chayns-components/core 5.0.24 → 5.0.26

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 (114) hide show
  1. package/lib/cjs/components/accordion/accordion-body/AccordionBody.js +1 -6
  2. package/lib/cjs/components/accordion/accordion-body/AccordionBody.js.map +1 -1
  3. package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js +0 -27
  4. package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  5. package/lib/cjs/components/accordion/accordion-content/AccordionContent.js +6 -13
  6. package/lib/cjs/components/accordion/accordion-content/AccordionContent.js.map +1 -1
  7. package/lib/cjs/components/accordion/accordion-content/AccordionContent.styles.js +0 -27
  8. package/lib/cjs/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
  9. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js +5 -1
  10. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  11. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js +37 -0
  12. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  13. package/lib/cjs/components/combobox/ComboBox.js +6 -13
  14. package/lib/cjs/components/combobox/ComboBox.js.map +1 -1
  15. package/lib/cjs/components/combobox/ComboBox.styles.js +1 -36
  16. package/lib/cjs/components/combobox/ComboBox.styles.js.map +1 -1
  17. package/lib/cjs/components/combobox/ComboBox.types.js +12 -0
  18. package/lib/cjs/components/combobox/ComboBox.types.js.map +1 -0
  19. package/lib/cjs/components/combobox/combobox-item/ComboBoxItem.js.map +1 -1
  20. package/lib/cjs/components/filter/filter-content/FIlterContent.js.map +1 -1
  21. package/lib/cjs/components/list/List.js +97 -37
  22. package/lib/cjs/components/list/List.js.map +1 -1
  23. package/lib/cjs/components/list/list-item/ListItem.js +0 -9
  24. package/lib/cjs/components/list/list-item/ListItem.js.map +1 -1
  25. package/lib/cjs/components/number-input/NumberInput.js +213 -132
  26. package/lib/cjs/components/number-input/NumberInput.js.map +1 -1
  27. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.js +1 -4
  28. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.js.map +1 -1
  29. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js +0 -34
  30. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js.map +1 -1
  31. package/lib/cjs/components/scroll-view/ScrollView.js +10 -16
  32. package/lib/cjs/components/scroll-view/ScrollView.js.map +1 -1
  33. package/lib/cjs/components/scroll-view/ScrollView.styles.js +3 -38
  34. package/lib/cjs/components/scroll-view/ScrollView.styles.js.map +1 -1
  35. package/lib/cjs/components/search-box/SearchBox.styles.js +2 -29
  36. package/lib/cjs/components/search-box/SearchBox.styles.js.map +1 -1
  37. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.js +2 -6
  38. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.js.map +1 -1
  39. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.styles.js +0 -27
  40. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.styles.js.map +1 -1
  41. package/lib/cjs/components/text-area/TextArea.js +2 -6
  42. package/lib/cjs/components/text-area/TextArea.js.map +1 -1
  43. package/lib/cjs/components/text-area/TextArea.styles.js +2 -31
  44. package/lib/cjs/components/text-area/TextArea.styles.js.map +1 -1
  45. package/lib/cjs/index.js +3 -2
  46. package/lib/cjs/index.js.map +1 -1
  47. package/lib/cjs/utils/calculate.js.map +1 -1
  48. package/lib/cjs/utils/numberInput.js +1 -0
  49. package/lib/cjs/utils/numberInput.js.map +1 -1
  50. package/lib/esm/components/accordion/accordion-body/AccordionBody.js +1 -6
  51. package/lib/esm/components/accordion/accordion-body/AccordionBody.js.map +1 -1
  52. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js +0 -27
  53. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  54. package/lib/esm/components/accordion/accordion-content/AccordionContent.js +6 -13
  55. package/lib/esm/components/accordion/accordion-content/AccordionContent.js.map +1 -1
  56. package/lib/esm/components/accordion/accordion-content/AccordionContent.styles.js +0 -27
  57. package/lib/esm/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
  58. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +6 -2
  59. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  60. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js +38 -1
  61. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  62. package/lib/esm/components/combobox/ComboBox.js +5 -12
  63. package/lib/esm/components/combobox/ComboBox.js.map +1 -1
  64. package/lib/esm/components/combobox/ComboBox.styles.js +1 -36
  65. package/lib/esm/components/combobox/ComboBox.styles.js.map +1 -1
  66. package/lib/esm/components/combobox/ComboBox.types.js +6 -0
  67. package/lib/esm/components/combobox/ComboBox.types.js.map +1 -0
  68. package/lib/esm/components/combobox/combobox-item/ComboBoxItem.js.map +1 -1
  69. package/lib/esm/components/filter/filter-content/FIlterContent.js.map +1 -1
  70. package/lib/esm/components/list/List.js +97 -37
  71. package/lib/esm/components/list/List.js.map +1 -1
  72. package/lib/esm/components/list/list-item/ListItem.js +0 -9
  73. package/lib/esm/components/list/list-item/ListItem.js.map +1 -1
  74. package/lib/esm/components/number-input/NumberInput.js +213 -132
  75. package/lib/esm/components/number-input/NumberInput.js.map +1 -1
  76. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.js +2 -5
  77. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.js.map +1 -1
  78. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js +0 -34
  79. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js.map +1 -1
  80. package/lib/esm/components/scroll-view/ScrollView.js +10 -16
  81. package/lib/esm/components/scroll-view/ScrollView.js.map +1 -1
  82. package/lib/esm/components/scroll-view/ScrollView.styles.js +3 -38
  83. package/lib/esm/components/scroll-view/ScrollView.styles.js.map +1 -1
  84. package/lib/esm/components/search-box/SearchBox.styles.js +1 -28
  85. package/lib/esm/components/search-box/SearchBox.styles.js.map +1 -1
  86. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.js +2 -6
  87. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.js.map +1 -1
  88. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.styles.js +0 -27
  89. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.styles.js.map +1 -1
  90. package/lib/esm/components/text-area/TextArea.js +2 -6
  91. package/lib/esm/components/text-area/TextArea.js.map +1 -1
  92. package/lib/esm/components/text-area/TextArea.styles.js +1 -30
  93. package/lib/esm/components/text-area/TextArea.styles.js.map +1 -1
  94. package/lib/esm/index.js +2 -1
  95. package/lib/esm/index.js.map +1 -1
  96. package/lib/esm/utils/calculate.js.map +1 -1
  97. package/lib/esm/utils/numberInput.js +1 -0
  98. package/lib/esm/utils/numberInput.js.map +1 -1
  99. package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +0 -2
  100. package/lib/types/components/accordion/accordion-content/AccordionContent.styles.d.ts +0 -2
  101. package/lib/types/components/color-scheme-provider/ColorSchemeProvider.styles.d.ts +7 -3
  102. package/lib/types/components/combobox/ComboBox.d.ts +2 -139
  103. package/lib/types/components/combobox/ComboBox.styles.d.ts +1 -3
  104. package/lib/types/components/combobox/ComboBox.types.d.ts +139 -0
  105. package/lib/types/components/combobox/combobox-item/ComboBoxItem.d.ts +1 -1
  106. package/lib/types/components/list/List.d.ts +0 -1
  107. package/lib/types/components/popup/popup-content-wrapper/PopupContentWrapper.styles.d.ts +0 -2
  108. package/lib/types/components/scroll-view/ScrollView.styles.d.ts +0 -2
  109. package/lib/types/components/search-box/SearchBox.styles.d.ts +0 -2
  110. package/lib/types/components/search-box/search-box-body/SearchBoxBody.styles.d.ts +0 -2
  111. package/lib/types/components/text-area/TextArea.styles.d.ts +0 -2
  112. package/lib/types/index.d.ts +3 -1
  113. package/lib/types/utils/calculate.d.ts +1 -1
  114. package/package.json +2 -2
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _chaynsApi = require("chayns-api");
8
7
  var _react = _interopRequireWildcard(require("react"));
9
8
  var _ScrollView = require("./ScrollView.styles");
10
9
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
@@ -16,21 +15,16 @@ const ScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
16
15
  children,
17
16
  overflowX = 'auto',
18
17
  overflowY = 'auto'
19
- }, ref) => {
20
- const {
21
- browser
22
- } = (0, _chaynsApi.getDevice)();
23
- return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_ScrollView.StyledScrollView, {
24
- $browser: browser === null || browser === void 0 ? void 0 : browser.name,
25
- $maxHeight: maxHeight,
26
- $height: height,
27
- $maxWidth: maxWidth,
28
- $width: width,
29
- $overflowX: overflowX,
30
- $overflowY: overflowY,
31
- ref: ref
32
- }, children), [browser === null || browser === void 0 ? void 0 : browser.name, children, height, maxHeight, maxWidth, overflowX, overflowY, ref, width]);
33
- });
18
+ }, ref) => (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_ScrollView.StyledScrollView, {
19
+ className: "chayns-scrollbar",
20
+ $maxHeight: maxHeight,
21
+ $height: height,
22
+ $maxWidth: maxWidth,
23
+ $width: width,
24
+ $overflowX: overflowX,
25
+ $overflowY: overflowY,
26
+ ref: ref
27
+ }, children), [children, height, maxHeight, maxWidth, overflowX, overflowY, ref, width]));
34
28
  ScrollView.displayName = 'ScrollView';
35
29
  var _default = exports.default = ScrollView;
36
30
  //# sourceMappingURL=ScrollView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollView.js","names":["_chaynsApi","require","_react","_interopRequireWildcard","_ScrollView","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ScrollView","forwardRef","maxHeight","height","maxWidth","width","children","overflowX","overflowY","ref","browser","getDevice","useMemo","createElement","StyledScrollView","$browser","name","$maxHeight","$height","$maxWidth","$width","$overflowX","$overflowY","displayName","_default","exports"],"sources":["../../../../src/components/scroll-view/ScrollView.tsx"],"sourcesContent":["import { getDevice } from 'chayns-api';\nimport React, { CSSProperties, forwardRef, ReactNode, useMemo } from 'react';\nimport { BrowserName } from '../../types/chayns';\nimport { StyledScrollView } from './ScrollView.styles';\n\nexport type ScrollViewProps = {\n /**\n * The elements that should be shown inside the scrollview\n */\n children: ReactNode;\n /**\n * The maximum height of the scroll view.\n */\n maxHeight?: CSSProperties['height'] | null;\n /**\n * The height of the scroll view.\n */\n height?: CSSProperties['height'];\n /**\n * The maximum width of the scroll view.\n */\n maxWidth?: CSSProperties['width'];\n /**\n * The width of the scroll view.\n */\n width?: CSSProperties['width'];\n /**\n * The overflow-x style of the scroll view.\n */\n overflowX?: 'scroll' | 'auto';\n /**\n * The overflow-y style of the scroll view.\n */\n overflowY?: 'scroll' | 'auto';\n};\n\nconst ScrollView = forwardRef<HTMLDivElement, ScrollViewProps>(\n (\n {\n maxHeight = 300,\n height,\n maxWidth,\n width,\n children,\n overflowX = 'auto',\n overflowY = 'auto',\n },\n ref,\n ) => {\n const { browser } = getDevice();\n\n return useMemo(\n () => (\n <StyledScrollView\n $browser={browser?.name as BrowserName}\n $maxHeight={maxHeight}\n $height={height}\n $maxWidth={maxWidth}\n $width={width}\n $overflowX={overflowX}\n $overflowY={overflowY}\n ref={ref}\n >\n {children}\n </StyledScrollView>\n ),\n [\n browser?.name,\n children,\n height,\n maxHeight,\n maxWidth,\n overflowX,\n overflowY,\n ref,\n width,\n ],\n );\n },\n);\n\nScrollView.displayName = 'ScrollView';\n\nexport default ScrollView;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAAuD,SAAAE,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAiCvD,MAAMkB,UAAU,gBAAG,IAAAC,iBAAU,EACzB,CACI;EACIC,SAAS,GAAG,GAAG;EACfC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACLC,QAAQ;EACRC,SAAS,GAAG,MAAM;EAClBC,SAAS,GAAG;AAChB,CAAC,EACDC,GAAG,KACF;EACD,MAAM;IAAEC;EAAQ,CAAC,GAAG,IAAAC,oBAAS,EAAC,CAAC;EAE/B,OAAO,IAAAC,cAAO,EACV,mBACIlC,MAAA,CAAAa,OAAA,CAAAsB,aAAA,CAACjC,WAAA,CAAAkC,gBAAgB;IACbC,QAAQ,EAAEL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEM,IAAoB;IACvCC,UAAU,EAAEf,SAAU;IACtBgB,OAAO,EAAEf,MAAO;IAChBgB,SAAS,EAAEf,QAAS;IACpBgB,MAAM,EAAEf,KAAM;IACdgB,UAAU,EAAEd,SAAU;IACtBe,UAAU,EAAEd,SAAU;IACtBC,GAAG,EAAEA;EAAI,GAERH,QACa,CACrB,EACD,CACII,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEM,IAAI,EACbV,QAAQ,EACRH,MAAM,EACND,SAAS,EACTE,QAAQ,EACRG,SAAS,EACTC,SAAS,EACTC,GAAG,EACHJ,KAAK,CAEb,CAAC;AACL,CACJ,CAAC;AAEDL,UAAU,CAACuB,WAAW,GAAG,YAAY;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlC,OAAA,GAEvBS,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"ScrollView.js","names":["_react","_interopRequireWildcard","require","_ScrollView","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ScrollView","forwardRef","maxHeight","height","maxWidth","width","children","overflowX","overflowY","ref","useMemo","createElement","StyledScrollView","className","$maxHeight","$height","$maxWidth","$width","$overflowX","$overflowY","displayName","_default","exports"],"sources":["../../../../src/components/scroll-view/ScrollView.tsx"],"sourcesContent":["import React, { CSSProperties, forwardRef, ReactNode, useMemo } from 'react';\nimport { StyledScrollView } from './ScrollView.styles';\n\nexport type ScrollViewProps = {\n /**\n * The elements that should be shown inside the scrollview\n */\n children: ReactNode;\n /**\n * The maximum height of the scroll view.\n */\n maxHeight?: CSSProperties['height'] | null;\n /**\n * The height of the scroll view.\n */\n height?: CSSProperties['height'];\n /**\n * The maximum width of the scroll view.\n */\n maxWidth?: CSSProperties['width'];\n /**\n * The width of the scroll view.\n */\n width?: CSSProperties['width'];\n /**\n * The overflow-x style of the scroll view.\n */\n overflowX?: 'scroll' | 'auto';\n /**\n * The overflow-y style of the scroll view.\n */\n overflowY?: 'scroll' | 'auto';\n};\n\nconst ScrollView = forwardRef<HTMLDivElement, ScrollViewProps>(\n (\n {\n maxHeight = 300,\n height,\n maxWidth,\n width,\n children,\n overflowX = 'auto',\n overflowY = 'auto',\n },\n ref,\n ) =>\n useMemo(\n () => (\n <StyledScrollView\n className=\"chayns-scrollbar\"\n $maxHeight={maxHeight}\n $height={height}\n $maxWidth={maxWidth}\n $width={width}\n $overflowX={overflowX}\n $overflowY={overflowY}\n ref={ref}\n >\n {children}\n </StyledScrollView>\n ),\n [children, height, maxHeight, maxWidth, overflowX, overflowY, ref, width],\n ),\n);\n\nScrollView.displayName = 'ScrollView';\n\nexport default ScrollView;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAuD,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,C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EX,SAAU;EACtBC,GAAG,EAAEA;AAAI,GAERH,QACa,CACrB,EACD,CAACA,QAAQ,EAAEH,MAAM,EAAED,SAAS,EAAEE,QAAQ,EAAEG,SAAS,EAAEC,SAAS,EAAEC,GAAG,EAAEJ,KAAK,CAC5E,CACR,CAAC;AAEDL,UAAU,CAACoB,WAAW,GAAG,YAAY;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA/B,OAAA,GAEvBS,UAAU","ignoreList":[]}
@@ -16,17 +16,17 @@ const StyledScrollView = exports.StyledScrollView = _styledComponents.default.di
16
16
  $height
17
17
  }) => $height && (0, _styledComponents.css)`
18
18
  height: ${typeof $height === 'number' ? `${$height}px` : $height};
19
- `}
19
+ `}
20
20
  ${({
21
21
  $maxWidth
22
22
  }) => $maxWidth && (0, _styledComponents.css)`
23
23
  max-width: ${typeof $maxWidth === 'number' ? `${$maxWidth}px` : $maxWidth};
24
- `}
24
+ `}
25
25
  ${({
26
26
  $width
27
27
  }) => $width && (0, _styledComponents.css)`
28
28
  width: ${typeof $width === 'number' ? `${$width}px` : $width};
29
- `}
29
+ `}
30
30
  ${({
31
31
  $overflowX
32
32
  }) => (0, _styledComponents.css)`
@@ -37,40 +37,5 @@ const StyledScrollView = exports.StyledScrollView = _styledComponents.default.di
37
37
  }) => (0, _styledComponents.css)`
38
38
  overflow-y: ${$overflowY};
39
39
  `}
40
-
41
- // Styles for custom scrollbar
42
- ${({
43
- $browser,
44
- theme
45
- }) => $browser === 'firefox' ? (0, _styledComponents.css)`
46
- scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
47
- scrollbar-width: thin;
48
- ` : (0, _styledComponents.css)`
49
- &::-webkit-scrollbar {
50
- width: 10px;
51
- height: 10px;
52
- }
53
-
54
- &::-webkit-scrollbar-track {
55
- background-color: transparent;
56
- }
57
-
58
- &::-webkit-scrollbar-button {
59
- background-color: transparent;
60
- height: 5px;
61
- width: 5px;
62
- }
63
-
64
- &::-webkit-scrollbar-thumb {
65
- background-color: rgba(${theme['text-rgb']}, 0.15);
66
- border-radius: 20px;
67
- background-clip: padding-box;
68
- border: solid 3px transparent;
69
- }
70
-
71
- &::-webkit-scrollbar-corner {
72
- background-color: transparent;
73
- }
74
- `}
75
40
  `;
76
41
  //# sourceMappingURL=ScrollView.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollView.styles.js","names":["_styledComponents","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledScrollView","exports","styled","div","$maxHeight","css","$height","$maxWidth","$width","$overflowX","$overflowY","$browser","theme"],"sources":["../../../../src/components/scroll-view/ScrollView.styles.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport styled, { css } from 'styled-components';\nimport { BrowserName } from '../../types/chayns';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledScrollViewProps = WithTheme<{\n $maxHeight?: CSSProperties['height'] | null;\n $height?: CSSProperties['height'];\n $maxWidth?: CSSProperties['width'];\n $width?: CSSProperties['width'];\n $overflowX: 'scroll' | 'auto';\n $overflowY: 'scroll' | 'auto';\n $browser: BrowserName;\n}>;\n\nexport const StyledScrollView = styled.div<StyledScrollViewProps>`\n ${({ $maxHeight }) =>\n $maxHeight &&\n css`\n max-height: ${typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight};\n `}\n ${({ $height }) =>\n $height &&\n css`\n height: ${typeof $height === 'number' ? `${$height}px` : $height};\n `} \n ${({ $maxWidth }) =>\n $maxWidth &&\n css`\n max-width: ${typeof $maxWidth === 'number' ? `${$maxWidth}px` : $maxWidth};\n `} \n ${({ $width }) =>\n $width &&\n css`\n width: ${typeof $width === 'number' ? `${$width}px` : $width};\n `} \n ${({ $overflowX }) => css`\n overflow-x: ${$overflowX};\n `}\n ${({ $overflowY }) => css`\n overflow-y: ${$overflowY};\n `}\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledScrollViewProps) =>\n $browser === 'firefox'\n ? css`\n scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;\n scrollbar-width: thin;\n `\n : css`\n &::-webkit-scrollbar {\n width: 10px;\n height: 10px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-button {\n background-color: transparent;\n height: 5px;\n width: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(${theme['text-rgb']}, 0.15);\n border-radius: 20px;\n background-clip: padding-box;\n border: solid 3px transparent;\n }\n\n &::-webkit-scrollbar-corner {\n background-color: transparent;\n }\n `}\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA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AC3D;AACA,eAAe,GACD,IAAAP,qBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CO,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ScrollView.styles.js","names":["_styledComponents","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledScrollView","exports","styled","div","$maxHeight","css","$height","$maxWidth","$width","$overflowX","$overflowY"],"sources":["../../../../src/components/scroll-view/ScrollView.styles.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledScrollViewProps = WithTheme<{\n $maxHeight?: CSSProperties['height'] | null;\n $height?: CSSProperties['height'];\n $maxWidth?: CSSProperties['width'];\n $width?: CSSProperties['width'];\n $overflowX: 'scroll' | 'auto';\n $overflowY: 'scroll' | 'auto';\n}>;\n\nexport const StyledScrollView = styled.div<StyledScrollViewProps>`\n ${({ $maxHeight }) =>\n $maxHeight &&\n css`\n max-height: ${typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight};\n `}\n ${({ $height }) =>\n $height &&\n css`\n height: ${typeof $height === 'number' ? `${$height}px` : $height};\n `}\n ${({ $maxWidth }) =>\n $maxWidth &&\n css`\n max-width: ${typeof $maxWidth === 'number' ? `${$maxWidth}px` : $maxWidth};\n `}\n ${({ $width }) =>\n $width &&\n css`\n width: ${typeof $width === 'number' ? `${$width}px` : $width};\n `}\n ${({ $overflowX }) => css`\n overflow-x: ${$overflowX};\n `}\n ${({ $overflowY }) => css`\n overflow-y: ${$overflowY};\n `}\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,uBA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AAQ,CAAC,KACVA,OAAO,IACP,IAAAD,qBAAG;AACX,sBAAsB,OAAOC,OAAO,KAAK,QAAQ,GAAG,GAAGA,OAAO,IAAI,GAAGA,OAAO;AAC5E,SAAS;AACT,MAAM,CAAC;EAAEC;AAAU,CAAC,KACZA,SAAS,IACT,IAAAF,qBAAG;AACX,yBAAyB,OAAOE,SAAS,KAAK,QAAQ,GAAG,GAAGA,SAAS,IAAI,GAAGA,SAAS;AACrF,SAAS;AACT,MAAM,CAAC;EAAEC;AAAO,CAAC,KACTA,MAAM,IACN,IAAAH,qBAAG;AACX,qBAAqB,OAAOG,MAAM,KAAK,QAAQ,GAAG,GAAGA,MAAM,IAAI,GAAGA,MAAM;AACxE,SAAS;AACT,MAAM,CAAC;EAAEC;AAAW,CAAC,KAAK,IAAAJ,qBAAG;AAC7B,sBAAsBI,UAAU;AAChC,KAAK;AACL,MAAM,CAAC;EAAEC;AAAW,CAAC,KAAK,IAAAL,qBAAG;AAC7B,sBAAsBK,UAAU;AAChC,KAAK;AACL,CAAC","ignoreList":[]}
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.StyledSearchBoxLeftWrapper = exports.StyledSearchBoxIcon = exports.StyledSearchBoxHintText = exports.StyledSearchBox = exports.StyledMotionSearchBoxBody = void 0;
7
7
  var _react = require("motion/react");
8
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
10
  const StyledSearchBox = exports.StyledSearchBox = _styledComponents.default.div``;
11
11
  const StyledMotionSearchBoxBody = exports.StyledMotionSearchBoxBody = (0, _styledComponents.default)(_react.motion.div)`
12
12
  background: ${({
@@ -32,33 +32,6 @@ const StyledMotionSearchBoxBody = exports.StyledMotionSearchBoxBody = (0, _style
32
32
  rgba(${({
33
33
  theme
34
34
  }) => theme['009-rgb']}, 0.08) inset;
35
-
36
- // Styles for custom scrollbar
37
- ${({
38
- $browser,
39
- theme
40
- }) => $browser === 'firefox' ? (0, _styledComponents.css)`
41
- scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
42
- scrollbar-width: thin;
43
- ` : (0, _styledComponents.css)`
44
- &::-webkit-scrollbar {
45
- width: 5px;
46
- }
47
-
48
- &::-webkit-scrollbar-track {
49
- background-color: transparent;
50
- }
51
-
52
- &::-webkit-scrollbar-button {
53
- background-color: transparent;
54
- height: 5px;
55
- }
56
-
57
- &::-webkit-scrollbar-thumb {
58
- background-color: rgba(${theme['text-rgb']}, 0.15);
59
- border-radius: 20px;
60
- }
61
- `}
62
35
  `;
63
36
  const StyledSearchBoxIcon = exports.StyledSearchBoxIcon = _styledComponents.default.div`
64
37
  cursor: pointer;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBox.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledSearchBox","exports","styled","div","StyledMotionSearchBoxBody","motion","theme","$width","$height","$browser","css","StyledSearchBoxIcon","StyledSearchBoxLeftWrapper","StyledSearchBoxHintText"],"sources":["../../../../src/components/search-box/SearchBox.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport { BrowserName } from '../../types/chayns';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledSearchBox = styled.div``;\n\ntype StyledMotionSearchBoxBodyProps = WithTheme<{\n $height: number;\n $width: number;\n $browser: BrowserName;\n}>;\n\nexport const StyledMotionSearchBoxBody = styled(motion.div)<StyledMotionSearchBoxBodyProps>`\n background: ${({ theme }: StyledMotionSearchBoxBodyProps) => theme['000']};\n position: absolute;\n z-index: 4;\n display: flex;\n flex-direction: column;\n border: 1px solid rgba(160, 160, 160, 0.3);\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n border-top: none;\n cursor: pointer;\n width: ${({ $width }) => $width}px;\n max-height: 300px;\n overflow-y: ${({ $height }) => ($height <= 300 ? 'hidden' : 'auto')};\n box-shadow: 0 0 0 1px\n rgba(${({ theme }: StyledMotionSearchBoxBodyProps) => theme['009-rgb']}, 0.08) inset;\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledMotionSearchBoxBodyProps) =>\n $browser === 'firefox'\n ? css`\n scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;\n scrollbar-width: thin;\n `\n : css`\n &::-webkit-scrollbar {\n width: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-button {\n background-color: transparent;\n height: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(${theme['text-rgb']}, 0.15);\n border-radius: 20px;\n }\n `}\n`;\n\nexport const StyledSearchBoxIcon = styled.div`\n cursor: pointer;\n padding: 0 10px;\n`;\n\nexport const StyledSearchBoxLeftWrapper = styled.div`\n display: flex;\n align-items: center;\n gap: 8px;\n`;\n\nexport const StyledSearchBoxHintText = styled.div`\n text-align: center;\n opacity: 0.8;\n padding: 6px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAgD,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC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,CAAC,KAAKA,MAAM;AACnC;AACA,kBAAkB,CAAC;EAAEC;AAAQ,CAAC,KAAMA,OAAO,IAAI,GAAG,GAAG,QAAQ,GAAG,MAAO;AACvE;AACA,eAAe,CAAC;EAAEF;AAAsC,CAAC,KAAKA,KAAK,CAAC,SAAS,CAAC;AAC9E;AACA;AACA,MAAM,CAAC;EAAEG,QAAQ;EAAEH;AAAsC,CAAC,KAClDG,QAAQ,KAAK,SAAS,GAChB,IAAAC,qBAAG;AACjB,0CAA0CJ,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACD,IAAAI,qBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CJ,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AACf,CAAC;AAEM,MAAMK,mBAAmB,GAAAV,OAAA,CAAAU,mBAAA,GAAGT,yBAAM,CAACC,GAAG;AAC7C;AACA;AACA,CAAC;AAEM,MAAMS,0BAA0B,GAAAX,OAAA,CAAAW,0BAAA,GAAGV,yBAAM,CAACC,GAAG;AACpD;AACA;AACA;AACA,CAAC;AAEM,MAAMU,uBAAuB,GAAAZ,OAAA,CAAAY,uBAAA,GAAGX,yBAAM,CAACC,GAAG;AACjD;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"SearchBox.styles.js","names":["_react","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledSearchBox","exports","styled","div","StyledMotionSearchBoxBody","motion","theme","$width","$height","StyledSearchBoxIcon","StyledSearchBoxLeftWrapper","StyledSearchBoxHintText"],"sources":["../../../../src/components/search-box/SearchBox.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledSearchBox = styled.div``;\n\ntype StyledMotionSearchBoxBodyProps = WithTheme<{\n $height: number;\n $width: number;\n}>;\n\nexport const StyledMotionSearchBoxBody = styled(motion.div)<StyledMotionSearchBoxBodyProps>`\n background: ${({ theme }: StyledMotionSearchBoxBodyProps) => theme['000']};\n position: absolute;\n z-index: 4;\n display: flex;\n flex-direction: column;\n border: 1px solid rgba(160, 160, 160, 0.3);\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n border-top: none;\n cursor: pointer;\n width: ${({ $width }) => $width}px;\n max-height: 300px;\n overflow-y: ${({ $height }) => ($height <= 300 ? 'hidden' : 'auto')};\n box-shadow: 0 0 0 1px\n rgba(${({ theme }: StyledMotionSearchBoxBodyProps) => theme['009-rgb']}, 0.08) inset;\n`;\n\nexport const StyledSearchBoxIcon = styled.div`\n cursor: pointer;\n padding: 0 10px;\n`;\n\nexport const StyledSearchBoxLeftWrapper = styled.div`\n display: flex;\n align-items: center;\n gap: 8px;\n`;\n\nexport const StyledSearchBoxHintText = styled.div`\n text-align: center;\n opacity: 0.8;\n padding: 6px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGhC,MAAMG,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGE,yBAAM,CAACC,GAAG,EAAE;AAOpC,MAAMC,yBAAyB,GAAAH,OAAA,CAAAG,yBAAA,GAAG,IAAAF,yBAAM,EAACG,aAAM,CAACF,GAAG,CAAiC;AAC3F,kBAAkB,CAAC;EAAEG;AAAsC,CAAC,KAAKA,KAAK,CAAC,KAAK,CAAC;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,CAAC;EAAEC;AAAO,CAAC,KAAKA,MAAM;AACnC;AACA,kBAAkB,CAAC;EAAEC;AAAQ,CAAC,KAAMA,OAAO,IAAI,GAAG,GAAG,QAAQ,GAAG,MAAO;AACvE;AACA,eAAe,CAAC;EAAEF;AAAsC,CAAC,KAAKA,KAAK,CAAC,SAAS,CAAC;AAC9E,CAAC;AAEM,MAAMG,mBAAmB,GAAAR,OAAA,CAAAQ,mBAAA,GAAGP,yBAAM,CAACC,GAAG;AAC7C;AACA;AACA,CAAC;AAEM,MAAMO,0BAA0B,GAAAT,OAAA,CAAAS,0BAAA,GAAGR,yBAAM,CAACC,GAAG;AACpD;AACA;AACA;AACA,CAAC;AAEM,MAAMQ,uBAAuB,GAAAV,OAAA,CAAAU,uBAAA,GAAGT,yBAAM,CAACC,GAAG;AACjD;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -10,7 +10,6 @@ var _uuid = require("../../../hooks/uuid");
10
10
  var _searchBox = require("../../../utils/searchBox");
11
11
  var _FilterButtons = _interopRequireDefault(require("../../filter-buttons/FilterButtons"));
12
12
  var _SearchBoxBody = require("./SearchBoxBody.styles");
13
- var _chaynsApi = require("chayns-api");
14
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
14
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
16
15
  const SearchBoxBody = /*#__PURE__*/(0, _react.forwardRef)(({
@@ -25,9 +24,6 @@ const SearchBoxBody = /*#__PURE__*/(0, _react.forwardRef)(({
25
24
  const [hasScrolled, setHasScrolled] = (0, _react.useState)(false);
26
25
  const [currentGroupName, setCurrentGroupName] = (0, _react.useState)('');
27
26
  const headRef = (0, _react.useRef)(null);
28
- const {
29
- browser
30
- } = (0, _chaynsApi.useDevice)();
31
27
  const headSize = (0, _element.useElementSize)(headRef);
32
28
  const uuid = (0, _uuid.useUuid)();
33
29
  const headHeight = (0, _react.useMemo)(() => headSize !== null && headSize !== void 0 && headSize.height ? headSize.height + 15 : 0, [headSize === null || headSize === void 0 ? void 0 : headSize.height]);
@@ -70,10 +66,10 @@ const SearchBoxBody = /*#__PURE__*/(0, _react.forwardRef)(({
70
66
  $headHeight: headHeight,
71
67
  key: "content",
72
68
  id: `searchBoxContent__${uuid}`,
73
- $browser: browser === null || browser === void 0 ? void 0 : browser.name,
69
+ className: "chayns-scrollbar",
74
70
  tabIndex: 0,
75
71
  onScroll: handleScroll
76
- }, children)), [browser, children, currentGroupName, filterButtons, handleScroll, hasScrolled, headHeight, height, onGroupSelect, ref, selectedGroups, shouldHideFilterButtons, shouldShow, uuid]);
72
+ }, children)), [children, currentGroupName, filterButtons, handleScroll, hasScrolled, headHeight, height, onGroupSelect, ref, selectedGroups, shouldHideFilterButtons, shouldShow, uuid]);
77
73
  });
78
74
  SearchBoxBody.displayName = 'SearchBoxBody';
79
75
  var _default = exports.default = SearchBoxBody;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBoxBody.js","names":["_react","_interopRequireWildcard","require","_element","_uuid","_searchBox","_FilterButtons","_interopRequireDefault","_SearchBoxBody","_chaynsApi","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SearchBoxBody","forwardRef","filterButtons","selectedGroups","height","children","shouldShow","onGroupSelect","shouldHideFilterButtons","ref","hasScrolled","setHasScrolled","useState","currentGroupName","setCurrentGroupName","headRef","useRef","browser","useDevice","headSize","useElementSize","uuid","useUuid","headHeight","useMemo","useEffect","element","document","getElementById","length","getCurrentGroupName","handlePreventDefault","event","preventDefault","stopPropagation","handleScroll","useCallback","scrollTop","target","createElement","StyledSearchBoxBody","onClick","inert","undefined","StyledSearchBoxBodyHead","$hasScrolled","$hasGroupName","items","size","onSelect","selectedItemIds","StyledSearchBoxBodyHeadGroupName","replace","StyledSearchBoxBodyContent","$height","$headHeight","key","id","$browser","name","tabIndex","onScroll","displayName","_default","exports"],"sources":["../../../../../src/components/search-box/search-box-body/SearchBoxBody.tsx"],"sourcesContent":["import React, {\n forwardRef,\n MouseEvent,\n UIEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport { useElementSize } from '../../../hooks/element';\nimport { useUuid } from '../../../hooks/uuid';\nimport type { IFilterButtonItem } from '../../../types/filterButtons';\nimport { getCurrentGroupName } from '../../../utils/searchBox';\nimport FilterButtons from '../../filter-buttons/FilterButtons';\nimport {\n StyledSearchBoxBody,\n StyledSearchBoxBodyContent,\n StyledSearchBoxBodyHead,\n StyledSearchBoxBodyHeadGroupName,\n} from './SearchBoxBody.styles';\nimport { useDevice } from 'chayns-api';\nimport { BrowserName } from '../../../types/chayns';\n\nexport type SearchBoxBodyProps = {\n children: ReactNode;\n filterButtons?: IFilterButtonItem[];\n selectedGroups?: string[];\n height: number;\n onGroupSelect?: (keys: string[]) => void;\n shouldHideFilterButtons?: boolean;\n shouldShow: boolean;\n};\n\nconst SearchBoxBody = forwardRef<HTMLDivElement, SearchBoxBodyProps>(\n (\n {\n filterButtons,\n selectedGroups,\n height,\n children,\n shouldShow,\n onGroupSelect,\n shouldHideFilterButtons,\n },\n ref,\n ) => {\n const [hasScrolled, setHasScrolled] = useState(false);\n const [currentGroupName, setCurrentGroupName] = useState('');\n\n const headRef = useRef<HTMLDivElement>(null);\n\n const { browser } = useDevice();\n\n const headSize = useElementSize(headRef);\n\n const uuid = useUuid();\n\n const headHeight = useMemo(\n () => (headSize?.height ? headSize.height + 15 : 0),\n [headSize?.height],\n );\n\n useEffect(() => {\n const element = document.getElementById(`searchBoxContent__${uuid}`);\n\n if (\n element &&\n ((selectedGroups?.length === 1 && selectedGroups[0] === 'all') ||\n selectedGroups?.length !== 1)\n ) {\n setCurrentGroupName(getCurrentGroupName(element));\n } else {\n setCurrentGroupName('');\n }\n }, [uuid, children, selectedGroups]);\n\n const handlePreventDefault = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n const handleScroll = useCallback(\n (event: UIEvent) => {\n const { scrollTop } = event.target as HTMLDivElement;\n\n setHasScrolled(scrollTop > 1);\n\n if (\n (selectedGroups?.length === 1 && selectedGroups[0] === 'all') ||\n selectedGroups?.length !== 1\n ) {\n setCurrentGroupName(getCurrentGroupName(event.target as HTMLDivElement));\n }\n },\n [selectedGroups],\n );\n\n return useMemo(\n () => (\n <StyledSearchBoxBody\n onClick={handlePreventDefault}\n ref={ref}\n inert={!shouldShow ? 'true' : undefined}\n >\n {filterButtons && filterButtons?.length > 1 && (\n <StyledSearchBoxBodyHead\n ref={headRef}\n $hasScrolled={hasScrolled}\n $hasGroupName={!!currentGroupName}\n >\n {!shouldHideFilterButtons && (\n <FilterButtons\n items={filterButtons}\n size={0}\n onSelect={onGroupSelect}\n selectedItemIds={selectedGroups}\n />\n )}\n <StyledSearchBoxBodyHeadGroupName>\n {currentGroupName.replace('_', '')}\n </StyledSearchBoxBodyHeadGroupName>\n </StyledSearchBoxBodyHead>\n )}\n <StyledSearchBoxBodyContent\n $height={height}\n $headHeight={headHeight}\n key=\"content\"\n id={`searchBoxContent__${uuid}`}\n $browser={(browser as { name: BrowserName })?.name}\n tabIndex={0}\n onScroll={handleScroll}\n >\n {children}\n </StyledSearchBoxBodyContent>\n </StyledSearchBoxBody>\n ),\n [\n browser,\n children,\n currentGroupName,\n filterButtons,\n handleScroll,\n hasScrolled,\n headHeight,\n height,\n onGroupSelect,\n ref,\n selectedGroups,\n shouldHideFilterButtons,\n shouldShow,\n uuid,\n ],\n );\n },\n);\n\nSearchBoxBody.displayName = 'SearchBoxBody';\n\nexport default SearchBoxBody;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OA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EjC,CAACL,uBAAuB,iBACrBrC,MAAA,CAAAY,OAAA,CAAAwD,aAAA,CAAC9D,cAAA,CAAAM,OAAa;IACVgE,KAAK,EAAE7C,aAAc;IACrB8C,IAAI,EAAE,CAAE;IACRC,QAAQ,EAAE1C,aAAc;IACxB2C,eAAe,EAAE/C;EAAe,CACnC,CACJ,eACDhC,MAAA,CAAAY,OAAA,CAAAwD,aAAA,CAAC5D,cAAA,CAAAwE,gCAAgC,QAC5BtC,gBAAgB,CAACuC,OAAO,CAAC,GAAG,EAAE,EAAE,CACH,CACb,CAC5B,eACDjF,MAAA,CAAAY,OAAA,CAAAwD,aAAA,CAAC5D,cAAA,CAAA0E,0BAA0B;IACvBC,OAAO,EAAElD,MAAO;IAChBmD,WAAW,EAAEhC,UAAW;IACxBiC,GAAG,EAAC,SAAS;IACbC,EAAE,EAAE,qBAAqBpC,IAAI,EAAG;IAChCqC,QAAQ,EAAGzC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAA4B0C,IAAK;IACnDC,QAAQ,EAAE,CAAE;IACZC,QAAQ,EAAE1B;EAAa,GAEtB9B,QACuB,CACX,CACxB,EACD,CACIY,OAAO,EACPZ,QAAQ,EACRQ,gBAAgB,EAChBX,aAAa,EACbiC,YAAY,EACZzB,WAAW,EACXa,UAAU,EACVnB,MAAM,EACNG,aAAa,EACbE,GAAG,EACHN,cAAc,EACdK,uBAAuB,EACvBF,UAAU,EACVe,IAAI,CAEZ,CAAC;AACL,CACJ,CAAC;AAEDrB,aAAa,CAAC8D,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjF,OAAA,GAE7BiB,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"SearchBoxBody.js","names":["_react","_interopRequireWildcard","require","_element","_uuid","_searchBox","_FilterButtons","_interopRequireDefault","_SearchBoxBody","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SearchBoxBody","forwardRef","filterButtons","selectedGroups","height","children","shouldShow","onGroupSelect","shouldHideFilterButtons","ref","hasScrolled","setHasScrolled","useState","currentGroupName","setCurrentGroupName","headRef","useRef","headSize","useElementSize","uuid","useUuid","headHeight","useMemo","useEffect","element","document","getElementById","length","getCurrentGroupName","handlePreventDefault","event","preventDefault","stopPropagation","handleScroll","useCallback","scrollTop","target","createElement","StyledSearchBoxBody","onClick","inert","undefined","StyledSearchBoxBodyHead","$hasScrolled","$hasGroupName","items","size","onSelect","selectedItemIds","StyledSearchBoxBodyHeadGroupName","replace","StyledSearchBoxBodyContent","$height","$headHeight","key","id","className","tabIndex","onScroll","displayName","_default","exports"],"sources":["../../../../../src/components/search-box/search-box-body/SearchBoxBody.tsx"],"sourcesContent":["import React, {\n forwardRef,\n MouseEvent,\n UIEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport { useElementSize } from '../../../hooks/element';\nimport { useUuid } from '../../../hooks/uuid';\nimport type { IFilterButtonItem } from '../../../types/filterButtons';\nimport { getCurrentGroupName } from '../../../utils/searchBox';\nimport FilterButtons from '../../filter-buttons/FilterButtons';\nimport {\n StyledSearchBoxBody,\n StyledSearchBoxBodyContent,\n StyledSearchBoxBodyHead,\n StyledSearchBoxBodyHeadGroupName,\n} from './SearchBoxBody.styles';\n\nexport type SearchBoxBodyProps = {\n children: ReactNode;\n filterButtons?: IFilterButtonItem[];\n selectedGroups?: string[];\n height: number;\n onGroupSelect?: (keys: string[]) => void;\n shouldHideFilterButtons?: boolean;\n shouldShow: boolean;\n};\n\nconst SearchBoxBody = forwardRef<HTMLDivElement, SearchBoxBodyProps>(\n (\n {\n filterButtons,\n selectedGroups,\n height,\n children,\n shouldShow,\n onGroupSelect,\n shouldHideFilterButtons,\n },\n ref,\n ) => {\n const [hasScrolled, setHasScrolled] = useState(false);\n const [currentGroupName, setCurrentGroupName] = useState('');\n\n const headRef = useRef<HTMLDivElement>(null);\n\n const headSize = useElementSize(headRef);\n\n const uuid = useUuid();\n\n const headHeight = useMemo(\n () => (headSize?.height ? headSize.height + 15 : 0),\n [headSize?.height],\n );\n\n useEffect(() => {\n const element = document.getElementById(`searchBoxContent__${uuid}`);\n\n if (\n element &&\n ((selectedGroups?.length === 1 && selectedGroups[0] === 'all') ||\n selectedGroups?.length !== 1)\n ) {\n setCurrentGroupName(getCurrentGroupName(element));\n } else {\n setCurrentGroupName('');\n }\n }, [uuid, children, selectedGroups]);\n\n const handlePreventDefault = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n const handleScroll = useCallback(\n (event: UIEvent) => {\n const { scrollTop } = event.target as HTMLDivElement;\n\n setHasScrolled(scrollTop > 1);\n\n if (\n (selectedGroups?.length === 1 && selectedGroups[0] === 'all') ||\n selectedGroups?.length !== 1\n ) {\n setCurrentGroupName(getCurrentGroupName(event.target as HTMLDivElement));\n }\n },\n [selectedGroups],\n );\n\n return useMemo(\n () => (\n <StyledSearchBoxBody\n onClick={handlePreventDefault}\n ref={ref}\n inert={!shouldShow ? 'true' : undefined}\n >\n {filterButtons && filterButtons?.length > 1 && (\n <StyledSearchBoxBodyHead\n ref={headRef}\n $hasScrolled={hasScrolled}\n $hasGroupName={!!currentGroupName}\n >\n {!shouldHideFilterButtons && (\n <FilterButtons\n items={filterButtons}\n size={0}\n onSelect={onGroupSelect}\n selectedItemIds={selectedGroups}\n />\n )}\n <StyledSearchBoxBodyHeadGroupName>\n {currentGroupName.replace('_', '')}\n </StyledSearchBoxBodyHeadGroupName>\n </StyledSearchBoxBodyHead>\n )}\n <StyledSearchBoxBodyContent\n $height={height}\n $headHeight={headHeight}\n key=\"content\"\n id={`searchBoxContent__${uuid}`}\n className=\"chayns-scrollbar\"\n tabIndex={0}\n onScroll={handleScroll}\n >\n {children}\n </StyledSearchBoxBodyContent>\n </StyledSearchBoxBody>\n ),\n [\n children,\n currentGroupName,\n filterButtons,\n handleScroll,\n hasScrolled,\n headHeight,\n height,\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,EAAEM,OAAQ;IACb4B,YAAY,EAAEjC,WAAY;IAC1BkC,aAAa,EAAE,CAAC,CAAC/B;EAAiB,GAEjC,CAACL,uBAAuB,iBACrBpC,MAAA,CAAAW,OAAA,CAAAsD,aAAA,CAAC3D,cAAA,CAAAK,OAAa;IACV8D,KAAK,EAAE3C,aAAc;IACrB4C,IAAI,EAAE,CAAE;IACRC,QAAQ,EAAExC,aAAc;IACxByC,eAAe,EAAE7C;EAAe,CACnC,CACJ,eACD/B,MAAA,CAAAW,OAAA,CAAAsD,aAAA,CAACzD,cAAA,CAAAqE,gCAAgC,QAC5BpC,gBAAgB,CAACqC,OAAO,CAAC,GAAG,EAAE,EAAE,CACH,CACb,CAC5B,eACD9E,MAAA,CAAAW,OAAA,CAAAsD,aAAA,CAACzD,cAAA,CAAAuE,0BAA0B;IACvBC,OAAO,EAAEhD,MAAO;IAChBiD,WAAW,EAAEhC,UAAW;IACxBiC,GAAG,EAAC,SAAS;IACbC,EAAE,EAAE,qBAAqBpC,IAAI,EAAG;IAChCqC,SAAS,EAAC,kBAAkB;IAC5BC,QAAQ,EAAE,CAAE;IACZC,QAAQ,EAAEzB;EAAa,GAEtB5B,QACuB,CACX,CACxB,EACD,CACIA,QAAQ,EACRQ,gBAAgB,EAChBX,aAAa,EACb+B,YAAY,EACZvB,WAAW,EACXW,UAAU,EACVjB,MAAM,EACNG,aAAa,EACbE,GAAG,EACHN,cAAc,EACdK,uBAAuB,EACvBF,UAAU,EACVa,IAAI,CAEZ,CAAC;AACL,CACJ,CAAC;AAEDnB,aAAa,CAAC2D,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA9E,OAAA,GAE7BiB,aAAa","ignoreList":[]}
@@ -45,32 +45,5 @@ const StyledSearchBoxBodyContent = exports.StyledSearchBoxBodyContent = _styledC
45
45
  $height,
46
46
  $headHeight
47
47
  }) => $height + $headHeight <= 300 ? 'hidden' : 'auto'};
48
-
49
- // Styles for custom scrollbar
50
- ${({
51
- $browser,
52
- theme
53
- }) => $browser === 'firefox' ? (0, _styledComponents.css)`
54
- scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
55
- scrollbar-width: thin;
56
- ` : (0, _styledComponents.css)`
57
- &::-webkit-scrollbar {
58
- width: 5px;
59
- }
60
-
61
- &::-webkit-scrollbar-track {
62
- background-color: transparent;
63
- }
64
-
65
- &::-webkit-scrollbar-button {
66
- background-color: transparent;
67
- height: 5px;
68
- }
69
-
70
- &::-webkit-scrollbar-thumb {
71
- background-color: rgba(${theme['text-rgb']}, 0.15);
72
- border-radius: 20px;
73
- }
74
- `}
75
48
  `;
76
49
  //# sourceMappingURL=SearchBoxBody.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBoxBody.styles.js","names":["_styledComponents","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledSearchBoxBody","exports","styled","div","StyledSearchBoxBodyHead","$hasGroupName","css","$hasScrolled","StyledSearchBoxBodyHeadGroupName","theme","text","StyledSearchBoxBodyContent","$headHeight","$height","$browser"],"sources":["../../../../../src/components/search-box/search-box-body/SearchBoxBody.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { BrowserName } from '../../../types/chayns';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledSearchBoxBody = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nexport const StyledSearchBoxBodyHead = styled.div<StyledSearchBoxHeadProps>`\n padding: 10px 10px 5px;\n display: flex;\n flex-direction: column;\n\n ${({ $hasGroupName }) =>\n $hasGroupName &&\n css`\n gap: 15px;\n `}\n\n ${({ $hasScrolled }) =>\n $hasScrolled &&\n css`\n box-shadow: 0 1px 4px #0000001a;\n `}\n`;\n\ntype StyledSearchBoxHeadProps = WithTheme<{ $hasScrolled: boolean; $hasGroupName: boolean }>;\n\ntype StyledSearchBoxBodyHeadGroupNameNameProps = WithTheme<unknown>;\n\nexport const StyledSearchBoxBodyHeadGroupName = styled.div<StyledSearchBoxBodyHeadGroupNameNameProps>`\n color: ${({ theme }: StyledSearchBoxBodyHeadGroupNameNameProps) => theme.text};\n font-weight: bold;\n`;\n\ntype StyledSearchBoxBodyContentProps = WithTheme<{\n $height: number;\n $headHeight: number;\n $browser: BrowserName;\n}>;\n\nexport const StyledSearchBoxBodyContent = styled.div<StyledSearchBoxBodyContentProps>`\n display: flex;\n flex-direction: column;\n cursor: pointer;\n width: 100%;\n max-height: ${({ $headHeight }) => 300 - $headHeight}px;\n overflow-y: ${({ $height, $headHeight }) => ($height + $headHeight <= 300 ? 'hidden' : 'auto')};\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledSearchBoxBodyContentProps) =>\n $browser === 'firefox'\n ? css`\n scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;\n scrollbar-width: thin;\n `\n : css`\n &::-webkit-scrollbar {\n width: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-button {\n background-color: transparent;\n height: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(${theme['text-rgb']}, 0.15);\n border-radius: 20px;\n }\n `}\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CA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AAC;EAAES;AAAY,CAAC,KAAK,GAAG,GAAGA,WAAW;AACxD,kBAAkB,CAAC;EAAEC,OAAO;EAAED;AAAY,CAAC,KAAMC,OAAO,GAAGD,WAAW,IAAI,GAAG,GAAG,QAAQ,GAAG,MAAO;AAClG;AACA;AACA,MAAM,CAAC;EAAEE,QAAQ;EAAEL;AAAuC,CAAC,KACnDK,QAAQ,KAAK,SAAS,GAChB,IAAAR,qBAAG;AACjB,0CAA0CG,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACD,IAAAH,qBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CG,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AACf,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"SearchBoxBody.styles.js","names":["_styledComponents","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledSearchBoxBody","exports","styled","div","StyledSearchBoxBodyHead","$hasGroupName","css","$hasScrolled","StyledSearchBoxBodyHeadGroupName","theme","text","StyledSearchBoxBodyContent","$headHeight","$height"],"sources":["../../../../../src/components/search-box/search-box-body/SearchBoxBody.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledSearchBoxBody = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nexport const StyledSearchBoxBodyHead = styled.div<StyledSearchBoxHeadProps>`\n padding: 10px 10px 5px;\n display: flex;\n flex-direction: column;\n\n ${({ $hasGroupName }) =>\n $hasGroupName &&\n css`\n gap: 15px;\n `}\n\n ${({ $hasScrolled }) =>\n $hasScrolled &&\n css`\n box-shadow: 0 1px 4px #0000001a;\n `}\n`;\n\ntype StyledSearchBoxHeadProps = WithTheme<{ $hasScrolled: boolean; $hasGroupName: boolean }>;\n\ntype StyledSearchBoxBodyHeadGroupNameNameProps = WithTheme<unknown>;\n\nexport const StyledSearchBoxBodyHeadGroupName = styled.div<StyledSearchBoxBodyHeadGroupNameNameProps>`\n color: ${({ theme }: StyledSearchBoxBodyHeadGroupNameNameProps) => theme.text};\n font-weight: bold;\n`;\n\ntype StyledSearchBoxBodyContentProps = WithTheme<{\n $height: number;\n $headHeight: number;\n}>;\n\nexport const StyledSearchBoxBodyContent = styled.div<StyledSearchBoxBodyContentProps>`\n display: flex;\n flex-direction: column;\n cursor: pointer;\n width: 100%;\n max-height: ${({ $headHeight }) => 300 - $headHeight}px;\n overflow-y: ${({ $height, $headHeight }) => ($height + $headHeight <= 300 ? 'hidden' : 'auto')};\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAGzC,MAAMkB,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,yBAAM,CAACC,GAAG;AAC7C;AACA;AACA,CAAC;AAEM,MAAMC,uBAAuB,GAAAH,OAAA,CAAAG,uBAAA,GAAGF,yBAAM,CAACC,GAA6B;AAC3E;AACA;AACA;AACA;AACA,MAAM,CAAC;EAAEE;AAAc,CAAC,KAChBA,aAAa,IACb,IAAAC,qBAAG;AACX;AACA,SAAS;AACT;AACA,MAAM,CAAC;EAAEC;AAAa,CAAC,KACfA,YAAY,IACZ,IAAAD,qBAAG;AACX;AACA,SAAS;AACT,CAAC;AAMM,MAAME,gCAAgC,GAAAP,OAAA,CAAAO,gCAAA,GAAGN,yBAAM,CAACC,GAA8C;AACrG,aAAa,CAAC;EAAEM;AAAiD,CAAC,KAAKA,KAAK,CAACC,IAAI;AACjF;AACA,CAAC;AAOM,MAAMC,0BAA0B,GAAAV,OAAA,CAAAU,0BAAA,GAAGT,yBAAM,CAACC,GAAoC;AACrF;AACA;AACA;AACA;AACA,kBAAkB,CAAC;EAAES;AAAY,CAAC,KAAK,GAAG,GAAGA,WAAW;AACxD,kBAAkB,CAAC;EAAEC,OAAO;EAAED;AAAY,CAAC,KAAMC,OAAO,GAAGD,WAAW,IAAI,GAAG,GAAG,QAAQ,GAAG,MAAO;AAClG,CAAC","ignoreList":[]}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _chaynsApi = require("chayns-api");
8
7
  var _react = _interopRequireWildcard(require("react"));
9
8
  var _AreaContextProvider = require("../area-provider/AreaContextProvider");
10
9
  var _Input = require("../input/Input.styles");
@@ -28,9 +27,6 @@ const TextArea = /*#__PURE__*/(0, _react.forwardRef)(({
28
27
  const [isOverflowing, setIsOverflowing] = (0, _react.useState)(false);
29
28
  const areaProvider = (0, _react.useContext)(_AreaContextProvider.AreaContext);
30
29
  const textareaRef = (0, _react.useRef)(null);
31
- const {
32
- browser
33
- } = (0, _chaynsApi.getDevice)();
34
30
  (0, _resize.useCursorRepaint)(textareaRef);
35
31
 
36
32
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
@@ -60,7 +56,7 @@ const TextArea = /*#__PURE__*/(0, _react.forwardRef)(({
60
56
  $isInvalid: isInvalid,
61
57
  $shouldChangeColor: shouldChangeColor
62
58
  }, /*#__PURE__*/_react.default.createElement(_TextArea.StyledTextAreaContent, null, /*#__PURE__*/_react.default.createElement(_TextArea.StyledTextAreaInput, {
63
- $browser: browser === null || browser === void 0 ? void 0 : browser.name,
59
+ className: "chayns-scrollbar",
64
60
  disabled: isDisabled,
65
61
  $isInvalid: isInvalid,
66
62
  ref: textareaRef,
@@ -75,7 +71,7 @@ const TextArea = /*#__PURE__*/(0, _react.forwardRef)(({
75
71
  rows: 1
76
72
  }), !value && /*#__PURE__*/_react.default.createElement(_TextArea.StyledTextAreaLabelWrapper, null, /*#__PURE__*/_react.default.createElement(_TextArea.StyledTextAreaLabel, {
77
73
  $isInvalid: isInvalid
78
- }, placeholder))), rightElement && shouldShowBorder && rightElement), rightElement && !shouldShowBorder && /*#__PURE__*/_react.default.createElement(_Input.StyledInputRightElement, null, rightElement)), [browser === null || browser === void 0 ? void 0 : browser.name, isDisabled, isInvalid, isOverflowing, maxHeight, minHeight, onBlur, onChange, onFocus, onKeyDown, placeholder, rightElement, shouldChangeColor, shouldShowBorder, value]);
74
+ }, placeholder))), rightElement && shouldShowBorder && rightElement), rightElement && !shouldShowBorder && /*#__PURE__*/_react.default.createElement(_Input.StyledInputRightElement, null, rightElement)), [isDisabled, isInvalid, isOverflowing, maxHeight, minHeight, onBlur, onChange, onFocus, onKeyDown, placeholder, rightElement, shouldChangeColor, shouldShowBorder, value]);
79
75
  });
80
76
  TextArea.displayName = 'TextArea';
81
77
  var _default = exports.default = TextArea;
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.js","names":["_chaynsApi","require","_react","_interopRequireWildcard","_AreaContextProvider","_Input","_TextArea","_resize","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TextArea","forwardRef","isDisabled","isInvalid","placeholder","value","onChange","onFocus","onKeyDown","rightElement","onBlur","maxHeight","minHeight","ref","_rightElement$props","isOverflowing","setIsOverflowing","useState","areaProvider","useContext","AreaContext","textareaRef","useRef","browser","getDevice","useCursorRepaint","shouldShowBorder","props","style","backgroundColor","undefined","shouldChangeColor","useMemo","adjustTextareaHeight","useCallback","current","height","scrollHeight","parseInt","toString","useImperativeHandle","useEffect","length","createElement","StyledTextArea","$isDisabled","StyledTextAreaContentWrapper","$isInvalid","$shouldChangeColor","StyledTextAreaContent","StyledTextAreaInput","$browser","name","disabled","$maxHeight","$minHeight","$isOverflowing","rows","StyledTextAreaLabelWrapper","StyledTextAreaLabel","StyledInputRightElement","displayName","_default","exports"],"sources":["../../../../src/components/text-area/TextArea.tsx"],"sourcesContent":["import { getDevice } from 'chayns-api';\nimport React, {\n ChangeEventHandler,\n CSSProperties,\n FocusEventHandler,\n forwardRef,\n KeyboardEventHandler,\n ReactElement,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { BrowserName } from '../../types/chayns';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport { StyledInputRightElement } from '../input/Input.styles';\nimport {\n StyledTextArea,\n StyledTextAreaContent,\n StyledTextAreaContentWrapper,\n StyledTextAreaInput,\n StyledTextAreaLabel,\n StyledTextAreaLabelWrapper,\n} from './TextArea.styles';\nimport { useCursorRepaint } from '../../hooks/resize';\n\nexport type TextAreaProps = {\n /**\n * Disables the text area so that it cannot be changed.\n */\n isDisabled?: boolean;\n /**\n * If true, the text area is marked as invalid\n */\n isInvalid?: boolean;\n /**\n * The maximum height of the text area.\n */\n maxHeight?: CSSProperties['maxHeight'];\n /**\n * The minimum height of the text area.\n */\n minHeight?: CSSProperties['minHeight'];\n /**\n * Function that is executed when the text area loses focus.\n */\n onBlur?: FocusEventHandler<HTMLTextAreaElement>;\n /**\n * Function that is executed when the text of the text area changes.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement>;\n /**\n * Function that is executed when the input field is focused\n */\n onFocus?: FocusEventHandler<HTMLTextAreaElement>;\n /**\n * Function that is executed when a letter is pressed\n */\n onKeyDown?: KeyboardEventHandler<HTMLTextAreaElement>;\n /**\n * Placeholder for the text area field.\n */\n placeholder?: string | ReactElement;\n /**\n * An element that should be displayed on the right side of the Input.\n */\n rightElement?: ReactElement;\n /**\n * Value if the text area should be controlled.\n */\n value?: string;\n};\n\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n isDisabled,\n isInvalid,\n placeholder,\n value,\n onChange,\n onFocus,\n onKeyDown,\n rightElement,\n onBlur,\n maxHeight = '120px',\n minHeight = '41px',\n },\n ref,\n ) => {\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n const areaProvider = useContext(AreaContext);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const { browser } = getDevice();\n\n useCursorRepaint(textareaRef);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const shouldShowBorder = rightElement?.props?.style?.backgroundColor === undefined;\n\n const shouldChangeColor = useMemo(\n () => areaProvider.shouldChangeColor ?? false,\n [areaProvider.shouldChangeColor],\n );\n\n const adjustTextareaHeight = useCallback(() => {\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;\n\n setIsOverflowing(\n textareaRef.current.scrollHeight > parseInt(maxHeight.toString(), 10),\n );\n }\n }, [maxHeight]);\n\n useImperativeHandle(ref, () => textareaRef.current as HTMLTextAreaElement);\n\n /**\n * This hook calculates the height of the TextArea after the displayValue is changed and the content is inside the \"textareaRef\".\n * To maintain the functionality while clearing the input, the length need to be greater than -1.\n */\n useEffect(() => {\n if (typeof value === 'string' && value.length > -1) {\n adjustTextareaHeight();\n }\n }, [adjustTextareaHeight, value]);\n\n return useMemo(\n () => (\n <StyledTextArea $isDisabled={isDisabled}>\n <StyledTextAreaContentWrapper\n $isInvalid={isInvalid}\n $shouldChangeColor={shouldChangeColor}\n >\n <StyledTextAreaContent>\n <StyledTextAreaInput\n $browser={browser?.name as BrowserName}\n disabled={isDisabled}\n $isInvalid={isInvalid}\n ref={textareaRef}\n value={value}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n $maxHeight={maxHeight}\n $minHeight={minHeight}\n $isOverflowing={isOverflowing}\n rows={1}\n />\n {!value && (\n <StyledTextAreaLabelWrapper>\n <StyledTextAreaLabel $isInvalid={isInvalid}>\n {placeholder}\n </StyledTextAreaLabel>\n </StyledTextAreaLabelWrapper>\n )}\n </StyledTextAreaContent>\n {rightElement && shouldShowBorder && rightElement}\n </StyledTextAreaContentWrapper>\n {rightElement && !shouldShowBorder && (\n <StyledInputRightElement>{rightElement}</StyledInputRightElement>\n )}\n </StyledTextArea>\n ),\n [\n browser?.name,\n isDisabled,\n isInvalid,\n isOverflowing,\n maxHeight,\n minHeight,\n onBlur,\n onChange,\n onFocus,\n onKeyDown,\n placeholder,\n rightElement,\n shouldChangeColor,\n shouldShowBorder,\n value,\n ],\n );\n },\n);\n\nTextArea.displayName = 'TextArea';\n\nexport default TextArea;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAgBA,IAAAG,oBAAA,GAAAH,OAAA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CAAChE,SAAA,CAAAgF,mBAAmB;IAACZ,UAAU,EAAE5C;EAAU,GACtCC,WACgB,CACG,CAEb,CAAC,EACvBK,YAAY,IAAIiB,gBAAgB,IAAIjB,YACX,CAAC,EAC9BA,YAAY,IAAI,CAACiB,gBAAgB,iBAC9BnD,MAAA,CAAAgB,OAAA,CAAAoD,aAAA,CAACjE,MAAA,CAAAkF,uBAAuB,QAAEnD,YAAsC,CAExD,CACnB,EACD,CACIc,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAE6B,IAAI,EACblD,UAAU,EACVC,SAAS,EACTY,aAAa,EACbJ,SAAS,EACTC,SAAS,EACTF,MAAM,EACNJ,QAAQ,EACRC,OAAO,EACPC,SAAS,EACTJ,WAAW,EACXK,YAAY,EACZsB,iBAAiB,EACjBL,gBAAgB,EAChBrB,KAAK,CAEb,CAAC;AACL,CACJ,CAAC;AAEDL,QAAQ,CAAC6D,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxE,OAAA,GAEnBS,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"TextArea.js","names":["_react","_interopRequireWildcard","require","_AreaContextProvider","_Input","_TextArea","_resize","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TextArea","forwardRef","isDisabled","isInvalid","placeholder","value","onChange","onFocus","onKeyDown","rightElement","onBlur","maxHeight","minHeight","ref","_rightElement$props","isOverflowing","setIsOverflowing","useState","areaProvider","useContext","AreaContext","textareaRef","useRef","useCursorRepaint","shouldShowBorder","props","style","backgroundColor","undefined","shouldChangeColor","useMemo","adjustTextareaHeight","useCallback","current","height","scrollHeight","parseInt","toString","useImperativeHandle","useEffect","length","createElement","StyledTextArea","$isDisabled","StyledTextAreaContentWrapper","$isInvalid","$shouldChangeColor","StyledTextAreaContent","StyledTextAreaInput","className","disabled","$maxHeight","$minHeight","$isOverflowing","rows","StyledTextAreaLabelWrapper","StyledTextAreaLabel","StyledInputRightElement","displayName","_default","exports"],"sources":["../../../../src/components/text-area/TextArea.tsx"],"sourcesContent":["import React, {\n ChangeEventHandler,\n CSSProperties,\n FocusEventHandler,\n forwardRef,\n KeyboardEventHandler,\n ReactElement,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport { StyledInputRightElement } from '../input/Input.styles';\nimport {\n StyledTextArea,\n StyledTextAreaContent,\n StyledTextAreaContentWrapper,\n StyledTextAreaInput,\n StyledTextAreaLabel,\n StyledTextAreaLabelWrapper,\n} from './TextArea.styles';\nimport { useCursorRepaint } from '../../hooks/resize';\n\nexport type TextAreaProps = {\n /**\n * Disables the text area so that it cannot be changed.\n */\n isDisabled?: boolean;\n /**\n * If true, the text area is marked as invalid\n */\n isInvalid?: boolean;\n /**\n * The maximum height of the text area.\n */\n maxHeight?: CSSProperties['maxHeight'];\n /**\n * The minimum height of the text area.\n */\n minHeight?: CSSProperties['minHeight'];\n /**\n * Function that is executed when the text area loses focus.\n */\n onBlur?: FocusEventHandler<HTMLTextAreaElement>;\n /**\n * Function that is executed when the text of the text area changes.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement>;\n /**\n * Function that is executed when the input field is focused\n */\n onFocus?: FocusEventHandler<HTMLTextAreaElement>;\n /**\n * Function that is executed when a letter is pressed\n */\n onKeyDown?: KeyboardEventHandler<HTMLTextAreaElement>;\n /**\n * Placeholder for the text area field.\n */\n placeholder?: string | ReactElement;\n /**\n * An element that should be displayed on the right side of the Input.\n */\n rightElement?: ReactElement;\n /**\n * Value if the text area should be controlled.\n */\n value?: string;\n};\n\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n isDisabled,\n isInvalid,\n placeholder,\n value,\n onChange,\n onFocus,\n onKeyDown,\n rightElement,\n onBlur,\n maxHeight = '120px',\n minHeight = '41px',\n },\n ref,\n ) => {\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n const areaProvider = useContext(AreaContext);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n useCursorRepaint(textareaRef);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const shouldShowBorder = rightElement?.props?.style?.backgroundColor === undefined;\n\n const shouldChangeColor = useMemo(\n () => areaProvider.shouldChangeColor ?? false,\n [areaProvider.shouldChangeColor],\n );\n\n const adjustTextareaHeight = useCallback(() => {\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;\n\n setIsOverflowing(\n textareaRef.current.scrollHeight > parseInt(maxHeight.toString(), 10),\n );\n }\n }, [maxHeight]);\n\n useImperativeHandle(ref, () => textareaRef.current as HTMLTextAreaElement);\n\n /**\n * This hook calculates the height of the TextArea after the displayValue is changed and the content is inside the \"textareaRef\".\n * To maintain the functionality while clearing the input, the length need to be greater than -1.\n */\n useEffect(() => {\n if (typeof value === 'string' && value.length > -1) {\n adjustTextareaHeight();\n }\n }, [adjustTextareaHeight, value]);\n\n return useMemo(\n () => (\n <StyledTextArea $isDisabled={isDisabled}>\n <StyledTextAreaContentWrapper\n $isInvalid={isInvalid}\n $shouldChangeColor={shouldChangeColor}\n >\n <StyledTextAreaContent>\n <StyledTextAreaInput\n className=\"chayns-scrollbar\"\n disabled={isDisabled}\n $isInvalid={isInvalid}\n ref={textareaRef}\n value={value}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n $maxHeight={maxHeight}\n $minHeight={minHeight}\n $isOverflowing={isOverflowing}\n rows={1}\n />\n {!value && (\n <StyledTextAreaLabelWrapper>\n <StyledTextAreaLabel $isInvalid={isInvalid}>\n {placeholder}\n </StyledTextAreaLabel>\n </StyledTextAreaLabelWrapper>\n )}\n </StyledTextAreaContent>\n {rightElement && shouldShowBorder && rightElement}\n </StyledTextAreaContentWrapper>\n {rightElement && !shouldShowBorder && (\n <StyledInputRightElement>{rightElement}</StyledInputRightElement>\n )}\n </StyledTextArea>\n ),\n [\n isDisabled,\n isInvalid,\n isOverflowing,\n maxHeight,\n minHeight,\n onBlur,\n onChange,\n onFocus,\n onKeyDown,\n placeholder,\n rightElement,\n shouldChangeColor,\n shouldShowBorder,\n value,\n ],\n );\n },\n);\n\nTextArea.displayName = 'TextArea';\n\nexport default TextArea;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAeA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAQA,IAAAI,OAAA,GAAAJ,OAAA;AAAsD,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,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AAU,EAAExC,SAAU;IACtByC,UAAU,EAAExC,SAAU;IACtByC,cAAc,EAAEtC,aAAc;IAC9BuC,IAAI,EAAE;EAAE,CACX,CAAC,EACD,CAACjD,KAAK,iBACH/B,MAAA,CAAAiB,OAAA,CAAAkD,aAAA,CAAC9D,SAAA,CAAA4E,0BAA0B,qBACvBjF,MAAA,CAAAiB,OAAA,CAAAkD,aAAA,CAAC9D,SAAA,CAAA6E,mBAAmB;IAACX,UAAU,EAAE1C;EAAU,GACtCC,WACgB,CACG,CAEb,CAAC,EACvBK,YAAY,IAAIe,gBAAgB,IAAIf,YACX,CAAC,EAC9BA,YAAY,IAAI,CAACe,gBAAgB,iBAC9BlD,MAAA,CAAAiB,OAAA,CAAAkD,aAAA,CAAC/D,MAAA,CAAA+E,uBAAuB,QAAEhD,YAAsC,CAExD,CACnB,EACD,CACIP,UAAU,EACVC,SAAS,EACTY,aAAa,EACbJ,SAAS,EACTC,SAAS,EACTF,MAAM,EACNJ,QAAQ,EACRC,OAAO,EACPC,SAAS,EACTJ,WAAW,EACXK,YAAY,EACZoB,iBAAiB,EACjBL,gBAAgB,EAChBnB,KAAK,CAEb,CAAC;AACL,CACJ,CAAC;AAEDL,QAAQ,CAAC0D,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArE,OAAA,GAEnBS,QAAQ","ignoreList":[]}
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.StyledTextAreaLabelWrapper = exports.StyledTextAreaLabel = exports.StyledTextAreaInput = exports.StyledTextAreaContentWrapper = exports.StyledTextAreaContent = exports.StyledTextArea = void 0;
7
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
9
  const StyledTextArea = exports.StyledTextArea = _styledComponents.default.div`
10
10
  display: flex;
11
11
  flex: 1 1 auto;
@@ -54,35 +54,6 @@ const StyledTextAreaInput = exports.StyledTextAreaInput = _styledComponents.defa
54
54
  width: 100%;
55
55
  padding: 8px 10px;
56
56
  cursor: text;
57
-
58
- // Styles for custom scrollbar
59
- ${({
60
- $browser,
61
- theme
62
- }) => $browser === 'firefox' ? (0, _styledComponents.css)`
63
- scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
64
- scrollbar-width: thin;
65
- ` : (0, _styledComponents.css)`
66
- &::-webkit-scrollbar {
67
- width: 10px;
68
- }
69
-
70
- &::-webkit-scrollbar-track {
71
- background-color: transparent;
72
- }
73
-
74
- &::-webkit-scrollbar-button {
75
- background-color: transparent;
76
- height: 5px;
77
- }
78
-
79
- &::-webkit-scrollbar-thumb {
80
- background-color: rgba(${theme['text-rgb']}, 0.15);
81
- border-radius: 20px;
82
- background-clip: padding-box;
83
- border: solid 3px transparent;
84
- }
85
- `}
86
57
  `;
87
58
  const StyledTextAreaLabelWrapper = exports.StyledTextAreaLabelWrapper = _styledComponents.default.label`
88
59
  left: 10px;
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.styles.js","names":["_styledComponents","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledTextArea","exports","styled","div","$isDisabled","StyledTextAreaContentWrapper","theme","$shouldChangeColor","colorMode","$isInvalid","wrong","StyledTextAreaContent","StyledTextAreaInput","textarea","text","$isOverflowing","$maxHeight","$minHeight","$browser","css","StyledTextAreaLabelWrapper","label","StyledTextAreaLabel"],"sources":["../../../../src/components/text-area/TextArea.styles.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport styled, { css } from 'styled-components';\nimport { BrowserName } from '../../types/chayns';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { TextAreaProps } from './TextArea';\n\ntype StyledTextAreaProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledTextArea = styled.div<StyledTextAreaProps>`\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n position: relative;\n`;\n\ntype StyledTextAreaContentWrapperProps = WithTheme<{\n $isInvalid: TextAreaProps['isInvalid'];\n $shouldChangeColor: boolean;\n}>;\n\nexport const StyledTextAreaContentWrapper = styled.div<StyledTextAreaContentWrapperProps>`\n background-color: ${({ theme, $shouldChangeColor }: StyledTextAreaContentWrapperProps) =>\n theme.colorMode === 'classic' || $shouldChangeColor ? theme['000'] : theme['100']};\n border-radius: 3px;\n border: 1px solid\n ${({ theme, $isInvalid }: StyledTextAreaContentWrapperProps) =>\n $isInvalid ? theme.wrong : 'rgba(160, 160, 160, 0.3)'};\n width: 100%;\n display: flex;\n`;\n\nexport const StyledTextAreaContent = styled.div`\n position: relative;\n display: flex;\n width: 100%;\n`;\n\ntype StyledTextAreaInputProps = WithTheme<{\n $browser: BrowserName;\n $isInvalid: TextAreaProps['isInvalid'];\n $isOverflowing: boolean;\n $maxHeight: CSSProperties['maxHeight'];\n $minHeight: CSSProperties['minHeight'];\n}>;\n\nexport const StyledTextAreaInput = styled.textarea<StyledTextAreaInputProps>`\n color: ${({ theme, $isInvalid }: StyledTextAreaInputProps) =>\n $isInvalid ? theme.wrong : theme.text};\n background: none;\n border: none;\n resize: none;\n overflow-y: ${({ $isOverflowing }) => ($isOverflowing ? 'scroll' : 'hidden')};\n max-height: ${({ $maxHeight }: StyledTextAreaInputProps) =>\n typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight};\n min-height: ${({ $minHeight }: StyledTextAreaInputProps) =>\n typeof $minHeight === 'number' ? `${$minHeight}px` : $minHeight};\n width: 100%;\n padding: 8px 10px;\n cursor: text;\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledTextAreaInputProps) =>\n $browser === 'firefox'\n ? css`\n scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;\n scrollbar-width: thin;\n `\n : css`\n &::-webkit-scrollbar {\n width: 10px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-button {\n background-color: transparent;\n height: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(${theme['text-rgb']}, 0.15);\n border-radius: 20px;\n background-clip: padding-box;\n border: solid 3px transparent;\n }\n `}\n`;\n\nexport const StyledTextAreaLabelWrapper = styled.label`\n left: 10px;\n top: 12px;\n align-items: baseline;\n display: flex;\n flex: 0 0 auto;\n gap: 4px;\n line-height: 1.3;\n pointer-events: none;\n position: absolute;\n user-select: none;\n width: calc(100% - 20px);\n cursor: text;\n`;\n\ntype StyledTextAreaLabelProps = WithTheme<{ $isInvalid?: TextAreaProps['isInvalid'] }>;\n\nexport const StyledTextAreaLabel = styled.label<StyledTextAreaLabelProps>`\n color: ${({ theme, $isInvalid }: StyledTextAreaLabelProps) =>\n $isInvalid ? theme.wrong : `rgba(${theme['text-rgb'] ?? ''}, 0.45)`};\n line-height: 1.3;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n cursor: text;\n text-overflow: ellipsis;\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,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tD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAIM,MAAMC,mBAAmB,GAAArB,OAAA,CAAAqB,mBAAA,GAAGpB,yBAAM,CAACmB,KAA+B;AACzE,aAAa,CAAC;EAAEf,KAAK;EAAEG;AAAqC,CAAC,KACrDA,UAAU,GAAGH,KAAK,CAACI,KAAK,GAAG,QAAQJ,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"TextArea.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledTextArea","exports","styled","div","$isDisabled","StyledTextAreaContentWrapper","theme","$shouldChangeColor","colorMode","$isInvalid","wrong","StyledTextAreaContent","StyledTextAreaInput","textarea","text","$isOverflowing","$maxHeight","$minHeight","StyledTextAreaLabelWrapper","label","StyledTextAreaLabel"],"sources":["../../../../src/components/text-area/TextArea.styles.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { TextAreaProps } from './TextArea';\n\ntype StyledTextAreaProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledTextArea = styled.div<StyledTextAreaProps>`\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n position: relative;\n`;\n\ntype StyledTextAreaContentWrapperProps = WithTheme<{\n $isInvalid: TextAreaProps['isInvalid'];\n $shouldChangeColor: boolean;\n}>;\n\nexport const StyledTextAreaContentWrapper = styled.div<StyledTextAreaContentWrapperProps>`\n background-color: ${({ theme, $shouldChangeColor }: StyledTextAreaContentWrapperProps) =>\n theme.colorMode === 'classic' || $shouldChangeColor ? theme['000'] : theme['100']};\n border-radius: 3px;\n border: 1px solid\n ${({ theme, $isInvalid }: StyledTextAreaContentWrapperProps) =>\n $isInvalid ? theme.wrong : 'rgba(160, 160, 160, 0.3)'};\n width: 100%;\n display: flex;\n`;\n\nexport const StyledTextAreaContent = styled.div`\n position: relative;\n display: flex;\n width: 100%;\n`;\n\ntype StyledTextAreaInputProps = WithTheme<{\n $isInvalid: TextAreaProps['isInvalid'];\n $isOverflowing: boolean;\n $maxHeight: CSSProperties['maxHeight'];\n $minHeight: CSSProperties['minHeight'];\n}>;\n\nexport const StyledTextAreaInput = styled.textarea<StyledTextAreaInputProps>`\n color: ${({ theme, $isInvalid }: StyledTextAreaInputProps) =>\n $isInvalid ? theme.wrong : theme.text};\n background: none;\n border: none;\n resize: none;\n overflow-y: ${({ $isOverflowing }) => ($isOverflowing ? 'scroll' : 'hidden')};\n max-height: ${({ $maxHeight }: StyledTextAreaInputProps) =>\n typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight};\n min-height: ${({ $minHeight }: StyledTextAreaInputProps) =>\n typeof $minHeight === 'number' ? `${$minHeight}px` : $minHeight};\n width: 100%;\n padding: 8px 10px;\n cursor: text;\n`;\n\nexport const StyledTextAreaLabelWrapper = styled.label`\n left: 10px;\n top: 12px;\n align-items: baseline;\n display: flex;\n flex: 0 0 auto;\n gap: 4px;\n line-height: 1.3;\n pointer-events: none;\n position: absolute;\n user-select: none;\n width: calc(100% - 20px);\n cursor: text;\n`;\n\ntype StyledTextAreaLabelProps = WithTheme<{ $isInvalid?: TextAreaProps['isInvalid'] }>;\n\nexport const StyledTextAreaLabel = styled.label<StyledTextAreaLabelProps>`\n color: ${({ theme, $isInvalid }: StyledTextAreaLabelProps) =>\n $isInvalid ? theme.wrong : `rgba(${theme['text-rgb'] ?? ''}, 0.45)`};\n line-height: 1.3;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n cursor: text;\n text-overflow: ellipsis;\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IA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GAAGA,UAAU;AACvE;AACA;AACA;AACA,CAAC;AAEM,MAAMC,0BAA0B,GAAAjB,OAAA,CAAAiB,0BAAA,GAAGhB,yBAAM,CAACiB,KAAK;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAIM,MAAMC,mBAAmB,GAAAnB,OAAA,CAAAmB,mBAAA,GAAGlB,yBAAM,CAACiB,KAA+B;AACzE,aAAa,CAAC;EAAEb,KAAK;EAAEG;AAAqC,CAAC,KACrDA,UAAU,GAAGH,KAAK,CAACI,KAAK,GAAG,QAAQJ,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
package/lib/cjs/index.js CHANGED
@@ -108,7 +108,7 @@ Object.defineProperty(exports, "ComboBox", {
108
108
  Object.defineProperty(exports, "ComboBoxSize", {
109
109
  enumerable: true,
110
110
  get: function () {
111
- return _ComboBox.ComboBoxSize;
111
+ return _ComboBox2.ComboBoxSize;
112
112
  }
113
113
  });
114
114
  Object.defineProperty(exports, "ContainerAnchor", {
@@ -571,7 +571,7 @@ var _AnimatedNumber = _interopRequireDefault(require("./components/animated-numb
571
571
  var _FileList = _interopRequireDefault(require("./components/file-list/FileList"));
572
572
  var _FileSelect = _interopRequireDefault(require("./components/file-select/FileSelect"));
573
573
  var _DropdownBodyWrapper = _interopRequireDefault(require("./components/dropdown-body-wrapper/DropdownBodyWrapper"));
574
- var _ComboBox = _interopRequireWildcard(require("./components/combobox/ComboBox"));
574
+ var _ComboBox = _interopRequireDefault(require("./components/combobox/ComboBox"));
575
575
  var _ContentCard = _interopRequireDefault(require("./components/content-card/ContentCard"));
576
576
  var _HighlightSlider = _interopRequireDefault(require("./components/highlight-slider/HighlightSlider"));
577
577
  var _ContextMenu = _interopRequireDefault(require("./components/context-menu/ContextMenu"));
@@ -625,6 +625,7 @@ var _fileDialog = require("./utils/fileDialog");
625
625
  var _isTobitEmployee = require("./utils/isTobitEmployee");
626
626
  var _pageProvider = require("./utils/pageProvider");
627
627
  var _uploadFile = require("./utils/uploadFile");
628
+ var _ComboBox2 = require("./components/combobox/ComboBox.types");
628
629
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
629
630
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
630
631
  //# sourceMappingURL=index.js.map