@dbcdk/react-components 0.0.188 → 0.0.190

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.
Files changed (59) hide show
  1. package/dist/components/accordion/Accordion.cjs +4 -8
  2. package/dist/components/accordion/Accordion.d.ts +1 -1
  3. package/dist/components/accordion/Accordion.js +4 -8
  4. package/dist/components/accordion/Accordion.module.css +55 -6
  5. package/dist/components/accordion/components/AccordionRow.cjs +2 -2
  6. package/dist/components/accordion/components/AccordionRow.d.ts +2 -2
  7. package/dist/components/accordion/components/AccordionRow.js +2 -2
  8. package/dist/components/accordion/components/AccordionRow.module.css +24 -2
  9. package/dist/components/badge/Badge.module.css +11 -11
  10. package/dist/components/breadcrumbs/Breadcrumbs.cjs +10 -7
  11. package/dist/components/breadcrumbs/Breadcrumbs.js +10 -7
  12. package/dist/components/breadcrumbs/Breadcrumbs.module.css +1 -5
  13. package/dist/components/button/Button.module.css +4 -2
  14. package/dist/components/chip/Chip.module.css +15 -1
  15. package/dist/components/circle/Circle.module.css +4 -0
  16. package/dist/components/forms/input/Input.module.css +2 -1
  17. package/dist/components/forms/input-container/InputContainer.cjs +11 -4
  18. package/dist/components/forms/input-container/InputContainer.d.ts +4 -4
  19. package/dist/components/forms/input-container/InputContainer.js +11 -4
  20. package/dist/components/forms/text-area/Textarea.cjs +2 -1
  21. package/dist/components/forms/text-area/Textarea.js +2 -1
  22. package/dist/components/metric-tile/MetricTile.cjs +25 -0
  23. package/dist/components/metric-tile/MetricTile.d.ts +1 -0
  24. package/dist/components/metric-tile/MetricTile.js +25 -0
  25. package/dist/components/metric-tile/MetricTile.module.css +8 -0
  26. package/dist/components/nav-bar/NavBar.d.ts +1 -0
  27. package/dist/components/overlay/tooltip/TooltipProvider.cjs +9 -5
  28. package/dist/components/overlay/tooltip/TooltipProvider.js +9 -5
  29. package/dist/components/page-layout/PageLayout.module.css +8 -1
  30. package/dist/components/sidebar/components/SidebarItem.cjs +2 -0
  31. package/dist/components/sidebar/components/SidebarItem.d.ts +2 -1
  32. package/dist/components/sidebar/components/SidebarItem.js +2 -0
  33. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +4 -0
  34. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts +2 -1
  35. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +4 -0
  36. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +6 -1
  37. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.d.ts +2 -1
  38. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +6 -1
  39. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +14 -0
  40. package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +13 -2
  41. package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +13 -2
  42. package/dist/components/table/Table.cjs +1 -0
  43. package/dist/components/table/Table.js +1 -0
  44. package/dist/components/table/Table.module.css +8 -5
  45. package/dist/components/table/Table.types.d.ts +1 -0
  46. package/dist/components/table/components/TableHeader.cjs +2 -0
  47. package/dist/components/table/components/TableHeader.d.ts +2 -1
  48. package/dist/components/table/components/TableHeader.js +2 -0
  49. package/dist/components/table/components/TableHeaderCell.cjs +3 -2
  50. package/dist/components/table/components/TableHeaderCell.d.ts +2 -1
  51. package/dist/components/table/components/TableHeaderCell.js +4 -3
  52. package/dist/components/table/components/TableRow.cjs +1 -0
  53. package/dist/components/table/components/TableRow.js +1 -0
  54. package/dist/components/table/tanstackTable.utils.cjs +3 -2
  55. package/dist/components/table/tanstackTable.utils.js +3 -2
  56. package/dist/components/tabs/Tabs.module.css +34 -6
  57. package/dist/styles/styles.css +39 -3
  58. package/dist/styles.css +39 -3
  59. package/package.json +1 -1
