@capillarytech/blaze-ui 6.4.0 → 6.6.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 (80) hide show
  1. package/CapAdvancedIcon/types.d.ts +1 -0
  2. package/CapAdvancedIcon/types.d.ts.map +1 -1
  3. package/CapDateRangePicker/index.d.ts.map +1 -1
  4. package/CapDateRangePicker/index.js +5 -1
  5. package/CapDateRangePicker/styles.css +28 -0
  6. package/CapDateRangePicker/styles.module.scss.js +2 -1
  7. package/CapDateRangePicker/styles.scss +37 -0
  8. package/CapDateRangePicker/types.d.ts +5 -0
  9. package/CapDateRangePicker/types.d.ts.map +1 -1
  10. package/CapDnDGraph/index.js +2 -2
  11. package/CapDndGraphSidebar/SideBarIcon.d.ts +3 -23
  12. package/CapDndGraphSidebar/SideBarIcon.d.ts.map +1 -1
  13. package/CapDndGraphSidebar/SideBarIcon.js +21 -39
  14. package/CapDndGraphSidebar/SidebarNodesRendered.d.ts +3 -9
  15. package/CapDndGraphSidebar/SidebarNodesRendered.d.ts.map +1 -1
  16. package/CapDndGraphSidebar/SidebarNodesRendered.js +13 -4
  17. package/CapDndGraphSidebar/index.d.ts +4 -20
  18. package/CapDndGraphSidebar/index.d.ts.map +1 -1
  19. package/CapDndGraphSidebar/index.js +31 -33
  20. package/CapDndGraphSidebar/styles.css +19 -6
  21. package/CapDndGraphSidebar/styles.module.scss.js +15 -0
  22. package/CapDndGraphSidebar/styles.scss +68 -51
  23. package/CapDndGraphSidebar/types.d.ts +106 -0
  24. package/CapDndGraphSidebar/types.d.ts.map +1 -0
  25. package/CapDndGraphSidebar/types.js +1 -0
  26. package/CapIcon/index.js +12 -12
  27. package/CapIcon/styles.css +17 -21
  28. package/CapIcon/styles.module.scss.js +3 -4
  29. package/CapIcon/styles.scss +10 -15
  30. package/CapMediaPreview/ImageRenderer.d.ts +2 -15
  31. package/CapMediaPreview/ImageRenderer.d.ts.map +1 -1
  32. package/CapMediaPreview/ImageRenderer.js +3 -11
  33. package/CapMediaPreview/MediaRenderer.d.ts +2 -1
  34. package/CapMediaPreview/MediaRenderer.d.ts.map +1 -1
  35. package/CapMediaPreview/MediaRenderer.js +17 -15
  36. package/CapMediaPreview/VideoPlayer.d.ts +2 -1
  37. package/CapMediaPreview/VideoPlayer.d.ts.map +1 -1
  38. package/CapMediaPreview/VideoPlayer.js +16 -15
  39. package/CapMediaPreview/index.d.ts +4 -51
  40. package/CapMediaPreview/index.d.ts.map +1 -1
  41. package/CapMediaPreview/index.js +86 -69
  42. package/CapMediaPreview/styles.css +31 -21
  43. package/CapMediaPreview/styles.module.scss.js +24 -0
  44. package/CapMediaPreview/styles.scss +38 -27
  45. package/CapMediaPreview/types.d.ts +48 -0
  46. package/CapMediaPreview/types.d.ts.map +1 -0
  47. package/CapMediaPreview/types.js +1 -0
  48. package/CapMobileDateRangePicker/DateRangeInputSelectors.d.ts +7 -0
  49. package/CapMobileDateRangePicker/DateRangeInputSelectors.d.ts.map +1 -0
  50. package/CapMobileDateRangePicker/DateRangeInputSelectors.js +68 -0
  51. package/CapMobileDateRangePicker/ReactMobileDatePickerModule.d.ts.map +1 -1
  52. package/CapMobileDateRangePicker/ReactMobileDatePickerModule.js +2 -1
  53. package/CapMobileDateRangePicker/index.d.ts +5 -21
  54. package/CapMobileDateRangePicker/index.d.ts.map +1 -1
  55. package/CapMobileDateRangePicker/index.js +256 -309
  56. package/CapMobileDateRangePicker/messages.d.ts +17 -0
  57. package/CapMobileDateRangePicker/messages.d.ts.map +1 -0
  58. package/CapMobileDateRangePicker/messages.js +20 -0
  59. package/CapMobileDateRangePicker/styles.css +107 -144
  60. package/CapMobileDateRangePicker/styles.module.scss.js +21 -0
  61. package/CapMobileDateRangePicker/styles.scss +188 -192
  62. package/CapMobileDateRangePicker/tests/CapMobileDateRangePicker.mockData.d.ts +18 -0
  63. package/CapMobileDateRangePicker/tests/CapMobileDateRangePicker.mockData.d.ts.map +1 -0
  64. package/CapMobileDateRangePicker/types.d.ts +95 -0
  65. package/CapMobileDateRangePicker/types.d.ts.map +1 -0
  66. package/CapMobileDateRangePicker/types.js +1 -0
  67. package/CapMobileDateRangePicker/utils.d.ts +3 -0
  68. package/CapMobileDateRangePicker/utils.d.ts.map +1 -0
  69. package/CapMobileDateRangePicker/utils.js +5 -0
  70. package/CapSelectFilter/types.d.ts +1 -1
  71. package/CapSelectFilter/types.d.ts.map +1 -1
  72. package/index.d.ts +6 -0
  73. package/index.d.ts.map +1 -1
  74. package/index.js +118 -112
  75. package/package.json +2 -2
  76. package/utils/dayjs.d.ts +29 -0
  77. package/utils/dayjs.d.ts.map +1 -1
  78. package/utils/dayjs.js +30 -0
  79. package/utils/getCapThemeConfig.d.ts +1 -1
  80. package/utils/getCapThemeConfig.d.ts.map +1 -1
