@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
|
@@ -10,100 +10,179 @@ export const DescriptionListContainer = styled.div({
|
|
|
10
10
|
width: "100%",
|
|
11
11
|
});
|
|
12
12
|
export const DescriptionList = styled.dl(({ theme }) => {
|
|
13
|
-
var _a, _b;
|
|
14
13
|
const { fontSize, lineHeight, density, columns, groupMinWidth } = useDescriptionListContext();
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
return {
|
|
15
|
+
containerType: "inline-size",
|
|
16
|
+
width: "100%",
|
|
17
|
+
margin: 0,
|
|
18
|
+
display: "grid",
|
|
19
|
+
columnGap: theme.space[gapConfig[density]],
|
|
20
|
+
fontSize: theme.fontSizes[fontSize] ?? theme.fontSizes.medium,
|
|
21
|
+
lineHeight: theme.lineHeights[lineHeight] ?? theme.lineHeights.base,
|
|
22
|
+
...(typeof columns === "number" && {
|
|
23
|
+
gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
|
|
24
|
+
}),
|
|
25
|
+
"a, p": {
|
|
18
26
|
fontSize: "inherit",
|
|
19
27
|
lineHeight: "inherit",
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
},
|
|
29
|
+
...(groupMinWidth && {
|
|
30
|
+
gridTemplateColumns: `repeat(auto-fit, minmax(${groupMinWidth}, 1fr))`,
|
|
31
|
+
}),
|
|
32
|
+
...(typeof columns === "object" && {
|
|
33
|
+
...Object.fromEntries(Object.entries(columns).map(([key, value]) => [
|
|
34
|
+
`@container (min-width: ${theme.breakpoints[key]})`,
|
|
35
|
+
{ gridTemplateColumns: `repeat(${value}, minmax(0, 1fr))` },
|
|
36
|
+
])),
|
|
37
|
+
}),
|
|
38
|
+
};
|
|
26
39
|
});
|
|
27
40
|
export const DescriptionGroup = styled.div(({ theme, rowSpan, columnSpan }) => {
|
|
28
41
|
const { descriptionTermMaxWidth, layout, showDivider, autoLayoutBreakpoint } = useDescriptionListContext();
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
return {
|
|
43
|
+
display: "grid",
|
|
44
|
+
gridTemplateRows: "auto 1fr",
|
|
45
|
+
...(showDivider && {
|
|
46
|
+
borderBottom: `1px solid ${theme.colors.lightGrey}`,
|
|
47
|
+
}),
|
|
48
|
+
...(layout === "inline" && {
|
|
49
|
+
gridTemplateColumns: `minmax(0, ${descriptionTermMaxWidth}) 1fr`,
|
|
50
|
+
}),
|
|
51
|
+
...((layout === "stacked" || layout === "auto") && {
|
|
52
|
+
gridTemplateColumns: "1fr",
|
|
53
|
+
}),
|
|
54
|
+
...(columnSpan && {
|
|
55
|
+
gridColumn: `span ${columnSpan} / span ${columnSpan}`,
|
|
56
|
+
}),
|
|
57
|
+
...(rowSpan && {
|
|
58
|
+
gridRow: `span ${rowSpan} / span ${rowSpan}`,
|
|
59
|
+
}),
|
|
60
|
+
[`@container (min-width: ${autoLayoutBreakpoint})`]: {
|
|
61
|
+
...(layout === "auto" && {
|
|
62
|
+
gridTemplateColumns: `minmax(0, min(50%, ${descriptionTermMaxWidth})) 1fr`,
|
|
63
|
+
}),
|
|
64
|
+
},
|
|
65
|
+
};
|
|
42
66
|
});
|
|
43
67
|
export const DescriptionTerm = styled.dt(({ theme }) => {
|
|
44
68
|
const { showDivider, layout, density, autoLayoutBreakpoint } = useDescriptionListContext();
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
return {
|
|
70
|
+
gridColumnStart: 1,
|
|
71
|
+
color: theme.colors.midGrey,
|
|
72
|
+
paddingLeft: theme.space.none,
|
|
73
|
+
paddingRight: theme.space.none,
|
|
74
|
+
...(layout !== "inline" && {
|
|
75
|
+
paddingBottom: theme.space.none,
|
|
76
|
+
}),
|
|
77
|
+
...(density === "compact" && {
|
|
78
|
+
paddingTop: theme.space.x0_25,
|
|
79
|
+
...(layout === "inline" && {
|
|
80
|
+
paddingBottom: theme.space.x0_25,
|
|
81
|
+
}),
|
|
82
|
+
}),
|
|
83
|
+
...(density === "medium" && {
|
|
84
|
+
paddingTop: theme.space.x0_75,
|
|
85
|
+
...(layout === "inline" && {
|
|
86
|
+
paddingBottom: theme.space.x0_75,
|
|
87
|
+
}),
|
|
88
|
+
}),
|
|
89
|
+
...(density === "relaxed" && {
|
|
90
|
+
paddingTop: theme.space.x1_5,
|
|
91
|
+
paddingBottom: theme.space.x0_25,
|
|
92
|
+
...(layout === "inline" && {
|
|
93
|
+
paddingBottom: theme.space.x1_5,
|
|
94
|
+
}),
|
|
95
|
+
}),
|
|
96
|
+
...(showDivider && {
|
|
61
97
|
borderTopWidth: "1px",
|
|
62
98
|
borderTopStyle: "solid",
|
|
63
99
|
borderTopColor: theme.colors.lightGrey,
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
100
|
+
}),
|
|
101
|
+
"&:first-child": {
|
|
102
|
+
border: "none",
|
|
103
|
+
},
|
|
104
|
+
[`@container (min-width: ${autoLayoutBreakpoint})`]: {
|
|
105
|
+
// wide auto layout
|
|
106
|
+
...(showDivider &&
|
|
107
|
+
layout !== "stacked" && {
|
|
108
|
+
borderTopWidth: "1px",
|
|
109
|
+
borderTopStyle: "solid",
|
|
110
|
+
borderTopColor: theme.colors.lightGrey,
|
|
111
|
+
}),
|
|
112
|
+
...(density === "compact" &&
|
|
113
|
+
layout !== "stacked" && {
|
|
114
|
+
paddingBottom: theme.space.x0_25,
|
|
115
|
+
}),
|
|
116
|
+
...(density === "medium" &&
|
|
117
|
+
layout !== "stacked" && {
|
|
118
|
+
paddingBottom: theme.space.x0_75,
|
|
119
|
+
}),
|
|
120
|
+
...(density === "relaxed" &&
|
|
121
|
+
layout !== "stacked" && {
|
|
122
|
+
paddingBottom: theme.space.x1_5,
|
|
123
|
+
}),
|
|
124
|
+
},
|
|
125
|
+
};
|
|
74
126
|
});
|
|
75
127
|
export const DescriptionDetails = styled.dd(({ theme }) => {
|
|
76
128
|
const { autoLayoutBreakpoint, showDivider, density, layout } = useDescriptionListContext();
|
|
77
|
-
return
|
|
129
|
+
return {
|
|
78
130
|
// narrow stuff + non-auto layout
|
|
79
|
-
margin: 0,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
131
|
+
margin: 0,
|
|
132
|
+
color: theme.colors.black,
|
|
133
|
+
paddingLeft: theme.space.none,
|
|
134
|
+
paddingRight: theme.space.none,
|
|
135
|
+
...(layout !== "inline" && {
|
|
136
|
+
paddingTop: theme.space.none,
|
|
137
|
+
}),
|
|
138
|
+
...(density === "compact" && {
|
|
139
|
+
paddingBottom: theme.space.x0_25,
|
|
140
|
+
...(layout === "inline" && {
|
|
141
|
+
paddingTop: theme.space.x0_25,
|
|
142
|
+
}),
|
|
143
|
+
}),
|
|
144
|
+
...(density === "medium" && {
|
|
145
|
+
paddingBottom: theme.space.x0_75,
|
|
146
|
+
...(layout === "inline" && {
|
|
147
|
+
paddingTop: theme.space.x0_75,
|
|
148
|
+
}),
|
|
149
|
+
}),
|
|
150
|
+
...(density === "relaxed" && {
|
|
151
|
+
paddingBottom: theme.space.x1_5,
|
|
152
|
+
paddingTop: theme.space.x0_25,
|
|
153
|
+
...(layout === "inline" && {
|
|
154
|
+
paddingTop: theme.space.x1_5,
|
|
155
|
+
}),
|
|
156
|
+
}),
|
|
157
|
+
...(showDivider &&
|
|
158
|
+
layout === "inline" && {
|
|
96
159
|
borderTopWidth: "1px",
|
|
97
160
|
borderTopStyle: "solid",
|
|
98
161
|
borderTopColor: theme.colors.lightGrey,
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
162
|
+
}),
|
|
163
|
+
"&:nth-child(2)": {
|
|
164
|
+
border: "none",
|
|
165
|
+
},
|
|
166
|
+
[`@container (min-width: ${autoLayoutBreakpoint})`]: {
|
|
167
|
+
// wide auto layout
|
|
168
|
+
...(showDivider &&
|
|
169
|
+
layout !== "stacked" && {
|
|
170
|
+
borderTopWidth: "1px",
|
|
171
|
+
borderTopStyle: "solid",
|
|
172
|
+
borderTopColor: theme.colors.lightGrey,
|
|
173
|
+
}),
|
|
174
|
+
...(density === "compact" &&
|
|
175
|
+
layout !== "stacked" && {
|
|
176
|
+
paddingTop: theme.space.x0_25,
|
|
177
|
+
}),
|
|
178
|
+
...(density === "medium" &&
|
|
179
|
+
layout !== "stacked" && {
|
|
180
|
+
paddingTop: theme.space.x0_75,
|
|
181
|
+
}),
|
|
182
|
+
...(density === "relaxed" &&
|
|
183
|
+
layout !== "stacked" && {
|
|
184
|
+
paddingTop: theme.space.x1_5,
|
|
185
|
+
}),
|
|
186
|
+
},
|
|
187
|
+
};
|
|
109
188
|
});
|
|
@@ -1,20 +1,6 @@
|
|
|
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, { createContext, useContext } from "react";
|
|
13
2
|
const DescriptionListContext = createContext(undefined);
|
|
14
|
-
export const DescriptionListProvider = (
|
|
15
|
-
var { children } = _a, contextProps = __rest(_a, ["children"]);
|
|
16
|
-
return (React.createElement(DescriptionListContext.Provider, { value: contextProps }, children));
|
|
17
|
-
};
|
|
3
|
+
export const DescriptionListProvider = ({ children, ...contextProps }) => (React.createElement(DescriptionListContext.Provider, { value: contextProps }, children));
|
|
18
4
|
export const useDescriptionListContext = () => {
|
|
19
5
|
const context = useContext(DescriptionListContext);
|
|
20
6
|
if (!context) {
|
|
@@ -2,7 +2,7 @@ export function validateAndExtractGridProps(props) {
|
|
|
2
2
|
const columns = "columns" in props ? props.columns : undefined;
|
|
3
3
|
const groupMinWidth = "groupMinWidth" in props ? props.groupMinWidth : undefined;
|
|
4
4
|
if (columns && groupMinWidth) {
|
|
5
|
-
throw new Error("Please provide either a `columns` or `groupMinWidth` prop to the DescriptionList, not both.\n\nSee component documentation: https://github.com/nulogy/design-system/blob/
|
|
5
|
+
throw new Error("Please provide either a `columns` or `groupMinWidth` prop to the DescriptionList, not both.\n\nSee component documentation: https://github.com/nulogy/design-system/blob/main/src/DescriptionList/README.md");
|
|
6
6
|
}
|
|
7
7
|
return { columns, groupMinWidth };
|
|
8
8
|
}
|
|
@@ -40,7 +40,7 @@ export const ThreeColumns = () => React.createElement(ColumnDemo, { title: "Thre
|
|
|
40
40
|
export const ResponsiveColumns = () => (React.createElement(ColumnDemo, { resizable: true, title: "Responsive Columns", columns: { small: 1, medium: 3, large: 6 }, description: "Small: 1 column, Medium: 3 columns, Large: 6 columns", info: React.createElement(Text, { fontSize: "sm", color: "darkGrey" },
|
|
41
41
|
"The breakpoint is based on the container width, not the viewport width. See component",
|
|
42
42
|
" ",
|
|
43
|
-
React.createElement(Link, { href: "https://github.com/nulogy/design-system/blob/
|
|
43
|
+
React.createElement(Link, { href: "https://github.com/nulogy/design-system/blob/main/src/DescriptionList/README.md" }, "documentation"),
|
|
44
44
|
".") }));
|
|
45
45
|
ResponsiveColumns.parameters = {
|
|
46
46
|
chromatic: {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
chromatic: {
|
|
6
|
-
viewports: number[];
|
|
7
|
-
};
|
|
8
|
-
};
|
|
1
|
+
import type { StoryObj } from "@storybook/react";
|
|
2
|
+
import DescriptionList from "../DescriptionList";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
9
5
|
};
|
|
6
|
+
export default _default;
|
|
7
|
+
type Story = StoryObj<typeof DescriptionList>;
|
|
8
|
+
export declare const GroupMinWidth: Story;
|
|
@@ -5,22 +5,25 @@ import { Heading1, Text } from "../../Type";
|
|
|
5
5
|
import { Resizable } from "../../utils/story/resizable";
|
|
6
6
|
import DescriptionList from "../DescriptionList";
|
|
7
7
|
import { SampleContent } from "./fixtures";
|
|
8
|
-
export
|
|
9
|
-
|
|
8
|
+
export default {
|
|
9
|
+
title: "Components/DescriptionList/GroupMinWidth",
|
|
10
|
+
};
|
|
11
|
+
export const GroupMinWidth = {
|
|
12
|
+
render: () => (React.createElement(Flex, { flexDirection: "column", gap: "x4" },
|
|
10
13
|
React.createElement(Flex, { flexDirection: "column", gap: "x2" },
|
|
11
14
|
React.createElement(Heading1, { compact: true }, "Group Min Width"),
|
|
12
15
|
React.createElement(Text, { fontSize: "sm", mb: "x4" }, "In this example the groupMinWidth is set to 200px, each group is given a minimum width of 200px with the remaining space distributed evenly between the groups."),
|
|
13
16
|
React.createElement(Resizable, { containerWidth: "100%", showContainerOutline: true },
|
|
14
17
|
React.createElement(DescriptionList, { groupMinWidth: "200px" },
|
|
15
|
-
React.createElement(SampleContent, null))))))
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
React.createElement(SampleContent, null)))))),
|
|
19
|
+
parameters: {
|
|
20
|
+
chromatic: {
|
|
21
|
+
viewports: [
|
|
22
|
+
parseInt(legacy.breakpoints.extraSmall),
|
|
23
|
+
parseInt(legacy.breakpoints.small),
|
|
24
|
+
parseInt(legacy.breakpoints.medium),
|
|
25
|
+
parseInt(legacy.breakpoints.large),
|
|
26
|
+
],
|
|
27
|
+
},
|
|
25
28
|
},
|
|
26
29
|
};
|
|
@@ -41,7 +41,7 @@ export const Auto = () => {
|
|
|
41
41
|
React.createElement(Text, { fontSize: "sm", color: "darkGrey" },
|
|
42
42
|
"The breakpoint is based on the container width, not the viewport width. See component",
|
|
43
43
|
" ",
|
|
44
|
-
React.createElement(Link, { href: "https://github.com/nulogy/design-system/blob/
|
|
44
|
+
React.createElement(Link, { href: "https://github.com/nulogy/design-system/blob/main/src/DescriptionList/README.md" }, "documentation"),
|
|
45
45
|
"."))),
|
|
46
46
|
React.createElement(Resizable, { containerWidth: "100%", showContainerOutline: true },
|
|
47
47
|
React.createElement(DescriptionList, { layout: "auto", autoLayoutBreakpoint: "640px" },
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
chromatic: {
|
|
6
|
-
disable: boolean;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
1
|
+
import type { StoryObj } from "@storybook/react";
|
|
2
|
+
import DescriptionList from "../DescriptionList";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
9
5
|
};
|
|
6
|
+
export default _default;
|
|
7
|
+
type Story = StoryObj<typeof DescriptionList>;
|
|
8
|
+
export declare const Playground: Story;
|