@dust-tt/sparkle 0.2.257 → 0.2.258-rc-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.
@@ -0,0 +1,14 @@
1
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
2
+ import * as React from "react";
3
+ declare const PopoverRoot: React.FC<PopoverPrimitive.PopoverProps>;
4
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ interface PopoverContentProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {
6
+ }
7
+ declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
8
+ interface PopoverProps extends Omit<PopoverContentProps, "content"> {
9
+ trigger: React.ReactNode;
10
+ content: React.ReactNode;
11
+ }
12
+ declare function Popover({ trigger, content, ...props }: PopoverProps): React.JSX.Element;
13
+ export { Popover, PopoverContent, PopoverRoot, PopoverTrigger };
14
+ //# sourceMappingURL=Popover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/components/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,WAAW,yCAAwB,CAAC;AAE1C,QAAA,MAAM,cAAc,gHAA2B,CAAC;AAEhD,UAAU,mBACR,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC;CAAG;AAE5E,QAAA,MAAM,cAAc,4FAsBlB,CAAC;AAEH,UAAU,YAAa,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC;IACjE,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,iBAAS,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,qBAO5D;AAID,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { __assign, __rest } from "tslib";
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
3
+ import * as React from "react";
4
+ import { classNames } from "../lib/utils";
5
+ var PopoverRoot = PopoverPrimitive.Root;
6
+ var PopoverTrigger = PopoverPrimitive.Trigger;
7
+ var PopoverContent = React.forwardRef(function (_a, ref) {
8
+ var className = _a.className, _b = _a.align, align = _b === void 0 ? "center" : _b, _c = _a.sideOffset, sideOffset = _c === void 0 ? 4 : _c, props = __rest(_a, ["className", "align", "sideOffset"]);
9
+ return (React.createElement(PopoverPrimitive.Portal, null,
10
+ React.createElement(PopoverPrimitive.Content, __assign({ ref: ref, align: align, sideOffset: sideOffset, className: classNames("data-[state=open]:s-animate-in data-[state=open]:s-fade-in-0 data-[state=open]:s-zoom-in-95", "data-[state=closed]:s-animate-out data-[state=closed]:s-fade-out-0 data-[state=closed]:s-zoom-out-95", "data-[side=bottom]:s-slide-in-from-top-2", "data-[side=left]:s-slide-in-from-right-2", "data-[side=right]:s-slide-in-from-left-2", "data-[side=top]:s-slide-in-from-bottom-2", "s-border-border s-text-primary-950 s-z-50 s-w-72 s-rounded-lg s-border s-bg-background s-p-4 s-shadow-md s-outline-none", className !== null && className !== void 0 ? className : "") }, props))));
11
+ });
12
+ function Popover(_a) {
13
+ var trigger = _a.trigger, content = _a.content, props = __rest(_a, ["trigger", "content"]);
14
+ return (React.createElement(PopoverRoot, null,
15
+ React.createElement(PopoverTrigger, null, trigger),
16
+ React.createElement(PopoverContent, __assign({}, props), content)));
17
+ }
18
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
19
+ export { Popover, PopoverContent, PopoverRoot, PopoverTrigger };
20
+ //# sourceMappingURL=Popover.js.map
@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G,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC"}
@@ -35,6 +35,7 @@ export { Notification } from "./Notification";
35
35
  export { Page } from "./Page";
36
36
  export { PaginatedCitationsGrid } from "./PaginatedCitationsGrid";
37
37
  export { Pagination } from "./Pagination";
38
+ export { Popover, PopoverContent, PopoverRoot, PopoverTrigger } from "./Popover";
38
39
  export { Popup } from "./Popup";
39
40
  export { PriceTable } from "./PriceTable";
40
41
  export { RadioButton } from "./RadioButton";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,O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EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,WAAW,EACX,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC"}
@@ -35,6 +35,7 @@ export { Notification } from "./Notification";
35
35
  export { Page } from "./Page";
36
36
  export { PaginatedCitationsGrid } from "./PaginatedCitationsGrid";
37
37
  export { Pagination } from "./Pagination";
38
+ export { Popover, PopoverContent, PopoverRoot, PopoverTrigger } from "./Popover";
38
39
  export { Popup } from "./Popup";
39
40
  export { PriceTable } from "./PriceTable";
