@dbcdk/react-components 0.0.204 → 0.0.205
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 +5 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +1 -0
- package/dist/components/alert/Alert.module.css +10 -30
- package/dist/components/callout/Callout.cjs +14 -0
- package/dist/components/callout/Callout.d.ts +15 -0
- package/dist/components/callout/Callout.js +8 -0
- package/dist/components/callout/Callout.module.css +44 -0
- package/dist/components/forms/input/Input.module.css +1 -1
- package/dist/components/forms/select/Select.module.css +1 -1
- package/dist/components/forms/text-area/Textarea.module.css +1 -1
- package/dist/components/inline-status/InlineStatus.module.css +17 -28
- package/dist/index.cjs +7 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/styles/styles.css +8 -0
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -98,6 +98,7 @@ var CopyButton = require('./components/copy-button/CopyButton');
|
|
|
98
98
|
var Divider = require('./components/divider/Divider');
|
|
99
99
|
var Grid = require('./components/grid/Grid');
|
|
100
100
|
var Alert = require('./components/alert/Alert');
|
|
101
|
+
var Callout = require('./components/callout/Callout');
|
|
101
102
|
var InlineStatus = require('./components/inline-status/InlineStatus');
|
|
102
103
|
var MediaCard = require('./components/media-card/MediaCard');
|
|
103
104
|
var Lightbox = require('./components/lightbox/Lightbox');
|
|
@@ -570,6 +571,10 @@ Object.defineProperty(exports, "Alert", {
|
|
|
570
571
|
enumerable: true,
|
|
571
572
|
get: function () { return Alert.Alert; }
|
|
572
573
|
});
|
|
574
|
+
Object.defineProperty(exports, "Callout", {
|
|
575
|
+
enumerable: true,
|
|
576
|
+
get: function () { return Callout.Callout; }
|
|
577
|
+
});
|
|
573
578
|
Object.defineProperty(exports, "InlineStatus", {
|
|
574
579
|
enumerable: true,
|
|
575
580
|
get: function () { return InlineStatus.InlineStatus; }
|
package/dist/client.d.ts
CHANGED
|
@@ -164,6 +164,8 @@ export { Grid, GridItem } from './components/grid/Grid';
|
|
|
164
164
|
export type { GridGap, GridMaxWidth, GridProps, GridItemProps } from './components/grid/Grid';
|
|
165
165
|
export { Alert } from './components/alert/Alert';
|
|
166
166
|
export type { AlertProps } from './components/alert/Alert';
|
|
167
|
+
export { Callout } from './components/callout/Callout';
|
|
168
|
+
export type { CalloutProps } from './components/callout/Callout';
|
|
167
169
|
export { InlineStatus } from './components/inline-status/InlineStatus';
|
|
168
170
|
export type { InlineStatusProps } from './components/inline-status/InlineStatus';
|
|
169
171
|
export { MediaCard } from './components/media-card/MediaCard';
|
package/dist/client.js
CHANGED
|
@@ -96,6 +96,7 @@ export { CopyButton } from './components/copy-button/CopyButton';
|
|
|
96
96
|
export { Divider } from './components/divider/Divider';
|
|
97
97
|
export { Grid, GridItem } from './components/grid/Grid';
|
|
98
98
|
export { Alert } from './components/alert/Alert';
|
|
99
|
+
export { Callout } from './components/callout/Callout';
|
|
99
100
|
export { InlineStatus } from './components/inline-status/InlineStatus';
|
|
100
101
|
export { MediaCard } from './components/media-card/MediaCard';
|
|
101
102
|
export { Lightbox } from './components/lightbox/Lightbox';
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
.container {
|
|
2
|
-
--alert-bg: var(--color-bg-toolbar);
|
|
3
|
-
--alert-fg: var(--color-fg-default);
|
|
4
|
-
|
|
5
2
|
display: flex;
|
|
6
3
|
align-items: flex-start;
|
|
7
4
|
gap: var(--spacing-sm);
|
|
8
5
|
inline-size: min(100%, var(--alert-max-width, 72ch));
|
|
9
6
|
max-inline-size: 100%;
|
|
10
7
|
padding: var(--spacing-sm) var(--spacing-md);
|
|
8
|
+
border: var(--border-width-thin) solid var(--color-border-default);
|
|
9
|
+
/* Severity accent on the left edge, as on toasts. */
|
|
10
|
+
border-inline-start: var(--border-width-thick) solid var(--alert-accent);
|
|
11
11
|
border-radius: var(--border-radius-default);
|
|
12
|
-
background: var(--alert-bg);
|
|
13
|
-
color: var(--
|
|
14
|
-
/* Severity stripe on the left edge. An inset shadow keeps size and padding unchanged. */
|
|
15
|
-
box-shadow: inset var(--border-width-thick) 0 0 var(--alert-accent, transparent);
|
|
12
|
+
background: color-mix(in srgb, var(--alert-accent) 4%, var(--color-bg-surface));
|
|
13
|
+
color: var(--color-fg-default);
|
|
16
14
|
box-sizing: border-box;
|
|
17
15
|
}
|
|
18
16
|
|
|
@@ -66,53 +64,35 @@
|
|
|
66
64
|
}
|
|
67
65
|
|
|
68
66
|
.neutral {
|
|
69
|
-
--alert-
|
|
70
|
-
|
|
67
|
+
--alert-accent: var(--color-border-default);
|
|
68
|
+
background: var(--color-bg-surface-subtle);
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
.success {
|
|
74
|
-
--alert-bg: var(--color-status-success-bg);
|
|
75
|
-
--alert-fg: var(--color-status-success-fg);
|
|
76
72
|
--alert-accent: var(--color-status-success);
|
|
77
73
|
}
|
|
78
74
|
|
|
79
75
|
.warning {
|
|
80
|
-
--alert-bg: var(--color-status-warning-bg);
|
|
81
|
-
--alert-fg: var(--color-status-warning-fg);
|
|
82
76
|
--alert-accent: var(--color-status-warning);
|
|
83
77
|
}
|
|
84
78
|
|
|
85
79
|
.error {
|
|
86
|
-
--alert-bg: var(--color-status-error-bg);
|
|
87
|
-
--alert-fg: var(--color-status-error-fg);
|
|
88
80
|
--alert-accent: var(--color-status-error);
|
|
89
81
|
}
|
|
90
82
|
|
|
91
83
|
.info {
|
|
92
|
-
--alert-bg: var(--color-status-info-bg);
|
|
93
|
-
--alert-fg: var(--color-status-info-fg);
|
|
94
84
|
--alert-accent: var(--color-status-info);
|
|
95
85
|
}
|
|
96
86
|
|
|
97
87
|
.brand {
|
|
98
|
-
--alert-bg: color-mix(in srgb, var(--color-brand) 10%, var(--color-bg-surface));
|
|
99
|
-
--alert-fg: var(--color-brand);
|
|
100
88
|
--alert-accent: var(--color-brand);
|
|
101
89
|
}
|
|
102
90
|
|
|
103
91
|
.accent {
|
|
104
|
-
--alert-bg: var(--color-accent-bg);
|
|
105
|
-
--alert-fg: var(--color-accent-fg);
|
|
106
92
|
--alert-accent: var(--color-accent);
|
|
107
93
|
}
|
|
108
94
|
|
|
109
|
-
/*
|
|
110
|
-
.
|
|
111
|
-
|
|
112
|
-
.error,
|
|
113
|
-
.info,
|
|
114
|
-
.brand,
|
|
115
|
-
.accent {
|
|
116
|
-
border-top-left-radius: 0;
|
|
117
|
-
border-bottom-left-radius: 0;
|
|
95
|
+
/* The brand icon is light (made for brand backgrounds), so use the brand colour here. */
|
|
96
|
+
.brand .leading svg {
|
|
97
|
+
color: var(--color-brand);
|
|
118
98
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var styles = require('./Callout.module.css');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
9
|
+
|
|
10
|
+
function Callout({ children, severity = "neutral" }) {
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${styles__default.default.callout} ${styles__default.default[severity]}`, children });
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.Callout = Callout;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
|
+
import type { Severity } from '../../constants/severity.types';
|
|
3
|
+
export interface CalloutProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Colour of the bar on the left edge. */
|
|
6
|
+
severity?: Severity;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A quiet box for extra content that belongs to what is right above it, e.g.
|
|
10
|
+
* help or examples under a form field. A light background and a bar on the
|
|
11
|
+
* left, without an outer border, so it doesn't look like an input or a card.
|
|
12
|
+
*
|
|
13
|
+
* Unlike Alert it has no icon, title or role: it isn't a message.
|
|
14
|
+
*/
|
|
15
|
+
export declare function Callout({ children, severity }: CalloutProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import styles from './Callout.module.css';
|
|
3
|
+
|
|
4
|
+
function Callout({ children, severity = "neutral" }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { className: `${styles.callout} ${styles[severity]}`, children });
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { Callout };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.callout {
|
|
2
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
3
|
+
border-inline-start: var(--border-width-thick) solid var(--callout-accent);
|
|
4
|
+
border-radius: var(--border-radius-default);
|
|
5
|
+
background: var(--callout-bg);
|
|
6
|
+
color: var(--color-fg-default);
|
|
7
|
+
font-size: var(--font-size-sm);
|
|
8
|
+
overflow-wrap: anywhere;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.neutral {
|
|
12
|
+
--callout-accent: var(--color-border-strong);
|
|
13
|
+
--callout-bg: var(--color-bg-surface-subtle);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.success {
|
|
17
|
+
--callout-accent: var(--color-status-success);
|
|
18
|
+
--callout-bg: color-mix(in srgb, var(--color-status-success) 8%, var(--color-bg-surface));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.warning {
|
|
22
|
+
--callout-accent: var(--color-status-warning);
|
|
23
|
+
--callout-bg: color-mix(in srgb, var(--color-status-warning) 8%, var(--color-bg-surface));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.error {
|
|
27
|
+
--callout-accent: var(--color-status-error);
|
|
28
|
+
--callout-bg: color-mix(in srgb, var(--color-status-error) 8%, var(--color-bg-surface));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.info {
|
|
32
|
+
--callout-accent: var(--color-status-info);
|
|
33
|
+
--callout-bg: color-mix(in srgb, var(--color-status-info) 8%, var(--color-bg-surface));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.brand {
|
|
37
|
+
--callout-accent: var(--color-brand);
|
|
38
|
+
--callout-bg: color-mix(in srgb, var(--color-brand) 8%, var(--color-bg-surface));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.accent {
|
|
42
|
+
--callout-accent: var(--color-accent);
|
|
43
|
+
--callout-bg: color-mix(in srgb, var(--color-accent) 8%, var(--color-bg-surface));
|
|
44
|
+
}
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
pointer-events: auto;
|
|
474
474
|
}
|
|
475
475
|
|
|
476
|
-
/* Error: wins over variant and
|
|
476
|
+
/* Error: wins over the variant's own border, hover and focus colours */
|
|
477
477
|
.field.invalid,
|
|
478
478
|
.field.invalid:hover:not([aria-disabled='true']) {
|
|
479
479
|
border-color: var(--color-status-error);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
background-color: var(--color-bg-toolbar-hover);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
/* Error
|
|
10
|
+
/* Error (the attribute raises specificity above Button's own border styles) */
|
|
11
11
|
.triggerInvalid[data-forminput],
|
|
12
12
|
.triggerInvalid[data-forminput]:hover:not([disabled]) {
|
|
13
13
|
border-color: var(--color-status-error);
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
.container {
|
|
2
|
-
--inline-status-bg: var(--color-bg-toolbar);
|
|
3
|
-
--inline-status-fg: var(--color-fg-default);
|
|
4
|
-
--inline-status-border: var(--color-border-subtle);
|
|
5
|
-
|
|
6
2
|
display: inline-flex;
|
|
7
3
|
align-items: flex-start;
|
|
8
4
|
gap: var(--spacing-xs);
|
|
9
5
|
max-inline-size: 100%;
|
|
10
6
|
|
|
11
7
|
padding: var(--spacing-2xs) var(--spacing-sm);
|
|
12
|
-
border:
|
|
8
|
+
border: var(--border-width-thin) solid
|
|
9
|
+
color-mix(in srgb, var(--inline-status-accent) 25%, var(--color-border-default));
|
|
13
10
|
border-radius: var(--border-radius-default);
|
|
14
|
-
background: var(--inline-status-bg);
|
|
15
|
-
color: var(--
|
|
11
|
+
background: color-mix(in srgb, var(--inline-status-accent) 4%, var(--color-bg-surface));
|
|
12
|
+
color: var(--color-fg-default);
|
|
16
13
|
|
|
17
14
|
font-family: var(--font-family);
|
|
18
15
|
font-size: var(--font-size-sm);
|
|
@@ -56,43 +53,35 @@
|
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
.neutral {
|
|
59
|
-
--inline-status-
|
|
60
|
-
|
|
61
|
-
--inline-status-border: transparent;
|
|
56
|
+
--inline-status-accent: var(--color-border-default);
|
|
57
|
+
background: var(--color-bg-surface-subtle);
|
|
62
58
|
}
|
|
63
59
|
|
|
64
60
|
.success {
|
|
65
|
-
--inline-status-
|
|
66
|
-
--inline-status-fg: var(--color-status-success-fg);
|
|
67
|
-
--inline-status-border: var(--color-status-success-border);
|
|
61
|
+
--inline-status-accent: var(--color-status-success);
|
|
68
62
|
}
|
|
69
63
|
|
|
70
64
|
.warning {
|
|
71
|
-
--inline-status-
|
|
72
|
-
--inline-status-fg: var(--color-status-warning-fg);
|
|
73
|
-
--inline-status-border: var(--color-status-warning-border);
|
|
65
|
+
--inline-status-accent: var(--color-status-warning);
|
|
74
66
|
}
|
|
75
67
|
|
|
76
68
|
.error {
|
|
77
|
-
--inline-status-
|
|
78
|
-
--inline-status-fg: var(--color-status-error-fg);
|
|
79
|
-
--inline-status-border: var(--color-status-error-border);
|
|
69
|
+
--inline-status-accent: var(--color-status-error);
|
|
80
70
|
}
|
|
81
71
|
|
|
82
72
|
.info {
|
|
83
|
-
--inline-status-
|
|
84
|
-
--inline-status-fg: var(--color-status-info-fg);
|
|
85
|
-
--inline-status-border: var(--color-status-info-border);
|
|
73
|
+
--inline-status-accent: var(--color-status-info);
|
|
86
74
|
}
|
|
87
75
|
|
|
88
76
|
.brand {
|
|
89
|
-
--inline-status-
|
|
90
|
-
--inline-status-fg: var(--color-brand);
|
|
91
|
-
--inline-status-border: color-mix(in srgb, var(--color-brand) 35%, transparent);
|
|
77
|
+
--inline-status-accent: var(--color-brand);
|
|
92
78
|
}
|
|
93
79
|
|
|
94
80
|
.accent {
|
|
95
|
-
--inline-status-
|
|
96
|
-
|
|
97
|
-
|
|
81
|
+
--inline-status-accent: var(--color-accent);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* The shared brand icon uses an on-brand colour; keep it visible on the faint tint. */
|
|
85
|
+
.brand .leading svg {
|
|
86
|
+
color: var(--color-brand);
|
|
98
87
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -41,6 +41,7 @@ var Toast = require('./components/toast/Toast');
|
|
|
41
41
|
var Hyperlink = require('./components/hyperlink/Hyperlink');
|
|
42
42
|
var StatePage = require('./components/state-page/StatePage');
|
|
43
43
|
var Alert = require('./components/alert/Alert');
|
|
44
|
+
var Callout = require('./components/callout/Callout');
|
|
44
45
|
var InlineStatus = require('./components/inline-status/InlineStatus');
|
|
45
46
|
var MediaCard = require('./components/media-card/MediaCard');
|
|
46
47
|
var HighlightedText = require('./components/highlighted-text/HighlightedText');
|
|
@@ -299,6 +300,12 @@ Object.keys(Alert).forEach(function (k) {
|
|
|
299
300
|
get: function () { return Alert[k]; }
|
|
300
301
|
});
|
|
301
302
|
});
|
|
303
|
+
Object.keys(Callout).forEach(function (k) {
|
|
304
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
305
|
+
enumerable: true,
|
|
306
|
+
get: function () { return Callout[k]; }
|
|
307
|
+
});
|
|
308
|
+
});
|
|
302
309
|
Object.keys(InlineStatus).forEach(function (k) {
|
|
303
310
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
304
311
|
enumerable: true,
|
package/dist/index.css
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
@import './components/breadcrumbs/Breadcrumbs.module.css';
|
|
11
11
|
@import './components/button-select/ButtonSelect.module.css';
|
|
12
12
|
@import './components/button/Button.module.css';
|
|
13
|
+
@import './components/callout/Callout.module.css';
|
|
13
14
|
@import './components/card-container/CardContainer.module.css';
|
|
14
15
|
@import './components/card/Card.module.css';
|
|
15
16
|
@import './components/card/components/CardMeta.module.css';
|
package/dist/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export * from './components/toast/Toast';
|
|
|
40
40
|
export * from './components/hyperlink/Hyperlink';
|
|
41
41
|
export * from './components/state-page/StatePage';
|
|
42
42
|
export * from './components/alert/Alert';
|
|
43
|
+
export * from './components/callout/Callout';
|
|
43
44
|
export * from './components/inline-status/InlineStatus';
|
|
44
45
|
export * from './components/media-card/MediaCard';
|
|
45
46
|
export * from './components/highlighted-text/HighlightedText';
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,7 @@ export * from './components/toast/Toast';
|
|
|
39
39
|
export * from './components/hyperlink/Hyperlink';
|
|
40
40
|
export * from './components/state-page/StatePage';
|
|
41
41
|
export * from './components/alert/Alert';
|
|
42
|
+
export * from './components/callout/Callout';
|
|
42
43
|
export * from './components/inline-status/InlineStatus';
|
|
43
44
|
export * from './components/media-card/MediaCard';
|
|
44
45
|
export * from './components/highlighted-text/HighlightedText';
|
package/dist/styles/styles.css
CHANGED
|
@@ -251,10 +251,18 @@ tr.dbc-table--hover:hover td:last-child {
|
|
|
251
251
|
color: var(--color-fg-subtle);
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
.dbc-default-text {
|
|
255
|
+
color: var(--color-fg-default);
|
|
256
|
+
}
|
|
257
|
+
|
|
254
258
|
.dbc-tabular-nums {
|
|
255
259
|
font-variant-numeric: tabular-nums;
|
|
256
260
|
}
|
|
257
261
|
|
|
262
|
+
.dbc-xs-text {
|
|
263
|
+
font-size: var(--font-size-xs);
|
|
264
|
+
}
|
|
265
|
+
|
|
258
266
|
.dbc-sm-text {
|
|
259
267
|
font-size: var(--font-size-sm);
|
|
260
268
|
}
|