@caratlogic/design-system 0.1.41 → 0.1.42
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/components/ui/multi-select.d.ts.map +1 -1
- package/dist/ui.cjs.js +5 -5
- package/dist/ui.cjs.js.map +1 -1
- package/dist/ui.esm.js +5 -5
- package/dist/ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-select.d.ts","sourceRoot":"","sources":["../../../src/components/ui/multi-select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EACL,OAAO,EAEP,YAAY,EAEZ,WAAW,EAEX,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAQL,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAaf,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,MAAM,EACN,aAAa,EACb,cAAc,GACf,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC7C,2CA6CA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,wBAAwB,CAAC,OAAO,MAAM,CAAC,2CAoB1C;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,aAAoB,EACpB,SAAS,EACT,gBAAmC,EACnC,GAAG,KAAK,EACT,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CA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AAC,KAAK,CAAC,EAAE,UAAU,CAAC,2CA6GpD;AAED,wBAAgB,kBAAkB,CAAC,EACjC,MAAa,EACb,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,GAAG;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,OAAO,CAAC,EAAE,UAAU,CAAC,2CAiC7D;AAED,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IACD,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,WAAW,CAAC,EAAE,OAAO,CAAC,2CAsB9D;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,wBAAwB,CAAC,OAAO,YAAY,CAAC,2CAGrD;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,wBAAwB,CAAC,OAAO,gBAAgB,CAAC,2CAGzD"}
|
package/dist/ui.cjs.js
CHANGED
|
@@ -3189,7 +3189,7 @@ function MultiSelect({ children, values, defaultValues, onValuesChange, }) {
|
|
|
3189
3189
|
}
|
|
3190
3190
|
function MultiSelectTrigger({ className, children, ...props }) {
|
|
3191
3191
|
const { open } = useMultiSelectContext();
|
|
3192
|
-
return (jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: jsxRuntime.jsxs(Button, { ...props, variant: props.variant ?? 'outline', role: props.role ?? 'combobox', "aria-expanded": props['aria-expanded'] ?? open, className: cn("flex h-auto min-h-9 w-fit items-center justify-between gap-2 overflow-hidden rounded-md border border-input bg-transparent px-3 py-1.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className), children: [children, jsxRuntime.jsx(ChevronsUpDown, { className: "size-4 shrink-0 opacity-50" })] }) }));
|
|
3192
|
+
return (jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: jsxRuntime.jsxs(Button, { ...props, variant: props.variant ?? 'outline', role: props.role ?? 'combobox', "aria-expanded": props['aria-expanded'] ?? open, className: cn("flex h-auto min-h-9 w-fit items-center justify-between gap-2 overflow-hidden rounded-md border border-input bg-transparent px-3 py-1.5 text-sm whitespace-nowrap shadow-xs has-[[data-selected-item]]:p-[3px] transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className), children: [children, jsxRuntime.jsx(ChevronsUpDown, { className: "size-4 shrink-0 opacity-50" })] }) }));
|
|
3193
3193
|
}
|
|
3194
3194
|
function MultiSelectValue({ placeholder, clickToRemove = true, className, overflowBehavior = 'wrap-when-open', ...props }) {
|
|
3195
3195
|
const { selectedValues, toggleValue, items, open } = useMultiSelectContext();
|
|
@@ -3234,16 +3234,16 @@ function MultiSelectValue({ placeholder, clickToRemove = true, className, overfl
|
|
|
3234
3234
|
if (selectedValues.size === 0 && placeholder) {
|
|
3235
3235
|
return (jsxRuntime.jsx("span", { className: "min-w-0 overflow-hidden font-normal text-muted-foreground", children: placeholder }));
|
|
3236
3236
|
}
|
|
3237
|
-
return (jsxRuntime.jsxs("div", { ...props, ref: handleResize, className: cn('flex w-full gap-1
|
|
3237
|
+
return (jsxRuntime.jsxs("div", { ...props, ref: handleResize, className: cn('flex w-full gap-1 overflow-hidden', shouldWrap && 'h-full flex-wrap', className), children: [[...selectedValues]
|
|
3238
3238
|
.filter((value) => items.has(value))
|
|
3239
|
-
.map((value) => (jsxRuntime.jsxs(Badge, { variant: "outline", "data-selected-item": true, className: cn('group flex items-center gap-1', clickToRemove && 'cursor-pointer'), onClick: clickToRemove
|
|
3239
|
+
.map((value) => (jsxRuntime.jsxs(Badge, { variant: "outline", "data-selected-item": true, className: cn('group flex h-7 items-center gap-1.5 px-3 text-sm', clickToRemove && 'cursor-pointer'), onClick: clickToRemove
|
|
3240
3240
|
? (e) => {
|
|
3241
3241
|
e.stopPropagation();
|
|
3242
3242
|
toggleValue(value);
|
|
3243
3243
|
}
|
|
3244
|
-
: undefined, children: [items.get(value), clickToRemove && (jsxRuntime.jsx(X$1, { className: "size-
|
|
3244
|
+
: undefined, children: [items.get(value), clickToRemove && (jsxRuntime.jsx(X$1, { className: "size-3.5 text-muted-foreground group-hover:text-destructive" }))] }, value))), jsxRuntime.jsxs(Badge, { style: {
|
|
3245
3245
|
display: overflowAmount > 0 && !shouldWrap ? 'block' : 'none',
|
|
3246
|
-
}, variant: "outline", ref: overflowRef, children: ["+", overflowAmount] })] }));
|
|
3246
|
+
}, variant: "outline", className: "h-7 items-center px-3 text-sm", ref: overflowRef, children: ["+", overflowAmount] })] }));
|
|
3247
3247
|
}
|
|
3248
3248
|
function MultiSelectContent({ search = true, children, ...props }) {
|
|
3249
3249
|
const canSearch = typeof search === 'object' ? true : search;
|