@chayns-components/core 5.0.25 → 5.0.27

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 (98) 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/combobox/ComboBox.js +6 -13
  10. package/lib/cjs/components/combobox/ComboBox.js.map +1 -1
  11. package/lib/cjs/components/combobox/ComboBox.styles.js +1 -36
  12. package/lib/cjs/components/combobox/ComboBox.styles.js.map +1 -1
  13. package/lib/cjs/components/combobox/ComboBox.types.js +12 -0
  14. package/lib/cjs/components/combobox/ComboBox.types.js.map +1 -0
  15. package/lib/cjs/components/combobox/combobox-item/ComboBoxItem.js.map +1 -1
  16. package/lib/cjs/components/filter/filter-content/FIlterContent.js.map +1 -1
  17. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.js +1 -4
  18. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.js.map +1 -1
  19. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js +0 -34
  20. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js.map +1 -1
  21. package/lib/cjs/components/progress-bar/ProgressBar.js +30 -27
  22. package/lib/cjs/components/progress-bar/ProgressBar.js.map +1 -1
  23. package/lib/cjs/components/progress-bar/ProgressBar.styles.js +4 -2
  24. package/lib/cjs/components/progress-bar/ProgressBar.styles.js.map +1 -1
  25. package/lib/cjs/components/scroll-view/ScrollView.js +10 -16
  26. package/lib/cjs/components/scroll-view/ScrollView.js.map +1 -1
  27. package/lib/cjs/components/scroll-view/ScrollView.styles.js +3 -38
  28. package/lib/cjs/components/scroll-view/ScrollView.styles.js.map +1 -1
  29. package/lib/cjs/components/search-box/SearchBox.styles.js +2 -29
  30. package/lib/cjs/components/search-box/SearchBox.styles.js.map +1 -1
  31. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.js +2 -6
  32. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.js.map +1 -1
  33. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.styles.js +0 -27
  34. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.styles.js.map +1 -1
  35. package/lib/cjs/components/text-area/TextArea.js +2 -6
  36. package/lib/cjs/components/text-area/TextArea.js.map +1 -1
  37. package/lib/cjs/components/text-area/TextArea.styles.js +2 -31
  38. package/lib/cjs/components/text-area/TextArea.styles.js.map +1 -1
  39. package/lib/cjs/index.js +3 -2
  40. package/lib/cjs/index.js.map +1 -1
  41. package/lib/cjs/utils/calculate.js.map +1 -1
  42. package/lib/esm/components/accordion/accordion-body/AccordionBody.js +1 -6
  43. package/lib/esm/components/accordion/accordion-body/AccordionBody.js.map +1 -1
  44. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js +0 -27
  45. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  46. package/lib/esm/components/accordion/accordion-content/AccordionContent.js +6 -13
  47. package/lib/esm/components/accordion/accordion-content/AccordionContent.js.map +1 -1
  48. package/lib/esm/components/accordion/accordion-content/AccordionContent.styles.js +0 -27
  49. package/lib/esm/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
  50. package/lib/esm/components/combobox/ComboBox.js +5 -12
  51. package/lib/esm/components/combobox/ComboBox.js.map +1 -1
  52. package/lib/esm/components/combobox/ComboBox.styles.js +1 -36
  53. package/lib/esm/components/combobox/ComboBox.styles.js.map +1 -1
  54. package/lib/esm/components/combobox/ComboBox.types.js +6 -0
  55. package/lib/esm/components/combobox/ComboBox.types.js.map +1 -0
  56. package/lib/esm/components/combobox/combobox-item/ComboBoxItem.js.map +1 -1
  57. package/lib/esm/components/filter/filter-content/FIlterContent.js.map +1 -1
  58. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.js +2 -5
  59. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.js.map +1 -1
  60. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js +0 -34
  61. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js.map +1 -1
  62. package/lib/esm/components/progress-bar/ProgressBar.js +30 -27
  63. package/lib/esm/components/progress-bar/ProgressBar.js.map +1 -1
  64. package/lib/esm/components/progress-bar/ProgressBar.styles.js +4 -2
  65. package/lib/esm/components/progress-bar/ProgressBar.styles.js.map +1 -1
  66. package/lib/esm/components/scroll-view/ScrollView.js +10 -16
  67. package/lib/esm/components/scroll-view/ScrollView.js.map +1 -1
  68. package/lib/esm/components/scroll-view/ScrollView.styles.js +3 -38
  69. package/lib/esm/components/scroll-view/ScrollView.styles.js.map +1 -1
  70. package/lib/esm/components/search-box/SearchBox.styles.js +1 -28
  71. package/lib/esm/components/search-box/SearchBox.styles.js.map +1 -1
  72. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.js +2 -6
  73. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.js.map +1 -1
  74. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.styles.js +0 -27
  75. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.styles.js.map +1 -1
  76. package/lib/esm/components/text-area/TextArea.js +2 -6
  77. package/lib/esm/components/text-area/TextArea.js.map +1 -1
  78. package/lib/esm/components/text-area/TextArea.styles.js +1 -30
  79. package/lib/esm/components/text-area/TextArea.styles.js.map +1 -1
  80. package/lib/esm/index.js +2 -1
  81. package/lib/esm/index.js.map +1 -1
  82. package/lib/esm/utils/calculate.js.map +1 -1
  83. package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +0 -2
  84. package/lib/types/components/accordion/accordion-content/AccordionContent.styles.d.ts +0 -2
  85. package/lib/types/components/combobox/ComboBox.d.ts +2 -139
  86. package/lib/types/components/combobox/ComboBox.styles.d.ts +1 -3
  87. package/lib/types/components/combobox/ComboBox.types.d.ts +139 -0
  88. package/lib/types/components/combobox/combobox-item/ComboBoxItem.d.ts +1 -1
  89. package/lib/types/components/popup/popup-content-wrapper/PopupContentWrapper.styles.d.ts +0 -2
  90. package/lib/types/components/progress-bar/ProgressBar.d.ts +4 -0
  91. package/lib/types/components/progress-bar/ProgressBar.styles.d.ts +1 -0
  92. package/lib/types/components/scroll-view/ScrollView.styles.d.ts +0 -2
  93. package/lib/types/components/search-box/SearchBox.styles.d.ts +0 -2
  94. package/lib/types/components/search-box/search-box-body/SearchBoxBody.styles.d.ts +0 -2
  95. package/lib/types/components/text-area/TextArea.styles.d.ts +0 -2
  96. package/lib/types/index.d.ts +3 -1
  97. package/lib/types/utils/calculate.d.ts +1 -1
  98. package/package.json +2 -2
