@lumx/react 4.2.0 → 4.2.1-alpha.1
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/index.d.ts +74 -42
- package/index.js +1284 -877
- package/index.js.map +1 -1
- package/package.json +5 -4
- package/utils/index.d.ts +64 -3
- package/utils/index.js +89 -3
- package/utils/index.js.map +1 -1
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Kind as Kind$1, HorizontalAlignment, Size as Size$1, ColorPalette as ColorPalette$1,
|
|
1
|
+
import { Kind as Kind$1, HorizontalAlignment as HorizontalAlignment$1, Size as Size$1, ColorPalette as ColorPalette$1, Orientation as Orientation$1, Alignment as Alignment$1, AspectRatio, ColorWithVariants as ColorWithVariants$1, ColorVariant as ColorVariant$1, Typography as Typography$1, Emphasis as Emphasis$1, GlobalSize, TypographyInterface as TypographyInterface$1, Theme as Theme$1 } 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 as GenericProps$1, HasTheme as HasTheme$1, ValueOf, HasAriaDisabled as HasAriaDisabled$1, HasCloseMode,
|
|
4
|
+
import { GenericProps as GenericProps$1, HasTheme as HasTheme$1, ValueOf, HasAriaDisabled as HasAriaDisabled$1, HasCloseMode, Falsy, HasClassName as HasClassName$1, HeadingElement as HeadingElement$1, HasRequiredLinkHref, HasAriaLabelOrLabelledBy } 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, InputHTMLAttributes, RefObject, ImgHTMLAttributes, CSSProperties, SetStateAction, Key, ElementType, ComponentProps } from 'react';
|
|
@@ -241,7 +241,7 @@ interface AutocompleteMultipleProps extends AutocompleteProps {
|
|
|
241
241
|
/** Selected values. */
|
|
242
242
|
values: any[];
|
|
243
243
|
/** Alignment of the chips in the autocomplete. */
|
|
244
|
-
chipsAlignment?: HorizontalAlignment;
|
|
244
|
+
chipsAlignment?: HorizontalAlignment$1;
|
|
245
245
|
/** Selected value render function. Default: Renders the value inside of a Chip. */
|
|
246
246
|
selectedChipRender(choice: any, index: number, onClear?: (event: React.MouseEvent, val: any) => void, isDisabled?: boolean): ReactNode | string;
|
|
247
247
|
}
|
|
@@ -318,6 +318,24 @@ interface BadgeWrapperProps extends GenericProps$1 {
|
|
|
318
318
|
}
|
|
319
319
|
declare const BadgeWrapper: Comp<BadgeWrapperProps, HTMLDivElement>;
|
|
320
320
|
|
|
321
|
+
/**
|
|
322
|
+
* Alignments.
|
|
323
|
+
*/
|
|
324
|
+
declare const Alignment: {
|
|
325
|
+
readonly bottom: "bottom";
|
|
326
|
+
readonly center: "center";
|
|
327
|
+
readonly end: "end";
|
|
328
|
+
readonly left: "left";
|
|
329
|
+
readonly right: "right";
|
|
330
|
+
readonly spaceAround: "space-around";
|
|
331
|
+
readonly spaceBetween: "space-between";
|
|
332
|
+
readonly spaceEvenly: "space-evenly";
|
|
333
|
+
readonly start: "start";
|
|
334
|
+
readonly top: "top";
|
|
335
|
+
};
|
|
336
|
+
type Alignment = ValueOf<typeof Alignment>;
|
|
337
|
+
type VerticalAlignment = Extract<Alignment, 'top' | 'center' | 'bottom'>;
|
|
338
|
+
type HorizontalAlignment = Extract<Alignment, 'right' | 'center' | 'left'>;
|
|
321
339
|
declare const Theme: {
|
|
322
340
|
readonly light: "light";
|
|
323
341
|
readonly dark: "dark";
|
|
@@ -338,6 +356,11 @@ declare const Size: {
|
|
|
338
356
|
readonly huge: "huge";
|
|
339
357
|
};
|
|
340
358
|
type Size = ValueOf<typeof Size>;
|
|
359
|
+
declare const Orientation: {
|
|
360
|
+
readonly horizontal: "horizontal";
|
|
361
|
+
readonly vertical: "vertical";
|
|
362
|
+
};
|
|
363
|
+
type Orientation = ValueOf<typeof Orientation>;
|
|
341
364
|
declare const Emphasis: {
|
|
342
365
|
readonly low: "low";
|
|
343
366
|
readonly medium: "medium";
|
|
@@ -531,7 +554,7 @@ interface BaseButtonProps extends GenericProps, Pick<AriaAttributes, 'aria-expan
|
|
|
531
554
|
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
532
555
|
/** Native button type. */
|
|
533
556
|
type?: 'submit' | 'reset' | 'button' | undefined;
|
|
534
|
-
/** Custom
|
|
557
|
+
/** Custom component for the link (can be used to inject router Link). */
|
|
535
558
|
linkAs?: 'a' | any;
|
|
536
559
|
}
|
|
537
560
|
|
|
@@ -622,7 +645,7 @@ interface ButtonGroupProps extends GenericProps {
|
|
|
622
645
|
/**
|
|
623
646
|
* Children
|
|
624
647
|
*/
|
|
625
|
-
children?:
|
|
648
|
+
children?: JSXElement;
|
|
626
649
|
}
|
|
627
650
|
|
|
628
651
|
/**
|
|
@@ -726,7 +749,7 @@ interface ChipGroupProps extends GenericProps$1 {
|
|
|
726
749
|
* Chip horizontal alignment.
|
|
727
750
|
* @deprecated
|
|
728
751
|
*/
|
|
729
|
-
align?: HorizontalAlignment;
|
|
752
|
+
align?: HorizontalAlignment$1;
|
|
730
753
|
/** List of Chip. */
|
|
731
754
|
children: ReactNode;
|
|
732
755
|
}
|
|
@@ -1179,16 +1202,20 @@ interface ExpansionPanelProps extends GenericProps$1, HasCloseMode, HasTheme$1 {
|
|
|
1179
1202
|
*/
|
|
1180
1203
|
declare const ExpansionPanel: Comp<ExpansionPanelProps, HTMLDivElement>;
|
|
1181
1204
|
|
|
1182
|
-
interface FlagProps extends GenericProps
|
|
1205
|
+
interface FlagProps$1 extends GenericProps, HasTheme {
|
|
1183
1206
|
/** Color of the component. */
|
|
1184
|
-
color?: ColorPalette
|
|
1207
|
+
color?: ColorPalette;
|
|
1185
1208
|
/** Icon to use before the label. */
|
|
1186
1209
|
icon?: string;
|
|
1187
1210
|
/** Text label of the flag. */
|
|
1188
|
-
|
|
1211
|
+
children: JSXElement;
|
|
1189
1212
|
/** Enable text truncate on overflow */
|
|
1190
1213
|
truncate?: boolean;
|
|
1191
1214
|
}
|
|
1215
|
+
|
|
1216
|
+
interface FlagProps extends Omit<FlagProps$1, 'children'> {
|
|
1217
|
+
label: React.ReactNode;
|
|
1218
|
+
}
|
|
1192
1219
|
/**
|
|
1193
1220
|
* Flag component.
|
|
1194
1221
|
*
|
|
@@ -1199,18 +1226,17 @@ interface FlagProps extends GenericProps$1, HasTheme$1 {
|
|
|
1199
1226
|
declare const Flag: Comp<FlagProps, HTMLDivElement>;
|
|
1200
1227
|
|
|
1201
1228
|
type MarginAutoAlignment = Extract<Alignment, 'top' | 'bottom' | 'right' | 'left'>;
|
|
1202
|
-
type GapSize = Extract<Size
|
|
1229
|
+
type GapSize = Extract<Size, 'tiny' | 'regular' | 'medium' | 'big' | 'huge'>;
|
|
1203
1230
|
type SpaceAlignment = Extract<Alignment, 'space-between' | 'space-evenly' | 'space-around'>;
|
|
1204
1231
|
type FlexVerticalAlignment = VerticalAlignment | SpaceAlignment;
|
|
1205
1232
|
type FlexHorizontalAlignment = HorizontalAlignment | SpaceAlignment;
|
|
1233
|
+
|
|
1206
1234
|
/**
|
|
1207
1235
|
* Defines the props of the component.
|
|
1208
1236
|
*/
|
|
1209
|
-
interface FlexBoxProps extends GenericProps
|
|
1210
|
-
/** Customize the root element. */
|
|
1211
|
-
as?: React.ElementType;
|
|
1237
|
+
interface FlexBoxProps$1 extends GenericProps {
|
|
1212
1238
|
/** Children elements. */
|
|
1213
|
-
children?:
|
|
1239
|
+
children?: JSXElement;
|
|
1214
1240
|
/** Whether the "content filling space" is enabled or not. */
|
|
1215
1241
|
fillSpace?: boolean;
|
|
1216
1242
|
/** Gap space between flexbox items. */
|
|
@@ -1228,6 +1254,14 @@ interface FlexBoxProps extends GenericProps$1 {
|
|
|
1228
1254
|
/** Whether the "flex wrap" is enabled or not. */
|
|
1229
1255
|
wrap?: boolean;
|
|
1230
1256
|
}
|
|
1257
|
+
|
|
1258
|
+
/**
|
|
1259
|
+
* Defines the props of the component.
|
|
1260
|
+
*/
|
|
1261
|
+
interface FlexBoxProps extends FlexBoxProps$1 {
|
|
1262
|
+
/** Customize the root element. */
|
|
1263
|
+
as?: React__default.ElementType;
|
|
1264
|
+
}
|
|
1231
1265
|
/**
|
|
1232
1266
|
* FlexBox component.
|
|
1233
1267
|
*
|
|
@@ -1383,15 +1417,6 @@ interface TextProps extends GenericProps {
|
|
|
1383
1417
|
children?: JSXElement;
|
|
1384
1418
|
}
|
|
1385
1419
|
|
|
1386
|
-
/**
|
|
1387
|
-
* Text component.
|
|
1388
|
-
*
|
|
1389
|
-
* @param props Component props.
|
|
1390
|
-
* @param ref Component ref.
|
|
1391
|
-
* @return React element.
|
|
1392
|
-
*/
|
|
1393
|
-
declare const Text: Comp<TextProps, HTMLElement>;
|
|
1394
|
-
|
|
1395
1420
|
/**
|
|
1396
1421
|
* Defines the props of the component.
|
|
1397
1422
|
*/
|
|
@@ -1399,12 +1424,9 @@ interface HeadingProps extends Partial<TextProps> {
|
|
|
1399
1424
|
/**
|
|
1400
1425
|
* Display a specific heading level instead of the one provided by parent context provider.
|
|
1401
1426
|
*/
|
|
1402
|
-
as?: HeadingElement
|
|
1403
|
-
/**
|
|
1404
|
-
* Children
|
|
1405
|
-
*/
|
|
1406
|
-
children?: React.ReactNode;
|
|
1427
|
+
as?: HeadingElement;
|
|
1407
1428
|
}
|
|
1429
|
+
|
|
1408
1430
|
/**
|
|
1409
1431
|
* Renders a heading component.
|
|
1410
1432
|
* Extends the `Text` Component with the heading level automatically computed based on
|
|
@@ -1434,13 +1456,13 @@ type GridGutterSize = Extract<Size$1, 'regular' | 'big' | 'huge'>;
|
|
|
1434
1456
|
*/
|
|
1435
1457
|
interface GridProps extends GenericProps$1 {
|
|
1436
1458
|
/** Orientation. */
|
|
1437
|
-
orientation?: Orientation;
|
|
1459
|
+
orientation?: Orientation$1;
|
|
1438
1460
|
/** Whether the children are wrapped or not. */
|
|
1439
1461
|
wrap?: string;
|
|
1440
1462
|
/** Vertical alignment. */
|
|
1441
|
-
vAlign?: Alignment;
|
|
1463
|
+
vAlign?: Alignment$1;
|
|
1442
1464
|
/** Horizontal alignment. */
|
|
1443
|
-
hAlign?: Alignment;
|
|
1465
|
+
hAlign?: Alignment$1;
|
|
1444
1466
|
/** Gutter size. */
|
|
1445
1467
|
gutter?: GridGutterSize;
|
|
1446
1468
|
/** Children */
|
|
@@ -1461,7 +1483,7 @@ type Columns = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11'
|
|
|
1461
1483
|
*/
|
|
1462
1484
|
interface GridItemProps extends GenericProps$1 {
|
|
1463
1485
|
/** Alignment. */
|
|
1464
|
-
align?: Alignment;
|
|
1486
|
+
align?: Alignment$1;
|
|
1465
1487
|
/** Order. */
|
|
1466
1488
|
order?: Columns;
|
|
1467
1489
|
/** Width. */
|
|
@@ -1589,7 +1611,7 @@ type ImgHTMLProps = ImgHTMLAttributes<HTMLImageElement>;
|
|
|
1589
1611
|
*/
|
|
1590
1612
|
interface ThumbnailProps extends GenericProps$1, HasTheme$1 {
|
|
1591
1613
|
/** Alignment of the thumbnail in it's parent (requires flex parent). */
|
|
1592
|
-
align?: HorizontalAlignment;
|
|
1614
|
+
align?: HorizontalAlignment$1;
|
|
1593
1615
|
/** Image alternative text. */
|
|
1594
1616
|
alt: string;
|
|
1595
1617
|
/** Image aspect ratio. */
|
|
@@ -1677,7 +1699,7 @@ interface ImageBlockProps extends GenericProps$1, HasTheme$1, ImageCaptionMetada
|
|
|
1677
1699
|
/** Action toolbar content. */
|
|
1678
1700
|
actions?: ReactNode;
|
|
1679
1701
|
/** Alignment. */
|
|
1680
|
-
align?: HorizontalAlignment;
|
|
1702
|
+
align?: HorizontalAlignment$1;
|
|
1681
1703
|
/** Image alternative text. */
|
|
1682
1704
|
alt: string;
|
|
1683
1705
|
/** Caption position. */
|
|
@@ -2053,13 +2075,13 @@ declare const ListSubheader: Comp<ListSubheaderProps, HTMLLIElement>;
|
|
|
2053
2075
|
/**
|
|
2054
2076
|
* Defines the props of the component.
|
|
2055
2077
|
*/
|
|
2056
|
-
interface MessageProps extends GenericProps
|
|
2078
|
+
interface MessageProps extends GenericProps {
|
|
2057
2079
|
/** Content. */
|
|
2058
|
-
children?:
|
|
2080
|
+
children?: JSXElement;
|
|
2059
2081
|
/** Whether the message has a background or not. */
|
|
2060
2082
|
hasBackground?: boolean;
|
|
2061
2083
|
/** Message variant. */
|
|
2062
|
-
kind?: Kind
|
|
2084
|
+
kind?: Kind;
|
|
2063
2085
|
/** Message custom icon SVG path. */
|
|
2064
2086
|
icon?: string;
|
|
2065
2087
|
/**
|
|
@@ -2074,6 +2096,7 @@ interface MessageProps extends GenericProps$1 {
|
|
|
2074
2096
|
label: string;
|
|
2075
2097
|
};
|
|
2076
2098
|
}
|
|
2099
|
+
|
|
2077
2100
|
/**
|
|
2078
2101
|
* Message component.
|
|
2079
2102
|
*
|
|
@@ -2131,7 +2154,7 @@ declare const NavigationItem: (<E extends ElementType = "a">(props: React$1.Prop
|
|
|
2131
2154
|
type NavigationProps = React.ComponentProps<'nav'> & HasClassName$1 & HasTheme$1 & {
|
|
2132
2155
|
/** Content of the navigation. These components should be of type NavigationItem to be rendered */
|
|
2133
2156
|
children?: React.ReactNode;
|
|
2134
|
-
orientation?: Orientation;
|
|
2157
|
+
orientation?: Orientation$1;
|
|
2135
2158
|
} & HasAriaLabelOrLabelledBy;
|
|
2136
2159
|
type SubComponents = {
|
|
2137
2160
|
Section: typeof NavigationSection;
|
|
@@ -2196,7 +2219,7 @@ interface PostBlockProps extends GenericProps$1, HasTheme$1 {
|
|
|
2196
2219
|
/** Metadata content. */
|
|
2197
2220
|
meta?: ReactNode;
|
|
2198
2221
|
/** Orientation. */
|
|
2199
|
-
orientation?: Orientation;
|
|
2222
|
+
orientation?: Orientation$1;
|
|
2200
2223
|
/** Tag content. */
|
|
2201
2224
|
tags?: ReactNode;
|
|
2202
2225
|
/** Content (string, or sanitized html). */
|
|
@@ -2905,7 +2928,7 @@ interface SwitchProps extends GenericProps$1, HasTheme$1, HasAriaDisabled$1 {
|
|
|
2905
2928
|
/** Native input name property. */
|
|
2906
2929
|
name?: string;
|
|
2907
2930
|
/** Position of the switch relative to the label. */
|
|
2908
|
-
position?: Extract<Alignment, 'right' | 'left'>;
|
|
2931
|
+
position?: Extract<Alignment$1, 'right' | 'left'>;
|
|
2909
2932
|
/** Native input value property. */
|
|
2910
2933
|
value?: string;
|
|
2911
2934
|
/** On change callback. */
|
|
@@ -3078,7 +3101,7 @@ interface TabListProps extends GenericProps$1, HasTheme$1 {
|
|
|
3078
3101
|
/** Layout of the tabs in the list. */
|
|
3079
3102
|
layout?: TabListLayout;
|
|
3080
3103
|
/** Position of the tabs in the list (requires 'clustered' layout). */
|
|
3081
|
-
position?: Alignment;
|
|
3104
|
+
position?: Alignment$1;
|
|
3082
3105
|
}
|
|
3083
3106
|
/**
|
|
3084
3107
|
* TabList component.
|
|
@@ -3143,6 +3166,15 @@ interface TabPanelProps extends GenericProps$1 {
|
|
|
3143
3166
|
*/
|
|
3144
3167
|
declare const TabPanel: Comp<TabPanelProps, HTMLDivElement>;
|
|
3145
3168
|
|
|
3169
|
+
/**
|
|
3170
|
+
* Text component.
|
|
3171
|
+
*
|
|
3172
|
+
* @param props Component props.
|
|
3173
|
+
* @param ref Component ref.
|
|
3174
|
+
* @return React element.
|
|
3175
|
+
*/
|
|
3176
|
+
declare const Text: Comp<TextProps, HTMLElement>;
|
|
3177
|
+
|
|
3146
3178
|
/**
|
|
3147
3179
|
* Defines the props of the component.
|
|
3148
3180
|
*/
|
|
@@ -3364,7 +3396,7 @@ interface UserBlockProps extends GenericProps$1, HasTheme$1 {
|
|
|
3364
3396
|
/** Props to pass to the name block. */
|
|
3365
3397
|
nameProps?: GenericProps$1;
|
|
3366
3398
|
/** Orientation. */
|
|
3367
|
-
orientation?: Orientation;
|
|
3399
|
+
orientation?: Orientation$1;
|
|
3368
3400
|
/** Simple action toolbar content. */
|
|
3369
3401
|
simpleAction?: ReactNode;
|
|
3370
3402
|
/** Size variant. */
|