@inbeat/ui 0.10.0 → 0.11.1
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/CHANGELOG.md +14 -0
- package/package.json +2 -2
- package/src/components/multi-select-popover.tsx +25 -30
- package/src/components/table.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.11.1](https://github.com/Genoux/ib-toolkit/compare/ui-v0.11.0...ui-v0.11.1) (2026-10-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **ui:** reduce table row radius to lg ([#54](https://github.com/Genoux/ib-toolkit/issues/54)) ([597ef96](https://github.com/Genoux/ib-toolkit/commit/597ef96327be82c562c0e616920f1ec09f888032))
|
|
9
|
+
|
|
10
|
+
## [0.11.0](https://github.com/Genoux/ib-toolkit/compare/ui-v0.10.0...ui-v0.11.0) (2026-10-08)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **ui:** custom trigger label and full list props on multi-select ([#52](https://github.com/Genoux/ib-toolkit/issues/52)) ([072c6bd](https://github.com/Genoux/ib-toolkit/commit/072c6bdf10201136e15379c699a804cc0b4e15e6))
|
|
16
|
+
|
|
3
17
|
## [0.10.0](https://github.com/Genoux/ib-toolkit/compare/ui-v0.9.4...ui-v0.10.0) (2026-10-08)
|
|
4
18
|
|
|
5
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inbeat/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "inBeat design tokens and primitives (Radix + Tailwind v4), shipped as source",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@base-ui/react": "^1.2.0",
|
|
65
65
|
"@fontsource-variable/geist": "^5.3.0",
|
|
66
66
|
"@fontsource-variable/geist-mono": "^5.3.0",
|
|
67
|
-
"@inbeat/config": "^0.
|
|
67
|
+
"@inbeat/config": "^0.11.1",
|
|
68
68
|
"@storybook/addon-a11y": "^10.6.0",
|
|
69
69
|
"@storybook/addon-docs": "^10.6.0",
|
|
70
70
|
"@storybook/addon-themes": "^10.6.0",
|
|
@@ -6,7 +6,7 @@ import { SearchInput } from "./search-input";
|
|
|
6
6
|
import { selectTriggerClassName } from "./select";
|
|
7
7
|
import { Spinner } from "./spinner";
|
|
8
8
|
import { ChevronDownIcon } from "lucide-react";
|
|
9
|
-
import { useMemo, useState } from "react";
|
|
9
|
+
import { type ReactNode, useMemo, useState } from "react";
|
|
10
10
|
import { cn } from "../lib/utils";
|
|
11
11
|
import { PersonAvatar } from "./person-identity";
|
|
12
12
|
|
|
@@ -50,6 +50,19 @@ export function getMultiSelectLabel({
|
|
|
50
50
|
return `${placeholder} (${selectedValues.length})`;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
export type MultiSelectOptionListProps = {
|
|
54
|
+
options: MultiSelectOption[];
|
|
55
|
+
selectedValues: string[];
|
|
56
|
+
onToggle: (value: string) => void;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
emptyMessage?: string;
|
|
59
|
+
isPending?: boolean;
|
|
60
|
+
keepOpenOnToggle?: boolean;
|
|
61
|
+
idPrefix?: string;
|
|
62
|
+
searchable?: boolean;
|
|
63
|
+
searchPlaceholder?: string;
|
|
64
|
+
};
|
|
65
|
+
|
|
53
66
|
export function MultiSelectOptionList({
|
|
54
67
|
options,
|
|
55
68
|
selectedValues,
|
|
@@ -61,18 +74,7 @@ export function MultiSelectOptionList({
|
|
|
61
74
|
idPrefix = "multi-select-option",
|
|
62
75
|
searchable,
|
|
63
76
|
searchPlaceholder = "Search…",
|
|
64
|
-
}: {
|
|
65
|
-
options: MultiSelectOption[];
|
|
66
|
-
selectedValues: string[];
|
|
67
|
-
onToggle: (value: string) => void;
|
|
68
|
-
disabled?: boolean;
|
|
69
|
-
emptyMessage?: string;
|
|
70
|
-
isPending?: boolean;
|
|
71
|
-
keepOpenOnToggle?: boolean;
|
|
72
|
-
idPrefix?: string;
|
|
73
|
-
searchable?: boolean;
|
|
74
|
-
searchPlaceholder?: string;
|
|
75
|
-
}) {
|
|
77
|
+
}: MultiSelectOptionListProps) {
|
|
76
78
|
const [query, setQuery] = useState("");
|
|
77
79
|
const visibleOptions = useMemo(() => {
|
|
78
80
|
const q = query.trim().toLowerCase();
|
|
@@ -144,27 +146,24 @@ export function MultiSelectOptionList({
|
|
|
144
146
|
|
|
145
147
|
export function MultiSelectPopover({
|
|
146
148
|
placeholder,
|
|
147
|
-
selectedValues,
|
|
148
|
-
options,
|
|
149
149
|
onChange,
|
|
150
|
+
renderLabel,
|
|
150
151
|
triggerClassName = "min-w-36 w-44 max-w-44",
|
|
151
152
|
contentClassName = "w-72 overflow-hidden",
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
idPrefix,
|
|
155
|
-
}: {
|
|
153
|
+
...listProps
|
|
154
|
+
}: Omit<MultiSelectOptionListProps, "onToggle"> & {
|
|
156
155
|
placeholder: string;
|
|
157
|
-
selectedValues: string[];
|
|
158
|
-
options: MultiSelectOption[];
|
|
159
156
|
onChange: (values: string[]) => void;
|
|
157
|
+
renderLabel?: (selectedOptions: MultiSelectOption[]) => ReactNode;
|
|
160
158
|
triggerClassName?: string;
|
|
161
159
|
contentClassName?: string;
|
|
162
|
-
emptyMessage?: string;
|
|
163
|
-
disabled?: boolean;
|
|
164
|
-
idPrefix?: string;
|
|
165
160
|
}) {
|
|
161
|
+
const { options, selectedValues, disabled } = listProps;
|
|
166
162
|
const isActive = selectedValues.length > 0;
|
|
167
|
-
const triggerLabel =
|
|
163
|
+
const triggerLabel =
|
|
164
|
+
isActive && renderLabel
|
|
165
|
+
? renderLabel(options.filter((option) => selectedValues.includes(option.value)))
|
|
166
|
+
: getMultiSelectLabel({ placeholder, selectedValues, options });
|
|
168
167
|
|
|
169
168
|
return (
|
|
170
169
|
<Popover modal={false}>
|
|
@@ -191,12 +190,8 @@ export function MultiSelectPopover({
|
|
|
191
190
|
onWheel={(event) => event.stopPropagation()}
|
|
192
191
|
>
|
|
193
192
|
<MultiSelectOptionList
|
|
194
|
-
|
|
195
|
-
selectedValues={selectedValues}
|
|
193
|
+
{...listProps}
|
|
196
194
|
onToggle={(value) => onChange(toggleMultiSelectValue(selectedValues, value))}
|
|
197
|
-
disabled={disabled}
|
|
198
|
-
emptyMessage={emptyMessage}
|
|
199
|
-
idPrefix={idPrefix}
|
|
200
195
|
/>
|
|
201
196
|
</PopoverContent>
|
|
202
197
|
</Popover>
|
package/src/components/table.tsx
CHANGED
|
@@ -14,7 +14,7 @@ function Table({ className, ...props }: React.ComponentProps<"table">) {
|
|
|
14
14
|
data-slot="table"
|
|
15
15
|
className={cn(
|
|
16
16
|
"w-full border-separate border-spacing-x-0 border-spacing-y-1.5 text-sm",
|
|
17
|
-
"[&_tbody_tr>td:first-child]:rounded-l-
|
|
17
|
+
"[&_tbody_tr>td:first-child]:rounded-l-lg [&_tbody_tr>td:last-child]:rounded-r-lg",
|
|
18
18
|
"[&_tbody_tr:hover>td]:bg-muted/50 [&_tbody_tr:focus-within>td]:bg-muted/50",
|
|
19
19
|
"[&_tbody_tr[data-state=selected]>td]:bg-muted",
|
|
20
20
|
"[&_tbody_tr>td]:transition-[background-color,color]",
|