@@ -8,7 +8,7 @@ import Popup from '../popup/Popup';
8
8
  const ProgressBar = t0 => {
9
9
  "use memo";
10
10
 
11
- const $ = _c(29);
11
+ const $ = _c(30);
12
12
  const {
13
13
  percentage,
14
14
  label,
@@ -17,7 +17,8 @@ const ProgressBar = t0 => {
17
17
  steps,
18
18
  colors,
19
19
  thumbLabel,
20
- showShine: t3
20
+ showShine: t3,
21
+ height
21
22
  } = t0;
22
23
  const shouldHideProgress = t1 === undefined ? false : t1;
23
24
  const shouldShowLabelInline = t2 === undefined ? false : t2;
@@ -61,7 +62,7 @@ const ProgressBar = t0 => {
61
62
  }
62
63
  const shineEffect = t4;
63
64
  let t5;
64
- if ($[6] !== colors?.backgroundColor || $[7] !== colors?.primaryTextColor || $[8] !== colors?.progressColor || $[9] !== colors?.secondaryTextColor || $[10] !== colors?.stepColor || $[11] !== label || $[12] !== percentage || $[13] !== shineEffect || $[14] !== shouldHideProgress || $[15] !== shouldShowLabelInline || $[16] !== showShine || $[17] !== steps || $[18] !== theme || $[19] !== thumbLabel || $[20] !== uuid) {
65
+ if ($[6] !== colors?.backgroundColor || $[7] !== colors?.primaryTextColor || $[8] !== colors?.progressColor || $[9] !== colors?.secondaryTextColor || $[10] !== colors?.stepColor || $[11] !== height || $[12] !== label || $[13] !== percentage || $[14] !== shineEffect || $[15] !== shouldHideProgress || $[16] !== shouldShowLabelInline || $[17] !== showShine || $[18] !== steps || $[19] !== theme || $[20] !== thumbLabel || $[21] !== uuid) {
65
66
  colors?.backgroundColor;
66
67
  colors?.primaryTextColor;
67
68
  colors?.progressColor;
@@ -98,7 +99,8 @@ const ProgressBar = t0 => {
98
99
  }));
99
100
  }
100
101
  return /*#__PURE__*/React.createElement(StyledProgressBarProgressWrapper, {
101
- $isBig: shouldShowLabelInline
102
+ $isBig: shouldShowLabelInline,
103
+ $height: height
102
104
  }, !!steps?.length && /*#__PURE__*/React.createElement(StyledProgressBarStepWrapper, null, steps.map(step => /*#__PURE__*/React.createElement(StyledProgressBarStep, {
103
105
  $position: step,
104
106
  key: `progress-step-${step}`,
@@ -146,42 +148,43 @@ const ProgressBar = t0 => {
146
148
  $[8] = colors?.progressColor;
147
149
  $[9] = colors?.secondaryTextColor;
148
150
  $[10] = colors?.stepColor;
149
- $[11] = label;
150
- $[12] = percentage;
151
- $[13] = shineEffect;
152
- $[14] = shouldHideProgress;
153
- $[15] = shouldShowLabelInline;
154
- $[16] = showShine;
155
- $[17] = steps;
156
- $[18] = theme;
157
- $[19] = thumbLabel;
158
- $[20] = uuid;
159
- $[21] = t5;
151
+ $[11] = height;
152
+ $[12] = label;
153
+ $[13] = percentage;
154
+ $[14] = shineEffect;
155
+ $[15] = shouldHideProgress;
156
+ $[16] = shouldShowLabelInline;
157
+ $[17] = showShine;
158
+ $[18] = steps;
159
+ $[19] = theme;
160
+ $[20] = thumbLabel;
161
+ $[21] = uuid;
162
+ $[22] = t5;
160
163
  } else {
161
- t5 = $[21];
164
+ t5 = $[22];
162
165
  }
163
166
  const progressBar = t5;
164
167
  colors?.primaryTextColor;
165
168
  let t6;
166
- if ($[22] !== colors?.primaryTextColor || $[23] !== label || $[24] !== shouldShowLabelInline) {
169
+ if ($[23] !== colors?.primaryTextColor || $[24] !== label || $[25] !== shouldShowLabelInline) {
167
170
  t6 = label && !shouldShowLabelInline && /*#__PURE__*/React.createElement(StyledProgressBarLabel, {
168
171
  $primaryColor: colors?.primaryTextColor
169
172
  }, label);
170
- $[22] = colors?.primaryTextColor;
171
- $[23] = label;
172
- $[24] = shouldShowLabelInline;
173
- $[25] = t6;
173
+ $[23] = colors?.primaryTextColor;
174
+ $[24] = label;
175
+ $[25] = shouldShowLabelInline;
176
+ $[26] = t6;
174
177
  } else {
175
- t6 = $[25];
178
+ t6 = $[26];
176
179
  }
177
180
  let t7;
178
- if ($[26] !== progressBar || $[27] !== t6) {
181
+ if ($[27] !== progressBar || $[28] !== t6) {
179
182
  t7 = /*#__PURE__*/React.createElement(StyledProgressBar, null, progressBar, t6);
180
- $[26] = progressBar;
181
- $[27] = t6;
182
- $[28] = t7;
183
+ $[27] = progressBar;
184
+ $[28] = t6;
185
+ $[29] = t7;
183
186
  } else {
184
- t7 = $[28];
187
+ t7 = $[29];
185
188
  }
186
189
  return t7;
187
190
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.js","names":["React","useContext","useMemo","useRef","useUuid","StyledMotionProgressBarProgress","StyledProgressBar","StyledProgressBarBackground","StyledProgressBarLabel","StyledProgressBarProgressWrapper","StyledProgressBarShine","StyledProgressBarStep","StyledProgressBarStepWrapper","StyledProgressBarThumbLabel","PopupAlignment","ThemeContext","ThemeProvider","Popup","ProgressBar","t0","$","_c","percentage","label","shouldHideProgress","t1","shouldShowLabelInline","t2","steps","colors","thumbLabel","showShine","t3","undefined","uuid","popupRef","theme","t4","bb0","shineCount","Math","ceil","speed","t5","Array","from","length","t6","map","_","index","createElement","key","$delay","shineEffect","backgroundColor","primaryTextColor","progressColor","secondaryTextColor","stepColor","$color","initial","width","left","animate","exit","transition","type","repeat","Infinity","repeatDelay","duration","step","onUpdate","current","show","onAnimationComplete","onClick","_temp","text","alignment","TopCenter","onHide","$primaryColor","$secondaryColor","progressBar","t7","displayName","event","stopPropagation"],"sources":["../../../../src/components/progress-bar/ProgressBar.tsx"],"sourcesContent":["import React, { FC, useContext, useMemo, useRef } from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport {\n StyledMotionProgressBarProgress,\n StyledProgressBar,\n StyledProgressBarBackground,\n StyledProgressBarLabel,\n StyledProgressBarProgressWrapper,\n StyledProgressBarShine,\n StyledProgressBarStep,\n StyledProgressBarStepWrapper,\n StyledProgressBarThumbLabel,\n} from './ProgressBar.styles';\nimport { PopupAlignment, PopupRef } from '../../types/popup';\nimport { ThemeContext, ThemeProvider } from 'styled-components';\nimport { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Popup from '../popup/Popup';\n\ntype Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N\n ? Acc[number]\n : Enumerate<N, [...Acc, Acc['length']]>;\n\ntype Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;\n\ninterface Colors {\n backgroundColor?: string;\n progressColor?: string;\n stepColor?: string;\n primaryTextColor?: string;\n secondaryTextColor?: string;\n}\n\nexport type ProgressBarProps = {\n /**\n * The colors of the ProgressBar.\n */\n colors?: Colors;\n /**\n * The label that should be displayed under the progressbar.\n */\n label?: string;\n /**\n * The percentage of the progress. Number between 0 and 100.\n */\n percentage?: Range<0, 101>;\n /**\n * Whether the progress should be hide and just display the label.\n */\n shouldHideProgress?: boolean;\n /**\n * Whether the label should be displayed inside the ProgressBar.\n */\n shouldShowLabelInline?: boolean;\n /**\n * Visual marked steps.\n */\n steps?: Range<0, 101>[];\n /**\n * The label that should be displayed on the thumb of the progress bar.\n */\n thumbLabel?: React.ReactNode;\n /**\n * Whether a shine animation should be shown on the progress bar. The amount of shine is based on the percentage value.\n */\n showShine?: boolean;\n};\n\nconst ProgressBar: FC<ProgressBarProps> = ({\n percentage,\n label,\n shouldHideProgress = false,\n shouldShowLabelInline = false,\n steps,\n colors,\n thumbLabel,\n showShine = false,\n}) => {\n 'use memo';\n\n const uuid = useUuid();\n const popupRef = useRef<PopupRef | null>(null);\n\n const theme = useContext(ThemeContext) as Theme | undefined;\n\n const shineEffect = useMemo(() => {\n if (!showShine || percentage === undefined) return null;\n const FULL_ANIMATION_LENGTH = 5;\n const MAX_SHINE_COUNT = 6;\n\n const shineCount = Math.ceil(MAX_SHINE_COUNT * (percentage / 100));\n const speed = FULL_ANIMATION_LENGTH * (percentage / 100);\n return Array.from({ length: shineCount }).map((_, index) => (\n <StyledProgressBarShine\n /* eslint-disable-next-line react/no-array-index-key */\n key={`progress-bar-shine__${shineCount}__${index}`}\n $speed={speed}\n $delay={(FULL_ANIMATION_LENGTH / shineCount) * index}\n />\n ));\n }, [percentage, showShine]);\n\n const progressBar = useMemo(() => {\n if (shouldHideProgress) {\n return null;\n }\n\n if (percentage === undefined) {\n return (\n <StyledProgressBarProgressWrapper>\n <StyledMotionProgressBarProgress\n key={`progress-bar-loop__${uuid}`}\n $color={colors?.progressColor}\n initial={{ width: '200px', left: '-200px' }}\n animate={{ width: '200px', left: '100%' }}\n exit={{ width: '200px', left: '100%' }}\n transition={{\n type: 'tween',\n repeat: Infinity,\n repeatDelay: 0,\n duration: 1,\n }}\n />\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n );\n }\n\n return (\n <StyledProgressBarProgressWrapper $isBig={shouldShowLabelInline}>\n {!!steps?.length && (\n <StyledProgressBarStepWrapper>\n {steps.map((step) => (\n <StyledProgressBarStep\n $position={step}\n key={`progress-step-${step}`}\n $color={colors?.stepColor}\n />\n ))}\n </StyledProgressBarStepWrapper>\n )}\n <StyledMotionProgressBarProgress\n $color={colors?.progressColor}\n key={`progress-bar__${uuid}`}\n initial={{ width: '0%' }}\n animate={{ width: `${percentage}%` }}\n exit={{ width: '0%' }}\n transition={{ type: 'tween' }}\n onUpdate={() => popupRef.current?.show()}\n onAnimationComplete={() => popupRef.current?.show()}\n >\n {showShine && shineEffect}\n {thumbLabel && (\n <StyledProgressBarThumbLabel onClick={(event) => event.stopPropagation()}>\n <ThemeProvider\n theme={{\n '000': colors?.backgroundColor ?? theme?.['104'],\n text: colors?.secondaryTextColor ?? theme?.['300'],\n }}\n >\n <Popup\n ref={popupRef}\n content={thumbLabel}\n alignment={PopupAlignment.TopCenter}\n onHide={() => popupRef.current?.show()}\n >\n {}\n </Popup>\n </ThemeProvider>\n </StyledProgressBarThumbLabel>\n )}\n </StyledMotionProgressBarProgress>\n\n {shouldShowLabelInline && label && (\n <StyledProgressBarLabel\n $shouldShowLabelInline={shouldShowLabelInline}\n $primaryColor={colors?.primaryTextColor}\n $secondaryColor={colors?.secondaryTextColor}\n $colorSplitPosition={percentage}\n >\n {label}\n </StyledProgressBarLabel>\n )}\n\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n );\n }, [\n colors?.backgroundColor,\n colors?.primaryTextColor,\n colors?.progressColor,\n colors?.secondaryTextColor,\n colors?.stepColor,\n label,\n percentage,\n shineEffect,\n shouldHideProgress,\n shouldShowLabelInline,\n showShine,\n steps,\n theme,\n thumbLabel,\n uuid,\n ]);\n\n return useMemo(\n () => (\n <StyledProgressBar>\n {progressBar}\n {label && !shouldShowLabelInline && (\n <StyledProgressBarLabel $primaryColor={colors?.primaryTextColor}>\n {label}\n </StyledProgressBarLabel>\n )}\n </StyledProgressBar>\n ),\n [colors?.primaryTextColor, label, progressBar, shouldShowLabelInline],\n );\n};\n\nProgressBar.displayName = 'ProgressBar';\n\nexport default ProgressBar;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAQC,UAAU,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OA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B,gBAAA,IAAApC,CAAA,SAAAG,KAAA,IAAAH,CAAA,SAAAM,qBAAA;IAPhBqB,EAAA,GAAAxB,KAA+B,IAA/B,CAAUG,qBAIV,iBAJA1B,KAAA,CAAAmD,aAAA,CACI3C,sBAAsB;MAAgB2E,aAAwB,EAAxBtD,MAAM,EAAA2B;IAAkB,GAC1DjC,KAET,CAAC;IAAAH,CAAA,OAAAS,MAAA,EAAA2B,gBAAA;IAAApC,CAAA,OAAAG,KAAA;IAAAH,CAAA,OAAAM,qBAAA;IAAAN,CAAA,OAAA2B,EAAA;EAAA;IAAAA,EAAA,GAAA3B,CAAA;EAAA;EAAA,IAAAkE,EAAA;EAAA,IAAAlE,CAAA,SAAAiE,WAAA,IAAAjE,CAAA,SAAA2B,EAAA;IANLuC,EAAA,gBAAAtF,KAAA,CAAAmD,aAAA,CAAC7C,iBAAiB,QACb+E,WAAW,EACXtC,EAKc,CAAC;IAAA3B,CAAA,OAAAiE,WAAA;IAAAjE,CAAA,OAAA2B,EAAA;IAAA3B,CAAA,OAAAkE,EAAA;EAAA;IAAAA,EAAA,GAAAlE,CAAA;EAAA;EAAA,OAPpBkE,EAOoB;AAAA,CAI/B;AAEDpE,WAAW,CAACqE,WAAW,GAAG,aAAa;AAEvC,eAAerE,WAAW;AA1JgB,SAAA4D,MAAAU,KAAA;EAAA,OAqF+BA,KAAK,CAAAC,eAAgB,CAAC,CAAC;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"ProgressBar.js","names":["React","useContext","useMemo","useRef","useUuid","StyledMotionProgressBarProgress","StyledProgressBar","StyledProgressBarBackground","StyledProgressBarLabel","StyledProgressBarProgressWrapper","StyledProgressBarShine","StyledProgressBarStep","StyledProgressBarStepWrapper","StyledProgressBarThumbLabel","PopupAlignment","ThemeContext","ThemeProvider","Popup","ProgressBar","t0","$","_c","percentage","label","shouldHideProgress","t1","shouldShowLabelInline","t2","steps","colors","thumbLabel","showShine","t3","height","undefined","uuid","popupRef","theme","t4","bb0","shineCount","Math","ceil","speed","t5","Array","from","length","t6","map","_","index","createElement","key","$delay","shineEffect","backgroundColor","primaryTextColor","progressColor","secondaryTextColor","stepColor","$color","initial","width","left","animate","exit","transition","type","repeat","Infinity","repeatDelay","duration","step","onUpdate","current","show","onAnimationComplete","onClick","_temp","text","alignment","TopCenter","onHide","$primaryColor","$secondaryColor","progressBar","t7","displayName","event","stopPropagation"],"sources":["../../../../src/components/progress-bar/ProgressBar.tsx"],"sourcesContent":["import React, { FC, useContext, useMemo, useRef } from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport {\n StyledMotionProgressBarProgress,\n StyledProgressBar,\n StyledProgressBarBackground,\n StyledProgressBarLabel,\n StyledProgressBarProgressWrapper,\n StyledProgressBarShine,\n StyledProgressBarStep,\n StyledProgressBarStepWrapper,\n StyledProgressBarThumbLabel,\n} from './ProgressBar.styles';\nimport { PopupAlignment, PopupRef } from '../../types/popup';\nimport { ThemeContext, ThemeProvider } from 'styled-components';\nimport { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Popup from '../popup/Popup';\n\ntype Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N\n ? Acc[number]\n : Enumerate<N, [...Acc, Acc['length']]>;\n\ntype Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;\n\ninterface Colors {\n backgroundColor?: string;\n progressColor?: string;\n stepColor?: string;\n primaryTextColor?: string;\n secondaryTextColor?: string;\n}\n\nexport type ProgressBarProps = {\n /**\n * The colors of the ProgressBar.\n */\n colors?: Colors;\n /**\n * The label that should be displayed under the progressbar.\n */\n label?: string;\n /**\n * The percentage of the progress. Number between 0 and 100.\n */\n percentage?: Range<0, 101>;\n /**\n * Whether the progress should be hide and just display the label.\n */\n shouldHideProgress?: boolean;\n /**\n * Whether the label should be displayed inside the ProgressBar.\n */\n shouldShowLabelInline?: boolean;\n /**\n * Visual marked steps.\n */\n steps?: Range<0, 101>[];\n /**\n * The label that should be displayed on the thumb of the progress bar.\n */\n thumbLabel?: React.ReactNode;\n /**\n * Whether a shine animation should be shown on the progress bar. The amount of shine is based on the percentage value.\n */\n showShine?: boolean;\n /**\n * The height of the progress bar in pixels. If not provided, it will be 10px if shouldShowLabelInline is false and 20px if shouldShowLabelInline is true.\n */\n height?: number;\n};\n\nconst ProgressBar: FC<ProgressBarProps> = ({\n percentage,\n label,\n shouldHideProgress = false,\n shouldShowLabelInline = false,\n steps,\n colors,\n thumbLabel,\n showShine = false,\n height,\n}) => {\n 'use memo';\n\n const uuid = useUuid();\n const popupRef = useRef<PopupRef | null>(null);\n\n const theme = useContext(ThemeContext) as Theme | undefined;\n\n const shineEffect = useMemo(() => {\n if (!showShine || percentage === undefined) return null;\n const FULL_ANIMATION_LENGTH = 5;\n const MAX_SHINE_COUNT = 6;\n\n const shineCount = Math.ceil(MAX_SHINE_COUNT * (percentage / 100));\n const speed = FULL_ANIMATION_LENGTH * (percentage / 100);\n return Array.from({ length: shineCount }).map((_, index) => (\n <StyledProgressBarShine\n /* eslint-disable-next-line react/no-array-index-key */\n key={`progress-bar-shine__${shineCount}__${index}`}\n $speed={speed}\n $delay={(FULL_ANIMATION_LENGTH / shineCount) * index}\n />\n ));\n }, [percentage, showShine]);\n\n const progressBar = useMemo(() => {\n if (shouldHideProgress) {\n return null;\n }\n\n if (percentage === undefined) {\n return (\n <StyledProgressBarProgressWrapper>\n <StyledMotionProgressBarProgress\n key={`progress-bar-loop__${uuid}`}\n $color={colors?.progressColor}\n initial={{ width: '200px', left: '-200px' }}\n animate={{ width: '200px', left: '100%' }}\n exit={{ width: '200px', left: '100%' }}\n transition={{\n type: 'tween',\n repeat: Infinity,\n repeatDelay: 0,\n duration: 1,\n }}\n />\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n );\n }\n\n return (\n <StyledProgressBarProgressWrapper $isBig={shouldShowLabelInline} $height={height}>\n {!!steps?.length && (\n <StyledProgressBarStepWrapper>\n {steps.map((step) => (\n <StyledProgressBarStep\n $position={step}\n key={`progress-step-${step}`}\n $color={colors?.stepColor}\n />\n ))}\n </StyledProgressBarStepWrapper>\n )}\n <StyledMotionProgressBarProgress\n $color={colors?.progressColor}\n key={`progress-bar__${uuid}`}\n initial={{ width: '0%' }}\n animate={{ width: `${percentage}%` }}\n exit={{ width: '0%' }}\n transition={{ type: 'tween' }}\n onUpdate={() => popupRef.current?.show()}\n onAnimationComplete={() => popupRef.current?.show()}\n >\n {showShine && shineEffect}\n {thumbLabel && (\n <StyledProgressBarThumbLabel onClick={(event) => event.stopPropagation()}>\n <ThemeProvider\n theme={{\n '000': colors?.backgroundColor ?? theme?.['104'],\n text: colors?.secondaryTextColor ?? theme?.['300'],\n }}\n >\n <Popup\n ref={popupRef}\n content={thumbLabel}\n alignment={PopupAlignment.TopCenter}\n onHide={() => popupRef.current?.show()}\n >\n {}\n </Popup>\n </ThemeProvider>\n </StyledProgressBarThumbLabel>\n )}\n </StyledMotionProgressBarProgress>\n\n {shouldShowLabelInline && label && (\n <StyledProgressBarLabel\n $shouldShowLabelInline={shouldShowLabelInline}\n $primaryColor={colors?.primaryTextColor}\n $secondaryColor={colors?.secondaryTextColor}\n $colorSplitPosition={percentage}\n >\n {label}\n </StyledProgressBarLabel>\n )}\n\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n );\n }, [\n colors?.backgroundColor,\n colors?.primaryTextColor,\n colors?.progressColor,\n colors?.secondaryTextColor,\n colors?.stepColor,\n height,\n label,\n percentage,\n shineEffect,\n shouldHideProgress,\n shouldShowLabelInline,\n showShine,\n steps,\n theme,\n thumbLabel,\n uuid,\n ]);\n\n return useMemo(\n () => (\n <StyledProgressBar>\n {progressBar}\n {label && !shouldShowLabelInline && (\n <StyledProgressBarLabel $primaryColor={colors?.primaryTextColor}>\n {label}\n </StyledProgressBarLabel>\n )}\n </StyledProgressBar>\n ),\n [colors?.primaryTextColor, label, progressBar, shouldShowLabelInline],\n );\n};\n\nProgressBar.displayName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AA;IAAAf,CAAA,OAAAwB,EAAA;EAAA;IAAAA,EAAA,GAAAxB,CAAA;EAAA;EAtGF,MAAAkE,WAAA,GAAoB1C,EAsGlB;EAaGf,MAAM,EAAA4B,gBAAkB;EAAA,IAAAT,EAAA;EAAA,IAAA5B,CAAA,SAAAS,MAAA,EAAA4B,gBAAA,IAAArC,CAAA,SAAAG,KAAA,IAAAH,CAAA,SAAAM,qBAAA;IAPhBsB,EAAA,GAAAzB,KAA+B,IAA/B,CAAUG,qBAIV,iBAJA1B,KAAA,CAAAoD,aAAA,CACI5C,sBAAsB;MAAgB4E,aAAwB,EAAxBvD,MAAM,EAAA4B;IAAkB,GAC1DlC,KAET,CAAC;IAAAH,CAAA,OAAAS,MAAA,EAAA4B,gBAAA;IAAArC,CAAA,OAAAG,KAAA;IAAAH,CAAA,OAAAM,qBAAA;IAAAN,CAAA,OAAA4B,EAAA;EAAA;IAAAA,EAAA,GAAA5B,CAAA;EAAA;EAAA,IAAAmE,EAAA;EAAA,IAAAnE,CAAA,SAAAkE,WAAA,IAAAlE,CAAA,SAAA4B,EAAA;IANLuC,EAAA,gBAAAvF,KAAA,CAAAoD,aAAA,CAAC9C,iBAAiB,QACbgF,WAAW,EACXtC,EAKc,CAAC;IAAA5B,CAAA,OAAAkE,WAAA;IAAAlE,CAAA,OAAA4B,EAAA;IAAA5B,CAAA,OAAAmE,EAAA;EAAA;IAAAA,EAAA,GAAAnE,CAAA;EAAA;EAAA,OAPpBmE,EAOoB;AAAA,CAI/B;AAEDrE,WAAW,CAACsE,WAAW,GAAG,aAAa;AAEvC,eAAetE,WAAW;AA5JgB,SAAA6D,MAAAU,KAAA;EAAA,OAsF+BA,KAAK,CAAAC,eAAgB,CAAC,CAAC;AAAA","ignoreList":[]}
@@ -16,11 +16,13 @@ export const StyledProgressBarProgressWrapper = styled.div`
16
16
  position: relative;
17
17
  width: 100%;
18
18
  height: ${({
19
+ $height,
19
20
  $isBig
20
- }) => $isBig ? 20 : 10}px;
21
+ }) => $height || ($isBig ? 20 : 10)}px;
21
22
  border-radius: ${({
23
+ $height,
22
24
  $isBig
23
- }) => $isBig ? 20 : 2}px;
25
+ }) => $isBig ? $height ?? 20 : ($height ?? 10) / 5}px;
24
26
  `;
25
27
  const shineMove = keyframes`
26
28
  from {
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.styles.js","names":["motion","styled","css","keyframes","StyledProgressBar","div","StyledProgressBarBackground","theme","$color","StyledProgressBarProgressWrapper","$isBig","shineMove","StyledProgressBarShine","attrs","$delay","style","animationDelay","$speed","StyledMotionProgressBarProgress","headline","StyledProgressBarLabel","$shouldShowLabelInline","$colorSplitPosition","$primaryColor","$secondaryColor","StyledProgressBarStepWrapper","StyledProgressBarStep","$position","StyledProgressBarThumbLabel"],"sources":["../../../../src/components/progress-bar/ProgressBar.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css, keyframes } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledProgressBar = styled.div`\n position: relative;\n`;\n\ntype StyledProgressBarBackgroundProps = WithTheme<{ $color?: string }>;\n\nexport const StyledProgressBarBackground = styled.div<StyledProgressBarBackgroundProps>`\n height: 100%;\n width: 100%;\n background-color: ${({ theme, $color }: StyledProgressBarBackgroundProps) =>\n $color ?? theme['104']};\n`;\n\ntype StyledProgressBarProgressWrapperProps = WithTheme<{\n $isBig?: boolean;\n}>;\n\nexport const StyledProgressBarProgressWrapper = styled.div<StyledProgressBarProgressWrapperProps>`\n overflow: hidden;\n position: relative;\n width: 100%;\n height: ${({ $isBig }) => ($isBig ? 20 : 10)}px;\n border-radius: ${({ $isBig }) => ($isBig ? 20 : 2)}px;\n`;\n\ntype StyledProgressBarProgressProps = WithTheme<{ $color?: string }>;\n\nconst shineMove = keyframes`\n from {\n transform: translateX(-150%);\n }\n to {\n transform: translateX(150%);\n }\n`;\n\nexport const StyledProgressBarShine = styled.div.attrs<{ $speed?: number; $delay?: number }>(\n ({ $delay }) => ({\n style: { animationDelay: `${$delay ?? 0}s` },\n }),\n)`\n position: absolute;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0) 33%,\n rgba(255, 255, 255, 0.5) 50%,\n rgba(255, 255, 255, 0) 66%\n );\n transform: translateX(-150%);\n animation: ${shineMove} ${({ $speed = 5 }) => `${$speed}s`} linear infinite;\n opacity: 0.95;\n`;\n\nexport const StyledMotionProgressBarProgress = styled(motion.div)<StyledProgressBarProgressProps>`\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n overflow: hidden;\n z-index: 2;\n display: flex;\n align-items: center;\n padding-left: 12px;\n background-color: ${({ theme, $color }: StyledProgressBarProgressProps) =>\n $color ?? theme.headline};\n`;\n\ntype StyledProgressBarLabelProps = WithTheme<{\n $shouldShowLabelInline?: boolean;\n $primaryColor?: string;\n $secondaryColor?: string;\n $colorSplitPosition?: number;\n}>;\n\nexport const StyledProgressBarLabel = styled.div<StyledProgressBarLabelProps>`\n font-size: 85%;\n color: ${({ theme, $shouldShowLabelInline }: StyledProgressBarLabelProps) =>\n $shouldShowLabelInline ? theme['100'] : theme.headline};\n white-space: nowrap;\n\n ${({ $colorSplitPosition, $primaryColor, $secondaryColor, theme }) =>\n $colorSplitPosition &&\n css`\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n\n display: flex;\n align-items: center;\n\n padding-left: 8px;\n\n font-weight: bold;\n\n -webkit-background-clip: text;\n\n color: transparent;\n background-image: linear-gradient(\n 90deg,\n ${$primaryColor ?? theme['100']} ${$colorSplitPosition}%,\n ${$secondaryColor ?? theme['300']} ${$colorSplitPosition}%\n );\n `}\n`;\n\nexport const StyledProgressBarStepWrapper = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n`;\n\ntype StyledProgressBarStepProps = WithTheme<{\n $position: number;\n $color?: string;\n}>;\n\nexport const StyledProgressBarStep = styled.div<StyledProgressBarStepProps>`\n background-color: ${({ theme, $color }: StyledProgressBarStepProps) => $color ?? theme['102']};\n height: 100%;\n width: 2px;\n position: absolute;\n top: 0;\n left: ${({ $position }: StyledProgressBarStepProps) => $position}%;\n`;\n\nexport const StyledProgressBarThumbLabel = styled.div`\n position: absolute;\n right: 0;\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,EAAEC,SAAS,QAAQ,mBAAmB;AAG1D,OAAO,MAAMC,iBAAiB,GAAGH,MAAM,CAACI,GAAG;AAC3C;AACA,CAAC;AAID,OAAO,MAAMC,2BAA2B,GAAGL,MAAM,CAACI,GAAqC;AACvF;AACA;AACA,wBAAwB,CAAC;EAAEE,KAAK;EAAEC;AAAyC,CAAC,KACpEA,MAAM,IAAID,KAAK,CAAC,KAAK,CAAC;AAC9B,CAAC;AAMD,OAAO,MAAME,gCAAgC,GAAGR,MAAM,CAACI,GAA0C;AACjG;AACA;AACA;AACA,cAAc,CAAC;EAAEK;AAAO,CAAC,KAAMA,MAAM,GAAG,EAAE,GAAG,EAAG;AAChD,qBAAqB,CAAC;EAAEA;AAAO,CAAC,KAAMA,MAAM,GAAG,EAAE,GAAG,CAAE;AACtD,CAAC;AAID,MAAMC,SAAS,GAAGR,SAAS;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMS,sBAAsB,GAAGX,MAAM,CAACI,GAAG,CAACQ,KAAK,CAClD,CAAC;EAAEC;AAAO,CAAC,MAAM;EACbC,KAAK,EAAE;IAAEC,cAAc,EAAE,GAAGF,MAAM,IAAI,CAAC;EAAI;AAC/C,CAAC,CACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiBH,SAAS,IAAI,CAAC;EAAEM,MAAM,GAAG;AAAE,CAAC,KAAK,GAAGA,MAAM,GAAG;AAC9D;AACA,CAAC;AAED,OAAO,MAAMC,+BAA+B,GAAGjB,MAAM,CAACD,MAAM,CAACK,GAAG,CAAiC;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,CAAC;EAAEE,KAAK;EAAEC;AAAuC,CAAC,KAClEA,MAAM,IAAID,KAAK,CAACY,QAAQ;AAChC,CAAC;AASD,OAAO,MAAMC,sBAAsB,GAAGnB,MAAM,CAACI,GAAgC;AAC7E;AACA,aAAa,CAAC;EAAEE,KAAK;EAAEc;AAAoD,CAAC,KACpEA,sBAAsB,GAAGd,KAAK,CAAC,KAAK,CAAC,GAAGA,KAAK,CAACY,QAAQ;AAC9D;AACA;AACA,MAAM,CAAC;EAAEG,mBAAmB;EAAEC,aAAa;EAAEC,eAAe;EAAEjB;AAAM,CAAC,KAC7De,mBAAmB,IACnBpB,GAAG;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkBqB,aAAa,IAAIhB,KAAK,CAAC,KAAK,CAAC,IAAIe,mBAAmB;AACtE,kBAAkBE,eAAe,IAAIjB,KAAK,CAAC,KAAK,CAAC,IAAIe,mBAAmB;AACxE;AACA,SAAS;AACT,CAAC;AAED,OAAO,MAAMG,4BAA4B,GAAGxB,MAAM,CAACI,GAAG;AACtD;AACA;AACA;AACA,CAAC;AAOD,OAAO,MAAMqB,qBAAqB,GAAGzB,MAAM,CAACI,GAA+B;AAC3E,wBAAwB,CAAC;EAAEE,KAAK;EAAEC;AAAmC,CAAC,KAAKA,MAAM,IAAID,KAAK,CAAC,KAAK,CAAC;AACjG;AACA;AACA;AACA;AACA,YAAY,CAAC;EAAEoB;AAAsC,CAAC,KAAKA,SAAS;AACpE,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAG3B,MAAM,CAACI,GAAG;AACrD;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ProgressBar.styles.js","names":["motion","styled","css","keyframes","StyledProgressBar","div","StyledProgressBarBackground","theme","$color","StyledProgressBarProgressWrapper","$height","$isBig","shineMove","StyledProgressBarShine","attrs","$delay","style","animationDelay","$speed","StyledMotionProgressBarProgress","headline","StyledProgressBarLabel","$shouldShowLabelInline","$colorSplitPosition","$primaryColor","$secondaryColor","StyledProgressBarStepWrapper","StyledProgressBarStep","$position","StyledProgressBarThumbLabel"],"sources":["../../../../src/components/progress-bar/ProgressBar.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css, keyframes } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledProgressBar = styled.div`\n position: relative;\n`;\n\ntype StyledProgressBarBackgroundProps = WithTheme<{ $color?: string }>;\n\nexport const StyledProgressBarBackground = styled.div<StyledProgressBarBackgroundProps>`\n height: 100%;\n width: 100%;\n background-color: ${({ theme, $color }: StyledProgressBarBackgroundProps) =>\n $color ?? theme['104']};\n`;\n\ntype StyledProgressBarProgressWrapperProps = WithTheme<{\n $isBig?: boolean;\n $height?: number;\n}>;\n\nexport const StyledProgressBarProgressWrapper = styled.div<StyledProgressBarProgressWrapperProps>`\n overflow: hidden;\n position: relative;\n width: 100%;\n height: ${({ $height, $isBig }) => $height || ($isBig ? 20 : 10)}px;\n border-radius: ${({ $height, $isBig }) => ($isBig ? ($height ?? 20) : ($height ?? 10) / 5)}px;\n`;\n\ntype StyledProgressBarProgressProps = WithTheme<{ $color?: string }>;\n\nconst shineMove = keyframes`\n from {\n transform: translateX(-150%);\n }\n to {\n transform: translateX(150%);\n }\n`;\n\nexport const StyledProgressBarShine = styled.div.attrs<{ $speed?: number; $delay?: number }>(\n ({ $delay }) => ({\n style: { animationDelay: `${$delay ?? 0}s` },\n }),\n)`\n position: absolute;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0) 33%,\n rgba(255, 255, 255, 0.5) 50%,\n rgba(255, 255, 255, 0) 66%\n );\n transform: translateX(-150%);\n animation: ${shineMove} ${({ $speed = 5 }) => `${$speed}s`} linear infinite;\n opacity: 0.95;\n`;\n\nexport const StyledMotionProgressBarProgress = styled(motion.div)<StyledProgressBarProgressProps>`\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n overflow: hidden;\n z-index: 2;\n display: flex;\n align-items: center;\n padding-left: 12px;\n background-color: ${({ theme, $color }: StyledProgressBarProgressProps) =>\n $color ?? theme.headline};\n`;\n\ntype StyledProgressBarLabelProps = WithTheme<{\n $shouldShowLabelInline?: boolean;\n $primaryColor?: string;\n $secondaryColor?: string;\n $colorSplitPosition?: number;\n}>;\n\nexport const StyledProgressBarLabel = styled.div<StyledProgressBarLabelProps>`\n font-size: 85%;\n color: ${({ theme, $shouldShowLabelInline }: StyledProgressBarLabelProps) =>\n $shouldShowLabelInline ? theme['100'] : theme.headline};\n white-space: nowrap;\n\n ${({ $colorSplitPosition, $primaryColor, $secondaryColor, theme }) =>\n $colorSplitPosition &&\n css`\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n\n display: flex;\n align-items: center;\n\n padding-left: 8px;\n\n font-weight: bold;\n\n -webkit-background-clip: text;\n\n color: transparent;\n background-image: linear-gradient(\n 90deg,\n ${$primaryColor ?? theme['100']} ${$colorSplitPosition}%,\n ${$secondaryColor ?? theme['300']} ${$colorSplitPosition}%\n );\n `}\n`;\n\nexport const StyledProgressBarStepWrapper = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n`;\n\ntype StyledProgressBarStepProps = WithTheme<{\n $position: number;\n $color?: string;\n}>;\n\nexport const StyledProgressBarStep = styled.div<StyledProgressBarStepProps>`\n background-color: ${({ theme, $color }: StyledProgressBarStepProps) => $color ?? theme['102']};\n height: 100%;\n width: 2px;\n position: absolute;\n top: 0;\n left: ${({ $position }: StyledProgressBarStepProps) => $position}%;\n`;\n\nexport const StyledProgressBarThumbLabel = styled.div`\n position: absolute;\n right: 0;\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,EAAEC,SAAS,QAAQ,mBAAm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sB,GAAGpB,MAAM,CAACI,GAAgC;AAC7E;AACA,aAAa,CAAC;EAAEE,KAAK;EAAEe;AAAoD,CAAC,KACpEA,sBAAsB,GAAGf,KAAK,CAAC,KAAK,CAAC,GAAGA,KAAK,CAACa,QAAQ;AAC9D;AACA;AACA,MAAM,CAAC;EAAEG,mBAAmB;EAAEC,aAAa;EAAEC,eAAe;EAAElB;AAAM,CAAC,KAC7DgB,mBAAmB,IACnBrB,GAAG;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkBsB,aAAa,IAAIjB,KAAK,CAAC,KAAK,CAAC,IAAIgB,mBAAmB;AACtE,kBAAkBE,eAAe,IAAIlB,KAAK,CAAC,KAAK,CAAC,IAAIgB,mBAAmB;AACxE;AACA,SAAS;AACT,CAAC;AAED,OAAO,MAAMG,4BAA4B,GAAGzB,MAAM,CAACI,GAAG;AACtD;AACA;AACA;AACA,CAAC;AAOD,OAAO,MAAMsB,qBAAqB,GAAG1B,MAAM,CAACI,GAA+B;AAC3E,wBAAwB,CAAC;EAAEE,KAAK;EAAEC;AAAmC,CAAC,KAAKA,MAAM,IAAID,KAAK,CAAC,KAAK,CAAC;AACjG;AACA;AACA;AACA;AACA,YAAY,CAAC;EAAEqB;AAAsC,CAAC,KAAKA,SAAS;AACpE,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAG5B,MAAM,CAACI,GAAG;AACrD;AACA;AACA,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { getDevice } from 'chayns-api';
2
1
  import React, { forwardRef, useMemo } from 'react';
3
2
  import { StyledScrollView } from './ScrollView.styles';
4
3
  const ScrollView = /*#__PURE__*/forwardRef(({
@@ -9,21 +8,16 @@ const ScrollView = /*#__PURE__*/forwardRef(({
9
8
  children,
10
9
  overflowX = 'auto',
11
10
  overflowY = 'auto'
12
- }, ref) => {
13
- const {
14
- browser
15
- } = getDevice();
16
- return useMemo(() => /*#__PURE__*/React.createElement(StyledScrollView, {
17
- $browser: browser?.name,
18
- $maxHeight: maxHeight,
19
- $height: height,
20
- $maxWidth: maxWidth,
21
- $width: width,
22
- $overflowX: overflowX,
23
- $overflowY: overflowY,
24
- ref: ref
25
- }, children), [browser?.name, children, height, maxHeight, maxWidth, overflowX, overflowY, ref, width]);
26
- });
11
+ }, ref) => useMemo(() => /*#__PURE__*/React.createElement(StyledScrollView, {
12
+ className: "chayns-scrollbar",
13
+ $maxHeight: maxHeight,
14
+ $height: height,
15
+ $maxWidth: maxWidth,
16
+ $width: width,
17
+ $overflowX: overflowX,
18
+ $overflowY: overflowY,
19
+ ref: ref
20
+ }, children), [children, height, maxHeight, maxWidth, overflowX, overflowY, ref, width]));
27
21
  ScrollView.displayName = 'ScrollView';
28
22
  export default ScrollView;
29
23
  //# sourceMappingURL=ScrollView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollView.js","names":["getDevice","React","forwardRef","useMemo","StyledScrollView","ScrollView","maxHeight","height","maxWidth","width","children","overflowX","overflowY","ref","browser","createElement","$browser","name","$maxHeight","$height","$maxWidth","$width","$overflowX","$overflowY","displayName"],"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,SAASA,SAAS,QAAQ,YAAY;AACtC,OAAOC,KAAK,IAAmBC,UAAU,EAAaC,OAAO,QAAQ,OAAO;AAE5E,SAASC,gBAAgB,QAAQ,qBAAqB;AAiCtD,MAAMC,UAAU,gBAAGH,UAAU,CACzB,CACI;EACII,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,GAAGd,SAAS,CAAC,CAAC;EAE/B,OAAOG,OAAO,CACV,mBACIF,KAAA,CAAAc,aAAA,CAACX,gBAAgB;IACbY,QAAQ,EAAEF,OAAO,EAAEG,IAAoB;IACvCC,UAAU,EAAEZ,SAAU;IACtBa,OAAO,EAAEZ,MAAO;IAChBa,SAAS,EAAEZ,QAAS;IACpBa,MAAM,EAAEZ,KAAM;IACda,UAAU,EAAEX,SAAU;IACtBY,UAAU,EAAEX,SAAU;IACtBC,GAAG,EAAEA;EAAI,GAERH,QACa,CACrB,EACD,CACII,OAAO,EAAEG,IAAI,EACbP,QAAQ,EACRH,MAAM,EACND,SAAS,EACTE,QAAQ,EACRG,SAAS,EACTC,SAAS,EACTC,GAAG,EACHJ,KAAK,CAEb,CAAC;AACL,CACJ,CAAC;AAEDJ,UAAU,CAACmB,WAAW,GAAG,YAAY;AAErC,eAAenB,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"ScrollView.js","names":["React","forwardRef","useMemo","StyledScrollView","ScrollView","maxHeight","height","maxWidth","width","children","overflowX","overflowY","ref","createElement","className","$maxHeight","$height","$maxWidth","$width","$overflowX","$overflowY","displayName"],"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,OAAOA,KAAK,IAAmBC,UAAU,EAAaC,OAAO,QAAQ,OAAO;AAC5E,SAASC,gBAAgB,QAAQ,qBAAqB;AAiCtD,MAAMC,UAAU,gBAAGH,UAAU,CACzB,CACI;EACII,SAAS,GAAG,GAAG;EACfC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACLC,QAAQ;EACRC,SAAS,GAAG,MAAM;EAClBC,SAAS,GAAG;AAChB,CAAC,EACDC,GAAG,KAEHV,OAAO,CACH,mBACIF,KAAA,CAAAa,aAAA,CAACV,gBAAgB;EACbW,SAAS,EAAC,kBAAkB;EAC5BC,UAAU,EAAEV,SAAU;EACtBW,OAAO,EAAEV,MAAO;EAChBW,SAAS,EAAEV,QAAS;EACpBW,MAAM,EAAEV,KAAM;EACdW,UAAU,EAAET,SAAU;EACtBU,UAAU,EAAET,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;AAEDJ,UAAU,CAACiB,WAAW,GAAG,YAAY;AAErC,eAAejB,UAAU","ignoreList":[]}
@@ -9,17 +9,17 @@ export const StyledScrollView = styled.div`
9
9
  $height
10
10
  }) => $height && css`
11
11
  height: ${typeof $height === 'number' ? `${$height}px` : $height};
12
- `}
12
+ `}
13
13
  ${({
14
14
  $maxWidth
15
15
  }) => $maxWidth && css`
16
16
  max-width: ${typeof $maxWidth === 'number' ? `${$maxWidth}px` : $maxWidth};
17
- `}
17
+ `}
18
18
  ${({
19
19
  $width
20
20
  }) => $width && css`
21
21
  width: ${typeof $width === 'number' ? `${$width}px` : $width};
22
- `}
22
+ `}
23
23
  ${({
24
24
  $overflowX
25
25
  }) => css`
@@ -30,40 +30,5 @@ export const StyledScrollView = styled.div`
30
30
  }) => css`
31
31
  overflow-y: ${$overflowY};
32
32
  `}
33
-
34
- // Styles for custom scrollbar
35
- ${({
36
- $browser,
37
- theme
38
- }) => $browser === 'firefox' ? css`
39
- scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
40
- scrollbar-width: thin;
41
- ` : css`
42
- &::-webkit-scrollbar {
43
- width: 10px;
44
- height: 10px;
45
- }
46
-
47
- &::-webkit-scrollbar-track {
48
- background-color: transparent;
49
- }
50
-
51
- &::-webkit-scrollbar-button {
52
- background-color: transparent;
53
- height: 5px;
54
- width: 5px;
55
- }
56
-
57
- &::-webkit-scrollbar-thumb {
58
- background-color: rgba(${theme['text-rgb']}, 0.15);
59
- border-radius: 20px;
60
- background-clip: padding-box;
61
- border: solid 3px transparent;
62
- }
63
-
64
- &::-webkit-scrollbar-corner {
65
- background-color: transparent;
66
- }
67
- `}
68
33
  `;
69
34
  //# sourceMappingURL=ScrollView.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollView.styles.js","names":["styled","css","StyledScrollView","div","$maxHeight","$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,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAc/C,OAAO,MAAMC,gBAAgB,GAAGF,MAAM,CAACG,GAA0B;AACjE,MAAM,CAAC;EAAEC;AAAW,CAAC,KACbA,UAAU,IACVH,GAAG;AACX,0BAA0B,OAAOG,UAAU,KAAK,QAAQ,GAAG,GAAGA,UAAU,IAAI,GAAGA,UAAU;AACzF,SAAS;AACT,MAAM,CAAC;EAAEC;AAAQ,CAAC,KACVA,OAAO,IACPJ,GAAG;AACX,sBAAsB,OAAOI,OAAO,KAAK,QAAQ,GAAG,GAAGA,OAAO,IAAI,GAAGA,OAAO;AAC5E,SAAS;AACT,MAAM,CAAC;EAAEC;AAAU,CAAC,KACZA,SAAS,IACTL,GAAG;AACX,yBAAyB,OAAOK,SAAS,KAAK,QAAQ,GAAG,GAAGA,SAAS,IAAI,GAAGA,SAAS;AACrF,SAAS;AACT,MAAM,CAAC;EAAEC;AAAO,CAAC,KACTA,MAAM,IACNN,GAAG;AACX,qBAAqB,OAAOM,MAAM,KAAK,QAAQ,GAAG,GAAGA,MAAM,IAAI,GAAGA,MAAM;AACxE,SAAS;AACT,MAAM,CAAC;EAAEC;AAAW,CAAC,KAAKP,GAAG;AAC7B,sBAAsBO,UAAU;AAChC,KAAK;AACL,MAAM,CAAC;EAAEC;AAAW,CAAC,KAAKR,GAAG;AAC7B,sBAAsBQ,UAAU;AAChC,KAAK;AACL;AACA;AACA,MAAM,CAAC;EAAEC,QAAQ;EAAEC;AAA6B,CAAC,KACzCD,QAAQ,KAAK,SAAS,GAChBT,GAAG;AACjB,0CAA0CU,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACDV,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CU,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":["styled","css","StyledScrollView","div","$maxHeight","$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,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAY/C,OAAO,MAAMC,gBAAgB,GAAGF,MAAM,CAACG,GAA0B;AACjE,MAAM,CAAC;EAAEC;AAAW,CAAC,KACbA,UAAU,IACVH,GAAG;AACX,0BAA0B,OAAOG,UAAU,KAAK,QAAQ,GAAG,GAAGA,UAAU,IAAI,GAAGA,UAAU;AACzF,SAAS;AACT,MAAM,CAAC;EAAEC;AAAQ,CAAC,KACVA,OAAO,IACPJ,GAAG;AACX,sBAAsB,OAAOI,OAAO,KAAK,QAAQ,GAAG,GAAGA,OAAO,IAAI,GAAGA,OAAO;AAC5E,SAAS;AACT,MAAM,CAAC;EAAEC;AAAU,CAAC,KACZA,SAAS,IACTL,GAAG;AACX,yBAAyB,OAAOK,SAAS,KAAK,QAAQ,GAAG,GAAGA,SAAS,IAAI,GAAGA,SAAS;AACrF,SAAS;AACT,MAAM,CAAC;EAAEC;AAAO,CAAC,KACTA,MAAM,IACNN,GAAG;AACX,qBAAqB,OAAOM,MAAM,KAAK,QAAQ,GAAG,GAAGA,MAAM,IAAI,GAAGA,MAAM;AACxE,SAAS;AACT,MAAM,CAAC;EAAEC;AAAW,CAAC,KAAKP,GAAG;AAC7B,sBAAsBO,UAAU;AAChC,KAAK;AACL,MAAM,CAAC;EAAEC;AAAW,CAAC,KAAKR,GAAG;AAC7B,sBAAsBQ,UAAU;AAChC,KAAK;AACL,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import { motion } from 'motion/react';
2
- import styled, { css } from 'styled-components';
2
+ import styled from 'styled-components';
3
3
  export const StyledSearchBox = styled.div``;
4
4
  export const StyledMotionSearchBoxBody = styled(motion.div)`
5
5
  background: ${({
@@ -25,33 +25,6 @@ export const StyledMotionSearchBoxBody = styled(motion.div)`
25
25
  rgba(${({
26
26
  theme
27
27
  }) => theme['009-rgb']}, 0.08) inset;
28
-
29
- // Styles for custom scrollbar
30
- ${({
31
- $browser,
32
- theme
33
- }) => $browser === 'firefox' ? css`
34
- scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
35
- scrollbar-width: thin;
36
- ` : css`
37
- &::-webkit-scrollbar {
38
- width: 5px;
39
- }
40
-
41
- &::-webkit-scrollbar-track {
42
- background-color: transparent;
43
- }
44
-
45
- &::-webkit-scrollbar-button {
46
- background-color: transparent;
47
- height: 5px;
48
- }
49
-
50
- &::-webkit-scrollbar-thumb {
51
- background-color: rgba(${theme['text-rgb']}, 0.15);
52
- border-radius: 20px;
53
- }
54
- `}
55
28
  `;
56
29
  export const StyledSearchBoxIcon = styled.div`
57
30
  cursor: pointer;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBox.styles.js","names":["motion","styled","css","StyledSearchBox","div","StyledMotionSearchBoxBody","theme","$width","$height","$browser","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,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAI/C,OAAO,MAAMC,eAAe,GAAGF,MAAM,CAACG,GAAG,EAAE;AAQ3C,OAAO,MAAMC,yBAAyB,GAAGJ,MAAM,CAACD,MAAM,CAACI,GAAG,CAAiC;AAC3F,kBAAkB,CAAC;EAAEE;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;AACA;AACA,MAAM,CAAC;EAAEG,QAAQ;EAAEH;AAAsC,CAAC,KAClDG,QAAQ,KAAK,SAAS,GAChBP,GAAG;AACjB,0CAA0CI,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACDJ,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CI,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AACf,CAAC;AAED,OAAO,MAAMI,mBAAmB,GAAGT,MAAM,CAACG,GAAG;AAC7C;AACA;AACA,CAAC;AAED,OAAO,MAAMO,0BAA0B,GAAGV,MAAM,CAACG,GAAG;AACpD;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMQ,uBAAuB,GAAGX,MAAM,CAACG,GAAG;AACjD;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"SearchBox.styles.js","names":["motion","styled","StyledSearchBox","div","StyledMotionSearchBoxBody","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,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,MAAM,mBAAmB;AAGtC,OAAO,MAAMC,eAAe,GAAGD,MAAM,CAACE,GAAG,EAAE;AAO3C,OAAO,MAAMC,yBAAyB,GAAGH,MAAM,CAACD,MAAM,CAACG,GAAG,CAAiC;AAC3F,kBAAkB,CAAC;EAAEE;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;AAED,OAAO,MAAMG,mBAAmB,GAAGP,MAAM,CAACE,GAAG;AAC7C;AACA;AACA,CAAC;AAED,OAAO,MAAMM,0BAA0B,GAAGR,MAAM,CAACE,GAAG;AACpD;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMO,uBAAuB,GAAGT,MAAM,CAACE,GAAG;AACjD;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -4,7 +4,6 @@ import { useUuid } from '../../../hooks/uuid';
4
4
  import { getCurrentGroupName } from '../../../utils/searchBox';
5
5
  import FilterButtons from '../../filter-buttons/FilterButtons';
6
6
  import { StyledSearchBoxBody, StyledSearchBoxBodyContent, StyledSearchBoxBodyHead, StyledSearchBoxBodyHeadGroupName } from './SearchBoxBody.styles';
7
- import { useDevice } from 'chayns-api';
8
7
  const SearchBoxBody = /*#__PURE__*/forwardRef(({
9
8
  filterButtons,
10
9
  selectedGroups,
@@ -17,9 +16,6 @@ const SearchBoxBody = /*#__PURE__*/forwardRef(({
17
16
  const [hasScrolled, setHasScrolled] = useState(false);
18
17
  const [currentGroupName, setCurrentGroupName] = useState('');
19
18
  const headRef = useRef(null);
20
- const {
21
- browser
22
- } = useDevice();
23
19
  const headSize = useElementSize(headRef);
24
20
  const uuid = useUuid();
25
21
  const headHeight = useMemo(() => headSize?.height ? headSize.height + 15 : 0, [headSize?.height]);
@@ -62,10 +58,10 @@ const SearchBoxBody = /*#__PURE__*/forwardRef(({
62
58
  $headHeight: headHeight,
63
59
  key: "content",
64
60
  id: `searchBoxContent__${uuid}`,
65
- $browser: browser?.name,
61
+ className: "chayns-scrollbar",
66
62
  tabIndex: 0,
67
63
  onScroll: handleScroll
68
- }, children)), [browser, children, currentGroupName, filterButtons, handleScroll, hasScrolled, headHeight, height, onGroupSelect, ref, selectedGroups, shouldHideFilterButtons, shouldShow, uuid]);
64
+ }, children)), [children, currentGroupName, filterButtons, handleScroll, hasScrolled, headHeight, height, onGroupSelect, ref, selectedGroups, shouldHideFilterButtons, shouldShow, uuid]);
69
65
  });
70
66
  SearchBoxBody.displayName = 'SearchBoxBody';
71
67
  export default SearchBoxBody;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBoxBody.js","names":["React","forwardRef","useCallback","useEffect","useMemo","useRef","useState","useElementSize","useUuid","getCurrentGroupName","FilterButtons","StyledSearchBoxBody","StyledSearchBoxBodyContent","StyledSearchBoxBodyHead","StyledSearchBoxBodyHeadGroupName","useDevice","SearchBoxBody","filterButtons","selectedGroups","height","children","shouldShow","onGroupSelect","shouldHideFilterButtons","ref","hasScrolled","setHasScrolled","currentGroupName","setCurrentGroupName","headRef","browser","headSize","uuid","headHeight","element","document","getElementById","length","handlePreventDefault","event","preventDefault","stopPropagation","handleScroll","scrollTop","target","createElement","onClick","inert","undefined","$hasScrolled","$hasGroupName","items","size","onSelect","selectedItemIds","replace","$height","$headHeight","key","id","$browser","name","tabIndex","onScroll","displayName"],"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 =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CAAC,CAACvB;EAAiB,GAEjC,CAACJ,uBAAuB,iBACrBvB,KAAA,CAAA6C,aAAA,CAACnC,aAAa;IACVyC,KAAK,EAAElC,aAAc;IACrBmC,IAAI,EAAE,CAAE;IACRC,QAAQ,EAAE/B,aAAc;IACxBgC,eAAe,EAAEpC;EAAe,CACnC,CACJ,eACDlB,KAAA,CAAA6C,aAAA,CAAC/B,gCAAgC,QAC5Ba,gBAAgB,CAAC4B,OAAO,CAAC,GAAG,EAAE,EAAE,CACH,CACb,CAC5B,eACDvD,KAAA,CAAA6C,aAAA,CAACjC,0BAA0B;IACvB4C,OAAO,EAAErC,MAAO;IAChBsC,WAAW,EAAExB,UAAW;IACxByB,GAAG,EAAC,SAAS;IACbC,EAAE,EAAE,qBAAqB3B,IAAI,EAAG;IAChC4B,QAAQ,EAAG9B,OAAO,EAA4B+B,IAAK;IACnDC,QAAQ,EAAE,CAAE;IACZC,QAAQ,EAAErB;EAAa,GAEtBtB,QACuB,CACX,CACxB,EACD,CACIU,OAAO,EACPV,QAAQ,EACRO,gBAAgB,EAChBV,aAAa,EACbyB,YAAY,EACZjB,WAAW,EACXQ,UAAU,EACVd,MAAM,EACNG,aAAa,EACbE,GAAG,EACHN,cAAc,EACdK,uBAAuB,EACvBF,UAAU,EACVW,IAAI,CAEZ,CAAC;AACL,CACJ,CAAC;AAEDhB,aAAa,CAACgD,WAAW,GAAG,eAAe;AAE3C,eAAehD,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"SearchBoxBody.js","names":["React","forwardRef","useCallback","useEffect","useMemo","useRef","useState","useElementSize","useUuid","getCurrentGroupName","FilterButtons","StyledSearchBoxBody","StyledSearchBoxBodyContent","StyledSearchBoxBodyHead","StyledSearchBoxBodyHeadGroupName","SearchBoxBody","filterButtons","selectedGroups","height","children","shouldShow","onGroupSelect","shouldHideFilterButtons","ref","hasScrolled","setHasScrolled","currentGroupName","setCurrentGroupName","headRef","headSize","uuid","headHeight","element","document","getElementById","length","handlePreventDefault","event","preventDefault","stopPropagation","handleScroll","scrollTop","target","createElement","onClick","inert","undefined","$hasScrolled","$hasGroupName","items","size","onSelect","selectedItemIds","replace","$height","$headHeight","key","id","className","tabIndex","onScroll","displayName"],"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,\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,OAAOA,KAAK,IACRC,UAAU,EAGVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAEL,OAAO;AACd,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SA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C,GAAG,EAAE,EAAE,CACH,CACb,CAC5B,eACDrD,KAAA,CAAA2C,aAAA,CAAC/B,0BAA0B;IACvB0C,OAAO,EAAEpC,MAAO;IAChBqC,WAAW,EAAExB,UAAW;IACxByB,GAAG,EAAC,SAAS;IACbC,EAAE,EAAE,qBAAqB3B,IAAI,EAAG;IAChC4B,SAAS,EAAC,kBAAkB;IAC5BC,QAAQ,EAAE,CAAE;IACZC,QAAQ,EAAEpB;EAAa,GAEtBrB,QACuB,CACX,CACxB,EACD,CACIA,QAAQ,EACRO,gBAAgB,EAChBV,aAAa,EACbwB,YAAY,EACZhB,WAAW,EACXO,UAAU,EACVb,MAAM,EACNG,aAAa,EACbE,GAAG,EACHN,cAAc,EACdK,uBAAuB,EACvBF,UAAU,EACVU,IAAI,CAEZ,CAAC;AACL,CACJ,CAAC;AAEDf,aAAa,CAAC8C,WAAW,GAAG,eAAe;AAE3C,eAAe9C,aAAa","ignoreList":[]}