@@ -23,7 +23,7 @@ function Accordion({
23
23
  items,
24
24
  mode = "single",
25
25
  size = "md",
26
- variant = "default",
26
+ variant = "filled",
27
27
  renderMode = "lazy",
28
28
  defaultOpenIndex = null,
29
29
  defaultOpenIndexes = [],
@@ -35,6 +35,7 @@ function Accordion({
35
35
  ...rest
36
36
  }) {
37
37
  const uid = react.useId();
38
+ const resolvedVariant = variant === "default" ? "filled" : variant;
38
39
  const isControlled = mode === "single" ? openIndex !== void 0 : openIndexes !== void 0;
39
40
  const [hasMounted, setHasMounted] = react.useState(false);
40
41
  react.useEffect(() => {
@@ -96,12 +97,7 @@ function Accordion({
96
97
  "div",
97
98
  {
98
99
  ...rest,
99
- className: [
100
- styles__default.default.container,
101
- styles__default.default[size],
102
- variant !== "default" ? styles__default.default[variant] : "",
103
- className
104
- ].filter(Boolean).join(" "),
100
+ className: [styles__default.default.container, styles__default.default[size], styles__default.default[resolvedVariant], className].filter(Boolean).join(" "),
105
101
  children: items.map((item, i) => {
106
102
  var _a;
107
103
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -114,7 +110,7 @@ function Accordion({
114
110
  onToggle: toggle,
115
111
  shouldAnimate: hasMounted,
116
112
  headlineSize: size === "sm" ? 4 : 3,
117
- variant,
113
+ variant: resolvedVariant,
118
114
  renderMode
119
115
  },
120
116
  (_a = item.id) != null ? _a : i
@@ -13,7 +13,7 @@ export interface AccordionItem {
13
13
  }
14
14
  type Size = 'sm' | 'md' | 'lg';
15
15
  type Mode = 'single' | 'multiple';
16
- type Variant = 'default' | 'outlined';
16
+ type Variant = 'filled' | 'outlined' | 'default';
17
17
  type OpenIndexes = number[] | 'all';
18
18
  type RenderMode = 'lazy' | 'eager';
19
19
  export interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
@@ -17,7 +17,7 @@ function Accordion({
17
17
  items,
18
18
  mode = "single",
19
19
  size = "md",
20
- variant = "default",
20
+ variant = "filled",
21
21
  renderMode = "lazy",
22
22
  defaultOpenIndex = null,
23
23
  defaultOpenIndexes = [],
@@ -29,6 +29,7 @@ function Accordion({
29
29
  ...rest
30
30
  }) {
31
31
  const uid = useId();
32
+ const resolvedVariant = variant === "default" ? "filled" : variant;
32
33
  const isControlled = mode === "single" ? openIndex !== void 0 : openIndexes !== void 0;
33
34
  const [hasMounted, setHasMounted] = useState(false);
34
35
  useEffect(() => {
@@ -90,12 +91,7 @@ function Accordion({
90
91
  "div",
91
92
  {
92
93
  ...rest,
93
- className: [
94
- styles.container,
95
- styles[size],
96
- variant !== "default" ? styles[variant] : "",
97
- className
98
- ].filter(Boolean).join(" "),
94
+ className: [styles.container, styles[size], styles[resolvedVariant], className].filter(Boolean).join(" "),
99
95
  children: items.map((item, i) => {
100
96
  var _a;
101
97
  return /* @__PURE__ */ jsx(
@@ -108,7 +104,7 @@ function Accordion({
108
104
  onToggle: toggle,
109
105
  shouldAnimate: hasMounted,
110
106
  headlineSize: size === "sm" ? 4 : 3,
111
- variant,
107
+ variant: resolvedVariant,
112
108
  renderMode
113
109
  },
114
110
  (_a = item.id) != null ? _a : i
@@ -1,41 +1,90 @@
1
1
  .container {
2
2
  border-radius: var(--border-radius-default);
3
- background-color: var(--color-bg-surface);
3
+ background-color: transparent;
4
4
  box-sizing: border-box;
5
5
  display: flex;
6
6
  flex-direction: column;
7
7
  overflow: hidden;
8
- gap: var(--spacing-xs);
8
+ gap: 0;
9
+ }
10
+
11
+ .filled {
12
+ --acc-item-bg: transparent;
13
+ --acc-trigger-bg: color-mix(
14
+ in srgb,
15
+ var(--color-bg-contextual-subtle) 66%,
16
+ var(--color-bg-surface)
17
+ );
18
+ --acc-trigger-bg-hover: color-mix(
19
+ in srgb,
20
+ var(--color-bg-contextual-subtle) 74%,
21
+ var(--color-bg-surface)
22
+ );
23
+ --acc-content-bg: var(--color-bg-surface);
24
+ --acc-item-separator: none;
25
+ --acc-item-gap: calc((var(--spacing-xxs) + var(--spacing-xs)) / 2);
26
+ --acc-item-radius: var(--border-radius-sm);
27
+ --acc-content-px: var(--acc-trigger-px);
28
+ --acc-content-open-pt: var(--spacing-2xs);
9
29
  }
10
30
 
11
31
  .outlined {
12
- background-color: transparent;
32
+ background-color: var(--color-bg-surface);
13
33
  border: 1px solid var(--color-border-subtle);
14
34
  border-radius: var(--border-radius-md);
15
35
  gap: 0;
36
+ --acc-item-bg: transparent;
37
+ --acc-content-bg: transparent;
38
+ --acc-item-gap: 0;
39
+ --acc-item-radius: 0;
16
40
  --acc-trigger-bg: transparent;
41
+ --acc-trigger-bg-hover: transparent;
17
42
  --acc-content-px: var(--acc-trigger-px);
18
43
  --acc-item-separator: 1px solid var(--color-border-subtle);
19
44
  }
20
45
 
21
46
  /* Size variables (consumed by AccordionRow) */
22
47
  .sm {
23
- --acc-trigger-py: var(--spacing-xs);
48
+ --acc-trigger-py: var(--spacing-xxs);
24
49
  --acc-trigger-px: var(--spacing-sm);
25
50
  --acc-content-py: var(--spacing-sm);
26
51
  --acc-font-size: var(--font-size-sm);
27
52
  }
28
53
 
29
54
  .md {
30
- --acc-trigger-py: var(--spacing-sm);
55
+ --acc-trigger-py: var(--spacing-xs);
31
56
  --acc-trigger-px: var(--spacing-md);
32
57
  --acc-content-py: var(--spacing-md);
33
58
  --acc-font-size: var(--font-size-md);
34
59
  }
35
60
 
36
61
  .lg {
37
- --acc-trigger-py: var(--spacing-md);
62
+ --acc-trigger-py: var(--spacing-sm);
38
63
  --acc-trigger-px: var(--spacing-md);
39
64
  --acc-content-py: var(--spacing-md);
40
65
  --acc-font-size: var(--font-size-md);
41
66
  }
67
+
68
+ .filled.sm {
69
+ --acc-trigger-py: var(--spacing-2xs);
70
+ }
71
+
72
+ .filled.md {
73
+ --acc-trigger-py: calc((var(--spacing-xs) + var(--spacing-xxs)) / 2);
74
+ }
75
+
76
+ .filled.lg {
77
+ --acc-trigger-py: calc((var(--spacing-sm) + var(--spacing-xs)) / 2);
78
+ }
79
+
80
+ .outlined.sm {
81
+ --acc-trigger-py: var(--spacing-xs);
82
+ }
83
+
84
+ .outlined.md {
85
+ --acc-trigger-py: var(--spacing-sm);
86
+ }
87
+
88
+ .outlined.lg {
89
+ --acc-trigger-py: var(--spacing-md);
90
+ }
@@ -19,11 +19,11 @@ function AccordionRow({
19
19
  onToggle,
20
20
  shouldAnimate = true,
21
21
  headlineSize = 4,
22
- variant = "default",
22
+ variant: _variant = "filled",
23
23
  renderMode = "lazy"
24
24
  }) {
25
25
  const isDisabled = !!item.disabled;
26
- const headlineWeight = variant === "outlined" ? 400 : 500;
26
+ const headlineWeight = 400;
27
27
  const buttonId = `${uid}-acc-btn-${index}`;
28
28
  const panelId = `${uid}-acc-panel-${index}`;
29
29
  const { innerRef, height, onTransitionEnd } = useCollapsibleHeight.useCollapsibleHeight(isOpen, shouldAnimate);
@@ -8,7 +8,7 @@ export type AccordionRowProps = {
8
8
  onToggle: (index: number) => void;
9
9
  shouldAnimate?: boolean;
10
10
  headlineSize?: 1 | 2 | 3 | 4 | 5 | 6;
11
- variant?: 'default' | 'outlined';
11
+ variant?: 'filled' | 'outlined' | 'default';
12
12
  renderMode?: 'lazy' | 'eager';
13
13
  };
14
- export declare function AccordionRow({ uid, index, item, isOpen, onToggle, shouldAnimate, headlineSize, variant, renderMode, }: AccordionRowProps): JSX.Element;
14
+ export declare function AccordionRow({ uid, index, item, isOpen, onToggle, shouldAnimate, headlineSize, variant: _variant, renderMode, }: AccordionRowProps): JSX.Element;
@@ -13,11 +13,11 @@ function AccordionRow({
13
13
  onToggle,
14
14
  shouldAnimate = true,
15
15
  headlineSize = 4,
16
- variant = "default",
16
+ variant: _variant = "filled",
17
17
  renderMode = "lazy"
18
18
  }) {
19
19
  const isDisabled = !!item.disabled;
20
- const headlineWeight = variant === "outlined" ? 400 : 500;
20
+ const headlineWeight = 400;
21
21
  const buttonId = `${uid}-acc-btn-${index}`;
22
22
  const panelId = `${uid}-acc-panel-${index}`;
23
23
  const { innerRef, height, onTransitionEnd } = useCollapsibleHeight(isOpen, shouldAnimate);
@@ -5,6 +5,15 @@
5
5
  background: var(--acc-trigger-bg, var(--color-bg-contextual-subtle));
6
6
  }
7
7
 
8
+ .item:not(.disabled):hover .headerRow {
9
+ background: var(--acc-trigger-bg-hover, var(--acc-trigger-bg, var(--color-bg-contextual-subtle)));
10
+ }
11
+
12
+ .item:not(.disabled):hover .title,
13
+ .item:not(.disabled):hover .chevron {
14
+ color: var(--color-fg-default);
15
+ }
16
+
8
17
  .trigger {
9
18
  all: unset;
10
19
  box-sizing: border-box;
@@ -75,9 +84,10 @@
75
84
  }
76
85
 
77
86
  .chevron {
78
- width: var(--icon-size-md);
79
- height: var(--icon-size-md);
87
+ width: var(--icon-size-sm);
88
+ height: var(--icon-size-sm);
80
89
  flex: 0 0 auto;
90
+ color: var(--color-fg-muted);
81
91
  transition: transform var(--transition-normal) var(--ease-standard);
82
92
  }
83
93
 
@@ -108,12 +118,24 @@
108
118
 
109
119
  .content {
110
120
  padding: var(--acc-content-py) var(--acc-content-px, 0);
121
+ background: var(--acc-content-bg, transparent);
122
+ }
123
+
124
+ .item[data-state='open'] .content {
125
+ padding-top: var(--acc-content-open-pt, var(--acc-content-py));
111
126
  }
112
127
 
113
128
  .item {
129
+ background: var(--acc-item-bg, transparent);
130
+ border-radius: var(--acc-item-radius, 0);
131
+ overflow: hidden;
114
132
  border-bottom: var(--acc-item-separator, none);
115
133
  }
116
134
 
135
+ .item + .item {
136
+ margin-top: var(--acc-item-gap, 0);
137
+ }
138
+
117
139
  :global(.outlined) .item[data-state='open'] .headerRow {
118
140
  box-shadow: inset 3px 0 0 var(--color-border-selected);
119
141
  }
@@ -4,22 +4,22 @@
4
4
  }
5
5
 
6
6
  .badge {
7
- position: absolute;
8
- top: 0;
9
- right: 0;
10
- transform: translate(50%, -50%);
11
- display: inline-flex;
12
- align-items: center;
13
- justify-content: center;
14
7
  box-sizing: border-box;
15
- min-inline-size: 16px;
16
- block-size: 16px;
8
+ block-size: 14px;
9
+ min-inline-size: 14px;
17
10
  padding-inline: var(--spacing-2xs);
18
11
  border-radius: var(--border-radius-rounded);
19
- font-size: var(--font-size-xs);
20
- line-height: 1;
12
+ font-size: 12px;
21
13
  color: var(--color-fg-inverse);
22
14
  pointer-events: none;
15
+ justify-content: center;
16
+ align-items: center;
17
+ line-height: 1;
18
+ display: inline-flex;
19
+ position: absolute;
20
+ top: 0;
21
+ right: 0;
22
+ transform: translate(50%, -30%);
23
23
  }
24
24
 
25
25
  .badge[data-dot='true'] {
@@ -12,13 +12,16 @@ function Breadcrumbs({
12
12
  items,
13
13
  ...navProps
14
14
  }) {
15
- return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: styles__default.default.breadcrumbs, "aria-label": "breadcrumb", ...navProps, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
16
- /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
17
- item.icon && item.icon,
18
- item.onClick ? /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: item.onClick, children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
19
- ] }),
20
- index < items.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.separator, children: "/" })
21
- ] }, `breadcrumbItem-${item.label}-${index}`)) }) });
15
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: styles__default.default.breadcrumbs, "aria-label": "breadcrumb", ...navProps, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { children: items.map((item, index) => {
16
+ const isCurrent = index === items.length - 1;
17
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
18
+ /* @__PURE__ */ jsxRuntime.jsxs("li", { "aria-current": isCurrent ? "page" : void 0, children: [
19
+ item.icon && item.icon,
20
+ item.onClick ? /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: item.onClick, children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
21
+ ] }),
22
+ index < items.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.separator, children: "/" })
23
+ ] }, `breadcrumbItem-${item.label}-${index}`);
24
+ }) }) });
22
25
  }
23
26
 
24
27
  exports.Breadcrumbs = Breadcrumbs;
@@ -6,13 +6,16 @@ function Breadcrumbs({
6
6
  items,
7
7
  ...navProps
8
8
  }) {
9
- return /* @__PURE__ */ jsx("nav", { className: styles.breadcrumbs, "aria-label": "breadcrumb", ...navProps, children: /* @__PURE__ */ jsx("ul", { children: items.map((item, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
10
- /* @__PURE__ */ jsxs("li", { children: [
11
- item.icon && item.icon,
12
- item.onClick ? /* @__PURE__ */ jsx("button", { onClick: item.onClick, children: item.label }) : /* @__PURE__ */ jsx("span", { children: item.label })
13
- ] }),
14
- index < items.length - 1 && /* @__PURE__ */ jsx("span", { className: styles.separator, children: "/" })
15
- ] }, `breadcrumbItem-${item.label}-${index}`)) }) });
9
+ return /* @__PURE__ */ jsx("nav", { className: styles.breadcrumbs, "aria-label": "breadcrumb", ...navProps, children: /* @__PURE__ */ jsx("ul", { children: items.map((item, index) => {
10
+ const isCurrent = index === items.length - 1;
11
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
12
+ /* @__PURE__ */ jsxs("li", { "aria-current": isCurrent ? "page" : void 0, children: [
13
+ item.icon && item.icon,
14
+ item.onClick ? /* @__PURE__ */ jsx("button", { onClick: item.onClick, children: item.label }) : /* @__PURE__ */ jsx("span", { children: item.label })
15
+ ] }),
16
+ index < items.length - 1 && /* @__PURE__ */ jsx("span", { className: styles.separator, children: "/" })
17
+ ] }, `breadcrumbItem-${item.label}-${index}`);
18
+ }) }) });
16
19
  }
