@dbcdk/react-components 0.0.4 → 0.0.5

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 (223) hide show
  1. package/dist/assets/logo.cjs +10 -10
  2. package/dist/assets/logo.js +10 -10
  3. package/dist/components/__stories__/story-components/Colors.cjs +159 -0
  4. package/dist/components/__stories__/story-components/Colors.d.ts +10 -0
  5. package/dist/components/__stories__/story-components/Colors.js +151 -0
  6. package/dist/components/__stories__/story-components/Colors.module.css +27 -0
  7. package/dist/components/__stories__/story-components/Spacing.cjs +190 -0
  8. package/dist/components/__stories__/story-components/Spacing.d.ts +1 -0
  9. package/dist/components/__stories__/story-components/Spacing.js +184 -0
  10. package/dist/components/__stories__/story-components/Spacing.module.css +154 -0
  11. package/dist/components/app-header/AppHeader.module.css +10 -15
  12. package/dist/components/attribute-chip/AttributeChip.cjs +22 -0
  13. package/dist/components/attribute-chip/AttributeChip.d.ts +8 -0
  14. package/dist/components/attribute-chip/AttributeChip.js +16 -0
  15. package/dist/components/attribute-chip/AttributeChip.module.css +65 -0
  16. package/dist/components/avatar/Avatar.cjs +38 -4
  17. package/dist/components/avatar/Avatar.d.ts +4 -2
  18. package/dist/components/avatar/Avatar.js +39 -5
  19. package/dist/components/avatar/Avatar.module.css +27 -0
  20. package/dist/components/breadcrumbs/Breadcrumbs.cjs +1 -2
  21. package/dist/components/breadcrumbs/Breadcrumbs.js +1 -2
  22. package/dist/components/breadcrumbs/Breadcrumbs.module.css +19 -22
  23. package/dist/components/button/Button.cjs +20 -12
  24. package/dist/components/button/Button.d.ts +4 -1
  25. package/dist/components/button/Button.js +20 -12
  26. package/dist/components/button/Button.module.css +118 -55
  27. package/dist/components/card/Card.cjs +53 -13
  28. package/dist/components/card/Card.d.ts +21 -6
  29. package/dist/components/card/Card.js +54 -14
  30. package/dist/components/card/Card.module.css +148 -44
  31. package/dist/components/card-container/CardContainer.cjs +6 -5
  32. package/dist/components/card-container/CardContainer.d.ts +5 -2
  33. package/dist/components/card-container/CardContainer.js +6 -5
  34. package/dist/components/card-container/CardContainer.module.css +40 -0
  35. package/dist/components/checkbox/Checkbox.cjs +3 -4
  36. package/dist/components/checkbox/Checkbox.d.ts +1 -1
  37. package/dist/components/checkbox/Checkbox.js +3 -4
  38. package/dist/components/checkbox/Checkbox.module.css +10 -10
  39. package/dist/components/chip/Chip.cjs +2 -1
  40. package/dist/components/chip/Chip.d.ts +2 -1
  41. package/dist/components/chip/Chip.js +2 -1
  42. package/dist/components/chip/Chip.module.css +42 -27
  43. package/dist/components/circle/Circle.module.css +11 -11
  44. package/dist/components/clear-button/ClearButton.cjs +3 -3
  45. package/dist/components/clear-button/ClearButton.js +3 -3
  46. package/dist/components/clear-button/ClearButton.module.css +8 -7
  47. package/dist/components/code-block/CodeBlock.cjs +18 -0
  48. package/dist/components/code-block/CodeBlock.d.ts +6 -0
  49. package/dist/components/code-block/CodeBlock.js +12 -0
  50. package/dist/components/code-block/CodeBlock.module.css +60 -0
  51. package/dist/components/copy-button/CopyButton.cjs +35 -0
  52. package/dist/components/copy-button/CopyButton.d.ts +9 -0
  53. package/dist/components/copy-button/CopyButton.js +29 -0
  54. package/dist/components/copy-button/CopyButton.module.css +6 -0
  55. package/dist/components/datetime-picker/DateTimePicker.cjs +504 -0
  56. package/dist/components/datetime-picker/DateTimePicker.d.ts +39 -0
  57. package/dist/components/datetime-picker/DateTimePicker.js +498 -0
  58. package/dist/components/datetime-picker/DateTimePicker.module.css +144 -0
  59. package/dist/components/filter-field/FilterField.cjs +34 -19
  60. package/dist/components/filter-field/FilterField.d.ts +2 -2
  61. package/dist/components/filter-field/FilterField.js +35 -20
  62. package/dist/components/filter-field/FilterField.module.css +14 -20
  63. package/dist/components/headline/Headline.cjs +10 -4
  64. package/dist/components/headline/Headline.d.ts +9 -1
  65. package/dist/components/headline/Headline.js +10 -4
  66. package/dist/components/headline/Headline.module.css +32 -7
  67. package/dist/components/icon/Icon.module.css +10 -9
  68. package/dist/components/input/Input.cjs +60 -19
  69. package/dist/components/input/Input.d.ts +7 -2
  70. package/dist/components/input/Input.js +60 -19
  71. package/dist/components/input/Input.module.css +90 -43
  72. package/dist/components/link/Link.cjs +46 -0
  73. package/dist/components/link/Link.d.ts +9 -0
  74. package/dist/components/link/Link.js +21 -0
  75. package/dist/components/link/Link.module.css +32 -0
  76. package/dist/components/menu/Menu.module.css +10 -32
  77. package/dist/components/meta-bar/MetaBar.cjs +29 -0
  78. package/dist/components/meta-bar/MetaBar.d.ts +11 -0
  79. package/dist/components/meta-bar/MetaBar.js +22 -0
  80. package/dist/components/meta-bar/MetaBar.module.css +12 -0
  81. package/dist/components/modal/Modal.cjs +134 -0
  82. package/dist/components/modal/Modal.d.ts +21 -0
  83. package/dist/components/modal/Modal.js +128 -0
  84. package/dist/components/modal/Modal.module.css +66 -0
  85. package/dist/components/modal/provider/ModalProvider.cjs +80 -0
  86. package/dist/components/modal/provider/ModalProvider.d.ts +21 -0
  87. package/dist/components/modal/provider/ModalProvider.js +77 -0
  88. package/dist/components/multi-select/MultiSelect.cjs +12 -1
  89. package/dist/components/multi-select/MultiSelect.js +12 -1
  90. package/dist/components/nav-bar/NavBar.module.css +11 -16
  91. package/dist/components/page/Page.module.css +2 -2
  92. package/dist/components/page-layout/PageLayout.cjs +5 -22
  93. package/dist/components/page-layout/PageLayout.d.ts +1 -8
  94. package/dist/components/page-layout/PageLayout.js +5 -22
  95. package/dist/components/page-layout/PageLayout.module.css +4 -80
  96. package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.cjs +32 -0
  97. package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.d.ts +11 -0
  98. package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.js +25 -0
  99. package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.module.css +84 -0
  100. package/dist/components/pagination/Pagination.cjs +83 -67
  101. package/dist/components/pagination/Pagination.d.ts +3 -1
  102. package/dist/components/pagination/Pagination.js +84 -68
  103. package/dist/components/pagination/Pagination.module.css +11 -3
  104. package/dist/components/panel/Panel.module.css +5 -7
  105. package/dist/components/popover/Popover.cjs +25 -8
  106. package/dist/components/popover/Popover.d.ts +2 -1
  107. package/dist/components/popover/Popover.js +25 -8
  108. package/dist/components/popover/Popover.module.css +4 -6
  109. package/dist/components/search-box/SearchBox.cjs +50 -37
  110. package/dist/components/search-box/SearchBox.d.ts +10 -7
  111. package/dist/components/search-box/SearchBox.js +50 -37
  112. package/dist/components/search-box/SearchBox.module.css +0 -1
  113. package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +12 -6
  114. package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +12 -6
  115. package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +5 -1
  116. package/dist/components/select/Select.cjs +82 -13
  117. package/dist/components/select/Select.d.ts +2 -1
  118. package/dist/components/select/Select.js +83 -14
  119. package/dist/components/sidebar/Sidebar.cjs +3 -30
  120. package/dist/components/sidebar/Sidebar.d.ts +2 -1
  121. package/dist/components/sidebar/Sidebar.js +4 -26
  122. package/dist/components/sidebar/components/SidebarItem.cjs +3 -1
  123. package/dist/components/sidebar/components/SidebarItem.js +3 -1
  124. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +40 -14
  125. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts +3 -1
  126. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +40 -14
  127. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +9 -38
  128. package/dist/components/sidebar/components/sidebar-container/SidebarContainer.cjs +50 -0
  129. package/dist/components/sidebar/components/sidebar-container/SidebarContainer.d.ts +8 -0
  130. package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +43 -0
  131. package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +155 -0
  132. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +16 -9
  133. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.d.ts +2 -1
  134. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +16 -9
  135. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +25 -12
  136. package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +2 -1
  137. package/dist/components/sidebar/components/sidebar-items/SidebarItems.d.ts +1 -1
  138. package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +2 -1
  139. package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.cjs +29 -2
  140. package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +25 -2
  141. package/dist/components/sidebar/providers/SidebarProvider.cjs +108 -10
  142. package/dist/components/sidebar/providers/SidebarProvider.d.ts +7 -3
  143. package/dist/components/sidebar/providers/SidebarProvider.js +109 -11
  144. package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.cjs +1 -1
  145. package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +1 -1
  146. package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +0 -12
  147. package/dist/components/split-pane/SplitPane.cjs +123 -0
  148. package/dist/components/split-pane/SplitPane.d.ts +34 -0
  149. package/dist/components/split-pane/SplitPane.js +114 -0
  150. package/dist/components/split-pane/SplitPane.module.css +106 -0
  151. package/dist/components/split-pane/provider/SplitPaneContext.cjs +87 -0
  152. package/dist/components/split-pane/provider/SplitPaneContext.d.ts +23 -0
  153. package/dist/components/split-pane/provider/SplitPaneContext.js +79 -0
  154. package/dist/components/table/Table.cjs +180 -112
  155. package/dist/components/table/Table.d.ts +22 -6
  156. package/dist/components/table/Table.js +181 -113
  157. package/dist/components/table/Table.module.css +74 -47
  158. package/dist/components/table/components/empty-state/EmptyState.cjs +52 -0
  159. package/dist/components/table/components/empty-state/EmptyState.d.ts +40 -0
  160. package/dist/components/table/components/empty-state/EmptyState.js +46 -0
  161. package/dist/components/table/components/empty-state/EmptyState.module.css +16 -0
  162. package/dist/components/table/components/table-settings/TableSettings.cjs +32 -0
  163. package/dist/components/table/components/table-settings/TableSettings.d.ts +7 -0
  164. package/dist/components/table/components/table-settings/TableSettings.js +30 -0
  165. package/dist/{tanstack.cjs → components/table/tanstack.cjs} +61 -99
  166. package/dist/components/table/tanstack.d.ts +14 -0
  167. package/dist/{tanstack.js → components/table/tanstack.js} +61 -99
  168. package/dist/components/tabs/Tabs.cjs +33 -17
  169. package/dist/components/tabs/Tabs.d.ts +6 -3
  170. package/dist/components/tabs/Tabs.js +33 -17
  171. package/dist/components/tabs/Tabs.module.css +9 -9
  172. package/dist/components/toast/Toast.cjs +47 -0
  173. package/dist/components/toast/Toast.d.ts +14 -0
  174. package/dist/components/toast/Toast.js +41 -0
  175. package/dist/components/toast/Toast.module.css +101 -0
  176. package/dist/components/toast/provider/ToastProvider.cjs +98 -0
  177. package/dist/components/toast/provider/ToastProvider.d.ts +23 -0
  178. package/dist/components/toast/provider/ToastProvider.js +91 -0
  179. package/dist/components/tooltip/Tooltip.cjs +134 -29
  180. package/dist/components/tooltip/Tooltip.js +135 -30
  181. package/dist/components/tooltip/Tooltip.module.css +25 -43
  182. package/dist/components/user-display/UserDisplay.module.css +2 -2
  183. package/dist/constants/severity.cjs +12 -12
  184. package/dist/constants/severity.js +12 -12
  185. package/dist/constants/sizes.cjs +1 -0
  186. package/dist/constants/sizes.d.ts +1 -1
  187. package/dist/constants/sizes.js +1 -0
  188. package/dist/hooks/usePagination.cjs +88 -0
  189. package/dist/hooks/usePagination.d.ts +33 -0
  190. package/dist/hooks/usePagination.js +86 -0
  191. package/dist/hooks/useSorting.cjs +118 -0
  192. package/dist/hooks/useSorting.d.ts +49 -0
  193. package/dist/hooks/useSorting.js +116 -0
  194. package/dist/hooks/useTableData.cjs +52 -0
  195. package/dist/hooks/useTableData.d.ts +40 -0
  196. package/dist/hooks/useTableData.js +50 -0
  197. package/dist/hooks/useTableSelection.cjs +130 -0
  198. package/dist/hooks/useTableSelection.d.ts +25 -0
  199. package/dist/hooks/useTableSelection.js +128 -0
  200. package/dist/hooks/useTableSettings.cjs +28 -0
  201. package/dist/hooks/useTableSettings.d.ts +7 -0
  202. package/dist/hooks/useTableSettings.js +26 -0
  203. package/dist/hooks/useTimeDuration.cjs +39 -0
  204. package/dist/hooks/useTimeDuration.d.ts +22 -0
  205. package/dist/hooks/useTimeDuration.js +37 -0
  206. package/dist/hooks/useViewportFill.js +1 -1
  207. package/dist/index.cjs +119 -0
  208. package/dist/index.d.ts +17 -0
  209. package/dist/index.js +17 -0
  210. package/dist/src/styles/styles.css +101 -8
  211. package/dist/styles/css-helper-classes/flex.css +97 -0
  212. package/dist/styles/css-helper-classes/typography.css +7 -0
  213. package/dist/styles/styles.css +101 -8
  214. package/dist/styles/themes/dbc/dark.css +206 -99
  215. package/dist/styles/themes/dbc/light.css +183 -89
  216. package/dist/types/sizes.types.d.ts +2 -2
  217. package/package.json +17 -11
  218. package/dist/components/data-summary/DataSummary.cjs +0 -49
  219. package/dist/components/data-summary/DataSummary.d.ts +0 -19
  220. package/dist/components/data-summary/DataSummary.js +0 -43
  221. package/dist/components/data-summary/DataSummary.module.css +0 -51
  222. package/dist/components/sidebar/Sidebar.module.css +0 -66
  223. package/dist/tanstack.d.ts +0 -25