@@ -38,32 +38,5 @@ export const StyledSearchBoxBodyContent = styled.div`
38
38
  $height,
39
39
  $headHeight
40
40
  }) => $height + $headHeight <= 300 ? 'hidden' : 'auto'};
41
-
42
- // Styles for custom scrollbar
43
- ${({
44
- $browser,
45
- theme
46
- }) => $browser === 'firefox' ? css`
47
- scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
48
- scrollbar-width: thin;
49
- ` : css`
50
- &::-webkit-scrollbar {
51
- width: 5px;
52
- }
53
-
54
- &::-webkit-scrollbar-track {
55
- background-color: transparent;
56
- }
57
-
58
- &::-webkit-scrollbar-button {
59
- background-color: transparent;
60
- height: 5px;
61
- }
62
-
63
- &::-webkit-scrollbar-thumb {
64
- background-color: rgba(${theme['text-rgb']}, 0.15);
65
- border-radius: 20px;
66
- }
67
- `}
68
41
  `;
69
42
  //# sourceMappingURL=SearchBoxBody.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBoxBody.styles.js","names":["styled","css","StyledSearchBoxBody","div","StyledSearchBoxBodyHead","$hasGroupName","$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,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAI/C,OAAO,MAAMC,mBAAmB,GAAGF,MAAM,CAACG,GAAG;AAC7C;AACA;AACA,CAAC;AAED,OAAO,MAAMC,uBAAuB,GAAGJ,MAAM,CAACG,GAA6B;AAC3E;AACA;AACA;AACA;AACA,MAAM,CAAC;EAAEE;AAAc,CAAC,KAChBA,aAAa,IACbJ,GAAG;AACX;AACA,SAAS;AACT;AACA,MAAM,CAAC;EAAEK;AAAa,CAAC,KACfA,YAAY,IACZL,GAAG;AACX;AACA,SAAS;AACT,CAAC;AAMD,OAAO,MAAMM,gCAAgC,GAAGP,MAAM,CAACG,GAA8C;AACrG,aAAa,CAAC;EAAEK;AAAiD,CAAC,KAAKA,KAAK,CAACC,IAAI;AACjF;AACA,CAAC;AAQD,OAAO,MAAMC,0BAA0B,GAAGV,MAAM,CAACG,GAAoC;AACrF;AACA;AACA;AACA;AACA,kBAAkB,CAAC;EAAEQ;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,GAChBZ,GAAG;AACjB,0CAA0CO,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACDP,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CO,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AACf,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"SearchBoxBody.styles.js","names":["styled","css","StyledSearchBoxBody","div","StyledSearchBoxBodyHead","$hasGroupName","$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,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,OAAO,MAAMC,mBAAmB,GAAGF,MAAM,CAACG,GAAG;AAC7C;AACA;AACA,CAAC;AAED,OAAO,MAAMC,uBAAuB,GAAGJ,MAAM,CAACG,GAA6B;AAC3E;AACA;AACA;AACA;AACA,MAAM,CAAC;EAAEE;AAAc,CAAC,KAChBA,aAAa,IACbJ,GAAG;AACX;AACA,SAAS;AACT;AACA,MAAM,CAAC;EAAEK;AAAa,CAAC,KACfA,YAAY,IACZL,GAAG;AACX;AACA,SAAS;AACT,CAAC;AAMD,OAAO,MAAMM,gCAAgC,GAAGP,MAAM,CAACG,GAA8C;AACrG,aAAa,CAAC;EAAEK;AAAiD,CAAC,KAAKA,KAAK,CAACC,IAAI;AACjF;AACA,CAAC;AAOD,OAAO,MAAMC,0BAA0B,GAAGV,MAAM,CAACG,GAAoC;AACrF;AACA;AACA;AACA;AACA,kBAAkB,CAAC;EAAEQ;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":[]}
