@mezzanine-ui/react 1.0.0-rc.0 → 1.0.0-rc.2

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 (64) hide show
  1. package/Badge/Badge.d.ts +4 -0
  2. package/Badge/Badge.js +2 -2
  3. package/Badge/typings.d.ts +13 -1
  4. package/Calendar/CalendarDays.js +4 -3
  5. package/Calendar/CalendarWeeks.js +4 -3
  6. package/Cascader/Cascader.d.ts +3 -0
  7. package/Cascader/Cascader.js +241 -0
  8. package/Cascader/CascaderPanel.d.ts +29 -0
  9. package/Cascader/CascaderPanel.js +29 -0
  10. package/Cascader/index.d.ts +5 -0
  11. package/Cascader/index.js +2 -0
  12. package/Cascader/typings.d.ts +92 -0
  13. package/Description/Description.d.ts +6 -1
  14. package/Description/Description.js +11 -4
  15. package/Description/DescriptionContent.d.ts +9 -3
  16. package/Description/DescriptionContent.js +4 -1
  17. package/Description/DescriptionContext.d.ts +6 -0
  18. package/Description/DescriptionContext.js +9 -0
  19. package/Description/index.d.ts +2 -0
  20. package/Description/index.js +1 -0
  21. package/Form/FormField.d.ts +6 -0
  22. package/Form/FormField.js +2 -2
  23. package/Form/FormHintText.d.ts +12 -0
  24. package/Form/FormHintText.js +3 -2
  25. package/Layout/Layout.d.ts +21 -5
  26. package/Layout/Layout.js +23 -19
  27. package/Layout/LayoutContext.d.ts +6 -6
  28. package/Layout/LayoutContext.js +2 -2
  29. package/Layout/LayoutHost.d.ts +0 -4
  30. package/Layout/LayoutHost.js +16 -13
  31. package/Layout/LayoutLeftPanel.d.ts +19 -0
  32. package/Layout/LayoutLeftPanel.js +86 -0
  33. package/Layout/LayoutMain.d.ts +10 -1
  34. package/Layout/LayoutMain.js +12 -3
  35. package/Layout/LayoutRightPanel.d.ts +19 -0
  36. package/Layout/{LayoutSidePanel.js → LayoutRightPanel.js} +32 -36
  37. package/Layout/index.d.ts +2 -2
  38. package/Layout/index.js +2 -1
  39. package/Modal/MediaPreviewModal.d.ts +4 -0
  40. package/Modal/MediaPreviewModal.js +2 -2
  41. package/Modal/Modal.d.ts +4 -0
  42. package/Modal/Modal.js +2 -2
  43. package/Modal/useModalContainer.js +0 -1
  44. package/Navigation/Navigation.d.ts +4 -0
  45. package/Navigation/Navigation.js +39 -3
  46. package/Navigation/NavigationFooter.js +19 -2
  47. package/Navigation/NavigationOption.d.ts +4 -0
  48. package/Navigation/NavigationOption.js +40 -19
  49. package/Navigation/NavigationOverflowMenuOption.js +11 -7
  50. package/Navigation/NavigationUserMenu.d.ts +1 -0
  51. package/Navigation/NavigationUserMenu.js +24 -5
  52. package/Navigation/context.d.ts +2 -0
  53. package/Navigation/context.js +4 -1
  54. package/Picker/RangePickerTrigger.js +1 -1
  55. package/Section/Section.js +6 -6
  56. package/Transition/Collapse.d.ts +2 -1
  57. package/Transition/Collapse.js +2 -1
  58. package/Upload/Upload.js +63 -9
  59. package/Upload/UploadPictureCard.d.ts +25 -15
  60. package/Upload/UploadPictureCard.js +14 -6
  61. package/index.d.ts +4 -2
  62. package/index.js +4 -1
  63. package/package.json +4 -4
  64. package/Layout/LayoutSidePanel.d.ts +0 -14
