@neasg/design-system 0.4.32 → 0.4.35
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/dist/multi-select.d.ts +3 -1
- package/dist/multi-select.js +3 -3
- package/dist/table.js +5 -1
- package/package.json +5 -1
package/dist/multi-select.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export interface MultiSelectProps {
|
|
|
20
20
|
searchPlaceholder?: string;
|
|
21
21
|
/** Cap how many selected tags render in the trigger; the rest collapse into a `+N` badge. */
|
|
22
22
|
maxVisibleTags?: number;
|
|
23
|
+
/** Show a "Clear" button in the dropdown footer when items are selected. */
|
|
24
|
+
clearable?: boolean;
|
|
23
25
|
className?: string;
|
|
24
26
|
triggerClassName?: string;
|
|
25
27
|
labelClassName?: string;
|
|
@@ -27,5 +29,5 @@ export interface MultiSelectProps {
|
|
|
27
29
|
errorClassName?: string;
|
|
28
30
|
id?: string;
|
|
29
31
|
}
|
|
30
|
-
declare function MultiSelect({ label, options, value, onValueChange, placeholder, description, error, invalid, disabled, hideLabel, searchable, searchPlaceholder, maxVisibleTags, className, triggerClassName, labelClassName, descriptionClassName, errorClassName, id, }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare function MultiSelect({ label, options, value, onValueChange, placeholder, description, error, invalid, disabled, hideLabel, searchable, searchPlaceholder, maxVisibleTags, clearable, className, triggerClassName, labelClassName, descriptionClassName, errorClassName, id, }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
31
33
|
export { MultiSelect };
|
package/dist/multi-select.js
CHANGED
|
@@ -8,10 +8,10 @@ import { Field, FieldDescription, FieldError, FieldLabel } from "./field";
|
|
|
8
8
|
import { Checkbox } from "./checkbox";
|
|
9
9
|
import { cn } from "./lib/utils";
|
|
10
10
|
import { Popover } from "./popover";
|
|
11
|
-
import { PopoverMenuSearch } from "./popover-menu";
|
|
11
|
+
import { PopoverMenuFooter, PopoverMenuFooterAction, PopoverMenuSearch } from "./popover-menu";
|
|
12
12
|
import { Typography } from "./typography";
|
|
13
13
|
import { SearchHighlight } from "./use-search-highlight";
|
|
14
|
-
function MultiSelect({ label, options, value, onValueChange, placeholder = "Select options", description, error, invalid = false, disabled = false, hideLabel = false, searchable = false, searchPlaceholder = "Search...", maxVisibleTags = 2, className, triggerClassName, labelClassName, descriptionClassName, errorClassName, id, }) {
|
|
14
|
+
function MultiSelect({ label, options, value, onValueChange, placeholder = "Select options", description, error, invalid = false, disabled = false, hideLabel = false, searchable = false, searchPlaceholder = "Search...", maxVisibleTags = 2, clearable = false, className, triggerClassName, labelClassName, descriptionClassName, errorClassName, id, }) {
|
|
15
15
|
const generatedId = React.useId();
|
|
16
16
|
const selectId = id !== null && id !== void 0 ? id : `multi-select-${generatedId}`;
|
|
17
17
|
const labelId = `${selectId}-label`;
|
|
@@ -179,6 +179,6 @@ function MultiSelect({ label, options, value, onValueChange, placeholder = "Sele
|
|
|
179
179
|
const isSelected = value.includes(option.value);
|
|
180
180
|
return (_jsxs("button", { type: "button", role: "option", "aria-selected": isSelected, disabled: option.disabled, tabIndex: -1, onClick: () => toggleOption(option.value), className: cn("flex min-h-8 w-full cursor-pointer items-center gap-1.5 rounded-sm px-2 py-1.5 text-left text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50", isSelected &&
|
|
181
181
|
"bg-highlight text-highlight-foreground hover:bg-highlight/80 hover:text-highlight-foreground focus:bg-highlight/80 focus:text-highlight-foreground"), children: [_jsx(Checkbox, { checked: isSelected, disabled: option.disabled, tabIndex: -1, readOnly: true, "aria-hidden": "true", className: "mt-0.5" }), _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx(SearchHighlight, { text: option.label, query: searchQuery }), option.description ? (_jsx(Typography, { as: "span", variant: "caption", children: _jsx(SearchHighlight, { text: option.description, query: searchQuery }) })) : null] })] }, option.value));
|
|
182
|
-
})) : (_jsx("div", { className: "px-2.5 py-1.5 text-center text-sm text-muted-foreground", children: "No options found." })) })] }), showDescription ? (_jsx(FieldDescription, { id: descriptionId, className: descriptionClassName, children: description })) : null, _jsx(FieldError, { id: errorId, className: errorClassName, children: error })] }));
|
|
182
|
+
})) : (_jsx("div", { className: "px-2.5 py-1.5 text-center text-sm text-muted-foreground", children: "No options found." })) }), clearable && value.length > 0 ? (_jsx(PopoverMenuFooter, { children: _jsx(PopoverMenuFooterAction, { onClick: () => onValueChange([]), children: "Clear" }) })) : null] }), showDescription ? (_jsx(FieldDescription, { id: descriptionId, className: descriptionClassName, children: description })) : null, _jsx(FieldError, { id: errorId, className: errorClassName, children: error })] }));
|
|
183
183
|
}
|
|
184
184
|
export { MultiSelect };
|
package/dist/table.js
CHANGED
|
@@ -198,7 +198,11 @@ function stickyClassName(sticky, kind, showShadow = false) {
|
|
|
198
198
|
? "shadow-[inset_-1px_0_0_0_hsl(var(--table-border)),_8px_0_12px_-10px_hsl(var(--foreground)_/_0.35)]"
|
|
199
199
|
: "shadow-[inset_1px_0_0_0_hsl(var(--table-border)),_-8px_0_12px_-10px_hsl(var(--foreground)_/_0.35)]"
|
|
200
200
|
: undefined;
|
|
201
|
-
const background = kind === "head"
|
|
201
|
+
const background = kind === "head"
|
|
202
|
+
? "bg-[hsl(var(--table-header-background))]"
|
|
203
|
+
: kind === "cell"
|
|
204
|
+
? "bg-inherit"
|
|
205
|
+
: "bg-card";
|
|
202
206
|
// Header and filter cells layer above sticky body cells on the other axis.
|
|
203
207
|
const z = kind === "cell" ? "z-10" : "z-20";
|
|
204
208
|
return cn("sticky", background, side, z, shadow);
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neasg/design-system",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.35",
|
|
4
4
|
"description": "NEA shared design system primitives, theme tokens, and Storybook docs.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/sandbox-nea/design-system.git"
|
|
8
|
+
},
|
|
5
9
|
"license": "UNLICENSED",
|
|
6
10
|
"type": "module",
|
|
7
11
|
"engines": {
|