@dbcdk/react-components 0.0.49 → 0.0.51

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.
@@ -90,8 +90,8 @@ id, options, selectedValue, onChange, baseDate, placeholder = 'Vælg interval',
90
90
  }, size: size, type: "button", "aria-haspopup": "listbox", "aria-expanded": !!isOpen, "aria-controls": listboxId, "aria-invalid": Boolean(error) || undefined, "aria-describedby": describedBy, children: _jsxs("span", { className: "dbc-flex dbc-justify-between dbc-items-center dbc-gap-xxs", style: { width: '100%' }, children: [_jsx("span", { className: "dbc-flex dbc-items-center dbc-gap-xxs", children: selected ? selected.label : placeholder }), onClear && selected && _jsx(ClearButton, { onClick: onClear }), icon] }) })), children: _jsx(Menu, { id: listboxId, onKeyDown: handleKeyDown, role: "listbox", children: options.map((opt, index) => {
91
91
  const isSelected = opt.minutesAgo === selectedValue;
92
92
  const isActive = index === activeIndex;
93
- return (_jsx(Menu.Item, { active: isActive,
93
+ return (_jsx(Menu.Item, { active: isActive, selected: isSelected,
94
94
  // IMPORTANT: listbox uses role="option"
95
- itemRole: "option", "aria-selected": isSelected, children: _jsxs("button", { ref: el => (optionRefs.current[index] = el), type: "button", tabIndex: isActive ? 0 : -1, onClick: () => handleCommit(opt), onFocus: () => setActiveIndex(index), style: { display: 'flex', alignItems: 'center', width: '100%' }, children: [_jsx("span", { style: { width: 16, display: 'inline-flex', justifyContent: 'center' }, children: isSelected ? _jsx(Check, {}) : null }), opt.label] }) }, opt.minutesAgo));
95
+ itemRole: "option", children: _jsxs("button", { ref: el => (optionRefs.current[index] = el), type: "button", tabIndex: isActive ? 0 : -1, "aria-selected": isSelected, onClick: () => handleCommit(opt), onFocus: () => setActiveIndex(index), style: { display: 'flex', alignItems: 'center', width: '100%' }, children: [_jsx("span", { style: { width: 16, display: 'inline-flex', justifyContent: 'center' }, children: isSelected ? _jsx(Check, {}) : null }), opt.label] }) }, opt.minutesAgo));
96
96
  }) }) }), (error || helpText) && (_jsx("span", { id: describedById, style: { display: 'none' }, children: error !== null && error !== void 0 ? error : helpText }))] }));
97
97
  }
@@ -9,10 +9,6 @@
9
9
  flex-direction: column;
10
10
  }
11
11
 
12
- .container > li + li {
13
- margin-block-start: var(--spacing-xxs);
14
- }
15
-
16
12
  .row {
17
13
  display: block;
18
14
  }
@@ -28,7 +24,7 @@
28
24
  text-decoration: none;
29
25
 
30
26
  /* choose your density */
31
- padding-block: var(--spacing-xxs);
27
+ padding-block: var(--spacing-xs);
32
28
  padding-inline: var(--spacing-md);
33
29
 
34
30
  background: transparent;
@@ -69,10 +65,10 @@
69
65
  display: flex;
70
66
  align-items: flex-start;
71
67
  inline-size: 100%;
72
- padding-block: 2px;
68
+ padding-block: var(--spacing-xs);
73
69
  padding-inline: var(--spacing-md);
74
70
  border-radius: var(--border-radius-sm);
75
- cursor: default;
71
+ cursor: pointer;
76
72
  }
77
73
 
78
74
  /* NEW: let Checkbox/Radio consume full width so the hover area feels right */
@@ -88,41 +84,46 @@
88
84
  align-items: center;
89
85
  gap: var(--spacing-sm);
90
86
  inline-size: 100%;
91
- cursor: default;
87
+ cursor: pointer;
92
88
  }
93
89
 
94
90
  .row :global(.label) {
95
91
  flex: 1 1 auto;
96
- cursor: default;
92
+ cursor: pointer;
97
93
  }
98
94
 
99
95
  .row :global(.label) * {
100
- cursor: default;
96
+ cursor: pointer;
97
+ }
98
+
99
+ .row + .row .interactive,
100
+ .row + .row > .interactiveChild {
101
+ box-shadow: inset 0 1px 0 var(--color-border-subtle);
101
102
  }
102
103
 
103
104
  /* Hover: support both cases (interactive element, or wrapper child) */
104
105
  .interactive:hover:not(.selected),
105
106
  .row:hover > .interactiveChild:not(.selected) {
106
- background-color: var(--color-bg-toolbar-hover);
107
+ background-color: var(--color-bg-hover-subtle);
107
108
  }
108
109
 
109
110
  /* Focus ring: support both cases */
110
111
  .interactive:focus-visible {
111
112
  outline: none;
112
- box-shadow: var(--focus-ring);
113
+ box-shadow: inset 0 0 0 1px var(--color-border-selected);
113
114
  }
114
115
 
115
116
  /* If wrapper contains a focusable element, show ring when any child is focused */
116
117
  .row:focus-within > .interactiveChild {
117
118
  outline: none;
118
- box-shadow: var(--focus-ring);
119
+ box-shadow: inset 0 0 0 1px var(--color-border-selected);
119
120
  }
120
121
 
121
122
  /* Keyboard active/current item */
122
123
  .active,
123
124
  .interactive.active,
124
125
  .row > .interactiveChild.active {
125
- background-color: var(--color-bg-toolbar-hover);
126
+ background-color: var(--color-bg-hover-subtle);
126
127
  }
127
128
 
128
129
  /* Selected item */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbcdk/react-components",
3
- "version": "0.0.49",
3
+ "version": "0.0.51",
4
4
  "description": "Reusable React components for DBC projects",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -56,11 +56,8 @@
56
56
  "changeset": "changeset",
57
57
  "version-packages": "changeset version",
58
58
  "typecheck": "tsc -p tsconfig.json --noEmit",
59
- "pack-it": "rimraf ./*.tgz && npm run build && npm pack",
60
- "postbuild": "cpy \"src/**/*.css\" dist --parents && cpy \"src/styles/styles.css\" dist && cpy \"src/styles/fonts/**/*\" dist/styles/fonts",
61
- "yalc:publish": "npm run build && yalc publish --push",
62
- "yalc:push": "npm run build && yalc push --scripts --changed",
63
- "yalc:watch": "chokidar 'src/**/*' -c 'npm run yalc:push'"
59
+ "pack:local": "rimraf ./*.tgz && npm run build && npm pack",
60
+ "postbuild": "cpy \"src/**/*.css\" dist --parents && cpy \"src/styles/styles.css\" dist && cpy \"src/styles/fonts/**/*\" dist/styles/fonts"
64
61
  },
65
62
  "peerDependencies": {
66
63
  "@tanstack/react-table": "^8.21.3",