17
20
 
18
21
  export { Breadcrumbs };
@@ -34,12 +34,8 @@
34
34
  .breadcrumbs li[aria-current='page'],
35
35
  .breadcrumbs li:last-of-type {
36
36
  color: var(--color-fg-default);
37
- cursor: default;
38
- }
39
-
40
- .breadcrumbs li[aria-current='page'] button,
41
- .breadcrumbs li:last-of-type button {
42
37
  font-weight: var(--font-weight-medium);
38
+ cursor: default;
43
39
  }
44
40
 
45
41
  .separator {
@@ -259,7 +259,8 @@
259
259
  }
260
260
 
261
261
  .header:hover {
262
- background-color: color-mix(in srgb, var(--color-navbar-fg) 12%, transparent);
262
+ background-color: transparent;
263
+ border-color: var(--color-navbar-fg);
263
264
  }
264
265
 
265
266
  .header:focus-visible {
@@ -275,7 +276,8 @@
275
276
  }
276
277
 
277
278
  .header.active:hover {
278
- background-color: color-mix(in srgb, var(--color-navbar-fg) 22%, transparent);
279
+ background-color: color-mix(in srgb, var(--color-navbar-fg) 16%, transparent);
280
+ border-color: var(--color-navbar-fg);
279
281
  }
