@helsenorge/designsystem-react 14.6.0 → 14.7.1
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/lib/AnchorLink.js +2 -2
- package/lib/AnchorLink.js.map +1 -1
- package/lib/Avatar.js +2 -2
- package/lib/Avatar.js.map +1 -1
- package/lib/Badge.js +2 -2
- package/lib/Badge.js.map +1 -1
- package/lib/Button.js +6 -6
- package/lib/Button.js.map +1 -1
- package/lib/CHANGELOG.md +17 -0
- package/lib/Checkbox.js +6 -6
- package/lib/Checkbox.js.map +1 -1
- package/lib/Chip.js +60 -0
- package/lib/Chip.js.map +1 -0
- package/lib/Close.js +3 -3
- package/lib/Close.js.map +1 -1
- package/lib/DictionaryTrigger.js +2 -2
- package/lib/DictionaryTrigger.js.map +1 -1
- package/lib/Drawer.js +42 -19
- package/lib/Drawer.js.map +1 -1
- package/lib/DrawerNavigation.js +81 -0
- package/lib/DrawerNavigation.js.map +1 -0
- package/lib/DrawerNavigation2.js +5 -0
- package/lib/DrawerNavigation2.js.map +1 -0
- package/lib/Duolist.js +5 -5
- package/lib/Duolist.js.map +1 -1
- package/lib/ElementHeader.js +9 -9
- package/lib/ElementHeader.js.map +1 -1
- package/lib/ElementHeaderText.js +4 -4
- package/lib/ElementHeaderText.js.map +1 -1
- package/lib/ErrorWrapper.js +2 -2
- package/lib/ErrorWrapper.js.map +1 -1
- package/lib/Expander.js +8 -8
- package/lib/Expander.js.map +1 -1
- package/lib/Filter.js +44 -0
- package/lib/Filter.js.map +1 -0
- package/lib/FilterButton.js +40 -0
- package/lib/FilterButton.js.map +1 -0
- package/lib/FilterButtonAndChipsWrapper.js +14 -0
- package/lib/FilterButtonAndChipsWrapper.js.map +1 -0
- package/lib/FilterDrawer.js +91 -0
- package/lib/FilterDrawer.js.map +1 -0
- package/lib/FilterLinkList.js +61 -0
- package/lib/FilterLinkList.js.map +1 -0
- package/lib/FilterLinkList2.js +5 -0
- package/lib/FilterLinkList2.js.map +1 -0
- package/lib/FilterOverviewLinkList.js +22 -0
- package/lib/FilterOverviewLinkList.js.map +1 -0
- package/lib/FilterOverviewSearch.js +16 -0
- package/lib/FilterOverviewSearch.js.map +1 -0
- package/lib/FilterResultCountAndSortWrapper.js +19 -0
- package/lib/FilterResultCountAndSortWrapper.js.map +1 -0
- package/lib/FilterSearch.js +87 -0
- package/lib/FilterSearch.js.map +1 -0
- package/lib/FilterSearch2.js +5 -0
- package/lib/FilterSearch2.js.map +1 -0
- package/lib/FilterSort.js +30 -0
- package/lib/FilterSort.js.map +1 -0
- package/lib/FormFieldTag.js +2 -2
- package/lib/FormFieldTag.js.map +1 -1
- package/lib/FormGroup.js +6 -6
- package/lib/FormGroup.js.map +1 -1
- package/lib/FormLayout.js +3 -3
- package/lib/FormLayout.js.map +1 -1
- package/lib/HelpDetails.js +3 -3
- package/lib/HelpDetails.js.map +1 -1
- package/lib/HelpTriggerIcon.js +2 -2
- package/lib/HelpTriggerIcon.js.map +1 -1
- package/lib/HelpTriggerStandalone.js +2 -2
- package/lib/HelpTriggerStandalone.js.map +1 -1
- package/lib/HighlightPanel.js +3 -3
- package/lib/HighlightPanel.js.map +1 -1
- package/lib/HorizontalScroll.js +4 -4
- package/lib/HorizontalScroll.js.map +1 -1
- package/lib/Icon.js +2 -2
- package/lib/Icon.js.map +1 -1
- package/lib/InfoTeaser.js +3 -3
- package/lib/InfoTeaser.js.map +1 -1
- package/lib/Input.js +4 -4
- package/lib/Input.js.map +1 -1
- package/lib/LinkList.js +5 -5
- package/lib/LinkList.js.map +1 -1
- package/lib/List.js +2 -2
- package/lib/List.js.map +1 -1
- package/lib/ListEditMode.js +4 -4
- package/lib/ListEditMode.js.map +1 -1
- package/lib/MaxCharacters.js +2 -2
- package/lib/MaxCharacters.js.map +1 -1
- package/lib/PanelTitle.js +2 -2
- package/lib/PanelTitle.js.map +1 -1
- package/lib/PopOver.js +2 -2
- package/lib/PopOver.js.map +1 -1
- package/lib/Search.js +26 -0
- package/lib/Search.js.map +1 -0
- package/lib/Select.js +7 -6
- package/lib/Select.js.map +1 -1
- package/lib/SingleSelectItem.js +3 -3
- package/lib/SingleSelectItem.js.map +1 -1
- package/lib/Slider.js +4 -4
- package/lib/Slider.js.map +1 -1
- package/lib/Spacer.js +2 -2
- package/lib/Spacer.js.map +1 -1
- package/lib/StatusDot.js +4 -4
- package/lib/StatusDot.js.map +1 -1
- package/lib/StatusDotList.js +2 -2
- package/lib/StatusDotList.js.map +1 -1
- package/lib/StepButtons.js +5 -5
- package/lib/StepButtons.js.map +1 -1
- package/lib/TabList.js +8 -8
- package/lib/TabList.js.map +1 -1
- package/lib/TabPanel.js +2 -2
- package/lib/TabPanel.js.map +1 -1
- package/lib/TableBody.js +2 -2
- package/lib/TableBody.js.map +1 -1
- package/lib/TableCell.js +2 -2
- package/lib/TableCell.js.map +1 -1
- package/lib/TableExpandedRow.js +4 -4
- package/lib/TableExpandedRow.js.map +1 -1
- package/lib/TableExpanderCell.js +2 -2
- package/lib/TableExpanderCell.js.map +1 -1
- package/lib/TableHead.js +2 -2
- package/lib/TableHead.js.map +1 -1
- package/lib/TableHeadCell.js +3 -3
- package/lib/TableHeadCell.js.map +1 -1
- package/lib/TableRow.js +3 -3
- package/lib/TableRow.js.map +1 -1
- package/lib/Textarea.js +4 -4
- package/lib/Textarea.js.map +1 -1
- package/lib/Title.js +4 -3
- package/lib/Title.js.map +1 -1
- package/lib/Toast.js +3 -3
- package/lib/Toast.js.map +1 -1
- package/lib/components/ArticleTeaser/index.js +4 -4
- package/lib/components/ArticleTeaser/index.js.map +1 -1
- package/lib/components/Chip/index.js +1 -59
- package/lib/components/Drawer/Drawer.d.ts +6 -0
- package/lib/components/Drawer/styles.module.scss +19 -0
- package/lib/components/Drawer/styles.module.scss.d.ts +1 -0
- package/lib/components/Dropdown/index.js +5 -5
- package/lib/components/Dropdown/index.js.map +1 -1
- package/lib/components/DropdownOld/index.js +3 -3
- package/lib/components/DropdownOld/index.js.map +1 -1
- package/lib/components/EmptyState/index.js +2 -2
- package/lib/components/EmptyState/index.js.map +1 -1
- package/lib/components/ExpanderHierarchy/index.js +7 -7
- package/lib/components/ExpanderHierarchy/index.js.map +1 -1
- package/lib/components/ExpanderList/index.js +6 -6
- package/lib/components/ExpanderList/index.js.map +1 -1
- package/lib/components/FavoriteButton/index.js +2 -2
- package/lib/components/FavoriteButton/index.js.map +1 -1
- package/lib/components/Filter/DrawerNavigation/DrawerNavigation.d.ts +35 -0
- package/lib/components/Filter/DrawerNavigation/FinnFastlegeFlyt.example.d.ts +2 -0
- package/lib/components/Filter/DrawerNavigation/FinnFastlegeFlyt.module.scss +15 -0
- package/lib/components/Filter/DrawerNavigation/FinnFastlegeFlyt.module.scss.d.ts +11 -0
- package/lib/components/Filter/DrawerNavigation/index.d.ts +4 -0
- package/lib/components/Filter/DrawerNavigation/index.js +3 -0
- package/lib/components/Filter/DrawerNavigation/useDrawerNavigation.d.ts +7 -0
- package/lib/components/Filter/FilterButton/FilterButton.d.ts +7 -0
- package/lib/components/Filter/FilterButton/index.d.ts +3 -0
- package/lib/components/Filter/FilterButton/index.js +2 -0
- package/lib/components/Filter/FilterButton/styles.module.scss +52 -0
- package/lib/components/Filter/FilterButton/styles.module.scss.d.ts +12 -0
- package/lib/components/Filter/FilterButtonAndChipsWrapper/FilterButtonAndChipsWrapper.d.ts +11 -0
- package/lib/components/Filter/FilterButtonAndChipsWrapper/index.d.ts +3 -0
- package/lib/components/Filter/FilterButtonAndChipsWrapper/index.js +2 -0
- package/lib/components/Filter/FilterButtonAndChipsWrapper/styles.module.scss +8 -0
- package/lib/components/Filter/FilterButtonAndChipsWrapper/styles.module.scss.d.ts +9 -0
- package/lib/components/Filter/FilterDrawer/FilterDrawer.d.ts +42 -0
- package/lib/components/Filter/FilterDrawer/index.d.ts +3 -0
- package/lib/components/Filter/FilterDrawer/index.js +2 -0
- package/lib/components/Filter/FilterDrawer/styles.module.scss +29 -0
- package/lib/components/Filter/FilterDrawer/styles.module.scss.d.ts +10 -0
- package/lib/components/Filter/FilterLinkList/FilterLinkList.d.ts +35 -0
- package/lib/components/Filter/FilterLinkList/FilterLinkList.module.scss +89 -0
- package/lib/components/Filter/FilterLinkList/FilterLinkList.module.scss.d.ts +14 -0
- package/lib/components/Filter/FilterLinkList/index.d.ts +3 -0
- package/lib/components/Filter/FilterLinkList/index.js +3 -0
- package/lib/components/Filter/FilterOverviewLinkList/FilterOverviewLinkList.d.ts +19 -0
- package/lib/components/Filter/FilterOverviewLinkList/index.d.ts +3 -0
- package/lib/components/Filter/FilterOverviewLinkList/index.js +2 -0
- package/lib/components/Filter/FilterOverviewSearch/FilterOverviewSearch.d.ts +9 -0
- package/lib/components/Filter/FilterOverviewSearch/index.d.ts +3 -0
- package/lib/components/Filter/FilterOverviewSearch/index.js +2 -0
- package/lib/components/Filter/FilterOverviewSearch/styles.module.scss +14 -0
- package/lib/components/Filter/FilterOverviewSearch/styles.module.scss.d.ts +9 -0
- package/lib/components/Filter/FilterResultCountAndSortWrapper/FilterResultCountAndSortWrapper.d.ts +8 -0
- package/lib/components/Filter/FilterResultCountAndSortWrapper/index.d.ts +3 -0
- package/lib/components/Filter/FilterResultCountAndSortWrapper/index.js +2 -0
- package/lib/components/Filter/FilterResultCountAndSortWrapper/styles.module.scss +17 -0
- package/lib/components/Filter/FilterResultCountAndSortWrapper/styles.module.scss.d.ts +11 -0
- package/lib/components/Filter/FilterSearch/FilterSearch.d.ts +19 -0
- package/lib/components/Filter/FilterSearch/index.d.ts +3 -0
- package/lib/components/Filter/FilterSearch/index.js +2 -0
- package/lib/components/Filter/FilterSearch/styles.module.scss +181 -0
- package/lib/components/Filter/FilterSearch/styles.module.scss.d.ts +16 -0
- package/lib/components/Filter/FilterSort/FilterSort.d.ts +8 -0
- package/lib/components/Filter/FilterSort/index.d.ts +3 -0
- package/lib/components/Filter/FilterSort/index.js +2 -0
- package/lib/components/Filter/FilterSort/styles.module.scss +33 -0
- package/lib/components/Filter/FilterSort/styles.module.scss.d.ts +11 -0
- package/lib/components/Filter/getFilterChips/getFilterChips.d.ts +17 -0
- package/lib/components/Filter/getFilterChips/index.d.ts +3 -0
- package/lib/components/Filter/getFilterChips/index.js +2 -0
- package/lib/components/Filter/index.d.ts +25 -0
- package/lib/components/Filter/index.js +137 -0
- package/lib/components/Filter/index.js.map +1 -0
- package/lib/components/Filter/resourceHelper.d.ts +3 -0
- package/lib/components/Filter/resourcesMock.d.ts +41 -0
- package/lib/components/Filter/useFilter.d.ts +20 -0
- package/lib/components/Filter/useFilterDrawer.d.ts +11 -0
- package/lib/components/Filter/utils.d.ts +81 -0
- package/lib/components/HelpBubble/index.js +3 -3
- package/lib/components/HelpBubble/index.js.map +1 -1
- package/lib/components/HelpPanel/index.js +2 -2
- package/lib/components/HelpPanel/index.js.map +1 -1
- package/lib/components/HelpTriggerInline/index.js +2 -2
- package/lib/components/HelpTriggerInline/index.js.map +1 -1
- package/lib/components/Icons/Filter.js +1 -43
- package/lib/components/Icons/Search.js +1 -25
- package/lib/components/Label/utils.d.ts +1 -0
- package/lib/components/Loader/index.js +4 -4
- package/lib/components/Loader/index.js.map +1 -1
- package/lib/components/Modal/index.js +9 -9
- package/lib/components/Modal/index.js.map +1 -1
- package/lib/components/NotificationPanel/index.js +6 -6
- package/lib/components/NotificationPanel/index.js.map +1 -1
- package/lib/components/Panel/index.js +12 -12
- package/lib/components/Panel/index.js.map +1 -1
- package/lib/components/PanelList/index.js +3 -3
- package/lib/components/PanelList/index.js.map +1 -1
- package/lib/components/PopMenu/index.js +3 -3
- package/lib/components/PopMenu/index.js.map +1 -1
- package/lib/components/Progressbar/index.js +2 -2
- package/lib/components/Progressbar/index.js.map +1 -1
- package/lib/components/PromoPanel/index.js +2 -2
- package/lib/components/PromoPanel/index.js.map +1 -1
- package/lib/components/Select/Select.d.ts +2 -0
- package/lib/components/Select/styles.module.scss +1 -0
- package/lib/components/ServiceMessage/index.js +5 -5
- package/lib/components/ServiceMessage/index.js.map +1 -1
- package/lib/components/SharingStatus/index.js +4 -4
- package/lib/components/SharingStatus/index.js.map +1 -1
- package/lib/components/Step/index.js +2 -2
- package/lib/components/Step/index.js.map +1 -1
- package/lib/components/Stepper/index.js +2 -2
- package/lib/components/Stepper/index.js.map +1 -1
- package/lib/components/StickyNote/index.js +8 -8
- package/lib/components/StickyNote/index.js.map +1 -1
- package/lib/components/Table/index.js +2 -2
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Tabs/index.js +4 -4
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/Tag/index.js +2 -2
- package/lib/components/Tag/index.js.map +1 -1
- package/lib/components/Tile/index.js +4 -4
- package/lib/components/Tile/index.js.map +1 -1
- package/lib/components/Title/Title.d.ts +2 -0
- package/lib/components/Toggle/index.js +7 -7
- package/lib/components/Toggle/index.js.map +1 -1
- package/lib/components/Validation/index.js +2 -2
- package/lib/components/Validation/index.js.map +1 -1
- package/lib/getFilterChips.js +30 -0
- package/lib/getFilterChips.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/lib/resource.js +4 -0
- package/lib/resource.js.map +1 -0
- package/lib/resourceHelper.js +31 -0
- package/lib/resourceHelper.js.map +1 -0
- package/lib/resources/HN.Designsystem.Drawer.nn-NO.json.d.ts +7 -0
- package/lib/resources/HN.Designsystem.Filter.en-GB.json.d.ts +13 -0
- package/lib/resources/HN.Designsystem.Filter.nb-NO.json.d.ts +13 -0
- package/lib/utils/resource.d.ts +6 -0
- package/lib/utils/resource.js +2 -0
- package/lib/utils2.js +11 -9
- package/lib/utils2.js.map +1 -1
- package/lib/utils3.js +5 -5
- package/lib/utils3.js.map +1 -1
- package/package.json +1 -1
- package/lib/components/Chip/index.js.map +0 -1
- package/lib/components/Icons/Filter.js.map +0 -1
- package/lib/components/Icons/Search.js.map +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type LinkType = React.FC<LinkProps>;
|
|
3
|
+
export interface CompoundComponent extends React.FC<LinkListProps> {
|
|
4
|
+
Link: LinkType;
|
|
5
|
+
}
|
|
6
|
+
export interface LinkListProps {
|
|
7
|
+
/** Items in the LinkList */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** Adds custom classes to the element. */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Sets the data-testid attribute. */
|
|
12
|
+
testId?: string;
|
|
13
|
+
/** Ref passed to the ul element */
|
|
14
|
+
ref?: React.Ref<HTMLUListElement | null>;
|
|
15
|
+
}
|
|
16
|
+
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
17
|
+
export type LinkProps = Modify<React.HTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, {
|
|
18
|
+
/** If needed children will be content instead of title and chips. Use only in edge cases */
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
/** Title text on link element */
|
|
21
|
+
title?: string;
|
|
22
|
+
/** Texts rendered inside non-interactive chips on link element */
|
|
23
|
+
chips?: string[];
|
|
24
|
+
/** Custom classname for link element */
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Ref for button */
|
|
27
|
+
linkRef?: React.RefObject<HTMLButtonElement | null>;
|
|
28
|
+
/** Sets the data-testid attribute. */
|
|
29
|
+
testId?: string;
|
|
30
|
+
/** Ref passed to the list item element */
|
|
31
|
+
ref?: React.Ref<HTMLLIElement | null>;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const Link: LinkType;
|
|
34
|
+
export declare const FilterLinkList: CompoundComponent;
|
|
35
|
+
export default FilterLinkList;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../../scss/breakpoints' as breakpoints;
|
|
3
|
+
@import '../../../scss/supernova/styles/colors.css';
|
|
4
|
+
|
|
5
|
+
.link-list {
|
|
6
|
+
list-style: none;
|
|
7
|
+
padding: 0;
|
|
8
|
+
width: inherit;
|
|
9
|
+
margin: 0;
|
|
10
|
+
position: relative;
|
|
11
|
+
|
|
12
|
+
&__item {
|
|
13
|
+
&:first-of-type {
|
|
14
|
+
border-top: 1px solid var(--component-listelements-border-neutral-normal);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&__button {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
align-items: center;
|
|
23
|
+
padding: 1rem;
|
|
24
|
+
padding-right: 0;
|
|
25
|
+
min-height: 4rem;
|
|
26
|
+
text-decoration: none;
|
|
27
|
+
color: var(--color-base-text-onlight);
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
width: 100%;
|
|
30
|
+
background-color: var(--color-base-background-white);
|
|
31
|
+
border: none;
|
|
32
|
+
text-align: left;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
border-bottom: 1px solid var(--component-listelements-border-neutral-normal);
|
|
35
|
+
|
|
36
|
+
&__content {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
gap: 0.375rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
background-color: var(--component-listelements-background-neutral-light);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:active {
|
|
47
|
+
background-color: var(--component-listelements-background-neutral-medium);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:focus-visible {
|
|
51
|
+
outline: 4px solid var(--color-action-border-onlight-focus);
|
|
52
|
+
outline-offset: 0; // Override user agent default
|
|
53
|
+
position: relative;
|
|
54
|
+
z-index: 1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__chip-list {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-flow: row wrap;
|
|
61
|
+
column-gap: 0.5rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&__chip {
|
|
65
|
+
box-sizing: border-box;
|
|
66
|
+
height: 1.625rem;
|
|
67
|
+
margin-top: 0.375rem;
|
|
68
|
+
margin-bottom: 6px;
|
|
69
|
+
background-color: var(--core-color-blueberry-50);
|
|
70
|
+
border: 1px solid var(--core-color-blueberry-500);
|
|
71
|
+
color: var(--core-color-blueberry-800);
|
|
72
|
+
border-radius: 100px;
|
|
73
|
+
font-size: 0.875rem;
|
|
74
|
+
font-weight: 600;
|
|
75
|
+
text-transform: uppercase;
|
|
76
|
+
text-wrap: none;
|
|
77
|
+
line-height: 1.25rem;
|
|
78
|
+
padding-top: 0.1875rem;
|
|
79
|
+
padding-left: 0.75rem;
|
|
80
|
+
padding-right: 0.75rem;
|
|
81
|
+
|
|
82
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
83
|
+
height: 1.875rem;
|
|
84
|
+
padding-top: 0.3125rem;
|
|
85
|
+
margin-top: 0.4375rem;
|
|
86
|
+
margin-bottom: 0.4375rem;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Styles = {
|
|
2
|
+
'link-list': string;
|
|
3
|
+
'link-list__button': string;
|
|
4
|
+
'link-list__button__content': string;
|
|
5
|
+
'link-list__chip': string;
|
|
6
|
+
'link-list__chip-list': string;
|
|
7
|
+
'link-list__item': string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type ClassNames = keyof Styles;
|
|
11
|
+
|
|
12
|
+
declare const styles: Styles;
|
|
13
|
+
|
|
14
|
+
export default styles;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FilterValues, UseFilterReturn } from '../useFilter';
|
|
2
|
+
export interface FilterOverviewLink {
|
|
3
|
+
/** The filter key to read values from */
|
|
4
|
+
filterKey: string;
|
|
5
|
+
/** Display title for the link */
|
|
6
|
+
title: string;
|
|
7
|
+
/** View ID to navigate to when clicked. Defaults to filterKey */
|
|
8
|
+
viewId?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FilterOverviewLinkListProps<T extends FilterValues> {
|
|
11
|
+
/** The filter instance from useFilter */
|
|
12
|
+
filter: UseFilterReturn<T>;
|
|
13
|
+
/** Look up the display label for a filter key + value */
|
|
14
|
+
getLabel: (key: keyof T, value: unknown) => string;
|
|
15
|
+
/** Configuration for which filter keys to show as links */
|
|
16
|
+
links: FilterOverviewLink[];
|
|
17
|
+
}
|
|
18
|
+
declare function FilterOverviewLinkList<T extends FilterValues>({ filter, getLabel, links }: FilterOverviewLinkListProps<T>): React.ReactNode;
|
|
19
|
+
export default FilterOverviewLinkList;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FilterSearchProps } from '../FilterSearch/FilterSearch';
|
|
2
|
+
export interface FilterOverviewSearchProps extends FilterSearchProps {
|
|
3
|
+
/** Adds custom classes to the wrapper element. */
|
|
4
|
+
wrapperClassName?: string;
|
|
5
|
+
/** Sets the data-testid attribute. */
|
|
6
|
+
testId?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const FilterOverviewSearch: React.FC<FilterOverviewSearchProps>;
|
|
9
|
+
export default FilterOverviewSearch;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@import '../../../scss/supernova/styles/colors.css';
|
|
2
|
+
@import '../../../scss/supernova/styles/spacers.css';
|
|
3
|
+
|
|
4
|
+
.filter-overview-search {
|
|
5
|
+
width: 100%;
|
|
6
|
+
padding: var(--core-space-s);
|
|
7
|
+
padding-right: var(--core-space-xl);
|
|
8
|
+
background-color: var(--color-base-background-white);
|
|
9
|
+
border-bottom: 1px solid var(--component-listelements-border-neutral-normal);
|
|
10
|
+
|
|
11
|
+
&:first-child {
|
|
12
|
+
border-top: 1px solid var(--component-listelements-border-neutral-normal);
|
|
13
|
+
}
|
|
14
|
+
}
|
package/lib/components/Filter/FilterResultCountAndSortWrapper/FilterResultCountAndSortWrapper.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface FilterResultCountAndSortWrapper {
|
|
2
|
+
/** Result count content area */
|
|
3
|
+
resultCount?: React.ReactNode;
|
|
4
|
+
/** FilterSort content area */
|
|
5
|
+
sortComponent?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const FilterResultCountAndSortWrapper: React.FC<FilterResultCountAndSortWrapper>;
|
|
8
|
+
export default FilterResultCountAndSortWrapper;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.filter-result-count-and-sort-wrapper {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-flow: row wrap;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
align-items: flex-end;
|
|
6
|
+
gap: var(--core-space-xs);
|
|
7
|
+
|
|
8
|
+
&__count {
|
|
9
|
+
text-wrap: nowrap;
|
|
10
|
+
line-height: 3rem;
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&__sort {
|
|
15
|
+
flex: 1 1 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type Styles = {
|
|
2
|
+
'filter-result-count-and-sort-wrapper': string;
|
|
3
|
+
'filter-result-count-and-sort-wrapper__count': string;
|
|
4
|
+
'filter-result-count-and-sort-wrapper__sort': string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type ClassNames = keyof Styles;
|
|
8
|
+
|
|
9
|
+
declare const styles: Styles;
|
|
10
|
+
|
|
11
|
+
export default styles;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HNDesignsystemFilter } from '../../../resources/Resources';
|
|
2
|
+
export interface FilterSearchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'className' | 'value' | 'onChange'> {
|
|
3
|
+
/** Adds custom classes to the component */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** The value given by the user in the input field */
|
|
6
|
+
value: string | undefined;
|
|
7
|
+
/** onChange handler for the input field */
|
|
8
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
9
|
+
/** Props for the search button */
|
|
10
|
+
buttonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
11
|
+
/** Props for the clear button */
|
|
12
|
+
clearButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
13
|
+
/** Texts if overriding SOT */
|
|
14
|
+
resources?: Partial<HNDesignsystemFilter>;
|
|
15
|
+
/** Ref passed to the input element */
|
|
16
|
+
ref?: React.Ref<HTMLInputElement | null>;
|
|
17
|
+
}
|
|
18
|
+
declare const FilterSearch: React.FC<FilterSearchProps>;
|
|
19
|
+
export default FilterSearch;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../../scss/breakpoints' as breakpoints;
|
|
3
|
+
@use '../../../scss/screen-reader' as sr;
|
|
4
|
+
@import '../../../scss/supernova/styles/spacers.css';
|
|
5
|
+
|
|
6
|
+
.filter-search {
|
|
7
|
+
&__wrapper {
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: 1fr auto auto;
|
|
10
|
+
align-items: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&__input-wrapper {
|
|
14
|
+
grid-column: 1 / 3;
|
|
15
|
+
grid-row: 1;
|
|
16
|
+
|
|
17
|
+
&:hover {
|
|
18
|
+
cursor: text;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__input {
|
|
23
|
+
position: relative;
|
|
24
|
+
height: 2rem;
|
|
25
|
+
width: 100%;
|
|
26
|
+
border-radius: 100px 0 0 100px;
|
|
27
|
+
border: 2px solid var(--color-base-border-onlight-emphasized);
|
|
28
|
+
background-color: var(--core-color-white);
|
|
29
|
+
padding: 0.375rem 1rem;
|
|
30
|
+
padding-right: 2.75rem;
|
|
31
|
+
text-overflow: ellipsis;
|
|
32
|
+
|
|
33
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
34
|
+
height: 2.75rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:not(:disabled)::placeholder {
|
|
38
|
+
color: var(--color-base-text-onlight);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--hovered,
|
|
42
|
+
&:hover,
|
|
43
|
+
&:active {
|
|
44
|
+
outline: 1px solid var(--color-base-border-onlight-emphasized);
|
|
45
|
+
background-color: var(--core-color-neutral-50);
|
|
46
|
+
z-index: 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:focus-visible {
|
|
50
|
+
border-color: var(--color-action-border-onlight-focus);
|
|
51
|
+
outline: 2px solid var(--color-action-border-onlight-focus);
|
|
52
|
+
z-index: 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:disabled {
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
border: 2px dashed var(--color-disabled-border);
|
|
58
|
+
outline: none;
|
|
59
|
+
color: var(--color-disabled-text);
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&__label {
|
|
64
|
+
@include sr.sr-only;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&__search-button,
|
|
69
|
+
&__clear-button {
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
outline: unset;
|
|
72
|
+
border: unset;
|
|
73
|
+
background-color: unset;
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
padding: 0;
|
|
78
|
+
|
|
79
|
+
svg {
|
|
80
|
+
fill: var(--color-action-graphics-onlight);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&:disabled {
|
|
84
|
+
cursor: not-allowed;
|
|
85
|
+
|
|
86
|
+
svg {
|
|
87
|
+
fill: var(--color-disabled-graphics);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&__search-button {
|
|
93
|
+
grid-column: 3;
|
|
94
|
+
grid-row: 1;
|
|
95
|
+
width: 2.75rem;
|
|
96
|
+
height: 2.75rem;
|
|
97
|
+
margin-left: -2px;
|
|
98
|
+
background-color: transparent;
|
|
99
|
+
|
|
100
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
101
|
+
width: 3rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&--inner {
|
|
105
|
+
position: relative;
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
width: 2.75rem;
|
|
109
|
+
height: 2rem;
|
|
110
|
+
background-color: var(--core-color-white);
|
|
111
|
+
border: 2px solid var(--color-base-border-onlight-emphasized);
|
|
112
|
+
border-radius: 0 100px 100px 0;
|
|
113
|
+
padding-right: 0.3125rem;
|
|
114
|
+
|
|
115
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
116
|
+
height: 2.75rem;
|
|
117
|
+
width: 3rem;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:disabled > & {
|
|
121
|
+
border: 2px dashed var(--color-disabled-border);
|
|
122
|
+
background: transparent;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:hover > &:not(:disabled > &),
|
|
126
|
+
:active > &:not(:disabled > &) {
|
|
127
|
+
outline: 1px solid var(--color-base-border-onlight-emphasized);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:hover > &:not(:disabled > &) {
|
|
131
|
+
background-color: var(--core-color-neutral-50);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:active > &:not(:disabled > &) {
|
|
135
|
+
background-color: var(--core-color-neutral-100);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:focus-visible > &:not(:disabled > &) {
|
|
139
|
+
border-color: var(--color-action-border-onlight-focus);
|
|
140
|
+
outline: 2px solid var(--color-action-border-onlight-focus);
|
|
141
|
+
z-index: 1;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
svg {
|
|
145
|
+
margin-left: 0.5rem;
|
|
146
|
+
|
|
147
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
148
|
+
margin-left: 0.0625rem;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&__clear-button {
|
|
155
|
+
position: relative;
|
|
156
|
+
grid-column: 2;
|
|
157
|
+
grid-row: 1;
|
|
158
|
+
width: 1.5rem;
|
|
159
|
+
height: 1.5rem;
|
|
160
|
+
margin: 0.375rem;
|
|
161
|
+
border-radius: 100%;
|
|
162
|
+
z-index: 1;
|
|
163
|
+
|
|
164
|
+
&:hover:not(:disabled) {
|
|
165
|
+
background-color: var(--core-color-neutral-50);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&:active:not(:disabled) {
|
|
169
|
+
background-color: var(--core-color-neutral-100);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&:focus-visible:not(:disabled) {
|
|
173
|
+
outline: 4px solid var(--color-action-border-onlight-focus);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
177
|
+
width: 2rem;
|
|
178
|
+
height: 2rem;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Styles = {
|
|
2
|
+
'filter-search__clear-button': string;
|
|
3
|
+
'filter-search__input': string;
|
|
4
|
+
'filter-search__input__label': string;
|
|
5
|
+
'filter-search__input--hovered': string;
|
|
6
|
+
'filter-search__input-wrapper': string;
|
|
7
|
+
'filter-search__search-button': string;
|
|
8
|
+
'filter-search__search-button--inner': string;
|
|
9
|
+
'filter-search__wrapper': string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type ClassNames = keyof Styles;
|
|
13
|
+
|
|
14
|
+
declare const styles: Styles;
|
|
15
|
+
|
|
16
|
+
export default styles;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HNDesignsystemFilter } from '../../../resources/Resources';
|
|
2
|
+
import { SelectProps } from '../../Select';
|
|
3
|
+
export interface FilterSortProps extends SelectProps {
|
|
4
|
+
/** Texts if overriding SOT */
|
|
5
|
+
resources?: Partial<HNDesignsystemFilter>;
|
|
6
|
+
}
|
|
7
|
+
declare const FilterSort: React.FC<FilterSortProps>;
|
|
8
|
+
export default FilterSort;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../../scss/breakpoints' as breakpoints;
|
|
3
|
+
@import '../../../scss/supernova/styles/spacers.css';
|
|
4
|
+
|
|
5
|
+
.select {
|
|
6
|
+
select {
|
|
7
|
+
outline: none;
|
|
8
|
+
text-align: right;
|
|
9
|
+
color: var(--color-action-text-onlight);
|
|
10
|
+
padding-right: 3rem;
|
|
11
|
+
height: 2.75rem;
|
|
12
|
+
|
|
13
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
14
|
+
height: 3rem;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
select option {
|
|
19
|
+
text-align: left;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__wrapper {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-flow: row wrap;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: flex-end;
|
|
27
|
+
gap: var(--core-space-4xs);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__label {
|
|
31
|
+
margin-bottom: 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FilterValues, UseFilterReturn } from '../useFilter';
|
|
2
|
+
export interface GetFilterChipsArgs<T extends FilterValues> {
|
|
3
|
+
/** The filter instance from useFilter */
|
|
4
|
+
filter: UseFilterReturn<T>;
|
|
5
|
+
/** Look up the display label for a filter key + value */
|
|
6
|
+
getLabel: (key: keyof T, value: unknown) => string;
|
|
7
|
+
/** Called when a chip is clicked (f.ex. to open the drawer at that filter category) */
|
|
8
|
+
onChipClick: (key: keyof T, value: unknown) => void;
|
|
9
|
+
/** Called when a chip's close button is clicked. If not provided, defaults to filter.removeFilter */
|
|
10
|
+
onChipRemove?: (key: keyof T, value: unknown) => void;
|
|
11
|
+
/** Called when the overflow chip is clicked */
|
|
12
|
+
onOverflowChipClick: () => void;
|
|
13
|
+
/** Function for mapping if close button is shown on chip or not */
|
|
14
|
+
willShowCloseButton?: (key: keyof T, value?: unknown) => boolean;
|
|
15
|
+
}
|
|
16
|
+
declare function getFilterChips<T extends FilterValues>({ filter, getLabel, onChipClick, onChipRemove, onOverflowChipClick, willShowCloseButton, }: GetFilterChipsArgs<T>): React.ReactNode[];
|
|
17
|
+
export default getFilterChips;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { default as DrawerNavigation } from './DrawerNavigation';
|
|
2
|
+
export * from './DrawerNavigation';
|
|
3
|
+
export { default as FilterButton } from './FilterButton';
|
|
4
|
+
export * from './FilterButton';
|
|
5
|
+
export { default as FilterButtonAndChipsWrapper } from './FilterButtonAndChipsWrapper';
|
|
6
|
+
export * from './FilterButtonAndChipsWrapper';
|
|
7
|
+
export { default as FilterDrawer } from './FilterDrawer';
|
|
8
|
+
export * from './FilterDrawer';
|
|
9
|
+
export { default as FilterLinkList } from './FilterLinkList';
|
|
10
|
+
export * from './FilterLinkList';
|
|
11
|
+
export { default as FilterOverviewLinkList } from './FilterOverviewLinkList';
|
|
12
|
+
export * from './FilterOverviewLinkList';
|
|
13
|
+
export { default as FilterOverviewSearch } from './FilterOverviewSearch';
|
|
14
|
+
export * from './FilterOverviewSearch';
|
|
15
|
+
export { default as FilterResultCountAndSortWrapper } from './FilterResultCountAndSortWrapper';
|
|
16
|
+
export * from './FilterResultCountAndSortWrapper';
|
|
17
|
+
export { default as FilterSearch } from './FilterSearch';
|
|
18
|
+
export * from './FilterSearch';
|
|
19
|
+
export { default as FilterSort } from './FilterSort';
|
|
20
|
+
export * from './FilterSort';
|
|
21
|
+
export { default as getFilterChips } from './getFilterChips';
|
|
22
|
+
export * from './getFilterChips';
|
|
23
|
+
export * from './useFilter';
|
|
24
|
+
export * from './useFilterDrawer';
|
|
25
|
+
export * from './utils';
|