@dbcdk/react-components 0.0.9 → 0.0.10
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/components/accordion/Accordion.d.ts +27 -0
- package/dist/components/accordion/Accordion.js +66 -0
- package/dist/components/accordion/Accordion.module.css +87 -0
- package/dist/components/button/Button.module.css +1 -0
- package/dist/components/circle/Circle.d.ts +4 -1
- package/dist/components/circle/Circle.js +2 -2
- package/dist/components/circle/Circle.module.css +54 -2
- package/dist/components/datetime-picker/DateTimePicker.d.ts +4 -8
- package/dist/components/datetime-picker/DateTimePicker.js +72 -92
- package/dist/components/datetime-picker/dateTimeHelpers.d.ts +14 -12
- package/dist/components/datetime-picker/dateTimeHelpers.js +25 -45
- package/dist/components/forms/checkbox/Checkbox.d.ts +2 -8
- package/dist/components/forms/checkbox/Checkbox.js +3 -5
- package/dist/components/forms/input/Input.d.ts +1 -0
- package/dist/components/forms/input/Input.js +2 -4
- package/dist/components/forms/input/Input.module.css +9 -11
- package/dist/components/forms/input-container/InputContainer.d.ts +2 -1
- package/dist/components/forms/input-container/InputContainer.js +3 -3
- package/dist/components/forms/input-container/InputContainer.module.css +65 -0
- package/dist/components/forms/radio-buttons/RadioButton.d.ts +36 -0
- package/dist/components/forms/radio-buttons/RadioButton.js +26 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.d.ts +25 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.js +19 -0
- package/dist/components/forms/radio-buttons/RadioButtons.module.css +117 -0
- package/dist/components/forms/select/Select.d.ts +1 -1
- package/dist/components/forms/select/Select.js +3 -3
- package/dist/components/forms/text-area/Textarea.js +3 -3
- package/dist/components/forms/text-area/Textarea.module.css +8 -1
- package/dist/components/headline/Headline.d.ts +2 -7
- package/dist/components/headline/Headline.js +5 -2
- package/dist/components/headline/Headline.module.css +61 -2
- package/dist/components/hyperlink/Hyperlink.d.ts +1 -0
- package/dist/components/hyperlink/Hyperlink.js +5 -1
- package/dist/components/icon/Icon.module.css +1 -0
- package/dist/components/interval-select/IntervalSelect.js +1 -1
- package/dist/components/nav-bar/NavBar.d.ts +24 -6
- package/dist/components/overlay/side-panel/SidePanel.d.ts +12 -4
- package/dist/components/overlay/side-panel/SidePanel.js +60 -4
- package/dist/components/overlay/side-panel/SidePanel.module.css +151 -28
- package/dist/components/overlay/side-panel/useSidePanel.d.ts +1 -1
- package/dist/components/overlay/side-panel/useSidePanel.js +2 -2
- package/dist/components/page-layout/PageLayout.js +0 -2
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts +5 -5
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +16 -8
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +0 -3
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.d.ts +3 -1
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +4 -3
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +109 -79
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +16 -3
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.module.css +20 -0
- package/dist/components/sidebar/providers/SidebarProvider.js +25 -46
- package/dist/components/skeleton-loader/SkeletonLoader.d.ts +1 -1
- package/dist/components/skeleton-loader/SkeletonLoader.js +15 -12
- package/dist/components/state-page/StatePage.d.ts +9 -0
- package/dist/components/state-page/StatePage.js +20 -0
- package/dist/components/state-page/StatePage.module.css +9 -0
- package/dist/components/state-page/empty.d.ts +2 -0
- package/dist/components/state-page/empty.js +2 -0
- package/dist/components/state-page/error.d.ts +2 -0
- package/dist/components/state-page/error.js +2 -0
- package/dist/components/state-page/notFound.d.ts +2 -0
- package/dist/components/state-page/notFound.js +2 -0
- package/dist/components/sticky-footer-layout/StickyFooterLayout.d.ts +19 -0
- package/dist/components/sticky-footer-layout/StickyFooterLayout.js +27 -0
- package/dist/components/table/Table.js +4 -4
- package/dist/components/table/Table.module.css +168 -60
- package/dist/components/table/components/empty-state/EmptyState.d.ts +1 -1
- package/dist/components/table/components/empty-state/EmptyState.js +6 -7
- package/dist/components/toast/Toast.js +5 -1
- package/dist/components/toast/Toast.module.css +40 -15
- package/dist/components/toast/provider/ToastProvider.js +1 -0
- package/dist/hooks/useTimeDuration.js +9 -3
- package/dist/hooks/useViewportFill.js +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -1
- package/dist/src/styles/styles.css +22 -3
- package/dist/styles/styles.css +22 -3
- package/dist/styles/themes/dbc/dark.css +1 -1
- package/dist/styles/themes/dbc/light.css +2 -1
- package/package.json +1 -1
|
@@ -6,7 +6,13 @@ function defaultDuration(ms) {
|
|
|
6
6
|
const sec = Math.floor(ms / 1000) % 60;
|
|
7
7
|
const min = Math.floor(ms / (1000 * 60)) % 60;
|
|
8
8
|
const hr = Math.floor(ms / (1000 * 60 * 60));
|
|
9
|
-
|
|
9
|
+
if (hr > 0) {
|
|
10
|
+
return `${hr}t ${min}m ${sec}s`;
|
|
11
|
+
}
|
|
12
|
+
if (min > 0) {
|
|
13
|
+
return `${min}m ${sec}s`;
|
|
14
|
+
}
|
|
15
|
+
return `${sec}s`;
|
|
10
16
|
}
|
|
11
17
|
export function useTimeDuration({ start, end, dateFormat = { dateStyle: 'short', timeStyle: 'medium' }, fallback = '—', formatDuration = defaultDuration, }) {
|
|
12
18
|
const [hydrated, setHydrated] = useState(false);
|
|
@@ -16,14 +22,14 @@ export function useTimeDuration({ start, end, dateFormat = { dateStyle: 'short',
|
|
|
16
22
|
return fallback;
|
|
17
23
|
if (!hydrated)
|
|
18
24
|
return fallback;
|
|
19
|
-
return new Intl.DateTimeFormat(
|
|
25
|
+
return new Intl.DateTimeFormat('da-DK', dateFormat).format(start);
|
|
20
26
|
}, [start, hydrated, fallback, dateFormat]);
|
|
21
27
|
const ended = useMemo(() => {
|
|
22
28
|
if (!end)
|
|
23
29
|
return fallback;
|
|
24
30
|
if (!hydrated)
|
|
25
31
|
return fallback;
|
|
26
|
-
return new Intl.DateTimeFormat(
|
|
32
|
+
return new Intl.DateTimeFormat('da-DK', dateFormat).format(end);
|
|
27
33
|
}, [end, hydrated, fallback, dateFormat]);
|
|
28
34
|
const duration = useMemo(() => {
|
|
29
35
|
if (!start || !end)
|
package/dist/index.d.ts
CHANGED
|
@@ -61,3 +61,9 @@ export * from './components/hyperlink/Hyperlink';
|
|
|
61
61
|
export * from './components/overlay/tooltip/Tooltip';
|
|
62
62
|
export * from './components/overlay/tooltip/TooltipProvider';
|
|
63
63
|
export * from './components/overlay/tooltip/useTooltipTrigger';
|
|
64
|
+
export * from './components/forms/radio-buttons/RadioButton';
|
|
65
|
+
export * from './components/forms/radio-buttons/RadioButtonGroup';
|
|
66
|
+
export * from './components/interval-select/IntervalSelect';
|
|
67
|
+
export * from './components/accordion/Accordion';
|
|
68
|
+
export * from './components/state-page/StatePage';
|
|
69
|
+
export * from './components/sticky-footer-layout/StickyFooterLayout';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
export * from './components/button/Button';
|
|
3
2
|
export * from './components/nav-bar/NavBar';
|
|
4
3
|
export * from './components/avatar/Avatar';
|
|
@@ -62,3 +61,9 @@ export * from './components/hyperlink/Hyperlink';
|
|
|
62
61
|
export * from './components/overlay/tooltip/Tooltip';
|
|
63
62
|
export * from './components/overlay/tooltip/TooltipProvider';
|
|
64
63
|
export * from './components/overlay/tooltip/useTooltipTrigger';
|
|
64
|
+
export * from './components/forms/radio-buttons/RadioButton';
|
|
65
|
+
export * from './components/forms/radio-buttons/RadioButtonGroup';
|
|
66
|
+
export * from './components/interval-select/IntervalSelect';
|
|
67
|
+
export * from './components/accordion/Accordion';
|
|
68
|
+
export * from './components/state-page/StatePage';
|
|
69
|
+
export * from './components/sticky-footer-layout/StickyFooterLayout';
|
|
@@ -30,6 +30,8 @@ body {
|
|
|
30
30
|
color: var(--color-fg-default);
|
|
31
31
|
background-color: var(--color-bg-page);
|
|
32
32
|
--density: var(--density-comfortable);
|
|
33
|
+
font-size: var(--font-size-sm);
|
|
34
|
+
margin: 0;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
h1 {
|
|
@@ -45,7 +47,7 @@ h3 {
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
h4 {
|
|
48
|
-
font-size: var(--font-size-
|
|
50
|
+
font-size: var(--font-size-sm);
|
|
49
51
|
font-weight: var(--font-weight-medium);
|
|
50
52
|
}
|
|
51
53
|
|
|
@@ -53,6 +55,10 @@ body.dbc-app {
|
|
|
53
55
|
max-width: 1600px;
|
|
54
56
|
}
|
|
55
57
|
|
|
58
|
+
.dbc-font-mono {
|
|
59
|
+
font-family: monospace;
|
|
60
|
+
}
|
|
61
|
+
|
|
56
62
|
.dbc-table {
|
|
57
63
|
--card-label-width: 260px;
|
|
58
64
|
border-collapse: collapse;
|
|
@@ -85,14 +91,27 @@ body.dbc-app {
|
|
|
85
91
|
}
|
|
86
92
|
}
|
|
87
93
|
|
|
94
|
+
.dbc-full-width {
|
|
95
|
+
width: 100%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.dbc-highlight {
|
|
99
|
+
background-color: var(--color-status-warning-bg);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.dbc-muted-text {
|
|
103
|
+
color: var(--color-fg-subtle);
|
|
104
|
+
}
|
|
105
|
+
|
|
88
106
|
.dbc-table--bordered {
|
|
89
107
|
width: auto;
|
|
90
|
-
border:
|
|
108
|
+
border: var(--border-width-thin) solid var(--color-border-default);
|
|
109
|
+
border-collapse: collapse;
|
|
91
110
|
}
|
|
92
111
|
|
|
93
112
|
.dbc-table--bordered th,
|
|
94
113
|
.dbc-table--bordered td {
|
|
95
|
-
border:
|
|
114
|
+
border: var(--border-width-thin) solid var(--color-border-default);
|
|
96
115
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
97
116
|
}
|
|
98
117
|
|
package/dist/styles/styles.css
CHANGED
|
@@ -30,6 +30,8 @@ body {
|
|
|
30
30
|
color: var(--color-fg-default);
|
|
31
31
|
background-color: var(--color-bg-page);
|
|
32
32
|
--density: var(--density-comfortable);
|
|
33
|
+
font-size: var(--font-size-sm);
|
|
34
|
+
margin: 0;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
h1 {
|
|
@@ -45,7 +47,7 @@ h3 {
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
h4 {
|
|
48
|
-
font-size: var(--font-size-
|
|
50
|
+
font-size: var(--font-size-sm);
|
|
49
51
|
font-weight: var(--font-weight-medium);
|
|
50
52
|
}
|
|
51
53
|
|
|
@@ -53,6 +55,10 @@ body.dbc-app {
|
|
|
53
55
|
max-width: 1600px;
|
|
54
56
|
}
|
|
55
57
|
|
|
58
|
+
.dbc-font-mono {
|
|
59
|
+
font-family: monospace;
|
|
60
|
+
}
|
|
61
|
+
|
|
56
62
|
.dbc-table {
|
|
57
63
|
--card-label-width: 260px;
|
|
58
64
|
border-collapse: collapse;
|
|
@@ -85,14 +91,27 @@ body.dbc-app {
|
|
|
85
91
|
}
|
|
86
92
|
}
|
|
87
93
|
|
|
94
|
+
.dbc-full-width {
|
|
95
|
+
width: 100%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.dbc-highlight {
|
|
99
|
+
background-color: var(--color-status-warning-bg);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.dbc-muted-text {
|
|
103
|
+
color: var(--color-fg-subtle);
|
|
104
|
+
}
|
|
105
|
+
|
|
88
106
|
.dbc-table--bordered {
|
|
89
107
|
width: auto;
|
|
90
|
-
border:
|
|
108
|
+
border: var(--border-width-thin) solid var(--color-border-default);
|
|
109
|
+
border-collapse: collapse;
|
|
91
110
|
}
|
|
92
111
|
|
|
93
112
|
.dbc-table--bordered th,
|
|
94
113
|
.dbc-table--bordered td {
|
|
95
|
-
border:
|
|
114
|
+
border: var(--border-width-thin) solid var(--color-border-default);
|
|
96
115
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
97
116
|
}
|
|
98
117
|
|
|
@@ -202,12 +202,13 @@ html[data-theme='light'] {
|
|
|
202
202
|
--icon-size-md: 20px;
|
|
203
203
|
--icon-size-lg: 24px;
|
|
204
204
|
|
|
205
|
+
--component-size-xxs: 12px;
|
|
205
206
|
--component-size-xs: 20px;
|
|
206
207
|
--component-size-sm: 30px;
|
|
207
208
|
--component-size-md: 36px;
|
|
208
209
|
--component-size-lg: 44px;
|
|
209
210
|
--component-size-xl: 435px;
|
|
210
|
-
--sidebar-width:
|
|
211
|
+
--sidebar-width: 180px;
|
|
211
212
|
|
|
212
213
|
/* Control paddings */
|
|
213
214
|
--control-padding-x: 12px;
|