@redsift/design-system 11.9.4 → 12.0.0-muiv5

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.
Files changed (112) hide show
  1. package/CONTRIBUTING.md +1 -5
  2. package/_internal/Alert2.js +9 -4
  3. package/_internal/Alert2.js.map +1 -1
  4. package/_internal/AppContent.js +9 -4
  5. package/_internal/AppContent.js.map +1 -1
  6. package/_internal/Badge2.js +9 -4
  7. package/_internal/Badge2.js.map +1 -1
  8. package/_internal/Breadcrumbs2.js +9 -4
  9. package/_internal/Breadcrumbs2.js.map +1 -1
  10. package/_internal/Button2.js +9 -4
  11. package/_internal/Button2.js.map +1 -1
  12. package/_internal/ButtonGroup.js +15 -6
  13. package/_internal/ButtonGroup.js.map +1 -1
  14. package/_internal/ButtonLink.js +1 -1
  15. package/_internal/Card2.js +9 -4
  16. package/_internal/Card2.js.map +1 -1
  17. package/_internal/CardActions.js +16 -12
  18. package/_internal/CardActions.js.map +1 -1
  19. package/_internal/CardBody.js +9 -4
  20. package/_internal/CardBody.js.map +1 -1
  21. package/_internal/CardHeader.js +13 -4
  22. package/_internal/CardHeader.js.map +1 -1
  23. package/_internal/Checkbox2.js +9 -4
  24. package/_internal/Checkbox2.js.map +1 -1
  25. package/_internal/CheckboxGroup.js +9 -4
  26. package/_internal/CheckboxGroup.js.map +1 -1
  27. package/_internal/DetailedCard.js +24 -12
  28. package/_internal/DetailedCard.js.map +1 -1
  29. package/_internal/Flexbox2.js +21 -16
  30. package/_internal/Flexbox2.js.map +1 -1
  31. package/_internal/Grid2.js +21 -16
  32. package/_internal/Grid2.js.map +1 -1
  33. package/_internal/GridItem.js +9 -4
  34. package/_internal/GridItem.js.map +1 -1
  35. package/_internal/Heading2.js +9 -4
  36. package/_internal/Heading2.js.map +1 -1
  37. package/_internal/Icon2.js +10 -5
  38. package/_internal/Icon2.js.map +1 -1
  39. package/_internal/IconButton.js +9 -4
  40. package/_internal/IconButton.js.map +1 -1
  41. package/_internal/IconButtonLink.js +1 -1
  42. package/_internal/Item2.js +16 -7
  43. package/_internal/Item2.js.map +1 -1
  44. package/_internal/Link2.js +9 -4
  45. package/_internal/Link2.js.map +1 -1
  46. package/_internal/LinkButton.js +2 -1
  47. package/_internal/LinkButton.js.map +1 -1
  48. package/_internal/Listbox2.js +14 -8
  49. package/_internal/Listbox2.js.map +1 -1
  50. package/_internal/Number2.js +10 -5
  51. package/_internal/Number2.js.map +1 -1
  52. package/_internal/NumberField.js +11 -6
  53. package/_internal/NumberField.js.map +1 -1
  54. package/_internal/Pill2.js +9 -4
  55. package/_internal/Pill2.js.map +1 -1
  56. package/_internal/ProgressBar.js +20 -11
  57. package/_internal/ProgressBar.js.map +1 -1
  58. package/_internal/Radio2.js +9 -4
  59. package/_internal/Radio2.js.map +1 -1
  60. package/_internal/RadioGroup.js +9 -4
  61. package/_internal/RadioGroup.js.map +1 -1
  62. package/_internal/Shield2.js +12 -7
  63. package/_internal/Shield2.js.map +1 -1
  64. package/_internal/SideNavigationMenu.js +1 -1
  65. package/_internal/Skeleton2.js +9 -4
  66. package/_internal/Skeleton2.js.map +1 -1
  67. package/_internal/SkeletonCircle.js +1 -1
  68. package/_internal/SkeletonText.js +1 -1
  69. package/_internal/Spinner2.js +9 -4
  70. package/_internal/Spinner2.js.map +1 -1
  71. package/_internal/Switch2.js +9 -4
  72. package/_internal/Switch2.js.map +1 -1
  73. package/_internal/SwitchGroup.js +9 -4
  74. package/_internal/SwitchGroup.js.map +1 -1
  75. package/_internal/Text2.js +13 -6
  76. package/_internal/Text2.js.map +1 -1
  77. package/_internal/TextArea.js +18 -12
  78. package/_internal/TextArea.js.map +1 -1
  79. package/_internal/TextField.js +12 -6
  80. package/_internal/TextField.js.map +1 -1
  81. package/_internal/_rollupPluginBabelHelpers.js +1 -1
  82. package/_internal/button.js +1 -1
  83. package/_internal/colors.js +1 -1
  84. package/_internal/icon-button.js +1 -1
  85. package/_internal/link.js +1 -1
  86. package/_internal/shared.js +1 -1
  87. package/_internal/styles.js +309 -217
  88. package/_internal/styles.js.map +1 -1
  89. package/_internal/styles2.js +202 -14
  90. package/_internal/styles2.js.map +1 -1
  91. package/_internal/styles3.js +30 -128
  92. package/_internal/styles3.js.map +1 -1
  93. package/_internal/styles4.js +129 -234
  94. package/_internal/styles4.js.map +1 -1
  95. package/_internal/styles5.js +227 -118
  96. package/_internal/styles5.js.map +1 -1
  97. package/_internal/styles6.js +128 -69
  98. package/_internal/styles6.js.map +1 -1
  99. package/_internal/styles7.js +84 -0
  100. package/_internal/styles7.js.map +1 -0
  101. package/_internal/text.js +1 -1
  102. package/_internal/types2.js.map +1 -1
  103. package/_internal/useFocusOnList.js +1 -1
  104. package/_internal/useFocusRing.js +1 -1
  105. package/_internal/useListboxItem.js.map +1 -1
  106. package/_internal/useLocalizedStringFormatter.js +1 -1
  107. package/_internal/useMessageFormatter.js +1 -1
  108. package/_internal/useNumberFormatter.js +1 -1
  109. package/index.d.ts +227 -136
  110. package/index.js +8 -164
  111. package/index.js.map +1 -1
  112. package/package.json +5 -6
package/CONTRIBUTING.md CHANGED
@@ -62,10 +62,6 @@ The Design System is following a monorepo architecture, providing multiple packa
62
62
 
63
63
  This package provides ready-to-use implementation of components with a customize style to fit Red Sift's use cases. It is based on all other packages.
64
64
 
65
- - _Deprecated_ `@redsift/design-system-legacy`
66
-
67
- This package contains all components prior to the 6.0.0 version. These components are deprecated and contributing to this package is discouraged since it will be removed in the future.
68
-
69
65
  Please make sure to work inside the correct package when making contribution.
70
66
 
71
67
  If you need something inside more than one package, do not duplicate the code. Place it inside one package, export it from this package and import it inside the others.
@@ -410,8 +406,8 @@ yarn build:charts
410
406
  yarn build:dashboard
411
407
  yarn build:design-system
412
408
  yarn build:icons
413
- yarn build:legacy
414
409
  yarn build:table
