@mezzanine-ui/react 1.0.0-beta.5 → 1.0.0-beta.7

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 (199) hide show
  1. package/Accordion/Accordion.d.ts +23 -1
  2. package/Accordion/Accordion.js +59 -11
  3. package/Accordion/AccordionActions.d.ts +13 -0
  4. package/Accordion/AccordionActions.js +24 -0
  5. package/Accordion/AccordionContent.d.ts +9 -0
  6. package/Accordion/{AccordionDetails.js → AccordionContent.js} +4 -6
  7. package/Accordion/AccordionControlContext.d.ts +2 -2
  8. package/Accordion/AccordionGroup.d.ts +10 -0
  9. package/Accordion/AccordionGroup.js +26 -0
  10. package/Accordion/AccordionTitle.d.ts +14 -0
  11. package/Accordion/AccordionTitle.js +56 -0
  12. package/Accordion/index.d.ts +8 -4
  13. package/Accordion/index.js +4 -2
  14. package/AutoComplete/AutoComplete.d.ts +25 -6
  15. package/AutoComplete/AutoComplete.js +119 -30
  16. package/Backdrop/Backdrop.js +15 -19
  17. package/Breadcrumb/BreadcrumbDropdown.js +1 -1
  18. package/Breadcrumb/BreadcrumbItem.js +1 -1
  19. package/Breadcrumb/BreadcrumbOverflowMenuItem.js +1 -1
  20. package/Calendar/CalendarDays.js +1 -1
  21. package/Card/BaseCard.d.ts +11 -0
  22. package/Card/BaseCard.js +48 -0
  23. package/Card/BaseCardSkeleton.d.ts +14 -0
  24. package/Card/BaseCardSkeleton.js +18 -0
  25. package/Card/CardGroup.d.ts +47 -0
  26. package/Card/CardGroup.js +147 -0
  27. package/Card/FourThumbnailCard.d.ts +14 -0
  28. package/Card/FourThumbnailCard.js +73 -0
  29. package/Card/FourThumbnailCardSkeleton.d.ts +14 -0
  30. package/Card/FourThumbnailCardSkeleton.js +20 -0
  31. package/Card/QuickActionCard.d.ts +12 -0
  32. package/Card/QuickActionCard.js +23 -0
  33. package/Card/QuickActionCardSkeleton.d.ts +14 -0
  34. package/Card/QuickActionCardSkeleton.js +18 -0
  35. package/Card/SingleThumbnailCard.d.ts +13 -0
  36. package/Card/SingleThumbnailCard.js +44 -0
  37. package/Card/SingleThumbnailCardSkeleton.d.ts +19 -0
  38. package/Card/SingleThumbnailCardSkeleton.js +18 -0
  39. package/Card/Thumbnail.d.ts +12 -0
  40. package/Card/Thumbnail.js +18 -0
  41. package/Card/ThumbnailCardInfo.d.ts +34 -0
  42. package/Card/ThumbnailCardInfo.js +43 -0
  43. package/Card/index.d.ts +43 -4
  44. package/Card/index.js +19 -2
  45. package/Card/typings.d.ts +442 -0
  46. package/Checkbox/Checkbox.d.ts +8 -0
  47. package/Checkbox/Checkbox.js +3 -2
  48. package/Checkbox/CheckboxGroup.js +1 -1
  49. package/ContentHeader/ContentHeader.d.ts +22 -70
  50. package/ContentHeader/ContentHeader.js +1 -1
  51. package/ContentHeader/ContentHeaderResponsive.d.ts +9 -0
  52. package/ContentHeader/ContentHeaderResponsive.js +7 -0
  53. package/ContentHeader/utils.d.ts +3 -3
  54. package/ContentHeader/utils.js +66 -20
  55. package/Cropper/Cropper.d.ts +66 -0
  56. package/Cropper/Cropper.js +115 -0
  57. package/Cropper/CropperElement.d.ts +10 -0
  58. package/Cropper/CropperElement.js +892 -0
  59. package/Cropper/index.d.ts +18 -0
  60. package/Cropper/index.js +8 -0
  61. package/Cropper/tools.d.ts +90 -0
  62. package/Cropper/tools.js +143 -0
  63. package/Cropper/typings.d.ts +69 -0
  64. package/Cropper/utils/cropper-calculations.d.ts +39 -0
  65. package/Cropper/utils/cropper-calculations.js +95 -0
  66. package/DateTimePicker/DateTimePicker.d.ts +1 -1
  67. package/DateTimePicker/DateTimePicker.js +22 -5
  68. package/DateTimeRangePicker/DateTimeRangePicker.d.ts +34 -0
  69. package/DateTimeRangePicker/DateTimeRangePicker.js +118 -0
  70. package/DateTimeRangePicker/index.d.ts +2 -0
  71. package/DateTimeRangePicker/index.js +1 -0
  72. package/Drawer/Drawer.d.ts +132 -1
  73. package/Drawer/Drawer.js +47 -3
  74. package/Dropdown/Dropdown.d.ts +10 -4
  75. package/Dropdown/Dropdown.js +37 -42
  76. package/Dropdown/DropdownItem.d.ts +7 -1
  77. package/Dropdown/DropdownItem.js +36 -6
  78. package/Dropdown/DropdownItemCard.js +2 -1
  79. package/FloatingButton/FloatingButton.d.ts +21 -0
  80. package/FloatingButton/FloatingButton.js +18 -0
  81. package/FloatingButton/index.d.ts +2 -0
  82. package/FloatingButton/index.js +1 -0
  83. package/Form/FormField.d.ts +30 -7
  84. package/Form/FormField.js +12 -4
  85. package/Input/Input.js +12 -21
  86. package/Input/SelectButton/SelectButton.d.ts +25 -4
  87. package/Input/SelectButton/SelectButton.js +21 -9
  88. package/Message/Message.js +1 -1
  89. package/Modal/MediaPreviewModal.d.ts +11 -0
  90. package/Modal/MediaPreviewModal.js +24 -7
  91. package/Modal/Modal.d.ts +1 -1
  92. package/Modal/Modal.js +1 -1
  93. package/Modal/useModalContainer.js +6 -2
  94. package/MultipleDatePicker/MultipleDatePicker.d.ts +62 -0
  95. package/MultipleDatePicker/MultipleDatePicker.js +176 -0
  96. package/MultipleDatePicker/MultipleDatePickerTrigger.d.ts +56 -0
  97. package/MultipleDatePicker/MultipleDatePickerTrigger.js +92 -0
  98. package/MultipleDatePicker/index.d.ts +6 -0
  99. package/MultipleDatePicker/index.js +3 -0
  100. package/MultipleDatePicker/useMultipleDatePickerValue.d.ts +55 -0
  101. package/MultipleDatePicker/useMultipleDatePickerValue.js +68 -0
  102. package/Navigation/NavigationHeader.js +1 -1
  103. package/NotificationCenter/NotificationCenterDrawer.d.ts +10 -52
  104. package/NotificationCenter/NotificationCenterDrawer.js +128 -0
  105. package/NotificationCenter/index.d.ts +2 -0
  106. package/NotificationCenter/index.js +1 -0
  107. package/OverflowTooltip/index.d.ts +2 -2
  108. package/Picker/FormattedInput.d.ts +1 -1
  109. package/Picker/FormattedInput.js +2 -1
  110. package/Picker/PickerTriggerWithSeparator.d.ts +10 -0
  111. package/Picker/PickerTriggerWithSeparator.js +2 -2
  112. package/Picker/RangePickerTrigger.js +1 -1
  113. package/Picker/useDateInputFormatter.d.ts +6 -0
  114. package/Picker/useDateInputFormatter.js +4 -1
  115. package/Section/Section.d.ts +32 -0
  116. package/Section/Section.js +62 -0
  117. package/Section/index.d.ts +2 -0
  118. package/Select/Select.d.ts +11 -12
  119. package/Select/Select.js +13 -34
  120. package/Select/SelectTrigger.js +21 -7
  121. package/Select/index.d.ts +0 -4
  122. package/Select/index.js +0 -2
  123. package/Select/typings.d.ts +0 -4
  124. package/Select/useSelectTriggerTags.d.ts +1 -1
  125. package/Select/useSelectTriggerTags.js +9 -6
  126. package/Separator/Separator.d.ts +14 -0
  127. package/Separator/Separator.js +17 -0
  128. package/Separator/index.d.ts +2 -0
  129. package/Separator/index.js +1 -0
  130. package/Table/utils/useTableRowSelection.js +6 -0
  131. package/Tag/TagGroup.d.ts +4 -2
  132. package/Tag/TagGroup.js +7 -4
  133. package/TextField/TextField.d.ts +1 -1
  134. package/TextField/TextField.js +63 -9
  135. package/TimePanel/TimePanelColumn.js +30 -21
  136. package/TimeRangePicker/TimeRangePicker.d.ts +29 -0
  137. package/TimeRangePicker/TimeRangePicker.js +96 -0
  138. package/TimeRangePicker/index.d.ts +3 -0
  139. package/TimeRangePicker/index.js +2 -0
  140. package/TimeRangePicker/useTimeRangePickerValue.d.ts +30 -0
  141. package/TimeRangePicker/useTimeRangePickerValue.js +92 -0
  142. package/Transition/Rotate.js +2 -5
  143. package/index.d.ts +30 -28
  144. package/index.js +26 -27
  145. package/package.json +4 -4
  146. package/Accordion/AccordionDetails.d.ts +0 -9
  147. package/Accordion/AccordionSummary.d.ts +0 -18
  148. package/Accordion/AccordionSummary.js +0 -51
  149. package/Alert/Alert.d.ts +0 -20
  150. package/Alert/Alert.js +0 -18
  151. package/Alert/index.d.ts +0 -3
  152. package/Alert/index.js +0 -1
  153. package/AppBar/AppBar.d.ts +0 -14
  154. package/AppBar/AppBar.js +0 -33
  155. package/AppBar/AppBarBrand.d.ts +0 -4
  156. package/AppBar/AppBarBrand.js +0 -11
  157. package/AppBar/AppBarMain.d.ts +0 -4
  158. package/AppBar/AppBarMain.js +0 -11
  159. package/AppBar/AppBarSupport.d.ts +0 -4
  160. package/AppBar/AppBarSupport.js +0 -11
  161. package/AppBar/index.d.ts +0 -8
  162. package/AppBar/index.js +0 -4
  163. package/Card/Card.d.ts +0 -51
  164. package/Card/Card.js +0 -20
  165. package/Card/CardActions.d.ts +0 -34
  166. package/Card/CardActions.js +0 -15
  167. package/ConfirmActions/ConfirmActions.d.ts +0 -46
  168. package/ConfirmActions/ConfirmActions.js +0 -15
  169. package/ConfirmActions/index.d.ts +0 -2
  170. package/ConfirmActions/index.js +0 -1
  171. package/Popconfirm/Popconfirm.d.ts +0 -16
  172. package/Popconfirm/Popconfirm.js +0 -15
  173. package/Popconfirm/index.d.ts +0 -2
  174. package/Popconfirm/index.js +0 -1
  175. package/Popover/Popover.d.ts +0 -23
  176. package/Popover/Popover.js +0 -35
  177. package/Popover/index.d.ts +0 -2
  178. package/Popover/index.js +0 -1
  179. package/Select/Option.d.ts +0 -18
  180. package/Select/Option.js +0 -45
  181. package/Select/TreeSelect.d.ts +0 -67
  182. package/Select/TreeSelect.js +0 -198
  183. package/Tree/Tree.d.ts +0 -70
  184. package/Tree/Tree.js +0 -139
  185. package/Tree/TreeNode.d.ts +0 -40
  186. package/Tree/TreeNode.js +0 -50
  187. package/Tree/TreeNodeList.d.ts +0 -24
  188. package/Tree/TreeNodeList.js +0 -28
  189. package/Tree/getTreeNodeEntities.d.ts +0 -11
  190. package/Tree/getTreeNodeEntities.js +0 -92
  191. package/Tree/index.d.ts +0 -13
  192. package/Tree/index.js +0 -7
  193. package/Tree/toggleValue.d.ts +0 -4
  194. package/Tree/toggleValue.js +0 -19
  195. package/Tree/traverseTree.d.ts +0 -2
  196. package/Tree/traverseTree.js +0 -11
  197. package/Tree/typings.d.ts +0 -16
  198. package/Tree/useTreeExpandedValue.d.ts +0 -14
  199. package/Tree/useTreeExpandedValue.js +0 -33
