@hitachivantara/uikit-react-core 5.0.0-next.5 → 5.0.0-next.6
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/dist/cjs/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/cjs/components/ActionsGeneric/ActionsGeneric.cjs.map +1 -1
- package/dist/cjs/components/Banner/Banner.cjs.map +1 -1
- package/dist/cjs/components/Banner/BannerContent/ActionContainer/ActionContainer.cjs.map +1 -1
- package/dist/cjs/components/Banner/BannerContent/BannerContent.cjs.map +1 -1
- package/dist/cjs/components/Banner/BannerContent/MessageContainer/MessageContainer.cjs.map +1 -1
- package/dist/cjs/components/BaseInput/BaseInput.cjs +1 -28
- package/dist/cjs/components/BaseInput/BaseInput.cjs.map +1 -1
- package/dist/cjs/components/Card/Content/Content.cjs.map +1 -1
- package/dist/cjs/components/Container/Container.styles.cjs +1 -1
- package/dist/cjs/components/Container/Container.styles.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.cjs +8 -7
- package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Title/Title.cjs +1 -0
- package/dist/cjs/components/Dialog/Title/Title.cjs.map +1 -1
- package/dist/cjs/components/EmptyState/EmptyState.styles.cjs +5 -5
- package/dist/cjs/components/EmptyState/EmptyState.styles.cjs.map +1 -1
- package/dist/cjs/components/Footer/Footer.styles.cjs +5 -5
- package/dist/cjs/components/Footer/Footer.styles.cjs.map +1 -1
- package/dist/cjs/components/Forms/Suggestions/Suggestions.cjs.map +1 -1
- package/dist/cjs/components/GlobalActions/GlobalActions.styles.cjs +4 -4
- package/dist/cjs/components/GlobalActions/GlobalActions.styles.cjs.map +1 -1
- package/dist/cjs/components/SimpleGrid/SimpleGrid.styles.cjs +1 -1
- package/dist/cjs/components/SimpleGrid/SimpleGrid.styles.cjs.map +1 -1
- package/dist/cjs/components/Snackbar/Snackbar.cjs.map +1 -1
- package/dist/cjs/components/Snackbar/SnackbarContentWrapper/SnackbarContentWrapper.cjs.map +1 -1
- package/dist/cjs/components/Table/TableBody/TableBody.cjs +1 -1
- package/dist/cjs/components/Table/TableBody/TableBody.cjs.map +1 -1
- package/dist/cjs/components/Table/hooks/useRowExpand.cjs +1 -1
- package/dist/cjs/components/Table/hooks/useRowExpand.cjs.map +1 -1
- package/dist/cjs/components/Tag/Tag.cjs.map +1 -1
- package/dist/cjs/components/TagsInput/TagsInput.cjs.map +1 -1
- package/dist/cjs/components/TagsInput/TagsInput.styles.cjs +14 -13
- package/dist/cjs/components/TagsInput/TagsInput.styles.cjs.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/cjs/providers/Provider.cjs +21 -11
- package/dist/cjs/providers/Provider.cjs.map +1 -1
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/ActionsGeneric/ActionsGeneric.js.map +1 -1
- package/dist/esm/components/Banner/Banner.js.map +1 -1
- package/dist/esm/components/Banner/BannerContent/ActionContainer/ActionContainer.js.map +1 -1
- package/dist/esm/components/Banner/BannerContent/BannerContent.js.map +1 -1
- package/dist/esm/components/Banner/BannerContent/MessageContainer/MessageContainer.js.map +1 -1
- package/dist/esm/components/BaseInput/BaseInput.js +1 -28
- package/dist/esm/components/BaseInput/BaseInput.js.map +1 -1
- package/dist/esm/components/Card/Content/Content.js.map +1 -1
- package/dist/esm/components/Container/Container.styles.js +1 -1
- package/dist/esm/components/Container/Container.styles.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +9 -8
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/Title/Title.js +1 -0
- package/dist/esm/components/Dialog/Title/Title.js.map +1 -1
- package/dist/esm/components/EmptyState/EmptyState.styles.js +5 -5
- package/dist/esm/components/EmptyState/EmptyState.styles.js.map +1 -1
- package/dist/esm/components/Footer/Footer.styles.js +5 -5
- package/dist/esm/components/Footer/Footer.styles.js.map +1 -1
- package/dist/esm/components/Forms/Suggestions/Suggestions.js.map +1 -1
- package/dist/esm/components/GlobalActions/GlobalActions.styles.js +4 -4
- package/dist/esm/components/GlobalActions/GlobalActions.styles.js.map +1 -1
- package/dist/esm/components/SimpleGrid/SimpleGrid.styles.js +1 -1
- package/dist/esm/components/SimpleGrid/SimpleGrid.styles.js.map +1 -1
- package/dist/esm/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/components/Snackbar/SnackbarContentWrapper/SnackbarContentWrapper.js.map +1 -1
- package/dist/esm/components/Table/TableBody/TableBody.js +1 -1
- package/dist/esm/components/Table/TableBody/TableBody.js.map +1 -1
- package/dist/esm/components/Table/hooks/useRowExpand.js +1 -1
- package/dist/esm/components/Table/hooks/useRowExpand.js.map +1 -1
- package/dist/esm/components/Tag/Tag.js.map +1 -1
- package/dist/esm/components/TagsInput/TagsInput.js.map +1 -1
- package/dist/esm/components/TagsInput/TagsInput.styles.js +14 -13
- package/dist/esm/components/TagsInput/TagsInput.styles.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/providers/Provider.js +21 -13
- package/dist/esm/providers/Provider.js.map +1 -1
- package/dist/types/components/Accordion/Accordion.d.ts +3 -3
- package/dist/types/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/types/components/ActionsGeneric/ActionsGeneric.d.ts +2 -2
- package/dist/types/components/ActionsGeneric/ActionsGeneric.d.ts.map +1 -1
- package/dist/types/components/Banner/Banner.d.ts +1 -1
- package/dist/types/components/Banner/Banner.d.ts.map +1 -1
- package/dist/types/components/Banner/BannerContent/ActionContainer/ActionContainer.d.ts +1 -1
- package/dist/types/components/Banner/BannerContent/ActionContainer/ActionContainer.d.ts.map +1 -1
- package/dist/types/components/Banner/BannerContent/BannerContent.d.ts +1 -1
- package/dist/types/components/Banner/BannerContent/BannerContent.d.ts.map +1 -1
- package/dist/types/components/Banner/BannerContent/MessageContainer/MessageContainer.d.ts +1 -1
- package/dist/types/components/Banner/BannerContent/MessageContainer/MessageContainer.d.ts.map +1 -1
- package/dist/types/components/BulkActions/BulkActions.styles.d.ts +1 -1
- package/dist/types/components/Card/Content/Content.d.ts +2 -1
- package/dist/types/components/Card/Content/Content.d.ts.map +1 -1
- package/dist/types/components/Container/Container.styles.d.ts +2 -1
- package/dist/types/components/Container/Container.styles.d.ts.map +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +2 -1
- package/dist/types/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/components/Dialog/Title/Title.d.ts.map +1 -1
- package/dist/types/components/EmptyState/EmptyState.styles.d.ts +4 -3
- package/dist/types/components/EmptyState/EmptyState.styles.d.ts.map +1 -1
- package/dist/types/components/Footer/Footer.styles.d.ts +6 -5
- package/dist/types/components/Footer/Footer.styles.d.ts.map +1 -1
- package/dist/types/components/Forms/Suggestions/Suggestions.d.ts +1 -1
- package/dist/types/components/Forms/Suggestions/Suggestions.d.ts.map +1 -1
- package/dist/types/components/GlobalActions/GlobalActions.styles.d.ts +2 -1
- package/dist/types/components/GlobalActions/GlobalActions.styles.d.ts.map +1 -1
- package/dist/types/components/SimpleGrid/SimpleGrid.styles.d.ts +2 -2
- package/dist/types/components/SimpleGrid/SimpleGrid.styles.d.ts.map +1 -1
- package/dist/types/components/Snackbar/Snackbar.d.ts +1 -1
- package/dist/types/components/Snackbar/Snackbar.d.ts.map +1 -1
- package/dist/types/components/Snackbar/SnackbarContentWrapper/SnackbarContentWrapper.d.ts +1 -1
- package/dist/types/components/Snackbar/SnackbarContentWrapper/SnackbarContentWrapper.d.ts.map +1 -1
- package/dist/types/components/Table/TableBody/TableBody.d.ts +4 -4
- package/dist/types/components/Table/TableBody/TableBody.d.ts.map +1 -1
- package/dist/types/components/Tag/Tag.d.ts +2 -2
- package/dist/types/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/components/TagsInput/TagsInput.d.ts +6 -6
- package/dist/types/components/TagsInput/TagsInput.d.ts.map +1 -1
- package/dist/types/components/TagsInput/TagsInput.styles.d.ts.map +1 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +3 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/providers/Provider.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.cjs","sources":["../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import React, {\n SyntheticEvent,\n useCallback,\n useMemo,\n HTMLAttributes,\n} from \"react\";\nimport clsx from \"clsx\";\nimport { useControlled } from \"hooks\";\nimport { DropDownXS, DropUpXS } from \"@hitachivantara/uikit-react-icons\";\nimport { HvBaseProps } from \"../../types\";\nimport { setId } from \"utils\";\nimport { StyledContainer, StyledLabel, StyledRoot } from \"./Accordion.styles\";\nimport accordionClasses, { HvAccordionClasses } from \"./accordionClasses\";\n\nexport type HvAccordionProps = HvBaseProps & {\n /**\n * Id to be applied to the root node of the accordion.\n */\n id?: string;\n /**\n * Class names to be applied to the accordion.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvAccordionClasses;\n /**\n * The accordion label button.\n */\n label?:
|
|
1
|
+
{"version":3,"file":"Accordion.cjs","sources":["../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import React, {\n SyntheticEvent,\n useCallback,\n useMemo,\n HTMLAttributes,\n} from \"react\";\nimport clsx from \"clsx\";\nimport { useControlled } from \"hooks\";\nimport { DropDownXS, DropUpXS } from \"@hitachivantara/uikit-react-icons\";\nimport { HvBaseProps } from \"../../types\";\nimport { setId } from \"utils\";\nimport { StyledContainer, StyledLabel, StyledRoot } from \"./Accordion.styles\";\nimport accordionClasses, { HvAccordionClasses } from \"./accordionClasses\";\n\nexport type HvAccordionProps = HvBaseProps & {\n /**\n * Id to be applied to the root node of the accordion.\n */\n id?: string;\n /**\n * Class names to be applied to the accordion.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvAccordionClasses;\n /**\n * The accordion label button.\n */\n label?: string;\n /**\n * The function that will be executed whenever the accordion toggles it will receive the state of the accordion\n */\n onChange?: (event: React.SyntheticEvent, value: boolean) => void;\n /**\n * Whether the accordion is open or not, if this property is defined the accordion must be fully controlled.\n */\n expanded?: boolean;\n /**\n * When uncontrolled, defines the initial expanded state.\n */\n defaultExpanded?: boolean;\n /**\n * An object containing props to be passed onto container holding the accordion children.\n */\n containerProps?: HTMLAttributes<HTMLDivElement>;\n /**\n * Heading Level to apply to accordion button if ´undefined´ the button won't have a header wrapper.\n */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * Is the accordion disabled.\n */\n disabled?: boolean;\n};\n\n/**\n * A accordion is a design element that expands in place to expose hidden information.\n */\nexport const HvAccordion = ({\n id,\n className,\n classes,\n disabled = false,\n label,\n onChange,\n children,\n expanded,\n headingLevel,\n defaultExpanded = false,\n containerProps,\n ...others\n}: HvAccordionProps) => {\n const [isOpen, setIsOpen] = useControlled(expanded, Boolean(defaultExpanded));\n\n const handleAction = useCallback(\n (event: SyntheticEvent) => {\n if (!disabled) {\n onChange?.(event, isOpen);\n setIsOpen(!isOpen);\n return true;\n }\n return false;\n },\n [disabled, onChange, isOpen, setIsOpen]\n );\n\n const handleClick = useCallback(\n (event: SyntheticEvent) => {\n handleAction(event);\n event.preventDefault();\n event.stopPropagation();\n },\n [handleAction]\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n let isEventHandled = false;\n const { key } = event;\n\n if (\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.currentTarget !== event.target\n ) {\n return;\n }\n switch (key) {\n case \"Enter\":\n case \" \":\n isEventHandled = handleAction(event);\n break;\n default:\n return;\n }\n\n if (isEventHandled) {\n event.preventDefault();\n event.stopPropagation();\n }\n },\n [handleAction]\n );\n\n const accordionHeaderId = setId(id, \"button\");\n const accordionContainer = setId(id, \"container\");\n const accordionHeader = useMemo(() => {\n const color = (disabled && [\"atmo5\"]) || undefined;\n const accordionButton = (\n <StyledLabel\n id={accordionHeaderId}\n component=\"div\"\n role=\"button\"\n className={clsx(accordionClasses.label, classes?.label)}\n disabled={disabled}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n onClick={handleClick}\n variant={\"label\"}\n aria-expanded={isOpen}\n aria-disabled={disabled}\n >\n {isOpen ? <DropUpXS color={color} /> : <DropDownXS color={color} />}\n {label}\n </StyledLabel>\n );\n const result =\n headingLevel === undefined ? (\n accordionButton\n ) : (\n <StyledLabel component={`h${headingLevel}`}>\n {accordionButton}\n </StyledLabel>\n );\n return result;\n }, [\n classes,\n handleClick,\n handleKeyDown,\n label,\n accordionHeaderId,\n disabled,\n headingLevel,\n isOpen,\n ]);\n\n return (\n <StyledRoot\n id={id}\n className={clsx(className, accordionClasses.root, classes?.root)}\n {...others}\n >\n {accordionHeader}\n <StyledContainer\n id={accordionContainer}\n role=\"region\"\n aria-labelledby={accordionHeaderId}\n className={clsx(accordionClasses.container, classes?.container)}\n hidden={!isOpen}\n {...containerProps}\n >\n {children}\n </StyledContainer>\n </StyledRoot>\n );\n};\n"],"names":["HvAccordion","id","className","classes","disabled","label","onChange","children","expanded","headingLevel","defaultExpanded","containerProps","others","isOpen","setIsOpen","useControlled","Boolean","handleAction","useCallback","event","handleClick","preventDefault","stopPropagation","handleKeyDown","isEventHandled","key","altKey","ctrlKey","metaKey","currentTarget","target","accordionHeaderId","setId","accordionContainer","accordionHeader","useMemo","color","undefined","accordionButton","StyledLabel","component","role","clsx","accordionClasses","tabIndex","onKeyDown","onClick","variant","_jsx","DropUpXS","DropDownXS","result","StyledRoot","root","StyledContainer","container","hidden"],"mappings":";;;;;;;;;;;;AA4DO,MAAMA,cAAcA,CAAC;AAAA,EAC1BC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,WAAW;AAAA,EACXC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,kBAAkB;AAAA,EACl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tC,OAAOF,mCAASE,KAAK;AAAA,MACtDD;AAAAA,MACAwC,UAAU;AAAA,MACVC,WAAWtB;AAAAA,MACXuB,SAAS1B;AAAAA,MACT2B,SAAS;AAAA,MACT,iBAAelC;AAAAA,MACf,iBAAeT;AAAAA,MAASG,UAEvBM,CAAAA,SAASmC,2BAAAA,IAACC,0BAAQ;AAAA,QAACb;AAAAA,MAAAA,CAAgB,IAAGY,2BAAAA,IAACE,4BAAU;AAAA,QAACd;AAAAA,MAAa,CAAA,GAC/D/B,KAAK;AAAA,IAAA,CAET;AACD,UAAM8C,SACJ1C,iBAAiB4B,SACfC,iDAECC,8BAAW;AAAA,MAACC,WAAY,IAAG/B;AAAAA,MAAeF,UACxC+B;AAAAA,IAAAA,CAEJ;AACIa,WAAAA;AAAAA,EAAAA,GACN,CACDhD,SACAiB,aACAG,eACAlB,OACA0B,mBACA3B,UACAK,cACAI,MAAM,CACP;AAED,yCACGuC,iBAAAA,YAAU;AAAA,IACTnD;AAAAA,IACAC,WAAWwC,cAAKxC,QAAAA,WAAWyC,iBAAiBU,QAAAA,MAAMlD,mCAASkD,IAAI;AAAA,IAAE,GAC7DzC;AAAAA,IAAML,UAET2B,CAAAA,iBACDc,2BAAAA,IAACM,kCAAe;AAAA,MACdrD,IAAIgC;AAAAA,MACJQ,MAAK;AAAA,MACL,mBAAiBV;AAAAA,MACjB7B,WAAWwC,cAAAA,QAAKC,iBAAAA,QAAiBY,WAAWpD,mCAASoD,SAAS;AAAA,MAC9DC,QAAQ,CAAC3C;AAAAA,MAAO,GACZF;AAAAA,MAAcJ;AAAAA,IAAAA,CAGF,CAAA;AAAA,EAAA,CACP;AAEjB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsGeneric.cjs","sources":["../../../../src/components/ActionsGeneric/ActionsGeneric.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { HvButtonSize, HvButtonVariant, HvDropDownMenu } from \"components\";\nimport { setId } from \"utils\";\nimport { isValidElement, useContext } from \"react\";\nimport { HvBaseProps } from \"../../types\";\nimport { actionsGenericClasses, HvActionsGenericClasses } from \".\";\nimport { MoreOptionsVertical } from \"@hitachivantara/uikit-react-icons\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport { StyledButton, StyledRoot } from \"./ActionsGeneric.styles\";\nimport { HvThemeContext } from \"providers\";\n\nexport type HvActionGeneric = {\n id: string;\n label: string;\n icon?:\n | React.ReactNode\n | ((params: { isDisabled?: boolean }) => React.ReactNode);\n disabled?: boolean;\n};\n\nexport type HvActionsGenericProps = HvBaseProps & {\n /** Button category. */\n category?: HvButtonVariant;\n /** Whether actions should be all disabled */\n disabled?: boolean;\n /** The renderable content inside the actions slot of the footer, or an Array of actions `{id, label, icon, disabled}` */\n actions: React.ReactNode | HvActionGeneric[];\n /** The callback function ran when an action is triggered, receiving `action` as param */\n actionsCallback?: (event:
|
|
1
|
+
{"version":3,"file":"ActionsGeneric.cjs","sources":["../../../../src/components/ActionsGeneric/ActionsGeneric.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { HvButtonSize, HvButtonVariant, HvDropDownMenu } from \"components\";\nimport { setId } from \"utils\";\nimport React, { isValidElement, useContext } from \"react\";\nimport { HvBaseProps } from \"../../types\";\nimport { actionsGenericClasses, HvActionsGenericClasses } from \".\";\nimport { MoreOptionsVertical } from \"@hitachivantara/uikit-react-icons\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport { StyledButton, StyledRoot } from \"./ActionsGeneric.styles\";\nimport { HvThemeContext } from \"providers\";\n\nexport type HvActionGeneric = {\n id: string;\n label: string;\n icon?:\n | React.ReactNode\n | ((params: { isDisabled?: boolean }) => React.ReactNode);\n disabled?: boolean;\n};\n\nexport type HvActionsGenericProps = HvBaseProps & {\n /** Button category. */\n category?: HvButtonVariant;\n /** Whether actions should be all disabled */\n disabled?: boolean;\n /** The renderable content inside the actions slot of the footer, or an Array of actions `{id, label, icon, disabled}` */\n actions: React.ReactNode | HvActionGeneric[];\n /** The callback function ran when an action is triggered, receiving `action` as param */\n actionsCallback?: (\n event: React.SyntheticEvent,\n id: string,\n action: HvActionGeneric\n ) => void;\n /** The number of maximum visible actions before they're collapsed into a `DropDownMenu`. */\n maxVisibleActions?: number;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvActionsGenericClasses;\n};\n\nexport const HvActionsGeneric = ({\n id,\n classes,\n className,\n category = \"secondaryGhost\",\n disabled = false,\n actions = [],\n actionsCallback,\n maxVisibleActions = Infinity,\n ...others\n}: HvActionsGenericProps) => {\n const { activeTheme, selectedMode } = useContext(HvThemeContext);\n\n if (!Array.isArray(actions)) return isValidElement(actions) ? actions : null;\n\n const renderButton = (action: HvActionGeneric, idx: number) => {\n const { disabled: actDisabled, id: actId, icon, label, ...other } = action;\n const actionId = setId(id, idx, \"action\", action.id);\n\n const renderedIcon = isValidElement(icon)\n ? icon\n : (icon as Function)?.({ isDisabled: disabled });\n\n return (\n <StyledButton\n id={actionId}\n key={actionId || idx}\n variant={category}\n className={clsx(actionsGenericClasses.button, classes?.button)}\n disabled={actDisabled ?? disabled}\n onClick={(event: React.SyntheticEvent) =>\n actionsCallback?.(event, id || \"\", action)\n }\n startIcon={renderedIcon}\n $baseColor={\n activeTheme?.colors?.modes[selectedMode].base1 || theme.colors.base1\n }\n size={(activeTheme?.actionsGeneric?.buttonSize as HvButtonSize) || \"md\"}\n {...other}\n >\n {label}\n </StyledButton>\n );\n };\n\n const renderActionsGrid = () => {\n const actsVisible = actions.slice(0, maxVisibleActions);\n const actsDropdown = actions.slice(maxVisibleActions);\n\n const semantic = category === \"semantic\";\n const iconColor =\n (disabled && \"atmo5\") || (semantic && \"base2\") || undefined;\n\n return (\n <>\n {actsVisible.map((action, idx) => renderButton(action, idx))}\n <HvDropDownMenu\n id={setId(id, \"menu\")}\n disabled={disabled}\n category={category}\n classes={{\n root: clsx(\n actionsGenericClasses.dropDownMenu,\n classes?.dropDownMenu\n ),\n icon: clsx(\n actionsGenericClasses.dropDownMenuButton,\n classes?.dropDownMenuButton\n ),\n iconSelected: clsx(\n actionsGenericClasses.dropDownMenuButtonSelected,\n classes?.dropDownMenuButtonSelected\n ),\n }}\n icon={<MoreOptionsVertical color={iconColor} />}\n placement=\"left\"\n onClick={(event: React.SyntheticEvent, action: HvActionGeneric) =>\n actionsCallback?.(event, id || \"\", action)\n }\n dataList={actsDropdown}\n keepOpened={false}\n disablePortal={false}\n />\n </>\n );\n };\n\n const actionOverflow = actions.length > maxVisibleActions;\n\n return (\n <StyledRoot\n className={clsx(\n className,\n actionsGenericClasses.root,\n classes?.root,\n actionOverflow &&\n clsx(actionsGenericClasses.actionContainer, classes?.actionContainer)\n )}\n $actionOverflow={actionOverflow}\n {...others}\n >\n {actionOverflow\n ? renderActionsGrid()\n : actions.map((action, idx) => renderButton(action, idx))}\n </StyledRoot>\n );\n};\n"],"names":["HvActionsGeneric","id","classes","className","category","disabled","actions","actionsCallback","maxVisibleActions","Infinity","others","activeTheme","selectedMode","useContext","HvThemeContext","Array","isArray","isValidElement","renderButton","action","idx","actDisabled","actId","icon","label","other","actionId","setId","renderedIcon","isDisabled","StyledButton","variant","clsx","actionsGenericClasses","button","onClick","event","startIcon","$baseColor","colors","modes","base1","theme","size","actionsGeneric","buttonSize","children","renderActionsGrid","actsVisible","slice","actsDropdown","semantic","iconColor","undefined","_Fragment","map","HvDropDownMenu","root","dropDownMenu","dropDownMenuButton","iconSelected","dropDownMenuButtonSelected","MoreOptionsVertical","color","placement","dataList","keepOpened","disablePortal","actionOverflow","length","StyledRoot","actionContainer","$actionOverflow"],"mappings":";;;;;;;;;;;;;;AAuCO,MAAMA,mBAAmBA,CAAC;AAAA,EAC/BC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,WAAW;AAAA,EACXC,WAAW;AAAA,EACXC,UAAU,CAAE;AAAA,EACZC;AAAAA,EACAC,oBAAoBC;AAAAA,KACjBC;AACkB,MAAM;AACrB,QAAA;AAAA,IAAEC;AAAAA,I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sx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useCallback } from \"react\";\nimport Slide from \"@mui/material/Slide\";\nimport {\n SnackbarProps as MuiSnackbarProps,\n SnackbarOrigin,\n} from \"@mui/material/Snackbar\";\nimport capitalize from \"lodash/capitalize\";\nimport { HvBaseProps } from \"../../types\";\nimport { StyledSnackbar } from \"./Banner.styles\";\nimport { bannerClasses, HvBannerClasses } from \".\";\nimport { setId } from \"utils\";\nimport {\n HvBannerContent,\n HvBannerContentProps,\n} from \"./BannerContent/BannerContent\";\nimport { HvActionGeneric } from \"components\";\n\nexport type HvBannerVariant =\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\"\n | \"default\";\n\nexport type HvBannerActionPosition = \"auto\" | \"inline\" | \"bottom-right\";\n\nexport type HvBannerProps = Omit<MuiSnackbarProps, \"anchorOrigin\"> &\n HvBaseProps & {\n /** If true | Snackbar is open. */\n open: boolean;\n /** Callback fired when the component requests to be closed. Typically onClose is used to set state in the parent component, which is used to control the Snackbar open prop. The reason parameter can optionally be used to control the response to onClose, for example ignoring clickaway. */\n onClose?: Function;\n /** The message to display. */\n label?: React.ReactNode;\n /** The anchor of the Snackbar. */\n anchorOrigin?: \"top\" | \"bottom\";\n /** Variant of the snackbar. */\n variant?: HvBannerVariant;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Actions to display on the right side. */\n actions?: React.ReactNode | HvActionGeneric[];\n /** The callback function ran when an action is triggered, receiving `action` as param */\n actionsCallback?: (\n event:
|
|
1
|
+
{"version":3,"file":"Banner.cjs","sources":["../../../../src/components/Banner/Banner.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useCallback } from \"react\";\nimport Slide from \"@mui/material/Slide\";\nimport {\n SnackbarProps as MuiSnackbarProps,\n SnackbarOrigin,\n} from \"@mui/material/Snackbar\";\nimport capitalize from \"lodash/capitalize\";\nimport { HvBaseProps } from \"../../types\";\nimport { StyledSnackbar } from \"./Banner.styles\";\nimport { bannerClasses, HvBannerClasses } from \".\";\nimport { setId } from \"utils\";\nimport {\n HvBannerContent,\n HvBannerContentProps,\n} from \"./BannerContent/BannerContent\";\nimport { HvActionGeneric } from \"components\";\n\nexport type HvBannerVariant =\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\"\n | \"default\";\n\nexport type HvBannerActionPosition = \"auto\" | \"inline\" | \"bottom-right\";\n\nexport type HvBannerProps = Omit<MuiSnackbarProps, \"anchorOrigin\"> &\n HvBaseProps & {\n /** If true | Snackbar is open. */\n open: boolean;\n /** Callback fired when the component requests to be closed. Typically onClose is used to set state in the parent component, which is used to control the Snackbar open prop. The reason parameter can optionally be used to control the response to onClose, for example ignoring clickaway. */\n onClose?: Function;\n /** The message to display. */\n label?: React.ReactNode;\n /** The anchor of the Snackbar. */\n anchorOrigin?: \"top\" | \"bottom\";\n /** Variant of the snackbar. */\n variant?: HvBannerVariant;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Actions to display on the right side. */\n actions?: React.ReactNode | HvActionGeneric[];\n /** The callback function ran when an action is triggered, receiving `action` as param */\n actionsCallback?: (\n event: React.SyntheticEvent,\n id: string,\n action: HvActionGeneric\n ) => void;\n /** The position property of the header. */\n actionsPosition?: HvBannerActionPosition;\n /** How much the transition animation last in milliseconds, if 0 no animation is played. */\n transitionDuration?: number;\n /** Direction of slide transition. */\n transitionDirection?: \"up\" | \"down\" | \"left\" | \"right\";\n /** Offset from top/bottom of the page, in px. Defaults to 60px. */\n offset?: number;\n /** Props to pass down to the Banner Wrapper. An object `actionProps` can be included to be passed as others to actions. */\n bannerContentProps?: HvBannerContentProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBannerClasses;\n };\n\n/**\n * A Banner displays an important and succinct message. It can also provide actions for the user to address, or dismiss.\n * It requires a user action, for it to be dismissed. Banners should appear at the top of the screen, below a top app bar.\n */\nexport const HvBanner = ({\n id,\n classes,\n className,\n open,\n onClose,\n anchorOrigin = \"top\",\n variant = \"default\",\n transitionDuration = 300,\n transitionDirection = \"down\",\n showIcon = false,\n customIcon,\n actions,\n actionsCallback,\n actionsPosition = \"auto\",\n label,\n offset = 60,\n bannerContentProps,\n ...others\n}: HvBannerProps) => {\n const anchorOriginOffset = {\n anchorOriginTop: {\n top: `${offset || 0}px`,\n },\n anchorOriginBottom: {\n bottom: `${offset || 0}px`,\n },\n };\n\n const anchorOriginBanner: SnackbarOrigin = {\n horizontal: \"center\",\n vertical: anchorOrigin,\n };\n\n const SlideTransition = useCallback(\n (properties) => <Slide {...properties} direction={transitionDirection} />,\n [transitionDirection]\n );\n\n return (\n <StyledSnackbar\n style={anchorOriginOffset[`anchorOrigin${capitalize(anchorOrigin)}`]}\n className={className}\n id={id}\n classes={{\n root: open\n ? clsx(bannerClasses.root, classes?.root)\n : clsx(bannerClasses.rootClosed, classes?.rootClosed),\n anchorOriginTopCenter: clsx(\n bannerClasses.anchorOriginTopCenter,\n classes?.anchorOriginTopCenter\n ),\n anchorOriginBottomCenter: clsx(\n bannerClasses.anchorOriginBottomCenter,\n classes?.anchorOriginBottomCenter\n ),\n }}\n anchorOrigin={anchorOriginBanner}\n TransitionComponent={SlideTransition}\n open={open}\n $isOpen={open}\n transitionDuration={transitionDuration}\n {...others}\n >\n <HvBannerContent\n id={setId(id, \"content\")}\n content={label}\n variant={variant}\n customIcon={customIcon}\n showIcon={showIcon}\n actions={actions}\n actionsCallback={actionsCallback}\n actionsPosition={actionsPosition}\n onClose={onClose}\n {...bannerContentProps}\n />\n </StyledSnackbar>\n );\n};\n"],"names":["HvBanner","id","classes","className","open","onClose","anchorOrigin","variant","transitionDuration","transitionDirection","showIcon","customIcon","actions","actionsCallback","actionsPosition","label","offset","bannerContentProps","others","anchorOriginOffset","anchorOriginTop","top","anchorOriginBottom","bottom","anchorOriginBanner","horizontal","vertical","SlideTransition","useCallback","properties","_jsx","Slide","direction","StyledSnackbar","style","capitalize","root","clsx","bannerClasses","rootClosed","anchorOriginTopCenter","anchorOriginBottomCenter","TransitionComponent","$isOpen","children","HvBannerContent","setId","content"],"mappings":";;;;;;;;;;;;;;;AAqEO,MAAMA,WAAWA,CAAC;AAAA,EACvBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,eAAe;AAAA,EACfC,UAAU;AAAA,EACVC,qBAAqB;AAAA,EACrBC,sBAAsB;AAAA,EACtBC,WAAW;AAAA,EACXC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,kBAAkB;AAAA,EAClBC;AAAAA,EACAC,SAAS;AAAA,EACTC;AAAAA,KACGC;AACU,MAAM;AACnB,QAAMC,qBAAqB;AAAA,IACzBC,iBAAiB;AAAA,MACfC,KAAM,GAAEL,UAAU;AAAA,IACpB;AAAA,IACAM,oBAAoB;AAAA,MAClBC,QAAS,GAAEP,UAAU;AAAA,IACvB;AAAA,EAAA;AAGF,QAAMQ,qBAAqC;AAAA,IACzCC,YAAY;AAAA,IACZC,UAAUpB;AAAAA,EAAAA;AAGZ,QAAMqB,kBAAkBC,MAAAA,YACrBC,CAAeC,eAAAA,2BAAAA,IAACC,eAAAA,SAAK;AAAA,IAAA,GAAKF;AAAAA,IAAYG,WAAWvB;AAAAA,EAAAA,CAAoB,GACtE,CAACA,mBAAmB,CAAC;AAGvB,wCACGwB,cAAAA,gBAAc;AAAA,IACbC,OAAOf,mBAAoB,eAAcgB,oBAAAA,QAAW7B,YAAY;AAAA,IAChEH;AAAAA,IACAF;AAAAA,IACAC,SAAS;AAAA,MACPkC,MAAMhC,OACFiC,cAAAA,QAAKC,cAAAA,QAAcF,MAAMlC,mCAASkC,IAAI,IACtCC,cAAKC,QAAAA,cAAAA,QAAcC,YAAYrC,mCAASqC,UAAU;AAAA,MACtDC,uBAAuBH,cAAAA,QACrBC,cAAAA,QAAcE,uBACdtC,mCAASsC,qBAAqB;AAAA,MAEhCC,0BAA0BJ,cAAAA,QACxBC,cAAAA,QAAcG,0BACdvC,mCAASuC,wBAAwB;AAAA,IAErC;AAAA,IACAnC,cAAckB;AAAAA,IACdkB,qBAAqBf;AAAAA,IACrBvB;AAAAA,IACAuC,SAASvC;AAAAA,IACTI;AAAAA,IAAuC,GACnCU;AAAAA,IAAM0B,yCAETC,+BAAe;AAAA,MACd5C,IAAI6C,MAAAA,MAAM7C,IAAI,SAAS;AAAA,MACvB8C,SAAShC;AAAAA,MACTR;AAAAA,MACAI;AAAAA,MACAD;AAAAA,MACAE;AAAAA,MACAC;AAAAA,MACAC;AAAAA,MACAT;AAAAA,MAAiB,GACbY;AAAAA,IAAAA,CAAkB;AAAA,EAAA,CAET;AAErB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionContainer.cjs","sources":["../../../../../../src/components/Banner/BannerContent/ActionContainer/ActionContainer.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { HvBaseProps } from \"../../../../types\";\nimport { actionContainerClasses, HvActionContainerClasses } from \".\";\nimport {\n StyledActionContainer,\n StyledButton,\n StyledClose,\n StyledActionsInnerContainer,\n} from \"./ActionContainer.styles\";\nimport { HvActionGeneric, HvActionsGeneric } from \"components\";\nimport { useContext } from \"react\";\nimport { HvThemeContext } from \"providers\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport type HvActionContainerProps = HvBaseProps & {\n /** onClose function. */\n onClose?: Function;\n /** Actions to display. */\n action?: React.ReactNode | HvActionGeneric[];\n /** The callback function ran when an action is triggered, receiving `action` as param */\n actionCallback?: (event:
|
|
1
|
+
{"version":3,"file":"ActionContainer.cjs","sources":["../../../../../../src/components/Banner/BannerContent/ActionContainer/ActionContainer.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { HvBaseProps } from \"../../../../types\";\nimport { actionContainerClasses, HvActionContainerClasses } from \".\";\nimport {\n StyledActionContainer,\n StyledButton,\n StyledClose,\n StyledActionsInnerContainer,\n} from \"./ActionContainer.styles\";\nimport { HvActionGeneric, HvActionsGeneric } from \"components\";\nimport { useContext } from \"react\";\nimport { HvThemeContext } from \"providers\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport type HvActionContainerProps = HvBaseProps & {\n /** onClose function. */\n onClose?: Function;\n /** Actions to display. */\n action?: React.ReactNode | HvActionGeneric[];\n /** The callback function ran when an action is triggered, receiving `action` as param */\n actionCallback?: (\n event: React.SyntheticEvent,\n id: string,\n action: HvActionGeneric\n ) => void;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvActionContainerClasses;\n};\n\nexport const HvActionContainer = ({\n id,\n classes,\n onClose,\n action,\n actionCallback,\n ...others\n}: HvActionContainerProps) => {\n const { activeTheme, selectedMode } = useContext(HvThemeContext);\n\n return (\n <StyledActionContainer\n className={clsx(\n actionContainerClasses.actionContainer,\n classes?.actionContainer\n )}\n >\n <StyledButton\n icon\n className={clsx(\n actionContainerClasses.closeAction,\n classes?.closeAction\n )}\n variant=\"secondaryGhost\"\n aria-label=\"Close\"\n onClick={onClose}\n tabIndex={0}\n $baseColor={\n activeTheme?.colors?.modes[selectedMode].base1 || theme.colors.base1\n }\n {...others}\n >\n <StyledClose\n iconSize=\"XS\"\n className={clsx(\n actionContainerClasses.iconContainer,\n classes?.iconContainer\n )}\n color=\"base2\"\n />\n </StyledButton>\n {action && (\n <StyledActionsInnerContainer\n className={clsx(\n actionContainerClasses.actionsInnerContainer,\n classes?.actionsInnerContainer\n )}\n >\n <HvActionsGeneric\n id={id}\n category=\"secondaryGhost\"\n actions={action}\n actionsCallback={actionCallback}\n />\n </StyledActionsInnerContainer>\n )}\n </StyledActionContainer>\n );\n};\n"],"names":["HvActionContainer","id","classes","onClose","action","actionCallback","others","activeTheme","selectedMode","useContext","HvThemeContext","StyledActionContainer","className","clsx","actionContainerClasses","actionContainer","children","_jsx","StyledButton","icon","closeAction","variant","onClick","tabIndex","$baseColor","colors","modes","base1","theme","StyledClose","iconSize","iconContainer","color","StyledActionsInnerContainer","actionsInnerContainer","HvActionsGeneric","category","actions","actionsCallback"],"mappings":";;;;;;;;;;;;AA6BO,MAAMA,oBAAoBA,CAAC;AAAA,EAChCC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,KACGC;AACmB,MAAM;;AACtB,QAAA;AAAA,IAAEC;AAAAA,IAAaC;AAAAA,EAAAA,IAAiBC,MAAAA,WAAWC,cAAAA,cAAc;AAE/D,yCACGC,uBAAAA,uBAAqB;AAAA,IACpBC,WAAWC,cAAAA,QACTC,uBAAAA,QAAuBC,iBACvBb,mCAASa,eAAe;AAAA,IACxBC,UAAA,CAEFC,2BAAAA,IAACC,qCAAY;AAAA,MACXC,MAAI;AAAA,MACJP,WAAWC,cAAAA,QACTC,uBAAAA,QAAuBM,aACvBlB,mCAASkB,WAAW;AAAA,MAEtBC,SAAQ;AAAA,MACR,cAAW;AAAA,MACXC,SAASnB;AAAAA,MACToB,UAAU;AAAA,MACVC,cACEjB,gDAAakB,WAAblB,mBAAqBmB,MAAMlB,cAAcmB,UAASC,kBAAMH,OAAOE;AAAAA,MAChE,GACGrB;AAAAA,MAAMU,yCAETa,oCAAW;AAAA,QACVC,UAAS;AAAA,QACTlB,WAAWC,cAAAA,QACTC,uBAAAA,QAAuBiB,eACvB7B,mCAAS6B,aAAa;AAAA,QAExBC,OAAM;AAAA,MAAA,CAAO;AAAA,IAAA,CACb,GAEH5B,UACCa,2BAAAA,IAACgB,oDAA2B;AAAA,MAC1BrB,WAAWC,cAAAA,QACTC,uBAAAA,QAAuBoB,uBACvBhC,mCAASgC,qBAAqB;AAAA,MAC9BlB,yCAEDmB,iCAAgB;AAAA,QACflC;AAAAA,QACAmC,UAAS;AAAA,QACTC,SAASjC;AAAAA,QACTkC,iBAAiBjC;AAAAA,MAAAA,CAAe;AAAA,IAAA,CAGrC,CAAA;AAAA,EAAA,CACqB;AAE5B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerContent.cjs","sources":["../../../../../src/components/Banner/BannerContent/BannerContent.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { SnackbarContentProps as MuiSnackbarContentProps } from \"@mui/material/SnackbarContent\";\nimport { HvBaseProps } from \"../../../types\";\nimport {\n bannerContentClasses,\n HvBannerContentClasses,\n HvMessageContainer,\n HvActionContainer,\n} from \".\";\nimport { StyledRoot, StyledSnackbarContent } from \"./BannerContent.styles\";\nimport {\n HvActionGeneric,\n HvBannerActionPosition,\n HvBannerVariant,\n} from \"components\";\nimport { forwardRef } from \"react\";\nimport { iconVariant } from \"utils\";\nimport { HvActionContainerProps } from \"./ActionContainer/ActionContainer\";\n\nexport type HvBannerContentProps = Omit<MuiSnackbarContentProps, \"variant\"> &\n HvBaseProps & {\n /** The message to display. */\n content?: React.ReactNode;\n /** Variant of the snackbar. */\n variant?: HvBannerVariant;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n /** onClose function. */\n onClose?: Function;\n /** Actions to display on the right side. */\n actions?: React.ReactNode | HvActionGeneric[];\n /** The callback function ran when an action is triggered, receiving `action` as param */\n actionsCallback?: (\n event:
|
|
1
|
+
{"version":3,"file":"BannerContent.cjs","sources":["../../../../../src/components/Banner/BannerContent/BannerContent.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { SnackbarContentProps as MuiSnackbarContentProps } from \"@mui/material/SnackbarContent\";\nimport { HvBaseProps } from \"../../../types\";\nimport {\n bannerContentClasses,\n HvBannerContentClasses,\n HvMessageContainer,\n HvActionContainer,\n} from \".\";\nimport { StyledRoot, StyledSnackbarContent } from \"./BannerContent.styles\";\nimport {\n HvActionGeneric,\n HvBannerActionPosition,\n HvBannerVariant,\n} from \"components\";\nimport { forwardRef } from \"react\";\nimport { iconVariant } from \"utils\";\nimport { HvActionContainerProps } from \"./ActionContainer/ActionContainer\";\n\nexport type HvBannerContentProps = Omit<MuiSnackbarContentProps, \"variant\"> &\n HvBaseProps & {\n /** The message to display. */\n content?: React.ReactNode;\n /** Variant of the snackbar. */\n variant?: HvBannerVariant;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n /** onClose function. */\n onClose?: Function;\n /** Actions to display on the right side. */\n actions?: React.ReactNode | HvActionGeneric[];\n /** The callback function ran when an action is triggered, receiving `action` as param */\n actionsCallback?: (\n event: React.SyntheticEvent,\n id: string,\n action: HvActionGeneric\n ) => void;\n /** The position property of the header. */\n actionsPosition?: HvBannerActionPosition;\n /** The props to pass down to the Action Container. */\n actionProps?: HvActionContainerProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBannerContentClasses;\n };\n\nexport const HvBannerContent = forwardRef<HTMLDivElement, HvBannerContentProps>(\n (\n {\n id,\n classes,\n showIcon = false,\n customIcon,\n variant = \"default\",\n onClose,\n actions,\n actionsCallback,\n actionsPosition = \"auto\",\n content,\n actionProps,\n ...others\n },\n ref\n ) => {\n const icon =\n customIcon || (showIcon && iconVariant(variant, \"base2\", undefined));\n\n // default to inline\n // this might try to be more intelligent in the future,\n // taking into account the content length, available space,\n // number of actions, etc..\n const effectiveActionsPosition =\n actionsPosition === \"auto\" ? \"inline\" : actionsPosition;\n\n return (\n <StyledRoot\n className={clsx(\n bannerContentClasses.outContainer,\n classes?.outContainer\n )}\n >\n <StyledSnackbarContent\n ref={ref}\n id={id}\n classes={{\n root: clsx(bannerContentClasses.root, classes?.root),\n message: clsx(bannerContentClasses.message, classes?.message),\n action: clsx(bannerContentClasses.action, classes?.action),\n }}\n className={clsx(\n bannerContentClasses.baseVariant,\n classes?.baseVariant\n )}\n message={\n <HvMessageContainer\n id={id}\n icon={icon}\n {...(effectiveActionsPosition === \"inline\" && {\n actionsOnMessage: actions,\n actionsOnMessageCallback: actionsCallback,\n })}\n message={content}\n />\n }\n action={\n <HvActionContainer\n id={id}\n onClose={onClose}\n {...(effectiveActionsPosition === \"bottom-right\" && {\n action: actions,\n actionCallback: actionsCallback,\n })}\n {...actionProps}\n />\n }\n $variant={variant as HvBannerVariant}\n {...others}\n />\n </StyledRoot>\n );\n }\n);\n"],"names":["HvBannerContent","forwardRef","id","classes","showIcon","customIcon","variant","onClose","actions","actionsCallback","actionsPosition","content","actionProps","others","ref","icon","iconVariant","undefined","effectiveActionsPosition","StyledRoot","className","clsx","bannerContentClasses","outContainer","children","StyledSnackbarContent","root","message","action","baseVariant","HvMessageContainer","actionsOnMessage","actionsOnMessageCallback","HvActionContainer","actionCallback","$variant"],"mappings":";;;;;;;;;;;;AA+CaA,MAAAA,kBAAkBC,iBAC7B,CACE;AAAA,EACEC;AAAAA,EACAC;AAAAA,EACAC,WAAW;AAAA,EACXC;AAAAA,EACAC,UAAU;AAAA,EACVC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,kBAAkB;AAAA,EAClBC;AAAAA,EACAC;AAAAA,KACGC;AACL,GACAC,QACG;AACH,QAAMC,OACJV,cAAeD,YAAYY,YAAAA,QAAYV,SAAS,SAASW,MAAS;AAM9DC,QAAAA,2BACJR,oBAAoB,SAAS,WAAWA;AAE1C,wCACGS,qBAAAA,YAAU;AAAA,IACTC,WAAWC,cAAAA,QACTC,qBAAAA,QAAqBC,cACrBpB,mCAASoB,YAAY;AAAA,IACrBC,yCAEDC,4CAAqB;AAAA,MACpBX;AAAAA,MACAZ;AAAAA,MACAC,SAAS;AAAA,QACPuB,MAAML,cAAAA,QAAKC,qBAAAA,QAAqBI,MAAMvB,mCAASuB,IAAI;AAAA,QACnDC,SAASN,cAAAA,QAAKC,qBAAAA,QAAqBK,SAASxB,mCAASwB,OAAO;AAAA,QAC5DC,QAAQP,cAAAA,QAAKC,qBAAAA,QAAqBM,QAAQzB,mCAASyB,MAAM;AAAA,MAC3D;AAAA,MACAR,WAAWC,cAAAA,QACTC,qBAAAA,QAAqBO,aACrB1B,mCAAS0B,WAAW;AAAA,MAEtBF,wCACGG,qCAAkB;AAAA,QACjB5B;AAAAA,QACAa;AAAAA,QAAW,GACNG,6BAA6B,YAAY;AAAA,UAC5Ca,kBAAkBvB;AAAAA,UAClBwB,0BAA0BvB;AAAAA,QAC5B;AAAA,QACAkB,SAAShB;AAAAA,MAAAA,CAEZ;AAAA,MACDiB,uCACGK,mCAAiB;AAAA,QAChB/B;AAAAA,QACAK;AAAAA,QAAiB,GACZW,6BAA6B,kBAAkB;AAAA,UAClDU,QAAQpB;AAAAA,UACR0B,gBAAgBzB;AAAAA,QAClB;AAAA,QAAC,GACGG;AAAAA,MAAAA,CAEP;AAAA,MACDuB,UAAU7B;AAAAA,MAA2B,GACjCO;AAAAA,IAAAA,CAAM;AAAA,EAAA,CAED;AAEjB,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageContainer.cjs","sources":["../../../../../../src/components/Banner/BannerContent/MessageContainer/MessageContainer.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { HvBaseProps } from \"../../../../types\";\nimport { HvActionGeneric, HvActionsGeneric } from \"components\";\nimport { messageContainerClasses, HvMessageContainerClasses } from \".\";\nimport {\n StyledIconContainer,\n StyledTypography,\n StyledMessageContainer,\n} from \"./MessageContainer.styles\";\nimport { setId } from \"utils\";\n\nexport type HvMessageContainerProps = HvBaseProps & {\n /** Icon to be presented. */\n icon?: React.ReactNode;\n /** The message to display. */\n message?: React.ReactNode;\n /** Actions to display on message. */\n actionsOnMessage?: React.ReactNode | HvActionGeneric[];\n /** The callback function ran when an action is triggered, receiving `actionsOnMessage` as param */\n actionsOnMessageCallback?: (\n event:
|
|
1
|
+
{"version":3,"file":"MessageContainer.cjs","sources":["../../../../../../src/components/Banner/BannerContent/MessageContainer/MessageContainer.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { HvBaseProps } from \"../../../../types\";\nimport { HvActionGeneric, HvActionsGeneric } from \"components\";\nimport { messageContainerClasses, HvMessageContainerClasses } from \".\";\nimport {\n StyledIconContainer,\n StyledTypography,\n StyledMessageContainer,\n} from \"./MessageContainer.styles\";\nimport { setId } from \"utils\";\n\nexport type HvMessageContainerProps = HvBaseProps & {\n /** Icon to be presented. */\n icon?: React.ReactNode;\n /** The message to display. */\n message?: React.ReactNode;\n /** Actions to display on message. */\n actionsOnMessage?: React.ReactNode | HvActionGeneric[];\n /** The callback function ran when an action is triggered, receiving `actionsOnMessage` as param */\n actionsOnMessageCallback?: (\n event: React.SyntheticEvent,\n id: string,\n action: HvActionGeneric\n ) => void;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvMessageContainerClasses;\n};\n\nexport const HvMessageContainer = ({\n id,\n classes,\n icon,\n actionsOnMessage,\n actionsOnMessageCallback,\n message,\n}: HvMessageContainerProps) => {\n return (\n <>\n {icon && (\n <StyledIconContainer\n className={clsx(\n messageContainerClasses.iconContainer,\n classes?.iconContainer\n )}\n >\n {icon}\n </StyledIconContainer>\n )}\n <StyledTypography\n id={setId(id, \"message-text\")}\n className={clsx(messageContainerClasses.message, classes?.message)}\n >\n {message}\n </StyledTypography>\n {actionsOnMessage && (\n <StyledMessageContainer\n id={setId(id, \"message-actions\")}\n className={clsx(\n messageContainerClasses.actionMessageContainer,\n classes?.actionMessageContainer\n )}\n >\n <HvActionsGeneric\n id={id}\n category=\"semantic\"\n actions={actionsOnMessage}\n actionsCallback={actionsOnMessageCallback}\n />\n </StyledMessageContainer>\n )}\n </>\n );\n};\n"],"names":["HvMessageContainer","id","classes","icon","actionsOnMessage","actionsOnMessageCallback","message","_Fragment","children","_jsx","StyledIconContainer","className","clsx","messageContainerClasses","iconContainer","StyledTypography","setId","StyledMessageContainer","actionMessageContainer","HvActionsGeneric","category","actions","actionsCallback"],"mappings":";;;;;;;;;;AA4BO,MAAMA,qBAAqBA,CAAC;AAAA,EACjCC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AACuB,MAAM;AAC7B,yCACEC,WAAAA,UAAA;AAAA,IAAAC,UACGL,CAAAA,QACCM,2BAAAA,IAACC,6CAAmB;AAAA,MAClBC,WAAWC,cAAAA,QACTC,wBAAAA,QAAwBC,eACxBZ,mCAASY,aAAa;AAAA,MACtBN,UAEDL;AAAAA,IAAAA,CAEJ,GACDM,2BAAAA,IAACM,0CAAgB;AAAA,MACfd,IAAIe,MAAAA,MAAMf,IAAI,cAAc;AAAA,MAC5BU,WAAWC,cAAAA,QAAKC,wBAAAA,QAAwBP,SAASJ,mCAASI,OAAO;AAAA,MAAEE,UAElEF;AAAAA,IAAAA,CAAO,GAETF,oBACCK,2BAAAA,IAACQ,gDAAsB;AAAA,MACrBhB,IAAIe,MAAAA,MAAMf,IAAI,iBAAiB;AAAA,MAC/BU,WAAWC,cAAAA,QACTC,wBAAAA,QAAwBK,wBACxBhB,mCAASgB,sBAAsB;AAAA,MAC/BV,yCAEDW,iCAAgB;AAAA,QACflB;AAAAA,QACAmB,UAAS;AAAA,QACTC,SAASjB;AAAAA,QACTkB,iBAAiBjB;AAAAA,MAAAA,CAAyB;AAAA,IAAA,CAG/C,CAAA;AAAA,EAAA,CACA;AAEP;;"}
|
|
@@ -12,34 +12,7 @@ const FormElementContext = require("../Forms/FormElement/context/FormElementCont
|
|
|
12
12
|
const FormElementDescriptorsContext = require("../Forms/FormElement/context/FormElementDescriptorsContext.cjs");
|
|
13
13
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
14
14
|
const clsx__default = /* @__PURE__ */ _interopDefault(clsx);
|
|
15
|
-
const baseInputStyles = /* @__PURE__ */ react.css({
|
|
16
|
-
"input:-webkit-autofill": {
|
|
17
|
-
"-webkit-box-shadow": `0 0 0px 1000px ${uikitStyles.theme.colors.atmo1} inset`,
|
|
18
|
-
"-webkit-text-fill-color": uikitStyles.theme.colors.acce1
|
|
19
|
-
},
|
|
20
|
-
"input[type=search]::-ms-clear": {
|
|
21
|
-
display: "none",
|
|
22
|
-
width: 0,
|
|
23
|
-
height: 0
|
|
24
|
-
},
|
|
25
|
-
"input[type=search]::-ms-reveal": {
|
|
26
|
-
display: "none",
|
|
27
|
-
width: 0,
|
|
28
|
-
height: 0
|
|
29
|
-
},
|
|
30
|
-
"input[type=search]::-webkit-search-decoration": {
|
|
31
|
-
display: "none"
|
|
32
|
-
},
|
|
33
|
-
"input[type=search]::-webkit-search-cancel-button": {
|
|
34
|
-
display: "none"
|
|
35
|
-
},
|
|
36
|
-
"input[type=search]::-webkit-search-results-button": {
|
|
37
|
-
display: "none"
|
|
38
|
-
},
|
|
39
|
-
"input[type=search]::-webkit-search-results-decoration": {
|
|
40
|
-
display: "none"
|
|
41
|
-
}
|
|
42
|
-
}, process.env.NODE_ENV === "production" ? "" : ";label:baseInputStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvQmFzZUlucHV0L0Jhc2VJbnB1dC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJ3QiIsImZpbGUiOiIvaG9tZS9ydW5uZXIvd29yay9odi11aWtpdC1yZWFjdC9odi11aWtpdC1yZWFjdC9wYWNrYWdlcy9jb3JlL3NyYy9jb21wb25lbnRzL0Jhc2VJbnB1dC9CYXNlSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgUmVmT2JqZWN0LCB1c2VDb250ZXh0IH0gZnJvbSBcInJlYWN0XCI7XG5pbXBvcnQge1xuICBJbnB1dEJhc2VDb21wb25lbnRQcm9wcyBhcyBNdWlJbnB1dEJhc2VDb21wb25lbnRQcm9wcyxcbiAgSW5wdXRQcm9wcyBhcyBNdWlJbnB1dFByb3BzLFxufSBmcm9tIFwiQG11aS9tYXRlc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W50UHJvcHMuZGlzYWJsZWR9XG4gICAgICAgICRpbnZhbGlkPXtsb2NhbEludmFsaWR9XG4gICAgICAgICRyZXNpemFibGU9e211bHRpbGluZSAmJiByZXNpemFibGV9XG4gICAgICAgICRyZWFkT25seT17ISFyZWFkT25seX1cbiAgICAgID5cbiAgICAgICAgPFN0eWxlZElucHV0XG4gICAgICAgICAgaWQ9e2lkfVxuICAgICAgICAgIG5hbWU9e2Zvcm1FbGVtZW50UHJvcHMubmFtZX1cbiAgICAgICAgICB2YWx1ZT17dmFsdWV9XG4gICAgICAgICAgZGVmYXVsdFZhbHVlPXtkZWZhdWx0VmFsdWV9XG4gICAgICAgICAgdHlwZT17dHlwZX1cbiAgICAgICAgICBwbGFjZWhvbGRlcj17cGxhY2Vob2xkZXJ9XG4gICAgICAgICAgcmVhZE9ubHk9eyEhZm9ybUVsZW1lbnRQcm9wcy5yZWFkT25seX1cbiAgICAgICAgICBkaXNhYmxlZD17Zm9ybUVsZW1lbnRQcm9wcy5kaXNhYmxlZH1cbiAgICAgICAgICBvbkNoYW5nZT17b25DaGFuZ2VIYW5kbGVyfVxuICAgICAgICAgIGNsYXNzTmFtZT17Y2xzeChcbiAgICAgICAgICAgIGxvY2FsSW52YWxpZCAmJiBiYXNlSW5wdXRDbGFzc2VzLmlucHV0Um9vdEludmFsaWQsXG4gICAgICAgICAgICByZWFkT25seSAmJiBiYXNlSW5wdXRDbGFzc2VzLmlucHV0Um9vdFJlYWRPbmx5XG4gICAgICAgICAgKX1cbiAgICAgICAgICBjbGFzc2VzPXt7XG4gICAgICAgICAgICByb290OiBjbHN4KGJhc2VJbnB1dENsYXNzZXMuaW5wdXRSb290LCBjbGFzc2VzPy5pbnB1dFJvb3QpLFxuICAgICAgICAgICAgZm9jdXNlZDogY2xzeChcbiAgICAgICAgICAgICAgYmFzZUlucHV0Q2xhc3Nlcy5pbnB1dFJvb3RGb2N1c2VkLFxuICAgICAgICAgICAgICBjbGFzc2VzPy5pbnB1dFJvb3RGb2N1c2VkXG4gICAgICAgICAgICApLFxuICAgICAgICAgICAgZGlzYWJsZWQ6IGNsc3goXG4gICAgICAgICAgICAgIGJhc2VJbnB1dENsYXNzZXMuaW5wdXRSb290RGlzYWJsZWQsXG4gICAgICAgICAgICAgIGNsYXNzZXM/LmlucHV0Um9vdERpc2FibGVkXG4gICAgICAgICAgICApLFxuICAgICAgICAgICAgbXVsdGlsaW5lOiBjbHN4KFxuICAgICAgICAgICAgICBiYXNlSW5wdXRDbGFzc2VzLmlucHV0Um9vdE11bHRpbGluZSxcbiAgICAgICAgICAgICAgY2xhc3Nlcz8uaW5wdXRSb290TXVsdGlsaW5lXG4gICAgICAgICAgICApLFxuICAgICAgICAgICAgaW5wdXQ6IGNsc3goXG4gICAgICAgICAgICAgIGJhc2VJbnB1dENsYXNzZXMuaW5wdXQsXG4gICAgICAgICAgICAgIGNsYXNzZXM/LmlucHV0LFxuICAgICAgICAgICAgICAhZm9ybUVsZW1lbnRQcm9wcy5kaXNhYmxlZCAmJlxuICAgICAgICAgICAgICAgIHJlc2l6YWJsZSAmJlxuICAgICAgICAgICAgICAgIGNsc3goYmFzZUlucHV0Q2xhc3Nlcy5pbnB1dFJlc2l6YWJsZSwgY2xhc3Nlcz8uaW5wdXRSZXNpemFibGUpLFxuICAgICAgICAgICAgICBkaXNhYmxlZCAmJlxuICAgICAgICAgICAgICAgIGNsc3goYmFzZUlucHV0Q2xhc3Nlcy5pbnB1dERpc2FibGVkLCBjbGFzc2VzPy5pbnB1dERpc2FibGVkKSxcbiAgICAgICAgICAgICAgcmVhZE9ubHkgJiZcbiAgICAgICAgICAgICAgICBjbHN4KGJhc2VJbnB1dENsYXNzZXMuaW5wdXRSZWFkT25seSwgY2xhc3Nlcz8ucmVhZE9ubHkpXG4gICAgICAgICAgICApLFxuICAgICAgICAgIH19XG4gICAgICAgICAgaW5wdXRQcm9wcz17e1xuICAgICAgICAgICAgLy8gQXZvaWQgdGhlIHJlcXVpcmVkIGF0dHJpYnV0ZSBhdCB0aGUgcm9vdCBub2RlXG4gICAgICAgICAgICByZXF1aXJlZDogZm9ybUVsZW1lbnRQcm9wcy5yZXF1aXJlZCxcbiAgICAgICAgICAgIC4uLmlucHV0UHJvcHMsXG4gICAgICAgICAgICAuLi5hcmlhUHJvcHMsXG4gICAgICAgICAgfX1cbiAgICAgICAgICBpbnB1dFJlZj17aW5wdXRSZWZ9XG4gICAgICAgICAgbXVsdGlsaW5lPXttdWx0aWxpbmV9XG4gICAgICAgICAgcm93cz17MTB9XG4gICAgICAgICAgJHJlc2l6YWJsZT17IWZvcm1FbGVtZW50UHJvcHMuZGlzYWJsZWQgJiYgcmVzaXphYmxlfVxuICAgICAgICAgICRkaXNhYmxlZD17ISFkaXNhYmxlZH1cbiAgICAgICAgICAkcmVhZE9ubHk9eyEhcmVhZE9ubHl9XG4gICAgICAgICAgJGludmFsaWQ9e2xvY2FsSW52YWxpZH1cbiAgICAgICAgICB7Li4ub3RoZXJzfVxuICAgICAgICAvPlxuICAgICAgICB7IW11bHRpbGluZSAmJiAoXG4gICAgICAgICAgPFN0eWxlZElucHV0Qm9yZGVyQ29udGFpbmVyXG4gICAgICAgICAgICByb2xlPVwicHJlc2VudGF0aW9uXCJcbiAgICAgICAgICAgIGNsYXNzTmFtZT17Y2xzeChcbiAgICAgICAgICAgICAgYmFzZUlucHV0Q2xhc3Nlcy5pbnB1dEJvcmRlckNvbnRhaW5lcixcbiAgICAgICAgICAgICAgY2xhc3Nlcz8uaW5wdXRCb3JkZXJDb250YWluZXJcbiAgICAgICAgICAgICl9XG4gICAgICAgICAgLz5cbiAgICAgICAgKX1cbiAgICAgIDwvU3R5bGVkUm9vdD5cbiAgICA8Lz5cbiAgKTtcbn07XG4iXX0= */");
|
|
15
|
+
const baseInputStyles = /* @__PURE__ */ react.css('"input:-webkit-autofill":{"-webkit-box-shadow":0 0 0px 1000px ', uikitStyles.theme.colors.atmo1, ' inset,"-webkit-text-fill-color":', uikitStyles.theme.colors.acce1, ',;},"input[type=search]::-ms-clear":{display:"none",width:0,height:0,;},"input[type=search]::-ms-reveal":{display:"none",width:0,height:0,;},"input[type=search]::-webkit-search-decoration":{display:"none";},"input[type=search]::-webkit-search-cancel-button":{display:"none";},"input[type=search]::-webkit-search-results-button":{display:"none",;},"input[type=search]::-webkit-search-results-decoration":{display:"none",;}' + (process.env.NODE_ENV === "production" ? "" : ";label:baseInputStyles;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2NvcmUvc3JjL2NvbXBvbmVudHMvQmFzZUlucHV0L0Jhc2VJbnB1dC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUIyQiIsImZpbGUiOiIvaG9tZS9ydW5uZXIvd29yay9odi11aWtpdC1yZWFjdC9odi11aWtpdC1yZWFjdC9wYWNrYWdlcy9jb3JlL3NyYy9jb21wb25lbnRzL0Jhc2VJbnB1dC9CYXNlSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgUmVmT2JqZWN0LCB1c2VDb250ZXh0IH0gZnJvbSBcInJlYWN0XCI7XG5pbXBvcnQge1xuICBJbnB1dEJhc2VDb21wb25lbnRQcm9wcyBhcyBNdWlJbnB1dEJhc2VDb21wb25lbnRQcm9wcyxcbiAgSW5wdXRQcm9wcyBhcyBNdWlJbnB1dFByb3BzLFxufSBmcm9tIFwiQG11aS9tYXRlcmlhbFwiO1xuaW1wb3J0IHsgSHZCYXNlUHJvcHMgfSBmcm9tIFwiLi4vLi4vdHlwZXNcIjtcbmltcG9ydCB7XG4gIFN0eWxlZFJvb3QsXG4gIFN0eWxlZElucHV0Qm9yZGVyQ29udGFpbmVyLFxuICBTdHlsZWRJbnB1dCxcbn0gZnJvbSBcIi4vQmFzZUluc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gICAgaWQ9e2lkfVxuICAgICAgICAgIG5hbWU9e2Zvcm1FbGVtZW50UHJvcHMubmFtZX1cbiAgICAgICAgICB2YWx1ZT17dmFsdWV9XG4gICAgICAgICAgZGVmYXVsdFZhbHVlPXtkZWZhdWx0VmFsdWV9XG4gICAgICAgICAgdHlwZT17dHlwZX1cbiAgICAgICAgICBwbGFjZWhvbGRlcj17cGxhY2Vob2xkZXJ9XG4gICAgICAgICAgcmVhZE9ubHk9eyEhZm9ybUVsZW1lbnRQcm9wcy5yZWFkT25seX1cbiAgICAgICAgICBkaXNhYmxlZD17Zm9ybUVsZW1lbnRQcm9wcy5kaXNhYmxlZH1cbiAgICAgICAgICBvbkNoYW5nZT17b25DaGFuZ2VIYW5kbGVyfVxuICAgICAgICAgIGNsYXNzTmFtZT17Y2xzeChcbiAgICAgICAgICAgIGxvY2FsSW52YWxpZCAmJiBiYXNlSW5wdXRDbGFzc2VzLmlucHV0Um9vdEludmFsaWQsXG4gICAgICAgICAgICByZWFkT25seSAmJiBiYXNlSW5wdXRDbGFzc2VzLmlucHV0Um9vdFJlYWRPbmx5XG4gICAgICAgICAgKX1cbiAgICAgICAgICBjbGFzc2VzPXt7XG4gICAgICAgICAgICByb290OiBjbHN4KGJhc2VJbnB1dENsYXNzZXMuaW5wdXRSb290LCBjbGFzc2VzPy5pbnB1dFJvb3QpLFxuICAgICAgICAgICAgZm9jdXNlZDogY2xzeChcbiAgICAgICAgICAgICAgYmFzZUlucHV0Q2xhc3Nlcy5pbnB1dFJvb3RGb2N1c2VkLFxuICAgICAgICAgICAgICBjbGFzc2VzPy5pbnB1dFJvb3RGb2N1c2VkXG4gICAgICAgICAgICApLFxuICAgICAgICAgICAgZGlzYWJsZWQ6IGNsc3goXG4gICAgICAgICAgICAgIGJhc2VJbnB1dENsYXNzZXMuaW5wdXRSb290RGlzYWJsZWQsXG4gICAgICAgICAgICAgIGNsYXNzZXM/LmlucHV0Um9vdERpc2FibGVkXG4gICAgICAgICAgICApLFxuICAgICAgICAgICAgbXVsdGlsaW5lOiBjbHN4KFxuICAgICAgICAgICAgICBiYXNlSW5wdXRDbGFzc2VzLmlucHV0Um9vdE11bHRpbGluZSxcbiAgICAgICAgICAgICAgY2xhc3Nlcz8uaW5wdXRSb290TXVsdGlsaW5lXG4gICAgICAgICAgICApLFxuICAgICAgICAgICAgaW5wdXQ6IGNsc3goXG4gICAgICAgICAgICAgIGJhc2VJbnB1dENsYXNzZXMuaW5wdXQsXG4gICAgICAgICAgICAgIGNsYXNzZXM/LmlucHV0LFxuICAgICAgICAgICAgICAhZm9ybUVsZW1lbnRQcm9wcy5kaXNhYmxlZCAmJlxuICAgICAgICAgICAgICAgIHJlc2l6YWJsZSAmJlxuICAgICAgICAgICAgICAgIGNsc3goYmFzZUlucHV0Q2xhc3Nlcy5pbnB1dFJlc2l6YWJsZSwgY2xhc3Nlcz8uaW5wdXRSZXNpemFibGUpLFxuICAgICAgICAgICAgICBkaXNhYmxlZCAmJlxuICAgICAgICAgICAgICAgIGNsc3goYmFzZUlucHV0Q2xhc3Nlcy5pbnB1dERpc2FibGVkLCBjbGFzc2VzPy5pbnB1dERpc2FibGVkKSxcbiAgICAgICAgICAgICAgcmVhZE9ubHkgJiZcbiAgICAgICAgICAgICAgICBjbHN4KGJhc2VJbnB1dENsYXNzZXMuaW5wdXRSZWFkT25seSwgY2xhc3Nlcz8ucmVhZE9ubHkpXG4gICAgICAgICAgICApLFxuICAgICAgICAgIH19XG4gICAgICAgICAgaW5wdXRQcm9wcz17e1xuICAgICAgICAgICAgLy8gQXZvaWQgdGhlIHJlcXVpcmVkIGF0dHJpYnV0ZSBhdCB0aGUgcm9vdCBub2RlXG4gICAgICAgICAgICByZXF1aXJlZDogZm9ybUVsZW1lbnRQcm9wcy5yZXF1aXJlZCxcbiAgICAgICAgICAgIC4uLmlucHV0UHJvcHMsXG4gICAgICAgICAgICAuLi5hcmlhUHJvcHMsXG4gICAgICAgICAgfX1cbiAgICAgICAgICBpbnB1dFJlZj17aW5wdXRSZWZ9XG4gICAgICAgICAgbXVsdGlsaW5lPXttdWx0aWxpbmV9XG4gICAgICAgICAgcm93cz17MTB9XG4gICAgICAgICAgJHJlc2l6YWJsZT17IWZvcm1FbGVtZW50UHJvcHMuZGlzYWJsZWQgJiYgcmVzaXphYmxlfVxuICAgICAgICAgICRkaXNhYmxlZD17ISFkaXNhYmxlZH1cbiAgICAgICAgICAkcmVhZE9ubHk9eyEhcmVhZE9ubHl9XG4gICAgICAgICAgJGludmFsaWQ9e2xvY2FsSW52YWxpZH1cbiAgICAgICAgICB7Li4ub3RoZXJzfVxuICAgICAgICAvPlxuICAgICAgICB7IW11bHRpbGluZSAmJiAoXG4gICAgICAgICAgPFN0eWxlZElucHV0Qm9yZGVyQ29udGFpbmVyXG4gICAgICAgICAgICByb2xlPVwicHJlc2VudGF0aW9uXCJcbiAgICAgICAgICAgIGNsYXNzTmFtZT17Y2xzeChcbiAgICAgICAgICAgICAgYmFzZUlucHV0Q2xhc3Nlcy5pbnB1dEJvcmRlckNvbnRhaW5lcixcbiAgICAgICAgICAgICAgY2xhc3Nlcz8uaW5wdXRCb3JkZXJDb250YWluZXJcbiAgICAgICAgICAgICl9XG4gICAgICAgICAgLz5cbiAgICAgICAgKX1cbiAgICAgIDwvU3R5bGVkUm9vdD5cbiAgICA8Lz5cbiAgKTtcbn07XG4iXX0= */");
|
|
43
16
|
const HvBaseInput = ({
|
|
44
17
|
classes,
|
|
45
18
|
className = "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInput.cjs","sources":["../../../../src/components/BaseInput/BaseInput.tsx"],"sourcesContent":["import { RefObject, useContext } from \"react\";\nimport {\n InputBaseComponentProps as MuiInputBaseComponentProps,\n InputProps as MuiInputProps,\n} from \"@mui/material\";\nimport { HvBaseProps } from \"../../types\";\nimport {\n StyledRoot,\n StyledInputBorderContainer,\n StyledInput,\n} from \"./BaseInput.styles\";\nimport {\n HvFormElementContext,\n HvFormElementDescriptorsContext,\n buildFormElementPropsFromContext,\n buildAriaPropsFromContext,\n} from \"../Forms/FormElement\";\nimport clsx from \"clsx\";\nimport baseInputClasses, { HvBaseInputClasses } from \"./baseInputClasses\";\nimport { css, Global } from \"@emotion/react\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\n// Global styles for the base input.\nconst baseInputStyles = css({\n \"input:-webkit-autofill\": {\n \"-webkit-box-shadow\": `0 0 0px 1000px ${theme.colors.atmo1} inset`,\n \"-webkit-text-fill-color\": theme.colors.acce1,\n },\n\n /* Clears input's clear and reveal buttons from IE */\n \"input[type=search]::-ms-clear\": {\n display: \"none\",\n width: 0,\n height: 0,\n },\n \"input[type=search]::-ms-reveal\": {\n display: \"none\",\n width: 0,\n height: 0,\n },\n\n /* Clears input's clear button from Chrome */\n \"input[type=search]::-webkit-search-decoration\": { display: \"none\" },\n \"input[type=search]::-webkit-search-cancel-button\": { display: \"none\" },\n \"input[type=search]::-webkit-search-results-button\": {\n display: \"none\",\n },\n \"input[type=search]::-webkit-search-results-decoration\": {\n display: \"none\",\n },\n});\n\nexport type HvBaseInputProps = Omit<MuiInputProps, \"onChange\"> &\n HvBaseProps<HTMLDivElement, { onChange }> & {\n /** The input name. */\n name?: string;\n /** The value of the input, when controlled. */\n value?: string;\n /** The initial value of the input, when uncontrolled. */\n defaultValue?: string;\n /** If `true` the input is disabled. */\n disabled?: boolean;\n /** Indicates that the input is not editable. */\n readOnly?: boolean;\n /** If true, the input element will be required. */\n required?: boolean;\n /** The function that will be executed onChange, allows modification of the input,\n * it receives the value. If a new value should be presented it must returned it. */\n onChange?: (\n event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n value: string\n ) => void;\n /** The input type. */\n type?: string;\n /** Label inside the input used to help user. */\n placeholder?: string;\n /** If true, a textarea element will be rendered. */\n multiline?: boolean;\n /** If true and multiline is also true the textarea element will be resizable. */\n resizable?: boolean;\n /** Denotes if the input is in an invalid state. */\n invalid?: boolean;\n /** Attributes applied to the input element. */\n inputProps?: MuiInputBaseComponentProps;\n /** Allows passing a ref to the underlying input */\n inputRef?: RefObject<HTMLElement>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBaseInputClasses;\n };\n\n/**\n * An Input component that only posses the most basic functionalities.\n * It should be used alongside the other form elements to construct a proper accessible form.\n */\nexport const HvBaseInput = ({\n classes,\n className = \"\",\n id,\n name,\n value,\n defaultValue,\n required,\n readOnly,\n disabled,\n onChange,\n type = \"text\",\n placeholder,\n multiline = false,\n resizable = false,\n invalid = false,\n inputRef,\n inputProps = {},\n ...others\n}: HvBaseInputProps) => {\n const formElementContext = useContext(HvFormElementContext);\n const formElementProps = buildFormElementPropsFromContext(\n name,\n disabled,\n readOnly,\n required,\n status,\n formElementContext\n );\n\n const localInvalid = invalid || formElementProps.status === \"invalid\";\n\n const formElementDescriptorsContext = useContext(\n HvFormElementDescriptorsContext\n );\n const ariaProps = buildAriaPropsFromContext(\n inputProps,\n formElementDescriptorsContext,\n localInvalid,\n id\n );\n\n const onChangeHandler = (\n event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\n ) => {\n onChange?.(event, event.target.value);\n };\n\n return (\n <>\n <Global styles={baseInputStyles} />\n <StyledRoot\n className={clsx(\n baseInputClasses.root,\n classes?.root,\n className,\n formElementProps.disabled &&\n clsx(baseInputClasses.disabled, classes?.disabled),\n localInvalid && clsx(baseInputClasses.invalid, classes?.invalid),\n multiline &&\n resizable &&\n clsx(baseInputClasses.resizable, classes?.resizable),\n readOnly && clsx(baseInputClasses.readOnly, classes?.readOnly)\n )}\n $disabled={formElementProps.disabled}\n $invalid={localInvalid}\n $resizable={multiline && resizable}\n $readOnly={!!readOnly}\n >\n <StyledInput\n id={id}\n name={formElementProps.name}\n value={value}\n defaultValue={defaultValue}\n type={type}\n placeholder={placeholder}\n readOnly={!!formElementProps.readOnly}\n disabled={formElementProps.disabled}\n onChange={onChangeHandler}\n className={clsx(\n localInvalid && baseInputClasses.inputRootInvalid,\n readOnly && baseInputClasses.inputRootReadOnly\n )}\n classes={{\n root: clsx(baseInputClasses.inputRoot, classes?.inputRoot),\n focused: clsx(\n baseInputClasses.inputRootFocused,\n classes?.inputRootFocused\n ),\n disabled: clsx(\n baseInputClasses.inputRootDisabled,\n classes?.inputRootDisabled\n ),\n multiline: clsx(\n baseInputClasses.inputRootMultiline,\n classes?.inputRootMultiline\n ),\n input: clsx(\n baseInputClasses.input,\n classes?.input,\n !formElementProps.disabled &&\n resizable &&\n clsx(baseInputClasses.inputResizable, classes?.inputResizable),\n disabled &&\n clsx(baseInputClasses.inputDisabled, classes?.inputDisabled),\n readOnly &&\n clsx(baseInputClasses.inputReadOnly, classes?.readOnly)\n ),\n }}\n inputProps={{\n // Avoid the required attribute at the root node\n required: formElementProps.required,\n ...inputProps,\n ...ariaProps,\n }}\n inputRef={inputRef}\n multiline={multiline}\n rows={10}\n $resizable={!formElementProps.disabled && resizable}\n $disabled={!!disabled}\n $readOnly={!!readOnly}\n $invalid={localInvalid}\n {...others}\n />\n {!multiline && (\n <StyledInputBorderContainer\n role=\"presentation\"\n className={clsx(\n baseInputClasses.inputBorderContainer,\n classes?.inputBorderContainer\n )}\n />\n )}\n </StyledRoot>\n </>\n );\n};\n"],"names":["baseInputStyles","css","theme","colors","atmo1","acce1","display","width","height","process","env","NODE_ENV","HvBaseInput","classes","className","id","name","value","defaultValue","required","readOnly","disabled","onChange","type","placeholder","multiline","resizable","invalid","inputRef","inputProps","others","formElementContext","useContext","HvFormElementContext","formElementProps","buildFormElementPropsFromContext","status","localInvalid","formElementDescriptorsContext","HvFormElementDescriptorsContext","ariaProps","buildAriaPropsFromContext","onChangeHandler","event","target","_Fragment","children","_jsx","Global","styles","_jsxs","StyledRoot","clsx","baseInputClasses","root","$disabled","$invalid","$resizable","$readOnly","StyledInput","inputRootInvalid","inputRootReadOnly","inputRoot","focused","inputRootFocused","inputRootDisabled","inputRootMultiline","input","inputResizable","inputDisabled","inputReadOnly","rows","StyledInputBorderContainer","role","inputBor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,QACPC,iBAAAA,QAAiBW,kBACjBnD,mCAASmD,gBAAgB;AAAA,UAE3B3C,UAAU+B,cAAAA,QACRC,iBAAAA,QAAiBY,mBACjBpD,mCAASoD,iBAAiB;AAAA,UAE5BxC,WAAW2B,cAAAA,QACTC,iBAAAA,QAAiBa,oBACjBrD,mCAASqD,kBAAkB;AAAA,UAE7BC,OAAOf,cAAAA,QACLC,iBAAAA,QAAiBc,OACjBtD,mCAASsD,OACT,CAACjC,iBAAiBb,YAChBK,aACA0B,cAAKC,QAAAA,iBAAAA,QAAiBe,gBAAgBvD,mCAASuD,cAAc,GAC/D/C,YACE+B,cAAAA,QAAKC,iBAAiBgB,QAAAA,eAAexD,mCAASwD,aAAa,GAC7DjD,YACEgC,cAAKC,QAAAA,iBAAAA,QAAiBiB,eAAezD,mCAASO,QAAQ,CAAC;AAAA,QAE7D;AAAA,QACAS,YAAY;AAAA,UAEVV,UAAUe,iBAAiBf;AAAAA,UAC3B,GAAGU;AAAAA,UACH,GAAGW;AAAAA,QACL;AAAA,QACAZ;AAAAA,QACAH;AAAAA,QACA8C,MAAM;AAAA,QACNd,YAAY,CAACvB,iBAAiBb,YAAYK;AAAAA,QAC1C6B,WAAW,CAAC,CAAClC;AAAAA,QACbqC,WAAW,CAAC,CAACtC;AAAAA,QACboC,UAAUnB;AAAAA,QAAa,GACnBP;AAAAA,MAAM,CAAA,GAEX,CAACL,4CACC+C,6CAA0B;AAAA,QACzBC,MAAK;AAAA,QACL3D,WAAWsC,cAAAA,QACTC,iBAAAA,QAAiBqB,sBACjB7D,mCAAS6D,oBAAoB;AAAA,MAAA,CAGlC,CAAA;AAAA,IAAA,CACU,CAAA;AAAA,EAAA,CACZ;AAEP;;"}
|
|
1
|
+
{"version":3,"file":"BaseInput.cjs","sources":["../../../../src/components/BaseInput/BaseInput.tsx"],"sourcesContent":["import { RefObject, useContext } from \"react\";\nimport {\n InputBaseComponentProps as MuiInputBaseComponentProps,\n InputProps as MuiInputProps,\n} from \"@mui/material\";\nimport { HvBaseProps } from \"../../types\";\nimport {\n StyledRoot,\n StyledInputBorderContainer,\n StyledInput,\n} from \"./BaseInput.styles\";\nimport {\n HvFormElementContext,\n HvFormElementDescriptorsContext,\n buildFormElementPropsFromContext,\n buildAriaPropsFromContext,\n} from \"../Forms/FormElement\";\nimport clsx from \"clsx\";\nimport baseInputClasses, { HvBaseInputClasses } from \"./baseInputClasses\";\nimport { css, Global } from \"@emotion/react\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\n// Global styles for the base input.\nconst baseInputStyles = css`\n \"input:-webkit-autofill\": {\n \"-webkit-box-shadow\": 0 0 0px 1000px ${theme.colors.atmo1} inset,\n \"-webkit-text-fill-color\": ${theme.colors.acce1},\n },\n\n /* Clears input's clear and reveal buttons from IE */\n \"input[type=search]::-ms-clear\": {\n display: \"none\",\n width: 0,\n height: 0,\n },\n \"input[type=search]::-ms-reveal\": {\n display: \"none\",\n width: 0,\n height: 0,\n },\n\n /* Clears input's clear button from Chrome */\n \"input[type=search]::-webkit-search-decoration\": { display: \"none\" },\n \"input[type=search]::-webkit-search-cancel-button\": { display: \"none\" },\n \"input[type=search]::-webkit-search-results-button\": {\n display: \"none\",\n },\n \"input[type=search]::-webkit-search-results-decoration\": {\n display: \"none\",\n },\n}`;\n\nexport type HvBaseInputProps = Omit<MuiInputProps, \"onChange\"> &\n HvBaseProps<HTMLDivElement, { onChange }> & {\n /** The input name. */\n name?: string;\n /** The value of the input, when controlled. */\n value?: string;\n /** The initial value of the input, when uncontrolled. */\n defaultValue?: string;\n /** If `true` the input is disabled. */\n disabled?: boolean;\n /** Indicates that the input is not editable. */\n readOnly?: boolean;\n /** If true, the input element will be required. */\n required?: boolean;\n /** The function that will be executed onChange, allows modification of the input,\n * it receives the value. If a new value should be presented it must returned it. */\n onChange?: (\n event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n value: string\n ) => void;\n /** The input type. */\n type?: string;\n /** Label inside the input used to help user. */\n placeholder?: string;\n /** If true, a textarea element will be rendered. */\n multiline?: boolean;\n /** If true and multiline is also true the textarea element will be resizable. */\n resizable?: boolean;\n /** Denotes if the input is in an invalid state. */\n invalid?: boolean;\n /** Attributes applied to the input element. */\n inputProps?: MuiInputBaseComponentProps;\n /** Allows passing a ref to the underlying input */\n inputRef?: RefObject<HTMLElement>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBaseInputClasses;\n };\n\n/**\n * An Input component that only posses the most basic functionalities.\n * It should be used alongside the other form elements to construct a proper accessible form.\n */\nexport const HvBaseInput = ({\n classes,\n className = \"\",\n id,\n name,\n value,\n defaultValue,\n required,\n readOnly,\n disabled,\n onChange,\n type = \"text\",\n placeholder,\n multiline = false,\n resizable = false,\n invalid = false,\n inputRef,\n inputProps = {},\n ...others\n}: HvBaseInputProps) => {\n const formElementContext = useContext(HvFormElementContext);\n const formElementProps = buildFormElementPropsFromContext(\n name,\n disabled,\n readOnly,\n required,\n status,\n formElementContext\n );\n\n const localInvalid = invalid || formElementProps.status === \"invalid\";\n\n const formElementDescriptorsContext = useContext(\n HvFormElementDescriptorsContext\n );\n const ariaProps = buildAriaPropsFromContext(\n inputProps,\n formElementDescriptorsContext,\n localInvalid,\n id\n );\n\n const onChangeHandler = (\n event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\n ) => {\n onChange?.(event, event.target.value);\n };\n\n return (\n <>\n <Global styles={baseInputStyles} />\n <StyledRoot\n className={clsx(\n baseInputClasses.root,\n classes?.root,\n className,\n formElementProps.disabled &&\n clsx(baseInputClasses.disabled, classes?.disabled),\n localInvalid && clsx(baseInputClasses.invalid, classes?.invalid),\n multiline &&\n resizable &&\n clsx(baseInputClasses.resizable, classes?.resizable),\n readOnly && clsx(baseInputClasses.readOnly, classes?.readOnly)\n )}\n $disabled={formElementProps.disabled}\n $invalid={localInvalid}\n $resizable={multiline && resizable}\n $readOnly={!!readOnly}\n >\n <StyledInput\n id={id}\n name={formElementProps.name}\n value={value}\n defaultValue={defaultValue}\n type={type}\n placeholder={placeholder}\n readOnly={!!formElementProps.readOnly}\n disabled={formElementProps.disabled}\n onChange={onChangeHandler}\n className={clsx(\n localInvalid && baseInputClasses.inputRootInvalid,\n readOnly && baseInputClasses.inputRootReadOnly\n )}\n classes={{\n root: clsx(baseInputClasses.inputRoot, classes?.inputRoot),\n focused: clsx(\n baseInputClasses.inputRootFocused,\n classes?.inputRootFocused\n ),\n disabled: clsx(\n baseInputClasses.inputRootDisabled,\n classes?.inputRootDisabled\n ),\n multiline: clsx(\n baseInputClasses.inputRootMultiline,\n classes?.inputRootMultiline\n ),\n input: clsx(\n baseInputClasses.input,\n classes?.input,\n !formElementProps.disabled &&\n resizable &&\n clsx(baseInputClasses.inputResizable, classes?.inputResizable),\n disabled &&\n clsx(baseInputClasses.inputDisabled, classes?.inputDisabled),\n readOnly &&\n clsx(baseInputClasses.inputReadOnly, classes?.readOnly)\n ),\n }}\n inputProps={{\n // Avoid the required attribute at the root node\n required: formElementProps.required,\n ...inputProps,\n ...ariaProps,\n }}\n inputRef={inputRef}\n multiline={multiline}\n rows={10}\n $resizable={!formElementProps.disabled && resizable}\n $disabled={!!disabled}\n $readOnly={!!readOnly}\n $invalid={localInvalid}\n {...others}\n />\n {!multiline && (\n <StyledInputBorderContainer\n role=\"presentation\"\n className={clsx(\n baseInputClasses.inputBorderContainer,\n classes?.inputBorderContainer\n )}\n />\n )}\n </StyledRoot>\n </>\n );\n};\n"],"names":["baseInputStyles","theme","colors","atmo1","acce1","process","env","NODE_ENV","HvBaseInput","classes","className","id","name","value","defaultValue","required","readOnly","disabled","onChange","type","placeholder","multiline","resizable","invalid","inputRef","inputProps","others","formElementContext","useContext","HvFormElementContext","formElementProps","buildFormElementPropsFromContext","status","localInvalid","formElementDescriptorsContext","HvFormElementDescriptorsContext","ariaProps","buildAriaPropsFromContext","onChangeHandler","event","target","_Fragment","children","_jsx","Global","styles","_jsxs","StyledRoot","clsx","baseInputClasses","root","$disabled","$invalid","$resizable","$readOnly","StyledInput","inputRootInvalid","inputRootReadOnly","inputRoot","focused","inputRootFocused","inputRootDisabled","inputRootMultiline","input","inputResizable","inputDisabled","inputReadOnly","rows","StyledInputBorderContainer","role","inputBorderContainer"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAMA,4CAEqCC,kEAAAA,YAAAA,MAAMC,OAAOC,OACvBF,qCAAAA,YAAMC,MAAAA,OAAOE,OAAKC,2aAAAA,QAAAC,IAAAC,aAAAF,eAAAA,KAAAA,4BAAAA,QAAAC,IAAAC,aAwBjD,eAAA,KAAA,irUAAA;AA4CK,MAAMC,cAAcA,CAAC;AAAA,EAC1BC;AAAAA,EACAC,YAAY;AAAA,EACZC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,OAAO;AAAA,EACPC;AAAAA,EACAC,YAAY;AAAA,EACZC,YAAY;AAAA,EACZC,UAAU;AAAA,EACVC;AAAAA,EACAC,aAAa,CAAC;AAAA,KACXC;AACa,MAAM;AAChBC,QAAAA,qBAAqBC,iBAAWC,mBAAAA,oBAAoB;AAC1D,QAAMC,mBAAmBC,UACvBnB,iCAAAA,MACAK,UACAD,UACAD,UACAiB,QACAL,kBAAkB;AAGdM,QAAAA,eAAeV,WAAWO,iBAAiBE,WAAW;AAEtDE,QAAAA,gCAAgCN,iBACpCO,8BAAAA,+BAA+B;AAEjC,QAAMC,YAAYC,UAAAA,0BAChBZ,YACAS,+BACAD,cACAtB,EAAE;AAGE2B,QAAAA,kBAAkBA,CACtBC,UACG;AACQA,yCAAAA,OAAOA,MAAMC,OAAO3B;AAAAA,EAAK;AAGtC,yCACE4B,WAAAA,UAAA;AAAA,IAAAC,UAAA,CACEC,2BAAAA,IAACC,cAAM;AAAA,MAACC,QAAQ7C;AAAAA,IAAAA,CAAmB,GACnC8C,2BAAAA,KAACC,6BAAU;AAAA,MACTrC,WAAWsC,cACTC,QAAAA,yBAAiBC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QAAAA,iBAAAA,QAAiBe,gBAAgBvD,mCAASuD,cAAc,GAC/D/C,YACE+B,cAAAA,QAAKC,iBAAiBgB,QAAAA,eAAexD,mCAASwD,aAAa,GAC7DjD,YACEgC,cAAKC,QAAAA,iBAAAA,QAAiBiB,eAAezD,mCAASO,QAAQ,CAAC;AAAA,QAE7D;AAAA,QACAS,YAAY;AAAA,UAEVV,UAAUe,iBAAiBf;AAAAA,UAC3B,GAAGU;AAAAA,UACH,GAAGW;AAAAA,QACL;AAAA,QACAZ;AAAAA,QACAH;AAAAA,QACA8C,MAAM;AAAA,QACNd,YAAY,CAACvB,iBAAiBb,YAAYK;AAAAA,QAC1C6B,WAAW,CAAC,CAAClC;AAAAA,QACbqC,WAAW,CAAC,CAACtC;AAAAA,QACboC,UAAUnB;AAAAA,QAAa,GACnBP;AAAAA,MAAM,CAAA,GAEX,CAACL,4CACC+C,6CAA0B;AAAA,QACzBC,MAAK;AAAA,QACL3D,WAAWsC,cAAAA,QACTC,iBAAAA,QAAiBqB,sBACjB7D,mCAAS6D,oBAAoB;AAAA,MAAA,CAGlC,CAAA;AAAA,IAAA,CACU,CAAA;AAAA,EAAA,CACZ;AAEP;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.cjs","sources":["../../../../../src/components/Card/Content/Content.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { HvBaseProps } from \"../../../types\";\nimport { StyledContent } from \"./Content.styles\";\nimport { CardContentProps as MuiCardContentProps } from \"@mui/material/CardContent\";\nimport cardContentClasses, { HvCardContentClasses } from \"./contentClasses\";\n\nexport type HvContentProps = MuiCardContentProps &\n HvBaseProps & {\n /** Id to be applied to the root node. */\n id?: string;\n /** The function that will be executed when this section is clicked. */\n onClick?:
|
|
1
|
+
{"version":3,"file":"Content.cjs","sources":["../../../../../src/components/Card/Content/Content.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { HvBaseProps } from \"../../../types\";\nimport { StyledContent } from \"./Content.styles\";\nimport { CardContentProps as MuiCardContentProps } from \"@mui/material/CardContent\";\nimport cardContentClasses, { HvCardContentClasses } from \"./contentClasses\";\n\nexport type HvContentProps = MuiCardContentProps &\n HvBaseProps & {\n /** Id to be applied to the root node. */\n id?: string;\n /** The function that will be executed when this section is clicked. */\n onClick?: (event: React.SyntheticEvent) => void;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvCardContentClasses;\n };\n\nexport const HvContent = ({\n id,\n classes,\n className,\n children,\n onClick,\n ...others\n}: HvContentProps) => {\n return (\n <StyledContent\n id={id}\n className={clsx(classes?.content, cardContentClasses.content, className)}\n onClick={onClick}\n {...others}\n >\n {children}\n </StyledContent>\n );\n};\n"],"names":["HvContent","id","classes","className","children","onClick","others","StyledContent","clsx","content","cardContentClasses"],"mappings":";;;;;;;;AAgBO,MAAMA,YAAYA,CAAC;AAAA,EACxBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,KACGC;AACW,MAAM;AACpB,wCACGC,eAAAA,eAAa;AAAA,IACZN;AAAAA,IACAE,WAAWK,cAAKN,QAAAA,mCAASO,SAASC,eAAAA,QAAmBD,SAASN,SAAS;AAAA,IACvEE;AAAAA,IAAiB,GACbC;AAAAA,IAAMF;AAAAA,EAAAA,CAGI;AAEpB;;"}
|
|
@@ -34,6 +34,6 @@ const StyledRoot = /* @__PURE__ */ _styled__default.default(material.Container,
|
|
|
34
34
|
paddingLeft: uikitStyles.theme.spacing(4),
|
|
35
35
|
paddingRight: uikitStyles.theme.spacing(4)
|
|
36
36
|
}
|
|
37
|
-
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
37
|
+
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2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bn0pKTtcbiJdfQ== */");
|
|
38
38
|
exports.StyledRoot = StyledRoot;
|
|
39
39
|
//# sourceMappingURL=Container.styles.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.styles.cjs","sources":["../../../../src/components/Container/Container.styles.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport {
|
|
1
|
+
{"version":3,"file":"Container.styles.cjs","sources":["../../../../src/components/Container/Container.styles.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport {\n Container as MuiContainer,\n Breakpoints as MuiBreakpoints,\n} from \"@mui/material\";\nimport { transientOptions } from \"utils/transientOptions\";\n\nexport const StyledRoot = styled(\n MuiContainer,\n transientOptions\n)(({ $breakpoints }: { $breakpoints: MuiBreakpoints }) => ({\n paddingLeft: theme.space.sm,\n paddingRight: theme.space.sm,\n [$breakpoints.up(\"md\")]: {\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(4),\n },\n}));\n"],"names":["StyledRoot","MuiContainer","process","env","NODE_ENV","_extends","target","transientOptions","label","$breakpoints","paddingLeft","theme","space","sm","paddingRight","up","spacing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQaA,MAAAA,sDACXC,SAAAA,WAAYC,QAAAC,IAAAC,4BAAAC,SAAA,IAAA;AAAA,EAAAC,QAAA;AAAA,GACZC,iBAAgB,gBAAA,IAAAF,SAAA,IAAA;AAAA,EAAAC,QAAA;AAAA,EAAAE,OAAA;AAAA,GAAhBD,iBAAAA,gBAAgB,CACjB,EAAC,CAAC;AAAA,EAAEE;AAA+C,OAAO;AAAA,EACzDC,aAAaC,YAAAA,MAAMC,MAAMC;AAAAA,EACzBC,cAAcH,YAAAA,MAAMC,MAAMC;AAAAA,EAC1B,CAACJ,aAAaM,GAAG,IAAI,IAAI;AAAA,IACvBL,aAAaC,YAAAA,MAAMK,QAAQ,CAAC;AAAA,IAC5BF,cAAcH,YAAAA,MAAMK,QAAQ,CAAC;AAAA,EAC/B;AACF,IAAEd,QAAAC,IAAAC,aAAC,eAAA,KAAA,iuCAAA;;"}
|
|
@@ -36,7 +36,7 @@ const HvDialog = ({
|
|
|
36
36
|
selectedMode,
|
|
37
37
|
rootId
|
|
38
38
|
} = React.useContext(ThemeProvider.HvThemeContext);
|
|
39
|
-
const
|
|
39
|
+
const focusableQueue = React.useRef({
|
|
40
40
|
first: void 0,
|
|
41
41
|
last: void 0
|
|
42
42
|
});
|
|
@@ -50,10 +50,10 @@ const HvDialog = ({
|
|
|
50
50
|
const measuredRef = React.useCallback((node) => {
|
|
51
51
|
if (node) {
|
|
52
52
|
const focusableList = focusableElementFinder.getFocusableList(node);
|
|
53
|
-
|
|
53
|
+
focusableQueue.current = {
|
|
54
54
|
first: focusableList[1],
|
|
55
55
|
last: focusableList[focusableList.length - 2]
|
|
56
|
-
}
|
|
56
|
+
};
|
|
57
57
|
if (lodash.isNil(firstFocusable))
|
|
58
58
|
focusableList[1].focus();
|
|
59
59
|
else {
|
|
@@ -68,13 +68,14 @@ const HvDialog = ({
|
|
|
68
68
|
}
|
|
69
69
|
}, [firstFocusable]);
|
|
70
70
|
const keyDownHandler = (event) => {
|
|
71
|
+
var _a, _b;
|
|
71
72
|
if (keyCheck.isKeypress(event, keyboardCodes.keyboardCodes.Tab) && !lodash.isNil(event.target) && !lodash.isNil(focusableQueue)) {
|
|
72
|
-
if (event.shiftKey && event.target === focusableQueue.first) {
|
|
73
|
-
focusableQueue.last.focus();
|
|
73
|
+
if (event.shiftKey && event.target === focusableQueue.current.first) {
|
|
74
|
+
(_a = focusableQueue.current.last) == null ? void 0 : _a.focus();
|
|
74
75
|
event.preventDefault();
|
|
75
76
|
}
|
|
76
|
-
if (!event.shiftKey && event.target === focusableQueue.last) {
|
|
77
|
-
focusableQueue.first.focus();
|
|
77
|
+
if (!event.shiftKey && event.target === focusableQueue.current.last) {
|
|
78
|
+
(_b = focusableQueue.current.first) == null ? void 0 : _b.focus();
|
|
78
79
|
event.preventDefault();
|
|
79
80
|
}
|
|
80
81
|
} else if (keyCheck.isKeypress(event, keyboardCodes.keyboardCodes.Esc)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.cjs","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import React, { useCallback, useContext, useState } from \"react\";\nimport clsx from \"clsx\";\nimport { DialogProps as MuiDialogProps } from \"@mui/material/Dialog\";\nimport { Close } from \"@hitachivantara/uikit-react-icons\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport { isNil } from \"lodash\";\nimport { HvBaseProps, HvExtraProps } from \"../../types\";\nimport {\n StyledBackdrop,\n StyledClose,\n StyledDialog,\n StyledPaper,\n} from \"./Dialog.styles\";\nimport { getFocusableList } from \"utils/focusableElementFinder\";\nimport { isKeypress, keyboardCodes, setId } from \"utils\";\nimport { HvThemeContext } from \"providers\";\nimport { withTooltip } from \"hocs\";\nimport dialogClasses, { HvDialogClasses } from \"./dialogClasses\";\n\nexport type HvDialogProps = Omit<MuiDialogProps, \"fullScreen\"> &\n HvBaseProps & {\n /** Id to be applied to the root node. */\n id?: string;\n /** Current state of the Dialog. */\n open?: boolean;\n /** Function executed on close. */\n onClose?: any;\n /** Element id that should be focus when the Dialog opens. */\n firstFocusable?: string;\n /** Title for the button close. */\n buttonTitle?: string;\n /** Set the dialog to fullscreen mode. */\n fullscreen?: boolean;\n /** Prevent closing the dialog when clicking on the backdrop. */\n disableBackdropClick?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvDialogClasses;\n } & HvExtraProps;\n\nexport const HvDialog = ({\n classes,\n className,\n id,\n children,\n open = false,\n onClose,\n firstFocusable,\n buttonTitle = \"Close\",\n fullscreen = false,\n disableBackdropClick = false,\n ...others\n}: HvDialogProps) => {\n delete others.fullScreen;\n\n const { activeTheme, selectedMode, rootId } = useContext(HvThemeContext);\n\n const [focusableQueue, setFocusableQueue] = useState<{\n first: any;\n last: any;\n }>({ first: undefined, last: undefined });\n\n // Because the `disableBackdropClick` property was deprecated in MUI5\n // and we want to maintain that funcionality to the user we're wrapping\n // the onClose call here to make that check.\n const wrappedClose = (event, reason = \"\", bypassValidation = false) => {\n if (bypassValidation) {\n onClose?.(event, reason);\n } else if (!disableBackdropClick) {\n onClose?.(event, reason);\n }\n };\n\n const measuredRef = useCallback(\n (node) => {\n if (node) {\n const focusableList = getFocusableList(node);\n setFocusableQueue({\n first: focusableList[1],\n last: focusableList[focusableList.length - 2],\n });\n if (isNil(firstFocusable)) focusableList[1].focus();\n else {\n const element =\n firstFocusable && document.getElementById(firstFocusable);\n if (element) element.focus();\n else {\n // eslint-disable-next-line no-console\n console.warn(`firstFocusable element ${firstFocusable} not found.`);\n focusableList[1].focus();\n }\n }\n }\n },\n [firstFocusable]\n );\n\n const keyDownHandler = (event) => {\n if (\n isKeypress(event, keyboardCodes.Tab) &&\n !isNil(event.target) &&\n !isNil(focusableQueue)\n ) {\n if (event.shiftKey && event.target === focusableQueue.first) {\n focusableQueue.last.focus();\n event.preventDefault();\n }\n if (!event.shiftKey && event.target === focusableQueue.last) {\n focusableQueue.first.focus();\n event.preventDefault();\n }\n }\n // Needed as this handler overrides the one in the material ui Modal.\n else if (isKeypress(event, keyboardCodes.Esc)) {\n if (\"onEscapeKeyDown\" in others) {\n others.onEscapeKeyDown(event);\n }\n\n if (!others.disableEscapeKeyDown) {\n // Swallow the event, in case someone is listening for the escape key on the body.\n event.stopPropagation();\n\n wrappedClose(event, \"escapeKeyDown\", true);\n }\n }\n };\n\n const closeButtonDisplay = () => <Close role=\"presentation\" />;\n\n const CloseButtonTooltipWrapper = buttonTitle\n ? withTooltip(closeButtonDisplay, buttonTitle, \"top\", null, null, null)\n : closeButtonDisplay;\n\n return (\n <StyledDialog\n container={document.getElementById(rootId || \"\") || document.body}\n className={clsx(dialogClasses.root, classes?.root, className)}\n id={id}\n ref={measuredRef}\n open={open}\n fullScreen={fullscreen}\n onClose={(event, reason) => wrappedClose(event, reason)}\n onKeyDown={keyDownHandler}\n fullWidth\n maxWidth={false}\n slots={{\n backdrop: (backdropProps) => (\n <StyledBackdrop\n open={open}\n onClick={(event) => wrappedClose(event)}\n $backColor={\n activeTheme?.colors?.modes[selectedMode].atmo4 ||\n theme.colors.atmo4\n }\n {...backdropProps}\n />\n ),\n }}\n PaperComponent={(paperProps) => (\n <StyledPaper $fullscreen={fullscreen} {...paperProps} />\n )}\n PaperProps={{\n classes: {\n root: fullscreen\n ? clsx(dialogClasses.fullscreen, classes?.fullscreen)\n : \"\",\n },\n }}\n {...others}\n aria-modal\n >\n <StyledClose\n id={setId(id, \"close\")}\n className={clsx(dialogClasses.closeButton, classes?.closeButton)}\n variant=\"secondaryGhost\"\n onClick={(event) => wrappedClose(event, undefined, true)}\n aria-label={buttonTitle}\n >\n <CloseButtonTooltipWrapper />\n </StyledClose>\n {children && typeof children === \"object\"\n ? React.Children.map(\n children,\n (c: React.ReactNode) =>\n c && React.cloneElement(c as React.ReactElement, { fullscreen })\n )\n : children}\n </StyledDialog>\n );\n};\n"],"names":["HvDialog","classes","className","id","children","open","onClose","firstFocusable","buttonTitle","fullscreen","disableBackdropClick","others","fullScreen","activeTheme","selectedMode","rootId","useContext","HvThemeContext","focusableQueue","setFocusableQueue","useState","first","undefined","last","wrappedClose","event","reason","bypassValidation","measuredRef","useCallback","node","focusableList","getFocusableList","length","isNil","focus","element","document","getElementById","warn","keyDownHandler","isKeypress","keyboardCodes","Tab","target","shiftKey","preventDefault","Esc","onEscapeKeyDown","disableEscapeKeyDown","stopPropagation","closeButtonDisplay","_jsx","Close","role","CloseButtonTooltipWrapper","withTooltip","StyledDialog","container","body","clsx","dialogClasses","root","ref","onKeyDown","fullWidth","maxWidth","slots","backdrop","backdropProps","StyledBackdrop","onClick","$backColor","colors","modes","atmo4","theme","PaperComponent","paperProps","StyledPaper","$fullscreen","PaperProps","StyledClose","setId","closeButton","variant","React","Children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;;AAAAA,0CAAAA,IAACkB,8BAAc;AAAA,UACbjE;AAAAA,UACAkE,SAAU9C,CAAUD,UAAAA,aAAaC,KAAK;AAAA,UACtC+C,cACE3D,gDAAa4D,WAAb5D,mBAAqB6D,MAAM5D,cAAc6D,UACzCC,kBAAMH,OAAOE;AAAAA,UACd,GACGN;AAAAA,QAAAA,CAAa;AAAA;AAAA,IAGvB;AAAA,IACAQ,gBAAiBC,CACf1B,eAAAA,2BAAAA,IAAC2B,2BAAW;AAAA,MAACC,aAAavE;AAAAA,MAAW,GAAKqE;AAAAA,IAAAA,CAC1C;AAAA,IACFG,YAAY;AAAA,MACVhF,SAAS;AAAA,QACP6D,MAAMrD,aACFmD,sBAAKC,cAAAA,QAAcpD,YAAYR,mCAASQ,UAAU,IAClD;AAAA,MACN;AAAA,IACF;AAAA,IAAE,GACEE;AAAAA,IACJ,cAAU;AAAA,IAAAP,UAAA,CAEVgD,2BAAAA,IAAC8B,2BAAW;AAAA,MACV/E,IAAIgF,MAAAA,MAAMhF,IAAI,OAAO;AAAA,MACrBD,WAAW0D,cAAAA,QAAKC,cAAAA,QAAcuB,aAAanF,mCAASmF,WAAW;AAAA,MAC/DC,SAAQ;AAAA,MACRd,SAAU9C,CAAAA,UAAUD,aAAaC,OAAOH,QAAW,IAAI;AAAA,MACvD,cAAYd;AAAAA,MAAYJ,UAExBgD,2BAAAA,IAACG,2BAAyB,EAAA;AAAA,IAAG,CAAA,GAE9BnD,YAAY,OAAOA,aAAa,WAC7BkF,eAAAA,QAAMC,SAASC,IACbpF,UACA,CAACqF,MACCA,KAAKH,eAAAA,QAAMI,aAAaD,GAAyB;AAAA,MAAEhF;AAAAA,IAAAA,CAAY,CAAC,IAEpEL,QAAQ;AAAA,EAAA,CACC;AAEnB;;"}
|
|
1
|
+
{"version":3,"file":"Dialog.cjs","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import React, { useCallback, useContext, useRef } from \"react\";\nimport clsx from \"clsx\";\nimport { DialogProps as MuiDialogProps } from \"@mui/material/Dialog\";\nimport { Close } from \"@hitachivantara/uikit-react-icons\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\nimport { isNil } from \"lodash\";\nimport { HvBaseProps, HvExtraProps } from \"../../types\";\nimport {\n StyledBackdrop,\n StyledClose,\n StyledDialog,\n StyledPaper,\n} from \"./Dialog.styles\";\nimport { getFocusableList } from \"utils/focusableElementFinder\";\nimport { isKeypress, keyboardCodes, setId } from \"utils\";\nimport { HvThemeContext } from \"providers\";\nimport { withTooltip } from \"hocs\";\nimport dialogClasses, { HvDialogClasses } from \"./dialogClasses\";\n\nexport type HvDialogProps = Omit<MuiDialogProps, \"fullScreen\"> &\n HvBaseProps & {\n /** Id to be applied to the root node. */\n id?: string;\n /** Current state of the Dialog. */\n open?: boolean;\n /** Function executed on close. */\n onClose?: (event: React.SyntheticEvent, reason?: string) => void;\n /** Element id that should be focus when the Dialog opens. */\n firstFocusable?: string;\n /** Title for the button close. */\n buttonTitle?: string;\n /** Set the dialog to fullscreen mode. */\n fullscreen?: boolean;\n /** Prevent closing the dialog when clicking on the backdrop. */\n disableBackdropClick?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvDialogClasses;\n } & HvExtraProps;\n\nexport const HvDialog = ({\n classes,\n className,\n id,\n children,\n open = false,\n onClose,\n firstFocusable,\n buttonTitle = \"Close\",\n fullscreen = false,\n disableBackdropClick = false,\n ...others\n}: HvDialogProps) => {\n delete others.fullScreen;\n\n const { activeTheme, selectedMode, rootId } = useContext(HvThemeContext);\n\n const focusableQueue = useRef<{\n first?: HTMLElement;\n last?: HTMLElement;\n }>({ first: undefined, last: undefined });\n\n // Because the `disableBackdropClick` property was deprecated in MUI5\n // and we want to maintain that funcionality to the user we're wrapping\n // the onClose call here to make that check.\n const wrappedClose = (event, reason = \"\", bypassValidation = false) => {\n if (bypassValidation) {\n onClose?.(event, reason);\n } else if (!disableBackdropClick) {\n onClose?.(event, reason);\n }\n };\n\n const measuredRef = useCallback(\n (node) => {\n if (node) {\n const focusableList = getFocusableList(node);\n focusableQueue.current = {\n first: focusableList[1],\n last: focusableList[focusableList.length - 2],\n };\n if (isNil(firstFocusable)) focusableList[1].focus();\n else {\n const element =\n firstFocusable && document.getElementById(firstFocusable);\n if (element) element.focus();\n else {\n // eslint-disable-next-line no-console\n console.warn(`firstFocusable element ${firstFocusable} not found.`);\n focusableList[1].focus();\n }\n }\n }\n },\n [firstFocusable]\n );\n\n const keyDownHandler = (event) => {\n if (\n isKeypress(event, keyboardCodes.Tab) &&\n !isNil(event.target) &&\n !isNil(focusableQueue)\n ) {\n if (event.shiftKey && event.target === focusableQueue.current.first) {\n focusableQueue.current.last?.focus();\n event.preventDefault();\n }\n if (!event.shiftKey && event.target === focusableQueue.current.last) {\n focusableQueue.current.first?.focus();\n event.preventDefault();\n }\n }\n // Needed as this handler overrides the one in the material ui Modal.\n else if (isKeypress(event, keyboardCodes.Esc)) {\n if (\"onEscapeKeyDown\" in others) {\n others.onEscapeKeyDown(event);\n }\n\n if (!others.disableEscapeKeyDown) {\n // Swallow the event, in case someone is listening for the escape key on the body.\n event.stopPropagation();\n\n wrappedClose(event, \"escapeKeyDown\", true);\n }\n }\n };\n\n const closeButtonDisplay = () => <Close role=\"presentation\" />;\n\n const CloseButtonTooltipWrapper = buttonTitle\n ? withTooltip(closeButtonDisplay, buttonTitle, \"top\", null, null, null)\n : closeButtonDisplay;\n\n return (\n <StyledDialog\n container={document.getElementById(rootId || \"\") || document.body}\n className={clsx(dialogClasses.root, classes?.root, className)}\n id={id}\n ref={measuredRef}\n open={open}\n fullScreen={fullscreen}\n onClose={(event, reason) => wrappedClose(event, reason)}\n onKeyDown={keyDownHandler}\n fullWidth\n maxWidth={false}\n slots={{\n backdrop: (backdropProps) => (\n <StyledBackdrop\n open={open}\n onClick={(event) => wrappedClose(event)}\n $backColor={\n activeTheme?.colors?.modes[selectedMode].atmo4 ||\n theme.colors.atmo4\n }\n {...backdropProps}\n />\n ),\n }}\n PaperComponent={(paperProps) => (\n <StyledPaper $fullscreen={fullscreen} {...paperProps} />\n )}\n PaperProps={{\n classes: {\n root: fullscreen\n ? clsx(dialogClasses.fullscreen, classes?.fullscreen)\n : \"\",\n },\n }}\n {...others}\n aria-modal\n >\n <StyledClose\n id={setId(id, \"close\")}\n className={clsx(dialogClasses.closeButton, classes?.closeButton)}\n variant=\"secondaryGhost\"\n onClick={(event) => wrappedClose(event, undefined, true)}\n aria-label={buttonTitle}\n >\n <CloseButtonTooltipWrapper />\n </StyledClose>\n {children && typeof children === \"object\"\n ? React.Children.map(\n children,\n (c: React.ReactNode) =>\n c && React.cloneElement(c as React.ReactElement, { fullscreen })\n )\n : children}\n </StyledDialog>\n );\n};\n"],"names":["HvDialog","classes","className","id","children","open","onClose","firstFocusable","buttonTitle","fullscreen","disableBackdropClick","others","fullScreen","activeTheme","selectedMode","rootId","useContext","HvThemeContext","focusableQueue","useRef","first","undefined","last","wrappedClose","event","reason","bypassValidation","measuredRef","useCallback","node","focusableList","getFocusableList","current","length","isNil","focus","element","document","getElementById","warn","keyDownHandler","isKeypress","keyboardCodes","Tab","target","shiftKey","preventDefault","Esc","onEscapeKeyDown","disableEscapeKeyDown","stopPropagation","closeButtonDisplay","_jsx","Close","role","CloseButtonTooltipWrapper","withTooltip","StyledDialog","container","body","clsx","dialogClasses","root","ref","onKeyDown","fullWidth","maxWidth","slots","backdrop","backdropProps","StyledBackdrop","onClick","$backColor","colors","modes","atmo4","theme","PaperComponent","paperProps","StyledPaper","$fullscreen","PaperProps","StyledClose","setId","closeButton","variant","React","Children","map","c","cloneElement"],"mappings":";;;;;;;;;;;;;;;;;;;AAuCO,MAAMA,WAAWA,CAAC;AAAA,EACvBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,OAAO;AAAA,EACPC;AAAAA,EACAC;AAAAA,EACAC,cAAc;AAAA,EACdC,aAAa;AAAA,EACbC,uBAAuB;AAAA,KACpBC;AACU,MAAM;A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AA,CAAa;AAAA;AAAA,IAGvB;AAAA,IACAQ,gBAAiBC,CACf1B,eAAAA,2BAAAA,IAAC2B,2BAAW;AAAA,MAACC,aAAavE;AAAAA,MAAW,GAAKqE;AAAAA,IAAAA,CAC1C;AAAA,IACFG,YAAY;AAAA,MACVhF,SAAS;AAAA,QACP6D,MAAMrD,aACFmD,sBAAKC,cAAAA,QAAcpD,YAAYR,mCAASQ,UAAU,IAClD;AAAA,MACN;AAAA,IACF;AAAA,IAAE,GACEE;AAAAA,IACJ,cAAU;AAAA,IAAAP,UAAA,CAEVgD,2BAAAA,IAAC8B,2BAAW;AAAA,MACV/E,IAAIgF,MAAAA,MAAMhF,IAAI,OAAO;AAAA,MACrBD,WAAW0D,cAAAA,QAAKC,cAAAA,QAAcuB,aAAanF,mCAASmF,WAAW;AAAA,MAC/DC,SAAQ;AAAA,MACRd,SAAU/C,CAAAA,UAAUD,aAAaC,OAAOH,QAAW,IAAI;AAAA,MACvD,cAAYb;AAAAA,MAAYJ,UAExBgD,2BAAAA,IAACG,2BAAyB,EAAA;AAAA,IAAG,CAAA,GAE9BnD,YAAY,OAAOA,aAAa,WAC7BkF,eAAAA,QAAMC,SAASC,IACbpF,UACA,CAACqF,MACCA,KAAKH,eAAAA,QAAMI,aAAaD,GAAyB;AAAA,MAAEhF;AAAAA,IAAAA,CAAY,CAAC,IAEpEL,QAAQ;AAAA,EAAA,CACC;AAEnB;;"}
|
|
@@ -21,6 +21,7 @@ const HvTitle = ({
|
|
|
21
21
|
const {
|
|
22
22
|
fullscreen
|
|
23
23
|
} = others;
|
|
24
|
+
delete others.fullscreen;
|
|
24
25
|
const icon = customIcon || showIcon && iconVariant.default(variant, "", "");
|
|
25
26
|
return /* @__PURE__ */ jsxRuntime.jsx(Title_styles.StyledTitle, {
|
|
26
27
|
className: clsx__default.default(titleClasses.default.root, classes == null ? void 0 : classes.root, className, fullscreen ? clsx__default.default(titleClasses.default.fullscreen, classes == null ? void 0 : classes.fullscreen) : ""),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Title.cjs","sources":["../../../../../src/components/Dialog/Title/Title.tsx"],"sourcesContent":["import { DialogTitleProps as MuiDialogTitleProps } from \"@mui/material/DialogTitle\";\nimport clsx from \"clsx\";\nimport { HvTypography } from \"components\";\nimport { HvBaseProps, HvExtraProps } from \"../../../types\";\nimport { iconVariant } from \"utils\";\nimport {\n StyledTitle,\n StyledMessageContainer,\n StyledTextWithIcon,\n} from \"./Title.styles\";\nimport dialogTitleClasses, { HvDialogTitleClasses } from \"./titleClasses\";\n\nexport type HvDialogTitleVariant =\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\"\n | \"default\";\n\nexport type HvTitleProps = Omit<MuiDialogTitleProps, \"variant\"> &\n HvBaseProps & {\n /** Variant of the Dialog. */\n variant?: HvDialogTitleVariant;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n classes?: HvDialogTitleClasses;\n } & HvExtraProps;\n\nexport const HvTitle = ({\n classes,\n className,\n children,\n variant = \"default\",\n showIcon = true,\n customIcon = null,\n ...others\n}: HvTitleProps) => {\n const isString = typeof children === \"string\";\n const { fullscreen } = others;\n\n const icon = customIcon || (showIcon && iconVariant(variant, \"\", \"\"));\n\n return (\n <StyledTitle\n className={clsx(\n dialogTitleClasses.root,\n classes?.root,\n className,\n fullscreen\n ? clsx(dialogTitleClasses.fullscreen, classes?.fullscreen)\n : \"\"\n )}\n $fullscreen={fullscreen}\n {...others}\n >\n <StyledMessageContainer>\n {icon}\n\n <StyledTextWithIcon $hasIcon={!!icon}>\n {!isString && children}\n {isString && <HvTypography variant=\"title4\">{children}</HvTypography>}\n </StyledTextWithIcon>\n </StyledMessageContainer>\n </StyledTitle>\n );\n};\n"],"names":["HvTitle","classes","className","children","variant","showIcon","customIcon","others","isString","fullscreen","icon","iconVariant","StyledTitle","clsx","dialogTitleClasses","root","$fullscreen","StyledMessageContainer","_jsxs","StyledTextWithIcon","$hasIcon","HvTypography"],"mappings":";;;;;;;;;;AA8BO,MAAMA,UAAUA,CAAC;AAAA,EACtBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,UAAU;AAAA,EACVC,WAAW;AAAA,EACXC,aAAa;AAAA,KACVC;AACS,MAAM;AACZC,QAAAA,WAAW,OAAOL,aAAa;AAC/B,QAAA;AAAA,IAAEM;AAAAA,EAAeF,IAAAA;
|
|
1
|
+
{"version":3,"file":"Title.cjs","sources":["../../../../../src/components/Dialog/Title/Title.tsx"],"sourcesContent":["import { DialogTitleProps as MuiDialogTitleProps } from \"@mui/material/DialogTitle\";\nimport clsx from \"clsx\";\nimport { HvTypography } from \"components\";\nimport { HvBaseProps, HvExtraProps } from \"../../../types\";\nimport { iconVariant } from \"utils\";\nimport {\n StyledTitle,\n StyledMessageContainer,\n StyledTextWithIcon,\n} from \"./Title.styles\";\nimport dialogTitleClasses, { HvDialogTitleClasses } from \"./titleClasses\";\n\nexport type HvDialogTitleVariant =\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\"\n | \"default\";\n\nexport type HvTitleProps = Omit<MuiDialogTitleProps, \"variant\"> &\n HvBaseProps & {\n /** Variant of the Dialog. */\n variant?: HvDialogTitleVariant;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n classes?: HvDialogTitleClasses;\n } & HvExtraProps;\n\nexport const HvTitle = ({\n classes,\n className,\n children,\n variant = \"default\",\n showIcon = true,\n customIcon = null,\n ...others\n}: HvTitleProps) => {\n const isString = typeof children === \"string\";\n const { fullscreen } = others;\n delete others.fullscreen;\n\n const icon = customIcon || (showIcon && iconVariant(variant, \"\", \"\"));\n\n return (\n <StyledTitle\n className={clsx(\n dialogTitleClasses.root,\n classes?.root,\n className,\n fullscreen\n ? clsx(dialogTitleClasses.fullscreen, classes?.fullscreen)\n : \"\"\n )}\n $fullscreen={fullscreen}\n {...others}\n >\n <StyledMessageContainer>\n {icon}\n\n <StyledTextWithIcon $hasIcon={!!icon}>\n {!isString && children}\n {isString && <HvTypography variant=\"title4\">{children}</HvTypography>}\n </StyledTextWithIcon>\n </StyledMessageContainer>\n </StyledTitle>\n );\n};\n"],"names":["HvTitle","classes","className","children","variant","showIcon","customIcon","others","isString","fullscreen","icon","iconVariant","StyledTitle","clsx","dialogTitleClasses","root","$fullscreen","StyledMessageContainer","_jsxs","StyledTextWithIcon","$hasIcon","HvTypography"],"mappings":";;;;;;;;;;AA8BO,MAAMA,UAAUA,CAAC;AAAA,EACtBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,UAAU;AAAA,EACVC,WAAW;AAAA,EACXC,aAAa;AAAA,KACVC;AACS,MAAM;AACZC,QAAAA,WAAW,OAAOL,aAAa;AAC/B,QAAA;AAAA,IAAEM;AAAAA,EAAeF,IAAAA;AACvB,SAAOA,OAAOE;AAEd,QAAMC,OAAOJ,cAAeD,YAAYM,YAAYP,QAAAA,SAAS,IAAI,EAAE;AAEnE,wCACGQ,aAAAA,aAAW;AAAA,IACVV,WAAWW,cAAAA,QACTC,aAAmBC,QAAAA,MACnBd,mCAASc,MACTb,WACAO,aACII,cAAAA,QAAKC,aAAmBL,QAAAA,YAAYR,mCAASQ,UAAU,IACvD,EAAE;AAAA,IAERO,aAAaP;AAAAA,IAAW,GACpBF;AAAAA,IAAMJ,0CAETc,qCAAsB;AAAA,MAAAd,UACpBO,CAAAA,MAEDQ,2BAAAA,KAACC,iCAAkB;AAAA,QAACC,UAAU,CAAC,CAACV;AAAAA,QAAKP,UAAA,CAClC,CAACK,YAAYL,UACbK,2CAAaa,yBAAY;AAAA,UAACjB,SAAQ;AAAA,UAAQD;AAAAA,QAAAA,CAA0B,CAAA;AAAA,MAAA,CAClD,CAAA;AAAA,IAAA,CAAA;AAAA,EAAA,CAEX;AAElB;;"}
|