410
+ yarn build:products
415
411
  ```
416
412
 
417
413
  ## Publishing a release
@@ -3,13 +3,14 @@ import React__default, { forwardRef, useState, useEffect, useCallback } from 're
3
3
  import classNames from 'classnames';
4
4
  import { mdiClose, mdiAlert, mdiTriangleOutline, mdiCheckCircle, mdiCheck, mdiAlertCircle, mdiAlertOutline, mdiInformation, mdiInformationOutline } from '@redsift/icons';
5
5
  import styled, { css } from 'styled-components';
6
- import { i as baseStyling } from './styles4.js';
6
+ import { i as baseStyling } from './styles5.js';
7
7
  import { T as Theme, N as NotificationsColorPalette } from './colors.js';
8
8
  import { u as useMessageFormatter } from './useMessageFormatter.js';
9
9
  import { F as Flexbox } from './Flexbox2.js';
10
10
  import { T as Text } from './Text2.js';
11
11
  import { tz as RedsiftTypographyFontWeightSemiBold } from './redsift-design-tokens.js';
12
12
  import { I as IconButton } from './IconButton.js';
13
+ import { f as getStylingTransientProps } from './styles.js';
13
14
  import { u as useTheme } from './useTheme.js';
14
15
  import { a as Icon } from './Icon2.js';
15
16
 
@@ -127,6 +128,10 @@ const getVariant = (variant, styleVariant, theme) => {
127
128
  * The Alert component.
128
129
  */
129
130
  const Alert = /*#__PURE__*/forwardRef((props, ref) => {
131
+ const {
132
+ transientProps,
133
+ otherProps
134
+ } = getStylingTransientProps(props);
130
135
  const {
131
136
  children,
132
137
  className,
@@ -137,8 +142,8 @@ const Alert = /*#__PURE__*/forwardRef((props, ref) => {
137
142
  title,
138
143
  variant: propsVariant,
139
144
  styleVariant: propsStyleVariant
140
- } = props,
141
- forwardedProps = _objectWithoutProperties(props, _excluded);
145
+ } = otherProps,
146
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded);
142
147
  const theme = useTheme(propsTheme);
143
148
  const variant = Object.values(AlertVariant).includes(propsVariant) ? propsVariant : 'info';
144
149
  const styleVariant = Object.values(AlertStyleVariant).includes(propsStyleVariant) ? propsStyleVariant : 'default';
@@ -159,7 +164,7 @@ const Alert = /*#__PURE__*/forwardRef((props, ref) => {
159
164
  setIsClosed(true);
160
165
  }
161
166
  }, [onClose]);
162
- return /*#__PURE__*/React__default.createElement(StyledAlert, _extends({}, forwardedProps, {
167
+ return /*#__PURE__*/React__default.createElement(StyledAlert, _extends({}, forwardedProps, transientProps, {
163
168
  className: classNames(Alert.className, className),
164
169
  ref: ref,
165
170
  $hasTitle: Boolean(title),
@@ -1 +1 @@
1
- {"version":3,"file":"Alert2.js","sources":["../../src/components/alert/types.ts","../../src/components/alert/intl/index.ts","../../src/components/alert/styles.ts","../../src/components/alert/Alert.tsx"],"sourcesContent":["import { ComponentProps } from 'react';\nimport { ValueOf, StylingProps, Theme } from '../..';\n\n/**\n * Component variant.\n */\nexport const AlertVariant = {\n success: 'success',\n error: 'error',\n warning: 'warning',\n info: 'info',\n} as const;\nexport type AlertVariant = ValueOf<typeof AlertVariant>;\n\nexport const AlertStyleVariant = {\n default: 'default',\n minimal: 'minimal',\n} as const;\nexport type AlertStyleVariant = ValueOf<typeof AlertStyleVariant>;\n\n/**\n * Component props.\n */\nexport interface AlertProps extends ComponentProps<'div'>, StylingProps {\n /** Whether the component can be closed or not. */\n isClosable?: boolean;\n /** Whether the component is closed or not. Used for controlled version. */\n isClosed?: boolean;\n /** Method to handle component change. */\n onClose?(isClosed: boolean): void;\n /** Title. */\n title?: string;\n /** Theme. */\n theme?: Theme;\n /** Variant */\n variant?: AlertVariant;\n /** Style variant. */\n styleVariant?: AlertStyleVariant;\n}\n\nexport type StyledAlertProps = Omit<AlertProps, 'variant' | 'styleVariant'> & {\n $hasTitle: boolean;\n $isClosable: AlertProps['isClosable'];\n $isClosed: AlertProps['isClosed'];\n $variant: AlertProps['variant'];\n $theme: AlertProps['theme'];\n $styleVariant: AlertProps['styleVariant'];\n};\n","import enUS from './en-US.json';\nimport frFR from './fr-FR.json';\n\nexport default {\n 'en-US': enUS,\n 'fr-FR': frFR,\n};\n","import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { StyledAlertProps } from './types';\nimport { Theme } from '../../types';\n\n/**\n * Component style.\n */\nexport const StyledAlert = styled.div<StyledAlertProps>`\n ${baseStyling}\n\n padding: 16px;\n ${({ $hasTitle, $isClosable, $isClosed, $variant, $styleVariant, $theme }) => css`\n color: var(--redsift-color-neutral-${$theme === Theme.light ? 'x-dark-grey' : 'white'});\n display: ${!$isClosed ? 'block' : 'none'};\n background-color: ${$styleVariant == 'minimal'\n ? `var(--redsift-color-neutral-${$theme !== Theme.light ? 'x-dark-grey' : 'white'})`\n : `var(--redsift-color-${$theme}-components-alert-${$variant}-background)`};\n\n border: ${$styleVariant == 'minimal'\n ? `1px solid var(--redsift-color-${$theme}-components-alert-${$variant}-border)`\n : 'none'};\n border-radius: ${$styleVariant == 'minimal' ? '8px' : '4px'};\n\n .redsift-alert-header__icon-button {\n background-color: transparent;\n padding: 0px;\n .redsift-icon {\n color: var(--redsift-color-neutral-x-dark-grey);\n }\n\n &:hover,\n &:focus-visible {\n background-color: var(--redsift-color-notifications-${$variant}-active);\n }\n }\n\n .redsift-alert__content {\n margin-top: ${$hasTitle ? '8px' : '-24px'};\n margin-left: 38px;\n ${$isClosable\n ? css`\n margin-right: 24px;\n `\n : ''};\n }\n `}\n`;\n","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 {\n mdiAlert,\n mdiTriangleOutline,\n mdiAlertCircle,\n mdiAlertOutline,\n mdiCheck,\n mdiCheckCircle,\n mdiClose,\n mdiInformation,\n mdiInformationOutline,\n} from '@redsift/icons';\nimport { IconButton } from '../icon-button';\nimport { NotificationsColorPalette, Comp, Theme } from '../../types';\nimport { StyledAlert } from './styles';\nimport { AlertProps, AlertVariant, AlertStyleVariant } from './types';\nimport { Icon } from '../icon';\nimport { Text } from '../text';\nimport { Flexbox } from '../flexbox';\nimport { RedsiftTypographyFontWeightSemiBold } from '../../utils';\nimport { useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'Alert';\nconst CLASSNAME = 'redsift-alert';\n\nconst getVariant = (variant: AlertVariant, styleVariant: AlertStyleVariant, theme: Theme) => {\n switch (variant) {\n case AlertVariant.info:\n default:\n return {\n color: theme === Theme.light ? NotificationsColorPalette.info : 'white',\n icon: styleVariant == 'default' ? mdiInformation : mdiInformationOutline,\n };\n case AlertVariant.error:\n return {\n color: theme === Theme.light ? NotificationsColorPalette.error : 'white',\n icon: styleVariant == 'default' ? mdiAlertCircle : mdiAlertOutline,\n };\n case AlertVariant.success:\n return {\n color: theme === Theme.light ? NotificationsColorPalette.success : 'white',\n icon: styleVariant == 'default' ? mdiCheckCircle : mdiCheck,\n };\n case AlertVariant.warning:\n return {\n color: theme === Theme.light ? NotificationsColorPalette.warning : 'white',\n icon: styleVariant == 'default' ? mdiAlert : mdiTriangleOutline,\n };\n }\n};\n\n/**\n * The Alert component.\n */\nexport const Alert: Comp<AlertProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n children,\n className,\n isClosable,\n isClosed: propsIsClosed,\n onClose,\n theme: propsTheme,\n title,\n variant: propsVariant,\n styleVariant: propsStyleVariant,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n const variant = Object.values(AlertVariant).includes(propsVariant!) ? propsVariant : 'info';\n const styleVariant = Object.values(AlertStyleVariant).includes(propsStyleVariant!) ? propsStyleVariant : 'default';\n\n const format = useMessageFormatter(intlMessages);\n\n const { color, icon } = getVariant(variant!, styleVariant!, theme);\n const [isClosed, setIsClosed] = useState(propsIsClosed);\n\n useEffect(() => {\n setIsClosed(propsIsClosed);\n }, [propsIsClosed]);\n\n const handleClose = useCallback(() => {\n if (onClose) {\n onClose(true);\n }\n if (propsIsClosed === undefined || propsIsClosed === null) {\n setIsClosed(true);\n }\n }, [onClose]);\n\n return (\n <StyledAlert\n {...forwardedProps}\n className={classNames(Alert.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n $hasTitle={Boolean(title)}\n $isClosable={isClosable}\n $isClosed={isClosed}\n $theme={theme}\n $variant={variant}\n $styleVariant={styleVariant}\n >\n <Flexbox className={`${Alert.className}__header`} justifyContent=\"space-between\">\n <Flexbox className={`${Alert.className}-header__title`} gap=\"14px\" alignItems=\"center\">\n <Icon icon={icon} color={color} />\n {title ? <Text fontWeight={RedsiftTypographyFontWeightSemiBold}>{title}</Text> : null}\n </Flexbox>\n\n {isClosable ? (\n <IconButton\n aria-label={format('close')}\n className={`${Alert.className}-header__icon-button`}\n icon={mdiClose}\n onClick={handleClose}\n color={color}\n />\n ) : null}\n </Flexbox>\n\n {children ? <div className={`${Alert.className}__content`}>{children}</div> : null}\n </StyledAlert>\n );\n});\nAlert.className = CLASSNAME;\nAlert.displayName = COMPONENT_NAME;\n"],"names":["AlertVariant","success","error","warning","info","AlertStyleVariant","default","minimal","enUS","frFR","StyledAlert","styled","div","baseStyling","_ref","$hasTitle","$isClosable","$isClosed","$variant","$styleVariant","$theme","css","Theme","light","COMPONENT_NAME","CLASSNAME","getVariant","variant","styleVariant","theme","color","NotificationsColorPalette","icon","mdiInformation","mdiInformationOutline","mdiAlertCircle","mdiAlertOutline","mdiCheckCircle","mdiCheck","mdiAlert","mdiTriangleOutline","Alert","forwardRef","props","ref","children","className","isClosable","isClosed","propsIsClosed","onClose","propsTheme","title","propsVariant","propsStyleVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","includes","format","useMessageFormatter","intlMessages","setIsClosed","useState","useEffect","handleClose","useCallback","undefined","React","createElement","_extends","classNames","Boolean","Flexbox","justifyContent","gap","alignItems","Icon","Text","fontWeight","RedsiftTypographyFontWeightSemiBold","IconButton","mdiClose","onClick","displayName"],"mappings":";;;;;;;;;;;;;;;AAGA;AACA;AACA;AACO,MAAMA,YAAY,GAAG;AAC1BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,IAAI,EAAE,MAAA;AACR,EAAU;AAGH,MAAMC,iBAAiB,GAAG;AAC/BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,OAAO,EAAE,SAAA;AACX,EAAU;;AAGV;AACA;AACA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AC,EAETL,UAAU,gBACTwB,cAAA,CAAAC,aAAA,CAACY,UAAU,EAAA;IACT,YAAYtB,EAAAA,MAAM,CAAC,OAAO,CAAE;AAC5BhB,IAAAA,SAAS,EAAG,CAAA,EAAEL,KAAK,CAACK,SAAU,CAAsB,oBAAA,CAAA;AACpDd,IAAAA,IAAI,EAAEqD,QAAS;AACfC,IAAAA,OAAO,EAAElB,WAAY;AACrBtC,IAAAA,KAAK,EAAEA,KAAAA;GACR,CAAC,GACA,IACG,CAAC,EAETe,QAAQ,gBAAG0B,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAK1B,IAAAA,SAAS,EAAG,CAAA,EAAEL,KAAK,CAACK,SAAU,CAAA,SAAA,CAAA;AAAW,GAAA,EAAED,QAAc,CAAC,GAAG,IACnE,CAAC,CAAA;AAElB,CAAC,EAAC;AACFJ,KAAK,CAACK,SAAS,GAAGrB,SAAS,CAAA;AAC3BgB,KAAK,CAAC8C,WAAW,GAAG/D,cAAc;;;;"}
1
+ {"version":3,"file":"Alert2.js","sources":["../../src/components/alert/types.ts","../../src/components/alert/intl/index.ts","../../src/components/alert/styles.ts","../../src/components/alert/Alert.tsx"],"sourcesContent":["import { ComponentProps } from 'react';\nimport { ValueOf, StylingProps, StylingTransientProps, Theme } from '../..';\n\n/**\n * Component variant.\n */\nexport const AlertVariant = {\n success: 'success',\n error: 'error',\n warning: 'warning',\n info: 'info',\n} as const;\nexport type AlertVariant = ValueOf<typeof AlertVariant>;\n\nexport const AlertStyleVariant = {\n default: 'default',\n minimal: 'minimal',\n} as const;\nexport type AlertStyleVariant = ValueOf<typeof AlertStyleVariant>;\n\n/**\n * Component props.\n */\nexport interface AlertProps extends ComponentProps<'div'>, StylingProps {\n /** Whether the component can be closed or not. */\n isClosable?: boolean;\n /** Whether the component is closed or not. Used for controlled version. */\n isClosed?: boolean;\n /** Method to handle component change. */\n onClose?(isClosed: boolean): void;\n /** Title. */\n title?: string;\n /** Theme. */\n theme?: Theme;\n /** Variant */\n variant?: AlertVariant;\n /** Style variant. */\n styleVariant?: AlertStyleVariant;\n}\n\nexport interface StyledAlertProps extends ComponentProps<'div'>, StylingTransientProps {\n $hasTitle: boolean;\n $isClosable: AlertProps['isClosable'];\n $isClosed: AlertProps['isClosed'];\n $variant: AlertProps['variant'];\n $theme: AlertProps['theme'];\n $styleVariant: AlertProps['styleVariant'];\n}\n","import enUS from './en-US.json';\nimport frFR from './fr-FR.json';\n\nexport default {\n 'en-US': enUS,\n 'fr-FR': frFR,\n};\n","import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { StyledAlertProps } from './types';\nimport { Theme } from '../../types';\n\n/**\n * Component style.\n */\nexport const StyledAlert = styled.div<StyledAlertProps>`\n ${baseStyling}\n\n padding: 16px;\n ${({ $hasTitle, $isClosable, $isClosed, $variant, $styleVariant, $theme }) => css`\n color: var(--redsift-color-neutral-${$theme === Theme.light ? 'x-dark-grey' : 'white'});\n display: ${!$isClosed ? 'block' : 'none'};\n background-color: ${$styleVariant == 'minimal'\n ? `var(--redsift-color-neutral-${$theme !== Theme.light ? 'x-dark-grey' : 'white'})`\n : `var(--redsift-color-${$theme}-components-alert-${$variant}-background)`};\n\n border: ${$styleVariant == 'minimal'\n ? `1px solid var(--redsift-color-${$theme}-components-alert-${$variant}-border)`\n : 'none'};\n border-radius: ${$styleVariant == 'minimal' ? '8px' : '4px'};\n\n .redsift-alert-header__icon-button {\n background-color: transparent;\n padding: 0px;\n .redsift-icon {\n color: var(--redsift-color-neutral-x-dark-grey);\n }\n\n &:hover,\n &:focus-visible {\n background-color: var(--redsift-color-notifications-${$variant}-active);\n }\n }\n\n .redsift-alert__content {\n margin-top: ${$hasTitle ? '8px' : '-24px'};\n margin-left: 38px;\n ${$isClosable\n ? css`\n margin-right: 24px;\n `\n : ''};\n }\n `}\n`;\n","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 {\n mdiAlert,\n mdiTriangleOutline,\n mdiAlertCircle,\n mdiAlertOutline,\n mdiCheck,\n mdiCheckCircle,\n mdiClose,\n mdiInformation,\n mdiInformationOutline,\n} from '@redsift/icons';\nimport { IconButton } from '../icon-button';\nimport { NotificationsColorPalette, Comp, Theme, getStylingTransientProps } from '../../types';\nimport { StyledAlert } from './styles';\nimport { AlertProps, AlertVariant, AlertStyleVariant } from './types';\nimport { Icon } from '../icon';\nimport { Text } from '../text';\nimport { Flexbox } from '../flexbox';\nimport { RedsiftTypographyFontWeightSemiBold } from '../../utils';\nimport { useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'Alert';\nconst CLASSNAME = 'redsift-alert';\n\nconst getVariant = (variant: AlertVariant, styleVariant: AlertStyleVariant, theme: Theme) => {\n switch (variant) {\n case AlertVariant.info:\n default:\n return {\n color: theme === Theme.light ? NotificationsColorPalette.info : 'white',\n icon: styleVariant == 'default' ? mdiInformation : mdiInformationOutline,\n };\n case AlertVariant.error:\n return {\n color: theme === Theme.light ? NotificationsColorPalette.error : 'white',\n icon: styleVariant == 'default' ? mdiAlertCircle : mdiAlertOutline,\n };\n case AlertVariant.success:\n return {\n color: theme === Theme.light ? NotificationsColorPalette.success : 'white',\n icon: styleVariant == 'default' ? mdiCheckCircle : mdiCheck,\n };\n case AlertVariant.warning:\n return {\n color: theme === Theme.light ? NotificationsColorPalette.warning : 'white',\n icon: styleVariant == 'default' ? mdiAlert : mdiTriangleOutline,\n };\n }\n};\n\n/**\n * The Alert component.\n */\nexport const Alert: Comp<AlertProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { transientProps, otherProps } = getStylingTransientProps(props);\n\n const {\n children,\n className,\n isClosable,\n isClosed: propsIsClosed,\n onClose,\n theme: propsTheme,\n title,\n variant: propsVariant,\n styleVariant: propsStyleVariant,\n ...forwardedProps\n } = otherProps;\n\n const theme = useTheme(propsTheme);\n const variant = Object.values(AlertVariant).includes(propsVariant!) ? propsVariant : 'info';\n const styleVariant = Object.values(AlertStyleVariant).includes(propsStyleVariant!) ? propsStyleVariant : 'default';\n\n const format = useMessageFormatter(intlMessages);\n\n const { color, icon } = getVariant(variant!, styleVariant!, theme);\n const [isClosed, setIsClosed] = useState(propsIsClosed);\n\n useEffect(() => {\n setIsClosed(propsIsClosed);\n }, [propsIsClosed]);\n\n const handleClose = useCallback(() => {\n if (onClose) {\n onClose(true);\n }\n if (propsIsClosed === undefined || propsIsClosed === null) {\n setIsClosed(true);\n }\n }, [onClose]);\n\n return (\n <StyledAlert\n {...forwardedProps}\n {...transientProps}\n className={classNames(Alert.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n $hasTitle={Boolean(title)}\n $isClosable={isClosable}\n $isClosed={isClosed}\n $theme={theme}\n $variant={variant}\n $styleVariant={styleVariant}\n >\n <Flexbox className={`${Alert.className}__header`} justifyContent=\"space-between\">\n <Flexbox className={`${Alert.className}-header__title`} gap=\"14px\" alignItems=\"center\">\n <Icon icon={icon} color={color} />\n {title ? <Text fontWeight={RedsiftTypographyFontWeightSemiBold}>{title}</Text> : null}\n </Flexbox>\n\n {isClosable ? (\n <IconButton\n aria-label={format('close')}\n className={`${Alert.className}-header__icon-button`}\n icon={mdiClose}\n onClick={handleClose}\n color={color}\n />\n ) : null}\n </Flexbox>\n\n {children ? <div className={`${Alert.className}__content`}>{children}</div> : null}\n </StyledAlert>\n );\n});\nAlert.className = CLASSNAME;\nAlert.displayName = COMPONENT_NAME;\n"],"names":["AlertVariant","success","error","warning","info","AlertStyleVariant","default","minimal","enUS","frFR","StyledAlert","styled","div","baseStyling","_ref","$hasTitle","$isClosable","$isClosed","$variant","$styleVariant","$theme","css","Theme","light","COMPONENT_NAME","CLASSNAME","getVariant","variant","styleVariant","theme","color","NotificationsColorPalette","icon","mdiInformation","mdiInformationOutline","mdiAlertCircle","mdiAlertOutline","mdiCheckCircle","mdiCheck","mdiAlert","mdiTriangleOutline","Alert","forwardRef","props","ref","transientProps","otherProps","getStylingTransientProps","children","className","isClosable","isClosed","propsIsClosed","onClose","propsTheme","title","propsVariant","propsStyleVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","includes","format","useMessageFormatter","intlMessages","setIsClosed","useState","useEffect","handleClose","useCallback","undefined","React","createElement","_extends","classNames","Boolean","Flexbox","justifyContent","gap","alignItems","Icon","Text","fontWeight","RedsiftTypographyFontWeightSemiBold","IconButton","mdiClose","onClick","displayName"],"mappings":";;;;;;;;;;;;;;;;AAGA;AACA;AACA;AACO,MAAMA,YAAY,GAAG;AAC1BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,IAAI,EAAE,MAAA;AACR,EAAU;AAGH,MAAMC,iBAAiB,GAAG;AAC/BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,OAAO,EAAE,SAAA;AACX,EAAU;;AAGV;AACA;AACA;;;;;;;;;;;;ACnBA,mBAAe;AACb,EAAA,OAAO,EAAEC,IAAI;AACb,EAAA,OAAO,EAAEC,IAAAA;AACX,CAAC;;ACDD;AACA;AACA;AACO,MAAMC,WAAW,GAAGC,MAAM,CAACC,GAAsB,CAAA;AACxD,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA;AACA,EAAA,EAAIC,IAAA,IAAA;EAAA,IAAC;IAAEC,SAAS;IAAEC,WAAW;IAAEC,SAAS;IAAEC,QAAQ;IAAEC,aAAa;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAN,IAAA,CAAA;AAAA,EAAA,OAAKO,GAAI,CAAA;AACpF,uCAAyCD,EAAAA,MAAM,KAAKE,KAAK,CAACC,KAAK,GAAG,aAAa,GAAG,OAAQ,CAAA;AAC1F,aAAA,EAAe,CAACN,SAAS,GAAG,OAAO,GAAG,MAAO,CAAA;AAC7C,sBAAwBE,EAAAA,aAAa,IAAI,SAAS,GACzC,+BAA8BC,MAAM,KAAK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IACnE,CAAC,CAAA;AAElB,CAAC,EAAC;AACFP,KAAK,CAACQ,SAAS,GAAGxB,SAAS,CAAA;AAC3BgB,KAAK,CAACiD,WAAW,GAAGlE,cAAc;;;;"}
@@ -4,7 +4,8 @@ import classNames from 'classnames';
4
4
  import { A as AppContainerContext } from './context2.js';
5
5
  import { u as useIsLoaded } from './useIsLoaded.js';
6
6
  import styled, { css } from 'styled-components';
7
- import { j as baseContainer } from './styles4.js';
7
+ import { j as baseContainer } from './styles5.js';
8
+ import { i as getContainerStylingTransientProps } from './styles.js';
8
9
  import { u as useTheme } from './useTheme.js';
9
10
  import { A as AppSidePanelVariant } from './types.js';
10
11
 
@@ -65,18 +66,22 @@ const CLASSNAME = 'redsift-app-content';
65
66
  * The AppContent component.
66
67
  */
67
68
  const AppContent = /*#__PURE__*/forwardRef((props, ref) => {
69
+ const {
70
+ transientProps,
71
+ otherProps
72
+ } = getContainerStylingTransientProps(props);
68
73
  const {
69
74
  children,
70
75
  className,
71
76
  theme: propsTheme
72
- } = props,
73
- forwardedProps = _objectWithoutProperties(props, _excluded);
77
+ } = otherProps,
78
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded);
74
79
  const {
75
80
  isLoaded
76
81
  } = useIsLoaded();
77
82
  const appContainerState = useContext(AppContainerContext);
78
83
  const theme = useTheme(propsTheme);
79
- return /*#__PURE__*/React__default.createElement(StyledAppContent, _extends({}, forwardedProps, {
84
+ return /*#__PURE__*/React__default.createElement(StyledAppContent, _extends({}, forwardedProps, transientProps, {
80
85
  $isLoaded: isLoaded,
81
86
  $isSidePanelCollapsed: appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.shrinked : true,
82
87
  $isAppFullScreen: appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.hidden : false,
@@ -1 +1 @@
1
- {"version":3,"file":"AppContent.js","sources":["../../src/components/app-content/styles.ts","../../src/components/app-content/AppContent.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { baseContainer } from '../shared';\nimport { StyledAppContentProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledAppContent = styled.main<StyledAppContentProps>`\n padding: 16px 64px;\n ${baseContainer}\n\n ${({ $theme }) =>\n $theme\n ? css`\n background-color: var(--redsift-color-${$theme}-components-page-background);\n `\n : ''}\n box-sizing: border-box;\n min-height: calc(100vh - 92px);\n\n @media screen and (max-width: 768px) {\n padding: 0px;\n }\n\n ${({ $isSidePanelCollapsed, $isAppFullScreen }) =>\n $isAppFullScreen\n ? css`\n transform: translate(0px);\n width: calc(100%);\n `\n : !$isSidePanelCollapsed\n ? css`\n transform: translate(254px);\n width: calc(100% - 254px);\n `\n : css`\n transform: translate(68px);\n width: calc(100% - 68px);\n `}\n\n ${({ $isLoaded }) =>\n $isLoaded\n ? css`\n transition: transform 0.25s ease-out, width 0.25s ease-out;\n `\n : ''}\n`;\n","import React, { forwardRef, RefObject, useContext } from 'react';\nimport classNames from 'classnames';\nimport { Comp } from '../../types';\nimport { AppContainerContext } from '../app-container/context';\nimport { useIsLoaded } from '../../hooks/useIsLoaded';\nimport { StyledAppContent } from './styles';\nimport { AppContentProps } from './types';\nimport { AppSidePanelVariant } from '../app-side-panel';\nimport { useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'AppContent';\nconst CLASSNAME = 'redsift-app-content';\n\n/**\n * The AppContent component.\n */\nexport const AppContent: Comp<AppContentProps, HTMLElement> = forwardRef((props, ref) => {\n const { children, className, theme: propsTheme, ...forwardedProps } = props;\n\n const { isLoaded } = useIsLoaded();\n const appContainerState = useContext(AppContainerContext);\n const theme = useTheme(propsTheme);\n\n return (\n <StyledAppContent\n {...forwardedProps}\n $isLoaded={isLoaded}\n $isSidePanelCollapsed={\n appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.shrinked : true\n }\n $isAppFullScreen={appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.hidden : false}\n $theme={theme}\n className={classNames(AppContent.className, className)}\n ref={ref as RefObject<HTMLElement>}\n >\n {children}\n </StyledAppContent>\n );\n});\nAppContent.className = CLASSNAME;\nAppContent.displayName = COMPONENT_NAME;\n"],"names":["StyledAppContent","styled","main","baseContainer","_ref","$theme","css","_ref2","$isSidePanelCollapsed","$isAppFullScreen","_ref3","$isLoaded","COMPONENT_NAME","CLASSNAME","AppContent","forwardRef","props","ref","children","className","theme","propsTheme","forwardedProps","_objectWithoutProperties","_excluded","isLoaded","useIsLoaded","appContainerState","useContext","AppContainerContext","useTheme","React","createElement","_extends","sidePanelVariant","AppSidePanelVariant","shrinked","hidden","classNames","displayName"],"mappings":";;;;;;;;;;AAIA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAGC,MAAM,CAACC,IAA4B,CAAA;AACnE;AACA,EAAA,EAAIC,aAAc,CAAA;AAClB;AACA,EAAA,EAAIC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAD,IAAA,CAAA;EAAA,OACXC,MAAM,GACFC,GAAI,CAAA;AACZ,gDAAA,EAAkDD,MAAO,CAAA;AACzD,QAAA,CAAS,GACD,EAAE,CAAA;AAAA,CAAC,CAAA;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAIE,KAAA,IAAA;EAAA,IAAC;IAAEC,qBAAqB;AAAEC,IAAAA,gBAAAA;AAAiB,GAAC,GAAAF,KAAA,CAAA;EAAA,OAC5CE,gBAAgB,GACZH,GAAI,CAAA;AACZ;AACA;AACA,QAAA,CAAS,GACD,CAACE,qBAAqB,GACtBF,GAAI,CAAA;AACZ;AACA;AACA,QAAA,CAAS,GACDA,GAAI,CAAA;AACZ;AACA;AACA,QAAS,CAAA,CAAA;AAAA,CAAC,CAAA;AACV;AACA,EAAA,EAAII,KAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,SAAAA;AAAU,GAAC,GAAAD,KAAA,CAAA;EAAA,OACdC,SAAS,GACLL,GAAI,CAAA;AACZ;AACA,QAAA,CAAS,GACD,EAAE,CAAA;AAAA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ts","../../src/components/app-content/AppContent.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { baseContainer } from '../shared';\nimport { StyledAppContentProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledAppContent = styled.main<StyledAppContentProps>`\n padding: 16px 64px;\n ${baseContainer}\n\n ${({ $theme }) =>\n $theme\n ? css`\n background-color: var(--redsift-color-${$theme}-components-page-background);\n `\n : ''}\n box-sizing: border-box;\n min-height: calc(100vh - 92px);\n\n @media screen and (max-width: 768px) {\n padding: 0px;\n }\n\n ${({ $isSidePanelCollapsed, $isAppFullScreen }) =>\n $isAppFullScreen\n ? css`\n transform: translate(0px);\n width: calc(100%);\n `\n : !$isSidePanelCollapsed\n ? css`\n transform: translate(254px);\n width: calc(100% - 254px);\n `\n : css`\n transform: translate(68px);\n width: calc(100% - 68px);\n `}\n\n ${({ $isLoaded }) =>\n $isLoaded\n ? css`\n transition: transform 0.25s ease-out, width 0.25s ease-out;\n `\n : ''}\n`;\n","import React, { forwardRef, RefObject, useContext } from 'react';\nimport classNames from 'classnames';\nimport { Comp, getContainerStylingTransientProps } from '../../types';\nimport { AppContainerContext } from '../app-container/context';\nimport { useIsLoaded } from '../../hooks/useIsLoaded';\nimport { StyledAppContent } from './styles';\nimport { AppContentProps } from './types';\nimport { AppSidePanelVariant } from '../app-side-panel';\nimport { useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'AppContent';\nconst CLASSNAME = 'redsift-app-content';\n\n/**\n * The AppContent component.\n */\nexport const AppContent: Comp<AppContentProps, HTMLElement> = forwardRef((props, ref) => {\n const { transientProps, otherProps } = getContainerStylingTransientProps(props);\n\n const { children, className, theme: propsTheme, ...forwardedProps } = otherProps;\n\n const { isLoaded } = useIsLoaded();\n const appContainerState = useContext(AppContainerContext);\n const theme = useTheme(propsTheme);\n\n return (\n <StyledAppContent\n {...forwardedProps}\n {...transientProps}\n $isLoaded={isLoaded}\n $isSidePanelCollapsed={\n appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.shrinked : true\n }\n $isAppFullScreen={appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.hidden : false}\n $theme={theme}\n className={classNames(AppContent.className, className)}\n ref={ref as RefObject<HTMLElement>}\n >\n {children}\n </StyledAppContent>\n );\n});\nAppContent.className = CLASSNAME;\nAppContent.displayName = COMPONENT_NAME;\n"],"names":["StyledAppContent","styled","main","baseContainer","_ref","$theme","css","_ref2","$isSidePanelCollapsed","$isAppFullScreen","_ref3","$isLoaded","COMPONENT_NAME","CLASSNAME","AppContent","forwardRef","props","ref","transientProps","otherProps","getContainerStylingTransientProps","children","className","theme","propsTheme","forwardedProps","_objectWithoutProperties","_excluded","isLoaded","useIsLoaded","appContainerState","useContext","AppContainerContext","useTheme","React","createElement","_extends","sidePanelVariant","AppSidePanelVariant","shrinked","hidden","classNames","displayName"],"mappings":";;;;;;;;;;;AAIA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAGC,MAAM,CAACC,IAA4B,CAAA;AACnE;AACA,EAAA,EAAIC,aAAc,CAAA;AAClB;AACA,EAAA,EAAIC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAD,IAAA,CAAA;EAAA,OACXC,MAAM,GACFC,GAAI,CAAA;AACZ,gDAAA,EAAkDD,MAAO,CAAA;AACzD,QAAA,CAAS,GACD,EAAE,CAAA;AAAA,CAAC,CAAA;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAIE,KAAA,IAAA;EAAA,IAAC;IAAEC,qBAAqB;AAAEC,IAAAA,gBAAAA;AAAiB,GAAC,GAAAF,KAAA,CAAA;EAAA,OAC5CE,gBAAgB,GACZH,GAAI,CAAA;AACZ;AACA;AACA,QAAA,CAAS,GACD,CAACE,qBAAqB,GACtBF,GAAI,CAAA;AACZ;AACA;AACA,QAAA,CAAS,GACDA,GAAI,CAAA;AACZ;AACA;AACA,QAAS,CAAA,CAAA;AAAA,CAAC,CAAA;AACV;AACA,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S,EAAEmB,UAAU,CAAC3B,UAAU,CAACQ,SAAS,EAAEA,SAAS,CAAE;AACvDL,IAAAA,GAAG,EAAEA,GAAAA;AAA8B,GAAA,CAAA,EAElCI,QACe,CAAC,CAAA;AAEvB,CAAC,EAAC;AACFP,UAAU,CAACQ,SAAS,GAAGT,SAAS,CAAA;AAChCC,UAAU,CAAC4B,WAAW,GAAG9B,cAAc;;;;"}
@@ -3,7 +3,8 @@ import React__default, { forwardRef } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import styled, { css } from 'styled-components';
5
5
  import { T as Theme, f as PresentationColorPalette, N as NotificationsColorPalette } from './colors.js';
6
- import { i as baseStyling } from './styles4.js';
6
+ import { i as baseStyling } from './styles5.js';
7
+ import { f as getStylingTransientProps } from './styles.js';
7
8
  import { u as useTheme } from './useTheme.js';
8
9
 
9
10
  /**
@@ -112,6 +113,10 @@ const CLASSNAME = 'redsift-badge';
112
113
  * The Badge component.
113
114
  */
114
115
  const Badge = /*#__PURE__*/forwardRef((props, ref) => {
116
+ const {
117
+ transientProps,
118
+ otherProps
119
+ } = getStylingTransientProps(props);
115
120
  const {
116
121
  autoBreak,
117
122
  children,
@@ -120,12 +125,12 @@ const Badge = /*#__PURE__*/forwardRef((props, ref) => {
120
125
  isReversed,
121
126
  theme: propsTheme,
122
127
  variant: propsVariant
123
- } = props,
124
- forwardedProps = _objectWithoutProperties(props, _excluded);
128
+ } = otherProps,
129
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded);
125
130
  const theme = useTheme(propsTheme);
126
131
  const color = [...Object.values(NotificationsColorPalette), ...Object.values(PresentationColorPalette)].includes(propsColor) ? propsColor : 'question';
127
132
  const variant = Object.values(BadgeVariant).includes(propsVariant) ? propsVariant : 'dot';
128
- return /*#__PURE__*/React__default.createElement(StyledBadge, _extends({}, forwardedProps, {
133
+ return /*#__PURE__*/React__default.createElement(StyledBadge, _extends({}, forwardedProps, transientProps, {
129
134
  $autoBreak: autoBreak,
130
135
  $color: color,
131
136
  $isReversed: isReversed,
@@ -1 +1 @@
1
- {"version":3,"file":"Badge2.js","sources":["../../src/components/badge/types.ts","../../src/components/badge/styles.ts","../../src/components/badge/Badge.tsx"],"sourcesContent":["import { ComponentProps } from 'react';\nimport {\n NotificationsColorPalette,\n PresentationColorPalette,\n LayoutProps,\n PositioningProps,\n SpacingProps,\n ValueOf,\n Theme,\n} from '../../types';\n\n/**\n * Component variant.\n */\nexport const BadgeVariant = {\n dot: 'dot',\n standard: 'standard',\n} as const;\nexport type BadgeVariant = ValueOf<typeof BadgeVariant>;\n\n/**\n * Component props.\n */\nexport interface BadgeProps extends ComponentProps<'div'>, LayoutProps, SpacingProps, PositioningProps {\n /** Whether the badge should automatically break content. */\n autoBreak?: boolean;\n /** Color variant. The product colors are available but should only be used to display the Badge in the color of another product. To display a Badge with a color of the current product, use `default`. */\n color?: NotificationsColorPalette | PresentationColorPalette;\n /** Whether the Badge has its colors reversed or not. */\n isReversed?: boolean;\n /** Theme. */\n theme?: Theme;\n /** Badge variant. */\n variant?: BadgeVariant;\n}\n\nexport type StyledBadgeProps = Omit<BadgeProps, 'color' | 'variant' | 'isReversed' | 'autoBreak'> & {\n $autoBreak: BadgeProps['autoBreak'];\n $color: BadgeProps['color'];\n $isReversed: BadgeProps['isReversed'];\n $variant: BadgeProps['variant'];\n $theme: BadgeProps['theme'];\n};\n","import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { NotificationsColorPalette, PresentationColorPalette, Theme } from '../../types';\nimport { BadgeVariant, StyledBadgeProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledBadge = styled.div<StyledBadgeProps>`\n ${baseStyling}\n box-sizing: content-box;\n\n ${({ $color, $isReversed, $theme }) => {\n if ($isReversed) {\n return css`\n background-color: var(--redsift-color-neutral-${$theme === Theme.light ? 'white' : 'x-dark-grey'});\n\n &,\n .redsift-icon {\n color: ${Object.keys(PresentationColorPalette).includes($color!)\n ? `var(--redsift-color-presentation-${$color}-darker);`\n : Object.keys(NotificationsColorPalette).includes($color!)\n ? `var(--redsift-color-notifications-${$color}-primary);`\n : css`var(--redsift-color-neutral-x-dark-grey);`};\n }\n `;\n } else {\n return css`\n background-color: ${Object.keys(PresentationColorPalette).includes($color!)\n ? `var(--redsift-color-presentation-${$color}-darker);`\n : Object.keys(NotificationsColorPalette).includes($color!)\n ? `var(--redsift-color-notifications-${$color}-primary);`\n : css`var(--redsift-color-neutral-x-dark-grey);`};\n &,\n .redsift-icon {\n color: var(--redsift-color-neutral-white);\n }\n `;\n }\n }}\n\n ${({ $variant, $autoBreak }) => {\n switch ($variant) {\n case BadgeVariant.dot:\n return css`\n border-radius: 50%;\n height: 8px;\n margin-bottom: 12px;\n margin-right: 12px;\n width: 8px;\n `;\n case BadgeVariant.standard:\n default:\n return css`\n align-items: center;\n border-radius: 64px;\n display: inline-flex;\n gap: 4px;\n height: fit-content;\n justify-content: center;\n min-width: 8px;\n padding: 4px 6px;\n text-align: center;\n width: fit-content;\n word-break: ${$autoBreak ? 'break-word' : 'normal'};\n\n &,\n .redsift-icon,\n .redsift-number,\n .redsift-text {\n font-family: var(--redsift-typography-badge-font-family);\n font-size: var(--redsift-typography-badge-font-size);\n font-weight: var(--redsift-typography-badge-font-weight);\n line-height: var(--redsift-typography-badge-line-height);\n }\n\n .redsift-icon {\n width: unset;\n height: unset;\n\n > svg {\n width: 1em;\n height: 1em;\n }\n }\n `;\n }\n }}\n`;\n","import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\nimport { NotificationsColorPalette, Comp, PresentationColorPalette } from '../../types';\nimport { StyledBadge } from './styles';\nimport { BadgeProps, BadgeVariant } from './types';\nimport { useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'Badge';\nconst CLASSNAME = 'redsift-badge';\n\n/**\n * The Badge component.\n */\nexport const Badge: Comp<BadgeProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n autoBreak,\n children,\n className,\n color: propsColor,\n isReversed,\n theme: propsTheme,\n variant: propsVariant,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n const color = [...Object.values(NotificationsColorPalette), ...Object.values(PresentationColorPalette)].includes(\n propsColor!\n )\n ? propsColor\n : 'question';\n const variant = Object.values(BadgeVariant).includes(propsVariant!) ? propsVariant : 'dot';\n\n return (\n <StyledBadge\n {...forwardedProps}\n $autoBreak={autoBreak}\n $color={color}\n $isReversed={isReversed}\n $theme={theme}\n $variant={variant}\n className={classNames(Badge.className, `${Badge.className}-${variant}`, className)}\n ref={ref as RefObject<HTMLDivElement>}\n >\n {variant === BadgeVariant.standard ? children : null}\n </StyledBadge>\n );\n});\nBadge.className = CLASSNAME;\nBadge.displayName = COMPONENT_NAME;\n"],"names":["BadgeVariant","dot","standard","StyledBadge","styled","div","baseStyling","_ref","$color","$isReversed","$theme","css","Theme","light","Object","keys","PresentationColorPalette","includes","NotificationsColorPalette","_ref2","$variant","$autoBreak","COMPONENT_NAME","CLASSNAME","Badge","forwardRef","props","ref","autoBreak","children","className","color","propsColor","isReversed","theme","propsTheme","variant","propsVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","values","React","createElement","_extends","classNames","displayName"],"mappings":";;;;;;;;AAWA;AACA;AACA;AACO,MAAMA,YAAY,GAAG;AAC1BC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,QAAQ,EAAE,UAAA;AACZ,EAAU;;AAGV;AACA;AACA;;ACjBA;AACA;AACA;AACO,MAAMC,WAAW,GAAGC,MAAM,CAACC,GAAsB,CAAA;AACxD,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA;AACA,EAAA,EAAIC,IAAA,IAAqC;EAAA,IAApC;IAAEC,MAAM;IAAEC,WAAW;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAH,IAAA,CAAA;AAChC,EAAA,IAAIE,WAAW,EAAE;AACf,IAAA,OAAOE,GAAI,CAAA;AACjB,sDAAwDD,EAAAA,MAAM,KAAKE,KAAK,CAACC,KAAK,GAAG,OAAO,GAAG,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AM;AACdd,IAAAA,QAAQ,EAAEgB,OAAQ;AAClBN,IAAAA,SAAS,EAAEgB,UAAU,CAACtB,KAAK,CAACM,SAAS,EAAG,CAAA,EAAEN,KAAK,CAACM,SAAU,CAAGM,CAAAA,EAAAA,OAAQ,CAAC,CAAA,EAAEN,SAAS,CAAE;AACnFH,IAAAA,GAAG,EAAEA,GAAAA;GAEJS,CAAAA,EAAAA,OAAO,KAAKpC,YAAY,CAACE,QAAQ,GAAG2B,QAAQ,GAAG,IACrC,CAAC,CAAA;AAElB,CAAC,EAAC;AACFL,KAAK,CAACM,SAAS,GAAGP,SAAS,CAAA;AAC3BC,KAAK,CAACuB,WAAW,GAAGzB,cAAc;;;;"}
1
+ {"version":3,"file":"Badge2.js","sources":["../../src/components/badge/types.ts","../../src/components/badge/styles.ts","../../src/components/badge/Badge.tsx"],"sourcesContent":["import { ComponentProps } from 'react';\nimport {\n NotificationsColorPalette,\n PresentationColorPalette,\n LayoutProps,\n LayoutTransientProps,\n PositioningProps,\n PositioningTransientProps,\n SpacingProps,\n SpacingTransientProps,\n ValueOf,\n Theme,\n} from '../../types';\n\n/**\n * Component variant.\n */\nexport const BadgeVariant = {\n dot: 'dot',\n standard: 'standard',\n} as const;\nexport type BadgeVariant = ValueOf<typeof BadgeVariant>;\n\n/**\n * Component props.\n */\nexport interface BadgeProps extends ComponentProps<'div'>, LayoutProps, SpacingProps, PositioningProps {\n /** Whether the badge should automatically break content. */\n autoBreak?: boolean;\n /** Color variant. The product colors are available but should only be used to display the Badge in the color of another product. To display a Badge with a color of the current product, use `default`. */\n color?: NotificationsColorPalette | PresentationColorPalette;\n /** Whether the Badge has its colors reversed or not. */\n isReversed?: boolean;\n /** Theme. */\n theme?: Theme;\n /** Badge variant. */\n variant?: BadgeVariant;\n}\n\nexport interface StyledBadgeProps\n extends ComponentProps<'div'>,\n LayoutTransientProps,\n SpacingTransientProps,\n PositioningTransientProps {\n $autoBreak: BadgeProps['autoBreak'];\n $color: BadgeProps['color'];\n $isReversed: BadgeProps['isReversed'];\n $variant: BadgeProps['variant'];\n $theme: BadgeProps['theme'];\n}\n","import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { NotificationsColorPalette, PresentationColorPalette, Theme } from '../../types';\nimport { BadgeVariant, StyledBadgeProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledBadge = styled.div<StyledBadgeProps>`\n ${baseStyling}\n box-sizing: content-box;\n\n ${({ $color, $isReversed, $theme }) => {\n if ($isReversed) {\n return css`\n background-color: var(--redsift-color-neutral-${$theme === Theme.light ? 'white' : 'x-dark-grey'});\n\n &,\n .redsift-icon {\n color: ${Object.keys(PresentationColorPalette).includes($color!)\n ? `var(--redsift-color-presentation-${$color}-darker);`\n : Object.keys(NotificationsColorPalette).includes($color!)\n ? `var(--redsift-color-notifications-${$color}-primary);`\n : css`var(--redsift-color-neutral-x-dark-grey);`};\n }\n `;\n } else {\n return css`\n background-color: ${Object.keys(PresentationColorPalette).includes($color!)\n ? `var(--redsift-color-presentation-${$color}-darker);`\n : Object.keys(NotificationsColorPalette).includes($color!)\n ? `var(--redsift-color-notifications-${$color}-primary);`\n : css`var(--redsift-color-neutral-x-dark-grey);`};\n &,\n .redsift-icon {\n color: var(--redsift-color-neutral-white);\n }\n `;\n }\n }}\n\n ${({ $variant, $autoBreak }) => {\n switch ($variant) {\n case BadgeVariant.dot:\n return css`\n border-radius: 50%;\n height: 8px;\n margin-bottom: 12px;\n margin-right: 12px;\n width: 8px;\n `;\n case BadgeVariant.standard:\n default:\n return css`\n align-items: center;\n border-radius: 64px;\n display: inline-flex;\n gap: 4px;\n height: fit-content;\n justify-content: center;\n min-width: 8px;\n padding: 4px 6px;\n text-align: center;\n width: fit-content;\n word-break: ${$autoBreak ? 'break-word' : 'normal'};\n\n &,\n .redsift-icon,\n .redsift-number,\n .redsift-text {\n font-family: var(--redsift-typography-badge-font-family);\n font-size: var(--redsift-typography-badge-font-size);\n font-weight: var(--redsift-typography-badge-font-weight);\n line-height: var(--redsift-typography-badge-line-height);\n }\n\n .redsift-icon {\n width: unset;\n height: unset;\n\n > svg {\n width: 1em;\n height: 1em;\n }\n }\n `;\n }\n }}\n`;\n","import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\nimport { NotificationsColorPalette, Comp, PresentationColorPalette, getStylingTransientProps } from '../../types';\nimport { StyledBadge } from './styles';\nimport { BadgeProps, BadgeVariant } from './types';\nimport { useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'Badge';\nconst CLASSNAME = 'redsift-badge';\n\n/**\n * The Badge component.\n */\nexport const Badge: Comp<BadgeProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { transientProps, otherProps } = getStylingTransientProps(props);\n\n const {\n autoBreak,\n children,\n className,\n color: propsColor,\n isReversed,\n theme: propsTheme,\n variant: propsVariant,\n ...forwardedProps\n } = otherProps;\n\n const theme = useTheme(propsTheme);\n const color = [...Object.values(NotificationsColorPalette), ...Object.values(PresentationColorPalette)].includes(\n propsColor!\n )\n ? propsColor\n : 'question';\n const variant = Object.values(BadgeVariant).includes(propsVariant!) ? propsVariant : 'dot';\n\n return (\n <StyledBadge\n {...forwardedProps}\n {...transientProps}\n $autoBreak={autoBreak}\n $color={color}\n $isReversed={isReversed}\n $theme={theme}\n $variant={variant}\n className={classNames(Badge.className, `${Badge.className}-${variant}`, className)}\n ref={ref as RefObject<HTMLDivElement>}\n >\n {variant === BadgeVariant.standard ? children : null}\n </StyledBadge>\n );\n});\nBadge.className = CLASSNAME;\nBadge.displayName = COMPONENT_NAME;\n"],"names":["BadgeVariant","dot","standard","StyledBadge","styled","div","baseStyling","_ref","$color","$isReversed","$theme","css","Theme","light","Object","keys","PresentationColorPalette","includes","NotificationsColorPalette","_ref2","$variant","$autoBreak","COMPONENT_NAME","CLASSNAME","Badge","forwardRef","props","ref","transientProps","otherProps","getStylingTransientProps","autoBreak","children","className","color","propsColor","isReversed","theme","propsTheme","variant","propsVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","values","React","createElement","_extends","classNames","displayName"],"mappings":";;;;;;;;;AAcA;AACA;AACA;AACO,MAAMA,YAAY,GAAG;AAC1BC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,QAAQ,EAAE,UAAA;AACZ,EAAU;;AAGV;AACA;AACA;;ACpBA;AACA;AACA;AACO,MAAMC,WAAW,GAAGC,MAAM,CAACC,GAAsB,CAAA;AACxD,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA;AACA,EAAA,EAAIC,IAAA,IAAqC;EAAA,IAApC;IAAEC,MAAM;IAAEC,WAAW;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAH,IAAA,CAAA;AAChC,EAAA,IAAIE,WAAW,EAAE;AACf,IAAA,OAAOE,GAAI,CAAA;AACjB,sDAAwDD,EAAAA,MAAM,KAAKE,KAAK,CAACC,KAAK,GAAG,OAAO,GAAG,aAAc,CAAA;AACzG;AACA;AACA;AACA,iBAAA,EAAmBC,MAAM,CAACC,IAAI,CAACC,wBAAwB,CAAC,CAACC,QAAQ,CAACT,MAAO,CAAC,GAC3D,CAAA,iCAAA,EAAmCA,MAAO,CAAU,SAAA,CAAA,GACrDM,MAAM,CAACC,IAAI,CAACG,yBAAyB,CAAC,CAACD,QAAQ,CAACT,MAAO,CAAC,GACvD,CAAoCA,kCAAAA,EAAAA,MAAO,CAAW,UAAA,CAAA,GACvDG,GAAI,CAA2C,yCAAA,CAAA,CAAA;AAC7D;AACA,MAAO,CAAA,CAAA;AACH,GAAC,MAAM;AACL,IAAA,OAAOA,GAAI,CAAA;AACjB,0BAAA,EAA4BG,MAAM,CAACC,IAAI,CAACC,wBAAwB,CAAC,CAACC,QAAQ,CAACT,MAAO,CAAC,GACtE,CAAA,iCAAA,EAAmCA,MAAO,CAAU,SAAA,CAAA,GACrDM,MAAM,CAACC,IAAI,CAACG,yBAAyB,CAAC,CAACD,QAAQ,CAACT,MAAO,CAAC,GACvD,CAAoCA,kCAAAA,EAAAA,MAAO,CAAW,U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AAc,SAAA,CAAA,CAAA;AAEd,EAAA,MAAMN,KAAK,GAAGO,QAAQ,CAACN,UAAU,CAAC,CAAA;EAClC,MAAMJ,KAAK,GAAG,CAAC,GAAGpB,MAAM,CAAC+B,MAAM,CAAC3B,yBAAyB,CAAC,EAAE,GAAGJ,MAAM,CAAC+B,MAAM,CAAC7B,wBAAwB,CAAC,CAAC,CAACC,QAAQ,CAC9GkB,UACF,CAAC,GACGA,UAAU,GACV,UAAU,CAAA;AACd,EAAA,MAAMI,OAAO,GAAGzB,MAAM,CAAC+B,MAAM,CAAC7C,YAAY,CAAC,CAACiB,QAAQ,CAACuB,YAAa,CAAC,GAAGA,YAAY,GAAG,KAAK,CAAA;EAE1F,oBACEM,cAAA,CAAAC,aAAA,CAAC5C,WAAW,EAAA6C,QAAA,CAAA,EAAA,EACNP,cAAc,EACdb,cAAc,EAAA;AAClBP,IAAAA,UAAU,EAAEU,SAAU;AACtBvB,IAAAA,MAAM,EAAE0B,KAAM;AACdzB,IAAAA,WAAW,EAAE2B,UAAW;AACxB1B,IAAAA,MAAM,EAAE2B,KAAM;AACdjB,IAAAA,QAAQ,EAAEmB,OAAQ;AAClBN,IAAAA,SAAS,EAAEgB,UAAU,CAACzB,KAAK,CAACS,SAAS,EAAG,CAAA,EAAET,KAAK,CAACS,SAAU,CAAGM,CAAAA,EAAAA,OAAQ,CAAC,CAAA,EAAEN,SAAS,CAAE;AACnFN,IAAAA,GAAG,EAAEA,GAAAA;GAEJY,CAAAA,EAAAA,OAAO,KAAKvC,YAAY,CAACE,QAAQ,GAAG8B,QAAQ,GAAG,IACrC,CAAC,CAAA;AAElB,CAAC,EAAC;AACFR,KAAK,CAACS,SAAS,GAAGV,SAAS,CAAA;AAC3BC,KAAK,CAAC0B,WAAW,GAAG5B,cAAc;;;;"}
@@ -3,9 +3,10 @@ import React__default, { forwardRef } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import { w as warnIfNoAccessibleLabelFound } from './warnIfNoAccessibleLabelFound.js';
5
5
  import styled, { css } from 'styled-components';
6
- import { i as baseStyling } from './styles4.js';
6
+ import { i as baseStyling } from './styles5.js';
7
7
  import { f as filterComponents } from './filterComponents.js';
8
8
  import { B as BreadcrumbItem } from './BreadcrumbItem.js';
9
+ import { f as getStylingTransientProps } from './styles.js';
9
10
  import { u as useTheme, a as ThemeProvider } from './useTheme.js';
10
11
 
11
12
  /**
@@ -49,13 +50,17 @@ const CLASSNAME = 'redsift-breadcrumbs';
49
50
  * The Breadcrumbs components is a list of links to the parent pages of the current page in hierarchical order.
50
51
  */
51
52
  const BaseBreadcrumbs = /*#__PURE__*/forwardRef((props, ref) => {
53
+ const {
54
+ transientProps,
55
+ otherProps
56
+ } = getStylingTransientProps(props);
52
57
  const {
53
58
  children,
54
59
  className,
55
60
  isDisabled,
56
61
  theme: propsTheme
57
- } = props,
58
- forwardedProps = _objectWithoutProperties(props, _excluded);
62
+ } = otherProps,
63
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded);
59
64
  warnIfNoAccessibleLabelFound(props, undefined, 'Breadcrumbs');
60
65
  const theme = useTheme(propsTheme);
61
66
  const childArray = filterComponents([Breadcrumbs.Item])(children);
@@ -77,7 +82,7 @@ const BaseBreadcrumbs = /*#__PURE__*/forwardRef((props, ref) => {
77
82
  value: {
78
83
  theme
79
84
  }
80
- }, /*#__PURE__*/React__default.createElement(StyledBreadcrumbs, _extends({}, forwardedProps, {
85
+ }, /*#__PURE__*/React__default.createElement(StyledBreadcrumbs, _extends({}, forwardedProps, transientProps, {
81
86
  $isDisabled: isDisabled,
82
87
  $theme: theme,
83
88
  className: classNames(BaseBreadcrumbs.className, className),
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs2.js","sources":["../../src/components/breadcrumbs/styles.ts","../../src/components/breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { StyledBreadcrumbsProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledBreadcrumbs = styled.nav<StyledBreadcrumbsProps>`\n ${baseStyling}\n\n ol {\n display: inline-flex;\n list-style: none;\n padding: unset;\n }\n\n .redsift-breadcrumbs__separator {\n font-family: var(--redsift-typography-body-font-family);\n font-size: var(--redsift-typography-body-font-size);\n font-weight: var(--redsift-typography-body-font-weight);\n line-height: var(--redsift-typography-body-line-height);\n margin: 0px 4px;\n\n ${({ $isDisabled, $theme }) =>\n $isDisabled\n ? css`\n color: var(--redsift-color-neutral-mid-grey);\n `\n : css`\n color: var(--redsift-color-${$theme}-components-text-primary);\n `}\n }\n`;\n","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":["StyledBreadcrumbs","styled","nav","baseStyling","_ref","$isDisabled","$theme","css","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","classNames","displayName","Object","assign","BreadcrumbItem"],"mappings":";;;;;;;;;;AAIA;AACA;AACA;AACO,MAAMA,iBAAiB,GAAGC,MAAM,CAACC,GAA4B,CAAA;AACpE,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAA,EAAMC,IAAA,IAAA;EAAA,IAAC;IAAEC,WAAW;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAF,IAAA,CAAA;EAAA,OACxBC,WAAW,GACPE,GAAI,CAAA;AACd;AACA,UAAA,CAAW,GACDA,GAAI,CAAA;AACd,uCAAA,EAAyCD,MAAO,CAAA;AAChD,UAAW,CAAA,CAAA;AAAA,CAAC,CAAA;AACZ;AACA,CAAC;;;ACtBD,MAAME,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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Aa,KAAA,EAAE,GAAU,CAAC,GAAG,IAChG,CAAC,CAAA;AAET,GAAC,CAAC,CAAA;AAEF,EAAA,oBACEqB,cAAA,CAAAC,aAAA,CAACG,aAAa,EAAA;AAACC,IAAAA,KAAK,EAAE;AAAExB,MAAAA,KAAAA;AAAM,KAAA;GAC5BmB,eAAAA,cAAA,CAAAC,aAAA,CAACrC,iBAAiB,EAAAuC,QAAA,KACZpB,cAAc,EAAA;AAClBd,IAAAA,WAAW,EAAEW,UAAW;AACxBV,IAAAA,MAAM,EAAEW,KAAM;IACdF,SAAS,EAAE2B,UAAU,CAAChC,eAAe,CAACK,SAAS,EAAEA,SAAS,CAAE;AAC5DF,IAAAA,GAAG,EAAEA,GAAAA;AAA8B,GAAA,CAAA,eAEnCuB,cAAA,CAAAC,aAAA,aAAKR,eAAoB,CACR,CACN,CAAC,CAAA;AAEpB,CAAC,EAAC;AACFnB,eAAe,CAACK,SAAS,GAAGN,SAAS,CAAA;AACrCC,eAAe,CAACiC,WAAW,GAAGnC,cAAc,CAAA;AAErC,MAAMmB,WAAW,GAAGiB,MAAM,CAACC,MAAM,CAACnC,eAAe,EAAE;AACxDkB,EAAAA,IAAI,EAAEkB,cAAAA;AACR,CAAC;;;;"}
1
+ {"version":3,"file":"Breadcrumbs2.js","sources":["../../src/components/breadcrumbs/styles.ts","../../src/components/breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { StyledBreadcrumbsProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledBreadcrumbs = styled.nav<StyledBreadcrumbsProps>`\n ${baseStyling}\n\n ol {\n display: inline-flex;\n list-style: none;\n padding: unset;\n }\n\n .redsift-breadcrumbs__separator {\n font-family: var(--redsift-typography-body-font-family);\n font-size: var(--redsift-typography-body-font-size);\n font-weight: var(--redsift-typography-body-font-weight);\n line-height: var(--redsift-typography-body-line-height);\n margin: 0px 4px;\n\n ${({ $isDisabled, $theme }) =>\n $isDisabled\n ? css`\n color: var(--redsift-color-neutral-mid-grey);\n `\n : css`\n color: var(--redsift-color-${$theme}-components-text-primary);\n `}\n }\n`;\n","import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\nimport { Comp, getStylingTransientProps } 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 { transientProps, otherProps } = getStylingTransientProps(props);\n\n const { children, className, isDisabled, theme: propsTheme, ...forwardedProps } = otherProps;\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 {...transientProps}\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":["StyledBreadcrumbs","styled","nav","baseStyling","_ref","$isDisabled","$theme","css","COMPONENT_NAME","CLASSNAME","BaseBreadcrumbs","forwardRef","props","ref","transientProps","otherProps","getStylingTransientProps","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","classNames","displayName","Object","assign","BreadcrumbItem"],"mappings":";;;;;;;;;;;AAIA;AACA;AACA;AACO,MAAMA,iBAAiB,GAAGC,MAAM,CAACC,GAA4B,CAAA;AACpE,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAA,EAAMC,IAAA,IAAA;EAAA,IAAC;IAAEC,WAAW;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAF,IAAA,CAAA;EAAA,OACxBC,WAAW,GACPE,GAAI,CAAA;AACd;AACA,UAAA,CAAW,GACDA,GAAI,CAAA;AACd,uCAAA,EAAyCD,MAAO,CAAA;AAChD,UAAW,CAAA,CAAA;AAAA,CAAC,CAAA;AACZ;AACA,CAAC;;;ACtBD,MAAME,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;IAAEC,cAAc;AAAEC,IAAAA,UAAAA;AAAW,GAAC,GAAGC,wBAAwB,CAACJ,KAAK,CAAC,CAAA;EAEtE,MAAM;MAAEK,QAAQ;MAAEC,SAAS;MAAEC,UAAU;AAAEC,MAAAA,KAAK,EAAEC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AAEF,EAAA,oBACEqB,cAAA,CAAAC,aAAA,CAACG,aAAa,EAAA;AAACC,IAAAA,KAAK,EAAE;AAAExB,MAAAA,KAAAA;AAAM,KAAA;GAC5BmB,eAAAA,cAAA,CAAAC,aAAA,CAACxC,iBAAiB,EAAA0C,QAAA,CAAA,EAAA,EACZpB,cAAc,EACdR,cAAc,EAAA;AAClBT,IAAAA,WAAW,EAAEc,UAAW;AACxBb,IAAAA,MAAM,EAAEc,KAAM;IACdF,SAAS,EAAE2B,UAAU,CAACnC,eAAe,CAACQ,SAAS,EAAEA,SAAS,CAAE;AAC5DL,IAAAA,GAAG,EAAEA,GAAAA;AAA8B,GAAA,CAAA,eAEnC0B,cAAA,CAAAC,aAAA,aAAKR,eAAoB,CACR,CACN,CAAC,CAAA;AAEpB,CAAC,EAAC;AACFtB,eAAe,CAACQ,SAAS,GAAGT,SAAS,CAAA;AACrCC,eAAe,CAACoC,WAAW,GAAGtC,cAAc,CAAA;AAErC,MAAMsB,WAAW,GAAGiB,MAAM,CAACC,MAAM,CAACtC,eAAe,EAAE;AACxDqB,EAAAA,IAAI,EAAEkB,cAAAA;AACR,CAAC;;;;"}
@@ -1,12 +1,13 @@
1
1
  import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
2
2
  import React__default, { forwardRef, useRef } from 'react';
3
3
  import classNames from 'classnames';
4
- import { B as ButtonVariant, S as StyledButton } from './styles.js';
4
+ import { B as ButtonVariant, S as StyledButton } from './styles2.js';
5
5
  import { StyledGradientBorder } from './gradient-border.js';
6
6
  import { B as ButtonsColorPalette } from './colors.js';
7
7
  import { C as ConditionalWrapper } from './ConditionalWrapper.js';
8
8
  import { a as Icon } from './Icon2.js';
9
9
  import { S as Spinner } from './Spinner2.js';
10
+ import { f as getStylingTransientProps } from './styles.js';
10
11
  import { u as useTheme } from './useTheme.js';
11
12
 
12
13
  const _excluded = ["children", "className", "color", "disabled", "fullWidth", "isActive", "isDisabled", "isHovered", "isLoading", "leftIcon", "leftIconProps", "rightIcon", "rightIconProps", "theme", "variant"];
@@ -23,6 +24,10 @@ const CLASSNAME = 'redsift-button';
23
24
  const Button = /*#__PURE__*/forwardRef((props, ref) => {
24
25
  const _ref = useRef();
25
26
  const buttonRef = ref || _ref;
27
+ const {
28
+ transientProps,
29
+ otherProps
30
+ } = getStylingTransientProps(props);
26
31
  const {
27
32
  children,
28
33
  className,
@@ -39,8 +44,8 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
39
44
  rightIconProps,
40
45
  theme: propsTheme,
41
46
  variant: propsVariant
42
- } = props,
43
- forwardedProps = _objectWithoutProperties(props, _excluded);
47
+ } = otherProps,
48
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded);
44
49
  const isDisabled = isLoading || propsIsDisabled || disabled;
45
50
  const theme = useTheme(propsTheme);
46
51
  const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
@@ -57,7 +62,7 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
57
62
  }, children)
58
63
  }, /*#__PURE__*/React__default.createElement(StyledButton, _extends({
59
64
  type: "button"
60
- }, forwardedProps, {
65
+ }, forwardedProps, transientProps, {
61
66
  $color: color,
62
67
  $fullWidth: fullWidth,
63
68
  $isActive: isActive,
@@ -1 +1 @@
1
- {"version":3,"file":"Button2.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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EAAE/B,OAAQ;AAClB,IAAA,eAAA,EAAeV,UAAW;IAC1BN,SAAS,EAAEgD,UAAU,CAACxD,MAAM,CAACQ,SAAS,EAAEA,SAAS,CAAE;AACnDG,IAAAA,QAAQ,EAAEG,UAAW;AACrBX,IAAAA,GAAG,EAAEG,SAAAA;GAEJY,CAAAA,EAAAA,QAAQ,gBAAGmB,cAAA,CAAAC,aAAA,CAACmB,IAAI,EAAAP,QAAA,CAAA;AAACQ,IAAAA,IAAI,EAAExC,QAAS;AAAC,IAAA,aAAA,EAAY,MAAM;AAACV,IAAAA,SAAS,EAAC,MAAA;AAAM,GAAA,EAAKW,aAAa,CAAG,CAAC,GAAG,IAAI,EACjGF,SAAS,gBAAGoB,cAAA,CAAAC,aAAA,CAACqB,OAAO,EAAA;AAACC,IAAAA,IAAI,EAAC,OAAO;IAACnD,KAAK,EAAEe,OAAO,KAAKU,aAAa,CAAC2B,OAAO,GAAG,SAAS,GAAG,SAAA;AAAU,GAAE,CAAC,GAAG,IAAI,eAC9GxB,cAAA,CAAAC,aAAA,CAAO/B,MAAAA,EAAAA,IAAAA,EAAAA,QAAe,CAAC,EACtBa,SAAS,gBAAGiB,cAAA,CAAAC,aAAA,CAACmB,IAAI,EAAAP,QAAA,CAAA;AAACQ,IAAAA,IAAI,EAAEtC,SAAU;AAAC,IAAA,aAAA,EAAY,MAAM;AAACZ,IAAAA,SAAS,EAAC,OAAA;AAAO,GAAA,EAAKa,cAAc,CAAG,CAAC,GAAG,IACtF,CACI,CAAC,CAAA;AAEzB,CAAC,EAAC;AACFrB,MAAM,CAACQ,SAAS,GAAGT,SAAS,CAAA;AAC5BC,MAAM,CAAC8D,WAAW,GAAGhE,cAAc;;;;"}
1
+ {"version":3,"file":"Button2.js","sources":["../../src/components/button/Button.tsx"],"sourcesContent":["import React, { forwardRef, RefObject, useRef } from 'react';\nimport classNames from 'classnames';\nimport { ButtonsColorPalette, Comp, getStylingTransientProps } 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 { transientProps, otherProps } = getStylingTransientProps(props);\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 } = otherProps;\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 {...transientProps}\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","transientProps","otherProps","getStylingTransientProps","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;IAAEG,cAAc;AAAEC,IAAAA,UAAAA;AAAW,GAAC,GAAGC,wBAAwB,CAACP,KAAK,CAAC,CAAA;EAEtE,MAAM;MACJQ,QAAQ;MACRC,SAAS;AACTC,MAAAA,KAA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AA;AAACQ,IAAAA,IAAI,EAAEtC,SAAU;AAAC,IAAA,aAAA,EAAY,MAAM;AAACZ,IAAAA,SAAS,EAAC,OAAA;AAAO,GAAA,EAAKa,cAAc,CAAG,CAAC,GAAG,IACtF,CACI,CAAC,CAAA;AAEzB,CAAC,EAAC;AACFxB,MAAM,CAACW,SAAS,GAAGZ,SAAS,CAAA;AAC5BC,MAAM,CAACiE,WAAW,GAAGnE,cAAc;;;;"}
@@ -2,7 +2,8 @@ import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBab
2
2
  import React__default, { forwardRef } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import styled, { css } from 'styled-components';
5
- import { i as baseStyling, g as baseFlexbox } from './styles4.js';
5
+ import { i as baseStyling, g as baseFlexbox } from './styles5.js';
6
+ import { f as getStylingTransientProps, h as getFlexLayoutTransientProps } from './styles.js';
6
7
  import { i as isComponent } from './isComponent.js';
7
8
  import { u as useTheme } from './useTheme.js';
8
9
  import { B as ButtonsColorPalette } from './colors.js';
@@ -31,9 +32,9 @@ const ButtonGroupVariant = {
31
32
  const StyledButtonGroup = styled.div`