40
41
  export { RadioButton } from "./RadioButton";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,E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AAO,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,WAAW,EACX,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { Popover } from "../index_with_tw_base";
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Popover;
6
+ };
7
+ export default meta;
8
+ export declare function SimplePopoverExample(): React.JSX.Element;
9
+ export declare function PopoverExample(): React.JSX.Element;
10
+ //# sourceMappingURL=Popover.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popover.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/Popover.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAGL,OAAO,EAIR,MAAM,uBAAuB,CAAC;AAE/B,QAAA,MAAM,IAAI;;;CAGsB,CAAC;AAEjC,eAAe,IAAI,CAAC;AAEpB,wBAAgB,oBAAoB,sBAkBnC;AAED,wBAAgB,cAAc,sBAoD7B"}
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+ import { Button, Input, Popover, PopoverContent, PopoverRoot, PopoverTrigger } from "../index_with_tw_base";
3
+ var meta = {
4
+ title: "Primitives/Popover",
5
+ component: Popover,
6
+ };
7
+ export default meta;
8
+ export function SimplePopoverExample() {
9
+ return (React.createElement(Popover, { trigger: React.createElement(Button, { label: "Popover", variant: "secondary" }), content: React.createElement("div", { className: "grid gap-2" },
10
+ React.createElement("p", null, "Lorem"),
11
+ React.createElement("p", null, "Ipsum"),
12
+ React.createElement("p", null, "Lorem"),
13
+ React.createElement("p", null, "Ipsum")), side: "right", sideOffset: 100 }));
14
+ }
15
+ export function PopoverExample() {
16
+ return (React.createElement(PopoverRoot, null,
17
+ React.createElement(PopoverTrigger, null,
18
+ React.createElement(Button, { label: "Popover", variant: "primary" })),
19
+ React.createElement(PopoverContent, { className: "w-80" },
20
+ React.createElement("div", { className: "grid gap-4" },
21
+ React.createElement("div", { className: "space-y-2" },
22
+ React.createElement("h4", { className: "font-medium leading-none s-pb-2" }, "Dimensions"),
23
+ React.createElement("p", { className: "text-sm text-muted-foreground" }, "Set the dimensions for the layer.")),
24
+ React.createElement("div", { className: "grid gap-2" },
25
+ React.createElement("div", { className: "grid grid-cols-3 items-center gap-4" },
26
+ React.createElement(Input, { name: "width", value: "200px", placeholder: "Width", className: "col-span-2 h-8" })),
27
+ React.createElement("div", { className: "grid grid-cols-3 items-center gap-4" },
28
+ React.createElement(Input, { name: "max-width", value: "300px", placeholder: "Max. width", className: "col-span-2 h-8" })),
29
+ React.createElement("div", { className: "grid grid-cols-3 items-center gap-4" },
30
+ React.createElement(Input, { name: "height", value: "30px", placeholder: "Height", className: "col-span-2 h-8" })),
31
+ React.createElement("div", { className: "grid grid-cols-3 items-center gap-4" },
32
+ React.createElement(Input, { name: "max-height", value: "100px", placeholder: "Max. height", className: "col-span-2 h-8" })))))));
33
+ }
34
+ //# sourceMappingURL=Popover.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popover.stories.js","sourceRoot":"","sources":["../../../src/stories/Popover.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,MAAM,EACN,KAAK,EACL,OAAO,EACP,cAAc,EACd,WAAW,EACX,cAAc,EACf,MAAM,uBAAuB,CAAC;AAE/B,IAAM,IAAI,GAAG;IACX,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,OAAO;CACY,CAAC;AAEjC,eAAe,IAAI,CAAC;AAEpB,MAAM,UAAU,oBAAoB;IAClC,OAAO,CACL,oBAAC,OAAO,IACN,OAAO,EACL,oBAAC,MAAM,IAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAC,WAAW,GAAE,EAE/C,OAAO,EACL,6BAAK,SAAS,EAAC,YA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CHANGED
@@ -1179,6 +1179,10 @@ select {
1179
1179
  width: 16rem;
1180
1180
  }
1181
1181
 
1182
+ .s-w-72 {
1183
+ width: 18rem;
1184
+ }
1185
+
1182
1186
  .s-w-8 {
1183
1187
  width: 2rem;
1184
1188
  }
@@ -2025,6 +2029,11 @@ select {
2025
2029
  background-color: rgb(146 64 14 / var(--tw-bg-opacity));
2026
2030
  }
2027
2031
 
