@lumx/react 3.0.6-alpha.2 → 3.0.6
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 +18 -1
- package/index.d.ts +19 -3
- package/index.js +550 -482
- package/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/button/Button.stories.tsx +27 -1
- package/src/components/button/Button.tsx +3 -3
- package/src/components/popover/Popover.tsx +12 -2
- package/src/components/popover-dialog/PopoverDialog.stories.tsx +75 -0
- package/src/components/popover-dialog/PopoverDialog.test.tsx +65 -0
- package/src/components/popover-dialog/PopoverDialog.tsx +65 -0
- package/src/components/popover-dialog/index.tsx +1 -0
- package/src/index.ts +1 -0
- package/src/stories/generated/PopoverDialog/Demos.stories.tsx +6 -0
- package/src/utils/type.ts +20 -0
package/_internal/types.d.ts
CHANGED
|
@@ -48,6 +48,23 @@ declare type Callback = () => void;
|
|
|
48
48
|
* (excluding `NaN` as it can't be distinguished from `number`)
|
|
49
49
|
*/
|
|
50
50
|
declare type Falsy = false | undefined | null | 0 | '';
|
|
51
|
+
/**
|
|
52
|
+
* Require either `aria-label` or `arial-labelledby` prop.
|
|
53
|
+
* If none are set, the order will prioritize `aria-labelledby` over `aria-label` as it
|
|
54
|
+
* needs a visible element.
|
|
55
|
+
*/
|
|
56
|
+
declare type HasAriaLabelOrLabelledBy<T = string | undefined> = T extends string ? {
|
|
57
|
+
/**
|
|
58
|
+
* The id of the element to use as title of the dialog. Can be within or out of the dialog.
|
|
59
|
+
* Although it is not recommended, aria-label can be used instead if no visible element is available.
|
|
60
|
+
*/
|
|
61
|
+
'aria-labelledby': T;
|
|
62
|
+
/** The label of the dialog. */
|
|
63
|
+
'aria-label'?: undefined;
|
|
64
|
+
} : {
|
|
65
|
+
'aria-label': string;
|
|
66
|
+
'aria-labelledby'?: undefined;
|
|
67
|
+
};
|
|
51
68
|
|
|
52
69
|
/**
|
|
53
70
|
* Alignments.
|
|
@@ -268,4 +285,4 @@ declare const ThumbnailVariant: {
|
|
|
268
285
|
};
|
|
269
286
|
declare type ThumbnailVariant = ValueOf<typeof ThumbnailVariant>;
|
|
270
287
|
|
|
271
|
-
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, Color as b, Callback as c, ColorPalette as d, VerticalAlignment as e, ColorVariant as f, TextElement as g, HeadingElement as h, AspectRatio as i, FocusPoint as j, ThumbnailSize as k, ThumbnailVariant as l,
|
|
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, Color as b, Callback as c, ColorPalette as d, VerticalAlignment as e, ColorVariant as f, TextElement as g, HeadingElement as h, AspectRatio as i, FocusPoint as j, ThumbnailSize as k, ThumbnailVariant as l, HasAriaLabelOrLabelledBy as m, GlobalSize as n, TypographyInterface as o, Theme as p, TypographyTitleCustom as q, TypographyCustom 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 Color, E as Emphasis, V as ValueOf, c as Callback, d as ColorPalette, A as Alignment, e as VerticalAlignment, O as Orientation, f as ColorVariant, T as Typography, g as TextElement, h as HeadingElement, i as AspectRatio, F as Falsy, j as FocusPoint, k as ThumbnailSize, l as ThumbnailVariant, m as
|
|
3
|
-
export { A as Alignment, i as AspectRatio, c as Callback, b as Color, d as ColorPalette, f as ColorVariant, E as Emphasis, j as FocusPoint, G as GenericProps,
|
|
2
|
+
import { K as Kind, C as Comp, G as GenericProps, H as HasTheme, a as HorizontalAlignment, S as Size, b as Color, E as Emphasis, V as ValueOf, c as Callback, d as ColorPalette, A as Alignment, e as VerticalAlignment, O as Orientation, f as ColorVariant, T as Typography, g as TextElement, h as HeadingElement, i as AspectRatio, F as Falsy, j as FocusPoint, k as ThumbnailSize, l as ThumbnailVariant, m as HasAriaLabelOrLabelledBy, n as GlobalSize, o as TypographyInterface } from './_internal/types.js';
|
|
3
|
+
export { A as Alignment, i as AspectRatio, c as Callback, b as Color, d as ColorPalette, f as ColorVariant, E as Emphasis, j as FocusPoint, G as GenericProps, n as GlobalSize, h as HeadingElement, a as HorizontalAlignment, K as Kind, O as Orientation, S as Size, g as TextElement, p as Theme, s as ThumbnailAspectRatio, k as ThumbnailSize, l as ThumbnailVariant, T as Typography, r as TypographyCustom, o as TypographyInterface, q as TypographyTitleCustom, e as VerticalAlignment } from './_internal/types.js';
|
|
4
4
|
|
|
5
5
|
interface AlertDialogProps extends Omit<DialogProps, 'header' | 'footer'> {
|
|
6
6
|
/** Message variant. */
|
|
@@ -771,6 +771,8 @@ interface PopoverProps extends GenericProps {
|
|
|
771
771
|
zIndex?: number;
|
|
772
772
|
/** On close callback (on click away or Escape pressed). */
|
|
773
773
|
onClose?(): void;
|
|
774
|
+
/** Whether the popover should trap the focus within itself. Default to false. */
|
|
775
|
+
withFocusTrap?: boolean;
|
|
774
776
|
}
|
|
775
777
|
/**
|
|
776
778
|
* Popover component.
|
|
@@ -1640,6 +1642,20 @@ interface NotificationProps extends GenericProps, HasTheme {
|
|
|
1640
1642
|
*/
|
|
1641
1643
|
declare const Notification: Comp<NotificationProps, HTMLDivElement>;
|
|
1642
1644
|
|
|
1645
|
+
/**
|
|
1646
|
+
* PopoverDialog props.
|
|
1647
|
+
* The PopoverDialog has the same props as the Popover but requires an accessible label.
|
|
1648
|
+
*/
|
|
1649
|
+
declare type PopoverDialogProps = PopoverProps & HasAriaLabelOrLabelledBy;
|
|
1650
|
+
/**
|
|
1651
|
+
* PopoverDialog component.
|
|
1652
|
+
* Defines a popover that acts like a dialog
|
|
1653
|
+
* * Has a dialog aria role
|
|
1654
|
+
* * Sets a focus trap within the popover
|
|
1655
|
+
* * Closes on click away and escape.
|
|
1656
|
+
*/
|
|
1657
|
+
declare const PopoverDialog: Comp<PopoverDialogProps, HTMLDivElement>;
|
|
1658
|
+
|
|
1643
1659
|
/**
|
|
1644
1660
|
* Defines the props of the component.
|
|
1645
1661
|
*/
|
|
@@ -2710,4 +2726,4 @@ interface UserBlockProps extends GenericProps, HasTheme {
|
|
|
2710
2726
|
*/
|
|
2711
2727
|
declare const UserBlock: Comp<UserBlockProps, HTMLDivElement>;
|
|
2712
2728
|
|
|
2713
|
-
export { AlertDialog, AlertDialogProps, Autocomplete, AutocompleteMultiple, AutocompleteMultipleProps, AutocompleteProps, Avatar, AvatarProps, AvatarSize, Badge, BadgeProps, BaseButtonProps, Button, ButtonEmphasis, ButtonGroup, ButtonGroupProps, ButtonProps, ButtonSize, Checkbox, CheckboxProps, Chip, ChipGroup, ChipGroupProps, ChipProps, CommentBlock, CommentBlockProps, CommentBlockVariant, DatePicker, DatePickerControlled, DatePickerControlledProps, DatePickerField, DatePickerFieldProps, DatePickerProps, Dialog, DialogProps, DialogSizes, Divider, DividerProps, DragHandle, DragHandleProps, Dropdown, DropdownProps, Elevation, ExpansionPanel, ExpansionPanelProps, Flag, FlagProps, FlexBox, FlexBoxProps, FlexHorizontalAlignment, FlexVerticalAlignment, GapSize, GenericBlock, GenericBlockGapSize, GenericBlockProps, Grid, GridItem, GridItemProps, GridProps, Heading, HeadingLevelProvider, HeadingLevelProviderProps, HeadingProps, Icon, IconButton, IconButtonProps, IconProps, IconSizes, ImageBlock, ImageBlockCaptionPosition, ImageBlockProps, ImageBlockSize, InlineList, InlineListProps, InputHelper, InputHelperProps, InputLabel, InputLabelProps, Lightbox, LightboxProps, Link, LinkPreview, LinkPreviewProps, LinkProps, List, ListDivider, ListDividerProps, ListItem, ListItemProps, ListItemSize, ListProps, ListSubheader, ListSubheaderProps, MarginAutoAlignment, Message, MessageProps, Mosaic, MosaicProps, Notification, NotificationProps, Offset, Placement, Popover, PopoverProps, PostBlock, PostBlockProps, Progress, ProgressProps, ProgressTracker, ProgressTrackerProps, ProgressTrackerProvider, ProgressTrackerProviderProps, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressTrackerStepPanelProps, ProgressTrackerStepProps, ProgressVariant, RadioButton, RadioButtonProps, RadioGroup, RadioGroupProps, Select, SelectMultiple, SelectMultipleField, SelectMultipleProps, SelectProps, SelectVariant, SideNavigation, SideNavigationItem, SideNavigationItemProps, SideNavigationProps, SkeletonCircle, SkeletonCircleProps, SkeletonRectangle, SkeletonRectangleProps, SkeletonRectangleVariant, SkeletonTypography, SkeletonTypographyProps, Slider, SliderProps, Slides, SlidesProps, Slideshow, SlideshowControls, SlideshowControlsProps, SlideshowItem, SlideshowItemProps, SlideshowProps, Switch, SwitchProps, Tab, TabList, TabListLayout, TabListProps, TabPanel, TabPanelProps, TabProps, TabProvider, TabProviderProps, Table, TableBody, TableBodyProps, TableCell, TableCellProps, TableCellVariant, TableHeader, TableHeaderProps, TableProps, TableRow, TableRowProps, Text, TextField, TextFieldProps, TextProps, ThOrder, Thumbnail, ThumbnailProps, Toolbar, ToolbarProps, Tooltip, TooltipPlacement, TooltipProps, Uploader, UploaderProps, UploaderSize, UploaderVariant, UserBlock, UserBlockProps, UserBlockSize, clamp, isClickable, useFocusPointStyle, useHeadingLevel };
|
|
2729
|
+
export { AlertDialog, AlertDialogProps, Autocomplete, AutocompleteMultiple, AutocompleteMultipleProps, AutocompleteProps, Avatar, AvatarProps, AvatarSize, Badge, BadgeProps, BaseButtonProps, Button, ButtonEmphasis, ButtonGroup, ButtonGroupProps, ButtonProps, ButtonSize, Checkbox, CheckboxProps, Chip, ChipGroup, ChipGroupProps, ChipProps, CommentBlock, CommentBlockProps, CommentBlockVariant, DatePicker, DatePickerControlled, DatePickerControlledProps, DatePickerField, DatePickerFieldProps, DatePickerProps, Dialog, DialogProps, DialogSizes, Divider, DividerProps, DragHandle, DragHandleProps, Dropdown, DropdownProps, Elevation, ExpansionPanel, ExpansionPanelProps, Flag, FlagProps, FlexBox, FlexBoxProps, FlexHorizontalAlignment, FlexVerticalAlignment, GapSize, GenericBlock, GenericBlockGapSize, GenericBlockProps, Grid, GridItem, GridItemProps, GridProps, Heading, HeadingLevelProvider, HeadingLevelProviderProps, HeadingProps, Icon, IconButton, IconButtonProps, IconProps, IconSizes, ImageBlock, ImageBlockCaptionPosition, ImageBlockProps, ImageBlockSize, InlineList, InlineListProps, InputHelper, InputHelperProps, InputLabel, InputLabelProps, Lightbox, LightboxProps, Link, LinkPreview, LinkPreviewProps, LinkProps, List, ListDivider, ListDividerProps, ListItem, ListItemProps, ListItemSize, ListProps, ListSubheader, ListSubheaderProps, MarginAutoAlignment, Message, MessageProps, Mosaic, MosaicProps, Notification, NotificationProps, Offset, Placement, Popover, PopoverDialog, PopoverDialogProps, PopoverProps, PostBlock, PostBlockProps, Progress, ProgressProps, ProgressTracker, ProgressTrackerProps, ProgressTrackerProvider, ProgressTrackerProviderProps, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressTrackerStepPanelProps, ProgressTrackerStepProps, ProgressVariant, RadioButton, RadioButtonProps, RadioGroup, RadioGroupProps, Select, SelectMultiple, SelectMultipleField, SelectMultipleProps, SelectProps, SelectVariant, SideNavigation, SideNavigationItem, SideNavigationItemProps, SideNavigationProps, SkeletonCircle, SkeletonCircleProps, SkeletonRectangle, SkeletonRectangleProps, SkeletonRectangleVariant, SkeletonTypography, SkeletonTypographyProps, Slider, SliderProps, Slides, SlidesProps, Slideshow, SlideshowControls, SlideshowControlsProps, SlideshowItem, SlideshowItemProps, SlideshowProps, Switch, SwitchProps, Tab, TabList, TabListLayout, TabListProps, TabPanel, TabPanelProps, TabProps, TabProvider, TabProviderProps, Table, TableBody, TableBodyProps, TableCell, TableCellProps, TableCellVariant, TableHeader, TableHeaderProps, TableProps, TableRow, TableRowProps, Text, TextField, TextFieldProps, TextProps, ThOrder, Thumbnail, ThumbnailProps, Toolbar, ToolbarProps, Tooltip, TooltipPlacement, TooltipProps, Uploader, UploaderProps, UploaderSize, UploaderVariant, UserBlock, UserBlockProps, UserBlockSize, clamp, isClickable, useFocusPointStyle, useHeadingLevel };
|