@trycompai/design-system 1.0.35 → 1.0.37
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/package.json
CHANGED
|
@@ -22,22 +22,28 @@ const inputGroupAddonVariants = cva(
|
|
|
22
22
|
{
|
|
23
23
|
variants: {
|
|
24
24
|
align: {
|
|
25
|
-
'inline-start': '
|
|
26
|
-
'inline-end': '
|
|
25
|
+
'inline-start': 'px-2 has-[>button]:ml-[-0.25rem] has-[>kbd]:ml-[-0.15rem] order-first',
|
|
26
|
+
'inline-end': 'px-2 has-[>button]:mr-[-0.25rem] has-[>kbd]:mr-[-0.15rem] order-last',
|
|
27
27
|
'block-start':
|
|
28
28
|
'px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start',
|
|
29
29
|
'block-end':
|
|
30
30
|
'px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start',
|
|
31
31
|
},
|
|
32
|
+
variant: {
|
|
33
|
+
default: 'bg-muted/50',
|
|
34
|
+
icon: 'bg-transparent',
|
|
35
|
+
},
|
|
32
36
|
},
|
|
33
37
|
defaultVariants: {
|
|
34
38
|
align: 'inline-start',
|
|
39
|
+
variant: 'default',
|
|
35
40
|
},
|
|
36
41
|
},
|
|
37
42
|
);
|
|
38
43
|
|
|
39
44
|
function InputGroupAddon({
|
|
40
45
|
align = 'inline-start',
|
|
46
|
+
variant = 'default',
|
|
41
47
|
...props
|
|
42
48
|
}: Omit<React.ComponentProps<'div'>, 'className'> & VariantProps<typeof inputGroupAddonVariants>) {
|
|
43
49
|
return (
|
|
@@ -45,7 +51,7 @@ function InputGroupAddon({
|
|
|
45
51
|
role="group"
|
|
46
52
|
data-slot="input-group-addon"
|
|
47
53
|
data-align={align}
|
|
48
|
-
className={inputGroupAddonVariants({ align })}
|
|
54
|
+
className={inputGroupAddonVariants({ align, variant })}
|
|
49
55
|
onClick={(e) => {
|
|
50
56
|
if ((e.target as HTMLElement).closest('button')) {
|
|
51
57
|
return;
|
|
@@ -643,7 +643,7 @@ function AppShellSearch({
|
|
|
643
643
|
return (
|
|
644
644
|
<div className={appShellSearchVariants({ searchWidth })}>
|
|
645
645
|
<InputGroup>
|
|
646
|
-
<InputGroupAddon align="inline-start">
|
|
646
|
+
<InputGroupAddon align="inline-start" variant="icon">
|
|
647
647
|
<Search />
|
|
648
648
|
</InputGroupAddon>
|
|
649
649
|
<InputGroupInput placeholder={placeholder} {...props} />
|
|
@@ -54,7 +54,7 @@ function ComboboxInput({
|
|
|
54
54
|
return (
|
|
55
55
|
<InputGroup>
|
|
56
56
|
<ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />
|
|
57
|
-
<InputGroupAddon align="inline-end">
|
|
57
|
+
<InputGroupAddon align="inline-end" variant="icon">
|
|
58
58
|
{showTrigger && (
|
|
59
59
|
<InputGroupButton
|
|
60
60
|
size="icon-xs"
|
|
@@ -228,6 +228,8 @@ function OrganizationSelector({
|
|
|
228
228
|
const [searchQuery, setSearchQuery] = React.useState('');
|
|
229
229
|
const [open, setOpen] = React.useState(false);
|
|
230
230
|
const [sort, setSort] = React.useState<OrganizationSort>(defaultSort);
|
|
231
|
+
const [dropdownOpen, setDropdownOpen] = React.useState(false);
|
|
232
|
+
const [sortOpen, setSortOpen] = React.useState(false);
|
|
231
233
|
const triggerRef = React.useRef<HTMLButtonElement>(null);
|
|
232
234
|
|
|
233
235
|
const selectedValue = value ?? internalValue;
|
|
@@ -291,6 +293,7 @@ function OrganizationSelector({
|
|
|
291
293
|
setSearchQuery(''); // Clear search on selection
|
|
292
294
|
if (closeOnSelect) {
|
|
293
295
|
setOpen(false); // Close modal on selection
|
|
296
|
+
setDropdownOpen(false); // Close dropdown on selection
|
|
294
297
|
}
|
|
295
298
|
},
|
|
296
299
|
[value, onValueChange, closeOnSelect]
|
|
@@ -362,7 +365,7 @@ function OrganizationSelector({
|
|
|
362
365
|
>
|
|
363
366
|
{/* Sort Menu */}
|
|
364
367
|
{enableSorting && (
|
|
365
|
-
<div data-slot="organization-selector-sort" className="
|
|
368
|
+
<div data-slot="organization-selector-sort" className="border-b border-border p-2">
|
|
366
369
|
<Select
|
|
367
370
|
value={`${sort.key}:${sort.direction}`}
|
|
368
371
|
onValueChange={(value) => value && setSort(parseSortValue(value))}
|
|
@@ -382,7 +385,7 @@ function OrganizationSelector({
|
|
|
382
385
|
)}
|
|
383
386
|
|
|
384
387
|
{/* Search Input */}
|
|
385
|
-
<div data-slot="command-input-wrapper" className="
|
|
388
|
+
<div data-slot="command-input-wrapper" className="border-b border-border p-2">
|
|
386
389
|
<div
|
|
387
390
|
data-slot="input-group"
|
|
388
391
|
role="group"
|
|
@@ -406,7 +409,7 @@ function OrganizationSelector({
|
|
|
406
409
|
{/* Organization List */}
|
|
407
410
|
<CommandPrimitive.List
|
|
408
411
|
data-slot="command-list"
|
|
409
|
-
className="no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto"
|
|
412
|
+
className="no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto pt-2"
|
|
410
413
|
>
|
|
411
414
|
{loading ? (
|
|
412
415
|
<EmptyState icon={<LoadingSpinner />} text={loadingText} />
|
|
@@ -468,7 +471,15 @@ function OrganizationSelector({
|
|
|
468
471
|
|
|
469
472
|
// Dropdown mode (default): inline combobox
|
|
470
473
|
return (
|
|
471
|
-
<ComboboxPrimitive.Root
|
|
474
|
+
<ComboboxPrimitive.Root
|
|
475
|
+
value={selectedValue}
|
|
476
|
+
onValueChange={handleValueChange}
|
|
477
|
+
open={dropdownOpen}
|
|
478
|
+
onOpenChange={(nextOpen) => {
|
|
479
|
+
if (sortOpen && !nextOpen) return;
|
|
480
|
+
setDropdownOpen(nextOpen);
|
|
481
|
+
}}
|
|
482
|
+
>
|
|
472
483
|
<ComboboxPrimitive.Trigger
|
|
473
484
|
ref={triggerRef}
|
|
474
485
|
data-slot="organization-selector-trigger"
|
|
@@ -501,11 +512,12 @@ function OrganizationSelector({
|
|
|
501
512
|
<Select
|
|
502
513
|
value={`${sort.key}:${sort.direction}`}
|
|
503
514
|
onValueChange={(value) => value && setSort(parseSortValue(value))}
|
|
515
|
+
onOpenChange={setSortOpen}
|
|
504
516
|
>
|
|
505
517
|
<SelectTrigger size="sm">
|
|
506
518
|
<span>{getSortLabel(sort)}</span>
|
|
507
519
|
</SelectTrigger>
|
|
508
|
-
<SelectContent align="start"
|
|
520
|
+
<SelectContent align="start">
|
|
509
521
|
{sortOptions.map((option) => (
|
|
510
522
|
<SelectItem key={option.value} value={option.value}>
|
|
511
523
|
{option.label}
|
|
@@ -533,7 +545,7 @@ function OrganizationSelector({
|
|
|
533
545
|
{/* Organization List */}
|
|
534
546
|
<ComboboxPrimitive.List
|
|
535
547
|
data-slot="organization-selector-list"
|
|
536
|
-
className="no-scrollbar max-h-64 scroll-py-1 overflow-y-auto
|
|
548
|
+
className="no-scrollbar max-h-64 scroll-py-1 overflow-y-auto px-1 pb-1 pt-2 overscroll-contain"
|
|
537
549
|
>
|
|
538
550
|
{loading ? (
|
|
539
551
|
<EmptyState icon={<LoadingSpinner />} text={loadingText} />
|