@dbcdk/react-components 0.0.173 → 0.0.174
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/client.cjs +14 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +2 -0
- package/dist/components/app-header/AppHeader.module.css +2 -2
- package/dist/components/button/Button.d.ts +3 -1
- package/dist/components/button/Button.module.css +26 -0
- package/dist/components/color-scheme-button/ColorSchemeButton.cjs +78 -0
- package/dist/components/color-scheme-button/ColorSchemeButton.d.ts +8 -0
- package/dist/components/color-scheme-button/ColorSchemeButton.js +75 -0
- package/dist/components/forms/form-select/FormSelect.d.ts +1 -1
- package/dist/components/forms/form-select/FormSelect.module.css +19 -0
- package/dist/components/forms/input/Input.cjs +1 -1
- package/dist/components/forms/input/Input.d.ts +1 -1
- package/dist/components/forms/input/Input.js +1 -1
- package/dist/components/forms/input/Input.module.css +32 -0
- package/dist/components/forms/typeahead/Typeahead.cjs +1 -0
- package/dist/components/forms/typeahead/Typeahead.js +1 -0
- package/dist/components/hyperlink/Hyperlink.cjs +2 -1
- package/dist/components/hyperlink/Hyperlink.d.ts +2 -1
- package/dist/components/hyperlink/Hyperlink.js +2 -1
- package/dist/components/hyperlink/Hyperlink.module.css +16 -0
- package/dist/components/nav-bar/NavBar.cjs +1 -0
- package/dist/components/nav-bar/NavBar.js +1 -0
- package/dist/components/nav-bar/NavBar.module.css +10 -10
- package/dist/components/page-layout/PageLayout.module.css +1 -1
- package/dist/components/popover/Popover.cjs +4 -2
- package/dist/components/popover/Popover.d.ts +2 -0
- package/dist/components/popover/Popover.js +4 -2
- package/dist/components/popover/Popover.module.css +5 -0
- package/dist/components/theme-button/ThemeButton.cjs +30 -23
- package/dist/components/theme-button/ThemeButton.d.ts +9 -3
- package/dist/components/theme-button/ThemeButton.js +31 -24
- package/dist/components/theme-script/ThemeScript.cjs +50 -12
- package/dist/components/theme-script/ThemeScript.d.ts +35 -12
- package/dist/components/theme-script/ThemeScript.js +51 -13
- package/dist/hooks/useColorScheme.cjs +74 -0
- package/dist/hooks/useColorScheme.d.ts +6 -0
- package/dist/hooks/useColorScheme.js +72 -0
- package/dist/hooks/useTheme.cjs +116 -50
- package/dist/hooks/useTheme.d.ts +17 -5
- package/dist/hooks/useTheme.js +117 -51
- package/dist/index.cjs +14 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/styles/themes/dbc/colors.css +13 -2
- package/dist/styles/themes/filmstriben/theme.css +55 -0
- package/dist/styles/themes/types.cjs +8 -0
- package/dist/styles/themes/types.d.ts +24 -16
- package/dist/styles/themes/types.js +6 -0
- package/dist/themes/filmstriben.css +4 -0
- package/dist/utils/color-scheme.constants.cjs +11 -0
- package/dist/utils/color-scheme.constants.d.ts +4 -0
- package/dist/utils/color-scheme.constants.js +7 -0
- package/dist/utils/theme.constants.cjs +3 -7
- package/dist/utils/theme.constants.d.ts +2 -4
- package/dist/utils/theme.constants.js +3 -6
- package/package.json +1 -1
- package/dist/styles/themes/filmstriben-budget/theme.css +0 -22
- package/dist/themes/filmstriben-budget.css +0 -3
package/dist/client.cjs
CHANGED
|
@@ -18,6 +18,7 @@ var EnvironmentBanner = require('./components/environment-banner/EnvironmentBann
|
|
|
18
18
|
var Footer = require('./components/page-layout/components/footer/Footer');
|
|
19
19
|
var Input = require('./components/forms/input/Input');
|
|
20
20
|
var SearchBox = require('./components/search-box/SearchBox');
|
|
21
|
+
var useColorScheme = require('./hooks/useColorScheme');
|
|
21
22
|
var useTheme = require('./hooks/useTheme');
|
|
22
23
|
var usePersistentState = require('./hooks/usePersistentState');
|
|
23
24
|
var Chip = require('./components/chip/Chip');
|
|
@@ -80,6 +81,7 @@ var StatePage = require('./components/state-page/StatePage');
|
|
|
80
81
|
var StickyFooterLayout = require('./components/sticky-footer-layout/StickyFooterLayout');
|
|
81
82
|
var Typeahead = require('./components/forms/typeahead/Typeahead');
|
|
82
83
|
var useDeviceSize = require('./hooks/useDeviceSize');
|
|
84
|
+
var ColorSchemeButton = require('./components/color-scheme-button/ColorSchemeButton');
|
|
83
85
|
var ThemeButton = require('./components/theme-button/ThemeButton');
|
|
84
86
|
var CopyButton = require('./components/copy-button/CopyButton');
|
|
85
87
|
var Divider = require('./components/divider/Divider');
|
|
@@ -195,6 +197,12 @@ Object.keys(SearchBox).forEach(function (k) {
|
|
|
195
197
|
get: function () { return SearchBox[k]; }
|
|
196
198
|
});
|
|
197
199
|
});
|
|
200
|
+
Object.keys(useColorScheme).forEach(function (k) {
|
|
201
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function () { return useColorScheme[k]; }
|
|
204
|
+
});
|
|
205
|
+
});
|
|
198
206
|
Object.keys(useTheme).forEach(function (k) {
|
|
199
207
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
200
208
|
enumerable: true,
|
|
@@ -567,6 +575,12 @@ Object.keys(useDeviceSize).forEach(function (k) {
|
|
|
567
575
|
get: function () { return useDeviceSize[k]; }
|
|
568
576
|
});
|
|
569
577
|
});
|
|
578
|
+
Object.keys(ColorSchemeButton).forEach(function (k) {
|
|
579
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
580
|
+
enumerable: true,
|
|
581
|
+
get: function () { return ColorSchemeButton[k]; }
|
|
582
|
+
});
|
|
583
|
+
});
|
|
570
584
|
Object.keys(ThemeButton).forEach(function (k) {
|
|
571
585
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
572
586
|
enumerable: true,
|
package/dist/client.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './components/environment-banner/EnvironmentBanner';
|
|
|
15
15
|
export * from './components/page-layout/components/footer/Footer';
|
|
16
16
|
export * from './components/forms/input/Input';
|
|
17
17
|
export * from './components/search-box/SearchBox';
|
|
18
|
+
export * from './hooks/useColorScheme';
|
|
18
19
|
export * from './hooks/useTheme';
|
|
19
20
|
export * from './hooks/usePersistentState';
|
|
20
21
|
export * from './components/chip/Chip';
|
|
@@ -77,6 +78,7 @@ export * from './components/state-page/StatePage';
|
|
|
77
78
|
export * from './components/sticky-footer-layout/StickyFooterLayout';
|
|
78
79
|
export * from './components/forms/typeahead/Typeahead';
|
|
79
80
|
export * from './hooks/useDeviceSize';
|
|
81
|
+
export * from './components/color-scheme-button/ColorSchemeButton';
|
|
80
82
|
export * from './components/theme-button/ThemeButton';
|
|
81
83
|
export * from './components/copy-button/CopyButton';
|
|
82
84
|
export * from './components/divider/Divider';
|
package/dist/client.js
CHANGED
|
@@ -16,6 +16,7 @@ export * from './components/environment-banner/EnvironmentBanner';
|
|
|
16
16
|
export * from './components/page-layout/components/footer/Footer';
|
|
17
17
|
export * from './components/forms/input/Input';
|
|
18
18
|
export * from './components/search-box/SearchBox';
|
|
19
|
+
export * from './hooks/useColorScheme';
|
|
19
20
|
export * from './hooks/useTheme';
|
|
20
21
|
export * from './hooks/usePersistentState';
|
|
21
22
|
export * from './components/chip/Chip';
|
|
@@ -78,6 +79,7 @@ export * from './components/state-page/StatePage';
|
|
|
78
79
|
export * from './components/sticky-footer-layout/StickyFooterLayout';
|
|
79
80
|
export * from './components/forms/typeahead/Typeahead';
|
|
80
81
|
export * from './hooks/useDeviceSize';
|
|
82
|
+
export * from './components/color-scheme-button/ColorSchemeButton';
|
|
81
83
|
export * from './components/theme-button/ThemeButton';
|
|
82
84
|
export * from './components/copy-button/CopyButton';
|
|
83
85
|
export * from './components/divider/Divider';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.header {
|
|
2
2
|
inline-size: 100%;
|
|
3
|
-
background-color: var(--color-bg
|
|
3
|
+
background-color: var(--color-navbar-bg);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.container {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
|
|
18
18
|
/* chrome */
|
|
19
|
-
color: var(--color-fg
|
|
19
|
+
color: var(--color-navbar-fg);
|
|
20
20
|
|
|
21
21
|
/* density-aware vertical rhythm */
|
|
22
22
|
padding-block: calc(var(--control-padding-y) + var(--density));
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { Size } from '../../types/sizes.types';
|
|
3
|
-
export type ButtonVariant = 'primary' | 'secondary' | 'outlined' | 'default' | 'inline' | 'success' | 'danger'
|
|
3
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'outlined' | 'default' | 'inline' | 'success' | 'danger'
|
|
4
|
+
/** Ghost button using --color-navbar-fg tokens — only meaningful inside/near AppHeader */
|
|
5
|
+
| 'header';
|
|
4
6
|
export type ButtonSize = Exclude<Size, 'xl'>;
|
|
5
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
8
|
variant?: ButtonVariant;
|
|
@@ -252,6 +252,32 @@
|
|
|
252
252
|
color: var(--button-bg-primary-hover);
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
.header {
|
|
256
|
+
background-color: transparent;
|
|
257
|
+
color: var(--color-navbar-fg);
|
|
258
|
+
border-color: var(--color-navbar-border);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.header:hover {
|
|
262
|
+
background-color: color-mix(in srgb, var(--color-navbar-fg) 12%, transparent);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.header:focus-visible {
|
|
266
|
+
outline: none;
|
|
267
|
+
border-color: var(--color-navbar-fg);
|
|
268
|
+
box-shadow: inset 0 0 0 1px var(--color-navbar-fg);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.header.active {
|
|
272
|
+
background-color: color-mix(in srgb, var(--color-navbar-fg) 16%, transparent);
|
|
273
|
+
color: var(--color-navbar-fg);
|
|
274
|
+
border-color: var(--color-navbar-fg);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.header.active:hover {
|
|
278
|
+
background-color: color-mix(in srgb, var(--color-navbar-fg) 22%, transparent);
|
|
279
|
+
}
|
|
280
|
+
|
|
255
281
|
.button.xs {
|
|
256
282
|
height: auto;
|
|
257
283
|
min-block-size: 0;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var lucideReact = require('lucide-react');
|
|
6
|
+
var Button = require('../../components/button/Button');
|
|
7
|
+
var Menu = require('../../components/menu/Menu');
|
|
8
|
+
var Popover = require('../../components/popover/Popover');
|
|
9
|
+
var useColorScheme = require('../../hooks/useColorScheme');
|
|
10
|
+
|
|
11
|
+
const COLOR_SCHEME_OPTIONS = [
|
|
12
|
+
{ value: "system", label: "System", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Monitor, { size: 16 }) },
|
|
13
|
+
{ value: "light", label: "Lyst", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { size: 16 }) },
|
|
14
|
+
{ value: "dark", label: "M\xF8rkt", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Moon, { size: 16 }) }
|
|
15
|
+
];
|
|
16
|
+
function ColorSchemeMenuSection() {
|
|
17
|
+
const { colorScheme, switchColorScheme } = useColorScheme.useColorScheme();
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
19
|
+
/* @__PURE__ */ jsxRuntime.jsx(Menu.Menu.Header, { children: "Udseende" }),
|
|
20
|
+
COLOR_SCHEME_OPTIONS.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
21
|
+
Menu.Menu.RadioItem,
|
|
22
|
+
{
|
|
23
|
+
name: "color-scheme",
|
|
24
|
+
value: option.value,
|
|
25
|
+
checked: colorScheme === option.value,
|
|
26
|
+
label: option.label,
|
|
27
|
+
onValueChange: (value) => switchColorScheme(value)
|
|
28
|
+
},
|
|
29
|
+
option.value
|
|
30
|
+
))
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
function ColorSchemeButton({
|
|
34
|
+
size,
|
|
35
|
+
variant = "outlined"
|
|
36
|
+
}) {
|
|
37
|
+
const { colorScheme, switchColorScheme } = useColorScheme.useColorScheme();
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
Popover.Popover,
|
|
40
|
+
{
|
|
41
|
+
matchTriggerWidth: false,
|
|
42
|
+
minWidth: "140px",
|
|
43
|
+
trigger: (handleClick, chevron) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
44
|
+
Button.Button,
|
|
45
|
+
{
|
|
46
|
+
variant,
|
|
47
|
+
size,
|
|
48
|
+
onClick: handleClick,
|
|
49
|
+
"aria-label": "Skift udseende",
|
|
50
|
+
"aria-haspopup": "menu",
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Palette, {}),
|
|
53
|
+
chevron
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
children: (close) => /* @__PURE__ */ jsxRuntime.jsxs(Menu.Menu, { children: [
|
|
58
|
+
/* @__PURE__ */ jsxRuntime.jsx(Menu.Menu.Header, { children: "Udseende" }),
|
|
59
|
+
COLOR_SCHEME_OPTIONS.map((option) => /* @__PURE__ */ jsxRuntime.jsx(Menu.Menu.Item, { active: colorScheme === option.value, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
onClick: () => {
|
|
63
|
+
switchColorScheme(option.value);
|
|
64
|
+
close();
|
|
65
|
+
},
|
|
66
|
+
children: [
|
|
67
|
+
option.icon,
|
|
68
|
+
option.label
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
) }, option.value))
|
|
72
|
+
] })
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
exports.ColorSchemeButton = ColorSchemeButton;
|
|
78
|
+
exports.ColorSchemeMenuSection = ColorSchemeMenuSection;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { ButtonSize, ButtonVariant } from '../../components/button/Button';
|
|
3
|
+
export interface ColorSchemeButtonProps {
|
|
4
|
+
size?: ButtonSize;
|
|
5
|
+
variant?: ButtonVariant;
|
|
6
|
+
}
|
|
7
|
+
export declare function ColorSchemeMenuSection(): JSX.Element;
|
|
8
|
+
export declare function ColorSchemeButton({ size, variant, }: ColorSchemeButtonProps): JSX.Element;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Palette, Monitor, Sun, Moon } from 'lucide-react';
|
|
4
|
+
import { Button } from '../../components/button/Button';
|
|
5
|
+
import { Menu } from '../../components/menu/Menu';
|
|
6
|
+
import { Popover } from '../../components/popover/Popover';
|
|
7
|
+
import { useColorScheme } from '../../hooks/useColorScheme';
|
|
8
|
+
|
|
9
|
+
const COLOR_SCHEME_OPTIONS = [
|
|
10
|
+
{ value: "system", label: "System", icon: /* @__PURE__ */ jsx(Monitor, { size: 16 }) },
|
|
11
|
+
{ value: "light", label: "Lyst", icon: /* @__PURE__ */ jsx(Sun, { size: 16 }) },
|
|
12
|
+
{ value: "dark", label: "M\xF8rkt", icon: /* @__PURE__ */ jsx(Moon, { size: 16 }) }
|
|
13
|
+
];
|
|
14
|
+
function ColorSchemeMenuSection() {
|
|
15
|
+
const { colorScheme, switchColorScheme } = useColorScheme();
|
|
16
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
+
/* @__PURE__ */ jsx(Menu.Header, { children: "Udseende" }),
|
|
18
|
+
COLOR_SCHEME_OPTIONS.map((option) => /* @__PURE__ */ jsx(
|
|
19
|
+
Menu.RadioItem,
|
|
20
|
+
{
|
|
21
|
+
name: "color-scheme",
|
|
22
|
+
value: option.value,
|
|
23
|
+
checked: colorScheme === option.value,
|
|
24
|
+
label: option.label,
|
|
25
|
+
onValueChange: (value) => switchColorScheme(value)
|
|
26
|
+
},
|
|
27
|
+
option.value
|
|
28
|
+
))
|
|
29
|
+
] });
|
|
30
|
+
}
|
|
31
|
+
function ColorSchemeButton({
|
|
32
|
+
size,
|
|
33
|
+
variant = "outlined"
|
|
34
|
+
}) {
|
|
35
|
+
const { colorScheme, switchColorScheme } = useColorScheme();
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
Popover,
|
|
38
|
+
{
|
|
39
|
+
matchTriggerWidth: false,
|
|
40
|
+
minWidth: "140px",
|
|
41
|
+
trigger: (handleClick, chevron) => /* @__PURE__ */ jsxs(
|
|
42
|
+
Button,
|
|
43
|
+
{
|
|
44
|
+
variant,
|
|
45
|
+
size,
|
|
46
|
+
onClick: handleClick,
|
|
47
|
+
"aria-label": "Skift udseende",
|
|
48
|
+
"aria-haspopup": "menu",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx(Palette, {}),
|
|
51
|
+
chevron
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
children: (close) => /* @__PURE__ */ jsxs(Menu, { children: [
|
|
56
|
+
/* @__PURE__ */ jsx(Menu.Header, { children: "Udseende" }),
|
|
57
|
+
COLOR_SCHEME_OPTIONS.map((option) => /* @__PURE__ */ jsx(Menu.Item, { active: colorScheme === option.value, children: /* @__PURE__ */ jsxs(
|
|
58
|
+
"button",
|
|
59
|
+
{
|
|
60
|
+
onClick: () => {
|
|
61
|
+
switchColorScheme(option.value);
|
|
62
|
+
close();
|
|
63
|
+
},
|
|
64
|
+
children: [
|
|
65
|
+
option.icon,
|
|
66
|
+
option.label
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
) }, option.value))
|
|
70
|
+
] })
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { ColorSchemeButton, ColorSchemeMenuSection };
|
|
@@ -10,7 +10,7 @@ export type FormSelectProps<T> = Omit<InputContainerProps, 'children' | 'htmlFor
|
|
|
10
10
|
onChange: (value: T) => void;
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
size?: 'sm' | 'md' | 'lg';
|
|
13
|
-
variant?: 'outlined' | 'filled' | 'standalone';
|
|
13
|
+
variant?: 'outlined' | 'filled' | 'standalone' | 'header';
|
|
14
14
|
onClear?: () => void;
|
|
15
15
|
/**
|
|
16
16
|
* Needed if T is an object and you want to use native select.
|
|
@@ -129,6 +129,25 @@
|
|
|
129
129
|
background-color: transparent;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
/* Ghost field for use inside/near AppHeader — only meaningful there */
|
|
133
|
+
.header {
|
|
134
|
+
background-color: transparent;
|
|
135
|
+
border-color: var(--color-navbar-border);
|
|
136
|
+
color: var(--color-navbar-fg);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.header:hover:not(:disabled) {
|
|
140
|
+
background-color: color-mix(in srgb, var(--color-navbar-fg) 8%, transparent);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.container:focus-within .header {
|
|
144
|
+
border-color: var(--color-navbar-fg);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.field:has(.header) .chevron {
|
|
148
|
+
color: var(--color-navbar-fg-muted);
|
|
149
|
+
}
|
|
150
|
+
|
|
132
151
|
/* =========================================
|
|
133
152
|
Sizes
|
|
134
153
|
========================================= */
|
|
@@ -87,7 +87,7 @@ const Input = react.forwardRef(function Input2({
|
|
|
87
87
|
focusOpenMode: tooltipOpenOnFocus ? "any" : "focus-visible",
|
|
88
88
|
closeOnPointerDown: false
|
|
89
89
|
});
|
|
90
|
-
const trailingButtonVariant = variant === "outlined" || variant === "standalone" ? "outlined" : "default";
|
|
90
|
+
const trailingButtonVariant = variant === "header" ? "header" : variant === "outlined" || variant === "standalone" ? "outlined" : "default";
|
|
91
91
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
92
92
|
InputContainer.InputContainer,
|
|
93
93
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { Size } from '../../../types/sizes.types';
|
|
3
3
|
import type { InputContainerProps } from '../input-container/InputContainer';
|
|
4
|
-
export type InputVariant = 'outlined' | 'surface' | 'subtle' | 'standalone' | 'embedded';
|
|
4
|
+
export type InputVariant = 'outlined' | 'surface' | 'subtle' | 'standalone' | 'embedded' | 'header';
|
|
5
5
|
export type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'width'> & Omit<InputContainerProps, 'children' | 'htmlFor' | 'tooltip' | 'tooltipPlacement' | 'size'> & {
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
autoFocus?: boolean;
|
|
@@ -81,7 +81,7 @@ const Input = forwardRef(function Input2({
|
|
|
81
81
|
focusOpenMode: tooltipOpenOnFocus ? "any" : "focus-visible",
|
|
82
82
|
closeOnPointerDown: false
|
|
83
83
|
});
|
|
84
|
-
const trailingButtonVariant = variant === "outlined" || variant === "standalone" ? "outlined" : "default";
|
|
84
|
+
const trailingButtonVariant = variant === "header" ? "header" : variant === "outlined" || variant === "standalone" ? "outlined" : "default";
|
|
85
85
|
return /* @__PURE__ */ jsx(
|
|
86
86
|
InputContainer,
|
|
87
87
|
{
|
|
@@ -183,6 +183,38 @@
|
|
|
183
183
|
inset 0 0 0 1px var(--color-border-selected);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
+
/* Ghost field for use inside/near AppHeader — only meaningful there */
|
|
187
|
+
.header {
|
|
188
|
+
background-color: transparent;
|
|
189
|
+
border-color: var(--color-navbar-border);
|
|
190
|
+
color: var(--color-navbar-fg);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.header:hover:not([aria-disabled='true']) {
|
|
194
|
+
background-color: color-mix(in srgb, var(--color-navbar-fg) 8%, transparent);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.header:focus-within:not([aria-disabled='true']) {
|
|
198
|
+
border-color: var(--color-navbar-fg);
|
|
199
|
+
box-shadow: inset 0 0 0 1px var(--color-navbar-fg);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.header .input {
|
|
203
|
+
color: var(--color-navbar-fg);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.header .input::placeholder {
|
|
207
|
+
color: var(--color-navbar-fg-muted) !important;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.header .icon {
|
|
211
|
+
color: var(--color-navbar-fg-muted);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.header:focus-within .icon {
|
|
215
|
+
color: var(--color-navbar-fg);
|
|
216
|
+
}
|
|
217
|
+
|
|
186
218
|
/* =========================
|
|
187
219
|
Modified state
|
|
188
220
|
========================= */
|
|
@@ -56,10 +56,11 @@ function Hyperlink(props) {
|
|
|
56
56
|
disabled = false,
|
|
57
57
|
...rest
|
|
58
58
|
} = props;
|
|
59
|
+
const variantClassName = variant === "secondary" ? styles__default.default.secondary : variant === "header" ? styles__default.default.header : styles__default.default.primary;
|
|
59
60
|
const linkClassName = cx(
|
|
60
61
|
styles__default.default.link,
|
|
61
62
|
className,
|
|
62
|
-
|
|
63
|
+
variantClassName,
|
|
63
64
|
inline ? "" : styles__default.default.block,
|
|
64
65
|
disabled ? styles__default.default.disabled : ""
|
|
65
66
|
);
|
|
@@ -9,7 +9,8 @@ type BaseProps = {
|
|
|
9
9
|
* Instead, it will clone its only child (e.g. Next <Link>) and apply styling/props to it.
|
|
10
10
|
*/
|
|
11
11
|
asChild?: boolean;
|
|
12
|
-
|
|
12
|
+
/** 'header' uses --color-navbar-fg tokens — only meaningful when rendered inside/near AppHeader */
|
|
13
|
+
variant?: 'primary' | 'secondary' | 'header';
|
|
13
14
|
inline?: boolean;
|
|
14
15
|
disabled?: boolean;
|
|
15
16
|
};
|
|
@@ -31,10 +31,11 @@ function Hyperlink(props) {
|
|
|
31
31
|
disabled = false,
|
|
32
32
|
...rest
|
|
33
33
|
} = props;
|
|
34
|
+
const variantClassName = variant === "secondary" ? styles.secondary : variant === "header" ? styles.header : styles.primary;
|
|
34
35
|
const linkClassName = cx(
|
|
35
36
|
styles.link,
|
|
36
37
|
className,
|
|
37
|
-
|
|
38
|
+
variantClassName,
|
|
38
39
|
inline ? "" : styles.block,
|
|
39
40
|
disabled ? styles.disabled : ""
|
|
40
41
|
);
|
|
@@ -23,6 +23,22 @@
|
|
|
23
23
|
color: var(--color-fg-default);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
.link.header {
|
|
27
|
+
color: var(--color-navbar-fg-muted);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.link.header:hover {
|
|
31
|
+
color: var(--color-navbar-fg);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.link.header:active {
|
|
35
|
+
color: var(--color-navbar-fg);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.link.header:focus-visible {
|
|
39
|
+
outline-color: var(--color-navbar-fg);
|
|
40
|
+
}
|
|
41
|
+
|
|
26
42
|
.link:hover {
|
|
27
43
|
color: var(--color-brand);
|
|
28
44
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.container {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
gap: var(--spacing-
|
|
4
|
+
gap: var(--spacing-2xl);
|
|
5
5
|
inline-size: 100%;
|
|
6
6
|
box-sizing: border-box;
|
|
7
7
|
flex-grow: 1;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
block-size: var(--component-size-md);
|
|
41
41
|
border: none;
|
|
42
42
|
background: transparent;
|
|
43
|
-
color: var(--color-fg
|
|
43
|
+
color: var(--color-navbar-fg);
|
|
44
44
|
border-radius: var(--border-radius-default);
|
|
45
45
|
cursor: pointer;
|
|
46
46
|
padding: 0;
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.burgerButton:hover {
|
|
51
|
-
background-color: var(--color-
|
|
51
|
+
background-color: color-mix(in srgb, var(--color-navbar-fg) 12%, transparent);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.burgerButton:focus-visible {
|
|
55
55
|
outline: none;
|
|
56
|
-
box-shadow: var(--
|
|
56
|
+
box-shadow: inset 0 0 0 1px var(--color-navbar-fg);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/* Mobile dropdown content */
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
display: inline-flex;
|
|
171
171
|
align-items: center;
|
|
172
172
|
gap: var(--spacing-xs);
|
|
173
|
-
color: var(--color-fg-muted);
|
|
173
|
+
color: var(--color-navbar-fg-muted);
|
|
174
174
|
font-family: var(--font-family);
|
|
175
175
|
font-size: var(--font-size-sm);
|
|
176
176
|
text-decoration: none;
|
|
@@ -185,17 +185,17 @@
|
|
|
185
185
|
|
|
186
186
|
/* Hover + focus */
|
|
187
187
|
.link:hover {
|
|
188
|
-
color: var(--color-fg
|
|
188
|
+
color: var(--color-navbar-fg);
|
|
189
189
|
}
|
|
190
190
|
.link:focus-visible {
|
|
191
191
|
outline: none;
|
|
192
|
-
box-shadow: var(--
|
|
192
|
+
box-shadow: inset 0 0 0 1px var(--color-navbar-fg);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
/* Active underline */
|
|
196
196
|
.link.active,
|
|
197
197
|
.link[aria-current='page'] {
|
|
198
|
-
color: var(--color-brand);
|
|
198
|
+
color: var(--color-navbar-brand);
|
|
199
199
|
box-shadow: none;
|
|
200
200
|
}
|
|
201
201
|
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
inset-block-end: 0;
|
|
207
207
|
inline-size: 0;
|
|
208
208
|
block-size: 2px;
|
|
209
|
-
background-color: var(--color-
|
|
209
|
+
background-color: var(--color-navbar-fg);
|
|
210
210
|
transition: inline-size var(--transition-fast) var(--ease-standard);
|
|
211
211
|
}
|
|
212
212
|
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
.link.active::after,
|
|
218
218
|
.link[aria-current='page']::after {
|
|
219
219
|
inline-size: 100%;
|
|
220
|
-
background-color: var(--color-brand);
|
|
220
|
+
background-color: var(--color-navbar-brand);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
/* Icons/images inside links */
|
|
@@ -96,7 +96,8 @@ const Popover = React.forwardRef(function Popover2({
|
|
|
96
96
|
autoFocusContent = false,
|
|
97
97
|
returnFocus = true,
|
|
98
98
|
anchorRef,
|
|
99
|
-
overlayRef
|
|
99
|
+
overlayRef,
|
|
100
|
+
variant = "default"
|
|
100
101
|
}, ref) {
|
|
101
102
|
const internalId = React.useId();
|
|
102
103
|
const resolvedContentId = contentId != null ? contentId : `popover-${internalId}`;
|
|
@@ -266,7 +267,8 @@ const Popover = React.forwardRef(function Popover2({
|
|
|
266
267
|
if (lastCloseReasonRef.current === "outside") return;
|
|
267
268
|
(_b = (_a = triggerElRef.current) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
268
269
|
}, [isOpen, returnFocus]);
|
|
269
|
-
const
|
|
270
|
+
const chevronClassName = variant === "header" ? styles__default.default.chevronHeader : "dbc-muted-text";
|
|
271
|
+
const icon = isOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: chevronClassName, size: 20 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: chevronClassName, size: 20 });
|
|
270
272
|
const setOverlayRef = React__namespace.useCallback(
|
|
271
273
|
(node) => {
|
|
272
274
|
assignRef(overlayRef, node);
|
|
@@ -18,6 +18,8 @@ export interface PopoverProps {
|
|
|
18
18
|
returnFocus?: boolean;
|
|
19
19
|
anchorRef?: React.RefObject<HTMLElement | null>;
|
|
20
20
|
overlayRef?: React.Ref<HTMLDivElement>;
|
|
21
|
+
/** 'header' colors the built-in chevron icon with --color-navbar-fg tokens — only meaningful inside/near AppHeader */
|
|
22
|
+
variant?: 'default' | 'header';
|
|
21
23
|
}
|
|
22
24
|
export interface PopoverHandle {
|
|
23
25
|
close: () => void;
|
|
@@ -72,7 +72,8 @@ const Popover = forwardRef(function Popover2({
|
|
|
72
72
|
autoFocusContent = false,
|
|
73
73
|
returnFocus = true,
|
|
74
74
|
anchorRef,
|
|
75
|
-
overlayRef
|
|
75
|
+
overlayRef,
|
|
76
|
+
variant = "default"
|
|
76
77
|
}, ref) {
|
|
77
78
|
const internalId = useId();
|
|
78
79
|
const resolvedContentId = contentId != null ? contentId : `popover-${internalId}`;
|
|
@@ -242,7 +243,8 @@ const Popover = forwardRef(function Popover2({
|
|
|
242
243
|
if (lastCloseReasonRef.current === "outside") return;
|
|
243
244
|
(_b = (_a = triggerElRef.current) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
244
245
|
}, [isOpen, returnFocus]);
|
|
245
|
-
const
|
|
246
|
+
const chevronClassName = variant === "header" ? styles.chevronHeader : "dbc-muted-text";
|
|
247
|
+
const icon = isOpen ? /* @__PURE__ */ jsx(ChevronUp, { className: chevronClassName, size: 20 }) : /* @__PURE__ */ jsx(ChevronDown, { className: chevronClassName, size: 20 });
|
|
246
248
|
const setOverlayRef = React.useCallback(
|
|
247
249
|
(node) => {
|
|
248
250
|
assignRef(overlayRef, node);
|