@dbcdk/react-components 0.0.167 → 0.0.168
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.
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var lucideReact = require('lucide-react');
|
|
6
5
|
var react = require('react');
|
|
7
6
|
var Input = require('../../components/forms/input/Input');
|
|
8
7
|
var Typeahead = require('../../components/forms/typeahead/Typeahead');
|
|
@@ -69,7 +68,8 @@ function OperatorDropdown({
|
|
|
69
68
|
Popover.Popover,
|
|
70
69
|
{
|
|
71
70
|
ref: popRef,
|
|
72
|
-
minWidth: "
|
|
71
|
+
minWidth: "140px",
|
|
72
|
+
matchTriggerWidth: false,
|
|
73
73
|
trigger: (toggle, icon) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
74
74
|
"button",
|
|
75
75
|
{
|
|
@@ -86,10 +86,7 @@ function OperatorDropdown({
|
|
|
86
86
|
),
|
|
87
87
|
children: /* @__PURE__ */ jsxRuntime.jsx(Menu.Menu, { children: operators.map((op) => {
|
|
88
88
|
const selected = op === value;
|
|
89
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Menu.Menu.Item, { active: selected, children: /* @__PURE__ */ jsxRuntime.
|
|
90
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { width: 16, display: "inline-flex", justifyContent: "center" }, children: selected ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { size: 16 }) : null }),
|
|
91
|
-
LABELS[op]
|
|
92
|
-
] }) }, op);
|
|
89
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Menu.Menu.Item, { active: selected, children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => handleSelect(op), disabled, children: LABELS[op] }) }, op);
|
|
93
90
|
}) })
|
|
94
91
|
}
|
|
95
92
|
);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Check } from 'lucide-react';
|
|
4
3
|
import { useRef, useMemo, useState, useEffect } from 'react';
|
|
5
4
|
import { Input } from '../../components/forms/input/Input';
|
|
6
5
|
import { Typeahead } from '../../components/forms/typeahead/Typeahead';
|
|
@@ -63,7 +62,8 @@ function OperatorDropdown({
|
|
|
63
62
|
Popover,
|
|
64
63
|
{
|
|
65
64
|
ref: popRef,
|
|
66
|
-
minWidth: "
|
|
65
|
+
minWidth: "140px",
|
|
66
|
+
matchTriggerWidth: false,
|
|
67
67
|
trigger: (toggle, icon) => /* @__PURE__ */ jsxs(
|
|
68
68
|
"button",
|
|
69
69
|
{
|
|
@@ -80,10 +80,7 @@ function OperatorDropdown({
|
|
|
80
80
|
),
|
|
81
81
|
children: /* @__PURE__ */ jsx(Menu, { children: operators.map((op) => {
|
|
82
82
|
const selected = op === value;
|
|
83
|
-
return /* @__PURE__ */ jsx(Menu.Item, { active: selected, children: /* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */ jsx("span", { style: { width: 16, display: "inline-flex", justifyContent: "center" }, children: selected ? /* @__PURE__ */ jsx(Check, { size: 16 }) : null }),
|
|
85
|
-
LABELS[op]
|
|
86
|
-
] }) }, op);
|
|
83
|
+
return /* @__PURE__ */ jsx(Menu.Item, { active: selected, children: /* @__PURE__ */ jsx("button", { type: "button", onClick: () => handleSelect(op), disabled, children: LABELS[op] }) }, op);
|
|
87
84
|
}) })
|
|
88
85
|
}
|
|
89
86
|
);
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
background: var(--color-bg-surface);
|
|
26
26
|
border-color: var(--color-border-subtle);
|
|
27
27
|
box-shadow: var(--shadow-xs);
|
|
28
|
-
--filter-operator-bg: var(--color-bg-surface);
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
.filterField.surface:hover {
|
|
@@ -37,14 +36,12 @@
|
|
|
37
36
|
background: color-mix(in srgb, var(--color-bg-selected) 45%, var(--color-bg-surface));
|
|
38
37
|
border-color: var(--color-border-selected);
|
|
39
38
|
box-shadow: var(--shadow-sm);
|
|
40
|
-
--filter-operator-bg: color-mix(in srgb, var(--color-bg-selected) 45%, var(--color-bg-surface));
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
.filterField.outlined {
|
|
44
42
|
background: var(--color-bg-surface);
|
|
45
43
|
border-color: var(--color-border-subtle);
|
|
46
44
|
box-shadow: none;
|
|
47
|
-
--filter-operator-bg: var(--color-bg-surface);
|
|
48
45
|
}
|
|
49
46
|
|
|
50
47
|
.filterField.outlined:hover {
|
|
@@ -55,34 +52,22 @@
|
|
|
55
52
|
background: color-mix(in srgb, var(--color-bg-selected) 38%, var(--color-bg-surface));
|
|
56
53
|
border-color: var(--color-border-selected);
|
|
57
54
|
box-shadow: none;
|
|
58
|
-
--filter-operator-bg: color-mix(in srgb, var(--color-bg-selected) 38%, var(--color-bg-surface));
|
|
59
55
|
}
|
|
60
56
|
|
|
61
57
|
.filterField.subtle {
|
|
62
58
|
background: var(--color-bg-toolbar);
|
|
63
59
|
border-color: transparent;
|
|
64
60
|
box-shadow: inset 0 0 0 1px transparent;
|
|
65
|
-
--filter-operator-bg: color-mix(in srgb, var(--color-fg-default) 4%, var(--color-bg-toolbar));
|
|
66
61
|
}
|
|
67
62
|
|
|
68
63
|
.filterField.subtle:hover {
|
|
69
64
|
background: var(--color-bg-surface-strong);
|
|
70
|
-
--filter-operator-bg: color-mix(
|
|
71
|
-
in srgb,
|
|
72
|
-
var(--color-fg-default) 6%,
|
|
73
|
-
var(--color-bg-surface-strong)
|
|
74
|
-
);
|
|
75
65
|
}
|
|
76
66
|
|
|
77
67
|
.filterField.subtle.active {
|
|
78
68
|
background: color-mix(in srgb, var(--color-bg-selected) 55%, var(--color-bg-surface-strong));
|
|
79
69
|
border-color: var(--color-border-selected);
|
|
80
70
|
box-shadow: inset 0 0 0 1px transparent;
|
|
81
|
-
--filter-operator-bg: color-mix(
|
|
82
|
-
in srgb,
|
|
83
|
-
var(--color-bg-selected) 55%,
|
|
84
|
-
var(--color-bg-surface-strong)
|
|
85
|
-
);
|
|
86
71
|
}
|
|
87
72
|
|
|
88
73
|
.filterField.active .label {
|
|
@@ -145,10 +130,10 @@
|
|
|
145
130
|
display: inline-flex;
|
|
146
131
|
align-items: center;
|
|
147
132
|
padding-block: var(--spacing-2xs);
|
|
148
|
-
padding-inline: var(--spacing-xs);
|
|
149
|
-
padding-inline-end: var(--spacing-xxs);
|
|
133
|
+
padding-inline: var(--spacing-xs) 0;
|
|
150
134
|
font-size: var(--font-size-sm);
|
|
151
|
-
color: var(--color-fg-
|
|
135
|
+
color: var(--color-fg-default);
|
|
136
|
+
font-weight: 500;
|
|
152
137
|
white-space: nowrap;
|
|
153
138
|
user-select: none;
|
|
154
139
|
}
|
|
@@ -171,8 +156,8 @@
|
|
|
171
156
|
gap: var(--spacing-xxs);
|
|
172
157
|
height: 100%;
|
|
173
158
|
padding-block: var(--spacing-2xs);
|
|
174
|
-
padding-inline: var(--spacing-
|
|
175
|
-
color: var(--color-fg-
|
|
159
|
+
padding-inline: var(--spacing-xs) var(--spacing-sm);
|
|
160
|
+
color: var(--color-fg-muted);
|
|
176
161
|
background: transparent;
|
|
177
162
|
border: 0;
|
|
178
163
|
cursor: pointer;
|
|
@@ -187,47 +172,10 @@
|
|
|
187
172
|
white-space: nowrap;
|
|
188
173
|
}
|
|
189
174
|
|
|
190
|
-
.filterField .operatorTrigger::after {
|
|
191
|
-
content: '';
|
|
192
|
-
position: absolute;
|
|
193
|
-
inset: 1px 0;
|
|
194
|
-
background: var(--filter-operator-bg, transparent);
|
|
195
|
-
pointer-events: none;
|
|
196
|
-
z-index: 0;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.filterField .operatorTrigger > * {
|
|
200
|
-
position: relative;
|
|
201
|
-
z-index: 1;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
175
|
.filterField .operatorTrigger:hover:not(:disabled) {
|
|
205
176
|
color: var(--color-fg-default);
|
|
206
177
|
}
|
|
207
178
|
|
|
208
|
-
.filterField .operatorTrigger:hover:not(:disabled)::after {
|
|
209
|
-
background: color-mix(
|
|
210
|
-
in srgb,
|
|
211
|
-
var(--color-fg-default) 8%,
|
|
212
|
-
var(--filter-operator-bg, transparent)
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/* =========================
|
|
217
|
-
SEPARATORS
|
|
218
|
-
========================= */
|
|
219
|
-
|
|
220
|
-
.filterField .operatorTrigger::before {
|
|
221
|
-
content: '';
|
|
222
|
-
position: absolute;
|
|
223
|
-
inset-inline-start: 0;
|
|
224
|
-
top: 8px;
|
|
225
|
-
bottom: 8px;
|
|
226
|
-
width: 1px;
|
|
227
|
-
background: var(--color-border-subtle);
|
|
228
|
-
pointer-events: none;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
179
|
/* =========================
|
|
232
180
|
DISABLED
|
|
233
181
|
========================= */
|
|
@@ -240,21 +188,16 @@
|
|
|
240
188
|
|
|
241
189
|
.filterField.surface .operatorTrigger:disabled,
|
|
242
190
|
.filterField.outlined .operatorTrigger:disabled {
|
|
243
|
-
--filter-operator-bg: var(--color-disabled-bg);
|
|
244
191
|
}
|
|
245
192
|
|
|
246
193
|
.filterField.subtle .operatorTrigger:disabled {
|
|
247
|
-
--filter-operator-bg: color-mix(
|
|
248
|
-
in srgb,
|
|
249
|
-
var(--color-fg-default) 3%,
|
|
250
|
-
var(--color-bg-surface-subtle)
|
|
251
|
-
);
|
|
252
194
|
}
|
|
253
195
|
|
|
254
196
|
.operatorTrigger svg {
|
|
255
197
|
height: var(--component-size-xxs);
|
|
256
198
|
width: var(--component-size-xxs);
|
|
257
199
|
flex: 0 0 auto;
|
|
200
|
+
color: currentColor;
|
|
258
201
|
}
|
|
259
202
|
|
|
260
203
|
/* =========================
|
|
@@ -269,6 +212,7 @@
|
|
|
269
212
|
flex: 1 1 auto;
|
|
270
213
|
min-width: 0;
|
|
271
214
|
position: relative;
|
|
215
|
+
padding-inline-start: 0;
|
|
272
216
|
}
|
|
273
217
|
|
|
274
218
|
/* Base child sizing */
|
|
@@ -365,8 +309,9 @@
|
|
|
365
309
|
|
|
366
310
|
.filterField .operatorText {
|
|
367
311
|
white-space: nowrap;
|
|
368
|
-
font-family: var(--font-family
|
|
312
|
+
font-family: var(--font-family);
|
|
369
313
|
font-size: var(--font-size-xs);
|
|
314
|
+
color: currentColor;
|
|
370
315
|
}
|
|
371
316
|
|
|
372
317
|
.filterField input {
|