280
282
 
281
283
  .button.xs {
@@ -24,6 +24,10 @@
24
24
  transform var(--transition-fast) var(--ease-standard);
25
25
  }
26
26
 
27
+ .hasClose {
28
+ gap: var(--spacing-2xs);
29
+ }
30
+
27
31
  .container:focus-visible {
28
32
  outline: none;
29
33
  }
@@ -93,6 +97,7 @@
93
97
  .sm {
94
98
  height: var(--component-size-xs);
95
99
  font-size: var(--font-size-xs);
100
+ padding-inline: var(--spacing-xs);
96
101
  }
97
102
 
98
103
  .md {
@@ -109,7 +114,7 @@
109
114
  .neutral {
110
115
  /* Tinted from the current foreground color instead of a fixed gray, so it
111
116
  stays visible whether it's sitting on a white panel or a muted toolbar. */
112
- --chip-bg: color-mix(in srgb, var(--color-fg-default) 12%, transparent);
117
+ --chip-bg: color-mix(in srgb, var(--color-fg-default) 8%, transparent);
113
118
  --chip-fg: var(--color-fg-default);
114
119
  --chip-border: transparent;
115
120
  --chip-outlined-border: var(--color-border-subtle);
@@ -119,6 +124,15 @@
119
124
  box-shadow: none;
120
125
  }
121
126
 
127
+ .neutral .close {
128
+ color: var(--color-fg-subtle);
129
+ }
130
+
131
+ .neutral .close:hover,
132
+ .neutral .close:focus-visible {
133
+ color: var(--color-fg-default);
134
+ }
135
+
122
136
  .success {
123
137
  --chip-bg: var(--color-status-success-bg);
124
138
  --chip-fg: var(--color-status-success-fg);
@@ -14,6 +14,10 @@
14
14
  font-size: var(--font-size-xs);
15
15
  }
16
16
 
17
+ .container[data-size='xs'] {
18
+ gap: var(--spacing-xxs);
19
+ }
20
+
17
21
  .circle {
18
22
  position: relative;
19
23
  display: inline-block;
@@ -191,7 +191,8 @@
191
191
  }
192
192
 
193
193
  .header:hover:not([aria-disabled='true']) {
194
- background-color: color-mix(in srgb, var(--color-navbar-fg) 8%, transparent);
194
+ background-color: transparent;
195
+ border-color: var(--color-navbar-fg);
195
196
  }
196
197
 
197
198
  .header:focus-within:not([aria-disabled='true']) {
@@ -21,6 +21,7 @@ function InputContainer({
21
21
  orientation = "horizontal",
22
22
  size = "md",
23
23
  labelWidth = "160px",
24
+ labelAlignment = "center",
24
25
  modified = false
25
26
  }) {
26
27
  const renderLabelRow = (label || labelAction) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${styles__default.default.labelRow} dbc-flex dbc-items-center dbc-gap-md`, children: [
@@ -59,10 +60,16 @@ function InputContainer({
59
60
  width: fullWidth ? "100%" : void 0
60
61
  },
61
62
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${styles__default.default.horizontal} dbc-flex dbc-flex-column dbc-gap-xs`, "data-size": size, children: [
62
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${styles__default.default.labelContainer} dbc-flex dbc-items-center dbc-gap-xs`, children: [
63
- renderLabelRow,
64
- children
65
- ] }),
63
+ /* @__PURE__ */ jsxRuntime.jsxs(
64
+ "div",
65
+ {
66
+ className: `${styles__default.default.labelContainer} dbc-flex ${labelAlignment === "top" ? "dbc-items-start" : "dbc-items-center"} dbc-gap-xs`,
67
+ children: [
68
+ renderLabelRow,
69
+ children
70
+ ]
71
+ }
72
+ ),
66
73
  renderMessageRow
67
74
  ] })
68
75
  }
@@ -3,9 +3,9 @@ export interface InputContainerProps {
3
3
  label?: string;
4
4
  labelAction?: React.ReactNode;
5
5
  htmlFor?: string;
6
- error?: string;
7
- helpText?: string;
8
- helpTextAddition?: string;
6
+ error?: React.ReactNode;
7
+ helpText?: React.ReactNode;
8
+ helpTextAddition?: React.ReactNode;
9
9
  fullWidth?: boolean;
10
10
  required?: boolean;
11
11
  children: React.ReactNode;
@@ -15,4 +15,4 @@ export interface InputContainerProps {
15
15
  labelAlignment?: 'top' | 'center';
16
16
  modified?: boolean;
17
17
  }
18
- export declare function InputContainer({ label, labelAction, htmlFor, error, helpText, helpTextAddition, fullWidth, required, children, orientation, size, labelWidth, modified, }: InputContainerProps): React.ReactElement;
18
+ export declare function InputContainer({ label, labelAction, htmlFor, error, helpText, helpTextAddition, fullWidth, required, children, orientation, size, labelWidth, labelAlignment, modified, }: InputContainerProps): React.ReactElement;
@@ -15,6 +15,7 @@ function InputContainer({
15
15
  orientation = "horizontal",
16
16
  size = "md",
17
17
  labelWidth = "160px",
18
+ labelAlignment = "center",
18
19
  modified = false
19
20
  }) {
20
21
  const renderLabelRow = (label || labelAction) && /* @__PURE__ */ jsxs("div", { className: `${styles.labelRow} dbc-flex dbc-items-center dbc-gap-md`, children: [
@@ -53,10 +54,16 @@ function InputContainer({
53
54
  width: fullWidth ? "100%" : void 0
54
55
  },
55
56
  children: /* @__PURE__ */ jsxs("div", { className: `${styles.horizontal} dbc-flex dbc-flex-column dbc-gap-xs`, "data-size": size, children: [
56
- /* @__PURE__ */ jsxs("div", { className: `${styles.labelContainer} dbc-flex dbc-items-center dbc-gap-xs`, children: [
57
- renderLabelRow,
58
- children
59
- ] }),
57
+ /* @__PURE__ */ jsxs(
58
+ "div",
59
+ {
60
+ className: `${styles.labelContainer} dbc-flex ${labelAlignment === "top" ? "dbc-items-start" : "dbc-items-center"} dbc-gap-xs`,
61
+ children: [
62
+ renderLabelRow,
63
+ children
64
+ ]
65
+ }
66
+ ),
60
67
  renderMessageRow
61
68
  ] })
62
69
  }
@@ -28,6 +28,7 @@ const Textarea = function Textarea2({
28
28
  label,
29
29
  error,
30
30
  helpText,
31
+ helpTextAddition,
31
32
  orientation = "horizontal",
32
33
  labelWidth = "160px",
33
34
  fullWidth = false,
@@ -97,7 +98,7 @@ const Textarea = function Textarea2({
97
98
  htmlFor: textareaId,
98
99
  error,
99
100
  helpText,
100
- helpTextAddition: showCount ? `${value == null ? void 0 : value.length} tegn i denne boks` : void 0,
101
+ helpTextAddition: helpTextAddition != null ? helpTextAddition : showCount ? `${value == null ? void 0 : value.length} tegn i denne boks` : void 0,
101
102
  orientation,
102
103
  labelWidth,
103
104
  fullWidth,
@@ -22,6 +22,7 @@ const Textarea = function Textarea2({
22
22
  label,
23
23
  error,
24
24
  helpText,
25
+ helpTextAddition,
25
26
  orientation = "horizontal",
26
27
  labelWidth = "160px",
27
28
  fullWidth = false,
@@ -91,7 +92,7 @@ const Textarea = function Textarea2({
91
92
  htmlFor: textareaId,
92
93
  error,
93
94
  helpText,
94
- helpTextAddition: showCount ? `${value == null ? void 0 : value.length} tegn i denne boks` : void 0,
95
+ helpTextAddition: helpTextAddition != null ? helpTextAddition : showCount ? `${value == null ? void 0 : value.length} tegn i denne boks` : void 0,
95
96
  orientation,
96
97
  labelWidth,
97
98
  fullWidth,
@@ -51,6 +51,7 @@ const MetricTileBase = ({
51
51
  label,
52
52
  icon,
53
53
  value,
54
+ onClick,
54
55
  tooltip,
55
56
  size = "md",
56
57
  variant = "filled",
@@ -69,14 +70,38 @@ const MetricTileBase = ({
69
70
  const resolvedValue = (_b = (_a = slots.Value) == null ? void 0 : _a.props.children) != null ? _b : value;
70
71
  const resolvedAdornment = (_c = slots.Adornment) == null ? void 0 : _c.props.children;
71
72
  const showValueRow = resolvedValue != null || resolvedAdornment != null;
73
+ const isClickable = onClick != null;
74
+ const handleKeyDown = (event) => {
75
+ if (!isClickable) return;
76
+ if (event.key === "Enter") {
77
+ event.preventDefault();
78
+ onClick == null ? void 0 : onClick();
79
+ }
80
+ if (event.key === " ") {
81
+ event.preventDefault();
82
+ }
83
+ };
84
+ const handleKeyUp = (event) => {
85
+ if (!isClickable) return;
86
+ if (event.key === " ") {
87
+ event.preventDefault();
88
+ onClick == null ? void 0 : onClick();
89
+ }
90
+ };
72
91
  return /* @__PURE__ */ jsxRuntime.jsx(client.Tooltip, { content: tooltip, placement: "bottom", children: /* @__PURE__ */ jsxRuntime.jsxs(
73
92
  "span",
74
93
  {
75
94
  className: styles__default.default.tile,
95
+ role: isClickable ? "button" : void 0,
96
+ tabIndex: isClickable ? 0 : void 0,
76
97
  "data-severity": severity,
77
98
  "data-size": size,
78
99
  "data-variant": variant,
100
+ "data-clickable": isClickable ? "true" : void 0,
79
101
  style,
102
+ onClick,
103
+ onKeyDown: handleKeyDown,
104
+ onKeyUp: handleKeyUp,
80
105
  children: [
81
106
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.labelRow, children: [
82
107
  icon != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.icon, children: icon }) : null,
@@ -11,6 +11,7 @@ interface MetricTileProps extends PropsWithChildren {
11
11
  label: string;
12
12
  icon?: JSX.Element;
13
13
  value?: string | number;
14
+ onClick?: () => void;
14
15
  tooltip?: ReactNode;
15
16
  size?: MetricTileSize;
16
17
  variant?: MetricTileVariant;