32
33
  display: ${_ref => {
33
34
  let {
34
- inline
35
+ $inline
35
36
  } = _ref;
36
- return inline ? 'inline-flex' : 'flex';
37
+ return $inline ? 'inline-flex' : 'flex';
37
38
  }};
38
39
 
39
40
  ${baseStyling}
@@ -130,14 +131,22 @@ const CLASSNAME = 'redsift-button-group';
130
131
  * The ButtonGroup component.
131
132
  */
132
133
  const ButtonGroup = /*#__PURE__*/forwardRef((props, ref) => {
134
+ const {
135
+ transientProps: stylingTransientProps,
136
+ otherProps: propsAfterStyling
137
+ } = getStylingTransientProps(props);
138
+ const {
139
+ transientProps: flexLayoutTransientProps,
140
+ otherProps
141
+ } = getFlexLayoutTransientProps(propsAfterStyling);
133
142
  const {
134
143
  children,
135
144
  className,
136
145
  color: propsColor,
137
146
  theme: propsTheme,
138
147
  variant: propsVariant
139
- } = props,
140
- forwardedProps = _objectWithoutProperties(props, _excluded);
148
+ } = otherProps,
149
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded);
141
150
  const theme = useTheme(propsTheme);
142
151
  const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
143
152
  const variant = Object.values(ButtonGroupVariant).includes(propsVariant) ? propsVariant : 'primary';