@@ -0,0 +1,147 @@
1
+ 'use client';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { cardClasses } from '@mezzanine-ui/core/card';
4
+ import { forwardRef, Children, isValidElement } from 'react';
5
+ import BaseCard from './BaseCard.js';
6
+ import BaseCardSkeleton from './BaseCardSkeleton.js';
7
+ import FourThumbnailCard from './FourThumbnailCard.js';
8
+ import FourThumbnailCardSkeleton from './FourThumbnailCardSkeleton.js';
9
+ import QuickActionCard from './QuickActionCard.js';
10
+ import QuickActionCardSkeleton from './QuickActionCardSkeleton.js';
11
+ import SingleThumbnailCard from './SingleThumbnailCard.js';
12
+ import SingleThumbnailCardSkeleton from './SingleThumbnailCardSkeleton.js';
13
+ import cx from 'clsx';
14
+
15
+ // List of allowed child component types
16
+ const ALLOWED_CARD_TYPES = [
17
+ BaseCard,
18
+ FourThumbnailCard,
19
+ QuickActionCard,
20
+ SingleThumbnailCard,
21
+ ];
22
+ /**
23
+ * Get display name of a component for error messages
24
+ */
25
+ function getComponentDisplayName(child) {
26
+ const { type } = child;
27
+ if (typeof type === 'string') {
28
+ return type;
29
+ }
30
+ return (type.displayName ||
31
+ type.name ||
32
+ 'Unknown');
33
+ }
34
+ /**
35
+ * Detect the first valid card type from children
36
+ */
37
+ function getFirstCardType(children) {
38
+ let firstType = null;
39
+ Children.forEach(children, (child) => {
40
+ if (firstType !== null)
41
+ return;
42
+ if (!isValidElement(child))
43
+ return;
44
+ if (child.type === QuickActionCard) {
45
+ firstType = QuickActionCard;
46
+ }
47
+ else if (child.type === BaseCard) {
48
+ firstType = BaseCard;
49
+ }
50
+ else if (child.type === SingleThumbnailCard) {
51
+ firstType = SingleThumbnailCard;
52
+ }
53
+ else if (child.type === FourThumbnailCard) {
54
+ firstType = FourThumbnailCard;
55
+ }
56
+ });
57
+ return firstType;
58
+ }
59
+ /**
60
+ * Get the skeleton component based on loading type
61
+ */
62
+ function getSkeletonComponent(loadingType) {
63
+ switch (loadingType) {
64
+ case 'base':
65
+ return BaseCardSkeleton;
66
+ case 'four-thumbnail':
67
+ return FourThumbnailCardSkeleton;
68
+ case 'quick-action':
69
+ return QuickActionCardSkeleton;
70
+ case 'single-thumbnail':
71
+ return SingleThumbnailCardSkeleton;
72
+ default:
73
+ return BaseCardSkeleton;
74
+ }
75
+ }
76
+ /**
77
+ * Get the group class modifier based on loading type
78
+ */
79
+ function getGroupClassFromLoadingType(loadingType) {
80
+ switch (loadingType) {
81
+ case 'four-thumbnail':
82
+ return cardClasses.groupFourThumbnail;
83
+ case 'quick-action':
84
+ return cardClasses.groupQuickAction;
85
+ case 'single-thumbnail':
86
+ return cardClasses.groupSingleThumbnail;
87
+ default:
88
+ return undefined;
89
+ }
90
+ }
91
+ /**
92
+ * CardGroup is a container for card components.
93
+ * It uses CSS Grid to layout cards in a horizontal row with consistent spacing.
94
+ */
95
+ const CardGroup = forwardRef(function CardGroup(props, ref) {
96
+ const { className, children, loading = false, loadingCount = 3, loadingThumbnailAspectRatio, loadingThumbnailWidth, loadingType, } = props;
97
+ // Detect first card type to determine min-width class
98
+ const firstCardType = getFirstCardType(children);
99
+ // Validate children at runtime
100
+ const validChildren = Children.map(children, (child) => {
101
+ if (!isValidElement(child)) {
102
+ return child;
103
+ }
104
+ const isAllowedType = ALLOWED_CARD_TYPES.some((allowedType) => child.type === allowedType);
105
+ if (!isAllowedType) {
106
+ const displayName = getComponentDisplayName(child);
107
+ console.warn(`[CardGroup] Invalid child type: <${displayName}>. ` +
108
+ 'CardGroup only accepts Card components (BaseCard, FourThumbnailCard, QuickActionCard, SingleThumbnailCard) as children.');
109
+ return null;
110
+ }
111
+ return child;
112
+ });
113
+ // Render loading skeletons
114
+ const renderSkeletons = () => {
115
+ if (!loading || !loadingType) {
116
+ return null;
117
+ }
118
+ const SkeletonComponent = getSkeletonComponent(loadingType);
119
+ // Build props for thumbnail skeletons
120
+ const thumbnailSkeletonProps = loadingType === 'single-thumbnail' || loadingType === 'four-thumbnail'
121
+ ? {
122
+ ...(loadingThumbnailAspectRatio && {
123
+ thumbnailAspectRatio: loadingThumbnailAspectRatio,
124
+ }),
125
+ ...(loadingThumbnailWidth && {
126
+ thumbnailWidth: loadingThumbnailWidth,
127
+ }),
128
+ }
129
+ : undefined;
130
+ return Array.from({ length: loadingCount }, (_, index) => (jsx(SkeletonComponent, { ...thumbnailSkeletonProps }, `skeleton-${index}`)));
131
+ };
132
+ // Determine group class modifier
133
+ const groupClassModifier = loadingType && loading
134
+ ? getGroupClassFromLoadingType(loadingType)
135
+ : undefined;
136
+ return (jsxs("div", { ref: ref, className: cx(cardClasses.group, {
137
+ [cardClasses.groupFourThumbnail]: firstCardType === FourThumbnailCard ||
138
+ groupClassModifier === cardClasses.groupFourThumbnail,
139
+ [cardClasses.groupQuickAction]: firstCardType === QuickActionCard ||
140
+ groupClassModifier === cardClasses.groupQuickAction,
141
+ [cardClasses.groupSingleThumbnail]: firstCardType === SingleThumbnailCard ||
142
+ groupClassModifier === cardClasses.groupSingleThumbnail,
143
+ }, className), children: [validChildren, renderSkeletons()] }));
144
+ });
145
+ CardGroup.displayName = 'CardGroup';
146
+
147
+ export { CardGroup as default };
@@ -0,0 +1,14 @@
1
+ import { ComponentOverridableForwardRefComponentPropsFactory } from '../utils/jsx-types';
2
+ import { FourThumbnailCardComponent, FourThumbnailCardProps } from './typings';
3
+ export type FourThumbnailCardComponentProps<C extends FourThumbnailCardComponent = 'div'> = ComponentOverridableForwardRefComponentPropsFactory<FourThumbnailCardComponent, C, FourThumbnailCardProps>;
4
+ /**
5
+ * FourThumbnailCard displays a 2x2 grid of image thumbnails with optional tag, personal action,
6
+ * and info section. Supports three action types: default, action, and overflow.
7
+ *
8
+ * Children must be Thumbnail components. If less than 4 are provided, empty slots will be rendered.
9
+ * If more than 4 are provided, only the first 4 will be used (with a console warning in development).
10
+ */
11
+ declare const FourThumbnailCard: import("react").ForwardRefExoticComponent<Omit<Omit<import("../utils/jsx-types").ComponentPropsWithoutKeyAndRef<"div">, "children" | "title" | "className" | "type" | "options" | "actionName" | "onActionClick" | "onOptionSelect" | "filetype" | "subtitle" | "personalActionIcon" | "personalActionActiveIcon" | "personalActionActive" | "personalActionOnClick" | "tag"> & FourThumbnailCardProps, "component"> & {
12
+ component?: FourThumbnailCardComponent | undefined;
13
+ } & import("react").RefAttributes<HTMLDivElement>>;
14
+ export default FourThumbnailCard;
@@ -0,0 +1,73 @@
1
+ 'use client';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { forwardRef, Children, isValidElement } from 'react';
4
+ import { cardClasses } from '@mezzanine-ui/core/card';
5
+ import Thumbnail from './Thumbnail.js';
6
+ import ThumbnailCardInfo from './ThumbnailCardInfo.js';
7
+ import Icon from '../Icon/Icon.js';
8
+ import cx from 'clsx';
9
+
10
+ const MAX_THUMBNAILS = 4;
11
+ /**
12
+ * FourThumbnailCard displays a 2x2 grid of image thumbnails with optional tag, personal action,
13
+ * and info section. Supports three action types: default, action, and overflow.
14
+ *
15
+ * Children must be Thumbnail components. If less than 4 are provided, empty slots will be rendered.
16
+ * If more than 4 are provided, only the first 4 will be used (with a console warning in development).
17
+ */
18
+ const FourThumbnailCard = forwardRef(function FourThumbnailCard(props, ref) {
19
+ const { children, className, component: Component = 'div', filetype, personalActionActive = false, personalActionActiveIcon, personalActionIcon, personalActionOnClick, subtitle, tag, title, type = 'default', ...rest } = props;
20
+ // Process children: filter valid Thumbnail elements and limit to MAX_THUMBNAILS
21
+ const childArray = Children.toArray(children).filter((child) => {
22
+ if (!isValidElement(child))
23
+ return false;
24
+ // Check if the child is a Thumbnail component
25
+ const isThumbnail = child.type === Thumbnail;
26
+ if (!isThumbnail && process.env.NODE_ENV !== 'production') {
27
+ const displayName = typeof child.type === 'string'
28
+ ? child.type
29
+ : child.type.displayName ||
30
+ child.type.name ||
31
+ 'Unknown';
32
+ console.warn(`[FourThumbnailCard] Invalid child type: <${displayName}>. ` +
33
+ 'FourThumbnailCard only accepts Thumbnail components as children.');
34
+ }
35
+ return isThumbnail;
36
+ });
37
+ // Warn if more than MAX_THUMBNAILS children are provided
38
+ if (childArray.length > MAX_THUMBNAILS &&
39
+ process.env.NODE_ENV !== 'production') {
40
+ console.warn(`[FourThumbnailCard] Received ${childArray.length} Thumbnail children, ` +
41
+ `but only the first ${MAX_THUMBNAILS} will be rendered.`);
42
+ }
43
+ // Take only the first MAX_THUMBNAILS
44
+ const thumbnails = childArray.slice(0, MAX_THUMBNAILS);
45
+ // Fill remaining slots with empty placeholders
46
+ const emptySlots = MAX_THUMBNAILS - thumbnails.length;
47
+ const emptyPlaceholders = Array.from({ length: emptySlots }, (_, index) => (jsx("div", { className: cx(cardClasses.fourThumbnailThumbnail, cardClasses.fourThumbnailThumbnailEmpty) }, `empty-${index}`)));
48
+ const hasPersonalAction = Boolean(personalActionIcon);
49
+ const currentPersonalActionIcon = personalActionActive
50
+ ? (personalActionActiveIcon !== null && personalActionActiveIcon !== void 0 ? personalActionActiveIcon : personalActionIcon)
51
+ : personalActionIcon;
52
+ const handlePersonalActionClick = (event) => {
53
+ event.stopPropagation();
54
+ personalActionOnClick === null || personalActionOnClick === void 0 ? void 0 : personalActionOnClick(event, personalActionActive);
55
+ };
56
+ const getInfoProps = () => {
57
+ if (type === 'action') {
58
+ const { actionName, onActionClick } = props;
59
+ return { actionName, onActionClick };
60
+ }
61
+ if (type === 'overflow') {
62
+ const { onOptionSelect, options } = props;
63
+ return { onOptionSelect, options };
64
+ }
65
+ return {};
66
+ };
67
+ // Filter out type-specific props before spreading
68
+ const { actionName: _actionName, onActionClick: _onActionClick, onOptionSelect: _onOptionSelect, options: _options, type: _type, ...componentProps } = rest;
69
+ return (jsxs(Component, { ...componentProps, ref: ref, className: cx(cardClasses.thumbnail, className), children: [jsxs("div", { className: cardClasses.fourThumbnail, children: [tag && jsx("div", { className: cardClasses.thumbnailTag, children: tag }), hasPersonalAction && currentPersonalActionIcon && (jsx("button", { "aria-label": "Personal Action", className: cardClasses.thumbnailPersonalAction, onClick: handlePersonalActionClick, type: "button", children: jsx(Icon, { icon: currentPersonalActionIcon, size: 24 }) })), thumbnails, emptyPlaceholders] }), jsx(ThumbnailCardInfo, { filetype: filetype, subtitle: subtitle, title: title, type: type, ...getInfoProps() })] }));
70
+ });
71
+ FourThumbnailCard.displayName = 'FourThumbnailCard';
72
+
73
+ export { FourThumbnailCard as default };
@@ -0,0 +1,14 @@
1
+ import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
2
+ export interface FourThumbnailCardSkeletonProps extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'children'> {
3
+ /**
4
+ * Width of the card skeleton container.
5
+ * @default 200
6
+ */
7
+ thumbnailWidth?: number | string;
8
+ }
9
+ /**
10
+ * Skeleton placeholder for FourThumbnailCard component.
11
+ * Renders a skeleton that mimics the FourThumbnailCard layout.
12
+ */
13
+ declare const FourThumbnailCardSkeleton: import("react").ForwardRefExoticComponent<FourThumbnailCardSkeletonProps & import("react").RefAttributes<HTMLDivElement>>;
14
+ export default FourThumbnailCardSkeleton;
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { cardClasses } from '@mezzanine-ui/core/card';
5
+ import Skeleton from '../Skeleton/Skeleton.js';
6
+ import cx from 'clsx';
7
+
8
+ /**
9
+ * Skeleton placeholder for FourThumbnailCard component.
10
+ * Renders a skeleton that mimics the FourThumbnailCard layout.
11
+ */
12
+ const FourThumbnailCardSkeleton = forwardRef(function FourThumbnailCardSkeleton(props, ref) {
13
+ const { className, thumbnailWidth = 200, ...rest } = props;
14
+ return (jsxs("div", { ...rest, ref: ref, className: cx(cardClasses.thumbnail, className), children: [jsx("div", { className: cardClasses.fourThumbnail, children: Array.from({ length: 4 }, (_, index) => (jsx(Skeleton, { className: cardClasses.fourThumbnailThumbnail, width: thumbnailWidth,
15
+ // For four-thumbnail layout, force to '4/3' to maintain the grid layout.
16
+ style: { aspectRatio: '4/3' } }, index))) }), jsx("div", { className: cardClasses.thumbnailInfo, children: jsx("div", { className: cardClasses.thumbnailInfoMain, children: jsxs("div", { className: cardClasses.thumbnailInfoContent, style: { width: '100%' }, children: [jsx(Skeleton, { height: 20, width: "100%" }), jsx(Skeleton, { height: 16, width: "100%" })] }) }) })] }));
17
+ });
18
+ FourThumbnailCardSkeleton.displayName = 'FourThumbnailCardSkeleton';
19
+
20
+ export { FourThumbnailCardSkeleton as default };
@@ -0,0 +1,12 @@
1
+ import { ComponentOverridableForwardRefComponentPropsFactory } from '../utils/jsx-types';
2
+ import { QuickActionCardComponent, QuickActionCardProps } from './typings';
3
+ export type QuickActionCardComponentProps<C extends QuickActionCardComponent = 'button'> = ComponentOverridableForwardRefComponentPropsFactory<QuickActionCardComponent, C, QuickActionCardProps>;
4
+ /**
5
+ * QuickActionCard is a compact card component for quick actions.
6
+ * It displays an icon with a title and optional subtitle.
7
+ * Either icon or title must be provided.
8
+ */
9
+ declare const QuickActionCard: import("react").ForwardRefExoticComponent<Omit<Omit<import("../utils/jsx-types").ComponentPropsWithoutKeyAndRef<"button">, "title" | "className" | "icon" | "disabled" | "readOnly" | "mode" | "subtitle"> & QuickActionCardProps, "component"> & {
10
+ component?: QuickActionCardComponent | undefined;
11
+ } & import("react").RefAttributes<HTMLButtonElement>>;
12
+ export default QuickActionCard;
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { cardClasses } from '@mezzanine-ui/core/card';
5
+ import Icon from '../Icon/Icon.js';
6
+ import cx from 'clsx';
7
+
8
+ /**
9
+ * QuickActionCard is a compact card component for quick actions.
10
+ * It displays an icon with a title and optional subtitle.
11
+ * Either icon or title must be provided.
12
+ */
13
+ const QuickActionCard = forwardRef(function QuickActionCard(props, ref) {
14
+ const { className, component: Component = 'button', disabled = false, icon, mode = 'horizontal', readOnly = false, subtitle, title, ...rest } = props;
15
+ return (jsxs(Component, { ...rest, ref: ref, "aria-disabled": disabled || undefined, "aria-readonly": readOnly || undefined, className: cx(cardClasses.quickAction, {
16
+ [cardClasses.quickActionDisabled]: disabled,
17
+ [cardClasses.quickActionReadOnly]: readOnly,
18
+ [cardClasses.quickActionVertical]: mode === 'vertical',
19
+ }, className), children: [icon && (jsx(Icon, { icon: icon, size: 24, className: cardClasses.quickActionIcon })), title || subtitle ? (jsxs("div", { className: cardClasses.quickActionContent, children: [title && jsx("span", { className: cardClasses.quickActionTitle, children: title }), subtitle && (jsx("span", { className: cardClasses.quickActionSubtitle, children: subtitle }))] })) : null] }));
20
+ });
21
+ QuickActionCard.displayName = 'QuickActionCard';
22
+
23
+ export { QuickActionCard as default };
@@ -0,0 +1,14 @@
1
+ import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
2
+ export interface QuickActionCardSkeletonProps extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'children'> {
3
+ /**
4
+ * Layout mode matching QuickActionCard
5
+ * @default 'horizontal'
6
+ */
7
+ mode?: 'horizontal' | 'vertical';
8
+ }
9
+ /**
10
+ * Skeleton placeholder for QuickActionCard component.
11
+ * Renders a skeleton that mimics the QuickActionCard layout.
12
+ */
13
+ declare const QuickActionCardSkeleton: import("react").ForwardRefExoticComponent<QuickActionCardSkeletonProps & import("react").RefAttributes<HTMLDivElement>>;
14
+ export default QuickActionCardSkeleton;
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { cardClasses } from '@mezzanine-ui/core/card';
5
+ import Skeleton from '../Skeleton/Skeleton.js';
6
+ import cx from 'clsx';
7
+
8
+ /**
9
+ * Skeleton placeholder for QuickActionCard component.
10
+ * Renders a skeleton that mimics the QuickActionCard layout.
11
+ */
12
+ const QuickActionCardSkeleton = forwardRef(function QuickActionCardSkeleton(props, ref) {
13
+ const { className, mode = 'horizontal', ...rest } = props;
14
+ return (jsxs("div", { ...rest, ref: ref, className: cx(cardClasses.quickAction, cardClasses.quickActionReadOnly, mode === 'vertical' && cardClasses.quickActionVertical, className), children: [jsx(Skeleton, { circle: true, height: 24, width: 24 }), jsxs("div", { className: cardClasses.quickActionContent, children: [jsx(Skeleton, { height: 20, width: "70%" }), jsx(Skeleton, { height: 16, width: "50%" })] })] }));
15
+ });
16
+ QuickActionCardSkeleton.displayName = 'QuickActionCardSkeleton';
17
+
18
+ export { QuickActionCardSkeleton as default };
@@ -0,0 +1,13 @@
1
+ import { ComponentOverridableForwardRefComponentPropsFactory } from '../utils/jsx-types';
2
+ import { SingleThumbnailCardComponent, SingleThumbnailCardProps } from './typings';
3
+ export type SingleThumbnailCardComponentProps<C extends SingleThumbnailCardComponent = 'div'> = ComponentOverridableForwardRefComponentPropsFactory<SingleThumbnailCardComponent, C, SingleThumbnailCardProps>;
4
+ /**
5
+ * SingleThumbnailCard displays a single image thumbnail with optional tag, personal action,
6
+ * and info section. Supports three action types: default, action, and overflow.
7
+ *
8
+ * The card width is determined by the image child element.
9
+ */
10
+ declare const SingleThumbnailCard: import("react").ForwardRefExoticComponent<Omit<Omit<import("../utils/jsx-types").ComponentPropsWithoutKeyAndRef<"div">, "children" | "title" | "className" | "type" | "options" | "actionName" | "onActionClick" | "onOptionSelect" | "filetype" | "subtitle" | "personalActionIcon" | "personalActionActiveIcon" | "personalActionActive" | "personalActionOnClick" | "tag"> & SingleThumbnailCardProps, "component"> & {
11
+ component?: SingleThumbnailCardComponent | undefined;
12
+ } & import("react").RefAttributes<HTMLDivElement>>;
13
+ export default SingleThumbnailCard;
@@ -0,0 +1,44 @@
1
+ 'use client';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { forwardRef, Children } from 'react';
4
+ import { cardClasses } from '@mezzanine-ui/core/card';
5
+ import ThumbnailCardInfo from './ThumbnailCardInfo.js';
6
+ import Icon from '../Icon/Icon.js';
7
+ import cx from 'clsx';
8
+
9
+ /**
10
+ * SingleThumbnailCard displays a single image thumbnail with optional tag, personal action,
11
+ * and info section. Supports three action types: default, action, and overflow.
12
+ *
13
+ * The card width is determined by the image child element.
14
+ */
15
+ const SingleThumbnailCard = forwardRef(function SingleThumbnailCard(props, ref) {
16
+ const { children, className, component: Component = 'div', filetype, personalActionActive = false, personalActionActiveIcon, personalActionIcon, personalActionOnClick, subtitle, tag, title, type = 'default', ...rest } = props;
17
+ // Ensure only one child is provided
18
+ const child = Children.only(children);
19
+ const hasPersonalAction = Boolean(personalActionIcon);
20
+ const currentPersonalActionIcon = personalActionActive
21
+ ? (personalActionActiveIcon !== null && personalActionActiveIcon !== void 0 ? personalActionActiveIcon : personalActionIcon)
22
+ : personalActionIcon;
23
+ const handlePersonalActionClick = (event) => {
24
+ event.stopPropagation();
25
+ personalActionOnClick === null || personalActionOnClick === void 0 ? void 0 : personalActionOnClick(event, personalActionActive);
26
+ };
27
+ const getInfoProps = () => {
28
+ if (type === 'action') {
29
+ const { actionName, onActionClick } = props;
30
+ return { actionName, onActionClick };
31
+ }
32
+ if (type === 'overflow') {
33
+ const { onOptionSelect, options } = props;
34
+ return { onOptionSelect, options };
35
+ }
36
+ return {};
37
+ };
38
+ // Filter out type-specific props before spreading
39
+ const { actionName: _actionName, onActionClick: _onActionClick, onOptionSelect: _onOptionSelect, options: _options, type: _type, ...componentProps } = rest;
40
+ return (jsxs(Component, { ...componentProps, ref: ref, className: cx(cardClasses.thumbnail, className), children: [jsxs("div", { className: cardClasses.singleThumbnail, children: [tag && jsx("div", { className: cardClasses.thumbnailTag, children: tag }), hasPersonalAction && currentPersonalActionIcon && (jsx("button", { "aria-label": "Personal Action", className: cardClasses.thumbnailPersonalAction, onClick: handlePersonalActionClick, type: "button", children: jsx(Icon, { icon: currentPersonalActionIcon, size: 24 }) })), child, jsx("div", { className: cardClasses.singleThumbnailOverlay })] }), jsx(ThumbnailCardInfo, { filetype: filetype, subtitle: subtitle, title: title, type: type, ...getInfoProps() })] }));
41
+ });
42
+ SingleThumbnailCard.displayName = 'SingleThumbnailCard';
43
+
44
+ export { SingleThumbnailCard as default };
@@ -0,0 +1,19 @@
1
+ import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
2
+ export interface SingleThumbnailCardSkeletonProps extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'children'> {
3
+ /**
4
+ * Width of the thumbnail skeleton.
5
+ * @default 'var(--mzn-spacing-size-container-slim)'
6
+ */
7
+ thumbnailWidth?: number | string;
8
+ /**
9
+ * Aspect ratio of the thumbnail skeleton.
10
+ * @default '16/9'
11
+ */
12
+ thumbnailAspectRatio?: string;
13
+ }
14
+ /**
15
+ * Skeleton placeholder for SingleThumbnailCard component.
16
+ * Renders a skeleton that mimics the SingleThumbnailCard layout.
17
+ */
18
+ declare const SingleThumbnailCardSkeleton: import("react").ForwardRefExoticComponent<SingleThumbnailCardSkeletonProps & import("react").RefAttributes<HTMLDivElement>>;
19
+ export default SingleThumbnailCardSkeleton;
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { cardClasses } from '@mezzanine-ui/core/card';
5
+ import Skeleton from '../Skeleton/Skeleton.js';
6
+ import cx from 'clsx';
7
+
8
+ /**
9
+ * Skeleton placeholder for SingleThumbnailCard component.
10
+ * Renders a skeleton that mimics the SingleThumbnailCard layout.
11
+ */
12
+ const SingleThumbnailCardSkeleton = forwardRef(function SingleThumbnailCardSkeleton(props, ref) {
13
+ const { className, thumbnailAspectRatio = '16/9', thumbnailWidth = 'var(--mzn-spacing-size-container-slim)', ...rest } = props;
14
+ return (jsxs("div", { ...rest, ref: ref, className: cx(cardClasses.thumbnail, className), children: [jsx("div", { className: cardClasses.singleThumbnail, children: jsx(Skeleton, { height: "100%", style: { aspectRatio: thumbnailAspectRatio }, width: thumbnailWidth }) }), jsx("div", { className: cardClasses.thumbnailInfo, children: jsx("div", { className: cardClasses.thumbnailInfoMain, children: jsxs("div", { className: cardClasses.thumbnailInfoContent, style: { width: '100%' }, children: [jsx(Skeleton, { height: 20, width: "100%" }), jsx(Skeleton, { height: 16, width: "100%" })] }) }) })] }));
15
+ });
16
+ SingleThumbnailCardSkeleton.displayName = 'SingleThumbnailCardSkeleton';
17
+
18
+ export { SingleThumbnailCardSkeleton as default };
@@ -0,0 +1,12 @@
1
+ import { ComponentOverridableForwardRefComponentPropsFactory } from '../utils/jsx-types';
2
+ import { ThumbnailComponent, ThumbnailPropsBase } from './typings';
3
+ export type ThumbnailComponentProps<C extends ThumbnailComponent = 'div'> = ComponentOverridableForwardRefComponentPropsFactory<ThumbnailComponent, C, ThumbnailPropsBase>;
4
+ /**
5
+ * Thumbnail is a child component for FourThumbnailCard.
6
+ * It wraps an image with an overlay that shows the title on hover.
7
+ * Supports polymorphic rendering as 'div', 'a', 'button', or custom components (e.g., Next.js Link).
8
+ */
9
+ declare const Thumbnail: import("react").ForwardRefExoticComponent<Omit<Omit<import("../utils/jsx-types").ComponentPropsWithoutKeyAndRef<"div">, keyof ThumbnailPropsBase> & ThumbnailPropsBase, "component"> & {
10
+ component?: ThumbnailComponent | undefined;
11
+ } & import("react").RefAttributes<HTMLElement>>;
12
+ export default Thumbnail;
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { cardClasses } from '@mezzanine-ui/core/card';
5
+ import cx from 'clsx';
6
+
7
+ /**
8
+ * Thumbnail is a child component for FourThumbnailCard.
9
+ * It wraps an image with an overlay that shows the title on hover.
10
+ * Supports polymorphic rendering as 'div', 'a', 'button', or custom components (e.g., Next.js Link).
11
+ */
12
+ const Thumbnail = forwardRef(function Thumbnail(props, ref) {
13
+ const { children, className, component: Component = 'div', title, ...rest } = props;
14
+ return (jsxs(Component, { ...rest, ref: ref, className: cx(cardClasses.fourThumbnailThumbnail, className), children: [children, jsx("div", { className: cardClasses.fourThumbnailOverlay, children: title && jsx("span", { children: title }) })] }));
15
+ });
16
+ Thumbnail.displayName = 'Thumbnail';
17
+
18
+ export { Thumbnail as default };
@@ -0,0 +1,34 @@
1
+ import { MouseEvent } from 'react';
2
+ import { SingleThumbnailCardOverflowProps, SingleThumbnailCardProps } from './typings';
3
+ export interface ThumbnailCardInfoProps extends Pick<SingleThumbnailCardProps, 'filetype' | 'subtitle' | 'title' | 'type'> {
4
+ /**
5
+ * Label text for the action button (when type="action")
6
+ */
7
+ actionName?: string;
8
+ /**
9
+ * Custom class name
10
+ */
11
+ className?: string;
12
+ /**
13
+ * Whether the action is disabled
14
+ */
15
+ disabled?: boolean;
16
+ /**
17
+ * Click handler for the action button (when type="action")
18
+ */
19
+ onActionClick?: (event: MouseEvent<HTMLButtonElement>) => void;
20
+ /**
21
+ * Callback when an option is selected (when type="overflow")
22
+ */
23
+ onOptionSelect?: SingleThumbnailCardOverflowProps['onOptionSelect'];
24
+ /**
25
+ * Dropdown options (when type="overflow")
26
+ */
27
+ options?: SingleThumbnailCardOverflowProps['options'];
28
+ }
29
+ /**
30
+ * ThumbnailCardInfo is a shared component for rendering card info section
31
+ * Used by SingleThumbnailCard and FourThumbnailCard
32
+ */
33
+ declare const ThumbnailCardInfo: import("react").ForwardRefExoticComponent<ThumbnailCardInfoProps & import("react").RefAttributes<HTMLDivElement>>;
34
+ export default ThumbnailCardInfo;
@@ -0,0 +1,43 @@
1
+ 'use client';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { getFileTypeCategory, cardClasses } from '@mezzanine-ui/core/card';
5
+ import { DotHorizontalIcon } from '@mezzanine-ui/icons';
6
+ import Button from '../Button/Button.js';
7
+ import Dropdown from '../Dropdown/Dropdown.js';
8
+ import cx from 'clsx';
9
+
10
+ /**
11
+ * ThumbnailCardInfo is a shared component for rendering card info section
12
+ * Used by SingleThumbnailCard and FourThumbnailCard
13
+ */
14
+ const ThumbnailCardInfo = forwardRef(function ThumbnailCardInfo(props, ref) {
15
+ const { className, disabled = false, filetype, subtitle, title, type = 'default', } = props;
16
+ const filetypeCategory = filetype
17
+ ? getFileTypeCategory(filetype)
18
+ : undefined;
19
+ const filetypeClassName = filetypeCategory
20
+ ? `${cardClasses.thumbnailInfoFiletype}--${filetypeCategory}`
21
+ : undefined;
22
+ const renderAction = () => {
23
+ if (type === 'default') {
24
+ return null;
25
+ }
26
+ if (type === 'action') {
27
+ const { actionName: name, onActionClick: onClick } = props;
28
+ return (jsx("div", { className: cardClasses.thumbnailInfoAction, children: jsx(Button, { disabled: disabled, onClick: (event) => {
29
+ event.stopPropagation();
30
+ onClick === null || onClick === void 0 ? void 0 : onClick(event);
31
+ }, size: "sub", type: "button", variant: "base-text-link", children: name }) }));
32
+ }
33
+ if (type === 'overflow') {
34
+ const { onOptionSelect: onSelect, options: opts } = props;
35
+ return (jsx("div", { className: cardClasses.thumbnailInfoAction, children: jsx(Dropdown, { disabled: disabled, globalPortal: false, mode: "single", onSelect: onSelect, options: opts, children: jsx(Button, { disabled: disabled, icon: DotHorizontalIcon, iconType: "icon-only", size: "sub", type: "button", variant: "base-text-link" }) }) }));
36
+ }
37
+ return null;
38
+ };
39
+ return (jsxs("div", { ref: ref, className: cx(cardClasses.thumbnailInfo, className), children: [jsxs("div", { className: cardClasses.thumbnailInfoMain, children: [filetype && (jsx("div", { className: cx(cardClasses.thumbnailInfoFiletype, filetypeClassName), children: filetype.toUpperCase() })), jsxs("div", { className: cardClasses.thumbnailInfoContent, children: [title && (jsx("span", { className: cardClasses.thumbnailInfoTitle, children: title })), subtitle && (jsx("span", { className: cardClasses.thumbnailInfoSubtitle, children: subtitle }))] })] }), renderAction()] }));
40
+ });
41
+ ThumbnailCardInfo.displayName = 'ThumbnailCardInfo';
42
+
43
+ export { ThumbnailCardInfo as default };
package/Card/index.d.ts CHANGED
@@ -1,4 +1,43 @@
1
- export type { CardActionsProps } from './CardActions';
2
- export { default as CardActions } from './CardActions';
3
- export type { CardProps } from './Card';
4
- export { default } from './Card';
1
+ import { PropsWithoutRef, ReactElement, ReactNode, RefAttributes } from 'react';
2
+ import BaseCard, { BaseCardComponentProps } from './BaseCard';
3
+ import FourThumbnailCard, { FourThumbnailCardComponentProps } from './FourThumbnailCard';
4
+ import QuickActionCard, { QuickActionCardComponentProps } from './QuickActionCard';
5
+ import SingleThumbnailCard, { SingleThumbnailCardComponentProps } from './SingleThumbnailCard';
6
+ import Thumbnail, { ThumbnailComponentProps } from './Thumbnail';
7
+ import { BaseCardComponent, FourThumbnailCardComponent, QuickActionCardComponent, SingleThumbnailCardComponent, ThumbnailComponent } from './typings';
8
+ export { default as CardGroup } from './CardGroup';
9
+ export type { CardGroupLoadingType, CardGroupProps } from './CardGroup';
10
+ export { default as ThumbnailCardInfo } from './ThumbnailCardInfo';
11
+ export type { ThumbnailCardInfoProps } from './ThumbnailCardInfo';
12
+ export { default as BaseCardSkeleton } from './BaseCardSkeleton';
13
+ export type { BaseCardSkeletonProps } from './BaseCardSkeleton';
14
+ export { default as FourThumbnailCardSkeleton } from './FourThumbnailCardSkeleton';
15
+ export type { FourThumbnailCardSkeletonProps } from './FourThumbnailCardSkeleton';
16
+ export { default as QuickActionCardSkeleton } from './QuickActionCardSkeleton';
17
+ export type { QuickActionCardSkeletonProps } from './QuickActionCardSkeleton';
18
+ export { default as SingleThumbnailCardSkeleton } from './SingleThumbnailCardSkeleton';
19
+ export type { SingleThumbnailCardSkeletonProps } from './SingleThumbnailCardSkeleton';
20
+ export type { BaseCardComponentProps, FourThumbnailCardComponentProps, QuickActionCardComponentProps, SingleThumbnailCardComponentProps, ThumbnailComponentProps, };
21
+ export type { BaseCardComponent, BaseCardActionVariant, BaseCardType, BaseCardProps, BaseCardPropsCommon, BaseCardDefaultProps, BaseCardActionProps, BaseCardOverflowProps, BaseCardToggleProps, FourThumbnailCardComponent, FourThumbnailCardType, FourThumbnailCardProps, FourThumbnailCardPropsCommon, FourThumbnailCardDefaultProps, FourThumbnailCardActionProps, FourThumbnailCardOverflowProps, QuickActionCardComponent, QuickActionCardMode, QuickActionCardProps, QuickActionCardPropsCommon, QuickActionCardWithIconProps, QuickActionCardWithTitleProps, SingleThumbnailCardComponent, SingleThumbnailCardType, SingleThumbnailCardProps, SingleThumbnailCardPropsCommon, SingleThumbnailCardDefaultProps, SingleThumbnailCardActionProps, SingleThumbnailCardOverflowProps, ThumbnailComponent, ThumbnailPropsBase, } from './typings';
22
+ /**
23
+ * Type alias for proper generic inference when using component prop
24
+ */
25
+ type GenericBaseCard = <C extends BaseCardComponent = 'div'>(props: PropsWithoutRef<BaseCardComponentProps<C>> & RefAttributes<HTMLElement>) => ReactElement<any>;
26
+ type GenericFourThumbnailCard = <C extends FourThumbnailCardComponent = 'div'>(props: PropsWithoutRef<FourThumbnailCardComponentProps<C>> & RefAttributes<HTMLElement> & {
27
+ children: ReactNode;
28
+ title: string;
29
+ }) => ReactElement<any>;
30
+ type GenericQuickActionCard = <C extends QuickActionCardComponent = 'button'>(props: PropsWithoutRef<QuickActionCardComponentProps<C>> & RefAttributes<HTMLElement>) => ReactElement<any>;
31
+ type GenericSingleThumbnailCard = <C extends SingleThumbnailCardComponent = 'div'>(props: PropsWithoutRef<SingleThumbnailCardComponentProps<C>> & RefAttributes<HTMLElement> & {
32
+ children: ReactElement;
33
+ title: string;
34
+ }) => ReactElement<any>;
35
+ type GenericThumbnail = <C extends ThumbnailComponent = 'div'>(props: PropsWithoutRef<ThumbnailComponentProps<C>> & RefAttributes<HTMLElement> & {
36
+ children: ReactNode;
37
+ }) => ReactElement<any>;
38
+ export { BaseCard, FourThumbnailCard, QuickActionCard, SingleThumbnailCard, Thumbnail, };
39
+ export declare const BaseCardGeneric: GenericBaseCard;
40
+ export declare const FourThumbnailCardGeneric: GenericFourThumbnailCard;
41
+ export declare const QuickActionCardGeneric: GenericQuickActionCard;
42
+ export declare const SingleThumbnailCardGeneric: GenericSingleThumbnailCard;
43
+ export declare const ThumbnailGeneric: GenericThumbnail;
package/Card/index.js CHANGED
@@ -1,2 +1,19 @@
1
- export { default as CardActions } from './CardActions.js';
2
- export { default } from './Card.js';
1
+ import BaseCard from './BaseCard.js';
2
+ import FourThumbnailCard from './FourThumbnailCard.js';
3
+ import QuickActionCard from './QuickActionCard.js';
4
+ import SingleThumbnailCard from './SingleThumbnailCard.js';
5
+ import Thumbnail from './Thumbnail.js';
6
+ export { default as CardGroup } from './CardGroup.js';
7
+ export { default as ThumbnailCardInfo } from './ThumbnailCardInfo.js';
8
+ export { default as BaseCardSkeleton } from './BaseCardSkeleton.js';
9
+ export { default as FourThumbnailCardSkeleton } from './FourThumbnailCardSkeleton.js';
10
+ export { default as QuickActionCardSkeleton } from './QuickActionCardSkeleton.js';
11
+ export { default as SingleThumbnailCardSkeleton } from './SingleThumbnailCardSkeleton.js';
12
+
13
+ const BaseCardGeneric = BaseCard;
14
+ const FourThumbnailCardGeneric = FourThumbnailCard;
15
+ const QuickActionCardGeneric = QuickActionCard;
16
+ const SingleThumbnailCardGeneric = SingleThumbnailCard;
17
+ const ThumbnailGeneric = Thumbnail;
18
+
19
+ export { BaseCard, BaseCardGeneric, FourThumbnailCard, FourThumbnailCardGeneric, QuickActionCard, QuickActionCardGeneric, SingleThumbnailCard, SingleThumbnailCardGeneric, Thumbnail, ThumbnailGeneric };