@@ -1,20 +1,6 @@
1
- .link {
2
- text-decoration: none;
3
- font-size: var(--font-size-sm);
4
- color: var(--color-link);
5
- transition:
6
- color var(--transition-fast) var(--ease-standard),
7
- text-decoration-color var(--transition-fast) var(--ease-standard);
8
- text-underline-offset: 0.15em;
9
- }
10
- .link:hover {
11
- color: var(--color-link-hover);
12
- text-decoration: underline;
13
- }
14
- .link:focus-visible {
15
- outline: none;
16
- box-shadow: var(--focus-ring);
17
- }
1
+ /* ==========================================================================
2
+ * BASE BUTTON
3
+ * ======================================================================= */
18
4
 
19
5
  .button {
20
6
  display: inline-flex;
@@ -26,24 +12,29 @@
26
12
  font-size: var(--font-size-sm);
27
13
  line-height: 1;
28
14
 
29
- border: var(--border-width-thin) solid transparent;
30
- border-radius: var(--border-radius-default);
15
+ height: var(--component-size-md);
16
+ min-block-size: calc(var(--component-size-md) + var(--density));
31
17
 
32
18
  padding-inline: var(--control-padding-x);
33
19
  padding-block: calc(var(--control-padding-y) + var(--density));
34
- min-block-size: calc(var(--component-size-md) + var(--density));
35
20
 
21
+ border-width: var(--border-width-thin, 1px);
22
+ border-style: solid;
23
+ border-color: transparent;
24
+
25
+ border-radius: var(--border-radius-default);
36
26
  cursor: pointer;
37
27
  user-select: none;
38
28
  white-space: nowrap;
29
+ }
39
30
 
