@ssa-ui-kit/core 2.33.0 → 3.1.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/dist/components/AccordionGroup/Accordion.d.ts +37 -0
- package/dist/components/AccordionGroup/AccordionContent.d.ts +48 -0
- package/dist/components/AccordionGroup/AccordionContext.d.ts +76 -2
- package/dist/components/AccordionGroup/AccordionGroup.d.ts +56 -0
- package/dist/components/AccordionGroup/AccordionTitle.d.ts +41 -0
- package/dist/components/AccordionGroup/types.d.ts +199 -1
- package/dist/components/Avatar/Avatar.d.ts +33 -0
- package/dist/components/Button/Button.d.ts +61 -0
- package/dist/components/Button/fixtures.d.ts +52 -31
- package/dist/components/Button/styles.d.ts +7 -12
- package/dist/components/Button/types.d.ts +98 -4
- package/dist/components/Charts/BarGaugeChart/components/BarGaugeChartHeader.d.ts +1 -1
- package/dist/components/Charts/BarLineComplexChart/BarLineComplexChartView.d.ts +2 -2
- package/dist/components/Charts/BarLineComplexChart/types.d.ts +2 -2
- package/dist/components/Charts/BigNumberChart/BigNumberChart.d.ts +4 -2
- package/dist/components/Charts/BigNumberChart/components/BigNumberChartHeader.d.ts +1 -1
- package/dist/components/Charts/BigNumberChart/components/TrendLine.d.ts +8 -3
- package/dist/components/Charts/BigNumberChart/components/TrendLineTooltip.d.ts +8 -5
- package/dist/components/Charts/GaugeChart/components/GaugeChartBase.d.ts +3 -1
- package/dist/components/Charts/GaugeChart/components/GaugeChartHeader.d.ts +1 -1
- package/dist/components/Charts/PieChart/PieChartLegendMarker.d.ts +1 -1
- package/dist/components/Charts/PieChart/styles.d.ts +1 -1
- package/dist/components/Charts/PieChart/types.d.ts +1 -1
- package/dist/components/Charts/RadarChart/RadarChart.d.ts +1 -1
- package/dist/components/Charts/RadarChart/components/RadarChartHeader.d.ts +1 -1
- package/dist/components/Charts/TreeMapChart/TreeMapChart.d.ts +1 -1
- package/dist/components/Charts/TreeMapChart/TreeMapChartHeader.d.ts +1 -1
- package/dist/components/Charts/index.d.ts +1 -0
- package/dist/components/Charts/utils/nivoReact19Compat.d.ts +18 -0
- package/dist/components/Checkbox/Checkbox.d.ts +84 -0
- package/dist/components/Checkbox/CheckboxBase.d.ts +1 -1
- package/dist/components/Checkbox/styles.d.ts +2 -2
- package/dist/components/Checkbox/types.d.ts +104 -3
- package/dist/components/Chip/Chip.d.ts +70 -0
- package/dist/components/Chip/constants.d.ts +1 -1
- package/dist/components/Chip/helpers.d.ts +6 -0
- package/dist/components/Chip/types.d.ts +129 -1
- package/dist/components/CollapsibleNavBar/CollapsibleNavBar.d.ts +1 -1
- package/dist/components/CollapsibleNavBar/CollapsibleNavBarContext.d.ts +2 -2
- package/dist/components/CollapsibleNavBar/components/TriggerIcon.d.ts +4 -2
- package/dist/components/CollapsibleNavBar/types.d.ts +9 -2
- package/dist/components/ColorPicker/components/CopyButton.d.ts +1 -1
- package/dist/components/DatePicker/constants.d.ts +22 -0
- package/dist/components/DatePicker/hooks/useDatePicker.d.ts +7 -5
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/styles.d.ts +3 -2
- package/dist/components/DatePicker/types.d.ts +10 -2
- package/dist/components/DatePicker/utils/dates.d.ts +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/components/DateRangePicker/DateRangePickerFormBridge.d.ts +46 -0
- package/dist/components/DateRangePicker/components/DatesListWrapper.d.ts +3 -2
- package/dist/components/DateRangePicker/constants.d.ts +1 -0
- package/dist/components/DateRangePicker/hooks/useDateRangePicker.d.ts +22 -17
- package/dist/components/DateRangePicker/index.d.ts +3 -0
- package/dist/components/DateRangePicker/styles.d.ts +6 -4
- package/dist/components/DateRangePicker/types.d.ts +24 -7
- package/dist/components/DateRangePicker/utils/dates.d.ts +2 -2
- package/dist/components/Drawer/index.d.ts +2 -1
- package/dist/components/Dropdown/Dropdown.d.ts +88 -0
- package/dist/components/Dropdown/types.d.ts +102 -1
- package/dist/components/DropdownOption/DropdownOption.d.ts +2 -0
- package/dist/components/DropdownOptions/DropdownOptions.d.ts +31 -0
- package/dist/components/DropdownOptions/types.d.ts +22 -0
- package/dist/components/DropdownToggle/DropdownToggle.d.ts +3 -2
- package/dist/components/DropdownToggle/types.d.ts +5 -3
- package/dist/components/Field/FieldControl.d.ts +62 -1
- package/dist/components/Field/FieldDescription.d.ts +33 -0
- package/dist/components/Field/FieldError.d.ts +36 -0
- package/dist/components/Field/FieldLabel.d.ts +37 -0
- package/dist/components/Field/FieldProvider.d.ts +19 -1
- package/dist/components/Field/FieldRoot.d.ts +90 -0
- package/dist/components/Field/FieldSuccess.d.ts +34 -0
- package/dist/components/Field/index.d.ts +4 -0
- package/dist/components/Filters/FilterBlockWrapper.d.ts +3 -2
- package/dist/components/Filters/FiltersContext.d.ts +4 -4
- package/dist/components/Filters/hooks/useVisibility.d.ts +2 -2
- package/dist/components/FullscreenModeContext.d.ts +1 -4
- package/dist/components/Icon/icons/Assessment.d.ts +1 -1
- package/dist/components/Icon/icons/Award.d.ts +3 -0
- package/dist/components/Icon/icons/Bench.d.ts +3 -0
- package/dist/components/Icon/icons/Briefcase.d.ts +3 -0
- package/dist/components/Icon/icons/Building.d.ts +3 -0
- package/dist/components/Icon/icons/CalendarSchedule.d.ts +3 -0
- package/dist/components/Icon/icons/Camera.d.ts +3 -0
- package/dist/components/Icon/icons/CardText.d.ts +3 -0
- package/dist/components/Icon/icons/Case.d.ts +3 -0
- package/dist/components/Icon/icons/Comments.d.ts +3 -0
- package/dist/components/Icon/icons/Compensation.d.ts +3 -0
- package/dist/components/Icon/icons/Contacts.d.ts +3 -0
- package/dist/components/Icon/icons/CopyLink.d.ts +3 -0
- package/dist/components/Icon/icons/Delete.d.ts +3 -0
- package/dist/components/Icon/icons/DiamondRing.d.ts +3 -0
- package/dist/components/Icon/icons/Document.d.ts +3 -0
- package/dist/components/Icon/icons/Documents.d.ts +3 -0
- package/dist/components/Icon/icons/Education.d.ts +3 -0
- package/dist/components/Icon/icons/EmployeeProfile.d.ts +3 -0
- package/dist/components/Icon/icons/Export.d.ts +3 -0
- package/dist/components/Icon/icons/FollowLink.d.ts +3 -0
- package/dist/components/Icon/icons/Form.d.ts +3 -0
- package/dist/components/Icon/icons/Gender.d.ts +3 -0
- package/dist/components/Icon/icons/Gift.d.ts +3 -0
- package/dist/components/Icon/icons/Inventory.d.ts +3 -0
- package/dist/components/Icon/icons/Link.d.ts +3 -0
- package/dist/components/Icon/icons/OfficeChair.d.ts +3 -0
- package/dist/components/Icon/icons/OpenBook.d.ts +3 -0
- package/dist/components/Icon/icons/Report.d.ts +1 -1
- package/dist/components/Icon/icons/Results.d.ts +3 -0
- package/dist/components/Icon/icons/Signature.d.ts +3 -0
- package/dist/components/Icon/icons/Summery.d.ts +3 -0
- package/dist/components/Icon/icons/Team.d.ts +3 -0
- package/dist/components/Icon/icons/TechnicalReview.d.ts +3 -0
- package/dist/components/Icon/icons/TennisBall.d.ts +3 -0
- package/dist/components/Icon/icons/Timeline.d.ts +3 -0
- package/dist/components/Icon/icons/UnionCircle.d.ts +3 -0
- package/dist/components/Icon/icons/Url.d.ts +3 -0
- package/dist/components/Icon/icons/all.d.ts +36 -1
- package/dist/components/Icon/icons/iconsList.d.ts +1 -1
- package/dist/components/IconButton/IconButton.d.ts +39 -0
- package/dist/components/IconButton/index.d.ts +2 -0
- package/dist/components/IconButton/styles.d.ts +2 -0
- package/dist/components/IconButton/types.d.ts +41 -0
- package/dist/components/Indicator/types.d.ts +4 -2
- package/dist/components/Input/types.d.ts +157 -0
- package/dist/components/JsonSchemaForm/fields/DateRangeField.d.ts +15 -1
- package/dist/components/JsonSchemaForm/utils/dateFormats.d.ts +37 -0
- package/dist/components/JsonSchemaForm/utils/dateRangeField.d.ts +24 -0
- package/dist/components/JsonSchemaForm/utils/index.d.ts +1 -0
- package/dist/components/JsonSchemaForm/utils/selectWidget.d.ts +16 -0
- package/dist/components/Modal/Modal.d.ts +60 -0
- package/dist/components/Modal/types.d.ts +21 -1
- package/dist/components/ModalContent/ModalContent.d.ts +42 -1
- package/dist/components/ModalDialog/ModalDialog.d.ts +27 -0
- package/dist/components/ModalDialog/types.d.ts +18 -0
- package/dist/components/ModalDismissButton/ModalDismissButton.d.ts +29 -2
- package/dist/components/ModalOpenButton/ModalOpenButton.d.ts +25 -1
- package/dist/components/MultipleDropdown/index.d.ts +1 -0
- package/dist/components/MultipleDropdown/types.d.ts +74 -0
- package/dist/components/NavBar/types.d.ts +1 -1
- package/dist/components/NotificationMenu/types.d.ts +3 -3
- package/dist/components/Pagination/ArrowButton.d.ts +32 -0
- package/dist/components/Pagination/Pagination.d.ts +81 -0
- package/dist/components/Pagination/PaginationButtons.d.ts +35 -0
- package/dist/components/Pagination/PaginationContext.d.ts +30 -0
- package/dist/components/Pagination/WithPagination.d.ts +47 -4
- package/dist/components/Pagination/components/RowsPerPageDropdown/RowsPerPageDropdown.d.ts +41 -0
- package/dist/components/Pagination/components/RowsPerPageDropdown/types.d.ts +39 -0
- package/dist/components/Pagination/styles.d.ts +1 -1
- package/dist/components/Pagination/types.d.ts +178 -0
- package/dist/components/PersonInfo/styles.d.ts +1 -1
- package/dist/components/Popover/Popover.d.ts +120 -0
- package/dist/components/Popover/PopoverClose.d.ts +26 -0
- package/dist/components/Popover/PopoverContent.d.ts +33 -0
- package/dist/components/Popover/PopoverDescription.d.ts +22 -1
- package/dist/components/Popover/PopoverHeading.d.ts +22 -1
- package/dist/components/Popover/PopoverTrigger.d.ts +30 -0
- package/dist/components/Popover/hooks/usePopover.d.ts +21 -0
- package/dist/components/Popover/hooks/usePopoverContext.d.ts +23 -0
- package/dist/components/Popover/types.d.ts +86 -0
- package/dist/components/Radio/Radio.d.ts +69 -1
- package/dist/components/Radio/RadioBase.d.ts +1 -1
- package/dist/components/Radio/types.d.ts +109 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/index.d.ts +1 -0
- package/dist/components/RadioGroup/types.d.ts +42 -0
- package/dist/components/SearchBox/SearchBox.d.ts +60 -0
- package/dist/components/SearchBox/SearchBoxInput.d.ts +1 -1
- package/dist/components/SearchBox/types.d.ts +46 -0
- package/dist/components/Slider/Slider.d.ts +53 -0
- package/dist/components/Slider/consts.d.ts +4 -0
- package/dist/components/Slider/index.d.ts +4 -0
- package/dist/components/Slider/styles.d.ts +90 -0
- package/dist/components/Slider/types.d.ts +69 -0
- package/dist/components/Switch/Switch.d.ts +66 -1
- package/dist/components/Switch/SwitchBase.d.ts +5 -1
- package/dist/components/Switch/SwitchContext.d.ts +50 -0
- package/dist/components/Switch/types.d.ts +74 -0
- package/dist/components/Table/Table.d.ts +74 -0
- package/dist/components/TableBody/TableBody.d.ts +55 -0
- package/dist/components/TableCell/TableCell.d.ts +56 -4
- package/dist/components/TableCell/types.d.ts +33 -0
- package/dist/components/TableCellHeader/TableCellHeader.d.ts +63 -2
- package/dist/components/TableCellHeader/types.d.ts +28 -0
- package/dist/components/TableFilters/TableFilters.d.ts +72 -0
- package/dist/components/TableFilters/hooks/useTableData.d.ts +3 -3
- package/dist/components/TableFilters/types.d.ts +130 -2
- package/dist/components/TableHead/TableHead.d.ts +37 -0
- package/dist/components/TableRow/TableRow.d.ts +2 -7
- package/dist/components/TableRow/types.d.ts +34 -0
- package/dist/components/TextField/TextField.d.ts +76 -0
- package/dist/components/TextField/types.d.ts +80 -0
- package/dist/components/Textarea/Textarea.d.ts +81 -0
- package/dist/components/Textarea/TextareaBase.d.ts +6 -1
- package/dist/components/Textarea/types.d.ts +109 -0
- package/dist/components/Tooltip/SimpleChartTooltip.d.ts +2 -1
- package/dist/components/Tooltip/Tooltip.d.ts +73 -0
- package/dist/components/Tooltip/types.d.ts +116 -5
- package/dist/components/TooltipContent/TooltipContent.d.ts +45 -0
- package/dist/components/TooltipTrigger/TooltipTrigger.d.ts +27 -1
- package/dist/components/Typeahead/Typeahead.context.d.ts +10 -4
- package/dist/components/Typeahead/Typeahead.d.ts +173 -9
- package/dist/components/Typeahead/components/TypeaheadOption.d.ts +1 -1
- package/dist/components/Typeahead/styles.d.ts +10 -5
- package/dist/components/Typeahead/types.d.ts +191 -1
- package/dist/components/Typeahead/useTypeahead.d.ts +13 -5
- package/dist/components/Typography/Typography.d.ts +50 -0
- package/dist/components/Typography/types.d.ts +67 -0
- package/dist/components/UserProfile/UserProfile.d.ts +76 -0
- package/dist/components/UserProfile/styles.d.ts +6 -4
- package/dist/components/UserProfile/types.d.ts +85 -1
- package/dist/components/WidgetCard/Title.d.ts +1 -1
- package/dist/components/WidgetCard/WidgetCardBase.d.ts +1 -1
- package/dist/components/WithLink.d.ts +1 -1
- package/dist/components/Wrapper/Wrapper.d.ts +83 -2
- package/dist/components/Wrapper/index.d.ts +1 -0
- package/dist/components/index.d.ts +113 -85
- package/dist/index.d.ts +1 -0
- package/dist/index.js +48942 -19624
- package/dist/index.js.map +1 -1
- package/dist/types/emotion.d.ts +65 -0
- package/dist/utils/react19HocCompat.d.ts +14 -0
- package/package.json +42 -33
- package/dist/components/Icon/icons/Company.d.ts +0 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { IconButtonProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* IconButton - Square icon-only button for icon actions
|
|
4
|
+
*
|
|
5
|
+
* A compact button that displays a single icon from the kit (e.g. edit, bin, search).
|
|
6
|
+
* Uses the kit's Icon and theme. Good for row actions, toolbars, and secondary actions
|
|
7
|
+
* where a text label is not needed. Optional tooltip on hover and full style overrides
|
|
8
|
+
* via a single styles prop.
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Any icon from the kit via icon name
|
|
12
|
+
* - Optional tooltip (title) on hover via kit Tooltip
|
|
13
|
+
* - Optional aria-label; defaults to raw icon name for screen readers
|
|
14
|
+
* - Single styles prop: button, iconColor, icon (all overridable)
|
|
15
|
+
* - Transparent or grey background variant; disabled state
|
|
16
|
+
*
|
|
17
|
+
* @category Form Controls
|
|
18
|
+
* @subcategory Action
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <IconButton icon="edit" onClick={onEdit} aria-label="Edit" />
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <IconButton icon="bin" onClick={onDelete} title="Delete" transparent />
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <IconButton
|
|
33
|
+
* icon="search"
|
|
34
|
+
* onClick={onSearch}
|
|
35
|
+
* styles={{ button: { marginLeft: 8 }, iconColor: theme.colors.blue }}
|
|
36
|
+
* />
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare const IconButton: ({ icon, onClick, "aria-label": ariaLabel, title, disabled, transparent, styles, }: IconButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Interpolation, Theme } from '@emotion/react';
|
|
2
|
+
import type { MapIconsType } from '../Icon/types';
|
|
3
|
+
export type IconButtonProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Icon name from the UI kit Icon component (e.g. "edit", "bin", "search")
|
|
6
|
+
*/
|
|
7
|
+
icon: keyof MapIconsType;
|
|
8
|
+
/**
|
|
9
|
+
* Click handler
|
|
10
|
+
*/
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Accessible label for screen readers. When omitted, the raw icon name is used.
|
|
14
|
+
*/
|
|
15
|
+
'aria-label'?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Tooltip text; when provided, uses the kit's Tooltip on hover.
|
|
18
|
+
*/
|
|
19
|
+
title?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Disables the button and applies disabled styles
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Use transparent background instead of theme grey
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
transparent?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Custom styles in one prop. Each key is applied where it belongs:
|
|
32
|
+
* - `button`: Emotion styles merged with default button styles
|
|
33
|
+
* - `iconColor`: icon color (defaults to theme.colors.greyDarker)
|
|
34
|
+
* - `icon`: Emotion styles passed to the Icon
|
|
35
|
+
*/
|
|
36
|
+
styles?: {
|
|
37
|
+
button?: Interpolation<Theme>;
|
|
38
|
+
iconColor?: string;
|
|
39
|
+
icon?: Interpolation<Theme>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export interface IndicatorProps {
|
|
2
2
|
isVisible: boolean;
|
|
3
|
-
children: React.ReactElement
|
|
3
|
+
children: React.ReactElement<{
|
|
4
|
+
ref: React.Ref<HTMLDivElement | null>;
|
|
5
|
+
}>;
|
|
4
6
|
position?: 'right' | 'left';
|
|
5
7
|
background?: string;
|
|
6
|
-
text?: string | number | JSX.Element;
|
|
8
|
+
text?: string | number | React.JSX.Element;
|
|
7
9
|
}
|
|
8
10
|
export type ChildrenDataProps = Record<string, number>;
|
|
@@ -4,33 +4,190 @@ import type { Interpolation, Theme } from '@emotion/react';
|
|
|
4
4
|
interface ExtendedInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
5
5
|
'data-testid'?: string;
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Props for the Input component
|
|
9
|
+
*
|
|
10
|
+
* A flexible text input component with built-in validation, status indicators,
|
|
11
|
+
* icon support, and React Hook Form integration. Supports all standard HTML input
|
|
12
|
+
* types and provides visual feedback for validation states.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* // Basic input with React Hook Form
|
|
17
|
+
* const { register } = useForm();
|
|
18
|
+
* <Input
|
|
19
|
+
* name="email"
|
|
20
|
+
* type="email"
|
|
21
|
+
* placeholder="Enter your email"
|
|
22
|
+
* register={register}
|
|
23
|
+
* />
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* // Input with validation
|
|
29
|
+
* <Input
|
|
30
|
+
* name="password"
|
|
31
|
+
* type="password"
|
|
32
|
+
* register={register}
|
|
33
|
+
* validationSchema={{
|
|
34
|
+
* required: 'Password is required',
|
|
35
|
+
* minLength: { value: 8, message: 'Must be at least 8 characters' }
|
|
36
|
+
* }}
|
|
37
|
+
* status={errors.password ? 'error' : 'basic'}
|
|
38
|
+
* errors={errors.password}
|
|
39
|
+
* showHelperText
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // Input with icons and helper text
|
|
46
|
+
* <Input
|
|
47
|
+
* name="search"
|
|
48
|
+
* placeholder="Search products..."
|
|
49
|
+
* startElement={<Icon name="search" />}
|
|
50
|
+
* endElement={<Icon name="clear" onClick={handleClear} />}
|
|
51
|
+
* helperText="Type to search"
|
|
52
|
+
* showHelperText
|
|
53
|
+
* />
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @note React Hook Form integration is optional. If `register` is not provided,
|
|
57
|
+
* the component will still work but validation features will be unavailable.
|
|
58
|
+
*/
|
|
7
59
|
export interface InputProps extends Partial<Pick<UseFormReturn, 'register' | 'control' | 'setValue'>> {
|
|
60
|
+
/**
|
|
61
|
+
* Name attribute for the input, required for React Hook Form integration
|
|
62
|
+
*/
|
|
8
63
|
name: string;
|
|
64
|
+
/**
|
|
65
|
+
* Visual validation status of the input
|
|
66
|
+
* - `basic`: Default state, no validation feedback
|
|
67
|
+
* - `error`: Error state with red border and error icon
|
|
68
|
+
* - `success`: Success state with green border and success icon
|
|
69
|
+
* - `custom`: Custom styling (no default status styling)
|
|
70
|
+
* @default 'basic'
|
|
71
|
+
*/
|
|
9
72
|
status?: keyof InputStatusColors;
|
|
73
|
+
/**
|
|
74
|
+
* HTML input type attribute
|
|
75
|
+
* Supports all standard HTML input types (text, email, password, number, etc.)
|
|
76
|
+
* @default 'text'
|
|
77
|
+
*/
|
|
10
78
|
type?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Placeholder text displayed when input is empty
|
|
81
|
+
*/
|
|
11
82
|
placeholder?: string;
|
|
83
|
+
/**
|
|
84
|
+
* React Hook Form validation schema
|
|
85
|
+
* Object containing validation rules (required, minLength, pattern, etc.)
|
|
86
|
+
*/
|
|
12
87
|
validationSchema?: Record<string, unknown>;
|
|
88
|
+
/**
|
|
89
|
+
* Whether the input is disabled
|
|
90
|
+
* Disabled inputs cannot be edited and appear visually muted
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
13
93
|
disabled?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Custom CSS class name for the input element
|
|
96
|
+
*/
|
|
14
97
|
className?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Custom CSS class name for the wrapper container
|
|
100
|
+
*/
|
|
15
101
|
wrapperClassName?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Custom CSS class name for the helper text container
|
|
104
|
+
*/
|
|
16
105
|
helperClassName?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Custom element type to render as (for composition)
|
|
108
|
+
*/
|
|
17
109
|
as?: React.ElementType;
|
|
110
|
+
/**
|
|
111
|
+
* React element to display before the input (e.g., icon)
|
|
112
|
+
* Commonly an Icon component
|
|
113
|
+
*/
|
|
18
114
|
startElement?: React.ReactElement;
|
|
115
|
+
/**
|
|
116
|
+
* React element to display after the input (e.g., icon or action button)
|
|
117
|
+
* Commonly an Icon component or clear button
|
|
118
|
+
*/
|
|
19
119
|
endElement?: React.ReactElement;
|
|
120
|
+
/**
|
|
121
|
+
* Custom Emotion CSS styles
|
|
122
|
+
*/
|
|
20
123
|
css?: Interpolation<Theme>;
|
|
124
|
+
/**
|
|
125
|
+
* Additional props to pass directly to the underlying input element
|
|
126
|
+
* Includes all standard HTML input attributes
|
|
127
|
+
*/
|
|
21
128
|
inputProps?: ExtendedInputProps;
|
|
129
|
+
/**
|
|
130
|
+
* Tooltip text to display when hovering over error icon
|
|
131
|
+
* Only visible when status is 'error' and showStatusIcon is true
|
|
132
|
+
*/
|
|
22
133
|
errorTooltip?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Tooltip text to display when hovering over success icon
|
|
136
|
+
* Only visible when status is 'success' and showStatusIcon is true
|
|
137
|
+
*/
|
|
23
138
|
successTooltip?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Whether to show helper text below the input
|
|
141
|
+
* Displays validation errors, helper text, or character count
|
|
142
|
+
* @default false
|
|
143
|
+
*/
|
|
24
144
|
showHelperText?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Whether to show status icon (error/success) inside the input
|
|
147
|
+
* Hidden when endElement is provided or input is disabled
|
|
148
|
+
* @default true
|
|
149
|
+
*/
|
|
25
150
|
showStatusIcon?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Whether to show borders around the input
|
|
153
|
+
* @default true
|
|
154
|
+
*/
|
|
26
155
|
showBorders?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Helper text to display below the input
|
|
158
|
+
* Only shown when showHelperText is true and no errors are present
|
|
159
|
+
*/
|
|
27
160
|
helperText?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Maximum character length for the input
|
|
163
|
+
* When provided with showHelperText, displays character count (e.g., "45 / 100")
|
|
164
|
+
*/
|
|
28
165
|
maxLength?: number;
|
|
166
|
+
/**
|
|
167
|
+
* React Hook Form field error object
|
|
168
|
+
* Used to display validation error messages
|
|
169
|
+
*/
|
|
29
170
|
errors?: FieldError;
|
|
171
|
+
/**
|
|
172
|
+
* Keyboard event handler for keyup events
|
|
173
|
+
* Also used internally for character counting when maxLength is provided
|
|
174
|
+
*/
|
|
30
175
|
onKeyUp?: KeyboardEventHandler<HTMLInputElement>;
|
|
176
|
+
/**
|
|
177
|
+
* Click handler for the start element
|
|
178
|
+
* Useful for making start icons interactive (e.g., toggle password visibility)
|
|
179
|
+
*/
|
|
31
180
|
onStartElementClick?: (event: BaseSyntheticEvent) => void;
|
|
181
|
+
/**
|
|
182
|
+
* Click handler for the end element
|
|
183
|
+
* Useful for making end icons interactive (e.g., clear button)
|
|
184
|
+
*/
|
|
32
185
|
onEndElementClick?: (event: BaseSyntheticEvent) => void;
|
|
33
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Status color mappings for Input component
|
|
189
|
+
* Defines the visual styling for different validation states
|
|
190
|
+
*/
|
|
34
191
|
export interface InputStatusColors {
|
|
35
192
|
basic: Interpolation<Theme>;
|
|
36
193
|
error: Interpolation<Theme>;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
1
|
import { FieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* DateRangeField - RJSF adapter for DateRangePicker
|
|
4
|
+
*
|
|
5
|
+
* Uses DateRangePickerFormBridge so that:
|
|
6
|
+
* - Format conversion: formData (outputFormat) → DateRangePicker (inputFormat) happens in the bridge
|
|
7
|
+
* - "Present" handling: form stores PRESENT_VALUE string; picker only sees null (see bridge)
|
|
8
|
+
*
|
|
9
|
+
* SCHEMA REQUIREMENT: type must be "object" with properties start and end (each typically type: "string").
|
|
10
|
+
*
|
|
11
|
+
* USAGE (example schemas):
|
|
12
|
+
* - Both optional: { type: "object", properties: { start: { type: "string" }, end: { type: "string" } } }
|
|
13
|
+
* - Only start required: same + required: ["start"]
|
|
14
|
+
* - Both required (or "present" for end): same + required: ["start", "end"] // "present" satisfies string
|
|
15
|
+
*/
|
|
16
|
+
export declare const DateRangeField: <T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = Record<string, unknown>>(props: FieldProps<T, S, F>) => import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common date format type used by both DatePicker and DateRangePicker
|
|
3
|
+
* Valid formats: 'mm/dd/yyyy', 'dd/mm/yyyy', 'mm/yyyy', 'yyyy'
|
|
4
|
+
*
|
|
5
|
+
* This type is shared between:
|
|
6
|
+
* - DatePicker (DatePickerFormat)
|
|
7
|
+
* - DateRangePicker (Format)
|
|
8
|
+
* Both are identical, so we use this common type for validation
|
|
9
|
+
*/
|
|
10
|
+
export type DateFormat = 'mm/dd/yyyy' | 'dd/mm/yyyy' | 'mm/yyyy' | 'yyyy';
|
|
11
|
+
/**
|
|
12
|
+
* Common picker/calendar type used by both DatePicker and DateRangePicker
|
|
13
|
+
* Valid types: 'days', 'months', 'years'
|
|
14
|
+
*
|
|
15
|
+
* This type is shared between:
|
|
16
|
+
* - DateRangePicker (RangePickerType, CalendarType)
|
|
17
|
+
* - DatePicker (CalendarType)
|
|
18
|
+
* All are identical, so we use this common type
|
|
19
|
+
*/
|
|
20
|
+
export type PickerCalendarType = 'days' | 'months' | 'years';
|
|
21
|
+
/**
|
|
22
|
+
* Validates if a value is a valid date format
|
|
23
|
+
* Used by both DatePicker (DateWidget) and DateRangePicker (DateRangeField)
|
|
24
|
+
*
|
|
25
|
+
* This replaces:
|
|
26
|
+
* - isValidFormat (DateRangeField)
|
|
27
|
+
* - isValidDatePickerFormat (DateWidget)
|
|
28
|
+
*/
|
|
29
|
+
export declare const isValidDateFormat: (value: unknown) => value is DateFormat;
|
|
30
|
+
/**
|
|
31
|
+
* Valid output formats include:
|
|
32
|
+
* - Input formats: 'mm/dd/yyyy', 'dd/mm/yyyy', 'mm/yyyy', 'yyyy'
|
|
33
|
+
* - ISO formats: 'yyyy-MM-dd', 'yyyy-MM', 'yyyy'
|
|
34
|
+
*
|
|
35
|
+
* Used for outputFormat validation in DateRangeField and DateWidget
|
|
36
|
+
*/
|
|
37
|
+
export declare const isValidOutputFormat: (value: unknown) => value is string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DateRangePickerProps } from '../../DateRangePicker/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props that need special handling (validation/transformation) or are RJSF-controlled
|
|
4
|
+
* These are extracted explicitly and NOT spread
|
|
5
|
+
*/
|
|
6
|
+
export type NonSpreadableProps = 'format' | 'rangePickerType' | 'outputFormat' | 'name' | 'onChange' | 'value' | 'defaultValue';
|
|
7
|
+
/**
|
|
8
|
+
* Props that can be automatically spread from uiOptions
|
|
9
|
+
* New props added to DateRangePickerProps will automatically be included here
|
|
10
|
+
*/
|
|
11
|
+
export type SpreadableFromUiOptions = Omit<DateRangePickerProps, NonSpreadableProps>;
|
|
12
|
+
/**
|
|
13
|
+
* Extract props that need transformation/validation from uiOptions
|
|
14
|
+
*/
|
|
15
|
+
export declare const extractTransformedProps: (uiOptions: Record<string, unknown>) => {
|
|
16
|
+
rangePickerType: import("./dateFormats").PickerCalendarType;
|
|
17
|
+
outputFormat: string;
|
|
18
|
+
format: import("./dateFormats").DateFormat | undefined;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Extract props that can be spread automatically from uiOptions
|
|
22
|
+
* Filters out props that need special handling
|
|
23
|
+
*/
|
|
24
|
+
export declare const extractSpreadableProps: (uiOptions: Record<string, unknown>) => Partial<SpreadableFromUiOptions>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TypeaheadProps } from '../../Typeahead/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props that need special handling (computed from RJSF state) or are RJSF-controlled
|
|
4
|
+
* These are extracted explicitly and NOT spread
|
|
5
|
+
*/
|
|
6
|
+
export type SelectWidgetNonSpreadableProps = 'name' | 'onChange' | 'onClearAll' | 'onRemoveSelectedClick' | 'onEmptyChange' | 'selectedItems' | 'isMultiple' | 'isDisabled' | 'placeholder' | 'renderOption' | 'children';
|
|
7
|
+
/**
|
|
8
|
+
* Props that can be automatically spread from uiOptions
|
|
9
|
+
* New props added to TypeaheadProps will automatically be included here
|
|
10
|
+
*/
|
|
11
|
+
export type SelectWidgetSpreadableFromUiOptions = Omit<TypeaheadProps, SelectWidgetNonSpreadableProps>;
|
|
12
|
+
/**
|
|
13
|
+
* Extract props that can be spread automatically from uiOptions
|
|
14
|
+
* Filters out props that need special handling or are computed from RJSF state
|
|
15
|
+
*/
|
|
16
|
+
export declare const extractSelectWidgetSpreadableProps: (uiOptions: Record<string, unknown>) => Partial<SelectWidgetSpreadableFromUiOptions>;
|
|
@@ -1,3 +1,63 @@
|
|
|
1
1
|
import { ModalProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Modal - Dialog overlay for focused user interaction
|
|
4
|
+
*
|
|
5
|
+
* A compound component that provides a modal dialog with built-in state management,
|
|
6
|
+
* trigger and dismiss buttons, and optional portal rendering. Use Modal (root),
|
|
7
|
+
* ModalOpenButton (activator), ModalContent (dialog body), and ModalDismissButton
|
|
8
|
+
* (close) together. ModalContent can render in a portal to document.body (usePortal)
|
|
9
|
+
* or in place for use inside other overlays (e.g. Drawer).
|
|
10
|
+
*
|
|
11
|
+
* @category Components
|
|
12
|
+
* @subcategory Overlay
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* // Basic modal
|
|
17
|
+
* <Modal>
|
|
18
|
+
* <ModalOpenButton>
|
|
19
|
+
* <Button>Open modal</Button>
|
|
20
|
+
* </ModalOpenButton>
|
|
21
|
+
* <ModalContent aria-label="Example modal">
|
|
22
|
+
* <div>
|
|
23
|
+
* <h3>Title</h3>
|
|
24
|
+
* <p>Content</p>
|
|
25
|
+
* <ModalDismissButton>
|
|
26
|
+
* <Button variant="secondary">Close</Button>
|
|
27
|
+
* </ModalDismissButton>
|
|
28
|
+
* </div>
|
|
29
|
+
* </ModalContent>
|
|
30
|
+
* </Modal>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* // Controlled from parent
|
|
36
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
37
|
+
* <Modal isOpen={isOpen}>
|
|
38
|
+
* <ModalContent aria-label="Controlled modal">
|
|
39
|
+
* <ModalDismissButton><Button onClick={() => setIsOpen(false)}>Close</Button></ModalDismissButton>
|
|
40
|
+
* </ModalContent>
|
|
41
|
+
* </Modal>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* // Modal with portal (e.g. inside Drawer) - centers on full screen
|
|
47
|
+
* <ModalContent aria-label="Modal in drawer" usePortal>
|
|
48
|
+
* ...
|
|
49
|
+
* </ModalContent>
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see {@link ModalContent} - Dialog content and container
|
|
53
|
+
* @see {@link ModalOpenButton} - Trigger to open
|
|
54
|
+
* @see {@link ModalDismissButton} - Trigger to close
|
|
55
|
+
*
|
|
56
|
+
* @accessibility
|
|
57
|
+
* - Focus trapped within modal when open
|
|
58
|
+
* - aria-label on ModalContent for screen readers
|
|
59
|
+
* - ESC to close (when implemented in ModalDialog)
|
|
60
|
+
* - Focus management on open/close
|
|
61
|
+
*/
|
|
2
62
|
declare const Modal: ({ isOpen, ...rest }: ModalProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
63
|
export default Modal;
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
import type { ModalDialogProps } from '../ModalDialog';
|
|
2
|
+
/**
|
|
3
|
+
* Context value for Modal: [isOpen, setIsOpen].
|
|
4
|
+
* Provided by Modal (root) and consumed by ModalContent, ModalOpenButton, ModalDismissButton.
|
|
5
|
+
*/
|
|
2
6
|
export type ModalContextProps = [boolean, (isOpen: boolean) => void];
|
|
3
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Props for the Modal root and ModalContent components.
|
|
9
|
+
*
|
|
10
|
+
* Modal root accepts isOpen for controlled usage; ModalContent accepts
|
|
11
|
+
* ModalDialog props (aria-label, noBackground, className, children) plus usePortal.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Modal isOpen={isOpen}>
|
|
16
|
+
* <ModalContent aria-label="Dialog" usePortal>...</ModalContent>
|
|
17
|
+
* </Modal>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export type ModalProps = Partial<ModalDialogProps> & {
|
|
21
|
+
/** When true, render modal in a portal to document.body. When false (default), render in place (e.g. inside a Drawer). */
|
|
22
|
+
usePortal?: boolean;
|
|
23
|
+
};
|
|
@@ -1,3 +1,44 @@
|
|
|
1
1
|
import { ModalProps } from '../Modal/types';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* ModalContent - Dialog content and overlay container
|
|
4
|
+
*
|
|
5
|
+
* Renders the modal dialog content when the modal is open. Uses ModalContext
|
|
6
|
+
* to read open state. Can render in place (default) or in a portal to
|
|
7
|
+
* document.body when usePortal is true (e.g. for modals inside a Drawer that
|
|
8
|
+
* should center on the full screen).
|
|
9
|
+
*
|
|
10
|
+
* Only renders when modal is open. Accepts ModalDialog props (aria-label,
|
|
11
|
+
* noBackground, className) and usePortal. Must be used within Modal.
|
|
12
|
+
*
|
|
13
|
+
* @category Components
|
|
14
|
+
* @subcategory Overlay
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <Modal>
|
|
19
|
+
* <ModalOpenButton><Button>Open</Button></ModalOpenButton>
|
|
20
|
+
* <ModalContent aria-label="Example dialog">
|
|
21
|
+
* <p>Content</p>
|
|
22
|
+
* <ModalDismissButton><Button>Close</Button></ModalDismissButton>
|
|
23
|
+
* </ModalContent>
|
|
24
|
+
* </Modal>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* // With portal (e.g. inside Drawer) - centers on full screen
|
|
30
|
+
* <ModalContent aria-label="Dialog" usePortal>
|
|
31
|
+
* ...
|
|
32
|
+
* </ModalContent>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @see {@link Modal} - Parent component that provides context
|
|
36
|
+
* @see {@link ModalOpenButton} - Trigger to open
|
|
37
|
+
* @see {@link ModalDismissButton} - Trigger to close
|
|
38
|
+
*
|
|
39
|
+
* @accessibility
|
|
40
|
+
* - aria-label should be set for screen readers
|
|
41
|
+
* - Renders in portal when usePortal for proper stacking
|
|
42
|
+
*/
|
|
43
|
+
declare function ModalContent({ children, 'aria-label': ariaLabel, usePortal, ...props }: ModalProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
3
44
|
export default ModalContent;
|
|
@@ -1,3 +1,30 @@
|
|
|
1
1
|
import { ModalDialogProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* ModalDialog - Presentational dialog container and overlay
|
|
4
|
+
*
|
|
5
|
+
* Renders the fixed full-screen overlay and centered dialog box. Used internally
|
|
6
|
+
* by ModalContent; typically not used directly. Handles visibility (display
|
|
7
|
+
* based on isOpen), optional background overlay (noBackground), and dialog
|
|
8
|
+
* ARIA attributes (role="dialog", aria-modal).
|
|
9
|
+
*
|
|
10
|
+
* @category Components
|
|
11
|
+
* @subcategory Overlay
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // Usually used via ModalContent
|
|
16
|
+
* <ModalContent aria-label="My dialog">
|
|
17
|
+
* <div>Dialog body</div>
|
|
18
|
+
* </ModalContent>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @see {@link Modal} - Root component that provides state
|
|
22
|
+
* @see {@link ModalContent} - Wraps ModalDialog and handles portal
|
|
23
|
+
*
|
|
24
|
+
* @accessibility
|
|
25
|
+
* - role="dialog", aria-modal="true"
|
|
26
|
+
* - aria-label for screen reader label
|
|
27
|
+
* - Fixed overlay for focus containment
|
|
28
|
+
*/
|
|
2
29
|
declare const ModalDialog: ({ isOpen, noBackground, children, "aria-label": ariaLabel, ...props }: ModalDialogProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
30
|
export default ModalDialog;
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the ModalDialog presentational component.
|
|
3
|
+
*
|
|
4
|
+
* Used by ModalContent when rendering the dialog. isOpen controls visibility;
|
|
5
|
+
* noBackground removes the overlay; aria-label is required for accessibility.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <ModalDialog isOpen={true} aria-label="Confirm action">
|
|
10
|
+
* <p>Are you sure?</p>
|
|
11
|
+
* </ModalDialog>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
1
14
|
export interface ModalDialogProps {
|
|
15
|
+
/** Whether the dialog is visible. When false, content is hidden (display: none). */
|
|
2
16
|
isOpen: boolean;
|
|
17
|
+
/** When true, the overlay is transparent (no dimmed background). */
|
|
3
18
|
noBackground?: boolean;
|
|
19
|
+
/** Accessible name for the dialog (required for screen readers). */
|
|
4
20
|
'aria-label'?: string;
|
|
21
|
+
/** Dialog body content. */
|
|
5
22
|
children?: React.ReactNode;
|
|
23
|
+
/** Optional CSS class for the inner dialog element. */
|
|
6
24
|
className?: string;
|
|
7
25
|
}
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ModalDismissButton - Trigger element that closes the modal
|
|
3
|
+
*
|
|
4
|
+
* Wraps a single React element (typically a Button) and injects an onClick
|
|
5
|
+
* handler that closes the modal via ModalContext. Preserves the child's
|
|
6
|
+
* existing onClick by calling both. Must be used within Modal.
|
|
7
|
+
*
|
|
8
|
+
* @category Components
|
|
9
|
+
* @subcategory Overlay
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Modal>
|
|
14
|
+
* <ModalOpenButton><Button>Open</Button></ModalOpenButton>
|
|
15
|
+
* <ModalContent aria-label="Dialog">
|
|
16
|
+
* <p>Content</p>
|
|
17
|
+
* <ModalDismissButton>
|
|
18
|
+
* <Button variant="secondary">Close</Button>
|
|
19
|
+
* </ModalDismissButton>
|
|
20
|
+
* </ModalContent>
|
|
21
|
+
* </Modal>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @see {@link Modal} - Parent component that provides context
|
|
25
|
+
* @see {@link ModalContent} - Content container
|
|
26
|
+
* @see {@link ModalOpenButton} - Trigger to open
|
|
27
|
+
*/
|
|
28
|
+
declare function ModalDismissButton({ children: child, }: {
|
|
29
|
+
children: React.JSX.Element;
|
|
3
30
|
}): import("react").FunctionComponentElement<any>;
|
|
4
31
|
export default ModalDismissButton;
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModalOpenButton - Trigger element that opens the modal
|
|
3
|
+
*
|
|
4
|
+
* Wraps a single React element (typically a Button) and injects an onClick
|
|
5
|
+
* handler that opens the modal via ModalContext. Preserves the child's
|
|
6
|
+
* existing onClick by calling both. Must be used within Modal.
|
|
7
|
+
*
|
|
8
|
+
* @category Components
|
|
9
|
+
* @subcategory Overlay
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Modal>
|
|
14
|
+
* <ModalOpenButton>
|
|
15
|
+
* <Button>Open modal</Button>
|
|
16
|
+
* </ModalOpenButton>
|
|
17
|
+
* <ModalContent aria-label="Dialog">...</ModalContent>
|
|
18
|
+
* </Modal>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @see {@link Modal} - Parent component that provides context
|
|
22
|
+
* @see {@link ModalContent} - Content displayed when open
|
|
23
|
+
* @see {@link ModalDismissButton} - Trigger to close
|
|
24
|
+
*/
|
|
1
25
|
declare function ModalOpenButton({ children: child }: {
|
|
2
|
-
children: JSX.Element;
|
|
26
|
+
children: React.JSX.Element;
|
|
3
27
|
}): import("react").FunctionComponentElement<any>;
|
|
4
28
|
export default ModalOpenButton;
|