@pega/cosmos-react-core 6.0.13 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +4 -6
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.js +6 -2
- package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.js +1 -1
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/Drawer.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.js +3 -2
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/style-utils.d.ts +1 -0
- package/lib/components/AppShell/style-utils.d.ts.map +1 -1
- package/lib/components/AppShell/style-utils.js +4 -2
- package/lib/components/AppShell/style-utils.js.map +1 -1
- package/lib/components/Badges/Selection.js +1 -1
- package/lib/components/Badges/Selection.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +23 -4
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/HiddenText/HiddenText.d.ts +11 -0
- package/lib/components/HiddenText/HiddenText.d.ts.map +1 -0
- package/lib/components/HiddenText/HiddenText.js +15 -0
- package/lib/components/HiddenText/HiddenText.js.map +1 -0
- package/lib/components/HiddenText/index.d.ts +2 -0
- package/lib/components/HiddenText/index.d.ts.map +1 -0
- package/lib/components/HiddenText/index.js +2 -0
- package/lib/components/HiddenText/index.js.map +1 -0
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +2 -2
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-up-down.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/arrow-micro-up-down.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/arrow-micro-up-down.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/arrow-micro-up-down.icon.js.map +1 -0
- package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
- package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
- package/lib/components/Icon/streamlineIconNames.js +1 -0
- package/lib/components/Icon/streamlineIconNames.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +1 -2
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +1 -1
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +10 -3
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts +3 -1
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
- package/lib/components/Modal/Modal.styles.js +22 -12
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.js +28 -1
- package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +4 -1
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +13 -1
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useRefMap.d.ts +8 -0
- package/lib/hooks/useRefMap.d.ts.map +1 -0
- package/lib/hooks/useRefMap.js +27 -0
- package/lib/hooks/useRefMap.js.map +1 -0
- package/lib/i18n/default.d.ts +13 -1
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +16 -2
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +13 -1
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/mouseState.d.ts +9 -0
- package/lib/utils/mouseState.d.ts.map +1 -0
- package/lib/utils/mouseState.js +26 -0
- package/lib/utils/mouseState.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldGroupList.js","sourceRoot":"","sources":["../../../src/components/FieldGroup/FieldGroupList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FieldGroupList.js","sourceRoot":"","sources":["../../../src/components/FieldGroup/FieldGroupList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,UAAU,EAAE,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG5D,YAAY,CAAC,QAAQ,CAAC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AAO,EAAE,GAAG,EAAE;oCACZ,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC;oCACnB,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;gCACjB,CAAC;6BACF;yBACF;wBACH,CAAC,CAAC,SAAS,EAEf,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,YAExC,QAAQ,IAtBJ,EAAE,CAuBQ,CAClB,CAAC;YACJ,CAAC,CACF,EACA,KAAK,IAAI,CACR,MAAC,eAAe,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,aAC5D,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,OAAE,CAAC,CAAC,KAAK,CAAC,IACd,CACnB,IACoB,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { forwardRef, useEffect, useRef } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { ForwardProps } from '../../types';\nimport Button from '../Button';\nimport Icon, { registerIcon } from '../Icon';\nimport * as plusIcon from '../Icon/icons/plus.icon';\nimport { useI18n } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport { getActiveElement, getFocusables } from '../../utils';\n\nimport FieldGroup, { StyledFieldGroup } from './FieldGroup';\nimport type { FieldGroupProps } from './FieldGroup';\n\nregisterIcon(plusIcon);\n\nexport type FieldGroupListItemProps = FieldGroupProps & {\n /** The ID of the field group list item */\n id: string;\n /** Item level onDelete callback. */\n onDelete?: (id: string) => void;\n};\n\nexport interface FieldGroupListProps {\n items: FieldGroupListItemProps[];\n onAdd?: () => void;\n onDelete?: (id: string) => void;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledFieldGroupList = styled.div(\n ({ theme }) =>\n css`\n margin-block-start: ${theme.base.spacing};\n\n ${StyledFieldGroup} {\n margin-block-start: 0;\n }\n `\n);\n\nStyledFieldGroupList.defaultProps = defaultThemeProp;\n\nexport const StyledListItem = styled(FieldGroup)(\n ({ theme }) =>\n css`\n padding: ${theme.base.spacing} 0 calc(2 * ${theme.base.spacing});\n\n &:not(:last-of-type) {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n margin-block-end: calc(2 * ${theme.base.spacing});\n }\n\n legend {\n margin-block-end: 0;\n }\n `\n);\n\nStyledListItem.defaultProps = defaultThemeProp;\n\nconst StyledAddButton = styled(Button)(\n ({ theme }) =>\n css`\n margin-top: ${theme.base.spacing};\n `\n);\n\nStyledAddButton.defaultProps = defaultThemeProp;\n\nconst FieldGroupList: FunctionComponent<FieldGroupListProps & ForwardProps> = forwardRef(\n function FieldGroupList(\n { items, onAdd, onDelete, ...restProps }: PropsWithoutRef<FieldGroupListProps>,\n ref: FieldGroupListProps['ref']\n ) {\n const t = useI18n();\n const lastItemRef = useRef<HTMLDivElement>(null);\n const addBtnRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n const currentActiveEl = getActiveElement();\n if (currentActiveEl === addBtnRef.current && lastItemRef.current) {\n const groupItemLegend = lastItemRef.current.querySelector(':scope > legend');\n const focusables = getFocusables(lastItemRef.current);\n\n const groupActionButtons = focusables.filter(focusable =>\n groupItemLegend?.contains(focusable)\n );\n\n const groupContentFocusables = focusables.filter(\n focusable => !groupItemLegend?.contains(focusable)\n );\n\n if (groupContentFocusables.length > 0) {\n groupContentFocusables[0].focus();\n } else {\n groupActionButtons[0]?.focus();\n }\n }\n }, [items.length]);\n\n return (\n <StyledFieldGroupList ref={ref} {...restProps}>\n {items.map(\n (\n {\n id,\n children,\n name,\n headingTag,\n onDelete: itemOnDelete,\n ...restItemProps\n }: FieldGroupListItemProps,\n index\n ) => {\n const isLastItem = index === items.length - 1;\n return (\n <StyledListItem\n key={id}\n name={name}\n headingTag={headingTag}\n {...restItemProps}\n actions={\n onDelete || itemOnDelete\n ? [\n {\n id: 'delete',\n text: t('delete'),\n icon: 'trash',\n iconOnly: true,\n onClick: () => {\n itemOnDelete?.(id);\n onDelete?.(id);\n }\n }\n ]\n : undefined\n }\n ref={isLastItem ? lastItemRef : undefined}\n >\n {children}\n </StyledListItem>\n );\n }\n )}\n {onAdd && (\n <StyledAddButton variant='link' onClick={onAdd} ref={addBtnRef}>\n <Icon name='plus' /> {t('add')}\n </StyledAddButton>\n )}\n </StyledFieldGroupList>\n );\n }\n);\n\nexport default FieldGroupList;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WithAttributes } from '../../types';
|
|
2
|
+
type HiddenTextProps = WithAttributes<'span', {
|
|
3
|
+
/** A DOM id that other elements can reference for an accessible label/description text. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Text content for an accessible label/description. */
|
|
6
|
+
children: string;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const StyledHiddenText: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
9
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<HiddenTextProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=HiddenText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HiddenText.d.ts","sourceRoot":"","sources":["../../../src/components/HiddenText/HiddenText.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAc,cAAc,EAAE,MAAM,aAAa,CAAC;AAG9D,KAAK,eAAe,GAAG,cAAc,CACnC,MAAM,EACN;IACE,2FAA2F;IAC3F,EAAE,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;CAClB,CACF,CAAC;AAEF,eAAO,MAAM,gBAAgB,0GAE5B,CAAC;;AAEF,wBAQE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { useConfiguration } from '../../hooks';
|
|
6
|
+
export const StyledHiddenText = styled.span `
|
|
7
|
+
display: none;
|
|
8
|
+
`;
|
|
9
|
+
export default forwardRef(function HiddenText(props, ref) {
|
|
10
|
+
const { portalTarget } = useConfiguration();
|
|
11
|
+
return portalTarget
|
|
12
|
+
? createPortal(_jsx(StyledHiddenText, { ...props, ref: ref }), portalTarget)
|
|
13
|
+
: null;
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=HiddenText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HiddenText.js","sourceRoot":"","sources":["../../../src/components/HiddenText/HiddenText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAY/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAA;;CAE1C,CAAC;AAEF,eAAe,UAAU,CACvB,SAAS,UAAU,CAAC,KAAK,EAAE,GAAG;IAC5B,MAAM,EAAE,YAAY,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAE5C,OAAO,YAAY;QACjB,CAAC,CAAC,YAAY,CAAC,KAAC,gBAAgB,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,EAAE,YAAY,CAAC;QACvE,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport type { PropsWithoutRef } from 'react';\nimport styled from 'styled-components';\n\nimport type { RefElement, WithAttributes } from '../../types';\nimport { useConfiguration } from '../../hooks';\n\ntype HiddenTextProps = WithAttributes<\n 'span',\n {\n /** A DOM id that other elements can reference for an accessible label/description text. */\n id: string;\n /** Text content for an accessible label/description. */\n children: string;\n }\n>;\n\nexport const StyledHiddenText = styled.span`\n display: none;\n`;\n\nexport default forwardRef<RefElement<HiddenTextProps>, PropsWithoutRef<HiddenTextProps>>(\n function HiddenText(props, ref) {\n const { portalTarget } = useConfiguration();\n\n return portalTarget\n ? createPortal(<StyledHiddenText {...props} ref={ref} />, portalTarget)\n : null;\n }\n);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HiddenText/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/HiddenText/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { default } from './HiddenText';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAwB,aAAa,EAAE,yBAAyB,EAAE,MAAM,OAAO,CAAC;AAK5F,OAAO,KAAK,EAAE,cAAc,EAAc,cAAc,EAAE,MAAM,aAAa,CAAC;AAG9E,KAAK,aAAa,GAAG,cAAc,GAAG;IACpC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,WAAW,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,SAAS,GACjB,cAAc,CACZ,KAAK,EACL,aAAa,GAAG;IACd,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,C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
});
|
|
122
122
|
StyledIconShape.defaultProps = defaultThemeProp;
|
|
123
123
|
const emptyIconDefinition = Object.freeze({ Component: () => null });
|
|
124
|
-
const Icon = forwardRef(function Icon({ set: setProp, name, size, ...restProps }, ref) {
|
|
124
|
+
const Icon = forwardRef(function Icon({ set: setProp, name, size, 'aria-label': ariaLabel, ...restProps }, ref) {
|
|
125
125
|
const { base: { 'icon-set': setTheme } } = useTheme();
|
|
126
126
|
const set = setProp ?? setTheme ?? 'budicon';
|
|
127
127
|
const [iconDef, setIconDef] = useState(iconRegistry.get(set)?.get(name) ?? emptyIconDefinition);
|
|
@@ -166,7 +166,7 @@ const Icon = forwardRef(function Icon({ set: setProp, name, size, ...restProps }
|
|
|
166
166
|
})();
|
|
167
167
|
return () => controller.abort();
|
|
168
168
|
}, [name, set]);
|
|
169
|
-
return typeof restProps.background === 'string' ? (_jsx(StyledIconShape, {
|
|
169
|
+
return typeof restProps.background === 'string' ? (_jsx(StyledIconShape, { ...restProps, background: restProps.background, foreground: restProps.foreground, shape: restProps.shape, size: size, ref: ref, children: _jsx(StyledIcon, { role: ariaLabel !== undefined ? 'img' : 'presentation', "aria-label": ariaLabel, viewBox: iconDef.viewBox, children: _jsx(iconDef.Component, {}) }) })) : (_jsx(StyledIcon, { ...restProps, role: ariaLabel !== undefined ? 'img' : 'presentation', "aria-label": ariaLabel, viewBox: iconDef.viewBox, size: size, ref: ref, children: _jsx(iconDef.Component, {}) }));
|
|
170
170
|
});
|
|
171
171
|
export default Icon;
|
|
172
172
|
//# sourceMappingURL=Icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa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AE,CAAC;QAEL,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;IAEhB,OAAO,OAAO,SAAS,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,CAChD,KAAC,eAAe,IACd,IAAI,EAAC,cAAc,KACf,SAAS,EACb,UAAU,EAAE,SAAS,CAAC,UAAU,EAChC,UAAU,EAAE,SAAS,CAAC,UAAU,EAChC,KAAK,EAAE,SAAS,CAAC,KAAK,EACtB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAA0B,YAE/B,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,CAAC,OAAO,YAClC,KAAC,OAAO,CAAC,SAAS,KAAG,GACV,GACG,CACnB,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,IACT,IAAI,EAAC,cAAc,KACf,SAAS,EACb,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAyB,YAE9B,KAAC,OAAO,CAAC,SAAS,KAAG,GACV,CACd,CAAC;AACJ,CAAC,CAAyC,CAAC;AAE3C,eAAe,IAAI,CAAC","sourcesContent":["import { forwardRef, useState, useEffect } from 'react';\nimport type { Ref, PropsWithoutRef, ComponentType, ForwardRefExoticComponent } from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport { useTheme } from '../../hooks';\nimport type { NoChildrenProp, RefElement, WithAttributes } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\ntype BaseIconProps = NoChildrenProp & {\n /**\n * The name of the icon set.\n * @default theme.base['icon-set']\n */\n set?: string;\n /** The name indicating the Cosmos Icon. Reference the catalog above for the available names. */\n name: string;\n /**\n * Background & svg size.\n * @default \"s\" without background, \"m\" with background.\n */\n size?: 's' | 'm' | 'l' | 'font-size';\n};\n\nexport type IconProps =\n | WithAttributes<\n 'div',\n BaseIconProps & {\n /** Background color. */\n background: string;\n /**\n * Foreground color (svg fill).\n * Applies readable color off background if undefined.\n */\n foreground?: string;\n /**\n * Shape of the background.\n * @default 'square'\n */\n shape?: 'square' | 'circle';\n }\n >\n | WithAttributes<\n 'svg',\n BaseIconProps & {\n background?: never;\n foreground?: never;\n shape?: never;\n }\n >;\n\nexport interface IconDefinition {\n Component: ComponentType;\n viewBox?: string;\n}\n\nexport interface IconModule extends IconDefinition {\n set?: IconProps['set'];\n name: IconProps['name'];\n}\n\nconst iconRegistry = new Map<string, Map<string, IconDefinition>>([]);\n\nexport const registerIcon = (...icons: IconModule[]) => {\n icons.forEach(({ set: modSet, name, ...iconDef }) => {\n const set = modSet ?? 'budicon';\n\n if (!iconRegistry.has(set)) {\n iconRegistry.set(set, new Map([[name, iconDef]]));\n } else if (!iconRegistry.get(set)!.has(name)) {\n iconRegistry.get(set)!.set(name, iconDef);\n }\n });\n};\n\nexport const forceRegisterIcon = (...icons: IconModule[]) => {\n icons.forEach(({ set: modSet, name, ...iconDef }) => {\n const set = modSet ?? 'budicon';\n\n if (!iconRegistry.has(set)) {\n iconRegistry.set(set, new Map([[name, iconDef]]));\n } else {\n iconRegistry.get(set)!.set(name, iconDef);\n }\n });\n};\n\nexport const StyledIcon = styled.svg<{ size?: IconProps['size'] }>(({ theme, size = 's' }) => {\n const {\n components: {\n icon: {\n size: { s, m, l }\n }\n }\n } = theme;\n return css`\n display: inline-block;\n fill: currentColor;\n vertical-align: middle;\n flex-shrink: 0;\n /* stylelint-disable unit-allowed-list */\n min-width: 14px;\n min-height: 14px;\n /* stylelint-enable unit-allowed-list */\n\n ${size === 's' &&\n css`\n width: ${s};\n height: ${s};\n `}\n\n ${size === 'm' &&\n css`\n width: ${m};\n height: ${m};\n `}\n\n ${size === 'l' &&\n css`\n width: ${l};\n height: ${l};\n `}\n\n ${size === 'font-size' &&\n css`\n width: 1em;\n height: 1em;\n `}\n `;\n});\n\nStyledIcon.defaultProps = defaultThemeProp;\n\nexport const StyledIconShape = styled.div<{\n background: NonNullable<IconProps['background']>;\n foreground?: IconProps['foreground'];\n size?: IconProps['size'];\n shape?: IconProps['shape'];\n}>(({ theme, background, foreground, size = 'm', shape = 'square' }) => {\n const readableFg = readableColor(background);\n\n const {\n base: { 'border-radius': baseRadius },\n components: {\n icon: {\n size: { s, m, l },\n 'border-radius-multiplier': borderRadiusMultiplier\n }\n }\n } = theme;\n\n return css`\n color: ${foreground ?? readableFg};\n background-color: ${background};\n display: flex;\n justify-content: center;\n align-items: center;\n\n ${size === 's' &&\n css`\n width: ${s};\n height: ${s};\n `}\n\n ${size === 'm' &&\n css`\n width: ${m};\n height: ${m};\n `}\n\n ${size === 'l' &&\n css`\n width: ${l};\n height: ${l};\n `}\n\n ${size === 'font-size' &&\n css`\n width: 1em;\n height: 1em;\n `}\n\n ${shape === 'square' &&\n css`\n border-radius: calc(${borderRadiusMultiplier} * ${baseRadius});\n `}\n\n ${shape === 'circle' &&\n css`\n border-radius: 50%;\n `}\n\n ${StyledIcon} {\n width: 50%;\n height: 50%;\n /* stylelint-disable unit-allowed-list */\n min-width: min(14px, 90%);\n min-height: min(14px, 90%);\n /* stylelint-enable unit-allowed-list */\n }\n `;\n});\n\nStyledIconShape.defaultProps = defaultThemeProp;\n\nconst emptyIconDefinition: Readonly<IconDefinition> = Object.freeze({ Component: () => null });\n\nconst Icon = forwardRef<RefElement<IconProps>, PropsWithoutRef<IconProps>>(function Icon(\n { set: setProp, name, size, ...restProps }: PropsWithoutRef<IconProps>,\n ref\n) {\n const {\n base: { 'icon-set': setTheme }\n } = useTheme();\n\n const set = setProp ?? setTheme ?? 'budicon';\n\n const [iconDef, setIconDef] = useState(iconRegistry.get(set)?.get(name) ?? emptyIconDefinition);\n\n useEffect(() => {\n if (iconRegistry.get(set)?.has(name)) {\n setIconDef(iconRegistry.get(set)!.get(name)!);\n return;\n }\n\n const controller = new AbortController();\n\n (async () => {\n try {\n const encodedName = encodeURIComponent(name);\n let iconSet: string;\n let module: IconModule;\n\n switch (set) {\n case 'streamline':\n iconSet = 'streamline-icons';\n break;\n case 'budicon':\n iconSet = 'icons';\n break;\n default:\n throw new Error('Unknown icon');\n }\n\n // The following expression is required for Storybook Vite Builder\n try {\n module = await import(`./${iconSet}/${encodedName}.icon`);\n } catch {\n module = await import(`./${iconSet}/${encodedName}.icon.tsx`);\n }\n\n if (module.name !== name || !module.Component) throw new Error('Malformed icon definition');\n\n registerIcon(module);\n } catch {\n registerIcon({ set, name, ...emptyIconDefinition });\n }\n\n if (!controller.signal.aborted) {\n setIconDef(iconRegistry.get(set)!.get(name) ?? emptyIconDefinition);\n }\n })();\n\n return () => controller.abort();\n }, [name, set]);\n\n return typeof restProps.background === 'string' ? (\n <StyledIconShape\n role='presentation'\n {...restProps}\n background={restProps.background}\n foreground={restProps.foreground}\n shape={restProps.shape}\n size={size}\n ref={ref as Ref<HTMLDivElement>}\n >\n <StyledIcon viewBox={iconDef.viewBox}>\n <iconDef.Component />\n </StyledIcon>\n </StyledIconShape>\n ) : (\n <StyledIcon\n role='presentation'\n {...restProps}\n viewBox={iconDef.viewBox}\n size={size}\n ref={ref as Ref<SVGSVGElement>}\n >\n <iconDef.Component />\n </StyledIcon>\n );\n}) as ForwardRefExoticComponent<IconProps>;\n\nexport default Icon;\n"]}
|
|
1
|
+
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAsD/C,MAAM,YAAY,GAAG,IAAI,GAAG,CAAsC,EAAE,CAAC,CAAC;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,KAAK,QAAQ,CAAC,CAAC,CAAC,CAChD,KAAC,eAAe,OACV,SAAS,EACb,UAAU,EAAE,SAAS,CAAC,UAAU,EAChC,UAAU,EAAE,SAAS,CAAC,UAAU,EAChC,KAAK,EAAE,SAAS,CAAC,KAAK,EACtB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAA0B,YAE/B,KAAC,UAAU,IACT,IAAI,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,gBAC1C,SAAS,EACrB,OAAO,EAAE,OAAO,CAAC,OAAO,YAExB,KAAC,OAAO,CAAC,SAAS,KAAG,GACV,GACG,CACnB,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,OACL,SAAS,EACb,IAAI,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,gBAC1C,SAAS,EACrB,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAyB,YAE9B,KAAC,OAAO,CAAC,SAAS,KAAG,GACV,CACd,CAAC;AACJ,CAAC,CAAyC,CAAC;AAE3C,eAAe,IAAI,CAAC","sourcesContent":["import { forwardRef, useState, useEffect } from 'react';\nimport type { Ref, PropsWithoutRef, ComponentType, ForwardRefExoticComponent } from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport { useTheme } from '../../hooks';\nimport type { NoChildrenProp, RefElement, WithAttributes } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\ntype BaseIconProps = NoChildrenProp & {\n /**\n * The name of the icon set.\n * @default theme.base['icon-set']\n */\n set?: string;\n /** The name indicating the Cosmos Icon. Reference the catalog above for the available names. */\n name: string;\n /**\n * Background & svg size.\n * @default \"s\" without background, \"m\" with background.\n */\n size?: 's' | 'm' | 'l' | 'font-size';\n};\n\nexport type IconProps =\n | WithAttributes<\n 'div',\n BaseIconProps & {\n /** Background color. */\n background: string;\n /**\n * Foreground color (svg fill).\n * Applies readable color off background if undefined.\n */\n foreground?: string;\n /**\n * Shape of the background.\n * @default 'square'\n */\n shape?: 'square' | 'circle';\n }\n >\n | WithAttributes<\n 'svg',\n BaseIconProps & {\n background?: never;\n foreground?: never;\n shape?: never;\n }\n >;\n\nexport interface IconDefinition {\n Component: ComponentType;\n viewBox?: string;\n}\n\nexport interface IconModule extends IconDefinition {\n set?: IconProps['set'];\n name: IconProps['name'];\n}\n\nconst iconRegistry = new Map<string, Map<string, IconDefinition>>([]);\n\nexport const registerIcon = (...icons: IconModule[]) => {\n icons.forEach(({ set: modSet, name, ...iconDef }) => {\n const set = modSet ?? 'budicon';\n\n if (!iconRegistry.has(set)) {\n iconRegistry.set(set, new Map([[name, iconDef]]));\n } else if (!iconRegistry.get(set)!.has(name)) {\n iconRegistry.get(set)!.set(name, iconDef);\n }\n });\n};\n\nexport const forceRegisterIcon = (...icons: IconModule[]) => {\n icons.forEach(({ set: modSet, name, ...iconDef }) => {\n const set = modSet ?? 'budicon';\n\n if (!iconRegistry.has(set)) {\n iconRegistry.set(set, new Map([[name, iconDef]]));\n } else {\n iconRegistry.get(set)!.set(name, iconDef);\n }\n });\n};\n\nexport const StyledIcon = styled.svg<{ size?: IconProps['size'] }>(({ theme, size = 's' }) => {\n const {\n components: {\n icon: {\n size: { s, m, l }\n }\n }\n } = theme;\n return css`\n display: inline-block;\n fill: currentColor;\n vertical-align: middle;\n flex-shrink: 0;\n /* stylelint-disable unit-allowed-list */\n min-width: 14px;\n min-height: 14px;\n /* stylelint-enable unit-allowed-list */\n\n ${size === 's' &&\n css`\n width: ${s};\n height: ${s};\n `}\n\n ${size === 'm' &&\n css`\n width: ${m};\n height: ${m};\n `}\n\n ${size === 'l' &&\n css`\n width: ${l};\n height: ${l};\n `}\n\n ${size === 'font-size' &&\n css`\n width: 1em;\n height: 1em;\n `}\n `;\n});\n\nStyledIcon.defaultProps = defaultThemeProp;\n\nexport const StyledIconShape = styled.div<{\n background: NonNullable<IconProps['background']>;\n foreground?: IconProps['foreground'];\n size?: IconProps['size'];\n shape?: IconProps['shape'];\n}>(({ theme, background, foreground, size = 'm', shape = 'square' }) => {\n const readableFg = readableColor(background);\n\n const {\n base: { 'border-radius': baseRadius },\n components: {\n icon: {\n size: { s, m, l },\n 'border-radius-multiplier': borderRadiusMultiplier\n }\n }\n } = theme;\n\n return css`\n color: ${foreground ?? readableFg};\n background-color: ${background};\n display: flex;\n justify-content: center;\n align-items: center;\n\n ${size === 's' &&\n css`\n width: ${s};\n height: ${s};\n `}\n\n ${size === 'm' &&\n css`\n width: ${m};\n height: ${m};\n `}\n\n ${size === 'l' &&\n css`\n width: ${l};\n height: ${l};\n `}\n\n ${size === 'font-size' &&\n css`\n width: 1em;\n height: 1em;\n `}\n\n ${shape === 'square' &&\n css`\n border-radius: calc(${borderRadiusMultiplier} * ${baseRadius});\n `}\n\n ${shape === 'circle' &&\n css`\n border-radius: 50%;\n `}\n\n ${StyledIcon} {\n width: 50%;\n height: 50%;\n /* stylelint-disable unit-allowed-list */\n min-width: min(14px, 90%);\n min-height: min(14px, 90%);\n /* stylelint-enable unit-allowed-list */\n }\n `;\n});\n\nStyledIconShape.defaultProps = defaultThemeProp;\n\nconst emptyIconDefinition: Readonly<IconDefinition> = Object.freeze({ Component: () => null });\n\nconst Icon = forwardRef<RefElement<IconProps>, PropsWithoutRef<IconProps>>(function Icon(\n { set: setProp, name, size, 'aria-label': ariaLabel, ...restProps }: PropsWithoutRef<IconProps>,\n ref\n) {\n const {\n base: { 'icon-set': setTheme }\n } = useTheme();\n\n const set = setProp ?? setTheme ?? 'budicon';\n\n const [iconDef, setIconDef] = useState(iconRegistry.get(set)?.get(name) ?? emptyIconDefinition);\n\n useEffect(() => {\n if (iconRegistry.get(set)?.has(name)) {\n setIconDef(iconRegistry.get(set)!.get(name)!);\n return;\n }\n\n const controller = new AbortController();\n\n (async () => {\n try {\n const encodedName = encodeURIComponent(name);\n let iconSet: string;\n let module: IconModule;\n\n switch (set) {\n case 'streamline':\n iconSet = 'streamline-icons';\n break;\n case 'budicon':\n iconSet = 'icons';\n break;\n default:\n throw new Error('Unknown icon');\n }\n\n // The following expression is required for Storybook Vite Builder\n try {\n module = await import(`./${iconSet}/${encodedName}.icon`);\n } catch {\n module = await import(`./${iconSet}/${encodedName}.icon.tsx`);\n }\n\n if (module.name !== name || !module.Component) throw new Error('Malformed icon definition');\n\n registerIcon(module);\n } catch {\n registerIcon({ set, name, ...emptyIconDefinition });\n }\n\n if (!controller.signal.aborted) {\n setIconDef(iconRegistry.get(set)!.get(name) ?? emptyIconDefinition);\n }\n })();\n\n return () => controller.abort();\n }, [name, set]);\n\n return typeof restProps.background === 'string' ? (\n <StyledIconShape\n {...restProps}\n background={restProps.background}\n foreground={restProps.foreground}\n shape={restProps.shape}\n size={size}\n ref={ref as Ref<HTMLDivElement>}\n >\n <StyledIcon\n role={ariaLabel !== undefined ? 'img' : 'presentation'}\n aria-label={ariaLabel}\n viewBox={iconDef.viewBox}\n >\n <iconDef.Component />\n </StyledIcon>\n </StyledIconShape>\n ) : (\n <StyledIcon\n {...restProps}\n role={ariaLabel !== undefined ? 'img' : 'presentation'}\n aria-label={ariaLabel}\n viewBox={iconDef.viewBox}\n size={size}\n ref={ref as Ref<SVGSVGElement>}\n >\n <iconDef.Component />\n </StyledIcon>\n );\n}) as ForwardRefExoticComponent<IconProps>;\n\nexport default Icon;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrow-micro-up-down.icon.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/streamline-icons/arrow-micro-up-down.icon.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,eAAe,CAAC;AAEhC,eAAO,MAAM,IAAI,wBAAwB,CAAC;AAE1C,eAAO,MAAM,SAAS,mBAQrB,CAAC;AAEF,eAAO,MAAM,OAAO,cAAc,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// This file is autogenerated. Any changes will be overwritten.
|
|
3
|
+
export const set = 'streamline';
|
|
4
|
+
export const name = 'arrow-micro-up-down';
|
|
5
|
+
export const Component = () => (_jsx("path", { fill: 'currentColor', stroke: 'currentColor', strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M6.415 7.47h5.17c.31 0 .517-.147.362-.265L9.362 4.58a.654.654 0 0 0-.62-.059c-.052.03-.104.03-.104.06L6.053 7.205c-.155.118.051.265.362.265zm5.17 3.06h-5.17c-.31 0-.517.147-.362.265l2.585 2.625a.654.654 0 0 0 .62.059c.052-.03.104-.03.104-.06l2.585-2.624c.155-.118-.051-.265-.362-.265z' }));
|
|
6
|
+
export const viewBox = '0 0 18 18';
|
|
7
|
+
//# sourceMappingURL=arrow-micro-up-down.icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrow-micro-up-down.icon.js","sourceRoot":"","sources":["../../../../src/components/Icon/streamline-icons/arrow-micro-up-down.icon.tsx"],"names":[],"mappings":";AAAA,+DAA+D;AAE/D,MAAM,CAAC,MAAM,GAAG,GAAG,YAAY,CAAC;AAEhC,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAC7B,eACE,IAAI,EAAC,cAAc,EACnB,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,CAAC,EAAC,8RAA8R,GAChS,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,WAAW,CAAC","sourcesContent":["// This file is autogenerated. Any changes will be overwritten.\n\nexport const set = 'streamline';\n\nexport const name = 'arrow-micro-up-down';\n\nexport const Component = () => (\n <path\n fill='currentColor'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n d='M6.415 7.47h5.17c.31 0 .517-.147.362-.265L9.362 4.58a.654.654 0 0 0-.62-.059c-.052.03-.104.03-.104.06L6.053 7.205c-.155.118.051.265.362.265zm5.17 3.06h-5.17c-.31 0-.517.147-.362.265l2.585 2.625a.654.654 0 0 0 .62.059c.052-.03.104-.03.104-.06l2.585-2.624c.155-.118-.051-.265-.362-.265z'\n />\n);\n\nexport const viewBox = '0 0 18 18';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const streamlineIconNames: readonly ["ai-assist", "alexa", "align-center", "align-left", "align-right", "amazon", "api", "app", "arrow-above-row-right", "arrow-bend-left", "arrow-down", "arrow-left-column", "arrow-left", "arrow-micro-down", "arrow-micro-left", "arrow-micro-right", "arrow-micro-up", "arrow-out", "arrow-right-column", "arrow-right", "arrow-up-down", "arrow-up", "bank", "bars", "bell-push-notification", "bell", "bluetooth", "book-open", "bookmark", "box-4", "box", "browser-code", "browser", "bug", "building-2", "building-3-solid", "building-3", "bulb", "calendar-empty", "calendar-range", "calendar", "car", "caret-down", "caret-left", "caret-right", "caret-up", "case-medical", "case-solid", "case", "chain", "chart-line", "chart-pie", "chat-check", "chat-exclamation-mark", "chat-help", "chat-quote", "chat-transfer", "chat-typing", "chat-unavailable", "chat", "chats", "check-badge", "check", "chevron-solid", "chevron", "circle-mixed-left", "circle", "clipboard-check", "clipboard-medical", "clipboard-pencil-solid", "clipboard-pencil", "clipboard-plus", "clipboard", "clock-solid", "clock", "cloud", "code-search", "code", "column-delete", "conversation", "copy", "credit", "csr-agent", "currency", "custom-column", "database-search", "dataviz-area-multi", "dataviz-area-stacked", "dataviz-area", "dataviz-bar-clustered", "dataviz-bar-stacked", "dataviz-bar", "dataviz-bell-curve", "dataviz-bubble", "dataviz-column-clustered", "dataviz-column-stacked", "dataviz-column", "dataviz-combo", "dataviz-datetime-field", "dataviz-donut", "dataviz-flip-counter", "dataviz-forecast", "dataviz-funnel", "dataviz-gauge-linear", "dataviz-gauge-progress", "dataviz-gauge", "dataviz-geo-choropleth", "dataviz-heatmap", "dataviz-histogram", "dataviz-line-horizontal", "dataviz-line-multi", "dataviz-line-stepped", "dataviz-line", "dataviz-numeric-field", "dataviz-pareto", "dataviz-pie", "dataviz-pivot-table", "dataviz-radar", "dataviz-scatter", "dataviz-spark", "dataviz-sparklines-area", "dataviz-sparklines-columns", "dataviz-sparklines-line", "dataviz-sparklines-pies", "dataviz-spline", "dataviz-string-field", "dataviz-table-with-bars", "dataviz-trend-down", "dataviz-trend-up", "dataviz-waterfall", "desktop", "diamond", "disc-stack-solid", "disc-stack", "doctor-female", "doctor-male", "document-pdf", "document", "docusign", "dot-9-solid", "download", "drag", "email-open", "exchange", "eye-off", "face-blank", "face-happy", "face-sad", "facebook", "farming-wheat", "fast-forward", "field-cursor", "filetype-text", "filter", "fingerprint-search", "flag-check", "flag-finish", "flag-wave-solid", "flag-wave", "flashlight", "flow-process", "folder-closed", "folder-empty", "folder-hierarchy", "folder-nested", "folder-search", "folder", "folders", "forward-all", "forward", "function", "gear-play", "gear-solid", "gear", "globe", "google", "government", "graduate", "hand-book-open", "hand-over-paper", "hand", "handshake", "header", "headset", "home-solid", "home", "house-bed", "house-person", "infinity", "information", "ios-face-id", "ios-finger-id", "layers", "letter", "linkedin", "list", "location-solid", "location", "mail-warning", "mail", "megaphone", "merge", "messages-to-chat", "mic-off", "mic", "minus", "mobile-phone", "module", "money-atm", "money", "monitor-lock", "more", "mountain-top", "multi-device", "navigation", "newspaper-fold", "newspaper", "nodes-down", "note-pin", "notepad", "number-decimal", "offer-list", "offer-table", "offer", "open-new-tab", "open", "opportunity-refresh", "opportunity", "os-apple", "paper-clip", "paper-search", "password-lock", "pause", "paypal", "pega", "pegasus", "pencil", "people-group-stakeholders", "percentage", "person-connection", "person-hierarchy-check", "person-stars", "person", "persons-group", "phone-call", "phone-dial", "phone-hangup", "phone-in", "phone-ivr", "phone-off", "phone-out", "phone-split", "phone-transfer", "phone", "phonebook", "picture", "play-solid", "play", "plug-solid", "plug", "plus", "polaris-solid", "polaris", "presentation", "product", "project-plan", "project", "qr", "receipt", "reply-all", "reply", "reset", "robot-happy", "robot-sad", "robot", "roof-people", "row-delete", "row-insert", "row", "rule-library-solid", "rule-library", "rule", "scale-down", "scale-up", "script", "search-analytics-solid", "search-analytics", "search", "send", "server", "set", "share", "shield-solid", "shield", "shipment-box", "shop", "shuffle", "sigma", "slideshow", "snow", "speaker", "split", "stakeholders", "star-mixed", "star-solid", "star", "sub-step", "table-bolt-solid", "table-bolt", "table", "tag", "target-path", "team", "thumbs-down-solid", "thumbs-down", "thumbs-up-solid", "thumbs-up", "times", "todo", "toolbox-open", "toolbox-wrench", "transform", "trash", "tribox", "twitter", "two-disk-stacks", "type-cursor", "umbrella", "user-check", "user-document", "user-information", "user-pencil", "user-solid", "user-star", "user-unavailable", "user", "variable", "voice", "wand", "warn-solid", "warn", "widget", "wifi", "youtube"];
|
|
1
|
+
declare const streamlineIconNames: readonly ["ai-assist", "alexa", "align-center", "align-left", "align-right", "amazon", "api", "app", "arrow-above-row-right", "arrow-bend-left", "arrow-down", "arrow-left-column", "arrow-left", "arrow-micro-down", "arrow-micro-left", "arrow-micro-right", "arrow-micro-up-down", "arrow-micro-up", "arrow-out", "arrow-right-column", "arrow-right", "arrow-up-down", "arrow-up", "bank", "bars", "bell-push-notification", "bell", "bluetooth", "book-open", "bookmark", "box-4", "box", "browser-code", "browser", "bug", "building-2", "building-3-solid", "building-3", "bulb", "calendar-empty", "calendar-range", "calendar", "car", "caret-down", "caret-left", "caret-right", "caret-up", "case-medical", "case-solid", "case", "chain", "chart-line", "chart-pie", "chat-check", "chat-exclamation-mark", "chat-help", "chat-quote", "chat-transfer", "chat-typing", "chat-unavailable", "chat", "chats", "check-badge", "check", "chevron-solid", "chevron", "circle-mixed-left", "circle", "clipboard-check", "clipboard-medical", "clipboard-pencil-solid", "clipboard-pencil", "clipboard-plus", "clipboard", "clock-solid", "clock", "cloud", "code-search", "code", "column-delete", "conversation", "copy", "credit", "csr-agent", "currency", "custom-column", "database-search", "dataviz-area-multi", "dataviz-area-stacked", "dataviz-area", "dataviz-bar-clustered", "dataviz-bar-stacked", "dataviz-bar", "dataviz-bell-curve", "dataviz-bubble", "dataviz-column-clustered", "dataviz-column-stacked", "dataviz-column", "dataviz-combo", "dataviz-datetime-field", "dataviz-donut", "dataviz-flip-counter", "dataviz-forecast", "dataviz-funnel", "dataviz-gauge-linear", "dataviz-gauge-progress", "dataviz-gauge", "dataviz-geo-choropleth", "dataviz-heatmap", "dataviz-histogram", "dataviz-line-horizontal", "dataviz-line-multi", "dataviz-line-stepped", "dataviz-line", "dataviz-numeric-field", "dataviz-pareto", "dataviz-pie", "dataviz-pivot-table", "dataviz-radar", "dataviz-scatter", "dataviz-spark", "dataviz-sparklines-area", "dataviz-sparklines-columns", "dataviz-sparklines-line", "dataviz-sparklines-pies", "dataviz-spline", "dataviz-string-field", "dataviz-table-with-bars", "dataviz-trend-down", "dataviz-trend-up", "dataviz-waterfall", "desktop", "diamond", "disc-stack-solid", "disc-stack", "doctor-female", "doctor-male", "document-pdf", "document", "docusign", "dot-9-solid", "download", "drag", "email-open", "exchange", "eye-off", "face-blank", "face-happy", "face-sad", "facebook", "farming-wheat", "fast-forward", "field-cursor", "filetype-text", "filter", "fingerprint-search", "flag-check", "flag-finish", "flag-wave-solid", "flag-wave", "flashlight", "flow-process", "folder-closed", "folder-empty", "folder-hierarchy", "folder-nested", "folder-search", "folder", "folders", "forward-all", "forward", "function", "gear-play", "gear-solid", "gear", "globe", "google", "government", "graduate", "hand-book-open", "hand-over-paper", "hand", "handshake", "header", "headset", "home-solid", "home", "house-bed", "house-person", "infinity", "information", "ios-face-id", "ios-finger-id", "layers", "letter", "linkedin", "list", "location-solid", "location", "mail-warning", "mail", "megaphone", "merge", "messages-to-chat", "mic-off", "mic", "minus", "mobile-phone", "module", "money-atm", "money", "monitor-lock", "more", "mountain-top", "multi-device", "navigation", "newspaper-fold", "newspaper", "nodes-down", "note-pin", "notepad", "number-decimal", "offer-list", "offer-table", "offer", "open-new-tab", "open", "opportunity-refresh", "opportunity", "os-apple", "paper-clip", "paper-search", "password-lock", "pause", "paypal", "pega", "pegasus", "pencil", "people-group-stakeholders", "percentage", "person-connection", "person-hierarchy-check", "person-stars", "person", "persons-group", "phone-call", "phone-dial", "phone-hangup", "phone-in", "phone-ivr", "phone-off", "phone-out", "phone-split", "phone-transfer", "phone", "phonebook", "picture", "play-solid", "play", "plug-solid", "plug", "plus", "polaris-solid", "polaris", "presentation", "product", "project-plan", "project", "qr", "receipt", "reply-all", "reply", "reset", "robot-happy", "robot-sad", "robot", "roof-people", "row-delete", "row-insert", "row", "rule-library-solid", "rule-library", "rule", "scale-down", "scale-up", "script", "search-analytics-solid", "search-analytics", "search", "send", "server", "set", "share", "shield-solid", "shield", "shipment-box", "shop", "shuffle", "sigma", "slideshow", "snow", "speaker", "split", "stakeholders", "star-mixed", "star-solid", "star", "sub-step", "table-bolt-solid", "table-bolt", "table", "tag", "target-path", "team", "thumbs-down-solid", "thumbs-down", "thumbs-up-solid", "thumbs-up", "times", "todo", "toolbox-open", "toolbox-wrench", "transform", "trash", "tribox", "twitter", "two-disk-stacks", "type-cursor", "umbrella", "user-check", "user-document", "user-information", "user-pencil", "user-solid", "user-star", "user-unavailable", "user", "variable", "voice", "wand", "warn-solid", "warn", "widget", "wifi", "youtube"];
|
|
2
2
|
export default streamlineIconNames;
|
|
3
3
|
export type StreamlineIconName = (typeof streamlineIconNames)[number];
|
|
4
4
|
//# sourceMappingURL=streamlineIconNames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamlineIconNames.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/streamlineIconNames.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"streamlineIconNames.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/streamlineIconNames.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,mBAAmB,66JA0Vf,CAAC;AAEX,eAAe,mBAAmB,CAAC;AAEnC,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamlineIconNames.js","sourceRoot":"","sources":["../../../src/components/Icon/streamlineIconNames.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAE/D,MAAM,mBAAmB,GAAG;IAC1B,WAAW;IACX,OAAO;IACP,cAAc;IACd,YAAY;IACZ,aAAa;IACb,QAAQ;IACR,KAAK;IACL,KAAK;IACL,uBAAuB;IACvB,iBAAiB;IACjB,YAAY;IACZ,mBAAmB;IACnB,YAAY;IACZ,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,WAAW;IACX,oBAAoB;IACpB,aAAa;IACb,eAAe;IACf,UAAU;IACV,MAAM;IACN,MAAM;IACN,wBAAwB;IACxB,MAAM;IACN,WAAW;IACX,WAAW;IACX,UAAU;IACV,OAAO;IACP,KAAK;IACL,cAAc;IACd,SAAS;IACT,KAAK;IACL,YAAY;IACZ,kBAAkB;IAClB,YAAY;IACZ,MAAM;IACN,gBAAgB;IAChB,gBAAgB;IAChB,UAAU;IACV,KAAK;IACL,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,UAAU;IACV,cAAc;IACd,YAAY;IACZ,MAAM;IACN,OAAO;IACP,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,uBAAuB;IACvB,WAAW;IACX,YAAY;IACZ,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,MAAM;IACN,OAAO;IACP,aAAa;IACb,OAAO;IACP,eAAe;IACf,SAAS;IACT,mBAAmB;IACnB,QAAQ;IACR,iBAAiB;IACjB,mBAAmB;IACnB,wBAAwB;IACxB,kBAAkB;IAClB,gBAAgB;IAChB,WAAW;IACX,aAAa;IACb,OAAO;IACP,OAAO;IACP,aAAa;IACb,MAAM;IACN,eAAe;IACf,cAAc;IACd,MAAM;IACN,QAAQ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QAAQ;IACR,MAAM;IACN,QAAQ;IACR,KAAK;IACL,OAAO;IACP,cAAc;IACd,QAAQ;IACR,cAAc;IACd,MAAM;IACN,SAAS;IACT,OAAO;IACP,WAAW;IACX,MAAM;IACN,SAAS;IACT,OAAO;IACP,cAAc;IACd,YAAY;IACZ,YAAY;IACZ,MAAM;IACN,UAAU;IACV,kBAAkB;IAClB,YAAY;IACZ,OAAO;IACP,KAAK;IACL,aAAa;IACb,MAAM;IACN,mBAAmB;IACnB,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,OAAO;IACP,MAAM;IACN,cAAc;IACd,gBAAgB;IAChB,WAAW;IACX,OAAO;IACP,QAAQ;IACR,SAAS;IACT,iBAAiB;IACjB,aAAa;IACb,UAAU;IACV,YAAY;IACZ,eAAe;IACf,kBAAkB;IAClB,aAAa;IACb,YAAY;IACZ,WAAW;IACX,kBAAkB;IAClB,MAAM;IACN,UAAU;IACV,OAAO;IACP,MAAM;IACN,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,MAAM;IACN,SAAS;CACD,CAAC;AAEX,eAAe,mBAAmB,CAAC","sourcesContent":["// This file is autogenerated. Any changes will be overwritten.\n\nconst streamlineIconNames = [\n 'ai-assist',\n 'alexa',\n 'align-center',\n 'align-left',\n 'align-right',\n 'amazon',\n 'api',\n 'app',\n 'arrow-above-row-right',\n 'arrow-bend-left',\n 'arrow-down',\n 'arrow-left-column',\n 'arrow-left',\n 'arrow-micro-down',\n 'arrow-micro-left',\n 'arrow-micro-right',\n 'arrow-micro-up',\n 'arrow-out',\n 'arrow-right-column',\n 'arrow-right',\n 'arrow-up-down',\n 'arrow-up',\n 'bank',\n 'bars',\n 'bell-push-notification',\n 'bell',\n 'bluetooth',\n 'book-open',\n 'bookmark',\n 'box-4',\n 'box',\n 'browser-code',\n 'browser',\n 'bug',\n 'building-2',\n 'building-3-solid',\n 'building-3',\n 'bulb',\n 'calendar-empty',\n 'calendar-range',\n 'calendar',\n 'car',\n 'caret-down',\n 'caret-left',\n 'caret-right',\n 'caret-up',\n 'case-medical',\n 'case-solid',\n 'case',\n 'chain',\n 'chart-line',\n 'chart-pie',\n 'chat-check',\n 'chat-exclamation-mark',\n 'chat-help',\n 'chat-quote',\n 'chat-transfer',\n 'chat-typing',\n 'chat-unavailable',\n 'chat',\n 'chats',\n 'check-badge',\n 'check',\n 'chevron-solid',\n 'chevron',\n 'circle-mixed-left',\n 'circle',\n 'clipboard-check',\n 'clipboard-medical',\n 'clipboard-pencil-solid',\n 'clipboard-pencil',\n 'clipboard-plus',\n 'clipboard',\n 'clock-solid',\n 'clock',\n 'cloud',\n 'code-search',\n 'code',\n 'column-delete',\n 'conversation',\n 'copy',\n 'credit',\n 'csr-agent',\n 'currency',\n 'custom-column',\n 'database-search',\n 'dataviz-area-multi',\n 'dataviz-area-stacked',\n 'dataviz-area',\n 'dataviz-bar-clustered',\n 'dataviz-bar-stacked',\n 'dataviz-bar',\n 'dataviz-bell-curve',\n 'dataviz-bubble',\n 'dataviz-column-clustered',\n 'dataviz-column-stacked',\n 'dataviz-column',\n 'dataviz-combo',\n 'dataviz-datetime-field',\n 'dataviz-donut',\n 'dataviz-flip-counter',\n 'dataviz-forecast',\n 'dataviz-funnel',\n 'dataviz-gauge-linear',\n 'dataviz-gauge-progress',\n 'dataviz-gauge',\n 'dataviz-geo-choropleth',\n 'dataviz-heatmap',\n 'dataviz-histogram',\n 'dataviz-line-horizontal',\n 'dataviz-line-multi',\n 'dataviz-line-stepped',\n 'dataviz-line',\n 'dataviz-numeric-field',\n 'dataviz-pareto',\n 'dataviz-pie',\n 'dataviz-pivot-table',\n 'dataviz-radar',\n 'dataviz-scatter',\n 'dataviz-spark',\n 'dataviz-sparklines-area',\n 'dataviz-sparklines-columns',\n 'dataviz-sparklines-line',\n 'dataviz-sparklines-pies',\n 'dataviz-spline',\n 'dataviz-string-field',\n 'dataviz-table-with-bars',\n 'dataviz-trend-down',\n 'dataviz-trend-up',\n 'dataviz-waterfall',\n 'desktop',\n 'diamond',\n 'disc-stack-solid',\n 'disc-stack',\n 'doctor-female',\n 'doctor-male',\n 'document-pdf',\n 'document',\n 'docusign',\n 'dot-9-solid',\n 'download',\n 'drag',\n 'email-open',\n 'exchange',\n 'eye-off',\n 'face-blank',\n 'face-happy',\n 'face-sad',\n 'facebook',\n 'farming-wheat',\n 'fast-forward',\n 'field-cursor',\n 'filetype-text',\n 'filter',\n 'fingerprint-search',\n 'flag-check',\n 'flag-finish',\n 'flag-wave-solid',\n 'flag-wave',\n 'flashlight',\n 'flow-process',\n 'folder-closed',\n 'folder-empty',\n 'folder-hierarchy',\n 'folder-nested',\n 'folder-search',\n 'folder',\n 'folders',\n 'forward-all',\n 'forward',\n 'function',\n 'gear-play',\n 'gear-solid',\n 'gear',\n 'globe',\n 'google',\n 'government',\n 'graduate',\n 'hand-book-open',\n 'hand-over-paper',\n 'hand',\n 'handshake',\n 'header',\n 'headset',\n 'home-solid',\n 'home',\n 'house-bed',\n 'house-person',\n 'infinity',\n 'information',\n 'ios-face-id',\n 'ios-finger-id',\n 'layers',\n 'letter',\n 'linkedin',\n 'list',\n 'location-solid',\n 'location',\n 'mail-warning',\n 'mail',\n 'megaphone',\n 'merge',\n 'messages-to-chat',\n 'mic-off',\n 'mic',\n 'minus',\n 'mobile-phone',\n 'module',\n 'money-atm',\n 'money',\n 'monitor-lock',\n 'more',\n 'mountain-top',\n 'multi-device',\n 'navigation',\n 'newspaper-fold',\n 'newspaper',\n 'nodes-down',\n 'note-pin',\n 'notepad',\n 'number-decimal',\n 'offer-list',\n 'offer-table',\n 'offer',\n 'open-new-tab',\n 'open',\n 'opportunity-refresh',\n 'opportunity',\n 'os-apple',\n 'paper-clip',\n 'paper-search',\n 'password-lock',\n 'pause',\n 'paypal',\n 'pega',\n 'pegasus',\n 'pencil',\n 'people-group-stakeholders',\n 'percentage',\n 'person-connection',\n 'person-hierarchy-check',\n 'person-stars',\n 'person',\n 'persons-group',\n 'phone-call',\n 'phone-dial',\n 'phone-hangup',\n 'phone-in',\n 'phone-ivr',\n 'phone-off',\n 'phone-out',\n 'phone-split',\n 'phone-transfer',\n 'phone',\n 'phonebook',\n 'picture',\n 'play-solid',\n 'play',\n 'plug-solid',\n 'plug',\n 'plus',\n 'polaris-solid',\n 'polaris',\n 'presentation',\n 'product',\n 'project-plan',\n 'project',\n 'qr',\n 'receipt',\n 'reply-all',\n 'reply',\n 'reset',\n 'robot-happy',\n 'robot-sad',\n 'robot',\n 'roof-people',\n 'row-delete',\n 'row-insert',\n 'row',\n 'rule-library-solid',\n 'rule-library',\n 'rule',\n 'scale-down',\n 'scale-up',\n 'script',\n 'search-analytics-solid',\n 'search-analytics',\n 'search',\n 'send',\n 'server',\n 'set',\n 'share',\n 'shield-solid',\n 'shield',\n 'shipment-box',\n 'shop',\n 'shuffle',\n 'sigma',\n 'slideshow',\n 'snow',\n 'speaker',\n 'split',\n 'stakeholders',\n 'star-mixed',\n 'star-solid',\n 'star',\n 'sub-step',\n 'table-bolt-solid',\n 'table-bolt',\n 'table',\n 'tag',\n 'target-path',\n 'team',\n 'thumbs-down-solid',\n 'thumbs-down',\n 'thumbs-up-solid',\n 'thumbs-up',\n 'times',\n 'todo',\n 'toolbox-open',\n 'toolbox-wrench',\n 'transform',\n 'trash',\n 'tribox',\n 'twitter',\n 'two-disk-stacks',\n 'type-cursor',\n 'umbrella',\n 'user-check',\n 'user-document',\n 'user-information',\n 'user-pencil',\n 'user-solid',\n 'user-star',\n 'user-unavailable',\n 'user',\n 'variable',\n 'voice',\n 'wand',\n 'warn-solid',\n 'warn',\n 'widget',\n 'wifi',\n 'youtube'\n] as const;\n\nexport default streamlineIconNames;\n\nexport type StreamlineIconName = (typeof streamlineIconNames)[number];\n"]}
|
|
1
|
+
{"version":3,"file":"streamlineIconNames.js","sourceRoot":"","sources":["../../../src/components/Icon/streamlineIconNames.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAE/D,MAAM,mBAAmB,GAAG;IAC1B,WAAW;IACX,OAAO;IACP,cAA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AAa;IACb,MAAM;IACN,mBAAmB;IACnB,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,OAAO;IACP,MAAM;IACN,cAAc;IACd,gBAAgB;IAChB,WAAW;IACX,OAAO;IACP,QAAQ;IACR,SAAS;IACT,iBAAiB;IACjB,aAAa;IACb,UAAU;IACV,YAAY;IACZ,eAAe;IACf,kBAAkB;IAClB,aAAa;IACb,YAAY;IACZ,WAAW;IACX,kBAAkB;IAClB,MAAM;IACN,UAAU;IACV,OAAO;IACP,MAAM;IACN,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,MAAM;IACN,SAAS;CACD,CAAC;AAEX,eAAe,mBAAmB,CAAC","sourcesContent":["// This file is autogenerated. Any changes will be overwritten.\n\nconst streamlineIconNames = [\n 'ai-assist',\n 'alexa',\n 'align-center',\n 'align-left',\n 'align-right',\n 'amazon',\n 'api',\n 'app',\n 'arrow-above-row-right',\n 'arrow-bend-left',\n 'arrow-down',\n 'arrow-left-column',\n 'arrow-left',\n 'arrow-micro-down',\n 'arrow-micro-left',\n 'arrow-micro-right',\n 'arrow-micro-up-down',\n 'arrow-micro-up',\n 'arrow-out',\n 'arrow-right-column',\n 'arrow-right',\n 'arrow-up-down',\n 'arrow-up',\n 'bank',\n 'bars',\n 'bell-push-notification',\n 'bell',\n 'bluetooth',\n 'book-open',\n 'bookmark',\n 'box-4',\n 'box',\n 'browser-code',\n 'browser',\n 'bug',\n 'building-2',\n 'building-3-solid',\n 'building-3',\n 'bulb',\n 'calendar-empty',\n 'calendar-range',\n 'calendar',\n 'car',\n 'caret-down',\n 'caret-left',\n 'caret-right',\n 'caret-up',\n 'case-medical',\n 'case-solid',\n 'case',\n 'chain',\n 'chart-line',\n 'chart-pie',\n 'chat-check',\n 'chat-exclamation-mark',\n 'chat-help',\n 'chat-quote',\n 'chat-transfer',\n 'chat-typing',\n 'chat-unavailable',\n 'chat',\n 'chats',\n 'check-badge',\n 'check',\n 'chevron-solid',\n 'chevron',\n 'circle-mixed-left',\n 'circle',\n 'clipboard-check',\n 'clipboard-medical',\n 'clipboard-pencil-solid',\n 'clipboard-pencil',\n 'clipboard-plus',\n 'clipboard',\n 'clock-solid',\n 'clock',\n 'cloud',\n 'code-search',\n 'code',\n 'column-delete',\n 'conversation',\n 'copy',\n 'credit',\n 'csr-agent',\n 'currency',\n 'custom-column',\n 'database-search',\n 'dataviz-area-multi',\n 'dataviz-area-stacked',\n 'dataviz-area',\n 'dataviz-bar-clustered',\n 'dataviz-bar-stacked',\n 'dataviz-bar',\n 'dataviz-bell-curve',\n 'dataviz-bubble',\n 'dataviz-column-clustered',\n 'dataviz-column-stacked',\n 'dataviz-column',\n 'dataviz-combo',\n 'dataviz-datetime-field',\n 'dataviz-donut',\n 'dataviz-flip-counter',\n 'dataviz-forecast',\n 'dataviz-funnel',\n 'dataviz-gauge-linear',\n 'dataviz-gauge-progress',\n 'dataviz-gauge',\n 'dataviz-geo-choropleth',\n 'dataviz-heatmap',\n 'dataviz-histogram',\n 'dataviz-line-horizontal',\n 'dataviz-line-multi',\n 'dataviz-line-stepped',\n 'dataviz-line',\n 'dataviz-numeric-field',\n 'dataviz-pareto',\n 'dataviz-pie',\n 'dataviz-pivot-table',\n 'dataviz-radar',\n 'dataviz-scatter',\n 'dataviz-spark',\n 'dataviz-sparklines-area',\n 'dataviz-sparklines-columns',\n 'dataviz-sparklines-line',\n 'dataviz-sparklines-pies',\n 'dataviz-spline',\n 'dataviz-string-field',\n 'dataviz-table-with-bars',\n 'dataviz-trend-down',\n 'dataviz-trend-up',\n 'dataviz-waterfall',\n 'desktop',\n 'diamond',\n 'disc-stack-solid',\n 'disc-stack',\n 'doctor-female',\n 'doctor-male',\n 'document-pdf',\n 'document',\n 'docusign',\n 'dot-9-solid',\n 'download',\n 'drag',\n 'email-open',\n 'exchange',\n 'eye-off',\n 'face-blank',\n 'face-happy',\n 'face-sad',\n 'facebook',\n 'farming-wheat',\n 'fast-forward',\n 'field-cursor',\n 'filetype-text',\n 'filter',\n 'fingerprint-search',\n 'flag-check',\n 'flag-finish',\n 'flag-wave-solid',\n 'flag-wave',\n 'flashlight',\n 'flow-process',\n 'folder-closed',\n 'folder-empty',\n 'folder-hierarchy',\n 'folder-nested',\n 'folder-search',\n 'folder',\n 'folders',\n 'forward-all',\n 'forward',\n 'function',\n 'gear-play',\n 'gear-solid',\n 'gear',\n 'globe',\n 'google',\n 'government',\n 'graduate',\n 'hand-book-open',\n 'hand-over-paper',\n 'hand',\n 'handshake',\n 'header',\n 'headset',\n 'home-solid',\n 'home',\n 'house-bed',\n 'house-person',\n 'infinity',\n 'information',\n 'ios-face-id',\n 'ios-finger-id',\n 'layers',\n 'letter',\n 'linkedin',\n 'list',\n 'location-solid',\n 'location',\n 'mail-warning',\n 'mail',\n 'megaphone',\n 'merge',\n 'messages-to-chat',\n 'mic-off',\n 'mic',\n 'minus',\n 'mobile-phone',\n 'module',\n 'money-atm',\n 'money',\n 'monitor-lock',\n 'more',\n 'mountain-top',\n 'multi-device',\n 'navigation',\n 'newspaper-fold',\n 'newspaper',\n 'nodes-down',\n 'note-pin',\n 'notepad',\n 'number-decimal',\n 'offer-list',\n 'offer-table',\n 'offer',\n 'open-new-tab',\n 'open',\n 'opportunity-refresh',\n 'opportunity',\n 'os-apple',\n 'paper-clip',\n 'paper-search',\n 'password-lock',\n 'pause',\n 'paypal',\n 'pega',\n 'pegasus',\n 'pencil',\n 'people-group-stakeholders',\n 'percentage',\n 'person-connection',\n 'person-hierarchy-check',\n 'person-stars',\n 'person',\n 'persons-group',\n 'phone-call',\n 'phone-dial',\n 'phone-hangup',\n 'phone-in',\n 'phone-ivr',\n 'phone-off',\n 'phone-out',\n 'phone-split',\n 'phone-transfer',\n 'phone',\n 'phonebook',\n 'picture',\n 'play-solid',\n 'play',\n 'plug-solid',\n 'plug',\n 'plus',\n 'polaris-solid',\n 'polaris',\n 'presentation',\n 'product',\n 'project-plan',\n 'project',\n 'qr',\n 'receipt',\n 'reply-all',\n 'reply',\n 'reset',\n 'robot-happy',\n 'robot-sad',\n 'robot',\n 'roof-people',\n 'row-delete',\n 'row-insert',\n 'row',\n 'rule-library-solid',\n 'rule-library',\n 'rule',\n 'scale-down',\n 'scale-up',\n 'script',\n 'search-analytics-solid',\n 'search-analytics',\n 'search',\n 'send',\n 'server',\n 'set',\n 'share',\n 'shield-solid',\n 'shield',\n 'shipment-box',\n 'shop',\n 'shuffle',\n 'sigma',\n 'slideshow',\n 'snow',\n 'speaker',\n 'split',\n 'stakeholders',\n 'star-mixed',\n 'star-solid',\n 'star',\n 'sub-step',\n 'table-bolt-solid',\n 'table-bolt',\n 'table',\n 'tag',\n 'target-path',\n 'team',\n 'thumbs-down-solid',\n 'thumbs-down',\n 'thumbs-up-solid',\n 'thumbs-up',\n 'times',\n 'todo',\n 'toolbox-open',\n 'toolbox-wrench',\n 'transform',\n 'trash',\n 'tribox',\n 'twitter',\n 'two-disk-stacks',\n 'type-cursor',\n 'umbrella',\n 'user-check',\n 'user-document',\n 'user-information',\n 'user-pencil',\n 'user-solid',\n 'user-star',\n 'user-unavailable',\n 'user',\n 'variable',\n 'voice',\n 'wand',\n 'warn-solid',\n 'warn',\n 'widget',\n 'wifi',\n 'youtube'\n] as const;\n\nexport default streamlineIconNames;\n\nexport type StreamlineIconName = (typeof streamlineIconNames)[number];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.styles.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,kBAAkB,qMAE9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,0KAAiB,CAAC;AAElD,eAAO,MAAM,cAAc;kBACX,OAAO;WACd,SAAS,CAAC,MAAM,CAAC;;;SAoHzB,CAAC;AAIF,eAAO,MAAM,eAAe,yGAW3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,uGAElC,CAAC;AAEF,eAAO,MAAM,eAAe,wGAM1B,CAAC;AAIH,eAAO,MAAM,mBAAmB,wGAM9B,CAAC;AAIH,eAAO,MAAM,qBAAqB,yGAUhC,CAAC;AAIH,eAAO,MAAM,oBAAoB,4GA6C/B,CAAC;AAIH,eAAO,MAAM,cAAc,wGAiB1B,CAAC;AAIF,eAAO,MAAM,uBAAuB,8GAMlC,CAAC;AAIH,eAAO,MAAM,6BAA6B,8GAEzC,CAAC;AAEF,eAAO,MAAM,iBAAiB,wGAI7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,yGAoBjC,CAAC;AAIF,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"Menu.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.styles.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,kBAAkB,qMAE9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,0KAAiB,CAAC;AAElD,eAAO,MAAM,cAAc;kBACX,OAAO;WACd,SAAS,CAAC,MAAM,CAAC;;;SAoHzB,CAAC;AAIF,eAAO,MAAM,eAAe,yGAW3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,uGAElC,CAAC;AAEF,eAAO,MAAM,eAAe,wGAM1B,CAAC;AAIH,eAAO,MAAM,mBAAmB,wGAM9B,CAAC;AAIH,eAAO,MAAM,qBAAqB,yGAUhC,CAAC;AAIH,eAAO,MAAM,oBAAoB,4GA6C/B,CAAC;AAIH,eAAO,MAAM,cAAc,wGAiB1B,CAAC;AAIF,eAAO,MAAM,uBAAuB,8GAMlC,CAAC;AAIH,eAAO,MAAM,6BAA6B,8GAEzC,CAAC;AAEF,eAAO,MAAM,iBAAiB,wGAI7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,yGAoBjC,CAAC;AAIF,eAAO,MAAM,UAAU,yGAmDrB,CAAC"}
|
|
@@ -248,7 +248,6 @@ export const StyledMenuListWrapper = styled.div(({ theme }) => css `
|
|
|
248
248
|
StyledMenuListWrapper.defaultProps = defaultThemeProp;
|
|
249
249
|
export const StyledMenu = styled.div(({ theme }) => {
|
|
250
250
|
const borderStyle = `0.0625rem solid ${theme.base.palette['border-line']}`;
|
|
251
|
-
const activeColor = tryCatch(() => mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive));
|
|
252
251
|
return css `
|
|
253
252
|
display: flex;
|
|
254
253
|
flex-direction: column;
|
|
@@ -274,7 +273,7 @@ export const StyledMenu = styled.div(({ theme }) => {
|
|
|
274
273
|
}
|
|
275
274
|
|
|
276
275
|
&[data-active-scope='true'] [data-current='true'] {
|
|
277
|
-
|
|
276
|
+
box-shadow: ${theme.base.shadow['focus-inset']};
|
|
278
277
|
}
|
|
279
278
|
|
|
280
279
|
${StyledVisuallyHiddenText}:first-child {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.styles.js","sourceRoot":"","sources":["../../../src/components/Menu/Menu.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,MAAM,MAAM,WAAW,CAAC;AAI/B,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,C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BAId,WAAW;;GAE5B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import { hideVisually, mix, readableColor, rgba } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { StyledEmptyState } from '../EmptyState';\nimport Icon, { StyledIcon } from '../Icon';\nimport { StyledGrid } from '../Grid';\nimport { tryCatch } from '../../utils';\nimport { StyledText } from '../Text';\nimport { StyledVisuallyHiddenText } from '../VisuallyHiddenText/VisuallyHiddenText';\nimport Button from '../Button';\n\nimport type { MenuProps } from './Menu.types';\n\nexport const StyledExpandButton = styled(Button)`\n align-self: center;\n`;\n\nexport const StyledCheckMarkIcon = styled(Icon)``;\n\nexport const StyledMenuItem = styled.li<{\n isParentItem: boolean;\n mode?: MenuProps['mode'];\n isChecked?: boolean;\n selectableParent?: boolean;\n}>(\n ({\n theme: { base, components },\n isParentItem,\n mode = 'action',\n 'aria-selected': isChecked = false,\n selectableParent = false\n }) => {\n const activeColor = tryCatch(() =>\n mix(0.85, base.palette['primary-background'], base.palette.interactive)\n );\n const hoverColor = tryCatch(() =>\n mix(0.95, base.palette['primary-background'], base.palette.interactive)\n );\n const hoverCheckColor = tryCatch(() =>\n rgba(\n components['radio-check'][':checked']['background-color'],\n base.transparency['transparent-5']\n )\n );\n\n const checkedBackground = components['radio-check'][':checked']['background-color'];\n const checkedForeground = tryCatch(() => readableColor(checkedBackground));\n\n return css`\n min-height: ${base['hit-area']['mouse-min']};\n padding: calc(0.5 * ${base.spacing}) ${base.spacing};\n cursor: pointer;\n\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n\n &:focus-within {\n background-color: ${activeColor};\n }\n\n &:hover {\n ${StyledCheckMarkIcon} {\n visibility: visible;\n ${mode === 'single-select' &&\n css`\n color: ${isChecked ? checkedBackground : hoverCheckColor};\n `}\n ${mode === 'multi-select' &&\n css`\n ${!isChecked &&\n css`\n border-color: ${components['form-control'][':hover']['border-color']};\n `}\n `}\n }\n }\n\n &:hover:not([aria-disabled='true']) {\n background-color: ${hoverColor};\n }\n\n a:first-of-type {\n display: block;\n width: 100%;\n text-decoration: none;\n color: inherit;\n }\n\n ${isParentItem &&\n !selectableParent &&\n (mode === 'multi-select' || mode === 'single-select') &&\n css`\n padding-inline-start: calc(1.125rem + 2 * ${base.spacing});\n `}\n\n ${StyledGrid} {\n flex-grow: 1;\n }\n\n ${StyledCheckMarkIcon} {\n margin-inline-start: 0;\n ${mode === 'single-select' &&\n css`\n ${isChecked\n ? css`\n color: ${checkedBackground};\n `\n : css`\n visibility: hidden;\n `}\n `}\n ${mode === 'multi-select' &&\n css`\n ${isChecked\n ? css`\n color: ${checkedForeground};\n background-color: ${checkedBackground};\n border: 0.0625rem solid ${components['radio-check'][':checked']['border-color']};\n `\n : css`\n color: transparent;\n border: 0.0625rem solid ${components['radio-check']['border-color']};\n `}\n border-radius: min(\n calc(${base['border-radius']} * ${components.checkbox['border-radius']}),\n 0.25rem\n );\n `}\n }\n\n &[aria-disabled='true'] {\n background-color: ${components['form-control'][':disabled']['background-color']};\n opacity: ${base['disabled-opacity']};\n }\n `;\n }\n);\n\nStyledMenuItem.defaultProps = defaultThemeProp;\n\nexport const StyledAncestors = styled.div`\n ${StyledIcon} {\n width: 1em;\n height: 1em;\n }\n\n & > ${StyledText} {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n`;\n\nexport const StyledVisibilityHidden = styled.p`\n ${hideVisually}\n`;\n\nexport const StyledSeparator = styled.li(({ theme }) => {\n return css`\n height: 0.0625rem;\n background-color: ${theme.base.palette['border-line']};\n margin: ${theme.base.spacing} 0;\n `;\n});\n\nStyledSeparator.defaultProps = defaultThemeProp;\n\nexport const StyledMenuGroupList = styled.ul(({ theme }) => {\n return css`\n ${StyledMenuItem} {\n padding-inline-start: calc(1.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledMenuGroupList.defaultProps = defaultThemeProp;\n\nexport const StyledMenuGroupHeader = styled.div(({ theme }) => {\n return css`\n min-height: ${theme.base['hit-area']['mouse-min']};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n background-color: ${theme.base.palette['secondary-background']};\n\n @media (pointer: coarse) {\n min-height: ${theme.base['hit-area']['finger-min']};\n }\n `;\n});\n\nStyledMenuGroupHeader.defaultProps = defaultThemeProp;\n\nexport const StyledMenuListHeader = styled.legend(({ theme: { base } }) => {\n const hoverColor = tryCatch(() =>\n mix(0.95, base.palette['primary-background'], base.palette.interactive)\n );\n const activeColor = tryCatch(() =>\n mix(0.85, base.palette['primary-background'], base.palette.interactive)\n );\n\n return css`\n cursor: pointer;\n width: 100%;\n background-color: ${base.palette['primary-background']};\n\n &:first-child {\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n }\n\n &:last-child {\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n }\n\n &:focus-within {\n box-shadow: ${base.shadow['focus-inset']};\n background-color: ${activeColor};\n }\n\n &:hover:not([aria-disabled='true']):not([data-current='true']) {\n background-color: ${hoverColor};\n }\n color: ${base.palette['foreground-color']};\n padding: calc(0.5 * ${base.spacing}) ${base.spacing};\n text-align: start;\n border-radius: inherit;\n\n > ${StyledGrid} {\n grid-column-gap: ${base.spacing};\n }\n\n ${StyledIcon} {\n /* Fixes vertical align issue increasing box size beyond square */\n display: block;\n }\n `;\n});\n\nStyledMenuListHeader.defaultProps = defaultThemeProp;\n\nexport const StyledMenuList = styled.ul(\n ({ theme }) => css`\n overflow-x: hidden;\n overflow-y: auto;\n list-style: none;\n height: 100%;\n border-radius: inherit;\n\n ${StyledEmptyState} {\n padding: ${theme.base.spacing};\n height: auto;\n }\n\n li:not(:first-child):not([role='presentation']) > ${StyledMenuGroupHeader} {\n margin-block-start: ${theme.base.spacing};\n }\n `\n);\n\nStyledMenuList.defaultProps = defaultThemeProp;\n\nexport const StyledMenuListContainer = styled.fieldset(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['primary-background']};\n border: 0;\n border-radius: inherit;\n `;\n});\n\nStyledMenuListContainer.defaultProps = defaultThemeProp;\n\nexport const StyledFlyoutMenuListContainer = styled(StyledMenuListContainer)`\n min-width: 10rem;\n`;\n\nexport const StyledLoadingItem = styled.li`\n display: block;\n position: relative;\n height: 2.8rem;\n`;\n\nexport const StyledMenuListWrapper = styled.div(\n ({ theme }) => css`\n position: relative;\n overflow: hidden;\n transition: height ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n\n & > fieldset:first-child {\n position: relative;\n }\n\n &:first-child {\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n }\n\n &:last-child {\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n }\n `\n);\n\nStyledMenuListWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledMenu = styled.div(({ theme }) => {\n const borderStyle = `0.0625rem solid ${theme.base.palette['border-line']}`;\n const activeColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n\n return css`\n display: flex;\n flex-direction: column;\n\n &,\n ${StyledMenuListWrapper} {\n max-height: inherit;\n }\n\n &:focus {\n box-shadow: ${theme.base.shadow.focus};\n outline: none;\n }\n\n &:first-child {\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n }\n\n &:last-child {\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n }\n\n &[data-active-scope='true'] [data-current='true'] {\n background-color: ${activeColor};\n }\n\n ${StyledVisuallyHiddenText}:first-child {\n + ${StyledMenuListWrapper}, + header {\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n }\n }\n\n > header,\n > footer {\n padding: ${theme.base.spacing};\n }\n\n > header {\n border-bottom: ${borderStyle};\n }\n\n > footer {\n border-top: ${borderStyle};\n }\n `;\n});\n\nStyledMenu.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"Menu.styles.js","sourceRoot":"","sources":["../../../src/components/Menu/Menu.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AgB,CAAC;AAEtD,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjD,MAAM,WAAW,GAAG,mBAAmB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;IAE3E,OAAO,GAAG,CAAA;;;;;MAKN,qBAAqB;;;;;oBAKP,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;oBAevB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;;;MAG9C,wBAAwB;UACpB,qBAAqB;;;;;;;;iBAQd,KAAK,CAAC,IAAI,CAAC,OAAO;;;;uBAIZ,WAAW;;;;oBAId,WAAW;;GAE5B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import { hideVisually, mix, readableColor, rgba } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { StyledEmptyState } from '../EmptyState';\nimport Icon, { StyledIcon } from '../Icon';\nimport { StyledGrid } from '../Grid';\nimport { tryCatch } from '../../utils';\nimport { StyledText } from '../Text';\nimport { StyledVisuallyHiddenText } from '../VisuallyHiddenText/VisuallyHiddenText';\nimport Button from '../Button';\n\nimport type { MenuProps } from './Menu.types';\n\nexport const StyledExpandButton = styled(Button)`\n align-self: center;\n`;\n\nexport const StyledCheckMarkIcon = styled(Icon)``;\n\nexport const StyledMenuItem = styled.li<{\n isParentItem: boolean;\n mode?: MenuProps['mode'];\n isChecked?: boolean;\n selectableParent?: boolean;\n}>(\n ({\n theme: { base, components },\n isParentItem,\n mode = 'action',\n 'aria-selected': isChecked = false,\n selectableParent = false\n }) => {\n const activeColor = tryCatch(() =>\n mix(0.85, base.palette['primary-background'], base.palette.interactive)\n );\n const hoverColor = tryCatch(() =>\n mix(0.95, base.palette['primary-background'], base.palette.interactive)\n );\n const hoverCheckColor = tryCatch(() =>\n rgba(\n components['radio-check'][':checked']['background-color'],\n base.transparency['transparent-5']\n )\n );\n\n const checkedBackground = components['radio-check'][':checked']['background-color'];\n const checkedForeground = tryCatch(() => readableColor(checkedBackground));\n\n return css`\n min-height: ${base['hit-area']['mouse-min']};\n padding: calc(0.5 * ${base.spacing}) ${base.spacing};\n cursor: pointer;\n\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n\n &:focus-within {\n background-color: ${activeColor};\n }\n\n &:hover {\n ${StyledCheckMarkIcon} {\n visibility: visible;\n ${mode === 'single-select' &&\n css`\n color: ${isChecked ? checkedBackground : hoverCheckColor};\n `}\n ${mode === 'multi-select' &&\n css`\n ${!isChecked &&\n css`\n border-color: ${components['form-control'][':hover']['border-color']};\n `}\n `}\n }\n }\n\n &:hover:not([aria-disabled='true']) {\n background-color: ${hoverColor};\n }\n\n a:first-of-type {\n display: block;\n width: 100%;\n text-decoration: none;\n color: inherit;\n }\n\n ${isParentItem &&\n !selectableParent &&\n (mode === 'multi-select' || mode === 'single-select') &&\n css`\n padding-inline-start: calc(1.125rem + 2 * ${base.spacing});\n `}\n\n ${StyledGrid} {\n flex-grow: 1;\n }\n\n ${StyledCheckMarkIcon} {\n margin-inline-start: 0;\n ${mode === 'single-select' &&\n css`\n ${isChecked\n ? css`\n color: ${checkedBackground};\n `\n : css`\n visibility: hidden;\n `}\n `}\n ${mode === 'multi-select' &&\n css`\n ${isChecked\n ? css`\n color: ${checkedForeground};\n background-color: ${checkedBackground};\n border: 0.0625rem solid ${components['radio-check'][':checked']['border-color']};\n `\n : css`\n color: transparent;\n border: 0.0625rem solid ${components['radio-check']['border-color']};\n `}\n border-radius: min(\n calc(${base['border-radius']} * ${components.checkbox['border-radius']}),\n 0.25rem\n );\n `}\n }\n\n &[aria-disabled='true'] {\n background-color: ${components['form-control'][':disabled']['background-color']};\n opacity: ${base['disabled-opacity']};\n }\n `;\n }\n);\n\nStyledMenuItem.defaultProps = defaultThemeProp;\n\nexport const StyledAncestors = styled.div`\n ${StyledIcon} {\n width: 1em;\n height: 1em;\n }\n\n & > ${StyledText} {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n`;\n\nexport const StyledVisibilityHidden = styled.p`\n ${hideVisually}\n`;\n\nexport const StyledSeparator = styled.li(({ theme }) => {\n return css`\n height: 0.0625rem;\n background-color: ${theme.base.palette['border-line']};\n margin: ${theme.base.spacing} 0;\n `;\n});\n\nStyledSeparator.defaultProps = defaultThemeProp;\n\nexport const StyledMenuGroupList = styled.ul(({ theme }) => {\n return css`\n ${StyledMenuItem} {\n padding-inline-start: calc(1.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledMenuGroupList.defaultProps = defaultThemeProp;\n\nexport const StyledMenuGroupHeader = styled.div(({ theme }) => {\n return css`\n min-height: ${theme.base['hit-area']['mouse-min']};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n background-color: ${theme.base.palette['secondary-background']};\n\n @media (pointer: coarse) {\n min-height: ${theme.base['hit-area']['finger-min']};\n }\n `;\n});\n\nStyledMenuGroupHeader.defaultProps = defaultThemeProp;\n\nexport const StyledMenuListHeader = styled.legend(({ theme: { base } }) => {\n const hoverColor = tryCatch(() =>\n mix(0.95, base.palette['primary-background'], base.palette.interactive)\n );\n const activeColor = tryCatch(() =>\n mix(0.85, base.palette['primary-background'], base.palette.interactive)\n );\n\n return css`\n cursor: pointer;\n width: 100%;\n background-color: ${base.palette['primary-background']};\n\n &:first-child {\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n }\n\n &:last-child {\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n }\n\n &:focus-within {\n box-shadow: ${base.shadow['focus-inset']};\n background-color: ${activeColor};\n }\n\n &:hover:not([aria-disabled='true']):not([data-current='true']) {\n background-color: ${hoverColor};\n }\n color: ${base.palette['foreground-color']};\n padding: calc(0.5 * ${base.spacing}) ${base.spacing};\n text-align: start;\n border-radius: inherit;\n\n > ${StyledGrid} {\n grid-column-gap: ${base.spacing};\n }\n\n ${StyledIcon} {\n /* Fixes vertical align issue increasing box size beyond square */\n display: block;\n }\n `;\n});\n\nStyledMenuListHeader.defaultProps = defaultThemeProp;\n\nexport const StyledMenuList = styled.ul(\n ({ theme }) => css`\n overflow-x: hidden;\n overflow-y: auto;\n list-style: none;\n height: 100%;\n border-radius: inherit;\n\n ${StyledEmptyState} {\n padding: ${theme.base.spacing};\n height: auto;\n }\n\n li:not(:first-child):not([role='presentation']) > ${StyledMenuGroupHeader} {\n margin-block-start: ${theme.base.spacing};\n }\n `\n);\n\nStyledMenuList.defaultProps = defaultThemeProp;\n\nexport const StyledMenuListContainer = styled.fieldset(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['primary-background']};\n border: 0;\n border-radius: inherit;\n `;\n});\n\nStyledMenuListContainer.defaultProps = defaultThemeProp;\n\nexport const StyledFlyoutMenuListContainer = styled(StyledMenuListContainer)`\n min-width: 10rem;\n`;\n\nexport const StyledLoadingItem = styled.li`\n display: block;\n position: relative;\n height: 2.8rem;\n`;\n\nexport const StyledMenuListWrapper = styled.div(\n ({ theme }) => css`\n position: relative;\n overflow: hidden;\n transition: height ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n\n & > fieldset:first-child {\n position: relative;\n }\n\n &:first-child {\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n }\n\n &:last-child {\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n }\n `\n);\n\nStyledMenuListWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledMenu = styled.div(({ theme }) => {\n const borderStyle = `0.0625rem solid ${theme.base.palette['border-line']}`;\n\n return css`\n display: flex;\n flex-direction: column;\n\n &,\n ${StyledMenuListWrapper} {\n max-height: inherit;\n }\n\n &:focus {\n box-shadow: ${theme.base.shadow.focus};\n outline: none;\n }\n\n &:first-child {\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n }\n\n &:last-child {\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n }\n\n &[data-active-scope='true'] [data-current='true'] {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${StyledVisuallyHiddenText}:first-child {\n + ${StyledMenuListWrapper}, + header {\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n }\n }\n\n > header,\n > footer {\n padding: ${theme.base.spacing};\n }\n\n > header {\n border-bottom: ${borderStyle};\n }\n\n > footer {\n border-top: ${borderStyle};\n }\n `;\n});\n\nStyledMenu.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -65,7 +65,7 @@ const MenuButton = forwardRef(function MenuButton(props, ref) {
|
|
|
65
65
|
}
|
|
66
66
|
}, buttonRef);
|
|
67
67
|
const { rtl } = useDirection();
|
|
68
|
-
return (_jsxs(_Fragment, { children: [_jsx(Button, { "data-testid": testIds.root, as: StyledMenuButton, "aria-label": text, ...restProps, id: id, ref: buttonRef, "aria-expanded": isOpen, "aria-haspopup": 'menu', "aria-controls": `${id}-popover
|
|
68
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { "data-testid": testIds.root, as: StyledMenuButton, "aria-label": text, ...restProps, id: id, ref: buttonRef, "aria-expanded": isOpen, "aria-haspopup": 'menu', "aria-controls": isOpen ? `${id}-popover` : undefined, label: iconOnly && !isOpen ? text : undefined, onClick: (e) => {
|
|
69
69
|
// e.detail is 0 when triggered by keyboard.
|
|
70
70
|
const mouseClick = e.detail > 0;
|
|
71
71
|
// Close the menu if it is open and either:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton.js","sourceRoot":"","sources":["../../../src/components/MenuButton/MenuButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAS1D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,C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,GAAG,EAAE,UAAU,EACnB,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,MAAM,EACtB,MAAM,EAAE,SAAS,CAAC,OAAO,EACzB,GAAG,EAAE,UAAU,YAEd,IAAI,IAAI,CACP,KAAC,IAAI,IACH,MAAM,EAAE,OAAO,CAAC,IAAI,KAChB,IAAI,EACR,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBACzB,IACE,IAAI,CAAC,IAAI,KAAK,cAAc;4BAC3B,CAAgF;iCAC9E,MAAM,GAAG,CAAC,EACb;4BACA,SAAS,CAAC,KAAK,CAAC,CAAC;yBAClB;wBACD,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;oBAChC,CAAC,EACD,cAAc,EAAE,SAAS,CAAC,OAAO,IAAI,SAAS,GAC9C,CACH,GACuB,IACzB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { forwardRef, useState, useCallback } from 'react';\nimport type {\n FunctionComponent,\n MouseEventHandler,\n MouseEvent,\n UIEvent,\n PropsWithoutRef,\n KeyboardEventHandler\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp, OmitStrict, TestIdProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport {\n useConsolidatedRef,\n useUID,\n useFocusWithin,\n useDirection,\n useTestIds,\n useEscape\n} from '../../hooks';\nimport Button, { StyledButton } from '../Button';\nimport type { ButtonProps } from '../Button';\nimport Popover, { StyledPopover } from '../Popover';\nimport type { PopoverProps } from '../Popover';\nimport Menu from '../Menu';\nimport type { AcceptedMouseEventElement, MenuProps } from '../Menu/Menu.types';\nimport Icon, { registerIcon, StyledIcon } from '../Icon';\nimport * as arrowMicroDownIcon from '../Icon/icons/arrow-micro-down.icon';\nimport Text, { StyledText } from '../Text';\nimport Flex from '../Flex';\nimport { Count } from '../Badges';\nimport type { CountProps } from '../Badges/Count';\nimport { withTestIds } from '../../utils';\n\nimport { getMenuButtonTestIds } from './MenuButton.test-ids';\n\nregisterIcon(arrowMicroDownIcon);\n\nexport interface MenuButtonProps extends BaseProps, NoChildrenProp, TestIdProp {\n /** The text for the MenuButton also used to set the aria-label. */\n text: string;\n /**\n * Determines the Button variant for the MenuButton.\n * @default 'secondary'\n */\n variant?: ButtonProps['variant'];\n /** The name of the icon for the MenuButton. */\n icon?: string;\n /** Only display the icon. The text prop will be forwarded to a tooltip. */\n iconOnly?: ButtonProps['icon'];\n /** The total count representing the list data which was selected. */\n count?: CountProps['children'];\n /** The click handler for the MenuButton. */\n onClick?: MouseEventHandler;\n /** Menu related props. */\n menu?: MenuProps;\n /** Popover related props. */\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n /** DOM id for the button element. */\n id?: string;\n /** Ref for the button element. */\n ref?: ButtonProps['ref'];\n /** The keydown handler for the MenuButton. */\n onKeyDown?: KeyboardEventHandler;\n}\n\nconst StyledMenuButton = styled.button(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n gap: ${spacing};\n flex-shrink: 0;\n white-space: nowrap;\n max-width: 100%;\n\n & + ${StyledPopover} + ${StyledButton} {\n margin-inline-start: ${spacing};\n }\n `;\n }\n);\n\nStyledMenuButton.defaultProps = defaultThemeProp;\n\nconst StyledMenuButtonChildren = styled.span(({ theme }) => {\n return css`\n max-width: 100%;\n\n ${StyledText} {\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n ${StyledIcon}:last-child:not(:first-child) {\n /* Offsets the flex gap to make the down arrow appear to trail the text. */\n margin-inline-start: -${theme.base.spacing};\n }\n `;\n});\n\nconst StyledMenuButtonPopover = styled(Popover)`\n min-width: 20ch;\n`;\n\nconst MenuButton: FunctionComponent<ForwardProps & MenuButtonProps> = forwardRef(\n function MenuButton(props: PropsWithoutRef<MenuButtonProps>, ref: MenuButtonProps['ref']) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n text,\n menu,\n popover,\n onClick,\n icon,\n count,\n iconOnly = false,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getMenuButtonTestIds);\n const [isOpen, setIsOpen] = useState(false);\n\n const buttonRef = useConsolidatedRef(ref);\n const popoverRef = useConsolidatedRef<HTMLDivElement>(popover?.ref);\n const menuRef = useConsolidatedRef<HTMLDivElement>(menu?.ref);\n\n // FIXME: Type assertion required for issue in useFocusWithin generic\n useFocusWithin<HTMLElement>(\n [popoverRef, buttonRef],\n useCallback(isFocused => {\n if (!isFocused) setIsOpen(false);\n }, [])\n );\n\n useEscape(e => {\n if (isOpen) {\n setIsOpen(false);\n e.stopPropagation();\n }\n }, buttonRef);\n\n const { rtl } = useDirection();\n\n return (\n <>\n <Button\n data-testid={testIds.root}\n as={StyledMenuButton}\n aria-label={text}\n {...restProps}\n id={id}\n ref={buttonRef}\n aria-expanded={isOpen}\n aria-haspopup='menu'\n aria-controls={`${id}-popover`}\n label={iconOnly && !isOpen ? text : undefined}\n onClick={(e: MouseEvent<HTMLButtonElement> & UIEvent<HTMLButtonElement>) => {\n // e.detail is 0 when triggered by keyboard.\n const mouseClick = e.detail > 0;\n\n // Close the menu if it is open and either:\n // It is a *mouse* click on the button.\n // Or, the menu mode is not multiselect.\n if (isOpen && (mouseClick || menu?.mode !== 'multi-select')) {\n setIsOpen(false);\n } else {\n setIsOpen(true);\n }\n\n // If the menu is closed or the user mouse clicks.\n // This avoids Enter key firing onClick when selecting a menu item.\n if (!isOpen || mouseClick) {\n onClick?.(e);\n }\n }}\n icon={iconOnly}\n >\n <Flex as={StyledMenuButtonChildren} container={{ alignItems: 'center', gap: 1 }}>\n {icon && <Icon name={icon} />}\n {!iconOnly && (\n <>\n {text && <Text>{text}</Text>}\n {typeof count === 'number' && <Count>{count}</Count>}\n {text && <Icon name='arrow-micro-down' />}\n </>\n )}\n </Flex>\n </Button>\n <StyledMenuButtonPopover\n placement={rtl ? 'bottom-end' : 'bottom-start'}\n hideOnTargetHidden\n {...popover}\n id={`${id}-popover`}\n show={!!menu && isOpen}\n target={buttonRef.current}\n ref={popoverRef}\n >\n {menu && (\n <Menu\n testId={testIds.root}\n {...menu}\n ref={menuRef}\n items={menu.items}\n onItemClick={(itemId, e) => {\n if (\n menu.mode !== 'multi-select' &&\n (e as MouseEvent<AcceptedMouseEventElement> & UIEvent<AcceptedMouseEventElement>)\n .detail > 0\n ) {\n setIsOpen(false);\n }\n menu.onItemClick?.(itemId, e);\n }}\n focusControlEl={buttonRef.current || undefined}\n />\n )}\n </StyledMenuButtonPopover>\n </>\n );\n }\n);\n\nexport default withTestIds(MenuButton, getMenuButtonTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"MenuButton.js","sourceRoot":"","sources":["../../../src/components/MenuButton/MenuButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAS1D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,cAAc,EACd,YAAY,EACZ,UAAU,EACV,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,kBAAkB,MAAM,qCAAqC,CAAC;AAC1E,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO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,SAAS,CAAC,KAAK,CAAC,CAAC;yBAClB;wBACD,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;oBAChC,CAAC,EACD,cAAc,EAAE,SAAS,CAAC,OAAO,IAAI,SAAS,GAC9C,CACH,GACuB,IACzB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { forwardRef, useState, useCallback } from 'react';\nimport type {\n FunctionComponent,\n MouseEventHandler,\n MouseEvent,\n UIEvent,\n PropsWithoutRef,\n KeyboardEventHandler\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp, OmitStrict, TestIdProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport {\n useConsolidatedRef,\n useUID,\n useFocusWithin,\n useDirection,\n useTestIds,\n useEscape\n} from '../../hooks';\nimport Button, { StyledButton } from '../Button';\nimport type { ButtonProps } from '../Button';\nimport Popover, { StyledPopover } from '../Popover';\nimport type { PopoverProps } from '../Popover';\nimport Menu from '../Menu';\nimport type { AcceptedMouseEventElement, MenuProps } from '../Menu/Menu.types';\nimport Icon, { registerIcon, StyledIcon } from '../Icon';\nimport * as arrowMicroDownIcon from '../Icon/icons/arrow-micro-down.icon';\nimport Text, { StyledText } from '../Text';\nimport Flex from '../Flex';\nimport { Count } from '../Badges';\nimport type { CountProps } from '../Badges/Count';\nimport { withTestIds } from '../../utils';\n\nimport { getMenuButtonTestIds } from './MenuButton.test-ids';\n\nregisterIcon(arrowMicroDownIcon);\n\nexport interface MenuButtonProps extends BaseProps, NoChildrenProp, TestIdProp {\n /** The text for the MenuButton also used to set the aria-label. */\n text: string;\n /**\n * Determines the Button variant for the MenuButton.\n * @default 'secondary'\n */\n variant?: ButtonProps['variant'];\n /** The name of the icon for the MenuButton. */\n icon?: string;\n /** Only display the icon. The text prop will be forwarded to a tooltip. */\n iconOnly?: ButtonProps['icon'];\n /** The total count representing the list data which was selected. */\n count?: CountProps['children'];\n /** The click handler for the MenuButton. */\n onClick?: MouseEventHandler;\n /** Menu related props. */\n menu?: MenuProps;\n /** Popover related props. */\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n /** DOM id for the button element. */\n id?: string;\n /** Ref for the button element. */\n ref?: ButtonProps['ref'];\n /** The keydown handler for the MenuButton. */\n onKeyDown?: KeyboardEventHandler;\n}\n\nconst StyledMenuButton = styled.button(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n gap: ${spacing};\n flex-shrink: 0;\n white-space: nowrap;\n max-width: 100%;\n\n & + ${StyledPopover} + ${StyledButton} {\n margin-inline-start: ${spacing};\n }\n `;\n }\n);\n\nStyledMenuButton.defaultProps = defaultThemeProp;\n\nconst StyledMenuButtonChildren = styled.span(({ theme }) => {\n return css`\n max-width: 100%;\n\n ${StyledText} {\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n ${StyledIcon}:last-child:not(:first-child) {\n /* Offsets the flex gap to make the down arrow appear to trail the text. */\n margin-inline-start: -${theme.base.spacing};\n }\n `;\n});\n\nconst StyledMenuButtonPopover = styled(Popover)`\n min-width: 20ch;\n`;\n\nconst MenuButton: FunctionComponent<ForwardProps & MenuButtonProps> = forwardRef(\n function MenuButton(props: PropsWithoutRef<MenuButtonProps>, ref: MenuButtonProps['ref']) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n text,\n menu,\n popover,\n onClick,\n icon,\n count,\n iconOnly = false,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getMenuButtonTestIds);\n const [isOpen, setIsOpen] = useState(false);\n\n const buttonRef = useConsolidatedRef(ref);\n const popoverRef = useConsolidatedRef<HTMLDivElement>(popover?.ref);\n const menuRef = useConsolidatedRef<HTMLDivElement>(menu?.ref);\n\n // FIXME: Type assertion required for issue in useFocusWithin generic\n useFocusWithin<HTMLElement>(\n [popoverRef, buttonRef],\n useCallback(isFocused => {\n if (!isFocused) setIsOpen(false);\n }, [])\n );\n\n useEscape(e => {\n if (isOpen) {\n setIsOpen(false);\n e.stopPropagation();\n }\n }, buttonRef);\n\n const { rtl } = useDirection();\n\n return (\n <>\n <Button\n data-testid={testIds.root}\n as={StyledMenuButton}\n aria-label={text}\n {...restProps}\n id={id}\n ref={buttonRef}\n aria-expanded={isOpen}\n aria-haspopup='menu'\n aria-controls={isOpen ? `${id}-popover` : undefined}\n label={iconOnly && !isOpen ? text : undefined}\n onClick={(e: MouseEvent<HTMLButtonElement> & UIEvent<HTMLButtonElement>) => {\n // e.detail is 0 when triggered by keyboard.\n const mouseClick = e.detail > 0;\n\n // Close the menu if it is open and either:\n // It is a *mouse* click on the button.\n // Or, the menu mode is not multiselect.\n if (isOpen && (mouseClick || menu?.mode !== 'multi-select')) {\n setIsOpen(false);\n } else {\n setIsOpen(true);\n }\n\n // If the menu is closed or the user mouse clicks.\n // This avoids Enter key firing onClick when selecting a menu item.\n if (!isOpen || mouseClick) {\n onClick?.(e);\n }\n }}\n icon={iconOnly}\n >\n <Flex as={StyledMenuButtonChildren} container={{ alignItems: 'center', gap: 1 }}>\n {icon && <Icon name={icon} />}\n {!iconOnly && (\n <>\n {text && <Text>{text}</Text>}\n {typeof count === 'number' && <Count>{count}</Count>}\n {text && <Icon name='arrow-micro-down' />}\n </>\n )}\n </Flex>\n </Button>\n <StyledMenuButtonPopover\n placement={rtl ? 'bottom-end' : 'bottom-start'}\n hideOnTargetHidden\n {...popover}\n id={`${id}-popover`}\n show={!!menu && isOpen}\n target={buttonRef.current}\n ref={popoverRef}\n >\n {menu && (\n <Menu\n testId={testIds.root}\n {...menu}\n ref={menuRef}\n items={menu.items}\n onItemClick={(itemId, e) => {\n if (\n menu.mode !== 'multi-select' &&\n (e as MouseEvent<AcceptedMouseEventElement> & UIEvent<AcceptedMouseEventElement>)\n .detail > 0\n ) {\n setIsOpen(false);\n }\n menu.onItemClick?.(itemId, e);\n }}\n focusControlEl={buttonRef.current || undefined}\n />\n )}\n </StyledMenuButtonPopover>\n </>\n );\n }\n);\n\nexport default withTestIds(MenuButton, getMenuButtonTestIds);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EAKlB,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EAKlB,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAqBhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAWhD,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,GAAG,YAAY,CA+StD,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { getFocusables } from '../../utils';
|
|
|
5
5
|
import Backdrop from '../Backdrop';
|
|
6
6
|
import Flex from '../Flex';
|
|
7
7
|
import Button from '../Button';
|
|
8
|
-
import { useConsolidatedRef, useI18n, useOuterEvent, useUID, useFocusTrap, usePrevious, useModalContext, useEvent } from '../../hooks';
|
|
8
|
+
import { useConsolidatedRef, useI18n, useOuterEvent, useUID, useFocusTrap, usePrevious, useModalContext, useEvent, useBreakpoint } from '../../hooks';
|
|
9
9
|
import Icon, { registerIcon } from '../Icon';
|
|
10
10
|
import * as timesIcon from '../Icon/icons/times.icon';
|
|
11
11
|
import * as minusIcon from '../Icon/icons/minus.icon';
|
|
@@ -98,8 +98,9 @@ const Modal = forwardRef(function Modal(props, ref) {
|
|
|
98
98
|
setFocus();
|
|
99
99
|
}
|
|
100
100
|
}, [progress]);
|
|
101
|
+
const isModalSmallOrAbove = useBreakpoint('sm', { breakpointRef: modalRef });
|
|
101
102
|
const maximized = stretch || state === 'maximized';
|
|
102
|
-
const modal = (_jsxs(Flex, { ...restProps, container: { direction: 'column' }, ref: modalRef, as: StyledModal, forwardedAs: as, onClick: (e) => e.stopPropagation(), onKeyDown: onModalKeyDown, alert: alert, role: alert ? 'alertdialog' : 'dialog', stretch: maximized, center: center, "aria-labelledby": `${id}-heading`, "aria-describedby": alert ? `${id}-content` : undefined, "aria-modal": state === 'docked' ? 'false' : 'true', state: state, "aria-busy": progress ? 'true' : 'false', children: [_jsxs(Flex, { container: { justify: 'between', alignItems: '
|
|
103
|
+
const modal = (_jsxs(Flex, { ...restProps, container: { direction: 'column' }, ref: modalRef, as: StyledModal, forwardedAs: as, onClick: (e) => e.stopPropagation(), onKeyDown: onModalKeyDown, alert: alert, role: alert ? 'alertdialog' : 'dialog', stretch: maximized, center: center, "aria-labelledby": `${id}-heading`, "aria-describedby": alert ? `${id}-content` : undefined, "aria-modal": state === 'docked' ? 'false' : 'true', state: state, "aria-busy": progress ? 'true' : 'false', children: [_jsxs(Flex, { container: { justify: 'between', alignItems: 'start', gap: 1 }, item: { shrink: 0 }, as: StyledModalHeader, hasAction: minimizable || dismissible, children: [_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, as: Text, variant: 'h2', id: `${id}-heading`, children: [_jsx("span", { children: heading }), typeof count === 'number' && _jsx(Count, { children: count })] }), _jsxs(Flex, { container: true, children: [maximizable && !alert && state !== 'maximized' && (_jsx(Button, { icon: true, variant: 'simple', label: t('maximize'), "aria-label": t('modal_maximize'), onKeyDown: onHeaderActionKeyDown, onClick: () => {
|
|
103
104
|
if (onRequestMaximize?.() !== false) {
|
|
104
105
|
maximize();
|
|
105
106
|
}
|
|
@@ -113,7 +114,13 @@ const Modal = forwardRef(function Modal(props, ref) {
|
|
|
113
114
|
}
|
|
114
115
|
}, children: _jsx(Icon, { name: 'minus' }) })), dismissible && !alert && (_jsx(Button, { icon: true, variant: 'simple', label: t('close'), "aria-label": t('modal_close'), onKeyDown: onHeaderActionKeyDown, onClick: tryDismiss, ref: closeButtonRef, children: _jsx(Icon, { name: 'times' }) }))] })] }), _jsxs(Flex, { item: { grow: 1 }, as: StyledModalContent, ref: modalContentRef, style: modalContentRef.current
|
|
115
116
|
? { '--scroll-top': `${modalContentRef.current.scrollTop}px` }
|
|
116
|
-
: undefined, children: [children && (_jsx(StyledModalChildrenWrap, { id: `${id}-content`, inert: progress ? '' : undefined, children: children })), _jsx(Progress, { visible: !!progress, focusOnVisible: true, placement: 'local', message: typeof progress === 'object' ? progress.message : t('loading') })] }), actions && (_jsx(Flex, { container: {
|
|
117
|
+
: undefined, children: [children && (_jsx(StyledModalChildrenWrap, { id: `${id}-content`, inert: progress ? '' : undefined, children: children })), _jsx(Progress, { visible: !!progress, focusOnVisible: true, placement: 'local', message: typeof progress === 'object' ? progress.message : t('loading') })] }), actions && (_jsx(Flex, { container: {
|
|
118
|
+
pad: [2.5, 3, 3],
|
|
119
|
+
gap: 1,
|
|
120
|
+
...(isModalSmallOrAbove
|
|
121
|
+
? { direction: 'row', justify: 'end' }
|
|
122
|
+
: { direction: 'column' })
|
|
123
|
+
}, item: { shrink: 0 }, as: StyledModalActions, isSmallOrAbove: isModalSmallOrAbove, children: actions }))] }));
|
|
117
124
|
const renderModal = state === 'docked' ? (modal) : (_jsx(Backdrop, { ref: backdropRef, container: {
|
|
118
125
|
alignItems: center || maximized ? 'center' : 'start'
|
|
119
126
|
}, transitionSpeed: 'slow', open: state === 'open' || state === 'maximized', onBeforeTransitionIn: onBeforeOpen, onAfterTransitionIn: onAfterOpen, onBeforeTransitionOut: onBeforeClose, onAfterTransitionOut: () => {
|