@betterinternship/components 3.2.1 → 3.2.3

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.
@@ -23,19 +23,44 @@ export type FilterMenuOption = {
23
23
  label: React.ReactNode;
24
24
  value: string;
25
25
  };
26
- /**
27
- * A filter chip that opens a checklist: each tick applies immediately, and
28
- * the chip shows how many are on (in the selected, secondary style). On
29
- * phones the checklist opens in a bottom sheet with Clear and Done.
30
- */
31
- export declare function FilterMenu({ label, options, value, onValueChange, size, align, className, contentClassName, }: {
32
- label: React.ReactNode;
33
- options: FilterMenuOption[];
34
- /** The selected option values. */
35
- value: string[];
36
- onValueChange: (value: string[]) => void;
26
+ type FilterMenuCommon = {
27
+ /** The chip's label (and the sheet title when it's text). */
28
+ label?: React.ReactNode;
29
+ /** Replaces the default chip, e.g. a labelled field button. */
30
+ trigger?: React.ReactElement<React.HTMLAttributes<HTMLElement>>;
31
+ /** Sheet title / list name when `label` isn't plain text. */
32
+ title?: string;
33
+ /** Shows a clear action (popover footer and sheet footer). */
34
+ onClear?: () => void;
35
+ clearLabel?: string;
37
36
  size?: "xs" | "sm" | "md";
38
37
  align?: "start" | "center" | "end";
39
38
  className?: string;
40
39
  contentClassName?: string;
41
- }): import("react/jsx-runtime").JSX.Element;
40
+ };
41
+ /** Simple filters: options in, selected values out. */
42
+ type FilterMenuOptionsProps = FilterMenuCommon & {
43
+ options: FilterMenuOption[];
44
+ /** The selected option values. */
45
+ value: string[];
46
+ onValueChange: (value: string[]) => void;
47
+ items?: never;
48
+ };
49
+ /** Lists with their own rules (groups, indents): the rows themselves. */
50
+ type FilterMenuItemsProps = FilterMenuCommon & {
51
+ items: CheckboxListItem[];
52
+ options?: never;
53
+ value?: never;
54
+ onValueChange?: never;
55
+ };
56
+ export type FilterMenuProps = FilterMenuOptionsProps | FilterMenuItemsProps;
57
+ /**
58
+ * A checklist behind a trigger: a dropdown on desktop and a bottom sheet
59
+ * (with Clear and Done) on phones. Each tick applies immediately.
60
+ *
61
+ * Feed it either `options` + `value` + `onValueChange` (simple filters; the
62
+ * default trigger is a FilterChip showing the count in the selected,
63
+ * secondary style), or ready-made `items` with your own `trigger`.
64
+ */
65
+ export declare function FilterMenu(props: FilterMenuProps): import("react/jsx-runtime").JSX.Element;
66
+ export {};
@@ -25,31 +25,55 @@ function CheckboxList({ items, className, "aria-label": label, }) {
25
25
  return (jsx("ul", { "aria-label": label, className: cn("m-0 list-none", optionListClassName, className), children: items.map((item, index) => (jsx("li", { children: jsxs("label", { className: cn(optionRowClassName, item.indent && "pl-8", item.strong && "font-medium", item.disabled && "pointer-events-none opacity-50"), children: [jsx(Checkbox, { checked: item.checked, disabled: item.disabled, onCheckedChange: (checked) => item.onCheckedChange(checked === true) }), jsx("span", { className: "min-w-0 flex-1", children: item.label })] }) }, index))) }));
26
26
  }
27
27
  /**
28
- * A filter chip that opens a checklist: each tick applies immediately, and
29
- * the chip shows how many are on (in the selected, secondary style). On
30
- * phones the checklist opens in a bottom sheet with Clear and Done.
28
+ * A checklist behind a trigger: a dropdown on desktop and a bottom sheet
29
+ * (with Clear and Done) on phones. Each tick applies immediately.
30
+ *
31
+ * Feed it either `options` + `value` + `onValueChange` (simple filters; the
32
+ * default trigger is a FilterChip showing the count in the selected,
33
+ * secondary style), or ready-made `items` with your own `trigger`.
31
34
  */
