@chayns-components/core 5.0.0-beta.433 → 5.0.0-beta.435
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/api/theme/get.d.ts +2 -0
- package/lib/api/theme/get.js +21 -0
- package/lib/api/theme/get.js.map +1 -0
- package/lib/components/accordion/Accordion.d.ts +4 -0
- package/lib/components/accordion/Accordion.js +2 -0
- package/lib/components/accordion/Accordion.js.map +1 -1
- package/lib/components/accordion/Accordion.styles.js +23 -15
- package/lib/components/accordion/Accordion.styles.js.map +1 -1
- package/lib/components/accordion/accordion-head/AccordionHead.d.ts +1 -0
- package/lib/components/accordion/accordion-head/AccordionHead.js +23 -4
- package/lib/components/accordion/accordion-head/AccordionHead.js.map +1 -1
- package/lib/components/accordion/accordion-head/AccordionHead.styles.d.ts +4 -0
- package/lib/components/accordion/accordion-head/AccordionHead.styles.js +40 -19
- package/lib/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
- package/lib/components/color-scheme-provider/ColorSchemeProvider.d.ts +5 -0
- package/lib/components/color-scheme-provider/ColorSchemeProvider.js +42 -12
- package/lib/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/components/content-card/ContentCard.styles.js +19 -2
- package/lib/components/content-card/ContentCard.styles.js.map +1 -1
- package/lib/components/icon/Icon.js +5 -1
- package/lib/components/icon/Icon.js.map +1 -1
- package/lib/components/text-area/TextArea.js +5 -25
- package/lib/components/text-area/TextArea.js.map +1 -1
- package/lib/types/colorSchemeProvider.d.ts +15 -0
- package/lib/types/colorSchemeProvider.js +15 -0
- package/lib/types/colorSchemeProvider.js.map +1 -0
- package/lib/utils/font.d.ts +2 -0
- package/lib/utils/font.js +17 -1
- package/lib/utils/font.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getDesignSettings = void 0;
|
|
7
|
+
var _chaynsApi = require("chayns-api");
|
|
8
|
+
const getDesignSettings = async () => {
|
|
9
|
+
const {
|
|
10
|
+
id
|
|
11
|
+
} = (0, _chaynsApi.getSite)();
|
|
12
|
+
const response = await fetch(`https://api-qa.chayns.net/css/${id}/style/v2`, {
|
|
13
|
+
method: 'GET'
|
|
14
|
+
});
|
|
15
|
+
if (response.status === 200) {
|
|
16
|
+
return await response.json();
|
|
17
|
+
}
|
|
18
|
+
return undefined;
|
|
19
|
+
};
|
|
20
|
+
exports.getDesignSettings = getDesignSettings;
|
|
21
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","names":["_chaynsApi","require","getDesignSettings","id","getSite","response","fetch","method","status","json","undefined","exports"],"sources":["../../../src/api/theme/get.ts"],"sourcesContent":["import { getSite } from 'chayns-api';\nimport type { DesignSettings } from '../../types/colorSchemeProvider';\n\nexport const getDesignSettings = async (): Promise<DesignSettings | undefined> => {\n const { id } = getSite();\n\n const response = await fetch(`https://api-qa.chayns.net/css/${id}/style/v2`, {\n method: 'GET',\n });\n\n if (response.status === 200) {\n return (await response.json()) as DesignSettings;\n }\n\n return undefined;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAGO,MAAMC,iBAAiB,GAAG,MAAAA,CAAA,KAAiD;EAC9E,MAAM;IAAEC;EAAG,CAAC,GAAG,IAAAC,kBAAO,EAAC,CAAC;EAExB,MAAMC,QAAQ,GAAG,MAAMC,KAAK,CAAE,iCAAgCH,EAAG,WAAU,EAAE;IACzEI,MAAM,EAAE;EACZ,CAAC,CAAC;EAEF,IAAIF,QAAQ,CAACG,MAAM,KAAK,GAAG,EAAE;IACzB,OAAQ,MAAMH,QAAQ,CAACI,IAAI,CAAC,CAAC;EACjC;EAEA,OAAOC,SAAS;AACpB,CAAC;AAACC,OAAA,CAAAT,iBAAA,GAAAA,iBAAA"}
|
|
@@ -72,6 +72,10 @@ export type AccordionProps = {
|
|
|
72
72
|
* The placeholder to be used for the search
|
|
73
73
|
*/
|
|
74
74
|
searchPlaceholder?: string;
|
|
75
|
+
/**
|
|
76
|
+
* The value that is displayed inside the search
|
|
77
|
+
*/
|
|
78
|
+
searchValue?: string;
|
|
75
79
|
/**
|
|
76
80
|
* This will force the background color of the accordion to be used even if it is closed and not hovered.
|
|
77
81
|
*/
|
|
@@ -35,6 +35,7 @@ const Accordion = _ref => {
|
|
|
35
35
|
rightElement,
|
|
36
36
|
searchIcon,
|
|
37
37
|
searchPlaceholder,
|
|
38
|
+
searchValue,
|
|
38
39
|
shouldForceBackground = false,
|
|
39
40
|
shouldHideBackground = false,
|
|
40
41
|
shouldRotateIcon = true,
|
|
@@ -135,6 +136,7 @@ const Accordion = _ref => {
|
|
|
135
136
|
rightElement: rightElement,
|
|
136
137
|
searchIcon: searchIcon,
|
|
137
138
|
searchPlaceholder: searchPlaceholder,
|
|
139
|
+
searchValue: searchValue,
|
|
138
140
|
shouldRotateIcon: shouldRotateIcon,
|
|
139
141
|
title: title,
|
|
140
142
|
titleElement: titleElement
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_uuid","_AccordionBody","_interopRequireDefault","_AccordionGroup","_AccordionHead","_Accordion","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","AccordionContext","exports","React","createContext","isWrapped","Accordion","_ref","bodyMaxHeight","children","icon","isDefaultOpen","isDisabled","isFixed","isOpened","isTitleGreyed","onBodyScroll","onClose","onOpen","onSearchChange","rightElement","searchIcon","searchPlaceholder","shouldForceBackground","shouldHideBackground","shouldRotateIcon","title","titleElement","shouldRenderClosed","openAccordionUuid","updateOpenAccordionUuid","useContext","AccordionGroupContext","isParentWrapped","isAccordionOpen","setIsAccordionOpen","useState","uuid","useUuid","isInitialRenderRef","useRef","isInGroup","isOpen","onCloseRef","onOpenRef","useEffect","current","handleHeadClick","useCallback","currentIsAccordionOpen","shouldOnlyOpen","accordionContextProviderValue","useMemo","createElement","StyledAccordion","className","Provider","value","MotionConfig","transition","type","onClick","AnimatePresence","initial","maxHeight","onScroll","shouldHideBody","displayName","_default"],"sources":["../../../src/components/accordion/Accordion.tsx"],"sourcesContent":["import { AnimatePresence, MotionConfig } from 'framer-motion';\nimport React, {\n ChangeEventHandler,\n FC,\n ReactNode,\n UIEvent,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport AccordionBody from './accordion-body/AccordionBody';\nimport { AccordionGroupContext } from './accordion-group/AccordionGroup';\nimport AccordionHead from './accordion-head/AccordionHead';\nimport { StyledAccordion } from './Accordion.styles';\n\nexport const AccordionContext = React.createContext({ isWrapped: false });\n\nexport type AccordionProps = {\n /**\n * Maximum height of the accordion body element. This automatically makes the content of the\n * body element scrollable.\n */\n bodyMaxHeight?: number;\n /**\n * The content of the accordion body\n */\n children: ReactNode;\n /**\n * The icon that is displayed in front of the title\n */\n icon?: string;\n /**\n * This can be used to automatically expand the Accordion during the first render.\n */\n isDefaultOpen?: boolean;\n /**\n * This will disable the Accordion so that it cannot be opened and will gray out the title. Does not work with isOpened.\n */\n isDisabled?: boolean;\n /**\n * This can be used so that the Accordion cannot be opened or closed.\n * In addition, in this case the icon is exchanged to mark the Accordions.\n */\n isFixed?: boolean;\n /**\n * This can be used to open the Accordion from the outside.\n */\n isOpened?: boolean;\n /**\n * This will gray out the title of the Accordion to indicate hidden content, for example.\n */\n isTitleGreyed?: boolean;\n /**\n * This value must be set for nested Accordions. This adjusts the style of\n * the head and the padding of the content.\n */\n isWrapped?: boolean;\n /**\n * Function that is executed when the accordion body will be scrolled\n */\n onBodyScroll?: (event: UIEvent<HTMLDivElement>) => void;\n /**\n * Function that is executed when the accordion will be closed.\n */\n onClose?: VoidFunction;\n /**\n * Function that is executed when the accordion will be opened.\n */\n onOpen?: VoidFunction;\n /**\n * Function that is executed when the text of the search in the accordion\n * head changes. When this function is given, the search field is displayed\n * in the Accordion Head.\n */\n onSearchChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Content to be displayed on the right side in the head of the Accordion\n */\n rightElement?: ReactNode;\n /**\n * Icon to be displayed on the right side in the search input\n */\n searchIcon?: string[];\n /**\n * The placeholder to be used for the search\n */\n searchPlaceholder?: string;\n /**\n * This will force the background color of the accordion to be used even if it is closed and not hovered.\n */\n shouldForceBackground?: boolean;\n /**\n * This will hide the background color of the accordion\n */\n shouldHideBackground?: boolean;\n /**\n * Whether the icon should be rotating.\n */\n shouldRotateIcon?: boolean;\n /**\n * Title of the Accordion displayed in the head\n */\n title: string;\n /**\n * Additional elements to be displayed in the header next to the title.\n */\n titleElement?: ReactNode;\n /**\n * This will render the Accordion closed on the first render.\n */\n shouldRenderClosed?: boolean;\n};\n\nconst Accordion: FC<AccordionProps> = ({\n bodyMaxHeight,\n children,\n icon,\n isDefaultOpen = false,\n isDisabled = false,\n isFixed = false,\n isOpened,\n isTitleGreyed = false,\n isWrapped = false,\n onBodyScroll,\n onClose,\n onOpen,\n onSearchChange,\n rightElement,\n searchIcon,\n searchPlaceholder,\n shouldForceBackground = false,\n shouldHideBackground = false,\n shouldRotateIcon = true,\n title,\n titleElement,\n shouldRenderClosed = false,\n}) => {\n const { openAccordionUuid, updateOpenAccordionUuid } = useContext(AccordionGroupContext);\n const { isWrapped: isParentWrapped } = useContext(AccordionContext);\n\n const [isAccordionOpen, setIsAccordionOpen] = useState<boolean>(isDefaultOpen ?? isOpened);\n\n const uuid = useUuid();\n\n const isInitialRenderRef = useRef(true);\n\n const isInGroup = typeof updateOpenAccordionUuid === 'function';\n\n const isOpen = isInGroup ? openAccordionUuid === uuid : isAccordionOpen;\n\n const onCloseRef = useRef(onClose);\n const onOpenRef = useRef(onOpen);\n\n useEffect(() => {\n onCloseRef.current = onClose;\n onOpenRef.current = onOpen;\n }, [onClose, onOpen]);\n\n const handleHeadClick = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid);\n }\n\n setIsAccordionOpen((currentIsAccordionOpen) => !currentIsAccordionOpen);\n }, [isDisabled, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (isDisabled && isOpen) {\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid);\n }\n\n setIsAccordionOpen((currentIsAccordionOpen) => !currentIsAccordionOpen);\n }\n }, [isDisabled, isOpen, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (isOpen) {\n if (typeof onOpenRef.current === 'function') {\n onOpenRef.current();\n }\n } else if (typeof onCloseRef.current === 'function') {\n onCloseRef.current();\n }\n }, [isOpen]);\n\n useEffect(() => {\n if (isDefaultOpen) {\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid, { shouldOnlyOpen: true });\n } else {\n setIsAccordionOpen(true);\n }\n }\n }, [isDefaultOpen, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (typeof isOpened === 'boolean') {\n if (typeof updateOpenAccordionUuid === 'function' && isOpened) {\n updateOpenAccordionUuid(uuid);\n } else {\n setIsAccordionOpen(isOpened);\n }\n }\n }, [isOpened, updateOpenAccordionUuid, uuid]);\n\n const accordionContextProviderValue = useMemo(() => ({ isWrapped }), [isWrapped]);\n\n return (\n <StyledAccordion\n className=\"beta-chayns-accordion\"\n isOpen={isOpen}\n isParentWrapped={isParentWrapped}\n isWrapped={isWrapped}\n shouldForceBackground={shouldForceBackground}\n shouldHideBackground={shouldHideBackground}\n >\n <AccordionContext.Provider value={accordionContextProviderValue}>\n <MotionConfig transition={{ type: 'tween' }}>\n <AccordionHead\n icon={icon}\n isOpen={isOpen}\n isFixed={isFixed}\n isTitleGreyed={isTitleGreyed || isDisabled}\n isWrapped={isWrapped}\n onClick={handleHeadClick}\n onSearchChange={onSearchChange}\n rightElement={rightElement}\n searchIcon={searchIcon}\n searchPlaceholder={searchPlaceholder}\n shouldRotateIcon={shouldRotateIcon}\n title={title}\n titleElement={titleElement}\n />\n <AnimatePresence initial={false}>\n {(isOpen || shouldRenderClosed) && (\n <AccordionBody\n maxHeight={bodyMaxHeight}\n onScroll={onBodyScroll}\n shouldHideBody={shouldRenderClosed && !isOpen}\n >\n {children}\n </AccordionBody>\n )}\n </AnimatePresence>\n </MotionConfig>\n </AccordionContext.Provider>\n </StyledAccordion>\n );\n};\n\nAccordion.displayName = 'Accordion';\n\nexport default Accordion;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAYA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAAqD,SAAAK,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,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e;IAACC,OAAO,EAAE;EAAM,GAC3B,CAACrB,MAAM,IAAId,kBAAkB,kBAC1BzD,MAAA,CAAAU,OAAA,CAAAwE,aAAA,CAAC/E,cAAA,CAAAO,OAAa;IACVmF,SAAS,EAAExD,aAAc;IACzByD,QAAQ,EAAEjD,YAAa;IACvBkD,cAAc,EAAEtC,kBAAkB,IAAI,CAACc;EAAO,GAE7CjC,QACU,CAEN,CACP,CACS,CACd,CAAC;AAE1B,CAAC;AAEDH,SAAS,CAAC6D,WAAW,GAAG,WAAW;AAAC,IAAAC,QAAA,GAAAlE,OAAA,CAAArB,OAAA,GAErByB,SAAS"}
|
|
1
|
+
{"version":3,"file":"Accordion.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_uuid","_AccordionBody","_interopRequireDefault","_AccordionGroup","_AccordionHead","_Accordion","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","AccordionContext","exports","React","createContext","isWrapped","Accordion","_ref","bodyMaxHeight","children","icon","isDefaultOpen","isDisabled","isFixed","isOpened","isTitleGreyed","onBodyScroll","onClose","onOpen","onSearchChange","rightElement","searchIcon","searchPlaceholder","searchValue","shouldForceBackground","shouldHideBackground","shouldRotateIcon","title","titleElement","shouldRenderClosed","openAccordionUuid","updateOpenAccordionUuid","useContext","AccordionGroupContext","isParentWrapped","isAccordionOpen","setIsAccordionOpen","useState","uuid","useUuid","isInitialRenderRef","useRef","isInGroup","isOpen","onCloseRef","onOpenRef","useEffect","current","handleHeadClick","useCallback","currentIsAccordionOpen","shouldOnlyOpen","accordionContextProviderValue","useMemo","createElement","StyledAccordion","className","Provider","value","MotionConfig","transition","type","onClick","AnimatePresence","initial","maxHeight","onScroll","shouldHideBody","displayName","_default"],"sources":["../../../src/components/accordion/Accordion.tsx"],"sourcesContent":["import { AnimatePresence, MotionConfig } from 'framer-motion';\nimport React, {\n ChangeEventHandler,\n FC,\n ReactNode,\n UIEvent,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport AccordionBody from './accordion-body/AccordionBody';\nimport { AccordionGroupContext } from './accordion-group/AccordionGroup';\nimport AccordionHead from './accordion-head/AccordionHead';\nimport { StyledAccordion } from './Accordion.styles';\nimport { useTheme } from 'styled-components';\n\nexport const AccordionContext = React.createContext({ isWrapped: false });\n\nexport type AccordionProps = {\n /**\n * Maximum height of the accordion body element. This automatically makes the content of the\n * body element scrollable.\n */\n bodyMaxHeight?: number;\n /**\n * The content of the accordion body\n */\n children: ReactNode;\n /**\n * The icon that is displayed in front of the title\n */\n icon?: string;\n /**\n * This can be used to automatically expand the Accordion during the first render.\n */\n isDefaultOpen?: boolean;\n /**\n * This will disable the Accordion so that it cannot be opened and will gray out the title. Does not work with isOpened.\n */\n isDisabled?: boolean;\n /**\n * This can be used so that the Accordion cannot be opened or closed.\n * In addition, in this case the icon is exchanged to mark the Accordions.\n */\n isFixed?: boolean;\n /**\n * This can be used to open the Accordion from the outside.\n */\n isOpened?: boolean;\n /**\n * This will gray out the title of the Accordion to indicate hidden content, for example.\n */\n isTitleGreyed?: boolean;\n /**\n * This value must be set for nested Accordions. This adjusts the style of\n * the head and the padding of the content.\n */\n isWrapped?: boolean;\n /**\n * Function that is executed when the accordion body will be scrolled\n */\n onBodyScroll?: (event: UIEvent<HTMLDivElement>) => void;\n /**\n * Function that is executed when the accordion will be closed.\n */\n onClose?: VoidFunction;\n /**\n * Function that is executed when the accordion will be opened.\n */\n onOpen?: VoidFunction;\n /**\n * Function that is executed when the text of the search in the accordion\n * head changes. When this function is given, the search field is displayed\n * in the Accordion Head.\n */\n onSearchChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Content to be displayed on the right side in the head of the Accordion\n */\n rightElement?: ReactNode;\n /**\n * Icon to be displayed on the right side in the search input\n */\n searchIcon?: string[];\n /**\n * The placeholder to be used for the search\n */\n searchPlaceholder?: string;\n /**\n * The value that is displayed inside the search\n */\n searchValue?: string;\n /**\n * This will force the background color of the accordion to be used even if it is closed and not hovered.\n */\n shouldForceBackground?: boolean;\n /**\n * This will hide the background color of the accordion\n */\n shouldHideBackground?: boolean;\n /**\n * Whether the icon should be rotating.\n */\n shouldRotateIcon?: boolean;\n /**\n * Title of the Accordion displayed in the head\n */\n title: string;\n /**\n * Additional elements to be displayed in the header next to the title.\n */\n titleElement?: ReactNode;\n /**\n * This will render the Accordion closed on the first render.\n */\n shouldRenderClosed?: boolean;\n};\n\nconst Accordion: FC<AccordionProps> = ({\n bodyMaxHeight,\n children,\n icon,\n isDefaultOpen = false,\n isDisabled = false,\n isFixed = false,\n isOpened,\n isTitleGreyed = false,\n isWrapped = false,\n onBodyScroll,\n onClose,\n onOpen,\n onSearchChange,\n rightElement,\n searchIcon,\n searchPlaceholder,\n searchValue,\n shouldForceBackground = false,\n shouldHideBackground = false,\n shouldRotateIcon = true,\n title,\n titleElement,\n shouldRenderClosed = false,\n}) => {\n const { openAccordionUuid, updateOpenAccordionUuid } = useContext(AccordionGroupContext);\n const { isWrapped: isParentWrapped } = useContext(AccordionContext);\n\n const [isAccordionOpen, setIsAccordionOpen] = useState<boolean>(isDefaultOpen ?? isOpened);\n\n const uuid = useUuid();\n\n const isInitialRenderRef = useRef(true);\n\n const isInGroup = typeof updateOpenAccordionUuid === 'function';\n\n const isOpen = isInGroup ? openAccordionUuid === uuid : isAccordionOpen;\n\n const onCloseRef = useRef(onClose);\n const onOpenRef = useRef(onOpen);\n\n useEffect(() => {\n onCloseRef.current = onClose;\n onOpenRef.current = onOpen;\n }, [onClose, onOpen]);\n\n const handleHeadClick = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid);\n }\n\n setIsAccordionOpen((currentIsAccordionOpen) => !currentIsAccordionOpen);\n }, [isDisabled, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (isDisabled && isOpen) {\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid);\n }\n\n setIsAccordionOpen((currentIsAccordionOpen) => !currentIsAccordionOpen);\n }\n }, [isDisabled, isOpen, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (isOpen) {\n if (typeof onOpenRef.current === 'function') {\n onOpenRef.current();\n }\n } else if (typeof onCloseRef.current === 'function') {\n onCloseRef.current();\n }\n }, [isOpen]);\n\n useEffect(() => {\n if (isDefaultOpen) {\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid, { shouldOnlyOpen: true });\n } else {\n setIsAccordionOpen(true);\n }\n }\n }, [isDefaultOpen, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (typeof isOpened === 'boolean') {\n if (typeof updateOpenAccordionUuid === 'function' && isOpened) {\n updateOpenAccordionUuid(uuid);\n } else {\n setIsAccordionOpen(isOpened);\n }\n }\n }, [isOpened, updateOpenAccordionUuid, uuid]);\n\n const accordionContextProviderValue = useMemo(() => ({ isWrapped }), [isWrapped]);\n\n return (\n <StyledAccordion\n className=\"beta-chayns-accordion\"\n isOpen={isOpen}\n isParentWrapped={isParentWrapped}\n isWrapped={isWrapped}\n shouldForceBackground={shouldForceBackground}\n shouldHideBackground={shouldHideBackground}\n >\n <AccordionContext.Provider value={accordionContextProviderValue}>\n <MotionConfig transition={{ type: 'tween' }}>\n <AccordionHead\n icon={icon}\n isOpen={isOpen}\n isFixed={isFixed}\n isTitleGreyed={isTitleGreyed || isDisabled}\n isWrapped={isWrapped}\n onClick={handleHeadClick}\n onSearchChange={onSearchChange}\n rightElement={rightElement}\n searchIcon={searchIcon}\n searchPlaceholder={searchPlaceholder}\n searchValue={searchValue}\n shouldRotateIcon={shouldRotateIcon}\n title={title}\n titleElement={titleElement}\n />\n <AnimatePresence initial={false}>\n {(isOpen || shouldRenderClosed) && (\n <AccordionBody\n maxHeight={bodyMaxHeight}\n onScroll={onBodyScroll}\n shouldHideBody={shouldRenderClosed && !isOpen}\n >\n {children}\n </AccordionBody>\n )}\n </AnimatePresence>\n </MotionConfig>\n </AccordionContext.Provider>\n </StyledAccordion>\n );\n};\n\nAccordion.displayName = 'Accordion';\n\nexport default Accordion;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAYA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAAqD,SAAAK,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAZ,CAAA,oBAAAY,CA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I,CAACc;EAAO,GAE7ClC,QACU,CAEN,CACP,CACS,CACd,CAAC;AAE1B,CAAC;AAEDH,SAAS,CAAC8D,WAAW,GAAG,WAAW;AAAC,IAAAC,QAAA,GAAAnE,OAAA,CAAArB,OAAA,GAErByB,SAAS"}
|
|
@@ -17,18 +17,26 @@ const StyledAccordion = exports.StyledAccordion = _styledComponents.default.div`
|
|
|
17
17
|
theme
|
|
18
18
|
} = _ref;
|
|
19
19
|
return (isOpen || shouldForceBackground) && !isWrapped && !shouldHideBackground && (0, _styledComponents.css)`
|
|
20
|
-
background-color: ${theme['100']};
|
|
21
|
-
border-radius:
|
|
22
|
-
box-shadow: 0 2px 6px 0 rgba(0, 0, 0,
|
|
20
|
+
background-color: rgba(${theme['100-rgb']}, ${theme.cardBackgroundOpacity});
|
|
21
|
+
border-radius: ${theme.cardBorderRadius}px;
|
|
22
|
+
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, ${theme.cardShadow});
|
|
23
23
|
`;
|
|
24
24
|
}}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
${_ref2 => {
|
|
27
|
+
let {
|
|
28
|
+
theme
|
|
29
|
+
} = _ref2;
|
|
30
|
+
return theme.accordionLines && (0, _styledComponents.css)`
|
|
31
|
+
border-bottom: 1px solid transparent;
|
|
32
|
+
`;
|
|
33
|
+
}}
|
|
34
|
+
|
|
35
|
+
margin-bottom: ${_ref3 => {
|
|
28
36
|
let {
|
|
29
37
|
isOpen,
|
|
30
38
|
isWrapped
|
|
31
|
-
} =
|
|
39
|
+
} = _ref3;
|
|
32
40
|
return isOpen && !isWrapped ? '30px' : '0px';
|
|
33
41
|
}};
|
|
34
42
|
transition:
|
|
@@ -38,13 +46,13 @@ const StyledAccordion = exports.StyledAccordion = _styledComponents.default.div`
|
|
|
38
46
|
box-shadow 0.3s ease,
|
|
39
47
|
margin-bottom 0.3s ease;
|
|
40
48
|
|
|
41
|
-
${
|
|
49
|
+
${_ref4 => {
|
|
42
50
|
let {
|
|
43
51
|
isOpen,
|
|
44
52
|
isWrapped,
|
|
45
53
|
shouldForceBackground,
|
|
46
54
|
theme
|
|
47
|
-
} =
|
|
55
|
+
} = _ref4;
|
|
48
56
|
if (shouldForceBackground) return undefined;
|
|
49
57
|
if (isWrapped) {
|
|
50
58
|
return (0, _styledComponents.css)`
|
|
@@ -61,33 +69,33 @@ const StyledAccordion = exports.StyledAccordion = _styledComponents.default.div`
|
|
|
61
69
|
return undefined;
|
|
62
70
|
}}
|
|
63
71
|
|
|
64
|
-
${
|
|
72
|
+
${_ref5 => {
|
|
65
73
|
let {
|
|
66
74
|
isParentWrapped
|
|
67
|
-
} =
|
|
75
|
+
} = _ref5;
|
|
68
76
|
return isParentWrapped && (0, _styledComponents.css)`
|
|
69
77
|
padding-left: 17px;
|
|
70
78
|
`;
|
|
71
79
|
}}
|
|
72
80
|
|
|
73
|
-
${
|
|
81
|
+
${_ref6 => {
|
|
74
82
|
let {
|
|
75
83
|
isWrapped
|
|
76
|
-
} =
|
|
84
|
+
} = _ref6;
|
|
77
85
|
return !isWrapped && (0, _styledComponents.css)`
|
|
78
86
|
margin-top: 10px;
|
|
79
87
|
`;
|
|
80
88
|
}}
|
|
81
89
|
|
|
82
|
-
${
|
|
90
|
+
${_ref7 => {
|
|
83
91
|
let {
|
|
84
92
|
isWrapped,
|
|
85
93
|
shouldHideBackground,
|
|
86
94
|
theme
|
|
87
|
-
} =
|
|
95
|
+
} = _ref7;
|
|
88
96
|
return !isWrapped && !shouldHideBackground && (0, _styledComponents.css)`
|
|
89
97
|
&:hover {
|
|
90
|
-
background-color: ${theme['100']};
|
|
98
|
+
background-color: rgba(${theme['100-rgb']}, ${theme.cardBackgroundOpacity});
|
|
91
99
|
}
|
|
92
100
|
`;
|
|
93
101
|
}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","StyledAccordion","exports","styled","div","_ref","isOpen","isWrapped","shouldForceBackground","shouldHideBackground","theme","css","_ref2","_ref3","undefined","headline","
|
|
1
|
+
{"version":3,"file":"Accordion.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","StyledAccordion","exports","styled","div","_ref","isOpen","isWrapped","shouldForceBackground","shouldHideBackground","theme","css","cardBackgroundOpacity","cardBorderRadius","cardShadow","_ref2","accordionLines","_ref3","_ref4","undefined","headline","_ref5","isParentWrapped","_ref6","_ref7"],"sources":["../../../src/components/accordion/Accordion.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { AccordionProps } from './Accordion';\n\ntype StyledMotionAccordionProps = WithTheme<{\n isOpen: boolean;\n isParentWrapped: boolean;\n}> &\n Pick<AccordionProps, 'isWrapped' | 'shouldForceBackground' | 'shouldHideBackground'>;\n\nexport const StyledAccordion = styled.div<StyledMotionAccordionProps>`\n ${({\n isOpen,\n isWrapped,\n shouldForceBackground,\n shouldHideBackground,\n theme,\n }: StyledMotionAccordionProps) =>\n (isOpen || shouldForceBackground) &&\n !isWrapped &&\n !shouldHideBackground &&\n css`\n background-color: rgba(${theme['100-rgb']}, ${theme.cardBackgroundOpacity});\n border-radius: ${theme.cardBorderRadius}px;\n box-shadow: 0 2px 6px 0 rgba(0, 0, 0, ${theme.cardShadow});\n `}\n\n ${({ theme }: StyledMotionAccordionProps) =>\n theme.accordionLines &&\n css`\n border-bottom: 1px solid transparent;\n `}\n \n margin-bottom: ${({ isOpen, isWrapped }) => (isOpen && !isWrapped ? '30px' : '0px')};\n transition:\n background-color 0.3s ease,\n border-bottom-color 0.3s ease,\n border-radius 0.3s ease,\n box-shadow 0.3s ease,\n margin-bottom 0.3s ease;\n\n ${({ isOpen, isWrapped, shouldForceBackground, theme }: StyledMotionAccordionProps) => {\n if (shouldForceBackground) return undefined;\n\n if (isWrapped) {\n return css`\n :not(:last-child) {\n border-bottom-color: ${theme.headline};\n }\n `;\n }\n\n if (!isOpen) {\n return css`\n border-bottom-color: ${theme.headline};\n `;\n }\n\n return undefined;\n }}\n\n ${({ isParentWrapped }) =>\n isParentWrapped &&\n css`\n padding-left: 17px;\n `}\n\n ${({ isWrapped }) =>\n !isWrapped &&\n css`\n margin-top: 10px;\n `}\n\n ${({ isWrapped, shouldHideBackground, theme }) =>\n !isWrapped &&\n !shouldHideBackground &&\n css`\n &:hover {\n background-color: rgba(${theme['100-rgb']}, ${theme.cardBackgroundOpacity});\n }\n `}\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SA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AACA;AACA;AACA;AACA;AACA,MAAMW,KAAA,IAAqF;EAAA,IAApF;IAAEZ,MAAM;IAAEC,SAAS;IAAEC,qBAAqB;IAAEE;EAAkC,CAAC,GAAAQ,KAAA;EAC9E,IAAIV,qBAAqB,EAAE,OAAOW,SAAS;EAE3C,IAAIZ,SAAS,EAAE;IACX,OAAO,IAAAI,qBAAG,CAAC;AACvB;AACA,2CAA2CD,KAAK,CAACU,QAAS;AAC1D;AACA,aAAa;EACL;EAEA,IAAI,CAACd,MAAM,EAAE;IACT,OAAO,IAAAK,qBAAG,CAAC;AACvB,uCAAuCD,KAAK,CAACU,QAAS;AACtD,aAAa;EACL;EAEA,OAAOD,SAAS;AACpB,CAAE;AACN;AACA,MAAME,KAAA;EAAA,IAAC;IAAEC;EAAgB,CAAC,GAAAD,KAAA;EAAA,OAClBC,eAAe,IACf,IAAAX,qBAAG,CAAC;AACZ;AACA,SAAS;AAAA,CAAC;AACV;AACA,MAAMY,KAAA;EAAA,IAAC;IAAEhB;EAAU,CAAC,GAAAgB,KAAA;EAAA,OACZ,CAAChB,SAAS,IACV,IAAAI,qBAAG,CAAC;AACZ;AACA,SAAS;AAAA,CAAC;AACV;AACA,MAAMa,KAAA;EAAA,IAAC;IAAEjB,SAAS;IAAEE,oBAAoB;IAAEC;EAAM,CAAC,GAAAc,KAAA;EAAA,OACzC,CAACjB,SAAS,IACV,CAACE,oBAAoB,IACrB,IAAAE,qBAAG,CAAC;AACZ;AACA,yCAAyCD,KAAK,CAAC,SAAS,CAAE,KAAIA,KAAK,CAACE,qBAAsB;AAC1F;AACA,SAAS;AAAA,CAAC;AACV,CAAC"}
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _AccordionHead = require("./AccordionHead.styles");
|
|
10
10
|
var _accordion = require("../../../utils/accordion");
|
|
11
11
|
var _Icon = _interopRequireDefault(require("../../icon/Icon"));
|
|
12
|
+
var _styledComponents = require("styled-components");
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -24,6 +25,7 @@ const AccordionHead = _ref => {
|
|
|
24
25
|
rightElement,
|
|
25
26
|
searchIcon,
|
|
26
27
|
searchPlaceholder,
|
|
28
|
+
searchValue,
|
|
27
29
|
shouldRotateIcon,
|
|
28
30
|
title,
|
|
29
31
|
titleElement
|
|
@@ -32,6 +34,10 @@ const AccordionHead = _ref => {
|
|
|
32
34
|
closed: isWrapped ? 40 : 33,
|
|
33
35
|
open: isWrapped ? 40 : 33
|
|
34
36
|
});
|
|
37
|
+
const {
|
|
38
|
+
accordionIcon,
|
|
39
|
+
iconStyle
|
|
40
|
+
} = (0, _styledComponents.useTheme)();
|
|
35
41
|
const titleWrapperRef = (0, _react.useRef)(null);
|
|
36
42
|
const hasSearchIcon = Array.isArray(searchIcon);
|
|
37
43
|
(0, _react.useEffect)(() => {
|
|
@@ -41,6 +47,20 @@ const AccordionHead = _ref => {
|
|
|
41
47
|
width: (titleWrapperRef.current?.clientWidth ?? 0) - 10
|
|
42
48
|
}));
|
|
43
49
|
}, [isWrapped, title]);
|
|
50
|
+
const iconElement = (0, _react.useMemo)(() => {
|
|
51
|
+
if (icon || icon && isFixed) {
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
53
|
+
icons: [isFixed ? 'fa fa-horizontal-rule' : icon ?? 'fa fa-chevron-right']
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (!accordionIcon) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return /*#__PURE__*/_react.default.createElement(_AccordionHead.StyledAccordionIcon, {
|
|
60
|
+
className: iconStyle,
|
|
61
|
+
icon: accordionIcon?.toString(16)
|
|
62
|
+
});
|
|
63
|
+
}, [accordionIcon, icon, iconStyle, isFixed]);
|
|
44
64
|
return /*#__PURE__*/_react.default.createElement(_AccordionHead.StyledMotionAccordionHead, {
|
|
45
65
|
animate: {
|
|
46
66
|
height: isOpen ? headHeight.open : headHeight.closed
|
|
@@ -53,9 +73,7 @@ const AccordionHead = _ref => {
|
|
|
53
73
|
},
|
|
54
74
|
initial: false,
|
|
55
75
|
onClick: !isFixed ? onClick : undefined
|
|
56
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
57
|
-
icons: [isFixed ? 'fa fa-horizontal-rule' : icon ?? 'fa fa-chevron-right']
|
|
58
|
-
})), /*#__PURE__*/_react.default.createElement(_AccordionHead.StyledMotionContentWrapper, {
|
|
76
|
+
}, iconElement), /*#__PURE__*/_react.default.createElement(_AccordionHead.StyledMotionContentWrapper, {
|
|
59
77
|
animate: {
|
|
60
78
|
opacity: isTitleGreyed ? 0.5 : 1
|
|
61
79
|
},
|
|
@@ -96,7 +114,8 @@ const AccordionHead = _ref => {
|
|
|
96
114
|
key: "rightInput",
|
|
97
115
|
onChange: onSearchChange,
|
|
98
116
|
placeholder: searchPlaceholder,
|
|
99
|
-
type: "text"
|
|
117
|
+
type: "text",
|
|
118
|
+
value: searchValue
|
|
100
119
|
}), hasSearchIcon && /*#__PURE__*/_react.default.createElement(_AccordionHead.StyledMotionRightInputIconWrapper, {
|
|
101
120
|
animate: {
|
|
102
121
|
opacity: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionHead.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_AccordionHead","_accordion","_Icon","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","AccordionHead","_ref","icon","isOpen","isFixed","isTitleGreyed","isWrapped","onClick","onSearchChange","rightElement","searchIcon","searchPlaceholder","shouldRotateIcon","title","titleElement","headHeight","setHeadHeight","useState","closed","open","titleWrapperRef","useRef","hasSearchIcon","Array","isArray","useEffect","getAccordionHeadHeight","width","current","clientWidth","createElement","StyledMotionAccordionHead","animate","height","className","initial","StyledMotionIconWrapper","rotate","undefined","icons","StyledMotionContentWrapper","opacity","ref","LayoutGroup","StyledMotionTitleWrapper","AnimatePresence","StyledMotionTitle","scale","key","StyledMotionTitleElementWrapper","layout","StyledRightWrapper","Fragment","StyledMotionRightInput","autoComplete","exit","hasIcon","onChange","placeholder","type","StyledMotionRightInputIconWrapper","StyledMotionRightElementWrapper","displayName","_default","exports"],"sources":["../../../../src/components/accordion/accordion-head/AccordionHead.tsx"],"sourcesContent":["import { AnimatePresence, LayoutGroup } from 'framer-motion';\nimport React, {\n ChangeEventHandler,\n FC,\n MouseEventHandler,\n ReactNode,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport {\n StyledMotionAccordionHead,\n StyledMotionContentWrapper,\n StyledMotionIconWrapper,\n StyledMotionRightElementWrapper,\n StyledMotionRightInput,\n StyledMotionRightInputIconWrapper,\n StyledMotionTitle,\n StyledMotionTitleElementWrapper,\n StyledMotionTitleWrapper,\n StyledRightWrapper,\n} from './AccordionHead.styles';\nimport { getAccordionHeadHeight } from '../../../utils/accordion';\nimport Icon from '../../icon/Icon';\n\ntype AccordionHeadProps = {\n icon?: string;\n isOpen: boolean;\n isFixed: boolean;\n isTitleGreyed: boolean;\n isWrapped: boolean;\n onClick: MouseEventHandler<HTMLDivElement>;\n onSearchChange?: ChangeEventHandler<HTMLInputElement>;\n rightElement?: ReactNode;\n searchIcon?: string[];\n searchPlaceholder?: string;\n shouldRotateIcon?: boolean;\n title: string;\n titleElement?: ReactNode;\n};\n\ninterface HeadHeight {\n closed: number;\n open: number;\n}\n\nconst AccordionHead: FC<AccordionHeadProps> = ({\n icon,\n isOpen,\n isFixed,\n isTitleGreyed,\n isWrapped,\n onClick,\n onSearchChange,\n rightElement,\n searchIcon,\n searchPlaceholder,\n shouldRotateIcon,\n title,\n titleElement,\n}) => {\n const [headHeight, setHeadHeight] = useState<HeadHeight>({\n closed: isWrapped ? 40 : 33,\n open: isWrapped ? 40 : 33,\n });\n\n const titleWrapperRef = useRef<HTMLDivElement>(null);\n\n const hasSearchIcon = Array.isArray(searchIcon);\n\n useEffect(() => {\n setHeadHeight(\n getAccordionHeadHeight({\n isWrapped,\n title,\n width: (titleWrapperRef.current?.clientWidth ?? 0) - 10,\n }),\n );\n }, [isWrapped, title]);\n\n return (\n <StyledMotionAccordionHead\n animate={{ height: isOpen ? headHeight.open : headHeight.closed }}\n className=\"beta-chayns-accordion-head\"\n initial={false}\n >\n <StyledMotionIconWrapper\n animate={{ rotate: (isOpen || isFixed) && shouldRotateIcon ? 90 : 0 }}\n initial={false}\n onClick={!isFixed ? onClick : undefined}\n >\n <Icon icons={[isFixed ? 'fa fa-horizontal-rule' : icon ?? 'fa fa-chevron-right']} />\n </StyledMotionIconWrapper>\n <StyledMotionContentWrapper\n animate={{ opacity: isTitleGreyed ? 0.5 : 1 }}\n initial={false}\n onClick={!isFixed ? onClick : undefined}\n ref={titleWrapperRef}\n >\n <LayoutGroup>\n <StyledMotionTitleWrapper>\n <AnimatePresence initial={false}>\n <StyledMotionTitle\n animate={{ scale: 1 }}\n initial={{ scale: isOpen && !isWrapped ? 1 / 1.3 : 1.3 }}\n isOpen={isOpen}\n isWrapped={isWrapped}\n key={\n isOpen && !isWrapped\n ? 'accordionHeadTitleBig'\n : 'accordionHeadTitle'\n }\n >\n {title}\n </StyledMotionTitle>\n </AnimatePresence>\n </StyledMotionTitleWrapper>\n {titleElement && (\n <StyledMotionTitleElementWrapper layout>\n {titleElement}\n </StyledMotionTitleElementWrapper>\n )}\n </LayoutGroup>\n </StyledMotionContentWrapper>\n {(typeof onSearchChange === 'function' || rightElement) && (\n <StyledRightWrapper>\n <AnimatePresence initial={false}>\n {typeof onSearchChange === 'function' && isOpen ? (\n <>\n <StyledMotionRightInput\n animate={{ opacity: 1, width: '165px' }}\n autoComplete=\"off\"\n exit={{ opacity: 0, width: 0 }}\n hasIcon={hasSearchIcon}\n initial={{ opacity: 0, width: 0 }}\n key=\"rightInput\"\n onChange={onSearchChange}\n placeholder={searchPlaceholder}\n type=\"text\"\n />\n {hasSearchIcon && (\n <StyledMotionRightInputIconWrapper\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n initial={{ opacity: 0 }}\n key=\"rightInputIcon\"\n >\n <Icon icons={searchIcon} />\n </StyledMotionRightInputIconWrapper>\n )}\n </>\n ) : (\n <StyledMotionRightElementWrapper\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n initial={{ opacity: 0 }}\n key=\"rightElementWrapper\"\n >\n {rightElement}\n </StyledMotionRightElementWrapper>\n )}\n </AnimatePresence>\n </StyledRightWrapper>\n )}\n </StyledMotionAccordionHead>\n );\n};\n\nAccordionHead.displayName = 'AccordionHead';\n\nexport default AccordionHead;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AASA,IAAAG,cAAA,GAAAH,OAAA;AAYA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAC,sBAAA,CAAAN,OAAA;AAAmC,SAAAM,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,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AE,CAAE;IACxBc,IAAI,EAAE;MAAEd,OAAO,EAAE;IAAE,CAAE;IACrBN,OAAO,EAAE;MAAEM,OAAO,EAAE;IAAE,CAAE;IACxBO,GAAG,EAAC;EAAqB,GAExBvC,YAC4B,CAExB,CACD,CAED,CAAC;AAEpC,CAAC;AAEDT,aAAa,CAAC8D,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAApF,OAAA,GAE7BoB,aAAa"}
|
|
1
|
+
{"version":3,"file":"AccordionHead.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_AccordionHead","_accordion","_Icon","_interopRequireDefault","_styledComponents","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","AccordionHead","_ref","icon","isOpen","isFixed","isTitleGreyed","isWrapped","onClick","onSearchChange","rightElement","searchIcon","searchPlaceholder","searchValue","shouldRotateIcon","title","titleElement","headHeight","setHeadHeight","useState","closed","open","accordionIcon","iconStyle","useTheme","titleWrapperRef","useRef","hasSearchIcon","Array","isArray","useEffect","getAccordionHeadHeight","width","current","clientWidth","iconElement","useMemo","createElement","icons","StyledAccordionIcon","className","toString","StyledMotionAccordionHead","animate","height","initial","StyledMotionIconWrapper","rotate","undefined","StyledMotionContentWrapper","opacity","ref","LayoutGroup","StyledMotionTitleWrapper","AnimatePresence","StyledMotionTitle","scale","key","StyledMotionTitleElementWrapper","layout","StyledRightWrapper","Fragment","StyledMotionRightInput","autoComplete","exit","hasIcon","onChange","placeholder","type","value","StyledMotionRightInputIconWrapper","StyledMotionRightElementWrapper","displayName","_default","exports"],"sources":["../../../../src/components/accordion/accordion-head/AccordionHead.tsx"],"sourcesContent":["import { AnimatePresence, LayoutGroup } from 'framer-motion';\nimport React, {\n ChangeEventHandler,\n FC,\n MouseEventHandler,\n ReactNode,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n StyledAccordionIcon,\n StyledMotionAccordionHead,\n StyledMotionContentWrapper,\n StyledMotionIconWrapper,\n StyledMotionRightElementWrapper,\n StyledMotionRightInput,\n StyledMotionRightInputIconWrapper,\n StyledMotionTitle,\n StyledMotionTitleElementWrapper,\n StyledMotionTitleWrapper,\n StyledRightWrapper,\n} from './AccordionHead.styles';\nimport { getAccordionHeadHeight } from '../../../utils/accordion';\nimport Icon from '../../icon/Icon';\nimport { useTheme } from 'styled-components';\n\ntype AccordionHeadProps = {\n icon?: string;\n isOpen: boolean;\n isFixed: boolean;\n isTitleGreyed: boolean;\n isWrapped: boolean;\n onClick: MouseEventHandler<HTMLDivElement>;\n onSearchChange?: ChangeEventHandler<HTMLInputElement>;\n rightElement?: ReactNode;\n searchIcon?: string[];\n searchPlaceholder?: string;\n searchValue?: string;\n shouldRotateIcon?: boolean;\n title: string;\n titleElement?: ReactNode;\n};\n\ninterface HeadHeight {\n closed: number;\n open: number;\n}\n\nconst AccordionHead: FC<AccordionHeadProps> = ({\n icon,\n isOpen,\n isFixed,\n isTitleGreyed,\n isWrapped,\n onClick,\n onSearchChange,\n rightElement,\n searchIcon,\n searchPlaceholder,\n searchValue,\n shouldRotateIcon,\n title,\n titleElement,\n}) => {\n const [headHeight, setHeadHeight] = useState<HeadHeight>({\n closed: isWrapped ? 40 : 33,\n open: isWrapped ? 40 : 33,\n });\n\n const { accordionIcon, iconStyle } = useTheme();\n\n const titleWrapperRef = useRef<HTMLDivElement>(null);\n\n const hasSearchIcon = Array.isArray(searchIcon);\n\n useEffect(() => {\n setHeadHeight(\n getAccordionHeadHeight({\n isWrapped,\n title,\n width: (titleWrapperRef.current?.clientWidth ?? 0) - 10,\n }),\n );\n }, [isWrapped, title]);\n\n const iconElement = useMemo(() => {\n if (icon || (icon && isFixed)) {\n return (\n <Icon icons={[isFixed ? 'fa fa-horizontal-rule' : icon ?? 'fa fa-chevron-right']} />\n );\n }\n\n if (!accordionIcon) {\n return null;\n }\n\n return (\n <StyledAccordionIcon\n className={iconStyle as string}\n icon={(accordionIcon as number)?.toString(16)}\n />\n );\n }, [accordionIcon, icon, iconStyle, isFixed]);\n\n return (\n <StyledMotionAccordionHead\n animate={{ height: isOpen ? headHeight.open : headHeight.closed }}\n className=\"beta-chayns-accordion-head\"\n initial={false}\n >\n <StyledMotionIconWrapper\n animate={{ rotate: (isOpen || isFixed) && shouldRotateIcon ? 90 : 0 }}\n initial={false}\n onClick={!isFixed ? onClick : undefined}\n >\n {iconElement}\n </StyledMotionIconWrapper>\n <StyledMotionContentWrapper\n animate={{ opacity: isTitleGreyed ? 0.5 : 1 }}\n initial={false}\n onClick={!isFixed ? onClick : undefined}\n ref={titleWrapperRef}\n >\n <LayoutGroup>\n <StyledMotionTitleWrapper>\n <AnimatePresence initial={false}>\n <StyledMotionTitle\n animate={{ scale: 1 }}\n initial={{ scale: isOpen && !isWrapped ? 1 / 1.3 : 1.3 }}\n isOpen={isOpen}\n isWrapped={isWrapped}\n key={\n isOpen && !isWrapped\n ? 'accordionHeadTitleBig'\n : 'accordionHeadTitle'\n }\n >\n {title}\n </StyledMotionTitle>\n </AnimatePresence>\n </StyledMotionTitleWrapper>\n {titleElement && (\n <StyledMotionTitleElementWrapper layout>\n {titleElement}\n </StyledMotionTitleElementWrapper>\n )}\n </LayoutGroup>\n </StyledMotionContentWrapper>\n {(typeof onSearchChange === 'function' || rightElement) && (\n <StyledRightWrapper>\n <AnimatePresence initial={false}>\n {typeof onSearchChange === 'function' && isOpen ? (\n <>\n <StyledMotionRightInput\n animate={{ opacity: 1, width: '165px' }}\n autoComplete=\"off\"\n exit={{ opacity: 0, width: 0 }}\n hasIcon={hasSearchIcon}\n initial={{ opacity: 0, width: 0 }}\n key=\"rightInput\"\n onChange={onSearchChange}\n placeholder={searchPlaceholder}\n type=\"text\"\n value={searchValue}\n />\n {hasSearchIcon && (\n <StyledMotionRightInputIconWrapper\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n initial={{ opacity: 0 }}\n key=\"rightInputIcon\"\n >\n <Icon icons={searchIcon} />\n </StyledMotionRightInputIconWrapper>\n )}\n </>\n ) : (\n <StyledMotionRightElementWrapper\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n initial={{ opacity: 0 }}\n key=\"rightElementWrapper\"\n >\n {rightElement}\n </StyledMotionRightElementWrapper>\n )}\n </AnimatePresence>\n </StyledRightWrapper>\n )}\n </StyledMotionAccordionHead>\n );\n};\n\nAccordionHead.displayName = 'AccordionHead';\n\nexport default AccordionHead;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAUA,IAAAG,cAAA,GAAAH,OAAA;AAaA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AAA6C,SAAAM,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,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IAC5B5B,OAAO,EAAE;MAAEO,OAAO,EAAE;IAAE,CAAE;IACxBc,IAAI,EAAE;MAAEd,OAAO,EAAE;IAAE,CAAE;IACrBL,OAAO,EAAE;MAAEK,OAAO,EAAE;IAAE,CAAE;IACxBO,GAAG,EAAC;EAAqB,GAExB/C,YAC4B,CAExB,CACD,CAED,CAAC;AAEpC,CAAC;AAEDT,aAAa,CAACuE,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7F,OAAA,GAE7BoB,aAAa"}
|
|
@@ -531,6 +531,10 @@ export declare const StyledMotionIconWrapper: import("styled-components").IStyle
|
|
|
531
531
|
} & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLDivElement>, {
|
|
532
532
|
theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
533
533
|
}>> & Omit<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
534
|
+
type StyledAccordionIconProps = WithTheme<{
|
|
535
|
+
icon: string;
|
|
536
|
+
}>;
|
|
537
|
+
export declare const StyledAccordionIcon: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, StyledAccordionIconProps>>;
|
|
534
538
|
export declare const StyledMotionContentWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<{
|
|
535
539
|
slot?: string | undefined;
|
|
536
540
|
title?: string | undefined;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyledRightWrapper = exports.StyledMotionTitleWrapper = exports.StyledMotionTitleElementWrapper = exports.StyledMotionTitle = exports.StyledMotionRightInputIconWrapper = exports.StyledMotionRightInput = exports.StyledMotionRightElementWrapper = exports.StyledMotionIconWrapper = exports.StyledMotionContentWrapper = exports.StyledMotionAccordionHead = void 0;
|
|
6
|
+
exports.StyledRightWrapper = exports.StyledMotionTitleWrapper = exports.StyledMotionTitleElementWrapper = exports.StyledMotionTitle = exports.StyledMotionRightInputIconWrapper = exports.StyledMotionRightInput = exports.StyledMotionRightElementWrapper = exports.StyledMotionIconWrapper = exports.StyledMotionContentWrapper = exports.StyledMotionAccordionHead = exports.StyledAccordionIcon = void 0;
|
|
7
7
|
var _framerMotion = require("framer-motion");
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -34,12 +34,33 @@ const StyledMotionIconWrapper = exports.StyledMotionIconWrapper = (0, _styledCom
|
|
|
34
34
|
justify-content: center;
|
|
35
35
|
width: 25px;
|
|
36
36
|
`;
|
|
37
|
+
const StyledAccordionIcon = exports.StyledAccordionIcon = _styledComponents.default.i`
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
display: flex;
|
|
41
|
+
color: ${_ref3 => {
|
|
42
|
+
let {
|
|
43
|
+
theme
|
|
44
|
+
} = _ref3;
|
|
45
|
+
return theme.headline;
|
|
46
|
+
}};
|
|
47
|
+
|
|
48
|
+
&:before {
|
|
49
|
+
content: ${_ref4 => {
|
|
50
|
+
let {
|
|
51
|
+
icon
|
|
52
|
+
} = _ref4;
|
|
53
|
+
return `"\\${icon}"`;
|
|
54
|
+
}};
|
|
55
|
+
font-family: 'Font Awesome 6 Pro', Fontawesome !important;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
37
58
|
const StyledMotionContentWrapper = exports.StyledMotionContentWrapper = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
38
59
|
align-self: flex-start;
|
|
39
|
-
cursor: ${
|
|
60
|
+
cursor: ${_ref5 => {
|
|
40
61
|
let {
|
|
41
62
|
onClick
|
|
42
|
-
} =
|
|
63
|
+
} = _ref5;
|
|
43
64
|
return typeof onClick === 'function' ? 'pointer' : 'default';
|
|
44
65
|
}};
|
|
45
66
|
display: flex;
|
|
@@ -54,43 +75,43 @@ const StyledMotionTitleWrapper = exports.StyledMotionTitleWrapper = (0, _styledC
|
|
|
54
75
|
grid-template-areas: 'header';
|
|
55
76
|
`;
|
|
56
77
|
const StyledMotionTitle = exports.StyledMotionTitle = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
57
|
-
font-size: ${
|
|
78
|
+
font-size: ${_ref6 => {
|
|
58
79
|
let {
|
|
59
80
|
isOpen,
|
|
60
81
|
isWrapped
|
|
61
|
-
} =
|
|
82
|
+
} = _ref6;
|
|
62
83
|
return isOpen && !isWrapped ? '1.3rem' : undefined;
|
|
63
84
|
}};
|
|
64
|
-
font-weight: ${
|
|
85
|
+
font-weight: ${_ref7 => {
|
|
65
86
|
let {
|
|
66
87
|
isOpen,
|
|
67
88
|
isWrapped
|
|
68
|
-
} =
|
|
89
|
+
} = _ref7;
|
|
69
90
|
return isOpen && isWrapped ? 700 : 'normal';
|
|
70
91
|
}};
|
|
71
92
|
grid-area: header;
|
|
72
|
-
height: ${
|
|
93
|
+
height: ${_ref8 => {
|
|
73
94
|
let {
|
|
74
95
|
isWrapped
|
|
75
|
-
} =
|
|
96
|
+
} = _ref8;
|
|
76
97
|
return isWrapped ? '100%' : undefined;
|
|
77
98
|
}};
|
|
78
99
|
overflow: hidden;
|
|
79
100
|
text-overflow: ellipsis;
|
|
80
101
|
transform-origin: top left;
|
|
81
102
|
user-select: none;
|
|
82
|
-
white-space: ${
|
|
103
|
+
white-space: ${_ref9 => {
|
|
83
104
|
let {
|
|
84
105
|
isOpen,
|
|
85
106
|
isWrapped
|
|
86
|
-
} =
|
|
107
|
+
} = _ref9;
|
|
87
108
|
return isOpen && !isWrapped ? 'normal' : 'nowrap';
|
|
88
109
|
}};
|
|
89
110
|
|
|
90
|
-
${
|
|
111
|
+
${_ref10 => {
|
|
91
112
|
let {
|
|
92
113
|
isWrapped
|
|
93
|
-
} =
|
|
114
|
+
} = _ref10;
|
|
94
115
|
return isWrapped && (0, _styledComponents.css)`
|
|
95
116
|
align-items: center;
|
|
96
117
|
display: flex;
|
|
@@ -120,25 +141,25 @@ const StyledMotionRightInput = exports.StyledMotionRightInput = (0, _styledCompo
|
|
|
120
141
|
background-color: transparent;
|
|
121
142
|
border: 1px solid transparent;
|
|
122
143
|
border-bottom-color: rgba(
|
|
123
|
-
${
|
|
144
|
+
${_ref11 => {
|
|
124
145
|
let {
|
|
125
146
|
theme
|
|
126
|
-
} =
|
|
147
|
+
} = _ref11;
|
|
127
148
|
return theme['headline-rgb'];
|
|
128
149
|
}},
|
|
129
150
|
0.45
|
|
130
151
|
);
|
|
131
|
-
color: ${
|
|
152
|
+
color: ${_ref12 => {
|
|
132
153
|
let {
|
|
133
154
|
theme
|
|
134
|
-
} =
|
|
155
|
+
} = _ref12;
|
|
135
156
|
return theme.text;
|
|
136
157
|
}};
|
|
137
158
|
grid-area: header;
|
|
138
|
-
padding: ${
|
|
159
|
+
padding: ${_ref13 => {
|
|
139
160
|
let {
|
|
140
161
|
hasIcon
|
|
141
|
-
} =
|
|
162
|
+
} = _ref13;
|
|
142
163
|
return hasIcon ? '5px 23px 5px 1px' : '5px 1px';
|
|
143
164
|
}};
|
|
144
165
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionHead.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","StyledMotionAccordionHead","exports","styled","motion","div","_ref","theme","text","StyledMotionIconWrapper","_ref2","onClick","
|
|
1
|
+
{"version":3,"file":"AccordionHead.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","StyledMotionAccordionHead","exports","styled","motion","div","_ref","theme","text","StyledMotionIconWrapper","_ref2","onClick","StyledAccordionIcon","_ref3","headline","_ref4","icon","StyledMotionContentWrapper","_ref5","StyledMotionTitleWrapper","StyledMotionTitle","_ref6","isOpen","isWrapped","undefined","_ref7","_ref8","_ref9","_ref10","css","StyledMotionTitleElementWrapper","StyledRightWrapper","StyledMotionRightElementWrapper","StyledMotionRightInput","input","_ref11","_ref12","_ref13","hasIcon","StyledMotionRightInputIconWrapper"],"sources":["../../../../src/components/accordion/accordion-head/AccordionHead.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled, { css } from 'styled-components';\nimport type {\n FramerMotionBugFix,\n WithTheme,\n} from '../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledMotionAccordionHeadProps = WithTheme<unknown>;\n\nexport const StyledMotionAccordionHead = styled(motion.div)<StyledMotionAccordionHeadProps>`\n align-items: center;\n color: ${({ theme }: StyledMotionAccordionHeadProps) => theme.text};\n display: flex;\n overflow: hidden;\n padding: 4px 0;\n`;\n\nexport const StyledMotionIconWrapper = styled(motion.div)<FramerMotionBugFix>`\n align-items: center;\n cursor: ${({ onClick }) => (typeof onClick === 'function' ? 'pointer' : 'default')};\n display: flex;\n flex: 0 0 auto;\n height: 25px;\n justify-content: center;\n width: 25px;\n`;\n\ntype StyledAccordionIconProps = WithTheme<{ icon: string }>;\n\nexport const StyledAccordionIcon = styled.i<StyledAccordionIconProps>`\n align-items: center;\n justify-content: center;\n display: flex;\n color: ${({ theme }: StyledAccordionIconProps) => theme.headline};\n\n &:before {\n content: ${({ icon }) => `\"\\\\${icon}\"`};\n font-family: 'Font Awesome 6 Pro', Fontawesome !important;\n }\n`;\n\nexport const StyledMotionContentWrapper = styled(motion.div)<FramerMotionBugFix>`\n align-self: flex-start;\n cursor: ${({ onClick }) => (typeof onClick === 'function' ? 'pointer' : 'default')};\n display: flex;\n flex: 1 1 auto;\n height: 100%;\n overflow: hidden;\n margin-right: 10px;\n`;\n\nexport const StyledMotionTitleWrapper = styled(motion.div)<FramerMotionBugFix>`\n display: grid;\n flex: 0 1 auto;\n grid-template-areas: 'header';\n`;\n\ninterface StyledMotionTitleProps {\n isOpen: boolean;\n isWrapped: boolean;\n}\n\nexport const StyledMotionTitle = styled(motion.div)<StyledMotionTitleProps>`\n font-size: ${({ isOpen, isWrapped }) => (isOpen && !isWrapped ? '1.3rem' : undefined)};\n font-weight: ${({ isOpen, isWrapped }) => (isOpen && isWrapped ? 700 : 'normal')};\n grid-area: header;\n height: ${({ isWrapped }) => (isWrapped ? '100%' : undefined)};\n overflow: hidden;\n text-overflow: ellipsis;\n transform-origin: top left;\n user-select: none;\n white-space: ${({ isOpen, isWrapped }) => (isOpen && !isWrapped ? 'normal' : 'nowrap')};\n\n ${({ isWrapped }) =>\n isWrapped &&\n css`\n align-items: center;\n display: flex;\n `}\n`;\n\nexport const StyledMotionTitleElementWrapper = styled(motion.div)<FramerMotionBugFix>`\n align-items: center;\n display: flex;\n margin-left: 8px;\n`;\n\nexport const StyledRightWrapper = styled.div`\n display: grid;\n flex: 0 0 auto;\n grid-template-areas: 'right';\n margin-right: 5px;\n overflow: hidden;\n position: relative;\n`;\n\nexport const StyledMotionRightElementWrapper = styled(motion.div)<FramerMotionBugFix>`\n align-items: center;\n display: flex;\n grid-area: header;\n justify-content: flex-end;\n`;\n\ntype StyledMotionRightInputProps = WithTheme<{\n hasIcon: boolean;\n}>;\n\nexport const StyledMotionRightInput = styled(motion.input)<StyledMotionRightInputProps>`\n background-color: transparent;\n border: 1px solid transparent;\n border-bottom-color: rgba(\n ${({ theme }: StyledMotionRightInputProps) => theme['headline-rgb']},\n 0.45\n );\n color: ${({ theme }: StyledMotionRightInputProps) => theme.text};\n grid-area: header;\n padding: ${({ hasIcon }) => (hasIcon ? '5px 23px 5px 1px' : '5px 1px')};\n`;\n\nexport const StyledMotionRightInputIconWrapper = styled(motion.div)<FramerMotionBugFix>`\n align-items: center;\n display: flex;\n height: 100%;\n justify-content: center;\n position: absolute;\n right: 4px;\n top: 0;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAgD,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL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;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAM2B,+BAA+B,GAAA9B,OAAA,CAAA8B,+BAAA,GAAG,IAAA7B,yBAAM,EAACC,oBAAM,CAACC,GAAG,CAAsB;AACtF;AACA;AACA;AACA;AACA,CAAC;AAMM,MAAM4B,sBAAsB,GAAA/B,OAAA,CAAA+B,sBAAA,GAAG,IAAA9B,yBAAM,EAACC,oBAAM,CAAC8B,KAAK,CAA+B;AACxF;AACA;AACA;AACA,UAAUC,MAAA;EAAA,IAAC;IAAE5B;EAAmC,CAAC,GAAA4B,MAAA;EAAA,OAAK5B,KAAK,CAAC,cAAc,CAAC;AAAA,CAAC;AAC5E;AACA;AACA,aAAa6B,MAAA;EAAA,IAAC;IAAE7B;EAAmC,CAAC,GAAA6B,MAAA;EAAA,OAAK7B,KAAK,CAACC,IAAI;AAAA,CAAC;AACpE;AACA,eAAe6B,MAAA;EAAA,IAAC;IAAEC;EAAQ,CAAC,GAAAD,MAAA;EAAA,OAAMC,OAAO,GAAG,kBAAkB,GAAG,SAAS;AAAA,CAAE;AAC3E,CAAC;AAEM,MAAMC,iCAAiC,GAAArC,OAAA,CAAAqC,iCAAA,GAAG,IAAApC,yBAAM,EAACC,oBAAM,CAACC,GAAG,CAAsB;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
+
import type { DesignSettings } from '../../types/colorSchemeProvider';
|
|
2
3
|
declare enum ColorMode {
|
|
3
4
|
Classic = 0,
|
|
4
5
|
Dark = 1,
|
|
@@ -23,6 +24,10 @@ type ColorSchemeProviderProps = {
|
|
|
23
24
|
cssVariables?: {
|
|
24
25
|
[key: string]: string | number;
|
|
25
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* The design settings of a page.
|
|
29
|
+
*/
|
|
30
|
+
designSettings?: DesignSettings;
|
|
26
31
|
/**
|
|
27
32
|
* The secondary hex color to be used for the children
|
|
28
33
|
*/
|
|
@@ -8,6 +8,8 @@ var _colors = require("@chayns/colors");
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _styledComponents = require("styled-components");
|
|
10
10
|
var _font = require("../../utils/font");
|
|
11
|
+
var _chaynsApi = require("chayns-api");
|
|
12
|
+
var _get = require("../../api/theme/get");
|
|
11
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
15
|
var ColorMode = /*#__PURE__*/function (ColorMode) {
|
|
@@ -28,39 +30,67 @@ const GlobalStyle = (0, _styledComponents.createGlobalStyle)`
|
|
|
28
30
|
const ColorSchemeProvider = _ref => {
|
|
29
31
|
let {
|
|
30
32
|
children,
|
|
31
|
-
color
|
|
32
|
-
colorMode
|
|
33
|
+
color,
|
|
34
|
+
colorMode,
|
|
33
35
|
cssVariables = {},
|
|
34
36
|
secondaryColor,
|
|
35
|
-
style = {}
|
|
37
|
+
style = {},
|
|
38
|
+
designSettings
|
|
36
39
|
} = _ref;
|
|
37
40
|
const [colors, setColors] = (0, _react.useState)({});
|
|
38
|
-
const [
|
|
41
|
+
const [theme, setTheme] = (0, _react.useState)({});
|
|
42
|
+
const [internalDesignSettings, setInternalDesignSettings] = (0, _react.useState)();
|
|
43
|
+
(0, _react.useEffect)(() => {
|
|
44
|
+
if (designSettings) {
|
|
45
|
+
setInternalDesignSettings(designSettings);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
void (0, _get.getDesignSettings)().then(result => {
|
|
49
|
+
setInternalDesignSettings(result);
|
|
50
|
+
});
|
|
51
|
+
}, [designSettings]);
|
|
52
|
+
const site = (0, _chaynsApi.getSite)();
|
|
53
|
+
const internalColorMode = colorMode ?? site.colorMode;
|
|
54
|
+
const internalColor = color ?? site.color;
|
|
39
55
|
(0, _react.useEffect)(() => {
|
|
40
56
|
const availableColors = (0, _colors.getAvailableColorList)();
|
|
41
57
|
const newColors = {};
|
|
42
|
-
const
|
|
58
|
+
const newTheme = {};
|
|
43
59
|
availableColors.forEach(colorName => {
|
|
44
60
|
const hexColor = (0, _colors.getColorFromPalette)(colorName, {
|
|
45
|
-
color,
|
|
46
|
-
colorMode,
|
|
61
|
+
color: internalColor,
|
|
62
|
+
colorMode: internalColorMode,
|
|
47
63
|
secondaryColor
|
|
48
64
|
});
|
|
49
65
|
if (hexColor) {
|
|
50
66
|
const rgbColor = (0, _colors.hexToRgb255)(hexColor);
|
|
51
67
|
newColors[`--chayns-color--${colorName}`] = hexColor;
|
|
52
|
-
|
|
68
|
+
newTheme[colorName] = hexColor;
|
|
53
69
|
if (rgbColor) {
|
|
54
70
|
newColors[`--chayns-color-rgb--${colorName}`] = `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;
|
|
55
|
-
|
|
71
|
+
newTheme[`${colorName}-rgb`] = `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;
|
|
56
72
|
}
|
|
57
73
|
}
|
|
58
74
|
});
|
|
75
|
+
if (internalDesignSettings) {
|
|
76
|
+
Object.keys(internalDesignSettings).forEach(key => {
|
|
77
|
+
if (key === 'iconStyle') {
|
|
78
|
+
newTheme[key] = (0, _font.convertIconStyle)(internalDesignSettings.iconStyle);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// ToDo: Find better solution
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
86
|
+
newTheme[key] = internalDesignSettings[key];
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
setTheme(newTheme);
|
|
59
90
|
setColors(newColors);
|
|
60
|
-
|
|
61
|
-
}, [color, colorMode, secondaryColor]);
|
|
91
|
+
}, [internalColor, internalColorMode, internalDesignSettings, secondaryColor]);
|
|
62
92
|
return /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
|
|
63
|
-
theme:
|
|
93
|
+
theme: theme
|
|
64
94
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
65
95
|
style: {
|
|
66
96
|
...colors,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSchemeProvider.js","names":["_colors","require","_react","_interopRequireWildcard","_styledComponents","_font","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ColorMode","GlobalStyle","createGlobalStyle","generateFontFaces","ColorSchemeProvider","_ref","children","color","colorMode","
|
|
1
|
+
{"version":3,"file":"ColorSchemeProvider.js","names":["_colors","require","_react","_interopRequireWildcard","_styledComponents","_font","_chaynsApi","_get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ColorMode","GlobalStyle","createGlobalStyle","generateFontFaces","ColorSchemeProvider","_ref","children","color","colorMode","cssVariables","secondaryColor","style","designSettings","colors","setColors","useState","theme","setTheme","internalDesignSettings","setInternalDesignSettings","useEffect","getDesignSettings","then","result","site","getSite","internalColorMode","internalColor","availableColors","getAvailableColorList","newColors","newTheme","forEach","colorName","hexColor","getColorFromPalette","rgbColor","hexToRgb255","g","b","keys","key","convertIconStyle","iconStyle","createElement","ThemeProvider","displayName","_default","exports"],"sources":["../../../src/components/color-scheme-provider/ColorSchemeProvider.tsx"],"sourcesContent":["import { getAvailableColorList, getColorFromPalette, hexToRgb255 } from '@chayns/colors';\nimport React, { FC, ReactNode, useEffect, useState } from 'react';\nimport { createGlobalStyle, ThemeProvider } from 'styled-components';\nimport { convertIconStyle, generateFontFaces } from '../../utils/font';\nimport type { DesignSettings } from '../../types/colorSchemeProvider';\nimport { getSite } from 'chayns-api';\nimport { getDesignSettings } from '../../api/theme/get';\n\nenum ColorMode {\n Classic,\n Dark,\n Light,\n}\n\ntype 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 * 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 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\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 ${generateFontFaces}\n\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n`;\n\nconst ColorSchemeProvider: FC<ColorSchemeProviderProps> = ({\n children,\n color,\n colorMode,\n cssVariables = {},\n secondaryColor,\n style = {},\n designSettings,\n}) => {\n const [colors, setColors] = useState<Theme>({});\n const [theme, setTheme] = useState<Theme>({});\n const [internalDesignSettings, setInternalDesignSettings] = useState<DesignSettings>();\n\n useEffect(() => {\n if (designSettings) {\n setInternalDesignSettings(designSettings);\n\n return;\n }\n\n void getDesignSettings().then((result) => {\n setInternalDesignSettings(result);\n });\n }, [designSettings]);\n\n const site = getSite();\n\n const internalColorMode = colorMode ?? site.colorMode;\n const internalColor = color ?? site.color;\n\n useEffect(() => {\n const availableColors = getAvailableColorList();\n\n const newColors: Theme = {};\n const newTheme: Theme = {};\n\n availableColors.forEach((colorName: string) => {\n const hexColor = getColorFromPalette(colorName, {\n color: internalColor,\n colorMode: internalColorMode,\n secondaryColor,\n });\n\n if (hexColor) {\n const rgbColor = hexToRgb255(hexColor);\n\n newColors[`--chayns-color--${colorName}`] = hexColor;\n newTheme[colorName] = hexColor;\n\n if (rgbColor) {\n newColors[`--chayns-color-rgb--${colorName}`] =\n `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;\n newTheme[`${colorName}-rgb`] = `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;\n }\n }\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 setTheme(newTheme);\n setColors(newColors);\n }, [internalColor, internalColorMode, internalDesignSettings, secondaryColor]);\n\n return (\n <ThemeProvider theme={theme}>\n <div style={{ ...colors, ...cssVariables, ...style }}>{children}</div>\n <GlobalStyle />\n </ThemeProvider>\n );\n};\n\nColorSchemeProvider.displayName = 'ColorSchemeProvider';\n\nexport default ColorSchemeProvider;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OA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BACIrC,MAAA,CAAAY,OAAA,CAAA2D,aAAA,CAACrE,iBAAA,CAAAsE,aAAa;IAAC7B,KAAK,EAAEA;EAAM,gBACxB3C,MAAA,CAAAY,OAAA,CAAA2D,aAAA;IAAKjC,KAAK,EAAE;MAAE,GAAGE,MAAM;MAAE,GAAGJ,YAAY;MAAE,GAAGE;IAAM;EAAE,GAAEL,QAAc,CAAC,eACtEjC,MAAA,CAAAY,OAAA,CAAA2D,aAAA,CAAC3C,WAAW,MAAE,CACH,CAAC;AAExB,CAAC;AAEDG,mBAAmB,CAAC0C,WAAW,GAAG,qBAAqB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA/D,OAAA,GAEzCmB,mBAAmB"}
|
|
@@ -7,12 +7,29 @@ exports.StyledContentCard = void 0;
|
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
9
|
const StyledContentCard = exports.StyledContentCard = _styledComponents.default.div`
|
|
10
|
-
background-color: ${_ref => {
|
|
10
|
+
background-color: rgba(${_ref => {
|
|
11
11
|
let {
|
|
12
12
|
theme
|
|
13
13
|
} = _ref;
|
|
14
|
-
return theme['
|
|
14
|
+
return theme['100-rgb'];
|
|
15
|
+
}}, ${_ref2 => {
|
|
16
|
+
let {
|
|
17
|
+
theme
|
|
18
|
+
} = _ref2;
|
|
19
|
+
return theme.cardBackgroundOpacity;
|
|
15
20
|
}};
|
|
21
|
+
border-radius: ${_ref3 => {
|
|
22
|
+
let {
|
|
23
|
+
theme
|
|
24
|
+
} = _ref3;
|
|
25
|
+
return theme.cardBorderRadius;
|
|
26
|
+
}}px;
|
|
27
|
+
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, ${_ref4 => {
|
|
28
|
+
let {
|
|
29
|
+
theme
|
|
30
|
+
} = _ref4;
|
|
31
|
+
return theme.cardShadow;
|
|
32
|
+
}});
|
|
16
33
|
padding: 8px 12px;
|
|
17
34
|
|
|
18
35
|
&:not(:last-child) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentCard.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledContentCard","exports","styled","div","_ref","theme"],"sources":["../../../src/components/content-card/ContentCard.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledContentCardProps = WithTheme<unknown>;\n\nexport const StyledContentCard = styled.div`\n background-color: ${({ theme }: StyledContentCardProps) => theme['
|
|
1
|
+
{"version":3,"file":"ContentCard.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledContentCard","exports","styled","div","_ref","theme","_ref2","cardBackgroundOpacity","_ref3","cardBorderRadius","_ref4","cardShadow"],"sources":["../../../src/components/content-card/ContentCard.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledContentCardProps = WithTheme<unknown>;\n\nexport const StyledContentCard = styled.div`\n background-color: rgba(${({ theme }: StyledContentCardProps) => theme['100-rgb']}, ${({ theme }: StyledContentCardProps) => theme.cardBackgroundOpacity};\n border-radius: ${({ theme }: StyledContentCardProps) => theme.cardBorderRadius}px;\n box-shadow: 0 2px 6px 0 rgba(0, 0, 0, ${({ theme }: StyledContentCardProps) => theme.cardShadow});\n padding: 8px 12px;\n\n &:not(:last-child) {\n margin-bottom: 8px;\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAKhC,MAAMG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGE,yBAAM,CAACC,GAAI;AAC5C,6BAA6BC,IAAA;EAAA,IAAC;IAAEC;EAA8B,CAAC,GAAAD,IAAA;EAAA,OAAKC,KAAK,CAAC,SAAS,CAAC;AAAA,CAAC,KAAIC,KAAA;EAAA,IAAC;IAAED;EAA8B,CAAC,GAAAC,KAAA;EAAA,OAAKD,KAAK,CAACE,qBAAqB;AAAA,CAAC;AAC5J,qBAAqBC,KAAA;EAAA,IAAC;IAAEH;EAA8B,CAAC,GAAAG,KAAA;EAAA,OAAKH,KAAK,CAACI,gBAAgB;AAAA,CAAC;AACnF,4CAA4CC,KAAA;EAAA,IAAC;IAAEL;EAA8B,CAAC,GAAAK,KAAA;EAAA,OAAKL,KAAK,CAACM,UAAU;AAAA,CAAC;AACpG;AACA;AACA;AACA;AACA;AACA,CAAC"}
|
|
@@ -8,6 +8,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _Icon = require("./Icon.styles");
|
|
10
10
|
var _icon = require("../../utils/icon");
|
|
11
|
+
var _styledComponents = require("styled-components");
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
const Icon = _ref => {
|
|
13
14
|
let {
|
|
@@ -37,6 +38,9 @@ const Icon = _ref => {
|
|
|
37
38
|
onDoubleClick(event);
|
|
38
39
|
}
|
|
39
40
|
};
|
|
41
|
+
const {
|
|
42
|
+
iconStyle
|
|
43
|
+
} = (0, _styledComponents.useTheme)();
|
|
40
44
|
let maxStackSizeFactor = 1;
|
|
41
45
|
icons.forEach(icon => {
|
|
42
46
|
const stackSizeFactor = (0, _icon.getStackSizeFactor)(icon);
|
|
@@ -55,7 +59,7 @@ const Icon = _ref => {
|
|
|
55
59
|
size: size
|
|
56
60
|
}, icons.map(icon => {
|
|
57
61
|
const stackSizeFactor = (0, _icon.getStackSizeFactor)(icon);
|
|
58
|
-
const iconClasses = (0, _clsx.default)(icon
|
|
62
|
+
const iconClasses = (0, _clsx.default)(`${iconStyle} ${icon}`, {
|
|
59
63
|
'fa-stack-1x': shouldUseStackedIcon && stackSizeFactor === undefined
|
|
60
64
|
});
|
|
61
65
|
return /*#__PURE__*/_react.default.createElement(_Icon.StyledIcon, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","names":["_clsx","_interopRequireDefault","require","_react","_Icon","_icon","obj","__esModule","default","Icon","_ref","className","color","icons","isDisabled","onClick","onDoubleClick","onMouseDown","size","shouldStopPropagation","handleClick","event","stopPropagation","handleDoubleClick","maxStackSizeFactor","forEach","icon","stackSizeFactor","getStackSizeFactor","shouldUseStackedIcon","length","wrapperClasses","clsx","createElement","StyledIconWrapper","undefined","map","iconClasses","StyledIcon","includes","fontSize","isStacked","key","displayName","_default","exports"],"sources":["../../../src/components/icon/Icon.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React, { FC, MouseEventHandler } from 'react';\nimport { StyledIcon, StyledIconWrapper } from './Icon.styles';\nimport { getStackSizeFactor } from '../../utils/icon';\n\nexport type IconProps = {\n /**\n * Additional class names for the root element\n */\n className?: string;\n /**\n * The color of the icon\n */\n color?: string;\n /**\n * The FontAwesome or tobit icons to render. Multiple icons are stacked.\n */\n icons: string[];\n /**\n * Disables the icon so that it cannot be clicked anymore\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when the icon was clicked\n */\n onClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon was double-clicked\n */\n onDoubleClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when a mouse button is pressed on the icon\n */\n onMouseDown?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Size of the icon in pixel\n */\n size?: number;\n /**\n * Stops event propagation on click\n */\n shouldStopPropagation?: boolean;\n};\n\nconst Icon: FC<IconProps> = ({\n className,\n color,\n icons,\n isDisabled,\n onClick,\n onDoubleClick,\n onMouseDown,\n size = 15,\n shouldStopPropagation,\n}) => {\n const handleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n };\n\n const handleDoubleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onDoubleClick === 'function') {\n onDoubleClick(event);\n }\n };\n\n let maxStackSizeFactor = 1;\n\n icons.forEach((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n if (stackSizeFactor && stackSizeFactor > maxStackSizeFactor) {\n maxStackSizeFactor = stackSizeFactor;\n }\n });\n\n const shouldUseStackedIcon = icons.length > 1;\n\n const wrapperClasses = clsx(\n 'beta-chayns-icon',\n shouldUseStackedIcon ? 'fa-stack' : '',\n className,\n );\n\n return (\n <StyledIconWrapper\n className={wrapperClasses}\n isDisabled={isDisabled}\n onClick={typeof onClick === 'function' ? handleClick : undefined}\n onDoubleClick={typeof onDoubleClick === 'function' ? handleDoubleClick : undefined}\n onMouseDown={onMouseDown}\n size={size}\n >\n {icons.map((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n const iconClasses = clsx(icon
|
|
1
|
+
{"version":3,"file":"Icon.js","names":["_clsx","_interopRequireDefault","require","_react","_Icon","_icon","_styledComponents","obj","__esModule","default","Icon","_ref","className","color","icons","isDisabled","onClick","onDoubleClick","onMouseDown","size","shouldStopPropagation","handleClick","event","stopPropagation","handleDoubleClick","iconStyle","useTheme","maxStackSizeFactor","forEach","icon","stackSizeFactor","getStackSizeFactor","shouldUseStackedIcon","length","wrapperClasses","clsx","createElement","StyledIconWrapper","undefined","map","iconClasses","StyledIcon","includes","fontSize","isStacked","key","displayName","_default","exports"],"sources":["../../../src/components/icon/Icon.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React, { FC, MouseEventHandler } from 'react';\nimport { StyledIcon, StyledIconWrapper } from './Icon.styles';\nimport { getStackSizeFactor } from '../../utils/icon';\nimport { useTheme } from 'styled-components';\n\nexport type IconProps = {\n /**\n * Additional class names for the root element\n */\n className?: string;\n /**\n * The color of the icon\n */\n color?: string;\n /**\n * The FontAwesome or tobit icons to render. Multiple icons are stacked.\n */\n icons: string[];\n /**\n * Disables the icon so that it cannot be clicked anymore\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when the icon was clicked\n */\n onClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon was double-clicked\n */\n onDoubleClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when a mouse button is pressed on the icon\n */\n onMouseDown?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Size of the icon in pixel\n */\n size?: number;\n /**\n * Stops event propagation on click\n */\n shouldStopPropagation?: boolean;\n};\n\nconst Icon: FC<IconProps> = ({\n className,\n color,\n icons,\n isDisabled,\n onClick,\n onDoubleClick,\n onMouseDown,\n size = 15,\n shouldStopPropagation,\n}) => {\n const handleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n };\n\n const handleDoubleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onDoubleClick === 'function') {\n onDoubleClick(event);\n }\n };\n\n const { iconStyle } = useTheme();\n\n let maxStackSizeFactor = 1;\n\n icons.forEach((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n if (stackSizeFactor && stackSizeFactor > maxStackSizeFactor) {\n maxStackSizeFactor = stackSizeFactor;\n }\n });\n\n const shouldUseStackedIcon = icons.length > 1;\n\n const wrapperClasses = clsx(\n 'beta-chayns-icon',\n shouldUseStackedIcon ? 'fa-stack' : '',\n className,\n );\n\n return (\n <StyledIconWrapper\n className={wrapperClasses}\n isDisabled={isDisabled}\n onClick={typeof onClick === 'function' ? handleClick : undefined}\n onDoubleClick={typeof onDoubleClick === 'function' ? handleDoubleClick : undefined}\n onMouseDown={onMouseDown}\n size={size}\n >\n {icons.map((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n const iconClasses = clsx(`${iconStyle as string} ${icon}`, {\n 'fa-stack-1x': shouldUseStackedIcon && stackSizeFactor === undefined,\n });\n\n return (\n <StyledIcon\n className={iconClasses}\n color={icon.includes('fa-inverse') ? 'white' : color}\n fontSize={((stackSizeFactor || 1) / maxStackSizeFactor) * size}\n isStacked={shouldUseStackedIcon}\n key={icon}\n size={size}\n />\n );\n })}\n </StyledIconWrapper>\n );\n};\n\nIcon.displayName = 'Icon';\n\nexport default Icon;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAA6C,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAyC7C,MAAMG,IAAmB,GAAGC,IAAA,IAUtB;EAAA,IAVuB;IACzBC,SAAS;IACTC,KAAK;IACLC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC,aAAa;IACbC,WAAW;IACXC,IAAI,GAAG,EAAE;IACTC;EACJ,CAAC,GAAAT,IAAA;EACG,MAAMU,WAA+C,GAAIC,KAAK,IAAK;IAC/D,IAAIF,qBAAqB,EAAE;MACvBE,KAAK,CAACC,eAAe,CAAC,CAAC;IAC3B;IAEA,IAAI,OAAOP,OAAO,KAAK,UAAU,EAAE;MAC/BA,OAAO,CAACM,KAAK,CAAC;IAClB;EACJ,CAAC;EAED,MAAME,iBAAqD,GAAIF,KAAK,IAAK;IACrE,IAAIF,qBAAqB,EAAE;MACvBE,KAAK,CAACC,eAAe,CAAC,CAAC;IAC3B;IAEA,IAAI,OAAON,aAAa,KAAK,UAAU,EAAE;MACrCA,aAAa,CAACK,KAAK,CAAC;IACxB;E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,CAAC,YAAY,CAAC,GAAG,OAAO,GAAG7B,KAAM;MACrD8B,QAAQ,EAAG,CAACb,eAAe,IAAI,CAAC,IAAIH,kBAAkB,GAAIR,IAAK;MAC/DyB,SAAS,EAAEZ,oBAAqB;MAChCa,GAAG,EAAEhB,IAAK;MACVV,IAAI,EAAEA;IAAK,CACd,CAAC;EAEV,CAAC,CACc,CAAC;AAE5B,CAAC;AAEDT,IAAI,CAACoC,WAAW,GAAG,MAAM;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAvC,OAAA,GAEXC,IAAI"}
|
|
@@ -18,7 +18,6 @@ const TextArea = _ref => {
|
|
|
18
18
|
maxHeight = '120px',
|
|
19
19
|
minHeight = '41px'
|
|
20
20
|
} = _ref;
|
|
21
|
-
const [displayedValue, setDisplayedValue] = (0, _react.useState)('');
|
|
22
21
|
const [isOverflowing, setIsOverflowing] = (0, _react.useState)(false);
|
|
23
22
|
const textareaRef = (0, _react.useRef)(null);
|
|
24
23
|
const {
|
|
@@ -37,40 +36,21 @@ const TextArea = _ref => {
|
|
|
37
36
|
* To maintain the functionality while clearing the input, the length need to be greater than -1.
|
|
38
37
|
*/
|
|
39
38
|
(0, _react.useEffect)(() => {
|
|
40
|
-
if (
|
|
39
|
+
if (value && value.length > -1) {
|
|
41
40
|
adjustTextareaHeight();
|
|
42
41
|
}
|
|
43
|
-
}, [adjustTextareaHeight,
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* This function sets the external value
|
|
47
|
-
*/
|
|
48
|
-
(0, _react.useEffect)(() => {
|
|
49
|
-
if (typeof value === 'string') {
|
|
50
|
-
setDisplayedValue(value);
|
|
51
|
-
}
|
|
52
|
-
}, [value]);
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* This function updates the value
|
|
56
|
-
*/
|
|
57
|
-
const handleChange = (0, _react.useCallback)(event => {
|
|
58
|
-
setDisplayedValue(event.target.value);
|
|
59
|
-
if (onChange) {
|
|
60
|
-
onChange(event);
|
|
61
|
-
}
|
|
62
|
-
}, [onChange]);
|
|
42
|
+
}, [adjustTextareaHeight, value]);
|
|
63
43
|
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_TextArea.StyledTextArea, null, /*#__PURE__*/_react.default.createElement(_TextArea.StyledTextAreaInput, {
|
|
64
44
|
browser: browser?.name,
|
|
65
45
|
ref: textareaRef,
|
|
66
|
-
value:
|
|
46
|
+
value: value,
|
|
67
47
|
onBlur: onBlur,
|
|
68
|
-
onChange:
|
|
48
|
+
onChange: onChange,
|
|
69
49
|
maxHeight: maxHeight,
|
|
70
50
|
minHeight: minHeight,
|
|
71
51
|
isOverflowing: isOverflowing,
|
|
72
52
|
rows: 1
|
|
73
|
-
}), !
|
|
53
|
+
}), !value && /*#__PURE__*/_react.default.createElement(_TextArea.StyledTextAreaLabel, null, placeholder)), [browser?.name, isOverflowing, maxHeight, minHeight, onBlur, onChange, placeholder, value]);
|
|
74
54
|
};
|
|
75
55
|
TextArea.displayName = 'TextArea';
|
|
76
56
|
var _default = exports.default = TextArea;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","names":["_chaynsApi","require","_react","_interopRequireWildcard","_TextArea","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","TextArea","_ref","placeholder","value","onChange","onBlur","maxHeight","minHeight","
|
|
1
|
+
{"version":3,"file":"TextArea.js","names":["_chaynsApi","require","_react","_interopRequireWildcard","_TextArea","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","TextArea","_ref","placeholder","value","onChange","onBlur","maxHeight","minHeight","isOverflowing","setIsOverflowing","useState","textareaRef","useRef","browser","getDevice","adjustTextareaHeight","useCallback","current","style","height","scrollHeight","parseInt","toString","useEffect","length","useMemo","createElement","StyledTextArea","StyledTextAreaInput","name","ref","rows","StyledTextAreaLabel","displayName","_default","exports"],"sources":["../../../src/components/text-area/TextArea.tsx"],"sourcesContent":["import { getDevice } from 'chayns-api';\nimport React, {\n ChangeEventHandler,\n CSSProperties,\n FC,\n FocusEventHandler,\n ReactElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { StyledTextArea, StyledTextAreaInput, StyledTextAreaLabel } from './TextArea.styles';\n\nexport type TextAreaProps = {\n /**\n * The maximum height of the text area.\n */\n maxHeight?: CSSProperties['maxHeight'];\n /**\n * The minimum height of the text area.\n */\n minHeight?: CSSProperties['minHeight'];\n /**\n * Function that is executed when the text area loses focus.\n */\n onBlur?: FocusEventHandler<HTMLTextAreaElement>;\n /**\n * Function that is executed when the text of the text area changes.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement>;\n /**\n * Placeholder for the text area field.\n */\n placeholder?: string | ReactElement;\n /**\n * Value if the text area should be controlled.\n */\n value?: string;\n};\n\nconst TextArea: FC<TextAreaProps> = ({\n placeholder,\n value,\n onChange,\n onBlur,\n maxHeight = '120px',\n minHeight = '41px',\n}) => {\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const { browser } = getDevice();\n\n const adjustTextareaHeight = useCallback(() => {\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;\n\n setIsOverflowing(textareaRef.current.scrollHeight > parseInt(maxHeight.toString(), 10));\n }\n }, [maxHeight]);\n\n /**\n * This hook calculates the height of the TextArea after the displayValue is changed and the content is inside the \"textareaRef\".\n * To maintain the functionality while clearing the input, the length need to be greater than -1.\n */\n useEffect(() => {\n if (value && value.length > -1) {\n adjustTextareaHeight();\n }\n }, [adjustTextareaHeight, value]);\n\n return useMemo(\n () => (\n <StyledTextArea>\n <StyledTextAreaInput\n browser={browser?.name}\n ref={textareaRef}\n value={value}\n onBlur={onBlur}\n onChange={onChange}\n maxHeight={maxHeight}\n minHeight={minHeight}\n isOverflowing={isOverflowing}\n rows={1}\n />\n {!value && <StyledTextAreaLabel>{placeholder}</StyledTextAreaLabel>}\n </StyledTextArea>\n ),\n [browser?.name, isOverflowing, maxHeight, minHeight, onBlur, onChange, placeholder, value],\n );\n};\n\nTextArea.displayName = 'TextArea';\n\nexport default TextArea;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAYA,IAAAG,SAAA,GAAAH,OAAA;AAA6F,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GA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AAC,EAAE,CAACA,oBAAoB,EAAEZ,KAAK,CAAC,CAAC;EAEjC,OAAO,IAAAsB,cAAO,EACV,mBACIjD,MAAA,CAAAS,OAAA,CAAAyC,aAAA,CAAChD,SAAA,CAAAiD,cAAc,qBACXnD,MAAA,CAAAS,OAAA,CAAAyC,aAAA,CAAChD,SAAA,CAAAkD,mBAAmB;IAChBf,OAAO,EAAEA,OAAO,EAAEgB,IAAK;IACvBC,GAAG,EAAEnB,WAAY;IACjBR,KAAK,EAAEA,KAAM;IACbE,MAAM,EAAEA,MAAO;IACfD,QAAQ,EAAEA,QAAS;IACnBE,SAAS,EAAEA,SAAU;IACrBC,SAAS,EAAEA,SAAU;IACrBC,aAAa,EAAEA,aAAc;IAC7BuB,IAAI,EAAE;EAAE,CACX,CAAC,EACD,CAAC5B,KAAK,iBAAI3B,MAAA,CAAAS,OAAA,CAAAyC,aAAA,CAAChD,SAAA,CAAAsD,mBAAmB,QAAE9B,WAAiC,CACtD,CACnB,EACD,CAACW,OAAO,EAAEgB,IAAI,EAAErB,aAAa,EAAEF,SAAS,EAAEC,SAAS,EAAEF,MAAM,EAAED,QAAQ,EAAEF,WAAW,EAAEC,KAAK,CAC7F,CAAC;AACL,CAAC;AAEDH,QAAQ,CAACiC,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlD,OAAA,GAEnBe,QAAQ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface DesignSettings {
|
|
2
|
+
accordionIcon: number;
|
|
3
|
+
accordionLines: boolean;
|
|
4
|
+
cardBorderRadius: number;
|
|
5
|
+
cardBackgroundOpacity: number;
|
|
6
|
+
cardShadow: number;
|
|
7
|
+
iconStyle: IconStyle;
|
|
8
|
+
}
|
|
9
|
+
export declare enum IconStyle {
|
|
10
|
+
SOLID = 0,
|
|
11
|
+
REGULAR = 1,
|
|
12
|
+
LIGHT = 2,
|
|
13
|
+
DUOTONE = 3,
|
|
14
|
+
SHARP = 4
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.IconStyle = void 0;
|
|
7
|
+
let IconStyle = exports.IconStyle = /*#__PURE__*/function (IconStyle) {
|
|
8
|
+
IconStyle[IconStyle["SOLID"] = 0] = "SOLID";
|
|
9
|
+
IconStyle[IconStyle["REGULAR"] = 1] = "REGULAR";
|
|
10
|
+
IconStyle[IconStyle["LIGHT"] = 2] = "LIGHT";
|
|
11
|
+
IconStyle[IconStyle["DUOTONE"] = 3] = "DUOTONE";
|
|
12
|
+
IconStyle[IconStyle["SHARP"] = 4] = "SHARP";
|
|
13
|
+
return IconStyle;
|
|
14
|
+
}({});
|
|
15
|
+
//# sourceMappingURL=colorSchemeProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorSchemeProvider.js","names":["IconStyle","exports"],"sources":["../../src/types/colorSchemeProvider.ts"],"sourcesContent":["export interface DesignSettings {\n accordionIcon: number;\n accordionLines: boolean;\n cardBorderRadius: number;\n cardBackgroundOpacity: number;\n cardShadow: number;\n iconStyle: IconStyle;\n}\n\nexport enum IconStyle {\n SOLID,\n REGULAR,\n LIGHT,\n DUOTONE,\n SHARP,\n}\n"],"mappings":";;;;;;IASYA,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"}
|
package/lib/utils/font.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { IconStyle } from '../types/colorSchemeProvider';
|
|
1
2
|
export interface Font {
|
|
2
3
|
family: string;
|
|
3
4
|
src: string;
|
|
4
5
|
unicodeRange?: string;
|
|
5
6
|
}
|
|
7
|
+
export declare const convertIconStyle: (iconStyle: IconStyle) => "fa-solid" | "fa-duotone" | "fa-sharp" | "fa-light" | "fa-regular";
|
|
6
8
|
export declare const generateFontFaces: () => string;
|
package/lib/utils/font.js
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.generateFontFaces = void 0;
|
|
6
|
+
exports.generateFontFaces = exports.convertIconStyle = void 0;
|
|
7
|
+
var _colorSchemeProvider = require("../types/colorSchemeProvider");
|
|
7
8
|
const fonts = [{
|
|
8
9
|
family: 'Noto Color Emoji',
|
|
9
10
|
src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.0.woff2',
|
|
@@ -45,6 +46,21 @@ const fonts = [{
|
|
|
45
46
|
src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.9.woff2',
|
|
46
47
|
unicodeRange: 'U+200d, U+261d, U+2620, U+2639-263a, U+2665, U+270a-270d, U+2728, U+2763-2764, U+2b50, U+fe0f, U+1f31a-1f31f, U+1f32b, U+1f383, U+1f389, U+1f3fb-1f3ff, U+1f440-1f450, U+1f463-1f465, U+1f479-1f47b, U+1f47d-1f480, U+1f485, U+1f48b-1f48c, U+1f493-1f49f, U+1f4a4-1f4a6, U+1f4a8-1f4ab, U+1f4af, U+1f525, U+1f573, U+1f590, U+1f595-1f596, U+1f5a4, U+1f5e3, U+1f600-1f644, U+1f648-1f64a, U+1f64c, U+1f64f, U+1f90c-1f925, U+1f927-1f92f, U+1f932-1f933, U+1f970-1f976, U+1f978-1f97a, U+1f9a0, U+1f9b4-1f9b7, U+1f9bb, U+1f9be-1f9bf, U+1f9d0, U+1f9e0-1f9e1, U+1fa75-1fa79, U+1fac0-1fac2, U+1fae0-1fae6, U+1fae8, U+1faf0-1faf8'
|
|
47
48
|
}];
|
|
49
|
+
const convertIconStyle = iconStyle => {
|
|
50
|
+
switch (iconStyle) {
|
|
51
|
+
case _colorSchemeProvider.IconStyle.SOLID:
|
|
52
|
+
return 'fa-solid';
|
|
53
|
+
case _colorSchemeProvider.IconStyle.DUOTONE:
|
|
54
|
+
return 'fa-duotone';
|
|
55
|
+
case _colorSchemeProvider.IconStyle.SHARP:
|
|
56
|
+
return 'fa-sharp';
|
|
57
|
+
case _colorSchemeProvider.IconStyle.LIGHT:
|
|
58
|
+
return 'fa-light';
|
|
59
|
+
default:
|
|
60
|
+
return 'fa-regular';
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.convertIconStyle = convertIconStyle;
|
|
48
64
|
const generateFontFaces = () => fonts.map(font => `
|
|
49
65
|
@font-face {
|
|
50
66
|
font-display: swap;
|
package/lib/utils/font.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.js","names":["fonts","family","src","unicodeRange","generateFontFaces","map","font","join","exports"],"sources":["../../src/utils/font.ts"],"sourcesContent":["export interface Font {\n family: string;\n src: string;\n unicodeRange?: string;\n}\n\nconst fonts: Font[] = [\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.0.woff2',\n unicodeRange: 'U+1f1e6-1f1ff',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.1.woff2',\n unicodeRange:\n 'U+200d, U+2620, U+26a7, U+fe0f, U+1f308, U+1f38c, U+1f3c1, U+1f3f3-1f3f4, U+1f6a9, U+e0062-e0063, U+e0065, U+e0067, U+e006c, U+e006e, U+e0073-e0074, U+e0077, U+e007f',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.2.woff2',\n unicodeRange:\n 'U+23, U+2a, U+30-39, U+a9, U+ae, U+200d, U+203c, U+2049, U+20e3, U+2122, U+2139, U+2194-2199, U+21a9-21aa, U+23cf, U+23e9-23ef, U+23f8-23fa, U+24c2, U+25aa-25ab, U+25b6, U+25c0, U+25fb-25fe, U+2611, U+2622-2623, U+2626, U+262a, U+262e-262f, U+2638, U+2640, U+2642, U+2648-2653, U+2660, U+2663, U+2665-2666, U+2668, U+267b, U+267e-267f, U+2695, U+269b-269c, U+26a0, U+26a7, U+26aa-26ab, U+26ce, U+26d4, U+2705, U+2714, U+2716, U+271d, U+2721, U+2733-2734, U+2747, U+274c, U+274e, U+2753-2755, U+2757, U+2764, U+2795-2797, U+27a1, U+27b0, U+27bf, U+2934-2935, U+2b05-2b07, U+2b1b-2b1c, U+2b55, U+3030, U+303d, U+3297, U+3299, U+fe0f, U+1f170-1f171, U+1f17e-1f17f, U+1f18e, U+1f191-1f19a, U+1f201-1f202, U+1f21a, U+1f22f, U+1f232-1f23a, U+1f250-1f251, U+1f310, U+1f3a6, U+1f3b5-1f3b6, U+1f3bc, U+1f3e7, U+1f441, U+1f499-1f49c, U+1f49f-1f4a0, U+1f4a2, U+1f4ac-1f4ad, U+1f4b1-1f4b2, U+1f4b9, U+1f4db, U+1f4f2-1f4f6, U+1f500-1f50a, U+1f515, U+1f518-1f524, U+1f52f-1f53d, U+1f549, U+1f54e, U+1f5a4, U+1f5e8, U+1f5ef, U+1f6ab, U+1f6ad-1f6b1, U+1f6b3, U+1f6b7-1f6bc, U+1f6be, U+1f6c2-1f6c5, U+1f6d0-1f6d1, U+1f6d7, U+1f6dc, U+1f7e0-1f7eb, U+1f7f0, U+1f90d-1f90e, U+1f9e1, U+1fa75-1fa77, U+1faaf',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.3.woff2',\n unicodeRange:\n 'U+231a-231b, U+2328, U+23f0-23f3, U+2602, U+260e, U+2692, U+2694, U+2696-2697, U+2699, U+26b0-26b1, U+26cf, U+26d1, U+26d3, U+2702, U+2709, U+270f, U+2712, U+fe0f, U+1f302, U+1f321, U+1f392-1f393, U+1f3a9, U+1f3bd, U+1f3ee, U+1f3f7, U+1f3fa, U+1f451-1f462, U+1f484, U+1f489-1f48a, U+1f48c-1f48e, U+1f4a1, U+1f4a3, U+1f4b0, U+1f4b3-1f4b8, U+1f4bb-1f4da, U+1f4dc-1f4f1, U+1f4ff, U+1f50b-1f514, U+1f516-1f517, U+1f526-1f529, U+1f52c-1f52e, U+1f550-1f567, U+1f56f-1f570, U+1f576, U+1f587, U+1f58a-1f58d, U+1f5a5, U+1f5a8, U+1f5b1-1f5b2, U+1f5c2-1f5c4, U+1f5d1-1f5d3, U+1f5dc-1f5de, U+1f5e1, U+1f5f3, U+1f6aa, U+1f6ac, U+1f6bd, U+1f6bf, U+1f6c1, U+1f6cb, U+1f6cd-1f6cf, U+1f6d2, U+1f6e0-1f6e1, U+1f6f0, U+1f97b-1f97f, U+1f9af, U+1f9ba, U+1f9e2-1f9e6, U+1f9ea-1f9ec, U+1f9ee-1f9f4, U+1f9f7-1f9ff, U+1fa71-1fa74, U+1fa79-1fa7b, U+1fa86, U+1fa91-1fa93, U+1fa96, U+1fa99-1faa0, U+1faa2-1faa7, U+1faaa-1faae',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.4.woff2',\n unicodeRange:\n 'U+265f, U+26bd-26be, U+26f3, U+26f8, U+fe0f, U+1f004, U+1f0cf, U+1f380-1f384, U+1f386-1f38b, U+1f38d-1f391, U+1f396-1f397, U+1f399-1f39b, U+1f39e-1f39f, U+1f3a3-1f3a5, U+1f3a7-1f3a9, U+1f3ab-1f3b4, U+1f3b7-1f3bb, U+1f3bd-1f3c0, U+1f3c5-1f3c6, U+1f3c8-1f3c9, U+1f3cf-1f3d3, U+1f3f8-1f3f9, U+1f47e, U+1f4e2, U+1f4f7-1f4fd, U+1f52b, U+1f579, U+1f58c-1f58d, U+1f5bc, U+1f6f7, U+1f6f9, U+1f6fc, U+1f93f, U+1f941, U+1f945, U+1f947-1f94f, U+1f9e7-1f9e9, U+1f9f5-1f9f6, U+1fa70-1fa71, U+1fa80-1fa81, U+1fa83-1fa85, U+1fa87-1fa88, U+1fa94-1fa95, U+1fa97-1fa98, U+1faa1, U+1faa9',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.5.woff2',\n unicodeRange:\n 'U+2693, U+26e9-26ea, U+26f1-26f2, U+26f4-26f5, U+26fa, U+26fd, U+2708, U+fe0f, U+1f301, U+1f303, U+1f306-1f307, U+1f309, U+1f310, U+1f3a0-1f3a2, U+1f3aa, U+1f3cd-1f3ce, U+1f3d5, U+1f3d7-1f3db, U+1f3df-1f3e6, U+1f3e8-1f3ed, U+1f3ef-1f3f0, U+1f488, U+1f492, U+1f4ba, U+1f54b-1f54d, U+1f5fa-1f5ff, U+1f680-1f6a2, U+1f6a4-1f6a8, U+1f6b2, U+1f6d1, U+1f6d5-1f6d6, U+1f6dd-1f6df, U+1f6e2-1f6e5, U+1f6e9, U+1f6eb-1f6ec, U+1f6f3-1f6f6, U+1f6f8, U+1f6fa-1f6fb, U+1f9bc-1f9bd, U+1f9ed, U+1f9f3, U+1fa7c',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.6.woff2',\n unicodeRange:\n 'U+2615, U+fe0f, U+1f32d-1f330, U+1f336, U+1f33d, U+1f345-1f37f, U+1f382, U+1f52a, U+1f942-1f944, U+1f950-1f96f, U+1f99e, U+1f9aa, U+1f9c0-1f9cb, U+1fad0-1fadb',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.7.woff2',\n unicodeRange:\n 'U+200d, U+2600-2601, U+2603-2604, U+2614, U+2618, U+26a1, U+26c4-26c5, U+26c8, U+26f0, U+2728, U+2744, U+2b1b, U+2b50, U+fe0f, U+1f300, U+1f304-1f305, U+1f308, U+1f30a-1f30f, U+1f311-1f321, U+1f324-1f32c, U+1f331-1f335, U+1f337-1f33c, U+1f33e-1f344, U+1f3d4, U+1f3d6, U+1f3dc-1f3de, U+1f3f5, U+1f400-1f43f, U+1f490, U+1f4a7, U+1f4ab, U+1f4ae, U+1f525, U+1f54a, U+1f573, U+1f577-1f578, U+1f648-1f64a, U+1f940, U+1f980-1f9ae, U+1f9ba, U+1fa90, U+1faa8, U+1fab0-1fabd, U+1fabf, U+1face-1facf, U+1fae7',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.8.woff2',\n unicodeRange:\n 'U+200d, U+2640, U+2642, U+2695-2696, U+26f7, U+26f9, U+2708, U+2764, U+fe0f, U+1f33e, U+1f373, U+1f37c, U+1f384-1f385, U+1f393, U+1f3a4, U+1f3a8, U+1f3c2-1f3c4, U+1f3c7, U+1f3ca-1f3cc, U+1f3eb, U+1f3ed, U+1f3fb-1f3ff, U+1f466-1f478, U+1f47c, U+1f481-1f483, U+1f486-1f487, U+1f48b, U+1f48f, U+1f491, U+1f4bb-1f4bc, U+1f527, U+1f52c, U+1f574-1f575, U+1f57a, U+1f645-1f647, U+1f64b, U+1f64d-1f64e, U+1f680, U+1f692, U+1f6a3, U+1f6b4-1f6b6, U+1f6c0, U+1f6cc, U+1f91d, U+1f926, U+1f930-1f931, U+1f934-1f93a, U+1f93c-1f93e, U+1f977, U+1f9af-1f9b3, U+1f9b8-1f9b9, U+1f9bc-1f9bd, U+1f9cc-1f9cf, U+1f9d1-1f9df, U+1fa82, U+1fac3-1fac5',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.9.woff2',\n unicodeRange:\n 'U+200d, U+261d, U+2620, U+2639-263a, U+2665, U+270a-270d, U+2728, U+2763-2764, U+2b50, U+fe0f, U+1f31a-1f31f, U+1f32b, U+1f383, U+1f389, U+1f3fb-1f3ff, U+1f440-1f450, U+1f463-1f465, U+1f479-1f47b, U+1f47d-1f480, U+1f485, U+1f48b-1f48c, U+1f493-1f49f, U+1f4a4-1f4a6, U+1f4a8-1f4ab, U+1f4af, U+1f525, U+1f573, U+1f590, U+1f595-1f596, U+1f5a4, U+1f5e3, U+1f600-1f644, U+1f648-1f64a, U+1f64c, U+1f64f, U+1f90c-1f925, U+1f927-1f92f, U+1f932-1f933, U+1f970-1f976, U+1f978-1f97a, U+1f9a0, U+1f9b4-1f9b7, U+1f9bb, U+1f9be-1f9bf, U+1f9d0, U+1f9e0-1f9e1, U+1fa75-1fa79, U+1fac0-1fac2, U+1fae0-1fae6, U+1fae8, U+1faf0-1faf8',\n },\n];\n\nexport const generateFontFaces = () =>\n fonts\n .map(\n (font) => `\n @font-face {\n font-display: swap;\n font-family: \"${font.family}\";\n font-style: normal;\n font-weight: 400;\n src: url(\"${font.src}\") format(\"woff2\");\n ${font.unicodeRange ? `unicode-range: ${font.unicodeRange};` : ''}\n }\n`\n )\n .join('');\n"],"mappings":";;;;;;AAMA,MAAMA,KAAa,GAAG,CACl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AA,iBAAA"}
|
|
1
|
+
{"version":3,"file":"font.js","names":["_colorSchemeProvider","require","fonts","family","src","unicodeRange","convertIconStyle","iconStyle","IconStyle","SOLID","DUOTONE","SHARP","LIGHT","exports","generateFontFaces","map","font","join"],"sources":["../../src/utils/font.ts"],"sourcesContent":["import { IconStyle } from '../types/colorSchemeProvider';\n\nexport interface Font {\n family: string;\n src: string;\n unicodeRange?: string;\n}\n\nconst fonts: Font[] = [\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.0.woff2',\n unicodeRange: 'U+1f1e6-1f1ff',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.1.woff2',\n unicodeRange:\n 'U+200d, U+2620, U+26a7, U+fe0f, U+1f308, U+1f38c, U+1f3c1, U+1f3f3-1f3f4, U+1f6a9, U+e0062-e0063, U+e0065, U+e0067, U+e006c, U+e006e, U+e0073-e0074, U+e0077, U+e007f',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.2.woff2',\n unicodeRange:\n 'U+23, U+2a, U+30-39, U+a9, U+ae, U+200d, U+203c, U+2049, U+20e3, U+2122, U+2139, U+2194-2199, U+21a9-21aa, U+23cf, U+23e9-23ef, U+23f8-23fa, U+24c2, U+25aa-25ab, U+25b6, U+25c0, U+25fb-25fe, U+2611, U+2622-2623, U+2626, U+262a, U+262e-262f, U+2638, U+2640, U+2642, U+2648-2653, U+2660, U+2663, U+2665-2666, U+2668, U+267b, U+267e-267f, U+2695, U+269b-269c, U+26a0, U+26a7, U+26aa-26ab, U+26ce, U+26d4, U+2705, U+2714, U+2716, U+271d, U+2721, U+2733-2734, U+2747, U+274c, U+274e, U+2753-2755, U+2757, U+2764, U+2795-2797, U+27a1, U+27b0, U+27bf, U+2934-2935, U+2b05-2b07, U+2b1b-2b1c, U+2b55, U+3030, U+303d, U+3297, U+3299, U+fe0f, U+1f170-1f171, U+1f17e-1f17f, U+1f18e, U+1f191-1f19a, U+1f201-1f202, U+1f21a, U+1f22f, U+1f232-1f23a, U+1f250-1f251, U+1f310, U+1f3a6, U+1f3b5-1f3b6, U+1f3bc, U+1f3e7, U+1f441, U+1f499-1f49c, U+1f49f-1f4a0, U+1f4a2, U+1f4ac-1f4ad, U+1f4b1-1f4b2, U+1f4b9, U+1f4db, U+1f4f2-1f4f6, U+1f500-1f50a, U+1f515, U+1f518-1f524, U+1f52f-1f53d, U+1f549, U+1f54e, U+1f5a4, U+1f5e8, U+1f5ef, U+1f6ab, U+1f6ad-1f6b1, U+1f6b3, U+1f6b7-1f6bc, U+1f6be, U+1f6c2-1f6c5, U+1f6d0-1f6d1, U+1f6d7, U+1f6dc, U+1f7e0-1f7eb, U+1f7f0, U+1f90d-1f90e, U+1f9e1, U+1fa75-1fa77, U+1faaf',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.3.woff2',\n unicodeRange:\n 'U+231a-231b, U+2328, U+23f0-23f3, U+2602, U+260e, U+2692, U+2694, U+2696-2697, U+2699, U+26b0-26b1, U+26cf, U+26d1, U+26d3, U+2702, U+2709, U+270f, U+2712, U+fe0f, U+1f302, U+1f321, U+1f392-1f393, U+1f3a9, U+1f3bd, U+1f3ee, U+1f3f7, U+1f3fa, U+1f451-1f462, U+1f484, U+1f489-1f48a, U+1f48c-1f48e, U+1f4a1, U+1f4a3, U+1f4b0, U+1f4b3-1f4b8, U+1f4bb-1f4da, U+1f4dc-1f4f1, U+1f4ff, U+1f50b-1f514, U+1f516-1f517, U+1f526-1f529, U+1f52c-1f52e, U+1f550-1f567, U+1f56f-1f570, U+1f576, U+1f587, U+1f58a-1f58d, U+1f5a5, U+1f5a8, U+1f5b1-1f5b2, U+1f5c2-1f5c4, U+1f5d1-1f5d3, U+1f5dc-1f5de, U+1f5e1, U+1f5f3, U+1f6aa, U+1f6ac, U+1f6bd, U+1f6bf, U+1f6c1, U+1f6cb, U+1f6cd-1f6cf, U+1f6d2, U+1f6e0-1f6e1, U+1f6f0, U+1f97b-1f97f, U+1f9af, U+1f9ba, U+1f9e2-1f9e6, U+1f9ea-1f9ec, U+1f9ee-1f9f4, U+1f9f7-1f9ff, U+1fa71-1fa74, U+1fa79-1fa7b, U+1fa86, U+1fa91-1fa93, U+1fa96, U+1fa99-1faa0, U+1faa2-1faa7, U+1faaa-1faae',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.4.woff2',\n unicodeRange:\n 'U+265f, U+26bd-26be, U+26f3, U+26f8, U+fe0f, U+1f004, U+1f0cf, U+1f380-1f384, U+1f386-1f38b, U+1f38d-1f391, U+1f396-1f397, U+1f399-1f39b, U+1f39e-1f39f, U+1f3a3-1f3a5, U+1f3a7-1f3a9, U+1f3ab-1f3b4, U+1f3b7-1f3bb, U+1f3bd-1f3c0, U+1f3c5-1f3c6, U+1f3c8-1f3c9, U+1f3cf-1f3d3, U+1f3f8-1f3f9, U+1f47e, U+1f4e2, U+1f4f7-1f4fd, U+1f52b, U+1f579, U+1f58c-1f58d, U+1f5bc, U+1f6f7, U+1f6f9, U+1f6fc, U+1f93f, U+1f941, U+1f945, U+1f947-1f94f, U+1f9e7-1f9e9, U+1f9f5-1f9f6, U+1fa70-1fa71, U+1fa80-1fa81, U+1fa83-1fa85, U+1fa87-1fa88, U+1fa94-1fa95, U+1fa97-1fa98, U+1faa1, U+1faa9',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.5.woff2',\n unicodeRange:\n 'U+2693, U+26e9-26ea, U+26f1-26f2, U+26f4-26f5, U+26fa, U+26fd, U+2708, U+fe0f, U+1f301, U+1f303, U+1f306-1f307, U+1f309, U+1f310, U+1f3a0-1f3a2, U+1f3aa, U+1f3cd-1f3ce, U+1f3d5, U+1f3d7-1f3db, U+1f3df-1f3e6, U+1f3e8-1f3ed, U+1f3ef-1f3f0, U+1f488, U+1f492, U+1f4ba, U+1f54b-1f54d, U+1f5fa-1f5ff, U+1f680-1f6a2, U+1f6a4-1f6a8, U+1f6b2, U+1f6d1, U+1f6d5-1f6d6, U+1f6dd-1f6df, U+1f6e2-1f6e5, U+1f6e9, U+1f6eb-1f6ec, U+1f6f3-1f6f6, U+1f6f8, U+1f6fa-1f6fb, U+1f9bc-1f9bd, U+1f9ed, U+1f9f3, U+1fa7c',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.6.woff2',\n unicodeRange:\n 'U+2615, U+fe0f, U+1f32d-1f330, U+1f336, U+1f33d, U+1f345-1f37f, U+1f382, U+1f52a, U+1f942-1f944, U+1f950-1f96f, U+1f99e, U+1f9aa, U+1f9c0-1f9cb, U+1fad0-1fadb',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.7.woff2',\n unicodeRange:\n 'U+200d, U+2600-2601, U+2603-2604, U+2614, U+2618, U+26a1, U+26c4-26c5, U+26c8, U+26f0, U+2728, U+2744, U+2b1b, U+2b50, U+fe0f, U+1f300, U+1f304-1f305, U+1f308, U+1f30a-1f30f, U+1f311-1f321, U+1f324-1f32c, U+1f331-1f335, U+1f337-1f33c, U+1f33e-1f344, U+1f3d4, U+1f3d6, U+1f3dc-1f3de, U+1f3f5, U+1f400-1f43f, U+1f490, U+1f4a7, U+1f4ab, U+1f4ae, U+1f525, U+1f54a, U+1f573, U+1f577-1f578, U+1f648-1f64a, U+1f940, U+1f980-1f9ae, U+1f9ba, U+1fa90, U+1faa8, U+1fab0-1fabd, U+1fabf, U+1face-1facf, U+1fae7',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.8.woff2',\n unicodeRange:\n 'U+200d, U+2640, U+2642, U+2695-2696, U+26f7, U+26f9, U+2708, U+2764, U+fe0f, U+1f33e, U+1f373, U+1f37c, U+1f384-1f385, U+1f393, U+1f3a4, U+1f3a8, U+1f3c2-1f3c4, U+1f3c7, U+1f3ca-1f3cc, U+1f3eb, U+1f3ed, U+1f3fb-1f3ff, U+1f466-1f478, U+1f47c, U+1f481-1f483, U+1f486-1f487, U+1f48b, U+1f48f, U+1f491, U+1f4bb-1f4bc, U+1f527, U+1f52c, U+1f574-1f575, U+1f57a, U+1f645-1f647, U+1f64b, U+1f64d-1f64e, U+1f680, U+1f692, U+1f6a3, U+1f6b4-1f6b6, U+1f6c0, U+1f6cc, U+1f91d, U+1f926, U+1f930-1f931, U+1f934-1f93a, U+1f93c-1f93e, U+1f977, U+1f9af-1f9b3, U+1f9b8-1f9b9, U+1f9bc-1f9bd, U+1f9cc-1f9cf, U+1f9d1-1f9df, U+1fa82, U+1fac3-1fac5',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.9.woff2',\n unicodeRange:\n 'U+200d, U+261d, U+2620, U+2639-263a, U+2665, U+270a-270d, U+2728, U+2763-2764, U+2b50, U+fe0f, U+1f31a-1f31f, U+1f32b, U+1f383, U+1f389, U+1f3fb-1f3ff, U+1f440-1f450, U+1f463-1f465, U+1f479-1f47b, U+1f47d-1f480, U+1f485, U+1f48b-1f48c, U+1f493-1f49f, U+1f4a4-1f4a6, U+1f4a8-1f4ab, U+1f4af, U+1f525, U+1f573, U+1f590, U+1f595-1f596, U+1f5a4, U+1f5e3, U+1f600-1f644, U+1f648-1f64a, U+1f64c, U+1f64f, U+1f90c-1f925, U+1f927-1f92f, U+1f932-1f933, U+1f970-1f976, U+1f978-1f97a, U+1f9a0, U+1f9b4-1f9b7, U+1f9bb, U+1f9be-1f9bf, U+1f9d0, U+1f9e0-1f9e1, U+1fa75-1fa79, U+1fac0-1fac2, U+1fae0-1fae6, U+1fae8, U+1faf0-1faf8',\n },\n];\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 generateFontFaces = () =>\n fonts\n .map(\n (font) => `\n @font-face {\n font-display: swap;\n font-family: \"${font.family}\";\n font-style: normal;\n font-weight: 400;\n src: url(\"${font.src}\") format(\"woff2\");\n ${font.unicodeRange ? `unicode-range: ${font.unicodeRange};` : ''}\n }\n`,\n )\n .join('');\n"],"mappings":";;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AAQA,MAAMC,KAAa,GAAG,CAClB;EACIC,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EAAE;AAClB,CAAC,EACD;EACIF,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EACR;AACR,CAAC,EACD;EACIF,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EACR;AACR,CAAC,EAC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ACA,CACQ,CAAC,CACAY,IAAI,CAAC,EAAE,CAAC;AAACJ,OAAA,CAAAC,iBAAA,GAAAA,iBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.435",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chayns",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "91888d02bb6dbe58d754c129c8531f0941afb9e0"
|
|
69
69
|
}
|