@redsift/products 11.6.0-muiv5-alpha.9 → 11.6.0-muiv5-alpha.11

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 (83) hide show
  1. package/{_internal → _virtual/_internal}/_rollupPluginBabelHelpers.js +1 -1
  2. package/_virtual/_internal/jsx-runtime.js +4 -0
  3. package/_virtual/_internal/jsx-runtime.js.map +1 -0
  4. package/_virtual/_internal/react-jsx-runtime.development.js +4 -0
  5. package/_virtual/_internal/react-jsx-runtime.development.js.map +1 -0
  6. package/_virtual/_internal/react-jsx-runtime.production.min.js +4 -0
  7. package/_virtual/_internal/react-jsx-runtime.production.min.js.map +1 -0
  8. package/package.json +5 -5
  9. package/packages/popovers/src/components/dialog/_internal/Dialog.js +56 -0
  10. package/packages/popovers/src/components/dialog/_internal/Dialog.js.map +1 -0
  11. package/packages/popovers/src/components/dialog/_internal/context.js +6 -0
  12. package/packages/popovers/src/components/dialog/_internal/context.js.map +1 -0
  13. package/packages/popovers/src/components/dialog/_internal/types.js +20 -0
  14. package/packages/popovers/src/components/dialog/_internal/types.js.map +1 -0
  15. package/packages/popovers/src/components/dialog/_internal/useDialog.js +95 -0
  16. package/packages/popovers/src/components/dialog/_internal/useDialog.js.map +1 -0
  17. package/packages/popovers/src/components/dialog/_internal/useDialogContext.js +13 -0
  18. package/packages/popovers/src/components/dialog/_internal/useDialogContext.js.map +1 -0
  19. package/packages/popovers/src/components/dialog-content/_internal/DialogContent.js +97 -0
  20. package/packages/popovers/src/components/dialog-content/_internal/DialogContent.js.map +1 -0
  21. package/packages/popovers/src/components/dialog-content/_internal/styles.js +77 -0
  22. package/packages/popovers/src/components/dialog-content/_internal/styles.js.map +1 -0
  23. package/packages/popovers/src/components/dialog-content/intl/_internal/en-US.js +7 -0
  24. package/packages/popovers/src/components/dialog-content/intl/_internal/en-US.js.map +1 -0
  25. package/packages/popovers/src/components/dialog-content/intl/_internal/fr-FR.js +7 -0
  26. package/packages/popovers/src/components/dialog-content/intl/_internal/fr-FR.js.map +1 -0
  27. package/packages/popovers/src/components/dialog-content/intl/index.js +10 -0
  28. package/packages/popovers/src/components/dialog-content/intl/index.js.map +1 -0
  29. package/packages/popovers/src/components/dialog-content-actions/_internal/DialogContentActions.js +38 -0
  30. package/packages/popovers/src/components/dialog-content-actions/_internal/DialogContentActions.js.map +1 -0
  31. package/packages/popovers/src/components/dialog-content-actions/_internal/styles.js +20 -0
  32. package/packages/popovers/src/components/dialog-content-actions/_internal/styles.js.map +1 -0
  33. package/packages/popovers/src/components/dialog-content-body/_internal/DialogContentBody.js +49 -0
  34. package/packages/popovers/src/components/dialog-content-body/_internal/DialogContentBody.js.map +1 -0
  35. package/packages/popovers/src/components/dialog-content-body/_internal/styles.js +65 -0
  36. package/packages/popovers/src/components/dialog-content-body/_internal/styles.js.map +1 -0
  37. package/packages/popovers/src/components/dialog-content-header/_internal/DialogContentHeader.js +86 -0
  38. package/packages/popovers/src/components/dialog-content-header/_internal/DialogContentHeader.js.map +1 -0
  39. package/packages/popovers/src/components/dialog-content-header/_internal/styles.js +31 -0
  40. package/packages/popovers/src/components/dialog-content-header/_internal/styles.js.map +1 -0
  41. package/packages/popovers/src/components/dialog-trigger/_internal/DialogTrigger.js +47 -0
  42. package/packages/popovers/src/components/dialog-trigger/_internal/DialogTrigger.js.map +1 -0
  43. package/packages/products/src/components/radar/_internal/radar.js +25 -0
  44. package/packages/products/src/components/radar/_internal/radar.js.map +1 -0
  45. package/{_internal → packages/products/src/components/radar-button/_internal}/RadarButton.js +2 -2
  46. package/packages/products/src/components/radar-button/_internal/RadarButton.js.map +1 -0
  47. package/packages/products/src/components/radar-button/_internal/radar-button.js +2 -0
  48. package/packages/products/src/components/radar-dialog/_internal/PulsedRadarImage.js +437 -0
  49. package/packages/products/src/components/radar-dialog/_internal/PulsedRadarImage.js.map +1 -0
  50. package/packages/products/src/components/radar-dialog/_internal/RadarDialog.js +146 -0
  51. package/packages/products/src/components/radar-dialog/_internal/RadarDialog.js.map +1 -0
  52. package/packages/products/src/components/radar-dialog/_internal/RadarSimpleDialog.js +23 -0
  53. package/packages/products/src/components/radar-dialog/_internal/RadarSimpleDialog.js.map +1 -0
  54. package/packages/products/src/components/radar-dialog/_internal/ScatterGrid.js +1548 -0
  55. package/packages/products/src/components/radar-dialog/_internal/ScatterGrid.js.map +1 -0
  56. package/packages/products/src/components/radar-dialog/_internal/radar-dialog.js +3 -0
  57. package/{_internal → packages/products/src/components/radar-dialog/_internal}/radar-dialog.js.map +1 -1
  58. package/{_internal → packages/products/src/components/radar-item/_internal}/RadarItem.js +2 -2
  59. package/packages/products/src/components/radar-item/_internal/RadarItem.js.map +1 -0
  60. package/packages/products/src/components/radar-item/_internal/radar-item.js +2 -0
  61. package/{_internal/RadarSimpleMenuButton.js → packages/products/src/components/radar-menu-button/_internal/RadarMenuButton.js} +3 -39
  62. package/packages/products/src/components/radar-menu-button/_internal/RadarMenuButton.js.map +1 -0
  63. package/packages/products/src/components/radar-menu-button/_internal/RadarSimpleMenuButton.js +42 -0
  64. package/packages/products/src/components/radar-menu-button/_internal/RadarSimpleMenuButton.js.map +1 -0
  65. package/packages/products/src/components/radar-menu-button/_internal/radar-menu-button.js +3 -0
  66. package/{_internal → packages/products/src/components/radar-menu-button/_internal}/radar-menu-button.js.map +1 -1
  67. package/packages/products/src/index.js +6 -0
  68. package/{index.js.map → packages/products/src/index.js.map} +1 -1
  69. package/_internal/RadarButton.js.map +0 -1
  70. package/_internal/RadarItem.js.map +0 -1
  71. package/_internal/RadarSimpleDialog.js +0 -8810
  72. package/_internal/RadarSimpleDialog.js.map +0 -1
  73. package/_internal/RadarSimpleMenuButton.js.map +0 -1
  74. package/_internal/radar-button.js +0 -2
  75. package/_internal/radar-dialog.js +0 -2
  76. package/_internal/radar-item.js +0 -2
  77. package/_internal/radar-menu-button.js +0 -2
  78. package/_internal/radar.js +0 -23
  79. package/_internal/radar.js.map +0 -1
  80. package/index.js +0 -5
  81. /package/{_internal → _virtual/_internal}/_rollupPluginBabelHelpers.js.map +0 -0
  82. /package/{_internal → packages/products/src/components/radar-button/_internal}/radar-button.js.map +0 -0
  83. /package/{_internal → packages/products/src/components/radar-item/_internal}/radar-item.js.map +0 -0
