@utilitywarehouse/hearth-react-native 0.36.0 → 0.36.2
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/SKILL.md +27 -16
- package/build/components/Accordion/Accordion.d.ts +4 -0
- package/build/components/Accordion/Accordion.js +4 -0
- package/build/components/Accordion/Accordion.props.d.ts +2 -0
- package/build/components/Alert/Alert.d.ts +4 -0
- package/build/components/Alert/Alert.js +4 -0
- package/build/components/Avatar/Avatar.d.ts +4 -0
- package/build/components/Avatar/Avatar.js +4 -0
- package/build/components/Badge/Badge.d.ts +4 -0
- package/build/components/Badge/Badge.js +4 -0
- package/build/components/Badge/Badge.props.d.ts +19 -0
- package/build/components/Banner/Banner.d.ts +5 -0
- package/build/components/Banner/Banner.js +5 -0
- package/build/components/Banner/BannerIllustration.d.ts +4 -0
- package/build/components/Banner/BannerIllustration.js +4 -0
- package/build/components/Banner/BannerImage.d.ts +4 -0
- package/build/components/Banner/BannerImage.js +4 -0
- package/build/components/BodyText/BodyText.d.ts +4 -0
- package/build/components/BodyText/BodyText.js +4 -0
- package/build/components/BottomSheet/BottomSheet.d.ts +6 -0
- package/build/components/BottomSheet/BottomSheet.js +6 -0
- package/build/components/BottomSheet/BottomSheet.props.d.ts +2 -0
- package/build/components/Box/Box.d.ts +4 -0
- package/build/components/Box/Box.js +4 -0
- package/build/components/Box/Box.props.d.ts +2 -0
- package/build/components/Button/Button.d.ts +4 -0
- package/build/components/Button/Button.js +4 -0
- package/build/components/Button/Button.props.d.ts +129 -0
- package/build/components/Card/Card.d.ts +4 -0
- package/build/components/Card/Card.js +4 -0
- package/build/components/Card/Card.props.d.ts +19 -1
- package/build/components/Card/CardAction/CardAction.d.ts +4 -0
- package/build/components/Card/CardAction/CardAction.js +4 -0
- package/build/components/Card/CardAction/CardAction.props.d.ts +23 -0
- package/build/components/Card/CardPressHandler.d.ts +8 -3
- package/build/components/Card/CardPressHandler.js +3 -0
- package/build/components/Carousel/Carousel.d.ts +3 -0
- package/build/components/Carousel/Carousel.js +3 -0
- package/build/components/Carousel/Carousel.props.d.ts +37 -0
- package/build/components/Center/Center.d.ts +3 -0
- package/build/components/Center/Center.js +3 -0
- package/build/components/Checkbox/Checkbox.d.ts +3 -0
- package/build/components/Checkbox/Checkbox.js +3 -0
- package/build/components/Checkbox/Checkbox.props.d.ts +20 -0
- package/build/components/Checkbox/CheckboxGroup.d.ts +3 -0
- package/build/components/Checkbox/CheckboxGroup.js +3 -0
- package/build/components/Checkbox/CheckboxGroup.props.d.ts +24 -0
- package/build/components/Combobox/Combobox.d.ts +3 -0
- package/build/components/Combobox/Combobox.js +3 -0
- package/build/components/Container/Container.d.ts +3 -0
- package/build/components/Container/Container.js +3 -0
- package/build/components/CurrencyInput/CurrencyInput.d.ts +3 -0
- package/build/components/CurrencyInput/CurrencyInput.js +3 -0
- package/build/components/CurrencyInput/CurrencyInput.props.d.ts +25 -0
- package/build/components/DateInput/DateInput.d.ts +4 -0
- package/build/components/DateInput/DateInput.js +4 -0
- package/build/components/DateInput/DateInput.props.d.ts +3 -0
- package/build/components/DatePicker/DatePicker.d.ts +14 -0
- package/build/components/DatePicker/DatePicker.js +4 -0
- package/build/components/DatePicker/DatePicker.props.d.ts +78 -0
- package/build/components/DatePickerInput/DatePickerInput.d.ts +4 -0
- package/build/components/DatePickerInput/DatePickerInput.js +4 -0
- package/build/components/DatePickerInput/DatePickerInput.props.d.ts +21 -0
- package/build/components/DescriptionList/DescriptionList.d.ts +4 -0
- package/build/components/DescriptionList/DescriptionList.js +4 -0
- package/build/components/DescriptionList/DescriptionList.props.d.ts +4 -0
- package/build/components/DetailText/DetailText.d.ts +4 -0
- package/build/components/DetailText/DetailText.js +4 -0
- package/build/components/Divider/Divider.d.ts +4 -0
- package/build/components/Divider/Divider.js +4 -0
- package/build/components/Divider/Divider.props.d.ts +10 -0
- package/build/components/Expandable/Expandable.d.ts +5 -0
- package/build/components/Expandable/Expandable.js +5 -0
- package/build/components/ExpandableCard/ExpandableCard.d.ts +4 -0
- package/build/components/ExpandableCard/ExpandableCard.js +4 -0
- package/build/components/Flex/Flex.d.ts +4 -0
- package/build/components/Flex/Flex.js +4 -0
- package/build/components/Flex/Flex.props.d.ts +20 -0
- package/build/components/FormField/FormField.d.ts +5 -0
- package/build/components/FormField/FormField.js +5 -0
- package/build/components/FormField/FormField.props.d.ts +24 -0
- package/build/components/Grid/Grid.d.ts +4 -0
- package/build/components/Grid/Grid.js +4 -0
- package/build/components/HTMLElements/ListItem.d.ts +5 -0
- package/build/components/HTMLElements/OrderedList.d.ts +10 -0
- package/build/components/HTMLElements/OrderedList.js +4 -0
- package/build/components/HTMLElements/UnorderedList.d.ts +10 -0
- package/build/components/HTMLElements/UnorderedList.js +4 -0
- package/build/components/Heading/Heading.d.ts +4 -0
- package/build/components/Heading/Heading.js +4 -0
- package/build/components/HighlightBanner/HighlightBanner.d.ts +5 -0
- package/build/components/HighlightBanner/HighlightBanner.js +5 -0
- package/build/components/HighlightBanner/HighlightBanner.props.d.ts +14 -0
- package/build/components/HighlightBanner/HighlightBannerImage.d.ts +4 -0
- package/build/components/HighlightBanner/HighlightBannerImage.js +4 -0
- package/build/components/Icon/Icon.d.ts +4 -0
- package/build/components/Icon/Icon.js +4 -0
- package/build/components/Icon/Icon.props.d.ts +8 -0
- package/build/components/IconButton/IconButton.d.ts +5 -0
- package/build/components/IconButton/IconButton.js +5 -0
- package/build/components/IconButton/IconButton.props.d.ts +9 -0
- package/build/components/IconContainer/IconContainer.d.ts +4 -0
- package/build/components/IconContainer/IconContainer.js +4 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.d.ts +6 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.js +6 -0
- package/build/components/InlineLink/InlineLink.d.ts +1 -0
- package/build/components/InlineLink/InlineLink.js +1 -0
- package/build/components/InlineLink/InlineLink.props.d.ts +4 -0
- package/build/components/Input/Input.d.ts +5 -0
- package/build/components/Input/Input.js +5 -0
- package/build/components/Input/Input.props.d.ts +54 -0
- package/build/components/Link/Link.d.ts +5 -0
- package/build/components/Link/Link.js +5 -0
- package/build/components/Link/Link.props.d.ts +15 -0
- package/build/components/List/List.d.ts +1 -0
- package/build/components/List/List.js +1 -0
- package/build/components/List/List.props.d.ts +8 -0
- package/build/components/Menu/Menu.d.ts +1 -0
- package/build/components/Menu/Menu.js +1 -0
- package/build/components/Modal/Modal.d.ts +5 -0
- package/build/components/Modal/Modal.js +5 -1
- package/build/components/Modal/Modal.props.d.ts +6 -0
- package/build/components/Modal/Modal.shared.types.d.ts +32 -0
- package/build/components/Modal/ModalImage.d.ts +1 -0
- package/build/components/Modal/ModalImage.js +1 -0
- package/build/components/NavModal/NavModal.d.ts +8 -0
- package/build/components/NavModal/NavModal.js +8 -0
- package/build/components/NavModal/NavModal.props.d.ts +10 -0
- package/build/components/Pagination/Pagination.d.ts +5 -0
- package/build/components/Pagination/Pagination.js +5 -0
- package/build/components/PillGroup/Pill.d.ts +1 -0
- package/build/components/PillGroup/Pill.js +1 -0
- package/build/components/PillGroup/PillGroup.d.ts +5 -0
- package/build/components/PillGroup/PillGroup.js +5 -0
- package/build/components/ProgressBar/ProgressBar.d.ts +5 -0
- package/build/components/ProgressBar/ProgressBar.js +5 -0
- package/build/components/ProgressBar/ProgressBar.props.d.ts +4 -0
- package/build/components/ProgressStepper/ProgressStep.d.ts +13 -0
- package/build/components/ProgressStepper/ProgressStep.js +5 -0
- package/build/components/ProgressStepper/ProgressStepper.d.ts +5 -0
- package/build/components/ProgressStepper/ProgressStepper.js +5 -0
- package/build/components/Radio/Radio.d.ts +5 -0
- package/build/components/Radio/Radio.js +5 -0
- package/build/components/Radio/Radio.props.d.ts +17 -0
- package/build/components/Radio/RadioGroup.d.ts +5 -0
- package/build/components/Radio/RadioGroup.js +5 -0
- package/build/components/Radio/RadioGroup.props.d.ts +25 -0
- package/build/components/RadioCard/RadioCard.d.ts +10 -0
- package/build/components/RadioCard/RadioCard.js +10 -0
- package/build/components/RadioCard/RadioCard.props.d.ts +14 -0
- package/build/components/RadioCard/RadioCardGroup.d.ts +4 -0
- package/build/components/RadioCard/RadioCardGroup.js +4 -0
- package/build/components/RadioCard/RadioCardGroup.props.d.ts +17 -0
- package/build/components/Rating/Rating.d.ts +5 -0
- package/build/components/Rating/Rating.js +5 -0
- package/build/components/Roundel/Roundel.d.ts +1 -0
- package/build/components/Roundel/Roundel.js +1 -0
- package/build/components/SectionHeader/SectionHeader.d.ts +1 -0
- package/build/components/SectionHeader/SectionHeader.js +1 -0
- package/build/components/SectionHeader/SectionHeader.props.d.ts +7 -0
- package/build/components/SegmentedControl/SegmentedControl.d.ts +5 -0
- package/build/components/SegmentedControl/SegmentedControl.js +5 -0
- package/build/components/Select/Select.d.ts +5 -0
- package/build/components/Select/Select.js +5 -0
- package/build/components/Skeleton/Skeleton.d.ts +1 -0
- package/build/components/Skeleton/Skeleton.js +1 -0
- package/build/components/Skeleton/Skeleton.props.d.ts +4 -0
- package/build/components/Spinner/Spinner.d.ts +4 -0
- package/build/components/Spinner/Spinner.js +8 -0
- package/build/components/Spinner/Spinner.props.d.ts +5 -0
- package/build/components/Spinner/Spinner.web.d.ts +4 -0
- package/build/components/Spinner/Spinner.web.js +8 -0
- package/build/components/StepperInput/StepperInput.d.ts +4 -0
- package/build/components/StepperInput/StepperInput.js +4 -0
- package/build/components/StepperInput/StepperInput.props.d.ts +44 -0
- package/build/components/Switch/Switch.d.ts +4 -0
- package/build/components/Switch/Switch.js +4 -0
- package/build/components/Switch/Switch.props.d.ts +5 -0
- package/build/components/Table/Table.d.ts +4 -0
- package/build/components/Table/Table.js +4 -0
- package/build/components/Table/Table.props.d.ts +6 -0
- package/build/components/Table/TableHeader.d.ts +3 -0
- package/build/components/Table/TableHeader.js +3 -0
- package/build/components/Table/TableHeaderCell.d.ts +6 -0
- package/build/components/Table/TableHeaderCell.js +3 -0
- package/build/components/Tabs/Tabs.d.ts +5 -0
- package/build/components/Tabs/Tabs.js +5 -0
- package/build/components/Textarea/Textarea.d.ts +6 -0
- package/build/components/Textarea/Textarea.js +6 -0
- package/build/components/Textarea/Textarea.props.d.ts +14 -0
- package/build/components/TimePicker/TimePicker.d.ts +5 -0
- package/build/components/TimePicker/TimePicker.js +5 -0
- package/build/components/TimePickerInput/TimePickerInput.d.ts +5 -0
- package/build/components/TimePickerInput/TimePickerInput.js +5 -0
- package/build/components/TimePickerInput/TimePickerInput.props.d.ts +28 -0
- package/build/components/Timeline/Timeline.d.ts +5 -0
- package/build/components/Timeline/Timeline.js +5 -0
- package/build/components/Timeline/TimelineItem.d.ts +4 -0
- package/build/components/Timeline/TimelineItem.js +4 -0
- package/build/components/Toast/Toast.context.d.ts +4 -0
- package/build/components/Toast/Toast.context.js +4 -0
- package/build/components/Toast/Toast.props.d.ts +7 -0
- package/build/components/ToggleButton/ToggleButton.d.ts +4 -0
- package/build/components/ToggleButton/ToggleButton.js +4 -0
- package/build/components/ToggleButton/ToggleButton.props.d.ts +6 -0
- package/build/components/ToggleButtonCard/ToggleButtonCard.d.ts +8 -0
- package/build/components/ToggleButtonCard/ToggleButtonCard.js +8 -0
- package/build/components/ToggleButtonCard/ToggleButtonCard.props.d.ts +9 -0
- package/build/components/ToggleButtonCard/ToggleButtonCardGroup.props.d.ts +15 -0
- package/build/components/UnstyledIconButton/UnstyledIconButton.d.ts +5 -0
- package/build/components/UnstyledIconButton/UnstyledIconButton.js +5 -0
- package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +17 -0
- package/build/components/VerificationInput/VerificationInput.d.ts +4 -0
- package/build/components/VerificationInput/VerificationInput.js +4 -0
- package/package.json +8 -5
- package/public/llms/components/checkbox.md +6 -1
- package/public/llms/components/expandable-card.md +2 -2
- package/public/llms/components/modal.md +4 -0
- package/public/llms/docs/introduction.md +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type SkeletonProps from './Skeleton.props';
|
|
3
|
+
/** A pulsing placeholder block, shown in place of content while it loads. */
|
|
3
4
|
declare const Skeleton: {
|
|
4
5
|
({ width, height, backgroundColor: bg, borderRadius, style, ...props }: SkeletonProps): React.JSX.Element;
|
|
5
6
|
displayName: string;
|
|
@@ -5,6 +5,7 @@ import { StyleSheet } from 'react-native-unistyles';
|
|
|
5
5
|
import { useTheme } from '../../hooks';
|
|
6
6
|
import { getFlattenedColorValue } from '../../utils';
|
|
7
7
|
import getStyleValue from '../../utils/getStyleValue';
|
|
8
|
+
/** A pulsing placeholder block, shown in place of content while it loads. */
|
|
8
9
|
const Skeleton = ({ width, height, backgroundColor: bg, borderRadius, style, ...props }) => {
|
|
9
10
|
const opacity = useSharedValue(1);
|
|
10
11
|
const { components } = useTheme();
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { DimensionValue, ViewProps } from 'react-native';
|
|
2
2
|
import type { ColorValue, BorderRadiusValue } from '../../types';
|
|
3
3
|
interface SkeletonProps extends ViewProps {
|
|
4
|
+
/** The width of the skeleton. */
|
|
4
5
|
width: DimensionValue;
|
|
6
|
+
/** The height of the skeleton. */
|
|
5
7
|
height: DimensionValue;
|
|
8
|
+
/** The background color of the skeleton. Falls back to the theme's loading colour. */
|
|
6
9
|
backgroundColor?: ColorValue;
|
|
10
|
+
/** The border radius of the skeleton. Falls back to the theme's `xs` border radius. */
|
|
7
11
|
borderRadius?: BorderRadiusValue;
|
|
8
12
|
}
|
|
9
13
|
export default SkeletonProps;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type SpinnerProps from './Spinner.props';
|
|
2
|
+
/**
|
|
3
|
+
* Indicates that an asynchronous process is ongoing. Use it on its own or inside
|
|
4
|
+
* another component, such as a `Button` or `Dialog`, while content is loading.
|
|
5
|
+
*/
|
|
2
6
|
declare const Spinner: import("react").ComponentType<SpinnerProps>;
|
|
3
7
|
export default Spinner;
|
|
@@ -9,6 +9,10 @@ import { useTheme } from '../../hooks';
|
|
|
9
9
|
import { getFlattenedColorValue } from '../../utils';
|
|
10
10
|
const AnimatedSvg = Animated.createAnimatedComponent(Svg);
|
|
11
11
|
const AnimatedCircle = Animated.createAnimatedComponent(Circle);
|
|
12
|
+
/**
|
|
13
|
+
* Indicates that an asynchronous process is ongoing. Use it on its own or inside
|
|
14
|
+
* another component, such as a `Button` or `Dialog`, while content is loading.
|
|
15
|
+
*/
|
|
12
16
|
const SpinnerRoot = ({ size = 'md', color, ...props }) => {
|
|
13
17
|
const { components } = useTheme();
|
|
14
18
|
const width = components.spinner[size].size;
|
|
@@ -81,5 +85,9 @@ const styles = StyleSheet.create(theme => ({
|
|
|
81
85
|
},
|
|
82
86
|
},
|
|
83
87
|
}));
|
|
88
|
+
/**
|
|
89
|
+
* Indicates that an asynchronous process is ongoing. Use it on its own or inside
|
|
90
|
+
* another component, such as a `Button` or `Dialog`, while content is loading.
|
|
91
|
+
*/
|
|
84
92
|
const Spinner = createSpinner({ Root: SpinnerRoot });
|
|
85
93
|
export default Spinner;
|
|
@@ -2,7 +2,12 @@ import { RefAttributes } from 'react';
|
|
|
2
2
|
import { type ViewProps } from 'react-native';
|
|
3
3
|
import { ColorValue } from '../../types';
|
|
4
4
|
interface SpinnerProps extends ViewProps, RefAttributes<any> {
|
|
5
|
+
/**
|
|
6
|
+
* The size of the spinner.
|
|
7
|
+
* @default 'md'
|
|
8
|
+
*/
|
|
5
9
|
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
10
|
+
/** The color of the spinner. */
|
|
6
11
|
color?: ColorValue;
|
|
7
12
|
}
|
|
8
13
|
export default SpinnerProps;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type SpinnerProps from './Spinner.props';
|
|
3
|
+
/**
|
|
4
|
+
* Indicates that an asynchronous process is ongoing. Use it on its own or inside
|
|
5
|
+
* another component, such as a `Button` or `Dialog`, while content is loading.
|
|
6
|
+
*/
|
|
3
7
|
declare const Spinner: React.ComponentType<SpinnerProps>;
|
|
4
8
|
export default Spinner;
|
|
@@ -10,6 +10,10 @@ import { useTheme } from '../../hooks';
|
|
|
10
10
|
import { getFlattenedColorValue } from '../../utils';
|
|
11
11
|
const AnimatedSvg = Animated.createAnimatedComponent(Svg);
|
|
12
12
|
const AnimatedCircle = Animated.createAnimatedComponent(Circle);
|
|
13
|
+
/**
|
|
14
|
+
* Indicates that an asynchronous process is ongoing. Use it on its own or inside
|
|
15
|
+
* another component, such as a `Button` or `Dialog`, while content is loading.
|
|
16
|
+
*/
|
|
13
17
|
const SpinnerRoot = ({ size = 'md', color, ...props }) => {
|
|
14
18
|
const { components } = useTheme();
|
|
15
19
|
const width = components.spinner[size].size;
|
|
@@ -77,5 +81,9 @@ const styles = StyleSheet.create(theme => ({
|
|
|
77
81
|
},
|
|
78
82
|
},
|
|
79
83
|
}));
|
|
84
|
+
/**
|
|
85
|
+
* Indicates that an asynchronous process is ongoing. Use it on its own or inside
|
|
86
|
+
* another component, such as a `Button` or `Dialog`, while content is loading.
|
|
87
|
+
*/
|
|
80
88
|
const Spinner = createSpinner({ Root: SpinnerRoot });
|
|
81
89
|
export default Spinner;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import StepperInputProps from './StepperInput.props';
|
|
2
|
+
/**
|
|
3
|
+
* Combines a numeric text input with decrement and increment controls. Use it when a value should
|
|
4
|
+
* stay within a defined range but still needs direct text entry.
|
|
5
|
+
*/
|
|
2
6
|
declare const StepperInput: {
|
|
3
7
|
({ value, defaultValue, onChangeText, onChangeValue, min, max, step, focusInputOnStepPress, validationStatus, disabled, readonly, focused, inBottomSheet, required, label, labelVariant, helperText, helperIcon, validText, invalidText, style, decrementAccessibilityLabel, incrementAccessibilityLabel, onFocus, onBlur, ref, ...props }: StepperInputProps): import("react").JSX.Element;
|
|
4
8
|
displayName: string;
|
|
@@ -8,6 +8,10 @@ import { FormField } from '../FormField';
|
|
|
8
8
|
import { InputComponent, InputField } from '../Input/Input';
|
|
9
9
|
import StepperButton from './StepperButton';
|
|
10
10
|
import { clampValue, formatNumber, getDecimalPlaces, normalizeValue, parseValue, sanitizeValue, } from './StepperInput.utils';
|
|
11
|
+
/**
|
|
12
|
+
* Combines a numeric text input with decrement and increment controls. Use it when a value should
|
|
13
|
+
* stay within a defined range but still needs direct text entry.
|
|
14
|
+
*/
|
|
11
15
|
const StepperInput = ({ value, defaultValue, onChangeText, onChangeValue, min, max, step = 1, focusInputOnStepPress = false, validationStatus = 'initial', disabled = false, readonly = false, focused = false, inBottomSheet = false, required = true, label, labelVariant = 'body', helperText, helperIcon, validText, invalidText, style, decrementAccessibilityLabel = 'Decrease value', incrementAccessibilityLabel = 'Increase value', onFocus, onBlur, ref, ...props }) => {
|
|
12
16
|
const inputRef = useRef(null);
|
|
13
17
|
const isControlled = value !== undefined;
|
|
@@ -2,30 +2,74 @@ import type { ComponentType, Ref } from 'react';
|
|
|
2
2
|
import type { TextInput, TextInputProps, ViewProps } from 'react-native';
|
|
3
3
|
export interface StepperBaseProps {
|
|
4
4
|
ref?: Ref<TextInput>;
|
|
5
|
+
/** Disables the input and both stepper buttons.
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
5
8
|
disabled?: boolean;
|
|
9
|
+
/** Validation styling for the input.
|
|
10
|
+
* @default 'initial'
|
|
11
|
+
*/
|
|
6
12
|
validationStatus?: 'initial' | 'valid' | 'invalid';
|
|
13
|
+
/** Prevents editing and disables both buttons.
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
7
16
|
readonly?: boolean;
|
|
17
|
+
/** Forces the focused visual state on the input.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
8
20
|
focused?: boolean;
|
|
9
21
|
placeholder?: string;
|
|
22
|
+
/** Renders using `BottomSheetTextInput` for use inside a bottom sheet.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
10
25
|
inBottomSheet?: boolean;
|
|
26
|
+
/** Indicates the input is required.
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
11
29
|
required?: boolean;
|
|
30
|
+
/** Label shown above the stepper. */
|
|
12
31
|
label?: string;
|
|
32
|
+
/** Typography variant used for the label.
|
|
33
|
+
* @default 'body'
|
|
34
|
+
*/
|
|
13
35
|
labelVariant?: 'heading' | 'body';
|
|
36
|
+
/** Helper text shown below the label. */
|
|
14
37
|
helperText?: string;
|
|
38
|
+
/** Icon shown next to the helper text. */
|
|
15
39
|
helperIcon?: ComponentType;
|
|
40
|
+
/** Validation text shown when `validationStatus` is `'valid'`. */
|
|
16
41
|
validText?: string;
|
|
42
|
+
/** Validation text shown when `validationStatus` is `'invalid'`. */
|
|
17
43
|
invalidText?: string;
|
|
44
|
+
/** Controlled value displayed in the input. */
|
|
18
45
|
value?: number | string;
|
|
46
|
+
/** Initial value for uncontrolled usage. */
|
|
19
47
|
defaultValue?: number;
|
|
48
|
+
/** Minimum allowed numeric value. */
|
|
20
49
|
min?: number;
|
|
50
|
+
/** Maximum allowed numeric value. */
|
|
21
51
|
max?: number;
|
|
52
|
+
/** Amount added or removed when a step button is pressed.
|
|
53
|
+
* @default 1
|
|
54
|
+
*/
|
|
22
55
|
step?: number;
|
|
56
|
+
/** Called whenever the current text can be parsed as a number. */
|
|
23
57
|
onChangeValue?: (value: number) => void;
|
|
58
|
+
/** Moves focus to the text input after a step button updates the value.
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
24
61
|
focusInputOnStepPress?: boolean;
|
|
62
|
+
/** Accessibility label for the decrement button.
|
|
63
|
+
* @default 'Decrease value'
|
|
64
|
+
*/
|
|
25
65
|
decrementAccessibilityLabel?: string;
|
|
66
|
+
/** Accessibility label for the increment button.
|
|
67
|
+
* @default 'Increase value'
|
|
68
|
+
*/
|
|
26
69
|
incrementAccessibilityLabel?: string;
|
|
27
70
|
}
|
|
28
71
|
export type StepperInputProps = StepperBaseProps & Omit<TextInputProps, 'children' | 'value' | 'defaultValue' | 'onChangeText' | 'editable' | 'keyboardType'> & ViewProps & {
|
|
72
|
+
/** Called whenever the displayed string changes. */
|
|
29
73
|
onChangeText?: (text: string) => void;
|
|
30
74
|
};
|
|
31
75
|
export default StepperInputProps;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import SwitchProps from './Switch.props';
|
|
2
|
+
/**
|
|
3
|
+
* Toggles a single setting on or off. Use it to activate or deactivate an individual
|
|
4
|
+
* option, typically inside a form field or list item.
|
|
5
|
+
*/
|
|
2
6
|
declare const CustomSwitch: ({ value, onValueChange, disabled, size, ...accessibilityProps }: SwitchProps) => import("react").JSX.Element;
|
|
3
7
|
export default CustomSwitch;
|
|
@@ -7,6 +7,10 @@ import { StyleSheet } from 'react-native-unistyles';
|
|
|
7
7
|
import { useAnimatedTheme } from 'react-native-unistyles/reanimated';
|
|
8
8
|
import { useTheme } from '../../hooks';
|
|
9
9
|
import { Icon } from '../Icon';
|
|
10
|
+
/**
|
|
11
|
+
* Toggles a single setting on or off. Use it to activate or deactivate an individual
|
|
12
|
+
* option, typically inside a form field or list item.
|
|
13
|
+
*/
|
|
10
14
|
const CustomSwitch = ({ value = false, onValueChange, disabled = false, size = 'md', ...accessibilityProps }) => {
|
|
11
15
|
const { components } = useTheme();
|
|
12
16
|
const theme = useAnimatedTheme();
|
|
@@ -6,7 +6,12 @@ type SwitchSize = 'sm' | 'md';
|
|
|
6
6
|
*/
|
|
7
7
|
type DeprecatedSwitchSize = 'small' | 'medium';
|
|
8
8
|
interface SwitchProps extends PressableProps, AccessibilityProps {
|
|
9
|
+
/**
|
|
10
|
+
* The value of the switch.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
9
13
|
value: boolean;
|
|
14
|
+
/** Called when the switch value changes. */
|
|
10
15
|
onValueChange?: (value: boolean) => void;
|
|
11
16
|
disabled?: boolean;
|
|
12
17
|
/**
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { TableProps } from './Table.props';
|
|
2
|
+
/**
|
|
3
|
+
* Arranges structured data into rows and columns, with optional pagination beneath the rows.
|
|
4
|
+
* Scrolls horizontally when the columns need more space than the viewport allows.
|
|
5
|
+
*/
|
|
2
6
|
declare const Table: {
|
|
3
7
|
({ children, columnWidths, container, pagination, style, ...props }: TableProps): import("react").JSX.Element;
|
|
4
8
|
displayName: string;
|
|
@@ -34,6 +34,10 @@ const getMaxColumnCount = (children) => {
|
|
|
34
34
|
});
|
|
35
35
|
return maxColumns;
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Arranges structured data into rows and columns, with optional pagination beneath the rows.
|
|
39
|
+
* Scrolls horizontally when the columns need more space than the viewport allows.
|
|
40
|
+
*/
|
|
37
41
|
const Table = ({ children, columnWidths = [], container = 'none', pagination, style, ...props }) => {
|
|
38
42
|
const [containerWidth, setContainerWidth] = useState(0);
|
|
39
43
|
const columnCount = getMaxColumnCount(children);
|
|
@@ -27,6 +27,7 @@ export interface TableBodyProps extends ViewProps {
|
|
|
27
27
|
children: ReactNode;
|
|
28
28
|
}
|
|
29
29
|
export interface TableHeaderProps extends ViewProps {
|
|
30
|
+
/** TableHeaderCell elements rendered as the header row. */
|
|
30
31
|
children: ReactNode;
|
|
31
32
|
/**
|
|
32
33
|
* Visual style for header cells.
|
|
@@ -41,7 +42,12 @@ export interface TableCellProps extends ViewProps {
|
|
|
41
42
|
children?: ReactNode;
|
|
42
43
|
}
|
|
43
44
|
export interface TableHeaderCellProps extends ViewProps {
|
|
45
|
+
/** Cell content; strings and numbers are rendered as body text. */
|
|
44
46
|
children?: ReactNode;
|
|
47
|
+
/**
|
|
48
|
+
* Visual style for the cell, normally set automatically by the parent TableHeader.
|
|
49
|
+
* @default 'white'
|
|
50
|
+
*/
|
|
45
51
|
color?: 'purple' | 'white';
|
|
46
52
|
/**
|
|
47
53
|
* Renders the header cell as a row header within the body.
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { TableHeaderProps } from './Table.props';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a row of TableHeaderCell elements as the header of a Table.
|
|
4
|
+
*/
|
|
2
5
|
declare const TableHeader: {
|
|
3
6
|
({ children, color, style, ...props }: TableHeaderProps): import("react").JSX.Element;
|
|
4
7
|
displayName: string;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Children, cloneElement, isValidElement } from 'react';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
|
+
/**
|
|
5
|
+
* Renders a row of TableHeaderCell elements as the header of a Table.
|
|
6
|
+
*/
|
|
4
7
|
const TableHeader = ({ children, color = 'purple', style, ...props }) => {
|
|
5
8
|
const items = Children.toArray(children);
|
|
6
9
|
return (_jsx(View, { ...props, style: [styles.header, style], children: items.map((child, index) => {
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { TableHeaderCellProps } from './Table.props';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a single header cell within a TableHeader row, or a row header when used with `row`.
|
|
4
|
+
*/
|
|
2
5
|
declare const TableHeaderCell: {
|
|
3
6
|
({ children, color, row, style, trailingContent, ...props }: TableHeaderCellProps & {
|
|
7
|
+
/** Zero-based index of this cell among its siblings, set automatically by TableHeader. */
|
|
4
8
|
columnIndex?: number;
|
|
9
|
+
/** Whether this is the last cell in its row, set automatically by TableHeader. */
|
|
5
10
|
isLast?: boolean;
|
|
11
|
+
/** Whether this cell belongs to the last body row, used to omit the bottom border. */
|
|
6
12
|
isLastRow?: boolean;
|
|
7
13
|
}): import("react").JSX.Element;
|
|
8
14
|
displayName: string;
|
|
@@ -12,6 +12,9 @@ const renderContent = (children, weight = 'semibold', color = 'white') => {
|
|
|
12
12
|
}
|
|
13
13
|
return children;
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Renders a single header cell within a TableHeader row, or a row header when used with `row`.
|
|
17
|
+
*/
|
|
15
18
|
const TableHeaderCell = ({ children, color = 'white', row = false, style, trailingContent, ...props }) => {
|
|
16
19
|
const { columnWidths, container, hasPagination } = useTableContext();
|
|
17
20
|
const { columnIndex = 0, isLast, isLastRow, ...rest } = props;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type TabsProps from './Tabs.props';
|
|
2
|
+
/**
|
|
3
|
+
* Groups Tab components into a single tab bar, managing selection state and the animated
|
|
4
|
+
* active indicator. Use with TabPanel to link tabs to their corresponding content.
|
|
5
|
+
* @summary A tab bar for switching between related views.
|
|
6
|
+
*/
|
|
2
7
|
declare const Tabs: {
|
|
3
8
|
({ value: controlledValue, defaultValue, onValueChange, size, disabled, children, ...props }: TabsProps): import("react").JSX.Element;
|
|
4
9
|
displayName: string;
|
|
@@ -3,6 +3,11 @@ import { Children, isValidElement, useCallback, useEffect, useMemo, useRef, useS
|
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
import { Easing, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
5
5
|
import { TabsContext } from './Tabs.context';
|
|
6
|
+
/**
|
|
7
|
+
* Groups Tab components into a single tab bar, managing selection state and the animated
|
|
8
|
+
* active indicator. Use with TabPanel to link tabs to their corresponding content.
|
|
9
|
+
* @summary A tab bar for switching between related views.
|
|
10
|
+
*/
|
|
6
11
|
const Tabs = ({ value: controlledValue, defaultValue, onValueChange, size = 'md', disabled, children, ...props }) => {
|
|
7
12
|
// Collect child tab values
|
|
8
13
|
const tabValues = useMemo(() => {
|
|
@@ -7,5 +7,11 @@ export declare const TextareaComponent: import("@gluestack-ui/textarea/lib/types
|
|
|
7
7
|
};
|
|
8
8
|
}, import("react-native").TextInputProps>;
|
|
9
9
|
export declare const TextareaField: import("react").ForwardRefExoticComponent<import("react-native").TextInputProps & import("react").RefAttributes<import("react-native").TextInputProps> & import("@gluestack-ui/textarea/lib/typescript/types").IInputProps>;
|
|
10
|
+
/**
|
|
11
|
+
* A multi-line text field for entering longer form content, optionally resizable by dragging
|
|
12
|
+
* a handle. Renders as a form field with label, helper, and validation text, or as a plain
|
|
13
|
+
* container when used with children such as TextareaField.
|
|
14
|
+
* @summary A multi-line text input field.
|
|
15
|
+
*/
|
|
10
16
|
declare const Textarea: ({ validationStatus, children, resizable, defaultHeight, disabled, focused, readonly, label, labelVariant, helperText, validText, invalidText, required, helperIcon, onLayout, ...props }: TextareaProps) => import("react").JSX.Element;
|
|
11
17
|
export default Textarea;
|
|
@@ -18,6 +18,12 @@ export const TextareaField = TextareaComponent.Input;
|
|
|
18
18
|
const DEFAULT_TEXTAREA_HEIGHT = 96;
|
|
19
19
|
const RESIZE_HANDLE_TOUCH_SIZE = 28;
|
|
20
20
|
const RESIZE_HANDLE_ICON_SIZE = 9;
|
|
21
|
+
/**
|
|
22
|
+
* A multi-line text field for entering longer form content, optionally resizable by dragging
|
|
23
|
+
* a handle. Renders as a form field with label, helper, and validation text, or as a plain
|
|
24
|
+
* container when used with children such as TextareaField.
|
|
25
|
+
* @summary A multi-line text input field.
|
|
26
|
+
*/
|
|
21
27
|
const Textarea = ({ validationStatus = 'initial', children, resizable = false, defaultHeight, disabled, focused, readonly, label, labelVariant, helperText, validText, invalidText, required, helperIcon, onLayout, ...props }) => {
|
|
22
28
|
const formFieldContext = useFormFieldContext();
|
|
23
29
|
const hasMeasuredHeight = useRef(false);
|
|
@@ -41,16 +41,30 @@ export interface TextareaBaseProps {
|
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
43
|
validationStatus?: 'initial' | 'valid' | 'invalid';
|
|
44
|
+
/** Makes the textarea read-only. */
|
|
44
45
|
readonly?: boolean;
|
|
46
|
+
/** Sets focus on the textarea. */
|
|
45
47
|
focused?: boolean;
|
|
48
|
+
/** Placeholder text shown when the textarea is empty. */
|
|
46
49
|
placeholder?: string;
|
|
50
|
+
/** Label for the textarea. Only used when the textarea has no children. */
|
|
47
51
|
label?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Visual variant of the label text. Only used when the textarea has no children.
|
|
54
|
+
* @default 'body'
|
|
55
|
+
*/
|
|
48
56
|
labelVariant?: 'heading' | 'body';
|
|
57
|
+
/** Helper text shown below the textarea. Only used when the textarea has no children. */
|
|
49
58
|
helperText?: string;
|
|
59
|
+
/** Icon shown alongside the helper text. Only used when the textarea has no children. */
|
|
50
60
|
helperIcon?: React.ComponentType;
|
|
61
|
+
/** Text shown when `validationStatus` is `'valid'`. Only used when the textarea has no children. */
|
|
51
62
|
validText?: string;
|
|
63
|
+
/** Text shown when `validationStatus` is `'invalid'`. */
|
|
52
64
|
invalidText?: string;
|
|
65
|
+
/** Whether the textarea is required. Only used when the textarea has no children. */
|
|
53
66
|
required?: boolean;
|
|
67
|
+
/** Adjusts styling when the textarea is rendered inside a bottom sheet. */
|
|
54
68
|
isInBottomSheet?: boolean;
|
|
55
69
|
}
|
|
56
70
|
export interface TextareaWithChildrenProps extends TextareaBaseProps, ViewProps {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { TimePickerProps } from './TimePicker.props';
|
|
2
|
+
/**
|
|
3
|
+
* Presents a wheel-based hour and minute selector inside a bottom sheet, opened imperatively
|
|
4
|
+
* via a ref. Supports 12-hour and 24-hour clocks and reports the picked time as a `Date`.
|
|
5
|
+
* @summary A bottom-sheet time picker.
|
|
6
|
+
*/
|
|
2
7
|
declare const TimePicker: {
|
|
3
8
|
({ timeZone, date, onChange, use12Hours, minuteInterval, hideFooter, style, ref, onCancel, }: TimePickerProps): import("react").JSX.Element;
|
|
4
9
|
displayName: string;
|
|
@@ -13,6 +13,11 @@ dayjs.extend(timezone);
|
|
|
13
13
|
const Footer = ({ onCancel, onConfirm }) => {
|
|
14
14
|
return (_jsxs(RNView, { style: styles.footer, testID: "footer", children: [_jsx(Button, { variant: "ghost", colorScheme: "functional", onPress: onCancel, children: "Cancel" }), _jsx(Button, { variant: "ghost", colorScheme: "functional", onPress: onConfirm, children: "Ok" })] }));
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Presents a wheel-based hour and minute selector inside a bottom sheet, opened imperatively
|
|
18
|
+
* via a ref. Supports 12-hour and 24-hour clocks and reports the picked time as a `Date`.
|
|
19
|
+
* @summary A bottom-sheet time picker.
|
|
20
|
+
*/
|
|
16
21
|
const TimePicker = ({ timeZone, date, onChange, use12Hours, minuteInterval, hideFooter, style, ref, onCancel = () => { }, }) => {
|
|
17
22
|
dayjs.tz.setDefault(timeZone);
|
|
18
23
|
dayjs.locale('en');
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type TimePickerInputProps from './TimePickerInput.props';
|
|
2
|
+
/**
|
|
3
|
+
* A text input for entering a time directly, paired with a trigger button that opens a
|
|
4
|
+
* TimePicker for selecting the same value. Formats and parses input using Day.js.
|
|
5
|
+
* @summary A text input with a time picker trigger.
|
|
6
|
+
*/
|
|
2
7
|
declare const TimePickerInput: {
|
|
3
8
|
({ validationStatus, disabled, focused, readonly, placeholder, inBottomSheet, format, openButtonLabel, autoCloseOnSelect, label, labelVariant, helperText, helperIcon, validText, invalidText, required, onChange, onChangeText, onBlur, onFocus, value, timePickerProps, onClear, ...rest }: TimePickerInputProps): import("react").JSX.Element;
|
|
4
9
|
displayName: string;
|
|
@@ -12,6 +12,11 @@ import { UnstyledIconButton } from '../UnstyledIconButton';
|
|
|
12
12
|
import { DEFAULT_FORMAT_12, DEFAULT_FORMAT_24, maskDefaultFormat } from './TimePickerInput.utils';
|
|
13
13
|
import TimePickerInputDoneButton from './TimePickerInputDoneButton';
|
|
14
14
|
dayjs.extend(customParseFormat);
|
|
15
|
+
/**
|
|
16
|
+
* A text input for entering a time directly, paired with a trigger button that opens a
|
|
17
|
+
* TimePicker for selecting the same value. Formats and parses input using Day.js.
|
|
18
|
+
* @summary A text input with a time picker trigger.
|
|
19
|
+
*/
|
|
15
20
|
const TimePickerInput = ({ validationStatus = 'initial', disabled, focused, readonly, placeholder = '--:--', inBottomSheet = false, format, openButtonLabel = 'Open time picker', autoCloseOnSelect = true, label, labelVariant, helperText, helperIcon, validText, invalidText, required = true, onChange, onChangeText, onBlur, onFocus, value, timePickerProps, onClear, ...rest }) => {
|
|
16
21
|
const formFieldContext = useFormFieldContext();
|
|
17
22
|
const isDisabled = formFieldContext?.disabled ?? disabled;
|
|
@@ -2,18 +2,46 @@ import type { TextInputProps, ViewProps } from 'react-native';
|
|
|
2
2
|
import type { DateType } from '../DatePicker/DatePicker.props';
|
|
3
3
|
import type { TimePickerProps } from '../TimePicker/TimePicker.props';
|
|
4
4
|
export interface TimePickerInputBaseProps {
|
|
5
|
+
/** Disables both typing and the time picker trigger button. */
|
|
5
6
|
disabled?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Renders the corresponding validation style. Inherited from FormField when nested.
|
|
9
|
+
* @default 'initial'
|
|
10
|
+
*/
|
|
6
11
|
validationStatus?: 'initial' | 'valid' | 'invalid';
|
|
12
|
+
/** Prevents manual typing while keeping the picker trigger available. */
|
|
7
13
|
readonly?: boolean;
|
|
14
|
+
/** Forces the focused state styling. */
|
|
8
15
|
focused?: boolean;
|
|
16
|
+
/** Label for the input. Inherited from FormField context when nested. */
|
|
9
17
|
label?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Visual variant of the label text.
|
|
20
|
+
* @default 'body'
|
|
21
|
+
*/
|
|
10
22
|
labelVariant?: 'heading' | 'body';
|
|
23
|
+
/** Helper text shown below the input. Inherited from FormField context when nested. */
|
|
11
24
|
helperText?: string;
|
|
25
|
+
/** Icon shown alongside the helper text. */
|
|
12
26
|
helperIcon?: React.ComponentType;
|
|
27
|
+
/** Text shown when `validationStatus` is `'valid'`. Inherited from FormField context when nested. */
|
|
13
28
|
validText?: string;
|
|
29
|
+
/** Text shown when `validationStatus` is `'invalid'`. Inherited from FormField context when nested. */
|
|
14
30
|
invalidText?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Placeholder text shown when the input is empty.
|
|
33
|
+
* @default '--:--'
|
|
34
|
+
*/
|
|
15
35
|
placeholder?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Uses BottomSheetTextInput when rendering inside a bottom sheet.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
16
40
|
inBottomSheet?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the input is required.
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
17
45
|
required?: boolean;
|
|
18
46
|
/**
|
|
19
47
|
* Controls how the selected time is formatted when displayed inside the input.
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TimelineProps } from './Timeline.props';
|
|
3
|
+
/**
|
|
4
|
+
* Renders a vertical sequence of TimelineItem components, connecting them with a line and
|
|
5
|
+
* passing each its position so start, middle, and end connectors draw correctly.
|
|
6
|
+
* @summary A vertical timeline of connected steps.
|
|
7
|
+
*/
|
|
3
8
|
declare const Timeline: {
|
|
4
9
|
({ children, variant, style, ...rest }: TimelineProps): React.JSX.Element;
|
|
5
10
|
displayName: string;
|
|
@@ -14,6 +14,11 @@ const getItemPosition = (index, count) => {
|
|
|
14
14
|
}
|
|
15
15
|
return 'middle';
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Renders a vertical sequence of TimelineItem components, connecting them with a line and
|
|
19
|
+
* passing each its position so start, middle, and end connectors draw correctly.
|
|
20
|
+
* @summary A vertical timeline of connected steps.
|
|
21
|
+
*/
|
|
17
22
|
const Timeline = ({ children, variant = 'static', style, ...rest }) => {
|
|
18
23
|
const childElements = React.Children.toArray(children).filter(React.isValidElement);
|
|
19
24
|
return (_jsx(View, { accessibilityRole: "list", style: [styles.root, style], ...rest, children: childElements.map((child, index) => {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { TimelineItemProps } from './Timeline.props';
|
|
2
|
+
/**
|
|
3
|
+
* A single step within a Timeline, showing a label, optional helper text, and a connector
|
|
4
|
+
* indicator. Can also be used standalone outside of Timeline.
|
|
5
|
+
*/
|
|
2
6
|
declare const TimelineItem: {
|
|
3
7
|
({ children, helperText, label, position, state, style, variant, accessibilityLabel: accessibilityLabelProp, accessible: accessibleProp, ...rest }: TimelineItemProps): import("react").JSX.Element;
|
|
4
8
|
displayName: string;
|
|
@@ -4,6 +4,10 @@ import { View } from 'react-native';
|
|
|
4
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
5
5
|
import { BodyText } from '../BodyText';
|
|
6
6
|
import { Icon } from '../Icon';
|
|
7
|
+
/**
|
|
8
|
+
* A single step within a Timeline, showing a label, optional helper text, and a connector
|
|
9
|
+
* indicator. Can also be used standalone outside of Timeline.
|
|
10
|
+
*/
|
|
7
11
|
const TimelineItem = ({ children, helperText, label, position = 'single', state = 'incomplete', style, variant = 'static', accessibilityLabel: accessibilityLabelProp, accessible: accessibleProp, ...rest }) => {
|
|
8
12
|
styles.useVariants({ position, state, variant });
|
|
9
13
|
const hasCustomContent = Boolean(children);
|
|
@@ -2,6 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import type { ToastContextValue, ToastProviderProps } from './Toast.props';
|
|
3
3
|
declare const ToastContext: React.Context<ToastContextValue | undefined>;
|
|
4
4
|
export declare const useToastContext: () => ToastContextValue;
|
|
5
|
+
/**
|
|
6
|
+
* Renders and manages toast notifications for its subtree. Mount once near the
|
|
7
|
+
* app root, then trigger toasts anywhere below it via `useToast()`.
|
|
8
|
+
*/
|
|
5
9
|
export declare const ToastProvider: React.FC<ToastProviderProps>;
|
|
6
10
|
export declare const useToast: () => ToastContextValue;
|
|
7
11
|
export default ToastContext;
|
|
@@ -10,6 +10,10 @@ export const useToastContext = () => {
|
|
|
10
10
|
throw new Error('useToastContext must be used within ToastProvider');
|
|
11
11
|
return ctx;
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Renders and manages toast notifications for its subtree. Mount once near the
|
|
15
|
+
* app root, then trigger toasts anywhere below it via `useToast()`.
|
|
16
|
+
*/
|
|
13
17
|
export const ToastProvider = ({ children, safeAreaPadding = true, }) => {
|
|
14
18
|
const [toasts, setToasts] = useState([]);
|
|
15
19
|
const timers = useRef({});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
export interface ToastOptions {
|
|
3
|
+
/** Custom ID for the toast; auto-generated when omitted. */
|
|
3
4
|
id?: string;
|
|
5
|
+
/** The main message to display. */
|
|
4
6
|
text: string | ReactNode;
|
|
5
7
|
/** Optional action text to display as a link */
|
|
6
8
|
actionText?: string;
|
|
@@ -23,7 +25,12 @@ export interface ToastInstance extends ToastOptions {
|
|
|
23
25
|
duration: number;
|
|
24
26
|
}
|
|
25
27
|
export interface ToastProviderProps {
|
|
28
|
+
/** App content to render below the toast stack. */
|
|
26
29
|
children: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to pad the toast stack for the device's safe area insets.
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
27
34
|
safeAreaPadding?: boolean;
|
|
28
35
|
}
|
|
29
36
|
export interface ToastContextValue {
|
|
@@ -9,6 +9,10 @@ export declare const ToggleButtonIcon: import("react").ForwardRefExoticComponent
|
|
|
9
9
|
}> & import("..").IconProps & {
|
|
10
10
|
toggled: boolean;
|
|
11
11
|
}>;
|
|
12
|
+
/**
|
|
13
|
+
* A pressable button that switches between an on and off state, such as for a single
|
|
14
|
+
* standalone setting.
|
|
15
|
+
*/
|
|
12
16
|
declare const ToggleButton: {
|
|
13
17
|
({ text, toggled, onToggle, ...props }: ToggleButtonProps): import("react").JSX.Element;
|
|
14
18
|
displayName: string;
|
|
@@ -14,6 +14,10 @@ export const ToggleButtonText = ToggleButtonComponent.Text;
|
|
|
14
14
|
export const ToggleButtonIcon = ToggleButtonComponent.Icon;
|
|
15
15
|
ToggleButtonText.displayName = 'ToggleButtonText';
|
|
16
16
|
ToggleButtonIcon.displayName = 'ToggleButtonIcon';
|
|
17
|
+
/**
|
|
18
|
+
* A pressable button that switches between an on and off state, such as for a single
|
|
19
|
+
* standalone setting.
|
|
20
|
+
*/
|
|
17
21
|
const ToggleButton = ({ text, toggled = false, onToggle, ...props }) => {
|
|
18
22
|
return (_jsxs(ToggleButtonComponent, { toggled: toggled, onToggle: onToggle, ...props, children: [toggled && _jsx(ToggleButtonIcon, { toggled: toggled }), _jsx(ToggleButtonText, { toggled: toggled, children: text })] }));
|
|
19
23
|
};
|