@lumx/react 3.1.2 → 3.1.3
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.
- package/_internal/types.d.ts +1 -1
- package/index.d.ts +5 -5
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/expansion-panel/ExpansionPanel.stories.tsx +65 -0
- package/src/components/expansion-panel/ExpansionPanel.test.tsx +2 -2
- package/src/components/expansion-panel/ExpansionPanel.tsx +8 -8
package/_internal/types.d.ts
CHANGED
|
@@ -285,4 +285,4 @@ declare const ThumbnailVariant: {
|
|
|
285
285
|
};
|
|
286
286
|
declare type ThumbnailVariant = ValueOf<typeof ThumbnailVariant>;
|
|
287
287
|
|
|
288
|
-
export { Alignment as A, Comp as C, Emphasis as E, Falsy as F, GenericProps as G, HasTheme as H, Kind as K, Orientation as O, Size as S, Typography as T, ValueOf as V, HorizontalAlignment as a, ColorPalette as b,
|
|
288
|
+
export { Alignment as A, Comp as C, Emphasis as E, Falsy as F, GenericProps as G, HasTheme as H, Kind as K, Orientation as O, Size as S, Typography as T, ValueOf as V, HorizontalAlignment as a, ColorPalette as b, VerticalAlignment as c, ColorVariant as d, TextElement as e, HeadingElement as f, AspectRatio as g, FocusPoint as h, ThumbnailSize as i, ThumbnailVariant as j, HasAriaLabelOrLabelledBy as k, GlobalSize as l, TypographyInterface as m, Color as n, Theme as o, TypographyTitleCustom as p, TypographyCustom as q, Callback as r, ThumbnailAspectRatio as s };
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode, SyntheticEvent, ReactElement, MouseEventHandler, KeyboardEventHandler, AriaAttributes, DetailedHTMLProps, ButtonHTMLAttributes, InputHTMLAttributes, Ref, RefObject, ImgHTMLAttributes, CSSProperties, SetStateAction, Key } from 'react';
|
|
2
|
-
import { K as Kind, C as Comp, G as GenericProps, H as HasTheme, a as HorizontalAlignment, S as Size, b as ColorPalette, E as Emphasis, V as ValueOf,
|
|
3
|
-
export { A as Alignment,
|
|
2
|
+
import { K as Kind, C as Comp, G as GenericProps, H as HasTheme, a as HorizontalAlignment, S as Size, b as ColorPalette, E as Emphasis, V as ValueOf, A as Alignment, c as VerticalAlignment, O as Orientation, d as ColorVariant, T as Typography, e as TextElement, f as HeadingElement, g as AspectRatio, F as Falsy, h as FocusPoint, i as ThumbnailSize, j as ThumbnailVariant, k as HasAriaLabelOrLabelledBy, l as GlobalSize, m as TypographyInterface } from './_internal/types.js';
|
|
3
|
+
export { A as Alignment, g as AspectRatio, r as Callback, n as Color, b as ColorPalette, d as ColorVariant, E as Emphasis, h as FocusPoint, G as GenericProps, l as GlobalSize, f as HeadingElement, a as HorizontalAlignment, K as Kind, O as Orientation, S as Size, e as TextElement, o as Theme, s as ThumbnailAspectRatio, i as ThumbnailSize, j as ThumbnailVariant, T as Typography, q as TypographyCustom, m as TypographyInterface, p as TypographyTitleCustom, c as VerticalAlignment } from './_internal/types.js';
|
|
4
4
|
|
|
5
5
|
interface AlertDialogProps extends Omit<DialogProps, 'header' | 'footer'> {
|
|
6
6
|
/** Message variant. */
|
|
@@ -877,13 +877,13 @@ interface ExpansionPanelProps extends GenericProps, HasTheme {
|
|
|
877
877
|
/** Label text (overwritten if a `<header>` is provided in the children). */
|
|
878
878
|
label?: string;
|
|
879
879
|
/** On open callback. */
|
|
880
|
-
onOpen?:
|
|
880
|
+
onOpen?: (event: React.MouseEvent) => void;
|
|
881
881
|
/** On close callback. */
|
|
882
|
-
onClose?:
|
|
882
|
+
onClose?: (event: React.MouseEvent) => void;
|
|
883
883
|
/** Props to pass to the toggle button (minus those already set by the ExpansionPanel props). */
|
|
884
884
|
toggleButtonProps: Pick<IconButtonProps, 'label'> & Omit<IconButtonProps, 'label' | 'onClick' | 'icon' | 'emphasis' | 'color'>;
|
|
885
885
|
/** On toggle open or close callback. */
|
|
886
|
-
onToggleOpen?(shouldOpen: boolean): void;
|
|
886
|
+
onToggleOpen?(shouldOpen: boolean, event: React.MouseEvent): void;
|
|
887
887
|
}
|
|
888
888
|
/**
|
|
889
889
|
* ExpansionPanel component.
|
package/index.js
CHANGED
|
@@ -6378,16 +6378,16 @@ const ExpansionPanel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
6378
6378
|
const headerContent = !isEmpty(headerProps.children) ? headerProps.children : /*#__PURE__*/React.createElement("span", {
|
|
6379
6379
|
className: `${CLASSNAME$k}__label`
|
|
6380
6380
|
}, label);
|
|
6381
|
-
const toggleOpen =
|
|
6381
|
+
const toggleOpen = event => {
|
|
6382
6382
|
const shouldOpen = !isOpen;
|
|
6383
6383
|
if (isFunction(onOpen) && shouldOpen) {
|
|
6384
|
-
onOpen();
|
|
6384
|
+
onOpen(event);
|
|
6385
6385
|
}
|
|
6386
6386
|
if (isFunction(onClose) && !shouldOpen) {
|
|
6387
|
-
onClose();
|
|
6387
|
+
onClose(event);
|
|
6388
6388
|
}
|
|
6389
6389
|
if (isFunction(onToggleOpen)) {
|
|
6390
|
-
onToggleOpen(shouldOpen);
|
|
6390
|
+
onToggleOpen(shouldOpen, event);
|
|
6391
6391
|
}
|
|
6392
6392
|
};
|
|
6393
6393
|
const color = theme === Theme.dark ? ColorPalette.light : ColorPalette.dark;
|