@itwin/itwinui-react 3.0.0-dev.7 → 3.0.0-dev.8
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/CHANGELOG.md +56 -0
- package/cjs/core/Alert/Alert.d.ts +20 -9
- package/cjs/core/Alert/Alert.js +48 -10
- package/cjs/core/ButtonGroup/ButtonGroup.js +41 -36
- package/cjs/core/Buttons/IconButton/IconButton.js +27 -44
- package/cjs/core/Buttons/SplitButton/SplitButton.js +3 -0
- package/cjs/core/ColorPicker/ColorInputPanel.js +172 -231
- package/cjs/core/ComboBox/ComboBox.js +3 -3
- package/cjs/core/ComboBox/ComboBoxDropdown.js +4 -9
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +3 -22
- package/cjs/core/ComboBox/ComboBoxMenu.d.ts +2 -2
- package/cjs/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +8 -6
- package/cjs/core/ComboBox/helpers.d.ts +1 -2
- package/cjs/core/DatePicker/DatePicker.d.ts +30 -8
- package/cjs/core/DatePicker/DatePicker.js +40 -5
- package/cjs/core/Dialog/Dialog.js +10 -16
- package/cjs/core/Dialog/DialogContext.d.ts +3 -4
- package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +20 -14
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +38 -15
- package/cjs/core/Header/HeaderSplitButton.js +1 -0
- package/cjs/core/Input/Input.d.ts +4 -0
- package/cjs/core/Input/Input.js +2 -1
- package/cjs/core/InputGrid/InputGrid.d.ts +25 -0
- package/cjs/core/InputGrid/InputGrid.js +39 -0
- package/cjs/core/InputGrid/index.d.ts +3 -0
- package/cjs/core/InputGrid/index.js +15 -0
- package/cjs/core/InputGroup/InputGroup.d.ts +13 -0
- package/cjs/core/InputGroup/InputGroup.js +35 -9
- package/cjs/core/InputWithDecorations/InputWithDecorations.d.ts +39 -0
- package/cjs/core/InputWithDecorations/InputWithDecorations.js +81 -0
- package/cjs/core/InputWithDecorations/index.d.ts +3 -0
- package/cjs/core/InputWithDecorations/index.js +15 -0
- package/cjs/core/Label/Label.d.ts +5 -0
- package/cjs/core/Label/Label.js +2 -0
- package/cjs/core/LabeledInput/LabeledInput.d.ts +22 -16
- package/cjs/core/LabeledInput/LabeledInput.js +52 -29
- package/cjs/core/LabeledSelect/LabeledSelect.d.ts +17 -7
- package/cjs/core/LabeledSelect/LabeledSelect.js +36 -17
- package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +15 -5
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +12 -45
- package/cjs/core/Menu/Menu.d.ts +1 -1
- package/cjs/core/Menu/Menu.js +1 -1
- package/cjs/core/Menu/MenuDivider.d.ts +2 -1
- package/cjs/core/Menu/MenuDivider.js +1 -1
- package/cjs/core/Menu/MenuItem.d.ts +1 -1
- package/cjs/core/Menu/MenuItem.js +1 -0
- package/cjs/core/Menu/MenuItemSkeleton.d.ts +1 -1
- package/cjs/core/Menu/MenuItemSkeleton.js +0 -1
- package/cjs/core/SearchBox/SearchBox.js +1 -1
- package/cjs/core/Select/Select.d.ts +4 -0
- package/cjs/core/Select/Select.js +10 -9
- package/cjs/core/SideNavigation/SideNavigation.js +2 -0
- package/cjs/core/Slider/Thumb.js +1 -0
- package/cjs/core/StatusMessage/StatusMessage.d.ts +12 -2
- package/cjs/core/StatusMessage/StatusMessage.js +23 -9
- package/cjs/core/Table/SubRowExpander.js +2 -0
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +6 -1
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +46 -18
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +2 -0
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -0
- package/cjs/core/Textarea/Textarea.d.ts +7 -1
- package/cjs/core/Textarea/Textarea.js +6 -11
- package/cjs/core/ThemeProvider/ThemeProvider.js +1 -1
- package/cjs/core/Tile/Tile.d.ts +139 -15
- package/cjs/core/Tile/Tile.js +107 -16
- package/cjs/core/Toast/Toast.d.ts +12 -4
- package/cjs/core/Toast/Toast.js +20 -4
- package/cjs/core/Tooltip/Tooltip.d.ts +35 -28
- package/cjs/core/Tooltip/Tooltip.js +116 -117
- package/cjs/core/TransferList/TransferList.js +4 -12
- package/cjs/core/index.d.ts +2 -0
- package/cjs/core/index.js +20 -4
- package/cjs/core/utils/components/Icon.d.ts +5 -0
- package/cjs/core/utils/components/Icon.js +8 -1
- package/cjs/core/utils/components/InputContainer.d.ts +0 -1
- package/cjs/core/utils/components/InputContainer.js +14 -34
- package/cjs/core/utils/components/InputFlexContainer.d.ts +1 -0
- package/cjs/core/utils/components/InputFlexContainer.js +3 -1
- package/cjs/core/utils/components/Portal.d.ts +27 -0
- package/cjs/core/utils/components/Portal.js +43 -0
- package/cjs/core/utils/components/index.d.ts +1 -0
- package/cjs/core/utils/components/index.js +1 -0
- package/cjs/core/utils/functions/index.d.ts +1 -0
- package/cjs/core/utils/functions/index.js +1 -0
- package/cjs/core/utils/functions/react.d.ts +8 -0
- package/cjs/core/utils/functions/react.js +40 -0
- package/cjs/core/utils/hooks/index.d.ts +1 -1
- package/cjs/core/utils/hooks/index.js +1 -1
- package/cjs/core/utils/hooks/useControlledState.d.ts +13 -0
- package/cjs/core/utils/hooks/useControlledState.js +39 -0
- package/cjs/styles.js +10 -28
- package/esm/core/Alert/Alert.d.ts +20 -9
- package/esm/core/Alert/Alert.js +49 -10
- package/esm/core/ButtonGroup/ButtonGroup.js +41 -36
- package/esm/core/Buttons/IconButton/IconButton.js +25 -40
- package/esm/core/Buttons/SplitButton/SplitButton.js +9 -1
- package/esm/core/ColorPicker/ColorInputPanel.js +173 -232
- package/esm/core/ComboBox/ComboBox.js +3 -3
- package/esm/core/ComboBox/ComboBoxDropdown.js +4 -9
- package/esm/core/ComboBox/ComboBoxEndIcon.js +4 -25
- package/esm/core/ComboBox/ComboBoxMenu.d.ts +2 -2
- package/esm/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxMenuItem.js +9 -7
- package/esm/core/ComboBox/helpers.d.ts +1 -2
- package/esm/core/DatePicker/DatePicker.d.ts +30 -8
- package/esm/core/DatePicker/DatePicker.js +25 -5
- package/esm/core/Dialog/Dialog.js +11 -23
- package/esm/core/Dialog/DialogContext.d.ts +3 -4
- package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +20 -14
- package/esm/core/ExpandableBlock/ExpandableBlock.js +39 -17
- package/esm/core/Header/HeaderSplitButton.js +1 -0
- package/esm/core/Input/Input.d.ts +4 -0
- package/esm/core/Input/Input.js +2 -1
- package/esm/core/InputGrid/InputGrid.d.ts +25 -0
- package/esm/core/InputGrid/InputGrid.js +35 -0
- package/esm/core/InputGrid/index.d.ts +3 -0
- package/esm/core/InputGrid/index.js +6 -0
- package/esm/core/InputGroup/InputGroup.d.ts +13 -0
- package/esm/core/InputGroup/InputGroup.js +34 -10
- package/esm/core/InputWithDecorations/InputWithDecorations.d.ts +39 -0
- package/esm/core/InputWithDecorations/InputWithDecorations.js +80 -0
- package/esm/core/InputWithDecorations/index.d.ts +3 -0
- package/esm/core/InputWithDecorations/index.js +6 -0
- package/esm/core/Label/Label.d.ts +5 -0
- package/esm/core/Label/Label.js +2 -0
- package/esm/core/LabeledInput/LabeledInput.d.ts +22 -16
- package/esm/core/LabeledInput/LabeledInput.js +53 -29
- package/esm/core/LabeledSelect/LabeledSelect.d.ts +17 -7
- package/esm/core/LabeledSelect/LabeledSelect.js +37 -18
- package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +15 -5
- package/esm/core/LabeledTextarea/LabeledTextarea.js +14 -45
- package/esm/core/Menu/Menu.d.ts +1 -1
- package/esm/core/Menu/Menu.js +1 -1
- package/esm/core/Menu/MenuDivider.d.ts +2 -1
- package/esm/core/Menu/MenuDivider.js +1 -1
- package/esm/core/Menu/MenuItem.d.ts +1 -1
- package/esm/core/Menu/MenuItem.js +1 -0
- package/esm/core/Menu/MenuItemSkeleton.d.ts +1 -1
- package/esm/core/Menu/MenuItemSkeleton.js +0 -1
- package/esm/core/SearchBox/SearchBox.js +1 -1
- package/esm/core/Select/Select.d.ts +4 -0
- package/esm/core/Select/Select.js +10 -9
- package/esm/core/SideNavigation/SideNavigation.js +2 -0
- package/esm/core/Slider/Thumb.js +1 -0
- package/esm/core/StatusMessage/StatusMessage.d.ts +12 -2
- package/esm/core/StatusMessage/StatusMessage.js +23 -16
- package/esm/core/Table/SubRowExpander.js +2 -0
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +6 -1
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +45 -17
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +2 -0
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -0
- package/esm/core/Textarea/Textarea.d.ts +7 -1
- package/esm/core/Textarea/Textarea.js +6 -11
- package/esm/core/ThemeProvider/ThemeProvider.js +4 -3
- package/esm/core/Tile/Tile.d.ts +139 -15
- package/esm/core/Tile/Tile.js +107 -16
- package/esm/core/Toast/Toast.d.ts +12 -4
- package/esm/core/Toast/Toast.js +21 -4
- package/esm/core/Tooltip/Tooltip.d.ts +35 -28
- package/esm/core/Tooltip/Tooltip.js +119 -116
- package/esm/core/TransferList/TransferList.js +4 -9
- package/esm/core/index.d.ts +2 -0
- package/esm/core/index.js +2 -0
- package/esm/core/utils/components/Icon.d.ts +5 -0
- package/esm/core/utils/components/Icon.js +8 -1
- package/esm/core/utils/components/InputContainer.d.ts +0 -1
- package/esm/core/utils/components/InputContainer.js +14 -30
- package/esm/core/utils/components/InputFlexContainer.d.ts +1 -0
- package/esm/core/utils/components/InputFlexContainer.js +3 -1
- package/esm/core/utils/components/Portal.d.ts +27 -0
- package/esm/core/utils/components/Portal.js +36 -0
- package/esm/core/utils/components/index.d.ts +1 -0
- package/esm/core/utils/components/index.js +1 -0
- package/esm/core/utils/functions/index.d.ts +1 -0
- package/esm/core/utils/functions/index.js +1 -0
- package/esm/core/utils/functions/react.d.ts +8 -0
- package/esm/core/utils/functions/react.js +35 -0
- package/esm/core/utils/hooks/index.d.ts +1 -1
- package/esm/core/utils/hooks/index.js +1 -1
- package/esm/core/utils/hooks/useControlledState.d.ts +13 -0
- package/esm/core/utils/hooks/useControlledState.js +34 -0
- package/esm/styles.js +10 -28
- package/package.json +3 -3
- package/styles.css +22 -19
- package/cjs/core/utils/hooks/useUncontrolledState.d.ts +0 -6
- package/cjs/core/utils/hooks/useUncontrolledState.js +0 -18
- package/esm/core/utils/hooks/useUncontrolledState.d.ts +0 -6
- package/esm/core/utils/hooks/useUncontrolledState.js +0 -13
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
2
3
|
import type { TimePickerProps } from '../TimePicker/TimePicker.js';
|
|
4
|
+
export type DatePickerLocalizedNames = {
|
|
5
|
+
[key in 'months' | 'shortDays' | 'days']: string[];
|
|
6
|
+
};
|
|
3
7
|
/**
|
|
4
8
|
* Generate localized months and days strings using `Intl.DateTimeFormat` for passed locale to use in DatePicker component.
|
|
5
9
|
* If locale is not passed, browser locale will be used.
|
|
6
10
|
*/
|
|
7
|
-
export declare const generateLocalizedStrings: (locale?: string) =>
|
|
8
|
-
months: string[];
|
|
9
|
-
shortDays: string[];
|
|
10
|
-
days: string[];
|
|
11
|
-
};
|
|
11
|
+
export declare const generateLocalizedStrings: (locale?: string) => DatePickerLocalizedNames;
|
|
12
12
|
export type DateRangePickerProps = {
|
|
13
13
|
/**
|
|
14
14
|
* Enable date range support.
|
|
@@ -42,9 +42,7 @@ type DatePickerProps = {
|
|
|
42
42
|
* Pass localized week days (start from sunday) and months.
|
|
43
43
|
* Use helper function `generateLocalizedStrings` to generate strings using `Intl.DateTimeFormat`.
|
|
44
44
|
*/
|
|
45
|
-
localizedNames?:
|
|
46
|
-
[key in 'months' | 'shortDays' | 'days']: string[];
|
|
47
|
-
};
|
|
45
|
+
localizedNames?: DatePickerLocalizedNames;
|
|
48
46
|
/**
|
|
49
47
|
* Set focus on selected day or today.
|
|
50
48
|
* @default false
|
|
@@ -60,6 +58,30 @@ type DatePickerProps = {
|
|
|
60
58
|
* @default false
|
|
61
59
|
*/
|
|
62
60
|
showYearSelection?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Allows props to be passed for calendar month year, referring to the div that wraps around the month/year and the next/previous buttons.
|
|
63
|
+
*/
|
|
64
|
+
monthYearProps?: React.ComponentProps<'div'>;
|
|
65
|
+
/**
|
|
66
|
+
* Allows props to be passed for only month, referring to span that wraps around the month title.
|
|
67
|
+
*/
|
|
68
|
+
monthProps?: React.ComponentProps<'span'>;
|
|
69
|
+
/**
|
|
70
|
+
* Allows props to be passed for week days, referring to div that wraps around the week day title.
|
|
71
|
+
*/
|
|
72
|
+
weekDayProps?: React.ComponentProps<'div'>;
|
|
73
|
+
/**
|
|
74
|
+
* Allows props to be passed for individual day , referring to div element the wraps around single day number.
|
|
75
|
+
*/
|
|
76
|
+
dayProps?: React.ComponentProps<'div'>;
|
|
77
|
+
/**
|
|
78
|
+
* Allows props to be passed for calendar, referring to div that is used for listbox for wraping days and weeks.
|
|
79
|
+
*/
|
|
80
|
+
calendarProps?: React.ComponentProps<'div'>;
|
|
81
|
+
/**
|
|
82
|
+
* Allows props to be passed for weeks, referring to div that wraps around weeks.
|
|
83
|
+
*/
|
|
84
|
+
weekProps?: React.ComponentProps<'div'>;
|
|
63
85
|
/**
|
|
64
86
|
* Will disable dates for which this function returns true.
|
|
65
87
|
* Disabled dates cannot be selected.
|
|
@@ -139,6 +139,12 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
|
|
|
139
139
|
enableRangeSelect = false,
|
|
140
140
|
startDate,
|
|
141
141
|
endDate,
|
|
142
|
+
monthYearProps,
|
|
143
|
+
calendarProps,
|
|
144
|
+
monthProps,
|
|
145
|
+
weekDayProps,
|
|
146
|
+
dayProps,
|
|
147
|
+
weekProps,
|
|
142
148
|
isDateDisabled,
|
|
143
149
|
...rest
|
|
144
150
|
} = props;
|
|
@@ -420,7 +426,14 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
|
|
|
420
426
|
null,
|
|
421
427
|
React.createElement(
|
|
422
428
|
index_js_1.Box,
|
|
423
|
-
{
|
|
429
|
+
{
|
|
430
|
+
as: 'div',
|
|
431
|
+
...monthYearProps,
|
|
432
|
+
className: (0, classnames_1.default)(
|
|
433
|
+
'iui-calendar-month-year',
|
|
434
|
+
monthYearProps?.className,
|
|
435
|
+
),
|
|
436
|
+
},
|
|
424
437
|
showYearSelection &&
|
|
425
438
|
React.createElement(
|
|
426
439
|
index_js_2.IconButton,
|
|
@@ -449,9 +462,13 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
|
|
|
449
462
|
index_js_1.Box,
|
|
450
463
|
{
|
|
451
464
|
as: 'span',
|
|
452
|
-
className: 'iui-calendar-month',
|
|
453
465
|
id: dateTableId,
|
|
454
466
|
title: monthNames[displayedMonthIndex],
|
|
467
|
+
...monthProps,
|
|
468
|
+
className: (0, classnames_1.default)(
|
|
469
|
+
'iui-calendar-month',
|
|
470
|
+
monthProps?.className,
|
|
471
|
+
),
|
|
455
472
|
},
|
|
456
473
|
monthNames[displayedMonthIndex],
|
|
457
474
|
),
|
|
@@ -482,7 +499,14 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
|
|
|
482
499
|
),
|
|
483
500
|
React.createElement(
|
|
484
501
|
index_js_1.Box,
|
|
485
|
-
{
|
|
502
|
+
{
|
|
503
|
+
as: 'div',
|
|
504
|
+
...weekDayProps,
|
|
505
|
+
className: (0, classnames_1.default)(
|
|
506
|
+
'iui-calendar-weekdays',
|
|
507
|
+
weekDayProps?.className,
|
|
508
|
+
),
|
|
509
|
+
},
|
|
486
510
|
shortDays.map((day, index) =>
|
|
487
511
|
React.createElement('div', { key: day, title: longDays[index] }, day),
|
|
488
512
|
),
|
|
@@ -493,13 +517,19 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
|
|
|
493
517
|
onKeyDown: handleCalendarKeyDown,
|
|
494
518
|
role: 'listbox',
|
|
495
519
|
'aria-labelledby': dateTableId,
|
|
520
|
+
...calendarProps,
|
|
496
521
|
},
|
|
497
522
|
weeks.map((weekDays, weekIndex) => {
|
|
498
523
|
return React.createElement(
|
|
499
524
|
index_js_1.Box,
|
|
500
525
|
{
|
|
526
|
+
as: 'div',
|
|
501
527
|
key: `week-${displayedMonthIndex}-${weekIndex}`,
|
|
502
|
-
|
|
528
|
+
...weekProps,
|
|
529
|
+
className: (0, classnames_1.default)(
|
|
530
|
+
'iui-calendar-week',
|
|
531
|
+
weekProps?.className,
|
|
532
|
+
),
|
|
503
533
|
},
|
|
504
534
|
weekDays.map((weekDay, dayIndex) => {
|
|
505
535
|
const dateValue = weekDay.getDate();
|
|
@@ -507,8 +537,8 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
|
|
|
507
537
|
return React.createElement(
|
|
508
538
|
index_js_1.Box,
|
|
509
539
|
{
|
|
540
|
+
as: 'div',
|
|
510
541
|
key: `day-${displayedMonthIndex}-${dayIndex}`,
|
|
511
|
-
className: getDayClass(weekDay),
|
|
512
542
|
onClick: () => !isDisabled && onDayClick(weekDay),
|
|
513
543
|
role: 'option',
|
|
514
544
|
tabIndex: isSameDay(weekDay, focusedDay) ? 0 : -1,
|
|
@@ -517,6 +547,11 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
|
|
|
517
547
|
isSameDay(weekDay, focusedDay) &&
|
|
518
548
|
needFocus.current &&
|
|
519
549
|
element?.focus(),
|
|
550
|
+
...dayProps,
|
|
551
|
+
className: (0, classnames_1.default)(
|
|
552
|
+
getDayClass(weekDay),
|
|
553
|
+
dayProps?.className,
|
|
554
|
+
),
|
|
520
555
|
},
|
|
521
556
|
dateValue,
|
|
522
557
|
);
|
|
@@ -7,7 +7,6 @@ const tslib_1 = require('tslib');
|
|
|
7
7
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
8
|
*--------------------------------------------------------------------------------------------*/
|
|
9
9
|
const React = tslib_1.__importStar(require('react'));
|
|
10
|
-
const ReactDOM = tslib_1.__importStar(require('react-dom'));
|
|
11
10
|
const classnames_1 = tslib_1.__importDefault(require('classnames'));
|
|
12
11
|
const DialogTitleBar_js_1 = require('./DialogTitleBar.js');
|
|
13
12
|
const DialogContent_js_1 = require('./DialogContent.js');
|
|
@@ -35,20 +34,6 @@ const DialogComponent = React.forwardRef((props, ref) => {
|
|
|
35
34
|
...rest
|
|
36
35
|
} = props;
|
|
37
36
|
const dialogRootRef = React.useRef(null);
|
|
38
|
-
const context = (0, index_js_1.useGlobals)();
|
|
39
|
-
const isClient = (0, index_js_1.useIsClient)();
|
|
40
|
-
const portalTo =
|
|
41
|
-
typeof portal !== 'boolean'
|
|
42
|
-
? portal.to
|
|
43
|
-
: portal
|
|
44
|
-
? context?.portalContainer || (0, index_js_1.getDocument)()?.body
|
|
45
|
-
: null;
|
|
46
|
-
const dialog = React.createElement(index_js_1.Box, {
|
|
47
|
-
className: (0, classnames_1.default)('iui-dialog-wrapper', className),
|
|
48
|
-
'data-iui-relative': relativeTo === 'container',
|
|
49
|
-
ref: (0, index_js_1.useMergedRefs)(ref, dialogRootRef),
|
|
50
|
-
...rest,
|
|
51
|
-
});
|
|
52
37
|
return React.createElement(
|
|
53
38
|
DialogContext_js_1.DialogContext.Provider,
|
|
54
39
|
{
|
|
@@ -68,7 +53,16 @@ const DialogComponent = React.forwardRef((props, ref) => {
|
|
|
68
53
|
placement,
|
|
69
54
|
},
|
|
70
55
|
},
|
|
71
|
-
|
|
56
|
+
React.createElement(
|
|
57
|
+
index_js_1.Portal,
|
|
58
|
+
{ portal: portal },
|
|
59
|
+
React.createElement(index_js_1.Box, {
|
|
60
|
+
className: (0, classnames_1.default)('iui-dialog-wrapper', className),
|
|
61
|
+
'data-iui-relative': relativeTo === 'container',
|
|
62
|
+
ref: (0, index_js_1.useMergedRefs)(ref, dialogRootRef),
|
|
63
|
+
...rest,
|
|
64
|
+
}),
|
|
65
|
+
),
|
|
72
66
|
);
|
|
73
67
|
});
|
|
74
68
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { PortalProps } from '../utils/index.js';
|
|
2
3
|
export type DialogContextProps = {
|
|
3
4
|
/**
|
|
4
5
|
* Flag whether dialog should be shown.
|
|
@@ -67,11 +68,9 @@ export type DialogContextProps = {
|
|
|
67
68
|
*
|
|
68
69
|
* Can be set to an object with a `to` property to portal into a specific element.
|
|
69
70
|
*
|
|
70
|
-
*
|
|
71
|
+
* Defaults to false if using `Dialog` and true if using `Modal`.
|
|
71
72
|
*/
|
|
72
|
-
portal?:
|
|
73
|
-
to: HTMLElement;
|
|
74
|
-
};
|
|
73
|
+
portal?: PortalProps['portal'];
|
|
75
74
|
/**
|
|
76
75
|
* Dialog root ref. For internal use.
|
|
77
76
|
*/
|
|
@@ -36,9 +36,11 @@ type ExpandableBlockOwnProps = {
|
|
|
36
36
|
*/
|
|
37
37
|
disabled?: boolean;
|
|
38
38
|
};
|
|
39
|
-
type
|
|
39
|
+
type ExpandableBlockTriggerOwnProps = {
|
|
40
40
|
label?: React.ReactNode;
|
|
41
|
+
caption?: React.ReactNode;
|
|
41
42
|
expandIcon?: React.ReactNode;
|
|
43
|
+
endIcon?: React.ReactNode;
|
|
42
44
|
};
|
|
43
45
|
type ExpandableBlockContentOwnProps = {
|
|
44
46
|
innerProps?: React.ComponentPropsWithoutRef<'div'>;
|
|
@@ -46,29 +48,32 @@ type ExpandableBlockContentOwnProps = {
|
|
|
46
48
|
/**
|
|
47
49
|
* Expandable block with customizable Title, Caption, Content and EndIcon subcomponents.
|
|
48
50
|
* @example
|
|
49
|
-
* <ExpandableBlock>
|
|
50
|
-
* <ExpandableBlock.
|
|
51
|
+
* <ExpandableBlock.Wrapper>
|
|
52
|
+
* <ExpandableBlock.Trigger>
|
|
51
53
|
* <ExpandableBlock.ExpandIcon/>
|
|
52
54
|
* <ExpandableBlock.LabelArea>
|
|
53
55
|
* <ExpandableBlock.Title/>
|
|
54
56
|
* <ExpandableBlock.Caption/>
|
|
55
57
|
* </ExpandableBlock.LabelArea>
|
|
56
58
|
* <ExpandableBlock.EndIcon/>
|
|
57
|
-
* </ExpandableBlock.
|
|
59
|
+
* </ExpandableBlock.Trigger>
|
|
58
60
|
* <ExpandableBlock.Content/>
|
|
59
|
-
* </ExpandableBlock>
|
|
61
|
+
* </ExpandableBlock.Wrapper>
|
|
60
62
|
*/
|
|
61
|
-
export declare const ExpandableBlock: PolymorphicForwardRefComponent<"div", ExpandableBlockOwnProps
|
|
63
|
+
export declare const ExpandableBlock: PolymorphicForwardRefComponent<"div", ExpandableBlockOwnProps & {
|
|
64
|
+
title?: React.ReactNode;
|
|
65
|
+
} & Pick<ExpandableBlockTriggerOwnProps, "caption" | "endIcon">> & {
|
|
66
|
+
Wrapper: PolymorphicForwardRefComponent<"div", ExpandableBlockOwnProps>;
|
|
62
67
|
/**
|
|
63
68
|
* `Header` container that contains `ExpandIcon`, `LabelArea` and `EndIcon` subcomponents
|
|
64
69
|
* @example
|
|
65
|
-
* <ExpandableBlock.
|
|
70
|
+
* <ExpandableBlock.Trigger>
|
|
66
71
|
* <ExpandableBlock.ExpandIcon/>
|
|
67
72
|
* <ExpandableBlock.LabelArea/>
|
|
68
73
|
* <ExpandableBlock.EndIcon/>
|
|
69
|
-
* </ExpandableBlock.
|
|
74
|
+
* </ExpandableBlock.Trigger>
|
|
70
75
|
*/
|
|
71
|
-
|
|
76
|
+
Trigger: PolymorphicForwardRefComponent<"button", ExpandableBlockTriggerOwnProps>;
|
|
72
77
|
/**
|
|
73
78
|
* The expanding icon on the left of header
|
|
74
79
|
*/
|
|
@@ -94,24 +99,25 @@ export declare const ExpandableBlock: PolymorphicForwardRefComponent<"div", Expa
|
|
|
94
99
|
* Svg icon displayed at the end of the main text.
|
|
95
100
|
* Will override status icon if specified. Used inside `Header` subcomponent.
|
|
96
101
|
* @example
|
|
97
|
-
* <ExpandableBlock.
|
|
102
|
+
* <ExpandableBlock.Trigger>
|
|
98
103
|
* <ExpandableBlock.EndIcon> <SvgIcon/> </ExpandableBlock.EndIcon>
|
|
99
|
-
* <ExpandableBlock.
|
|
104
|
+
* <ExpandableBlock.Trigger/>
|
|
100
105
|
*/
|
|
101
106
|
EndIcon: PolymorphicForwardRefComponent<"span", Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
102
107
|
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
103
|
-
}, "fill" | "as" | "key" | "size" | keyof React.HTMLAttributes<HTMLSpanElement
|
|
108
|
+
}, "fill" | "as" | "key" | "size" | keyof React.HTMLAttributes<HTMLSpanElement> | "padded"> & {
|
|
104
109
|
size?: "small" | "large" | "auto" | "medium" | import("../utils/types.js").AnyString | undefined;
|
|
105
110
|
fill?: "default" | "informational" | "negative" | "positive" | "warning" | import("../utils/types.js").AnyString | undefined;
|
|
111
|
+
padded?: boolean | undefined;
|
|
106
112
|
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
107
113
|
as?: "span" | undefined;
|
|
108
114
|
}, "ref">>;
|
|
109
115
|
/**
|
|
110
116
|
* Content shown in the block's body when fully expanded.
|
|
111
117
|
* @example
|
|
112
|
-
* <ExpandableBlock>
|
|
118
|
+
* <ExpandableBlock.Wrapper>
|
|
113
119
|
* <ExpandableBlock.Content> Content </ExpandableBlock.Content>
|
|
114
|
-
* </ExpandableBlock>
|
|
120
|
+
* </ExpandableBlock.Wrapper>
|
|
115
121
|
*/
|
|
116
122
|
Content: PolymorphicForwardRefComponent<"div", ExpandableBlockContentOwnProps>;
|
|
117
123
|
};
|
|
@@ -12,6 +12,21 @@ const index_js_1 = require('../utils/index.js');
|
|
|
12
12
|
const ExpandableBlockContext = React.createContext(undefined);
|
|
13
13
|
ExpandableBlockContext.displayName = 'ExpandableBlockContext';
|
|
14
14
|
const ExpandableBlockComponent = React.forwardRef((props, forwardedRef) => {
|
|
15
|
+
const { children, title, caption, endIcon, ...rest } = props;
|
|
16
|
+
return React.createElement(
|
|
17
|
+
exports.ExpandableBlock.Wrapper,
|
|
18
|
+
{ ...rest, ref: forwardedRef },
|
|
19
|
+
React.createElement(exports.ExpandableBlock.Trigger, {
|
|
20
|
+
label: title,
|
|
21
|
+
caption: caption,
|
|
22
|
+
endIcon: endIcon,
|
|
23
|
+
}),
|
|
24
|
+
React.createElement(exports.ExpandableBlock.Content, null, children),
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
ExpandableBlockComponent.displayName = 'ExpandableBlock';
|
|
28
|
+
// ----------------------------------------------------------------------------
|
|
29
|
+
const ExpandableBlockWrapper = React.forwardRef((props, forwardedRef) => {
|
|
15
30
|
const {
|
|
16
31
|
children,
|
|
17
32
|
className,
|
|
@@ -55,17 +70,19 @@ const ExpandableBlockComponent = React.forwardRef((props, forwardedRef) => {
|
|
|
55
70
|
),
|
|
56
71
|
);
|
|
57
72
|
});
|
|
58
|
-
|
|
59
|
-
const
|
|
73
|
+
ExpandableBlockWrapper.displayName = 'ExpandableBlock.Wrapper';
|
|
74
|
+
const ExpandableBlockTrigger = React.forwardRef((props, forwardedRef) => {
|
|
60
75
|
const {
|
|
61
76
|
className,
|
|
62
77
|
children,
|
|
63
78
|
label,
|
|
79
|
+
caption,
|
|
64
80
|
onClick: onClickProp,
|
|
65
81
|
expandIcon,
|
|
82
|
+
endIcon,
|
|
66
83
|
...rest
|
|
67
84
|
} = props;
|
|
68
|
-
const { isExpanded, setExpanded, disabled, onToggle } = (0,
|
|
85
|
+
const { isExpanded, setExpanded, disabled, onToggle, status } = (0,
|
|
69
86
|
index_js_1.useSafeContext)(ExpandableBlockContext);
|
|
70
87
|
return React.createElement(
|
|
71
88
|
index_js_1.ButtonBase,
|
|
@@ -93,11 +110,16 @@ const ExpandableBlockHeader = React.forwardRef((props, forwardedRef) => {
|
|
|
93
110
|
exports.ExpandableBlock.LabelArea,
|
|
94
111
|
null,
|
|
95
112
|
React.createElement(exports.ExpandableBlock.Title, null, label),
|
|
113
|
+
caption &&
|
|
114
|
+
React.createElement(exports.ExpandableBlock.Caption, null, caption),
|
|
96
115
|
),
|
|
116
|
+
endIcon || status
|
|
117
|
+
? React.createElement(exports.ExpandableBlock.EndIcon, null, endIcon)
|
|
118
|
+
: null,
|
|
97
119
|
),
|
|
98
120
|
);
|
|
99
121
|
});
|
|
100
|
-
|
|
122
|
+
ExpandableBlockTrigger.displayName = 'ExpandableBlock.Trigger';
|
|
101
123
|
// ----------------------------------------------------------------------------
|
|
102
124
|
// ExpandableBlock.ExpandIcon component
|
|
103
125
|
const ExpandableBlockExpandIcon = React.forwardRef((props, forwardedRef) => {
|
|
@@ -176,29 +198,30 @@ ExpandableBlockContent.displayName = 'ExpandableBlock.Content';
|
|
|
176
198
|
/**
|
|
177
199
|
* Expandable block with customizable Title, Caption, Content and EndIcon subcomponents.
|
|
178
200
|
* @example
|
|
179
|
-
* <ExpandableBlock>
|
|
180
|
-
* <ExpandableBlock.
|
|
201
|
+
* <ExpandableBlock.Wrapper>
|
|
202
|
+
* <ExpandableBlock.Trigger>
|
|
181
203
|
* <ExpandableBlock.ExpandIcon/>
|
|
182
204
|
* <ExpandableBlock.LabelArea>
|
|
183
205
|
* <ExpandableBlock.Title/>
|
|
184
206
|
* <ExpandableBlock.Caption/>
|
|
185
207
|
* </ExpandableBlock.LabelArea>
|
|
186
208
|
* <ExpandableBlock.EndIcon/>
|
|
187
|
-
* </ExpandableBlock.
|
|
209
|
+
* </ExpandableBlock.Trigger>
|
|
188
210
|
* <ExpandableBlock.Content/>
|
|
189
|
-
* </ExpandableBlock>
|
|
211
|
+
* </ExpandableBlock.Wrapper>
|
|
190
212
|
*/
|
|
191
213
|
exports.ExpandableBlock = Object.assign(ExpandableBlockComponent, {
|
|
214
|
+
Wrapper: ExpandableBlockWrapper,
|
|
192
215
|
/**
|
|
193
216
|
* `Header` container that contains `ExpandIcon`, `LabelArea` and `EndIcon` subcomponents
|
|
194
217
|
* @example
|
|
195
|
-
* <ExpandableBlock.
|
|
218
|
+
* <ExpandableBlock.Trigger>
|
|
196
219
|
* <ExpandableBlock.ExpandIcon/>
|
|
197
220
|
* <ExpandableBlock.LabelArea/>
|
|
198
221
|
* <ExpandableBlock.EndIcon/>
|
|
199
|
-
* </ExpandableBlock.
|
|
222
|
+
* </ExpandableBlock.Trigger>
|
|
200
223
|
*/
|
|
201
|
-
|
|
224
|
+
Trigger: ExpandableBlockTrigger,
|
|
202
225
|
/**
|
|
203
226
|
* The expanding icon on the left of header
|
|
204
227
|
*/
|
|
@@ -224,17 +247,17 @@ exports.ExpandableBlock = Object.assign(ExpandableBlockComponent, {
|
|
|
224
247
|
* Svg icon displayed at the end of the main text.
|
|
225
248
|
* Will override status icon if specified. Used inside `Header` subcomponent.
|
|
226
249
|
* @example
|
|
227
|
-
* <ExpandableBlock.
|
|
250
|
+
* <ExpandableBlock.Trigger>
|
|
228
251
|
* <ExpandableBlock.EndIcon> <SvgIcon/> </ExpandableBlock.EndIcon>
|
|
229
|
-
* <ExpandableBlock.
|
|
252
|
+
* <ExpandableBlock.Trigger/>
|
|
230
253
|
*/
|
|
231
254
|
EndIcon: ExpandableBlockEndIcon,
|
|
232
255
|
/**
|
|
233
256
|
* Content shown in the block's body when fully expanded.
|
|
234
257
|
* @example
|
|
235
|
-
* <ExpandableBlock>
|
|
258
|
+
* <ExpandableBlock.Wrapper>
|
|
236
259
|
* <ExpandableBlock.Content> Content </ExpandableBlock.Content>
|
|
237
|
-
* </ExpandableBlock>
|
|
260
|
+
* </ExpandableBlock.Wrapper>
|
|
238
261
|
*/
|
|
239
262
|
Content: ExpandableBlockContent,
|
|
240
263
|
});
|
|
@@ -4,6 +4,10 @@ export type InputProps = {
|
|
|
4
4
|
* Modify size of the input.
|
|
5
5
|
*/
|
|
6
6
|
size?: 'small' | 'large';
|
|
7
|
+
/**
|
|
8
|
+
* Status of input.
|
|
9
|
+
*/
|
|
10
|
+
status?: 'positive' | 'warning' | 'negative';
|
|
7
11
|
/**
|
|
8
12
|
* Modify the native `size` attribute of the `<input>` element.
|
|
9
13
|
* The `width` or `inline-size` property must be unset in order to use this prop.
|
package/cjs/core/Input/Input.js
CHANGED
|
@@ -17,13 +17,14 @@ const index_js_1 = require('../utils/index.js');
|
|
|
17
17
|
* <Input size='small' />
|
|
18
18
|
*/
|
|
19
19
|
exports.Input = React.forwardRef((props, ref) => {
|
|
20
|
-
const { size, htmlSize, className, ...rest } = props;
|
|
20
|
+
const { size, htmlSize, status, className, ...rest } = props;
|
|
21
21
|
const inputRef = React.useRef(null);
|
|
22
22
|
const refs = (0, index_js_1.useMergedRefs)(inputRef, ref);
|
|
23
23
|
return React.createElement(index_js_1.Box, {
|
|
24
24
|
as: 'input',
|
|
25
25
|
className: (0, classnames_1.default)('iui-input', className),
|
|
26
26
|
'data-iui-size': size,
|
|
27
|
+
'data-iui-status': status,
|
|
27
28
|
size: htmlSize,
|
|
28
29
|
ref: refs,
|
|
29
30
|
...rest,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
2
|
+
type InputGridOwnProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Set display style of label.
|
|
5
|
+
* Supported values:
|
|
6
|
+
* - 'default' - label appears above input.
|
|
7
|
+
* - 'inline' - appears in the same line as input.
|
|
8
|
+
* @default 'default'
|
|
9
|
+
*/
|
|
10
|
+
labelPlacement?: 'default' | 'inline';
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* InputGrid component is used to display inputs (input, textarea, select)
|
|
14
|
+
* with label and/or status message
|
|
15
|
+
*
|
|
16
|
+
* @usage
|
|
17
|
+
*
|
|
18
|
+
* <InputGrid>
|
|
19
|
+
* <Label htmlFor='input-1'>This is label</Label>
|
|
20
|
+
* <Input id='input-1'/>
|
|
21
|
+
* <StatusMessage>This is message</StatusMessage>
|
|
22
|
+
* </InputGrid>
|
|
23
|
+
*/
|
|
24
|
+
export declare const InputGrid: PolymorphicForwardRefComponent<"div", InputGridOwnProps>;
|
|
25
|
+
export default InputGrid;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
exports.InputGrid = void 0;
|
|
4
|
+
const tslib_1 = require('tslib');
|
|
5
|
+
/*---------------------------------------------------------------------------------------------
|
|
6
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
7
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
|
+
*--------------------------------------------------------------------------------------------*/
|
|
9
|
+
const React = tslib_1.__importStar(require('react'));
|
|
10
|
+
const index_js_1 = require('../utils/index.js');
|
|
11
|
+
const classnames_1 = tslib_1.__importDefault(require('classnames'));
|
|
12
|
+
//-------------------------------------------------------------------------------
|
|
13
|
+
/**
|
|
14
|
+
* InputGrid component is used to display inputs (input, textarea, select)
|
|
15
|
+
* with label and/or status message
|
|
16
|
+
*
|
|
17
|
+
* @usage
|
|
18
|
+
*
|
|
19
|
+
* <InputGrid>
|
|
20
|
+
* <Label htmlFor='input-1'>This is label</Label>
|
|
21
|
+
* <Input id='input-1'/>
|
|
22
|
+
* <StatusMessage>This is message</StatusMessage>
|
|
23
|
+
* </InputGrid>
|
|
24
|
+
*/
|
|
25
|
+
exports.InputGrid = React.forwardRef((props, ref) => {
|
|
26
|
+
const { children, className, labelPlacement = undefined, ...rest } = props;
|
|
27
|
+
return React.createElement(
|
|
28
|
+
index_js_1.Box,
|
|
29
|
+
{
|
|
30
|
+
className: (0, classnames_1.default)('iui-input-grid', className),
|
|
31
|
+
'data-iui-label-placement': labelPlacement,
|
|
32
|
+
ref: ref,
|
|
33
|
+
...rest,
|
|
34
|
+
},
|
|
35
|
+
children,
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
//-------------------------------------------------------------------------------
|
|
39
|
+
exports.default = exports.InputGrid;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
exports.InputGrid = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
var InputGrid_js_1 = require('./InputGrid.js');
|
|
9
|
+
Object.defineProperty(exports, 'InputGrid', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return InputGrid_js_1.InputGrid;
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
exports.default = './InputGrid';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
3
|
+
import { StatusMessage } from '../StatusMessage/index.js';
|
|
3
4
|
type InputGroupProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Label of the group.
|
|
@@ -36,6 +37,18 @@ type InputGroupProps = {
|
|
|
36
37
|
* Child inputs inside group.
|
|
37
38
|
*/
|
|
38
39
|
children: React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Passes properties for label.
|
|
42
|
+
*/
|
|
43
|
+
labelProps?: React.ComponentProps<'label'>;
|
|
44
|
+
/**
|
|
45
|
+
* Passes properties for message.
|
|
46
|
+
*/
|
|
47
|
+
messageProps?: Pick<React.ComponentProps<typeof StatusMessage>, 'iconProps' | 'contentProps'>;
|
|
48
|
+
/**
|
|
49
|
+
* Passes properties for inner input group element.
|
|
50
|
+
*/
|
|
51
|
+
innerProps?: React.ComponentProps<'div'>;
|
|
39
52
|
};
|
|
40
53
|
/**
|
|
41
54
|
* Group Checkbox/Radio components together
|
|
@@ -7,7 +7,11 @@ const tslib_1 = require('tslib');
|
|
|
7
7
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
8
|
*--------------------------------------------------------------------------------------------*/
|
|
9
9
|
const React = tslib_1.__importStar(require('react'));
|
|
10
|
+
const classnames_1 = tslib_1.__importDefault(require('classnames'));
|
|
10
11
|
const index_js_1 = require('../utils/index.js');
|
|
12
|
+
const index_js_2 = require('../InputGrid/index.js');
|
|
13
|
+
const index_js_3 = require('../Label/index.js');
|
|
14
|
+
const index_js_4 = require('../StatusMessage/index.js');
|
|
11
15
|
/**
|
|
12
16
|
* Group Checkbox/Radio components together
|
|
13
17
|
* @example
|
|
@@ -25,6 +29,7 @@ const index_js_1 = require('../utils/index.js');
|
|
|
25
29
|
*/
|
|
26
30
|
exports.InputGroup = React.forwardRef((props, forwardedRef) => {
|
|
27
31
|
const {
|
|
32
|
+
className,
|
|
28
33
|
children,
|
|
29
34
|
disabled = false,
|
|
30
35
|
displayStyle = 'default',
|
|
@@ -33,6 +38,9 @@ exports.InputGroup = React.forwardRef((props, forwardedRef) => {
|
|
|
33
38
|
status,
|
|
34
39
|
svgIcon,
|
|
35
40
|
required = false,
|
|
41
|
+
labelProps,
|
|
42
|
+
messageProps,
|
|
43
|
+
innerProps,
|
|
36
44
|
...rest
|
|
37
45
|
} = props;
|
|
38
46
|
const icon = () => {
|
|
@@ -47,23 +55,41 @@ exports.InputGroup = React.forwardRef((props, forwardedRef) => {
|
|
|
47
55
|
return undefined;
|
|
48
56
|
};
|
|
49
57
|
return React.createElement(
|
|
50
|
-
|
|
58
|
+
index_js_2.InputGrid,
|
|
51
59
|
{
|
|
52
|
-
label: label,
|
|
53
|
-
disabled: disabled,
|
|
54
|
-
required: required,
|
|
55
|
-
status: status,
|
|
56
|
-
message: message,
|
|
57
|
-
icon: icon(),
|
|
58
|
-
isLabelInline: displayStyle === 'inline',
|
|
59
60
|
ref: forwardedRef,
|
|
61
|
+
as: 'div',
|
|
62
|
+
labelPlacement: displayStyle,
|
|
63
|
+
className: (0, classnames_1.default)(
|
|
64
|
+
'iui-input-group-wrapper',
|
|
65
|
+
className,
|
|
66
|
+
),
|
|
60
67
|
...rest,
|
|
61
68
|
},
|
|
69
|
+
label &&
|
|
70
|
+
React.createElement(
|
|
71
|
+
index_js_3.Label,
|
|
72
|
+
{ as: 'label', required: required, disabled: disabled, ...labelProps },
|
|
73
|
+
label,
|
|
74
|
+
),
|
|
62
75
|
React.createElement(
|
|
63
76
|
index_js_1.Box,
|
|
64
|
-
{
|
|
77
|
+
{
|
|
78
|
+
as: 'div',
|
|
79
|
+
...innerProps,
|
|
80
|
+
className: (0, classnames_1.default)(
|
|
81
|
+
'iui-input-group',
|
|
82
|
+
innerProps?.className,
|
|
83
|
+
),
|
|
84
|
+
},
|
|
65
85
|
children,
|
|
66
86
|
),
|
|
87
|
+
(message || status || svgIcon) &&
|
|
88
|
+
React.createElement(
|
|
89
|
+
index_js_4.StatusMessage,
|
|
90
|
+
{ startIcon: icon(), status: status, ...messageProps },
|
|
91
|
+
displayStyle !== 'inline' && message,
|
|
92
|
+
),
|
|
67
93
|
);
|
|
68
94
|
});
|
|
69
95
|
exports.default = exports.InputGroup;
|