@dbcdk/react-components 0.0.184 → 0.0.186

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 (65) hide show
  1. package/dist/client.cjs +28 -0
  2. package/dist/client.d.ts +4 -0
  3. package/dist/client.js +4 -0
  4. package/dist/components/accordion/components/AccordionRow.cjs +2 -36
  5. package/dist/components/accordion/components/AccordionRow.js +2 -36
  6. package/dist/components/button-select/ButtonSelect.cjs +30 -21
  7. package/dist/components/button-select/ButtonSelect.d.ts +8 -4
  8. package/dist/components/button-select/ButtonSelect.js +30 -21
  9. package/dist/components/page/Page.module.css +1 -0
  10. package/dist/components/pagination/Pagination.module.css +1 -0
  11. package/dist/components/panel/Panel.module.css +0 -1
  12. package/dist/components/popover/Popover.cjs +1 -1
  13. package/dist/components/popover/Popover.js +1 -1
  14. package/dist/components/print-friendly/PrintFriendlyCard.cjs +39 -0
  15. package/dist/components/print-friendly/PrintFriendlyCard.d.ts +23 -0
  16. package/dist/components/print-friendly/PrintFriendlyCard.js +37 -0
  17. package/dist/components/print-friendly/PrintFriendlyMetaBar.cjs +25 -0
  18. package/dist/components/print-friendly/PrintFriendlyMetaBar.d.ts +19 -0
  19. package/dist/components/print-friendly/PrintFriendlyMetaBar.js +23 -0
  20. package/dist/components/print-friendly/PrintFriendlyTable.cjs +51 -0
  21. package/dist/components/print-friendly/PrintFriendlyTable.d.ts +34 -0
  22. package/dist/components/print-friendly/PrintFriendlyTable.js +49 -0
  23. package/dist/components/print-friendly/components/AccumulationFooter.cjs +42 -0
  24. package/dist/components/print-friendly/components/AccumulationFooter.d.ts +9 -0
  25. package/dist/components/print-friendly/components/AccumulationFooter.js +40 -0
  26. package/dist/components/print-friendly/emptyValue.cjs +9 -0
  27. package/dist/components/print-friendly/emptyValue.d.ts +2 -0
  28. package/dist/components/print-friendly/emptyValue.js +6 -0
  29. package/dist/components/print-friendly/printSelection.cjs +14 -0
  30. package/dist/components/print-friendly/printSelection.d.ts +19 -0
  31. package/dist/components/print-friendly/printSelection.js +10 -0
  32. package/dist/components/stack/Stack.cjs +6 -5
  33. package/dist/components/stack/Stack.d.ts +2 -1
  34. package/dist/components/stack/Stack.js +6 -5
  35. package/dist/components/table/Table.cjs +20 -4
  36. package/dist/components/table/Table.js +21 -5
  37. package/dist/components/table/Table.module.css +6 -0
  38. package/dist/components/table/Table.types.d.ts +1 -0
  39. package/dist/components/table/components/TableHeader.cjs +1 -0
  40. package/dist/components/table/components/TableHeader.js +1 -0
  41. package/dist/components/tabs/Tabs.cjs +49 -39
  42. package/dist/components/tabs/Tabs.d.ts +3 -1
  43. package/dist/components/tabs/Tabs.js +49 -39
  44. package/dist/components/tabs/Tabs.module.css +43 -25
  45. package/dist/components/timeline/Timeline.cjs +102 -0
  46. package/dist/components/timeline/Timeline.d.ts +60 -0
  47. package/dist/components/timeline/Timeline.js +96 -0
  48. package/dist/components/timeline/Timeline.module.css +22 -0
  49. package/dist/components/timeline/components/TimelineRow.cjs +147 -0
  50. package/dist/components/timeline/components/TimelineRow.d.ts +15 -0
  51. package/dist/components/timeline/components/TimelineRow.js +141 -0
  52. package/dist/components/timeline/components/TimelineRow.module.css +195 -0
  53. package/dist/hooks/useCollapsibleHeight.cjs +41 -0
  54. package/dist/hooks/useCollapsibleHeight.d.ts +6 -0
  55. package/dist/hooks/useCollapsibleHeight.js +39 -0
  56. package/dist/hooks/useViewportFill.cjs +11 -3
  57. package/dist/hooks/useViewportFill.js +11 -3
  58. package/dist/index.cjs +7 -0
  59. package/dist/index.css +2 -0
  60. package/dist/index.d.ts +1 -0
  61. package/dist/index.js +1 -0
  62. package/dist/styles/styles.css +74 -2
  63. package/dist/styles.css +74 -2
  64. package/dist/utils/date/formatDate.d.ts +3 -2
  65. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from './components/section-label/SectionLabel';
