@dbcdk/react-components 0.0.12 → 0.0.14

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 (76) hide show
  1. package/dist/components/accordion/Accordion.d.ts +2 -2
  2. package/dist/components/accordion/Accordion.js +34 -41
  3. package/dist/components/accordion/Accordion.module.css +13 -72
  4. package/dist/components/accordion/components/AccordionRow.d.ts +10 -0
  5. package/dist/components/accordion/components/AccordionRow.js +51 -0
  6. package/dist/components/accordion/components/AccordionRow.module.css +82 -0
  7. package/dist/components/breadcrumbs/Breadcrumbs.module.css +0 -1
  8. package/dist/components/button/Button.module.css +7 -7
  9. package/dist/components/card/Card.d.ts +9 -18
  10. package/dist/components/card/Card.js +34 -23
  11. package/dist/components/card/Card.module.css +22 -87
  12. package/dist/components/card/components/CardMeta.d.ts +15 -0
  13. package/dist/components/card/components/CardMeta.js +20 -0
  14. package/dist/components/card/components/CardMeta.module.css +51 -0
  15. package/dist/components/card-container/CardContainer.js +1 -1
  16. package/dist/components/card-container/CardContainer.module.css +3 -1
  17. package/dist/components/chip/Chip.module.css +7 -2
  18. package/dist/components/datetime-picker/DateTimePicker.d.ts +33 -8
  19. package/dist/components/datetime-picker/DateTimePicker.js +119 -78
  20. package/dist/components/datetime-picker/DateTimePicker.module.css +2 -0
  21. package/dist/components/datetime-picker/dateTimeHelpers.d.ts +15 -3
  22. package/dist/components/datetime-picker/dateTimeHelpers.js +137 -23
  23. package/dist/components/filter-field/FilterField.js +21 -6
  24. package/dist/components/filter-field/FilterField.module.css +5 -5
  25. package/dist/components/forms/form-select/FormSelect.d.ts +35 -0
  26. package/dist/components/forms/form-select/FormSelect.js +86 -0
  27. package/dist/components/forms/form-select/FormSelect.module.css +236 -0
  28. package/dist/components/forms/input/Input.d.ts +0 -3
  29. package/dist/components/forms/input/Input.js +0 -3
  30. package/dist/components/forms/input/Input.module.css +7 -7
  31. package/dist/components/forms/radio-buttons/RadioButtons.module.css +1 -0
  32. package/dist/components/forms/select/Select.js +55 -16
  33. package/dist/components/interval-select/IntervalSelect.d.ts +9 -2
  34. package/dist/components/interval-select/IntervalSelect.js +21 -6
  35. package/dist/components/menu/Menu.d.ts +11 -14
  36. package/dist/components/menu/Menu.js +18 -33
  37. package/dist/components/menu/Menu.module.css +2 -2
  38. package/dist/components/overlay/modal/Modal.module.css +2 -1
  39. package/dist/components/overlay/modal/provider/ModalProvider.js +1 -3
  40. package/dist/components/overlay/side-panel/SidePanel.js +1 -1
  41. package/dist/components/overlay/side-panel/SidePanel.module.css +1 -1
  42. package/dist/components/page-layout/PageLayout.d.ts +16 -4
  43. package/dist/components/page-layout/PageLayout.js +57 -28
  44. package/dist/components/page-layout/PageLayout.module.css +153 -33
  45. package/dist/components/popover/Popover.d.ts +17 -4
  46. package/dist/components/popover/Popover.js +147 -65
  47. package/dist/components/popover/Popover.module.css +5 -0
  48. package/dist/components/split-pane/SplitPane.d.ts +10 -24
  49. package/dist/components/split-pane/SplitPane.js +83 -54
  50. package/dist/components/split-pane/SplitPane.module.css +11 -6
  51. package/dist/components/split-pane/provider/SplitPaneContext.js +5 -11
  52. package/dist/components/sticky-footer-layout/StickyFooterLayout.d.ts +3 -8
  53. package/dist/components/sticky-footer-layout/StickyFooterLayout.js +57 -20
  54. package/dist/components/table/Table.d.ts +3 -8
  55. package/dist/components/table/Table.js +37 -76
  56. package/dist/components/table/Table.module.css +45 -42
  57. package/dist/components/table/{tanstack.d.ts → TanstackTable.d.ts} +5 -12
  58. package/dist/components/table/TanstackTable.js +84 -0
  59. package/dist/components/table/components/column-resizer/ColumnResizer.js +1 -1
  60. package/dist/components/table/components/column-resizer/ColumnResizer.module.css +17 -7
  61. package/dist/components/table/table.utils.d.ts +17 -0
  62. package/dist/components/table/table.utils.js +61 -0
  63. package/dist/components/table/tanstackTable.utils.d.ts +22 -0
  64. package/dist/components/table/tanstackTable.utils.js +104 -0
  65. package/dist/components/tabs/Tabs.d.ts +35 -12
  66. package/dist/components/tabs/Tabs.js +114 -26
  67. package/dist/components/tabs/Tabs.module.css +158 -71
  68. package/dist/index.d.ts +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/src/styles/styles.css +0 -1
  71. package/dist/styles/styles.css +0 -1
  72. package/dist/styles/themes/dbc/base.css +136 -0
  73. package/dist/styles/themes/dbc/dark.css +39 -202
  74. package/dist/styles/themes/dbc/light.css +17 -174
  75. package/package.json +4 -4
  76. package/dist/components/table/tanstack.js +0 -214
