@dbcdk/react-components 0.0.173 → 0.0.175
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/filter-field/FilterField.module.css +2 -2
- package/dist/components/forms/file-upload/FileUpload.module.css +3 -3
- package/dist/components/forms/form-select/FormSelect.d.ts +1 -1
- package/dist/components/forms/form-select/FormSelect.module.css +20 -1
- 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 +40 -8
- package/dist/components/forms/text-area/Textarea.module.css +2 -1
- 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 +14 -2
- package/dist/styles/themes/filmstriben/theme.css +108 -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 };
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
z-index: 1;
|
|
168
168
|
color: var(--color-fg-default);
|
|
169
169
|
background: color-mix(in srgb, var(--color-bg-hover-subtle) 55%, transparent);
|
|
170
|
-
box-shadow: inset 0 0 0 1px var(--color-
|
|
170
|
+
box-shadow: inset 0 0 0 1px var(--color-field-focus);
|
|
171
171
|
outline: none;
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
.valueWrapper:focus-within {
|
|
201
|
-
box-shadow: inset 0 0 0 1px var(--color-
|
|
201
|
+
box-shadow: inset 0 0 0 1px var(--color-field-focus);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
.invalid .valueWrapper:focus-within {
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
|
|
27
27
|
.dropzone:hover:not(.disabled) {
|
|
28
28
|
background-color: var(--color-bg-selected);
|
|
29
|
-
border-color: var(--color-
|
|
29
|
+
border-color: var(--color-field-focus);
|
|
30
30
|
color: var(--color-fg-default);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.dragging {
|
|
34
34
|
background-color: var(--color-bg-selected);
|
|
35
|
-
border-color: var(--color-
|
|
35
|
+
border-color: var(--color-field-focus);
|
|
36
36
|
color: var(--color-fg-default);
|
|
37
|
-
box-shadow: inset 0 0 0 1px var(--color-
|
|
37
|
+
box-shadow: inset 0 0 0 1px var(--color-field-focus);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.hasError {
|
|
@@ -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.
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
========================================= */
|
|
31
31
|
|
|
32
32
|
.container:focus-within {
|
|
33
|
-
box-shadow: 0 0 0 2px var(--color-
|
|
33
|
+
box-shadow: 0 0 0 2px var(--color-field-focus);
|
|
34
34
|
z-index: 1;
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -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
|
{
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
.outlined:focus-within:not([aria-disabled='true']) {
|
|
109
|
-
border-color: var(--color-
|
|
110
|
-
box-shadow: inset 0 0 0 1px var(--color-
|
|
109
|
+
border-color: var(--color-field-focus);
|
|
110
|
+
box-shadow: inset 0 0 0 1px var(--color-field-focus);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
.surface {
|
|
@@ -122,8 +122,8 @@
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.surface:focus-within:not([aria-disabled='true']) {
|
|
125
|
-
border-color: var(--color-
|
|
126
|
-
box-shadow: inset 0 0 0 1px var(--color-
|
|
125
|
+
border-color: var(--color-field-focus);
|
|
126
|
+
box-shadow: inset 0 0 0 1px var(--color-field-focus);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/* Old filled/tinted behavior, now renamed subtle */
|
|
@@ -138,8 +138,8 @@
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
.subtle:focus-within:not([aria-disabled='true']) {
|
|
141
|
-
border-color: var(--color-
|
|
142
|
-
box-shadow: inset 0 0 0 1px var(--color-
|
|
141
|
+
border-color: var(--color-field-focus);
|
|
142
|
+
box-shadow: inset 0 0 0 1px var(--color-field-focus);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
.embedded {
|
|
@@ -176,11 +176,43 @@
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
.standalone:focus-within:not([aria-disabled='true']) {
|
|
179
|
-
border-color: var(--color-
|
|
179
|
+
border-color: var(--color-field-focus);
|
|
180
180
|
box-shadow:
|
|
181
181
|
var(--shadow-xs),
|
|
182
182
|
var(--shadow-md),
|
|
183
|
-
inset 0 0 0 1px var(--color-
|
|
183
|
+
inset 0 0 0 1px var(--color-field-focus);
|
|
184
|
+
}
|
|
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);
|
|
184
216
|
}
|
|
185
217
|
|
|
186
218
|
/* =========================
|
|
@@ -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
|
}
|