@dbcdk/react-components 0.0.96 → 0.0.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/Table.types.d.ts +3 -0
- package/dist/components/table/components/TableHeader.d.ts +2 -1
- package/dist/index.cjs +12750 -0
- package/dist/index.css +7149 -0
- package/dist/index.js +12641 -79
- package/dist/tanstack.cjs +2674 -0
- package/dist/tanstack.css +1267 -0
- package/dist/tanstack.js +2650 -3
- package/dist/themes/dbc.css +3 -0
- package/dist/themes/forfatterweb.css +2 -0
- package/package.json +11 -10
- package/dist/assets/logo.js +0 -2
- package/dist/components/__stories__/_data/table.d.ts +0 -15
- package/dist/components/__stories__/_data/table.js +0 -55
- package/dist/components/__stories__/_data/tabs.d.ts +0 -9
- package/dist/components/__stories__/_data/tabs.js +0 -31
- package/dist/components/__stories__/story-components/Colors.d.ts +0 -11
- package/dist/components/__stories__/story-components/Colors.js +0 -96
- package/dist/components/__stories__/story-components/Colors.module.css +0 -27
- package/dist/components/__stories__/story-components/ComponentSizes.d.ts +0 -2
- package/dist/components/__stories__/story-components/ComponentSizes.js +0 -26
- package/dist/components/__stories__/story-components/Elevation.d.ts +0 -2
- package/dist/components/__stories__/story-components/Elevation.js +0 -49
- package/dist/components/__stories__/story-components/Flex.d.ts +0 -2
- package/dist/components/__stories__/story-components/Flex.js +0 -177
- package/dist/components/__stories__/story-components/Flex.module.css +0 -317
- package/dist/components/__stories__/story-components/Spacing.d.ts +0 -6
- package/dist/components/__stories__/story-components/Spacing.js +0 -76
- package/dist/components/__stories__/story-components/Spacing.module.css +0 -154
- package/dist/components/accordion/Accordion.js +0 -70
- package/dist/components/accordion/Accordion.module.css +0 -28
- package/dist/components/accordion/components/AccordionRow.js +0 -53
- package/dist/components/accordion/components/AccordionRow.module.css +0 -90
- package/dist/components/alert/Alert.js +0 -17
- package/dist/components/alert/Alert.module.css +0 -98
- package/dist/components/app-header/AppHeader.js +0 -5
- package/dist/components/app-header/AppHeader.module.css +0 -74
- package/dist/components/attribute-chip/AttributeChip.js +0 -5
- package/dist/components/attribute-chip/AttributeChip.module.css +0 -65
- package/dist/components/avatar/Avatar.js +0 -48
- package/dist/components/avatar/Avatar.module.css +0 -91
- package/dist/components/breadcrumbs/Breadcrumbs.js +0 -6
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +0 -80
- package/dist/components/button/Button.js +0 -81
- package/dist/components/button/Button.module.css +0 -249
- package/dist/components/button-select/ButtonSelect.js +0 -7
- package/dist/components/button-select/ButtonSelect.module.css +0 -40
- package/dist/components/card/Card.js +0 -71
- package/dist/components/card/Card.module.css +0 -160
- package/dist/components/card/components/CardMeta.js +0 -26
- package/dist/components/card/components/CardMeta.module.css +0 -55
- package/dist/components/card-container/CardContainer.js +0 -6
- package/dist/components/card-container/CardContainer.module.css +0 -61
- package/dist/components/chip/Chip.js +0 -31
- package/dist/components/chip/Chip.module.css +0 -236
- package/dist/components/circle/Circle.js +0 -5
- package/dist/components/circle/Circle.module.css +0 -128
- package/dist/components/clear-button/ClearButton.js +0 -13
- package/dist/components/clear-button/ClearButton.module.css +0 -26
- package/dist/components/code-block/CodeBlock.js +0 -58
- package/dist/components/code-block/CodeBlock.module.css +0 -124
- package/dist/components/copy-button/CopyButton.js +0 -78
- package/dist/components/copy-button/CopyButton.module.css +0 -22
- package/dist/components/datetime-picker/DateTimePicker.js +0 -403
- package/dist/components/datetime-picker/DateTimePicker.module.css +0 -155
- package/dist/components/datetime-picker/dateTimeHelpers.js +0 -248
- package/dist/components/divider/Divider.js +0 -12
- package/dist/components/filter-field/FilterField.js +0 -191
- package/dist/components/filter-field/FilterField.module.css +0 -379
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.js +0 -52
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.module.css +0 -59
- package/dist/components/forms/checkbox/Checkbox.js +0 -28
- package/dist/components/forms/checkbox/Checkbox.module.css +0 -103
- package/dist/components/forms/checkbox-group/CheckboxGroup.js +0 -75
- package/dist/components/forms/checkbox-group/CheckboxGroup.module.css +0 -115
- package/dist/components/forms/form-select/FormSelect.js +0 -86
- package/dist/components/forms/form-select/FormSelect.module.css +0 -236
- package/dist/components/forms/input/Input.js +0 -77
- package/dist/components/forms/input/Input.module.css +0 -468
- package/dist/components/forms/input-container/InputContainer.js +0 -15
- package/dist/components/forms/input-container/InputContainer.module.css +0 -60
- package/dist/components/forms/multi-select/MultiSelect.js +0 -122
- package/dist/components/forms/radio-buttons/RadioButton.js +0 -26
- package/dist/components/forms/radio-buttons/RadioButtonGroup.js +0 -19
- package/dist/components/forms/radio-buttons/RadioButtons.module.css +0 -118
- package/dist/components/forms/select/Select.js +0 -185
- package/dist/components/forms/select/Select.module.css +0 -32
- package/dist/components/forms/text-area/Textarea.js +0 -47
- package/dist/components/forms/text-area/Textarea.module.css +0 -70
- package/dist/components/forms/typeahead/Typeahead.js +0 -668
- package/dist/components/forms/typeahead/Typeahead.module.css +0 -38
- package/dist/components/grid/Grid.js +0 -23
- package/dist/components/grid/Grid.module.css +0 -35
- package/dist/components/headline/CollapsibleHeadline.js +0 -29
- package/dist/components/headline/Headline.js +0 -26
- package/dist/components/headline/Headline.module.css +0 -185
- package/dist/components/hyperlink/Hyperlink.js +0 -40
- package/dist/components/hyperlink/Hyperlink.module.css +0 -107
- package/dist/components/icon/Icon.js +0 -14
- package/dist/components/icon/Icon.module.css +0 -36
- package/dist/components/interval-select/IntervalSelect.js +0 -99
- package/dist/components/json-viewer/HighlightedText.js +0 -6
- package/dist/components/json-viewer/JsonNode.js +0 -30
- package/dist/components/json-viewer/JsonViewer.js +0 -68
- package/dist/components/json-viewer/JsonViewer.module.css +0 -346
- package/dist/components/json-viewer/types.js +0 -1
- package/dist/components/json-viewer/useClipboardStatus.js +0 -11
- package/dist/components/json-viewer/utils.js +0 -125
- package/dist/components/menu/Menu.js +0 -165
- package/dist/components/menu/Menu.module.css +0 -220
- package/dist/components/meta-bar/MetaBar.js +0 -9
- package/dist/components/meta-bar/MetaBar.module.css +0 -27
- package/dist/components/nav-bar/NavBar.js +0 -29
- package/dist/components/nav-bar/NavBar.module.css +0 -221
- package/dist/components/overlay/fade-overlay/FadeOverlay.js +0 -8
- package/dist/components/overlay/fade-overlay/FadeOverlay.module.css +0 -54
- package/dist/components/overlay/modal/Modal.js +0 -115
- package/dist/components/overlay/modal/Modal.module.css +0 -109
- package/dist/components/overlay/modal/provider/ModalProvider.js +0 -73
- package/dist/components/overlay/side-panel/SidePanel.js +0 -83
- package/dist/components/overlay/side-panel/SidePanel.module.css +0 -177
- package/dist/components/overlay/side-panel/useSidePanel.js +0 -11
- package/dist/components/overlay/tooltip/Tooltip.js +0 -17
- package/dist/components/overlay/tooltip/Tooltip.module.css +0 -104
- package/dist/components/overlay/tooltip/TooltipProvider.js +0 -255
- package/dist/components/overlay/tooltip/useTooltipTrigger.js +0 -118
- package/dist/components/page/Page.js +0 -11
- package/dist/components/page/Page.module.css +0 -89
- package/dist/components/page-layout/PageLayout.js +0 -76
- package/dist/components/page-layout/PageLayout.module.css +0 -236
- package/dist/components/page-layout/components/layout-footer/LayoutFooter.js +0 -27
- package/dist/components/page-layout/components/layout-footer/LayoutFooter.module.css +0 -89
- package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.js +0 -14
- package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.module.css +0 -84
- package/dist/components/pagination/Pagination.js +0 -56
- package/dist/components/pagination/Pagination.module.css +0 -25
- package/dist/components/panel/Panel.js +0 -7
- package/dist/components/panel/Panel.module.css +0 -29
- package/dist/components/popover/Popover.js +0 -257
- package/dist/components/popover/Popover.module.css +0 -54
- package/dist/components/search-box/SearchBox.js +0 -170
- package/dist/components/search-box/SearchBox.module.css +0 -21
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +0 -48
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +0 -167
- package/dist/components/sidebar/Sidebar.js +0 -6
- package/dist/components/sidebar/components/SidebarItem.js +0 -8
- package/dist/components/sidebar/components/SidebarItem.module.css +0 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +0 -63
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +0 -29
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +0 -153
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +0 -260
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +0 -18
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +0 -106
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +0 -26
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.module.css +0 -20
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +0 -30
- package/dist/components/sidebar/providers/SidebarProvider.js +0 -229
- package/dist/components/skeleton-loader/SkeletonLoader.js +0 -73
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +0 -13
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +0 -51
- package/dist/components/split-button/SplitButton.js +0 -10
- package/dist/components/split-button/SplitButton.module.css +0 -32
- package/dist/components/split-pane/SplitPane.js +0 -107
- package/dist/components/split-pane/SplitPane.module.css +0 -111
- package/dist/components/split-pane/provider/SplitPaneContext.js +0 -124
- package/dist/components/stack/Stack.js +0 -33
- package/dist/components/stack/Stack.module.css +0 -61
- package/dist/components/state-page/StatePage.js +0 -20
- package/dist/components/state-page/StatePage.module.css +0 -9
- package/dist/components/state-page/empty.js +0 -2
- package/dist/components/state-page/error.js +0 -2
- package/dist/components/state-page/notFound.js +0 -2
- package/dist/components/sticky-footer-layout/StickyFooterLayout.js +0 -64
- package/dist/components/table/Table.js +0 -50
- package/dist/components/table/Table.module.css +0 -536
- package/dist/components/table/Table.types.js +0 -1
- package/dist/components/table/TanstackTable.js +0 -111
- package/dist/components/table/components/TableBody.js +0 -10
- package/dist/components/table/components/TableHeader.js +0 -7
- package/dist/components/table/components/TableHeaderCell.js +0 -24
- package/dist/components/table/components/TableLoadingBody.js +0 -26
- package/dist/components/table/components/TablePagination.js +0 -1
- package/dist/components/table/components/TableRow.js +0 -54
- package/dist/components/table/components/TableSelectionCell.js +0 -16
- package/dist/components/table/components/column-resizer/ColumnResizer.js +0 -5
- package/dist/components/table/components/column-resizer/ColumnResizer.module.css +0 -22
- package/dist/components/table/components/empty-state/EmptyState.js +0 -23
- package/dist/components/table/components/empty-state/EmptyState.module.css +0 -4
- package/dist/components/table/components/table-settings/TableSettings.js +0 -63
- package/dist/components/table/hooks/useTableRowInteractions.js +0 -30
- package/dist/components/table/table.classes.js +0 -23
- package/dist/components/table/table.utils.js +0 -47
- package/dist/components/table/tanstackTable.utils.js +0 -175
- package/dist/components/tabs/Tabs.js +0 -125
- package/dist/components/tabs/Tabs.module.css +0 -233
- package/dist/components/theme-button/ThemeButton.js +0 -23
- package/dist/components/toast/Toast.js +0 -20
- package/dist/components/toast/Toast.module.css +0 -161
- package/dist/components/toast/provider/ToastProvider.js +0 -70
- package/dist/components/user-display/UserDisplay.js +0 -6
- package/dist/components/user-display/UserDisplay.module.css +0 -25
- package/dist/constants/severity.js +0 -24
- package/dist/constants/severity.types.js +0 -1
- package/dist/constants/sizes.js +0 -7
- package/dist/hooks/useDeviceSize.js +0 -32
- package/dist/hooks/useListNavigation.js +0 -234
- package/dist/hooks/usePagination.js +0 -140
- package/dist/hooks/useSorting.js +0 -118
- package/dist/hooks/useTableData.js +0 -45
- package/dist/hooks/useTableSelection.js +0 -164
- package/dist/hooks/useTableSettings.js +0 -71
- package/dist/hooks/useTheme.js +0 -66
- package/dist/hooks/useTimeDuration.js +0 -68
- package/dist/hooks/useViewportFill.js +0 -77
- package/dist/styles/animation.js +0 -5
- package/dist/styles/themes/types.js +0 -1
- package/dist/types/a11y-props.types.js +0 -1
- package/dist/types/sizes.types.js +0 -1
- package/dist/utils/arrays/nested-filtering.js +0 -48
- package/dist/utils/date/formatDate.js +0 -51
- package/dist/utils/localStorage.utils.js +0 -78
- package/dist/utils/text/get-highlighted-segments.js +0 -46
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
.filterField {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: stretch;
|
|
4
|
-
gap: 0;
|
|
5
|
-
position: relative;
|
|
6
|
-
z-index: 0;
|
|
7
|
-
font-size: var(--font-size-sm);
|
|
8
|
-
font-family: var(--font-family);
|
|
9
|
-
color: var(--color-fg-default);
|
|
10
|
-
border: 1px solid transparent;
|
|
11
|
-
border-radius: var(--border-radius-default);
|
|
12
|
-
overflow: visible;
|
|
13
|
-
transition:
|
|
14
|
-
background-color var(--transition-fast) var(--ease-standard),
|
|
15
|
-
border-color var(--transition-fast) var(--ease-standard),
|
|
16
|
-
box-shadow var(--transition-fast) var(--ease-standard),
|
|
17
|
-
color var(--transition-fast) var(--ease-standard);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/* =========================
|
|
21
|
-
VARIANTS
|
|
22
|
-
========================= */
|
|
23
|
-
|
|
24
|
-
.filterField.surface {
|
|
25
|
-
background: var(--color-bg-surface);
|
|
26
|
-
border-color: var(--color-border-subtle);
|
|
27
|
-
box-shadow: var(--shadow-xs);
|
|
28
|
-
--filter-operator-bg: var(--color-bg-surface);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.filterField.surface:hover {
|
|
32
|
-
border-color: var(--color-border-default);
|
|
33
|
-
box-shadow: var(--shadow-sm);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.filterField.surface.active {
|
|
37
|
-
background: color-mix(in srgb, var(--color-bg-selected) 45%, var(--color-bg-surface));
|
|
38
|
-
border-color: var(--color-border-selected);
|
|
39
|
-
box-shadow: var(--shadow-sm);
|
|
40
|
-
--filter-operator-bg: color-mix(in srgb, var(--color-bg-selected) 45%, var(--color-bg-surface));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.filterField.outlined {
|
|
44
|
-
background: var(--color-bg-surface);
|
|
45
|
-
border-color: var(--color-border-subtle);
|
|
46
|
-
box-shadow: none;
|
|
47
|
-
--filter-operator-bg: var(--color-bg-surface);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.filterField.outlined:hover {
|
|
51
|
-
border-color: var(--color-border-default);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.filterField.outlined.active {
|
|
55
|
-
background: color-mix(in srgb, var(--color-bg-selected) 38%, var(--color-bg-surface));
|
|
56
|
-
border-color: var(--color-border-selected);
|
|
57
|
-
box-shadow: none;
|
|
58
|
-
--filter-operator-bg: color-mix(in srgb, var(--color-bg-selected) 38%, var(--color-bg-surface));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.filterField.subtle {
|
|
62
|
-
background: var(--color-bg-toolbar);
|
|
63
|
-
border-color: transparent;
|
|
64
|
-
box-shadow: inset 0 0 0 1px transparent;
|
|
65
|
-
--filter-operator-bg: color-mix(in srgb, var(--color-fg-default) 4%, var(--color-bg-toolbar));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.filterField.subtle:hover {
|
|
69
|
-
background: var(--color-bg-surface-strong);
|
|
70
|
-
--filter-operator-bg: color-mix(
|
|
71
|
-
in srgb,
|
|
72
|
-
var(--color-fg-default) 6%,
|
|
73
|
-
var(--color-bg-surface-strong)
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.filterField.subtle.active {
|
|
78
|
-
background: color-mix(in srgb, var(--color-bg-selected) 55%, var(--color-bg-surface-strong));
|
|
79
|
-
border-color: var(--color-border-selected);
|
|
80
|
-
box-shadow: inset 0 0 0 1px transparent;
|
|
81
|
-
--filter-operator-bg: color-mix(
|
|
82
|
-
in srgb,
|
|
83
|
-
var(--color-bg-selected) 55%,
|
|
84
|
-
var(--color-bg-surface-strong)
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.filterField.active .label {
|
|
89
|
-
color: var(--color-fg-default);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/* =========================
|
|
93
|
-
FOCUS
|
|
94
|
-
========================= */
|
|
95
|
-
|
|
96
|
-
.filterField:focus-within {
|
|
97
|
-
z-index: 1;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.filterField.surface:focus-within,
|
|
101
|
-
.filterField.outlined:focus-within,
|
|
102
|
-
.filterField.subtle:focus-within {
|
|
103
|
-
border-color: var(--color-border-selected);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.filterField.surface:focus-within {
|
|
107
|
-
box-shadow: var(--shadow-sm);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.filterField.outlined:focus-within,
|
|
111
|
-
.filterField.subtle:focus-within {
|
|
112
|
-
box-shadow: none;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.filterField.surface.active:focus-within {
|
|
116
|
-
box-shadow: var(--shadow-sm);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.filterField.outlined.active:focus-within,
|
|
120
|
-
.filterField.subtle.active:focus-within {
|
|
121
|
-
box-shadow: none;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/* =========================
|
|
125
|
-
SIZES
|
|
126
|
-
========================= */
|
|
127
|
-
|
|
128
|
-
.filterField.sm {
|
|
129
|
-
block-size: var(--component-size-sm);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.filterField.md {
|
|
133
|
-
block-size: var(--component-size-md);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.filterField.lg {
|
|
137
|
-
block-size: var(--component-size-lg);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/* =========================
|
|
141
|
-
LABEL
|
|
142
|
-
========================= */
|
|
143
|
-
|
|
144
|
-
.filterField .label {
|
|
145
|
-
display: inline-flex;
|
|
146
|
-
align-items: center;
|
|
147
|
-
padding-block: var(--spacing-2xs);
|
|
148
|
-
padding-inline: var(--spacing-xs);
|
|
149
|
-
padding-inline-end: var(--spacing-xxs);
|
|
150
|
-
font-size: var(--font-size-sm);
|
|
151
|
-
color: var(--color-fg-subtle);
|
|
152
|
-
white-space: nowrap;
|
|
153
|
-
user-select: none;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/* =========================
|
|
157
|
-
OPERATOR
|
|
158
|
-
========================= */
|
|
159
|
-
|
|
160
|
-
.filterField .operatorWrapper {
|
|
161
|
-
flex: 0 0 auto;
|
|
162
|
-
display: flex;
|
|
163
|
-
align-items: stretch;
|
|
164
|
-
min-width: 0;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.filterField .operatorTrigger {
|
|
168
|
-
display: inline-flex;
|
|
169
|
-
align-items: center;
|
|
170
|
-
justify-content: center;
|
|
171
|
-
gap: var(--spacing-xxs);
|
|
172
|
-
height: 100%;
|
|
173
|
-
padding-block: var(--spacing-2xs);
|
|
174
|
-
padding-inline: var(--spacing-xxs);
|
|
175
|
-
color: var(--color-fg-default);
|
|
176
|
-
background: transparent;
|
|
177
|
-
border: 0;
|
|
178
|
-
cursor: pointer;
|
|
179
|
-
position: relative;
|
|
180
|
-
z-index: 0;
|
|
181
|
-
font-weight: var(--font-weight-default);
|
|
182
|
-
font-size: var(--font-size-sm);
|
|
183
|
-
transition:
|
|
184
|
-
background-color var(--transition-fast) var(--ease-standard),
|
|
185
|
-
color var(--transition-fast) var(--ease-standard);
|
|
186
|
-
flex: 0 0 auto;
|
|
187
|
-
white-space: nowrap;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.filterField .operatorTrigger::after {
|
|
191
|
-
content: '';
|
|
192
|
-
position: absolute;
|
|
193
|
-
inset: 1px 0;
|
|
194
|
-
background: var(--filter-operator-bg, transparent);
|
|
195
|
-
pointer-events: none;
|
|
196
|
-
z-index: 0;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.filterField .operatorTrigger > * {
|
|
200
|
-
position: relative;
|
|
201
|
-
z-index: 1;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.filterField .operatorTrigger:hover:not(:disabled) {
|
|
205
|
-
color: var(--color-fg-default);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.filterField .operatorTrigger:hover:not(:disabled)::after {
|
|
209
|
-
background: color-mix(
|
|
210
|
-
in srgb,
|
|
211
|
-
var(--color-fg-default) 8%,
|
|
212
|
-
var(--filter-operator-bg, transparent)
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/* =========================
|
|
217
|
-
SEPARATORS
|
|
218
|
-
========================= */
|
|
219
|
-
|
|
220
|
-
.filterField .operatorTrigger::before {
|
|
221
|
-
content: '';
|
|
222
|
-
position: absolute;
|
|
223
|
-
inset-inline-start: 0;
|
|
224
|
-
top: 8px;
|
|
225
|
-
bottom: 8px;
|
|
226
|
-
width: 1px;
|
|
227
|
-
background: var(--color-border-subtle);
|
|
228
|
-
pointer-events: none;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/* =========================
|
|
232
|
-
DISABLED
|
|
233
|
-
========================= */
|
|
234
|
-
|
|
235
|
-
.filterField .operatorTrigger:disabled,
|
|
236
|
-
.filterField .operatorTrigger[aria-disabled='true'] {
|
|
237
|
-
cursor: not-allowed;
|
|
238
|
-
color: var(--color-disabled-fg);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.filterField.surface .operatorTrigger:disabled,
|
|
242
|
-
.filterField.outlined .operatorTrigger:disabled {
|
|
243
|
-
--filter-operator-bg: var(--color-disabled-bg);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.filterField.subtle .operatorTrigger:disabled {
|
|
247
|
-
--filter-operator-bg: color-mix(
|
|
248
|
-
in srgb,
|
|
249
|
-
var(--color-fg-default) 3%,
|
|
250
|
-
var(--color-bg-surface-subtle)
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.operatorTrigger svg {
|
|
255
|
-
height: var(--component-size-xxs);
|
|
256
|
-
width: var(--component-size-xxs);
|
|
257
|
-
flex: 0 0 auto;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/* =========================
|
|
261
|
-
VALUE WRAPPER
|
|
262
|
-
========================= */
|
|
263
|
-
|
|
264
|
-
.filterField .valueWrapper {
|
|
265
|
-
display: flex;
|
|
266
|
-
align-items: center;
|
|
267
|
-
padding: 0;
|
|
268
|
-
height: 100%;
|
|
269
|
-
flex: 1 1 auto;
|
|
270
|
-
min-width: 0;
|
|
271
|
-
position: relative;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/* Base child sizing */
|
|
275
|
-
.filterField .valueWrapper > * {
|
|
276
|
-
height: 100%;
|
|
277
|
-
min-width: 0;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.filterField .valueWrapper > div {
|
|
281
|
-
display: flex;
|
|
282
|
-
align-items: center;
|
|
283
|
-
height: 100%;
|
|
284
|
-
min-width: 0;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/* Fill mode: regular inputs should stretch */
|
|
288
|
-
.filterField .valueWrapper:not(.autoWidth) > * {
|
|
289
|
-
width: 100%;
|
|
290
|
-
flex: 1 1 auto;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.filterField .valueWrapper:not(.autoWidth) > div {
|
|
294
|
-
width: 100%;
|
|
295
|
-
flex: 1 1 auto;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/* Auto-width mode: let Typeahead keep its measured width */
|
|
299
|
-
.filterField .valueWrapper.autoWidth {
|
|
300
|
-
flex: 1 1 auto;
|
|
301
|
-
width: auto;
|
|
302
|
-
min-width: 0;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.filterField .valueWrapper.autoWidth > * {
|
|
306
|
-
width: auto;
|
|
307
|
-
flex: 1 1 auto;
|
|
308
|
-
min-width: 0;
|
|
309
|
-
max-width: 100%;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.filterField .valueWrapper.autoWidth > div {
|
|
313
|
-
width: auto;
|
|
314
|
-
flex: 1 1 auto;
|
|
315
|
-
min-width: 0;
|
|
316
|
-
max-width: 100%;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
/* Embedded Input internals */
|
|
320
|
-
.filterField .valueWrapper .field {
|
|
321
|
-
min-height: unset;
|
|
322
|
-
height: 100%;
|
|
323
|
-
block-size: 100%;
|
|
324
|
-
box-shadow: none;
|
|
325
|
-
border: none;
|
|
326
|
-
background: transparent;
|
|
327
|
-
min-width: 0;
|
|
328
|
-
width: 100%;
|
|
329
|
-
flex: 1 1 auto;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
/* Keep a small breathing space inside the filter row */
|
|
333
|
-
.embeddedInputField {
|
|
334
|
-
min-width: 0;
|
|
335
|
-
width: 100%;
|
|
336
|
-
flex: 1 1 auto;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
.embeddedInputElement {
|
|
340
|
-
flex: 1 1 auto;
|
|
341
|
-
inline-size: 100%;
|
|
342
|
-
width: 100%;
|
|
343
|
-
min-width: 0;
|
|
344
|
-
height: 100%;
|
|
345
|
-
block-size: 100%;
|
|
346
|
-
min-height: unset;
|
|
347
|
-
background: transparent;
|
|
348
|
-
border: none;
|
|
349
|
-
box-shadow: none;
|
|
350
|
-
padding-block: 0;
|
|
351
|
-
padding-inline: 0;
|
|
352
|
-
margin: 0;
|
|
353
|
-
box-sizing: border-box;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
.filterField .valueWrapper .startAdornment {
|
|
357
|
-
margin-left: 0;
|
|
358
|
-
gap: 2px;
|
|
359
|
-
min-width: 0;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
/* =========================
|
|
363
|
-
TEXT
|
|
364
|
-
========================= */
|
|
365
|
-
|
|
366
|
-
.filterField .operatorText {
|
|
367
|
-
white-space: nowrap;
|
|
368
|
-
font-family: var(--font-family-mono);
|
|
369
|
-
font-size: var(--font-size-xs);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
.filterField input {
|
|
373
|
-
height: 100%;
|
|
374
|
-
min-width: 0;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
.filterField input::placeholder {
|
|
378
|
-
color: var(--color-fg-subtle);
|
|
379
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Chip } from '../../../components/chip/Chip';
|
|
5
|
-
import styles from './ChipMultiToggle.module.css';
|
|
6
|
-
export function ChipMultiToggle({ label, options, selectedValues = [], onChange, onToggle, size = 'sm', fullWidth = false, disabled = false, showAllOption = false, allLabel = 'Alle', allIcon, allTogglesNone = false, noneValue = '__none__', type = 'rounded', dataCy, }) {
|
|
7
|
-
const selectedSet = React.useMemo(() => new Set(selectedValues), [selectedValues]);
|
|
8
|
-
const isNoneSelected = allTogglesNone && selectedSet.has(noneValue);
|
|
9
|
-
const isAllSelected = showAllOption && !isNoneSelected && selectedSet.size === 0;
|
|
10
|
-
const toggleValue = (value) => {
|
|
11
|
-
if (disabled)
|
|
12
|
-
return;
|
|
13
|
-
// If we're in "none" state, selecting any option should exit none state
|
|
14
|
-
const next = new Set(selectedSet);
|
|
15
|
-
if (isNoneSelected)
|
|
16
|
-
next.delete(noneValue);
|
|
17
|
-
const willSelect = !next.has(value);
|
|
18
|
-
if (willSelect)
|
|
19
|
-
next.add(value);
|
|
20
|
-
else
|
|
21
|
-
next.delete(value);
|
|
22
|
-
const nextArr = Array.from(next);
|
|
23
|
-
onChange(nextArr);
|
|
24
|
-
onToggle === null || onToggle === void 0 ? void 0 : onToggle(value, willSelect);
|
|
25
|
-
};
|
|
26
|
-
const toggleAll = () => {
|
|
27
|
-
if (disabled)
|
|
28
|
-
return;
|
|
29
|
-
if (!allTogglesNone) {
|
|
30
|
-
onChange([]);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
// Toggle between All <-> None
|
|
34
|
-
if (isAllSelected) {
|
|
35
|
-
onChange([noneValue]);
|
|
36
|
-
onToggle === null || onToggle === void 0 ? void 0 : onToggle(noneValue, true);
|
|
37
|
-
}
|
|
38
|
-
else if (isNoneSelected) {
|
|
39
|
-
onChange([]);
|
|
40
|
-
onToggle === null || onToggle === void 0 ? void 0 : onToggle(noneValue, false);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
// If some are selected, clicking All goes to All (clear)
|
|
44
|
-
onChange([]);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return (_jsxs("div", { className: `${styles.wrapper} ${fullWidth ? styles.fullWidth : ''}`, "data-cy": dataCy, children: [label && _jsx("span", { className: styles.label, children: label }), _jsxs("div", { className: styles.container, children: [showAllOption && (_jsx("button", { type: "button", className: styles.chipButton, onClick: toggleAll, "aria-pressed": isAllSelected || isNoneSelected, disabled: disabled, children: _jsx(Chip, { type: type, size: size, severity: "neutral", customIcon: allIcon, selected: isAllSelected || isNoneSelected, children: isNoneSelected ? `${allLabel} (ingen)` : allLabel }) }, "__all__")), options.map(opt => {
|
|
48
|
-
// If none-state is active, everything else should look unselected
|
|
49
|
-
const isSelected = !isNoneSelected && selectedSet.has(opt.value);
|
|
50
|
-
return (_jsx("button", { type: "button", className: styles.chipButton, onClick: () => toggleValue(opt.value), "aria-pressed": isSelected, disabled: disabled, children: _jsx(Chip, { size: size, customIcon: opt.icon, severity: "neutral", type: type, selected: isSelected, children: opt.label }) }, opt.value));
|
|
51
|
-
})] })] }));
|
|
52
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/* ChipMultiToggle.module.css */
|
|
2
|
-
|
|
3
|
-
.wrapper {
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
flex-wrap: wrap;
|
|
7
|
-
gap: var(--spacing-xs);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.fullWidth {
|
|
11
|
-
width: 100%;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.label {
|
|
15
|
-
font-weight: var(--font-weight-medium);
|
|
16
|
-
color: var(--color-fg-muted);
|
|
17
|
-
white-space: nowrap;
|
|
18
|
-
line-height: var(--line-height-tight);
|
|
19
|
-
font-size: var(--font-size-sm);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.container {
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-wrap: wrap;
|
|
25
|
-
align-items: center;
|
|
26
|
-
gap: var(--spacing-xxs);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.chipButton {
|
|
30
|
-
padding: 0;
|
|
31
|
-
border: 0;
|
|
32
|
-
background: transparent;
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
font: inherit;
|
|
35
|
-
color: inherit;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.chipButton:disabled {
|
|
39
|
-
opacity: 1;
|
|
40
|
-
color: var(--color-disabled-fg);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.chipButton:focus-visible {
|
|
44
|
-
outline: none;
|
|
45
|
-
box-shadow: none;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.chipButton:focus-visible > * {
|
|
49
|
-
border-color: var(--color-border-selected);
|
|
50
|
-
box-shadow: inset 0 0 0 1px var(--color-border-selected);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.chipButton:focus-visible > .rounded {
|
|
54
|
-
border-radius: var(--border-radius-rounded);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.chipButton:focus-visible > .default {
|
|
58
|
-
border-radius: var(--border-radius-default);
|
|
59
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Check } from 'lucide-react';
|
|
4
|
-
import { useId, useState } from 'react';
|
|
5
|
-
import styles from './Checkbox.module.css';
|
|
6
|
-
import { InputContainer } from '../input-container/InputContainer';
|
|
7
|
-
export function Checkbox({ checked: controlled, onChange, variant = 'default', disabled, label, labelAs = 'label', size = 'md', modified, containerLabel, error, helpText, orientation = 'horizontal', labelWidth = '160px', fullWidth = false, required = false, noContainer = false, id, 'data-cy': dataCy, }) {
|
|
8
|
-
const [internal, setInternal] = useState(false);
|
|
9
|
-
const isChecked = controlled !== null && controlled !== void 0 ? controlled : internal;
|
|
10
|
-
const generatedId = useId();
|
|
11
|
-
const controlId = id !== null && id !== void 0 ? id : `checkbox-${generatedId}`;
|
|
12
|
-
const toggle = (e) => {
|
|
13
|
-
if (disabled)
|
|
14
|
-
return;
|
|
15
|
-
const value = !isChecked;
|
|
16
|
-
setInternal(value);
|
|
17
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(value, e);
|
|
18
|
-
};
|
|
19
|
-
const content = (_jsxs("span", { className: [styles.container, size === 'sm' ? styles.containerSm : '']
|
|
20
|
-
.filter(Boolean)
|
|
21
|
-
.join(' '), "data-cy": dataCy, children: [_jsx("button", { id: controlId, disabled: disabled, type: "button", role: "checkbox", "aria-checked": isChecked, "aria-disabled": disabled || undefined, "aria-invalid": Boolean(error) || undefined, onClick: toggle, className: [styles.checkbox, isChecked ? styles.checked : '', styles[variant], styles[size]]
|
|
22
|
-
.filter(Boolean)
|
|
23
|
-
.join(' '), children: isChecked && _jsx(Check, { className: styles.icon }) }), label &&
|
|
24
|
-
(labelAs === 'label' ? (_jsx("label", { className: styles.label, htmlFor: controlId, children: label })) : (_jsx("span", { className: styles.label, children: label })))] }));
|
|
25
|
-
if (noContainer)
|
|
26
|
-
return content;
|
|
27
|
-
return (_jsx(InputContainer, { modified: modified, label: containerLabel, htmlFor: controlId, error: error, helpText: helpText, orientation: orientation, size: size, labelWidth: labelWidth, fullWidth: fullWidth, required: required, children: content }));
|
|
28
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: flex-start;
|
|
4
|
-
gap: var(--spacing-sm);
|
|
5
|
-
vertical-align: middle;
|
|
6
|
-
line-height: var(--line-height-normal);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.containerSm {
|
|
10
|
-
gap: var(--spacing-xs);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.checkbox {
|
|
14
|
-
width: var(--component-size-sm);
|
|
15
|
-
height: var(--component-size-sm);
|
|
16
|
-
padding: 0;
|
|
17
|
-
display: flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
border: var(--border-width-thin) solid var(--color-border-default);
|
|
21
|
-
border-radius: var(--border-radius-sm);
|
|
22
|
-
background-color: var(--color-bg-surface);
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
transition:
|
|
25
|
-
background-color var(--transition-fast) var(--ease-standard),
|
|
26
|
-
border-color var(--transition-fast) var(--ease-standard),
|
|
27
|
-
box-shadow var(--transition-fast) var(--ease-standard);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.checkbox.sm {
|
|
31
|
-
width: var(--component-size-xs);
|
|
32
|
-
height: var(--component-size-xs);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.label {
|
|
36
|
-
display: block;
|
|
37
|
-
font-size: var(--font-size-sm);
|
|
38
|
-
min-width: 0;
|
|
39
|
-
flex: 1 1 auto;
|
|
40
|
-
line-height: var(--line-height-normal);
|
|
41
|
-
white-space: normal;
|
|
42
|
-
overflow-wrap: anywhere;
|
|
43
|
-
word-break: break-word;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.checkbox:hover {
|
|
47
|
-
border-color: var(--color-fg-default);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.checked {
|
|
51
|
-
background-color: var(--color-brand);
|
|
52
|
-
border-color: var(--color-brand);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.icon {
|
|
56
|
-
width: var(--icon-size-md);
|
|
57
|
-
height: var(--icon-size-md);
|
|
58
|
-
color: var(--color-fg-on-brand);
|
|
59
|
-
stroke-width: 2;
|
|
60
|
-
pointer-events: none;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.default {
|
|
64
|
-
background-color: var(--color-bg-toolbar);
|
|
65
|
-
border-color: var(--color-bg-toolbar);
|
|
66
|
-
&:not(:hover) {
|
|
67
|
-
border-color: var(--color-bg-toolbar);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.icon {
|
|
71
|
-
color: var(--color-fg-default);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.outlined.checked {
|
|
76
|
-
background-color: transparent;
|
|
77
|
-
border-color: var(--color-border-default);
|
|
78
|
-
&:not(:hover) {
|
|
79
|
-
border-color: var(--color-brand);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.icon {
|
|
83
|
-
color: var(--color-brand);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.success.checked {
|
|
88
|
-
background-color: var(--color-status-success);
|
|
89
|
-
&:not(:hover) {
|
|
90
|
-
border-color: transparent;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.info.checked {
|
|
95
|
-
background-color: var(--color-status-info);
|
|
96
|
-
&:not(:hover) {
|
|
97
|
-
border-color: transparent;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.icon {
|
|
101
|
-
color: var(--color-fg-on-brand);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
|
-
import styles from './CheckboxGroup.module.css';
|
|
5
|
-
import { Checkbox } from '../checkbox/Checkbox';
|
|
6
|
-
export function CheckboxGroup({ label, options, selectedValues, onChange, onToggle, variant = 'outlined', size = 'md', wrap = false, fullWidth = false, disabled = false, contained = true, actionLabels = { clear: 'Ryd', all: 'Alle' }, onActionClick, 'data-cy': dataCy, }) {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
const selectedSet = useMemo(() => new Set(selectedValues), [selectedValues]);
|
|
9
|
-
const enabledValues = useMemo(() => options.filter(o => !(disabled || o.disabled)).map(o => o.value), [options, disabled]);
|
|
10
|
-
const allEnabledSelected = enabledValues.length > 0 && enabledValues.every(v => selectedSet.has(v));
|
|
11
|
-
const toggleValue = (value) => {
|
|
12
|
-
if (disabled)
|
|
13
|
-
return;
|
|
14
|
-
const next = new Set(selectedSet);
|
|
15
|
-
const willSelect = !next.has(value);
|
|
16
|
-
if (willSelect)
|
|
17
|
-
next.add(value);
|
|
18
|
-
else
|
|
19
|
-
next.delete(value);
|
|
20
|
-
onChange(Array.from(next));
|
|
21
|
-
onToggle === null || onToggle === void 0 ? void 0 : onToggle(value, willSelect);
|
|
22
|
-
};
|
|
23
|
-
const selectAll = () => {
|
|
24
|
-
if (disabled)
|
|
25
|
-
return;
|
|
26
|
-
if (enabledValues.length === 0)
|
|
27
|
-
return;
|
|
28
|
-
onChange([...enabledValues]);
|
|
29
|
-
onToggle === null || onToggle === void 0 ? void 0 : onToggle('__select_all__', true);
|
|
30
|
-
};
|
|
31
|
-
const deselectAll = () => {
|
|
32
|
-
if (disabled)
|
|
33
|
-
return;
|
|
34
|
-
onChange([]);
|
|
35
|
-
onToggle === null || onToggle === void 0 ? void 0 : onToggle('__deselect_all__', false);
|
|
36
|
-
};
|
|
37
|
-
const handleAction = () => {
|
|
38
|
-
if (disabled)
|
|
39
|
-
return;
|
|
40
|
-
if (enabledValues.length === 0)
|
|
41
|
-
return;
|
|
42
|
-
if (allEnabledSelected) {
|
|
43
|
-
// currently all -> "Ryd" clears all
|
|
44
|
-
deselectAll();
|
|
45
|
-
onActionClick === null || onActionClick === void 0 ? void 0 : onActionClick('clear');
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
// not all -> "Alle" selects all
|
|
49
|
-
selectAll();
|
|
50
|
-
onActionClick === null || onActionClick === void 0 ? void 0 : onActionClick('all');
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const wrapperClassName = [
|
|
54
|
-
styles.wrapper,
|
|
55
|
-
fullWidth ? styles.fullWidth : '',
|
|
56
|
-
contained ? styles.contained : styles.plain,
|
|
57
|
-
styles[size],
|
|
58
|
-
]
|
|
59
|
-
.filter(Boolean)
|
|
60
|
-
.join(' ');
|
|
61
|
-
const itemsClassName = [styles.items, wrap ? styles.wrap : styles.noWrap].join(' ');
|
|
62
|
-
// Prevent UI jump by reserving width equal to the longer label.
|
|
63
|
-
const allText = (_a = actionLabels.all) !== null && _a !== void 0 ? _a : 'Alle';
|
|
64
|
-
const clearText = (_b = actionLabels.clear) !== null && _b !== void 0 ? _b : 'Ryd';
|
|
65
|
-
const actionMinWidth = `${Math.max(allText.length, clearText.length)}ch`;
|
|
66
|
-
return (_jsxs("div", { className: wrapperClassName, "data-cy": dataCy, style: { ['--checkboxgroup-action-min-width']: actionMinWidth }, children: [label && _jsx("span", { className: styles.groupLabel, children: label }), _jsx("div", { className: itemsClassName, role: "group", "aria-label": label, children: options.map(opt => {
|
|
67
|
-
const isChecked = selectedSet.has(opt.value);
|
|
68
|
-
const isDisabled = disabled || !!opt.disabled;
|
|
69
|
-
return (_jsx(Checkbox, { label: opt.label, checked: isChecked, disabled: isDisabled, variant: variant, size: "sm", onChange: () => {
|
|
70
|
-
if (isDisabled)
|
|
71
|
-
return;
|
|
72
|
-
toggleValue(opt.value);
|
|
73
|
-
}, noContainer: true }, opt.value));
|
|
74
|
-
}) }), _jsx("button", { type: "button", className: styles.actionButton, onClick: handleAction, disabled: disabled || enabledValues.length === 0, "aria-disabled": disabled || enabledValues.length === 0, children: _jsx("span", { className: styles.actionText, "data-mode": allEnabledSelected ? 'clear' : 'all', children: allEnabledSelected ? clearText : allText }) })] }));
|
|
75
|
-
}
|