9
9
  export * from './components/page-layout/PageLayout';
10
10
  export * from './components/page-layout/components/footer/Footer';
11
11
  export * from './components/card/Card';
12
+ export * from './components/print-friendly/printSelection';
12
13
  export * from './components/card-container/CardContainer';
13
14
  export * from './components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem';
14
15
  export * from './components/skeleton-loader/SkeletonLoader';
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ export * from './components/section-label/SectionLabel';
9
9
  export * from './components/page-layout/PageLayout';
10
10
  export * from './components/page-layout/components/footer/Footer';
11
11
  export * from './components/card/Card';
12
+ export * from './components/print-friendly/printSelection';
12
13
  export * from './components/card-container/CardContainer';
13
14
  export * from './components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem';
14
15
  export * from './components/skeleton-loader/SkeletonLoader';
@@ -99,11 +99,14 @@ body.dbc-app {
99
99
  max-width: var(--card-label-width);
100
100
  overflow: hidden;
101
101
  text-overflow: ellipsis;
102
- font-size: var(--font-size-xs);
102
+ font-size: var(--font-size-table-header);
103
103
  line-height: var(--line-height-table-header);
104
104
  color: var(--table-header-fg);
105
105
  letter-spacing: var(--letter-spacing-wide);
106
106
  font-weight: normal;
107
+ /* A bit more breathing room between the label and its value than the
108
+ shared th/td padding-inline gives on its own. */
109
+ padding-right: var(--spacing-xs);
107
110
  }
108
111
 
