@chayns-components/core 5.0.0-beta.990 → 5.0.0-beta.992
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/accordion/accordion-body/AccordionBody.js.map +1 -1
- package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
- package/lib/cjs/components/accordion/accordion-content/AccordionContent.js.map +1 -1
- package/lib/cjs/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js +14 -20
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js +5 -2
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
- package/lib/cjs/components/combobox/ComboBox.js.map +1 -1
- package/lib/cjs/components/combobox/ComboBox.styles.js.map +1 -1
- package/lib/cjs/components/page-provider/PageProvider.js +1 -3
- package/lib/cjs/components/page-provider/PageProvider.js.map +1 -1
- package/lib/cjs/components/scroll-view/ScrollView.js.map +1 -1
- package/lib/cjs/components/scroll-view/ScrollView.styles.js.map +1 -1
- package/lib/cjs/components/search-box/SearchBox.js.map +1 -1
- package/lib/cjs/components/search-box/SearchBox.styles.js.map +1 -1
- package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.js.map +1 -1
- package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.styles.js.map +1 -1
- package/lib/cjs/components/text-area/TextArea.js.map +1 -1
- package/lib/cjs/components/text-area/TextArea.styles.js.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types/chayns.js +0 -11
- package/lib/cjs/types/chayns.js.map +1 -1
- package/lib/cjs/types/colorSchemeProvider.js.map +1 -1
- package/lib/cjs/types/signature.js.map +1 -1
- package/lib/cjs/utils/font.js +1 -5
- package/lib/cjs/utils/font.js.map +1 -1
- package/lib/cjs/utils/pageProvider.js +5 -82
- package/lib/cjs/utils/pageProvider.js.map +1 -1
- package/lib/esm/components/accordion/accordion-body/AccordionBody.js.map +1 -1
- package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
- package/lib/esm/components/accordion/accordion-content/AccordionContent.js.map +1 -1
- package/lib/esm/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +14 -19
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js +10 -4
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
- package/lib/esm/components/combobox/ComboBox.js.map +1 -1
- package/lib/esm/components/combobox/ComboBox.styles.js.map +1 -1
- package/lib/esm/components/page-provider/PageProvider.js +1 -3
- package/lib/esm/components/page-provider/PageProvider.js.map +1 -1
- package/lib/esm/components/scroll-view/ScrollView.js.map +1 -1
- package/lib/esm/components/scroll-view/ScrollView.styles.js.map +1 -1
- package/lib/esm/components/search-box/SearchBox.js.map +1 -1
- package/lib/esm/components/search-box/SearchBox.styles.js.map +1 -1
- package/lib/esm/components/search-box/search-box-body/SearchBoxBody.js.map +1 -1
- package/lib/esm/components/search-box/search-box-body/SearchBoxBody.styles.js.map +1 -1
- package/lib/esm/components/text-area/TextArea.js.map +1 -1
- package/lib/esm/components/text-area/TextArea.styles.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types/chayns.js +1 -6
- package/lib/esm/types/chayns.js.map +1 -1
- package/lib/esm/types/colorSchemeProvider.js.map +1 -1
- package/lib/esm/types/signature.js.map +1 -1
- package/lib/esm/utils/font.js +1 -5
- package/lib/esm/utils/font.js.map +1 -1
- package/lib/esm/utils/pageProvider.js +5 -81
- package/lib/esm/utils/pageProvider.js.map +1 -1
- package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +2 -2
- package/lib/types/components/accordion/accordion-content/AccordionContent.styles.d.ts +2 -2
- package/lib/types/components/color-scheme-provider/ColorSchemeProvider.d.ts +1 -9
- package/lib/types/components/color-scheme-provider/ColorSchemeProvider.styles.d.ts +3 -1
- package/lib/types/components/combobox/ComboBox.styles.d.ts +2 -2
- package/lib/types/components/scroll-view/ScrollView.styles.d.ts +2 -2
- package/lib/types/components/search-box/SearchBox.styles.d.ts +2 -2
- package/lib/types/components/search-box/search-box-body/SearchBoxBody.d.ts +2 -2
- package/lib/types/components/search-box/search-box-body/SearchBoxBody.styles.d.ts +2 -2
- package/lib/types/components/text-area/TextArea.styles.d.ts +2 -2
- package/lib/types/index.d.ts +1 -0
- package/lib/types/types/chayns.d.ts +1 -122
- package/lib/types/types/colorSchemeProvider.d.ts +23 -19
- package/lib/types/types/signature.d.ts +0 -5
- package/lib/types/utils/pageProvider.d.ts +2 -3
- package/package.json +5 -5
- package/lib/cjs/api/theme/get.js +0 -32
- package/lib/cjs/api/theme/get.js.map +0 -1
- package/lib/esm/api/theme/get.js +0 -24
- package/lib/esm/api/theme/get.js.map +0 -1
- package/lib/types/api/theme/get.d.ts +0 -3
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_AreaContextProvider","_interopRequireWildcard","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_ComboBox","_ContentCard","_ContextMenu","_ExpandableContent","_FileInput","_FilterButton","_FilterButtons","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_MentionFinder","_NumberInput","_PageProvider","_Popup","_PopupContent","_ProgressBar","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SelectButton","_SetupWizardItem","_SetupWizard","_SharingBar","_Signature","_SliderButton","_Slider","_SmallWaitCursor","_TagInput","_TextArea","_Tooltip","_Truncation","_mentionFinder","_useElementSize","_comboBox","_contentCard","_contextMenu","_filterButtons","_truncation","_environment","_fileDialog","_isTobitEmployee","_pageProvider","_uploadFile","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\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 {\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 type {\n ColorSchemeContextProps,\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport {\n default as ComboBox,\n type ComboBoxTextStyles,\n type IComboBoxItem as ComboBoxItem,\n type IComboBoxItems as ComboBoxItems,\n} from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport {\n default as ContextMenu,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport { default as FileInput, type FileInputRef } 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 Icon } 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} 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 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 {\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 SharingBar } from './components/sharing-bar/SharingBar';\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 { default as TagInput } 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/useElementSize';\nexport { ComboBoxDirection } from './types/comboBox';\nexport { ContentCardType } from './types/contentCard';\nexport { ContextMenuAlignment } from './types/contextMenu';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/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 { ClampPosition } from './types/truncation';\nexport { getIsTouch } 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';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAA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reList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_AreaContextProvider","_interopRequireWildcard","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_ComboBox","_ContentCard","_ContextMenu","_ExpandableContent","_FileInput","_FilterButton","_FilterButtons","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_MentionFinder","_NumberInput","_PageProvider","_Popup","_PopupContent","_ProgressBar","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SelectButton","_SetupWizardItem","_SetupWizard","_SharingBar","_Signature","_SliderButton","_Slider","_SmallWaitCursor","_TagInput","_TextArea","_Tooltip","_Truncation","_mentionFinder","_useElementSize","_comboBox","_contentCard","_contextMenu","_filterButtons","_truncation","_environment","_fileDialog","_isTobitEmployee","_pageProvider","_uploadFile","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set"],"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 {\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 type {\n ColorSchemeContextProps,\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport {\n default as ComboBox,\n type ComboBoxTextStyles,\n type IComboBoxItem as ComboBoxItem,\n type IComboBoxItems as ComboBoxItems,\n} from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport {\n default as ContextMenu,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport { default as FileInput, type FileInputRef } 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 Icon } 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} 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 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 {\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 SharingBar } from './components/sharing-bar/SharingBar';\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 { default as TagInput } 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/useElementSize';\nexport type { BrowserName } from './types/chayns';\nexport { ComboBoxDirection } from './types/comboBox';\nexport { ContentCardType } from './types/contentCard';\nexport { ContextMenuAlignment } from './types/contextMenu';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/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 { ClampPosition } from './types/truncation';\nexport { getIsTouch } 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';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAAA,SAAAtE,uBAAA8D,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAI,UAAA,GAAAJ,CAAA,KAAAK,OAAA,EAAAL,CAAA","ignoreList":[]}
|
package/lib/cjs/types/chayns.js
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ButtonType = void 0;
|
|
7
|
-
let ButtonType = exports.ButtonType = /*#__PURE__*/function (ButtonType) {
|
|
8
|
-
ButtonType[ButtonType["Cancel"] = -1] = "Cancel";
|
|
9
|
-
ButtonType[ButtonType["Negative"] = 0] = "Negative";
|
|
10
|
-
ButtonType[ButtonType["Positive"] = 1] = "Positive";
|
|
11
|
-
return ButtonType;
|
|
12
|
-
}({});
|
|
13
2
|
//# sourceMappingURL=chayns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chayns.js","names":[
|
|
1
|
+
{"version":3,"file":"chayns.js","names":[],"sources":["../../../src/types/chayns.ts"],"sourcesContent":["export type BrowserName =\n | 'aol'\n | 'edge'\n | 'edge-ios'\n | 'yandexbrowser'\n | 'kakaotalk'\n | 'samsung'\n | 'silk'\n | 'miui'\n | 'beaker'\n | 'edge-chromium'\n | 'chrome'\n | 'chromium-webview'\n | 'phantomjs'\n | 'crios'\n | 'firefox'\n | 'fxios'\n | 'opera-mini'\n | 'opera'\n | 'pie'\n | 'netfront'\n | 'ie'\n | 'bb10'\n | 'android'\n | 'ios'\n | 'safari'\n | 'facebook'\n | 'instagram'\n | 'ios-webview'\n | 'curl'\n | 'searchbot'\n | 'bot'\n | null\n | undefined;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorSchemeProvider.js","names":["IconStyle","exports"],"sources":["../../../src/types/colorSchemeProvider.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"colorSchemeProvider.js","names":["IconStyle","exports"],"sources":["../../../src/types/colorSchemeProvider.ts"],"sourcesContent":["import { ColorMode } from 'chayns-api';\n\nexport interface DesignSettings {\n siteId?: string;\n color: string;\n secondaryColor?: string;\n colorMode: ColorMode;\n fontSize: number;\n iconStyle: IconStyle;\n headlineFontId?: number;\n backgroundType?: number;\n backgroundColor?: string;\n headerBarColor?: string;\n accordionIcon?: number;\n accordionLines: boolean;\n cardBorderRadius?: number;\n cardBackgroundOpacity?: number;\n cardShadow?: number;\n}\n\nexport enum IconStyle {\n SOLID,\n REGULAR,\n LIGHT,\n DUOTONE,\n SHARP,\n}\n\nexport interface ParagraphFormat {\n selector: string;\n fontSizePx?: number;\n lineHeight?: number;\n marginBeforePx?: number;\n marginAfterPx?: number;\n color?: string;\n fontId?: number;\n buttonDesignType?: number;\n backgroundColor?: string;\n}\n"],"mappings":";;;;;;IAoBYA,SAAS,GAAAC,OAAA,CAAAD,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.js","names":[],"sources":["../../../src/types/signature.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"signature.js","names":[],"sources":["../../../src/types/signature.ts"],"sourcesContent":["export interface GetUserSignatureResult {\n key: string;\n personId: string;\n value: string;\n}\n"],"mappings":"","ignoreList":[]}
|
package/lib/cjs/utils/font.js
CHANGED
|
@@ -69,8 +69,7 @@ const getHeadlineColorSelector = data => {
|
|
|
69
69
|
data.forEach(({
|
|
70
70
|
selector,
|
|
71
71
|
color,
|
|
72
|
-
backgroundColor
|
|
73
|
-
design
|
|
72
|
+
backgroundColor
|
|
74
73
|
}) => {
|
|
75
74
|
var _selectors;
|
|
76
75
|
const selectors = selector.split(',');
|
|
@@ -84,9 +83,6 @@ const getHeadlineColorSelector = data => {
|
|
|
84
83
|
if (color) {
|
|
85
84
|
themeResult[`${path}Color`] = color;
|
|
86
85
|
}
|
|
87
|
-
if (design) {
|
|
88
|
-
themeResult[`${path}Design`] = String(design);
|
|
89
|
-
}
|
|
90
86
|
return;
|
|
91
87
|
}
|
|
92
88
|
if (!color) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.js","names":["_colorSchemeProvider","require","convertIconStyle","iconStyle","IconStyle","SOLID","DUOTONE","SHARP","LIGHT","exports","getFontSize","element","document","createElement","style","position","opacity","textContent","body","appendChild","fontSize","window","getComputedStyle","removeChild","replace","hexToRgb","hex","r","g","b","a","result","exec","parseInt","undefined","getHeadlineColorSelector","data","themeResult","headlineMap","h1","h2","h3","h4","h5","h6","p","footer","forEach","selector","color","backgroundColor","
|
|
1
|
+
{"version":3,"file":"font.js","names":["_colorSchemeProvider","require","convertIconStyle","iconStyle","IconStyle","SOLID","DUOTONE","SHARP","LIGHT","exports","getFontSize","element","document","createElement","style","position","opacity","textContent","body","appendChild","fontSize","window","getComputedStyle","removeChild","replace","hexToRgb","hex","r","g","b","a","result","exec","parseInt","undefined","getHeadlineColorSelector","data","themeResult","headlineMap","h1","h2","h3","h4","h5","h6","p","footer","forEach","selector","color","backgroundColor","_selectors","selectors","split","tag","length","trim","path","rgb"],"sources":["../../../src/utils/font.ts"],"sourcesContent":["import { IconStyle, type ParagraphFormat } from '../types/colorSchemeProvider';\n\nexport const convertIconStyle = (iconStyle: IconStyle) => {\n switch (iconStyle) {\n case IconStyle.SOLID:\n return 'fa-solid';\n case IconStyle.DUOTONE:\n return 'fa-duotone';\n case IconStyle.SHARP:\n return 'fa-sharp';\n case IconStyle.LIGHT:\n return 'fa-light';\n default:\n return 'fa-regular';\n }\n};\n\nexport const getFontSize = () => {\n const element = document.createElement('p');\n\n element.style.position = 'absolute';\n element.style.opacity = '0';\n\n element.textContent = 'Ich war hier';\n\n document.body.appendChild(element);\n\n const { fontSize } = window.getComputedStyle(element);\n\n document.body.removeChild(element);\n\n return fontSize.replace('px', '');\n};\n\nconst hexToRgb = (hex: string) => {\n let r: number;\n let g: number;\n let b: number;\n let a: number;\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i.exec(hex);\n\n if (result) {\n r = parseInt(result[1] ?? '0', 16);\n g = parseInt(result[2] ?? '0', 16);\n b = parseInt(result[3] ?? '0', 16);\n a = result[4] ? parseInt(result[4], 16) / 100 : 1;\n\n return { r, g, b, a };\n }\n\n return undefined;\n};\n\nexport const getHeadlineColorSelector = (data: ParagraphFormat[]) => {\n const themeResult: { [key: string]: string } = {};\n const headlineMap: { [key: string]: string } = {\n h1: 'headline-1',\n h2: 'headline-2',\n h3: 'headline-3',\n h4: 'headline-4',\n h5: 'headline-5',\n h6: 'headline-6',\n p: 'text',\n footer: 'footer',\n '.button': 'button',\n };\n\n data.forEach(({ selector, color, backgroundColor }) => {\n const selectors = selector.split(',');\n\n const tag = selectors[selectors.length - 1]?.trim();\n\n const path = headlineMap[tag ?? ''];\n\n if (!path) {\n return;\n }\n\n if (path === 'button' && backgroundColor) {\n themeResult[`${path}BackgroundColor`] = backgroundColor;\n\n if (color) {\n themeResult[`${path}Color`] = color;\n }\n\n return;\n }\n\n if (!color) {\n return;\n }\n\n themeResult[path] = color;\n\n const rgb = hexToRgb(color);\n\n if (!rgb) {\n return;\n }\n\n const { r, g, b } = rgb;\n\n themeResult[`${path}-rgb`] = `${r}, ${g}, ${b}`;\n });\n\n return { themeResult };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AAEO,MAAMC,gBAAgB,GAAIC,SAAoB,IAAK;EACtD,QAAQA,SAAS;IACb,KAAKC,8BAAS,CAACC,KAAK;MAChB,OAAO,UAAU;IACrB,KAAKD,8BAAS,CAACE,OAAO;MAClB,OAAO,YAAY;IACvB,KAAKF,8BAAS,CAACG,KAAK;MAChB,OAAO,UAAU;IACrB,KAAKH,8BAAS,CAACI,KAAK;MAChB,OAAO,UAAU;IACrB;MACI,OAAO,YAAY;EAC3B;AACJ,CAAC;AAACC,OAAA,CAAAP,gBAAA,GAAAA,gBAAA;AAEK,MAAMQ,WAAW,GAAGA,CAAA,KAAM;EAC7B,MAAMC,OAAO,GAAGC,QAAQ,CAACC,aAAa,CAAC,GAAG,CAAC;EAE3CF,OAAO,CAACG,KAAK,CAACC,QAAQ,GAAG,UAAU;EACnCJ,OAAO,CAACG,KAAK,CAACE,OAAO,GAAG,GAAG;EAE3BL,OAAO,CAACM,WAAW,GAAG,cAAc;EAEpCL,QAAQ,CAACM,IAAI,CAACC,WAAW,CAACR,OAAO,CAAC;EAElC,MAAM;IAAES;EAAS,CAAC,GAAGC,MAAM,CAACC,gBAAgB,CAACX,OAAO,CAAC;EAErDC,QAAQ,CAACM,IAAI,CAACK,WAAW,CAACZ,OAAO,CAAC;EAElC,OAAOS,QAAQ,CAACI,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;AACrC,CAAC;AAACf,OAAA,CAAAC,WAAA,GAAAA,WAAA;AAEF,MAAMe,QAAQ,GAAIC,GAAW,IAAK;EAC9B,IAAIC,CAAS;EACb,IAAIC,CAAS;EACb,IAAIC,CAAS;EACb,IAAI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AAA,CAAiCK,IAAI,CAAC,CAAC;IAEnD,MAAMC,IAAI,GAAGnB,WAAW,CAACgB,GAAG,IAAI,EAAE,CAAC;IAEnC,IAAI,CAACG,IAAI,EAAE;MACP;IACJ;IAEA,IAAIA,IAAI,KAAK,QAAQ,IAAIP,eAAe,EAAE;MACtCb,WAAW,CAAC,GAAGoB,IAAI,iBAAiB,CAAC,GAAGP,eAAe;MAEvD,IAAID,KAAK,EAAE;QACPZ,WAAW,CAAC,GAAGoB,IAAI,OAAO,CAAC,GAAGR,KAAK;MACvC;MAEA;IACJ;IAEA,IAAI,CAACA,KAAK,EAAE;MACR;IACJ;IAEAZ,WAAW,CAACoB,IAAI,CAAC,GAAGR,KAAK;IAEzB,MAAMS,GAAG,GAAGjC,QAAQ,CAACwB,KAAK,CAAC;IAE3B,IAAI,CAACS,GAAG,EAAE;MACN;IACJ;IAEA,MAAM;MAAE/B,CAAC;MAAEC,CAAC;MAAEC;IAAE,CAAC,GAAG6B,GAAG;IAEvBrB,WAAW,CAAC,GAAGoB,IAAI,MAAM,CAAC,GAAG,GAAG9B,CAAC,KAAKC,CAAC,KAAKC,CAAC,EAAE;EACnD,CAAC,CAAC;EAEF,OAAO;IAAEQ;EAAY,CAAC;AAC1B,CAAC;AAAC5B,OAAA,CAAA0B,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -3,86 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useUsableHeight = exports.getUsableHeight =
|
|
6
|
+
exports.useUsableHeight = exports.getUsableHeight = void 0;
|
|
7
7
|
var _chaynsApi = require("chayns-api");
|
|
8
|
-
|
|
9
|
-
const getPagePadding = () => {
|
|
10
|
-
const {
|
|
11
|
-
runtimeEnvironment
|
|
12
|
-
} = (0, _chaynsApi.getEnvironment)();
|
|
13
|
-
if (typeof runtimeEnvironment === 'number' && [4, 5].includes(runtimeEnvironment)) {
|
|
14
|
-
return '0';
|
|
15
|
-
}
|
|
16
|
-
if (matchMedia(_pageProvider.PAGE_BREAKPOINTS.desktop).matches) {
|
|
17
|
-
return '35px 43px 30px';
|
|
18
|
-
}
|
|
19
|
-
return '15px 10px 20px';
|
|
20
|
-
};
|
|
21
|
-
exports.getPagePadding = getPagePadding;
|
|
22
|
-
const getPageProviderInformation = () => {
|
|
23
|
-
const padding = getPagePadding().split(' ');
|
|
24
|
-
const parseValue = value => {
|
|
25
|
-
const parsed = parseInt(value.replace('px', ''), 10);
|
|
26
|
-
return Number.isNaN(parsed) ? 0 : parsed;
|
|
27
|
-
};
|
|
28
|
-
if (padding.length === 1) {
|
|
29
|
-
const value = parseValue(padding[0] ?? '');
|
|
30
|
-
return {
|
|
31
|
-
top: value,
|
|
32
|
-
right: value,
|
|
33
|
-
bottom: value,
|
|
34
|
-
left: value
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
if (padding.length === 2) {
|
|
38
|
-
const [vertical, horizontal] = padding.map(parseValue);
|
|
39
|
-
return {
|
|
40
|
-
top: vertical ?? 0,
|
|
41
|
-
right: horizontal ?? 0,
|
|
42
|
-
bottom: vertical ?? 0,
|
|
43
|
-
left: horizontal ?? 0
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
if (padding.length === 3) {
|
|
47
|
-
const [top, horizontal, bottom] = padding.map(parseValue);
|
|
48
|
-
return {
|
|
49
|
-
top: top ?? 0,
|
|
50
|
-
right: horizontal ?? 0,
|
|
51
|
-
bottom: bottom ?? 0,
|
|
52
|
-
left: horizontal ?? 0
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
if (padding.length === 4) {
|
|
56
|
-
const [top, right, bottom, left] = padding.map(parseValue);
|
|
57
|
-
return {
|
|
58
|
-
top: top ?? 0,
|
|
59
|
-
right: right ?? 0,
|
|
60
|
-
bottom: bottom ?? 0,
|
|
61
|
-
left: left ?? 0
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
return {
|
|
65
|
-
top: 0,
|
|
66
|
-
right: 0,
|
|
67
|
-
bottom: 0,
|
|
68
|
-
left: 0
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
const getUsableHeight = async shouldRemovePadding => {
|
|
8
|
+
const getUsableHeight = async () => {
|
|
72
9
|
let usableHeight;
|
|
73
10
|
const {
|
|
74
11
|
bottomBarHeight,
|
|
75
12
|
offsetTop,
|
|
76
13
|
windowHeight
|
|
77
14
|
} = await (0, _chaynsApi.getWindowMetrics)();
|
|
78
|
-
|
|
79
|
-
bottom,
|
|
80
|
-
top
|
|
81
|
-
} = shouldRemovePadding ? {
|
|
82
|
-
bottom: 0,
|
|
83
|
-
top: 0
|
|
84
|
-
} : getPageProviderInformation();
|
|
85
|
-
usableHeight = windowHeight - bottom - top;
|
|
15
|
+
usableHeight = windowHeight;
|
|
86
16
|
if (bottomBarHeight) {
|
|
87
17
|
usableHeight -= bottomBarHeight;
|
|
88
18
|
}
|
|
@@ -92,21 +22,14 @@ const getUsableHeight = async shouldRemovePadding => {
|
|
|
92
22
|
return usableHeight;
|
|
93
23
|
};
|
|
94
24
|
exports.getUsableHeight = getUsableHeight;
|
|
95
|
-
const useUsableHeight =
|
|
25
|
+
const useUsableHeight = () => {
|
|
96
26
|
let usableHeight;
|
|
97
27
|
const {
|
|
98
28
|
bottomBarHeight,
|
|
99
29
|
offsetTop,
|
|
100
30
|
windowHeight
|
|
101
31
|
} = (0, _chaynsApi.useWindowMetrics)();
|
|
102
|
-
|
|
103
|
-
bottom,
|
|
104
|
-
top
|
|
105
|
-
} = shouldRemovePadding ? {
|
|
106
|
-
bottom: 0,
|
|
107
|
-
top: 0
|
|
108
|
-
} : getPageProviderInformation();
|
|
109
|
-
usableHeight = windowHeight - bottom - top;
|
|
32
|
+
usableHeight = windowHeight;
|
|
110
33
|
if (bottomBarHeight) {
|
|
111
34
|
usableHeight -= bottomBarHeight;
|
|
112
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageProvider.js","names":["_chaynsApi","require","
|
|
1
|
+
{"version":3,"file":"pageProvider.js","names":["_chaynsApi","require","getUsableHeight","usableHeight","bottomBarHeight","offsetTop","windowHeight","getWindowMetrics","exports","useUsableHeight","useWindowMetrics"],"sources":["../../../src/utils/pageProvider.ts"],"sourcesContent":["import { getWindowMetrics, useWindowMetrics } from 'chayns-api';\n\nexport const getUsableHeight = async () => {\n let usableHeight;\n\n const { bottomBarHeight, offsetTop, windowHeight } = await getWindowMetrics();\n\n usableHeight = windowHeight;\n\n if (bottomBarHeight) {\n usableHeight -= bottomBarHeight;\n }\n\n if (offsetTop) {\n usableHeight -= offsetTop;\n }\n\n return usableHeight;\n};\n\nexport const useUsableHeight = () => {\n let usableHeight;\n\n const { bottomBarHeight, offsetTop, windowHeight } = useWindowMetrics();\n usableHeight = windowHeight;\n\n if (bottomBarHeight) {\n usableHeight -= bottomBarHeight;\n }\n\n if (offsetTop) {\n usableHeight -= offsetTop;\n }\n\n return usableHeight;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEO,MAAMC,eAAe,GAAG,MAAAA,CAAA,KAAY;EACvC,IAAIC,YAAY;EAEhB,MAAM;IAAEC,eAAe;IAAEC,SAAS;IAAEC;EAAa,CAAC,GAAG,MAAM,IAAAC,2BAAgB,EAAC,CAAC;EAE7EJ,YAAY,GAAGG,YAAY;EAE3B,IAAIF,eAAe,EAAE;IACjBD,YAAY,IAAIC,eAAe;EACnC;EAEA,IAAIC,SAAS,EAAE;IACXF,YAAY,IAAIE,SAAS;EAC7B;EAEA,OAAOF,YAAY;AACvB,CAAC;AAACK,OAAA,CAAAN,eAAA,GAAAA,eAAA;AAEK,MAAMO,eAAe,GAAGA,CAAA,KAAM;EACjC,IAAIN,YAAY;EAEhB,MAAM;IAAEC,eAAe;IAAEC,SAAS;IAAEC;EAAa,CAAC,GAAG,IAAAI,2BAAgB,EAAC,CAAC;EACvEP,YAAY,GAAGG,YAAY;EAE3B,IAAIF,eAAe,EAAE;IACjBD,YAAY,IAAIC,eAAe;EACnC;EAEA,IAAIC,SAAS,EAAE;IACXF,YAAY,IAAIE,SAAS;EAC7B;EAEA,OAAOF,YAAY;AACvB,CAAC;AAACK,OAAA,CAAAC,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionBody.js","names":["getDevice","React","useMemo","AccordionGroupContext","StyledMotionAccordionBody","AccordionBody","_ref","children","maxHeight","onScroll","shouldHideBody","onAnimationComplete","browser","AccordionGroupContextProviderValue","openAccordionUuid","undefined","createElement","animate","height","opacity","className","exit","initial","$maxHeight","$browser","name","transition","duration","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 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 onAnimationComplete?: VoidFunction;\n};\n\nconst AccordionBody: FC<AccordionBodyProps> = ({\n children,\n maxHeight,\n onScroll,\n shouldHideBody,\n onAnimationComplete,\n}) => {\n const { browser } = getDevice();\n\n const AccordionGroupContextProviderValue = useMemo(\n () => ({ openAccordionUuid: undefined }),\n [],\n );\n\n return (\n <StyledMotionAccordionBody\n animate={{ height: shouldHideBody ? '0' : 'auto', opacity: shouldHideBody ? 0 : 1 }}\n className=\"beta-chayns-accordion-body\"\n exit={{ height: 0, opacity: 0 }}\n initial={{ height: 0, opacity: 0 }}\n $maxHeight={maxHeight}\n $browser={browser?.name}\n onAnimationComplete={onAnimationComplete}\n onScroll={onScroll}\n transition={{ opacity: { duration: 0.1 } }}\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;
|
|
1
|
+
{"version":3,"file":"AccordionBody.js","names":["getDevice","React","useMemo","AccordionGroupContext","StyledMotionAccordionBody","AccordionBody","_ref","children","maxHeight","onScroll","shouldHideBody","onAnimationComplete","browser","AccordionGroupContextProviderValue","openAccordionUuid","undefined","createElement","animate","height","opacity","className","exit","initial","$maxHeight","$browser","name","transition","duration","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 onAnimationComplete?: VoidFunction;\n};\n\nconst AccordionBody: FC<AccordionBodyProps> = ({\n children,\n maxHeight,\n onScroll,\n shouldHideBody,\n onAnimationComplete,\n}) => {\n const { browser } = getDevice();\n\n const AccordionGroupContextProviderValue = useMemo(\n () => ({ openAccordionUuid: undefined }),\n [],\n );\n\n return (\n <StyledMotionAccordionBody\n animate={{ height: shouldHideBody ? '0' : 'auto', opacity: shouldHideBody ? 0 : 1 }}\n className=\"beta-chayns-accordion-body\"\n exit={{ height: 0, opacity: 0 }}\n initial={{ height: 0, opacity: 0 }}\n $maxHeight={maxHeight}\n $browser={browser?.name as BrowserName}\n onAnimationComplete={onAnimationComplete}\n onScroll={onScroll}\n transition={{ opacity: { duration: 0.1 } }}\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;AAuBlE,MAAMC,aAAqC,GAAGC,IAAA,IAMxC;EAAA,IANyC;IAC3CC,QAAQ;IACRC,SAAS;IACTC,QAAQ;IACRC,cAAc;IACdC;EACJ,CAAC,GAAAL,IAAA;EACG,MAAM;IAAEM;EAAQ,CAAC,GAAGZ,SAAS,CAAC,CAAC;EAE/B,MAAMa,kCAAkC,GAAGX,OAAO,CAC9C,OAAO;IAAEY,iBAAiB,EAAEC;EAAU,CAAC,CAAC,EACxC,EACJ,CAAC;EAED,oBACId,KAAA,CAAAe,aAAA,CAACZ,yBAAyB;IACtBa,OAAO,EAAE;MAAEC,MAAM,EAAER,cAAc,GAAG,GAAG,GAAG,MAAM;MAAES,OAAO,EAAET,cAAc,GAAG,CAAC,GAAG;IAAE,CAAE;IACpFU,SAAS,EAAC,4BAA4B;IACtCC,IAAI,EAAE;MAAEH,MAAM,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAE,CAAE;IAChCG,OAAO,EAAE;MAAEJ,MAAM,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAE,CAAE;IACnCI,UAAU,EAAEf,SAAU;IACtBgB,QAAQ,EAAEZ,OAAO,EAAEa,IAAoB;IACvCd,mBAAmB,EAAEA,mBAAoB;IACzCF,QAAQ,EAAEA,QAAS;IACnBiB,UAAU,EAAE;MAAEP,OAAO,EAAE;QAAEQ,QAAQ,EAAE;MAAI;IAAE;EAAE,gBAE3C1B,KAAA,CAAAe,aAAA,CAACb,qBAAqB,CAACyB,QAAQ;IAACC,KAAK,EAAEhB;EAAmC,GACrEN,QAC2B,CACT,CAAC;AAEpC,CAAC;AAEDF,aAAa,CAACyB,WAAW,GAAG,eAAe;AAE3C,eAAezB,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionBody.styles.js","names":["motion","styled","css","StyledMotionAccordionBody","div","_ref","$maxHeight","_ref2","$browser","theme"],"sources":["../../../../../src/components/accordion/accordion-body/AccordionBody.styles.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"AccordionBody.styles.js","names":["motion","styled","css","StyledMotionAccordionBody","div","_ref","$maxHeight","_ref2","$browser","theme"],"sources":["../../../../../src/components/accordion/accordion-body/AccordionBody.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\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\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,eAAe;AACtC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAS/C,OAAO,MAAMC,yBAAyB,GAAGF,MAAM,CAACD,MAAM,CAACI,GAAG,CAAiC;AAC3F;AACA;AACA,MAAMC,IAAA;EAAA,IAAC;IAAEC;EAAW,CAAC,GAAAD,IAAA;EAAA,OACb,OAAOC,UAAU,KAAK,QAAQ,IAC9BJ,GAAG;AACX,0BAA0BI,UAAU;AACpC;AACA,SAAS;AAAA;AACT;AACA;AACA,MAAMC,KAAA;EAAA,IAAC;IAAEC,QAAQ;IAAEC;EAAsC,CAAC,GAAAF,KAAA;EAAA,OAClDC,QAAQ,KAAK,SAAS,GAChBN,GAAG;AACjB,0CAA0CO,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACDP,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CO,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AAAA;AACf,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionContent.js","names":["getDevice","React","AccordionContext","StyledAccordionContent","AccordionContent","_ref","children","maxHeight","onScroll","shouldPreventBottomSpace","browser","createElement","Consumer","_ref2","isWrapped","className","$isWrapped","$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 { AccordionContext } from '../Accordion';\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 <AccordionContext.Consumer>\n {({ isWrapped }) => (\n <StyledAccordionContent\n className=\"beta-chayns-accordion-content\"\n $isWrapped={isWrapped}\n $browser={browser?.name}\n $maxHeight={maxHeight}\n onScroll={onScroll}\n $shouldPreventBottomSpace={shouldPreventBottomSpace}\n >\n {children}\n </StyledAccordionContent>\n )}\n </AccordionContext.Consumer>\n );\n};\n\nAccordionContent.displayName = 'AccordionContent';\n\nexport default AccordionContent;\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,YAAY;AACtC,OAAOC,KAAK,MAAkC,OAAO;
|
|
1
|
+
{"version":3,"file":"AccordionContent.js","names":["getDevice","React","AccordionContext","StyledAccordionContent","AccordionContent","_ref","children","maxHeight","onScroll","shouldPreventBottomSpace","browser","createElement","Consumer","_ref2","isWrapped","className","$isWrapped","$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 { AccordionContext } from '../Accordion';\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 <AccordionContext.Consumer>\n {({ isWrapped }) => (\n <StyledAccordionContent\n className=\"beta-chayns-accordion-content\"\n $isWrapped={isWrapped}\n $browser={browser?.name as BrowserName}\n $maxHeight={maxHeight}\n onScroll={onScroll}\n $shouldPreventBottomSpace={shouldPreventBottomSpace}\n >\n {children}\n </StyledAccordionContent>\n )}\n </AccordionContext.Consumer>\n );\n};\n\nAccordionContent.displayName = 'AccordionContent';\n\nexport default AccordionContent;\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,YAAY;AACtC,OAAOC,KAAK,MAAkC,OAAO;AAErD,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,sBAAsB,QAAQ,2BAA2B;AAqBlE,MAAMC,gBAA2C,GAAGC,IAAA,IAK9C;EAAA,IAL+C;IACjDC,QAAQ;IACRC,SAAS;IACTC,QAAQ;IACRC,wBAAwB,GAAG;EAC/B,CAAC,GAAAJ,IAAA;EACG,MAAM;IAAEK;EAAQ,CAAC,GAAGV,SAAS,CAAC,CAAC;EAE/B,oBACIC,KAAA,CAAAU,aAAA,CAACT,gBAAgB,CAACU,QAAQ,QACrBC,KAAA;IAAA,IAAC;MAAEC;IAAU,CAAC,GAAAD,KAAA;IAAA,oBACXZ,KAAA,CAAAU,aAAA,CAACR,sBAAsB;MACnBY,SAAS,EAAC,+BAA+B;MACzCC,UAAU,EAAEF,SAAU;MACtBG,QAAQ,EAAEP,OAAO,EAAEQ,IAAoB;MACvCC,UAAU,EAAEZ,SAAU;MACtBC,QAAQ,EAAEA,QAAS;MACnBY,yBAAyB,EAAEX;IAAyB,GAEnDH,QACmB,CAAC;EAAA,CAEN,CAAC;AAEpC,CAAC;AAEDF,gBAAgB,CAACiB,WAAW,GAAG,kBAAkB;AAEjD,eAAejB,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionContent.styles.js","names":["styled","css","StyledAccordionContent","div","_ref","theme","text","_ref2","$isWrapped","_ref3","$shouldPreventBottomSpace","_ref4","$maxHeight","_ref5","$browser"],"sources":["../../../../../src/components/accordion/accordion-content/AccordionContent.styles.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"AccordionContent.styles.js","names":["styled","css","StyledAccordionContent","div","_ref","theme","text","_ref2","$isWrapped","_ref3","$shouldPreventBottomSpace","_ref4","$maxHeight","_ref5","$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 $isWrapped?: boolean;\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: ${({ $isWrapped }) => ($isWrapped ? '0 9px 18px 26px' : '0 9px 9px 10px')};\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;AAW/C,OAAO,MAAMC,sBAAsB,GAAGF,MAAM,CAACG,GAAgC;AAC7E,aAAaC,IAAA;EAAA,IAAC;IAAEC;EAAmC,CAAC,GAAAD,IAAA;EAAA,OAAKC,KAAK,CAACC,IAAI;AAAA;AACnE,eAAeC,KAAA;EAAA,IAAC;IAAEC;EAAW,CAAC,GAAAD,KAAA;EAAA,OAAMC,UAAU,GAAG,iBAAiB,GAAG,gBAAgB;AAAA,CAAC;AACtF;AACA,MAAMC,KAAA;EAAA,IAAC;IAAEC;EAA0B,CAAC,GAAAD,KAAA;EAAA,OAC5BC,yBAAyB,IACzBT,GAAG;AACX;AACA,SAAS;AAAA;AACT;AACA,MAAMU,KAAA;EAAA,IAAC;IAAEC;EAAW,CAAC,GAAAD,KAAA;EAAA,OACb,OAAOC,UAAU,KAAK,QAAQ,IAC9BX,GAAG;AACX,0BAA0BW,UAAU;AACpC;AACA,SAAS;AAAA;AACT;AACA;AACA,MAAMC,KAAA;EAAA,IAAC;IAAEC,QAAQ;IAAET;EAAmC,CAAC,GAAAQ,KAAA;EAAA,OAC/CC,QAAQ,KAAK,SAAS,GAChBb,GAAG;AACjB,0CAA0CI,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACDJ,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CI,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AAAA;AACf,CAAC","ignoreList":[]}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { getAvailableColorList, getColorFromPalette, hexToRgb255 } from '@chayns/colors';
|
|
2
|
-
import { useSite } from 'chayns-api';
|
|
2
|
+
import { ColorMode, useSite, useStyleSettings } from 'chayns-api';
|
|
3
3
|
import React, { createContext, useContext, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { Helmet } from 'react-helmet';
|
|
5
5
|
import { createGlobalStyle, ThemeProvider } from 'styled-components';
|
|
6
|
-
import { getDesignSettings, getParagraphFormat } from '../../api/theme/get';
|
|
7
6
|
import { convertIconStyle, getFontSize, getHeadlineColorSelector } from '../../utils/font';
|
|
8
7
|
import { StyledColorSchemeProvider } from './ColorSchemeProvider.styles';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
ColorMode[ColorMode["Light"] = 2] = "Light";
|
|
13
|
-
return ColorMode;
|
|
14
|
-
}(ColorMode || {}); // ToDo remove type after the framer-motion bug is Fixed
|
|
8
|
+
|
|
9
|
+
// ToDo remove type after the framer-motion bug is Fixed
|
|
10
|
+
|
|
15
11
|
const GlobalStyle = createGlobalStyle`
|
|
16
12
|
.ellipsis {
|
|
17
13
|
overflow: hidden;
|
|
@@ -28,7 +24,6 @@ const ColorSchemeProvider = _ref => {
|
|
|
28
24
|
colorMode,
|
|
29
25
|
cssVariables = {},
|
|
30
26
|
secondaryColor,
|
|
31
|
-
siteId,
|
|
32
27
|
style = {},
|
|
33
28
|
paragraphFormat,
|
|
34
29
|
designSettings,
|
|
@@ -44,24 +39,24 @@ const ColorSchemeProvider = _ref => {
|
|
|
44
39
|
color: internalColor,
|
|
45
40
|
colorMode: internalColorMode
|
|
46
41
|
} = useSite() ?? {};
|
|
42
|
+
const {
|
|
43
|
+
designSettings: designSettingsValue,
|
|
44
|
+
paragraphFormats: paragraphFormatValue
|
|
45
|
+
} = useStyleSettings() ?? {};
|
|
47
46
|
useEffect(() => {
|
|
48
47
|
if (designSettings) {
|
|
49
48
|
setInternalDesignSettings(designSettings);
|
|
50
|
-
} else if (
|
|
51
|
-
|
|
52
|
-
setInternalDesignSettings(result);
|
|
53
|
-
});
|
|
49
|
+
} else if (designSettingsValue) {
|
|
50
|
+
setInternalDesignSettings(designSettingsValue);
|
|
54
51
|
}
|
|
55
|
-
}, [designSettings,
|
|
52
|
+
}, [designSettings, designSettingsValue]);
|
|
56
53
|
useEffect(() => {
|
|
57
54
|
if (paragraphFormat) {
|
|
58
55
|
setInternalParagraphFormat(paragraphFormat);
|
|
59
|
-
} else if (
|
|
60
|
-
|
|
61
|
-
setInternalParagraphFormat(result);
|
|
62
|
-
});
|
|
56
|
+
} else if (paragraphFormatValue) {
|
|
57
|
+
setInternalParagraphFormat(paragraphFormatValue);
|
|
63
58
|
}
|
|
64
|
-
}, [
|
|
59
|
+
}, [paragraphFormat, paragraphFormatValue]);
|
|
65
60
|
useEffect(() => {
|
|
66
61
|
let newTheme = {};
|
|
67
62
|
const availableColors = getAvailableColorList();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSchemeProvider.js","names":["getAvailableColorList","getColorFromPalette","hexToRgb255","useSite","React","createContext","useContext","useEffect","useMemo","useState","Helmet","createGlobalStyle","ThemeProvider","getDesignSettings","getParagraphFormat","convertIconStyle","getFontSize","getHeadlineColorSelector","StyledColorSchemeProvider","ColorMode","GlobalStyle","ColorSchemeContext","undefined","useColorScheme","ColorSchemeProvider","_ref","children","color","colorMode","cssVariables","secondaryColor","siteId","style","paragraphFormat","designSettings","theme","colors","internalTheme","setInternalTheme","internalDesignSettings","setInternalDesignSettings","internalParagraphFormat","setInternalParagraphFormat","internalColor","internalColorMode","then","result","newTheme","availableColors","forEach","colorName","hexColor","rgbColor","r","g","b","Light","Dark","Object","keys","key","iconStyle","themeResult","fontSize","contextValue","createElement","Provider","value","rel","href","className","displayName"],"sources":["../../../../src/components/color-scheme-provider/ColorSchemeProvider.tsx"],"sourcesContent":["import { getAvailableColorList, getColorFromPalette, hexToRgb255 } from '@chayns/colors';\nimport { useSite } from 'chayns-api';\nimport React, {\n createContext,\n FC,\n ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { Helmet } from 'react-helmet';\nimport { createGlobalStyle, ThemeProvider } from 'styled-components';\nimport { getDesignSettings, getParagraphFormat } from '../../api/theme/get';\nimport type { DesignSettings, ParagraphFormat } from '../../types/colorSchemeProvider';\nimport { convertIconStyle, getFontSize, getHeadlineColorSelector } from '../../utils/font';\nimport { StyledColorSchemeProvider } from './ColorSchemeProvider.styles';\n\nenum ColorMode {\n Classic,\n Dark,\n Light,\n}\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 colors of the components\n */\n colors?: Theme;\n /**\n * The color mode to be used for the children\n */\n colorMode?: ColorMode;\n /**\n * Css variables to be added in addition to the chayns variables\n */\n cssVariables?: { [key: string]: string | number };\n /**\n * The design settings of a page.\n */\n designSettings?: DesignSettings;\n /**\n * The general format settings.\n */\n paragraphFormat?: ParagraphFormat[];\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 * The theme for the components\n */\n theme?: Theme;\n};\n\nexport interface Theme {\n [key: string]: string;\n}\n\nexport type WithTheme<T> = T & {\n theme: Theme;\n};\n\n// ToDo remove type after the framer-motion bug is Fixed\nexport type FramerMotionBugFix = WithTheme<unknown>;\n\nconst GlobalStyle = createGlobalStyle`\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n`;\n\nexport interface ColorSchemeContextProps {\n designSettings: DesignSettings;\n paragraphFormat: ParagraphFormat[];\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,\n colorMode,\n cssVariables = {},\n secondaryColor,\n siteId,\n style = {},\n paragraphFormat,\n designSettings,\n theme,\n colors,\n}) => {\n const [internalTheme, setInternalTheme] = useState<Theme>(theme ?? {});\n const [internalDesignSettings, setInternalDesignSettings] = useState<DesignSettings>();\n const [internalParagraphFormat, setInternalParagraphFormat] = useState<ParagraphFormat[]>();\n\n // Empty object is used to prevent error if ColorSchemeProvider is rendered on server\n const { color: internalColor, colorMode: internalColorMode } = useSite() ?? {};\n\n useEffect(() => {\n if (designSettings) {\n setInternalDesignSettings(designSettings);\n } else if (!internalDesignSettings) {\n void getDesignSettings(siteId).then((result) => {\n setInternalDesignSettings(result);\n });\n }\n }, [designSettings, internalDesignSettings, siteId]);\n\n useEffect(() => {\n if (paragraphFormat) {\n setInternalParagraphFormat(paragraphFormat);\n } else if (!internalParagraphFormat) {\n void getParagraphFormat(siteId).then((result) => {\n setInternalParagraphFormat(result);\n });\n }\n }, [internalParagraphFormat, paragraphFormat, siteId]);\n\n useEffect(() => {\n let newTheme: Theme = {};\n\n const availableColors = getAvailableColorList();\n\n if (!colors || !theme) {\n availableColors.forEach((colorName: string) => {\n const hexColor = getColorFromPalette(colorName, {\n color: color ?? internalColor,\n colorMode: colorMode ?? internalColorMode,\n secondaryColor,\n });\n\n if (hexColor) {\n const rgbColor = hexToRgb255(hexColor);\n\n if (!theme) {\n newTheme[colorName] = hexColor;\n }\n\n if (rgbColor) {\n if (!theme) {\n newTheme[`${colorName}-rgb`] =\n `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;\n }\n }\n }\n });\n }\n\n if (!theme) {\n switch (colorMode ?? internalColorMode) {\n case ColorMode.Light:\n newTheme.colorMode = 'light';\n break;\n case ColorMode.Dark:\n newTheme.colorMode = 'dark';\n break;\n default:\n newTheme.colorMode = 'classic';\n break;\n }\n\n if (internalDesignSettings) {\n Object.keys(internalDesignSettings).forEach((key) => {\n if (key === 'iconStyle') {\n newTheme[key] = convertIconStyle(internalDesignSettings.iconStyle);\n\n return;\n }\n\n // ToDo: Find better solution\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n newTheme[key] = internalDesignSettings[key];\n });\n }\n\n if (internalParagraphFormat) {\n const { themeResult } = getHeadlineColorSelector(internalParagraphFormat);\n\n // Update Theme\n Object.keys(themeResult).forEach((key) => {\n // ToDo: Find better solution\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n newTheme[key] = themeResult[key];\n });\n }\n\n newTheme.fontSize = getFontSize();\n } else {\n newTheme = theme;\n }\n\n setInternalTheme(newTheme);\n }, [\n color,\n colorMode,\n colors,\n internalColor,\n internalColorMode,\n internalDesignSettings,\n internalParagraphFormat,\n secondaryColor,\n theme,\n ]);\n\n const contextValue: ColorSchemeContextProps | undefined = useMemo(() => {\n if (internalDesignSettings && internalParagraphFormat) {\n return {\n paragraphFormat: internalParagraphFormat,\n designSettings: internalDesignSettings,\n theme: internalTheme,\n };\n }\n\n return undefined;\n }, [internalDesignSettings, internalParagraphFormat, internalTheme]);\n\n return (\n <ThemeProvider theme={internalTheme}>\n <ColorSchemeContext.Provider value={contextValue}>\n <Helmet>\n <link\n rel=\"stylesheet\"\n href=\"https://api.chayns-static.space/font/NotoColorEmoji/v1/font.css\"\n />\n </Helmet>\n <StyledColorSchemeProvider\n className=\"color-scheme-provider\"\n style={{\n ...cssVariables,\n ...style,\n }}\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,SAASA,qBAAqB,EAAEC,mBAAmB,EAAEC,WAAW,QAAQ,gBAAgB;AACxF,SAASC,OAAO,QAAQ,YAAY;AACpC,OAAOC,KAAK,IACRC,aAAa,EAGbC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QA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,QAAQ,GAAGZ,KAAK;IACpB;IAEAG,gBAAgB,CAACS,QAAQ,CAAC;EAC9B,CAAC,EAAE,CACCpB,KAAK,EACLC,SAAS,EACTQ,MAAM,EACNO,aAAa,EACbC,iBAAiB,EACjBL,sBAAsB,EACtBE,uBAAuB,EACvBX,cAAc,EACdK,KAAK,CACR,CAAC;EAEF,MAAM6B,YAAiD,GAAGxD,OAAO,CAAC,MAAM;IACpE,IAAI+B,sBAAsB,IAAIE,uBAAuB,EAAE;MACnD,OAAO;QACHR,eAAe,EAAEQ,uBAAuB;QACxCP,cAAc,EAAEK,sBAAsB;QACtCJ,KAAK,EAAEE;MACX,CAAC;IACL;IAEA,OAAOf,SAAS;EACpB,CAAC,EAAE,CAACiB,sBAAsB,EAAEE,uBAAuB,EAAEJ,aAAa,CAAC,CAAC;EAEpE,oBACIjC,KAAA,CAAA6D,aAAA,CAACrD,aAAa;IAACuB,KAAK,EAAEE;EAAc,gBAChCjC,KAAA,CAAA6D,aAAA,CAAC5C,kBAAkB,CAAC6C,QAAQ;IAACC,KAAK,EAAEH;EAAa,gBAC7C5D,KAAA,CAAA6D,aAAA,CAACvD,MAAM,qBACHN,KAAA,CAAA6D,aAAA;IACIG,GAAG,EAAC,YAAY;IAChBC,IAAI,EAAC;EAAiE,CACzE,CACG,CAAC,eACTjE,KAAA,CAAA6D,aAAA,CAAC/C,yBAAyB;IACtBoD,SAAS,EAAC,uBAAuB;IACjCtC,KAAK,EAAE;MACH,GAAGH,YAAY;MACf,GAAGG;IACP;EAAE,GAEDN,QACsB,CAAC,eAC5BtB,KAAA,CAAA6D,aAAA,CAAC7C,WAAW,MAAE,CACW,CAClB,CAAC;AAExB,CAAC;AAEDI,mBAAmB,CAAC+C,WAAW,GAAG,qBAAqB;AAEvD,eAAe/C,mBAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ColorSchemeProvider.js","names":["getAvailableColorList","getColorFromPalette","hexToRgb255","ColorMode","useSite","useStyleSettings","React","createContext","useContext","useEffect","useMemo","useState","Helmet","createGlobalStyle","ThemeProvider","convertIconStyle","getFontSize","getHeadlineColorSelector","StyledColorSchemeProvider","GlobalStyle","ColorSchemeContext","undefined","useColorScheme","ColorSchemeProvider","_ref","children","color","colorMode","cssVariables","secondaryColor","style","paragraphFormat","designSettings","theme","colors","internalTheme","setInternalTheme","internalDesignSettings","setInternalDesignSettings","internalParagraphFormat","setInternalParagraphFormat","internalColor","internalColorMode","designSettingsValue","paragraphFormats","paragraphFormatValue","newTheme","availableColors","forEach","colorName","hexColor","rgbColor","r","g","b","Light","Dark","Object","keys","key","iconStyle","themeResult","fontSize","contextValue","createElement","Provider","value","rel","href","className","displayName"],"sources":["../../../../src/components/color-scheme-provider/ColorSchemeProvider.tsx"],"sourcesContent":["import { getAvailableColorList, getColorFromPalette, hexToRgb255 } from '@chayns/colors';\nimport { ColorMode, useSite, useStyleSettings } from 'chayns-api';\nimport React, {\n createContext,\n FC,\n ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { Helmet } from 'react-helmet';\nimport { createGlobalStyle, ThemeProvider } from 'styled-components';\nimport type { DesignSettings, ParagraphFormat } from '../../types/colorSchemeProvider';\nimport { convertIconStyle, getFontSize, getHeadlineColorSelector } from '../../utils/font';\nimport { StyledColorSchemeProvider } from './ColorSchemeProvider.styles';\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 colors of the components\n */\n colors?: Theme;\n /**\n * The color mode to be used for the children\n */\n colorMode?: ColorMode;\n /**\n * Css variables to be added in addition to the chayns variables\n */\n cssVariables?: { [key: string]: string | number };\n /**\n * The design settings of a page.\n */\n designSettings?: DesignSettings;\n /**\n * The general format settings.\n */\n paragraphFormat?: ParagraphFormat[];\n /**\n * The secondary hex color to be used for the children\n */\n secondaryColor?: string;\n /**\n * Additional styles set on the root element\n */\n style?: { [key: string]: string | number };\n /**\n * The theme for the components\n */\n theme?: Theme;\n};\n\nexport interface Theme {\n [key: string]: string;\n}\n\nexport type WithTheme<T> = T & {\n theme: Theme;\n};\n\n// ToDo remove type after the framer-motion bug is Fixed\nexport type FramerMotionBugFix = WithTheme<unknown>;\n\nconst GlobalStyle = createGlobalStyle`\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n`;\n\nexport interface ColorSchemeContextProps {\n designSettings: DesignSettings;\n paragraphFormat: ParagraphFormat[];\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,\n colorMode,\n cssVariables = {},\n secondaryColor,\n style = {},\n paragraphFormat,\n designSettings,\n theme,\n colors,\n}) => {\n const [internalTheme, setInternalTheme] = useState<Theme>(theme ?? {});\n const [internalDesignSettings, setInternalDesignSettings] = useState<DesignSettings>();\n const [internalParagraphFormat, setInternalParagraphFormat] = useState<ParagraphFormat[]>();\n\n // Empty object is used to prevent error if ColorSchemeProvider is rendered on server\n const { color: internalColor, colorMode: internalColorMode } = useSite() ?? {};\n const { designSettings: designSettingsValue, paragraphFormats: paragraphFormatValue } =\n useStyleSettings() ?? {};\n\n useEffect(() => {\n if (designSettings) {\n setInternalDesignSettings(designSettings);\n } else if (designSettingsValue) {\n setInternalDesignSettings(designSettingsValue);\n }\n }, [designSettings, designSettingsValue]);\n\n useEffect(() => {\n if (paragraphFormat) {\n setInternalParagraphFormat(paragraphFormat);\n } else if (paragraphFormatValue) {\n setInternalParagraphFormat(paragraphFormatValue);\n }\n }, [paragraphFormat, paragraphFormatValue]);\n\n useEffect(() => {\n let newTheme: Theme = {};\n\n const availableColors = getAvailableColorList();\n\n if (!colors || !theme) {\n availableColors.forEach((colorName: string) => {\n const hexColor = getColorFromPalette(colorName, {\n color: color ?? internalColor,\n colorMode: colorMode ?? internalColorMode,\n secondaryColor,\n });\n\n if (hexColor) {\n const rgbColor = hexToRgb255(hexColor);\n\n if (!theme) {\n newTheme[colorName] = hexColor;\n }\n\n if (rgbColor) {\n if (!theme) {\n newTheme[`${colorName}-rgb`] =\n `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;\n }\n }\n }\n });\n }\n\n if (!theme) {\n switch (colorMode ?? internalColorMode) {\n case ColorMode.Light:\n newTheme.colorMode = 'light';\n break;\n case ColorMode.Dark:\n newTheme.colorMode = 'dark';\n break;\n default:\n newTheme.colorMode = 'classic';\n break;\n }\n\n if (internalDesignSettings) {\n Object.keys(internalDesignSettings).forEach((key) => {\n if (key === 'iconStyle') {\n newTheme[key] = convertIconStyle(internalDesignSettings.iconStyle);\n\n return;\n }\n\n // ToDo: Find better solution\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n newTheme[key] = internalDesignSettings[key];\n });\n }\n\n if (internalParagraphFormat) {\n const { themeResult } = getHeadlineColorSelector(internalParagraphFormat);\n\n // Update Theme\n Object.keys(themeResult).forEach((key) => {\n // ToDo: Find better solution\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n newTheme[key] = themeResult[key];\n });\n }\n\n newTheme.fontSize = getFontSize();\n } else {\n newTheme = theme;\n }\n\n setInternalTheme(newTheme);\n }, [\n color,\n colorMode,\n colors,\n internalColor,\n internalColorMode,\n internalDesignSettings,\n internalParagraphFormat,\n secondaryColor,\n theme,\n ]);\n\n const contextValue: ColorSchemeContextProps | undefined = useMemo(() => {\n if (internalDesignSettings && internalParagraphFormat) {\n return {\n paragraphFormat: internalParagraphFormat,\n designSettings: internalDesignSettings,\n theme: internalTheme,\n };\n }\n\n return undefined;\n }, [internalDesignSettings, internalParagraphFormat, internalTheme]);\n\n return (\n <ThemeProvider theme={internalTheme}>\n <ColorSchemeContext.Provider value={contextValue}>\n <Helmet>\n <link\n rel=\"stylesheet\"\n href=\"https://api.chayns-static.space/font/NotoColorEmoji/v1/font.css\"\n />\n </Helmet>\n <StyledColorSchemeProvider\n className=\"color-scheme-provider\"\n style={{\n ...cssVariables,\n ...style,\n }}\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,SAASA,qBAAqB,EAAEC,mBAAmB,EAAEC,WAAW,QAAQ,gBAAgB;AACxF,SAASC,SAAS,EAAEC,OAAO,EAAEC,gBAAgB,QAAQ,YAAY;AACjE,OAAOC,KAAK,IACRC,aAAa,EAGbC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACL,OAAO;AACd,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,iBAAiB,EAAEC,aAAa,QAAQ,mBAAmB;AAEpE,SAASC,gBAAgB,EAAEC,WAAW,EAAEC,wBAAwB,QAAQ,kBAAkB;AAC1F,SAASC,yBAAyB,QAAQ,8BAA8B;;AAqDxE;;AAGA,MAAMC,WAAW,GAAGN,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA,CAAC;AAQD,OAAO,MAAMO,kBAAkB,gBAAGb,aAAa,CAAsCc,SAAS,CAAC;AAE/F,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAAMd,UAAU,CAACY,kBAAkB,CAAC;AAElE,MAAMG,mBAAiD,GAAGC,IAAA,IAWpD;EAAA,IAXqD;IACvDC,QAAQ;IACRC,KAAK;IACLC,SAAS;IACTC,YAAY,GAAG,CAAC,CAAC;IACjBC,cAAc;IACdC,KAAK,GAAG,CAAC,CAAC;IACVC,eAAe;IACfC,cAAc;IACdC,KAAK;IACLC;EACJ,CAAC,GAAAV,IAAA;EACG,MAAM,CAACW,aAAa,EAAEC,gBAAgB,CAAC,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CAAC7C,WAAW,MAAE,CACW,CAClB,CAAC;AAExB,CAAC;AAEDI,mBAAmB,CAAC+C,WAAW,GAAG,qBAAqB;AAEvD,eAAe/C,mBAAmB","ignoreList":[]}
|
|
@@ -2,9 +2,15 @@ import { getAvailableColorList } from '@chayns/colors';
|
|
|
2
2
|
import { styled } from 'styled-components';
|
|
3
3
|
export const StyledColorSchemeProvider = styled.div`
|
|
4
4
|
color: var(--chayns-color--text);
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
|
|
6
|
+
${_ref => {
|
|
7
|
+
let {
|
|
8
|
+
theme
|
|
9
|
+
} = _ref;
|
|
10
|
+
return getAvailableColorList().map(colorName => {
|
|
11
|
+
const colorNameRgb = `${colorName}-rgb`;
|
|
12
|
+
return [`--chayns-color--${colorName}: ${theme[colorName]};`, `--chayns-color-rgb--${colorName}: ${theme[colorNameRgb]};`];
|
|
13
|
+
});
|
|
14
|
+
}}
|
|
9
15
|
`;
|
|
10
16
|
//# sourceMappingURL=ColorSchemeProvider.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSchemeProvider.styles.js","names":["getAvailableColorList","styled","StyledColorSchemeProvider","div","
|
|
1
|
+
{"version":3,"file":"ColorSchemeProvider.styles.js","names":["getAvailableColorList","styled","StyledColorSchemeProvider","div","_ref","theme","map","colorName","colorNameRgb"],"sources":["../../../../src/components/color-scheme-provider/ColorSchemeProvider.styles.ts"],"sourcesContent":["import { getAvailableColorList } from '@chayns/colors';\nimport { styled } from 'styled-components';\nimport { WithTheme } from './ColorSchemeProvider';\n\ntype ColorSchemeProviderProps = WithTheme<unknown>;\n\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"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,MAAM,QAAQ,mBAAmB;AAK1C,OAAO,MAAMC,yBAAyB,GAAGD,MAAM,CAACE,GAA6B;AAC7E;AACA;AACA,MAAMC,IAAA;EAAA,IAAC;IAAEC;EAAgC,CAAC,GAAAD,IAAA;EAAA,OAClCJ,qBAAqB,CAAC,CAAC,CAACM,GAAG,CAAEC,SAAiB,IAAK;IAC/C,MAAMC,YAAY,GAAG,GAAGD,SAAS,MAAM;IACvC,OAAO,CACH,mBAAmBA,SAAS,KAAKF,KAAK,CAACE,SAAS,CAAC,GAAG,EACpD,uBAAuBA,SAAS,KAAKF,KAAK,CAACG,YAAY,CAAC,GAAG,CAC9D;EACL,CAAC,CAAC;AAAA;AACV,CAAC","ignoreList":[]}
|