@@ -166,7 +175,7 @@ const ButtonGroup = /*#__PURE__*/forwardRef((props, ref) => {
166
175
  className: index === 0 ? 'first-button' : index === childArray.length - 1 ? 'last-button' : 'middle-button'
167
176
  });
168
177
  });
169
- return /*#__PURE__*/React__default.createElement(StyledButtonGroup, _extends({}, forwardedProps, {
178
+ return /*#__PURE__*/React__default.createElement(StyledButtonGroup, _extends({}, forwardedProps, stylingTransientProps, flexLayoutTransientProps, {
170
179
  className: classNames(ButtonGroup.className, className),
171
180
  ref: ref,
172
181
  $color: color,
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonGroup.js","sources":["../../src/components/button-group/types.ts","../../src/components/button-group/styles.ts","../../src/components/button-group/ButtonGroup.tsx"],"sourcesContent":["import { ComponentProps } from 'react';\nimport { FlexLayoutProps, ButtonsColorPalette, StylingProps, Theme, ValueOf } from '../../types';\n\n/**\n * Component variant.\n */\nexport const ButtonGroupVariant = {\n primary: 'primary',\n secondary: 'secondary',\n unstyled: 'unstyled',\n} as const;\nexport type ButtonGroupVariant = ValueOf<typeof ButtonGroupVariant>;\n\n/**\n * Component color.\n */\nexport type ButtonGroupColor = ButtonsColorPalette;\n\n/**\n * Component props.\n */\nexport interface ButtonGroupProps extends ComponentProps<'div'>, StylingProps, FlexLayoutProps {\n /** Button color. */\n color?: ButtonGroupColor;\n /** Button variant. */\n variant?: ButtonGroupVariant;\n /** Theme. */\n theme?: Theme;\n}\n\nexport type StyledButtonGroupProps = ButtonGroupProps & {\n $color: ButtonGroupProps['color'];\n $variant: ButtonGroupProps['variant'];\n $theme: ButtonGroupProps['theme'];\n};\n","import styled, { css } from 'styled-components';\nimport { baseFlexbox, baseStyling } from '../shared';\nimport { ButtonGroupVariant, StyledButtonGroupProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledButtonGroup = styled.div<StyledButtonGroupProps>`\n display: ${({ inline }) => (inline ? 'inline-flex' : 'flex')};\n\n ${baseStyling}\n ${baseFlexbox}\n\n ${({ $color, $variant, $theme }) => css`\n ${$variant === ButtonGroupVariant.secondary\n ? css`\n .first-button {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right-color: transparent;\n }\n\n .middle-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n margin-left: -1px;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right-color: transparent;\n }\n\n .last-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n margin-left: -1px;\n }\n `\n : $variant === ButtonGroupVariant.unstyled\n ? css`\n .first-button {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 1px solid rgba(0, 0, 0, 0.23);\n border-color: ${`var(\n --redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-default\n )`};\n }\n\n .middle-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 1px solid rgba(0, 0, 0, 0.23);\n border-color: ${`var(\n --redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-default\n )`};\n }\n\n .last-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n `\n : css`\n .first-button {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 1px solid #bdbdbd;\n border-color: ${`var(\n --redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-hover\n )`};\n }\n\n .middle-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 1px solid #bdbdbd;\n border-color: ${`var(\n --redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-hover\n )`};\n }\n\n .last-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n `}\n `};\n`;\n","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 isComponent('Toggletip')(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":["ButtonGroupVariant","primary","secondary","unstyled","StyledButtonGroup","styled","div","_ref","inline","baseStyling","baseFlexbox","_ref2","$color","$variant","$theme","css","COMPONENT_NAME","CLASSNAME","ButtonGroup","forwardRef","props","ref","children","className","color","propsColor","theme","propsTheme","variant","propsVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","childArray","filterComponents","buttons","map","child","index","_key","isComponent","_child$key","React","cloneElement","key","triggerClassName","length","createElement","_extends","classNames","displayName"],"mappings":";;;;;;;;;;AAGA;AACA;AACA;AACO,MAAMA,kBAAkB,GAAG;AAChCC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,SAAS,EAAE,WAAW;AACtBC,EAAAA,QAAQ,EAAE,UAAA;AACZ,EAAU;;AAGV;AACA;AACA;;AAGA;AACA;AACA;;AChBA;AACA;AACA;AACO,MAAMC,iBAAiB,GAAGC,MAAM,CAACC,GAA4B,CAAA;AACpE,WAAA,EAAaC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAD,IAAA,CAAA;AAAA,EAAA,OAAMC,MAAM,GAAG,aAAa,GAAG,MAAM,CAAA;AAAA,CAAE,CAAA;AAC/D;AACA,EAAA,EAAIC,WAAY,CAAA;AAChB,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA,EAAA,EAAIC,KAAA,IAAA;EAAA,IAAC;IAAEC,MAAM;IAAEC,QAAQ;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAH,KAAA,CAAA;AAAA,EAAA,OAAKI,GAAI,CAAA;AAC1C,IAAA,EAAMF,QAAQ,KAAKb,kBAAkB,CAACE,SAAS,GACvCa,GAAI,CAAA;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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ACPqB,GAAG,EAAA,CAAAH,UAAA,GAAEJ,KAAK,CAACO,GAAG,MAAA,IAAA,IAAAH,UAAA,KAAA,KAAA,CAAA,GAAAA,UAAA,GAAIH,KAAK;AACvBO,QAAAA,gBAAgB,EACdP,KAAK,KAAK,CAAC,GAAG,cAAc,GAAGA,KAAK,KAAKL,UAAU,CAACa,MAAM,GAAG,CAAC,GAAG,aAAa,GAAG,eAAA;AACrF,OAAC,CAAC,CAAA;AACJ,KAAA;AACA,IAAA,oBAAOJ,cAAK,CAACC,YAAY,CAACN,KAAK,EAAE;MAC/BlB,KAAK;MACLE,KAAK;MACLE,OAAO;MACPqB,GAAG,EAAA,CAAAL,IAAA,GAAGF,KAAK,CAAwEO,GAAG,MAAA,IAAA,IAAAL,IAAA,KAAA,KAAA,CAAA,GAAAA,IAAA,GAAID,KAAK;AAC/FpB,MAAAA,SAAS,EAAEoB,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,cAAA,CAAAK,aAAA,CAAChD,iBAAiB,EAAAiD,QAAA,KACZvB,cAAc,EAAA;IAClBP,SAAS,EAAE+B,UAAU,CAACpC,WAAW,CAACK,SAAS,EAAEA,SAAS,CAAE;AACxDF,IAAAA,GAAG,EAAEA,GAAiC;AACtCT,IAAAA,MAAM,EAAEY,KAAM;AACdX,IAAAA,QAAQ,EAAEe,OAAQ;AAClBd,IAAAA,MAAM,EAAEY,KAAAA;AAAM,GAAA,CAAA,EAEbc,OACgB,CAAC,CAAA;AAExB,CAAC,EAAC;AACFtB,WAAW,CAACK,SAAS,GAAGN,SAAS,CAAA;AACjCC,WAAW,CAACqC,WAAW,GAAGvC,cAAc;;;;"}
1
+ {"version":3,"file":"ButtonGroup.js","sources":["../../src/components/button-group/types.ts","../../src/components/button-group/styles.ts","../../src/components/button-group/ButtonGroup.tsx"],"sourcesContent":["import { ComponentProps } from 'react';\nimport {\n FlexLayoutProps,\n ButtonsColorPalette,\n StylingProps,\n StylingTransientProps,\n FlexLayoutTransientProps,\n Theme,\n ValueOf,\n} from '../../types';\n\n/**\n * Component variant.\n */\nexport const ButtonGroupVariant = {\n primary: 'primary',\n secondary: 'secondary',\n unstyled: 'unstyled',\n} as const;\nexport type ButtonGroupVariant = ValueOf<typeof ButtonGroupVariant>;\n\n/**\n * Component color.\n */\nexport type ButtonGroupColor = ButtonsColorPalette;\n\n/**\n * Component props.\n */\nexport interface ButtonGroupProps extends ComponentProps<'div'>, StylingProps, FlexLayoutProps {\n /** Button color. */\n color?: ButtonGroupColor;\n /** Button variant. */\n variant?: ButtonGroupVariant;\n /** Theme. */\n theme?: Theme;\n}\n\nexport interface StyledButtonGroupProps extends ComponentProps<'div'>, StylingTransientProps, FlexLayoutTransientProps {\n $color: ButtonGroupProps['color'];\n $variant: ButtonGroupProps['variant'];\n $theme: ButtonGroupProps['theme'];\n}\n","import styled, { css } from 'styled-components';\nimport { baseFlexbox, baseStyling } from '../shared';\nimport { ButtonGroupVariant, StyledButtonGroupProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledButtonGroup = styled.div<StyledButtonGroupProps>`\n display: ${({ $inline }) => ($inline ? 'inline-flex' : 'flex')};\n\n ${baseStyling}\n ${baseFlexbox}\n\n ${({ $color, $variant, $theme }) => css`\n ${$variant === ButtonGroupVariant.secondary\n ? css`\n .first-button {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right-color: transparent;\n }\n\n .middle-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n margin-left: -1px;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right-color: transparent;\n }\n\n .last-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n margin-left: -1px;\n }\n `\n : $variant === ButtonGroupVariant.unstyled\n ? css`\n .first-button {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 1px solid rgba(0, 0, 0, 0.23);\n border-color: ${`var(\n --redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-default\n )`};\n }\n\n .middle-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 1px solid rgba(0, 0, 0, 0.23);\n border-color: ${`var(\n --redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-default\n )`};\n }\n\n .last-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n `\n : css`\n .first-button {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 1px solid #bdbdbd;\n border-color: ${`var(\n --redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-hover\n )`};\n }\n\n .middle-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 1px solid #bdbdbd;\n border-color: ${`var(\n --redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-hover\n )`};\n }\n\n .last-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n `}\n `};\n`;\n","import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\nimport { ButtonsColorPalette, Comp, getStylingTransientProps, getFlexLayoutTransientProps } 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 { transientProps: stylingTransientProps, otherProps: propsAfterStyling } = getStylingTransientProps(props);\n const { transientProps: flexLayoutTransientProps, otherProps } = getFlexLayoutTransientProps(propsAfterStyling);\n\n const {\n children,\n className,\n color: propsColor,\n theme: propsTheme,\n variant: propsVariant,\n ...forwardedProps\n } = otherProps;\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 isComponent('Toggletip')(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 {...stylingTransientProps}\n {...flexLayoutTransientProps}\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":["ButtonGroupVariant","primary","secondary","unstyled","StyledButtonGroup","styled","div","_ref","$inline","baseStyling","baseFlexbox","_ref2","$color","$variant","$theme","css","COMPONENT_NAME","CLASSNAME","ButtonGroup","forwardRef","props","ref","transientProps","stylingTransientProps","otherProps","propsAfterStyling","getStylingTransientProps","flexLayoutTransientProps","getFlexLayoutTransientProps","children","className","color","propsColor","theme","propsTheme","variant","propsVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","childArray","filterComponents","buttons","map","child","index","_key","isComponent","_child$key","React","cloneElement","key","triggerClassName","length","createElement","_extends","classNames","displayName"],"mappings":";;;;;;;;;;;AAWA;AACA;AACA;AACO,MAAMA,kBAAkB,GAAG;AAChCC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,SAAS,EAAE,WAAW;AACtBC,EAAAA,QAAQ,EAAE,UAAA;AACZ,EAAU;;AAGV;AACA;AACA;;AAGA;AACA;AACA;;ACxBA;AACA;AACA;AACO,MAAMC,iBAAiB,GAAGC,MAAM,CAACC,GAA4B,CAAA;AACpE,WAAA,EAAaC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,OAAAA;AAAQ,GAAC,GAAAD,IAAA,CAAA;AAAA,EAAA,OAAMC,OAAO,GAAG,aAAa,GAAG,MAAM,CAAA;AAAA,CAAE,CAAA;AACjE;AACA,EAAA,EAAIC,WAAY,CAAA;AAChB,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA,EAAA,EAAIC,KAAA,IAAA;EAAA,IAAC;IAAEC,MAAM;IAAEC,QAAQ;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAH,KAAA,CAAA;AAAA,EAAA,OAAKI,GAAI,CAAA;AAC1C,IAAA,EAAMF,QAAQ,KAAKb,kBAAkB,CAACE,SAAS,GACvCa,GAAI,CAAA;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAA,CAAS,GACDF,QAAQ,KAAKb,kBAAkB,CAACG,QAAQ,GACxCY,GAAI,CAAA;AACZ;AACA;AACA;AACA;AACA,0BAA6B,EAAA,CAAA;AAC7B,8BAAA,EAAgCD,MAAO,CAAA,oBAAA,EAAsBD,QAAS,CAAA,QAAA,EAAUD,MAAO,CAAA;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WithoutProperties, c as _extends } from './_rollupPluginBab
2
2
  import React__default, { forwardRef } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import { StyledGradientBorder } from './gradient-border.js';
5
- import { B as ButtonVariant, S as StyledButton } from './styles.js';
5
+ import { B as ButtonVariant, S as StyledButton } from './styles2.js';
6
6
  import { u as useTheme } from './useTheme.js';
7
7
  import { B as ButtonsColorPalette } from './colors.js';
8
8
  import { C as ConditionalWrapper } from './ConditionalWrapper.js';