2032
+ .s-bg-background {
2033
+ --tw-bg-opacity: 1;
2034
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
2035
+ }
2036
+
2028
2037
  .s-bg-black\/70 {
2029
2038
  background-color: rgb(0 0 0 / 0.7);
2030
2039
  }
@@ -4597,6 +4606,16 @@ select {
4597
4606
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
4598
4607
  }
4599
4608
 
4609
+ .data-\[state\=open\]\:s-animate-in[data-state=open] {
4610
+ animation-name: enter;
4611
+ animation-duration: 150ms;
4612
+ --tw-enter-opacity: initial;
4613
+ --tw-enter-scale: initial;
4614
+ --tw-enter-rotate: initial;
4615
+ --tw-enter-translate-x: initial;
4616
+ --tw-enter-translate-y: initial;
4617
+ }
4618
+
4600
4619
  .data-\[state\=closed\]\:s-animate-out[data-state=closed] {
4601
4620
  animation-name: exit;
4602
4621
  animation-duration: 150ms;
@@ -4611,10 +4630,18 @@ select {
4611
4630
  --tw-exit-opacity: 0;
4612
4631
  }
4613
4632
 
4633
+ .data-\[state\=open\]\:s-fade-in-0[data-state=open] {
4634
+ --tw-enter-opacity: 0;
4635
+ }
4636
+
4614
4637
  .data-\[state\=closed\]\:s-zoom-out-95[data-state=closed] {
4615
4638
  --tw-exit-scale: .95;
4616
4639
  }
4617
4640
 
4641
+ .data-\[state\=open\]\:s-zoom-in-95[data-state=open] {
4642
+ --tw-enter-scale: .95;
4643
+ }
4644
+
4618
4645
  .data-\[side\=bottom\]\:s-slide-in-from-top-2[data-side=bottom] {
4619
4646
  --tw-enter-translate-y: -0.5rem;
4620
4647
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dust-tt/sparkle",
3
- "version": "0.2.257",
3
+ "version": "0.2.258-rc-1",
4
4
  "scripts": {
5
5
  "build": "rm -rf dist && npm run tailwind && npm run build:esm && npm run build:cjs",
6
6
  "tailwind": "tailwindcss -i ./src/styles/tailwind.css -o dist/sparkle.css",
@@ -89,6 +89,7 @@
89
89
  "@emoji-mart/react": "^1.1.1",
90
90
  "@headlessui/react": "^1.7.19",
91
91
  "@radix-ui/react-separator": "^1.1.0",
92
+ "@radix-ui/react-popover": "^1.1.2",
92
93
  "@radix-ui/react-slot": "^1.1.0",
93
94
  "@radix-ui/react-tooltip": "^1.1.3",
94
95
  "@tanstack/react-table": "^8.13.0",
@@ -0,0 +1,53 @@
1
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
2
+ import * as React from "react";
3
+
4
+ import { classNames } from "@sparkle/lib/utils";
5
+
6
+ const PopoverRoot = PopoverPrimitive.Root;
7
+
8
+ const PopoverTrigger = PopoverPrimitive.Trigger;
9
+
10
+ interface PopoverContentProps
11
+ extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {}
12
+
13
+ const PopoverContent = React.forwardRef<
14
+ React.ElementRef<typeof PopoverPrimitive.Content>,
15
+ PopoverContentProps
16
+ >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
17
+ <PopoverPrimitive.Portal>
18
+ <PopoverPrimitive.Content
19
+ ref={ref}
20
+ align={align}
21
+ sideOffset={sideOffset}
22
+ className={classNames(
23
+ "data-[state=open]:s-animate-in data-[state=open]:s-fade-in-0 data-[state=open]:s-zoom-in-95",
24
+ "data-[state=closed]:s-animate-out data-[state=closed]:s-fade-out-0 data-[state=closed]:s-zoom-out-95",
25
+ "data-[side=bottom]:s-slide-in-from-top-2",
26
+ "data-[side=left]:s-slide-in-from-right-2",
27
+ "data-[side=right]:s-slide-in-from-left-2",
28
+ "data-[side=top]:s-slide-in-from-bottom-2",
29
+ "s-border-border s-text-primary-950 s-z-50 s-w-72 s-rounded-lg s-border s-bg-background s-p-4 s-shadow-md s-outline-none",
30
+ className ?? ""
31
+ )}
32
+ {...props}
33
+ />
34
+ </PopoverPrimitive.Portal>
35
+ ));
36
+
37
+ interface PopoverProps extends Omit<PopoverContentProps, "content"> {
38
+ trigger: React.ReactNode;
39
+ content: React.ReactNode;
40
+ }
41
+
42
+ function Popover({ trigger, content, ...props }: PopoverProps) {
43
+ return (
44
+ <PopoverRoot>
45
+ <PopoverTrigger>{trigger}</PopoverTrigger>
46
+ <PopoverContent {...props}>{content}</PopoverContent>
47
+ </PopoverRoot>
48
+ );
49
+ }
50
+
51
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
52
+
53
+ export { Popover, PopoverContent, PopoverRoot, PopoverTrigger };
@@ -35,6 +35,7 @@ export { Notification } from "./Notification";
35
35
  export { Page } from "./Page";
36
36
  export { PaginatedCitationsGrid } from "./PaginatedCitationsGrid";
37
37
  export { Pagination } from "./Pagination";
38
+ export { Popover, PopoverContent, PopoverRoot, PopoverTrigger } from "./Popover";
38
39
  export { Popup } from "./Popup";
39
40
  export { PriceTable } from "./PriceTable";
40
41
  export { RadioButton } from "./RadioButton";
@@ -52,4 +53,4 @@ export {
52
53
  TooltipTrigger,
53
54
  } from "./Tooltip";
54
55
  export { Tree } from "./Tree";
55
- export { ZoomableImageCitationWrapper } from "./ZoomableImageCitationWrapper";
56
+ export { ZoomableImageCitationWrapper } from "./ZoomableImageCitationWrapper";
@@ -0,0 +1,93 @@
1
+ import type { Meta } from "@storybook/react";
2
+ import React from "react";
3
+
4
+ import {
5
+ Button,
6
+ Input,
7
+ Popover,
8
+ PopoverContent,
9
+ PopoverRoot,
10
+ PopoverTrigger
11
+ } from "../index_with_tw_base";
12
+
13
+ const meta = {
14
+ title: "Primitives/Popover",
15
+ component: Popover,
16
+ } satisfies Meta<typeof Popover>;
17
+
18
+ export default meta;
19
+
20
+ export function SimplePopoverExample () {
21
+ return (
22
+ <Popover
23
+ trigger={
24
+ <Button label="Popover" variant="secondary"/>
25
+ }
26
+ content={
27
+ <div className="grid gap-2">
28
+ <p>Lorem</p>
29
+ <p>Ipsum</p>
30
+ <p>Lorem</p>
31
+ <p>Ipsum</p>
32
+ </div>
33
+ }
34
+ side="right"
35
+ sideOffset={100}
36
+ />
37
+ )
38
+ }
39
+
40
+ export function PopoverExample() {
41
+ return (
42
+ <PopoverRoot>
43
+ <PopoverTrigger>
44
+ <Button label="Popover" variant="primary" />
45
+ </PopoverTrigger>
46
+ <PopoverContent className="w-80">
47
+ <div className="grid gap-4">
48
+ <div className="space-y-2">
49
+ <h4 className="font-medium leading-none s-pb-2">Dimensions</h4>
50
+ <p className="text-sm text-muted-foreground">
51
+ Set the dimensions for the layer.
52
+ </p>
53
+ </div>
54
+ <div className="grid gap-2">
55
+ <div className="grid grid-cols-3 items-center gap-4">
56
+ <Input
57
+ name="width"
58
+ value="200px"
59
+ placeholder="Width"
60
+ className="col-span-2 h-8"
61
+ />
62
+ </div>
63
+ <div className="grid grid-cols-3 items-center gap-4">
64
+ <Input
65
+ name="max-width"
66
+ value="300px"
67
+ placeholder="Max. width"
68
+ className="col-span-2 h-8"
69
+ />
70
+ </div>
71
+ <div className="grid grid-cols-3 items-center gap-4">
72
+ <Input
73
+ name="height"
74
+ value="30px"
75
+ placeholder="Height"
76
+ className="col-span-2 h-8"
77
+ />
78
+ </div>
79
+ <div className="grid grid-cols-3 items-center gap-4">
80
+ <Input
81
+ name="max-height"
82
+ value="100px"
83
+ placeholder="Max. height"
84
+ className="col-span-2 h-8"
85
+ />
86
+ </div>
87
+ </div>
88
+ </div>
89
+ </PopoverContent>
90
+ </PopoverRoot>
91
+ )
92
+ }
93
+