@dbcdk/react-components 0.0.64 → 0.0.66
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/forms/input/Input.module.css +6 -5
- package/dist/components/overlay/fade-overlay/FadeOverlay.d.ts +13 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.js +8 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.module.css +54 -0
- package/dist/components/page-layout/components/layout-footer/LayoutFooter.module.css +3 -1
- package/dist/components/search-box/SearchBox.d.ts +1 -0
- package/dist/components/search-box/SearchBox.js +5 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/styles/themes/dbc/dark.css +5 -5
- package/dist/styles/themes/dbc/light.css +5 -5
- package/package.json +1 -1
|
@@ -163,9 +163,9 @@
|
|
|
163
163
|
|
|
164
164
|
.standalone {
|
|
165
165
|
background-color: var(--color-bg-surface);
|
|
166
|
-
border-color: var(--color-border-
|
|
166
|
+
border-color: var(--color-border-subtle);
|
|
167
167
|
border-radius: var(--border-radius-rounded);
|
|
168
|
-
box-shadow: var(--shadow-xs), var(--shadow-
|
|
168
|
+
box-shadow: var(--shadow-xs), var(--shadow-sm);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
.standalone .input {
|
|
@@ -401,14 +401,15 @@
|
|
|
401
401
|
.withButton:has(.standalone) .trailingButton {
|
|
402
402
|
border-top-right-radius: var(--border-radius-rounded);
|
|
403
403
|
border-bottom-right-radius: var(--border-radius-rounded);
|
|
404
|
-
border-left-color: var(--color-border-
|
|
404
|
+
border-left-color: var(--color-border-subtle);
|
|
405
|
+
border-color: var(--color-border-subtle);
|
|
405
406
|
background-color: var(--color-bg-surface);
|
|
406
|
-
box-shadow: var(--shadow-xs), var(--shadow-
|
|
407
|
+
box-shadow: var(--shadow-xs), var(--shadow-sm);
|
|
407
408
|
}
|
|
408
409
|
|
|
409
410
|
.withButton:has(.standalone) .trailingButton:hover {
|
|
410
411
|
border-color: var(--color-border-strong);
|
|
411
|
-
box-shadow: var(--shadow-sm), var(--shadow-
|
|
412
|
+
box-shadow: var(--shadow-sm), var(--shadow-sm);
|
|
412
413
|
}
|
|
413
414
|
|
|
414
415
|
/* Date/time picker indicator (WebKit) */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactElement } from 'react';
|
|
2
|
+
export interface FadeOverlayProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Which edge should have the solid background color.
|
|
5
|
+
* Defaults to bottom, which fits preview/paywall-style fades.
|
|
6
|
+
*/
|
|
7
|
+
edge?: 'top' | 'right' | 'bottom' | 'left';
|
|
8
|
+
/**
|
|
9
|
+
* How far the fade reaches into the container.
|
|
10
|
+
*/
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
}
|
|
13
|
+
export declare function FadeOverlay({ edge, size, className, 'aria-hidden': ariaHidden, ...rest }: FadeOverlayProps): ReactElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styles from './FadeOverlay.module.css';
|
|
3
|
+
function cx(...parts) {
|
|
4
|
+
return parts.filter(Boolean).join(' ');
|
|
5
|
+
}
|
|
6
|
+
export function FadeOverlay({ edge = 'bottom', size = 'md', className, 'aria-hidden': ariaHidden = true, ...rest }) {
|
|
7
|
+
return (_jsx("div", { "aria-hidden": ariaHidden, className: cx(styles.overlay, styles[edge], styles[size], className), ...rest }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
.overlay {
|
|
2
|
+
--fade-overlay-color: var(--color-bg-surface);
|
|
3
|
+
--fade-overlay-size: 65%;
|
|
4
|
+
|
|
5
|
+
position: absolute;
|
|
6
|
+
inset: 0;
|
|
7
|
+
z-index: 1;
|
|
8
|
+
pointer-events: none;
|
|
9
|
+
border-radius: inherit;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.bottom {
|
|
13
|
+
background: linear-gradient(
|
|
14
|
+
to top,
|
|
15
|
+
var(--fade-overlay-color) 0%,
|
|
16
|
+
transparent var(--fade-overlay-size)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.top {
|
|
21
|
+
background: linear-gradient(
|
|
22
|
+
to bottom,
|
|
23
|
+
var(--fade-overlay-color) 0%,
|
|
24
|
+
transparent var(--fade-overlay-size)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.left {
|
|
29
|
+
background: linear-gradient(
|
|
30
|
+
to right,
|
|
31
|
+
var(--fade-overlay-color) 0%,
|
|
32
|
+
transparent var(--fade-overlay-size)
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.right {
|
|
37
|
+
background: linear-gradient(
|
|
38
|
+
to left,
|
|
39
|
+
var(--fade-overlay-color) 0%,
|
|
40
|
+
transparent var(--fade-overlay-size)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.sm {
|
|
45
|
+
--fade-overlay-size: 40%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.md {
|
|
49
|
+
--fade-overlay-size: 65%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.lg {
|
|
53
|
+
--fade-overlay-size: 85%;
|
|
54
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.footer {
|
|
2
2
|
inline-size: 100%;
|
|
3
3
|
background: var(--color-bg-surface-subtle);
|
|
4
|
+
line-height: var(--line-height-normal);
|
|
4
5
|
}
|
|
5
6
|
|
|
6
7
|
.inner {
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
font-style: normal;
|
|
38
39
|
margin: 0;
|
|
39
40
|
color: var(--color-fg-subtle);
|
|
40
|
-
line-height: var(--line-height-
|
|
41
|
+
line-height: var(--line-height-normal);
|
|
41
42
|
display: flex;
|
|
42
43
|
flex-direction: column;
|
|
43
44
|
gap: 1px;
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
flex-direction: column;
|
|
53
54
|
align-items: flex-start;
|
|
54
55
|
gap: 0;
|
|
56
|
+
line-height: var(--line-height-normal);
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
.linkGroup {
|
|
@@ -3,6 +3,7 @@ import { InputVariant } from '../../components/forms/input/Input';
|
|
|
3
3
|
import { Size } from '../../types/sizes.types';
|
|
4
4
|
type SearchBoxProps<T extends Record<string, unknown>> = {
|
|
5
5
|
inputWidth?: string | number;
|
|
6
|
+
maxWidth?: string | number;
|
|
6
7
|
inputSize?: Exclude<Size, 'xl'>;
|
|
7
8
|
variant?: InputVariant;
|
|
8
9
|
result?: T[];
|
|
@@ -7,7 +7,7 @@ import { Menu } from '../../components/menu/Menu';
|
|
|
7
7
|
import { Popover } from '../../components/popover/Popover';
|
|
8
8
|
import { SkeletonLoaderItem } from '../../components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem';
|
|
9
9
|
import styles from './SearchBox.module.css';
|
|
10
|
-
export const SearchBox = forwardRef(function SearchBoxInner({ inputWidth, inputSize, variant, result, debounce = true, debounceMs = 800, onSearch, onSelect, displayPopover, resultKeys, resultTemplate, initialTemplate, popoverMinWidth = '500px', noResultText = 'Ingen resultater', loading, enableHotkey = true, onButtonClick, buttonLabel, buttonIcon, fullWidth = false, value, onChange, ...rest }, ref) {
|
|
10
|
+
export const SearchBox = forwardRef(function SearchBoxInner({ inputWidth, maxWidth, inputSize, variant, result, debounce = true, debounceMs = 800, onSearch, onSelect, displayPopover, resultKeys, resultTemplate, initialTemplate, popoverMinWidth = '500px', noResultText = 'Ingen resultater', loading, enableHotkey = true, onButtonClick, buttonLabel, buttonIcon, fullWidth = false, value, onChange, ...rest }, ref) {
|
|
11
11
|
const isControlled = value !== undefined;
|
|
12
12
|
// What the user sees immediately in the textbox
|
|
13
13
|
const [draft, setDraft] = useState(() => (isControlled ? String(value !== null && value !== void 0 ? value : '') : ''));
|
|
@@ -156,5 +156,8 @@ export const SearchBox = forwardRef(function SearchBoxInner({ inputWidth, inputS
|
|
|
156
156
|
buttonIcon,
|
|
157
157
|
fullWidth,
|
|
158
158
|
]);
|
|
159
|
-
return _jsx("div", { style:
|
|
159
|
+
return (_jsx("div", { style: {
|
|
160
|
+
...(fullWidth ? { width: '100%' } : undefined),
|
|
161
|
+
...(maxWidth !== undefined ? { maxWidth } : undefined),
|
|
162
|
+
}, children: inputField }));
|
|
160
163
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export * from './components/filtering/chip-multi-toggle/ChipMultiToggle';
|
|
|
54
54
|
export * from './components/forms/checkbox-group/CheckboxGroup';
|
|
55
55
|
export * from './components/overlay/side-panel/SidePanel';
|
|
56
56
|
export * from './components/overlay/side-panel/useSidePanel';
|
|
57
|
+
export * from './components/overlay/fade-overlay/FadeOverlay';
|
|
57
58
|
export * from './components/forms/input-container/InputContainer';
|
|
58
59
|
export * from './components/hyperlink/Hyperlink';
|
|
59
60
|
export * from './components/overlay/tooltip/Tooltip';
|
package/dist/index.js
CHANGED
|
@@ -54,6 +54,7 @@ export * from './components/filtering/chip-multi-toggle/ChipMultiToggle';
|
|
|
54
54
|
export * from './components/forms/checkbox-group/CheckboxGroup';
|
|
55
55
|
export * from './components/overlay/side-panel/SidePanel';
|
|
56
56
|
export * from './components/overlay/side-panel/useSidePanel';
|
|
57
|
+
export * from './components/overlay/fade-overlay/FadeOverlay';
|
|
57
58
|
export * from './components/forms/input-container/InputContainer';
|
|
58
59
|
export * from './components/hyperlink/Hyperlink';
|
|
59
60
|
export * from './components/overlay/tooltip/Tooltip';
|
|
@@ -181,11 +181,11 @@ html[data-theme='dark'] {
|
|
|
181
181
|
--opac-bg-dark-invert: rgba(0, 0, 0, 0.15);
|
|
182
182
|
|
|
183
183
|
/* Shadows */
|
|
184
|
-
--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.
|
|
185
|
-
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.
|
|
186
|
-
--shadow-md: 0 2px
|
|
187
|
-
--shadow-lg: 0
|
|
188
|
-
--shadow-xl: 0
|
|
184
|
+
--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.18);
|
|
185
|
+
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.24);
|
|
186
|
+
--shadow-md: 0 2px 6px rgba(0, 0, 0, 0.32);
|
|
187
|
+
--shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
|
|
188
|
+
--shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.48);
|
|
189
189
|
|
|
190
190
|
/* Data viz */
|
|
191
191
|
--viz-cat-1: #2563eb;
|
|
@@ -180,11 +180,11 @@ html[data-theme='light'] {
|
|
|
180
180
|
--opac-bg-dark-invert: rgba(255, 255, 255, 0.1);
|
|
181
181
|
|
|
182
182
|
/* Shadows */
|
|
183
|
-
--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.
|
|
184
|
-
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.
|
|
185
|
-
--shadow-md: 0 2px
|
|
186
|
-
--shadow-lg: 0
|
|
187
|
-
--shadow-xl: 0
|
|
183
|
+
--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
184
|
+
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
|
|
185
|
+
--shadow-md: 0 2px 6px rgba(0, 0, 0, 0.08);
|
|
186
|
+
--shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
187
|
+
--shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
188
188
|
|
|
189
189
|
/* Data viz */
|
|
190
190
|
--viz-cat-1: #2563eb;
|