109
112
  .dbc-table td {
@@ -233,7 +236,7 @@ tr.dbc-table--hover:hover td:last-child {
233
236
  }
234
237
 
235
238
  .dbc-sm-text {
236
- font-size: var(--font-size-xs);
239
+ font-size: var(--font-size-sm);
237
240
  }
238
241
 
239
242
  .dbc-md-text {
@@ -379,3 +382,72 @@ tr.dbc-table--hover:hover td:last-child {
379
382
  clip: rect(0, 0, 0, 0);
380
383
  border: 0;
381
384
  }
385
+
386
+ /* ==========================================================================
387
+ Print
388
+ ========================================================================== */
389
+
390
+ @media print {
391
+ /* --- What to print (only content explicitly opted in via
392
+ printSelection()'s NOT_PRINTABLE_ATTRIBUTE gate, or a Modal) --- */
393
+ body[data-not-printable='true'] > *:not([data-not-printable='false']):not([role='dialog']) {
394
+ display: none !important;
395
+ }
396
+ body [data-not-printable='true'] {
397
+ display: none !important;
398
+ }
399
+
400
+ /* --- Page setup --- */
401
+ @page {
402
+ size: A4;
403
+ margin: 12mm;
404
+ }
405
+
406
+ html,
407
+ body {
408
+ height: auto !important; /* avoid 100vh/100% truncation */
409
+ overflow: visible !important; /* allow pagination */
410
+ }
411
+ * {
412
+ overflow: visible !important;
413
+ transform: none !important;
414
+ }
415
+
416
+ /* Modal (components/overlay/modal/Modal) portals a position:fixed,
417
+ scroll-clipped overlay directly onto body, wrapping the actual
418
+ `role="dialog"` element. It has no class or attribute of its own to
419
+ target, but it's always body's direct child that contains the dialog,
420
+ so :has() reaches it. */
421
+ body > div:has([role='dialog']) {
422
+ position: static !important;
423
+ inset: auto !important;
424
+ overflow: visible !important;
425
+ padding: 0 !important;
426
+ }
427
+
428
+ [role='dialog'] {
429
+ position: static !important;
430
+ width: 100% !important;
431
+ max-width: none !important;
432
+ height: auto !important;
433
+ max-height: none !important;
434
+ overflow: visible !important;
435
+ transform: none !important;
436
+ contain: none !important;
437
+ box-shadow: none !important;
438
+ }
439
+
440
+ /* --- Page breaks --- */
441
+ /* Use this class on any element that should start on a new page. */
442
+ .dbc-page-break-before:not(:first-of-type) {
443
+ margin-top: 0 !important;
444
+ break-before: page !important;
445
+ page-break-before: always !important; /* legacy */
446
+ }
447
+ /* Utility to discourage breaking inside certain blocks. */
448
+ .dbc-avoid-break,
449
+ [role='dialog'] {
450
+ break-inside: auto !important;
451
+ page-break-inside: auto !important;
452
+ }
453
+ }
package/dist/styles.css CHANGED
@@ -99,11 +99,14 @@ body.dbc-app {
99
99
  max-width: var(--card-label-width);
100
100
  overflow: hidden;
101
101
  text-overflow: ellipsis;
102
- font-size: var(--font-size-xs);
102
+ font-size: var(--font-size-table-header);
103
103
  line-height: var(--line-height-table-header);
104
104
  color: var(--table-header-fg);
105
105
  letter-spacing: var(--letter-spacing-wide);
106
106
  font-weight: normal;
107
+ /* A bit more breathing room between the label and its value than the
108
+ shared th/td padding-inline gives on its own. */
109
+ padding-right: var(--spacing-xs);
107
110
  }
108
111
 
109
112
  .dbc-table td {
@@ -233,7 +236,7 @@ tr.dbc-table--hover:hover td:last-child {
233
236
  }
234
237
 
235
238
  .dbc-sm-text {
236
- font-size: var(--font-size-xs);
239
+ font-size: var(--font-size-sm);
237
240
  }
238
241
 
239
242
  .dbc-md-text {
@@ -379,3 +382,72 @@ tr.dbc-table--hover:hover td:last-child {
379
382
  clip: rect(0, 0, 0, 0);
380
383
  border: 0;
381
384
  }
385
+
386
+ /* ==========================================================================
387
+ Print
388
+ ========================================================================== */
389
+
390
+ @media print {
391
+ /* --- What to print (only content explicitly opted in via
392
+ printSelection()'s NOT_PRINTABLE_ATTRIBUTE gate, or a Modal) --- */
393
+ body[data-not-printable='true'] > *:not([data-not-printable='false']):not([role='dialog']) {
394
+ display: none !important;
395
+ }
396
+ body [data-not-printable='true'] {
397
+ display: none !important;
398
+ }
399
+
400
+ /* --- Page setup --- */
401
+ @page {
402
+ size: A4;
403
+ margin: 12mm;
404
+ }
405
+
406
+ html,
407
+ body {
408
+ height: auto !important; /* avoid 100vh/100% truncation */
409
+ overflow: visible !important; /* allow pagination */
410
+ }
411
+ * {
412
+ overflow: visible !important;
413
+ transform: none !important;
414
+ }
415
+
416
+ /* Modal (components/overlay/modal/Modal) portals a position:fixed,
417
+ scroll-clipped overlay directly onto body, wrapping the actual
418
+ `role="dialog"` element. It has no class or attribute of its own to
419
+ target, but it's always body's direct child that contains the dialog,
420
+ so :has() reaches it. */
421
+ body > div:has([role='dialog']) {
422
+ position: static !important;
423
+ inset: auto !important;
424
+ overflow: visible !important;
425
+ padding: 0 !important;
426
+ }
427
+
428
+ [role='dialog'] {
429
+ position: static !important;
430
+ width: 100% !important;
431
+ max-width: none !important;
432
+ height: auto !important;
433
+ max-height: none !important;
434
+ overflow: visible !important;
435
+ transform: none !important;
436
+ contain: none !important;
437
+ box-shadow: none !important;
438
+ }
439
+
440
+ /* --- Page breaks --- */
441
+ /* Use this class on any element that should start on a new page. */
442
+ .dbc-page-break-before:not(:first-of-type) {
443
+ margin-top: 0 !important;
444
+ break-before: page !important;
445
+ page-break-before: always !important; /* legacy */
446
+ }
447
+ /* Utility to discourage breaking inside certain blocks. */
448
+ .dbc-avoid-break,
449
+ [role='dialog'] {
450
+ break-inside: auto !important;
451
+ page-break-inside: auto !important;
452
+ }
453
+ }
@@ -24,7 +24,7 @@
24
24
  * local "today", since that part is genuinely about the viewer's current day.
25
25
  * @returns A formatted string
26
26
  */
27
- export declare function formatDate(date: Date | string | number, options?: {
27
+ export interface FormatDateOptions {
28
28
  showTime?: boolean;
29
29
  showSeconds?: boolean;
30
30
  userFriendlyLabel?: boolean;
@@ -32,4 +32,5 @@ export declare function formatDate(date: Date | string | number, options?: {
32
32
  ignoreDate?: boolean;
33
33
  ignoreDateIfSame?: boolean;
34
34
  ignoreTimezone?: boolean;
35
- }): string;
35
+ }
36
+ export declare function formatDate(date: Date | string | number, options?: FormatDateOptions): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbcdk/react-components",
3
- "version": "0.0.184",
3
+ "version": "0.0.186",
4
4
  "description": "Reusable React components for DBC projects",
5
5
  "license": "ISC",
6
6
  "author": "",