@@ -1,4 +1,3 @@
1
- import { getDevice } from 'chayns-api';
2
1
  import React, { forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
3
2
  import { AreaContext } from '../area-provider/AreaContextProvider';
4
3
  import { StyledInputRightElement } from '../input/Input.styles';
@@ -20,9 +19,6 @@ const TextArea = /*#__PURE__*/forwardRef(({
20
19
  const [isOverflowing, setIsOverflowing] = useState(false);
21
20
  const areaProvider = useContext(AreaContext);
22
21
  const textareaRef = useRef(null);
23
- const {
24
- browser
25
- } = getDevice();
26
22
  useCursorRepaint(textareaRef);
27
23
 
28
24
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
@@ -52,7 +48,7 @@ const TextArea = /*#__PURE__*/forwardRef(({
52
48
  $isInvalid: isInvalid,
53
49
  $shouldChangeColor: shouldChangeColor
54
50
  }, /*#__PURE__*/React.createElement(StyledTextAreaContent, null, /*#__PURE__*/React.createElement(StyledTextAreaInput, {
55
- $browser: browser?.name,
51
+ className: "chayns-scrollbar",
56
52
  disabled: isDisabled,
57
53
  $isInvalid: isInvalid,
58
54
  ref: textareaRef,
@@ -67,7 +63,7 @@ const TextArea = /*#__PURE__*/forwardRef(({
67
63
  rows: 1
68
64
  }), !value && /*#__PURE__*/React.createElement(StyledTextAreaLabelWrapper, null, /*#__PURE__*/React.createElement(StyledTextAreaLabel, {
69
65
  $isInvalid: isInvalid
70
- }, placeholder))), rightElement && shouldShowBorder && rightElement), rightElement && !shouldShowBorder && /*#__PURE__*/React.createElement(StyledInputRightElement, null, rightElement)), [browser?.name, isDisabled, isInvalid, isOverflowing, maxHeight, minHeight, onBlur, onChange, onFocus, onKeyDown, placeholder, rightElement, shouldChangeColor, shouldShowBorder, value]);
66
+ }, placeholder))), rightElement && shouldShowBorder && rightElement), rightElement && !shouldShowBorder && /*#__PURE__*/React.createElement(StyledInputRightElement, null, rightElement)), [isDisabled, isInvalid, isOverflowing, maxHeight, minHeight, onBlur, onChange, onFocus, onKeyDown, placeholder, rightElement, shouldChangeColor, shouldShowBorder, value]);
71
67
  });
72
68
  TextArea.displayName = 'TextArea';
73
69
  export default TextArea;