@redsift/products 11.5.0 → 11.6.0-muiv5-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/_virtual/_rollupPluginBabelHelpers.js +93 -0
  2. package/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
  3. package/_virtual/jsx-runtime.js +4 -0
  4. package/_virtual/jsx-runtime.js.map +1 -0
  5. package/_virtual/react-jsx-runtime.development.js +4 -0
  6. package/_virtual/react-jsx-runtime.development.js.map +1 -0
  7. package/_virtual/react-jsx-runtime.production.min.js +4 -0
  8. package/_virtual/react-jsx-runtime.production.min.js.map +1 -0
  9. package/components/radar/index.d.ts +55 -0
  10. package/components/radar/index.js +25 -0
  11. package/components/radar/index.js.map +1 -0
  12. package/components/radar-button/RadarButton.d.ts +8 -0
  13. package/components/radar-button/RadarButton.js +25 -0
  14. package/components/radar-button/RadarButton.js.map +1 -0
  15. package/components/radar-dialog/PulsedRadarImage.js +437 -0
  16. package/components/radar-dialog/PulsedRadarImage.js.map +1 -0
  17. package/components/radar-dialog/RadarDialog.js +146 -0
  18. package/components/radar-dialog/RadarDialog.js.map +1 -0
  19. package/components/radar-dialog/RadarSimpleDialog.d.ts +15 -0
  20. package/components/radar-dialog/RadarSimpleDialog.js +23 -0
  21. package/components/radar-dialog/RadarSimpleDialog.js.map +1 -0
  22. package/components/radar-dialog/ScatterGrid.js +1548 -0
  23. package/components/radar-dialog/ScatterGrid.js.map +1 -0
  24. package/components/radar-item/RadarItem.d.ts +9 -0
  25. package/components/radar-item/RadarItem.js +23 -0
  26. package/components/radar-item/RadarItem.js.map +1 -0
  27. package/components/radar-menu-button/RadarMenuButton.d.ts +35 -0
  28. package/components/radar-menu-button/RadarMenuButton.js +61 -0
  29. package/components/radar-menu-button/RadarMenuButton.js.map +1 -0
  30. package/components/radar-menu-button/RadarSimpleMenuButton.d.ts +13 -0
  31. package/components/radar-menu-button/RadarSimpleMenuButton.js +42 -0
  32. package/components/radar-menu-button/RadarSimpleMenuButton.js.map +1 -0
  33. package/index.d.ts +5 -199
  34. package/index.js +5 -9038
  35. package/index.js.map +1 -1
  36. package/package.json +8 -8
  37. package/packages/popovers/src/components/dialog/Dialog.js +56 -0
  38. package/packages/popovers/src/components/dialog/Dialog.js.map +1 -0
  39. package/packages/popovers/src/components/dialog/context.js +6 -0
  40. package/packages/popovers/src/components/dialog/context.js.map +1 -0
  41. package/packages/popovers/src/components/dialog/types.js +20 -0
  42. package/packages/popovers/src/components/dialog/types.js.map +1 -0
  43. package/packages/popovers/src/components/dialog/useDialog.js +95 -0
  44. package/packages/popovers/src/components/dialog/useDialog.js.map +1 -0
  45. package/packages/popovers/src/components/dialog/useDialogContext.js +13 -0
  46. package/packages/popovers/src/components/dialog/useDialogContext.js.map +1 -0
  47. package/packages/popovers/src/components/dialog-content/DialogContent.js +97 -0
  48. package/packages/popovers/src/components/dialog-content/DialogContent.js.map +1 -0
  49. package/packages/popovers/src/components/dialog-content/intl/en-US.json.js +7 -0
  50. package/packages/popovers/src/components/dialog-content/intl/en-US.json.js.map +1 -0
  51. package/packages/popovers/src/components/dialog-content/intl/fr-FR.json.js +7 -0
  52. package/packages/popovers/src/components/dialog-content/intl/fr-FR.json.js.map +1 -0
  53. package/packages/popovers/src/components/dialog-content/intl/index.js +10 -0
  54. package/packages/popovers/src/components/dialog-content/intl/index.js.map +1 -0
  55. package/packages/popovers/src/components/dialog-content/styles.js +77 -0
  56. package/packages/popovers/src/components/dialog-content/styles.js.map +1 -0
  57. package/packages/popovers/src/components/dialog-content-actions/DialogContentActions.js +38 -0
  58. package/packages/popovers/src/components/dialog-content-actions/DialogContentActions.js.map +1 -0
  59. package/packages/popovers/src/components/dialog-content-actions/styles.js +20 -0
  60. package/packages/popovers/src/components/dialog-content-actions/styles.js.map +1 -0
  61. package/packages/popovers/src/components/dialog-content-body/DialogContentBody.js +49 -0
  62. package/packages/popovers/src/components/dialog-content-body/DialogContentBody.js.map +1 -0
  63. package/packages/popovers/src/components/dialog-content-body/styles.js +65 -0
  64. package/packages/popovers/src/components/dialog-content-body/styles.js.map +1 -0
  65. package/packages/popovers/src/components/dialog-content-header/DialogContentHeader.js +86 -0
  66. package/packages/popovers/src/components/dialog-content-header/DialogContentHeader.js.map +1 -0
  67. package/packages/popovers/src/components/dialog-content-header/styles.js +31 -0
  68. package/packages/popovers/src/components/dialog-content-header/styles.js.map +1 -0
  69. package/packages/popovers/src/components/dialog-trigger/DialogTrigger.js +47 -0
  70. package/packages/popovers/src/components/dialog-trigger/DialogTrigger.js.map +1 -0
  71. package/popovers/src/components/dialog/types.d.ts +50 -0
  72. package/popovers/src/components/dialog-content/types.d.ts +12 -0
  73. package/popovers/src/components/dialog-content-body/types.d.ts +12 -0
  74. package/popovers/src/components/dialog-content-header/types.d.ts +27 -0
  75. package/popovers/src/components/dialog-trigger/types.d.ts +10 -0