@@ -89,5 +89,5 @@ function _toPropertyKey(arg) {
89
89
  return typeof key === "symbol" ? key : String(key);
90
90
  }
91
91
 
92
- export { _extends as _, _objectWithoutProperties as a, _objectSpread2 as b };
92
+ export { _defineProperty as defineProperty, _extends as extends, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey };
93
93
  //# sourceMappingURL=_rollupPluginBabelHelpers.js.map
@@ -0,0 +1,4 @@
1
+ var jsxRuntime = {exports: {}};
2
+
3
+ export { jsxRuntime as __module };
4
+ //# sourceMappingURL=jsx-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,4 @@
1
+ var reactJsxRuntime_development = {};
2
+
3
+ export { reactJsxRuntime_development as __exports };
4
+ //# sourceMappingURL=react-jsx-runtime.development.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-jsx-runtime.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,4 @@
1
+ var reactJsxRuntime_production_min = {};
2
+
3
+ export { reactJsxRuntime_production_min as __exports };
4
+ //# sourceMappingURL=react-jsx-runtime.production.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-jsx-runtime.production.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
package/package.json CHANGED
@@ -30,11 +30,11 @@
30
30
  "test": "yarn test:unit && yarn test:storybook"
31
31
  },
32
32
  "types": "index.d.ts",
33
- "version": "11.6.0-muiv5-alpha.9",
33
+ "version": "11.6.0-muiv5-alpha.11",
34
34
  "dependencies": {
35
- "@redsift/design-system": "^11.6.0-muiv5-alpha.9",
36
- "@redsift/icons": "^11.6.0-muiv5-alpha.9",
37
- "@redsift/pickers": "^11.6.0-muiv5-alpha.9",
35
+ "@redsift/design-system": "^11.6.0-muiv5-alpha.11",
36
+ "@redsift/icons": "^11.6.0-muiv5-alpha.11",
37
+ "@redsift/pickers": "^11.6.0-muiv5-alpha.11",
38
38
  "classnames": "^2.3.1",
39
39
  "styled-components": "^5.3.5"
40
40
  },
@@ -95,5 +95,5 @@
95
95
  "react-dom": ">=17",
96
96
  "styled-components": "^5.3.5"
97
97
  },
98
- "gitHead": "233a8f0a7ffeaf1ca8477a5dbf947a453ab2fb33"
98
+ "gitHead": "aa2b60078c31ab64a6d5d7d77aa7a9dc71eb4031"
99
99
  }