@@ -9,30 +9,35 @@ export interface UploadPictureCardAriaLabels {
9
9
  */
10
10
  cancelUpload?: string;
11
11
  /**
12
- * Aria label for uploading status.
13
- * @default 'Uploading'
12
+ * Aria label for the click-to-replace overlay label.
13
+ * @default 'Click to Replace'
14
14
  */
15
- uploading?: string;
15
+ clickToReplace?: string;
16
16
  /**
17
- * Aria label for zoom in button.
18
- * @default 'Zoom in image'
17
+ * Aria label for delete button.
18
+ * @default 'Delete file'
19
19
  */
20
- zoomIn?: string;
20
+ delete?: string;
21
21
  /**
22
22
  * Aria label for download button.
23
23
  * @default 'Download file'
24
24
  */
25
25
  download?: string;
26
- /**
27
- * Aria label for delete button.
28
- * @default 'Delete file'
29
- */
30
- delete?: string;
31
26
  /**
32
27
  * Aria label for reload/retry button.
33
28
  * @default 'Retry upload'
34
29
  */
35
30
  reload?: string;
31
+ /**
32
+ * Aria label for uploading status.
33
+ * @default 'Uploading'
34
+ */
35
+ uploading?: string;
36
+ /**
37
+ * Aria label for zoom in button.
38
+ * @default 'Zoom in image'
39
+ */
40
+ zoomIn?: string;
36
41
  }
37
42
  export interface UploadPictureCardProps extends NativeElementPropsWithoutKeyAndRef<'div'> {
38
43
  /**
@@ -90,10 +95,6 @@ export interface UploadPictureCardProps extends NativeElementPropsWithoutKeyAndR
90
95
  * When delete icon is clicked, this callback will be fired.
91
96
  */
92
97
  onDelete?: MouseEventHandler;
93
- /**
94
- * When zoom in icon is clicked, this callback will be fired.
95
- */
96
- onZoomIn?: MouseEventHandler;
97
98
  /**
98
99
  * When download icon is clicked, this callback will be fired.
99
100
  */
@@ -102,6 +103,15 @@ export interface UploadPictureCardProps extends NativeElementPropsWithoutKeyAndR
102
103
  * When reload icon is clicked, this callback will be fired.
103
104
  */
104
105
  onReload?: MouseEventHandler;
106
+ /**
107
+ * When provided, the card becomes a replacement trigger in done status.
108
+ * On hover, shows a "Click to Replace" overlay label. Fired when the card body is clicked.
109
+ */
110
+ onReplace?: MouseEventHandler;
111
+ /**
112
+ * When zoom in icon is clicked, this callback will be fired.
113
+ */
114
+ onZoomIn?: MouseEventHandler;
105
115
  }
106
116
  /**
107
117
  * The react component for `mezzanine` upload picture card.
@@ -15,14 +15,15 @@ import cx from 'clsx';
15
15
  */