@@ -12,7 +12,6 @@
12
12
  border-radius: var(--border-radius-md);
13
13
  border: var(--border-width-thin) solid var(--color-border-subtle);
14
14
  box-shadow: var(--shadow-xs);
15
- padding-block: 0;
16
15
  transition:
17
16
  color var(--transition-fast) var(--ease-standard),
18
17
  box-shadow var(--transition-fast) var(--ease-standard),
@@ -24,33 +23,31 @@
24
23
  }
25
24
 
26
25
  /* BACKGROUND VARIANTS */
27
- .container.default {
26
+ .variantDefault {
28
27
  background-color: var(--card-bg-default, var(--color-bg-surface));
29
28
  }
30
29
 
31
- .container.subtle {
30
+ .variantSubtle {
32
31
  background-color: var(--card-bg-subtle, var(--color-bg-surface-subtle));
33
32
  }
34
33
 
35
- .container.strong {
34
+ .variantStrong {
36
35
  background-color: var(--card-bg-strong, var(--color-bg-surface-strong));
37
36
  color: var(--card-fg-on-strong, var(--color-fg-on-strong));
38
37
  }
39
38
 
40
- /* SIZE VARIANTS */
41
- .sm .inner {
42
- padding: var(--spacing-md);
43
- gap: var(--spacing-md);
39
+ /* SIZE VARIANTS (define vars once; inner uses them) */
40
+ .sm {
41
+ --card-pad: var(--spacing-md);
42
+ --card-gap: var(--spacing-md);
44
43
  }
45
-
46
- .md .inner {
47
- padding: var(--spacing-lg);
48
- gap: var(--spacing-lg);
44
+ .md {
45
+ --card-pad: var(--spacing-lg);
46
+ --card-gap: var(--spacing-lg);
49
47
  }
50
-
51
- .lg .inner {
52
- padding: var(--spacing-xl);
53
- gap: var(--spacing-xl);
48
+ .lg {
49
+ --card-pad: var(--spacing-xl);
50
+ --card-gap: var(--spacing-xl);
54
51
  }
55
52
 
56
53
  /* INNER LAYOUT */
@@ -58,6 +55,8 @@
58
55
  margin-inline: auto;
59
56
  display: flex;
60
57
  align-items: flex-start;
58
+ padding: var(--card-pad);
59
+ gap: var(--card-gap);
61
60
  }
62
61
 
63
62
  /* Media placement */
@@ -103,8 +102,8 @@
103
102
 
104
103
  /* CONTENT */
105
104
  .content {
106
- flex: 1 1 auto; /* important: allow content column to grow */
107
- min-inline-size: 0; /* prevents overflow in flex layouts */
105
+ flex: 1 1 auto;
106
+ min-inline-size: 0;
108
107
  display: flex;
109
108
  flex-direction: column;
110
109
  gap: var(--spacing-md);
@@ -118,11 +117,6 @@
118
117
  gap: var(--spacing-sm);
119
118
  }
120
119
 
121
- .value {
122
- font-weight: 600;
123
- white-space: nowrap;
124
- }
125
-
126
120
  .headerMeta {
127
121
  display: flex;
128
122
  align-items: center;
@@ -156,77 +150,18 @@
156
150
  }
157
151
 
158
152
  .sectionTitle {
159
- font-weight: 600;
153
+ font-weight: var(--font-weight-semibold);
160
154
  }
161
155
 
162
156
  /* BODY */
163
157
  .body {
164
- /* leave this as a neutral container; consumers render their own layout */
158
+ /* neutral container */
165
159
  }
166
160
 
167
- /* ACTIONS (bottom-right) */
161
+ /* ACTIONS */
168
162
  .actions {
169
- margin-top: auto; /* pushes actions to bottom of the content column */
163
+ margin-top: auto;
170
164
  display: flex;
171
- justify-content: flex-end; /* right-align buttons */
165
+ justify-content: flex-end;
172
166
  gap: var(--spacing-sm);
173
167
  }
174
-
175
- /* --- Meta grid primitives (optional) --- */
176
-
177
- .metaGrid {
178
- margin: 0;
179
- display: grid;
180
- gap: var(--spacing-xs) var(--spacing-lg);
181
- }
182
-
183
- .metaCols1 {
184
- grid-template-columns: 1fr;
185
- }
186
-
187
- .metaCols2 {
188
- grid-template-columns: 1fr;
189
- }
190
-
191
- .metaCols3 {
192
- grid-template-columns: 1fr;
193
- }
194
-
195
- @media (min-width: 640px) {
196
- .metaCols2 {
197
- grid-template-columns: 1fr 1fr;
198
- }
199
- .metaCols3 {
200
- grid-template-columns: 1fr 1fr 1fr;
201
- }
202
- }
203
-
204
- .metaRow {
205
- --label-width: 120px;
206
- display: grid;
207
- grid-template-columns: var(--label-width, auto) 1fr;
208
- gap: var(--spacing-xs);
209
- align-items: baseline;
210
- min-inline-size: 0;
211
- }
212
-
213
- .metaLabel {
214
- font-size: var(--font-size-xs);
215
- color: var(--color-fg-subtle);
216
- letter-spacing: var(--letter-spacing-wide);
217
- text-transform: uppercase;
218
- margin: 0;
219
- }
220
-
221
- .metaValue {
222
- margin: 0;
223
- font-size: var(--font-size-sm);
224
- color: var(--color-fg-default);
225
- font-weight: var(--font-weight-medium);
226
- min-inline-size: 0;
227
- word-break: break-word;
228
- }
229
-
230
- .metaNowrap {
231
- white-space: nowrap;
232
- }
@@ -0,0 +1,15 @@
1
+ import type { HTMLAttributes, JSX, ReactNode } from 'react';
2
+ export type CardMetaProps = {
3
+ columns?: 1 | 2 | 3;
4
+ className?: string;
5
+ children: ReactNode;
6
+ } & Omit<HTMLAttributes<HTMLDListElement>, 'children'>;
7
+ export type CardMetaRowProps = {
8
+ label: ReactNode;
9
+ value: ReactNode;
10
+ className?: string;
11
+ nowrapValue?: boolean;
12
+ labelWidth?: string;
13
+ };
14
+ export declare function CardMeta({ columns, className, children, ...rest }: CardMetaProps): JSX.Element;
15
+ export declare function CardMetaRow({ label, value, className, nowrapValue, labelWidth, }: CardMetaRowProps): JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import styles from './CardMeta.module.css';
3
+ function getColsClass(columns) {
4
+ switch (columns) {
5
+ case 1:
6
+ return styles.cols1;
7
+ case 3:
8
+ return styles.cols3;
9
+ case 2:
10
+ default:
11
+ return styles.cols2;
12
+ }
13
+ }
14
+ export function CardMeta({ columns = 2, className, children, ...rest }) {
15
+ const colsClass = getColsClass(columns);
16
+ return (_jsx("dl", { ...rest, className: [styles.grid, colsClass, className].filter(Boolean).join(' '), children: children }));
17
+ }
18
+ export function CardMetaRow({ label, value, className, nowrapValue, labelWidth, }) {
19
+ return (_jsxs("div", { className: [styles.row, className].filter(Boolean).join(' '), style: labelWidth ? { ['--label-width']: labelWidth } : undefined, children: [_jsx("dt", { className: styles.label, children: label }), _jsx("dd", { className: [styles.value, nowrapValue ? styles.nowrap : ''].filter(Boolean).join(' '), children: value })] }));
20
+ }
@@ -0,0 +1,51 @@
1
+ .grid {
2
+ margin: 0;
3
+ display: grid;
4
+ gap: var(--spacing-xs) var(--spacing-lg);
5
+ }
6
+
7
+ /* Base: single column */
8
+ .cols1,
9
+ .cols2,
10
+ .cols3 {
11
+ grid-template-columns: 1fr;
12
+ }
13
+
14
+ @media (min-width: 640px) {
15
+ .cols2 {
16
+ grid-template-columns: 1fr 1fr;
17
+ }
18
+ .cols3 {
19
+ grid-template-columns: 1fr 1fr 1fr;
20
+ }
21
+ }
22
+
23
+ .row {
24
+ --label-width: 120px;
25
+ display: grid;
26
+ grid-template-columns: var(--label-width) 1fr;
27
+ gap: var(--spacing-xs);
28
+ align-items: baseline;
29
+ min-inline-size: 0;
30
+ }
31
+
32
+ .label {
33
+ font-size: var(--font-size-xs);
34
+ color: var(--color-fg-subtle);
35
+ letter-spacing: var(--letter-spacing-wide);
36
+ text-transform: uppercase;
37
+ margin: 0;
38
+ }
39
+
40
+ .value {
41
+ margin: 0;
42
+ font-size: var(--font-size-sm);
43
+ color: var(--color-fg-default);
44
+ font-weight: var(--font-weight-medium);
45
+ min-inline-size: 0;
46
+ word-break: break-word;
47
+ }
48
+
49
+ .nowrap {
50
+ white-space: nowrap;
51
+ }
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Headline } from '../../components/headline/Headline';
3
3
  import styles from './CardContainer.module.css';
4
4
  export function CardContainer({ children, headline, expand, severity, displayHeaderMarker, }) {
5
- return (_jsxs("div", { className: styles.wrapper, children: [headline && (_jsx(Headline, { marker: displayHeaderMarker, severity: severity, children: headline })), _jsx("div", { className: styles.container, style: { ['--expand']: expand ? '1' : '0' }, children: children })] }));
5
+ return (_jsxs("div", { className: styles.wrapper, children: [headline && (_jsx(Headline, { marker: displayHeaderMarker, severity: severity, disableMargin: true, children: headline })), _jsx("div", { className: styles.container, style: { ['--expand']: expand ? '1' : '0' }, children: children })] }));
6
6
  }
@@ -1,5 +1,7 @@
1
1
  .wrapper {
2
- display: block;
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: var(--spacing-md);
3
5
  }
4
6
 
5
7
  .container {
@@ -11,7 +11,7 @@
11
11
  border-radius: var(--border-radius-default);
12
12
  border: var(--border-width-thin) solid transparent;
13
13
 
14
- padding-block: calc(var(--spacing-xxs) + var(--density));
14
+ padding-block: var(--spacing-xxs);
15
15
  padding-inline: var(--spacing-md);
16
16
 
17
17
  font-family: var(--font-family);
@@ -39,10 +39,15 @@
39
39
  block-size: var(--icon-size-md);
40
40
  }
41
41
 
42
+ .sm svg {
43
+ inline-size: var(--icon-size-sm);
44
+ block-size: var(--icon-size-sm);
45
+ }
46
+
42
47
  /* Small size */
43
48
  .sm {
44
49
  height: var(--component-size-xs);
45
- padding-block: calc(0px + var(--density));
50
+ padding-block: var(--spacing-xxs);
46
51
  padding-inline: var(--spacing-xs);
47
52
  font-size: var(--font-size-xs);
48
53
  }
@@ -1,17 +1,26 @@
1
1
  import React from 'react';
2
2
  import { Input } from '../../components/forms/input/Input';
3
- import { type UtcIsoString } from './dateTimeHelpers';
3
+ import { type DateOnlyString, type UtcIsoString } from './dateTimeHelpers';
4
4
  type Mode = 'single' | 'range';
5
5
  type WeekStart = 0 | 1;
6
- export type DateValue = UtcIsoString | null | {
7
- start: UtcIsoString | null;
8
- end: UtcIsoString | null;
6
+ /**
7
+ * Contract (recommended):
8
+ * - UI is always local time
9
+ *
10
+ * SINGLE:
11
+ * - enableTime=true => value is UtcIsoString | null (UTC instant in/out)
12
+ * - enableTime=false => value is DateOnlyString | null (calendar date in/out)
13
+ *
14
+ * RANGE:
15
+ * - always date-only in UI AND value: { start/end: DateOnlyString | null }
16
+ */
17
+ type RangeValue = {
18
+ start: DateOnlyString | null;
19
+ end: DateOnlyString | null;
9
20
  };
10
21
  type InputProps = React.ComponentProps<typeof Input>;
11
- export interface DateTimePickerProps {
22
+ type BaseProps = {
12
23
  mode?: Mode;
13
- value: DateValue;
14
- onChange: (next: DateValue) => void;
15
24
  enableTime?: boolean;
16
25
  timeStep?: number;
17
26
  min?: Date;
@@ -34,6 +43,22 @@ export interface DateTimePickerProps {
34
43
  locale: string;
35
44
  enableTime: boolean;
36
45
  }) => string;
37
- }
46
+ };
47
+ export type DateTimePickerProps = (BaseProps & {
48
+ mode?: 'single';
49
+ enableTime?: true;
50
+ value: UtcIsoString | null;
51
+ onChange: (next: UtcIsoString | null) => void;
52
+ }) | (BaseProps & {
53
+ mode?: 'single';
54
+ enableTime?: false;
55
+ value: DateOnlyString | null;
56
+ onChange: (next: DateOnlyString | null) => void;
57
+ }) | (BaseProps & {
58
+ mode: 'range';
59
+ enableTime?: boolean;
60
+ value: RangeValue;
61
+ onChange: (next: RangeValue) => void;
62
+ });
38
63
  export declare const DateTimePicker: React.ForwardRefExoticComponent<DateTimePickerProps & React.RefAttributes<HTMLDivElement>>;
39
64
  export {};