@@ -0,0 +1,49 @@
1
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React__default, { forwardRef } from 'react';
3
+ import classNames from 'classnames';
4
+ import { useMergeRefs } from '../../../../../node_modules/@floating-ui/react/dist/floating-ui.react.mjs.js';
5
+ import { useBoundingClientRect } from '@redsift/design-system';
6
+ import { StyledDialogContentBody } from './styles.js';
7
+ import { useDialogContext } from '../dialog/useDialogContext.js';
8
+
9
+ const _excluded = ["children", "className"];
10
+ const COMPONENT_NAME = 'DialogContentBody';
11
+ const CLASSNAME = 'redsift-dialog-content-body';
12
+
13
+ /**
14
+ * The DialogContentBody component.
15
+ */
16
+ const DialogContentBody = /*#__PURE__*/forwardRef((props, ref) => {
17
+ const {
18
+ children,
19
+ className
20
+ } = props,
21
+ forwardedProps = _objectWithoutProperties(props, _excluded);
22
+ const {
23
+ actionsRef,
24
+ bodyRef,
25
+ hasCloseButton,
26
+ headerRef,
27
+ initialFocus
28
+ } = useDialogContext();
29
+ const {
30
+ height: headerHeight = 0
31
+ } = useBoundingClientRect(headerRef, [children, headerRef]);
32
+ const {
33
+ height: actionsHeight = 0
34
+ } = useBoundingClientRect(actionsRef, [children, actionsRef]);
35
+
36
+ /* istanbul ignore next */
37
+ return /*#__PURE__*/React__default.createElement(StyledDialogContentBody, _extends({}, forwardedProps, {
38
+ className: classNames(DialogContentBody.className, className),
39
+ ref: useMergeRefs([ref, bodyRef]),
40
+ tabIndex: initialFocus === 'body' ? -1 : undefined,
41
+ $marginTop: Math.max(headerHeight, hasCloseButton ? 40 : 0) + 32,
42
+ $marginBottom: (actionsHeight === 0 ? 0 : actionsHeight + 16) + 32
43
+ }), children);
44
+ });
45
+ DialogContentBody.className = CLASSNAME;
46
+ DialogContentBody.displayName = COMPONENT_NAME;
47
+
48
+ export { DialogContentBody };
49
+ //# sourceMappingURL=DialogContentBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogContentBody.js","sources":["../../../../../../../popovers/src/components/dialog-content-body/DialogContentBody.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport classNames from 'classnames';\nimport { useMergeRefs } from '@floating-ui/react';\n\nimport { Comp, useBoundingClientRect } from '@redsift/design-system';\nimport { StyledDialogContentBody } from './styles';\nimport { DialogContentBodyProps } from './types';\nimport { useDialogContext } from '../dialog';\n\nconst COMPONENT_NAME = 'DialogContentBody';\nconst CLASSNAME = 'redsift-dialog-content-body';\n\n/**\n * The DialogContentBody component.\n */\nexport const DialogContentBody: Comp<DialogContentBodyProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, ...forwardedProps } = props;\n\n const { actionsRef, bodyRef, hasCloseButton, headerRef, initialFocus } = useDialogContext();\n\n const { height: headerHeight = 0 } = useBoundingClientRect(headerRef as any, [children, headerRef]);\n const { height: actionsHeight = 0 } = useBoundingClientRect(actionsRef as any, [children, actionsRef]);\n\n /* istanbul ignore next */\n return (\n <StyledDialogContentBody\n {...forwardedProps}\n className={classNames(DialogContentBody.className, className)}\n ref={useMergeRefs([ref, bodyRef])}\n tabIndex={initialFocus === 'body' ? -1 : undefined}\n $marginTop={Math.max(headerHeight, hasCloseButton ? 40 : 0) + 32}\n $marginBottom={(actionsHeight === 0 ? 0 : actionsHeight + 16) + 32}\n >\n {children}\n </StyledDialogContentBody>\n );\n});\nDialogContentBody.className = CLASSNAME;\nDialogContentBody.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","DialogContentBody","forwardRef","props","ref","children","className","forwardedProps","_objectWithoutProperties","_excluded","actionsRef","bodyRef","hasCloseButton","headerRef","initialFocus","useDialogContext","height","headerHeight","useBoundingClientRect","actionsHeight","React","createElement","StyledDialogContentBody","_extends","classNames","useMergeRefs","tabIndex","undefined","$marginTop","Math","max","$marginBottom","displayName"],"mappings":";;;;;;;;;AASA,MAAMA,cAAc,GAAG,mBAAmB,CAAA;AAC1C,MAAMC,SAAS,GAAG,6BAA6B,CAAA;;AAE/C;AACA;AACA;AACO,MAAMC,iBAA+D,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACxG,MAAM;MAAEC,QAAQ;AAAEC,MAAAA,SAAAA;AAA6B,KAAC,GAAGH,KAAK;AAAxBI,IAAAA,cAAc,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA,CAAA,CAAA;EAExD,MAAM;IAAEC,UAAU;IAAEC,OAAO;IAAEC,cAAc;IAAEC,SAAS;AAAEC,IAAAA,YAAAA;GAAc,GAAGC,gBAAgB,EAAE,CAAA;EAE3F,MAAM;IAAEC,MAAM,EAAEC,YAAY,GAAG,CAAA;GAAG,GAAGC,qBAAqB,CAACL,SAAS,EAAS,CAACR,QAAQ,EAAEQ,SAAS,CAAC,CAAC,CAAA;EACnG,MAAM;IAAEG,MAAM,EAAEG,aAAa,GAAG,CAAA;GAAG,GAAGD,qBAAqB,CAACR,UAAU,EAAS,CAACL,QAAQ,EAAEK,UAAU,CAAC,CAAC,CAAA;;AAEtG;EACA,oBACEU,cAAA,CAAAC,aAAA,CAACC,uBAAuB,EAAAC,QAAA,KAClBhB,cAAc,EAAA;IAClBD,SAAS,EAAEkB,UAAU,CAACvB,iBAAiB,CAACK,SAAS,EAAEA,SAAS,CAAE;IAC9DF,GAAG,EAAEqB,YAAY,CAAC,CAACrB,GAAG,EAAEO,OAAO,CAAC,CAAE;IAClCe,QAAQ,EAAEZ,YAAY,KAAK,MAAM,GAAG,CAAC,CAAC,GAAGa,SAAU;AACnDC,IAAAA,UAAU,EAAEC,IAAI,CAACC,GAAG,CAACb,YAAY,EAAEL,cAAc,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAG;IACjEmB,aAAa,EAAE,CAACZ,aAAa,KAAK,CAAC,GAAG,CAAC,GAAGA,aAAa,GAAG,EAAE,IAAI,EAAA;AAAG,GAAA,CAAA,EAElEd,QACsB,CAAC,CAAA;AAE9B,CAAC,EAAC;AACFJ,iBAAiB,CAACK,SAAS,GAAGN,SAAS,CAAA;AACvCC,iBAAiB,CAAC+B,WAAW,GAAGjC,cAAc;;;;"}
@@ -0,0 +1,65 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { baseContainer } from '@redsift/design-system';
3
+
4
+ /**
5
+ * Component style.
6
+ */
7
+ const StyledDialogContentBody = styled.div`
8
+ ${baseContainer}
9
+
10
+ overflow-y: auto;
11
+ ${_ref => {
12
+ let {
13
+ $marginTop,
14
+ $marginBottom
15
+ } = _ref;
16
+ return css`
17
+ max-height: calc(100vh - ${$marginTop + $marginBottom}px);
18
+ `;
19
+ }}
20
+
21
+ font-family: var(--redsift-typography-body-font-family);
22
+ font-size: var(--redsift-typography-body-font-size);
23
+ font-weight: var(--redsift-typography-body-font-weight);
24
+ line-height: var(--redsift-typography-body-line-height);
25
+ padding: 0 24px;
26
+ margin: 16px -24px;
27
+
28
+ &:focus-visible {
29
+ outline: none;
30
+ }
31
+
32
+ scrollbar-color: var(--redsift-color-neutral-mid-grey) transparent;
33
+ scrollbar-width: thin;
34
+
35
+ &::-webkit-scrollbar {
36
+ block-size: 9px;
37
+ inline-size: 9px;
38
+ }
39
+
40
+ &::-webkit-scrollbar-thumb {
41
+ background-clip: padding-box;
42
+ background-color: var(--redsift-color-neutral-mid-grey);
43
+ border-radius: 0px;
44
+ border-left: 2px solid transparent;
45
+ border-right: 2px solid transparent;
46
+ }
47
+
48
+ &::-webkit-scrollbar-track {
49
+ background-color: transparent;
50
+ }
51
+
52
+ &::-webkit-scrollbar-thumb:horizontal,
53
+ &::-webkit-scrollbar-thumb:vertical {
54
+ &:hover {
55
+ background-color: var(--redsift-color-neutral-x-dark-grey);
56
+ }
57
+ }
58
+
59
+ &::-webkit-scrollbar-corner {
60
+ visibility: hidden;
61
+ }
62
+ `;
63
+
64
+ export { StyledDialogContentBody };
65
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sources":["../../../../../../../popovers/src/components/dialog-content-body/styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { baseContainer } from '@redsift/design-system';\nimport { StyledDialogContentBodyProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledDialogContentBody = styled.div<StyledDialogContentBodyProps>`\n ${baseContainer}\n\n overflow-y: auto;\n ${({ $marginTop, $marginBottom }) => css`\n max-height: calc(100vh - ${$marginTop + $marginBottom}px);\n `}\n\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 padding: 0 24px;\n margin: 16px -24px;\n\n &:focus-visible {\n outline: none;\n }\n\n scrollbar-color: var(--redsift-color-neutral-mid-grey) transparent;\n scrollbar-width: thin;\n\n &::-webkit-scrollbar {\n block-size: 9px;\n inline-size: 9px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-clip: padding-box;\n background-color: var(--redsift-color-neutral-mid-grey);\n border-radius: 0px;\n border-left: 2px solid transparent;\n border-right: 2px solid transparent;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-thumb:horizontal,\n &::-webkit-scrollbar-thumb:vertical {\n &:hover {\n background-color: var(--redsift-color-neutral-x-dark-grey);\n }\n }\n\n &::-webkit-scrollbar-corner {\n visibility: hidden;\n }\n`;\n"],"names":["StyledDialogContentBody","styled","div","baseContainer","_ref","$marginTop","$marginBottom","css"],"mappings":";;;AAIA;AACA;AACA;AACaA,MAAAA,uBAAuB,GAAGC,MAAM,CAACC,GAAkC,CAAA;AAChF,EAAA,EAAIC,aAAc,CAAA;AAClB;AACA;AACA,EAAA,EAAIC,IAAA,IAAA;EAAA,IAAC;IAAEC,UAAU;AAAEC,IAAAA,aAAAA;AAAc,GAAC,GAAAF,IAAA,CAAA;AAAA,EAAA,OAAKG,GAAI,CAAA;AAC3C,6BAA+BF,EAAAA,UAAU,GAAGC,aAAc,CAAA;AAC1D,EAAG,CAAA,CAAA;AAAA,CAAC,CAAA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
@@ -0,0 +1,86 @@
1
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React__default, { forwardRef } from 'react';
3
+ import classNames from 'classnames';
4
+ import { useMergeRefs } from '../../../../../node_modules/@floating-ui/react/dist/floating-ui.react.mjs.js';
5
+ import { useId, Skeleton, Heading, Icon } from '@redsift/design-system';
6
+ import { StyledDialogContentHeader } from './styles.js';
7
+ import { useDialogContext } from '../dialog/useDialogContext.js';
8
+
9
+ const _excluded = ["children", "className", "header", "headingProps", "icon", "iconProps", "isLoading", "subheader", "theme"];
10
+ const COMPONENT_NAME = 'DialogContentHeader';
11
+ const CLASSNAME = 'redsift-dialog-content-header';
12
+
13
+ /**
14
+ * The DialogContentHeader component.
15
+ */
16
+ const DialogContentHeader = /*#__PURE__*/forwardRef((props, ref) => {
17
+ const {
18
+ children,
19
+ className,
20
+ header,
21
+ headingProps,
22
+ icon,
23
+ iconProps,
24
+ isLoading,
25
+ subheader,
26
+ theme
27
+ } = props,
28
+ forwardedProps = _objectWithoutProperties(props, _excluded);
29
+ const {
30
+ setLabelId,
31
+ setDescriptionId,
32
+ headerRef,
33
+ initialFocus
34
+ } = useDialogContext();
35
+ const [labelId] = useId();
36
+ const [descriptionId] = useId();
37
+
38
+ // Only sets `aria-labelledby` on the Dialog root element
39
+ // if this component is mounted inside it.
40
+ React__default.useLayoutEffect(() => {
41
+ setLabelId(labelId);
42
+ return () => setLabelId(undefined);
43
+ }, [labelId, setLabelId]);
44
+
45
+ // Only sets `aria-describedby` on the Dialog root element
46
+ // if this component is mounted inside it.
47
+ React__default.useLayoutEffect(() => {
48
+ setDescriptionId(descriptionId);
49
+ return () => setDescriptionId(undefined);
50
+ }, [descriptionId, setDescriptionId]);
51
+ return /*#__PURE__*/React__default.createElement(StyledDialogContentHeader, _extends({}, forwardedProps, {
52
+ className: classNames(DialogContentHeader.className, className),
53
+ ref: useMergeRefs([ref, headerRef]),
54
+ tabIndex: initialFocus === 'header' ? -1 : undefined
55
+ }), subheader ? /*#__PURE__*/React__default.createElement(Skeleton.Text, {
56
+ theme: theme,
57
+ variant: "body",
58
+ isLoaded: !isLoading
59
+ }, /*#__PURE__*/React__default.createElement("div", {
60
+ className: `${DialogContentHeader.className}__subheader`
61
+ }, subheader)) : null, header ? /*#__PURE__*/React__default.createElement(Skeleton.Text, {
62
+ theme: theme,
63
+ variant: (headingProps === null || headingProps === void 0 ? void 0 : headingProps.variant) || 'h2',
64
+ isLoaded: !isLoading,
65
+ marginTop: "10px",
66
+ marginBottom: "10px"
67
+ }, /*#__PURE__*/React__default.createElement(Heading, _extends({
68
+ theme: theme,
69
+ as: "h2",
70
+ color: "black",
71
+ className: `${DialogContentHeader.className}__header`,
72
+ variant: "h2"
73
+ }, headingProps), icon ? /*#__PURE__*/React__default.createElement(Icon, _extends({
74
+ theme: theme,
75
+ icon: icon,
76
+ "aria-hidden": "true",
77
+ size: "large"
78
+ }, iconProps)) : null, header)) : null, children ? /*#__PURE__*/React__default.createElement("div", {
79
+ id: descriptionId
80
+ }, children) : null);
81
+ });
82
+ DialogContentHeader.className = CLASSNAME;
83
+ DialogContentHeader.displayName = COMPONENT_NAME;
84
+
85
+ export { DialogContentHeader };
86
+ //# sourceMappingURL=DialogContentHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogContentHeader.js","sources":["../../../../../../../popovers/src/components/dialog-content-header/DialogContentHeader.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport classNames from 'classnames';\nimport { useMergeRefs } from '@floating-ui/react';\n\nimport { Icon, Heading, Comp, useId, Skeleton } from '@redsift/design-system';\nimport { StyledDialogContentHeader } from './styles';\nimport { DialogContentHeaderProps } from './types';\nimport { useDialogContext } from '../dialog';\n\nconst COMPONENT_NAME = 'DialogContentHeader';\nconst CLASSNAME = 'redsift-dialog-content-header';\n\n/**\n * The DialogContentHeader component.\n */\nexport const DialogContentHeader: Comp<DialogContentHeaderProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, header, headingProps, icon, iconProps, isLoading, subheader, theme, ...forwardedProps } =\n props;\n\n const { setLabelId, setDescriptionId, headerRef, initialFocus } = useDialogContext();\n const [labelId] = useId();\n const [descriptionId] = useId();\n\n // Only sets `aria-labelledby` on the Dialog root element\n // if this component is mounted inside it.\n React.useLayoutEffect(() => {\n setLabelId(labelId);\n return () => setLabelId(undefined);\n }, [labelId, setLabelId]);\n\n // Only sets `aria-describedby` on the Dialog root element\n // if this component is mounted inside it.\n React.useLayoutEffect(() => {\n setDescriptionId(descriptionId);\n return () => setDescriptionId(undefined);\n }, [descriptionId, setDescriptionId]);\n\n return (\n <StyledDialogContentHeader\n {...forwardedProps}\n className={classNames(DialogContentHeader.className, className)}\n ref={useMergeRefs([ref, headerRef])}\n tabIndex={initialFocus === 'header' ? -1 : undefined}\n >\n {subheader ? (\n <Skeleton.Text theme={theme} variant=\"body\" isLoaded={!isLoading}>\n <div className={`${DialogContentHeader.className}__subheader`}>{subheader}</div>\n </Skeleton.Text>\n ) : null}\n {header ? (\n <Skeleton.Text\n theme={theme}\n variant={headingProps?.variant || 'h2'}\n isLoaded={!isLoading}\n marginTop=\"10px\"\n marginBottom=\"10px\"\n >\n <Heading\n theme={theme}\n as=\"h2\"\n color=\"black\"\n className={`${DialogContentHeader.className}__header`}\n variant=\"h2\"\n {...headingProps}\n >\n {icon ? <Icon theme={theme} icon={icon} aria-hidden=\"true\" size=\"large\" {...iconProps} /> : null}\n {header}\n </Heading>\n </Skeleton.Text>\n ) : null}\n {children ? <div id={descriptionId}>{children}</div> : null}\n </StyledDialogContentHeader>\n );\n});\nDialogContentHeader.className = CLASSNAME;\nDialogContentHeader.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","DialogContentHeader","forwardRef","props","ref","children","className","header","headingProps","icon","iconProps","isLoading","subheader","theme","forwardedProps","_objectWithoutProperties","_excluded","setLabelId","setDescriptionId","headerRef","initialFocus","useDialogContext","labelId","useId","descriptionId","React","useLayoutEffect","undefined","createElement","StyledDialogContentHeader","_extends","classNames","useMergeRefs","tabIndex","Skeleton","Text","variant","isLoaded","marginTop","marginBottom","Heading","as","color","Icon","size","id","displayName"],"mappings":";;;;;;;;;AASA,MAAMA,cAAc,GAAG,qBAAqB,CAAA;AAC5C,MAAMC,SAAS,GAAG,+BAA+B,CAAA;;AAEjD;AACA;AACA;AACO,MAAMC,mBAAmE,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC5G,MAAM;MAAEC,QAAQ;MAAEC,SAAS;MAAEC,MAAM;MAAEC,YAAY;MAAEC,IAAI;MAAEC,SAAS;MAAEC,SAAS;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AErB,aAAAA;AAAc,GAAA,EAAEnB,QAAc,CAAC,GAAG,IAC9B,CAAC,CAAA;AAEhC,CAAC,EAAC;AACFJ,mBAAmB,CAACK,SAAS,GAAGN,SAAS,CAAA;AACzCC,mBAAmB,CAAC6C,WAAW,GAAG/C,cAAc;;;;"}
@@ -0,0 +1,31 @@
1
+ import styled from 'styled-components';
2
+ import { baseStyling, baseFlexbox } from '@redsift/design-system';
3
+
4
+ /**
5
+ * Component style.
6
+ */
7
+ const StyledDialogContentHeader = styled.div`
8
+ display: flex;
9
+ flex-direction: column;
10
+ width: 100%;
11
+ ${baseStyling}
12
+ ${baseFlexbox}
13
+
14
+ .redsift-dialog-content-header__header {
15
+ align-items: center;
16
+ display: flex;
17
+ gap: 8px;
18
+ padding: 10px 0px;
19
+ margin: 0px;
20
+ }
21
+
22
+ .redsift-dialog-content-header__subheader {
23
+ font-family: var(--redsift-typography-body-font-family);
24
+ font-size: var(--redsift-typography-body-font-size);
25
+ font-weight: var(--redsift-typography-body-font-weight);
26
+ line-height: var(--redsift-typography-body-line-height);
27
+ }
28
+ `;
29
+
30
+ export { StyledDialogContentHeader };
31
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sources":["../../../../../../../popovers/src/components/dialog-content-header/styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { StyledDialogContentHeaderProps } from './types';\nimport { baseFlexbox, baseStyling } from '@redsift/design-system';\n\n/**\n * Component style.\n */\nexport const StyledDialogContentHeader = styled.div<StyledDialogContentHeaderProps>`\n display: flex;\n flex-direction: column;\n width: 100%;\n ${baseStyling}\n ${baseFlexbox}\n\n .redsift-dialog-content-header__header {\n align-items: center;\n display: flex;\n gap: 8px;\n padding: 10px 0px;\n margin: 0px;\n }\n\n .redsift-dialog-content-header__subheader {\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 }\n`;\n"],"names":["StyledDialogContentHeader","styled","div","baseStyling","baseFlexbox"],"mappings":";;;AAIA;AACA;AACA;AACaA,MAAAA,yBAAyB,GAAGC,MAAM,CAACC,GAAoC,CAAA;AACpF;AACA;AACA;AACA,EAAA,EAAIC,WAAY,CAAA;AAChB,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
@@ -0,0 +1,47 @@
1
+ import { objectSpread2 as _objectSpread2 } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React__default, { forwardRef } from 'react';
3
+ import { useMergeRefs } from '../../../../../node_modules/@floating-ui/react/dist/floating-ui.react.mjs.js';
4
+ import { isComponent } from '@redsift/design-system';
5
+ import classNames from 'classnames';
6
+ import { useDialogContext } from '../dialog/useDialogContext.js';
7
+
8
+ const COMPONENT_NAME = 'DialogTrigger';
9
+ const CLASSNAME = 'redsift-dialog-trigger';
10
+
11
+ /**
12
+ * The DialogTrigger component.
13
+ */
14
+ const DialogTrigger = /*#__PURE__*/forwardRef((props, ref) => {
15
+ const {
16
+ children
17
+ } = props;
18
+ const {
19
+ getReferenceProps,
20
+ isOpen,
21
+ handleOpen,
22
+ refs,
23
+ triggerClassName,
24
+ color
25
+ } = useDialogContext();
26
+ const childrenRef = children === null || children === void 0 ? void 0 : children.ref;
27
+ const triggerRef = useMergeRefs([refs.setReference, ref, childrenRef]);
28
+ if (isComponent('Button')(children) || isComponent('IconButton')(children) || isComponent('LinkButton')(children) || isComponent('Checkbox')(children) || isComponent('Switch')(children) || isComponent('Radio')(children) || isComponent('Item')(children)) {
29
+ var _children$props$child;
30
+ return /*#__PURE__*/React__default.cloneElement(children, _objectSpread2(_objectSpread2({}, getReferenceProps(_objectSpread2(_objectSpread2(_objectSpread2({
31
+ ref: triggerRef
32
+ }, props), children.props), {}, {
33
+ children: (_children$props$child = children.props.children) !== null && _children$props$child !== void 0 ? _children$props$child : ''
34
+ }))), {}, {
35
+ onClick: props.onClick ? props.onClick : () => handleOpen(!isOpen),
36
+ isActive: isOpen,
37
+ className: classNames(children.props.className, triggerClassName),
38
+ color: color !== null && color !== void 0 ? color : children.props.color
39
+ }));
40
+ }
41
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children);
42
+ });
43
+ DialogTrigger.className = CLASSNAME;
44
+ DialogTrigger.displayName = COMPONENT_NAME;
45
+
46
+ export { DialogTrigger };
47
+ //# sourceMappingURL=DialogTrigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogTrigger.js","sources":["../../../../../../../popovers/src/components/dialog-trigger/DialogTrigger.tsx"],"sourcesContent":["import React, { forwardRef, ReactElement } from 'react';\nimport { useMergeRefs } from '@floating-ui/react';\n\nimport { Comp, isComponent } from '@redsift/design-system';\nimport { useDialogContext } from '../dialog';\nimport { DialogTriggerProps } from './types';\nimport classNames from 'classnames';\n\nconst COMPONENT_NAME = 'DialogTrigger';\nconst CLASSNAME = 'redsift-dialog-trigger';\n\n/**\n * The DialogTrigger component.\n */\nexport const DialogTrigger: Comp<DialogTriggerProps, HTMLButtonElement> = forwardRef((props, ref) => {\n const { children } = props;\n\n const { getReferenceProps, isOpen, handleOpen, refs, triggerClassName, color } = useDialogContext();\n const childrenRef = (children as any)?.ref;\n const triggerRef = useMergeRefs([refs.setReference, ref, childrenRef]);\n\n if (\n isComponent('Button')(children) ||\n isComponent('IconButton')(children) ||\n isComponent('LinkButton')(children) ||\n isComponent('Checkbox')(children) ||\n isComponent('Switch')(children) ||\n isComponent('Radio')(children) ||\n isComponent('Item')(children)\n ) {\n return React.cloneElement(children as ReactElement, {\n ...getReferenceProps({\n ref: triggerRef,\n ...props,\n ...children.props,\n children: children.props.children ?? '',\n }),\n onClick: props.onClick ? props.onClick : () => handleOpen(!isOpen),\n isActive: isOpen,\n className: classNames((children as ReactElement).props.className, triggerClassName),\n color: color ?? children.props.color,\n });\n }\n\n return <>{children}</>;\n});\nDialogTrigger.className = CLASSNAME;\nDialogTrigger.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","DialogTrigger","forwardRef","props","ref","children","getReferenceProps","isOpen","handleOpen","refs","triggerClassName","color","useDialogContext","childrenRef","triggerRef","useMergeRefs","setReference","isComponent","_children$props$child","React","cloneElement","_objectSpread","onClick","isActive","className","classNames","createElement","Fragment","displayName"],"mappings":";;;;;;;AAQA,MAAMA,cAAc,GAAG,eAAe,CAAA;AACtC,MAAMC,SAAS,GAAG,wBAAwB,CAAA;;AAE1C;AACA;AACA;AACO,MAAMC,aAA0D,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACnG,MAAM;AAAEC,IAAAA,QAAAA;AAAS,GAAC,GAAGF,KAAK,CAAA;EAE1B,MAAM;IAAEG,iBAAiB;IAAEC,MAAM;IAAEC,UAAU;IAAEC,IAAI;IAAEC,gBAAgB;AAAEC,IAAAA,KAAAA;GAAO,GAAGC,gBAAgB,EAAE,CAAA;EACnG,MAAMC,WAAW,GAAIR,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAARA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,QAAQ,CAAUD,GAAG,CAAA;AAC1C,EAAA,MAAMU,UAAU,GAAGC,YAAY,CAAC,CAACN,IAAI,CAACO,YAAY,EAAEZ,GAAG,EAAES,WAAW,CAAC,CAAC,CAAA;EAEtE,IACEI,WAAW,CAAC,QAAQ,CAAC,CAACZ,QAAQ,CAAC,IAC/BY,WAAW,CAAC,YAAY,CAAC,CAACZ,QAAQ,CAAC,IACnCY,WAAW,CAAC,YAAY,CAAC,CAACZ,QAAQ,CAAC,IACnCY,WAAW,CAAC,UAAU,CAAC,CAACZ,QAAQ,CAAC,IACjCY,WAAW,CAAC,QAAQ,CAAC,CAACZ,QAAQ,CAAC,IAC/BY,WAAW,CAAC,OAAO,CAAC,CAACZ,QAAQ,CAAC,IAC9BY,WAAW,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{ ButtonColor, Theme, ValueOf } from '@redsift/design-system';
3
+
4
+ /**
5
+ * Component variant.
6
+ */
7
+ declare const DialogSize: {
8
+ readonly small: "small";
9
+ readonly medium: "medium";
10
+ readonly large: "large";
11
+ readonly xlarge: "xlarge";
12
+ };
13
+ type DialogSize = ValueOf<typeof DialogSize>;
14
+ /**
15
+ * Component props.
16
+ */
17
+ interface DialogProps {
18
+ /** Button color that will be forward to the trigger. */
19
+ color?: ButtonColor;
20
+ /** Children. Can only be DialogTrigger and DialogContent. */
21
+ children: ReactNode;
22
+ /**
23
+ * Default open status.
24
+ * Used for uncontrolled version.
25
+ */
26
+ defaultOpen?: boolean;
27
+ /** Whether the Close icon button is displayed or not. */
28
+ hasCloseButton?: boolean;
29
+ /** Which element to initially focus. Can be either a number (tabbable index), a ref to en element, or a shortcut pointing towards a section of the dialog. See the accessibility section in the documentation to know which one to use. */
30
+ initialFocus?: number | React.MutableRefObject<HTMLElement | null> | 'header' | 'body' | 'actions';
31
+ /**
32
+ * Whether the component is opened or not.
33
+ * Used for controlled version.
34
+ */
35
+ isOpen?: boolean;
36
+ /** Method to handle component change. */
37
+ onOpen?: (open: boolean) => void;
38
+ /** Dialog size. */
39
+ size?: DialogSize | {
40
+ width?: string;
41
+ maxWidth?: string;
42
+ minWidth?: string;
43
+ };
44
+ /** Theme. */
45
+ theme?: Theme;
46
+ /** Class name to append to the trigger. */
47
+ triggerClassName?: string;
48
+ }
49
+
50
+ export { DialogProps, DialogSize };
@@ -0,0 +1,12 @@
1
+ import { Theme } from '@redsift/design-system';
2
+ import { ComponentProps } from 'react';
3
+
4
+ /**
5
+ * Component props.
6
+ */
7
+ interface DialogContentProps extends ComponentProps<'div'> {
8
+ /** Theme. */
9
+ theme?: Theme;
10
+ }
11
+
12
+ export { DialogContentProps };
@@ -0,0 +1,12 @@
1
+ import { ComponentProps } from 'react';
2
+ import { ContainerProps, Theme } from '@redsift/design-system';
3
+
4
+ /**
5
+ * Component props.
6
+ */
7
+ interface DialogContentBodyProps extends ComponentProps<'div'>, ContainerProps {
8
+ /** Theme. */
9
+ theme?: Theme;
10
+ }
11
+
12
+ export { DialogContentBodyProps };
@@ -0,0 +1,27 @@
1
+ import { ComponentProps } from 'react';
2
+ import { HeadingProps, IconProps, Theme } from '@redsift/design-system';
3
+
4
+ /**
5
+ * Component props.
6
+ */
7
+ interface DialogContentHeaderProps extends ComponentProps<'div'> {
8
+ /** Header. */
9
+ header?: string;
10
+ /** Heading props allowing to override the component rendered by the heading without changing its style. */
11
+ headingProps?: Pick<HeadingProps, 'as' | 'noWrap' | 'variant'>;
12
+ /** Subheader */
13
+ subheader?: string;
14
+ /**
15
+ * Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />
16
+ * Can also be a ReactElement.
17
+ */
18
+ icon?: IconProps['icon'];
19
+ /** Custom props to pass to the Icon component. */
20
+ iconProps?: Omit<IconProps, 'ref' | 'icon'>;
21
+ /** Whether the card is loading or not. */
22
+ isLoading?: boolean;
23
+ /** Theme. */
24
+ theme?: Theme;
25
+ }
26
+
27
+ export { DialogContentHeaderProps };
@@ -0,0 +1,10 @@
1
+ import { ComponentProps } from 'react';
2
+ import { StylingProps } from '@redsift/design-system';
3
+
4
+ /**
5
+ * Component props.
6
+ */
7
+ interface DialogTriggerProps extends ComponentProps<'button'>, StylingProps {
8
+ }
9
+
10
+ export { DialogTriggerProps };