16
16
  const UploadPictureCard = forwardRef(function UploadPictureCard(props, ref) {
17
17
  var _a;
18
- const { ariaLabels, className, file, url, status = 'loading', imageFit = 'cover', size = 'main', disabled = false, errorMessage, errorIcon, onDelete, onZoomIn, onDownload, onReload, ...rest } = props;
18
+ const { ariaLabels, className, file, url, status = 'loading', imageFit = 'cover', size = 'main', disabled = false, errorMessage, errorIcon, onDelete, onDownload, onReload, onReplace, onZoomIn, ...rest } = props;
19
19
  const defaultAriaLabels = {
20
20
  cancelUpload: 'Cancel upload',
21
- uploading: 'Uploading',
22
- zoomIn: 'Zoom in image',
23
- download: 'Download file',
21
+ clickToReplace: 'Click to Replace',
24
22
  delete: 'Delete file',
23
+ download: 'Download file',
25
24
  reload: 'Retry upload',
25
+ uploading: 'Uploading',
26
+ zoomIn: 'Zoom in image',
26
27
  };
27
28
  const labels = { ...defaultAriaLabels, ...ariaLabels };
28
29
  const isImage = useMemo(() => {
@@ -92,10 +93,17 @@ const UploadPictureCard = forwardRef(function UploadPictureCard(props, ref) {
92
93
  console.warn('UploadPictureCard: minor size is not supported for non-image files');
93
94
  return null;
94
95
  }
95
- return (jsx("div", { className: cx(uploadPictureCardClasses.host, uploadPictureCardClasses.size(size), disabled && uploadPictureCardClasses.disabled, className), "aria-disabled": disabled, ref: ref, role: "group", tabIndex: disabled ? -1 : 0, ...rest, children: jsxs("div", { className: uploadPictureCardClasses.container, children: [isImage && imageUrl && status !== 'error' && (jsx("img", { alt: fileName, src: imageUrl, style: {
96
+ return (jsx("div", { "aria-disabled": disabled, className: cx(uploadPictureCardClasses.host, uploadPictureCardClasses.size(size), disabled && uploadPictureCardClasses.disabled, onReplace && status === 'done' && uploadPictureCardClasses.replaceMode, className), onClick: onReplace && status === 'done' ? onReplace : undefined, onKeyDown: onReplace && status === 'done'
97
+ ? (e) => {
98
+ if (e.key === 'Enter' || e.key === ' ') {
99
+ e.preventDefault();
100
+ e.currentTarget.click();
101
+ }
102
+ }
103
+ : undefined, ref: ref, role: "group", tabIndex: disabled ? -1 : 0, ...rest, children: jsxs("div", { className: uploadPictureCardClasses.container, children: [isImage && imageUrl && status !== 'error' && (jsx("img", { alt: fileName, src: imageUrl, style: {
96
104
  objectFit: imageFit,
97
105
  objectPosition: 'center',
98
- } })), status === 'done' && size !== 'minor' && !isImage && (jsxs("div", { className: uploadPictureCardClasses.content, children: [jsx(Icon, { icon: FileIcon, color: "brand", size: 16 }), jsx(Typography, { className: uploadPictureCardClasses.name, ellipsis: true, children: fileName })] })), status === 'error' && size !== 'minor' && (jsxs("div", { className: uploadPictureCardClasses.errorMessage, role: "alert", "aria-live": "polite", children: [jsx(Icon, { icon: errorIconContent, color: "error", size: 16 }), jsx(Typography, { className: uploadPictureCardClasses.errorMessageText, children: errorMessageContent })] })), jsxs("div", { className: cx(uploadPictureCardClasses.actions, uploadPictureCardClasses.actionsStatus(status)), children: [status === 'loading' && size !== 'minor' && (jsxs(Fragment, { children: [jsx(ClearActions, { type: "embedded", variant: "contrast", onClick: onDelete, className: uploadPictureCardClasses.clearActionsIcon, "aria-label": labels.cancelUpload }), jsx("div", { className: uploadPictureCardClasses.loadingIcon, "aria-label": labels.uploading, children: jsx(Icon, { icon: SpinnerIcon, color: "fixed-light", spin: true, size: 32 }) })] })), status === 'done' && size !== 'minor' && (jsx(Fragment, { children: jsx("div", { className: uploadPictureCardClasses.tools, children: jsxs("div", { className: uploadPictureCardClasses.toolsContent, children: [jsx(Button, { variant: "base-secondary", size: "minor", icon: ZoomInIcon, iconType: "icon-only", onClick: onZoomIn, "aria-label": labels.zoomIn }), jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: DownloadIcon, onClick: onDownload, "aria-label": labels.download }), jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: TrashIcon, onClick: onDelete, "aria-label": labels.delete })] }) }) })), status === 'error' && size !== 'minor' && (jsx(Fragment, { children: jsx("div", { className: uploadPictureCardClasses.tools, children: jsxs("div", { className: uploadPictureCardClasses.toolsContent, children: [jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: ResetIcon, onClick: onReload, "aria-label": labels.reload }), jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: TrashIcon, onClick: onDelete, "aria-label": labels.delete })] }) }) })), size === 'minor' && (jsx(Icon, { icon: ZoomInIcon, color: "fixed-light", size: 24 }))] })] }) }));
106
+ } })), status === 'done' && size !== 'minor' && !isImage && (jsxs("div", { className: uploadPictureCardClasses.content, children: [jsx(Icon, { icon: FileIcon, color: "brand", size: 16 }), jsx(Typography, { className: uploadPictureCardClasses.name, ellipsis: true, children: fileName })] })), status === 'error' && size !== 'minor' && (jsxs("div", { className: uploadPictureCardClasses.errorMessage, role: "alert", "aria-live": "polite", children: [jsx(Icon, { icon: errorIconContent, color: "error", size: 16 }), jsx(Typography, { className: uploadPictureCardClasses.errorMessageText, children: errorMessageContent })] })), jsxs("div", { className: cx(uploadPictureCardClasses.actions, uploadPictureCardClasses.actionsStatus(status)), children: [status === 'loading' && size !== 'minor' && (jsxs(Fragment, { children: [jsx(ClearActions, { type: "embedded", variant: "contrast", onClick: onDelete, className: uploadPictureCardClasses.clearActionsIcon, "aria-label": labels.cancelUpload }), jsx("div", { className: uploadPictureCardClasses.loadingIcon, "aria-label": labels.uploading, children: jsx(Icon, { icon: SpinnerIcon, color: "fixed-light", spin: true, size: 32 }) })] })), status === 'done' && size !== 'minor' && (jsxs(Fragment, { children: [jsx("div", { className: uploadPictureCardClasses.tools, children: jsxs("div", { className: uploadPictureCardClasses.toolsContent, children: [onZoomIn && (jsx(Button, { variant: "base-secondary", size: "minor", icon: ZoomInIcon, iconType: "icon-only", onClick: onZoomIn, "aria-label": labels.zoomIn })), onDownload && (jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: DownloadIcon, onClick: onDownload, "aria-label": labels.download })), jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: TrashIcon, onClick: onDelete, "aria-label": labels.delete })] }) }), onReplace && (jsx("span", { className: uploadPictureCardClasses.replaceLabel, children: labels.clickToReplace }))] })), status === 'error' && size !== 'minor' && (jsx(Fragment, { children: jsx("div", { className: uploadPictureCardClasses.tools, children: jsxs("div", { className: uploadPictureCardClasses.toolsContent, children: [jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: ResetIcon, onClick: onReload, "aria-label": labels.reload }), jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: TrashIcon, onClick: onDelete, "aria-label": labels.delete })] }) }) })), size === 'minor' && (jsx(Icon, { icon: ZoomInIcon, color: "fixed-light", size: 24 }))] })] }) }));
99
107
  });