@@ -4,57 +4,10 @@
4
4
  * A component for displaying enlarged media (images, videos, documents, and more) in a carousel view
5
5
  *
6
6
  */
7
- import PropTypes from 'prop-types';
8
7
  import React from 'react';
9
- import './styles.scss';
10
- export declare const CapMediaPreview: {
11
- ({ intl: { formatMessage }, overrideClassName, overrideWrapperClassName, isMediaPreviewVisible, media, startIndex, width, height, topNavigationHeight, onClose, modalProps, }: {
12
- intl: {
13
- formatMessage: any;
14
- };
15
- overrideClassName: any;
16
- overrideWrapperClassName: any;
17
- isMediaPreviewVisible: any;
18
- media: any;
19
- startIndex: any;
20
- width: any;
21
- height: any;
22
- topNavigationHeight: any;
23
- onClose: any;
24
- modalProps: any;
25
- }): import("react/jsx-runtime").JSX.Element;
26
- propTypes: {
27
- intl: PropTypes.Validator<object>;
28
- overrideClassName: PropTypes.Requireable<string>;
29
- overrideWrapperClassName: PropTypes.Requireable<string>;
30
- isMediaPreviewVisible: PropTypes.Requireable<boolean>;
31
- media: PropTypes.Requireable<PropTypes.InferProps<{
32
- type: PropTypes.Validator<string>;
33
- file: PropTypes.Validator<NonNullable<NonNullable<string | object>>>;
34
- name: PropTypes.Requireable<string>;
35
- imageProps: PropTypes.Requireable<object>;
36
- videoProps: PropTypes.Requireable<object>;
37
- }>[]>;
38
- startIndex: PropTypes.Requireable<number>;
39
- width: PropTypes.Requireable<string>;
40
- height: PropTypes.Requireable<string>;
41
- topNavigationHeight: PropTypes.Requireable<string>;
42
- onClose: PropTypes.Requireable<(...args: any[]) => any>;
43
- modalProps: PropTypes.Requireable<object>;
44
- };
45
- defaultProps: {
46
- overrideClassName: string;
47
- overrideWrapperClassName: string;
48
- isMediaPreviewVisible: boolean;
49
- media: any[];
50
- startIndex: number;
51
- width: string;
52
- height: string;
53
- topNavigationHeight: string;
54
- onClose: () => void;
55
- modalProps: {};
56
- };
57
- };
58
- declare const _default: React.ComponentType<Omit<import("react-intl").WrappedComponentProps, "intl">>;
8
+ import type { WrappedComponentProps } from 'react-intl';
9
+ import type { CapMediaPreviewProps } from './types';
10
+ export declare const CapMediaPreview: ({ intl: { formatMessage }, overrideClassName, overrideWrapperClassName, isMediaPreviewVisible, media, startIndex, width, height, topNavigationHeight, onClose, modalProps, ...rest }: CapMediaPreviewProps & WrappedComponentProps) => import("react/jsx-runtime").JSX.Element;
11
+ declare const _default: React.ComponentType<Omit<CapMediaPreviewProps & WrappedComponentProps, "intl">>;
59
12
  export default _default;
