@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
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_VerificationBadge","_AreaContextProvider","_interopRequireWildcard","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_Badge2","_container","_dropdown","_element","_ref","_Filter","_AnimatedNumber","_FileList","_FileSelect","_DropdownBodyWrapper","_ComboBox","_ContentCard","_HighlightSlider","_ContextMenu","_ContextMenu2","_ExpandableContent","_FileInput","_FilterButton","_FilterButtons","_GridImage","_GroupedImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_MentionFinder","_MultiActionButton","_NumberInput","_PageProvider","_Popup","_PopupContent","_ProgressBar","_popup","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SelectButton","_SetupWizardItem","_SetupWizard","_SharingContextMenu","_SharingBar","_SharingButton","_Signature","_SliderButton","_Slider","_SmallWaitCursor","_TagInput","_TextArea","_Tooltip","_Truncation","_mentionFinder","_contentCard","_file","_filterButtons","_MultiActionButton2","_truncation","_environment","_fileDialog","_isTobitEmployee","_pageProvider","_uploadFile","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as VerificationBadge } from './components/verification-badge/VerificationBadge';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './components/badge/Badge.types';\nexport type {\n ColorSchemeContextProps,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { useContainer, ContainerAnchor } from './hooks/container';\nexport { DropdownDirection, type DropdownCoordinates } from './types/dropdown';\nexport { useIsMeasuredClone } from './hooks/element';\nexport { useCombinedRefs } from './hooks/ref';\nexport { default as Filter, type FilterRightIcon } from './components/filter/Filter';\nexport {\n type SortItem,\n type SearchConfig,\n type SortConfig,\n type CheckboxConfig,\n type FilterButtonConfig,\n type FilterRef,\n} from './types/filter';\nexport { default as AnimatedNumber } from './components/animated-number/AnimatedNumber';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport { default as DropdownBodyWrapper } from './components/dropdown-body-wrapper/DropdownBodyWrapper';\nexport {\n default as ComboBox,\n type ComboBoxTextStyles,\n type IComboBoxItem as ComboBoxItem,\n type IComboBoxItems as ComboBoxItems,\n type ComboBoxRef,\n ComboBoxSize,\n} from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as HighlightSlider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu.types';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport {\n default as FileInput,\n type FileInputRef,\n STREAMINGSERVICE_FILE_TYPES,\n TSIMG_FILE_TYPES,\n} from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as GroupedImage } from './components/grouped-image/GroupedImage';\nexport { default as Icon, type IconProps } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n type ListItemRef,\n} from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as MultiActionButton } from './components/multi-action-button/MultiActionButton';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingContextMenu } from './components/sharing-context-menu/SharingContextMenu';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as SharingButton } from './components/sharing-button/SharingButton';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport type { Tag } from './types/tagInput';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport type { TagInputRef } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/element';\nexport type { BrowserName } from './types/chayns';\nexport { ContentCardType } from './types/contentCard';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport {\n type MultiActionButtonAction,\n type MultiActionButtonActionEvent,\n type MultiActionButtonActionStatus,\n MultiActionButtonHeight,\n type MultiActionButtonProps,\n MultiActionButtonStatusType,\n} from './components/multi-action-button/MultiActionButton.types';\nexport { ClampPosition } from './types/truncation';\nexport { useIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\nexport type { Theme } from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CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAAA,SAAA/E,uBAAA8E,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAK,UAAA,GAAAL,CAAA,KAAAU,OAAA,EAAAV,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_VerificationBadge","_AreaContextProvider","_interopRequireWildcard","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_Badge2","_container","_dropdown","_element","_ref","_Filter","_AnimatedNumber","_FileList","_FileSelect","_DropdownBodyWrapper","_ComboBox","_ContentCard","_HighlightSlider","_ContextMenu","_ContextMenu2","_ExpandableContent","_FileInput","_FilterButton","_FilterButtons","_GridImage","_GroupedImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_MentionFinder","_MultiActionButton","_NumberInput","_PageProvider","_Popup","_PopupContent","_ProgressBar","_popup","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SelectButton","_SetupWizardItem","_SetupWizard","_SharingContextMenu","_SharingBar","_SharingButton","_Signature","_SliderButton","_Slider","_SmallWaitCursor","_TagInput","_TextArea","_Tooltip","_Truncation","_mentionFinder","_contentCard","_file","_filterButtons","_MultiActionButton2","_truncation","_environment","_fileDialog","_isTobitEmployee","_pageProvider","_uploadFile","_ComboBox2","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as VerificationBadge } from './components/verification-badge/VerificationBadge';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './components/badge/Badge.types';\nexport type {\n ColorSchemeContextProps,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { useContainer, ContainerAnchor } from './hooks/container';\nexport { DropdownDirection, type DropdownCoordinates } from './types/dropdown';\nexport { useIsMeasuredClone } from './hooks/element';\nexport { useCombinedRefs } from './hooks/ref';\nexport { default as Filter, type FilterRightIcon } from './components/filter/Filter';\nexport {\n type SortItem,\n type SearchConfig,\n type SortConfig,\n type CheckboxConfig,\n type FilterButtonConfig,\n type FilterRef,\n} from './types/filter';\nexport { default as AnimatedNumber } from './components/animated-number/AnimatedNumber';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport { default as DropdownBodyWrapper } from './components/dropdown-body-wrapper/DropdownBodyWrapper';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as HighlightSlider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu.types';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport {\n default as FileInput,\n type FileInputRef,\n STREAMINGSERVICE_FILE_TYPES,\n TSIMG_FILE_TYPES,\n} from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as GroupedImage } from './components/grouped-image/GroupedImage';\nexport { default as Icon, type IconProps } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n type ListItemRef,\n} from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as MultiActionButton } from './components/multi-action-button/MultiActionButton';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingContextMenu } from './components/sharing-context-menu/SharingContextMenu';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as SharingButton } from './components/sharing-button/SharingButton';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport type { Tag } from './types/tagInput';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport type { TagInputRef } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/element';\nexport type { BrowserName } from './types/chayns';\nexport { ContentCardType } from './types/contentCard';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport {\n type MultiActionButtonAction,\n type MultiActionButtonActionEvent,\n type MultiActionButtonActionStatus,\n MultiActionButtonHeight,\n type MultiActionButtonProps,\n MultiActionButtonStatusType,\n} from './components/multi-action-button/MultiActionButton.types';\nexport { ClampPosition } from './types/truncation';\nexport { useIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\nexport type { Theme } from './components/color-scheme-provider/ColorSchemeProvider';\nexport { ComboBoxSize } from './components/combobox/ComboBox.types';\nexport type {\n IComboBoxItem as ComboBoxItem,\n ComboBoxTextStyles,\n IComboBoxItems as ComboBoxItems,\n ComboBoxRef,\n} from './components/combobox/ComboBox.types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,eAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,kBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,oBAAA,GAAAC,uBAA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,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;AAAA,SAAAhF,uBAAA+E,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAK,UAAA,GAAAL,CAAA,KAAAU,OAAA,EAAAV,CAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"calculate.js","names":["_chaynsApi","require","_react","_interopRequireDefault","_server","_ColorSchemeProvider","e","__esModule","default","calculateMaxComboBoxItemWidth","functions","list","shouldShowBigImage","values","length","forEach","icons","imageUrl","rightElement","subtext","suffixElement","text","textStyles","tagName","styles","div","document","createElement","Object","assign","style","display","gap","position","visibility","whiteSpace","width","body","appendChild","innerText","innerHTML","renderToString","ChaynsProvider","data","isModule","offsetWidth","trim","push","removeChild","Math","max","apply","exports","calculateBiggestWidth","elements","container","padding","id","element","accessKey","calculateContentHeight","heights","offsetHeight","reduce","partialSum","a","getHeightOfSingleTextLine","height","getBoundingClientRect","getMaxHeightInPixels","maxHeight","rootElement","tempElement"],"sources":["../../../src/utils/calculate.tsx"],"sourcesContent":["import { ChaynsProvider, ChaynsReactFunctions, ChaynsReactValues } from 'chayns-api';\nimport React, { type CSSProperties } from 'react';\nimport { renderToString } from 'react-dom/server';\nimport ColorSchemeProvider from '../components/color-scheme-provider/ColorSchemeProvider';\nimport type { IComboBoxItem } from '../components/combobox/ComboBox';\nimport type { SliderButtonItem } from '../types/slider-button';\n\ninterface CalculateMaxComboBoxItemWidthOptions {\n functions: ChaynsReactFunctions;\n list: IComboBoxItem[];\n shouldShowBigImage?: boolean;\n values: ChaynsReactValues;\n}\n\nexport const calculateMaxComboBoxItemWidth = ({\n functions,\n list,\n shouldShowBigImage,\n values,\n}: CalculateMaxComboBoxItemWidthOptions) => {\n const length: number[] = [];\n\n list.forEach(({ icons, imageUrl, rightElement, subtext, suffixElement, text, textStyles }) => {\n const tagName = textStyles?.tagName ?? 'div';\n const styles = textStyles?.styles;\n\n const div = document.createElement(tagName);\n\n if (styles) {\n Object.assign(div.style, styles);\n }\n\n div.style.display = 'flex';\n div.style.gap = '10px';\n div.style.position = 'absolute';\n div.style.visibility = 'hidden';\n div.style.whiteSpace = 'nowrap';\n div.style.width = 'auto';\n\n document.body.appendChild(div);\n\n div.innerText = text;\n\n if (rightElement) {\n // ColorSchemeProvider is used to prevent missing scheme context error.\n // Due to the fact that the element is never rendered visible, the values are irrelevant.\n div.innerHTML += renderToString(\n <ChaynsProvider data={values} functions={functions} isModule>\n <ColorSchemeProvider>{rightElement}</ColorSchemeProvider>\n </ChaynsProvider>,\n );\n }\n\n if (suffixElement) {\n // ColorSchemeProvider is used to prevent missing scheme context error.\n // Due to the fact that the element is never rendered visible, the values are irrelevant.\n div.innerHTML += renderToString(\n <ChaynsProvider data={values} functions={functions} isModule>\n <ColorSchemeProvider>{suffixElement}</ColorSchemeProvider>\n </ChaynsProvider>,\n );\n }\n\n let width = div.offsetWidth;\n\n if (icons && icons.length > 0) {\n width += 20 + 10; // icon width + gap\n }\n\n if (imageUrl) {\n width +=\n (shouldShowBigImage || (typeof subtext === 'string' && subtext.trim() !== '')\n ? 40\n : 22) + 10; // image width + gap\n }\n\n length.push(width);\n\n document.body.removeChild(div);\n });\n\n return Math.max.apply(null, length);\n};\n\nexport const calculateBiggestWidth = (elements: SliderButtonItem[]) => {\n const container = document.createElement('div');\n\n container.style.visibility = 'hidden';\n container.style.position = 'absolute';\n container.style.width = 'auto';\n container.style.whiteSpace = 'nowrap';\n container.style.padding = '7px 12px';\n container.style.display = 'block';\n\n elements.forEach(({ text, id }) => {\n const element = document.createElement('div');\n\n element.accessKey = `slider-button-pseudo--${id}`;\n element.innerText = text;\n\n container.appendChild(element);\n });\n\n document.body.appendChild(container);\n\n const width = container.offsetWidth;\n\n document.body.removeChild(container);\n\n return width;\n};\n\nexport const calculateContentHeight = (elements: string[]) => {\n const heights: number[] = [];\n\n elements.forEach((element: string) => {\n const div = document.createElement('div');\n\n div.style.visibility = 'hidden';\n div.style.position = 'absolute';\n div.style.width = 'auto';\n div.style.padding = '4px 10px';\n div.style.whiteSpace = 'nowrap';\n\n document.body.appendChild(div);\n\n div.innerText = element;\n\n heights.push(div.offsetHeight);\n\n document.body.removeChild(div);\n });\n\n return heights.reduce((partialSum, a) => partialSum + a, 0);\n};\n\ninterface GetHeightOfSingleTextLineOptions {\n container: Element;\n}\n\nexport const getHeightOfSingleTextLine = ({ container }: GetHeightOfSingleTextLineOptions) => {\n const div = document.createElement('div');\n\n div.style.visibility = 'hidden';\n div.style.position = 'absolute';\n div.style.whiteSpace = 'nowrap';\n\n div.innerText = 'Single text line';\n\n container.appendChild(div);\n\n const { height } = div.getBoundingClientRect();\n\n container.removeChild(div);\n\n return height;\n};\n\nexport const getMaxHeightInPixels = (\n maxHeight: CSSProperties['maxHeight'],\n rootElement: Element,\n): number => {\n const tempElement = document.createElement('div');\n\n tempElement.style.position = 'absolute';\n tempElement.style.visibility = 'hidden';\n tempElement.style.height = '100vh';\n tempElement.style.maxHeight = maxHeight as string;\n\n rootElement.appendChild(tempElement);\n\n const { height } = tempElement.getBoundingClientRect();\n\n rootElement.removeChild(tempElement);\n\n return height;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAA0F,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,C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AC1C,KAAK,CAACI,UAAU,GAAG,QAAQ;EACvCsC,WAAW,CAAC1C,KAAK,CAACqC,MAAM,GAAG,OAAO;EAClCK,WAAW,CAAC1C,KAAK,CAACwC,SAAS,GAAGA,SAAmB;EAEjDC,WAAW,CAACjC,WAAW,CAACkC,WAAW,CAAC;EAEpC,MAAM;IAAEL;EAAO,CAAC,GAAGK,WAAW,CAACJ,qBAAqB,CAAC,CAAC;EAEtDG,WAAW,CAACvB,WAAW,CAACwB,WAAW,CAAC;EAEpC,OAAOL,MAAM;AACjB,CAAC;AAACf,OAAA,CAAAiB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"file":"calculate.js","names":["_chaynsApi","require","_react","_interopRequireDefault","_server","_ColorSchemeProvider","e","__esModule","default","calculateMaxComboBoxItemWidth","functions","list","shouldShowBigImage","values","length","forEach","icons","imageUrl","rightElement","subtext","suffixElement","text","textStyles","tagName","styles","div","document","createElement","Object","assign","style","display","gap","position","visibility","whiteSpace","width","body","appendChild","innerText","innerHTML","renderToString","ChaynsProvider","data","isModule","offsetWidth","trim","push","removeChild","Math","max","apply","exports","calculateBiggestWidth","elements","container","padding","id","element","accessKey","calculateContentHeight","heights","offsetHeight","reduce","partialSum","a","getHeightOfSingleTextLine","height","getBoundingClientRect","getMaxHeightInPixels","maxHeight","rootElement","tempElement"],"sources":["../../../src/utils/calculate.tsx"],"sourcesContent":["import { ChaynsProvider, ChaynsReactFunctions, ChaynsReactValues } from 'chayns-api';\nimport React, { type CSSProperties } from 'react';\nimport { renderToString } from 'react-dom/server';\nimport ColorSchemeProvider from '../components/color-scheme-provider/ColorSchemeProvider';\nimport type { SliderButtonItem } from '../types/slider-button';\nimport { IComboBoxItem } from '../components/combobox/ComboBox.types';\n\ninterface CalculateMaxComboBoxItemWidthOptions {\n functions: ChaynsReactFunctions;\n list: IComboBoxItem[];\n shouldShowBigImage?: boolean;\n values: ChaynsReactValues;\n}\n\nexport const calculateMaxComboBoxItemWidth = ({\n functions,\n list,\n shouldShowBigImage,\n values,\n}: CalculateMaxComboBoxItemWidthOptions) => {\n const length: number[] = [];\n\n list.forEach(({ icons, imageUrl, rightElement, subtext, suffixElement, text, textStyles }) => {\n const tagName = textStyles?.tagName ?? 'div';\n const styles = textStyles?.styles;\n\n const div = document.createElement(tagName);\n\n if (styles) {\n Object.assign(div.style, styles);\n }\n\n div.style.display = 'flex';\n div.style.gap = '10px';\n div.style.position = 'absolute';\n div.style.visibility = 'hidden';\n div.style.whiteSpace = 'nowrap';\n div.style.width = 'auto';\n\n document.body.appendChild(div);\n\n div.innerText = text;\n\n if (rightElement) {\n // ColorSchemeProvider is used to prevent missing scheme context error.\n // Due to the fact that the element is never rendered visible, the values are irrelevant.\n div.innerHTML += renderToString(\n <ChaynsProvider data={values} functions={functions} isModule>\n <ColorSchemeProvider>{rightElement}</ColorSchemeProvider>\n </ChaynsProvider>,\n );\n }\n\n if (suffixElement) {\n // ColorSchemeProvider is used to prevent missing scheme context error.\n // Due to the fact that the element is never rendered visible, the values are irrelevant.\n div.innerHTML += renderToString(\n <ChaynsProvider data={values} functions={functions} isModule>\n <ColorSchemeProvider>{suffixElement}</ColorSchemeProvider>\n </ChaynsProvider>,\n );\n }\n\n let width = div.offsetWidth;\n\n if (icons && icons.length > 0) {\n width += 20 + 10; // icon width + gap\n }\n\n if (imageUrl) {\n width +=\n (shouldShowBigImage || (typeof subtext === 'string' && subtext.trim() !== '')\n ? 40\n : 22) + 10; // image width + gap\n }\n\n length.push(width);\n\n document.body.removeChild(div);\n });\n\n return Math.max.apply(null, length);\n};\n\nexport const calculateBiggestWidth = (elements: SliderButtonItem[]) => {\n const container = document.createElement('div');\n\n container.style.visibility = 'hidden';\n container.style.position = 'absolute';\n container.style.width = 'auto';\n container.style.whiteSpace = 'nowrap';\n container.style.padding = '7px 12px';\n container.style.display = 'block';\n\n elements.forEach(({ text, id }) => {\n const element = document.createElement('div');\n\n element.accessKey = `slider-button-pseudo--${id}`;\n element.innerText = text;\n\n container.appendChild(element);\n });\n\n document.body.appendChild(container);\n\n const width = container.offsetWidth;\n\n document.body.removeChild(container);\n\n return width;\n};\n\nexport const calculateContentHeight = (elements: string[]) => {\n const heights: number[] = [];\n\n elements.forEach((element: string) => {\n const div = document.createElement('div');\n\n div.style.visibility = 'hidden';\n div.style.position = 'absolute';\n div.style.width = 'auto';\n div.style.padding = '4px 10px';\n div.style.whiteSpace = 'nowrap';\n\n document.body.appendChild(div);\n\n div.innerText = element;\n\n heights.push(div.offsetHeight);\n\n document.body.removeChild(div);\n });\n\n return heights.reduce((partialSum, a) => partialSum + a, 0);\n};\n\ninterface GetHeightOfSingleTextLineOptions {\n container: Element;\n}\n\nexport const getHeightOfSingleTextLine = ({ container }: GetHeightOfSingleTextLineOptions) => {\n const div = document.createElement('div');\n\n div.style.visibility = 'hidden';\n div.style.position = 'absolute';\n div.style.whiteSpace = 'nowrap';\n\n div.innerText = 'Single text line';\n\n container.appendChild(div);\n\n const { height } = div.getBoundingClientRect();\n\n container.removeChild(div);\n\n return height;\n};\n\nexport const getMaxHeightInPixels = (\n maxHeight: CSSProperties['maxHeight'],\n rootElement: Element,\n): number => {\n const tempElement = document.createElement('div');\n\n tempElement.style.position = 'absolute';\n tempElement.style.visibility = 'hidden';\n tempElement.style.height = '100vh';\n tempElement.style.maxHeight = maxHeight as string;\n\n rootElement.appendChild(tempElement);\n\n const { height } = tempElement.getBoundingClientRect();\n\n rootElement.removeChild(tempElement);\n\n return height;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAA0F,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAWnF,MAAMG,6BAA6B,GAAGA,CAAC;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AACqC,MAAM,GAAG,OAAO;EAClCK,WAAW,CAAC1C,KAAK,CAACwC,SAAS,GAAGA,SAAmB;EAEjDC,WAAW,CAACjC,WAAW,CAACkC,WAAW,CAAC;EAEpC,MAAM;IAAEL;EAAO,CAAC,GAAGK,WAAW,CAACJ,qBAAqB,CAAC,CAAC;EAEtDG,WAAW,CAACvB,WAAW,CAACwB,WAAW,CAAC;EAEpC,OAAOL,MAAM;AACjB,CAAC;AAACf,OAAA,CAAAiB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -24,6 +24,7 @@ const formateNumber = ({
24
24
  isMoneyInput,
25
25
  isTimeInput
26
26
  }) => {
27
+ if (Number.isNaN(number)) return '';
27
28
  if (isTimeInput && typeof number === 'string') {
28
29
  let hours = 0;
29
30
  let minutes = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"numberInput.js","names":["_numberInput","require","parseFloatWithDecimals","stringValue","decimals","parsed","parseFloat","toFixed","exports","formateNumber","number","isMoneyInput","isTimeInput","hours","minutes","firstTwoDigits","substring","includes","replace","firstTwoNumbers","Number","lastTwoNumbers","lastTwoNumbersLength","length","hoursStr","minutesStr","toLocaleString","useGrouping","minimumFractionDigits","undefined","maximumFractionDigits","maximumSignificantDigits","isValidString","isDecimalInput","string","isValid","DECIMAL_TEST","test","MONEY_TEST","TIME_TEST","INTEGER_TEST","startsWith"],"sources":["../../../src/utils/numberInput.ts"],"sourcesContent":["import { DECIMAL_TEST, INTEGER_TEST, MONEY_TEST, TIME_TEST } from '../constants/numberInput';\n\ninterface ParseFloatWithDecimals {\n ({ stringValue, decimals }: { stringValue: string; decimals?: number }): number | null;\n}\n\nexport const parseFloatWithDecimals: ParseFloatWithDecimals = ({ stringValue, decimals }) => {\n if (stringValue === '') {\n return null;\n }\n\n const parsed = parseFloat(stringValue);\n\n if (decimals) {\n return parseFloat(parsed.toFixed(decimals));\n }\n\n return parsed;\n};\n\ninterface FormateNumberOptions {\n number: number | string | null;\n isMoneyInput?: boolean;\n isTimeInput?: boolean;\n}\n\nexport const formateNumber = ({ number, isMoneyInput, isTimeInput }: FormateNumberOptions) => {\n if (isTimeInput && typeof number === 'string') {\n let hours = 0;\n let minutes = 0;\n\n let firstTwoDigits = number.substring(0, 2);\n\n if (firstTwoDigits.includes(':')) {\n firstTwoDigits = firstTwoDigits.replace(':', '');\n\n firstTwoDigits = `0${firstTwoDigits}`;\n }\n\n const firstTwoNumbers = Number(firstTwoDigits);\n let lastTwoNumbers = 0;\n let lastTwoNumbersLength = 0;\n\n if (number.includes(':')) {\n lastTwoNumbers = Number(number.substring(3, 5));\n lastTwoNumbersLength = number.substring(3, 5).length;\n } else {\n lastTwoNumbers = Number(number.substring(2, 4));\n lastTwoNumbersLength = number.substring(2, 4).length;\n }\n\n hours = firstTwoNumbers > 23 ? 23 : firstTwoNumbers;\n\n if (lastTwoNumbers < 7 && lastTwoNumbersLength === 1) {\n minutes = lastTwoNumbers * 10;\n } else {\n minutes = lastTwoNumbers > 59 ? 59 : lastTwoNumbers;\n }\n\n const hoursStr = hours < 10 ? `0${hours}` : `${hours}`;\n const minutesStr = minutes < 10 ? `0${minutes}` : `${minutes}`;\n\n return `${hoursStr}:${minutesStr}`;\n }\n\n if (typeof number !== 'number') {\n return '';\n }\n\n return number.toLocaleString('de-DE', {\n useGrouping: true,\n minimumFractionDigits: isMoneyInput ? 2 : undefined,\n maximumFractionDigits: isMoneyInput ? 2 : undefined,\n maximumSignificantDigits: !isMoneyInput ? 20 : undefined,\n });\n};\n\ninterface IsValidString {\n (config: {\n string: string;\n isDecimalInput?: boolean;\n isMoneyInput?: boolean;\n isTimeInput?: boolean;\n }): boolean;\n}\n\nexport const isValidString: IsValidString = ({\n isDecimalInput,\n isMoneyInput,\n isTimeInput,\n string,\n}) => {\n let isValid = false;\n\n // Allows numbers, one (comma/point) and any number of decimal places\n if (isDecimalInput && DECIMAL_TEST.test(string)) {\n isValid = true;\n }\n\n // Allows numbers but excludes numbers with leading 0\n if (isMoneyInput && MONEY_TEST.test(string)) {\n isValid = true;\n }\n\n if (isTimeInput && TIME_TEST) {\n isValid = true;\n }\n\n // Allows numbers but excludes numbers with leading 0\n if (!isDecimalInput && !isMoneyInput && !isTimeInput && INTEGER_TEST.test(string)) {\n isValid = true;\n }\n\n if (string.length === 0) {\n isValid = true;\n }\n\n if (string.startsWith('0')) {\n isValid = true;\n }\n\n return isValid;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMO,MAAMC,sBAA8C,GAAGA,CAAC;EAAEC,WAAW;EAAEC;AAAS,CAAC,KAAK;EACzF,IAAID,WAAW,KAAK,EAAE,EAAE;IACpB,OAAO,IAAI;EACf;EAEA,MAAME,MAAM,GAAGC,UAAU,CAACH,WAAW,CAAC;EAEtC,IAAIC,QAAQ,EAAE;IACV,OAAOE,UAAU,CAACD,MAAM,CAACE,OAAO,CAACH,QAAQ,CAAC,CAAC;EAC/C;EAEA,OAAOC,MAAM;AACjB,CAAC;AAACG,OAAA,CAAAN,sBAAA,GAAAA,sBAAA;AAQK,MAAMO,aAAa,GAAGA,CAAC;EAAEC,MAAM;EAAEC,YAAY;EAAEC;AAAkC,CAAC,KAAK;EAC1F,IAAIA,WAAW,IAAI,OAAOF,MAAM,KAAK,QAAQ,EAAE;IAC3C,IAAIG,KAAK,GAAG,CAAC;IACb,IAAIC,OAAO,GAAG,CAAC;IAEf,IAAIC,cAAc,GAAGL,MAAM,CAACM,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;IAE3C,IAAID,cAAc,CAACE,QAAQ,CAAC,GAAG,CAAC,EAAE;MAC9BF,cAAc,GAAGA,cAAc,CAACG,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;MAEhDH,cAAc,GAAG,IAAIA,cAAc,EAAE;IACzC;IAEA,MAAMI,eAAe,GAAGC,MAAM,CAACL,cAAc,CAAC;IAC9C,IAAIM,cAAc,GAAG,CAAC;IACtB,IAAIC,oBAAoB,GAAG,CAAC;IAE5B,IAAIZ,M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,CAAC;AACN,CAAC;AAACrB,OAAA,CAAAC,aAAA,GAAAA,aAAA;AAWK,MAAMuB,aAA4B,GAAGA,CAAC;EACzCC,cAAc;EACdtB,YAAY;EACZC,WAAW;EACXsB;AACJ,CAAC,KAAK;EACF,IAAIC,OAAO,GAAG,KAAK;;EAEnB;EACA,IAAIF,cAAc,IAAIG,yBAAY,CAACC,IAAI,CAACH,MAAM,CAAC,EAAE;IAC7CC,OAAO,GAAG,IAAI;EAClB;;EAEA;EACA,IAAIxB,YAAY,IAAI2B,uBAAU,CAACD,IAAI,CAACH,MAAM,CAAC,EAAE;IACzCC,OAAO,GAAG,IAAI;EAClB;EAEA,IAAIvB,WAAW,IAAI2B,sBAAS,EAAE;IAC1BJ,OAAO,GAAG,IAAI;EAClB;;EAEA;EACA,IAAI,CAACF,cAAc,IAAI,CAACtB,YAAY,IAAI,CAACC,WAAW,IAAI4B,yBAAY,CAACH,IAAI,CAACH,MAAM,CAAC,EAAE;IAC/EC,OAAO,GAAG,IAAI;EAClB;EAEA,IAAID,MAAM,CAACX,MAAM,KAAK,CAAC,EAAE;IACrBY,OAAO,GAAG,IAAI;EAClB;EAEA,IAAID,MAAM,CAACO,UAAU,CAAC,GAAG,CAAC,EAAE;IACxBN,OAAO,GAAG,IAAI;EAClB;EAEA,OAAOA,OAAO;AAClB,CAAC;AAAC3B,OAAA,CAAAwB,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"file":"numberInput.js","names":["_numberInput","require","parseFloatWithDecimals","stringValue","decimals","parsed","parseFloat","toFixed","exports","formateNumber","number","isMoneyInput","isTimeInput","Number","isNaN","hours","minutes","firstTwoDigits","substring","includes","replace","firstTwoNumbers","lastTwoNumbers","lastTwoNumbersLength","length","hoursStr","minutesStr","toLocaleString","useGrouping","minimumFractionDigits","undefined","maximumFractionDigits","maximumSignificantDigits","isValidString","isDecimalInput","string","isValid","DECIMAL_TEST","test","MONEY_TEST","TIME_TEST","INTEGER_TEST","startsWith"],"sources":["../../../src/utils/numberInput.ts"],"sourcesContent":["import { DECIMAL_TEST, INTEGER_TEST, MONEY_TEST, TIME_TEST } from '../constants/numberInput';\n\ninterface ParseFloatWithDecimals {\n ({ stringValue, decimals }: { stringValue: string; decimals?: number }): number | null;\n}\n\nexport const parseFloatWithDecimals: ParseFloatWithDecimals = ({ stringValue, decimals }) => {\n if (stringValue === '') {\n return null;\n }\n\n const parsed = parseFloat(stringValue);\n\n if (decimals) {\n return parseFloat(parsed.toFixed(decimals));\n }\n\n return parsed;\n};\n\ninterface FormateNumberOptions {\n number: number | string | null;\n isMoneyInput?: boolean;\n isTimeInput?: boolean;\n}\n\nexport const formateNumber = ({ number, isMoneyInput, isTimeInput }: FormateNumberOptions) => {\n if (Number.isNaN(number)) return '';\n if (isTimeInput && typeof number === 'string') {\n let hours = 0;\n let minutes = 0;\n\n let firstTwoDigits = number.substring(0, 2);\n\n if (firstTwoDigits.includes(':')) {\n firstTwoDigits = firstTwoDigits.replace(':', '');\n\n firstTwoDigits = `0${firstTwoDigits}`;\n }\n\n const firstTwoNumbers = Number(firstTwoDigits);\n let lastTwoNumbers = 0;\n let lastTwoNumbersLength = 0;\n\n if (number.includes(':')) {\n lastTwoNumbers = Number(number.substring(3, 5));\n lastTwoNumbersLength = number.substring(3, 5).length;\n } else {\n lastTwoNumbers = Number(number.substring(2, 4));\n lastTwoNumbersLength = number.substring(2, 4).length;\n }\n\n hours = firstTwoNumbers > 23 ? 23 : firstTwoNumbers;\n\n if (lastTwoNumbers < 7 && lastTwoNumbersLength === 1) {\n minutes = lastTwoNumbers * 10;\n } else {\n minutes = lastTwoNumbers > 59 ? 59 : lastTwoNumbers;\n }\n\n const hoursStr = hours < 10 ? `0${hours}` : `${hours}`;\n const minutesStr = minutes < 10 ? `0${minutes}` : `${minutes}`;\n\n return `${hoursStr}:${minutesStr}`;\n }\n\n if (typeof number !== 'number') {\n return '';\n }\n\n return number.toLocaleString('de-DE', {\n useGrouping: true,\n minimumFractionDigits: isMoneyInput ? 2 : undefined,\n maximumFractionDigits: isMoneyInput ? 2 : undefined,\n maximumSignificantDigits: !isMoneyInput ? 20 : undefined,\n });\n};\n\ninterface IsValidString {\n (config: {\n string: string;\n isDecimalInput?: boolean;\n isMoneyInput?: boolean;\n isTimeInput?: boolean;\n }): boolean;\n}\n\nexport const isValidString: IsValidString = ({\n isDecimalInput,\n isMoneyInput,\n isTimeInput,\n string,\n}) => {\n let isValid = false;\n\n // Allows numbers, one (comma/point) and any number of decimal places\n if (isDecimalInput && DECIMAL_TEST.test(string)) {\n isValid = true;\n }\n\n // Allows numbers but excludes numbers with leading 0\n if (isMoneyInput && MONEY_TEST.test(string)) {\n isValid = true;\n }\n\n if (isTimeInput && TIME_TEST) {\n isValid = true;\n }\n\n // Allows numbers but excludes numbers with leading 0\n if (!isDecimalInput && !isMoneyInput && !isTimeInput && INTEGER_TEST.test(string)) {\n isValid = true;\n }\n\n if (string.length === 0) {\n isValid = true;\n }\n\n if (string.startsWith('0')) {\n isValid = true;\n }\n\n return isValid;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMO,MAAMC,sBAA8C,GAAGA,CAAC;EAAEC,WAAW;EAAEC;AAAS,CAAC,KAAK;EACzF,IAAID,WAAW,KAAK,EAAE,EAAE;IACpB,OAAO,IAAI;EACf;EAEA,MAAME,MAAM,GAAGC,UAAU,CAACH,WAAW,CAAC;EAEtC,IAAIC,QAAQ,EAAE;IACV,OAAOE,UAAU,CAACD,MAAM,CAACE,OAAO,CAACH,QAAQ,CAAC,CAAC;EAC/C;EAEA,OAAOC,MAAM;AACjB,CAAC;AAACG,OAAA,CAAAN,sBAAA,GAAAA,sBAAA;AAQK,MAAMO,aAAa,GAAGA,CAAC;EAAEC,MAAM;EAAEC,YAAY;EAAEC;AAAkC,CAAC,KAAK;EAC1F,IAAIC,MAAM,CAACC,KAAK,CAACJ,MAAM,CAAC,EAAE,OAAO,EAAE;EACnC,IAAIE,WAAW,IAAI,OAAO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,EAAE;IACxBN,OAAO,GAAG,IAAI;EAClB;EAEA,OAAOA,OAAO;AAClB,CAAC;AAAC5B,OAAA,CAAAyB,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { getDevice } from 'chayns-api';
2
1
  import React, { useMemo } from 'react';
3
2
  import { AccordionGroupContext } from '../accordion-group/AccordionGroup';
4
3
  import { StyledMotionAccordionBody } from './AccordionBody.styles';
@@ -10,9 +9,6 @@ const AccordionBody = ({
10
9
  shouldSkipAnimation,
11
10
  onAnimationComplete
12
11
  }) => {
13
- const {
14
- browser
15
- } = getDevice();
16
12
  const AccordionGroupContextProviderValue = useMemo(() => ({
17
13
  openAccordionUuid: undefined
18
14
  }), []);
@@ -45,9 +41,8 @@ const AccordionBody = ({
45
41
  duration: 0.25
46
42
  }
47
43
  },
48
- className: "beta-chayns-accordion-body",
44
+ className: "beta-chayns-accordion-body chayns-scrollbar",
49
45
  $maxHeight: maxHeight,
50
- $browser: browser?.name,
51
46
  onAnimationComplete: onAnimationComplete,
52
47
  onScroll: onScroll
53
48
  }, /*#__PURE__*/React.createElement(AccordionGroupContext.Provider, {
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionBody.js","names":["getDevice","React","useMemo","AccordionGroupContext","StyledMotionAccordionBody","AccordionBody","children","maxHeight","onScroll","shouldHideBody","shouldSkipAnimation","onAnimationComplete","browser","AccordionGroupContextProviderValue","openAccordionUuid","undefined","createElement","initial","height","opacity","animate","exit","transition","duration","ease","className","$maxHeight","$browser","name","Provider","value","displayName"],"sources":["../../../../../src/components/accordion/accordion-body/AccordionBody.tsx"],"sourcesContent":["import { getDevice } from 'chayns-api';\nimport React, { FC, ReactNode, UIEvent, useMemo } from 'react';\nimport { BrowserName } from '../../../types/chayns';\nimport type { AccordionProps } from '../Accordion';\nimport { AccordionGroupContext } from '../accordion-group/AccordionGroup';\nimport { StyledMotionAccordionBody } from './AccordionBody.styles';\n\nexport type AccordionBodyProps = {\n /**\n * The elements that should be shown inside the body.\n */\n children: ReactNode;\n /**\n * Maximum height of the element. This automatically makes the content of the element scrollable.\n */\n maxHeight: AccordionProps['bodyMaxHeight'];\n /**\n * Function that is executed when the element will be scrolled\n */\n onScroll?: (event: UIEvent<HTMLDivElement>) => void;\n /**\n * Whether the body should be shown.\n */\n shouldHideBody: boolean;\n /**\n * Whether the animation should be skipped.\n */\n shouldSkipAnimation?: boolean;\n\n onAnimationComplete?: VoidFunction;\n};\n\nconst AccordionBody: FC<AccordionBodyProps> = ({\n children,\n maxHeight,\n onScroll,\n shouldHideBody,\n shouldSkipAnimation,\n onAnimationComplete,\n}) => {\n const { browser } = getDevice();\n\n const AccordionGroupContextProviderValue = useMemo(\n () => ({ openAccordionUuid: undefined }),\n [],\n );\n\n return (\n <StyledMotionAccordionBody\n initial={\n shouldSkipAnimation ? { height: 'auto', opacity: 1 } : { height: 0, opacity: 0 }\n }\n animate={{ height: shouldHideBody ? 0 : 'auto', opacity: shouldHideBody ? 0 : 1 }}\n exit={{ height: 0, opacity: 0 }}\n transition={{\n height: shouldSkipAnimation ? { duration: 0, ease: 'linear' } : { duration: 0.25 },\n opacity: shouldSkipAnimation ? { duration: 0 } : { duration: 0.25 },\n }}\n className=\"beta-chayns-accordion-body\"\n $maxHeight={maxHeight}\n $browser={browser?.name as BrowserName}\n onAnimationComplete={onAnimationComplete}\n onScroll={onScroll}\n >\n <AccordionGroupContext.Provider value={AccordionGroupContextProviderValue}>\n {children}\n </AccordionGroupContext.Provider>\n </StyledMotionAccordionBody>\n );\n};\n\nAccordionBody.displayName = 'AccordionBody';\n\nexport default AccordionBody;\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,YAAY;AACtC,OAAOC,KAAK,IAA4BC,OAAO,QAAQ,OAAO;AAG9D,SAASC,qBAAqB,QAAQ,mCAAmC;AACzE,SAASC,yBAAyB,QAAQ,wBAAwB;AA2BlE,MAAMC,aAAqC,GAAGA,CAAC;EAC3CC,QAAQ;EACRC,SAAS;EACTC,QA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":[]}
1
+ {"version":3,"file":"AccordionBody.js","names":["React","useMemo","AccordionGroupContext","StyledMotionAccordionBody","AccordionBody","children","maxHeight","onScroll","shouldHideBody","shouldSkipAnimation","onAnimationComplete","AccordionGroupContextProviderValue","openAccordionUuid","undefined","createElement","initial","height","opacity","animate","exit","transition","duration","ease","className","$maxHeight","Provider","value","displayName"],"sources":["../../../../../src/components/accordion/accordion-body/AccordionBody.tsx"],"sourcesContent":["import React, { FC, ReactNode, UIEvent, useMemo } from 'react';\nimport type { AccordionProps } from '../Accordion';\nimport { AccordionGroupContext } from '../accordion-group/AccordionGroup';\nimport { StyledMotionAccordionBody } from './AccordionBody.styles';\n\nexport type AccordionBodyProps = {\n /**\n * The elements that should be shown inside the body.\n */\n children: ReactNode;\n /**\n * Maximum height of the element. This automatically makes the content of the element scrollable.\n */\n maxHeight: AccordionProps['bodyMaxHeight'];\n /**\n * Function that is executed when the element will be scrolled\n */\n onScroll?: (event: UIEvent<HTMLDivElement>) => void;\n /**\n * Whether the body should be shown.\n */\n shouldHideBody: boolean;\n /**\n * Whether the animation should be skipped.\n */\n shouldSkipAnimation?: boolean;\n\n onAnimationComplete?: VoidFunction;\n};\n\nconst AccordionBody: FC<AccordionBodyProps> = ({\n children,\n maxHeight,\n onScroll,\n shouldHideBody,\n shouldSkipAnimation,\n onAnimationComplete,\n}) => {\n const AccordionGroupContextProviderValue = useMemo(\n () => ({ openAccordionUuid: undefined }),\n [],\n );\n\n return (\n <StyledMotionAccordionBody\n initial={\n shouldSkipAnimation ? { height: 'auto', opacity: 1 } : { height: 0, opacity: 0 }\n }\n animate={{ height: shouldHideBody ? 0 : 'auto', opacity: shouldHideBody ? 0 : 1 }}\n exit={{ height: 0, opacity: 0 }}\n transition={{\n height: shouldSkipAnimation ? { duration: 0, ease: 'linear' } : { duration: 0.25 },\n opacity: shouldSkipAnimation ? { duration: 0 } : { duration: 0.25 },\n }}\n className=\"beta-chayns-accordion-body chayns-scrollbar\"\n $maxHeight={maxHeight}\n onAnimationComplete={onAnimationComplete}\n onScroll={onScroll}\n >\n <AccordionGroupContext.Provider value={AccordionGroupContextProviderValue}>\n {children}\n </AccordionGroupContext.Provider>\n </StyledMotionAccordionBody>\n );\n};\n\nAccordionBody.displayName = 'AccordionBody';\n\nexport default AccordionBody;\n"],"mappings":"AAAA,OAAOA,KAAK,IAA4BC,OAAO,QAAQ,OAAO;AAE9D,SAASC,qBAAqB,QAAQ,mCAAmC;AACzE,SAASC,yBAAyB,QAAQ,wBAAwB;AA2BlE,MAAMC,aAAqC,GAAGA,CAAC;EAC3CC,QAAQ;EACRC,SAAS;EACTC,QAAQ;EACRC,cAAc;EACdC,mBAAmB;EACnBC;AACJ,CAAC,KAAK;EACF,MAAMC,kCAAkC,GAAGV,OAAO,CAC9C,OAAO;IAAEW,iBAAiB,EAAEC;EAAU,CAAC,CAAC,EACxC,EACJ,CAAC;EAED,oBACIb,KAAA,CAAAc,aAAA,CAACX,yBAAyB;IACtBY,OAAO,EACHN,mBAAmB,GAAG;MAAEO,MAAM,EAAE,MAAM;MAAEC,OAAO,EAAE;IAAE,CAAC,GAAG;MAAED,MAAM,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAE,CAClF;IACDC,OAAO,EAAE;MAAEF,MAAM,EAAER,cAAc,GAAG,CAAC,GAAG,MAAM;MAAES,OAAO,EAAET,cAAc,GAAG,CAAC,GAAG;IAAE,CAAE;IAClFW,IAAI,EAAE;MAAEH,MAAM,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAE,CAAE;IAChCG,UAAU,EAAE;MACRJ,MAAM,EAAEP,mBAAmB,GAAG;QAAEY,QAAQ,EAAE,CAAC;QAAEC,IAAI,EAAE;MAAS,CAAC,GAAG;QAAED,QAAQ,EAAE;MAAK,CAAC;MAClFJ,OAAO,EAAER,mBAAmB,GAAG;QAAEY,QAAQ,EAAE;MAAE,CAAC,GAAG;QAAEA,QAAQ,EAAE;MAAK;IACtE,CAAE;IACFE,SAAS,EAAC,6CAA6C;IACvDC,UAAU,EAAElB,SAAU;IACtBI,mBAAmB,EAAEA,mBAAoB;IACzCH,QAAQ,EAAEA;EAAS,gBAEnBP,KAAA,CAAAc,aAAA,CAACZ,qBAAqB,CAACuB,QAAQ;IAACC,KAAK,EAAEf;EAAmC,GACrEN,QAC2B,CACT,CAAC;AAEpC,CAAC;AAEDD,aAAa,CAACuB,WAAW,GAAG,eAAe;AAE3C,eAAevB,aAAa","ignoreList":[]}
@@ -10,32 +10,5 @@ export const StyledMotionAccordionBody = styled(motion.div)`
10
10
  max-height: ${$maxHeight}px;
11
11
  overflow-y: scroll;
12
12
  `}
13
-
14
- // Styles for custom scrollbar
15
- ${({
16
- $browser,
17
- theme
18
- }) => $browser === 'firefox' ? css`
19
- scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
20
- scrollbar-width: thin;
21
- ` : css`
22
- &::-webkit-scrollbar {
23
- width: 5px;
24
- }
25
-
26
- &::-webkit-scrollbar-track {
27
- background-color: transparent;
28
- }
29
-
30
- &::-webkit-scrollbar-button {
31
- background-color: transparent;
32
- height: 5px;
33
- }
34
-
35
- &::-webkit-scrollbar-thumb {
36
- background-color: rgba(${theme['text-rgb']}, 0.15);
37
- border-radius: 20px;
38
- }
39
- `}
40
13
  `;
41
14
  //# sourceMappingURL=AccordionBody.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionBody.styles.js","names":["motion","styled","css","StyledMotionAccordionBody","div","$maxHeight","$browser","theme"],"sources":["../../../../../src/components/accordion/accordion-body/AccordionBody.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\ntype StyledMotionAccordionBodyProps = WithTheme<{\n $maxHeight?: number;\n $browser: BrowserName;\n}>;\n\nexport const StyledMotionAccordionBody = styled(motion.div)<StyledMotionAccordionBodyProps>`\n overflow: hidden;\n transition: none !important;\n\n ${({ $maxHeight }) =>\n typeof $maxHeight === 'number' &&\n css`\n max-height: ${$maxHeight}px;\n overflow-y: scroll;\n `}\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledMotionAccordionBodyProps) =>\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,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAS/C,OAAO,MAAMC,yBAAyB,GAAGF,MAAM,CAACD,MAAM,CAACI,GAAG,CAAiC;AAC3F;AACA;AACA;AACA,MAAM,CAAC;EAAEC;AAAW,CAAC,KACb,OAAOA,UAAU,KAAK,QAAQ,IAC9BH,GAAG;AACX,0BAA0BG,UAAU;AACpC;AACA,SAAS;AACT;AACA;AACA,MAAM,CAAC;EAAEC,QAAQ;EAAEC;AAAsC,CAAC,KAClDD,QAAQ,KAAK,SAAS,GAChBJ,GAAG;AACjB,0CAA0CK,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACDL,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CK,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AACf,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"AccordionBody.styles.js","names":["motion","styled","css","StyledMotionAccordionBody","div","$maxHeight"],"sources":["../../../../../src/components/accordion/accordion-body/AccordionBody.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledMotionAccordionBodyProps = WithTheme<{\n $maxHeight?: number;\n}>;\n\nexport const StyledMotionAccordionBody = styled(motion.div)<StyledMotionAccordionBodyProps>`\n overflow: hidden;\n transition: none !important;\n\n ${({ $maxHeight }) =>\n typeof $maxHeight === 'number' &&\n css`\n max-height: ${$maxHeight}px;\n overflow-y: scroll;\n `}\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAO/C,OAAO,MAAMC,yBAAyB,GAAGF,MAAM,CAACD,MAAM,CAACI,GAAG,CAAiC;AAC3F;AACA;AACA;AACA,MAAM,CAAC;EAAEC;AAAW,CAAC,KACb,OAAOA,UAAU,KAAK,QAAQ,IAC9BH,GAAG;AACX,0BAA0BG,UAAU;AACpC;AACA,SAAS;AACT,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { getDevice } from 'chayns-api';
2
1
  import React from 'react';
3
2
  import { StyledAccordionContent } from './AccordionContent.styles';
4
3
  const AccordionContent = ({
@@ -6,18 +5,12 @@ const AccordionContent = ({
6
5
  maxHeight,
7
6
  onScroll,
8
7
  shouldPreventBottomSpace = false
9
- }) => {
10
- const {
11
- browser
12
- } = getDevice();
13
- return /*#__PURE__*/React.createElement(StyledAccordionContent, {
14
- className: "beta-chayns-accordion-content",
15
- $browser: browser?.name,
16
- $maxHeight: maxHeight,
17
- onScroll: onScroll,
18
- $shouldPreventBottomSpace: shouldPreventBottomSpace
19
- }, children);
20
- };
8
+ }) => /*#__PURE__*/React.createElement(StyledAccordionContent, {
9
+ className: "beta-chayns-accordion-content chayns-scrollbar",
10
+ $maxHeight: maxHeight,
11
+ onScroll: onScroll,
12
+ $shouldPreventBottomSpace: shouldPreventBottomSpace
13
+ }, children);
21
14
  AccordionContent.displayName = 'AccordionContent';
22
15
  export default AccordionContent;
23
16
  //# sourceMappingURL=AccordionContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionContent.js","names":["getDevice","React","StyledAccordionContent","AccordionContent","children","maxHeight","onScroll","shouldPreventBottomSpace","browser","createElement","className","$browser","name","$maxHeight","$shouldPreventBottomSpace","displayName"],"sources":["../../../../../src/components/accordion/accordion-content/AccordionContent.tsx"],"sourcesContent":["import { getDevice } from 'chayns-api';\nimport React, { FC, ReactNode, UIEvent } from 'react';\nimport { BrowserName } from '../../../types/chayns';\nimport { StyledAccordionContent } from './AccordionContent.styles';\n\nexport type AccordionContentProps = {\n /**\n * The content of the accordion content element\n */\n children: ReactNode;\n /**\n * Maximum height of the element. This automatically makes the content of the element scrollable.\n */\n maxHeight?: number;\n /**\n * Function that is executed when the element will be scrolled\n */\n onScroll?: (event: UIEvent<HTMLDivElement>) => void;\n /**\n * Whether the bottom space should be removed.\n */\n shouldPreventBottomSpace?: boolean;\n};\n\nconst AccordionContent: FC<AccordionContentProps> = ({\n children,\n maxHeight,\n onScroll,\n shouldPreventBottomSpace = false,\n}) => {\n const { browser } = getDevice();\n\n return (\n <StyledAccordionContent\n className=\"beta-chayns-accordion-content\"\n $browser={browser?.name as BrowserName}\n $maxHeight={maxHeight}\n onScroll={onScroll}\n $shouldPreventBottomSpace={shouldPreventBottomSpace}\n >\n {children}\n </StyledAccordionContent>\n );\n};\n\nAccordionContent.displayName = 'AccordionContent';\n\nexport default AccordionContent;\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,YAAY;AACtC,OAAOC,KAAK,MAAkC,OAAO;AAErD,SAASC,sBAAsB,QAAQ,2BAA2B;AAqBlE,MAAMC,gBAA2C,GAAGA,CAAC;EACjDC,QAAQ;EACRC,SAAS;EACTC,QAAQ;EACRC,wBAAwB,GAAG;AAC/B,CAAC,KAAK;EACF,MAAM;IAAEC;EAAQ,CAAC,GAAGR,SAAS,CAAC,CAAC;EAE/B,oBACIC,KAAA,CAAAQ,aAAA,CAACP,sBAAsB;IACnBQ,SAAS,EAAC,+BAA+B;IACzCC,QAAQ,EAAEH,OAAO,EAAEI,IAAoB;IACvCC,UAAU,EAAER,SAAU;IACtBC,QAAQ,EAAEA,QAAS;IACnBQ,yBAAyB,EAAEP;EAAyB,GAEnDH,QACmB,CAAC;AAEjC,CAAC;AAEDD,gBAAgB,CAACY,WAAW,GAAG,kBAAkB;AAEjD,eAAeZ,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"AccordionContent.js","names":["React","StyledAccordionContent","AccordionContent","children","maxHeight","onScroll","shouldPreventBottomSpace","createElement","className","$maxHeight","$shouldPreventBottomSpace","displayName"],"sources":["../../../../../src/components/accordion/accordion-content/AccordionContent.tsx"],"sourcesContent":["import React, { FC, ReactNode, UIEvent } from 'react';\nimport { StyledAccordionContent } from './AccordionContent.styles';\n\nexport type AccordionContentProps = {\n /**\n * The content of the accordion content element\n */\n children: ReactNode;\n /**\n * Maximum height of the element. This automatically makes the content of the element scrollable.\n */\n maxHeight?: number;\n /**\n * Function that is executed when the element will be scrolled\n */\n onScroll?: (event: UIEvent<HTMLDivElement>) => void;\n /**\n * Whether the bottom space should be removed.\n */\n shouldPreventBottomSpace?: boolean;\n};\n\nconst AccordionContent: FC<AccordionContentProps> = ({\n children,\n maxHeight,\n onScroll,\n shouldPreventBottomSpace = false,\n}) => (\n <StyledAccordionContent\n className=\"beta-chayns-accordion-content chayns-scrollbar\"\n $maxHeight={maxHeight}\n onScroll={onScroll}\n $shouldPreventBottomSpace={shouldPreventBottomSpace}\n >\n {children}\n </StyledAccordionContent>\n);\n\nAccordionContent.displayName = 'AccordionContent';\n\nexport default AccordionContent;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAkC,OAAO;AACrD,SAASC,sBAAsB,QAAQ,2BAA2B;AAqBlE,MAAMC,gBAA2C,GAAGA,CAAC;EACjDC,QAAQ;EACRC,SAAS;EACTC,QAAQ;EACRC,wBAAwB,GAAG;AAC/B,CAAC,kBACGN,KAAA,CAAAO,aAAA,CAACN,sBAAsB;EACnBO,SAAS,EAAC,gDAAgD;EAC1DC,UAAU,EAAEL,SAAU;EACtBC,QAAQ,EAAEA,QAAS;EACnBK,yBAAyB,EAAEJ;AAAyB,GAEnDH,QACmB,CAC3B;AAEDD,gBAAgB,CAACS,WAAW,GAAG,kBAAkB;AAEjD,eAAeT,gBAAgB","ignoreList":[]}
@@ -17,32 +17,5 @@ export const StyledAccordionContent = styled.div`
17
17
  max-height: ${$maxHeight}px;
18
18
  overflow-y: scroll;
19
19
  `}
20
-
21
- // Styles for custom scrollbar
22
- ${({
23
- $browser,
24
- theme
25
- }) => $browser === 'firefox' ? css`
26
- scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
27
- scrollbar-width: thin;
28
- ` : css`
29
- &::-webkit-scrollbar {
30
- width: 5px;
31
- }
32
-
33
- &::-webkit-scrollbar-track {
34
- background-color: transparent;
35
- }
36
-
37
- &::-webkit-scrollbar-button {
38
- background-color: transparent;
39
- height: 5px;
40
- }
41
-
42
- &::-webkit-scrollbar-thumb {
43
- background-color: rgba(${theme['text-rgb']}, 0.15);
44
- border-radius: 20px;
45
- }
46
- `}
47
20
  `;
48
21
  //# sourceMappingURL=AccordionContent.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionContent.styles.js","names":["styled","css","StyledAccordionContent","div","theme","text","$shouldPreventBottomSpace","$maxHeight","$browser"],"sources":["../../../../../src/components/accordion/accordion-content/AccordionContent.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { BrowserName } from '../../../types/chayns';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledAccordionContentProps = WithTheme<{\n $maxHeight?: number;\n $browser: BrowserName;\n $shouldPreventBottomSpace: boolean;\n}>;\n\nexport const StyledAccordionContent = styled.div<StyledAccordionContentProps>`\n color: ${({ theme }: StyledAccordionContentProps) => theme.text};\n padding: 0 9px 18px 26px;\n\n ${({ $shouldPreventBottomSpace }) =>\n $shouldPreventBottomSpace &&\n css`\n padding-bottom: 0;\n `}\n\n ${({ $maxHeight }) =>\n typeof $maxHeight === 'number' &&\n css`\n max-height: ${$maxHeight}px;\n overflow-y: scroll;\n `}\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledAccordionContentProps) =>\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;AAU/C,OAAO,MAAMC,sBAAsB,GAAGF,MAAM,CAACG,GAAgC;AAC7E,aAAa,CAAC;EAAEC;AAAmC,CAAC,KAAKA,KAAK,CAACC,IAAI;AACnE;AACA;AACA,MAAM,CAAC;EAAEC;AAA0B,CAAC,KAC5BA,yBAAyB,IACzBL,GAAG;AACX;AACA,SAAS;AACT;AACA,MAAM,CAAC;EAAEM;AAAW,CAAC,KACb,OAAOA,UAAU,KAAK,QAAQ,IAC9BN,GAAG;AACX,0BAA0BM,UAAU;AACpC;AACA,SAAS;AACT;AACA;AACA,MAAM,CAAC;EAAEC,QAAQ;EAAEJ;AAAmC,CAAC,KAC/CI,QAAQ,KAAK,SAAS,GAChBP,GAAG;AACjB,0CAA0CG,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACDH,GAAG;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":"AccordionContent.styles.js","names":["styled","css","StyledAccordionContent","div","theme","text","$shouldPreventBottomSpace","$maxHeight"],"sources":["../../../../../src/components/accordion/accordion-content/AccordionContent.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledAccordionContentProps = WithTheme<{\n $maxHeight?: number;\n $shouldPreventBottomSpace: boolean;\n}>;\n\nexport const StyledAccordionContent = styled.div<StyledAccordionContentProps>`\n color: ${({ theme }: StyledAccordionContentProps) => theme.text};\n padding: 0 9px 18px 26px;\n\n ${({ $shouldPreventBottomSpace }) =>\n $shouldPreventBottomSpace &&\n css`\n padding-bottom: 0;\n `}\n\n ${({ $maxHeight }) =>\n typeof $maxHeight === 'number' &&\n css`\n max-height: ${$maxHeight}px;\n overflow-y: scroll;\n `}\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAQ/C,OAAO,MAAMC,sBAAsB,GAAGF,MAAM,CAACG,GAAgC;AAC7E,aAAa,CAAC;EAAEC;AAAmC,CAAC,KAAKA,KAAK,CAACC,IAAI;AACnE;AACA;AACA,MAAM,CAAC;EAAEC;AAA0B,CAAC,KAC5BA,yBAAyB,IACzBL,GAAG;AACX;AACA,SAAS;AACT;AACA,MAAM,CAAC;EAAEM;AAAW,CAAC,KACb,OAAOA,UAAU,KAAK,QAAQ,IAC9BN,GAAG;AACX,0BAA0BM,UAAU;AACpC;AACA,SAAS;AACT,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { useSite } from 'chayns-api';
1
+ import { useDevice, useSite } from 'chayns-api';
2
2
  import React, { createContext, useContext, useMemo } from 'react';
3
3
  import { createGlobalStyle, ThemeProvider } from 'styled-components';
4
4
  import { StyledColorSchemeProvider } from './ColorSchemeProvider.styles';
@@ -38,6 +38,9 @@ const ColorSchemeProvider = ({
38
38
  color: internalColor,
39
39
  colorMode: internalColorMode
40
40
  } = useSite();
41
+ const {
42
+ browser
43
+ } = useDevice();
41
44
  const color = colorProp ?? context?.designSettings?.color ?? internalColor;
42
45
  const colorMode = colorModeProp ?? context?.designSettings?.colorMode ?? internalColorMode;
43
46
  const overrideParagraphFormat = color && color !== internalColor || colorMode !== internalColorMode;
@@ -58,7 +61,8 @@ const ColorSchemeProvider = ({
58
61
  value: contextValue
59
62
  }, /*#__PURE__*/React.createElement(StyledColorSchemeProvider, {
60
63
  className: "color-scheme-provider",
61
- style: style
64
+ style: style,
65
+ $browser: browser?.name
62
66
  }, children), /*#__PURE__*/React.createElement(GlobalStyle, null)));
63
67
  };
64
68
  ColorSchemeProvider.displayName = 'ColorSchemeProvider';
@@ -1 +1 @@
1
- {"version":3,"file":"ColorSchemeProvider.js","names":["useSite","React","createContext","useContext","useMemo","createGlobalStyle","ThemeProvider","StyledColorSchemeProvider","useChaynsTheme","GlobalStyle","ColorSchemeContext","undefined","useColorScheme","ColorSchemeProvider","children","color","colorProp","colorMode","colorModeProp","secondaryColor","siteId","style","iconColor","customVariables","context","internalColor","internalColorMode","designSettings","overrideParagraphFormat","paragraphFormat","contextValue","createElement","theme","Provider","value","className","displayName"],"sources":["../../../../src/components/color-scheme-provider/ColorSchemeProvider.tsx"],"sourcesContent":["import { ChaynsDesignSettings, ChaynsParagraphFormat, ColorMode, useSite } from 'chayns-api';\nimport React, { createContext, FC, ReactNode, useContext, useMemo } from 'react';\nimport { createGlobalStyle, ThemeProvider } from 'styled-components';\nimport { StyledColorSchemeProvider } from './ColorSchemeProvider.styles';\nimport { useChaynsTheme } from './hooks/useChaynsTheme';\n\nexport type ColorSchemeProviderProps = {\n /**\n * The content of the application or the components for which the styles should be set\n */\n children: ReactNode;\n /**\n * The hex color to be used for the children\n */\n color?: string;\n /**\n * The color mode to be used for the children\n */\n colorMode?: ColorMode;\n /**\n * The secondary hex color to be used for the children\n */\n secondaryColor?: string;\n /**\n * The site id of the page for which the design settings should be fetched\n */\n siteId?: string;\n /**\n * Additional styles set on the root element\n */\n style?: { [key: string]: string | number };\n /**\n * Additional variables to extend the theme\n */\n customVariables?: Record<string, string>;\n /**\n * An optional color for all icons\n */\n iconColor?: string;\n};\n\nexport interface Theme {\n [key: string]: string;\n}\n\nexport type WithTheme<T> = T & {\n theme: Theme;\n};\n\nconst GlobalStyle = createGlobalStyle`\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n footer {\n font-size: 0.85rem;\n color: #888;\n margin: 10px 0 0;\n\n & a {\n color: #888;\n letter-spacing: -0.3px;\n }\n }\n`;\n\nexport interface ColorSchemeContextProps {\n designSettings?: ChaynsDesignSettings;\n paragraphFormat: ChaynsParagraphFormat[];\n theme: Theme;\n}\n\nexport const ColorSchemeContext = createContext<ColorSchemeContextProps | undefined>(undefined);\n\nexport const useColorScheme = () => useContext(ColorSchemeContext);\n\nconst ColorSchemeProvider: FC<ColorSchemeProviderProps> = ({\n children,\n color: colorProp,\n colorMode: colorModeProp,\n secondaryColor,\n siteId,\n style = {},\n iconColor,\n customVariables,\n}) => {\n const context = useContext(ColorSchemeContext);\n\n const { color: internalColor, colorMode: internalColorMode } = useSite();\n\n const color = colorProp ?? context?.designSettings?.color ?? internalColor;\n const colorMode = colorModeProp ?? context?.designSettings?.colorMode ?? internalColorMode;\n\n const overrideParagraphFormat =\n (color && color !== internalColor) || colorMode !== internalColorMode;\n\n const paragraphFormat = useMemo(\n () => (overrideParagraphFormat ? [] : undefined),\n [overrideParagraphFormat],\n );\n\n const contextValue = useChaynsTheme({\n color,\n iconColor,\n colorMode,\n secondaryColor,\n siteId,\n customVariables,\n // Overrides the paragraphFormat on changed color or colorMode\n paragraphFormat,\n });\n\n return (\n <ThemeProvider theme={contextValue.theme}>\n <ColorSchemeContext.Provider value={contextValue}>\n <StyledColorSchemeProvider className=\"color-scheme-provider\" style={style}>\n {children}\n </StyledColorSchemeProvider>\n <GlobalStyle />\n </ColorSchemeContext.Provider>\n </ThemeProvider>\n );\n};\n\nColorSchemeProvider.displayName = 'ColorSchemeProvider';\n\nexport default ColorSchemeProvider;\n"],"mappings":"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YAAY,GAAGtB,cAAc,CAAC;IAChCO,KAAK;IACLO,SAAS;IACTL,SAAS;IACTE,cAAc;IACdC,MAAM;IACNG,eAAe;IACf;IACAM;EACJ,CAAC,CAAC;EAEF,oBACI5B,KAAA,CAAA8B,aAAA,CAACzB,aAAa;IAAC0B,KAAK,EAAEF,YAAY,CAACE;EAAM,gBACrC/B,KAAA,CAAA8B,aAAA,CAACrB,kBAAkB,CAACuB,QAAQ;IAACC,KAAK,EAAEJ;EAAa,gBAC7C7B,KAAA,CAAA8B,aAAA,CAACxB,yBAAyB;IAAC4B,SAAS,EAAC,uBAAuB;IAACd,KAAK,EAAEA;EAAM,GACrEP,QACsB,CAAC,eAC5Bb,KAAA,CAAA8B,aAAA,CAACtB,WAAW,MAAE,CACW,CAClB,CAAC;AAExB,CAAC;AAEDI,mBAAmB,CAACuB,WAAW,GAAG,qBAAqB;AAEvD,eAAevB,mBAAmB","ignoreList":[]}
1
+ {"version":3,"file":"ColorSchemeProvider.js","names":["useDevice","useSite","React","createContext","useContext","useMemo","createGlobalStyle","ThemeProvider","StyledColorSchemeProvider","useChaynsTheme","GlobalStyle","ColorSchemeContext","undefined","useColorScheme","ColorSchemeProvider","children","color","colorProp","colorMode","colorModeProp","secondaryColor","siteId","style","iconColor","customVariables","context","internalColor","internalColorMode","browser","designSettings","overrideParagraphFormat","paragraphFormat","contextValue","createElement","theme","Provider","value","className","$browser","name","displayName"],"sources":["../../../../src/components/color-scheme-provider/ColorSchemeProvider.tsx"],"sourcesContent":["import {\n ChaynsDesignSettings,\n ChaynsParagraphFormat,\n ColorMode,\n useDevice,\n useSite,\n} from 'chayns-api';\nimport React, { createContext, FC, ReactNode, useContext, useMemo } from 'react';\nimport { createGlobalStyle, ThemeProvider } from 'styled-components';\nimport { StyledColorSchemeProvider } from './ColorSchemeProvider.styles';\nimport { useChaynsTheme } from './hooks/useChaynsTheme';\nimport { BrowserName } from '../../types/chayns';\n\nexport type ColorSchemeProviderProps = {\n /**\n * The content of the application or the components for which the styles should be set\n */\n children: ReactNode;\n /**\n * The hex color to be used for the children\n */\n color?: string;\n /**\n * The color mode to be used for the children\n */\n colorMode?: ColorMode;\n /**\n * The secondary hex color to be used for the children\n */\n secondaryColor?: string;\n /**\n * The site id of the page for which the design settings should be fetched\n */\n siteId?: string;\n /**\n * Additional styles set on the root element\n */\n style?: { [key: string]: string | number };\n /**\n * Additional variables to extend the theme\n */\n customVariables?: Record<string, string>;\n /**\n * An optional color for all icons\n */\n iconColor?: string;\n};\n\nexport interface Theme {\n [key: string]: string;\n}\n\nexport type WithTheme<T> = T & {\n theme: Theme;\n};\n\nconst GlobalStyle = createGlobalStyle`\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n footer {\n font-size: 0.85rem;\n color: #888;\n margin: 10px 0 0;\n\n & a {\n color: #888;\n letter-spacing: -0.3px;\n }\n }\n`;\n\nexport interface ColorSchemeContextProps {\n designSettings?: ChaynsDesignSettings;\n paragraphFormat: ChaynsParagraphFormat[];\n theme: Theme;\n}\n\nexport const ColorSchemeContext = createContext<ColorSchemeContextProps | undefined>(undefined);\n\nexport const useColorScheme = () => useContext(ColorSchemeContext);\n\nconst ColorSchemeProvider: FC<ColorSchemeProviderProps> = ({\n children,\n color: colorProp,\n colorMode: colorModeProp,\n secondaryColor,\n siteId,\n style = {},\n iconColor,\n customVariables,\n}) => {\n const context = useContext(ColorSchemeContext);\n\n const { color: internalColor, colorMode: internalColorMode } = useSite();\n\n const { browser } = useDevice();\n\n const color = colorProp ?? context?.designSettings?.color ?? internalColor;\n const colorMode = colorModeProp ?? context?.designSettings?.colorMode ?? internalColorMode;\n\n const overrideParagraphFormat =\n (color && color !== internalColor) || colorMode !== internalColorMode;\n\n const paragraphFormat = useMemo(\n () => (overrideParagraphFormat ? [] : undefined),\n [overrideParagraphFormat],\n );\n\n const contextValue = useChaynsTheme({\n color,\n iconColor,\n colorMode,\n secondaryColor,\n siteId,\n customVariables,\n // Overrides the paragraphFormat on changed color or colorMode\n paragraphFormat,\n });\n\n return (\n <ThemeProvider theme={contextValue.theme}>\n <ColorSchemeContext.Provider value={contextValue}>\n <StyledColorSchemeProvider\n className=\"color-scheme-provider\"\n style={style}\n $browser={browser?.name as BrowserName}\n >\n {children}\n </StyledColorSchemeProvider>\n <GlobalStyle />\n </ColorSchemeContext.Provider>\n </ThemeProvider>\n );\n};\n\nColorSchemeProvider.displayName = 'ColorSchemeProvider';\n\nexport default ColorSchemeProvider;\n"],"mappings":"AAAA,SAIIA,SAAS,EACTC,OAAO,QACJ,YAAY;AACnB,OAAOC,KAAK,IAAIC,aAAa,EAAiBC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAChF,SAASC,iBAAiB,EAAEC,aAAa,QAAQ,mBAAmB;AACpE,SAASC,yBAAyB,QAAQ,8BAA8B;AACxE,SAASC,cAAc,QAAQ,wBAAwB;AA8CvD,MAAMC,WAAW,GAAGJ,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAQD,OAAO,MAAMK,kBAAkB,gBAAGR,aAAa,CAAsCS,SAAS,CAAC;AAE/F,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAAMT,UAAU,CAACO,kBAAkB,CAAC;AAElE,MAAMG,mBAAiD,GAAGA,CAAC;EACvDC,QAAQ;EACRC,KAAK,EAAEC,SAAS;EAChBC,SAAS,EAAEC,aAAa;EACxBC,cAAc;EACdC,MAAM;EACNC,KAAK,GAAG,CAAC,CAAC;EACVC,SAAS;EACTC;AACJ,CAAC,KAAK;EACF,MAAMC,OAAO,GAAGrB,UAAU,CAACO,kBAAkB,CAAC;EAE9C,MAAM;IAAEK,KAAK,EAAEU,aAAa;IAAER,SAAS,EAAES;EAAkB,CAAC,GAAG1B,OAAO,CAAC,CAAC;EAExE,MAAM;IAAE2B;EAAQ,CAAC,GAAG5B,SAAS,CAAC,CAAC;EAE/B,MAAMgB,KAAK,GAAGC,SAAS,IAAIQ,OAAO,EAAEI,cAAc,EAAEb,KAAK,IAAIU,aAAa;EAC1E,MAAMR,SAAS,GAAGC,aAAa,IAAIM,OAAO,EAAEI,cAAc,EAAEX,SAAS,IAAIS,iBAAiB;EAE1F,MAAMG,uBAAuB,GACxBd,KAAK,IAAIA,KAAK,KAAKU,aAAa,IAAKR,SAAS,KAAKS,iBAAiB;EAEzE,MAAMI,eAAe,GAAG1B,OAAO,CAC3B,MAAOyB,uBAAuB,GAAG,EAAE,GAAGlB,SAAU,EAChD,CAACkB,uBAAuB,CAC5B,CAAC;EAED,MAAME,YAAY,GAAGvB,cAAc,CAAC;IAChCO,KAAK;IACLO,SAAS;IACTL,SAAS;IACTE,cAAc;IACdC,MAAM;IACNG,eAAe;IACf;IACAO;EACJ,CAAC,CAAC;EAEF,oBACI7B,KAAA,CAAA+B,aAAA,CAAC1B,aAAa;IAAC2B,KAAK,EAAEF,YAAY,CAACE;EAAM,gBACrChC,KAAA,CAAA+B,aAAA,CAACtB,kBAAkB,CAACwB,QAAQ;IAACC,KAAK,EAAEJ;EAAa,gBAC7C9B,KAAA,CAAA+B,aAAA,CAACzB,yBAAyB;IACtB6B,SAAS,EAAC,uBAAuB;IACjCf,KAAK,EAAEA,KAAM;IACbgB,QAAQ,EAAEV,OAAO,EAAEW;EAAoB,GAEtCxB,QACsB,CAAC,eAC5Bb,KAAA,CAAA+B,aAAA,CAACvB,WAAW,MAAE,CACW,CAClB,CAAC;AAExB,CAAC;AAEDI,mBAAmB,CAAC0B,WAAW,GAAG,qBAAqB;AAEvD,eAAe1B,mBAAmB","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import { getAvailableColorList } from '@chayns/colors';
2
- import { styled } from 'styled-components';
2
+ import { css, styled } from 'styled-components';
3
3
  // noinspection CssUnresolvedCustomProperty
4
4
  export const StyledColorSchemeProvider = styled.div`
5
5
  color: var(--chayns-color--text);
@@ -21,5 +21,42 @@ export const StyledColorSchemeProvider = styled.div`
21
21
  .color-scheme-provider :is(h1,.h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6):first-child {
22
22
  margin-top: 0;
23
23
  }
24
+
25
+ // Styles for custom scrollbar
26
+ .chayns-scrollbar {
27
+ ${({
28
+ $browser,
29
+ theme
30
+ }) => $browser === 'firefox' ? css`
31
+ scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
32
+ scrollbar-width: thin;
33
+ ` : css`
34
+ &::-webkit-scrollbar {
35
+ width: 10px;
36
+ height: 10px;
37
+ }
38
+
39
+ &::-webkit-scrollbar-track {
40
+ background-color: transparent;
41
+ }
42
+
43
+ &::-webkit-scrollbar-button {
44
+ background-color: transparent;
45
+ height: 5px;
46
+ width: 5px;
47
+ }
48
+
49
+ &::-webkit-scrollbar-thumb {
50
+ background-color: rgba(${theme['text-rgb']}, 0.15);
51
+ border-radius: 20px;
52
+ background-clip: padding-box;
53
+ border: solid 3px transparent;
54
+ }
55
+
56
+ &::-webkit-scrollbar-corner {
57
+ background-color: transparent;
58
+ }
59
+ `}
60
+ }
24
61
  `;
25
62
  //# sourceMappingURL=ColorSchemeProvider.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorSchemeProvider.styles.js","names":["getAvailableColorList","styled","StyledColorSchemeProvider","div","theme","map","colorName","colorNameRgb","primary"],"sources":["../../../../src/components/color-scheme-provider/ColorSchemeProvider.styles.ts"],"sourcesContent":["import { getAvailableColorList } from '@chayns/colors';\nimport { styled } from 'styled-components';\nimport type { WithTheme } from './ColorSchemeProvider';\n\ntype ColorSchemeProviderProps = WithTheme<unknown>;\n\n// noinspection CssUnresolvedCustomProperty\nexport const StyledColorSchemeProvider = styled.div<ColorSchemeProviderProps>`\n color: var(--chayns-color--text);\n\n ${({ theme }: ColorSchemeProviderProps) =>\n getAvailableColorList().map((colorName: string) => {\n const colorNameRgb = `${colorName}-rgb`;\n return [\n `--chayns-color--${colorName}: ${theme[colorName]};`,\n `--chayns-color-rgb--${colorName}: ${theme[colorNameRgb]};`,\n ];\n })}\n\n ${({ theme }: ColorSchemeProviderProps) =>\n `\n --chayns-color--header-bar: ${theme['header-bar'] ?? theme.primary};\n `}\n\n // ToDo: Remove .h1...\n .color-scheme-provider :is(h1,.h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6):first-child {\n margin-top: 0;\n }\n`;\n"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,MAAM,QAAQ,mBAAmB;AAK1C;AACA,OAAO,MAAMC,yBAAyB,GAAGD,MAAM,CAACE,GAA6B;AAC7E;AACA;AACA,MAAM,CAAC;EAAEC;AAAgC,CAAC,KAClCJ,qBAAqB,CAAC,CAAC,CAACK,GAAG,CAAEC,SAAiB,IAAK;EAC/C,MAAMC,YAAY,GAAG,GAAGD,SAAS,MAAM;EACvC,OAAO,CACH,mBAAmBA,SAAS,KAAKF,KAAK,CAACE,SAAS,CAAC,GAAG,EACpD,uBAAuBA,SAAS,KAAKF,KAAK,CAACG,YAAY,CAAC,GAAG,CAC9D;AACL,CAAC,CAAC;AACV;AACA,MAAM,CAAC;EAAEH;AAAgC,CAAC,KAClC;AACR,sCAAsCA,KAAK,CAAC,YAAY,CAAC,IAAIA,KAAK,CAACI,OAAO;AAC1E,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ColorSchemeProvider.styles.js","names":["getAvailableColorList","css","styled","StyledColorSchemeProvider","div","theme","map","colorName","colorNameRgb","primary","$browser"],"sources":["../../../../src/components/color-scheme-provider/ColorSchemeProvider.styles.ts"],"sourcesContent":["import { getAvailableColorList } from '@chayns/colors';\nimport { css, styled } from 'styled-components';\nimport type { WithTheme } from './ColorSchemeProvider';\nimport { BrowserName } from '../../types/chayns';\n\ntype ColorSchemeProviderProps = WithTheme<{ $browser: BrowserName }>;\n\n// noinspection CssUnresolvedCustomProperty\nexport const StyledColorSchemeProvider = styled.div<ColorSchemeProviderProps>`\n color: var(--chayns-color--text);\n\n ${({ theme }: ColorSchemeProviderProps) =>\n getAvailableColorList().map((colorName: string) => {\n const colorNameRgb = `${colorName}-rgb`;\n return [\n `--chayns-color--${colorName}: ${theme[colorName]};`,\n `--chayns-color-rgb--${colorName}: ${theme[colorNameRgb]};`,\n ];\n })}\n\n ${({ theme }: ColorSchemeProviderProps) =>\n `\n --chayns-color--header-bar: ${theme['header-bar'] ?? theme.primary};\n `}\n\n // ToDo: Remove .h1...\n .color-scheme-provider :is(h1,.h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6):first-child {\n margin-top: 0;\n }\n\n // Styles for custom scrollbar\n .chayns-scrollbar {\n ${({ $browser, theme }: ColorSchemeProviderProps) =>\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`;\n"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,GAAG,EAAEC,MAAM,QAAQ,mBAAmB;AAM/C;AACA,OAAO,MAAMC,yBAAyB,GAAGD,MAAM,CAACE,GAA6B;AAC7E;AACA;AACA,MAAM,CAAC;EAAEC;AAAgC,CAAC,KAClCL,qBAAqB,CAAC,CAAC,CAACM,GAAG,CAAEC,SAAiB,IAAK;EAC/C,MAAMC,YAAY,GAAG,GAAGD,SAAS,MAAM;EACvC,OAAO,CACH,mBAAmBA,SAAS,KAAKF,KAAK,CAACE,SAAS,CAAC,GAAG,EACpD,uBAAuBA,SAAS,KAAKF,KAAK,CAACG,YAAY,CAAC,GAAG,CAC9D;AACL,CAAC,CAAC;AACV;AACA,MAAM,CAAC;EAAEH;AAAgC,CAAC,KAClC;AACR,sCAAsCA,KAAK,CAAC,YAAY,CAAC,IAAIA,KAAK,CAACI,OAAO;AAC1E,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,CAAC;EAAEC,QAAQ;EAAEL;AAAgC,CAAC,KAC5CK,QAAQ,KAAK,SAAS,GAChBT,GAAG;AACrB,8CAA8CI,KAAK,CAAC,UAAU,CAAC;AAC/D;AACA,mBAAmB,GACDJ,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmDI,KAAK,CAAC,UAAU,CAAC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { useDevice, useFunctions, useValues } from 'chayns-api';
1
+ import { useFunctions, useValues } from 'chayns-api';
2
2
  import React, { forwardRef, Fragment, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
3
3
  import { calculateMaxComboBoxItemWidth } from '../../utils/calculate';
4
4
  import { useIsTouch } from '../../utils/environment';
@@ -9,11 +9,7 @@ import { StyledComboBox, StyledComboBoxBody, StyledComboBoxClearIconWrapper, Sty
9
9
  import DropdownBodyWrapper from '../dropdown-body-wrapper/DropdownBodyWrapper';
10
10
  import { DropdownDirection } from '../../types/dropdown';
11
11
  import { useElementSize } from '../../hooks/element';
12
- export let ComboBoxSize = /*#__PURE__*/function (ComboBoxSize) {
13
- ComboBoxSize["NORMAL"] = "normal";
14
- ComboBoxSize["SMALL"] = "small";
15
- return ComboBoxSize;
16
- }({});
12
+ import { ComboBoxSize } from './ComboBox.types';
17
13
  const ComboBox = /*#__PURE__*/forwardRef(({
18
14
  bodyWidth,
19
15
  direction = DropdownDirection.RIGHT,
@@ -56,9 +52,6 @@ const ComboBox = /*#__PURE__*/forwardRef(({
56
52
  const functions = useFunctions();
57
53
  const values = useValues();
58
54
  const isTouch = useIsTouch();
59
- const {
60
- browser
61
- } = useDevice();
62
55
  const areaProvider = useContext(AreaContext);
63
56
  useEffect(() => {
64
57
  if (shouldUseFullWidth && parentSize) {
@@ -128,7 +121,7 @@ const ComboBox = /*#__PURE__*/forwardRef(({
128
121
  }
129
122
  setInternalSelectedItem(itemToSelect);
130
123
  handleClose();
131
- }, [onSelect]);
124
+ }, [handleClose, onSelect]);
132
125
  const handleClear = useCallback(event => {
133
126
  event.preventDefault();
134
127
  event.stopPropagation();
@@ -387,10 +380,10 @@ const ComboBox = /*#__PURE__*/forwardRef(({
387
380
  $shouldUseCurrentItemWidth: shouldUseCurrentItemWidth,
388
381
  $maxHeight: maxHeight,
389
382
  $minWidth: bodyWidth ?? bodyMinWidth,
390
- $browser: browser?.name,
383
+ className: "chayns-scrollbar",
391
384
  ref: contentRef,
392
385
  tabIndex: 0
393
- }, comboBoxGroups))), [minWidth, shouldUseFullWidth, shouldUseCurrentItemWidth, direction, handleHeaderClick, isAnimating, isTouch, size, shouldShowTransparentBackground, isDisabled, shouldChangeColor, shouldShowBigImage, prefix, prefixMinWidth, selectedItem, internalSelectedItem, placeholderImageUrl, shouldShowRoundPlaceholderImage, placeholderIcon, inputValue, onInputChange, handleInputBlur, handleInputFocus, placeholderText, shouldShowClearIcon, handleClear, shouldDisableActions, bodyWidth, contentHeight, handleClose, container, bodyMinWidth, maxHeight, browser?.name, comboBoxGroups]);
386
+ }, comboBoxGroups))), [minWidth, shouldUseFullWidth, shouldUseCurrentItemWidth, direction, handleHeaderClick, isAnimating, isTouch, size, shouldShowTransparentBackground, isDisabled, shouldChangeColor, shouldShowBigImage, prefix, prefixMinWidth, selectedItem, internalSelectedItem, placeholderImageUrl, shouldShowRoundPlaceholderImage, placeholderIcon, inputValue, onInputChange, handleInputBlur, handleInputFocus, placeholderText, shouldShowClearIcon, handleClear, shouldDisableActions, bodyWidth, contentHeight, shouldCaptureEvents, handleClose, container, bodyMinWidth, maxHeight, comboBoxGroups]);
394
387
  });
395
388
  ComboBox.displayName = 'ComboBox';
396
389
  export default ComboBox;