100
108
 
101
109
  export { UploadPictureCard as default };
package/index.d.ts CHANGED
@@ -42,8 +42,8 @@ export { default as Cropper } from './Cropper';
42
42
  export type { CropperComponent, CropperProps, CropperPropsBase, CropperSize, } from './Cropper';
43
43
  export { default as Icon } from './Icon';
44
44
  export type { IconColor, IconProps } from './Icon';
45
- export { default as Layout, LayoutMain, LayoutSidePanel } from './Layout';
46
- export type { LayoutMainProps, LayoutProps, LayoutSidePanelProps } from './Layout';
45
+ export { default as Layout, LayoutLeftPanel, LayoutMain, LayoutRightPanel, } from './Layout';
46
+ export type { LayoutLeftPanelProps, LayoutMainProps, LayoutProps, LayoutRightPanelProps, } from './Layout';
47
47
  export { default as Separator } from './Separator';
48
48
  export type { SeparatorProps } from './Separator';
49
49
  export { default as Typography } from './Typography';
@@ -116,6 +116,8 @@ export { PickerTrigger, RangePickerTrigger, usePickerDocumentEventClose, usePick
116
116
  export type { PickerTriggerProps, RangePickerTriggerProps, UsePickerDocumentEventCloseProps, UsePickerValueProps, } from './Picker';
117
117
  export { default as Radio, RadioGroup } from './Radio';
118
118
  export type { RadioGroupOrientation, RadioGroupProps, RadioProps, RadioSize, } from './Radio';
119
+ export { default as Cascader, CascaderPanel } from './Cascader';
120
+ export type { CascaderOption, CascaderPanelProps, CascaderProps, CascaderSize, } from './Cascader';
119
121
  export { default as Select, SelectControlContext, SelectTrigger, SelectTriggerTags, } from './Select';
120
122
  export type { SelectControl, SelectProps, SelectTriggerInputProps, SelectTriggerProps, SelectTriggerTagsProps, SelectValue, } from './Select';
121
123
  export { default as Selection } from './Selection';
package/index.js CHANGED
@@ -104,6 +104,8 @@ export { default as PickerTrigger } from './Picker/PickerTrigger.js';
104
104
  export { default as RangePickerTrigger } from './Picker/RangePickerTrigger.js';
105
105
  export { default as Radio } from './Radio/Radio.js';
106
106
  export { default as RadioGroup } from './Radio/RadioGroup.js';
107
+ export { default as Cascader } from './Cascader/Cascader.js';
108
+ export { default as CascaderPanel } from './Cascader/CascaderPanel.js';
107
109
  export { default as Select } from './Select/Select.js';
108
110
  export { default as SelectTrigger } from './Select/SelectTrigger.js';
109
111
  export { default as SelectTriggerTags } from './Select/SelectTriggerTags.js';
@@ -161,8 +163,9 @@ export { default as Slide } from './Transition/Slide.js';
161
163
  export { default as Transition } from './Transition/Transition.js';
162
164
  export { default as Translate } from './Transition/Translate.js';
163
165
  export { default as Dropdown } from './Dropdown/Dropdown.js';
166
+ export { LayoutLeftPanel } from './Layout/LayoutLeftPanel.js';
164
167
  export { LayoutMain } from './Layout/LayoutMain.js';
165
- export { LayoutSidePanel } from './Layout/LayoutSidePanel.js';
168
+ export { LayoutRightPanel } from './Layout/LayoutRightPanel.js';
166
169
  export { useStepper } from './Stepper/useStepper.js';
167
170
  export { usePagination } from './Pagination/usePagination.js';
168
171
  export { TableContext, TableDataContext, TableSuperContext, useTableContext, useTableDataContext, useTableSuperContext } from './Table/TableContext.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mezzanine-ui/react",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0-rc.2",
4
4
  "description": "React components for mezzanine-ui",
5
5
  "author": "Mezzanine",
6
6
  "repository": {
@@ -31,9 +31,9 @@
31
31
  "@floating-ui/dom": "^1.7.4",
32
32
  "@floating-ui/react-dom": "^2.1.6",
33
33
  "@hello-pangea/dnd": "^18.0.1",
34
- "@mezzanine-ui/core": "1.0.0-rc.0",
35
- "@mezzanine-ui/icons": "1.0.0-rc.0",
36
- "@mezzanine-ui/system": "1.0.0-rc.0",
34
+ "@mezzanine-ui/core": "1.0.0-rc.2",
35
+ "@mezzanine-ui/icons": "1.0.0-rc.2",
36
+ "@mezzanine-ui/system": "1.0.0-rc.2",
37
37
  "@tanstack/react-virtual": "^3.13.13",
38
38
  "@types/react-transition-group": "^4.4.12",
39
39
  "clsx": "^2.1.1",
@@ -1,14 +0,0 @@
1
- export interface LayoutSidePanelProps {
2
- /** The content rendered inside the side panel. */
3
- children?: React.ReactNode;
4
- /** Initial width (in px) of the side panel. Clamped to a minimum of 240px. */
5
- defaultSidePanelWidth?: number;
6
- /** Callback fired when the side panel width changes during resize. */
7
- onSidePanelWidthChange?: (width: number) => void;
8
- /** Controls whether the side panel and divider are visible. */
9
- open?: boolean;
10
- }
11
- export declare function LayoutSidePanel({ children, defaultSidePanelWidth, onSidePanelWidthChange, open, }: LayoutSidePanelProps): import("react/jsx-runtime").JSX.Element | null;
12
- export declare namespace LayoutSidePanel {
13
- var displayName: string;
14
- }