@invergent/ui-sdk 2.19.0 → 2.19.2
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/README.md +11 -2
- package/dist/badge.d.cts +1 -1
- package/dist/badge.d.ts +1 -1
- package/dist/button-group.cjs +80 -0
- package/dist/button-group.cjs.map +1 -0
- package/dist/button-group.d.cts +17 -0
- package/dist/button-group.d.ts +17 -0
- package/dist/button-group.js +75 -0
- package/dist/button-group.js.map +1 -0
- package/dist/button.d.cts +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/chip.cjs +3 -3
- package/dist/chip.cjs.map +1 -1
- package/dist/chip.d.cts +2 -4
- package/dist/chip.d.ts +2 -4
- package/dist/chip.js +3 -3
- package/dist/chip.js.map +1 -1
- package/dist/{chunk-IVMZANP7.cjs → chunk-ILCP5QXL.cjs} +6 -3
- package/dist/chunk-ILCP5QXL.cjs.map +1 -0
- package/dist/chunk-NSK344BJ.js +80 -0
- package/dist/chunk-NSK344BJ.js.map +1 -0
- package/dist/chunk-PH733KDD.js +141 -0
- package/dist/chunk-PH733KDD.js.map +1 -0
- package/dist/chunk-QEBQ5NUN.cjs +148 -0
- package/dist/chunk-QEBQ5NUN.cjs.map +1 -0
- package/dist/chunk-UXSDDJXM.cjs +88 -0
- package/dist/chunk-UXSDDJXM.cjs.map +1 -0
- package/dist/{chunk-CPAFEXKR.js → chunk-WO2SXSNH.js} +6 -3
- package/dist/chunk-WO2SXSNH.js.map +1 -0
- package/dist/collapsible-header.cjs +14 -3
- package/dist/collapsible-header.cjs.map +1 -1
- package/dist/collapsible-header.d.cts +4 -1
- package/dist/collapsible-header.d.ts +4 -1
- package/dist/collapsible-header.js +14 -3
- package/dist/collapsible-header.js.map +1 -1
- package/dist/command.cjs +177 -0
- package/dist/command.cjs.map +1 -0
- package/dist/command.d.cts +22 -0
- package/dist/command.d.ts +22 -0
- package/dist/command.js +167 -0
- package/dist/command.js.map +1 -0
- package/dist/confirm-dialog.cjs +5 -3
- package/dist/confirm-dialog.cjs.map +1 -1
- package/dist/confirm-dialog.d.cts +4 -1
- package/dist/confirm-dialog.d.ts +4 -1
- package/dist/confirm-dialog.js +5 -3
- package/dist/confirm-dialog.js.map +1 -1
- package/dist/field.cjs +1 -1
- package/dist/field.js +1 -1
- package/dist/hover-card.cjs +43 -0
- package/dist/hover-card.cjs.map +1 -0
- package/dist/hover-card.d.cts +9 -0
- package/dist/hover-card.d.ts +9 -0
- package/dist/hover-card.js +39 -0
- package/dist/hover-card.js.map +1 -0
- package/dist/input-group.cjs +30 -142
- package/dist/input-group.cjs.map +1 -1
- package/dist/input-group.js +5 -139
- package/dist/input-group.js.map +1 -1
- package/dist/item.cjs +196 -0
- package/dist/item.cjs.map +1 -0
- package/dist/item.d.cts +28 -0
- package/dist/item.d.ts +28 -0
- package/dist/item.js +185 -0
- package/dist/item.js.map +1 -0
- package/dist/popover.cjs +31 -82
- package/dist/popover.cjs.map +1 -1
- package/dist/popover.js +2 -78
- package/dist/popover.js.map +1 -1
- package/dist/progress-bar.cjs +22 -10
- package/dist/progress-bar.cjs.map +1 -1
- package/dist/progress-bar.d.cts +2 -1
- package/dist/progress-bar.d.ts +2 -1
- package/dist/progress-bar.js +22 -10
- package/dist/progress-bar.js.map +1 -1
- package/dist/rabbit-mark.cjs +30 -0
- package/dist/rabbit-mark.cjs.map +1 -0
- package/dist/rabbit-mark.d.cts +16 -0
- package/dist/rabbit-mark.d.ts +16 -0
- package/dist/rabbit-mark.js +26 -0
- package/dist/rabbit-mark.js.map +1 -0
- package/dist/responsive-panel.cjs +85 -0
- package/dist/responsive-panel.cjs.map +1 -0
- package/dist/responsive-panel.d.cts +33 -0
- package/dist/responsive-panel.d.ts +33 -0
- package/dist/responsive-panel.js +83 -0
- package/dist/responsive-panel.js.map +1 -0
- package/dist/tab-strip.cjs +74 -0
- package/dist/tab-strip.cjs.map +1 -0
- package/dist/tab-strip.d.cts +22 -0
- package/dist/tab-strip.d.ts +22 -0
- package/dist/tab-strip.js +71 -0
- package/dist/tab-strip.js.map +1 -0
- package/dist/tabs.d.cts +1 -1
- package/dist/tabs.d.ts +1 -1
- package/dist/timeline.cjs +171 -0
- package/dist/timeline.cjs.map +1 -0
- package/dist/timeline.d.cts +28 -0
- package/dist/timeline.d.ts +28 -0
- package/dist/timeline.js +162 -0
- package/dist/timeline.js.map +1 -0
- package/dist/toggle-group.cjs +4 -2
- package/dist/toggle-group.cjs.map +1 -1
- package/dist/toggle-group.js +3 -1
- package/dist/toggle-group.js.map +1 -1
- package/dist/toggle.cjs +4 -4
- package/dist/toggle.d.cts +1 -1
- package/dist/toggle.d.ts +1 -1
- package/dist/toggle.js +1 -1
- package/package.json +2 -1
- package/dist/chunk-CPAFEXKR.js.map +0 -1
- package/dist/chunk-IVMZANP7.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -48,16 +48,25 @@ the kit carries Work's own components:
|
|
|
48
48
|
| `sidebar` | `Sidebar`, `SidebarBrand`, `SidebarUserBar`, `SidebarAction`, `useSidebar` | The desktop sidebar: open, or an icon rail that opens on hover, with the pin toggle at its bottom. `ListRow` and `SectionLabel` inside it collapse with the rail; outside it (a phone drawer) the parts draw open. |
|
|
49
49
|
| `list-row` | `ListRow`, `ListGroup` | A list entry (icon, label, description, count, chevron) in three densities; a button, or any link via `asChild`. |
|
|
50
50
|
| `section-label` | `SectionLabel` | A rule and a quiet word starting a group of rows. |
|
|
51
|
-
| `collapsible-header` | `CollapsibleHeader` | A styled `CollapsibleTrigger`: `nav` (a group in a list of rows) or `section` (a disclosure). |
|
|
52
|
-
| `chip` | `Chip`, `TonePill`, `TagPill`, `TONE` | Round chips by tone (`ok`, `warn`, `bad`, `muted`), removable with `onRemove`. |
|
|
51
|
+
| `collapsible-header` | `CollapsibleHeader` | A styled `CollapsibleTrigger`: `nav` (a group in a list of rows) or `section` (a disclosure; `size="sm"` for the compact one). |
|
|
52
|
+
| `chip` | `Chip`, `TonePill`, `TagPill`, `TONE` | Round chips by tone (`ok`, `warn`, `bad`, `info`, `muted`), removable with `onRemove`. |
|
|
53
53
|
| `choice-card` | `ChoiceCard` | A selectable option card (`aria-pressed`), amber when picked. |
|
|
54
54
|
| `text-link` | `TextLink` | Amber or muted text link; `asChild` for router links. |
|
|
55
55
|
| `segmented-control` | `SegmentedControl` | The Work / Dev mode switch, for any two or three peers. |
|
|
56
56
|
| `toggle`, `toggle-group` | `FilterPill`, `ViewSwitch`, `useRememberedView` | A list filter pill; a tab's view switch. |
|
|
57
|
+
| `tab-strip` | `TabStrip`, `TabStripTab` | A compact strip of tabs that close (a browser's open pages). |
|
|
57
58
|
| `pill-tabs` | `PillTabs` | A page's section tabs as a bare strip (`tabs` draws the same over Radix). |
|
|
58
59
|
| `empty-state` | `EmptyState`, `EmptyStateLogo` | The brand badge, a heading, copy and actions for an empty list. |
|
|
59
60
|
| `stat-card` | `StatCard`, `InfoHint`, `ChannelChip` | A stat tile: label, value, hint, detail. |
|
|
60
61
|
| `control-styles` | `CONTROL_*` | Class strings for native controls that cannot be a component. |
|
|
62
|
+
| `command` | `Command`, `CommandList`, `CommandGroup`, `CommandItem`, … | A searchable list (cmdk) with Work's menu rows; `data-checked` on an item lights its amber check. |
|
|
63
|
+
| `hover-card` | `HoverCard`, `HoverCardTrigger`, `HoverCardContent` | A card shown on hover, on the popover surface. |
|
|
64
|
+
| `item` | `Item`, `ItemMedia`, `ItemContent`, `ItemTitle`, `ItemDescription`, `ItemActions`, … | A content row (media, title, description, actions), plain, outlined or muted. |
|
|
65
|
+
| `button-group` | `ButtonGroup`, `ButtonGroupText`, `ButtonGroupSeparator` | Buttons joined into one control, rounded only at its ends. |
|
|
66
|
+
| `progress-bar` | `ProgressBar` | A 4px bar on the line colour, filled with `color` (amber by default). |
|
|
67
|
+
| `responsive-panel` | `ResponsivePanel` | A popover with a cursor, a bottom sheet on a phone. |
|
|
68
|
+
| `timeline` | `Timeline`, `TimelineItem`, `TimelineIndicator`, `TimelineSeparator`, … | A vertical run of steps, each a dot on a connecting line. |
|
|
69
|
+
| `rabbit-mark` | `RabbitMark`, `RABBIT_MARK_PATH`, `RABBIT_MARK_BOX` | The rabbit silhouette as an icon in `currentColor`, and its path for a canvas. |
|
|
61
70
|
|
|
62
71
|
Several rely on the `data-*` variants and the `no-scrollbar` utility from
|
|
63
72
|
`shadcn/tailwind.css`; import it alongside the theme.
|
package/dist/badge.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
10
10
|
asChild?: boolean;
|
package/dist/badge.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk6ARYCL4L_cjs = require('./chunk-6ARYCL4L.cjs');
|
|
4
|
+
var chunk6YHDDRIM_cjs = require('./chunk-6YHDDRIM.cjs');
|
|
5
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
6
|
+
var radixUi = require('radix-ui');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
var buttonGroupVariants = classVarianceAuthority.cva(
|
|
10
|
+
"group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 *:data-[slot=input]:px-4 has-[>[data-variant=outline]]:*:data-[slot=input-group]:border-foreground/[0.12] has-[>[data-variant=outline]]:*:data-[slot=input-group]:px-2.5 has-[>[data-variant=outline]]:*:data-[slot=select-trigger]:border-foreground/[0.12] has-[>[data-variant=outline]]:*:[[role=combobox]]:px-2.5 has-[>[data-variant=outline]]:[&>[data-slot=input-group]:has(:focus-visible)]:border-foreground/20 has-[>[data-variant=outline]]:[&>[data-slot=select-trigger]:focus-visible]:border-foreground/20 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-[10px] [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[>[data-variant=outline]]:[&>input]:border-foreground/[0.12] has-[>[data-variant=outline]]:[&>input:focus-visible]:border-foreground/20",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
orientation: {
|
|
14
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
15
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
orientation: "horizontal"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
function ButtonGroup({
|
|
24
|
+
className,
|
|
25
|
+
orientation,
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
role: "group",
|
|
32
|
+
"data-slot": "button-group",
|
|
33
|
+
"data-orientation": orientation,
|
|
34
|
+
className: chunk6YHDDRIM_cjs.cn(buttonGroupVariants({ orientation }), className),
|
|
35
|
+
...props
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
function ButtonGroupText({
|
|
40
|
+
className,
|
|
41
|
+
asChild = false,
|
|
42
|
+
...props
|
|
43
|
+
}) {
|
|
44
|
+
const Comp = asChild ? radixUi.Slot.Root : "div";
|
|
45
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
46
|
+
Comp,
|
|
47
|
+
{
|
|
48
|
+
className: chunk6YHDDRIM_cjs.cn(
|
|
49
|
+
"flex items-center gap-2 rounded-[7px] border border-transparent bg-transparent px-2.5 text-[13px] font-medium text-muted-foreground group-has-[>[data-variant=outline]]/button-group:border-foreground/[0.12] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-3.5",
|
|
50
|
+
className
|
|
51
|
+
),
|
|
52
|
+
...props
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function ButtonGroupSeparator({
|
|
57
|
+
className,
|
|
58
|
+
orientation = "vertical",
|
|
59
|
+
...props
|
|
60
|
+
}) {
|
|
61
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
+
chunk6ARYCL4L_cjs.Separator,
|
|
63
|
+
{
|
|
64
|
+
"data-slot": "button-group-separator",
|
|
65
|
+
orientation,
|
|
66
|
+
className: chunk6YHDDRIM_cjs.cn(
|
|
67
|
+
"relative self-stretch bg-foreground/[0.12] data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto",
|
|
68
|
+
className
|
|
69
|
+
),
|
|
70
|
+
...props
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
exports.ButtonGroup = ButtonGroup;
|
|
76
|
+
exports.ButtonGroupSeparator = ButtonGroupSeparator;
|
|
77
|
+
exports.ButtonGroupText = ButtonGroupText;
|
|
78
|
+
exports.buttonGroupVariants = buttonGroupVariants;
|
|
79
|
+
//# sourceMappingURL=button-group.cjs.map
|
|
80
|
+
//# sourceMappingURL=button-group.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/button-group.tsx"],"names":["cva","jsx","cn","Slot","Separator"],"mappings":";;;;;;;;AASA,IAAM,mBAAA,GAAsBA,0BAAA;AAAA,EAC1B,s7BAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,WAAA,EAAa;AAAA,QACX,UAAA,EACE,iHAAA;AAAA,QACF,QAAA,EACE;AAAA;AACJ,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,WAAA,EAAa;AAAA;AACf;AAEJ;AAEA,SAAS,WAAA,CAAY;AAAA,EACnB,SAAA;AAAA,EACA,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA2E;AACzE,EAAA,uBACEC,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,OAAA;AAAA,MACL,WAAA,EAAU,cAAA;AAAA,MACV,kBAAA,EAAkB,WAAA;AAAA,MAClB,WAAWC,oBAAA,CAAG,mBAAA,CAAoB,EAAE,WAAA,EAAa,GAAG,SAAS,CAAA;AAAA,MAC5D,GAAG;AAAA;AAAA,GACN;AAEJ;AAIA,SAAS,eAAA,CAAgB;AAAA,EACvB,SAAA;AAAA,EACA,OAAA,GAAU,KAAA;AAAA,EACV,GAAG;AACL,CAAA,EAEG;AACD,EAAA,MAAM,IAAA,GAAO,OAAA,GAAUC,YAAA,CAAK,IAAA,GAAO,KAAA;AAEnC,EAAA,uBACEF,cAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAWC,oBAAA;AAAA,QACT,kRAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,oBAAA,CAAqB;AAAA,EAC5B,SAAA;AAAA,EACA,WAAA,GAAc,UAAA;AAAA,EACd,GAAG;AACL,CAAA,EAA2C;AACzC,EAAA,uBACED,cAAA;AAAA,IAACG,2BAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,wBAAA;AAAA,MACV,WAAA;AAAA,MACA,SAAA,EAAWF,oBAAA;AAAA,QACT,kIAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ","file":"button-group.cjs","sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\"\nimport { Slot } from \"radix-ui\"\n\nimport { cn } from \"./lib/utils\"\nimport { Separator } from \"./separator\"\n\n// Buttons joined into one control: the inner corners square off and the\n// shared borders collapse, so the group keeps the Work button's 7px corners\n// only at its two ends.\nconst buttonGroupVariants = cva(\n \"group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 *:data-[slot=input]:px-4 has-[>[data-variant=outline]]:*:data-[slot=input-group]:border-foreground/[0.12] has-[>[data-variant=outline]]:*:data-[slot=input-group]:px-2.5 has-[>[data-variant=outline]]:*:data-[slot=select-trigger]:border-foreground/[0.12] has-[>[data-variant=outline]]:*:[[role=combobox]]:px-2.5 has-[>[data-variant=outline]]:[&>[data-slot=input-group]:has(:focus-visible)]:border-foreground/20 has-[>[data-variant=outline]]:[&>[data-slot=select-trigger]:focus-visible]:border-foreground/20 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-[10px] [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[>[data-variant=outline]]:[&>input]:border-foreground/[0.12] has-[>[data-variant=outline]]:[&>input:focus-visible]:border-foreground/20\",\n {\n variants: {\n orientation: {\n horizontal:\n \"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none\",\n vertical:\n \"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none\",\n },\n },\n defaultVariants: {\n orientation: \"horizontal\",\n },\n }\n)\n\nfunction ButtonGroup({\n className,\n orientation,\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof buttonGroupVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"button-group\"\n data-orientation={orientation}\n className={cn(buttonGroupVariants({ orientation }), className)}\n {...props}\n />\n )\n}\n\n// A label inside the group (\"2 of 5\"): the button's 13px medium in muted\n// text, bordered like its outline neighbours.\nfunction ButtonGroupText({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n asChild?: boolean\n}) {\n const Comp = asChild ? Slot.Root : \"div\"\n\n return (\n <Comp\n className={cn(\n \"flex items-center gap-2 rounded-[7px] border border-transparent bg-transparent px-2.5 text-[13px] font-medium text-muted-foreground group-has-[>[data-variant=outline]]/button-group:border-foreground/[0.12] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-3.5\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ButtonGroupSeparator({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"button-group-separator\"\n orientation={orientation}\n className={cn(\n \"relative self-stretch bg-foreground/[0.12] data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n ButtonGroup,\n ButtonGroupSeparator,\n ButtonGroupText,\n buttonGroupVariants,\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { Separator } from './separator.cjs';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'radix-ui';
|
|
7
|
+
|
|
8
|
+
declare const buttonGroupVariants: (props?: ({
|
|
9
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
}): react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { Separator } from './separator.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'radix-ui';
|
|
7
|
+
|
|
8
|
+
declare const buttonGroupVariants: (props?: ({
|
|
9
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
}): react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Separator } from './chunk-CTIEUG5L.js';
|
|
2
|
+
import { cn } from './chunk-LZGII7SX.js';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { Slot } from 'radix-ui';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var buttonGroupVariants = cva(
|
|
8
|
+
"group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 *:data-[slot=input]:px-4 has-[>[data-variant=outline]]:*:data-[slot=input-group]:border-foreground/[0.12] has-[>[data-variant=outline]]:*:data-[slot=input-group]:px-2.5 has-[>[data-variant=outline]]:*:data-[slot=select-trigger]:border-foreground/[0.12] has-[>[data-variant=outline]]:*:[[role=combobox]]:px-2.5 has-[>[data-variant=outline]]:[&>[data-slot=input-group]:has(:focus-visible)]:border-foreground/20 has-[>[data-variant=outline]]:[&>[data-slot=select-trigger]:focus-visible]:border-foreground/20 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-[10px] [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[>[data-variant=outline]]:[&>input]:border-foreground/[0.12] has-[>[data-variant=outline]]:[&>input:focus-visible]:border-foreground/20",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
orientation: {
|
|
12
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
13
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
orientation: "horizontal"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
function ButtonGroup({
|
|
22
|
+
className,
|
|
23
|
+
orientation,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
role: "group",
|
|
30
|
+
"data-slot": "button-group",
|
|
31
|
+
"data-orientation": orientation,
|
|
32
|
+
className: cn(buttonGroupVariants({ orientation }), className),
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
function ButtonGroupText({
|
|
38
|
+
className,
|
|
39
|
+
asChild = false,
|
|
40
|
+
...props
|
|
41
|
+
}) {
|
|
42
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
Comp,
|
|
45
|
+
{
|
|
46
|
+
className: cn(
|
|
47
|
+
"flex items-center gap-2 rounded-[7px] border border-transparent bg-transparent px-2.5 text-[13px] font-medium text-muted-foreground group-has-[>[data-variant=outline]]/button-group:border-foreground/[0.12] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-3.5",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function ButtonGroupSeparator({
|
|
55
|
+
className,
|
|
56
|
+
orientation = "vertical",
|
|
57
|
+
...props
|
|
58
|
+
}) {
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
Separator,
|
|
61
|
+
{
|
|
62
|
+
"data-slot": "button-group-separator",
|
|
63
|
+
orientation,
|
|
64
|
+
className: cn(
|
|
65
|
+
"relative self-stretch bg-foreground/[0.12] data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto",
|
|
66
|
+
className
|
|
67
|
+
),
|
|
68
|
+
...props
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
74
|
+
//# sourceMappingURL=button-group.js.map
|
|
75
|
+
//# sourceMappingURL=button-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/button-group.tsx"],"names":[],"mappings":";;;;;;AASA,IAAM,mBAAA,GAAsB,GAAA;AAAA,EAC1B,s7BAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,WAAA,EAAa;AAAA,QACX,UAAA,EACE,iHAAA;AAAA,QACF,QAAA,EACE;AAAA;AACJ,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,WAAA,EAAa;AAAA;AACf;AAEJ;AAEA,SAAS,WAAA,CAAY;AAAA,EACnB,SAAA;AAAA,EACA,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA2E;AACzE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,OAAA;AAAA,MACL,WAAA,EAAU,cAAA;AAAA,MACV,kBAAA,EAAkB,WAAA;AAAA,MAClB,WAAW,EAAA,CAAG,mBAAA,CAAoB,EAAE,WAAA,EAAa,GAAG,SAAS,CAAA;AAAA,MAC5D,GAAG;AAAA;AAAA,GACN;AAEJ;AAIA,SAAS,eAAA,CAAgB;AAAA,EACvB,SAAA;AAAA,EACA,OAAA,GAAU,KAAA;AAAA,EACV,GAAG;AACL,CAAA,EAEG;AACD,EAAA,MAAM,IAAA,GAAO,OAAA,GAAU,IAAA,CAAK,IAAA,GAAO,KAAA;AAEnC,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA;AAAA,QACT,kRAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,oBAAA,CAAqB;AAAA,EAC5B,SAAA;AAAA,EACA,WAAA,GAAc,UAAA;AAAA,EACd,GAAG;AACL,CAAA,EAA2C;AACzC,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,wBAAA;AAAA,MACV,WAAA;AAAA,MACA,SAAA,EAAW,EAAA;AAAA,QACT,kIAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ","file":"button-group.js","sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\"\nimport { Slot } from \"radix-ui\"\n\nimport { cn } from \"./lib/utils\"\nimport { Separator } from \"./separator\"\n\n// Buttons joined into one control: the inner corners square off and the\n// shared borders collapse, so the group keeps the Work button's 7px corners\n// only at its two ends.\nconst buttonGroupVariants = cva(\n \"group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 *:data-[slot=input]:px-4 has-[>[data-variant=outline]]:*:data-[slot=input-group]:border-foreground/[0.12] has-[>[data-variant=outline]]:*:data-[slot=input-group]:px-2.5 has-[>[data-variant=outline]]:*:data-[slot=select-trigger]:border-foreground/[0.12] has-[>[data-variant=outline]]:*:[[role=combobox]]:px-2.5 has-[>[data-variant=outline]]:[&>[data-slot=input-group]:has(:focus-visible)]:border-foreground/20 has-[>[data-variant=outline]]:[&>[data-slot=select-trigger]:focus-visible]:border-foreground/20 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-[10px] [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[>[data-variant=outline]]:[&>input]:border-foreground/[0.12] has-[>[data-variant=outline]]:[&>input:focus-visible]:border-foreground/20\",\n {\n variants: {\n orientation: {\n horizontal:\n \"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none\",\n vertical:\n \"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none\",\n },\n },\n defaultVariants: {\n orientation: \"horizontal\",\n },\n }\n)\n\nfunction ButtonGroup({\n className,\n orientation,\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof buttonGroupVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"button-group\"\n data-orientation={orientation}\n className={cn(buttonGroupVariants({ orientation }), className)}\n {...props}\n />\n )\n}\n\n// A label inside the group (\"2 of 5\"): the button's 13px medium in muted\n// text, bordered like its outline neighbours.\nfunction ButtonGroupText({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n asChild?: boolean\n}) {\n const Comp = asChild ? Slot.Root : \"div\"\n\n return (\n <Comp\n className={cn(\n \"flex items-center gap-2 rounded-[7px] border border-transparent bg-transparent px-2.5 text-[13px] font-medium text-muted-foreground group-has-[>[data-variant=outline]]/button-group:border-foreground/[0.12] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-3.5\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ButtonGroupSeparator({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"button-group-separator\"\n orientation={orientation}\n className={cn(\n \"relative self-stretch bg-foreground/[0.12] data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n ButtonGroup,\n ButtonGroupSeparator,\n ButtonGroupText,\n buttonGroupVariants,\n}\n"]}
|
package/dist/button.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
8
8
|
size?: "default" | "sm" | "lg" | "icon" | "xs" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
package/dist/button.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
8
8
|
size?: "default" | "sm" | "lg" | "icon" | "xs" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
package/dist/chip.cjs
CHANGED
|
@@ -9,6 +9,7 @@ var TONE = {
|
|
|
9
9
|
ok: "bg-emerald-500/12 text-emerald-700 dark:text-emerald-300",
|
|
10
10
|
warn: "bg-amber-500/14 text-amber-700 dark:text-amber-300",
|
|
11
11
|
bad: "bg-red-500/12 text-red-700 dark:text-red-300",
|
|
12
|
+
info: "bg-sky-500/12 text-sky-700 dark:text-sky-300",
|
|
12
13
|
muted: "bg-foreground/[0.06] text-muted-foreground"
|
|
13
14
|
};
|
|
14
15
|
var chipVariants = classVarianceAuthority.cva(
|
|
@@ -60,10 +61,9 @@ function Chip({
|
|
|
60
61
|
}
|
|
61
62
|
function TonePill({
|
|
62
63
|
tone,
|
|
63
|
-
|
|
64
|
-
children
|
|
64
|
+
...props
|
|
65
65
|
}) {
|
|
66
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Chip, { tone, size: "sm",
|
|
66
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Chip, { tone, size: "sm", ...props });
|
|
67
67
|
}
|
|
68
68
|
function TagPill({
|
|
69
69
|
label,
|
package/dist/chip.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/chip.t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AAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,QAAA;AAAA,QACA,QAAA,oBACCC,cAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,QAAA;AAAA,YAGL,WAAA,EAAa,CAAC,CAAA,KAAM,CAAA,CAAE,cAAA,EAAe;AAAA,YACrC,OAAA,EAAS,QAAA;AAAA,YACT,YAAA,EAAY,WAAA;AAAA,YAEZ,SAAA,EAAU,mSAAA;AAAA,YAEV,QAAA,kBAAAA,cAAA,CAACC,iBAAA,EAAA,EAAM,SAAA,EAAU,UAAA,EAAW;AAAA;AAAA;AAC9B;AAAA;AAAA,GAEJ;AAEJ;AAGA,SAAS,QAAA,CAAS;AAAA,EAChB,IAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAqE;AACnE,EAAA,sCAAQ,IAAA,EAAA,EAAK,IAAA,EAAY,IAAA,EAAK,IAAA,EAAM,GAAG,KAAA,EAAO,CAAA;AAChD;AAGA,SAAS,OAAA,CAAQ;AAAA,EACf,KAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA,GAAO,IAAA;AAAA,EACP;AACF,CAAA,EAKG;AACD,EAAA,uBACED,cAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAM,IAAA,KAAS,IAAA,GAAO,SAAA,GAAY,IAAA;AAAA,MAClC,QAAA;AAAA,MACA,WAAA,EAAa,cAAc,KAAK,CAAA,CAAA;AAAA,MAChC,SAAA,EAAWD,oBAAA,CAAG,aAAA,EAAe,SAAS,CAAA;AAAA,MAErC,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chip.cjs","sourcesContent":["import * as React from \"react\"\nimport { cva } from \"class-variance-authority\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"./lib/utils\"\n\nexport type Tone = \"ok\" | \"warn\" | \"bad\" | \"info\" | \"muted\"\n\n// The Work console's status tones: a faint wash of the colour with text a\n// step darker in light mode and a step lighter in dark.\nexport const TONE: Record<Tone, string> = {\n ok: \"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300\",\n warn: \"bg-amber-500/14 text-amber-700 dark:text-amber-300\",\n bad: \"bg-red-500/12 text-red-700 dark:text-red-300\",\n info: \"bg-sky-500/12 text-sky-700 dark:text-sky-300\",\n muted: \"bg-foreground/[0.06] text-muted-foreground\",\n}\n\n// One chip for statuses (TonePill), tags and removable values (TagPill):\n// round, medium weight, tinted by tone.\nconst chipVariants = cva(\n \"inline-flex w-fit shrink-0 items-center gap-1 rounded-full font-medium whitespace-nowrap [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n tone: TONE,\n size: {\n sm: \"px-2 py-0.5 text-[11.5px]\",\n default: \"px-2 py-0.5 text-xs\",\n lg: \"px-2.5 py-0.5 text-sm\",\n },\n },\n defaultVariants: { tone: \"muted\", size: \"default\" },\n }\n)\n\nfunction Chip({\n tone = \"muted\",\n size = \"default\",\n onRemove,\n removeLabel = \"Remove\",\n className,\n children,\n ...props\n}: React.ComponentProps<\"span\"> & {\n tone?: Tone\n size?: \"sm\" | \"default\" | \"lg\"\n /** Shows an × that calls this. */\n onRemove?: () => void\n /** The ×'s accessible name. */\n removeLabel?: string\n}) {\n return (\n <span\n data-slot=\"chip\"\n data-tone={tone}\n className={cn(chipVariants({ tone, size }), onRemove && \"pr-1\", className)}\n {...props}\n >\n {children}\n {onRemove && (\n <button\n type=\"button\"\n // preventDefault on mousedown keeps the adjacent input focused so\n // removing a chip doesn't trigger its blur-to-commit handler.\n onMouseDown={(e) => e.preventDefault()}\n onClick={onRemove}\n aria-label={removeLabel}\n // The × is 10px; the overlay gives it a usable hit area.\n className=\"relative inline-flex cursor-pointer items-center justify-center rounded-full border-none bg-transparent p-0.5 text-current opacity-60 transition-opacity outline-none after:absolute after:-inset-1.5 hover:opacity-100 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/40\"\n >\n <XIcon className=\"size-2.5\" />\n </button>\n )}\n </span>\n )\n}\n\n/** A status chip (\"Active\", \"Paused\") in one of the tones. */\nfunction TonePill({\n tone,\n ...props\n}: Omit<React.ComponentProps<\"span\">, \"onRemove\"> & { tone?: Tone }) {\n return <Chip tone={tone} size=\"sm\" {...props} />\n}\n\n/** A tag, removable when `onRemove` is given. */\nfunction TagPill({\n label,\n onRemove,\n size = \"xs\",\n className,\n}: {\n label: string\n onRemove?: () => void\n size?: \"xs\" | \"sm\"\n className?: string\n}) {\n return (\n <Chip\n size={size === \"xs\" ? \"default\" : \"lg\"}\n onRemove={onRemove}\n removeLabel={`Remove tag ${label}`}\n className={cn(\"font-normal\", className)}\n >\n {label}\n </Chip>\n )\n}\n\nexport { Chip, TonePill, TagPill, chipVariants }\n"]}
|
package/dist/chip.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
|
-
type Tone = "ok" | "warn" | "bad" | "muted";
|
|
5
|
+
type Tone = "ok" | "warn" | "bad" | "info" | "muted";
|
|
6
6
|
declare const TONE: Record<Tone, string>;
|
|
7
7
|
declare const chipVariants: (props?: ({
|
|
8
8
|
tone?: Tone | null | undefined;
|
|
@@ -17,10 +17,8 @@ declare function Chip({ tone, size, onRemove, removeLabel, className, children,
|
|
|
17
17
|
removeLabel?: string;
|
|
18
18
|
}): react_jsx_runtime.JSX.Element;
|
|
19
19
|
/** A status chip ("Active", "Paused") in one of the tones. */
|
|
20
|
-
declare function TonePill({ tone,
|
|
20
|
+
declare function TonePill({ tone, ...props }: Omit<React.ComponentProps<"span">, "onRemove"> & {
|
|
21
21
|
tone?: Tone;
|
|
22
|
-
className?: string;
|
|
23
|
-
children: React.ReactNode;
|
|
24
22
|
}): react_jsx_runtime.JSX.Element;
|
|
25
23
|
/** A tag, removable when `onRemove` is given. */
|
|
26
24
|
declare function TagPill({ label, onRemove, size, className, }: {
|
package/dist/chip.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
|
-
type Tone = "ok" | "warn" | "bad" | "muted";
|
|
5
|
+
type Tone = "ok" | "warn" | "bad" | "info" | "muted";
|
|
6
6
|
declare const TONE: Record<Tone, string>;
|
|
7
7
|
declare const chipVariants: (props?: ({
|
|
8
8
|
tone?: Tone | null | undefined;
|
|
@@ -17,10 +17,8 @@ declare function Chip({ tone, size, onRemove, removeLabel, className, children,
|
|
|
17
17
|
removeLabel?: string;
|
|
18
18
|
}): react_jsx_runtime.JSX.Element;
|
|
19
19
|
/** A status chip ("Active", "Paused") in one of the tones. */
|
|
20
|
-
declare function TonePill({ tone,
|
|
20
|
+
declare function TonePill({ tone, ...props }: Omit<React.ComponentProps<"span">, "onRemove"> & {
|
|
21
21
|
tone?: Tone;
|
|
22
|
-
className?: string;
|
|
23
|
-
children: React.ReactNode;
|
|
24
22
|
}): react_jsx_runtime.JSX.Element;
|
|
25
23
|
/** A tag, removable when `onRemove` is given. */
|
|
26
24
|
declare function TagPill({ label, onRemove, size, className, }: {
|
package/dist/chip.js
CHANGED
|
@@ -7,6 +7,7 @@ var TONE = {
|
|
|
7
7
|
ok: "bg-emerald-500/12 text-emerald-700 dark:text-emerald-300",
|
|
8
8
|
warn: "bg-amber-500/14 text-amber-700 dark:text-amber-300",
|
|
9
9
|
bad: "bg-red-500/12 text-red-700 dark:text-red-300",
|
|
10
|
+
info: "bg-sky-500/12 text-sky-700 dark:text-sky-300",
|
|
10
11
|
muted: "bg-foreground/[0.06] text-muted-foreground"
|
|
11
12
|
};
|
|
12
13
|
var chipVariants = cva(
|
|
@@ -58,10 +59,9 @@ function Chip({
|
|
|
58
59
|
}
|
|
59
60
|
function TonePill({
|
|
60
61
|
tone,
|
|
61
|
-
|
|
62
|
-
children
|
|
62
|
+
...props
|
|
63
63
|
}) {
|
|
64
|
-
return /* @__PURE__ */ jsx(Chip, { tone, size: "sm",
|
|
64
|
+
return /* @__PURE__ */ jsx(Chip, { tone, size: "sm", ...props });
|
|
65
65
|
}
|
|
66
66
|
function TagPill({
|
|
67
67
|
label,
|
package/dist/chip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/chip.tsx"],"names":[],"mappings":";;;;;AAUO,IAAM,IAAA,GAA6B;AAAA,EACxC,EAAA,EAAI,0DAAA;AAAA,EACJ,IAAA,EAAM,oDAAA;AAAA,EACN,GAAA,EAAK,8CAAA;AAAA,EACL,KAAA,EAAO;AACT;AAIA,IAAM,YAAA,GAAe,GAAA;AAAA,EACnB,uIAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,IAAA;AAAA,MACN,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,2BAAA;AAAA,QACJ,OAAA,EAAS,qBAAA;AAAA,QACT,EAAA,EAAI;AAAA;AACN,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,IAAA,EAAM,OAAA,EAAS,MAAM,SAAA;AAAU;AAEtD;AAEA,SAAS,IAAA,CAAK;AAAA,EACZ,IAAA,GAAO,OAAA;AAAA,EACP,IAAA,GAAO,SAAA;AAAA,EACP,QAAA;AAAA,EACA,WAAA,GAAc,QAAA;AAAA,EACd,SAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAOG;AACD,EAAA,uBACE,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,MAAA;AAAA,MACV,WAAA,EAAW,IAAA;AAAA,MACX,SAAA,EAAW,EAAA,CAAG,YAAA,CAAa,EAAE,IAAA,EAAM,MAAM,CAAA,EAAG,QAAA,IAAY,MAAA,EAAQ,SAAS,CAAA;AAAA,MACxE,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAA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\nimport { cva } from \"class-variance-authority\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"./lib/utils\"\n\nexport type Tone = \"ok\" | \"warn\" | \"bad\" | \"info\" | \"muted\"\n\n// The Work console's status tones: a faint wash of the colour with text a\n// step darker in light mode and a step lighter in dark.\nexport const TONE: Record<Tone, string> = {\n ok: \"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300\",\n warn: \"bg-amber-500/14 text-amber-700 dark:text-amber-300\",\n bad: \"bg-red-500/12 text-red-700 dark:text-red-300\",\n info: \"bg-sky-500/12 text-sky-700 dark:text-sky-300\",\n muted: \"bg-foreground/[0.06] text-muted-foreground\",\n}\n\n// One chip for statuses (TonePill), tags and removable values (TagPill):\n// round, medium weight, tinted by tone.\nconst chipVariants = cva(\n \"inline-flex w-fit shrink-0 items-center gap-1 rounded-full font-medium whitespace-nowrap [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n tone: TONE,\n size: {\n sm: \"px-2 py-0.5 text-[11.5px]\",\n default: \"px-2 py-0.5 text-xs\",\n lg: \"px-2.5 py-0.5 text-sm\",\n },\n },\n defaultVariants: { tone: \"muted\", size: \"default\" },\n }\n)\n\nfunction Chip({\n tone = \"muted\",\n size = \"default\",\n onRemove,\n removeLabel = \"Remove\",\n className,\n children,\n ...props\n}: React.ComponentProps<\"span\"> & {\n tone?: Tone\n size?: \"sm\" | \"default\" | \"lg\"\n /** Shows an × that calls this. */\n onRemove?: () => void\n /** The ×'s accessible name. */\n removeLabel?: string\n}) {\n return (\n <span\n data-slot=\"chip\"\n data-tone={tone}\n className={cn(chipVariants({ tone, size }), onRemove && \"pr-1\", className)}\n {...props}\n >\n {children}\n {onRemove && (\n <button\n type=\"button\"\n // preventDefault on mousedown keeps the adjacent input focused so\n // removing a chip doesn't trigger its blur-to-commit handler.\n onMouseDown={(e) => e.preventDefault()}\n onClick={onRemove}\n aria-label={removeLabel}\n // The × is 10px; the overlay gives it a usable hit area.\n className=\"relative inline-flex cursor-pointer items-center justify-center rounded-full border-none bg-transparent p-0.5 text-current opacity-60 transition-opacity outline-none after:absolute after:-inset-1.5 hover:opacity-100 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/40\"\n >\n <XIcon className=\"size-2.5\" />\n </button>\n )}\n </span>\n )\n}\n\n/** A status chip (\"Active\", \"Paused\") in one of the tones. */\nfunction TonePill({\n tone,\n ...props\n}: Omit<React.ComponentProps<\"span\">, \"onRemove\"> & { tone?: Tone }) {\n return <Chip tone={tone} size=\"sm\" {...props} />\n}\n\n/** A tag, removable when `onRemove` is given. */\nfunction TagPill({\n label,\n onRemove,\n size = \"xs\",\n className,\n}: {\n label: string\n onRemove?: () => void\n size?: \"xs\" | \"sm\"\n className?: string\n}) {\n return (\n <Chip\n size={size === \"xs\" ? \"default\" : \"lg\"}\n onRemove={onRemove}\n removeLabel={`Remove tag ${label}`}\n className={cn(\"font-normal\", className)}\n >\n {label}\n </Chip>\n )\n}\n\nexport { Chip, TonePill, TagPill, chipVariants }\n"]}
|
|
@@ -16,7 +16,10 @@ var toggleVariants = classVarianceAuthority.cva(
|
|
|
16
16
|
size: {
|
|
17
17
|
default: "min-h-10 px-3 text-[13px] pointer-fine:min-h-8",
|
|
18
18
|
sm: "min-h-9 px-3 text-[12px] pointer-fine:min-h-7",
|
|
19
|
-
lg: "min-h-11 px-4 text-sm pointer-fine:min-h-9"
|
|
19
|
+
lg: "min-h-11 px-4 text-sm pointer-fine:min-h-9",
|
|
20
|
+
// Square, as the Button's icon sizes: 44px on touch.
|
|
21
|
+
icon: "size-9 min-h-11 min-w-11 px-0 pointer-fine:min-h-0 pointer-fine:min-w-0",
|
|
22
|
+
"icon-xs": "size-7 min-h-11 min-w-11 px-0 pointer-fine:min-h-0 pointer-fine:min-w-0"
|
|
20
23
|
}
|
|
21
24
|
},
|
|
22
25
|
defaultVariants: {
|
|
@@ -63,5 +66,5 @@ function FilterPill({
|
|
|
63
66
|
exports.FilterPill = FilterPill;
|
|
64
67
|
exports.Toggle = Toggle;
|
|
65
68
|
exports.toggleVariants = toggleVariants;
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
67
|
-
//# sourceMappingURL=chunk-
|
|
69
|
+
//# sourceMappingURL=chunk-ILCP5QXL.cjs.map
|
|
70
|
+
//# sourceMappingURL=chunk-ILCP5QXL.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/toggle.tsx"],"names":["cva","jsx","TogglePrimitive","cn"],"mappings":";;;;;;;AAWA,IAAM,cAAA,GAAiBA,0BAAA;AAAA,EACrB,oVAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EACE,6NAAA;AAAA,QACF,OAAA,EACE;AAAA,OACJ;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,OAAA,EAAS,gDAAA;AAAA,QACT,EAAA,EAAI,+CAAA;AAAA,QACJ,EAAA,EAAI,4CAAA;AAAA;AAAA,QAEJ,IAAA,EAAM,yEAAA;AAAA,QACN,SAAA,EACE;AAAA;AACJ,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACR;AAEJ;AAEA,SAAS,MAAA,CAAO;AAAA,EACd,SAAA;AAAA,EACA,OAAA,GAAU,SAAA;AAAA,EACV,IAAA,GAAO,SAAA;AAAA,EACP,GAAG;AACL,CAAA,EACuC;AACrC,EAAA,uBACEC,cAAA;AAAA,IAACC,cAAA,CAAgB,IAAA;AAAA,IAAhB;AAAA,MACC,WAAA,EAAU,QAAA;AAAA,MACV,SAAA,EAAWC,qBAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,SAAA,EAAW,CAAC,CAAA;AAAA,MACzD,GAAG;AAAA;AAAA,GACN;AAEJ;AAMA,SAAS,UAAA,CAAW;AAAA,EAClB,EAAA;AAAA,EACA,OAAA;AAAA,EACA,GAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAQG;AACD,EAAA,uBACEF,cAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAQ,SAAA;AAAA,MACR,IAAA,EAAK,IAAA;AAAA,MACL,OAAA,EAAS,EAAA;AAAA,MACT,eAAA,EAAiB,MAAM,OAAA,EAAQ;AAAA,MAC/B,WAAWE,oBAAA,CAAG,GAAA,IAAO,CAAC,EAAA,IAAM,cAAc,SAAS,CAAA;AAAA,MAClD,GAAG;AAAA;AAAA,GACN;AAEJ","file":"chunk-ILCP5QXL.cjs","sourcesContent":["import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Toggle as TogglePrimitive } from \"radix-ui\"\n\nimport { cn } from \"./lib/utils\"\n\n// The Work console's pressed-state toggles. `default` is the 9px chip its\n// forms use for a choice that is on or off (Once / Repeating, the days of the\n// week): a faint box, amber-tinted once pressed. `outline` is its filter\n// pill: round, bordered, a neutral fill once on. Muted text brightens on\n// hover. Touch keeps 40px or more, a mouse the compact height.\nconst toggleVariants = cva(\n \"group/toggle inline-flex shrink-0 items-center justify-center gap-1.5 border whitespace-nowrap transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5\",\n {\n variants: {\n variant: {\n default:\n \"rounded-[9px] border-foreground/[0.08] bg-foreground/[0.04] font-medium text-muted-foreground hover:text-foreground data-[state=on]:border-amber-500/40 data-[state=on]:bg-amber-500/[0.12] data-[state=on]:text-foreground\",\n outline:\n \"rounded-full border-foreground/10 text-muted-foreground hover:text-foreground data-[state=on]:border-foreground/30 data-[state=on]:bg-foreground/[0.08] data-[state=on]:font-medium data-[state=on]:text-foreground\",\n },\n size: {\n default: \"min-h-10 px-3 text-[13px] pointer-fine:min-h-8\",\n sm: \"min-h-9 px-3 text-[12px] pointer-fine:min-h-7\",\n lg: \"min-h-11 px-4 text-sm pointer-fine:min-h-9\",\n // Square, as the Button's icon sizes: 44px on touch.\n icon: \"size-9 min-h-11 min-w-11 px-0 pointer-fine:min-h-0 pointer-fine:min-w-0\",\n \"icon-xs\":\n \"size-7 min-h-11 min-w-11 px-0 pointer-fine:min-h-0 pointer-fine:min-w-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Toggle({\n className,\n variant = \"default\",\n size = \"default\",\n ...props\n}: React.ComponentProps<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>) {\n return (\n <TogglePrimitive.Root\n data-slot=\"toggle\"\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\n/**\n * The Work filter pill (a row of them filters a list: \"All channels\",\n * \"Slack 3\"…). An empty filter stays clickable, just quieter.\n */\nfunction FilterPill({\n on,\n onClick,\n dim,\n className,\n ...props\n}: Omit<\n React.ComponentProps<typeof TogglePrimitive.Root>,\n \"pressed\" | \"onPressedChange\" | \"onClick\"\n> & {\n on: boolean\n onClick: () => void\n /** Nothing behind it yet: still clickable, just quieter. */\n dim?: boolean\n}) {\n return (\n <Toggle\n variant=\"outline\"\n size=\"sm\"\n pressed={on}\n onPressedChange={() => onClick()}\n className={cn(dim && !on && \"opacity-55\", className)}\n {...props}\n />\n )\n}\n\nexport { Toggle, FilterPill, toggleVariants }\n"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { cn } from './chunk-LZGII7SX.js';
|
|
2
|
+
import { Popover as Popover$1 } from 'radix-ui';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function Popover({
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Popover$1.Root, { "data-slot": "popover", ...props });
|
|
9
|
+
}
|
|
10
|
+
function PopoverTrigger({
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx(Popover$1.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
14
|
+
}
|
|
15
|
+
function PopoverContent({
|
|
16
|
+
className,
|
|
17
|
+
align = "center",
|
|
18
|
+
sideOffset = 4,
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(
|
|
22
|
+
Popover$1.Content,
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "popover-content",
|
|
25
|
+
align,
|
|
26
|
+
sideOffset,
|
|
27
|
+
className: cn(
|
|
28
|
+
// The surface of Work's menus, at panel padding.
|
|
29
|
+
"z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-4 rounded-[12px] border border-foreground/10 bg-popover p-4 text-sm text-popover-foreground shadow-[0px_10px_24px_0px_rgba(0,0,0,0.12)] outline-hidden duration-100 dark:shadow-[0px_10px_24px_0px_rgba(0,0,0,0.5)] data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
30
|
+
className
|
|
31
|
+
),
|
|
32
|
+
...props
|
|
33
|
+
}
|
|
34
|
+
) });
|
|
35
|
+
}
|
|
36
|
+
function PopoverAnchor({
|
|
37
|
+
...props
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ jsx(Popover$1.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
40
|
+
}
|
|
41
|
+
function PopoverHeader({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
"data-slot": "popover-header",
|
|
46
|
+
className: cn("flex flex-col gap-1 text-sm", className),
|
|
47
|
+
...props
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function PopoverTitle({ className, ...props }) {
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
"data-slot": "popover-title",
|
|
56
|
+
className: cn("text-[13px] font-semibold text-foreground", className),
|
|
57
|
+
...props
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
function PopoverDescription({
|
|
62
|
+
className,
|
|
63
|
+
...props
|
|
64
|
+
}) {
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
"p",
|
|
67
|
+
{
|
|
68
|
+
"data-slot": "popover-description",
|
|
69
|
+
className: cn(
|
|
70
|
+
"text-[12.5px] leading-relaxed text-muted-foreground",
|
|
71
|
+
className
|
|
72
|
+
),
|
|
73
|
+
...props
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
|
|
79
|
+
//# sourceMappingURL=chunk-NSK344BJ.js.map
|
|
80
|
+
//# sourceMappingURL=chunk-NSK344BJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/popover.tsx"],"names":["PopoverPrimitive"],"mappings":";;;;AAKA,SAAS,OAAA,CAAQ;AAAA,EACf,GAAG;AACL,CAAA,EAAuD;AACrD,EAAA,2BAAQA,SAAA,CAAiB,IAAA,EAAjB,EAAsB,WAAA,EAAU,SAAA,EAAW,GAAG,KAAA,EAAO,CAAA;AAC/D;AAEA,SAAS,cAAA,CAAe;AAAA,EACtB,GAAG;AACL,CAAA,EAA0D;AACxD,EAAA,2BAAQA,SAAA,CAAiB,OAAA,EAAjB,EAAyB,WAAA,EAAU,iBAAA,EAAmB,GAAG,KAAA,EAAO,CAAA;AAC1E;AAEA,SAAS,cAAA,CAAe;AAAA,EACtB,SAAA;AAAA,EACA,KAAA,GAAQ,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AAA,EAAW,EAAA;AAAA,QACT,qDAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ","file":"chunk-NSK344BJ.js","sourcesContent":["import * as React from \"react\"\nimport { Popover as PopoverPrimitive } from \"radix-ui\"\n\nimport { cn } from \"./lib/utils\"\n\nfunction Popover({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nfunction PopoverTrigger({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />\n}\n\nfunction PopoverContent({\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n // The surface of Work's menus, at panel padding.\n \"z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-4 rounded-[12px] border border-foreground/10 bg-popover p-4 text-sm text-popover-foreground shadow-[0px_10px_24px_0px_rgba(0,0,0,0.12)] outline-hidden duration-100 dark:shadow-[0px_10px_24px_0px_rgba(0,0,0,0.5)] data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n )\n}\n\nfunction PopoverAnchor({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />\n}\n\nfunction PopoverHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-header\"\n className={cn(\"flex flex-col gap-1 text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverTitle({ className, ...props }: React.ComponentProps<\"h2\">) {\n return (\n <div\n data-slot=\"popover-title\"\n className={cn(\"text-[13px] font-semibold text-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverDescription({\n className,\n ...props\n}: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"popover-description\"\n className={cn(\n \"text-[12.5px] leading-relaxed text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverTitle,\n PopoverTrigger,\n}\n"]}
|