@carbon/react 1.91.0-rc.0 → 1.92.0-rc.0
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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +969 -934
- package/es/components/Accordion/AccordionItem.d.ts +12 -1
- package/es/components/Accordion/AccordionItem.js +9 -2
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.d.ts +27 -2
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +27 -4
- package/es/components/Breadcrumb/Breadcrumb.js +2 -1
- package/es/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/es/components/Checkbox/Checkbox.js +2 -2
- package/es/components/ComboBox/ComboBox.js +39 -23
- package/es/components/ComboButton/index.js +1 -1
- package/es/components/ComposedModal/ComposedModal.js +66 -17
- package/es/components/ComposedModal/ComposedModalPresence.d.ts +34 -0
- package/es/components/ComposedModal/ComposedModalPresence.js +42 -0
- package/es/components/ComposedModal/index.d.ts +1 -0
- package/es/components/ComposedModal/useComposedModalState.d.ts +7 -0
- package/es/components/ComposedModal/useComposedModalState.js +24 -0
- package/es/components/ContentSwitcher/ContentSwitcher.js +2 -2
- package/es/components/DataTable/TableBatchActions.js +2 -2
- package/es/components/DatePickerInput/DatePickerInput.js +2 -2
- package/es/components/Dialog/Dialog.js +2 -2
- package/es/components/Dropdown/Dropdown.js +5 -5
- package/es/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
- package/es/components/ExpandableSearch/ExpandableSearch.js +1 -1
- package/es/components/FeatureFlags/index.d.ts +2 -1
- package/es/components/FeatureFlags/index.js +3 -1
- package/es/components/FileUploader/FileUploader.js +2 -2
- package/es/components/FileUploader/FileUploaderItem.js +2 -2
- package/es/components/FluidTextInput/FluidPasswordInput.js +24 -5
- package/es/components/FluidTextInput/index.js +1 -1
- package/es/components/FormLabel/FormLabel.js +1 -1
- package/es/components/ListBox/ListBox.d.ts +1 -1
- package/es/components/ListBox/ListBox.js +1 -2
- package/es/components/ListItem/ListItem.js +1 -1
- package/es/components/Menu/MenuItem.js +2 -2
- package/es/components/MenuButton/index.d.ts +1 -1
- package/es/components/MenuButton/index.js +1 -1
- package/es/components/Modal/Modal.js +60 -10
- package/es/components/Modal/ModalPresence.d.ts +32 -0
- package/es/components/Modal/ModalPresence.js +37 -0
- package/es/components/Modal/index.d.ts +2 -1
- package/es/components/Modal/index.js +1 -0
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/es/components/MultiSelect/MultiSelect.js +6 -5
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/NumberInput/NumberInput.d.ts +21 -11
- package/es/components/NumberInput/NumberInput.js +40 -26
- package/es/components/OverflowMenu/OverflowMenu.js +2 -3
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +1 -1
- package/es/components/PageHeader/PageHeader.js +2 -2
- package/es/components/PaginationNav/PaginationNav.d.ts +20 -0
- package/es/components/PaginationNav/PaginationNav.js +34 -5
- package/es/components/ProgressIndicator/ProgressIndicator.js +1 -1
- package/es/components/RadioButton/RadioButton.js +3 -3
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +2 -2
- package/es/components/RadioTile/RadioTile.js +2 -2
- package/es/components/Select/Select.js +2 -2
- package/es/components/Slider/Slider.js +2 -2
- package/es/components/StructuredList/StructuredList.js +2 -2
- package/es/components/Tabs/Tabs.js +2 -2
- package/es/components/Tag/DismissibleTag.js +3 -3
- package/es/components/Tag/OperationalTag.js +3 -3
- package/es/components/Tag/SelectableTag.js +3 -3
- package/es/components/Tag/Tag.js +2 -2
- package/es/components/Text/Text.d.ts +1 -1
- package/es/components/Text/Text.js +0 -1
- package/es/components/Text/TextDirection.d.ts +1 -1
- package/es/components/Text/TextDirection.js +0 -1
- package/es/components/Text/createTextComponent.d.ts +2 -8
- package/es/components/Text/createTextComponent.js +2 -2
- package/es/components/Text/index.d.ts +0 -8
- package/es/components/TextArea/TextArea.js +2 -2
- package/es/components/TextInput/TextInput.js +2 -2
- package/es/components/Tile/Tile.js +2 -2
- package/es/components/Toggle/Toggle.js +2 -2
- package/es/components/UIShell/Switcher.js +0 -26
- package/es/index.d.ts +27 -23
- package/es/index.js +44 -41
- package/es/internal/useNormalizedInputProps.js +2 -2
- package/es/internal/usePresence.d.ts +17 -0
- package/es/internal/usePresence.js +66 -0
- package/es/internal/usePresenceContext.d.ts +25 -0
- package/es/internal/usePresenceContext.js +46 -0
- package/es/tools/mergeRefs.d.ts +5 -5
- package/es/tools/mergeRefs.js +16 -12
- package/lib/components/Accordion/AccordionItem.d.ts +12 -1
- package/lib/components/Accordion/AccordionItem.js +9 -2
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.d.ts +27 -2
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +27 -4
- package/lib/components/Breadcrumb/Breadcrumb.js +2 -1
- package/lib/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/lib/components/Checkbox/Checkbox.js +2 -2
- package/lib/components/ComboBox/ComboBox.js +39 -23
- package/lib/components/ComboButton/index.js +1 -1
- package/lib/components/ComposedModal/ComposedModal.js +65 -16
- package/lib/components/ComposedModal/ComposedModalPresence.d.ts +34 -0
- package/lib/components/ComposedModal/ComposedModalPresence.js +46 -0
- package/lib/components/ComposedModal/index.d.ts +1 -0
- package/lib/components/ComposedModal/useComposedModalState.d.ts +7 -0
- package/lib/components/ComposedModal/useComposedModalState.js +26 -0
- package/lib/components/ContentSwitcher/ContentSwitcher.js +1 -1
- package/lib/components/DataTable/TableBatchActions.js +2 -2
- package/lib/components/DatePickerInput/DatePickerInput.js +2 -2
- package/lib/components/Dialog/Dialog.js +2 -2
- package/lib/components/Dropdown/Dropdown.js +3 -3
- package/lib/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
- package/lib/components/ExpandableSearch/ExpandableSearch.js +1 -1
- package/lib/components/FeatureFlags/index.d.ts +2 -1
- package/lib/components/FeatureFlags/index.js +3 -1
- package/lib/components/FileUploader/FileUploader.js +2 -2
- package/lib/components/FileUploader/FileUploaderItem.js +2 -2
- package/lib/components/FluidTextInput/FluidPasswordInput.js +26 -5
- package/lib/components/FluidTextInput/index.js +2 -1
- package/lib/components/FormLabel/FormLabel.js +1 -1
- package/lib/components/ListBox/ListBox.d.ts +1 -1
- package/lib/components/ListBox/ListBox.js +1 -2
- package/lib/components/ListItem/ListItem.js +1 -1
- package/lib/components/Menu/MenuItem.js +2 -2
- package/lib/components/MenuButton/index.d.ts +1 -1
- package/lib/components/MenuButton/index.js +1 -1
- package/lib/components/Modal/Modal.js +59 -9
- package/lib/components/Modal/ModalPresence.d.ts +32 -0
- package/lib/components/Modal/ModalPresence.js +41 -0
- package/lib/components/Modal/index.d.ts +2 -1
- package/lib/components/Modal/index.js +1 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/lib/components/MultiSelect/MultiSelect.js +4 -3
- package/lib/components/Notification/Notification.js +2 -2
- package/lib/components/NumberInput/NumberInput.d.ts +21 -11
- package/lib/components/NumberInput/NumberInput.js +40 -26
- package/lib/components/OverflowMenu/OverflowMenu.js +2 -3
- package/lib/components/OverflowMenu/next/index.js +1 -1
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +1 -1
- package/lib/components/PageHeader/PageHeader.js +2 -2
- package/lib/components/PaginationNav/PaginationNav.d.ts +20 -0
- package/lib/components/PaginationNav/PaginationNav.js +34 -5
- package/lib/components/ProgressIndicator/ProgressIndicator.js +1 -1
- package/lib/components/RadioButton/RadioButton.js +3 -3
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +3 -3
- package/lib/components/RadioTile/RadioTile.js +2 -2
- package/lib/components/Select/Select.js +2 -2
- package/lib/components/Slider/Slider.js +2 -2
- package/lib/components/StructuredList/StructuredList.js +2 -2
- package/lib/components/Tabs/Tabs.js +2 -2
- package/lib/components/Tag/DismissibleTag.js +3 -3
- package/lib/components/Tag/OperationalTag.js +3 -3
- package/lib/components/Tag/SelectableTag.js +3 -3
- package/lib/components/Tag/Tag.js +2 -2
- package/lib/components/Text/Text.d.ts +1 -1
- package/lib/components/Text/Text.js +0 -1
- package/lib/components/Text/TextDirection.d.ts +1 -1
- package/lib/components/Text/TextDirection.js +0 -1
- package/lib/components/Text/createTextComponent.d.ts +2 -8
- package/lib/components/Text/createTextComponent.js +2 -2
- package/lib/components/Text/index.d.ts +0 -8
- package/lib/components/TextArea/TextArea.js +2 -2
- package/lib/components/TextInput/TextInput.js +2 -2
- package/lib/components/Tile/Tile.js +2 -2
- package/lib/components/Toggle/Toggle.js +2 -2
- package/lib/components/UIShell/Switcher.js +0 -26
- package/lib/index.d.ts +27 -23
- package/lib/index.js +55 -6
- package/lib/internal/useNormalizedInputProps.js +2 -2
- package/lib/internal/usePresence.d.ts +17 -0
- package/lib/internal/usePresence.js +68 -0
- package/lib/internal/usePresenceContext.d.ts +25 -0
- package/lib/internal/usePresenceContext.js +48 -0
- package/lib/tools/mergeRefs.d.ts +5 -5
- package/lib/tools/mergeRefs.js +16 -14
- package/package.json +8 -8
- package/telemetry.yml +5 -2
- package/es/components/Text/index.js +0 -16
- package/lib/components/Text/index.js +0 -20
|
@@ -17,6 +17,26 @@ export declare const translationIds: {
|
|
|
17
17
|
type TranslationKey = keyof typeof translationIds;
|
|
18
18
|
type ExcludedAttributes = 'defaultValue' | 'id' | 'min' | 'max' | 'onChange' | 'onClick' | 'size' | 'step' | 'value';
|
|
19
19
|
export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes>, TranslateWithId<TranslationKey> {
|
|
20
|
+
/**
|
|
21
|
+
* Optional validation function that is called with the input value and locale.
|
|
22
|
+
* This is called before other validations, giving consumers the ability
|
|
23
|
+
* to short-circuit or extend validation without replacing built-in rules
|
|
24
|
+
* @example
|
|
25
|
+
* // Using the built-in separator validation
|
|
26
|
+
* <NumberInput validate={validateNumberSeparators} />
|
|
27
|
+
*
|
|
28
|
+
* // Combining with custom validation
|
|
29
|
+
* <NumberInput
|
|
30
|
+
* validate={(value, locale) => {
|
|
31
|
+
* return validateNumberSeparators(value, locale) && customValidation(value)
|
|
32
|
+
* }}
|
|
33
|
+
* />
|
|
34
|
+
* - Return `false` to immediately fail validation.
|
|
35
|
+
* - Return `true` to pass this validation, but still run other checks (min, max, required, etc.).
|
|
36
|
+
* - Return `undefined` to defer entirely to built-in validation logic.
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
validate?: (value: string, locale: string) => boolean | undefined;
|
|
20
40
|
/**
|
|
21
41
|
* `true` to allow empty string.
|
|
22
42
|
*/
|
|
@@ -186,16 +206,6 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
186
206
|
*/
|
|
187
207
|
warnText?: ReactNode;
|
|
188
208
|
}
|
|
209
|
+
export declare const validateNumberSeparators: (input: string, locale: string) => boolean;
|
|
189
210
|
declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
190
|
-
export interface Label {
|
|
191
|
-
disabled?: boolean;
|
|
192
|
-
hideLabel?: boolean;
|
|
193
|
-
id?: string;
|
|
194
|
-
label?: ReactNode;
|
|
195
|
-
}
|
|
196
|
-
export interface HelperTextProps {
|
|
197
|
-
id?: string;
|
|
198
|
-
description?: ReactNode;
|
|
199
|
-
disabled?: boolean;
|
|
200
|
-
}
|
|
201
211
|
export { NumberInput };
|
|
@@ -16,7 +16,8 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
16
16
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
17
17
|
import '../FluidForm/FluidForm.js';
|
|
18
18
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
19
|
-
import '../Text/
|
|
19
|
+
import { Text } from '../Text/Text.js';
|
|
20
|
+
import '../Text/TextDirection.js';
|
|
20
21
|
import { clamp } from '../../internal/clamp.js';
|
|
21
22
|
import { useControllableState } from '../../internal/useControllableState.js';
|
|
22
23
|
import { NumberParser, NumberFormatter } from '@carbon/utilities';
|
|
@@ -25,7 +26,6 @@ import { match } from '../../internal/keyboard/match.js';
|
|
|
25
26
|
import { NumberFormatOptionsPropType } from './NumberFormatPropTypes.js';
|
|
26
27
|
import { AILabel } from '../AILabel/index.js';
|
|
27
28
|
import { isComponentElement } from '../../internal/utils.js';
|
|
28
|
-
import { Text } from '../Text/Text.js';
|
|
29
29
|
|
|
30
30
|
var _Subtract, _Add;
|
|
31
31
|
const translationIds = {
|
|
@@ -41,6 +41,7 @@ const defaultTranslations = {
|
|
|
41
41
|
[translationIds['increment.number']]: 'Increment number',
|
|
42
42
|
[translationIds['decrement.number']]: 'Decrement number'
|
|
43
43
|
};
|
|
44
|
+
|
|
44
45
|
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
45
46
|
const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
46
47
|
const {
|
|
@@ -75,6 +76,7 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
|
75
76
|
translateWithId: t = id => defaultTranslations[id],
|
|
76
77
|
type = 'number',
|
|
77
78
|
defaultValue = type === 'number' ? 0 : NaN,
|
|
79
|
+
validate,
|
|
78
80
|
warn = false,
|
|
79
81
|
warnText = '',
|
|
80
82
|
stepStartValue = 0,
|
|
@@ -121,7 +123,6 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
|
121
123
|
* Only used when type="text"
|
|
122
124
|
*/
|
|
123
125
|
const [previousNumberValue, setPreviousNumberValue] = useState(numberValue);
|
|
124
|
-
|
|
125
126
|
/**
|
|
126
127
|
* The current text value of the input.
|
|
127
128
|
* Only used when type=text
|
|
@@ -152,9 +153,11 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
|
152
153
|
const isInputValid = getInputValidity({
|
|
153
154
|
allowEmpty,
|
|
154
155
|
invalid,
|
|
155
|
-
value: type === 'number' ? value : numberValue,
|
|
156
|
+
value: validate ? inputValue : type === 'number' ? value : numberValue,
|
|
156
157
|
max,
|
|
157
|
-
min
|
|
158
|
+
min,
|
|
159
|
+
validate,
|
|
160
|
+
locale
|
|
158
161
|
});
|
|
159
162
|
const normalizedProps = useNormalizedInputProps({
|
|
160
163
|
id,
|
|
@@ -212,8 +215,6 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
|
212
215
|
}
|
|
213
216
|
if (type === 'text') {
|
|
214
217
|
const _value = allowEmpty && event.target.value === '' ? '' : event.target.value;
|
|
215
|
-
|
|
216
|
-
// When isControlled, setNumberValue will not update numberValue in useControllableState.
|
|
217
218
|
setNumberValue(numberParser.parse(_value));
|
|
218
219
|
setInputValue(_value);
|
|
219
220
|
// The onChange prop isn't called here because it will be called on blur
|
|
@@ -263,7 +264,7 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
|
263
264
|
rawValue = currentValue - step;
|
|
264
265
|
}
|
|
265
266
|
const precision = Math.max(getDecimalPlaces(currentValue), getDecimalPlaces(step));
|
|
266
|
-
const floatValue = parseFloat(rawValue.toFixed(precision));
|
|
267
|
+
const floatValue = parseFloat(Number(rawValue).toFixed(precision));
|
|
267
268
|
const newValue = clamp(floatValue, min ?? -Infinity, max ?? Infinity);
|
|
268
269
|
const state = {
|
|
269
270
|
value: newValue,
|
|
@@ -374,13 +375,15 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
|
374
375
|
// they've passed in.
|
|
375
376
|
const _numberValue = isControlled ? numberParser.parse(inputValue) : numberValue;
|
|
376
377
|
const formattedValue = isNaN(_numberValue) ? '' : format(_numberValue);
|
|
377
|
-
|
|
378
|
-
|
|
378
|
+
const rawValue = e.target.value;
|
|
379
|
+
// Validate raw input
|
|
380
|
+
const isValid = validate ? validate(rawValue, locale) : true;
|
|
381
|
+
setInputValue(isValid ? formattedValue : rawValue);
|
|
379
382
|
// Calling format() can alter the number (such as rounding it)
|
|
380
383
|
// causing the _numberValue to mismatch the formatted value in
|
|
381
384
|
// the input. To avoid this, formattedValue is re-parsed.
|
|
382
385
|
const parsedFormattedNewValue = numberParser.parse(formattedValue);
|
|
383
|
-
if (onChange) {
|
|
386
|
+
if (onChange && isValid) {
|
|
384
387
|
const state = {
|
|
385
388
|
value: parsedFormattedNewValue,
|
|
386
389
|
direction: previousNumberValue < parsedFormattedNewValue ? 'up' : 'down'
|
|
@@ -614,7 +617,18 @@ NumberInput.propTypes = {
|
|
|
614
617
|
/**
|
|
615
618
|
* Provide the text that is displayed when the control is in warning state
|
|
616
619
|
*/
|
|
617
|
-
warnText: PropTypes.node
|
|
620
|
+
warnText: PropTypes.node,
|
|
621
|
+
/**
|
|
622
|
+
* Optional validation function that is called with the input value and locale.
|
|
623
|
+
*
|
|
624
|
+
* - Return `false` to immediately fail validation.
|
|
625
|
+
* - Return `true` to pass this validation, but still run other checks (min, max, required, etc.).
|
|
626
|
+
* - Return `undefined` to defer entirely to built-in validation logic.
|
|
627
|
+
*
|
|
628
|
+
* This is called before other validations, giving consumers the ability
|
|
629
|
+
* to short-circuit or extend validation without replacing built-in rules.
|
|
630
|
+
*/
|
|
631
|
+
validate: PropTypes.func
|
|
618
632
|
};
|
|
619
633
|
const Label = ({
|
|
620
634
|
disabled,
|
|
@@ -637,17 +651,11 @@ const Label = ({
|
|
|
637
651
|
}
|
|
638
652
|
return null;
|
|
639
653
|
};
|
|
640
|
-
|
|
641
|
-
disabled: PropTypes.bool,
|
|
642
|
-
hideLabel: PropTypes.bool,
|
|
643
|
-
id: PropTypes.string,
|
|
644
|
-
label: PropTypes.node
|
|
645
|
-
};
|
|
646
|
-
function HelperText({
|
|
654
|
+
const HelperText = ({
|
|
647
655
|
disabled,
|
|
648
656
|
description,
|
|
649
657
|
id
|
|
650
|
-
}) {
|
|
658
|
+
}) => {
|
|
651
659
|
const prefix = usePrefix();
|
|
652
660
|
const className = cx(`${prefix}--form__helper-text`, {
|
|
653
661
|
[`${prefix}--form__helper-text--disabled`]: disabled
|
|
@@ -660,11 +668,6 @@ function HelperText({
|
|
|
660
668
|
}, description);
|
|
661
669
|
}
|
|
662
670
|
return null;
|
|
663
|
-
}
|
|
664
|
-
HelperText.propTypes = {
|
|
665
|
-
description: PropTypes.node,
|
|
666
|
-
disabled: PropTypes.bool,
|
|
667
|
-
id: PropTypes.string
|
|
668
671
|
};
|
|
669
672
|
|
|
670
673
|
/**
|
|
@@ -678,6 +681,8 @@ HelperText.propTypes = {
|
|
|
678
681
|
* @param {number} config.value
|
|
679
682
|
* @param {number} config.max
|
|
680
683
|
* @param {number} config.min
|
|
684
|
+
* @param {Function} config.validate
|
|
685
|
+
* @param {string} config.locale
|
|
681
686
|
* @returns {boolean}
|
|
682
687
|
*/
|
|
683
688
|
function getInputValidity({
|
|
@@ -685,8 +690,17 @@ function getInputValidity({
|
|
|
685
690
|
invalid,
|
|
686
691
|
value,
|
|
687
692
|
max,
|
|
688
|
-
min
|
|
693
|
+
min,
|
|
694
|
+
validate,
|
|
695
|
+
locale
|
|
689
696
|
}) {
|
|
697
|
+
if (typeof validate === 'function') {
|
|
698
|
+
const result = validate(value, locale);
|
|
699
|
+
if (result === false) {
|
|
700
|
+
return false; // immediate invalid
|
|
701
|
+
}
|
|
702
|
+
// If true or undefined, continue to further validations
|
|
703
|
+
}
|
|
690
704
|
if (invalid) {
|
|
691
705
|
return false;
|
|
692
706
|
}
|
|
@@ -17,7 +17,7 @@ import { matches } from '../../internal/keyboard/match.js';
|
|
|
17
17
|
import { noopFn } from '../../internal/noopFn.js';
|
|
18
18
|
import { PrefixContext } from '../../internal/usePrefix.js';
|
|
19
19
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
20
|
-
import mergeRefs from '../../tools/mergeRefs.js';
|
|
20
|
+
import { mergeRefs } from '../../tools/mergeRefs.js';
|
|
21
21
|
import { setupGetInstanceId } from '../../tools/setupGetInstanceId.js';
|
|
22
22
|
import { IconButton } from '../IconButton/index.js';
|
|
23
23
|
import { useOutsideClick } from '../../internal/useOutsideClick.js';
|
|
@@ -171,8 +171,7 @@ const OverflowMenu = /*#__PURE__*/forwardRef(({
|
|
|
171
171
|
if (onCloseMenu) {
|
|
172
172
|
onCloseMenu();
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
}, [onClose]);
|
|
174
|
+
}, []);
|
|
176
175
|
const closeMenuAndFocus = useCallback(() => {
|
|
177
176
|
const wasClicked = click;
|
|
178
177
|
const wasOpen = open;
|
|
@@ -15,7 +15,7 @@ import { useFeatureFlag } from '../../FeatureFlags/index.js';
|
|
|
15
15
|
import { IconButton } from '../../IconButton/index.js';
|
|
16
16
|
import { Menu } from '../../Menu/Menu.js';
|
|
17
17
|
import '../../Menu/MenuItem.js';
|
|
18
|
-
import mergeRefs from '../../../tools/mergeRefs.js';
|
|
18
|
+
import { mergeRefs } from '../../../tools/mergeRefs.js';
|
|
19
19
|
import { useId } from '../../../internal/useId.js';
|
|
20
20
|
import { usePrefix } from '../../../internal/usePrefix.js';
|
|
21
21
|
import { useAttachedMenu } from '../../../internal/useAttachedMenu.js';
|
|
@@ -13,8 +13,8 @@ import { ArrowDown, ArrowUp } from '../../internal/keyboard/keys.js';
|
|
|
13
13
|
import { match } from '../../internal/keyboard/match.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
15
|
import { warning } from '../../internal/warning.js';
|
|
16
|
-
import '../Text/index.js';
|
|
17
16
|
import { Text } from '../Text/Text.js';
|
|
17
|
+
import '../Text/TextDirection.js';
|
|
18
18
|
|
|
19
19
|
const frFn = forwardRef;
|
|
20
20
|
const OverflowMenuItem = frFn((props, ref) => {
|
|
@@ -12,7 +12,8 @@ import cx from 'classnames';
|
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
import { breakpoints } from '@carbon/layout';
|
|
14
14
|
import { useMatchMedia } from '../../internal/useMatchMedia.js';
|
|
15
|
-
import '../Text/
|
|
15
|
+
import { Text } from '../Text/Text.js';
|
|
16
|
+
import '../Text/TextDirection.js';
|
|
16
17
|
import { MenuButton } from '../MenuButton/index.js';
|
|
17
18
|
import '../Menu/Menu.js';
|
|
18
19
|
import { MenuItem } from '../Menu/MenuItem.js';
|
|
@@ -34,7 +35,6 @@ import '../Grid/Row.js';
|
|
|
34
35
|
import Column from '../Grid/Column.js';
|
|
35
36
|
import '../Grid/ColumnHang.js';
|
|
36
37
|
import '../Grid/GridContext.js';
|
|
37
|
-
import { Text } from '../Text/Text.js';
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* ----------
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { TranslateWithId } from '../../types/common';
|
|
9
|
+
type TooltipAlignment = 'start' | 'center' | 'end';
|
|
10
|
+
type TooltipPosition = 'top' | 'right' | 'bottom' | 'left';
|
|
9
11
|
declare const translationIds: {
|
|
10
12
|
readonly 'carbon.pagination-nav.next': "Next";
|
|
11
13
|
readonly 'carbon.pagination-nav.previous': "Previous";
|
|
@@ -34,6 +36,14 @@ export interface DirectionButtonProps {
|
|
|
34
36
|
* The callback function called when the button is clicked.
|
|
35
37
|
*/
|
|
36
38
|
onClick?: React.MouseEventHandler;
|
|
39
|
+
/**
|
|
40
|
+
* Specify the alignment of the tooltip for the icon-only next/prev buttons.
|
|
41
|
+
*/
|
|
42
|
+
tooltipAlignment?: TooltipAlignment;
|
|
43
|
+
/**
|
|
44
|
+
* Specify the position of the tooltip for the icon-only next/prev buttons.
|
|
45
|
+
*/
|
|
46
|
+
tooltipPosition?: TooltipPosition;
|
|
37
47
|
}
|
|
38
48
|
export interface PaginationItemProps extends TranslateWithId<'carbon.pagination-nav.item' | 'carbon.pagination-nav.active'> {
|
|
39
49
|
/**
|
|
@@ -98,6 +108,16 @@ export interface PaginationNavProps extends Omit<React.HTMLAttributes<HTMLElemen
|
|
|
98
108
|
* Specify the size of the PaginationNav.
|
|
99
109
|
*/
|
|
100
110
|
size?: 'sm' | 'md' | 'lg';
|
|
111
|
+
/**
|
|
112
|
+
* Specify the alignment of the tooltip for the icon-only next/prev buttons.
|
|
113
|
+
* Can be one of: start, center, or end.
|
|
114
|
+
*/
|
|
115
|
+
tooltipAlignment?: TooltipAlignment;
|
|
116
|
+
/**
|
|
117
|
+
* Specify the position of the tooltip for the icon-only next/prev buttons.
|
|
118
|
+
* Can be one of: top, right, bottom, or left.
|
|
119
|
+
*/
|
|
120
|
+
tooltipPosition?: TooltipPosition;
|
|
101
121
|
/**
|
|
102
122
|
* The total number of items.
|
|
103
123
|
*/
|
|
@@ -68,13 +68,16 @@ function DirectionButton({
|
|
|
68
68
|
direction,
|
|
69
69
|
label,
|
|
70
70
|
disabled,
|
|
71
|
-
onClick
|
|
71
|
+
onClick,
|
|
72
|
+
tooltipAlignment = 'center',
|
|
73
|
+
tooltipPosition = 'bottom'
|
|
72
74
|
}) {
|
|
73
75
|
const prefix = usePrefix();
|
|
76
|
+
const align = tooltipAlignment === 'center' ? tooltipPosition : `${tooltipPosition}-${tooltipAlignment}`;
|
|
74
77
|
return /*#__PURE__*/React.createElement("li", {
|
|
75
78
|
className: `${prefix}--pagination-nav__list-item`
|
|
76
79
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
77
|
-
align:
|
|
80
|
+
align: align,
|
|
78
81
|
disabled: disabled,
|
|
79
82
|
kind: "ghost",
|
|
80
83
|
label: label,
|
|
@@ -173,6 +176,8 @@ const PaginationNav = /*#__PURE__*/React.forwardRef(({
|
|
|
173
176
|
page = 0,
|
|
174
177
|
loop = false,
|
|
175
178
|
size = 'lg',
|
|
179
|
+
tooltipAlignment,
|
|
180
|
+
tooltipPosition,
|
|
176
181
|
translateWithId: t = translateWithId,
|
|
177
182
|
...rest
|
|
178
183
|
}, ref) => {
|
|
@@ -276,7 +281,9 @@ const PaginationNav = /*#__PURE__*/React.forwardRef(({
|
|
|
276
281
|
"aria-label": t('carbon.pagination-nav.previous'),
|
|
277
282
|
label: t('carbon.pagination-nav.previous'),
|
|
278
283
|
disabled: backwardButtonDisabled,
|
|
279
|
-
onClick: jumpToPrevious
|
|
284
|
+
onClick: jumpToPrevious,
|
|
285
|
+
tooltipAlignment: tooltipAlignment,
|
|
286
|
+
tooltipPosition: tooltipPosition
|
|
280
287
|
}),
|
|
281
288
|
// render first item if at least 5 items can be displayed or
|
|
282
289
|
// 4 items can be displayed and the current page is either 0 or 1
|
|
@@ -321,7 +328,9 @@ const PaginationNav = /*#__PURE__*/React.forwardRef(({
|
|
|
321
328
|
"aria-label": t('carbon.pagination-nav.next'),
|
|
322
329
|
label: t('carbon.pagination-nav.next'),
|
|
323
330
|
disabled: forwardButtonDisabled,
|
|
324
|
-
onClick: jumpToNext
|
|
331
|
+
onClick: jumpToNext,
|
|
332
|
+
tooltipAlignment: tooltipAlignment,
|
|
333
|
+
tooltipPosition: tooltipPosition
|
|
325
334
|
})), /*#__PURE__*/React.createElement("div", {
|
|
326
335
|
"aria-live": "polite",
|
|
327
336
|
"aria-atomic": "true",
|
|
@@ -344,7 +353,17 @@ DirectionButton.propTypes = {
|
|
|
344
353
|
/**
|
|
345
354
|
* The callback function called when the button is clicked.
|
|
346
355
|
*/
|
|
347
|
-
onClick: PropTypes.func
|
|
356
|
+
onClick: PropTypes.func,
|
|
357
|
+
/**
|
|
358
|
+
* Specify how the tooltip should align with the navigation button.
|
|
359
|
+
* Can be one of: start, center, or end.
|
|
360
|
+
*/
|
|
361
|
+
tooltipAlignment: PropTypes.oneOf(['start', 'center', 'end']),
|
|
362
|
+
/**
|
|
363
|
+
* Specify the position of the tooltip relative to the navigation button.
|
|
364
|
+
* Can be one of: top, right, bottom, or left.
|
|
365
|
+
*/
|
|
366
|
+
tooltipPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left'])
|
|
348
367
|
};
|
|
349
368
|
PaginationItem.propTypes = {
|
|
350
369
|
/**
|
|
@@ -415,6 +434,16 @@ PaginationNav.propTypes = {
|
|
|
415
434
|
* Specify the size of the PaginationNav.
|
|
416
435
|
*/
|
|
417
436
|
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
437
|
+
/**
|
|
438
|
+
* Specify the alignment of the tooltip for the icon-only prev/next buttons.
|
|
439
|
+
* Can be one of: start, center, or end.
|
|
440
|
+
*/
|
|
441
|
+
tooltipAlignment: PropTypes.oneOf(['start', 'center', 'end']),
|
|
442
|
+
/**
|
|
443
|
+
* Specify the position of the tooltip for the icon-only prev/next buttons.
|
|
444
|
+
* Can be one of: top, right, bottom, or left.
|
|
445
|
+
*/
|
|
446
|
+
tooltipPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
|
418
447
|
/**
|
|
419
448
|
* The total number of items.
|
|
420
449
|
*/
|
|
@@ -13,8 +13,8 @@ import { Enter, Space } from '../../internal/keyboard/keys.js';
|
|
|
13
13
|
import { matches } from '../../internal/keyboard/match.js';
|
|
14
14
|
import { Warning, Incomplete, CheckmarkOutline, CircleDash } from '@carbon/icons-react';
|
|
15
15
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
|
-
import '../Text/index.js';
|
|
17
16
|
import { Text } from '../Text/Text.js';
|
|
17
|
+
import '../Text/TextDirection.js';
|
|
18
18
|
|
|
19
19
|
const defaultTranslations = {
|
|
20
20
|
'carbon.progress-step.complete': 'Complete',
|
|
@@ -9,14 +9,14 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React, { useRef, cloneElement } from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import '../Text/
|
|
12
|
+
import { Text } from '../Text/Text.js';
|
|
13
|
+
import '../Text/TextDirection.js';
|
|
13
14
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
14
15
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
16
|
import { useId } from '../../internal/useId.js';
|
|
16
|
-
import mergeRefs from '../../tools/mergeRefs.js';
|
|
17
|
+
import { mergeRefs } from '../../tools/mergeRefs.js';
|
|
17
18
|
import { AILabel } from '../AILabel/index.js';
|
|
18
19
|
import { isComponentElement } from '../../internal/utils.js';
|
|
19
|
-
import { Text } from '../Text/Text.js';
|
|
20
20
|
|
|
21
21
|
const RadioButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
22
22
|
const {
|
|
@@ -9,11 +9,11 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React, { useState, useRef, cloneElement } from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import { Legend } from '../Text/
|
|
12
|
+
import { Legend } from '../Text/createTextComponent.js';
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
15
15
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
16
|
-
import mergeRefs from '../../tools/mergeRefs.js';
|
|
16
|
+
import { mergeRefs } from '../../tools/mergeRefs.js';
|
|
17
17
|
import { useId } from '../../internal/useId.js';
|
|
18
18
|
import { AILabel } from '../AILabel/index.js';
|
|
19
19
|
import { isComponentElement } from '../../internal/utils.js';
|
|
@@ -16,11 +16,11 @@ import { useFallbackId } from '../../internal/useId.js';
|
|
|
16
16
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
17
17
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
18
18
|
import { noopFn } from '../../internal/noopFn.js';
|
|
19
|
-
import '../Text/
|
|
19
|
+
import { Text } from '../Text/Text.js';
|
|
20
|
+
import '../Text/TextDirection.js';
|
|
20
21
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
21
22
|
import { AILabel } from '../AILabel/index.js';
|
|
22
23
|
import { isComponentElement } from '../../internal/utils.js';
|
|
23
|
-
import { Text } from '../Text/Text.js';
|
|
24
24
|
|
|
25
25
|
var _RadioButtonChecked, _RadioButton, _CheckmarkFilled;
|
|
26
26
|
const RadioTile = /*#__PURE__*/React.forwardRef(({
|
|
@@ -16,10 +16,10 @@ import '../FluidForm/FluidForm.js';
|
|
|
16
16
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
17
17
|
import { useId } from '../../internal/useId.js';
|
|
18
18
|
import { composeEventHandlers } from '../../tools/events.js';
|
|
19
|
-
import '../Text/
|
|
19
|
+
import { Text } from '../Text/Text.js';
|
|
20
|
+
import '../Text/TextDirection.js';
|
|
20
21
|
import { AILabel } from '../AILabel/index.js';
|
|
21
22
|
import { isComponentElement } from '../../internal/utils.js';
|
|
22
|
-
import { Text } from '../Text/Text.js';
|
|
23
23
|
|
|
24
24
|
const Select = /*#__PURE__*/React.forwardRef(({
|
|
25
25
|
className,
|
|
@@ -14,13 +14,13 @@ import { matches } from '../../internal/keyboard/match.js';
|
|
|
14
14
|
import { PrefixContext } from '../../internal/usePrefix.js';
|
|
15
15
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
16
16
|
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
17
|
-
import '../Text/
|
|
17
|
+
import { Text } from '../Text/Text.js';
|
|
18
|
+
import '../Text/TextDirection.js';
|
|
18
19
|
import '../Tooltip/DefinitionTooltip.js';
|
|
19
20
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
20
21
|
import { LowerHandle, LowerHandleFocus, UpperHandle, UpperHandleFocus } from './SliderHandles.js';
|
|
21
22
|
import { clamp } from '../../internal/clamp.js';
|
|
22
23
|
import { throttle } from '../../node_modules/es-toolkit/dist/compat/function/throttle.js';
|
|
23
|
-
import { Text } from '../Text/Text.js';
|
|
24
24
|
|
|
25
25
|
const ThumbWrapper = ({
|
|
26
26
|
hasTooltip,
|
|
@@ -12,10 +12,10 @@ import cx from 'classnames';
|
|
|
12
12
|
import { useId } from '../../internal/useId.js';
|
|
13
13
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
|
-
import '../Text/
|
|
15
|
+
import { Text } from '../Text/Text.js';
|
|
16
|
+
import '../Text/TextDirection.js';
|
|
16
17
|
import { RadioButtonChecked, RadioButton } from '@carbon/icons-react';
|
|
17
18
|
import { useOutsideClick } from '../../internal/useOutsideClick.js';
|
|
18
|
-
import { Text } from '../Text/Text.js';
|
|
19
19
|
|
|
20
20
|
var _StructuredListCell;
|
|
21
21
|
const GridSelectedRowStateContext = /*#__PURE__*/React.createContext(null);
|
|
@@ -32,10 +32,10 @@ import { usePressable } from './usePressable.js';
|
|
|
32
32
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
33
33
|
import { useEvent } from '../../internal/useEvent.js';
|
|
34
34
|
import { useMatchMedia } from '../../internal/useMatchMedia.js';
|
|
35
|
-
import '../Text/
|
|
35
|
+
import { Text } from '../Text/Text.js';
|
|
36
|
+
import '../Text/TextDirection.js';
|
|
36
37
|
import { BadgeIndicator } from '../BadgeIndicator/index.js';
|
|
37
38
|
import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.js';
|
|
38
|
-
import { Text } from '../Text/Text.js';
|
|
39
39
|
|
|
40
40
|
var _ChevronLeft, _ChevronRight, _BadgeIndicator;
|
|
41
41
|
const verticalTabHeight = 64;
|
|
@@ -16,12 +16,12 @@ import Tag, { TYPES, SIZES } from './Tag.js';
|
|
|
16
16
|
import { Close } from '@carbon/icons-react';
|
|
17
17
|
import '../Tooltip/DefinitionTooltip.js';
|
|
18
18
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
19
|
-
import '../Text/
|
|
19
|
+
import { Text } from '../Text/Text.js';
|
|
20
|
+
import '../Text/TextDirection.js';
|
|
20
21
|
import { isEllipsisActive } from './isEllipsisActive.js';
|
|
21
|
-
import mergeRefs from '../../tools/mergeRefs.js';
|
|
22
|
+
import { mergeRefs } from '../../tools/mergeRefs.js';
|
|
22
23
|
import { AILabel } from '../AILabel/index.js';
|
|
23
24
|
import { isComponentElement } from '../../internal/utils.js';
|
|
24
|
-
import { Text } from '../Text/Text.js';
|
|
25
25
|
|
|
26
26
|
var _Close;
|
|
27
27
|
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
@@ -14,10 +14,10 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
14
14
|
import Tag, { SIZES } from './Tag.js';
|
|
15
15
|
import '../Tooltip/DefinitionTooltip.js';
|
|
16
16
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
17
|
-
import '../Text/index.js';
|
|
18
|
-
import { isEllipsisActive } from './isEllipsisActive.js';
|
|
19
|
-
import mergeRefs from '../../tools/mergeRefs.js';
|
|
20
17
|
import { Text } from '../Text/Text.js';
|
|
18
|
+
import '../Text/TextDirection.js';
|
|
19
|
+
import { isEllipsisActive } from './isEllipsisActive.js';
|
|
20
|
+
import { mergeRefs } from '../../tools/mergeRefs.js';
|
|
21
21
|
|
|
22
22
|
const TYPES = {
|
|
23
23
|
red: 'Red',
|
|
@@ -14,11 +14,11 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
14
14
|
import Tag, { SIZES } from './Tag.js';
|
|
15
15
|
import '../Tooltip/DefinitionTooltip.js';
|
|
16
16
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
17
|
-
import '../Text/
|
|
17
|
+
import { Text } from '../Text/Text.js';
|
|
18
|
+
import '../Text/TextDirection.js';
|
|
18
19
|
import { isEllipsisActive } from './isEllipsisActive.js';
|
|
19
|
-
import mergeRefs from '../../tools/mergeRefs.js';
|
|
20
|
+
import { mergeRefs } from '../../tools/mergeRefs.js';
|
|
20
21
|
import { useControllableState } from '../../internal/useControllableState.js';
|
|
21
|
-
import { Text } from '../Text/Text.js';
|
|
22
22
|
|
|
23
23
|
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
24
24
|
const SelectableTag = /*#__PURE__*/forwardRef(({
|
package/es/components/Tag/Tag.js
CHANGED
|
@@ -12,7 +12,8 @@ import cx from 'classnames';
|
|
|
12
12
|
import { Close } from '@carbon/icons-react';
|
|
13
13
|
import { useId } from '../../internal/useId.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
|
-
import '../Text/
|
|
15
|
+
import { Text } from '../Text/Text.js';
|
|
16
|
+
import '../Text/TextDirection.js';
|
|
16
17
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
17
18
|
import { DefinitionTooltip } from '../Tooltip/DefinitionTooltip.js';
|
|
18
19
|
import '../Tooltip/Tooltip.js';
|
|
@@ -20,7 +21,6 @@ import { isEllipsisActive } from './isEllipsisActive.js';
|
|
|
20
21
|
import { useMergedRefs } from '../../internal/useMergedRefs.js';
|
|
21
22
|
import { AILabel } from '../AILabel/index.js';
|
|
22
23
|
import { isComponentElement } from '../../internal/utils.js';
|
|
23
|
-
import { Text } from '../Text/Text.js';
|
|
24
24
|
|
|
25
25
|
var _Close;
|
|
26
26
|
const TYPES = {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { type ElementType, type ReactElement, type ReactNode } from 'react';
|
|
8
8
|
import { PolymorphicComponentPropWithRef, PolymorphicRef } from '../../internal/PolymorphicProps';
|
|
9
|
-
import { type TextDir } from '
|
|
9
|
+
import { type TextDir } from './TextDirectionContext';
|
|
10
10
|
export interface TextBaseProps {
|
|
11
11
|
dir?: TextDir;
|
|
12
12
|
children?: ReactNode;
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React, { useContext, Children } from 'react';
|
|
11
|
-
import './index.js';
|
|
12
11
|
import { TextDirectionContext } from './TextDirectionContext.js';
|
|
13
12
|
|
|
14
13
|
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { ReactNode } from 'react';
|
|
9
|
-
import { type GetTextDirection, type TextDir } from '
|
|
9
|
+
import { type GetTextDirection, type TextDir } from './TextDirectionContext';
|
|
10
10
|
export interface TextDirectionProps {
|
|
11
11
|
children: ReactNode;
|
|
12
12
|
dir?: TextDir;
|
|
@@ -5,14 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { type ElementType } from 'react';
|
|
8
|
-
import { TextProps } from '
|
|
9
|
-
|
|
10
|
-
* Create a text component wrapper for a given text node type. Useful for
|
|
11
|
-
* returning a `Text` component for a text node like a `<label>`.
|
|
12
|
-
* @param {string} element
|
|
13
|
-
* @param {string} displayName
|
|
14
|
-
*/
|
|
15
|
-
export declare const createTextComponent: (element: ElementType, displayName: string) => {
|
|
8
|
+
import { TextProps } from './Text';
|
|
9
|
+
export declare const Legend: {
|
|
16
10
|
(props: TextProps<ElementType>): import("react/jsx-runtime").JSX.Element;
|
|
17
11
|
displayName: string;
|
|
18
12
|
};
|