32
- function FilterMenu({ label, options, value, onValueChange, size = "sm", align = "start", className, contentClassName, }) {
35
+ function FilterMenu(props) {
36
+ const { label, trigger: customTrigger, title: titleProp, onClear, clearLabel = "Clear", size = "sm", align = "start", className, contentClassName, } = props;
33
37
  const isMobile = useMobile();
34
38
  const [open, setOpen] = React.useState(false);
35
39
  const closeRef = React.useRef(null);
36
- const count = value.length;
37
- const title = typeof label === "string" ? label : "Filter";
38
- const trigger = (jsxs(FilterChip, { size: size, selected: count > 0, count: count || undefined, className: className, "aria-haspopup": "dialog", "aria-expanded": open, onClick: isMobile ? () => setOpen(true) : undefined, children: [label, jsx(ChevronDown, { size: 14, "aria-hidden": "true", className: "-mr-1" })] }));
39
- const list = (jsx(CheckboxList, { "aria-label": title, items: options.map((option) => ({
40
+ // Both ways in become the same rows.
41
+ const items = props.items ??
42
+ props.options.map((option) => ({
40
43
  label: option.label,
41
- checked: value.includes(option.value),
42
- onCheckedChange: (on) => onValueChange(on
43
- ? [...value, option.value]
44
- : value.filter((item) => item !== option.value)),
45
- })) }));
44
+ checked: props.value.includes(option.value),
45
+ onCheckedChange: (on) => props.onValueChange(on
46
+ ? [...props.value, option.value]
47
+ : props.value.filter((item) => item !== option.value)),
48
+ }));
49
+ const count = props.items
50
+ ? props.items.filter((item) => item.checked).length
51
+ : props.value.length;
52
+ const title = titleProp ?? (typeof label === "string" ? label : "Filter");
53
+ // The sheet always offers Clear while something's on; the popover only
54
+ // when the caller asks for it.
55
+ const clearInSheet = onClear ??
56
+ (!props.items && count > 0 ? () => props.onValueChange([]) : undefined);
57
+ const triggerProps = {
58
+ "aria-haspopup": "dialog",
59
+ "aria-expanded": open,
60
+ onClick: isMobile ? () => setOpen(true) : undefined,
61
+ };
62
+ const trigger = customTrigger ? (React.cloneElement(customTrigger, {
63
+ ...triggerProps,
64
+ onClick: (event) => {
65
+ customTrigger.props.onClick?.(event);
66
+ triggerProps.onClick?.();
67
+ },
68
+ })) : (jsxs(FilterChip, { size: size, selected: count > 0, count: count || undefined, className: className, ...triggerProps, children: [label, jsx(ChevronDown, { size: 14, "aria-hidden": "true", className: "-mr-1" })] }));
69
+ const list = jsx(CheckboxList, { "aria-label": title, items: items });
46
70
  // Phones: a bottom sheet, like Autocomplete and Select.
47
71
  if (isMobile)
48
72
  return (jsxs(Fragment, { children: [trigger, jsx(Sheet, { open: open, onOpenChange: setOpen, children: jsxs(SheetContent, { side: "bottom", showCloseButton: false, overlayClassName: "z-[1090] bg-black/25 backdrop-blur-[1px]", "aria-describedby": undefined, onOpenAutoFocus: (event) => {
49
73
  event.preventDefault();
50
74
  closeRef.current?.focus();
51
- }, className: "flex flex-col gap-0 p-0 pb-[max(0.75rem,env(safe-area-inset-bottom))]", children: [jsxs("div", { className: "flex shrink-0 items-center justify-between gap-4 px-4 pb-1 pt-4", children: [jsx(SheetTitle, { className: "text-base font-semibold text-foreground", children: title }), jsx("button", { ref: closeRef, type: "button", "aria-label": "Close", className: "-mr-3 flex h-11 w-11 shrink-0 cursor-pointer items-center justify-center rounded-control-lg text-muted-foreground hover:bg-muted", onClick: () => setOpen(false), children: jsx(X, { className: "h-5 w-5", "aria-hidden": "true" }) })] }), jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-2", children: list }), jsxs("div", { className: "flex shrink-0 gap-2 border-t border-border px-4 pt-3", children: [count > 0 && (jsx(Button, { type: "button", variant: "outline", className: "flex-1", onClick: () => onValueChange([]), children: "Clear" })), jsx(Button, { type: "button", className: "flex-1", onClick: () => setOpen(false), children: "Done" })] })] }) })] }));
52
- return (jsxs(Popover, { children: [jsx(PopoverTrigger, { asChild: true, children: trigger }), jsx(PopoverContent, { align: align, className: cn("w-56 p-0", contentClassName), children: list })] }));
75
+ }, className: "flex flex-col gap-0 p-0 pb-[max(0.75rem,env(safe-area-inset-bottom))]", children: [jsxs("div", { className: "flex shrink-0 items-center justify-between gap-4 px-4 pb-1 pt-4", children: [jsx(SheetTitle, { className: "text-base font-semibold text-foreground", children: title }), jsx("button", { ref: closeRef, type: "button", "aria-label": "Close", className: "-mr-3 flex h-11 w-11 shrink-0 cursor-pointer items-center justify-center rounded-control-lg text-muted-foreground hover:bg-muted", onClick: () => setOpen(false), children: jsx(X, { className: "h-5 w-5", "aria-hidden": "true" }) })] }), jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-2", children: list }), jsxs("div", { className: "flex shrink-0 gap-2 border-t border-border px-4 pt-3", children: [clearInSheet && (jsx(Button, { type: "button", variant: "ghost", scheme: "neutral", className: "flex-1", onClick: clearInSheet, children: clearLabel })), jsx(Button, { type: "button", variant: "outline", className: "flex-1", onClick: () => setOpen(false), children: "Done" })] })] }) })] }));
76
+ return (jsxs(Popover, { open: open, onOpenChange: setOpen, children: [jsx(PopoverTrigger, { asChild: true, children: trigger }), jsxs(PopoverContent, { align: align, className: cn("w-56 p-0", contentClassName), children: [list, onClear && (jsx("div", { className: "border-t border-border p-option-inset", children: jsx(Button, { type: "button", variant: "link", scheme: "primary", size: "xs", onClick: onClear, children: clearLabel }) }))] })] }));
53
77
  }
54
78
 
55
79
  export { CheckboxList, FilterMenu, optionListClassName, optionRowClassName };
@@ -1 +1 @@
1
- {"version":3,"file":"option-list.js","sources":["../../src/components/option-list.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronDown, X } from \"lucide-react\";\n\nimport { cn } from \"@/utils\";\nimport { useMobile } from \"@/hooks/use-mobile\";\nimport { Button } from \"./button\";\nimport { Checkbox } from \"./checkbox\";\nimport { FilterChip } from \"./filter-chip\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\nimport { Sheet, SheetContent, SheetTitle } from \"./sheet\";\n\n/*\n * The shared look for every list of options (menus, selects, dropdowns,\n * autocomplete, filter menus): the list is inset from its container's edge,\n * and each row is its own rounded box with a little space between rows, so\n * hover and selection read as distinct pills rather than full-bleed stripes.\n */\n\n/** Padding + row gap for a list of options inside a popover or sheet. */\nexport const optionListClassName = \"flex flex-col gap-option-gap p-option-inset\";\n\n/** One option row. Pair with a hover/focus or selected state as needed. */\nexport const optionRowClassName =\n \"relative flex min-h-option-row w-full cursor-pointer select-none items-center gap-3 rounded-control-sm px-option-x py-2 text-left text-sm text-foreground outline-none transition-colors duration-state hover:bg-muted focus-visible:bg-muted motion-reduce:transition-none max-md:min-h-11\";\n\nexport type CheckboxListItem = {\n label: React.ReactNode;\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n /** Indents the row under a group heading row. */\n indent?: boolean;\n /** Bolder label, e.g. a group's \"All …\" row. */\n strong?: boolean;\n disabled?: boolean;\n};\n\n/** A list of checkbox rows in the shared option style. */\nexport function CheckboxList({\n items,\n className,\n \"aria-label\": label,\n}: {\n items: CheckboxListItem[];\n className?: string;\n \"aria-label\"?: string;\n}) {\n return (\n <ul\n aria-label={label}\n className={cn(\"m-0 list-none\", optionListClassName, className)}\n >\n {items.map((item, index) => (\n <li key={index}>\n <label\n className={cn(\n optionRowClassName,\n item.indent && \"pl-8\",\n item.strong && \"font-medium\",\n item.disabled && \"pointer-events-none opacity-50\",\n )}\n >\n <Checkbox\n checked={item.checked}\n disabled={item.disabled}\n onCheckedChange={(checked) =>\n item.onCheckedChange(checked === true)\n }\n />\n <span className=\"min-w-0 flex-1\">{item.label}</span>\n </label>\n </li>\n ))}\n </ul>\n );\n}\n\nexport type FilterMenuOption = { label: React.ReactNode; value: string };\n\n/**\n * A filter chip that opens a checklist: each tick applies immediately, and\n * the chip shows how many are on (in the selected, secondary style). On\n * phones the checklist opens in a bottom sheet with Clear and Done.\n */\nexport function FilterMenu({\n label,\n options,\n value,\n onValueChange,\n size = \"sm\",\n align = \"start\",\n className,\n contentClassName,\n}: {\n label: React.ReactNode;\n options: FilterMenuOption[];\n /** The selected option values. */\n value: string[];\n onValueChange: (value: string[]) => void;\n size?: \"xs\" | \"sm\" | \"md\";\n align?: \"start\" | \"center\" | \"end\";\n className?: string;\n contentClassName?: string;\n}) {\n const isMobile = useMobile();\n const [open, setOpen] = React.useState(false);\n const closeRef = React.useRef<HTMLButtonElement>(null);\n const count = value.length;\n const title = typeof label === \"string\" ? label : \"Filter\";\n\n const trigger = (\n <FilterChip\n size={size}\n selected={count > 0}\n count={count || undefined}\n className={className}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={isMobile ? () => setOpen(true) : undefined}\n >\n {label}\n <ChevronDown size={14} aria-hidden=\"true\" className=\"-mr-1\" />\n </FilterChip>\n );\n\n const list = (\n <CheckboxList\n aria-label={title}\n items={options.map((option) => ({\n label: option.label,\n checked: value.includes(option.value),\n onCheckedChange: (on) =>\n onValueChange(\n on\n ? [...value, option.value]\n : value.filter((item) => item !== option.value),\n ),\n }))}\n />\n );\n\n // Phones: a bottom sheet, like Autocomplete and Select.\n if (isMobile)\n return (\n <>\n {trigger}\n <Sheet open={open} onOpenChange={setOpen}>\n <SheetContent\n side=\"bottom\"\n showCloseButton={false}\n overlayClassName=\"z-[1090] bg-black/25 backdrop-blur-[1px]\"\n aria-describedby={undefined}\n onOpenAutoFocus={(event) => {\n event.preventDefault();\n closeRef.current?.focus();\n }}\n className=\"flex flex-col gap-0 p-0 pb-[max(0.75rem,env(safe-area-inset-bottom))]\"\n >\n <div className=\"flex shrink-0 items-center justify-between gap-4 px-4 pb-1 pt-4\">\n <SheetTitle className=\"text-base font-semibold text-foreground\">\n {title}\n </SheetTitle>\n <button\n ref={closeRef}\n type=\"button\"\n aria-label=\"Close\"\n className=\"-mr-3 flex h-11 w-11 shrink-0 cursor-pointer items-center justify-center rounded-control-lg text-muted-foreground hover:bg-muted\"\n onClick={() => setOpen(false)}\n >\n <X className=\"h-5 w-5\" aria-hidden=\"true\" />\n </button>\n </div>\n <div className=\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-2\">\n {list}\n </div>\n <div className=\"flex shrink-0 gap-2 border-t border-border px-4 pt-3\">\n {count > 0 && (\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"flex-1\"\n onClick={() => onValueChange([])}\n >\n Clear\n </Button>\n )}\n <Button\n type=\"button\"\n className=\"flex-1\"\n onClick={() => setOpen(false)}\n >\n Done\n </Button>\n </div>\n </SheetContent>\n </Sheet>\n </>\n );\n\n return (\n <Popover>\n <PopoverTrigger asChild>{trigger}</PopoverTrigger>\n <PopoverContent\n align={align}\n className={cn(\"w-56 p-0\", contentClassName)}\n >\n {list}\n </PopoverContent>\n </Popover>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAaA;;;;;AAKG;AAEH;AACO;AAEP;AACO;AAcP;AACM;;AAqCN;AAIA;;;;AAIG;AACG;AAoBJ;AACA;;AAEA;AACA;AAEA;AAeA;;;;;AAUY;;;AAOZ;AACE;;AAWU;AACF;AA4CV;AAWF;;"}
1
+ {"version":3,"file":"option-list.js","sources":["../../src/components/option-list.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronDown, X } from \"lucide-react\";\n\nimport { cn } from \"@/utils\";\nimport { useMobile } from \"@/hooks/use-mobile\";\nimport { Button } from \"./button\";\nimport { Checkbox } from \"./checkbox\";\nimport { FilterChip } from \"./filter-chip\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\nimport { Sheet, SheetContent, SheetTitle } from \"./sheet\";\n\n/*\n * The shared look for every list of options (menus, selects, dropdowns,\n * autocomplete, filter menus): the list is inset from its container's edge,\n * and each row is its own rounded box with a little space between rows, so\n * hover and selection read as distinct pills rather than full-bleed stripes.\n */\n\n/** Padding + row gap for a list of options inside a popover or sheet. */\nexport const optionListClassName = \"flex flex-col gap-option-gap p-option-inset\";\n\n/** One option row. Pair with a hover/focus or selected state as needed. */\nexport const optionRowClassName =\n \"relative flex min-h-option-row w-full cursor-pointer select-none items-center gap-3 rounded-control-sm px-option-x py-2 text-left text-sm text-foreground outline-none transition-colors duration-state hover:bg-muted focus-visible:bg-muted motion-reduce:transition-none max-md:min-h-11\";\n\nexport type CheckboxListItem = {\n label: React.ReactNode;\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n /** Indents the row under a group heading row. */\n indent?: boolean;\n /** Bolder label, e.g. a group's \"All …\" row. */\n strong?: boolean;\n disabled?: boolean;\n};\n\n/** A list of checkbox rows in the shared option style. */\nexport function CheckboxList({\n items,\n className,\n \"aria-label\": label,\n}: {\n items: CheckboxListItem[];\n className?: string;\n \"aria-label\"?: string;\n}) {\n return (\n <ul\n aria-label={label}\n className={cn(\"m-0 list-none\", optionListClassName, className)}\n >\n {items.map((item, index) => (\n <li key={index}>\n <label\n className={cn(\n optionRowClassName,\n item.indent && \"pl-8\",\n item.strong && \"font-medium\",\n item.disabled && \"pointer-events-none opacity-50\",\n )}\n >\n <Checkbox\n checked={item.checked}\n disabled={item.disabled}\n onCheckedChange={(checked) =>\n item.onCheckedChange(checked === true)\n }\n />\n <span className=\"min-w-0 flex-1\">{item.label}</span>\n </label>\n </li>\n ))}\n </ul>\n );\n}\n\nexport type FilterMenuOption = { label: React.ReactNode; value: string };\n\ntype FilterMenuCommon = {\n /** The chip's label (and the sheet title when it's text). */\n label?: React.ReactNode;\n /** Replaces the default chip, e.g. a labelled field button. */\n trigger?: React.ReactElement<React.HTMLAttributes<HTMLElement>>;\n /** Sheet title / list name when `label` isn't plain text. */\n title?: string;\n /** Shows a clear action (popover footer and sheet footer). */\n onClear?: () => void;\n clearLabel?: string;\n size?: \"xs\" | \"sm\" | \"md\";\n align?: \"start\" | \"center\" | \"end\";\n className?: string;\n contentClassName?: string;\n};\n\n/** Simple filters: options in, selected values out. */\ntype FilterMenuOptionsProps = FilterMenuCommon & {\n options: FilterMenuOption[];\n /** The selected option values. */\n value: string[];\n onValueChange: (value: string[]) => void;\n items?: never;\n};\n\n/** Lists with their own rules (groups, indents): the rows themselves. */\ntype FilterMenuItemsProps = FilterMenuCommon & {\n items: CheckboxListItem[];\n options?: never;\n value?: never;\n onValueChange?: never;\n};\n\nexport type FilterMenuProps = FilterMenuOptionsProps | FilterMenuItemsProps;\n\n/**\n * A checklist behind a trigger: a dropdown on desktop and a bottom sheet\n * (with Clear and Done) on phones. Each tick applies immediately.\n *\n * Feed it either `options` + `value` + `onValueChange` (simple filters; the\n * default trigger is a FilterChip showing the count in the selected,\n * secondary style), or ready-made `items` with your own `trigger`.\n */\nexport function FilterMenu(props: FilterMenuProps) {\n const {\n label,\n trigger: customTrigger,\n title: titleProp,\n onClear,\n clearLabel = \"Clear\",\n size = \"sm\",\n align = \"start\",\n className,\n contentClassName,\n } = props;\n const isMobile = useMobile();\n const [open, setOpen] = React.useState(false);\n const closeRef = React.useRef<HTMLButtonElement>(null);\n\n // Both ways in become the same rows.\n const items: CheckboxListItem[] =\n props.items ??\n props.options.map((option) => ({\n label: option.label,\n checked: props.value.includes(option.value),\n onCheckedChange: (on) =>\n props.onValueChange(\n on\n ? [...props.value, option.value]\n : props.value.filter((item) => item !== option.value),\n ),\n }));\n const count = props.items\n ? props.items.filter((item) => item.checked).length\n : props.value.length;\n const title = titleProp ?? (typeof label === \"string\" ? label : \"Filter\");\n // The sheet always offers Clear while something's on; the popover only\n // when the caller asks for it.\n const clearInSheet =\n onClear ??\n (!props.items && count > 0 ? () => props.onValueChange([]) : undefined);\n\n const triggerProps = {\n \"aria-haspopup\": \"dialog\" as const,\n \"aria-expanded\": open,\n onClick: isMobile ? () => setOpen(true) : undefined,\n };\n const trigger = customTrigger ? (\n React.cloneElement(customTrigger, {\n ...triggerProps,\n onClick: (event: React.MouseEvent<HTMLElement>) => {\n customTrigger.props.onClick?.(event);\n triggerProps.onClick?.();\n },\n })\n ) : (\n <FilterChip\n size={size}\n selected={count > 0}\n count={count || undefined}\n className={className}\n {...triggerProps}\n >\n {label}\n <ChevronDown size={14} aria-hidden=\"true\" className=\"-mr-1\" />\n </FilterChip>\n );\n\n const list = <CheckboxList aria-label={title} items={items} />;\n\n // Phones: a bottom sheet, like Autocomplete and Select.\n if (isMobile)\n return (\n <>\n {trigger}\n <Sheet open={open} onOpenChange={setOpen}>\n <SheetContent\n side=\"bottom\"\n showCloseButton={false}\n overlayClassName=\"z-[1090] bg-black/25 backdrop-blur-[1px]\"\n aria-describedby={undefined}\n onOpenAutoFocus={(event) => {\n event.preventDefault();\n closeRef.current?.focus();\n }}\n className=\"flex flex-col gap-0 p-0 pb-[max(0.75rem,env(safe-area-inset-bottom))]\"\n >\n <div className=\"flex shrink-0 items-center justify-between gap-4 px-4 pb-1 pt-4\">\n <SheetTitle className=\"text-base font-semibold text-foreground\">\n {title}\n </SheetTitle>\n <button\n ref={closeRef}\n type=\"button\"\n aria-label=\"Close\"\n className=\"-mr-3 flex h-11 w-11 shrink-0 cursor-pointer items-center justify-center rounded-control-lg text-muted-foreground hover:bg-muted\"\n onClick={() => setOpen(false)}\n >\n <X className=\"h-5 w-5\" aria-hidden=\"true\" />\n </button>\n </div>\n <div className=\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-2\">\n {list}\n </div>\n <div className=\"flex shrink-0 gap-2 border-t border-border px-4 pt-3\">\n {clearInSheet && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n scheme=\"neutral\"\n className=\"flex-1\"\n onClick={clearInSheet}\n >\n {clearLabel}\n </Button>\n )}\n {/* Outline, like Autocomplete's: ticks already applied, so\n Done only closes the sheet. */}\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"flex-1\"\n onClick={() => setOpen(false)}\n >\n Done\n </Button>\n </div>\n </SheetContent>\n </Sheet>\n </>\n );\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>{trigger}</PopoverTrigger>\n <PopoverContent\n align={align}\n className={cn(\"w-56 p-0\", contentClassName)}\n >\n {list}\n {onClear && (\n <div className=\"border-t border-border p-option-inset\">\n <Button\n type=\"button\"\n variant=\"link\"\n scheme=\"primary\"\n size=\"xs\"\n onClick={onClear}\n >\n {clearLabel}\n </Button>\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAaA;;;;;AAKG;AAEH;AACO;AAEP;AACO;AAcP;AACM;;AAqCN;AAuCA;;;;;;;AAOG;AACG;AACJ;AAWA;AACA;;;AAIA;;;;;;AASU;AAEP;AACH;AACE;AACA;AACF;;;;;AAOA;AACE;AACA;AACA;;AAEF;AAEI;AACA;;AAEE;;;;;AAmBN;AACE;;AAWU;AACF;AAgDV;AAwBF;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterinternship/components",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
4
4
  "workspaces": [
5
5
  "playground"
6
6
  ],