60
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapMediaPreview/index.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,KAA2C,MAAM,OAAO,CAAC;AAUhE,OAAO,eAAe,CAAC;AAEvB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuI3B,CAAC;;AAqCF,wBAA2C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapMediaPreview/index.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAWxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,eAAe,GAAI,sLAa7B,oBAAoB,GAAG,qBAAqB,4CAsL9C,CAAC;;AAEF,wBAA2C"}
@@ -1,37 +1,39 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
- import { Modal } from "antd";
2
+ import { Modal } from "antd-v5";
3
3
  import classNames from "classnames";
4
- import PropTypes from "prop-types";
5
4
  import { useState, useEffect, useCallback } from "react";
6
5
  import { injectIntl } from "react-intl";
7
6
  import CapHeader from "../CapHeader/index.js";
8
7
  import CapIcon from "../CapIcon/index.js";
9
8
  import CapRow from "../CapRow/index.js";
9
+ import logDeprecationWarning from "../utils/logDeprecationWarning.js";
10
10
  import { CLASS_PREFIX } from "./constants.js";
11
11
  import MediaRenderer from "./MediaRenderer.js";
12
12
  import messages from "./messages.js";
13
- import './styles.css';/* empty css */
13
+ import styles from "./styles.module.scss.js";
14
14
  const CapMediaPreview = ({
15
15
  intl: { formatMessage },
16
- overrideClassName,
17
- overrideWrapperClassName,
18
- isMediaPreviewVisible,
19
- media,
20
- startIndex,
21
- width,
22
- height,
23
- topNavigationHeight,
24
- onClose,
25
- modalProps
16
+ overrideClassName = "",
17
+ overrideWrapperClassName = "",
18
+ isMediaPreviewVisible = false,
19
+ media = [],
20
+ startIndex = 0,
21
+ width = "100vw",
22
+ height = "100vh",
23
+ topNavigationHeight = "64px",
24
+ onClose = () => {
25
+ },
26
+ modalProps = {},
27
+ ...rest
26
28
  }) => {
27
- const [currentIndex, setCurrentIndex] = useState(startIndex || 0);
29
+ const [currentIndex, setCurrentIndex] = useState(startIndex);
28
30
  const mediaLength = (media == null ? void 0 : media.length) || 0;
29
31
  const currentMedia = media && media[currentIndex] ? media[currentIndex] : {};
30
32
  const showNavigation = mediaLength > 1;
31
33
  const isLeftNavDisabled = currentIndex === 0;
32
34
  const isRightNavDisabled = currentIndex === mediaLength - 1;
33
35
  useEffect(() => {
34
- if (isMediaPreviewVisible && startIndex !== void 0) {
36
+ if (isMediaPreviewVisible) {
35
37
  setCurrentIndex(startIndex);
36
38
  }
37
39
  }, [startIndex, isMediaPreviewVisible]);
@@ -71,64 +73,113 @@ const CapMediaPreview = ({
71
73
  if (!isMediaPreviewVisible || !(media == null ? void 0 : media.length)) {
72
74
  return /* @__PURE__ */ jsx(Fragment, {});
73
75
  }
76
+ const modalPropsWithDeprecation = modalProps;
77
+ if (modalPropsWithDeprecation.visible !== void 0) {
78
+ logDeprecationWarning("CapMediaPreview", "visible", modalPropsWithDeprecation.visible, "open");
79
+ }
80
+ if (modalPropsWithDeprecation.onVisibleChange !== void 0) {
81
+ logDeprecationWarning(
82
+ "CapMediaPreview",
83
+ "onVisibleChange",
84
+ modalPropsWithDeprecation.onVisibleChange,
85
+ "afterOpenChange"
86
+ );
87
+ }
88
+ const finalOpen = modalPropsWithDeprecation.open ?? modalPropsWithDeprecation.visible ?? isMediaPreviewVisible;
89
+ const finalOnCancel = modalPropsWithDeprecation.onCancel ?? onClose;
90
+ const {
91
+ visible: _visible,
92
+ onVisibleChange: _onVisibleChange,
93
+ classNames: _classNames,
94
+ styles: _styles,
95
+ style: _style,
96
+ ...spreadableModalProps
97
+ } = modalPropsWithDeprecation;
98
+ const existingClassNames = typeof _classNames === "object" && _classNames && !("call" in _classNames) ? _classNames : {};
99
+ const modalClassNames = {
100
+ wrapper: classNames(
101
+ styles[`${CLASS_PREFIX}-wrapper`],
102
+ overrideWrapperClassName,
103
+ existingClassNames.wrapper
104
+ ),
105
+ container: classNames(styles[`${CLASS_PREFIX}-modal-content`], existingClassNames.container),
106
+ body: classNames(styles[`${CLASS_PREFIX}-body`], existingClassNames.body),
107
+ ...Object.fromEntries(
108
+ Object.entries(existingClassNames).filter(
109
+ ([key]) => !["wrapper", "container", "body"].includes(key)
110
+ )
111
+ )
112
+ };
74
113
  return /* @__PURE__ */ jsx(
75
114
  Modal,
76
115
  {
77
- visible: isMediaPreviewVisible,
116
+ open: finalOpen,
78
117
  footer: null,
79
118
  closable: false,
80
119
  centered: true,
81
120
  keyboard: false,
82
121
  destroyOnClose: true,
83
- onCancel: onClose,
122
+ onCancel: finalOnCancel,
84
123
  className: classNames(CLASS_PREFIX, overrideClassName),
85
- wrapClassName: classNames(`${CLASS_PREFIX}-wrapper`, overrideWrapperClassName),
124
+ classNames: modalClassNames,
125
+ width,
126
+ styles: _styles,
86
127
  style: {
87
128
  "--top-navigation-height": topNavigationHeight,
88
- "--modal-width": width,
89
- "--modal-height": height
129
+ "--modal-width": width !== void 0 ? String(width) : void 0,
130
+ "--modal-height": height,
131
+ ..._style
90
132
  },
91
- ...modalProps,
92
- children: /* @__PURE__ */ jsxs(CapRow, { className: `${CLASS_PREFIX}-container`, children: [
133
+ ...spreadableModalProps,
134
+ ...rest,
135
+ children: /* @__PURE__ */ jsxs(CapRow, { className: styles[`${CLASS_PREFIX}-container`], children: [
93
136
  /* @__PURE__ */ jsxs(
94
137
  CapRow,
95
138
  {
96
- className: `${CLASS_PREFIX}-header`,
139
+ className: styles[`${CLASS_PREFIX}-header`],
97
140
  type: "flex",
98
141
  justify: "space-between",
99
142
  align: "middle",
100
143
  children: [
101
144
  /* @__PURE__ */ jsx(CapHeader, { title: (currentMedia == null ? void 0 : currentMedia.name) || formatMessage(messages.mediaPreview) }),
102
- /* @__PURE__ */ jsx(CapIcon, { type: "close", onClick: onClose })
145
+ /* @__PURE__ */ jsx(CapIcon, { type: "close", onClick: finalOnCancel })
103
146
  ]
104
147
  }
105
148
  ),
106
- /* @__PURE__ */ jsxs(CapRow, { className: `${CLASS_PREFIX}-content`, children: [
149
+ /* @__PURE__ */ jsxs(CapRow, { className: styles[`${CLASS_PREFIX}-content`], children: [
107
150
  showNavigation && /* @__PURE__ */ jsx(
108
151
  CapRow,
109
152
  {
110
- className: classNames(`${CLASS_PREFIX}-nav-button`, "left", {
111
- disabled: isLeftNavDisabled
112
- }),
153
+ className: classNames(
154
+ styles[`${CLASS_PREFIX}-nav-button`],
155
+ styles[`${CLASS_PREFIX}-nav-button-left`],
156
+ {
157
+ [styles[`${CLASS_PREFIX}-nav-button-disabled`]]: isLeftNavDisabled
158
+ }
159
+ ),
113
160
  onClick: handlePrevious,
114
161
  disabled: isLeftNavDisabled,
115
- children: /* @__PURE__ */ jsx(CapIcon, { className: `${CLASS_PREFIX}-nav-button-icon`, type: "chevron-left" })
162
+ children: /* @__PURE__ */ jsx(CapIcon, { className: styles[`${CLASS_PREFIX}-nav-button-icon`], type: "chevron-left" })
116
163
  }
117
164
  ),
118
- /* @__PURE__ */ jsx(CapRow, { className: `${CLASS_PREFIX}-media-container`, children: /* @__PURE__ */ jsx(MediaRenderer, { currentMedia }) }),
165
+ /* @__PURE__ */ jsx(CapRow, { className: styles[`${CLASS_PREFIX}-media-container`], children: /* @__PURE__ */ jsx(MediaRenderer, { currentMedia }) }),
119
166
  showNavigation && /* @__PURE__ */ jsx(
120
167
  CapRow,
121
168
  {
122
- className: classNames(`${CLASS_PREFIX}-nav-button`, "right", {
123
- disabled: isRightNavDisabled
124
- }),
169
+ className: classNames(
170
+ styles[`${CLASS_PREFIX}-nav-button`],
171
+ styles[`${CLASS_PREFIX}-nav-button-right`],
172
+ {
173
+ [styles[`${CLASS_PREFIX}-nav-button-disabled`]]: isRightNavDisabled
174
+ }
175
+ ),
125
176
  onClick: handleNext,
126
177
  disabled: isRightNavDisabled,
127
- children: /* @__PURE__ */ jsx(CapIcon, { className: `${CLASS_PREFIX}-nav-button-icon`, type: "chevron-right" })
178
+ children: /* @__PURE__ */ jsx(CapIcon, { className: styles[`${CLASS_PREFIX}-nav-button-icon`], type: "chevron-right" })
128
179
  }
129
180
  )
130
181
  ] }),
131
- mediaLength > 1 && /* @__PURE__ */ jsxs(CapRow, { className: `${CLASS_PREFIX}-counter`, children: [
182
+ mediaLength > 1 && /* @__PURE__ */ jsxs(CapRow, { className: styles[`${CLASS_PREFIX}-counter`], children: [
132
183
  currentIndex + 1,
133
184
  " / ",
134
185
  mediaLength
@@ -137,40 +188,6 @@ const CapMediaPreview = ({
137
188
  }
138
189
  );
139
190
  };
140
- CapMediaPreview.propTypes = {
141
- intl: PropTypes.object.isRequired,
142
- overrideClassName: PropTypes.string,
143
- overrideWrapperClassName: PropTypes.string,
144
- isMediaPreviewVisible: PropTypes.bool,
145
- media: PropTypes.arrayOf(
146
- PropTypes.shape({
147
- type: PropTypes.string.isRequired,
148
- file: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
149
- name: PropTypes.string,
150
- imageProps: PropTypes.object,
151
- videoProps: PropTypes.object
152
- })
153
- ),
154
- startIndex: PropTypes.number,
155
- width: PropTypes.string,
156
- height: PropTypes.string,
157
- topNavigationHeight: PropTypes.string,
158
- onClose: PropTypes.func,
159
- modalProps: PropTypes.object
160
- };
161
- CapMediaPreview.defaultProps = {
162
- overrideClassName: "",
163
- overrideWrapperClassName: "",
164
- isMediaPreviewVisible: false,
165
- media: [],
166
- startIndex: 0,
167
- width: "100vw",
168
- height: "100vh",
169
- topNavigationHeight: "64px",
170
- onClose: () => {
171
- },
172
- modalProps: {}
173
- };
174
191
  const index = injectIntl(CapMediaPreview);
175
192
  export {
176
193
  CapMediaPreview,
@@ -15,33 +15,42 @@
15
15
  top: 0;
16
16
  padding-bottom: 0;
17
17
  }
18
- .cap-media-preview {
18
+ .ant-modal.cap-media-preview,
19
+ .ant-modal-wrap .ant-modal.cap-media-preview {
19
20
  width: var(--modal-width) !important;
20
21
  height: var(--modal-height) !important;
21
22
  top: var(--top-navigation-height) !important;
22
- padding: 0;
23
- margin: 0;
24
- }
25
- .cap-media-preview .ant-modal-content {
26
- height: calc(var(--modal-height) - var(--top-navigation-height));
27
- background-color: rgba(94, 94, 94, 0.4);
28
- backdrop-filter: blur(0.857rem);
29
- border-radius: 0;
30
- display: flex;
31
- flex-direction: column;
32
- padding: 0;
33
23
  }
34
- .cap-media-preview .ant-modal-body {
35
- flex: 1;
24
+ .cap-media-preview-modal-content {
25
+ height: calc(var(--modal-height) - var(--top-navigation-height)) !important;
26
+ background: rgba(94, 94, 94, 0.4) !important;
27
+ backdrop-filter: blur(0.857rem) !important;
28
+ border-radius: 0 !important;
29
+ display: flex !important;
30
+ flex-direction: column !important;
31
+ padding: 0 !important;
32
+ box-shadow: none !important;
33
+ width: 100% !important;
34
+ margin: 0 !important;
35
+ border: none !important;
36
+ outline: none !important;
37
+ transform: none !important;
38
+ position: relative !important;
39
+ color: inherit !important;
40
+ }
41
+ .cap-media-preview-body {
42
+ flex: 1 !important;
43
+ flex-direction: column !important;
36
44
  display: flex;
37
45
  align-items: center;
38
46
  justify-content: center;
39
- padding: 0;
47
+ padding: 0 !important;
40
48
  overflow: hidden;
41
49
  }
42
50
  .cap-media-preview-container {
43
51
  width: 100%;
44
- height: 100%;
52
+ flex: 1;
53
+ min-height: 0;
45
54
  display: flex;
46
55
  flex-direction: column;
47
56
  align-items: center;
@@ -61,7 +70,8 @@
61
70
  .cap-media-preview-content {
62
71
  position: relative;
63
72
  width: 100%;
64
- height: 100%;
73
+ flex: 1;
74
+ min-height: 0;
65
75
  display: flex;
66
76
  align-items: center;
67
77
  justify-content: center;
@@ -98,16 +108,16 @@
98
108
  background-color: #f4f5f7;
99
109
  cursor: pointer;
100
110
  }
101
- .cap-media-preview-nav-button.left {
111
+ .cap-media-preview-nav-button.cap-media-preview-nav-button-left {
102
112
  left: 1.714rem;
103
113
  }
104
- .cap-media-preview-nav-button.right {
114
+ .cap-media-preview-nav-button.cap-media-preview-nav-button-right {
105
115
  right: 1.714rem;
106
116
  }
107
- .cap-media-preview-nav-button.disabled {
117
+ .cap-media-preview-nav-button.cap-media-preview-nav-button-disabled {
108
118
  cursor: not-allowed;
109
119
  }
110
- .cap-media-preview-nav-button.disabled .cap-media-preview-nav-button-icon {
120
+ .cap-media-preview-nav-button.cap-media-preview-nav-button-disabled .cap-media-preview-nav-button-icon {
111
121
  color: #b3bac5;
112
122
  }
113
123
  .cap-media-preview-counter {
@@ -0,0 +1,24 @@
1
+ import './styles.css';const styles = {
2
+ "cap-media-preview-wrapper": "cap-media-preview-wrapper",
3
+ "cap-media-preview": "cap-media-preview",
4
+ "cap-media-preview-modal-content": "cap-media-preview-modal-content",
5
+ "cap-media-preview-body": "cap-media-preview-body",
6
+ "cap-media-preview-container": "cap-media-preview-container",
7
+ "cap-media-preview-header": "cap-media-preview-header",
8
+ "cap-media-preview-content": "cap-media-preview-content",
9
+ "cap-media-preview-media-container": "cap-media-preview-media-container",
10
+ "cap-media-preview-image": "cap-media-preview-image",
11
+ "cap-media-preview-video": "cap-media-preview-video",
12
+ "cap-media-preview-nav-button": "cap-media-preview-nav-button",
13
+ "cap-media-preview-nav-button-left": "cap-media-preview-nav-button-left",
14
+ "cap-media-preview-nav-button-right": "cap-media-preview-nav-button-right",
15
+ "cap-media-preview-nav-button-disabled": "cap-media-preview-nav-button-disabled",
16
+ "cap-media-preview-nav-button-icon": "cap-media-preview-nav-button-icon",
17
+ "cap-media-preview-counter": "cap-media-preview-counter",
18
+ "cap-media-preview-unsupported": "cap-media-preview-unsupported",
19
+ "cap-media-preview-unsupported-icon": "cap-media-preview-unsupported-icon",
20
+ "cap-media-preview-unsupported-label": "cap-media-preview-unsupported-label"
21
+ };
22
+ export {
23
+ styles as default
24
+ };
@@ -12,42 +12,51 @@ $flex-center: (
12
12
  #{$property}: $value;
13
13
  }
14
14
 
15
- .ant-modal {
15
+ :global(.ant-modal) {
16
16
  top: 0;
17
17
  padding-bottom: 0;
18
18
  }
19
19
  }
20
20
 
21
- .#{$media-preview} {
21
+ :global(.ant-modal).#{$media-preview},
22
+ :global(.ant-modal-wrap .ant-modal).#{$media-preview} {
22
23
  width: var(--modal-width) !important;
23
24
  height: var(--modal-height) !important;
24
25
  top: var(--top-navigation-height) !important;
25
- padding: 0;
26
- margin: 0;
27
-
28
- .ant-modal-content {
29
- height: calc(var(--modal-height) - var(--top-navigation-height));
30
- background-color: rgba(94, 94, 94, 0.4);
31
- backdrop-filter: blur($CAP_SPACE_12);
32
- border-radius: 0;
33
- display: flex;
34
- flex-direction: column;
35
- padding: 0;
36
- }
26
+ }
37
27
 
38
- .ant-modal-body {
39
- flex: 1;
40
- @each $property, $value in $flex-center {
41
- #{$property}: $value;
42
- }
43
- padding: 0;
44
- overflow: hidden;
28
+ .#{$media-preview}-modal-content {
29
+ height: calc(var(--modal-height) - var(--top-navigation-height)) !important;
30
+ background: rgba(94, 94, 94, 0.4) !important;
31
+ backdrop-filter: blur($CAP_SPACE_12) !important;
32
+ border-radius: 0 !important;
33
+ display: flex !important;
34
+ flex-direction: column !important;
35
+ padding: 0 !important;
36
+ box-shadow: none !important;
37
+ width: 100% !important;
38
+ margin: 0 !important;
39
+ border: none !important;
40
+ outline: none !important;
41
+ transform: none !important;
42
+ position: relative !important;
43
+ color: inherit !important;
44
+ }
45
+
46
+ .#{$media-preview}-body {
47
+ flex: 1 !important;
48
+ flex-direction: column !important;
49
+ @each $property, $value in $flex-center {
50
+ #{$property}: $value;
45
51
  }
52
+ padding: 0 !important;
53
+ overflow: hidden;
46
54
  }
47
55
 
48
56
  .#{$media-preview}-container {
49
57
  width: 100%;
50
- height: 100%;
58
+ flex: 1;
59
+ min-height: 0;
51
60
  display: flex;
52
61
  flex-direction: column;
53
62
  @each $property, $value in $flex-center {
@@ -73,7 +82,8 @@ $flex-center: (
73
82
  .#{$media-preview}-content {
74
83
  position: relative;
75
84
  width: 100%;
76
- height: 100%;
85
+ flex: 1;
86
+ min-height: 0;
77
87
  @each $property, $value in $flex-center {
78
88
  #{$property}: $value;
79
89
  }
@@ -100,7 +110,8 @@ $flex-center: (
100
110
  flex-shrink: 0;
101
111
  aspect-ratio: 964.62/540;
102
112
  object-fit: contain;
103
- box-shadow: 0 0 0.071rem rgba(9, 30, 66, 0.31),
113
+ box-shadow:
114
+ 0 0 0.071rem rgba(9, 30, 66, 0.31),
104
115
  0 0.286rem 0.571rem -0.143rem rgba(9, 30, 66, 0.25);
105
116
  }
106
117
 
@@ -115,15 +126,15 @@ $flex-center: (
115
126
  background-color: $CAP_G09;
116
127
  cursor: pointer;
117
128
 
118
- &.left {
129
+ &.#{$media-preview}-nav-button-left {
119
130
  left: $CAP_SPACE_24;
120
131
  }
121
132
 
122
- &.right {
133
+ &.#{$media-preview}-nav-button-right {
123
134
  right: $CAP_SPACE_24;
124
135
  }
125
136
 
126
- &.disabled {
137
+ &.#{$media-preview}-nav-button-disabled {
127
138
  cursor: not-allowed;
128
139
  .#{$media-preview}-nav-button-icon {
129
140
  color: $CAP_G06;
@@ -0,0 +1,48 @@
1
+ import type { ModalProps } from 'antd-v5';
2
+ import type { WrappedComponentProps } from 'react-intl';
3
+ export interface MediaItem {
4
+ type: string;
5
+ file: string | File;
6
+ name?: string;
7
+ imageProps?: Record<string, unknown>;
8
+ videoProps?: Record<string, unknown>;
9
+ }
10
+ export interface CapMediaPreviewProps extends Omit<ModalProps, 'open' | 'visible' | 'onVisibleChange' | 'onOpenChange'> {
11
+ /** Override className for Modal */
12
+ overrideClassName?: string;
13
+ /** Override className for Modal wrapper */
14
+ overrideWrapperClassName?: string;
15
+ /** Whether the media preview modal is visible */
16
+ isMediaPreviewVisible?: boolean;
17
+ /** Array of media items to display */
18
+ media?: MediaItem[];
19
+ /** Starting index for media carousel */
20
+ startIndex?: number;
21
+ /** Width of the modal */
22
+ width?: ModalProps['width'];
23
+ /** Height of the modal */
24
+ height?: string;
25
+ /** Top navigation height (used for CSS variable) */
26
+ topNavigationHeight?: string;
27
+ /** Callback when modal is closed */
28
+ onClose?: () => void;
29
+ /** Additional props to pass to Modal component */
30
+ modalProps?: Omit<ModalProps, 'open' | 'visible' | 'onVisibleChange' | 'onOpenChange'>;
31
+ }
32
+ export interface MediaRendererProps extends WrappedComponentProps {
33
+ /** Current media item to render */
34
+ currentMedia?: MediaItem;
35
+ }
36
+ export interface ImageRendererProps {
37
+ /** Image source URL */
38
+ src?: string | null;
39
+ /** Additional props to pass to CapImage */
40
+ imageProps?: Record<string, unknown>;
41
+ }
42
+ export interface VideoPlayerProps extends WrappedComponentProps {
43
+ /** Video source URL */
44
+ src?: string | null;
45
+ /** Additional props to pass to video element */
46
+ videoProps?: Record<string, unknown>;
47
+ }
48
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapMediaPreview/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,GAAG,cAAc,CAAC;IACjF,mCAAmC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,iDAAiD;IACjD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,sCAAsC;IACtC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,kDAAkD;IAClD,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,GAAG,cAAc,CAAC,CAAC;CACxF;AAED,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D,mCAAmC;IACnC,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,gBAAiB,SAAQ,qBAAqB;IAC7D,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC"}
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { DateRangeInputSelectorsProps, IntlShape } from './types';
3
+ declare const _default: React.ComponentType<Omit<DateRangeInputSelectorsProps & {
4
+ intl: IntlShape;
5
+ }, "intl">>;
6
+ export default _default;
7
+ //# sourceMappingURL=DateRangeInputSelectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateRangeInputSelectors.d.ts","sourceRoot":"","sources":["../../components/CapMobileDateRangePicker/DateRangeInputSelectors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,KAAK,EAAE,4BAA4B,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;;UAIQ,SAAS;;AAuDxF,wBAAmD"}
@@ -0,0 +1,68 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import classNames from "classnames";
3
+ import moment from "moment";
4
+ import { injectIntl } from "react-intl";
5
+ import { RANGE_PICKER } from "../utils/dayjs.js";
6
+ import CapColumn from "../CapColumn/index.js";
7
+ import InputFinal from "../CapInput/index.js";
8
+ import CapLabelWithStatic from "../CapLabel/index.js";
9
+ import CapRow from "../CapRow/index.js";
10
+ import messages from "./messages.js";
11
+ import styles from "./styles.module.scss.js";
12
+ import { clsPrefix } from "./index.js";
13
+ const DateRangeInputSelectors = ({
14
+ intl: { formatMessage },
15
+ focusedInput,
16
+ startDate,
17
+ endDate,
18
+ dateDisplayFormat,
19
+ handleStartDateClick,
20
+ handleEndDateClick,
21
+ showPlaceholders = false
22
+ }) => {
23
+ return /* @__PURE__ */ jsxs(CapRow, { className: styles[`${clsPrefix}-inputs`], children: [
24
+ /* @__PURE__ */ jsxs(CapColumn, { span: 10, children: [
25
+ showPlaceholders && /* @__PURE__ */ jsx(CapLabelWithStatic, { className: styles[`${clsPrefix}-inputs-label`], children: formatMessage(messages.startDate) }),
26
+ /* @__PURE__ */ jsx(
27
+ InputFinal,
28
+ {
29
+ className: classNames({
30
+ [styles[`${clsPrefix}-inputs-focused`]]: focusedInput === RANGE_PICKER.START_DATE
31
+ }),
32
+ value: moment(startDate).format(dateDisplayFormat),
33
+ size: "middle",
34
+ readOnly: true,
35
+ onClick: handleStartDateClick
36
+ }
37
+ )
38
+ ] }),
39
+ /* @__PURE__ */ jsx(
40
+ CapColumn,
41
+ {
42
+ className: classNames(styles[`${clsPrefix}-inputs-date-range-hyphen`], {
43
+ [styles[`${clsPrefix}-inputs-date-range-hyphen-vertical-align`]]: showPlaceholders
44
+ }),
45
+ children: "-"
46
+ }
47
+ ),
48
+ /* @__PURE__ */ jsxs(CapColumn, { span: 10, children: [
49
+ showPlaceholders && /* @__PURE__ */ jsx(CapLabelWithStatic, { className: styles[`${clsPrefix}-inputs-label`], children: formatMessage(messages.endDate) }),
50
+ /* @__PURE__ */ jsx(
51
+ InputFinal,
52
+ {
53
+ className: classNames({
54
+ [styles[`${clsPrefix}-inputs-focused`]]: focusedInput === RANGE_PICKER.END_DATE
55
+ }),
56
+ value: moment(endDate).format(dateDisplayFormat),
57
+ size: "middle",
58
+ readOnly: true,
59
+ onClick: handleEndDateClick
60
+ }
61
+ )
62
+ ] })
63
+ ] });
64
+ };
65
+ const DateRangeInputSelectors_default = injectIntl(DateRangeInputSelectors);
66
+ export {
67
+ DateRangeInputSelectors_default as default
68
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"ReactMobileDatePickerModule.d.ts","sourceRoot":"","sources":["../../components/CapMobileDateRangePicker/ReactMobileDatePickerModule.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,QAAA,MAAM,qBAAqB,KAAqC,CAAC;AACjE,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"ReactMobileDatePickerModule.d.ts","sourceRoot":"","sources":["../../components/CapMobileDateRangePicker/ReactMobileDatePickerModule.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,QAAA,MAAM,qBAAqB,KAA4C,CAAC;AACxE,eAAe,qBAAqB,CAAC"}