@nulogy/components 15.2.1 → 15.2.3
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/README.md +3 -3
- package/dist/main.js +53108 -54055
- package/dist/main.module.js +8809 -9756
- package/dist/src/Alert/Alert.js +2 -14
- package/dist/src/Alert/Alert.story.d.ts +15 -19
- package/dist/src/Alert/Alert.story.js +25 -14
- package/dist/src/AppTag/components/LogoWrapper.d.ts +0 -1
- package/dist/src/AppTag/components/NulogyLogo.js +2 -14
- package/dist/src/AsyncSelect/AsyncSelect.graphql.story.js +4 -13
- package/dist/src/AsyncSelect/AsyncSelect.js +14 -16
- package/dist/src/AsyncSelect/AsyncSelectComponents.js +9 -21
- package/dist/src/AsyncSelect/fixtures.js +4 -13
- package/dist/src/Banner/Banner.js +1 -15
- package/dist/src/BottomSheet/BottomSheet.js +2 -15
- package/dist/src/BottomSheet/BottomSheet.parts.d.ts +2 -2
- package/dist/src/BottomSheet/BottomSheet.parts.js +8 -22
- package/dist/src/BottomSheet/BottomSheet.styled.d.ts +4 -5
- package/dist/src/Box/Box.d.ts +12 -4
- package/dist/src/BrandedNavBar/DesktopMenu.js +22 -36
- package/dist/src/BrandedNavBar/MenuTrigger.js +4 -16
- package/dist/src/BrandedNavBar/MenuTriggerButton.js +8 -22
- package/dist/src/BrandedNavBar/MobileMenu.js +28 -35
- package/dist/src/BrandedNavBar/NavBar.js +7 -21
- package/dist/src/BrandedNavBar/NavBar.story.d.ts +4 -6
- package/dist/src/BrandedNavBar/NavBar.story.js +12 -4
- package/dist/src/BrandedNavBar/NavBarBackground.d.ts +0 -1
- package/dist/src/BrandedNavBar/NavBarDropdownMenu.js +14 -8
- package/dist/src/BrandedNavBar/SmallNavBar.js +4 -16
- package/dist/src/BrandedNavBar/SmallNavBar.story.d.ts +5 -2
- package/dist/src/BrandedNavBar/SmallNavBar.story.js +27 -6
- package/dist/src/BrandedNavBar/SubMenuTrigger.js +4 -16
- package/dist/src/BrandedNavBar/SubMenuTriggerButton.js +2 -14
- package/dist/src/BrandedNavBar/renderSubMenuItems.js +7 -17
- package/dist/src/Branding/Branding.js +2 -14
- package/dist/src/Branding/BrandingText.d.ts +0 -1
- package/dist/src/Branding/LettermarkLogo.js +2 -14
- package/dist/src/Branding/WordmarkLogo.js +2 -14
- package/dist/src/Breadcrumbs/Breadcrumbs.js +2 -14
- package/dist/src/Breadcrumbs/BreadcrumbsList.d.ts +0 -1
- package/dist/src/Breadcrumbs/BreadcrumbsListItem.d.ts +0 -1
- package/dist/src/Button/Button.js +2 -14
- package/dist/src/Button/CloseButton.js +1 -1
- package/dist/src/Button/ControlIcon.js +2 -16
- package/dist/src/Button/DangerButton.d.ts +0 -1
- package/dist/src/Button/IconicButton.js +55 -73
- package/dist/src/Button/PrimaryButton.d.ts +0 -1
- package/dist/src/Button/QuietButton.d.ts +0 -1
- package/dist/src/ButtonGroup/ButtonGroup.d.ts +0 -1
- package/dist/src/ButtonGroup/ButtonGroup.js +8 -2
- package/dist/src/Card/Card.js +2 -14
- package/dist/src/Card/Card.story.js +1 -1
- package/dist/src/Card/CardSet.d.ts +0 -1
- package/dist/src/Checkbox/Checkbox.js +20 -6
- package/dist/src/Checkbox/Checkbox.story.js +4 -1
- package/dist/src/Checkbox/CheckboxGroup.js +4 -16
- package/dist/src/DatePickers/DatePicker.js +2 -14
- package/dist/src/DatePickers/MonthPicker.js +2 -14
- package/dist/src/DatePickers/WeekPicker.js +10 -17
- package/dist/src/DatePickers/custom/weekPickerStyles.d.ts +0 -1
- package/dist/src/DatePickers/shared/components/BasePicker.js +9 -15
- package/dist/src/DatePickers/shared/components/DatePickerInput.js +2 -13
- package/dist/src/DatePickers/shared/styles.d.ts +0 -1
- package/dist/src/DatePickers/shared/types.d.ts +0 -1
- package/dist/src/DatePickers/stories/DatePicker.story.d.ts +7 -3
- package/dist/src/DatePickers/stories/DatePicker.story.js +54 -22
- package/dist/src/DatePickers/stories/WeekPicker.story.js +1 -1
- package/dist/src/DateRange/DateRange.js +36 -22
- package/dist/src/DateRange/DateRangeStyles.d.ts +0 -1
- package/dist/src/DateRange/EndTime.d.ts +3 -4
- package/dist/src/DateRange/StartTime.d.ts +3 -4
- package/dist/src/Decorations/index.js +1 -1
- package/dist/src/DescriptionList/DescriptionList.js +1 -13
- package/dist/src/DescriptionList/DescriptionList.parts.d.ts +0 -1
- package/dist/src/DescriptionList/DescriptionList.parts.js +156 -77
- package/dist/src/DescriptionList/DescriptionListContext.js +1 -15
- package/dist/src/DescriptionList/lib/utils.js +1 -1
- package/dist/src/DescriptionList/stories/DescriptionList.column.story.js +1 -1
- package/dist/src/DescriptionList/stories/DescriptionList.group-min-width.story.d.ts +7 -8
- package/dist/src/DescriptionList/stories/DescriptionList.group-min-width.story.js +15 -12
- package/dist/src/DescriptionList/stories/DescriptionList.layout.story.js +1 -1
- package/dist/src/DescriptionList/stories/DescriptionList.playground.story.d.ts +7 -8
- package/dist/src/DescriptionList/stories/DescriptionList.playground.story.js +203 -195
- package/dist/src/DescriptionList/stories/fixtures.d.ts +2 -2
- package/dist/src/Divider/Divider.d.ts +0 -1
- package/dist/src/DropdownMenu/DropdownItem.d.ts +0 -1
- package/dist/src/DropdownMenu/DropdownMenu.js +13 -17
- package/dist/src/DropdownMenu/DropdownMenu.story.js +2 -2
- package/dist/src/DropdownMenu/DropdownMenuContainer.d.ts +0 -1
- package/dist/src/DropdownMenu/DropdownMenuContainer.js +10 -1
- package/dist/src/DropdownMenu/DropdownText.d.ts +1 -2
- package/dist/src/FieldLabel/FieldLabel.js +2 -14
- package/dist/src/FieldLabel/HelpText.d.ts +1 -2
- package/dist/src/FieldLabel/LabelText.d.ts +0 -1
- package/dist/src/FieldLabel/MaybeFieldLabel.js +1 -15
- package/dist/src/FieldLabel/RequirementText.js +1 -1
- package/dist/src/Flex/Flex.d.ts +0 -1
- package/dist/src/Flex/Flex.story.js +3 -17
- package/dist/src/Form/Field.d.ts +0 -1
- package/dist/src/Form/Fieldset.d.ts +0 -1
- package/dist/src/Form/Form.js +3 -17
- package/dist/src/Form/FormSection.js +3 -17
- package/dist/src/Icon/Icon.js +9 -24
- package/dist/src/Icon/LoadingIcon.js +2 -14
- package/dist/src/Input/Input.js +3 -15
- package/dist/src/Input/InputField.js +4 -16
- package/dist/src/Input/Prefix.js +2 -16
- package/dist/src/Input/Suffix.js +2 -14
- package/dist/src/Layout/ApplicationFrame.js +2 -14
- package/dist/src/Layout/Header.d.ts +1 -1
- package/dist/src/Layout/Header.js +4 -17
- package/dist/src/Layout/Header.story.d.ts +10 -9
- package/dist/src/Layout/Header.story.js +9 -8
- package/dist/src/Layout/Page.js +5 -19
- package/dist/src/Layout/Sidebar.js +4 -18
- package/dist/src/Layout/Sidebar.story.d.ts +4 -1
- package/dist/src/Layout/Sidebar.story.js +24 -31
- package/dist/src/Link/Link.js +13 -21
- package/dist/src/List/List.d.ts +0 -1
- package/dist/src/Modal/Modal.story.d.ts +39 -61
- package/dist/src/Modal/Modal.story.js +110 -85
- package/dist/src/Modal/ModalCloseButton.d.ts +0 -1
- package/dist/src/Modal/ModalFooter.d.ts +0 -1
- package/dist/src/Modal/ModalHeader.d.ts +0 -1
- package/dist/src/NDSProvider/ComponentVariantContext.js +1 -1
- package/dist/src/NDSProvider/GlobalStyles.d.ts +0 -1
- package/dist/src/NDSProvider/ModalStyleOverride.d.ts +0 -1
- package/dist/src/NDSProvider/Reset.d.ts +0 -1
- package/dist/src/NDSProvider/renderWithNDSProvider.spec-utils.d.ts +3 -1
- package/dist/src/NDSProvider/renderWithNDSProvider.spec-utils.js +3 -1
- package/dist/src/NavBarSearch/NavBarSearch.js +2 -14
- package/dist/src/Navigation/Navigation.js +3 -16
- package/dist/src/Navigation/components/AppSwitcher/NulogyAppSwitcher.js +6 -3
- package/dist/src/Navigation/components/AppSwitcher/parts/Item.js +1 -15
- package/dist/src/Navigation/components/AppSwitcher/parts/Link.js +2 -16
- package/dist/src/Navigation/components/AppSwitcher/parts/index.d.ts +4 -5
- package/dist/src/Navigation/components/DesktopNav/DesktopNav.js +2 -2
- package/dist/src/Navigation/components/MenuSubItem/MenuSubItem.js +4 -5
- package/dist/src/Navigation/components/MenuSubItem/parts/styled.d.ts +0 -1
- package/dist/src/Navigation/components/MenuSubItem/parts/styled.js +49 -7
- package/dist/src/Navigation/components/MobileNav/MobileNav.js +2 -2
- package/dist/src/Navigation/components/MobileNav/parts/MobileMenuItem.js +12 -21
- package/dist/src/Navigation/components/MobileNav/parts/styled.d.ts +1 -2
- package/dist/src/Navigation/components/MobileNav/parts/styled.js +35 -4
- package/dist/src/Navigation/components/NulogyLogo/SvgNulogyLogo.js +1 -1
- package/dist/src/Navigation/components/UserMenu/UserMenu.d.ts +0 -1
- package/dist/src/Navigation/components/UserMenu/parts/Header.js +1 -1
- package/dist/src/Navigation/components/UserMenu/parts/Item.js +7 -16
- package/dist/src/Navigation/components/UserMenu/parts/MobileItem.js +7 -16
- package/dist/src/Navigation/components/UserMenu/parts/styled.d.ts +0 -1
- package/dist/src/Navigation/components/UserMenu/parts/styled.js +43 -18
- package/dist/src/Navigation/components/shared/NavigationLogo.js +4 -16
- package/dist/src/Navigation/components/shared/NavigationLogoLink.js +2 -14
- package/dist/src/Navigation/components/shared/NavigationMenuContent.d.ts +0 -1
- package/dist/src/Navigation/components/shared/NavigationMenuItem.js +10 -24
- package/dist/src/Navigation/components/shared/components.d.ts +0 -1
- package/dist/src/Navigation/components/shared/components.js +29 -5
- package/dist/src/Navigation/hooks/useResponsiveMenu.d.ts +0 -1
- package/dist/src/Navigation/stories/Navigation.mobileVisibility.story.js +21 -9
- package/dist/src/Navigation/stories/fixtures/logos/CustomLogo2.js +1 -1
- package/dist/src/Navigation/stories/fixtures/logos/CustomLogo3.js +1 -1
- package/dist/src/Navigation/stories/fixtures/logos/Customlogo1.js +1 -1
- package/dist/src/Overlay/Overlay.d.ts +0 -1
- package/dist/src/Pagination/PageNumber.d.ts +0 -1
- package/dist/src/Pagination/Pagination.js +3 -16
- package/dist/src/Pagination/PaginationButton.d.ts +0 -1
- package/dist/src/Popper/Popper.js +29 -6
- package/dist/src/Primitives/index.d.ts +0 -1
- package/dist/src/Radio/Radio.js +11 -18
- package/dist/src/Radio/Radio.story.d.ts +322 -32
- package/dist/src/Radio/Radio.story.js +36 -22
- package/dist/src/Radio/RadioGroup.js +4 -16
- package/dist/src/RangeContainer/RangeContainer.js +6 -15
- package/dist/src/Select/MenuList.js +14 -19
- package/dist/src/Select/Select.d.ts +2 -2
- package/dist/src/Select/Select.js +16 -17
- package/dist/src/Select/Select.spec-utils.js +1 -0
- package/dist/src/Select/Select.story.d.ts +5 -1
- package/dist/src/Select/Select.story.fixture.js +8 -30
- package/dist/src/Select/Select.story.js +107 -31
- package/dist/src/Select/SelectComponents.js +7 -7
- package/dist/src/Select/SelectOption.js +1 -1
- package/dist/src/Select/customReactSelectStyles.js +152 -44
- package/dist/src/Select/lib.js +1 -2
- package/dist/src/SortingTable/SortingTable.js +6 -15
- package/dist/src/StatusIndicator/StatusIndicator.d.ts +0 -1
- package/dist/src/StatusIndicator/StatusIndicator.js +16 -1
- package/dist/src/Summary/Summary.js +2 -14
- package/dist/src/Summary/SummaryDivider.js +1 -1
- package/dist/src/Summary/SummaryItem.js +2 -14
- package/dist/src/Switcher/Switch.js +23 -19
- package/dist/src/Switcher/Switcher.js +4 -16
- package/dist/src/Table/BaseTable.js +2 -14
- package/dist/src/Table/StatefulTable.d.ts +1 -1
- package/dist/src/Table/StatefulTable.js +17 -9
- package/dist/src/Table/StyledTh.d.ts +0 -1
- package/dist/src/Table/StyledTh.js +11 -2
- package/dist/src/Table/Table.js +2 -14
- package/dist/src/Table/Table.types.d.ts +0 -1
- package/dist/src/Table/TableBody.js +11 -11
- package/dist/src/Table/TableFoot.js +5 -8
- package/dist/src/Table/TableHead.js +1 -4
- package/dist/src/Table/addExpandableControl.js +5 -2
- package/dist/src/Table/addSelectableControl.js +5 -2
- package/dist/src/Table/stories/BaseTable.story.d.ts +11 -7
- package/dist/src/Table/stories/BaseTable.story.js +156 -34
- package/dist/src/Table/stories/SortingColumnHeader.story.d.ts +5 -2
- package/dist/src/Table/stories/SortingColumnHeader.story.js +20 -3
- package/dist/src/Table/stories/Table.story.d.ts +7 -14
- package/dist/src/Table/stories/Table.story.js +172 -127
- package/dist/src/Table/stories/TableWithCustomSorting.story.js +4 -1
- package/dist/src/Table/stories/TableWithFiltering.story.js +8 -2
- package/dist/src/Table/stories/TableWithServerSidePagination.story.js +4 -15
- package/dist/src/Tabs/Tab.js +11 -18
- package/dist/src/Tabs/TabContainer.d.ts +0 -1
- package/dist/src/Tabs/TabScrollIndicator.js +2 -14
- package/dist/src/Tabs/Tabs.js +5 -7
- package/dist/src/Textarea/Textarea.js +3 -15
- package/dist/src/TimePicker/TimePicker.js +2 -14
- package/dist/src/TimePicker/TimePickerDropdown.d.ts +0 -1
- package/dist/src/TimePicker/TimePickerInput.d.ts +0 -1
- package/dist/src/TimePicker/TimePickerInput.js +6 -4
- package/dist/src/TimeRange/TimeRange.js +20 -20
- package/dist/src/Toast/Toast.js +4 -16
- package/dist/src/ToastContainer/ToastContainer.js +4 -16
- package/dist/src/ToastContainer/ToastContainer.story.js +1 -1
- package/dist/src/ToastContainer/ToastFunction.js +7 -19
- package/dist/src/Toggle/Toggle.js +4 -17
- package/dist/src/Toggle/ToggleButton.js +2 -14
- package/dist/src/Tooltip/Tooltip.story.d.ts +15 -52
- package/dist/src/Tooltip/Tooltip.story.js +80 -72
- package/dist/src/Tooltip/TooltipContainer.d.ts +0 -1
- package/dist/src/Tooltip/TooltipContainer.js +16 -1
- package/dist/src/Tooltip/components/TooltipComponents.js +9 -24
- package/dist/src/TopBar/TopBar.styled.d.ts +14 -7
- package/dist/src/TopBar/components/BackLink.js +2 -14
- package/dist/src/TopBar/components/Menu.js +2 -15
- package/dist/src/TopBar/components/MenuItemLink.js +2 -14
- package/dist/src/TopBar/components/PageTitle.js +2 -14
- package/dist/src/TopBar/stories/TopBar.backButton.story.js +3 -3
- package/dist/src/TopBar/stories/TopBar.menu.story.js +9 -20
- package/dist/src/TopBar/stories/TopBar.story.js +3 -3
- package/dist/src/TruncatedText/TruncatedText.js +8 -16
- package/dist/src/TruncatedText/components/MaybeTooltip.d.ts +1 -1
- package/dist/src/TruncatedText/components/TruncatedTextFillWidth.js +3 -15
- package/dist/src/TruncatedText/components/TruncatedTextMaxCharacters.js +4 -16
- package/dist/src/Type/Headings.d.ts +4 -5
- package/dist/src/Type/Text.d.ts +0 -1
- package/dist/src/Validation/InlineValidation.js +2 -14
- package/dist/src/VerticalDivider/VerticalDivider.d.ts +0 -1
- package/dist/src/VisualTests/WithSpace.story.js +18 -18
- package/dist/src/hooks/useMediaQuery/useMediaQuery.js +1 -2
- package/dist/src/i18n.js +1 -1
- package/dist/src/locale.story.js +1 -1
- package/dist/src/testing/matchers/toHaveStyle.d.ts +15 -0
- package/dist/src/testing/matchers/toHaveStyle.js +50 -0
- package/dist/src/testing/matchers/toMatchDate.d.ts +1 -0
- package/dist/src/testing/matchers/toMatchDate.js +1 -1
- package/dist/src/theme/mergeThemes.util.js +7 -1
- package/dist/src/theme/useNDSTheme.js +9 -3
- package/dist/src/utils/ClickInputLabel.d.ts +0 -1
- package/dist/src/utils/DetectOutsideClick.d.ts +3 -0
- package/dist/src/utils/DetectOutsideClick.js +3 -0
- package/dist/src/utils/PopperArrow.js +5 -1
- package/dist/src/utils/ScrollIndicators.js +1 -1
- package/dist/src/utils/generateId.d.ts +5 -0
- package/dist/src/utils/generateId.js +5 -0
- package/dist/src/utils/index.d.ts +0 -1
- package/dist/src/utils/index.js +0 -1
- package/dist/src/utils/numberFromDimension/numberFromDimension.spec.js +1 -0
- package/dist/src/utils/story/code.d.ts +0 -1
- package/dist/src/utils/story/dashed.d.ts +2 -2
- package/dist/src/utils/story/placeholder.js +1 -1
- package/dist/src/utils/story/resizable.d.ts +2 -2
- package/dist/src/utils/story/resizable.js +1 -1
- package/dist/src/utils/story/simulatedAPIRequests.js +8 -19
- package/dist/src/utils/subPx.js +1 -1
- package/dist/src/utils/testing/useConditionalAutoClick.js +3 -3
- package/dist/src/utils/testing/useUrlProps.js +1 -1
- package/dist/src/utils/ts/FocusManager.js +1 -1
- package/dist/src/utils/useWindowDimension.story.d.ts +1 -1
- package/dist/src/utils/withMenuState.js +1 -1
- package/dist/vitest.config.d.ts +2 -0
- package/dist/vitest.config.js +11 -0
- package/package.json +45 -85
- package/dist/src/NDSProvider/mountWithNDSProvider.spec-utils.d.ts +0 -1
- package/dist/src/NDSProvider/mountWithNDSProvider.spec-utils.js +0 -4
- package/dist/src/utils/withWindowDimensions.d.ts +0 -3
- package/dist/src/utils/withWindowDimensions.js +0 -28
|
@@ -1,37 +1,327 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react";
|
|
1
2
|
import React from "react";
|
|
3
|
+
import { Radio } from "../index";
|
|
2
4
|
declare const _default: {
|
|
3
5
|
title: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
6
|
+
component: React.ForwardRefExoticComponent<Omit<{
|
|
7
|
+
children?: React.ReactNode | Record<string, unknown>;
|
|
8
|
+
value?: string | readonly string[] | number | undefined;
|
|
9
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
10
|
+
form?: string | undefined;
|
|
11
|
+
slot?: string | undefined;
|
|
12
|
+
style?: React.CSSProperties | undefined;
|
|
13
|
+
title?: string | undefined;
|
|
14
|
+
pattern?: string | undefined;
|
|
15
|
+
property?: string | undefined;
|
|
16
|
+
color?: string | undefined;
|
|
17
|
+
content?: string | undefined;
|
|
18
|
+
height?: number | string | undefined;
|
|
19
|
+
translate?: "yes" | "no" | undefined;
|
|
20
|
+
width?: number | string | undefined;
|
|
21
|
+
hidden?: boolean | undefined;
|
|
22
|
+
key?: React.Key | null | undefined;
|
|
23
|
+
defaultChecked?: boolean | undefined;
|
|
24
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
25
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
26
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
27
|
+
accessKey?: string | undefined;
|
|
28
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
29
|
+
autoFocus?: boolean | undefined;
|
|
30
|
+
className?: string | undefined;
|
|
31
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
|
|
32
|
+
contextMenu?: string | undefined;
|
|
33
|
+
dir?: string | undefined;
|
|
34
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
35
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
36
|
+
id?: string | undefined;
|
|
37
|
+
lang?: string | undefined;
|
|
38
|
+
nonce?: string | undefined;
|
|
39
|
+
placeholder?: string | undefined;
|
|
40
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
41
|
+
tabIndex?: number | undefined;
|
|
42
|
+
radioGroup?: string | undefined;
|
|
43
|
+
role?: React.AriaRole | undefined;
|
|
44
|
+
about?: string | undefined;
|
|
45
|
+
datatype?: string | undefined;
|
|
46
|
+
inlist?: any;
|
|
47
|
+
prefix?: string | undefined;
|
|
48
|
+
rel?: string | undefined;
|
|
49
|
+
resource?: string | undefined;
|
|
50
|
+
rev?: string | undefined;
|
|
51
|
+
typeof?: string | undefined;
|
|
52
|
+
vocab?: string | undefined;
|
|
53
|
+
autoCorrect?: string | undefined;
|
|
54
|
+
autoSave?: string | undefined;
|
|
55
|
+
itemProp?: string | undefined;
|
|
56
|
+
itemScope?: boolean | undefined;
|
|
57
|
+
itemType?: string | undefined;
|
|
58
|
+
itemID?: string | undefined;
|
|
59
|
+
itemRef?: string | undefined;
|
|
60
|
+
results?: number | undefined;
|
|
61
|
+
security?: string | undefined;
|
|
62
|
+
unselectable?: "on" | "off" | undefined;
|
|
63
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
64
|
+
is?: string | undefined;
|
|
65
|
+
exportparts?: string | undefined;
|
|
66
|
+
part?: string | undefined;
|
|
67
|
+
"aria-activedescendant"?: string | undefined;
|
|
68
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
69
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
70
|
+
"aria-braillelabel"?: string | undefined;
|
|
71
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
72
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
73
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
74
|
+
"aria-colcount"?: number | undefined;
|
|
75
|
+
"aria-colindex"?: number | undefined;
|
|
76
|
+
"aria-colindextext"?: string | undefined;
|
|
77
|
+
"aria-colspan"?: number | undefined;
|
|
78
|
+
"aria-controls"?: string | undefined;
|
|
79
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
80
|
+
"aria-describedby"?: string | undefined;
|
|
81
|
+
"aria-description"?: string | undefined;
|
|
82
|
+
"aria-details"?: string | undefined;
|
|
83
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
84
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
85
|
+
"aria-errormessage"?: string | undefined;
|
|
86
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
87
|
+
"aria-flowto"?: string | undefined;
|
|
88
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
89
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
90
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
91
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
92
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
93
|
+
"aria-label"?: string | undefined;
|
|
94
|
+
"aria-labelledby"?: string | undefined;
|
|
95
|
+
"aria-level"?: number | undefined;
|
|
96
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
97
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
98
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
99
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
100
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
101
|
+
"aria-owns"?: string | undefined;
|
|
102
|
+
"aria-placeholder"?: string | undefined;
|
|
103
|
+
"aria-posinset"?: number | undefined;
|
|
104
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
105
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
106
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
107
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
108
|
+
"aria-roledescription"?: string | undefined;
|
|
109
|
+
"aria-rowcount"?: number | undefined;
|
|
110
|
+
"aria-rowindex"?: number | undefined;
|
|
111
|
+
"aria-rowindextext"?: string | undefined;
|
|
112
|
+
"aria-rowspan"?: number | undefined;
|
|
113
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
114
|
+
"aria-setsize"?: number | undefined;
|
|
115
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
116
|
+
"aria-valuemax"?: number | undefined;
|
|
117
|
+
"aria-valuemin"?: number | undefined;
|
|
118
|
+
"aria-valuenow"?: number | undefined;
|
|
119
|
+
"aria-valuetext"?: string | undefined;
|
|
120
|
+
dangerouslySetInnerHTML?: {
|
|
121
|
+
__html: string | TrustedHTML;
|
|
122
|
+
} | undefined;
|
|
123
|
+
onCopy?: React.ClipboardEventHandler<HTMLInputElement>;
|
|
124
|
+
onCopyCapture?: React.ClipboardEventHandler<HTMLInputElement>;
|
|
125
|
+
onCut?: React.ClipboardEventHandler<HTMLInputElement>;
|
|
126
|
+
onCutCapture?: React.ClipboardEventHandler<HTMLInputElement>;
|
|
127
|
+
onPaste?: React.ClipboardEventHandler<HTMLInputElement>;
|
|
128
|
+
onPasteCapture?: React.ClipboardEventHandler<HTMLInputElement>;
|
|
129
|
+
onCompositionEnd?: React.CompositionEventHandler<HTMLInputElement>;
|
|
130
|
+
onCompositionEndCapture?: React.CompositionEventHandler<HTMLInputElement>;
|
|
131
|
+
onCompositionStart?: React.CompositionEventHandler<HTMLInputElement>;
|
|
132
|
+
onCompositionStartCapture?: React.CompositionEventHandler<HTMLInputElement>;
|
|
133
|
+
onCompositionUpdate?: React.CompositionEventHandler<HTMLInputElement>;
|
|
134
|
+
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLInputElement>;
|
|
135
|
+
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
136
|
+
onFocusCapture?: React.FocusEventHandler<HTMLInputElement>;
|
|
137
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
138
|
+
onBlurCapture?: React.FocusEventHandler<HTMLInputElement>;
|
|
139
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
140
|
+
onChangeCapture?: React.FormEventHandler<HTMLInputElement>;
|
|
141
|
+
onBeforeInput?: React.InputEventHandler<HTMLInputElement>;
|
|
142
|
+
onBeforeInputCapture?: React.FormEventHandler<HTMLInputElement>;
|
|
143
|
+
onInput?: React.FormEventHandler<HTMLInputElement>;
|
|
144
|
+
onInputCapture?: React.FormEventHandler<HTMLInputElement>;
|
|
145
|
+
onReset?: React.FormEventHandler<HTMLInputElement>;
|
|
146
|
+
onResetCapture?: React.FormEventHandler<HTMLInputElement>;
|
|
147
|
+
onSubmit?: React.FormEventHandler<HTMLInputElement>;
|
|
148
|
+
onSubmitCapture?: React.FormEventHandler<HTMLInputElement>;
|
|
149
|
+
onInvalid?: React.FormEventHandler<HTMLInputElement>;
|
|
150
|
+
onInvalidCapture?: React.FormEventHandler<HTMLInputElement>;
|
|
151
|
+
onLoad?: React.ReactEventHandler<HTMLInputElement>;
|
|
152
|
+
onLoadCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
153
|
+
onError?: React.ReactEventHandler<HTMLInputElement>;
|
|
154
|
+
onErrorCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
155
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
156
|
+
onKeyDownCapture?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
157
|
+
onKeyPress?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
158
|
+
onKeyPressCapture?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
159
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
160
|
+
onKeyUpCapture?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
161
|
+
onAbort?: React.ReactEventHandler<HTMLInputElement>;
|
|
162
|
+
onAbortCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
163
|
+
onCanPlay?: React.ReactEventHandler<HTMLInputElement>;
|
|
164
|
+
onCanPlayCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
165
|
+
onCanPlayThrough?: React.ReactEventHandler<HTMLInputElement>;
|
|
166
|
+
onCanPlayThroughCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
167
|
+
onDurationChange?: React.ReactEventHandler<HTMLInputElement>;
|
|
168
|
+
onDurationChangeCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
169
|
+
onEmptied?: React.ReactEventHandler<HTMLInputElement>;
|
|
170
|
+
onEmptiedCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
171
|
+
onEncrypted?: React.ReactEventHandler<HTMLInputElement>;
|
|
172
|
+
onEncryptedCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
173
|
+
onEnded?: React.ReactEventHandler<HTMLInputElement>;
|
|
174
|
+
onEndedCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
175
|
+
onLoadedData?: React.ReactEventHandler<HTMLInputElement>;
|
|
176
|
+
onLoadedDataCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
177
|
+
onLoadedMetadata?: React.ReactEventHandler<HTMLInputElement>;
|
|
178
|
+
onLoadedMetadataCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
179
|
+
onLoadStart?: React.ReactEventHandler<HTMLInputElement>;
|
|
180
|
+
onLoadStartCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
181
|
+
onPause?: React.ReactEventHandler<HTMLInputElement>;
|
|
182
|
+
onPauseCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
183
|
+
onPlay?: React.ReactEventHandler<HTMLInputElement>;
|
|
184
|
+
onPlayCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
185
|
+
onPlaying?: React.ReactEventHandler<HTMLInputElement>;
|
|
186
|
+
onPlayingCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
187
|
+
onProgress?: React.ReactEventHandler<HTMLInputElement>;
|
|
188
|
+
onProgressCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
189
|
+
onRateChange?: React.ReactEventHandler<HTMLInputElement>;
|
|
190
|
+
onRateChangeCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
191
|
+
onSeeked?: React.ReactEventHandler<HTMLInputElement>;
|
|
192
|
+
onSeekedCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
193
|
+
onSeeking?: React.ReactEventHandler<HTMLInputElement>;
|
|
194
|
+
onSeekingCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
195
|
+
onStalled?: React.ReactEventHandler<HTMLInputElement>;
|
|
196
|
+
onStalledCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
197
|
+
onSuspend?: React.ReactEventHandler<HTMLInputElement>;
|
|
198
|
+
onSuspendCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
199
|
+
onTimeUpdate?: React.ReactEventHandler<HTMLInputElement>;
|
|
200
|
+
onTimeUpdateCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
201
|
+
onVolumeChange?: React.ReactEventHandler<HTMLInputElement>;
|
|
202
|
+
onVolumeChangeCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
203
|
+
onWaiting?: React.ReactEventHandler<HTMLInputElement>;
|
|
204
|
+
onWaitingCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
205
|
+
onAuxClick?: React.MouseEventHandler<HTMLInputElement>;
|
|
206
|
+
onAuxClickCapture?: React.MouseEventHandler<HTMLInputElement>;
|
|
207
|
+
onClick?: React.MouseEventHandler<HTMLInputElement>;
|
|
208
|
+
onClickCapture?: React.MouseEventHandler<HTMLInputElement>;
|
|
209
|
+
onContextMenu?: React.MouseEventHandler<HTMLInputElement>;
|
|
210
|
+
onContextMenuCapture?: React.MouseEventHandler<HTMLInputElement>;
|
|
211
|
+
onDoubleClick?: React.MouseEventHandler<HTMLInputElement>;
|
|
212
|
+
onDoubleClickCapture?: React.MouseEventHandler<HTMLInputElement>;
|
|
213
|
+
onDrag?: React.DragEventHandler<HTMLInputElement>;
|
|
214
|
+
onDragCapture?: React.DragEventHandler<HTMLInputElement>;
|
|
215
|
+
onDragEnd?: React.DragEventHandler<HTMLInputElement>;
|
|
216
|
+
onDragEndCapture?: React.DragEventHandler<HTMLInputElement>;
|
|
217
|
+
onDragEnter?: React.DragEventHandler<HTMLInputElement>;
|
|
218
|
+
onDragEnterCapture?: React.DragEventHandler<HTMLInputElement>;
|
|
219
|
+
onDragExit?: React.DragEventHandler<HTMLInputElement>;
|
|
220
|
+
onDragExitCapture?: React.DragEventHandler<HTMLInputElement>;
|
|
221
|
+
onDragLeave?: React.DragEventHandler<HTMLInputElement>;
|
|
222
|
+
onDragLeaveCapture?: React.DragEventHandler<HTMLInputElement>;
|
|
223
|
+
onDragOver?: React.DragEventHandler<HTMLInputElement>;
|
|
224
|
+
onDragOverCapture?: React.DragEventHandler<HTMLInputElement>;
|
|
225
|
+
onDragStart?: React.DragEventHandler<HTMLInputElement>;
|
|
226
|
+
onDragStartCapture?: React.DragEventHandler<HTMLInputElement>;
|
|
227
|
+
onDrop?: React.DragEventHandler<HTMLInputElement>;
|
|
228
|
+
onDropCapture?: React.DragEventHandler<HTMLInputElement>;
|
|
229
|
+
onMouseDown?: React.MouseEventHandler<HTMLInputElement>;
|
|
230
|
+
onMouseDownCapture?: React.MouseEventHandler<HTMLInputElement>;
|
|
231
|
+
onMouseEnter?: React.MouseEventHandler<HTMLInputElement>;
|
|
232
|
+
onMouseLeave?: React.MouseEventHandler<HTMLInputElement>;
|
|
233
|
+
onMouseMove?: React.MouseEventHandler<HTMLInputElement>;
|
|
234
|
+
onMouseMoveCapture?: React.MouseEventHandler<HTMLInputElement>;
|
|
235
|
+
onMouseOut?: React.MouseEventHandler<HTMLInputElement>;
|
|
236
|
+
onMouseOutCapture?: React.MouseEventHandler<HTMLInputElement>;
|
|
237
|
+
onMouseOver?: React.MouseEventHandler<HTMLInputElement>;
|
|
238
|
+
onMouseOverCapture?: React.MouseEventHandler<HTMLInputElement>;
|
|
239
|
+
onMouseUp?: React.MouseEventHandler<HTMLInputElement>;
|
|
240
|
+
onMouseUpCapture?: React.MouseEventHandler<HTMLInputElement>;
|
|
241
|
+
onSelect?: React.ReactEventHandler<HTMLInputElement>;
|
|
242
|
+
onSelectCapture?: React.ReactEventHandler<HTMLInputElement>;
|
|
243
|
+
onTouchCancel?: React.TouchEventHandler<HTMLInputElement>;
|
|
244
|
+
onTouchCancelCapture?: React.TouchEventHandler<HTMLInputElement>;
|
|
245
|
+
onTouchEnd?: React.TouchEventHandler<HTMLInputElement>;
|
|
246
|
+
onTouchEndCapture?: React.TouchEventHandler<HTMLInputElement>;
|
|
247
|
+
onTouchMove?: React.TouchEventHandler<HTMLInputElement>;
|
|
248
|
+
onTouchMoveCapture?: React.TouchEventHandler<HTMLInputElement>;
|
|
249
|
+
onTouchStart?: React.TouchEventHandler<HTMLInputElement>;
|
|
250
|
+
onTouchStartCapture?: React.TouchEventHandler<HTMLInputElement>;
|
|
251
|
+
onPointerDown?: React.PointerEventHandler<HTMLInputElement>;
|
|
252
|
+
onPointerDownCapture?: React.PointerEventHandler<HTMLInputElement>;
|
|
253
|
+
onPointerMove?: React.PointerEventHandler<HTMLInputElement>;
|
|
254
|
+
onPointerMoveCapture?: React.PointerEventHandler<HTMLInputElement>;
|
|
255
|
+
onPointerUp?: React.PointerEventHandler<HTMLInputElement>;
|
|
256
|
+
onPointerUpCapture?: React.PointerEventHandler<HTMLInputElement>;
|
|
257
|
+
onPointerCancel?: React.PointerEventHandler<HTMLInputElement>;
|
|
258
|
+
onPointerCancelCapture?: React.PointerEventHandler<HTMLInputElement>;
|
|
259
|
+
onPointerEnter?: React.PointerEventHandler<HTMLInputElement>;
|
|
260
|
+
onPointerEnterCapture?: React.PointerEventHandler<HTMLInputElement>;
|
|
261
|
+
onPointerLeave?: React.PointerEventHandler<HTMLInputElement>;
|
|
262
|
+
onPointerLeaveCapture?: React.PointerEventHandler<HTMLInputElement>;
|
|
263
|
+
onPointerOver?: React.PointerEventHandler<HTMLInputElement>;
|
|
264
|
+
onPointerOverCapture?: React.PointerEventHandler<HTMLInputElement>;
|
|
265
|
+
onPointerOut?: React.PointerEventHandler<HTMLInputElement>;
|
|
266
|
+
onPointerOutCapture?: React.PointerEventHandler<HTMLInputElement>;
|
|
267
|
+
onGotPointerCapture?: React.PointerEventHandler<HTMLInputElement>;
|
|
268
|
+
onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLInputElement>;
|
|
269
|
+
onLostPointerCapture?: React.PointerEventHandler<HTMLInputElement>;
|
|
270
|
+
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLInputElement>;
|
|
271
|
+
onScroll?: React.UIEventHandler<HTMLInputElement>;
|
|
272
|
+
onScrollCapture?: React.UIEventHandler<HTMLInputElement>;
|
|
273
|
+
onWheel?: React.WheelEventHandler<HTMLInputElement>;
|
|
274
|
+
onWheelCapture?: React.WheelEventHandler<HTMLInputElement>;
|
|
275
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLInputElement>;
|
|
276
|
+
onAnimationStartCapture?: React.AnimationEventHandler<HTMLInputElement>;
|
|
277
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLInputElement>;
|
|
278
|
+
onAnimationEndCapture?: React.AnimationEventHandler<HTMLInputElement>;
|
|
279
|
+
onAnimationIteration?: React.AnimationEventHandler<HTMLInputElement>;
|
|
280
|
+
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLInputElement>;
|
|
281
|
+
onTransitionEnd?: React.TransitionEventHandler<HTMLInputElement>;
|
|
282
|
+
onTransitionEndCapture?: React.TransitionEventHandler<HTMLInputElement>;
|
|
283
|
+
list?: string | undefined;
|
|
284
|
+
name?: string | undefined;
|
|
285
|
+
type?: React.HTMLInputTypeAttribute | undefined;
|
|
286
|
+
alt?: string | undefined;
|
|
287
|
+
src?: string | undefined;
|
|
288
|
+
disabled?: boolean | undefined;
|
|
289
|
+
formAction?: string | undefined;
|
|
290
|
+
formEncType?: string | undefined;
|
|
291
|
+
formMethod?: string | undefined;
|
|
292
|
+
formNoValidate?: boolean | undefined;
|
|
293
|
+
formTarget?: string | undefined;
|
|
294
|
+
autoComplete?: string | undefined;
|
|
295
|
+
accept?: string | undefined;
|
|
296
|
+
capture?: boolean | "user" | "environment" | undefined;
|
|
297
|
+
checked?: boolean | undefined;
|
|
298
|
+
max?: number | string | undefined;
|
|
299
|
+
maxLength?: number | undefined;
|
|
300
|
+
min?: number | string | undefined;
|
|
301
|
+
minLength?: number | undefined;
|
|
302
|
+
multiple?: boolean | undefined;
|
|
303
|
+
readOnly?: boolean | undefined;
|
|
304
|
+
required?: boolean | undefined;
|
|
305
|
+
step?: number | string | undefined;
|
|
306
|
+
} & import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
|
|
307
|
+
htmlSize?: number;
|
|
308
|
+
variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
|
|
309
|
+
labelText?: React.ReactNode;
|
|
310
|
+
checked?: boolean;
|
|
311
|
+
defaultChecked?: boolean;
|
|
312
|
+
error?: boolean;
|
|
313
|
+
}, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
314
|
+
args: {
|
|
315
|
+
id: string;
|
|
316
|
+
labelText: string;
|
|
36
317
|
};
|
|
37
318
|
};
|
|
319
|
+
export default _default;
|
|
320
|
+
type Story = StoryObj<typeof Radio>;
|
|
321
|
+
export declare const Default: Story;
|
|
322
|
+
export declare const SetToDefaultChecked: Story;
|
|
323
|
+
export declare const SetToDisabled: Story;
|
|
324
|
+
export declare const SetToError: Story;
|
|
325
|
+
export declare const SetToRequired: Story;
|
|
326
|
+
export declare const Controlled: Story;
|
|
327
|
+
export declare const UsingRefToControlFocus: Story;
|
|
@@ -3,42 +3,56 @@ import { action } from "@storybook/addon-actions";
|
|
|
3
3
|
import { Radio, Button } from "../index";
|
|
4
4
|
export default {
|
|
5
5
|
title: "Components/Radio",
|
|
6
|
+
component: Radio,
|
|
7
|
+
args: {
|
|
8
|
+
id: "radio",
|
|
9
|
+
labelText: "I am a radio button",
|
|
10
|
+
},
|
|
6
11
|
};
|
|
7
|
-
export const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
name: "Set to defaultChecked",
|
|
12
|
+
export const Default = {
|
|
13
|
+
args: {
|
|
14
|
+
labelText: "I am a radio button",
|
|
15
|
+
},
|
|
12
16
|
};
|
|
13
|
-
export const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
export const SetToDefaultChecked = {
|
|
18
|
+
args: {
|
|
19
|
+
defaultChecked: true,
|
|
20
|
+
labelText: "I am checked by default",
|
|
21
|
+
},
|
|
22
|
+
name: "Set to default checked",
|
|
23
|
+
};
|
|
24
|
+
export const SetToDisabled = {
|
|
25
|
+
render: (args) => (React.createElement(React.Fragment, null,
|
|
26
|
+
React.createElement(Radio, { ...args, id: "radio-1", disabled: true, labelText: "I am disabled" }),
|
|
27
|
+
React.createElement(Radio, { ...args, id: "radio-2", checked: true, disabled: true, labelText: "I am disabled" }))),
|
|
17
28
|
name: "Set to disabled",
|
|
18
29
|
};
|
|
19
|
-
export const SetToError =
|
|
20
|
-
React.createElement(
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
export const SetToError = {
|
|
31
|
+
render: (args) => (React.createElement(React.Fragment, null,
|
|
32
|
+
React.createElement(Radio, { ...args, id: "radio", error: true, labelText: "I am error" }),
|
|
33
|
+
React.createElement(Radio, { ...args, id: "radio", defaultChecked: true, error: true, labelText: "I am error" }))),
|
|
23
34
|
name: "Set to error",
|
|
24
35
|
};
|
|
25
|
-
export const SetToRequired =
|
|
26
|
-
React.createElement(
|
|
27
|
-
|
|
36
|
+
export const SetToRequired = {
|
|
37
|
+
render: (args) => (React.createElement(React.Fragment, null,
|
|
38
|
+
React.createElement(Radio, { ...args, id: "radio", labelText: "I am a radio button", required: true }))),
|
|
28
39
|
name: "Set to required",
|
|
29
40
|
};
|
|
30
|
-
export const Controlled =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
export const Controlled = {
|
|
42
|
+
render: (args) => (React.createElement(React.Fragment, null,
|
|
43
|
+
React.createElement(Radio, { ...args, id: "radio-1", checked: true, onChange: action("onChange"), labelText: "I am controlled and checked" }),
|
|
44
|
+
React.createElement(Radio, { ...args, id: "radio-2", checked: false, onChange: action("onChange"), labelText: "I am controlled and unchecked" }))),
|
|
45
|
+
};
|
|
46
|
+
const UsingRefToControlFocusComponent = () => {
|
|
34
47
|
const ref = useRef(null);
|
|
35
48
|
const handleClick = () => {
|
|
36
49
|
ref.current.focus();
|
|
37
50
|
};
|
|
38
51
|
return (React.createElement(React.Fragment, null,
|
|
39
52
|
React.createElement(Radio, { ref: ref, checked: true, onChange: action("onChange"), labelText: "I am controlled and checked" }),
|
|
40
|
-
React.createElement(Button, { onClick: handleClick }, "Focus the Input")));
|
|
53
|
+
React.createElement(Button, { onClick: handleClick, "data-testid": "the-button" }, "Focus the Input")));
|
|
41
54
|
};
|
|
42
|
-
UsingRefToControlFocus
|
|
55
|
+
export const UsingRefToControlFocus = {
|
|
56
|
+
render: (args) => React.createElement(UsingRefToControlFocusComponent, { ...args }),
|
|
43
57
|
name: "using ref to control focus",
|
|
44
58
|
};
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import { useTheme } from "styled-components";
|
|
14
3
|
import { HelpText, RequirementText } from "../FieldLabel";
|
|
15
4
|
import { InlineValidation } from "../Validation";
|
|
16
5
|
import { Fieldset } from "../Form";
|
|
17
6
|
import Radio from "./Radio";
|
|
18
|
-
export default function RadioGroup(
|
|
19
|
-
|
|
20
|
-
const otherProps = Object.assign(Object.assign({}, props), { errorMessage, errorList });
|
|
7
|
+
export default function RadioGroup({ className, id, errorMessage, errorList, labelText, helpText, requirementText, ...props }) {
|
|
8
|
+
const otherProps = { ...props, errorMessage, errorList };
|
|
21
9
|
const theme = useTheme();
|
|
22
10
|
return (React.createElement(Fieldset, { className: className, id: id },
|
|
23
11
|
React.createElement("legend", { style: { marginBottom: theme.space.x1 } },
|
|
@@ -34,8 +22,8 @@ const labelTextStyles = (theme) => ({
|
|
|
34
22
|
});
|
|
35
23
|
const getRadioButtons = (props) => {
|
|
36
24
|
const radioButtons = React.Children.map(props.children, (radio) => {
|
|
37
|
-
const
|
|
38
|
-
return (React.createElement(Radio,
|
|
25
|
+
const { value, disabled, required, onChange, ...radioProps } = radio.props;
|
|
26
|
+
return (React.createElement(Radio, { ...radioProps, value: value, disabled: props.disabled || disabled, error: !!(props.errorMessage || props.errorList), required: props.required || required, name: props.name, defaultChecked: value === props.defaultValue ? true : undefined, checked: props.checkedValue && value === props.checkedValue, onChange: props.onChange || onChange }));
|
|
39
27
|
});
|
|
40
28
|
return radioButtons;
|
|
41
29
|
};
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import propTypes from "@styled-system/prop-types";
|
|
14
3
|
import { Text } from "../Type";
|
|
@@ -17,12 +6,14 @@ import { FieldLabel } from "../FieldLabel";
|
|
|
17
6
|
import { FieldLabelDefaultProps } from "../FieldLabel/FieldLabel.type";
|
|
18
7
|
import { InlineValidation } from "../Validation";
|
|
19
8
|
import { getSubset, omitSubset } from "../utils/subset";
|
|
20
|
-
const RangeContainer = (
|
|
21
|
-
|
|
9
|
+
const RangeContainer = ({ startComponent, endComponent, errorMessages = [], labelProps = {
|
|
10
|
+
...FieldLabelDefaultProps,
|
|
11
|
+
labelText: "Range",
|
|
12
|
+
}, variant, ...props }) => {
|
|
22
13
|
const spaceProps = getSubset(props, propTypes.space);
|
|
23
14
|
const restProps = omitSubset(props, propTypes.space);
|
|
24
|
-
return (React.createElement(Flex,
|
|
25
|
-
React.createElement(FieldLabel,
|
|
15
|
+
return (React.createElement(Flex, { ...spaceProps, flexDirection: "column" },
|
|
16
|
+
React.createElement(FieldLabel, { ...labelProps, ...restProps }),
|
|
26
17
|
React.createElement(Flex, { flexWrap: "wrap", mt: "x1", mb: errorMessages.length ? "x1" : "x3" },
|
|
27
18
|
React.createElement(Flex, null, startComponent),
|
|
28
19
|
React.createElement(Flex, { px: "half", alignItems: "flex-end", alignSelf: "flex-end" },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copied as is from: https://github.com/jacobworrel/react-windowed-select/blob/
|
|
2
|
+
Copied as is from: https://github.com/jacobworrel/react-windowed-select/blob/main/src/MenuList.tsx
|
|
3
3
|
MIT License
|
|
4
4
|
Copyright (c) 2019 Jacob Worrel
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
@@ -18,17 +18,6 @@
|
|
|
18
18
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
19
|
SOFTWARE.
|
|
20
20
|
*/
|
|
21
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
|
-
var t = {};
|
|
23
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
24
|
-
t[p] = s[p];
|
|
25
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
26
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
28
|
-
t[p[i]] = s[p[i]];
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
};
|
|
32
21
|
import * as React from "react";
|
|
33
22
|
import { VariableSizeList as List } from "react-window";
|
|
34
23
|
import { createGetHeight, flattenGroupedChildren, getCurrentIndex } from "./lib";
|
|
@@ -63,7 +52,7 @@ function MenuList(props) {
|
|
|
63
52
|
const itemCount = children.length;
|
|
64
53
|
const [measuredHeights, setMeasuredHeights] = React.useState({});
|
|
65
54
|
// calc menu height
|
|
66
|
-
const
|
|
55
|
+
const { maxHeight, paddingBottom = 0, paddingTop = 0, ...menuListStyle } = getStyles("menuList", props);
|
|
67
56
|
const totalHeight = React.useMemo(() => {
|
|
68
57
|
return heights.reduce((sum, height, idx) => {
|
|
69
58
|
if (measuredHeights[idx]) {
|
|
@@ -88,7 +77,10 @@ function MenuList(props) {
|
|
|
88
77
|
if (measuredHeights[index] !== undefined && measuredHeights[index] === measuredHeight) {
|
|
89
78
|
return;
|
|
90
79
|
}
|
|
91
|
-
setMeasuredHeights((measuredHeights) => (
|
|
80
|
+
setMeasuredHeights((measuredHeights) => ({
|
|
81
|
+
...measuredHeights,
|
|
82
|
+
[index]: measuredHeight,
|
|
83
|
+
}));
|
|
92
84
|
// this forces the list to rerender items after the item positions resizing
|
|
93
85
|
if (list.current) {
|
|
94
86
|
list.current.resetAfterIndex(index);
|
|
@@ -104,11 +96,14 @@ function MenuList(props) {
|
|
|
104
96
|
}, [currentIndex, children, list]);
|
|
105
97
|
return (React.createElement(List, { className: classNamePrefix
|
|
106
98
|
? `${classNamePrefix}__menu-list${isMulti ? ` ${classNamePrefix}__menu-list--is-multi` : ""}`
|
|
107
|
-
: "", style: menuListStyle, ref: list, outerRef: innerRef, estimatedItemSize: estimatedItemSize, innerElementType: React.forwardRef((
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return (React.createElement("div", { style:
|
|
99
|
+
: "", style: menuListStyle, ref: list, outerRef: innerRef, estimatedItemSize: estimatedItemSize, innerElementType: React.forwardRef(({ style, ...rest }, ref) => (React.createElement("div", { ref: ref, style: {
|
|
100
|
+
...style,
|
|
101
|
+
height: `${parseFloat(style.height) + paddingBottom + paddingTop}px`,
|
|
102
|
+
}, ...rest }))), height: menuHeight, width: "100%", itemCount: itemCount, itemData: children, itemSize: (index) => measuredHeights[index] || heights[index] }, ({ data, index, style }) => {
|
|
103
|
+
return (React.createElement("div", { style: {
|
|
104
|
+
...style,
|
|
105
|
+
top: `${parseFloat(style.top.toString()) + paddingTop}px`,
|
|
106
|
+
} },
|
|
112
107
|
React.createElement(MenuItem, { data: data[index], index: index, setMeasuredHeight: setMeasuredHeight })));
|
|
113
108
|
}));
|
|
114
109
|
}
|
|
@@ -10,7 +10,7 @@ export interface NDSOption {
|
|
|
10
10
|
label: ReactNode;
|
|
11
11
|
value: NDSOptionValue;
|
|
12
12
|
}
|
|
13
|
-
interface CustomProps<Option extends NDSOption, IsMulti extends boolean, Group extends GroupBase<Option>> extends StyledProps {
|
|
13
|
+
export interface CustomProps<Option extends NDSOption, IsMulti extends boolean, Group extends GroupBase<Option>> extends StyledProps {
|
|
14
14
|
autocomplete?: Props<Option, IsMulti, Group>["isSearchable"];
|
|
15
15
|
labelText?: FieldLabelProps["labelText"];
|
|
16
16
|
requirementText?: FieldLabelProps["requirementText"];
|
|
@@ -30,5 +30,5 @@ interface CustomProps<Option extends NDSOption, IsMulti extends boolean, Group e
|
|
|
30
30
|
styles?: (selectStyles: StylesConfig<Option, IsMulti, Group>) => StylesConfig<Option, IsMulti, Group>;
|
|
31
31
|
}
|
|
32
32
|
export type NDSSelectProps<Option extends NDSOption = NDSOption, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> = Omit<Props<Option, IsMulti, Group>, keyof CustomProps<Option, IsMulti, Group> | "isSearchable" | "isDisabled" | "defaultMenuIsOpen" | "isMulti" | "styles"> & CustomProps<Option, IsMulti, Group>;
|
|
33
|
-
declare const NDSSelect: <Option extends NDSOption = NDSOption, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props:
|
|
33
|
+
declare const NDSSelect: <Option extends NDSOption = NDSOption, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: NDSSelectProps<Option, IsMulti, Group> & React.RefAttributes<Select<Option, IsMulti, Group>>) => React.ReactElement;
|
|
34
34
|
export default NDSSelect;
|