@lumx/react 3.20.1-alpha.42 → 3.20.1-alpha.44
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/{Portal.js → useClassnames.js} +73 -28
- package/_internal/useClassnames.js.map +1 -0
- package/index.d.ts +11 -3
- package/index.js +1241 -984
- package/index.js.map +1 -1
- package/package.json +3 -4
- package/utils/index.d.ts +53 -2
- package/utils/index.js +1 -1
- package/_internal/Portal.js.map +0 -1
|
@@ -1,31 +1,8 @@
|
|
|
1
|
-
import React__default, {
|
|
2
|
-
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
1
|
+
import React__default, { useEffect, useContext, createContext, useMemo, useRef } from 'react';
|
|
3
2
|
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
|
-
|
|
6
|
-
const DisabledStateContext = /*#__PURE__*/React__default.createContext({
|
|
7
|
-
state: null
|
|
8
|
-
});
|
|
9
|
-
/**
|
|
10
|
-
* Disabled state provider.
|
|
11
|
-
* All nested LumX Design System components inherit this disabled state.
|
|
12
|
-
*/
|
|
13
|
-
function DisabledStateProvider({
|
|
14
|
-
children,
|
|
15
|
-
...value
|
|
16
|
-
}) {
|
|
17
|
-
return /*#__PURE__*/jsx(DisabledStateContext.Provider, {
|
|
18
|
-
value: value,
|
|
19
|
-
children: children
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Get DisabledState context value
|
|
25
|
-
*/
|
|
26
|
-
function useDisabledStateContext() {
|
|
27
|
-
return useContext(DisabledStateContext);
|
|
28
|
-
}
|
|
5
|
+
import { cls } from '@lumx/core/js/utils';
|
|
29
6
|
|
|
30
7
|
const EVENT_TYPES = ['mousedown', 'touchstart'];
|
|
31
8
|
function isClickAway(targets, refs) {
|
|
@@ -155,5 +132,73 @@ const Portal = ({
|
|
|
155
132
|
return /*#__PURE__*/createPortal(children, context.container);
|
|
156
133
|
};
|
|
157
134
|
|
|
158
|
-
|
|
159
|
-
|
|
135
|
+
const DisabledStateContext = /*#__PURE__*/React__default.createContext({
|
|
136
|
+
state: null
|
|
137
|
+
});
|
|
138
|
+
/**
|
|
139
|
+
* Disabled state provider.
|
|
140
|
+
* All nested LumX Design System components inherit this disabled state.
|
|
141
|
+
*/
|
|
142
|
+
function DisabledStateProvider({
|
|
143
|
+
children,
|
|
144
|
+
...value
|
|
145
|
+
}) {
|
|
146
|
+
return /*#__PURE__*/jsx(DisabledStateContext.Provider, {
|
|
147
|
+
value: value,
|
|
148
|
+
children: children
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Get DisabledState context value
|
|
154
|
+
*/
|
|
155
|
+
function useDisabledStateContext() {
|
|
156
|
+
return useContext(DisabledStateContext);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Hook that retrieves several utilities for the classnames feature.
|
|
161
|
+
* @param classname - base component class name
|
|
162
|
+
* @returns utility functions
|
|
163
|
+
*/
|
|
164
|
+
function useClassnames(classname) {
|
|
165
|
+
return useMemo(() => {
|
|
166
|
+
return {
|
|
167
|
+
/**
|
|
168
|
+
* Returns the BEM class for the given block (and modifier if it is defined)
|
|
169
|
+
*
|
|
170
|
+
* Executing `block()` returns`CLASSNAME`
|
|
171
|
+
*
|
|
172
|
+
* Executing `block('modifier')` returns `CLASSNAME CLASSNAME--modifier`
|
|
173
|
+
*
|
|
174
|
+
* Executing `block({ modifier1: true, modifier2: false })` returns `CLASSNAME CLASSNAME--modifier1`
|
|
175
|
+
*
|
|
176
|
+
* Executing `block(['className'])` returns `CLASSNAME className`
|
|
177
|
+
*
|
|
178
|
+
* @param modifier - string or Record<string, boolean> or list of css classes
|
|
179
|
+
* @param additionalClasses - string | string[] - list of additional classes to be added
|
|
180
|
+
* @returns string
|
|
181
|
+
*/
|
|
182
|
+
block: cls.bem.block(classname),
|
|
183
|
+
/**
|
|
184
|
+
* Returns the BEM class for the given element (and modifier if it is defined)
|
|
185
|
+
*
|
|
186
|
+
* Executing `element('element')` returns `CLASSNAME__element`
|
|
187
|
+
*
|
|
188
|
+
* Executing `element('element', 'modifier')` returns `CLASSNAME__element CLASSNAME__element--modifier`
|
|
189
|
+
*
|
|
190
|
+
* Executing `element('element', { modifier1: true, modifier2: false })` returns `CLASSNAME__element CLASSNAME__element--modifier1`
|
|
191
|
+
*
|
|
192
|
+
* Executing `element('element', ['classname'])` returns `CLASSNAME__element` class name
|
|
193
|
+
*
|
|
194
|
+
* @param modifier - string or Record<string, boolean> or list of css classes
|
|
195
|
+
* @param additionalClasses - string | string[] - list of additional classes to be added
|
|
196
|
+
* @returns string
|
|
197
|
+
*/
|
|
198
|
+
element: cls.bem.element(classname)
|
|
199
|
+
};
|
|
200
|
+
}, [classname]);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export { ClickAwayProvider as C, DisabledStateProvider as D, Portal as P, PortalProvider as a, useClassnames as b, useDisabledStateContext as u };
|
|
204
|
+
//# sourceMappingURL=useClassnames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useClassnames.js","sources":["../../src/hooks/useClickAway.tsx","../../src/utils/ClickAwayProvider/ClickAwayProvider.tsx","../../src/utils/Portal/PortalProvider.tsx","../../src/utils/Portal/Portal.tsx","../../src/utils/disabled/DisabledStateContext.tsx","../../src/utils/className/useClassnames.ts"],"sourcesContent":["import { RefObject, useEffect } from 'react';\n\nimport { Falsy } from '@lumx/react/utils/type';\n\nimport isEmpty from 'lodash/isEmpty';\n\nconst EVENT_TYPES = ['mousedown', 'touchstart'];\n\nfunction isClickAway(targets: HTMLElement[], refs: Array<RefObject<HTMLElement>>): boolean {\n // The targets elements are not contained in any of the listed element references.\n return !refs.some((ref) => targets.some((target) => ref?.current?.contains(target)));\n}\n\nexport interface ClickAwayParameters {\n /**\n * A callback function to call when the user clicks away from the elements.\n */\n callback: EventListener | Falsy;\n /**\n * Elements considered within the click away context (clicking outside them will trigger the click away callback).\n */\n childrenRefs: RefObject<Array<RefObject<HTMLElement>>>;\n}\n\n/**\n * Listen to clicks away from the given elements and callback the passed in function.\n *\n * Warning: If you need to detect click away on nested React portals, please use the `ClickAwayProvider` component.\n */\nexport function useClickAway({ callback, childrenRefs }: ClickAwayParameters): void {\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!callback || !currentRefs || isEmpty(currentRefs)) {\n return undefined;\n }\n const listener: EventListener = (evt) => {\n const targets = [evt.composedPath?.()[0], evt.target] as HTMLElement[];\n if (isClickAway(targets, currentRefs)) {\n callback(evt);\n }\n };\n\n EVENT_TYPES.forEach((evtType) => document.addEventListener(evtType, listener));\n return () => {\n EVENT_TYPES.forEach((evtType) => document.removeEventListener(evtType, listener));\n };\n }, [callback, childrenRefs]);\n}\n","import { createContext, RefObject, useContext, useEffect, useMemo, useRef } from 'react';\nimport { ClickAwayParameters, useClickAway } from '@lumx/react/hooks/useClickAway';\n\ninterface ContextValue {\n childrenRefs: Array<RefObject<HTMLElement>>;\n addRefs(...newChildrenRefs: Array<RefObject<HTMLElement>>): void;\n}\n\nconst ClickAwayAncestorContext = createContext<ContextValue | null>(null);\n\ninterface ClickAwayProviderProps extends ClickAwayParameters {\n /**\n * (Optional) Element that should be considered as part of the parent\n */\n parentRef?: RefObject<HTMLElement>;\n /**\n * Children\n */\n children?: React.ReactNode;\n}\n\n/**\n * Component combining the `useClickAway` hook with a React context to hook into the React component tree and make sure\n * we take into account both the DOM tree and the React tree to detect click away.\n *\n * @return the react component.\n */\nexport const ClickAwayProvider: React.FC<ClickAwayProviderProps> = ({\n children,\n callback,\n childrenRefs,\n parentRef,\n}) => {\n const parentContext = useContext(ClickAwayAncestorContext);\n const currentContext = useMemo(() => {\n const context: ContextValue = {\n childrenRefs: [],\n /**\n * Add element refs to the current context and propagate to the parent context.\n */\n addRefs(...newChildrenRefs) {\n // Add element refs that should be considered as inside the click away context.\n context.childrenRefs.push(...newChildrenRefs);\n\n if (parentContext) {\n // Also add then to the parent context\n parentContext.addRefs(...newChildrenRefs);\n if (parentRef) {\n // The parent element is also considered as inside the parent click away context but not inside the current context\n parentContext.addRefs(parentRef);\n }\n }\n },\n };\n return context;\n }, [parentContext, parentRef]);\n\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!currentRefs) {\n return;\n }\n currentContext.addRefs(...currentRefs);\n }, [currentContext, childrenRefs]);\n\n useClickAway({ callback, childrenRefs: useRef(currentContext.childrenRefs) });\n return <ClickAwayAncestorContext.Provider value={currentContext}>{children}</ClickAwayAncestorContext.Provider>;\n};\nClickAwayProvider.displayName = 'ClickAwayProvider';\n","import React from 'react';\n\ntype Container = DocumentFragment | Element;\n\n/**\n * Portal initializing function.\n * If it does not provide a container, the Portal children will render in classic React tree and not in a portal.\n */\nexport type PortalInit = () => {\n container?: Container;\n teardown?: () => void;\n};\n\nexport const PortalContext = React.createContext<PortalInit>(() => ({ container: document.body }));\n\nexport interface PortalProviderProps {\n children?: React.ReactNode;\n value: PortalInit;\n}\n\n/**\n * Customize where <Portal> wrapped elements render (tooltip, popover, dialog, etc.)\n */\nexport const PortalProvider: React.FC<PortalProviderProps> = PortalContext.Provider;\n","import React from 'react';\nimport { createPortal } from 'react-dom';\nimport { PortalContext } from './PortalProvider';\n\nexport interface PortalProps {\n enabled?: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Render children in a portal outside the current DOM position\n * (defaults to `document.body` but can be customized with the PortalContextProvider)\n */\nexport const Portal: React.FC<PortalProps> = ({ children, enabled = true }) => {\n const init = React.useContext(PortalContext);\n const context = React.useMemo(\n () => {\n return enabled ? init() : null;\n },\n // Only update on 'enabled'\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [enabled],\n );\n\n React.useLayoutEffect(() => {\n return context?.teardown;\n }, [context?.teardown, enabled]);\n\n if (!context?.container) {\n return <>{children}</>;\n }\n return createPortal(children, context.container);\n};\n","import React, { useContext } from 'react';\n\n/** Disable state */\ntype DisabledStateContextValue =\n | {\n state: 'disabled';\n }\n | { state: undefined | null };\n\nexport const DisabledStateContext = React.createContext<DisabledStateContextValue>({ state: null });\n\nexport type DisabledStateProviderProps = DisabledStateContextValue & {\n children: React.ReactNode;\n};\n\n/**\n * Disabled state provider.\n * All nested LumX Design System components inherit this disabled state.\n */\nexport function DisabledStateProvider({ children, ...value }: DisabledStateProviderProps) {\n return <DisabledStateContext.Provider value={value}>{children}</DisabledStateContext.Provider>;\n}\n\n/**\n * Get DisabledState context value\n */\nexport function useDisabledStateContext(): DisabledStateContextValue {\n return useContext(DisabledStateContext);\n}\n","import { cls } from '@lumx/core/js/utils';\nimport { useMemo } from 'react';\nimport type { KebabCase } from '@lumx/core/js/types';\n\n/**\n * Hook that retrieves several utilities for the classnames feature.\n * @param classname - base component class name\n * @returns utility functions\n */\nexport function useClassnames<C extends string>(classname: KebabCase<C>) {\n return useMemo(() => {\n return {\n /**\n * Returns the BEM class for the given block (and modifier if it is defined)\n *\n * Executing `block()` returns`CLASSNAME`\n *\n * Executing `block('modifier')` returns `CLASSNAME CLASSNAME--modifier`\n *\n * Executing `block({ modifier1: true, modifier2: false })` returns `CLASSNAME CLASSNAME--modifier1`\n *\n * Executing `block(['className'])` returns `CLASSNAME className`\n *\n * @param modifier - string or Record<string, boolean> or list of css classes\n * @param additionalClasses - string | string[] - list of additional classes to be added\n * @returns string\n */\n block: cls.bem.block(classname),\n /**\n * Returns the BEM class for the given element (and modifier if it is defined)\n *\n * Executing `element('element')` returns `CLASSNAME__element`\n *\n * Executing `element('element', 'modifier')` returns `CLASSNAME__element CLASSNAME__element--modifier`\n *\n * Executing `element('element', { modifier1: true, modifier2: false })` returns `CLASSNAME__element CLASSNAME__element--modifier1`\n *\n * Executing `element('element', ['classname'])` returns `CLASSNAME__element` class name\n *\n * @param modifier - string or Record<string, boolean> or list of css classes\n * @param additionalClasses - string | string[] - list of additional classes to be added\n * @returns string\n */\n element: cls.bem.element(classname),\n };\n }, [classname]);\n}\n"],"names":["EVENT_TYPES","isClickAway","targets","refs","some","ref","target","current","contains","useClickAway","callback","childrenRefs","useEffect","currentRefs","isEmpty","undefined","listener","evt","composedPath","forEach","evtType","document","addEventListener","removeEventListener","ClickAwayAncestorContext","createContext","ClickAwayProvider","children","parentRef","parentContext","useContext","currentContext","useMemo","context","addRefs","newChildrenRefs","push","useRef","_jsx","Provider","value","displayName","PortalContext","React","container","body","PortalProvider","Portal","enabled","init","useLayoutEffect","teardown","_Fragment","createPortal","DisabledStateContext","state","DisabledStateProvider","useDisabledStateContext","useClassnames","classname","block","cls","bem","element"],"mappings":";;;;;;AAMA,MAAMA,WAAW,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC;AAE/C,SAASC,WAAWA,CAACC,OAAsB,EAAEC,IAAmC,EAAW;AACvF;EACA,OAAO,CAACA,IAAI,CAACC,IAAI,CAAEC,GAAG,IAAKH,OAAO,CAACE,IAAI,CAAEE,MAAM,IAAKD,GAAG,EAAEE,OAAO,EAAEC,QAAQ,CAACF,MAAM,CAAC,CAAC,CAAC;AACxF;AAaA;AACA;AACA;AACA;AACA;AACO,SAASG,YAAYA,CAAC;EAAEC,QAAQ;AAAEC,EAAAA;AAAkC,CAAC,EAAQ;AAChFC,EAAAA,SAAS,CAAC,MAAM;IACZ,MAAM;AAAEL,MAAAA,OAAO,EAAEM;AAAY,KAAC,GAAGF,YAAY;IAC7C,IAAI,CAACD,QAAQ,IAAI,CAACG,WAAW,IAAIC,OAAO,CAACD,WAAW,CAAC,EAAE;AACnD,MAAA,OAAOE,SAAS;AACpB,IAAA;IACA,MAAMC,QAAuB,GAAIC,GAAG,IAAK;AACrC,MAAA,MAAMf,OAAO,GAAG,CAACe,GAAG,CAACC,YAAY,IAAI,CAAC,CAAC,CAAC,EAAED,GAAG,CAACX,MAAM,CAAkB;AACtE,MAAA,IAAIL,WAAW,CAACC,OAAO,EAAEW,WAAW,CA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1
1
|
import { Kind, HorizontalAlignment, Size, ColorPalette, Emphasis, Alignment, VerticalAlignment, Orientation, ColorWithVariants, ColorVariant, Typography, WhiteSpace, AspectRatio, GlobalSize, TypographyInterface, Theme } from '@lumx/core/js/constants';
|
|
2
2
|
export * from '@lumx/core/js/constants';
|
|
3
3
|
import * as _lumx_core_js_types from '@lumx/core/js/types';
|
|
4
|
-
import { GenericProps, HasTheme, ValueOf, HasCloseMode, TextElement, HeadingElement, Falsy, HasClassName, HasAriaLabelOrLabelledBy } from '@lumx/core/js/types';
|
|
4
|
+
import { GenericProps, HasTheme, ValueOf, HasCloseMode, TextElement, HeadingElement, Falsy, HasClassName, HasAriaLabelOrLabelledBy, LumxClassName } from '@lumx/core/js/types';
|
|
5
5
|
export * from '@lumx/core/js/types';
|
|
6
6
|
import * as React$1 from 'react';
|
|
7
7
|
import React__default, { Ref, ReactElement, ReactNode, SyntheticEvent, MouseEventHandler, KeyboardEventHandler, AriaAttributes, DetailedHTMLProps, ButtonHTMLAttributes, InputHTMLAttributes, RefObject, ImgHTMLAttributes, CSSProperties, SetStateAction, Key, ElementType } from 'react';
|
|
@@ -1925,7 +1925,7 @@ declare const NavigationItem: (<E extends ElementType = "a">(props: React$1.Prop
|
|
|
1925
1925
|
ref?: ComponentRef<E> | undefined;
|
|
1926
1926
|
}) => React$1.JSX.Element) & {
|
|
1927
1927
|
displayName: string;
|
|
1928
|
-
className:
|
|
1928
|
+
className: "lumx-navigation-item";
|
|
1929
1929
|
};
|
|
1930
1930
|
|
|
1931
1931
|
type NavigationProps = React.ComponentProps<'nav'> & HasClassName & HasTheme & {
|
|
@@ -2718,6 +2718,14 @@ interface TableProps extends GenericProps, HasTheme {
|
|
|
2718
2718
|
/** Children */
|
|
2719
2719
|
children?: React.ReactNode;
|
|
2720
2720
|
}
|
|
2721
|
+
/**
|
|
2722
|
+
* Component display name.
|
|
2723
|
+
*/
|
|
2724
|
+
declare const COMPONENT_NAME = "Table";
|
|
2725
|
+
/**
|
|
2726
|
+
* Component default class name and class prefix.
|
|
2727
|
+
*/
|
|
2728
|
+
declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
2721
2729
|
/**
|
|
2722
2730
|
* Table component.
|
|
2723
2731
|
*
|
|
@@ -3152,5 +3160,5 @@ declare const ThemeProvider: React__default.FC<{
|
|
|
3152
3160
|
/** Get the theme in the current context. */
|
|
3153
3161
|
declare function useTheme(): ThemeContextValue;
|
|
3154
3162
|
|
|
3155
|
-
export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonEmphasis, ButtonGroup, Checkbox, Chip, ChipGroup, CommentBlock, CommentBlockVariant, DatePicker, DatePickerControlled, DatePickerField, Dialog, Divider, DragHandle, Dropdown, ExpansionPanel, Flag, FlexBox, GenericBlock, GenericBlockGapSize, Grid, GridColumn, GridItem, Heading, HeadingLevelProvider, Icon, IconButton, ImageBlock, ImageBlockCaptionPosition, ImageLightbox, InlineList, InputHelper, InputLabel, Lightbox, Link, LinkPreview, List, ListDivider, ListItem, ListSubheader, Message, Mosaic, Navigation, Notification, Placement, Popover, PopoverDialog, PostBlock, Progress, ProgressCircular, ProgressLinear, ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressVariant, RadioButton, RadioGroup, Select, SelectMultiple, SelectMultipleField, SelectVariant, SideNavigation, SideNavigationItem, SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography, Slider, Slides, Slideshow, SlideshowControls, SlideshowItem, Switch, Tab, TabList, TabListLayout, TabPanel, TabProvider, Table, TableBody, TableCell, TableCellVariant, TableHeader, TableRow, Text, TextField, ThOrder, ThemeProvider, Thumbnail, ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant, Toolbar, Tooltip, Uploader, UploaderVariant, UserBlock, clamp, isClickable, useFocusPointStyle, useHeadingLevel, useTheme };
|
|
3163
|
+
export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonEmphasis, ButtonGroup, CLASSNAME, Checkbox, Chip, ChipGroup, CommentBlock, CommentBlockVariant, DatePicker, DatePickerControlled, DatePickerField, Dialog, Divider, DragHandle, Dropdown, ExpansionPanel, Flag, FlexBox, GenericBlock, GenericBlockGapSize, Grid, GridColumn, GridItem, Heading, HeadingLevelProvider, Icon, IconButton, ImageBlock, ImageBlockCaptionPosition, ImageLightbox, InlineList, InputHelper, InputLabel, Lightbox, Link, LinkPreview, List, ListDivider, ListItem, ListSubheader, Message, Mosaic, Navigation, Notification, Placement, Popover, PopoverDialog, PostBlock, Progress, ProgressCircular, ProgressLinear, ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressVariant, RadioButton, RadioGroup, Select, SelectMultiple, SelectMultipleField, SelectVariant, SideNavigation, SideNavigationItem, SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography, Slider, Slides, Slideshow, SlideshowControls, SlideshowItem, Switch, Tab, TabList, TabListLayout, TabPanel, TabProvider, Table, TableBody, TableCell, TableCellVariant, TableHeader, TableRow, Text, TextField, ThOrder, ThemeProvider, Thumbnail, ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant, Toolbar, Tooltip, Uploader, UploaderVariant, UserBlock, clamp, isClickable, useFocusPointStyle, useHeadingLevel, useTheme };
|
|
3156
3164
|
export type { AlertDialogProps, AutocompleteMultipleProps, AutocompleteProps, AvatarProps, AvatarSize, BadgeProps, BadgeWrapperProps, BaseButtonProps, ButtonGroupProps, ButtonProps, ButtonSize, CheckboxProps, ChipGroupProps, ChipProps, CommentBlockProps, DatePickerControlledProps, DatePickerFieldProps, DatePickerProps, DialogProps, DialogSizes, DividerProps, DragHandleProps, DropdownProps, Elevation, ExpansionPanelProps, FlagProps, FlexBoxProps, FlexHorizontalAlignment, FlexVerticalAlignment, FocusPoint, GapSize, GenericBlockProps, GridColumnGapSize, GridColumnProps, GridItemProps, GridProps, HeadingLevelProviderProps, HeadingProps, IconButtonProps, IconProps, IconSizes, ImageBlockProps, ImageBlockSize, ImageLightboxProps, InlineListProps, InputHelperProps, InputLabelProps, LightboxProps, LinkPreviewProps, LinkProps, ListDividerProps, ListItemProps, ListItemSize, ListProps, ListSubheaderProps, MarginAutoAlignment, MessageProps, MosaicProps, NavigationProps, NotificationProps, Offset, PopoverDialogProps, PopoverProps, PostBlockProps, ProgressCircularProps, ProgressCircularSize, ProgressLinearProps, ProgressProps, ProgressTrackerProps, ProgressTrackerProviderProps, ProgressTrackerStepPanelProps, ProgressTrackerStepProps, RadioButtonProps, RadioGroupProps, SelectMultipleProps, SelectProps, SideNavigationItemProps, SideNavigationProps, SkeletonCircleProps, SkeletonRectangleProps, SkeletonTypographyProps, SliderProps, SlidesProps, SlideshowControlsProps, SlideshowItemProps, SlideshowProps, SwitchProps, TabListProps, TabPanelProps, TabProps, TabProviderProps, TableBodyProps, TableCellProps, TableHeaderProps, TableProps, TableRowProps, TextFieldProps, TextProps, ThumbnailProps, ThumbnailSize, ToolbarProps, TooltipPlacement, TooltipProps, UploaderProps, UploaderSize, UserBlockProps, UserBlockSize };
|