31
+ .button:hover {
40
32
  transition:
41
33
  background-color var(--transition-fast) var(--ease-standard),
42
34
  color var(--transition-fast) var(--ease-standard),
43
35
  border-color var(--transition-fast) var(--ease-standard),
44
36
  box-shadow var(--transition-fast) var(--ease-standard);
45
37
  }
46
-
47
38
  .button:focus-visible {
48
39
  outline: none;
49
40
  box-shadow: var(--focus-ring);
@@ -53,104 +44,176 @@
53
44
  .button[aria-disabled='true'] {
54
45
  cursor: not-allowed;
55
46
  pointer-events: none;
56
- color: var(--color-disabled-text);
57
47
  background-color: var(--color-disabled-bg);
58
48
  border-color: var(--color-disabled-border);
49
+ color: var(--color-disabled-fg);
50
+ }
51
+
52
+ /* ==========================================================================
53
+ * LINK STYLE
54
+ * ======================================================================= */
55
+
56
+ .link {
57
+ text-decoration: none;
58
+ font-size: var(--font-size-sm);
59
+ color: var(--color-link);
60
+ transition:
61
+ color var(--transition-fast) var(--ease-standard),
62
+ text-decoration-color var(--transition-fast) var(--ease-standard);
63
+ text-underline-offset: 0.15em;
59
64
  }
60
65
 
66
+ .link:focus-visible {
67
+ outline: none;
68
+ box-shadow: var(--focus-ring);
69
+ }
70
+
71
+ /* Icons */
61
72
  .button svg,
62
73
  .icon svg {
63
- inline-size: var(--icon-size);
64
- block-size: var(--icon-size);
74
+ inline-size: var(--icon-size-md);
75
+ block-size: var(--icon-size-md);
65
76
  }
77
+
66
78
  .icon {
67
79
  display: inline-flex;
68
80
  }
69
81
 
70
- .button.sm {
82
+ /* ==========================================================================
83
+ * SIZES
84
+ * ======================================================================= */
85
+
86
+ .button.xs {
87
+ height: var(--component-size-xs);
88
+ min-block-size: calc(var(--component-size-sm) + var(--density));
71
89
  padding-inline: var(--spacing-sm);
90
+ }
91
+
92
+ .button.sm {
93
+ height: var(--component-size-sm);
72
94
  min-block-size: calc(var(--component-size-sm) + var(--density));
95
+ padding-inline: var(--spacing-sm);
73
96
  }
97
+
98
+ .button.xs {
99
+ height: var(--component-size-xs);
100
+ min-block-size: calc(var(--component-size-xs) + var(--density));
101
+ padding-inline: var(--spacing-xs);
102
+ font-size: var(--font-size-xs);
103
+ }
104
+
105
+ .button.sm svg {
106
+ inline-size: var(--icon-size-sm);
107
+ block-size: var(--icon-size-sm);
108
+ }
109
+
74
110
  .button.lg {
75
- padding-inline: var(--spacing-lg);
111
+ height: var(--component-size-lg);
76
112
  min-block-size: calc(var(--component-size-lg) + var(--density));
113
+ padding-inline: var(--spacing-lg);
114
+ }
115
+
116
+ .button.fullWidth {
117
+ width: 100%;
77
118
  }
78
119
 
120
+ /* ==========================================================================
121
+ * VARIANTS (semantic token-based)
122
+ * ======================================================================= */
123
+
79
124
  .primary {
80
- background-color: var(--color-primary);
81
- color: var(--color-text-on-primary);
125
+ background-color: var(--button-bg-primary);
126
+ color: var(--button-fg-primary);
82
127
  border-color: transparent;
83
128
  }
129
+
84
130
  .primary:hover {
85
- background-color: var(--color-primary-hover);
131
+ background-color: var(--button-bg-primary-hover);
86
132
  }
87
133
 
88
134
  .secondary {
89
- background-color: var(--color-secondary);
90
- color: var(--color-text-on-secondary);
91
- border-color: transparent;
135
+ background-color: var(--button-bg-secondary);
136
+ color: var(--button-fg-secondary);
137
+ border-color: var(--button-border-secondary);
92
138
  }
139
+
93
140
  .secondary:hover {
94
- background-color: var(--color-secondary-hover);
141
+ background-color: var(--button-bg-secondary-hover);
142
+ border-color: var(--color-border-strong);
95
143
  }
96
144
 
97
145
  .default {
98
- background-color: var(--color-surface);
99
- color: var(--color-text);
100
- border-color: var(--color-border);
146
+ background-color: var(--color-bg-surface);
147
+ color: var(--color-fg-default);
148
+ border-color: var(--color-border-subtle);
101
149
  }
150
+
102
151
  .default:hover {
103
- background-color: var(--color-surface-hover);
104
- border-color: var(--color-border-strong);
152
+ background-color: var(--color-bg-hover-subtle);
153
+ border-color: var(--color-border-default);
105
154
  }
106
155
 
107
156
  .outlined {
108
157
  background-color: transparent;
109
- color: var(--color-text);
110
- border-color: var(--color-border);
158
+ color: var(--color-fg-default);
159
+ border-width: var(--border-width-thin, 1px);
160
+ border-style: solid;
161
+ border-color: var(--color-border-default);
111
162
  }
112
- .outlined:hover {
163
+
164
+ .outlined:not(.active):hover {
165
+ background-color: var(--color-bg-hover-subtle);
113
166
  border-color: var(--color-border-strong);
114
167
  }
115
168
 
116
169
  .success {
117
170
  background-color: transparent;
118
- color: var(--color-text-success);
119
- border-color: var(--color-border-success);
171
+ color: var(--color-status-success-fg);
172
+ border-color: var(--color-status-success-border);
120
173
  }
174
+
121
175
  .success .icon {
122
- color: var(--color-success);
176
+ color: var(--color-status-success);
123
177
  }
178
+
124
179
  .success:hover {
125
- border-color: var(--color-text);
180
+ border-color: var(--color-fg-default);
126
181
  }
127
182
 
128
183
  .danger {
129
184
  background-color: transparent;
130
- color: var(--color-text-error);
131
- border-color: var(--color-border-error);
185
+ color: var(--color-status-error-fg);
186
+ border-color: var(--color-status-error-border);
132
187
  }
188
+
133
189
  .danger .icon {
134
- color: var(--color-error);
190
+ color: var(--color-status-error);
135
191
  }
192
+
136
193
  .danger:hover {
137
- border-color: var(--color-text);
194
+ border-color: var(--color-fg-default);
138
195
  }
139
196
 
140
197
  .button.inline {
141
- padding: var(--spacing-xxs);
142
- min-block-size: unset;
143
198
  background-color: transparent;
144
- color: var(--color-text);
145
199
  border-color: transparent;
200
+ padding: var(--spacing-xxs);
201
+ min-block-size: unset;
202
+ block-size: unset;
203
+ height: unset;
204
+ color: var(--color-fg-default);
146
205
  }
147
206
 
148
207
  .button.inline:hover {
149
- background-color: var(--color-surface-hover);
208
+ background-color: var(--color-bg-contextual);
150
209
  }
151
210
 
152
211
  .active {
153
- background-color: var(--color-primary);
154
- color: var(--color-text-on-primary);
212
+ background-color: var(--button-bg-primary);
213
+ color: var(--button-fg-primary);
155
214
  border-color: var(--color-border-selected);
156
215
  }
216
+
217
+ .active:hover {
218
+ background-color: var(--button-bg-primary-hover);
219
+ }
@@ -3,27 +3,67 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var Headline = require('../headline/Headline');
5
5
  var styles = require('./Card.module.css');
6
+ var SkeletonLoaderItem = require('../skeleton-loader/skeleton-loader-item/SkeletonLoaderItem');
7
+ var Link = require('../link/Link');
6
8
 
7
9
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
10
 
9
11
  var styles__default = /*#__PURE__*/_interopDefault(styles);
10
12
 
11
- function Card({ header, content, image, link: Link, width }) {
12
- const cardContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.imageContainer, children: image }),
13
+ function Card({
14
+ title,
15
+ loading,
16
+ variant = "default",
17
+ size = "md",
18
+ headerMarker = true,
19
+ headerIcon,
20
+ severity,
21
+ image,
22
+ imgPlacement = "left",
23
+ mediaWidth,
24
+ actions,
25
+ headerMeta,
26
+ sectionTitle,
27
+ showSectionDivider = false,
28
+ children,
29
+ link,
30
+ width
31
+ }) {
32
+ const outerContainerStyle = width ? { ["--width"]: `${width}%` } : void 0;
33
+ const mediaStyle = mediaWidth ? { ["--card-media-width"]: `${mediaWidth}px` } : void 0;
34
+ const innerPlacementClass = imgPlacement === "top" ? styles__default.default.innerImgTop : imgPlacement === "right" ? styles__default.default.innerImgRight : styles__default.default.innerImgLeft;
35
+ const inner = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${styles__default.default.inner} ${innerPlacementClass}`, children: [
36
+ image && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.media, style: mediaStyle, children: image }),
14
37
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.content, children: [
15
- /* @__PURE__ */ jsxRuntime.jsx(Headline.Headline, { marker: true, severity: "brand", size: 2, weight: 500, children: header }),
16
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: content })
38
+ (title || headerMeta) && /* @__PURE__ */ jsxRuntime.jsxs("header", { className: styles__default.default.header, children: [
39
+ title && /* @__PURE__ */ jsxRuntime.jsx(
40
+ Headline.Headline,
41
+ {
42
+ severity,
43
+ marker: headerMarker,
44
+ icon: headerIcon,
45
+ size: 4,
46
+ weight: 500,
47
+ disableMargin: true,
48
+ children: title
49
+ }
50
+ ),
51
+ headerMeta && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.headerMeta, children: headerMeta })
52
+ ] }),
53
+ loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.loadingList, children: Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.loadingRow, children: [
54
+ /* @__PURE__ */ jsxRuntime.jsx(SkeletonLoaderItem.SkeletonLoaderItem, {}),
55
+ /* @__PURE__ */ jsxRuntime.jsx(SkeletonLoaderItem.SkeletonLoaderItem, { width: "100%" })
56
+ ] }, index)) }),
57
+ !loading && (showSectionDivider || sectionTitle) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.section, children: [
58
+ showSectionDivider && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.sectionDivider }),
59
+ sectionTitle && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.sectionTitle, children: sectionTitle })
60
+ ] }),
61
+ !loading && children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.body, children }),
62
+ !loading && actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.actions, children: actions })
17
63
  ] })
18
64
  ] });
19
- return /* @__PURE__ */ jsxRuntime.jsx(
20
- "div",
21
- {
22
- className: styles__default.default.container,
23
- style: width ? { ["--width"]: `${width}%` } : void 0,
24
- children: Link ? /* @__PURE__ */ jsxRuntime.jsx(Link, { children: cardContent }) : cardContent
25
- }
26
- );
65
+ const cardWithLink = link ? /* @__PURE__ */ jsxRuntime.jsx(Link.Link, { component: link }) : inner;
66
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${styles__default.default.outerContainer} ${styles__default.default[size]}`, style: outerContainerStyle, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: [styles__default.default.container, styles__default.default[variant]].filter(Boolean).join(" "), children: cardWithLink }) });
27
67
  }