@@ -0,0 +1,56 @@
1
+ import React__default from 'react';
2
+ import { useTheme, partitionComponents, isComponent, ThemeProvider } from '@redsift/design-system';
3
+ import { DialogContext } from './context.js';
4
+ import { DialogSize } from './types.js';
5
+ import { useDialog } from './useDialog.js';
6
+ import { DialogTrigger } from '../../dialog-trigger/_internal/DialogTrigger.js';
7
+ import { DialogContent } from '../../dialog-content/_internal/DialogContent.js';
8
+
9
+ const COMPONENT_NAME = 'Dialog';
10
+ const CLASSNAME = 'redsift-dialog';
11
+
12
+ /**
13
+ * The Dialog component.
14
+ */
15
+ const BaseDialog = props => {
16
+ const {
17
+ color,
18
+ children,
19
+ defaultOpen,
20
+ hasCloseButton = true,
21
+ initialFocus,
22
+ isOpen,
23
+ onOpen,
24
+ size = DialogSize.medium,
25
+ theme: propsTheme,
26
+ triggerClassName
27
+ } = props;
28
+ const theme = useTheme(propsTheme);
29
+ const dialog = useDialog({
30
+ color,
31
+ defaultOpen,
32
+ hasCloseButton,
33
+ initialFocus,
34
+ isOpen,
35
+ onOpen,
36
+ size,
37
+ triggerClassName
38
+ });
39
+ const [[trigger], [content]] = partitionComponents(React__default.Children.toArray(children), [isComponent('DialogTrigger'), isComponent('DialogContent')]);
40
+ return /*#__PURE__*/React__default.createElement(ThemeProvider, {
41
+ value: {
42
+ theme
43
+ }
44
+ }, /*#__PURE__*/React__default.createElement(DialogContext.Provider, {
45
+ value: dialog
46
+ }, trigger && isComponent('DialogTrigger')(trigger) ? trigger : null, content && isComponent('DialogContent')(content) ? content : null));
47
+ };
48
+ BaseDialog.className = CLASSNAME;
49
+ BaseDialog.displayName = COMPONENT_NAME;
50
+ const Dialog = Object.assign(BaseDialog, {
51
+ Trigger: DialogTrigger,
52
+ Content: DialogContent
53
+ });
54
+
55
+ export { BaseDialog, Dialog };
56
+ //# sourceMappingURL=Dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.js","sources":["../../../../../../../../popovers/src/components/dialog/Dialog.tsx"],"sourcesContent":["import React from 'react';\nimport { partitionComponents, isComponent, useTheme, ThemeProvider } from '@redsift/design-system';\nimport { DialogContent } from '../dialog-content';\nimport { DialogTrigger } from '../dialog-trigger';\n\nimport { DialogContext } from './context';\nimport { DialogProps, DialogSize } from './types';\nimport { useDialog } from './useDialog';\n\nconst COMPONENT_NAME = 'Dialog';\nconst CLASSNAME = 'redsift-dialog';\n\n/**\n * The Dialog component.\n */\nexport const BaseDialog: React.FC<DialogProps> & {\n displayName?: string;\n className?: string;\n} = (props) => {\n const {\n color,\n children,\n defaultOpen,\n hasCloseButton = true,\n initialFocus,\n isOpen,\n onOpen,\n size = DialogSize.medium,\n theme: propsTheme,\n triggerClassName,\n } = props;\n\n const theme = useTheme(propsTheme);\n\n const dialog = useDialog({\n color,\n defaultOpen,\n hasCloseButton,\n initialFocus,\n isOpen,\n onOpen,\n size,\n triggerClassName,\n });\n\n const [[trigger], [content]] = partitionComponents(React.Children.toArray(children), [\n isComponent('DialogTrigger'),\n isComponent('DialogContent'),\n ]);\n\n return (\n <ThemeProvider value={{ theme }}>\n <DialogContext.Provider value={dialog}>\n {trigger && isComponent('DialogTrigger')(trigger) ? trigger : null}\n {content && isComponent('DialogContent')(content) ? content : null}\n </DialogContext.Provider>\n </ThemeProvider>\n );\n};\nBaseDialog.className = CLASSNAME;\nBaseDialog.displayName = COMPONENT_NAME;\n\nexport const Dialog = Object.assign(BaseDialog, {\n Trigger: DialogTrigger,\n Content: DialogContent,\n});\n"],"names":["COMPONENT_NAME","CLASSNAME","BaseDialog","props","color","children","defaultOpen","hasCloseButton","initialFocus","isOpen","onOpen","size","DialogSize","medium","theme","propsTheme","triggerClassName","useTheme","dialog","useDialog","trigger","content","partitionComponents","React","Children","toArray","isComponent","createElement","ThemeProvider","value","DialogContext","Provider","className","displayName","Dialog","Object","assign","Trigger","DialogTrigger","Content","DialogContent"],"mappings":";;;;;;;;AASA,MAAMA,cAAc,GAAG,QAAQ,CAAA;AAC/B,MAAMC,SAAS,GAAG,gBAAgB,CAAA;;AAElC;AACA;AACA;AACaC,MAAAA,UAGZ,GAAIC,KAAK,IAAK;EACb,MAAM;IACJC,KAAK;IACLC,QAAQ;IACRC,WAAW;AACXC,IAAAA,cAAc,GAAG,IAAI;IACrBC,YAAY;IACZC,MAAM;IACNC,MAAM;IACNC,IAAI,GAAGC,UAAU,CAACC,MAAM;AACxBC,IAAAA,KAAK,EAAEC,UAAU;AACjBC,IAAAA,gBAAAA;AACF,GAAC,GAAGb,KAAK,CAAA;AAET,EAAA,MAAMW,KAAK,GAAGG,QAAQ,CAACF,UAAU,CAAC,CAAA;EAElC,MAAMG,MAAM,GAAGC,SAAS,CAAC;IACvBf,KAAK;IACLE,WAAW;IACXC,cAAc;IACdC,YAAY;IACZC,MAAM;IACNC,MAAM;IACNC,IAAI;AACJK,IAAAA,gBAAAA;AACF,GAAC,CAAC,CAAA;AAEF,EAAA,MAAM,CAAC,CAACI,OAAO,CAAC,EAAE,CAACC,OAAO,CAAC,CAAC,GAAGC,mBAAmB,CAACC,cAAK,CAACC,QAAQ,CAACC,OAAO,CAACpB,QAAQ,CAAC,EAAE,CACnFqB,WAAW,CAAC,eAAe,CAAC,EAC5BA,WAAW,CAAC,eAAe,CAAC,CAC7B,CAAC,CAAA;AAEF,EAAA,oBACEH,cAAA,CAAAI,aAAA,CAACC,aAAa,EAAA;AAACC,IAAAA,KAAK,EAAE;AAAEf,MAAAA,KAAAA;AAAM,KAAA;AAAE,GAAA,eAC9BS,cAAA,CAAAI,aAAA,CAACG,aAAa,CAACC,QAAQ,EAAA;AAACF,IAAAA,KAAK,EAAEX,MAAAA;AAAO,GAAA,EACnCE,OAAO,IAAIM,WAAW,CAAC,eAAe,CAAC,CAACN,OAAO,CAAC,GAAGA,OAAO,GAAG,IAAI,EACjEC,OAAO,IAAIK,WAAW,CAAC,eAAe,CAAC,CAACL,OAAO,CAAC,GAAGA,OAAO,GAAG,IACxC,CACX,CAAC,CAAA;AAEpB,EAAC;AACDnB,UAAU,CAAC8B,SAAS,GAAG/B,SAAS,CAAA;AAChCC,UAAU,CAAC+B,WAAW,GAAGjC,cAAc,CAAA;AAEhC,MAAMkC,MAAM,GAAGC,MAAM,CAACC,MAAM,CAAClC,UAAU,EAAE;AAC9CmC,EAAAA,OAAO,EAAEC,aAAa;AACtBC,EAAAA,OAAO,EAAEC,aAAAA;AACX,CAAC;;;;"}
@@ -0,0 +1,6 @@
1
+ import React__default from 'react';
2
+
3
+ const DialogContext = /*#__PURE__*/React__default.createContext(null);
4
+
5
+ export { DialogContext };
6
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sources":["../../../../../../../../popovers/src/components/dialog/context.ts"],"sourcesContent":["import React from 'react';\nimport { DialogState } from './types';\n\nexport const DialogContext = React.createContext<DialogState | null>(null);\n"],"names":["DialogContext","React","createContext"],"mappings":";;AAGO,MAAMA,aAAa,gBAAGC,cAAK,CAACC,aAAa,CAAqB,IAAI;;;;"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Context props.
3
+ */
4
+
5
+ /**
6
+ * Component variant.
7
+ */
8
+ const DialogSize = {
9
+ small: 'small',
10
+ medium: 'medium',
11
+ large: 'large',
12
+ xlarge: 'xlarge'
13
+ };
14
+
15
+ /**
16
+ * Component props.
17
+ */
18
+
19
+ export { DialogSize };
20
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":["../../../../../../../../popovers/src/components/dialog/types.ts"],"sourcesContent":["import { Dispatch, ReactNode, SetStateAction } from 'react';\nimport { ButtonColor, Theme, ValueOf } from '@redsift/design-system';\nimport { useDialog } from './useDialog';\n\n/**\n * Context props.\n */\nexport type DialogState =\n | (ReturnType<typeof useDialog> & {\n setLabelId: Dispatch<SetStateAction<string | undefined>>;\n setDescriptionId: Dispatch<SetStateAction<string | undefined>>;\n /** Class name to append to the trigger. */\n readonly triggerClassName?: string;\n })\n | null;\n\n/**\n * Component variant.\n */\nexport const DialogSize = {\n small: 'small',\n medium: 'medium',\n large: 'large',\n xlarge: 'xlarge',\n} as const;\nexport type DialogSize = ValueOf<typeof DialogSize>;\n\n/**\n * Component props.\n */\nexport interface DialogProps {\n /** Button color that will be forward to the trigger. */\n color?: ButtonColor;\n /** Children. Can only be DialogTrigger and DialogContent. */\n children: ReactNode;\n /**\n * Default open status.\n * Used for uncontrolled version.\n */\n defaultOpen?: boolean;\n /** Whether the Close icon button is displayed or not. */\n hasCloseButton?: boolean;\n /** 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. */\n initialFocus?: number | React.MutableRefObject<HTMLElement | null> | 'header' | 'body' | 'actions';\n /**\n * Whether the component is opened or not.\n * Used for controlled version.\n */\n isOpen?: boolean;\n /** Method to handle component change. */\n onOpen?: (open: boolean) => void;\n /** Dialog size. */\n size?: DialogSize | { width?: string; maxWidth?: string; minWidth?: string };\n /** Theme. */\n theme?: Theme;\n /** Class name to append to the trigger. */\n triggerClassName?: string;\n}\n\nexport type StyledDialogProps = DialogProps;\n"],"names":["DialogSize","small","medium","large","xlarge"],"mappings":"AAIA;AACA;AACA;;AAUA;AACA;AACA;AACO,MAAMA,UAAU,GAAG;AACxBC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAA;AACV,EAAU;;AAGV;AACA;AACA;;;;"}
@@ -0,0 +1,95 @@
1
+ import { objectSpread2 as _objectSpread2 } from '../../../../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
2
+ import React__default, { useRef, useState, useEffect, useCallback } from 'react';
3
+ import { useFloating, useDismiss, useRole, useInteractions } from '../../../../../../node_modules/@floating-ui/react/dist/_internal/floating-ui.react.js';
4
+ import { DialogSize } from './types.js';
5
+
6
+ const sizeToDimension = size => {
7
+ if (typeof size !== 'string') {
8
+ return size;
9
+ }
10
+ switch (size) {
11
+ case DialogSize.small:
12
+ return {
13
+ width: '540px'
14
+ };
15
+ case DialogSize.large:
16
+ return {
17
+ width: '800px'
18
+ };
19
+ case DialogSize.xlarge:
20
+ return {
21
+ width: '80vw'
22
+ };
23
+ case DialogSize.medium:
24
+ default:
25
+ return {
26
+ width: '700px'
27
+ };
28
+ }
29
+ };
30
+ function useDialog(_ref) {
31
+ let {
32
+ color,
33
+ defaultOpen,
34
+ hasCloseButton,
35
+ initialFocus,
36
+ isOpen: propsIsOpen,
37
+ onOpen,
38
+ size,
39
+ triggerClassName
40
+ } = _ref;
41
+ const headerRef = useRef(null);
42
+ const bodyRef = useRef(null);
43
+ const actionsRef = useRef(null);
44
+ const [labelId, setLabelId] = React__default.useState();
45
+ const [descriptionId, setDescriptionId] = React__default.useState();
46
+ const [isOpen, setIsOpen] = useState(propsIsOpen !== null && propsIsOpen !== void 0 ? propsIsOpen : defaultOpen);
47
+ const {
48
+ width,
49
+ minWidth,
50
+ maxWidth
51
+ } = sizeToDimension(size);
52
+ useEffect(() => {
53
+ setIsOpen(propsIsOpen !== null && propsIsOpen !== void 0 ? propsIsOpen : defaultOpen);
54
+ }, [propsIsOpen, defaultOpen]);
55
+ const handleOpen = useCallback(collapsed => {
56
+ if (onOpen) {
57
+ onOpen(collapsed);
58
+ }
59
+ if (propsIsOpen === undefined || propsIsOpen === null) {
60
+ setIsOpen(collapsed);
61
+ }
62
+ }, [onOpen]);
63
+ const data = useFloating({
64
+ open: isOpen,
65
+ onOpenChange: handleOpen
66
+ });
67
+ const context = data.context;
68
+ const dismiss = useDismiss(context, {
69
+ outsidePressEvent: 'mousedown'
70
+ });
71
+ const role = useRole(context);
72
+ const interactions = useInteractions([dismiss, role]);
73
+ return React__default.useMemo(() => _objectSpread2(_objectSpread2(_objectSpread2({
74
+ color,
75
+ isOpen,
76
+ handleOpen
77
+ }, interactions), data), {}, {
78
+ labelId,
79
+ descriptionId,
80
+ setLabelId,
81
+ setDescriptionId,
82
+ hasCloseButton,
83
+ initialFocus,
84
+ width,
85
+ minWidth,
86
+ maxWidth,
87
+ headerRef,
88
+ bodyRef,
89
+ actionsRef,
90
+ triggerClassName
91
+ }), [color, isOpen, handleOpen, interactions, data, labelId, descriptionId, hasCloseButton, initialFocus, width, minWidth, maxWidth, headerRef, bodyRef, actionsRef, triggerClassName]);
92
+ }
93
+
94
+ export { sizeToDimension, useDialog };
95
+ //# sourceMappingURL=useDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDialog.js","sources":["../../../../../../../../popovers/src/components/dialog/useDialog.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { useFloating, useDismiss, useRole, useInteractions } from '@floating-ui/react';\nimport { DialogProps, DialogSize } from './types';\n\nexport const sizeToDimension = (\n size: DialogSize | { width?: string; maxWidth?: string; minWidth?: string }\n): { width?: string; maxWidth?: string; minWidth?: string } => {\n if (typeof size !== 'string') {\n return size;\n }\n\n switch (size) {\n case DialogSize.small:\n return { width: '540px' };\n case DialogSize.large:\n return { width: '800px' };\n case DialogSize.xlarge:\n return { width: '80vw' };\n case DialogSize.medium:\n default:\n return { width: '700px' };\n }\n};\n\nexport function useDialog({\n color,\n defaultOpen,\n hasCloseButton,\n initialFocus,\n isOpen: propsIsOpen,\n onOpen,\n size,\n triggerClassName,\n}: Omit<DialogProps, 'children'>) {\n const headerRef = useRef(null);\n const bodyRef = useRef(null);\n const actionsRef = useRef(null);\n const [labelId, setLabelId] = React.useState<string | undefined>();\n const [descriptionId, setDescriptionId] = React.useState<string | undefined>();\n\n const [isOpen, setIsOpen] = useState(propsIsOpen ?? defaultOpen);\n\n const { width, minWidth, maxWidth } = sizeToDimension(size!);\n\n useEffect(() => {\n setIsOpen(propsIsOpen ?? defaultOpen);\n }, [propsIsOpen, defaultOpen]);\n\n const handleOpen = useCallback(\n (collapsed: boolean) => {\n if (onOpen) {\n onOpen(collapsed);\n }\n if (propsIsOpen === undefined || propsIsOpen === null) {\n setIsOpen(collapsed);\n }\n },\n [onOpen]\n );\n\n const data = useFloating({\n open: isOpen,\n onOpenChange: handleOpen,\n });\n\n const context = data.context;\n\n const dismiss = useDismiss(context, { outsidePressEvent: 'mousedown' });\n const role = useRole(context);\n\n const interactions = useInteractions([dismiss, role]);\n\n return React.useMemo(\n () => ({\n color,\n isOpen,\n handleOpen,\n ...interactions,\n ...data,\n labelId,\n descriptionId,\n setLabelId,\n setDescriptionId,\n hasCloseButton,\n initialFocus,\n width,\n minWidth,\n maxWidth,\n headerRef,\n bodyRef,\n actionsRef,\n triggerClassName,\n }),\n [\n color,\n isOpen,\n handleOpen,\n interactions,\n data,\n labelId,\n descriptionId,\n hasCloseButton,\n initialFocus,\n width,\n minWidth,\n maxWidth,\n headerRef,\n bodyRef,\n actionsRef,\n triggerClassName,\n ]\n );\n}\n"],"names":["sizeToDimension","size","DialogSize","small","width","large","xlarge","medium","useDialog","_ref","color","defaultOpen","hasCloseButton","initialFocus","isOpen","propsIsOpen","onOpen","triggerClassName","headerRef","useRef","bodyRef","actionsRef","labelId","setLabelId","React","useState","descriptionId","setDescriptionId","setIsOpen","minWidth","maxWidth","useEffect","handleOpen","useCallback","collapsed","undefined","data","useFloating","open","onOpenChange","context","dismiss","useDismiss","outsidePressEvent","role","useRole","interactions","useInteractions","useMemo","_objectSpread"],"mappings":";;;;;AAIaA,MAAAA,eAAe,GAC1BC,IAA2E,IACd;AAC7D,EAAA,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;AAC5B,IAAA,OAAOA,IAAI,CAAA;AACb,GAAA;AAEA,EAAA,QAAQA,IAAI;IACV,KAAKC,UAAU,CAACC,KAAK;MACnB,OAAO;AAAEC,QAAAA,KAAK,EAAE,OAAA;OAAS,CAAA;IAC3B,KAAKF,UAAU,CAACG,KAAK;MACnB,OAAO;AAAED,QAAAA,KAAK,EAAE,OAAA;OAAS,CAAA;IAC3B,KAAKF,UAAU,CAACI,MAAM;MACpB,OAAO;AAAEF,QAAAA,KAAK,EAAE,MAAA;OAAQ,CAAA;IAC1B,KAAKF,UAAU,CAACK,MAAM,CAAA;AACtB,IAAA;MACE,OAAO;AAAEH,QAAAA,KAAK,EAAE,OAAA;OAAS,CAAA;AAC7B,GAAA;AACF,EAAC;AAEM,SAASI,SAASA,CAAAC,IAAA,EASS;EAAA,IATR;IACxBC,KAAK;IACLC,WAAW;IACXC,cAAc;IACdC,YAAY;AACZC,IAAAA,MAAM,EAAEC,WAAW;IACnBC,MAAM;IACNf,IAAI;AACJgB,IAAAA,gBAAAA;AAC6B,GAAC,GAAAR,IAAA,CAAA;AAC9B,EAAA,MAAMS,SAAS,GAAGC,MAAM,CAAC,IAAI,CAAC,CAAA;AAC9B,EAAA,MAAMC,OAAO,GAAGD,MAAM,CAAC,IAAI,CAAC,CAAA;AAC5B,EAAA,MAAME,UAAU,GAAGF,MAAM,CAAC,IAAI,CAAC,CAAA;EAC/B,MAAM,CAACG,OAAO,EAAEC,UAAU,CAAC,GAAGC,cAAK,CAACC,QAAQ,EAAsB,CAAA;EAClE,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGH,cAAK,CAACC,QAAQ,EAAsB,CAAA;AAE9E,EAAA,MAAM,C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,MAAAC,cAAA,CAAAA,cAAA,CAAAA,cAAA,CAAA;IACEvC,KAAK;IACLI,MAAM;AACNkB,IAAAA,UAAAA;GACGc,EAAAA,YAAY,GACZV,IAAI,CAAA,EAAA,EAAA,EAAA;IACPd,OAAO;IACPI,aAAa;IACbH,UAAU;IACVI,gBAAgB;IAChBf,cAAc;IACdC,YAAY;IACZT,KAAK;IACLyB,QAAQ;IACRC,QAAQ;IACRZ,SAAS;IACTE,OAAO;IACPC,UAAU;AACVJ,IAAAA,gBAAAA;AAAgB,GAAA,CAChB,EACF,CACEP,KAAK,EACLI,MAAM,EACNkB,UAAU,EACVc,YAAY,EACZV,IAAI,EACJd,OAAO,EACPI,aAAa,EACbd,cAAc,EACdC,YAAY,EACZT,KAAK,EACLyB,QAAQ,EACRC,QAAQ,EACRZ,SAAS,EACTE,OAAO,EACPC,UAAU,EACVJ,gBAAgB,CAEpB,CAAC,CAAA;AACH;;;;"}
@@ -0,0 +1,13 @@
1
+ import React__default from 'react';
2
+ import { DialogContext } from './context.js';
3
+
4
+ const useDialogContext = () => {
5
+ const context = React__default.useContext(DialogContext);
6
+ if (context == null) {
7
+ throw new Error('Dialog components must be wrapped in <Dialog />');
8
+ }
9
+ return context;
10
+ };
11
+
12
+ export { useDialogContext };
13
+ //# sourceMappingURL=useDialogContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDialogContext.js","sources":["../../../../../../../../popovers/src/components/dialog/useDialogContext.tsx"],"sourcesContent":["import React from 'react';\nimport { DialogContext } from './context';\n\nexport const useDialogContext = () => {\n const context = React.useContext(DialogContext);\n\n if (context == null) {\n throw new Error('Dialog components must be wrapped in <Dialog />');\n }\n\n return context;\n};\n"],"names":["useDialogContext","context","React","useContext","DialogContext","Error"],"mappings":";;;AAGaA,MAAAA,gBAAgB,GAAGA,MAAM;AACpC,EAAA,MAAMC,OAAO,GAAGC,cAAK,CAACC,UAAU,CAACC,aAAa,CAAC,CAAA;EAE/C,IAAIH,OAAO,IAAI,IAAI,EAAE;AACnB,IAAA,MAAM,IAAII,KAAK,CAAC,iDAAiD,CAAC,CAAA;AACpE,GAAA;AAEA,EAAA,OAAOJ,OAAO,CAAA;AAChB;;;;"}
@@ -0,0 +1,97 @@
1
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, objectSpread2 as _objectSpread2 } from '../../../../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
2
+ import React__default, { forwardRef, useContext } from 'react';
3
+ import classNames from 'classnames';
4
+ import { useTransitionStyles, useMergeRefs, FloatingPortal, FloatingFocusManager } from '../../../../../../node_modules/@floating-ui/react/dist/_internal/floating-ui.react.js';
5
+ import { mdiClose } from '@redsift/icons';
6
+ import { AppContainerContext, useTheme, useMessageFormatter, partitionComponents, isComponent, IconButton } from '@redsift/design-system';
7
+ import intlMessages from '../intl/index.js';
8
+ import { StyledFloatingOverlay, StyledDialogContent } from './styles.js';
9
+ import { DialogContentHeader } from '../../dialog-content-header/_internal/DialogContentHeader.js';
10
+ import { DialogContentBody } from '../../dialog-content-body/_internal/DialogContentBody.js';
11
+ import { DialogContentActions } from '../../dialog-content-actions/_internal/DialogContentActions.js';
12
+ import { useDialogContext } from '../../dialog/_internal/useDialogContext.js';
13
+
14
+ const _excluded = ["children", "className", "style", "theme"];
15
+ const COMPONENT_NAME = 'DialogContent';
16
+ const CLASSNAME = 'redsift-dialog-content';
17
+
18
+ /**
19
+ * The DialogContent component.
20
+ */
21
+ const BaseDialogContent = /*#__PURE__*/forwardRef((props, ref) => {
22
+ const {
23
+ children,
24
+ className,
25
+ style,
26
+ theme: propsTheme
27
+ } = props,
28
+ forwardedProps = _objectWithoutProperties(props, _excluded);
29
+ const appContainerState = useContext(AppContainerContext);
30
+ const {
31
+ context: floatingContext,
32
+ getFloatingProps,
33
+ refs,
34
+ labelId,
35
+ descriptionId,
36
+ handleOpen,
37
+ hasCloseButton,
38
+ initialFocus: propsInitialFocus,
39
+ width,
40
+ minWidth,
41
+ maxWidth,
42
+ headerRef,
43
+ bodyRef,
44
+ actionsRef
45
+ } = useDialogContext();
46
+ const theme = useTheme(propsTheme);
47
+ const {
48
+ isMounted,
49
+ styles
50
+ } = useTransitionStyles(floatingContext);
51
+ const dialogRef = useMergeRefs([refs.setFloating, ref]);
52
+ const format = useMessageFormatter(intlMessages);
53
+ const [[header], [body], [actions]] = partitionComponents(React__default.Children.toArray(children), [isComponent('DialogContentHeader'), isComponent('DialogContentBody'), isComponent('DialogContentActions')]);
54
+ const initialFocus = propsInitialFocus === 'header' ? headerRef : propsInitialFocus === 'body' ? bodyRef : propsInitialFocus === 'actions' ? actionsRef : propsInitialFocus ? propsInitialFocus : undefined;
55
+ return /*#__PURE__*/React__default.createElement(FloatingPortal, {
56
+ root: appContainerState === null || appContainerState === void 0 ? void 0 : appContainerState.appContainerRef.current
57
+ }, isMounted && /*#__PURE__*/React__default.createElement(StyledFloatingOverlay, {
58
+ lockScroll: true,
59
+ style: styles
60
+ }, /*#__PURE__*/React__default.createElement(FloatingFocusManager, {
61
+ context: floatingContext,
62
+ initialFocus: initialFocus ? initialFocus : undefined
63
+ }, /*#__PURE__*/React__default.createElement(StyledDialogContent, _extends({
64
+ $theme: theme,
65
+ className: classNames(DialogContent.className, className)
66
+ }, forwardedProps, {
67
+ ref: dialogRef,
68
+ "aria-labelledby": labelId,
69
+ "aria-describedby": descriptionId
70
+ }, getFloatingProps(props), {
71
+ style: _objectSpread2(_objectSpread2({}, styles), style),
72
+ $width: width,
73
+ $minWidth: minWidth,
74
+ $maxWidth: maxWidth
75
+ }), !header && !body && !actions ? /*#__PURE__*/React__default.createElement(DialogContentBody, null, children) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, header || hasCloseButton ? /*#__PURE__*/React__default.createElement("div", {
76
+ className: `${BaseDialogContent.className}__header`
77
+ }, header, hasCloseButton ? /*#__PURE__*/React__default.createElement(IconButton, {
78
+ theme: theme,
79
+ "aria-label": format('close'),
80
+ className: `${BaseDialogContent.className}-header__icon-button`,
81
+ color: "grey",
82
+ icon: mdiClose,
83
+ onClick: () => handleOpen(false)
84
+ }) : null) : null, body || actions ? /*#__PURE__*/React__default.createElement("div", {
85
+ className: `${BaseDialogContent.className}__content`
86
+ }, body, actions) : null)))));
87
+ });
88
+ BaseDialogContent.className = CLASSNAME;
89
+ BaseDialogContent.displayName = COMPONENT_NAME;
90
+ const DialogContent = Object.assign(BaseDialogContent, {
91
+ Header: DialogContentHeader,
92
+ Body: DialogContentBody,
93
+ Actions: DialogContentActions
94
+ });
95
+
96
+ export { BaseDialogContent, DialogContent };
97
+ //# sourceMappingURL=DialogContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogContent.js","sources":["../../../../../../../../popovers/src/components/dialog-content/DialogContent.tsx"],"sourcesContent":["import React, { forwardRef, useContext } from 'react';\nimport classNames from 'classnames';\nimport { useMergeRefs, FloatingPortal, FloatingFocusManager, useTransitionStyles } from '@floating-ui/react';\nimport { mdiClose } from '@redsift/icons';\n\nimport { AppContainerContext, useMessageFormatter } from '@redsift/design-system';\nimport intlMessages from './intl';\n\nimport { Comp, IconButton, isComponent, partitionComponents, useTheme } from '@redsift/design-system';\nimport { DialogContentProps } from './types';\nimport { useDialogContext } from '../dialog';\nimport { StyledDialogContent, StyledFloatingOverlay } from './styles';\nimport { DialogContentActions } from '../dialog-content-actions';\nimport { DialogContentBody } from '../dialog-content-body';\nimport { DialogContentHeader } from '../dialog-content-header';\n\nconst COMPONENT_NAME = 'DialogContent';\nconst CLASSNAME = 'redsift-dialog-content';\n\n/**\n * The DialogContent component.\n */\nexport const BaseDialogContent: Comp<DialogContentProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, style, theme: propsTheme, ...forwardedProps } = props;\n const appContainerState = useContext(AppContainerContext);\n const {\n context: floatingContext,\n getFloatingProps,\n refs,\n labelId,\n descriptionId,\n handleOpen,\n hasCloseButton,\n initialFocus: propsInitialFocus,\n width,\n minWidth,\n maxWidth,\n headerRef,\n bodyRef,\n actionsRef,\n } = useDialogContext();\n const theme = useTheme(propsTheme);\n const { isMounted, styles } = useTransitionStyles(floatingContext);\n const dialogRef = useMergeRefs([refs.setFloating, ref]);\n\n const format = useMessageFormatter(intlMessages);\n\n const [[header], [body], [actions]] = partitionComponents(React.Children.toArray(children), [\n isComponent('DialogContentHeader'),\n isComponent('DialogContentBody'),\n isComponent('DialogContentActions'),\n ]);\n\n const initialFocus: number | React.MutableRefObject<HTMLElement | null> | undefined =\n propsInitialFocus === 'header'\n ? headerRef\n : propsInitialFocus === 'body'\n ? bodyRef\n : propsInitialFocus === 'actions'\n ? actionsRef\n : propsInitialFocus\n ? propsInitialFocus\n : undefined;\n\n return (\n <FloatingPortal root={appContainerState?.appContainerRef.current}>\n {isMounted && (\n <StyledFloatingOverlay lockScroll style={styles}>\n <FloatingFocusManager context={floatingContext} initialFocus={initialFocus ? initialFocus : undefined}>\n <StyledDialogContent\n $theme={theme!}\n className={classNames(DialogContent.className, className)}\n {...forwardedProps}\n ref={dialogRef}\n aria-labelledby={labelId}\n aria-describedby={descriptionId}\n {...getFloatingProps(props)}\n style={{ ...styles, ...style }}\n $width={width}\n $minWidth={minWidth}\n $maxWidth={maxWidth}\n >\n {!header && !body && !actions ? (\n <DialogContentBody>{children}</DialogContentBody>\n ) : (\n <>\n {header || hasCloseButton ? (\n <div className={`${BaseDialogContent.className}__header`}>\n {header}\n\n {hasCloseButton ? (\n <IconButton\n theme={theme}\n aria-label={format('close')}\n className={`${BaseDialogContent.className}-header__icon-button`}\n color=\"grey\"\n icon={mdiClose}\n onClick={() => handleOpen(false)}\n />\n ) : null}\n </div>\n ) : null}\n {body || actions ? (\n <div className={`${BaseDialogContent.className}__content`}>\n {body}\n {actions}\n </div>\n ) : null}\n </>\n )}\n </StyledDialogContent>\n </FloatingFocusManager>\n </StyledFloatingOverlay>\n )}\n </FloatingPortal>\n );\n});\nBaseDialogContent.className = CLASSNAME;\nBaseDialogContent.displayName = COMPONENT_NAME;\n\nexport const DialogContent = Object.assign(BaseDialogContent, {\n Header: DialogContentHeader,\n Body: DialogContentBody,\n Actions: DialogContentActions,\n});\n"],"names":["COMPONENT_NAME","CLASSNAME","BaseDialogContent","forwardRef","props","ref","children","className","style","theme","propsTheme","forwardedProps","_objectWithoutProperties","_excluded","appContainerState","useContext","AppContainerContext","context","floatingContext","getFloatingProps","refs","labelId","descriptionId","handleOpen","hasCloseButton","initialFocus","propsInitialFocus","width","minWidth","maxWidth","headerRef","bodyRef","actionsRef","useDialogContext","useTheme","isMounted","styles","useTransitionStyles","dialogRef","useMergeRefs","setFloating","format","useMessageFormatter","intlMessages","header","body","actions","partitionComponents","React","Children","toArray","isComponent","undefined","createElement","FloatingPortal","root","appContainerRef","current","StyledFloatingOverlay","lockScroll","FloatingFocusManager","StyledDialogContent","_extends","$theme","classNames","DialogContent","_objectSpread","$width","$minWidth","$maxWidth","DialogContentBody","Fragment","IconButton","color","icon","mdiClose","onClick","displayName","Object","assign","Header","DialogContentHeader","Body","Actions","DialogContentActions"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,cAAc,GAAG,eAAe,CAAA;AACtC,MAAMC,SAAS,GAAG,wBAAwB,CAAA;;AAE1C;AACA;AACA;AACO,MAAMC,iBAA2D,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACpG,MAAM;MAAEC,QAAQ;MAAEC,SAAS;MAAEC,KAAK;AAAEC,MAAAA,KAAK,EAAEC,UAAAA;AAA8B,KAAC,GAAGN,KAAK;AAAxBO,IAAAA,cAAc,GAAAC,wBAAA,CAAKR,KAAK,EAAAS,SAAA,CAAA,CAAA;AAClF,EAAA,MAAMC,iBAAiB,GAAGC,UAAU,CAACC,mBAAmB,CAAC,CAAA;EACzD,MAAM;AACJC,IAAAA,OAAO,EAAEC,eAAe;IACxBC,gBAAgB;IAChBC,IAAI;IACJC,OAAO;IACPC,aAAa;IACbC,UAAU;IACVC,cAAc;AACdC,IAAAA,YAAY,EAAEC,iBAAiB;IAC/BC,KAAK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,MAAM,CAAC,OAAO,CAAE;AAC5BlC,IAAAA,SAAS,EAAG,CAAA,EAAEL,iBAAiB,CAACK,SAAU,CAAsB,oBAAA,CAAA;AAChEkE,IAAAA,KAAK,EAAC,MAAM;AACZC,IAAAA,IAAI,EAAEC,QAAS;AACfC,IAAAA,OAAO,EAAEA,MAAMrD,UAAU,CAAC,KAAK,CAAA;AAAE,GAClC,CAAC,GACA,IACD,CAAC,GACJ,IAAI,EACPsB,IAAI,IAAIC,OAAO,gBACdE,cAAA,CAAAK,aAAA,CAAA,KAAA,EAAA;AAAK9C,IAAAA,SAAS,EAAG,CAAA,EAAEL,iBAAiB,CAACK,SAAU,CAAA,SAAA,CAAA;GAC5CsC,EAAAA,IAAI,EACJC,OACE,CAAC,GACJ,IACJ,CAEe,CACD,CACD,CAEX,CAAC,CAAA;AAErB,CAAC,EAAC;AACF5C,iBAAiB,CAACK,SAAS,GAAGN,SAAS,CAAA;AACvCC,iBAAiB,CAAC2E,WAAW,GAAG7E,cAAc,CAAA;AAEvC,MAAMiE,aAAa,GAAGa,MAAM,CAACC,MAAM,CAAC7E,iBAAiB,EAAE;AAC5D8E,EAAAA,MAAM,EAAEC,mBAAmB;AAC3BC,EAAAA,IAAI,EAAEZ,iBAAiB;AACvBa,EAAAA,OAAO,EAAEC,oBAAAA;AACX,CAAC;;;;"}
@@ -0,0 +1,77 @@
1
+ import { FloatingOverlay } from '../../../../../../node_modules/@floating-ui/react/dist/_internal/floating-ui.react.js';
2
+ import styled, { css } from 'styled-components';
3
+ import { baseContainer, Theme } from '@redsift/design-system';
4
+
5
+ /**
6
+ * Component style.
7
+ */
8
+ const StyledDialogContent = styled.div`
9
+ ${baseContainer}
10
+ ${_ref => {
11
+ let {
12
+ $theme
13
+ } = _ref;
14
+ return css`
15
+ color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});
16
+ background-color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'black' : 'white'});
17
+ `;
18
+ }}
19
+
20
+ border-radius: 4px;
21
+ box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2);
22
+ display: flex;
23
+ filter: drop-shadow(0px 4px 5px rgba(0, 0, 0, 0.14)) drop-shadow(0px 1px 10px rgba(0, 0, 0, 0.12));
24
+ flex-direction: column;
25
+ font-family: var(--redsift-typography-dialog-font-family);
26
+ font-size: var(--redsift-typography-dialog-font-size);
27
+ font-weight: var(--redsift-typography-dialog-font-weight);
28
+ line-height: var(--redsift-typography-dialog-line-height);
29
+ margin: 32px;
30
+ max-width: calc(100vw - 48px);
31
+ padding: 24px;
32
+ width: 540px;
33
+ z-index: var(--redsift-layout-z-index-dialog);
34
+
35
+ ${_ref2 => {
36
+ let {
37
+ $width,
38
+ $maxWidth,
39
+ $minWidth
40
+ } = _ref2;
41
+ return css`
42
+ ${$width !== undefined ? `width: ${$width};` : ''}
43
+ ${$maxWidth !== undefined ? `min-width: ${$maxWidth};` : ''}
44
+ ${$minWidth !== undefined ? `max-width: ${$minWidth};` : ''}
45
+ `;
46
+ }}
47
+
48
+ &:focus-visible {
49
+ outline: none;
50
+ }
51
+
52
+ .redsift-dialog-content__header {
53
+ align-items: flex-start;
54
+ display: flex;
55
+ justify-content: space-between;
56
+ }
57
+
58
+ .redsift-card-header__icon-button {
59
+ margin-top: 8px;
60
+ margin-left: auto;
61
+ margin-right: 8px;
62
+
63
+ [dir='rtl'] & {
64
+ margin-left: 8px;
65
+ margin-right: auto;
66
+ }
67
+ }
68
+ `;
69
+ const StyledFloatingOverlay = styled(FloatingOverlay)`
70
+ background: rgba(0, 0, 0, 0.8);
71
+ display: grid;
72
+ place-items: center;
73
+ z-index: var(--redsift-layout-z-index-overlay);
74
+ `;
75
+
76
+ export { StyledDialogContent, StyledFloatingOverlay };
77
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sources":["../../../../../../../../popovers/src/components/dialog-content/styles.ts"],"sourcesContent":["import { FloatingOverlay } from '@floating-ui/react';\nimport styled, { css } from 'styled-components';\nimport { StyledDialogContentProps } from './types';\nimport { Theme, baseContainer } from '@redsift/design-system';\n\n/**\n * Component style.\n */\nexport const StyledDialogContent = styled.div<StyledDialogContentProps>`\n ${baseContainer}\n ${({ $theme }) => css`\n color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});\n background-color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'black' : 'white'});\n `}\n\n border-radius: 4px;\n box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2);\n display: flex;\n filter: drop-shadow(0px 4px 5px rgba(0, 0, 0, 0.14)) drop-shadow(0px 1px 10px rgba(0, 0, 0, 0.12));\n flex-direction: column;\n font-family: var(--redsift-typography-dialog-font-family);\n font-size: var(--redsift-typography-dialog-font-size);\n font-weight: var(--redsift-typography-dialog-font-weight);\n line-height: var(--redsift-typography-dialog-line-height);\n margin: 32px;\n max-width: calc(100vw - 48px);\n padding: 24px;\n width: 540px;\n z-index: var(--redsift-layout-z-index-dialog);\n\n ${({ $width, $maxWidth, $minWidth }) => css`\n ${$width !== undefined ? `width: ${$width};` : ''}\n ${$maxWidth !== undefined ? `min-width: ${$maxWidth};` : ''}\n ${$minWidth !== undefined ? `max-width: ${$minWidth};` : ''}\n `}\n\n &:focus-visible {\n outline: none;\n }\n\n .redsift-dialog-content__header {\n align-items: flex-start;\n display: flex;\n justify-content: space-between;\n }\n\n .redsift-card-header__icon-button {\n margin-top: 8px;\n margin-left: auto;\n margin-right: 8px;\n\n [dir='rtl'] & {\n margin-left: 8px;\n margin-right: auto;\n }\n }\n`;\n\nexport const StyledFloatingOverlay = styled(FloatingOverlay)`\n background: rgba(0, 0, 0, 0.8);\n display: grid;\n place-items: center;\n z-index: var(--redsift-layout-z-index-overlay);\n`;\n"],"names":["StyledDialogContent","styled","div","baseContainer","_ref","$theme","css","Theme","dark","_ref2","$width","$maxWidth","$minWidth","undefined","StyledFloatingOverlay","FloatingOverlay"],"mappings":";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Close";
2
+ var enUS = {
3
+ close: close
4
+ };
5
+
6
+ export { close, enUS as default };
7
+ //# sourceMappingURL=en-US.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en-US.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,7 @@
1
+ var close = "Fermer";
2
+ var frFR = {
3
+ close: close
4
+ };
5
+
6
+ export { close, frFR as default };
7
+ //# sourceMappingURL=fr-FR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fr-FR.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,10 @@
1
+ import enUS from './_internal/en-US.js';
2
+ import frFR from './_internal/fr-FR.js';
3
+
4
+ var intlMessages = {
5
+ 'en-US': enUS,
6
+ 'fr-FR': frFR
7
+ };
8
+
9
+ export { intlMessages as default };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../popovers/src/components/dialog-content/intl/index.ts"],"sourcesContent":["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"],"names":["enUS","frFR"],"mappings":";;;AAGA,mBAAe;AACb,EAAA,OAAO,EAAEA,IAAI;AACb,EAAA,OAAO,EAAEC,IAAAA;AACX,CAAC;;;;"}
@@ -0,0 +1,38 @@
1
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
2
+ import React__default, { forwardRef } from 'react';
3
+ import classNames from 'classnames';
4
+ import { useMergeRefs } from '../../../../../../node_modules/@floating-ui/react/dist/_internal/floating-ui.react.js';
5
+ import { StyledDialogContentActions } from './styles.js';
6
+ import { useDialogContext } from '../../dialog/_internal/useDialogContext.js';
7
+
8
+ const _excluded = ["children", "className", "flexDirection"];
9
+ const COMPONENT_NAME = 'DialogContentActions';
10
+ const CLASSNAME = 'redsift-dialog-content-actions';
11
+
12
+ /**
13
+ * The DialogContentActions component.
14
+ */
15
+ const DialogContentActions = /*#__PURE__*/forwardRef((props, ref) => {
16
+ const {
17
+ children,
18
+ className,
19
+ flexDirection = 'row'
20
+ } = props,
21
+ forwardedProps = _objectWithoutProperties(props, _excluded);
22
+ const {
23
+ actionsRef,
24
+ initialFocus
25
+ } = useDialogContext();
26
+ return /*#__PURE__*/React__default.createElement(StyledDialogContentActions, _extends({
27
+ flexDirection: flexDirection
28
+ }, forwardedProps, {
29
+ className: classNames(DialogContentActions.className, className),
30
+ ref: useMergeRefs([ref, actionsRef]),
31
+ tabIndex: initialFocus === 'actions' ? -1 : undefined
32
+ }), children);
33
+ });
34
+ DialogContentActions.className = CLASSNAME;
35
+ DialogContentActions.displayName = COMPONENT_NAME;
36
+
37
+ export { DialogContentActions };
38
+ //# sourceMappingURL=DialogContentActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogContentActions.js","sources":["../../../../../../../../popovers/src/components/dialog-content-actions/DialogContentActions.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport classNames from 'classnames';\nimport { useMergeRefs } from '@floating-ui/react';\n\nimport { Comp } from '@redsift/design-system';\nimport { StyledDialogContentActions } from './styles';\nimport { DialogContentActionsProps } from './types';\nimport { useDialogContext } from '../dialog';\n\nconst COMPONENT_NAME = 'DialogContentActions';\nconst CLASSNAME = 'redsift-dialog-content-actions';\n\n/**\n * The DialogContentActions component.\n */\nexport const DialogContentActions: Comp<DialogContentActionsProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, flexDirection = 'row', ...forwardedProps } = props;\n\n const { actionsRef, initialFocus } = useDialogContext();\n\n return (\n <StyledDialogContentActions\n flexDirection={flexDirection}\n {...forwardedProps}\n className={classNames(DialogContentActions.className, className)}\n ref={useMergeRefs([ref, actionsRef])}\n tabIndex={initialFocus === 'actions' ? -1 : undefined}\n >\n {children}\n </StyledDialogContentActions>\n );\n});\nDialogContentActions.className = CLASSNAME;\nDialogContentActions.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","DialogContentActions","forwardRef","props","ref","children","className","flexDirection","forwardedProps","_objectWithoutProperties","_excluded","actionsRef","initialFocus","useDialogContext","React","createElement","StyledDialogContentActions","_extends","classNames","useMergeRefs","tabIndex","undefined","displayName"],"mappings":";;;;;;;;AASA,MAAMA,cAAc,GAAG,sBAAsB,CAAA;AAC7C,MAAMC,SAAS,GAAG,gCAAgC,CAAA;;AAElD;AACA;AACA;AACO,MAAMC,oBAAqE,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC9G,MAAM;MAAEC,QAAQ;MAAEC,SAAS;AAAEC,MAAAA,aAAa,GAAG,KAAA;AAAyB,KAAC,GAAGJ,KAAK;AAAxBK,IAAAA,cAAc,GAAAC,wBAAA,CAAKN,KAAK,EAAAO,SAAA,CAAA,CAAA;EAE/E,MAAM;IAAEC,UAAU;AAAEC,IAAAA,YAAAA;GAAc,GAAGC,gBAAgB,EAAE,CAAA;AAEvD,EAAA,oBACEC,cAAA,CAAAC,aAAA,CAACC,0BAA0B,EAAAC,QAAA,CAAA;AACzBV,IAAAA,aAAa,EAAEA,aAAAA;AAAc,GAAA,EACzBC,cAAc,EAAA;IAClBF,SAAS,EAAEY,UAAU,CAACjB,oBAAoB,CAACK,SAAS,EAAEA,SAAS,CAAE;IACjEF,GAAG,EAAEe,YAAY,CAAC,CAACf,GAAG,EAAEO,UAAU,CAAC,CAAE;AACrCS,IAAAA,QAAQ,EAAER,YAAY,KAAK,SAAS,GAAG,CAAC,CAAC,GAAGS,SAAAA;AAAU,GAAA,CAAA,EAErDhB,QACyB,CAAC,CAAA;AAEjC,CAAC,EAAC;AACFJ,oBAAoB,CAACK,SAAS,GAAGN,SAAS,CAAA;AAC1CC,oBAAoB,CAACqB,WAAW,GAAGvB,cAAc;;;;"}
@@ -0,0 +1,20 @@
1
+ import styled from 'styled-components';
2
+ import { baseContainer } from '@redsift/design-system';
3
+
4
+ /**
5
+ * Component style.
6
+ */
7
+ const StyledDialogContentActions = styled.div`
8
+ display: flex;
9
+ ${baseContainer}
10
+
11
+ margin-top: 8px;
12
+ margin-bottom: 8px;
13
+
14
+ &:focus-visible {
15
+ outline: none;
16
+ }
17
+ `;
18
+
19
+ export { StyledDialogContentActions };
20
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sources":["../../../../../../../../popovers/src/components/dialog-content-actions/styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { baseContainer } from '@redsift/design-system';\nimport { StyledDialogContentActionsProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledDialogContentActions = styled.div<StyledDialogContentActionsProps>`\n display: flex;\n ${baseContainer}\n\n margin-top: 8px;\n margin-bottom: 8px;\n\n &:focus-visible {\n outline: none;\n }\n`;\n"],"names":["StyledDialogContentActions","styled","div","baseContainer"],"mappings":";;;AAIA;AACA;AACA;AACaA,MAAAA,0BAA0B,GAAGC,MAAM,CAACC,GAAqC,CAAA;AACtF;AACA,EAAA,EAAIC,aAAc,CAAA;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}