@redsift/design-system 11.6.0-muiv5-alpha.2 → 11.6.0-muiv5-alpha.4
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/components/alert/Alert.js +8 -8
- package/components/alert/Alert.js.map +1 -1
- package/components/app-bar/AppBar.js +11 -11
- package/components/app-bar/AppBar.js.map +1 -1
- package/components/app-container/AppContainer.js +16 -16
- package/components/app-container/AppContainer.js.map +1 -1
- package/components/app-container/context.js +2 -2
- package/components/app-container/context.js.map +1 -1
- package/components/app-content/AppContent.js +2 -2
- package/components/app-content/AppContent.js.map +1 -1
- package/components/app-side-panel/AppSidePanel.js +8 -8
- package/components/app-side-panel/AppSidePanel.js.map +1 -1
- package/components/app-side-panel/useAppSidePanel.js +2 -2
- package/components/app-side-panel/useAppSidePanel.js.map +1 -1
- package/components/badge/Badge.js +2 -2
- package/components/badge/Badge.js.map +1 -1
- package/components/breadcrumb-item/BreadcrumbItem.js +2 -2
- package/components/breadcrumb-item/BreadcrumbItem.js.map +1 -1
- package/components/breadcrumbs/Breadcrumbs.js +7 -7
- package/components/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/components/button/Button.js +7 -7
- package/components/button/Button.js.map +1 -1
- package/components/button-group/ButtonGroup.js +4 -4
- package/components/button-group/ButtonGroup.js.map +1 -1
- package/components/button-link/ButtonLink.js +6 -6
- package/components/button-link/ButtonLink.js.map +1 -1
- package/components/card/Card.js +7 -7
- package/components/card/Card.js.map +1 -1
- package/components/card-actions/CardActions.js +2 -2
- package/components/card-actions/CardActions.js.map +1 -1
- package/components/card-body/CardBody.js +2 -2
- package/components/card-body/CardBody.js.map +1 -1
- package/components/card-header/CardHeader.js +7 -7
- package/components/card-header/CardHeader.js.map +1 -1
- package/components/checkbox/Checkbox.js +7 -7
- package/components/checkbox/Checkbox.js.map +1 -1
- package/components/checkbox-group/CheckboxGroup.js +7 -7
- package/components/checkbox-group/CheckboxGroup.js.map +1 -1
- package/components/checkbox-group/context.js +2 -2
- package/components/checkbox-group/context.js.map +1 -1
- package/components/conditional-wrapper/ConditionalWrapper.js +2 -2
- package/components/conditional-wrapper/ConditionalWrapper.js.map +1 -1
- package/components/detailed-card/DetailedCard.js +20 -20
- package/components/detailed-card/DetailedCard.js.map +1 -1
- package/components/detailed-card/types.d.ts +10 -1
- package/components/detailed-card-collapsible-section-items/DetailedCardCollapsibleSectionItems.js +3 -3
- package/components/detailed-card-collapsible-section-items/DetailedCardCollapsibleSectionItems.js.map +1 -1
- package/components/detailed-card-header/DetailedCardHeader.js +4 -4
- package/components/detailed-card-header/DetailedCardHeader.js.map +1 -1
- package/components/detailed-card-section/DetailedCardSection.js +10 -10
- package/components/detailed-card-section/DetailedCardSection.js.map +1 -1
- package/components/detailed-card-section-item/DetailedCardSectionItem.js +12 -12
- package/components/detailed-card-section-item/DetailedCardSectionItem.js.map +1 -1
- package/components/flexbox/Flexbox.js +3 -3
- package/components/flexbox/Flexbox.js.map +1 -1
- package/components/focus-within-group/FocusWithinGroup.js +2 -2
- package/components/focus-within-group/FocusWithinGroup.js.map +1 -1
- package/components/focus-within-group/context.js +2 -2
- package/components/focus-within-group/context.js.map +1 -1
- package/components/grid/Grid.js +3 -3
- package/components/grid/Grid.js.map +1 -1
- package/components/grid-item/GridItem.js +2 -2
- package/components/grid-item/GridItem.js.map +1 -1
- package/components/heading/Heading.js +2 -2
- package/components/heading/Heading.js.map +1 -1
- package/components/icon/Icon.js +5 -5
- package/components/icon/Icon.js.map +1 -1
- package/components/icon-button/IconButton.js +6 -6
- package/components/icon-button/IconButton.js.map +1 -1
- package/components/icon-button-link/IconButtonLink.js +5 -5
- package/components/icon-button-link/IconButtonLink.js.map +1 -1
- package/components/item/Item.js +19 -19
- package/components/item/Item.js.map +1 -1
- package/components/link/Link.js +5 -5
- package/components/link/Link.js.map +1 -1
- package/components/link-button/LinkButton.js +5 -5
- package/components/link-button/LinkButton.js.map +1 -1
- package/components/listbox/ActiveDescendantListbox.d.ts +1 -1
- package/components/listbox/ActiveDescendantListbox.js +3 -3
- package/components/listbox/ActiveDescendantListbox.js.map +1 -1
- package/components/listbox/Listbox.js +8 -8
- package/components/listbox/Listbox.js.map +1 -1
- package/components/listbox/RovingTabindexListbox.d.ts +1 -1
- package/components/listbox/RovingTabindexListbox.js +3 -3
- package/components/listbox/RovingTabindexListbox.js.map +1 -1
- package/components/listbox/context.js +2 -2
- package/components/listbox/context.js.map +1 -1
- package/components/number/Number.js +2 -2
- package/components/number/Number.js.map +1 -1
- package/components/number-field/NumberField.js +16 -16
- package/components/number-field/NumberField.js.map +1 -1
- package/components/pill/Pill.js +10 -10
- package/components/pill/Pill.js.map +1 -1
- package/components/progress-bar/ProgressBar.js +2 -2
- package/components/progress-bar/ProgressBar.js.map +1 -1
- package/components/radio/Radio.js +6 -6
- package/components/radio/Radio.js.map +1 -1
- package/components/radio-group/RadioGroup.js +7 -7
- package/components/radio-group/RadioGroup.js.map +1 -1
- package/components/radio-group/context.js +2 -2
- package/components/radio-group/context.js.map +1 -1
- package/components/shield/Shield.js +5 -5
- package/components/shield/Shield.js.map +1 -1
- package/components/side-navigation-menu/SideNavigationMenu.js +16 -16
- package/components/side-navigation-menu/SideNavigationMenu.js.map +1 -1
- package/components/side-navigation-menu/context.js +2 -2
- package/components/side-navigation-menu/context.js.map +1 -1
- package/components/side-navigation-menu-bar/SideNavigationMenuBar.js +7 -7
- package/components/side-navigation-menu-bar/SideNavigationMenuBar.js.map +1 -1
- package/components/side-navigation-menu-bar/context.js +2 -2
- package/components/side-navigation-menu-bar/context.js.map +1 -1
- package/components/side-navigation-menu-bar/useSideNavigationMenuBar.js +4 -4
- package/components/side-navigation-menu-bar/useSideNavigationMenuBar.js.map +1 -1
- package/components/side-navigation-menu-item/SideNavigationMenuItem.js +9 -9
- package/components/side-navigation-menu-item/SideNavigationMenuItem.js.map +1 -1
- package/components/skeleton/Skeleton.js +4 -4
- package/components/skeleton/Skeleton.js.map +1 -1
- package/components/skeleton-circle/SkeletonCircle.js +4 -4
- package/components/skeleton-circle/SkeletonCircle.js.map +1 -1
- package/components/skeleton-text/SkeletonText.js +4 -4
- package/components/skeleton-text/SkeletonText.js.map +1 -1
- package/components/spinner/Spinner.js +2 -2
- package/components/spinner/Spinner.js.map +1 -1
- package/components/switch/Switch.js +9 -9
- package/components/switch/Switch.js.map +1 -1
- package/components/switch-group/SwitchGroup.js +7 -7
- package/components/switch-group/SwitchGroup.js.map +1 -1
- package/components/switch-group/context.js +2 -2
- package/components/switch-group/context.js.map +1 -1
- package/components/text/Text.js +2 -2
- package/components/text/Text.js.map +1 -1
- package/components/text-area/TextArea.js +11 -11
- package/components/text-area/TextArea.js.map +1 -1
- package/components/text-field/TextField.js +13 -13
- package/components/text-field/TextField.js.map +1 -1
- package/components/theme/context.js +2 -2
- package/components/theme/context.js.map +1 -1
- package/package.json +6 -2
- package/react-aria/react-aria/focus/useFocusable.js +2 -2
- package/react-aria/react-aria/focus/useFocusable.js.map +1 -1
- package/react-aria/react-aria/i18n/context.js +4 -4
- package/react-aria/react-aria/i18n/context.js.map +1 -1
- package/react-aria/react-aria/interactions/context.js +2 -2
- package/react-aria/react-aria/interactions/context.js.map +1 -1
- package/react-aria/react-aria/ssr/SSRProvider.js +13 -13
- package/react-aria/react-aria/ssr/SSRProvider.js.map +1 -1
- package/react-aria/react-aria/utils/mergeProps.js +2 -2
- package/react-aria/react-aria/utils/mergeProps.js.map +1 -1
- package/react-aria/react-aria/utils/useLayoutEffect.js +2 -2
- package/react-aria/react-aria/utils/useLayoutEffect.js.map +1 -1
- package/utils/filterComponents.js +2 -2
- package/utils/filterComponents.js.map +1 -1
- package/utils/isComponent.js +2 -2
- package/utils/isComponent.js.map +1 -1
- package/utils/useId.js +4 -4
- package/utils/useId.js.map +1 -1
- package/_virtual/jsx-runtime.js +0 -4
- package/_virtual/jsx-runtime.js.map +0 -1
- package/_virtual/react-jsx-runtime.development.js +0 -4
- package/_virtual/react-jsx-runtime.development.js.map +0 -1
- package/_virtual/react-jsx-runtime.production.min.js +0 -4
- package/_virtual/react-jsx-runtime.production.min.js.map +0 -1
- package/packages/popovers/src/components/tooltip/Tooltip.js +0 -62
- package/packages/popovers/src/components/tooltip/Tooltip.js.map +0 -1
- package/packages/popovers/src/components/tooltip/context.js +0 -6
- package/packages/popovers/src/components/tooltip/context.js.map +0 -1
- package/packages/popovers/src/components/tooltip/types.js +0 -28
- package/packages/popovers/src/components/tooltip/types.js.map +0 -1
- package/packages/popovers/src/components/tooltip/useTooltip.js +0 -78
- package/packages/popovers/src/components/tooltip/useTooltip.js.map +0 -1
- package/packages/popovers/src/components/tooltip/useTooltipContext.js +0 -13
- package/packages/popovers/src/components/tooltip/useTooltipContext.js.map +0 -1
- package/packages/popovers/src/components/tooltip-content/TooltipContent.js +0 -80
- package/packages/popovers/src/components/tooltip-content/TooltipContent.js.map +0 -1
- package/packages/popovers/src/components/tooltip-content/styles.js +0 -128
- package/packages/popovers/src/components/tooltip-content/styles.js.map +0 -1
- package/packages/popovers/src/components/tooltip-trigger/TooltipTrigger.js +0 -47
- package/packages/popovers/src/components/tooltip-trigger/TooltipTrigger.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound.js';
|
|
5
5
|
import { StyledBreadcrumbs } from './styles.js';
|
|
@@ -29,27 +29,27 @@ const BaseBreadcrumbs = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
29
29
|
const breadcrumbItems = childArray.map((child, index) => {
|
|
30
30
|
var _child$key;
|
|
31
31
|
const isCurrent = index === childArray.length - 1;
|
|
32
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
33
33
|
key: index
|
|
34
|
-
}, /*#__PURE__*/
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Breadcrumbs.Item, _extends({
|
|
35
35
|
isDisabled: child.props.isDisabled || isDisabled || undefined
|
|
36
36
|
}, child.props, {
|
|
37
37
|
key: (_child$key = child.key) !== null && _child$key !== void 0 ? _child$key : index,
|
|
38
38
|
isCurrent: isCurrent
|
|
39
|
-
})), isCurrent === false ? /*#__PURE__*/
|
|
39
|
+
})), isCurrent === false ? /*#__PURE__*/React.createElement("span", {
|
|
40
40
|
className: `${BaseBreadcrumbs.className}__separator`
|
|
41
41
|
}, '/') : null);
|
|
42
42
|
});
|
|
43
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
44
44
|
value: {
|
|
45
45
|
theme
|
|
46
46
|
}
|
|
47
|
-
}, /*#__PURE__*/
|
|
47
|
+
}, /*#__PURE__*/React.createElement(StyledBreadcrumbs, _extends({}, forwardedProps, {
|
|
48
48
|
$isDisabled: isDisabled,
|
|
49
49
|
$theme: theme,
|
|
50
50
|
className: classNames(BaseBreadcrumbs.className, className),
|
|
51
51
|
ref: ref
|
|
52
|
-
}), /*#__PURE__*/
|
|
52
|
+
}), /*#__PURE__*/React.createElement("ol", null, breadcrumbItems)));
|
|
53
53
|
});
|
|
54
54
|
BaseBreadcrumbs.className = CLASSNAME;
|
|
55
55
|
BaseBreadcrumbs.displayName = COMPONENT_NAME;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.js","sources":["../../../src/components/breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\nimport { Comp } from '../../types';\nimport { BreadcrumbItem } from '../breadcrumb-item';\nimport { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound';\nimport { StyledBreadcrumbs } from './styles';\nimport { BreadcrumbsProps } from './types';\nimport { filterComponents } from '../../utils';\nimport { ThemeProvider, useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'Breadcrumbs';\nconst CLASSNAME = 'redsift-breadcrumbs';\n\n/**\n * The Breadcrumbs components is a list of links to the parent pages of the current page in hierarchical order.\n */\nexport const BaseBreadcrumbs: Comp<BreadcrumbsProps, HTMLElement> = forwardRef((props, ref) => {\n const { children, className, isDisabled, theme: propsTheme, ...forwardedProps } = props;\n\n warnIfNoAccessibleLabelFound(props, undefined, 'Breadcrumbs');\n\n const theme = useTheme(propsTheme);\n\n const childArray = filterComponents([Breadcrumbs.Item])(children);\n const breadcrumbItems = childArray.map((child, index) => {\n const isCurrent = index === childArray.length - 1;\n\n return (\n <li key={index}>\n <Breadcrumbs.Item\n isDisabled={child.props.isDisabled || isDisabled || undefined}\n {...child.props}\n key={child.key ?? index}\n isCurrent={isCurrent}\n />\n {isCurrent === false ? <span className={`${BaseBreadcrumbs.className}__separator`}>{'/'}</span> : null}\n </li>\n );\n });\n\n return (\n <ThemeProvider value={{ theme }}>\n <StyledBreadcrumbs\n {...forwardedProps}\n $isDisabled={isDisabled}\n $theme={theme}\n className={classNames(BaseBreadcrumbs.className, className)}\n ref={ref as RefObject<HTMLElement>}\n >\n <ol>{breadcrumbItems}</ol>\n </StyledBreadcrumbs>\n </ThemeProvider>\n );\n});\nBaseBreadcrumbs.className = CLASSNAME;\nBaseBreadcrumbs.displayName = COMPONENT_NAME;\n\nexport const Breadcrumbs = Object.assign(BaseBreadcrumbs, {\n Item: BreadcrumbItem,\n});\n"],"names":["COMPONENT_NAME","CLASSNAME","BaseBreadcrumbs","forwardRef","props","ref","children","className","isDisabled","theme","propsTheme","forwardedProps","_objectWithoutProperties","_excluded","warnIfNoAccessibleLabelFound","undefined","useTheme","childArray","filterComponents","Breadcrumbs","Item","breadcrumbItems","map","child","index","_child$key","isCurrent","length","React","createElement","key","_extends","ThemeProvider","value","StyledBreadcrumbs","$isDisabled","$theme","classNames","displayName","Object","assign","BreadcrumbItem"],"mappings":";;;;;;;;;;;AAUA,MAAMA,cAAc,GAAG,aAAa,CAAA;AACpC,MAAMC,SAAS,GAAG,qBAAqB,CAAA;;AAEvC;AACA;AACA;AACO,MAAMC,eAAoD,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC7F,MAAM;MAAEC,QAAQ;MAAEC,SAAS;MAAEC,UAAU;AAAEC,MAAAA,KAAK,EAAEC,UAAAA;AAA8B,KAAC,GAAGN,KAAK;AAAxBO,IAAAA,cAAc,GAAAC,wBAAA,CAAKR,KAAK,EAAAS,SAAA,CAAA,CAAA;AAEvFC,EAAAA,4BAA4B,CAACV,KAAK,EAAEW,SAAS,EAAE,aAAa,CAAC,CAAA;AAE7D,EAAA,MAAMN,KAAK,GAAGO,QAAQ,CAACN,UAAU,CAAC,CAAA;AAElC,EAAA,MAAMO,UAAU,GAAGC,gBAAgB,CAAC,CAACC,WAAW,CAACC,IAAI,CAAC,CAAC,CAACd,QAAQ,CAAC,CAAA;EACjE,MAAMe,eAAe,GAAGJ,UAAU,CAACK,GAAG,CAAC,CAACC,KAAK,EAAEC,KAAK,KAAK;AAAA,IAAA,IAAAC,UAAA,CAAA;IACvD,MAAMC,SAAS,GAAGF,KAAK,KAAKP,UAAU,CAACU,MAAM,GAAG,CAAC,CAAA;IAEjD,oBACEC,
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.js","sources":["../../../src/components/breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\nimport { Comp } from '../../types';\nimport { BreadcrumbItem } from '../breadcrumb-item';\nimport { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound';\nimport { StyledBreadcrumbs } from './styles';\nimport { BreadcrumbsProps } from './types';\nimport { filterComponents } from '../../utils';\nimport { ThemeProvider, useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'Breadcrumbs';\nconst CLASSNAME = 'redsift-breadcrumbs';\n\n/**\n * The Breadcrumbs components is a list of links to the parent pages of the current page in hierarchical order.\n */\nexport const BaseBreadcrumbs: Comp<BreadcrumbsProps, HTMLElement> = forwardRef((props, ref) => {\n const { children, className, isDisabled, theme: propsTheme, ...forwardedProps } = props;\n\n warnIfNoAccessibleLabelFound(props, undefined, 'Breadcrumbs');\n\n const theme = useTheme(propsTheme);\n\n const childArray = filterComponents([Breadcrumbs.Item])(children);\n const breadcrumbItems = childArray.map((child, index) => {\n const isCurrent = index === childArray.length - 1;\n\n return (\n <li key={index}>\n <Breadcrumbs.Item\n isDisabled={child.props.isDisabled || isDisabled || undefined}\n {...child.props}\n key={child.key ?? index}\n isCurrent={isCurrent}\n />\n {isCurrent === false ? <span className={`${BaseBreadcrumbs.className}__separator`}>{'/'}</span> : null}\n </li>\n );\n });\n\n return (\n <ThemeProvider value={{ theme }}>\n <StyledBreadcrumbs\n {...forwardedProps}\n $isDisabled={isDisabled}\n $theme={theme}\n className={classNames(BaseBreadcrumbs.className, className)}\n ref={ref as RefObject<HTMLElement>}\n >\n <ol>{breadcrumbItems}</ol>\n </StyledBreadcrumbs>\n </ThemeProvider>\n );\n});\nBaseBreadcrumbs.className = CLASSNAME;\nBaseBreadcrumbs.displayName = COMPONENT_NAME;\n\nexport const Breadcrumbs = Object.assign(BaseBreadcrumbs, {\n Item: BreadcrumbItem,\n});\n"],"names":["COMPONENT_NAME","CLASSNAME","BaseBreadcrumbs","forwardRef","props","ref","children","className","isDisabled","theme","propsTheme","forwardedProps","_objectWithoutProperties","_excluded","warnIfNoAccessibleLabelFound","undefined","useTheme","childArray","filterComponents","Breadcrumbs","Item","breadcrumbItems","map","child","index","_child$key","isCurrent","length","React","createElement","key","_extends","ThemeProvider","value","StyledBreadcrumbs","$isDisabled","$theme","classNames","displayName","Object","assign","BreadcrumbItem"],"mappings":";;;;;;;;;;;AAUA,MAAMA,cAAc,GAAG,aAAa,CAAA;AACpC,MAAMC,SAAS,GAAG,qBAAqB,CAAA;;AAEvC;AACA;AACA;AACO,M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MAAAA,SAAS,EAAG,CAAA,EAAEL,eAAe,CAACK,SAAU,CAAA,WAAA,CAAA;AAAa,KAAA,EAAE,GAAU,CAAC,GAAG,IAChG,CAAC,CAAA;AAET,GAAC,CAAC,CAAA;AAEF,EAAA,oBACEqB,KAAA,CAAAC,aAAA,CAACG,aAAa,EAAA;AAACC,IAAAA,KAAK,EAAE;AAAExB,MAAAA,KAAAA;AAAM,KAAA;GAC5BmB,eAAAA,KAAA,CAAAC,aAAA,CAACK,iBAAiB,EAAAH,QAAA,KACZpB,cAAc,EAAA;AAClBwB,IAAAA,WAAW,EAAE3B,UAAW;AACxB4B,IAAAA,MAAM,EAAE3B,KAAM;IACdF,SAAS,EAAE8B,UAAU,CAACnC,eAAe,CAACK,SAAS,EAAEA,SAAS,CAAE;AAC5DF,IAAAA,GAAG,EAAEA,GAAAA;AAA8B,GAAA,CAAA,eAEnCuB,KAAA,CAAAC,aAAA,aAAKR,eAAoB,CACR,CACN,CAAC,CAAA;AAEpB,CAAC,EAAC;AACFnB,eAAe,CAACK,SAAS,GAAGN,SAAS,CAAA;AACrCC,eAAe,CAACoC,WAAW,GAAGtC,cAAc,CAAA;AAErC,MAAMmB,WAAW,GAAGoB,MAAM,CAACC,MAAM,CAACtC,eAAe,EAAE;AACxDkB,EAAAA,IAAI,EAAEqB,cAAAA;AACR,CAAC;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import
|
|
2
|
+
import React, { forwardRef, useRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { StyledButton } from './styles.js';
|
|
5
5
|
import { ButtonVariant } from './types.js';
|
|
@@ -47,16 +47,16 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
47
47
|
const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
|
|
48
48
|
const variant = Object.values(ButtonVariant).includes(propsVariant) ? propsVariant : 'primary';
|
|
49
49
|
const isGradient = color === ButtonsColorPalette.radar;
|
|
50
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/React.createElement(ConditionalWrapper, {
|
|
51
51
|
condition: isGradient && variant === ButtonVariant.secondary,
|
|
52
|
-
wrapper: children => /*#__PURE__*/
|
|
52
|
+
wrapper: children => /*#__PURE__*/React.createElement(StyledGradientBorder, {
|
|
53
53
|
$color: color,
|
|
54
54
|
$isActive: isActive,
|
|
55
55
|
$isDisabled: isDisabled,
|
|
56
56
|
$isHovered: isHovered,
|
|
57
57
|
$theme: theme
|
|
58
58
|
}, children)
|
|
59
|
-
}, /*#__PURE__*/
|
|
59
|
+
}, /*#__PURE__*/React.createElement(StyledButton, _extends({
|
|
60
60
|
type: "button"
|
|
61
61
|
}, forwardedProps, {
|
|
62
62
|
$color: color,
|
|
@@ -72,14 +72,14 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
72
72
|
className: classNames(Button.className, className),
|
|
73
73
|
disabled: isDisabled,
|
|
74
74
|
ref: buttonRef
|
|
75
|
-
}), leftIcon ? /*#__PURE__*/
|
|
75
|
+
}), leftIcon ? /*#__PURE__*/React.createElement(Icon, _extends({
|
|
76
76
|
icon: leftIcon,
|
|
77
77
|
"aria-hidden": "true",
|
|
78
78
|
className: "left"
|
|
79
|
-
}, leftIconProps)) : null, isLoading ? /*#__PURE__*/
|
|
79
|
+
}, leftIconProps)) : null, isLoading ? /*#__PURE__*/React.createElement(Spinner, {
|
|
80
80
|
size: "small",
|
|
81
81
|
color: variant === ButtonVariant.primary ? 'grey-l1' : 'grey-l2'
|
|
82
|
-
}) : null, /*#__PURE__*/
|
|
82
|
+
}) : null, /*#__PURE__*/React.createElement("span", null, children), rightIcon ? /*#__PURE__*/React.createElement(Icon, _extends({
|
|
83
83
|
icon: rightIcon,
|
|
84
84
|
"aria-hidden": "true",
|
|
85
85
|
className: "right"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import React, { forwardRef, RefObject, useRef } from 'react';\nimport classNames from 'classnames';\nimport { ButtonsColorPalette, Comp } from '../../types';\nimport { Icon } from '../../components/icon';\nimport { StyledButton } from './styles';\nimport { ButtonProps, ButtonVariant } from './types';\nimport { Spinner } from '../../components/spinner';\nimport { useTheme } from '../theme';\nimport { ConditionalWrapper } from '../conditional-wrapper';\nimport { StyledGradientBorder } from '../gradient-border';\n\nconst COMPONENT_NAME = 'Button';\nconst CLASSNAME = 'redsift-button';\n\n/**\n * The Button is a semantic button that looks like a button.\n *\n * For a semantic link that looks like a button, please use the ButtonLink component.\n * For a semantic link that looks like a link, please use the Link component.\n * For a semantic button that looks like a link, please use the LinkButton component.\n */\nexport const Button: Comp<ButtonProps, HTMLButtonElement> = forwardRef((props, ref) => {\n const _ref = useRef<HTMLButtonElement>();\n const buttonRef = ref || _ref;\n\n const {\n children,\n className,\n color: propsColor,\n disabled,\n fullWidth,\n isActive,\n isDisabled: propsIsDisabled,\n isHovered,\n isLoading,\n leftIcon,\n leftIconProps,\n rightIcon,\n rightIconProps,\n theme: propsTheme,\n variant: propsVariant,\n ...forwardedProps\n } = props;\n const isDisabled = isLoading || propsIsDisabled || disabled;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : 'primary';\n const variant = Object.values(ButtonVariant).includes(propsVariant!) ? propsVariant : 'primary';\n const isGradient = color === ButtonsColorPalette.radar;\n\n return (\n <ConditionalWrapper\n condition={isGradient && variant === ButtonVariant.secondary}\n wrapper={(children) => (\n <StyledGradientBorder\n $color={color}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isHovered={isHovered}\n $theme={theme}\n >\n {children}\n </StyledGradientBorder>\n )}\n >\n <StyledButton\n type=\"button\"\n {...forwardedProps}\n $color={color}\n $fullWidth={fullWidth}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isGradient={isGradient}\n $isHovered={isHovered}\n $isLoading={isLoading}\n $theme={theme}\n $variant={variant}\n aria-disabled={isDisabled}\n className={classNames(Button.className, className)}\n disabled={isDisabled}\n ref={buttonRef as RefObject<HTMLButtonElement>}\n >\n {leftIcon ? <Icon icon={leftIcon} aria-hidden=\"true\" className=\"left\" {...leftIconProps} /> : null}\n {isLoading ? <Spinner size=\"small\" color={variant === ButtonVariant.primary ? 'grey-l1' : 'grey-l2'} /> : null}\n <span>{children}</span>\n {rightIcon ? <Icon icon={rightIcon} aria-hidden=\"true\" className=\"right\" {...rightIconProps} /> : null}\n </StyledButton>\n </ConditionalWrapper>\n );\n});\nButton.className = CLASSNAME;\nButton.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","Button","forwardRef","props","ref","_ref","useRef","buttonRef","children","className","color","propsColor","disabled","fullWidth","isActive","isDisabled","propsIsDisabled","isHovered","isLoading","leftIcon","leftIconProps","rightIcon","rightIconProps","theme","propsTheme","variant","propsVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","ButtonVariant","isGradient","radar","React","createElement","ConditionalWrapper","condition","secondary","wrapper","StyledGradientBorder","$color","$isActive","$isDisabled","$isHovered","$theme","StyledButton","_extends","type","$fullWidth","$isGradient","$isLoading","$variant","classNames","Icon","icon","Spinner","size","primary","displayName"],"mappings":";;;;;;;;;;;;;AAWA,MAAMA,cAAc,GAAG,QAAQ,CAAA;AAC/B,MAAMC,SAAS,GAAG,gBAAgB,CAAA;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,MAA4C,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;AACrF,EAAA,MAAMC,IAAI,GAAGC,MAAM,EAAqB,CAAA;AACxC,EAAA,MAAMC,SAAS,GAAGH,GAAG,IAAIC,IAAI,CAAA;EAE7B,MAAM;MACJG,QAAQ;MACRC,SAAS;AACTC,MAAAA,KAAK,EAAEC,UAAU;MACjBC,QAAQ;MACRC,SAAS;MACTC,QAAQ;AACRC,MAAAA,UAAU,EAAEC,eAAe;MAC3BC,SAAS;MACTC,SAAS;MACTC,QAAQ;MACRC,aAAa;MACbC,SAAS;MACTC,cAAc;AACdC,MAAAA,KAAK,EAAEC,UAAU;AACjBC,MAAAA,OAAO,EAAEC,YAAAA;AAEX,KAAC,GAAGvB,KAAK;AADJwB,IAAAA,cAAc,GAAAC,wBAAA,CACfzB,KAAK,EAAA0B,SAAA,CAAA,CAAA;AACT,EAAA,MAAMd,UAAU,GAAGG,SAAS,IAAIF,eAAe,IAAIJ,QAAQ,CAAA;AAE3D,EAAA,MAAMW,KAAK,GAAGO,QAAQ,CAACN,UAAU,CAAC,CAAA;AAClC,EAAA,MAAMd,KAAK,GAAGqB,MAAM,CAACC,MAAM,CAACC,mBAAmB,CAAC,CAACC,QAAQ,CAACvB,UAAW,CAAC,GAAGA,UAAU,GAAG,SAAS,CAAA;AAC/F,EAAA,MAAMc,OAAO,GAAGM,MAAM,CAACC,MAAM,CAACG,aAAa,CAAC,CAACD,QAAQ,CAACR,YAAa,CAAC,GAAGA,YAAY,GAAG,SAAS,CAAA;AAC/F,EAAA,MAAMU,UAAU,GAAG1B,KAAK,KAAKuB,mBAAmB,CAACI,KAAK,CAAA;AAEtD,EAAA,oBACEC,
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import React, { forwardRef, RefObject, useRef } from 'react';\nimport classNames from 'classnames';\nimport { ButtonsColorPalette, Comp } from '../../types';\nimport { Icon } from '../../components/icon';\nimport { StyledButton } from './styles';\nimport { ButtonProps, ButtonVariant } from './types';\nimport { Spinner } from '../../components/spinner';\nimport { useTheme } from '../theme';\nimport { ConditionalWrapper } from '../conditional-wrapper';\nimport { StyledGradientBorder } from '../gradient-border';\n\nconst COMPONENT_NAME = 'Button';\nconst CLASSNAME = 'redsift-button';\n\n/**\n * The Button is a semantic button that looks like a button.\n *\n * For a semantic link that looks like a button, please use the ButtonLink component.\n * For a semantic link that looks like a link, please use the Link component.\n * For a semantic button that looks like a link, please use the LinkButton component.\n */\nexport const Button: Comp<ButtonProps, HTMLButtonElement> = forwardRef((props, ref) => {\n const _ref = useRef<HTMLButtonElement>();\n const buttonRef = ref || _ref;\n\n const {\n children,\n className,\n color: propsColor,\n disabled,\n fullWidth,\n isActive,\n isDisabled: propsIsDisabled,\n isHovered,\n isLoading,\n leftIcon,\n leftIconProps,\n rightIcon,\n rightIconProps,\n theme: propsTheme,\n variant: propsVariant,\n ...forwardedProps\n } = props;\n const isDisabled = isLoading || propsIsDisabled || disabled;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : 'primary';\n const variant = Object.values(ButtonVariant).includes(propsVariant!) ? propsVariant : 'primary';\n const isGradient = color === ButtonsColorPalette.radar;\n\n return (\n <ConditionalWrapper\n condition={isGradient && variant === ButtonVariant.secondary}\n wrapper={(children) => (\n <StyledGradientBorder\n $color={color}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isHovered={isHovered}\n $theme={theme}\n >\n {children}\n </StyledGradientBorder>\n )}\n >\n <StyledButton\n type=\"button\"\n {...forwardedProps}\n $color={color}\n $fullWidth={fullWidth}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isGradient={isGradient}\n $isHovered={isHovered}\n $isLoading={isLoading}\n $theme={theme}\n $variant={variant}\n aria-disabled={isDisabled}\n className={classNames(Button.className, className)}\n disabled={isDisabled}\n ref={buttonRef as RefObject<HTMLButtonElement>}\n >\n {leftIcon ? <Icon icon={leftIcon} aria-hidden=\"true\" className=\"left\" {...leftIconProps} /> : null}\n {isLoading ? <Spinner size=\"small\" color={variant === ButtonVariant.primary ? 'grey-l1' : 'grey-l2'} /> : null}\n <span>{children}</span>\n {rightIcon ? <Icon icon={rightIcon} aria-hidden=\"true\" className=\"right\" {...rightIconProps} /> : null}\n </StyledButton>\n </ConditionalWrapper>\n );\n});\nButton.className = CLASSNAME;\nButton.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","Button","forwardRef","props","ref","_ref","useRef","buttonRef","children","className","color","propsColor","disabled","fullWidth","isActive","isDisabled","propsIsDisabled","isHovered","isLoading","leftIcon","leftIconProps","rightIcon","rightIconProps","theme","propsTheme","variant","propsVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","ButtonVariant","isGradient","radar","React","createElement","ConditionalWrapper","condition","secondary","wrapper","StyledGradientBorder","$color","$isActive","$isDisabled","$isHovered","$theme","StyledButton","_extends","type","$fullWidth","$isGradient","$isLoading","$variant","classNames","Icon","icon","Spinner","size","primary","displayName"],"mappings":";;;;;;;;;;;;;AAWA,MAAMA,cAAc,GAAG,QAAQ,CAAA;AAC/B,MAAMC,SAAS,GAAG,gBAAgB,CAAA;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,MAA4C,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;AACrF,EAAA,MAAMC,IAAI,GAAGC,MAAM,EAAqB,CAAA;AACxC,EAAA,MAAMC,SAAS,GAAGH,GAAG,IAAIC,IAAI,CAAA;EAE7B,MAAM;MACJG,QAAQ;MACRC,SAAS;AACTC,MAAAA,KAAK,EAAEC,UAAU;MACjBC,QAAQ;MACRC,SAAS;MACTC,QAAQ;AACRC,MAAAA,UAAU,EAAEC,eAAe;MAC3BC,SAAS;MACTC,SAAS;MACTC,QAAQ;MACRC,aAAa;MACbC,SAAS;MACTC,cAAc;AACdC,MAAAA,KAAK,EAAEC,UAAU;AACjBC,MAAAA,OAAO,EAAEC,YAAAA;AAEX,KAAC,GAAGvB,KAAK;AADJwB,IAAAA,cAAc,GAAAC,wBAAA,CACfzB,KAAK,EAAA0B,SAAA,CAAA,CAAA;AACT,EAAA,MAAMd,UAAU,GAAGG,SAAS,IAAIF,eAAe,IAAIJ,QAAQ,CA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|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { StyledButtonGroup } from './styles.js';
|
|
5
5
|
import { ButtonGroupVariant } from './types.js';
|
|
@@ -36,7 +36,7 @@ const ButtonGroup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
36
36
|
var _key;
|
|
37
37
|
if (isComponent('MenuButton')(child) || isComponent('Select')(child) || isComponent('Dialog')(child) || isComponent('Popover')(child) || isComponent('Tooltip')(child)) {
|
|
38
38
|
var _child$key;
|
|
39
|
-
return /*#__PURE__*/
|
|
39
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
40
40
|
color,
|
|
41
41
|
theme,
|
|
42
42
|
variant,
|
|
@@ -44,7 +44,7 @@ const ButtonGroup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
44
44
|
triggerClassName: index === 0 ? 'first-button' : index === childArray.length - 1 ? 'last-button' : 'middle-button'
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
return /*#__PURE__*/
|
|
47
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
48
48
|
color,
|
|
49
49
|
theme,
|
|
50
50
|
variant,
|
|
@@ -52,7 +52,7 @@ const ButtonGroup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
52
52
|
className: index === 0 ? 'first-button' : index === childArray.length - 1 ? 'last-button' : 'middle-button'
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
|
-
return /*#__PURE__*/
|
|
55
|
+
return /*#__PURE__*/React.createElement(StyledButtonGroup, _extends({}, forwardedProps, {
|
|
56
56
|
className: classNames(ButtonGroup.className, className),
|
|
57
57
|
ref: ref,
|
|
58
58
|
$color: color,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.js","sources":["../../../src/components/button-group/ButtonGroup.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\nimport { ButtonsColorPalette, Comp } from '../../types';\nimport { StyledButtonGroup } from './styles';\nimport { ButtonGroupProps, ButtonGroupVariant } from './types';\nimport { filterComponents, isComponent } from '../../utils';\nimport { useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'ButtonGroup';\nconst CLASSNAME = 'redsift-button-group';\n\n/**\n * The ButtonGroup component.\n */\nexport const ButtonGroup: Comp<ButtonGroupProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, color: propsColor, theme: propsTheme, variant: propsVariant, ...forwardedProps } = props;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : 'primary';\n const variant = Object.values(ButtonGroupVariant).includes(propsVariant!) ? propsVariant : 'primary';\n\n /**\n * Create an array containing only valid children being either Button, IconButton, ButtonLink, MenuButton or Select.\n */\n const childArray = filterComponents([\n 'Button',\n 'IconButton',\n 'ButtonLink',\n 'MenuButton',\n 'Select',\n 'Dialog',\n 'Popover',\n 'Tooltip',\n ])(children);\n const buttons = childArray.map((child, index) => {\n if (\n isComponent('MenuButton')(child) ||\n isComponent('Select')(child) ||\n isComponent('Dialog')(child) ||\n isComponent('Popover')(child) ||\n isComponent('Tooltip')(child)\n ) {\n return React.cloneElement(child, {\n color,\n theme,\n variant,\n key: child.key ?? index,\n triggerClassName:\n index === 0 ? 'first-button' : index === childArray.length - 1 ? 'last-button' : 'middle-button',\n });\n }\n return React.cloneElement(child, {\n color,\n theme,\n variant,\n key: (child as React.ReactElement<any, string | React.JSXElementConstructor<any>>).key ?? index,\n className: index === 0 ? 'first-button' : index === childArray.length - 1 ? 'last-button' : 'middle-button',\n });\n });\n\n return (\n <StyledButtonGroup\n {...forwardedProps}\n className={classNames(ButtonGroup.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n $color={color}\n $variant={variant}\n $theme={theme}\n >\n {buttons}\n </StyledButtonGroup>\n );\n});\nButtonGroup.className = CLASSNAME;\nButtonGroup.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","ButtonGroup","forwardRef","props","ref","children","className","color","propsColor","theme","propsTheme","variant","propsVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","ButtonGroupVariant","childArray","filterComponents","buttons","map","child","index","_key","isComponent","_child$key","React","cloneElement","key","triggerClassName","length","createElement","StyledButtonGroup","_extends","classNames","$color","$variant","$theme","displayName"],"mappings":";;;;;;;;;;;AAQA,MAAMA,cAAc,GAAG,aAAa,CAAA;AACpC,MAAMC,SAAS,GAAG,sBAAsB,CAAA;;AAExC;AACA;AACA;AACO,MAAMC,WAAmD,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC5F,MAAM;MAAEC,QAAQ;MAAEC,SAAS;AAAEC,MAAAA,KAAK,EAAEC,UAAU;AAAEC,MAAAA,KAAK,EAAEC,UAAU;AAAEC,MAAAA,OAAO,EAAEC,YAAAA;AAAgC,KAAC,GAAGT,KAAK;AAAxBU,IAAAA,cAAc,GAAAC,wBAAA,CAAKX,KAAK,EAAAY,SAAA,CAAA,CAAA;AAErH,EAAA,MAAMN,KAAK,GAAGO,QAAQ,CAACN,UAAU,CAAC,CAAA;AAClC,EAAA,MAAMH,KAAK,GAAGU,MAAM,CAACC,MAAM,CAACC,mBAAmB,CAAC,CAACC,QAAQ,CAACZ,UAAW,CAAC,GAAGA,UAAU,GAAG,SAAS,CAAA;AAC/F,EAAA,MAAMG,OAAO,GAAGM,MAAM,CAACC,MAAM,CAACG,kBAAkB,CAAC,CAACD,QAAQ,CAACR,YAAa,CAAC,GAAGA,YAAY,GAAG,SAAS,CAAA;;AAEpG;AACF;AACA;EACE,MAAMU,UAAU,GAAGC,gBAAgB,CAAC,CAClC,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,CACV,CAAC,CAAClB,QAAQ,CAAC,CAAA;EACZ,MAAMmB,OAAO,GAAGF,UAAU,CAACG,GAAG,CAAC,CAACC,KAAK,EAAEC,KAAK,KAAK;AAAA,IAAA,IAAAC,IAAA,CAAA;AAC/C,IAAA,IACEC,WAAW,CAAC,YAAY,CAAC,CAACH,KAAK,CAAC,IAChCG,WAAW,CAAC,QAAQ,CAAC,CAACH,KAAK,CAAC,IAC5BG,WAAW,CAAC,QAAQ,CAAC,CAACH,KAAK,CAAC,IAC5BG,WAAW,CAAC,SAAS,CAAC,CAACH,KAAK,CAAC,IAC7BG,WAAW,CAAC,SAAS,CAAC,CAACH,KAAK,CAAC,EAC7B;AAAA,MAAA,IAAAI,UAAA,CAAA;AACA,MAAA,oBAAOC,
|
|
1
|
+
{"version":3,"file":"ButtonGroup.js","sources":["../../../src/components/button-group/ButtonGroup.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\nimport { ButtonsColorPalette, Comp } from '../../types';\nimport { StyledButtonGroup } from './styles';\nimport { ButtonGroupProps, ButtonGroupVariant } from './types';\nimport { filterComponents, isComponent } from '../../utils';\nimport { useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'ButtonGroup';\nconst CLASSNAME = 'redsift-button-group';\n\n/**\n * The ButtonGroup component.\n */\nexport const ButtonGroup: Comp<ButtonGroupProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, color: propsColor, theme: propsTheme, variant: propsVariant, ...forwardedProps } = props;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : 'primary';\n const variant = Object.values(ButtonGroupVariant).includes(propsVariant!) ? propsVariant : 'primary';\n\n /**\n * Create an array containing only valid children being either Button, IconButton, ButtonLink, MenuButton or Select.\n */\n const childArray = filterComponents([\n 'Button',\n 'IconButton',\n 'ButtonLink',\n 'MenuButton',\n 'Select',\n 'Dialog',\n 'Popover',\n 'Tooltip',\n ])(children);\n const buttons = childArray.map((child, index) => {\n if (\n isComponent('MenuButton')(child) ||\n isComponent('Select')(child) ||\n isComponent('Dialog')(child) ||\n isComponent('Popover')(child) ||\n isComponent('Tooltip')(child)\n ) {\n return React.cloneElement(child, {\n color,\n theme,\n variant,\n key: child.key ?? index,\n triggerClassName:\n index === 0 ? 'first-button' : index === childArray.length - 1 ? 'last-button' : 'middle-button',\n });\n }\n return React.cloneElement(child, {\n color,\n theme,\n variant,\n key: (child as React.ReactElement<any, string | React.JSXElementConstructor<any>>).key ?? index,\n className: index === 0 ? 'first-button' : index === childArray.length - 1 ? 'last-button' : 'middle-button',\n });\n });\n\n return (\n <StyledButtonGroup\n {...forwardedProps}\n className={classNames(ButtonGroup.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n $color={color}\n $variant={variant}\n $theme={theme}\n >\n {buttons}\n </StyledButtonGroup>\n );\n});\nButtonGroup.className = CLASSNAME;\nButtonGroup.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","ButtonGroup","forwardRef","props","ref","children","className","color","propsColor","theme","propsTheme","variant","propsVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","ButtonGroupVariant","childArray","filterComponents","buttons","map","child","index","_key","isComponent","_child$key","React","cloneElement","key","triggerClassName","length","createElement","StyledButtonGroup","_extends","classNames","$color","$variant","$theme","displayName"],"mappings":";;;;;;;;;;;AAQA,MAAMA,cAAc,GAAG,aAAa,CAAA;AACpC,MAAMC,SAAS,GAAG,sBAAsB,CAAA;;AAExC;AACA;AACA;AACO,MAAMC,WAAmD,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC5F,MAAM;MAAEC,QAAQ;MAAEC,SAAS;AAAEC,MAAAA,KAAK,EAAEC,UAAU;AAAEC,MAAAA,KAAK,EAAEC,UAAU;AAAEC,MAAAA,OAAO,EAAEC,YAAAA;AAAgC,KAAC,GAAGT,KAAK;AAAxBU,IAAAA,cAAc,GAAAC,wBAAA,CAAKX,KAAK,EAAAY,SAAA,CAAA,CAAA;AAErH,EAAA,MAAMN,KAAK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MAAM,GAAG,CAAC,GAAG,aAAa,GAAG,eAAA;AACrF,OAAC,CAAC,CAAA;AACJ,KAAA;AACA,IAAA,oBAAOJ,KAAK,CAACC,YAAY,CAACN,KAAK,EAAE;MAC/BnB,KAAK;MACLE,KAAK;MACLE,OAAO;MACPsB,GAAG,EAAA,CAAAL,IAAA,GAAGF,KAAK,CAAwEO,GAAG,MAAA,IAAA,IAAAL,IAAA,KAAA,KAAA,CAAA,GAAAA,IAAA,GAAID,KAAK;AAC/FrB,MAAAA,SAAS,EAAEqB,KAAK,KAAK,CAAC,GAAG,cAAc,GAAGA,KAAK,KAAKL,UAAU,CAACa,MAAM,GAAG,CAAC,GAAG,aAAa,GAAG,eAAA;AAC9F,KAAC,CAAC,CAAA;AACJ,GAAC,CAAC,CAAA;EAEF,oBACEJ,KAAA,CAAAK,aAAA,CAACC,iBAAiB,EAAAC,QAAA,KACZzB,cAAc,EAAA;IAClBP,SAAS,EAAEiC,UAAU,CAACtC,WAAW,CAACK,SAAS,EAAEA,SAAS,CAAE;AACxDF,IAAAA,GAAG,EAAEA,GAAiC;AACtCoC,IAAAA,MAAM,EAAEjC,KAAM;AACdkC,IAAAA,QAAQ,EAAE9B,OAAQ;AAClB+B,IAAAA,MAAM,EAAEjC,KAAAA;AAAM,GAAA,CAAA,EAEbe,OACgB,CAAC,CAAA;AAExB,CAAC,EAAC;AACFvB,WAAW,CAACK,SAAS,GAAGN,SAAS,CAAA;AACjCC,WAAW,CAAC0C,WAAW,GAAG5C,cAAc;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { StyledGradientBorder } from '../gradient-border/index.js';
|
|
5
5
|
import { ButtonVariant } from '../button/types.js';
|
|
@@ -43,16 +43,16 @@ const ButtonLink = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
43
43
|
const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
|
|
44
44
|
const variant = Object.values(ButtonVariant).includes(propsVariant) ? propsVariant : 'primary';
|
|
45
45
|
const isGradient = color === ButtonsColorPalette.radar;
|
|
46
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/React.createElement(ConditionalWrapper, {
|
|
47
47
|
condition: isGradient && variant === ButtonVariant.secondary,
|
|
48
|
-
wrapper: children => /*#__PURE__*/
|
|
48
|
+
wrapper: children => /*#__PURE__*/React.createElement(StyledGradientBorder, {
|
|
49
49
|
$color: color,
|
|
50
50
|
$isActive: isActive,
|
|
51
51
|
$isDisabled: isDisabled,
|
|
52
52
|
$isHovered: isHovered,
|
|
53
53
|
$theme: theme
|
|
54
54
|
}, children)
|
|
55
|
-
}, /*#__PURE__*/
|
|
55
|
+
}, /*#__PURE__*/React.createElement(StyledButton, _extends({
|
|
56
56
|
as: as || 'a',
|
|
57
57
|
role: "link",
|
|
58
58
|
tabIndex: !isDisabled ? 0 : undefined
|
|
@@ -68,11 +68,11 @@ const ButtonLink = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
68
68
|
href: !isDisabled ? href : undefined,
|
|
69
69
|
ref: ref,
|
|
70
70
|
target: target
|
|
71
|
-
}), leftIcon ? /*#__PURE__*/
|
|
71
|
+
}), leftIcon ? /*#__PURE__*/React.createElement(Icon, _extends({
|
|
72
72
|
icon: leftIcon,
|
|
73
73
|
"aria-hidden": "true",
|
|
74
74
|
className: "left"
|
|
75
|
-
}, leftIconProps)) : null, /*#__PURE__*/
|
|
75
|
+
}, leftIconProps)) : null, /*#__PURE__*/React.createElement("span", null, children), rightIcon ? /*#__PURE__*/React.createElement(Icon, _extends({
|
|
76
76
|
icon: rightIcon,
|
|
77
77
|
"aria-hidden": "true",
|
|
78
78
|
className: "right"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonLink.js","sources":["../../../src/components/button-link/ButtonLink.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\nimport { Comp, ButtonsColorPalette } from '../../types';\nimport { Icon } from '../icon';\nimport { ButtonVariant, StyledButton } from '../button';\nimport { ButtonLinkProps } from './types';\nimport { useTheme } from '../theme';\nimport { ConditionalWrapper } from '../conditional-wrapper';\nimport { StyledGradientBorder } from '../gradient-border';\n\nconst COMPONENT_NAME = 'ButtonLink';\nconst CLASSNAME = 'redsift-button-link';\n\n/**\n * The ButtonLink is a semantic link that looks like a button.\n *\n * For a semantic button that looks like a button, please use the Button component.\n * For a semantic link that looks like a link, please use the Link component.\n * For a semantic button that looks like a link, please use the LinkButton component.\n */\nexport const ButtonLink: Comp<ButtonLinkProps, HTMLAnchorElement> = forwardRef((props, ref) => {\n const {\n as,\n children,\n className,\n color: propsColor,\n href,\n isActive,\n isDisabled,\n isHovered,\n leftIcon,\n leftIconProps,\n rightIcon,\n rightIconProps,\n target,\n theme: propsTheme,\n variant: propsVariant,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : 'primary';\n const variant = Object.values(ButtonVariant).includes(propsVariant!) ? propsVariant : 'primary';\n const isGradient = color === ButtonsColorPalette.radar;\n\n return (\n <ConditionalWrapper\n condition={isGradient && variant === ButtonVariant.secondary}\n wrapper={(children) => (\n <StyledGradientBorder\n $color={color}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isHovered={isHovered}\n $theme={theme}\n >\n {children}\n </StyledGradientBorder>\n )}\n >\n <StyledButton\n as={(as || 'a') as any}\n role=\"link\"\n tabIndex={!isDisabled ? 0 : undefined}\n {...forwardedProps}\n $color={color}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isHovered={isHovered}\n $isGradient={isGradient}\n $theme={theme}\n $variant={variant}\n className={classNames(ButtonLink.className, className)}\n href={!isDisabled ? href : undefined}\n ref={ref as RefObject<HTMLAnchorElement>}\n target={target}\n >\n {leftIcon ? <Icon icon={leftIcon} aria-hidden=\"true\" className=\"left\" {...leftIconProps} /> : null}\n <span>{children}</span>\n {rightIcon ? <Icon icon={rightIcon} aria-hidden=\"true\" className=\"right\" {...rightIconProps} /> : null}\n </StyledButton>\n </ConditionalWrapper>\n );\n});\nButtonLink.className = CLASSNAME;\nButtonLink.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","ButtonLink","forwardRef","props","ref","as","children","className","color","propsColor","href","isActive","isDisabled","isHovered","leftIcon","leftIconProps","rightIcon","rightIconProps","target","theme","propsTheme","variant","propsVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","ButtonVariant","isGradient","radar","React","createElement","ConditionalWrapper","condition","secondary","wrapper","StyledGradientBorder","$color","$isActive","$isDisabled","$isHovered","$theme","StyledButton","_extends","role","tabIndex","undefined","$isGradient","$variant","classNames","Icon","icon","displayName"],"mappings":";;;;;;;;;;;;AAUA,MAAMA,cAAc,GAAG,YAAY,CAAA;AACnC,MAAMC,SAAS,GAAG,qBAAqB,CAAA;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,UAAoD,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC7F,MAAM;MACJC,EAAE;MACFC,QAAQ;MACRC,SAAS;AACTC,MAAAA,KAAK,EAAEC,UAAU;MACjBC,IAAI;MACJC,QAAQ;MACRC,UAAU;MACVC,SAAS;MACTC,QAAQ;MACRC,aAAa;MACbC,SAAS;MACTC,cAAc;MACdC,MAAM;AACNC,MAAAA,KAAK,EAAEC,UAAU;AACjBC,MAAAA,OAAO,EAAEC,YAAAA;AAEX,KAAC,GAAGnB,KAAK;AADJoB,IAAAA,cAAc,GAAAC,wBAAA,CACfrB,KAAK,EAAAsB,SAAA,CAAA,CAAA;AAET,EAAA,MAAMN,KAAK,GAAGO,QAAQ,CAACN,UAAU,CAAC,CAAA;AAClC,EAAA,MAAMZ,KAAK,GAAGmB,MAAM,CAACC,MAAM,CAACC,mBAAmB,CAAC,CAACC,QAAQ,CAACrB,UAAW,CAAC,GAAGA,UAAU,GAAG,SAAS,CAAA;AAC/F,EAAA,MAAMY,OAAO,GAAGM,MAAM,CAACC,MAAM,CAACG,aAAa,CAAC,CAACD,QAAQ,CAACR,YAAa,CAAC,GAAGA,YAAY,GAAG,SAAS,CAAA;AAC/F,EAAA,MAAMU,UAAU,GAAGxB,KAAK,KAAKqB,mBAAmB,CAACI,KAAK,CAAA;AAEtD,EAAA,oBACEC,
|
|
1
|
+
{"version":3,"file":"ButtonLink.js","sources":["../../../src/components/button-link/ButtonLink.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\nimport { Comp, ButtonsColorPalette } from '../../types';\nimport { Icon } from '../icon';\nimport { ButtonVariant, StyledButton } from '../button';\nimport { ButtonLinkProps } from './types';\nimport { useTheme } from '../theme';\nimport { ConditionalWrapper } from '../conditional-wrapper';\nimport { StyledGradientBorder } from '../gradient-border';\n\nconst COMPONENT_NAME = 'ButtonLink';\nconst CLASSNAME = 'redsift-button-link';\n\n/**\n * The ButtonLink is a semantic link that looks like a button.\n *\n * For a semantic button that looks like a button, please use the Button component.\n * For a semantic link that looks like a link, please use the Link component.\n * For a semantic button that looks like a link, please use the LinkButton component.\n */\nexport const ButtonLink: Comp<ButtonLinkProps, HTMLAnchorElement> = forwardRef((props, ref) => {\n const {\n as,\n children,\n className,\n color: propsColor,\n href,\n isActive,\n isDisabled,\n isHovered,\n leftIcon,\n leftIconProps,\n rightIcon,\n rightIconProps,\n target,\n theme: propsTheme,\n variant: propsVariant,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : 'primary';\n const variant = Object.values(ButtonVariant).includes(propsVariant!) ? propsVariant : 'primary';\n const isGradient = color === ButtonsColorPalette.radar;\n\n return (\n <ConditionalWrapper\n condition={isGradient && variant === ButtonVariant.secondary}\n wrapper={(children) => (\n <StyledGradientBorder\n $color={color}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isHovered={isHovered}\n $theme={theme}\n >\n {children}\n </StyledGradientBorder>\n )}\n >\n <StyledButton\n as={(as || 'a') as any}\n role=\"link\"\n tabIndex={!isDisabled ? 0 : undefined}\n {...forwardedProps}\n $color={color}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isHovered={isHovered}\n $isGradient={isGradient}\n $theme={theme}\n $variant={variant}\n className={classNames(ButtonLink.className, className)}\n href={!isDisabled ? href : undefined}\n ref={ref as RefObject<HTMLAnchorElement>}\n target={target}\n >\n {leftIcon ? <Icon icon={leftIcon} aria-hidden=\"true\" className=\"left\" {...leftIconProps} /> : null}\n <span>{children}</span>\n {rightIcon ? <Icon icon={rightIcon} aria-hidden=\"true\" className=\"right\" {...rightIconProps} /> : null}\n </StyledButton>\n </ConditionalWrapper>\n );\n});\nButtonLink.className = CLASSNAME;\nButtonLink.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","ButtonLink","forwardRef","props","ref","as","children","className","color","propsColor","href","isActive","isDisabled","isHovered","leftIcon","leftIconProps","rightIcon","rightIconProps","target","theme","propsTheme","variant","propsVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","ButtonVariant","isGradient","radar","React","createElement","ConditionalWrapper","condition","secondary","wrapper","StyledGradientBorder","$color","$isActive","$isDisabled","$isHovered","$theme","StyledButton","_extends","role","tabIndex","undefined","$isGradient","$variant","classNames","Icon","icon","displayName"],"mappings":";;;;;;;;;;;;AAUA,MAAMA,cAAc,GAAG,YAAY,CAAA;AACnC,MAAMC,SAAS,GAAG,qBAAqB,CAAA;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,UAAoD,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG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AC,EAAC;AACFhB,UAAU,CAACM,SAAS,GAAGP,SAAS,CAAA;AAChCC,UAAU,CAACuD,WAAW,GAAGzD,cAAc;;;;"}
|
package/components/card/Card.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import
|
|
2
|
+
import React, { forwardRef, useState, useEffect, useCallback } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import intlMessages from './intl/index.js';
|
|
5
5
|
import { mdiChevronDown, mdiChevronUp } from '@redsift/icons';
|
|
@@ -46,26 +46,26 @@ const BaseCard = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
46
46
|
setIsCollapsed(collapsed);
|
|
47
47
|
}
|
|
48
48
|
}, [onCollapse]);
|
|
49
|
-
const [[header], [body], [actions]] = partitionComponents(
|
|
50
|
-
return /*#__PURE__*/
|
|
49
|
+
const [[header], [body], [actions]] = partitionComponents(React.Children.toArray(children), [isComponent('CardHeader'), isComponent('CardBody'), isComponent('CardActions')]);
|
|
50
|
+
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
51
51
|
value: {
|
|
52
52
|
theme
|
|
53
53
|
}
|
|
54
|
-
}, /*#__PURE__*/
|
|
54
|
+
}, /*#__PURE__*/React.createElement(StyledCard, _extends({}, forwardedProps, {
|
|
55
55
|
className: classNames(BaseCard.className, className),
|
|
56
56
|
ref: ref,
|
|
57
57
|
$isCollapsed: isCollapsed,
|
|
58
58
|
$theme: theme
|
|
59
|
-
}), header || isCollapsible ? /*#__PURE__*/
|
|
59
|
+
}), header || isCollapsible ? /*#__PURE__*/React.createElement("div", {
|
|
60
60
|
className: `${BaseCard.className}__header`
|
|
61
|
-
}, header && isComponent('CardHeader')(header) ? header : null, isCollapsible ? /*#__PURE__*/
|
|
61
|
+
}, header && isComponent('CardHeader')(header) ? header : null, isCollapsible ? /*#__PURE__*/React.createElement(IconButton, {
|
|
62
62
|
theme: theme,
|
|
63
63
|
"aria-label": format(isCollapsed ? 'expand' : 'collapse'),
|
|
64
64
|
className: `${BaseCard.className}-header__icon-button`,
|
|
65
65
|
color: "grey",
|
|
66
66
|
icon: isCollapsed ? mdiChevronDown : mdiChevronUp,
|
|
67
67
|
onClick: () => handleCollapse(!isCollapsed)
|
|
68
|
-
}) : null) : null, body || actions ? /*#__PURE__*/
|
|
68
|
+
}) : null) : null, body || actions ? /*#__PURE__*/React.createElement("div", {
|
|
69
69
|
className: `${BaseCard.className}__content`
|
|
70
70
|
}, body && isComponent('CardBody')(body) ? body : null, actions && isComponent('CardActions')(actions) ? actions : null) : null));
|
|
71
71
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../../src/components/card/Card.tsx"],"sourcesContent":["import React, { forwardRef, RefObject, useCallback, useEffect, useState } from 'react';\nimport classNames from 'classnames';\n\nimport { useMessageFormatter } from '../../react-aria/react-aria/i18n';\nimport intlMessages from './intl';\n\nimport { mdiChevronDown, mdiChevronUp } from '@redsift/icons';\nimport { IconButton } from '../icon-button';\nimport { Comp } from '../../types';\nimport { StyledCard } from './styles';\nimport { CardProps } from './types';\nimport { partitionComponents } from '../../utils/partitionComponents';\nimport { isComponent } from '../../utils/isComponent';\nimport { CardHeader } from '../card-header';\nimport { CardBody } from '../card-body';\nimport { CardActions } from '../card-actions';\nimport { ThemeProvider, useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'Card';\nconst CLASSNAME = 'redsift-card';\n\n/**\n * The Card component.\n */\nconst BaseCard: Comp<CardProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n children,\n className,\n defaultCollapsed,\n isCollapsed: propsIsCollapsed,\n isCollapsible,\n onCollapse,\n theme: propsTheme,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n\n const format = useMessageFormatter(intlMessages);\n\n const [isCollapsed, setIsCollapsed] = useState(propsIsCollapsed ?? defaultCollapsed);\n\n useEffect(() => {\n setIsCollapsed(propsIsCollapsed ?? defaultCollapsed);\n }, [propsIsCollapsed, defaultCollapsed]);\n\n const handleCollapse = useCallback(\n (collapsed: boolean) => {\n if (onCollapse) {\n onCollapse(collapsed);\n }\n if (propsIsCollapsed === undefined || propsIsCollapsed === null) {\n setIsCollapsed(collapsed);\n }\n },\n [onCollapse]\n );\n\n const [[header], [body], [actions]] = partitionComponents(React.Children.toArray(children), [\n isComponent('CardHeader'),\n isComponent('CardBody'),\n isComponent('CardActions'),\n ]);\n\n return (\n <ThemeProvider value={{ theme }}>\n <StyledCard\n {...forwardedProps}\n className={classNames(BaseCard.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n $isCollapsed={isCollapsed}\n $theme={theme}\n >\n {header || isCollapsible ? (\n <div className={`${BaseCard.className}__header`}>\n {header && isComponent('CardHeader')(header) ? header : null}\n\n {isCollapsible ? (\n <IconButton\n theme={theme}\n aria-label={format(isCollapsed ? 'expand' : 'collapse')}\n className={`${BaseCard.className}-header__icon-button`}\n color=\"grey\"\n icon={isCollapsed ? mdiChevronDown : mdiChevronUp}\n onClick={() => handleCollapse(!isCollapsed)}\n />\n ) : null}\n </div>\n ) : null}\n\n {body || actions ? (\n <div className={`${BaseCard.className}__content`}>\n {body && isComponent('CardBody')(body) ? body : null}\n {actions && isComponent('CardActions')(actions) ? actions : null}\n </div>\n ) : null}\n </StyledCard>\n </ThemeProvider>\n );\n});\nBaseCard.className = CLASSNAME;\nBaseCard.displayName = COMPONENT_NAME;\n\nexport const Card = Object.assign(BaseCard, {\n Header: CardHeader,\n Body: CardBody,\n Actions: CardActions,\n});\n"],"names":["COMPONENT_NAME","CLASSNAME","BaseCard","forwardRef","props","ref","children","className","defaultCollapsed","isCollapsed","propsIsCollapsed","isCollapsible","onCollapse","theme","propsTheme","forwardedProps","_objectWithoutProperties","_excluded","useTheme","format","useMessageFormatter","intlMessages","setIsCollapsed","useState","useEffect","handleCollapse","useCallback","collapsed","undefined","header","body","actions","partitionComponents","React","Children","toArray","isComponent","createElement","ThemeProvider","value","StyledCard","_extends","classNames","$isCollapsed","$theme","IconButton","color","icon","mdiChevronDown","mdiChevronUp","onClick","displayName","Card","Object","assign","Header","CardHeader","Body","CardBody","Actions","CardActions"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,MAAMA,cAAc,GAAG,MAAM,CAAA;AAC7B,MAAMC,SAAS,GAAG,cAAc,CAAA;;AAEhC;AACA;AACA;AACA,MAAMC,QAAyC,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC3E,MAAM;MACJC,QAAQ;MACRC,SAAS;MACTC,gBAAgB;AAChBC,MAAAA,WAAW,EAAEC,gBAAgB;MAC7BC,aAAa;MACbC,UAAU;AACVC,MAAAA,KAAK,EAAEC,UAAAA;AAET,KAAC,GAAGV,KAAK;AADJW,IAAAA,cAAc,GAAAC,wBAAA,CACfZ,KAAK,EAAAa,SAAA,CAAA,CAAA;AAET,EAAA,MAAMJ,KAAK,GAAGK,QAAQ,CAACJ,UAAU,CAAC,CAAA;AAElC,EAAA,MAAMK,MAAM,GAAGC,mBAAmB,CAACC,YAAY,CAAC,CAAA;AAEhD,EAAA,MAAM,CAACZ,WAAW,EAAEa,cAAc,CAAC,GAAGC,QAAQ,CAACb,gBAAgB,aAAhBA,gBAAgB,KAAA,KAAA,CAAA,GAAhBA,gBAAgB,GAAIF,gBAAgB,CAAC,CAAA;AAEpFgB,EAAAA,SAAS,CAAC,MAAM;IACdF,cAAc,CAACZ,gBAAgB,KAAhBA,IAAAA,IAAAA,gBAAgB,cAAhBA,gBAAgB,GAAIF,gBAAgB,CAAC,CAAA;AACtD,GAAC,EAAE,CAACE,gBAAgB,EAAEF,gBAAgB,CAAC,CAAC,CAAA;AAExC,EAAA,MAAMiB,cAAc,GAAGC,WAAW,CAC/BC,SAAkB,IAAK;AACtB,IAAA,IAAIf,UAAU,EAAE;MACdA,UAAU,CAACe,SAAS,CAAC,CAAA;AACvB,KAAA;AACA,IAAA,IAAIjB,gBAAgB,KAAKkB,SAAS,IAAIlB,gBAAgB,KAAK,IAAI,EAAE;MAC/DY,cAAc,CAACK,SAAS,CAAC,CAAA;AAC3B,KAAA;AACF,GAAC,EACD,CAACf,UAAU,CACb,CAAC,CAAA;AAED,EAAA,MAAM,CAAC,CAACiB,MAAM,CAAC,EAAE,CAACC,IAAI,CAAC,EAAE,CAACC,OAAO,CAAC,CAAC,GAAGC,mBAAmB,CAACC,
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../src/components/card/Card.tsx"],"sourcesContent":["import React, { forwardRef, RefObject, useCallback, useEffect, useState } from 'react';\nimport classNames from 'classnames';\n\nimport { useMessageFormatter } from '../../react-aria/react-aria/i18n';\nimport intlMessages from './intl';\n\nimport { mdiChevronDown, mdiChevronUp } from '@redsift/icons';\nimport { IconButton } from '../icon-button';\nimport { Comp } from '../../types';\nimport { StyledCard } from './styles';\nimport { CardProps } from './types';\nimport { partitionComponents } from '../../utils/partitionComponents';\nimport { isComponent } from '../../utils/isComponent';\nimport { CardHeader } from '../card-header';\nimport { CardBody } from '../card-body';\nimport { CardActions } from '../card-actions';\nimport { ThemeProvider, useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'Card';\nconst CLASSNAME = 'redsift-card';\n\n/**\n * The Card component.\n */\nconst BaseCard: Comp<CardProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n children,\n className,\n defaultCollapsed,\n isCollapsed: propsIsCollapsed,\n isCollapsible,\n onCollapse,\n theme: propsTheme,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n\n const format = useMessageFormatter(intlMessages);\n\n const [isCollapsed, setIsCollapsed] = useState(propsIsCollapsed ?? defaultCollapsed);\n\n useEffect(() => {\n setIsCollapsed(propsIsCollapsed ?? defaultCollapsed);\n }, [propsIsCollapsed, defaultCollapsed]);\n\n const handleCollapse = useCallback(\n (collapsed: boolean) => {\n if (onCollapse) {\n onCollapse(collapsed);\n }\n if (propsIsCollapsed === undefined || propsIsCollapsed === null) {\n setIsCollapsed(collapsed);\n }\n },\n [onCollapse]\n );\n\n const [[header], [body], [actions]] = partitionComponents(React.Children.toArray(children), [\n isComponent('CardHeader'),\n isComponent('CardBody'),\n isComponent('CardActions'),\n ]);\n\n return (\n <ThemeProvider value={{ theme }}>\n <StyledCard\n {...forwardedProps}\n className={classNames(BaseCard.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n $isCollapsed={isCollapsed}\n $theme={theme}\n >\n {header || isCollapsible ? (\n <div className={`${BaseCard.className}__header`}>\n {header && isComponent('CardHeader')(header) ? header : null}\n\n {isCollapsible ? (\n <IconButton\n theme={theme}\n aria-label={format(isCollapsed ? 'expand' : 'collapse')}\n className={`${BaseCard.className}-header__icon-button`}\n color=\"grey\"\n icon={isCollapsed ? mdiChevronDown : mdiChevronUp}\n onClick={() => handleCollapse(!isCollapsed)}\n />\n ) : null}\n </div>\n ) : null}\n\n {body || actions ? (\n <div className={`${BaseCard.className}__content`}>\n {body && isComponent('CardBody')(body) ? body : null}\n {actions && isComponent('CardActions')(actions) ? actions : null}\n </div>\n ) : null}\n </StyledCard>\n </ThemeProvider>\n );\n});\nBaseCard.className = CLASSNAME;\nBaseCard.displayName = COMPONENT_NAME;\n\nexport const Card = Object.assign(BaseCard, {\n Header: CardHeader,\n Body: CardBody,\n Actions: CardActions,\n});\n"],"names":["COMPONENT_NAME","CLASSNAME","BaseCard","forwardRef","props","ref","children","className","defaultCollapsed","isCollapsed","propsIsCollapsed","isCollapsible","onCollapse","theme","propsTheme","forwardedProps","_objectWithoutProperties","_excluded","useTheme","format","useMessageFormatter","intlMessages","setIsCollapsed","useState","useEffect","handleCollapse","useCallback","collapsed","undefined","header","body","actions","partitionComponents","React","Children","toArray","isComponent","createElement","ThemeProvider","value","StyledCard","_extends","classNames","$isCollapsed","$theme","IconButton","color","icon","mdiChevronDown","mdiChevronUp","onClick","displayName","Card","Object","assign","Header","CardHeader","Body","CardBody","Actions","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AAC,MAAM;AACZC,IAAAA,IAAI,EAAEtC,WAAW,GAAGuC,cAAc,GAAGC,YAAa;AAClDC,IAAAA,OAAO,EAAEA,MAAMzB,cAAc,CAAC,CAAChB,WAAW,CAAA;AAAE,GAC7C,CAAC,GACA,IACD,CAAC,GACJ,IAAI,EAEPqB,IAAI,IAAIC,OAAO,gBACdE,KAAA,CAAAI,aAAA,CAAA,KAAA,EAAA;AAAK9B,IAAAA,SAAS,EAAG,CAAA,EAAEL,QAAQ,CAACK,SAAU,CAAA,SAAA,CAAA;AAAW,GAAA,EAC9CuB,IAAI,IAAIM,WAAW,CAAC,UAAU,CAAC,CAACN,IAAI,CAAC,GAAGA,IAAI,GAAG,IAAI,EACnDC,OAAO,IAAIK,WAAW,CAAC,aAAa,CAAC,CAACL,OAAO,CAAC,GAAGA,OAAO,GAAG,IACzD,CAAC,GACJ,IACM,CACC,CAAC,CAAA;AAEpB,CAAC,CAAC,CAAA;AACF7B,QAAQ,CAACK,SAAS,GAAGN,SAAS,CAAA;AAC9BC,QAAQ,CAACiD,WAAW,GAAGnD,cAAc,CAAA;AAE9B,MAAMoD,IAAI,GAAGC,MAAM,CAACC,MAAM,CAACpD,QAAQ,EAAE;AAC1CqD,EAAAA,MAAM,EAAEC,UAAU;AAClBC,EAAAA,IAAI,EAAEC,QAAQ;AACdC,EAAAA,OAAO,EAAEC,WAAAA;AACX,CAAC;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { StyledCardActions } from './styles.js';
|
|
5
5
|
|
|
@@ -18,7 +18,7 @@ const CardActions = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
18
18
|
flexDirection = 'row'
|
|
19
19
|
} = props,
|
|
20
20
|
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
21
|
-
return /*#__PURE__*/
|
|
21
|
+
return /*#__PURE__*/React.createElement(StyledCardActions, _extends({
|
|
22
22
|
display: display,
|
|
23
23
|
flexDirection: flexDirection
|
|
24
24
|
}, forwardedProps, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardActions.js","sources":["../../../src/components/card-actions/CardActions.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\n\nimport { Comp } from '../../types';\nimport { StyledCardActions } from './styles';\nimport { CardActionsProps } from './types';\n\nconst COMPONENT_NAME = 'CardActions';\nconst CLASSNAME = 'redsift-card-actions';\n\n/**\n * The CardActions component.\n */\nexport const CardActions: Comp<CardActionsProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, display = 'flex', flexDirection = 'row', ...forwardedProps } = props;\n\n return (\n <StyledCardActions\n display={display}\n flexDirection={flexDirection}\n {...forwardedProps}\n className={classNames(CardActions.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n >\n {children}\n </StyledCardActions>\n );\n});\nCardActions.className = CLASSNAME;\nCardActions.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","CardActions","forwardRef","props","ref","children","className","display","flexDirection","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","StyledCardActions","_extends","classNames","displayName"],"mappings":";;;;;;AAOA,MAAMA,cAAc,GAAG,aAAa,CAAA;AACpC,MAAMC,SAAS,GAAG,sBAAsB,CAAA;;AAExC;AACA;AACA;AACO,MAAMC,WAAmD,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC5F,MAAM;MAAEC,QAAQ;MAAEC,SAAS;AAAEC,MAAAA,OAAO,GAAG,MAAM;AAAEC,MAAAA,aAAa,GAAG,KAAA;AAAyB,KAAC,GAAGL,KAAK;AAAxBM,IAAAA,cAAc,GAAAC,wBAAA,CAAKP,KAAK,EAAAQ,SAAA,CAAA,CAAA;AAEjG,EAAA,oBACEC,
|
|
1
|
+
{"version":3,"file":"CardActions.js","sources":["../../../src/components/card-actions/CardActions.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\n\nimport { Comp } from '../../types';\nimport { StyledCardActions } from './styles';\nimport { CardActionsProps } from './types';\n\nconst COMPONENT_NAME = 'CardActions';\nconst CLASSNAME = 'redsift-card-actions';\n\n/**\n * The CardActions component.\n */\nexport const CardActions: Comp<CardActionsProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, display = 'flex', flexDirection = 'row', ...forwardedProps } = props;\n\n return (\n <StyledCardActions\n display={display}\n flexDirection={flexDirection}\n {...forwardedProps}\n className={classNames(CardActions.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n >\n {children}\n </StyledCardActions>\n );\n});\nCardActions.className = CLASSNAME;\nCardActions.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","CardActions","forwardRef","props","ref","children","className","display","flexDirection","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","StyledCardActions","_extends","classNames","displayName"],"mappings":";;;;;;AAOA,MAAMA,cAAc,GAAG,aAAa,CAAA;AACpC,MAAMC,SAAS,GAAG,sBAAsB,CAAA;;AAExC;AACA;AACA;AACO,MAAMC,WAAmD,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC5F,MAAM;MAAEC,QAAQ;MAAEC,SAAS;AAAEC,MAAAA,OAAO,GAAG,MAAM;AAAEC,MAAAA,aAAa,GAAG,KAAA;AAAyB,KAAC,GAAGL,KAAK;AAAxBM,IAAAA,cAAc,GAAAC,wBAAA,CAAKP,KAAK,EAAAQ,SAAA,CAAA,CAAA;AAEjG,EAAA,oBACEC,KAAA,CAAAC,aAAA,CAACC,iBAAiB,EAAAC,QAAA,CAAA;AAChBR,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,aAAa,EAAEA,aAAAA;AAAc,GAAA,EACzBC,cAAc,EAAA;IAClBH,SAAS,EAAEU,UAAU,CAACf,WAAW,CAACK,SAAS,EAAEA,SAAS,CAAE;AACxDF,IAAAA,GAAG,EAAEA,GAAAA;AAAiC,GAAA,CAAA,EAErCC,QACgB,CAAC,CAAA;AAExB,CAAC,EAAC;AACFJ,WAAW,CAACK,SAAS,GAAGN,SAAS,CAAA;AACjCC,WAAW,CAACgB,WAAW,GAAGlB,cAAc;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { StyledCardBody } from './styles.js';
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ const CardBody = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
16
16
|
className
|
|
17
17
|
} = props,
|
|
18
18
|
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
19
|
-
return /*#__PURE__*/
|
|
19
|
+
return /*#__PURE__*/React.createElement(StyledCardBody, _extends({}, forwardedProps, {
|
|
20
20
|
className: classNames(CardBody.className, className),
|
|
21
21
|
ref: ref
|
|
22
22
|
}), children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardBody.js","sources":["../../../src/components/card-body/CardBody.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\n\nimport { Comp } from '../../types';\nimport { StyledCardBody } from './styles';\nimport { CardBodyProps } from './types';\n\nconst COMPONENT_NAME = 'CardBody';\nconst CLASSNAME = 'redsift-card-body';\n\n/**\n * The CardBody component.\n */\nexport const CardBody: Comp<CardBodyProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, ...forwardedProps } = props;\n\n return (\n <StyledCardBody\n {...forwardedProps}\n className={classNames(CardBody.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n >\n {children}\n </StyledCardBody>\n );\n});\nCardBody.className = CLASSNAME;\nCardBody.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","CardBody","forwardRef","props","ref","children","className","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","StyledCardBody","_extends","classNames","displayName"],"mappings":";;;;;;AAOA,MAAMA,cAAc,GAAG,UAAU,CAAA;AACjC,MAAMC,SAAS,GAAG,mBAAmB,CAAA;;AAErC;AACA;AACA;AACO,MAAMC,QAA6C,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACtF,MAAM;MAAEC,QAAQ;AAAEC,MAAAA,SAAAA;AAA6B,KAAC,GAAGH,KAAK;AAAxBI,IAAAA,cAAc,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA,CAAA,CAAA;EAExD,oBACEC,
|
|
1
|
+
{"version":3,"file":"CardBody.js","sources":["../../../src/components/card-body/CardBody.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\n\nimport { Comp } from '../../types';\nimport { StyledCardBody } from './styles';\nimport { CardBodyProps } from './types';\n\nconst COMPONENT_NAME = 'CardBody';\nconst CLASSNAME = 'redsift-card-body';\n\n/**\n * The CardBody component.\n */\nexport const CardBody: Comp<CardBodyProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, ...forwardedProps } = props;\n\n return (\n <StyledCardBody\n {...forwardedProps}\n className={classNames(CardBody.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n >\n {children}\n </StyledCardBody>\n );\n});\nCardBody.className = CLASSNAME;\nCardBody.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","CardBody","forwardRef","props","ref","children","className","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","StyledCardBody","_extends","classNames","displayName"],"mappings":";;;;;;AAOA,MAAMA,cAAc,GAAG,UAAU,CAAA;AACjC,MAAMC,SAAS,GAAG,mBAAmB,CAAA;;AAErC;AACA;AACA;AACO,MAAMC,QAA6C,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACtF,MAAM;MAAEC,QAAQ;AAAEC,MAAAA,SAAAA;AAA6B,KAAC,GAAGH,KAAK;AAAxBI,IAAAA,cAAc,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA,CAAA,CAAA;EAExD,oBACEC,KAAA,CAAAC,aAAA,CAACC,cAAc,EAAAC,QAAA,KACTN,cAAc,EAAA;IAClBD,SAAS,EAAEQ,UAAU,CAACb,QAAQ,CAACK,SAAS,EAAEA,SAAS,CAAE;AACrDF,IAAAA,GAAG,EAAEA,GAAAA;AAAiC,GAAA,CAAA,EAErCC,QACa,CAAC,CAAA;AAErB,CAAC,EAAC;AACFJ,QAAQ,CAACK,SAAS,GAAGN,SAAS,CAAA;AAC9BC,QAAQ,CAACc,WAAW,GAAGhB,cAAc;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { StyledCardHeader } from './styles.js';
|
|
5
5
|
import { Skeleton } from '../skeleton/Skeleton.js';
|
|
@@ -25,25 +25,25 @@ const CardHeader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25
25
|
subheader
|
|
26
26
|
} = props,
|
|
27
27
|
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
28
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/React.createElement(StyledCardHeader, _extends({}, forwardedProps, {
|
|
29
29
|
className: classNames(CardHeader.className, className),
|
|
30
30
|
ref: ref
|
|
31
|
-
}), subheader ? /*#__PURE__*/
|
|
31
|
+
}), subheader ? /*#__PURE__*/React.createElement(Skeleton.Text, {
|
|
32
32
|
variant: "body",
|
|
33
33
|
isLoaded: !isLoading
|
|
34
|
-
}, /*#__PURE__*/
|
|
34
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
35
35
|
className: `${CardHeader.className}__subheader`
|
|
36
|
-
}, subheader)) : null, header ? /*#__PURE__*/
|
|
36
|
+
}, subheader)) : null, header ? /*#__PURE__*/React.createElement(Skeleton.Text, {
|
|
37
37
|
variant: (headingProps === null || headingProps === void 0 ? void 0 : headingProps.variant) || 'h2',
|
|
38
38
|
isLoaded: !isLoading,
|
|
39
39
|
marginTop: "10px",
|
|
40
40
|
marginBottom: "10px"
|
|
41
|
-
}, /*#__PURE__*/
|
|
41
|
+
}, /*#__PURE__*/React.createElement(Heading, _extends({
|
|
42
42
|
as: "h2",
|
|
43
43
|
color: "black",
|
|
44
44
|
className: `${CardHeader.className}__header`,
|
|
45
45
|
variant: "h2"
|
|
46
|
-
}, headingProps), icon ? /*#__PURE__*/
|
|
46
|
+
}, headingProps), icon ? /*#__PURE__*/React.createElement(Icon, _extends({
|
|
47
47
|
icon: icon,
|
|
48
48
|
"aria-hidden": "true",
|
|
49
49
|
size: "large"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardHeader.js","sources":["../../../src/components/card-header/CardHeader.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\n\nimport { Icon } from '../icon';\nimport { Heading } from '../heading';\nimport { Comp } from '../../types';\nimport { StyledCardHeader } from './styles';\nimport { CardHeaderProps } from './types';\nimport { Skeleton } from '../skeleton';\n\nconst COMPONENT_NAME = 'CardHeader';\nconst CLASSNAME = 'redsift-card-header';\n\n/**\n * The CardHeader component.\n */\nexport const CardHeader: Comp<CardHeaderProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, header, headingProps, icon, iconProps, isLoading, subheader, ...forwardedProps } = props;\n\n return (\n <StyledCardHeader\n {...forwardedProps}\n className={classNames(CardHeader.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n >\n {subheader ? (\n <Skeleton.Text variant=\"body\" isLoaded={!isLoading}>\n <div className={`${CardHeader.className}__subheader`}>{subheader}</div>\n </Skeleton.Text>\n ) : null}\n {header ? (\n <Skeleton.Text\n variant={headingProps?.variant || 'h2'}\n isLoaded={!isLoading}\n marginTop=\"10px\"\n marginBottom=\"10px\"\n >\n <Heading as=\"h2\" color=\"black\" className={`${CardHeader.className}__header`} variant=\"h2\" {...headingProps}>\n {icon ? <Icon icon={icon} aria-hidden=\"true\" size=\"large\" {...iconProps} /> : null}\n {header}\n </Heading>\n </Skeleton.Text>\n ) : null}\n {children}\n </StyledCardHeader>\n );\n});\nCardHeader.className = CLASSNAME;\nCardHeader.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","CardHeader","forwardRef","props","ref","children","className","header","headingProps","icon","iconProps","isLoading","subheader","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","StyledCardHeader","_extends","classNames","Skeleton","Text","variant","isLoaded","marginTop","marginBottom","Heading","as","color","Icon","size","displayName"],"mappings":";;;;;;;;;AAUA,MAAMA,cAAc,GAAG,YAAY,CAAA;AACnC,MAAMC,SAAS,GAAG,qBAAqB,CAAA;;AAEvC;AACA;AACA;AACO,MAAMC,UAAiD,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC1F,MAAM;MAAEC,QAAQ;MAAEC,SAAS;MAAEC,MAAM;MAAEC,YAAY;MAAEC,IAAI;MAAEC,SAAS;MAAEC,SAAS;AAAEC,MAAAA,SAAAA;AAA6B,KAAC,GAAGT,KAAK;AAAxBU,IAAAA,cAAc,GAAAC,wBAAA,CAAKX,KAAK,EAAAY,SAAA,CAAA,CAAA;EAErH,oBACEC,
|
|
1
|
+
{"version":3,"file":"CardHeader.js","sources":["../../../src/components/card-header/CardHeader.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\n\nimport { Icon } from '../icon';\nimport { Heading } from '../heading';\nimport { Comp } from '../../types';\nimport { StyledCardHeader } from './styles';\nimport { CardHeaderProps } from './types';\nimport { Skeleton } from '../skeleton';\n\nconst COMPONENT_NAME = 'CardHeader';\nconst CLASSNAME = 'redsift-card-header';\n\n/**\n * The CardHeader component.\n */\nexport const CardHeader: Comp<CardHeaderProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, header, headingProps, icon, iconProps, isLoading, subheader, ...forwardedProps } = props;\n\n return (\n <StyledCardHeader\n {...forwardedProps}\n className={classNames(CardHeader.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n >\n {subheader ? (\n <Skeleton.Text variant=\"body\" isLoaded={!isLoading}>\n <div className={`${CardHeader.className}__subheader`}>{subheader}</div>\n </Skeleton.Text>\n ) : null}\n {header ? (\n <Skeleton.Text\n variant={headingProps?.variant || 'h2'}\n isLoaded={!isLoading}\n marginTop=\"10px\"\n marginBottom=\"10px\"\n >\n <Heading as=\"h2\" color=\"black\" className={`${CardHeader.className}__header`} variant=\"h2\" {...headingProps}>\n {icon ? <Icon icon={icon} aria-hidden=\"true\" size=\"large\" {...iconProps} /> : null}\n {header}\n </Heading>\n </Skeleton.Text>\n ) : null}\n {children}\n </StyledCardHeader>\n );\n});\nCardHeader.className = CLASSNAME;\nCardHeader.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","CardHeader","forwardRef","props","ref","children","className","header","headingProps","icon","iconProps","isLoading","subheader","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","StyledCardHeader","_extends","classNames","Skeleton","Text","variant","isLoaded","marginTop","marginBottom","Heading","as","color","Icon","size","displayName"],"mappings":";;;;;;;;;AAUA,MAAMA,cAAc,GAAG,YAAY,CAAA;AACnC,MAAMC,SAAS,GAAG,qBAAqB,CAAA;;AAEvC;AACA;AACA;AACO,MAAMC,UAAiD,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC1F,MAAM;MAAEC,QAAQ;MAAEC,SAAS;MAAEC,MAAM;M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,IAAI,gBAAGO,KAAA,CAAAC,aAAA,CAACa,IAAI,EAAAX,QAAA,CAAA;AAACV,IAAAA,IAAI,EAAEA,IAAK;AAAC,IAAA,aAAA,EAAY,MAAM;AAACsB,IAAAA,IAAI,EAAC,OAAA;AAAO,GAAA,EAAKrB,SAAS,CAAG,CAAC,GAAG,IAAI,EACjFH,MACM,CACI,CAAC,GACd,IAAI,EACPF,QACe,CAAC,CAAA;AAEvB,CAAC,EAAC;AACFJ,UAAU,CAACK,SAAS,GAAGN,SAAS,CAAA;AAChCC,UAAU,CAAC+B,WAAW,GAAGjC,cAAc;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import
|
|
2
|
+
import React, { forwardRef, useContext, useState, useEffect, useCallback } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { mdiCheckboxMarked, mdiMinusBox, mdiCheckboxBlankOutline } from '@redsift/icons';
|
|
5
5
|
import { CheckboxGroupContext } from '../checkbox-group/context.js';
|
|
@@ -92,7 +92,7 @@ const Checkbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
92
92
|
onChange === null || onChange === void 0 ? void 0 : onChange(!isSelected, value, name, event, groupState);
|
|
93
93
|
}
|
|
94
94
|
}, [onChange, groupState, isSelected, propsIsSelected]);
|
|
95
|
-
return /*#__PURE__*/
|
|
95
|
+
return /*#__PURE__*/React.createElement(StyledCheckbox, _extends({}, forwardedProps, {
|
|
96
96
|
$isColored: isColored,
|
|
97
97
|
$isDisabled: isDisabled,
|
|
98
98
|
$isFocusVisible: isFocusVisible,
|
|
@@ -102,15 +102,15 @@ const Checkbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
102
102
|
$theme: theme,
|
|
103
103
|
className: classNames(Checkbox.className, className),
|
|
104
104
|
ref: ref
|
|
105
|
-
}), isSelected || isControlled && propsIsSelected ? /*#__PURE__*/
|
|
105
|
+
}), isSelected || isControlled && propsIsSelected ? /*#__PURE__*/React.createElement(Icon, {
|
|
106
106
|
icon: mdiCheckboxMarked
|
|
107
|
-
}) : isIndeterminate ? /*#__PURE__*/
|
|
107
|
+
}) : isIndeterminate ? /*#__PURE__*/React.createElement(Icon, {
|
|
108
108
|
icon: mdiMinusBox
|
|
109
|
-
}) : /*#__PURE__*/
|
|
109
|
+
}) : /*#__PURE__*/React.createElement(Icon, {
|
|
110
110
|
icon: mdiCheckboxBlankOutline
|
|
111
|
-
}), children ? /*#__PURE__*/
|
|
111
|
+
}), children ? /*#__PURE__*/React.createElement("span", {
|
|
112
112
|
className: "label"
|
|
113
|
-
}, children) : null, /*#__PURE__*/
|
|
113
|
+
}, children) : null, /*#__PURE__*/React.createElement("input", _extends({}, inputProps, focusProps, {
|
|
114
114
|
"aria-checked": isSelected || isControlled && propsIsSelected ? 'true' : isIndeterminate ? 'mixed' : 'false',
|
|
115
115
|
"aria-disabled": isDisabled,
|
|
116
116
|
"aria-invalid": isInvalid || isRequired && !(isSelected || isControlled && propsIsSelected),
|