28
68
 
29
69
  exports.Card = Card;
@@ -1,11 +1,26 @@
1
+ import React, { JSXElementConstructor, ReactElement } from 'react';
2
+ import { Severity } from '@/constants/severity.types';
3
+ type CardVariant = 'default' | 'subtle' | 'strong';
4
+ type CardSize = 'sm' | 'md' | 'lg';
5
+ type CardImagePlacement = 'left' | 'right' | 'top';
1
6
  interface CardProps {
2
- header: string;
3
- content: React.ReactNode | string;
7
+ title?: string;
8
+ loading?: boolean;
9
+ variant?: CardVariant;
10
+ size?: CardSize;
11
+ headerMarker?: boolean;
12
+ headerIcon?: React.ReactNode;
13
+ severity?: Severity;
4
14
  image?: React.ReactNode;
5
- link?: React.ComponentType<{
6
- children: React.ReactNode;
7
- }>;
15
+ imgPlacement?: CardImagePlacement;
16
+ mediaWidth?: number;
17
+ actions?: React.ReactNode;
18
+ headerMeta?: React.ReactNode;
19
+ sectionTitle?: string;
20
+ showSectionDivider?: boolean;
21
+ children?: React.ReactNode;
22
+ link?: ReactElement<any, string | JSXElementConstructor<any>>;
8
23
  width?: 25 | 33 | 50 | 66 | 75 | 100;
9
24
  }
10
- export declare function Card({ header, content, image, link: Link, width }: CardProps): JSX.Element;
25
+ export declare function Card({ title, loading, variant, size, headerMarker, headerIcon, severity, image, imgPlacement, mediaWidth, actions, headerMeta, sectionTitle, showSectionDivider, children, link, width, }: CardProps): JSX.Element;
11
26
  export {};
@@ -1,23 +1,63 @@
1
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Headline } from '../headline/Headline';
3
3
  import styles from './Card.module.css';
4
+ import { SkeletonLoaderItem } from '../skeleton-loader/skeleton-loader-item/SkeletonLoaderItem';
5
+ import { Link } from '../link/Link';
4
6
 
5
- function Card({ header, content, image, link: Link, width }) {
6
- const cardContent = /* @__PURE__ */ jsxs(Fragment, { children: [
7
- /* @__PURE__ */ jsx("div", { className: styles.imageContainer, children: image }),
7
+ function Card({
8
+ title,
9
+ loading,
10
+ variant = "default",
11
+ size = "md",
12
+ headerMarker = true,
13
+ headerIcon,
14
+ severity,
15
+ image,
16
+ imgPlacement = "left",
17
+ mediaWidth,
18
+ actions,
19
+ headerMeta,
20
+ sectionTitle,
21
+ showSectionDivider = false,
22
+ children,
23
+ link,
24
+ width
25
+ }) {
26
+ const outerContainerStyle = width ? { ["--width"]: `${width}%` } : void 0;
27
+ const mediaStyle = mediaWidth ? { ["--card-media-width"]: `${mediaWidth}px` } : void 0;
28
+ const innerPlacementClass = imgPlacement === "top" ? styles.innerImgTop : imgPlacement === "right" ? styles.innerImgRight : styles.innerImgLeft;
29
+ const inner = /* @__PURE__ */ jsxs("div", { className: `${styles.inner} ${innerPlacementClass}`, children: [
30
+ image && /* @__PURE__ */ jsx("div", { className: styles.media, style: mediaStyle, children: image }),
8
31
  /* @__PURE__ */ jsxs("div", { className: styles.content, children: [
9
- /* @__PURE__ */ jsx(Headline, { marker: true, severity: "brand", size: 2, weight: 500, children: header }),
10
- /* @__PURE__ */ jsx("div", { children: content })
32
+ (title || headerMeta) && /* @__PURE__ */ jsxs("header", { className: styles.header, children: [
33
+ title && /* @__PURE__ */ jsx(
34
+ Headline,
35
+ {
36
+ severity,
37
+ marker: headerMarker,
38
+ icon: headerIcon,
39
+ size: 4,
40
+ weight: 500,
41
+ disableMargin: true,
42
+ children: title
43
+ }
44
+ ),
45
+ headerMeta && /* @__PURE__ */ jsx("div", { className: styles.headerMeta, children: headerMeta })
46
+ ] }),
47
+ loading && /* @__PURE__ */ jsx("div", { className: styles.loadingList, children: Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ jsxs("div", { className: styles.loadingRow, children: [
48
+ /* @__PURE__ */ jsx(SkeletonLoaderItem, {}),
49
+ /* @__PURE__ */ jsx(SkeletonLoaderItem, { width: "100%" })
50
+ ] }, index)) }),
51
+ !loading && (showSectionDivider || sectionTitle) && /* @__PURE__ */ jsxs("div", { className: styles.section, children: [
52
+ showSectionDivider && /* @__PURE__ */ jsx("div", { className: styles.sectionDivider }),
53
+ sectionTitle && /* @__PURE__ */ jsx("div", { className: styles.sectionTitle, children: sectionTitle })
54
+ ] }),
55
+ !loading && children && /* @__PURE__ */ jsx("div", { className: styles.body, children }),
56
+ !loading && actions && /* @__PURE__ */ jsx("div", { className: styles.actions, children: actions })
11
57
  ] })
12
58
  ] });
13
- return /* @__PURE__ */ jsx(
14
- "div",
15
- {
16
- className: styles.container,
17
- style: width ? { ["--width"]: `${width}%` } : void 0,
18
- children: Link ? /* @__PURE__ */ jsx(Link, { children: cardContent }) : cardContent
19
- }
20
- );
59
+ const cardWithLink = link ? /* @__PURE__ */ jsx(Link, { component: link }) : inner;
60
+ return /* @__PURE__ */ jsx("div", { className: `${styles.outerContainer} ${styles[size]}`, style: outerContainerStyle, children: /* @__PURE__ */ jsx("div", { className: [styles.container, styles[variant]].filter(Boolean).join(" "), children: cardWithLink }) });
21
61
  }
22
62
 
23
63
  export { Card };
@@ -1,15 +1,18 @@
1
- /* Card container */
1
+ /* OUTER WRAPPER (optional width control) */
2
+ .outerContainer {
3
+ inline-size: var(--width, 100%);
4
+ }
5
+
6
+ /* CARD CONTAINER */
2
7
  .container {
3
8
  inline-size: 100%;
4
- color: var(--color-text);
5
- background: var(--color-surface);
6
- border: var(--border-width-thin) solid var(--color-border);
7
- border-radius: var(--border-radius-lg);
8
-
9
- /* elevation */
10
- box-shadow: var(--shadow-sm);
11
- padding: var(--spacing-md);
12
-
9
+ position: relative;
10
+ color: var(--card-fg-default, var(--color-fg-default));
11
+ background-color: var(--card-bg-default, var(--color-bg-surface));
12
+ border-radius: var(--border-radius-md);
13
+ border: var(--border-width-thin) solid var(--color-border-subtle);
14
+ box-shadow: var(--shadow-xs);
15
+ padding-block: 0;
13
16
  transition:
14
17
  color var(--transition-fast) var(--ease-standard),
15
18
  box-shadow var(--transition-fast) var(--ease-standard),
@@ -17,53 +20,154 @@
17
20
  }
18
21
 
19
22
  .container:hover {
20
- color: var(--color-highlight);
21
- cursor: pointer;
22
- box-shadow: var(--shadow-lg);
23
- transform: translateY(-2px);
23
+ box-shadow: var(--shadow-sm);
24
+ }
25
+
26
+ /* BACKGROUND VARIANTS */
27
+ .container.default {
28
+ background-color: var(--card-bg-default, var(--color-bg-surface));
29
+ }
30
+
31
+ .container.subtle {
32
+ background-color: var(--card-bg-subtle, var(--color-bg-surface-subtle));
33
+ }
34
+
35
+ .container.strong {
36
+ background-color: var(--card-bg-strong, var(--color-bg-surface-strong));
37
+ color: var(--card-fg-on-strong, var(--color-fg-on-strong));
38
+ }
39
+
40
+ /* SIZE VARIANTS */
41
+ .sm .inner {
42
+ padding: var(--spacing-md);
43
+ gap: var(--spacing-md);
44
+ }
45
+
46
+ .md .inner {
47
+ padding: var(--spacing-lg);
48
+ gap: var(--spacing-lg);
24
49
  }
25
50
 
26
- /* Responsive width (uses your width var if provided) */
27
- @media screen and (min-width: 768px) {
28
- .container {
29
- inline-size: calc(var(--width, 100%) - var(--spacing-md));
30
- }
51
+ .lg .inner {
52
+ padding: var(--spacing-xl);
53
+ gap: var(--spacing-xl);
31
54
  }
32
55
 
33
- /* Media note: if you use custom media, define:
34
- @custom-media --dbc-bp-md (min-width: 768px);
35
- then swap the query above to: @media (--dbc-bp-md) { ... } */
56
+ /* INNER LAYOUT */
57
+ .inner {
58
+ margin-inline: auto;
59
+ display: flex;
60
+ align-items: flex-start;
61
+ }
62
+
63
+ /* Media placement */
64
+ .innerImgTop {
65
+ flex-direction: column;
66
+ }
36
67
 
37
- /* Image wrapper */
38
- .imageContainer {
39
- overflow: hidden;
40
- border-start-start-radius: var(--border-radius-lg);
41
- border-start-end-radius: var(--border-radius-lg);
68
+ .innerImgLeft {
69
+ flex-direction: row;
42
70
  }
43
71
 
44
- /* Media */
45
- .container img {
72
+ .innerImgRight {
73
+ flex-direction: row-reverse;
74
+ }
75
+
76
+ /* MEDIA */
77
+ .media {
78
+ flex: 0 0 auto;
79
+ display: flex;
80
+ align-items: flex-start;
81
+ justify-content: center;
82
+ }
83
+
84
+ .innerImgLeft .media,
85
+ .innerImgRight .media {
86
+ inline-size: var(--card-media-width, 56px);
87
+ max-inline-size: 25%;
88
+ }
89
+
90
+ .innerImgTop .media {
91
+ inline-size: 100%;
92
+ max-inline-size: 100%;
93
+ }
94
+
95
+ .media img,
96
+ .media picture,
97
+ .media video,
98
+ .media svg {
99
+ display: block;
46
100
  inline-size: 100%;
47
101
  block-size: auto;
48
- border-block-end: var(--border-width-thin) solid var(--color-border);
49
- transform: scale(1);
50
102
  }
51
103
 
52
- /* Headings & text */
53
- .container h3 {
54
- margin: var(--spacing-sm) 0;
55
- color: inherit;
104
+ /* CONTENT */
105
+ .content {
106
+ flex: 1 1 auto; /* important: allow content column to grow */
107
+ min-inline-size: 0; /* prevents overflow in flex layouts */
108
+ display: flex;
109
+ flex-direction: column;
110
+ gap: var(--spacing-md);
111
+ }
112
+
113
+ /* HEADER */
114
+ .header {
115
+ display: flex;
116
+ align-items: flex-start;
117
+ justify-content: space-between;
118
+ gap: var(--spacing-sm);
119
+ }
120
+
121
+ .value {
122
+ font-weight: 600;
123
+ white-space: nowrap;
124
+ }
125
+
126
+ .headerMeta {
127
+ display: flex;
128
+ align-items: center;
129
+ gap: var(--spacing-xs);
130
+ }
131
+
132
+ /* LOADING */
133
+ .loadingList {
134
+ display: grid;
135
+ gap: var(--spacing-sm);
136
+ }
137
+
138
+ .loadingRow {
139
+ display: grid;
140
+ grid-template-columns: auto 1fr;
141
+ gap: var(--spacing-sm);
142
+ align-items: center;
143
+ }
144
+
145
+ /* SECTION */
146
+ .section {
147
+ display: flex;
148
+ flex-direction: column;
149
+ gap: var(--spacing-md);
150
+ }
151
+
152
+ .sectionDivider {
153
+ inline-size: 100%;
154
+ block-size: var(--border-width-thin);
155
+ background: var(--color-border-subtle);
156
+ }
157
+
158
+ .sectionTitle {
159
+ font-weight: 600;
56
160
  }
57
161
 
58
- .container p {
59
- margin: var(--spacing-sm) 0;
60
- line-height: var(--line-height-tight);
162
+ /* BODY */
163
+ .body {
164
+ /* leave this as a neutral container; consumers render their own layout */
61
165
  }
62
166
 
63
- /* Optional: image hover zoom (tokenized) */
64
- /*
65
- .container:hover img {
66
- transition: transform var(--transition-normal) var(--ease-standard);
67
- transform: scale(1.02);
167
+ /* ACTIONS (bottom-right) */
168
+ .actions {
169
+ margin-top: auto; /* pushes actions to bottom of the content column */
170
+ display: flex;
171
+ justify-content: flex-end; /* right-align buttons */
172
+ gap: var(--spacing-sm);
68
173
  }
69
- */