@refine-studio/ui 0.0.0 → 0.1.0
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/LICENSE +21 -0
- package/README.md +102 -2
- package/dist/components/accordion/accordion.d.ts +15 -0
- package/dist/components/accordion/accordion.js +58 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/alert/alert.d.ts +24 -0
- package/dist/components/alert/alert.js +98 -0
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +36 -0
- package/dist/components/alert-dialog/alert-dialog.js +112 -0
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +77 -0
- package/dist/components/app-shell/app-shell.js +224 -0
- package/dist/components/app-shell/app-shell.js.map +1 -0
- package/dist/components/avatar/avatar.d.ts +32 -0
- package/dist/components/avatar/avatar.js +83 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/badge/badge.d.ts +15 -0
- package/dist/components/badge/badge.js +50 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +24 -0
- package/dist/components/breadcrumb/breadcrumb.js +82 -0
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/button/button.d.ts +15 -0
- package/dist/components/button/button.js +75 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/card/card.d.ts +46 -0
- package/dist/components/card/card.js +124 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +6 -0
- package/dist/components/checkbox/checkbox.js +31 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/chip/chip.d.ts +25 -0
- package/dist/components/chip/chip.js +54 -0
- package/dist/components/chip/chip.js.map +1 -0
- package/dist/components/code/code.d.ts +15 -0
- package/dist/components/code/code.js +63 -0
- package/dist/components/code/code.js.map +1 -0
- package/dist/components/collapsible/collapsible.d.ts +14 -0
- package/dist/components/collapsible/collapsible.js +55 -0
- package/dist/components/collapsible/collapsible.js.map +1 -0
- package/dist/components/combobox/combobox.d.ts +33 -0
- package/dist/components/combobox/combobox.js +244 -0
- package/dist/components/combobox/combobox.js.map +1 -0
- package/dist/components/command-menu/command-menu.d.ts +35 -0
- package/dist/components/command-menu/command-menu.js +116 -0
- package/dist/components/command-menu/command-menu.js.map +1 -0
- package/dist/components/context-menu/context-menu.d.ts +45 -0
- package/dist/components/context-menu/context-menu.js +136 -0
- package/dist/components/context-menu/context-menu.js.map +1 -0
- package/dist/components/data-table/data-table.d.ts +49 -0
- package/dist/components/data-table/data-table.js +171 -0
- package/dist/components/data-table/data-table.js.map +1 -0
- package/dist/components/data-table/sort-rows.d.ts +6 -0
- package/dist/components/data-table/sort-rows.js +33 -0
- package/dist/components/data-table/sort-rows.js.map +1 -0
- package/dist/components/dialog/dialog.d.ts +42 -0
- package/dist/components/dialog/dialog.js +118 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +45 -0
- package/dist/components/dropdown-menu/dropdown-menu.js +137 -0
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -0
- package/dist/components/dropdown-menu/menu-styles.d.ts +10 -0
- package/dist/components/dropdown-menu/menu-styles.js +34 -0
- package/dist/components/dropdown-menu/menu-styles.js.map +1 -0
- package/dist/components/empty-state/empty-state.d.ts +12 -0
- package/dist/components/empty-state/empty-state.js +46 -0
- package/dist/components/empty-state/empty-state.js.map +1 -0
- package/dist/components/eyebrow/eyebrow.d.ts +9 -0
- package/dist/components/eyebrow/eyebrow.js +25 -0
- package/dist/components/eyebrow/eyebrow.js.map +1 -0
- package/dist/components/field/field.d.ts +56 -0
- package/dist/components/field/field.js +135 -0
- package/dist/components/field/field.js.map +1 -0
- package/dist/components/glow-border/glow-border.d.ts +9 -0
- package/dist/components/glow-border/glow-border.js +39 -0
- package/dist/components/glow-border/glow-border.js.map +1 -0
- package/dist/components/hex-field/hex-field.d.ts +12 -0
- package/dist/components/hex-field/hex-field.js +86 -0
- package/dist/components/hex-field/hex-field.js.map +1 -0
- package/dist/components/input/input.d.ts +14 -0
- package/dist/components/input/input.js +52 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/kbd/kbd.d.ts +9 -0
- package/dist/components/kbd/kbd.js +26 -0
- package/dist/components/kbd/kbd.js.map +1 -0
- package/dist/components/label/label.d.ts +6 -0
- package/dist/components/label/label.js +17 -0
- package/dist/components/label/label.js.map +1 -0
- package/dist/components/logo/logo-paths.d.ts +5 -0
- package/dist/components/logo/logo-paths.js +20 -0
- package/dist/components/logo/logo-paths.js.map +1 -0
- package/dist/components/logo/logo.d.ts +18 -0
- package/dist/components/logo/logo.js +94 -0
- package/dist/components/logo/logo.js.map +1 -0
- package/dist/components/marquee/marquee.d.ts +15 -0
- package/dist/components/marquee/marquee.js +54 -0
- package/dist/components/marquee/marquee.js.map +1 -0
- package/dist/components/page-header/page-header.d.ts +15 -0
- package/dist/components/page-header/page-header.js +50 -0
- package/dist/components/page-header/page-header.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +28 -0
- package/dist/components/pagination/pagination.js +95 -0
- package/dist/components/pagination/pagination.js.map +1 -0
- package/dist/components/popover/popover.d.ts +14 -0
- package/dist/components/popover/popover.js +48 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/progress/progress.d.ts +14 -0
- package/dist/components/progress/progress.js +41 -0
- package/dist/components/progress/progress.js.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +10 -0
- package/dist/components/radio-group/radio-group.js +33 -0
- package/dist/components/radio-group/radio-group.js.map +1 -0
- package/dist/components/section-heading/section-heading.d.ts +18 -0
- package/dist/components/section-heading/section-heading.js +57 -0
- package/dist/components/section-heading/section-heading.js.map +1 -0
- package/dist/components/select/select.d.ts +32 -0
- package/dist/components/select/select.js +100 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/separator/separator.d.ts +10 -0
- package/dist/components/separator/separator.js +37 -0
- package/dist/components/separator/separator.js.map +1 -0
- package/dist/components/sheet/sheet.d.ts +29 -0
- package/dist/components/sheet/sheet.js +130 -0
- package/dist/components/sheet/sheet.js.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +5 -0
- package/dist/components/skeleton/skeleton.js +18 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/slider/slider.d.ts +10 -0
- package/dist/components/slider/slider.js +36 -0
- package/dist/components/slider/slider.js.map +1 -0
- package/dist/components/spinner/spinner.d.ts +9 -0
- package/dist/components/spinner/spinner.js +40 -0
- package/dist/components/spinner/spinner.js.map +1 -0
- package/dist/components/spotlight/spotlight.d.ts +9 -0
- package/dist/components/spotlight/spotlight.js +32 -0
- package/dist/components/spotlight/spotlight.js.map +1 -0
- package/dist/components/starfield/starfield.d.ts +11 -0
- package/dist/components/starfield/starfield.js +76 -0
- package/dist/components/starfield/starfield.js.map +1 -0
- package/dist/components/stat/stat.d.ts +28 -0
- package/dist/components/stat/stat.js +100 -0
- package/dist/components/stat/stat.js.map +1 -0
- package/dist/components/switch/switch.d.ts +13 -0
- package/dist/components/switch/switch.js +44 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/table/table.d.ts +52 -0
- package/dist/components/table/table.js +96 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +24 -0
- package/dist/components/tabs/tabs.js +89 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/textarea/textarea.d.ts +5 -0
- package/dist/components/textarea/textarea.js +20 -0
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/theme-switcher/theme-switcher.d.ts +7 -0
- package/dist/components/theme-switcher/theme-switcher.js +57 -0
- package/dist/components/theme-switcher/theme-switcher.js.map +1 -0
- package/dist/components/toaster/toaster.d.ts +7 -0
- package/dist/components/toaster/toaster.js +43 -0
- package/dist/components/toaster/toaster.js.map +1 -0
- package/dist/components/toggle-group/toggle-group.d.ts +24 -0
- package/dist/components/toggle-group/toggle-group.js +84 -0
- package/dist/components/toggle-group/toggle-group.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +19 -0
- package/dist/components/tooltip/tooltip.js +49 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/fonts/geist-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-cyrillic-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-cyrillic-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-symbols2-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-vietnamese-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-mono.LICENSE +93 -0
- package/dist/fonts/geist-vietnamese-wght-normal.woff2 +0 -0
- package/dist/fonts/geist.LICENSE +93 -0
- package/dist/icons/create-refine-icon.d.ts +13 -0
- package/dist/icons/create-refine-icon.js +37 -0
- package/dist/icons/create-refine-icon.js.map +1 -0
- package/dist/icons/icon.d.ts +10 -0
- package/dist/icons/icon.js +13 -0
- package/dist/icons/icon.js.map +1 -0
- package/dist/icons/refine-icon-names.d.ts +1857 -0
- package/dist/icons/refine-icon-names.js +471 -0
- package/dist/icons/refine-icon-names.js.map +1 -0
- package/dist/icons/refine-icons.d.ts +1852 -0
- package/dist/icons/refine-icons.js +604 -0
- package/dist/icons/refine-icons.js.map +1 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +61 -0
- package/dist/lib/cn.d.ts +5 -0
- package/dist/lib/cn.js +49 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/use-breakpoint.d.ts +16 -0
- package/dist/lib/use-breakpoint.js +52 -0
- package/dist/lib/use-breakpoint.js.map +1 -0
- package/dist/styles.css +697 -0
- package/dist/theme/theme-provider.d.ts +31 -0
- package/dist/theme/theme-provider.js +115 -0
- package/dist/theme/theme-provider.js.map +1 -0
- package/dist/theme/theme-scope.d.ts +12 -0
- package/dist/theme/theme-scope.js +22 -0
- package/dist/theme/theme-scope.js.map +1 -0
- package/dist/theme/theme.d.ts +20 -0
- package/dist/theme/theme.js +37 -0
- package/dist/theme/theme.js.map +1 -0
- package/package.json +91 -5
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { Button } from "../button/button.js";
|
|
3
|
+
import { ChevronLeft, ChevronRight, Ellipsis } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
// src/components/pagination/pagination.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Marks up the page links as a navigation landmark.
|
|
8
|
+
*/
|
|
9
|
+
var Pagination = ({ className, ...props }) => {
|
|
10
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
11
|
+
"aria-label": "Pagination",
|
|
12
|
+
className: cn("flex w-full justify-center", className),
|
|
13
|
+
"data-slot": "pagination",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var PaginationContent = ({ className, ...props }) => {
|
|
18
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
19
|
+
className: cn("flex items-center gap-1", className),
|
|
20
|
+
"data-slot": "pagination-content",
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
var PaginationItem = (props) => {
|
|
25
|
+
return /* @__PURE__ */ jsx("li", {
|
|
26
|
+
"data-slot": "pagination-item",
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Links to one page; the active page is outlined and announced as current.
|
|
32
|
+
*/
|
|
33
|
+
var PaginationLink = ({ className, isActive = false, size = "icon", ...props }) => {
|
|
34
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
35
|
+
asChild: true,
|
|
36
|
+
className: cn("font-mono tabular-nums", className),
|
|
37
|
+
size,
|
|
38
|
+
variant: isActive ? "outline" : "ghost",
|
|
39
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
40
|
+
"aria-current": isActive ? "page" : void 0,
|
|
41
|
+
"data-active": isActive,
|
|
42
|
+
"data-slot": "pagination-link",
|
|
43
|
+
...props
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Links to the previous page.
|
|
49
|
+
*/
|
|
50
|
+
var PaginationPrevious = ({ children = "Previous", className, ...props }) => {
|
|
51
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
52
|
+
className: cn("gap-1 pl-2.5 font-sans", className),
|
|
53
|
+
size: "md",
|
|
54
|
+
...props,
|
|
55
|
+
children: [/* @__PURE__ */ jsx(ChevronLeft, {}), /* @__PURE__ */ jsx("span", {
|
|
56
|
+
className: "hidden sm:inline",
|
|
57
|
+
children
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Links to the next page.
|
|
63
|
+
*/
|
|
64
|
+
var PaginationNext = ({ children = "Next", className, ...props }) => {
|
|
65
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
66
|
+
className: cn("gap-1 pr-2.5 font-sans", className),
|
|
67
|
+
size: "md",
|
|
68
|
+
...props,
|
|
69
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
70
|
+
className: "hidden sm:inline",
|
|
71
|
+
children
|
|
72
|
+
}), /* @__PURE__ */ jsx(ChevronRight, {})]
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Stands in for the pages between the visible ones.
|
|
77
|
+
*/
|
|
78
|
+
var PaginationEllipsis = ({ className, ...props }) => {
|
|
79
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
80
|
+
className: cn("flex size-control-md items-center justify-center text-subtle", className),
|
|
81
|
+
"data-slot": "pagination-ellipsis",
|
|
82
|
+
...props,
|
|
83
|
+
children: [/* @__PURE__ */ jsx(Ellipsis, {
|
|
84
|
+
"aria-hidden": true,
|
|
85
|
+
className: "size-4",
|
|
86
|
+
role: "presentation"
|
|
87
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
88
|
+
className: "sr-only",
|
|
89
|
+
children: "More pages"
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","names":[],"sources":["../../../src/components/pagination/pagination.tsx"],"sourcesContent":["import { ChevronLeft, ChevronRight, Ellipsis } from 'lucide-react';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../lib/cn';\nimport { Button } from '../button/button';\n\n/**\n * Marks up the page links as a navigation landmark.\n */\nexport const Pagination = ({ className, ...props }: ComponentProps<'nav'>) => {\n return (\n <nav\n aria-label=\"Pagination\"\n className={cn('flex w-full justify-center', className)}\n data-slot=\"pagination\"\n {...props}\n />\n );\n};\n\nexport const PaginationContent = ({ className, ...props }: ComponentProps<'ul'>) => {\n return <ul className={cn('flex items-center gap-1', className)} data-slot=\"pagination-content\" {...props} />;\n};\n\nexport const PaginationItem = (props: ComponentProps<'li'>) => {\n return <li data-slot=\"pagination-item\" {...props} />;\n};\n\ninterface PaginationLinkProps extends ComponentProps<'a'> {\n isActive?: boolean;\n size?: 'icon' | 'md';\n}\n\n/**\n * Links to one page; the active page is outlined and announced as current.\n */\nexport const PaginationLink = ({ className, isActive = false, size = 'icon', ...props }: PaginationLinkProps) => {\n return (\n <Button\n asChild\n className={cn('font-mono tabular-nums', className)}\n size={size}\n variant={isActive ? 'outline' : 'ghost'}\n >\n <a aria-current={isActive ? 'page' : undefined} data-active={isActive} data-slot=\"pagination-link\" {...props} />\n </Button>\n );\n};\n\n/**\n * Links to the previous page.\n */\nexport const PaginationPrevious = ({ children = 'Previous', className, ...props }: ComponentProps<'a'>) => {\n return (\n <PaginationLink className={cn('gap-1 pl-2.5 font-sans', className)} size=\"md\" {...props}>\n <ChevronLeft />\n <span className=\"hidden sm:inline\">{children}</span>\n </PaginationLink>\n );\n};\n\n/**\n * Links to the next page.\n */\nexport const PaginationNext = ({ children = 'Next', className, ...props }: ComponentProps<'a'>) => {\n return (\n <PaginationLink className={cn('gap-1 pr-2.5 font-sans', className)} size=\"md\" {...props}>\n <span className=\"hidden sm:inline\">{children}</span>\n <ChevronRight />\n </PaginationLink>\n );\n};\n\n/**\n * Stands in for the pages between the visible ones.\n */\nexport const PaginationEllipsis = ({ className, ...props }: ComponentProps<'span'>) => {\n return (\n <span\n className={cn('flex size-control-md items-center justify-center text-subtle', className)}\n data-slot=\"pagination-ellipsis\"\n {...props}\n >\n <Ellipsis aria-hidden className=\"size-4\" role=\"presentation\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n );\n};\n"],"mappings":";;;;;;;;AASA,IAAa,cAAc,EAAE,WAAW,GAAG,YAAmC;CAC5E,OACE,oBAAC,OAAD;EACE,cAAW;EACX,WAAW,GAAG,8BAA8B,SAAS;EACrD,aAAU;EACV,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,qBAAqB,EAAE,WAAW,GAAG,YAAkC;CAClF,OAAO,oBAAC,MAAD;EAAI,WAAW,GAAG,2BAA2B,SAAS;EAAG,aAAU;EAAqB,GAAI;CAAQ,CAAA;AAC7G;AAEA,IAAa,kBAAkB,UAAgC;CAC7D,OAAO,oBAAC,MAAD;EAAI,aAAU;EAAkB,GAAI;CAAQ,CAAA;AACrD;;;;AAUA,IAAa,kBAAkB,EAAE,WAAW,WAAW,OAAO,OAAO,QAAQ,GAAG,YAAiC;CAC/G,OACE,oBAAC,QAAD;EACE,SAAA;EACA,WAAW,GAAG,0BAA0B,SAAS;EAC3C;EACN,SAAS,WAAW,YAAY;EAEhC,UAAA,oBAAC,KAAD;GAAG,gBAAc,WAAW,SAAS,KAAA;GAAW,eAAa;GAAU,aAAU;GAAkB,GAAI;EAAQ,CAAA;CACzG,CAAA;AAEZ;;;;AAKA,IAAa,sBAAsB,EAAE,WAAW,YAAY,WAAW,GAAG,YAAiC;CACzG,OACE,qBAAC,gBAAD;EAAgB,WAAW,GAAG,0BAA0B,SAAS;EAAG,MAAK;EAAK,GAAI;EAAlF,UAAA,CACE,oBAAC,aAAD,CAAc,CAAA,GACd,oBAAC,QAAD;GAAM,WAAU;GAAoB;EAAe,CAAA,CACrC;;AAEpB;;;;AAKA,IAAa,kBAAkB,EAAE,WAAW,QAAQ,WAAW,GAAG,YAAiC;CACjG,OACE,qBAAC,gBAAD;EAAgB,WAAW,GAAG,0BAA0B,SAAS;EAAG,MAAK;EAAK,GAAI;EAAlF,UAAA,CACE,oBAAC,QAAD;GAAM,WAAU;GAAoB;EAAe,CAAA,GACnD,oBAAC,cAAD,CAAe,CAAA,CACD;;AAEpB;;;;AAKA,IAAa,sBAAsB,EAAE,WAAW,GAAG,YAAoC;CACrF,OACE,qBAAC,QAAD;EACE,WAAW,GAAG,gEAAgE,SAAS;EACvF,aAAU;EACV,GAAI;EAHN,UAAA,CAKE,oBAAC,UAAD;GAAU,eAAA;GAAY,WAAU;GAAS,MAAK;EAAgB,CAAA,GAC9D,oBAAC,QAAD;GAAM,WAAU;GAAU,UAAA;EAAgB,CAAA,CACtC;;AAEV"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from 'radix-ui';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
export declare const FLOATING_ANIMATION_CLASS_NAME: string;
|
|
4
|
+
/**
|
|
5
|
+
* Holds the open state of a non-modal floating panel anchored to its trigger.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Popover: (props: ComponentProps<typeof PopoverPrimitive.Root>) => import("react").JSX.Element;
|
|
8
|
+
export declare const PopoverTrigger: (props: ComponentProps<typeof PopoverPrimitive.Trigger>) => import("react").JSX.Element;
|
|
9
|
+
export declare const PopoverAnchor: (props: ComponentProps<typeof PopoverPrimitive.Anchor>) => import("react").JSX.Element;
|
|
10
|
+
export declare const PopoverClose: (props: ComponentProps<typeof PopoverPrimitive.Close>) => import("react").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* Portals the floating panel next to its trigger, flipping sides when space runs out.
|
|
13
|
+
*/
|
|
14
|
+
export declare const PopoverContent: ({ align, className, sideOffset, ...props }: ComponentProps<typeof PopoverPrimitive.Content>) => import("react").JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import { Popover } from "radix-ui";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/components/popover/popover.tsx
|
|
6
|
+
var FLOATING_ANIMATION_CLASS_NAME = cn("data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", "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");
|
|
7
|
+
/**
|
|
8
|
+
* Holds the open state of a non-modal floating panel anchored to its trigger.
|
|
9
|
+
*/
|
|
10
|
+
var Popover$1 = (props) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(Popover.Root, {
|
|
12
|
+
"data-slot": "popover",
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var PopoverTrigger = (props) => {
|
|
17
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, {
|
|
18
|
+
"data-slot": "popover-trigger",
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var PopoverAnchor = (props) => {
|
|
23
|
+
return /* @__PURE__ */ jsx(Popover.Anchor, {
|
|
24
|
+
"data-slot": "popover-anchor",
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
var PopoverClose = (props) => {
|
|
29
|
+
return /* @__PURE__ */ jsx(Popover.Close, {
|
|
30
|
+
"data-slot": "popover-close",
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Portals the floating panel next to its trigger, flipping sides when space runs out.
|
|
36
|
+
*/
|
|
37
|
+
var PopoverContent = ({ align = "center", className, sideOffset = 8, ...props }) => {
|
|
38
|
+
return /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Content, {
|
|
39
|
+
align,
|
|
40
|
+
className: cn("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-card border bg-popover p-4 text-popover-foreground shadow-float outline-none", FLOATING_ANIMATION_CLASS_NAME, className),
|
|
41
|
+
"data-slot": "popover-content",
|
|
42
|
+
sideOffset,
|
|
43
|
+
...props
|
|
44
|
+
}) });
|
|
45
|
+
};
|
|
46
|
+
export { FLOATING_ANIMATION_CLASS_NAME, Popover$1 as Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.js","names":["Popover","PopoverPrimitive"],"sources":["../../../src/components/popover/popover.tsx"],"sourcesContent":["'use client';\n\nimport { Popover as PopoverPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../lib/cn';\n\nexport const FLOATING_ANIMATION_CLASS_NAME = cn(\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',\n 'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',\n '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',\n);\n\n/**\n * Holds the open state of a non-modal floating panel anchored to its trigger.\n */\nexport const Popover = (props: ComponentProps<typeof PopoverPrimitive.Root>) => {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n};\n\nexport const PopoverTrigger = (props: ComponentProps<typeof PopoverPrimitive.Trigger>) => {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n};\n\nexport const PopoverAnchor = (props: ComponentProps<typeof PopoverPrimitive.Anchor>) => {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n};\n\nexport const PopoverClose = (props: ComponentProps<typeof PopoverPrimitive.Close>) => {\n return <PopoverPrimitive.Close data-slot=\"popover-close\" {...props} />;\n};\n\n/**\n * Portals the floating panel next to its trigger, flipping sides when space runs out.\n */\nexport const PopoverContent = ({\n align = 'center',\n className,\n sideOffset = 8,\n ...props\n}: ComponentProps<typeof PopoverPrimitive.Content>) => {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align={align}\n className={cn(\n // base\n 'z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-card border bg-popover p-4 text-popover-foreground shadow-float outline-none',\n // animation\n FLOATING_ANIMATION_CLASS_NAME,\n className,\n )}\n data-slot=\"popover-content\"\n sideOffset={sideOffset}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n};\n"],"mappings":";;;;;AAOA,IAAa,gCAAgC,GAC3C,kGACA,yFACA,6JACF;;;;AAKA,IAAaA,aAAW,UAAwD;CAC9E,OAAO,oBAACC,QAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;CAAQ,CAAA;AAChE;AAEA,IAAa,kBAAkB,UAA2D;CACxF,OAAO,oBAACA,QAAiB,SAAlB;EAA0B,aAAU;EAAkB,GAAI;CAAQ,CAAA;AAC3E;AAEA,IAAa,iBAAiB,UAA0D;CACtF,OAAO,oBAACA,QAAiB,QAAlB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,IAAa,gBAAgB,UAAyD;CACpF,OAAO,oBAACA,QAAiB,OAAlB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;;;;AAKA,IAAa,kBAAkB,EAC7B,QAAQ,UACR,WACA,aAAa,GACb,GAAG,YACkD;CACrD,OACE,oBAACA,QAAiB,QAAlB,EAAA,UACE,oBAACA,QAAiB,SAAlB;EACS;EACP,WAAW,GAET,oJAEA,+BACA,SACF;EACA,aAAU;EACE;EACZ,GAAI;CACL,CAAA,EACsB,CAAA;AAE7B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { Progress as ProgressPrimitive } from 'radix-ui';
|
|
3
|
+
import type { ComponentProps } from 'react';
|
|
4
|
+
export declare const progressVariants: (props?: ({
|
|
5
|
+
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
interface ProgressProps extends Omit<ComponentProps<typeof ProgressPrimitive.Root>, 'children'>, VariantProps<typeof progressVariants> {
|
|
8
|
+
tone?: 'danger' | 'gem' | 'success' | 'warning';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Shows how far a task has come; a `null` value sweeps a short bar across the track instead of filling it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Progress: ({ className, max, size, tone, value, ...props }: ProgressProps) => import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { Progress } from "radix-ui";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
// src/components/progress/progress.tsx
|
|
6
|
+
var progressVariants = cva(["relative w-full overflow-hidden rounded-full bg-muted"], {
|
|
7
|
+
variants: { size: {
|
|
8
|
+
xs: "h-1",
|
|
9
|
+
sm: "h-1.5",
|
|
10
|
+
md: "h-2.5",
|
|
11
|
+
lg: "h-4"
|
|
12
|
+
} },
|
|
13
|
+
defaultVariants: { size: "md" }
|
|
14
|
+
});
|
|
15
|
+
var INDICATOR_CLASS_BY_TONE = {
|
|
16
|
+
danger: "bg-danger",
|
|
17
|
+
gem: "bg-gem-gradient",
|
|
18
|
+
success: "bg-success",
|
|
19
|
+
warning: "bg-warning"
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Shows how far a task has come; a `null` value sweeps a short bar across the track instead of filling it.
|
|
23
|
+
*/
|
|
24
|
+
var Progress$1 = ({ className, max = 100, size, tone = "gem", value = null, ...props }) => {
|
|
25
|
+
const isIndeterminate = value === null;
|
|
26
|
+
const percentage = isIndeterminate ? 0 : Math.min(100, Math.max(0, value / max * 100));
|
|
27
|
+
return /* @__PURE__ */ jsx(Progress.Root, {
|
|
28
|
+
className: cn(progressVariants({ size }), className),
|
|
29
|
+
"data-slot": "progress",
|
|
30
|
+
max,
|
|
31
|
+
value,
|
|
32
|
+
...props,
|
|
33
|
+
children: /* @__PURE__ */ jsx(Progress.Indicator, {
|
|
34
|
+
className: cn("h-full rounded-full transition-transform duration-500 ease-out-expo", INDICATOR_CLASS_BY_TONE[tone], { "w-full origin-left animate-indeterminate": isIndeterminate }),
|
|
35
|
+
style: isIndeterminate ? void 0 : { transform: `translateX(-${100 - percentage}%)` }
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
export { Progress$1 as Progress, progressVariants };
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","names":["Progress","ProgressPrimitive"],"sources":["../../../src/components/progress/progress.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../lib/cn';\n\nexport const progressVariants = cva(\n [\n // base\n 'relative w-full overflow-hidden rounded-full bg-muted',\n ],\n {\n variants: {\n size: {\n xs: 'h-1',\n sm: 'h-1.5',\n md: 'h-2.5',\n lg: 'h-4',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\ninterface ProgressProps\n extends Omit<ComponentProps<typeof ProgressPrimitive.Root>, 'children'>, VariantProps<typeof progressVariants> {\n tone?: 'danger' | 'gem' | 'success' | 'warning';\n}\n\nconst INDICATOR_CLASS_BY_TONE = {\n danger: 'bg-danger',\n gem: 'bg-gem-gradient',\n success: 'bg-success',\n warning: 'bg-warning',\n} satisfies Record<NonNullable<ProgressProps['tone']>, string>;\n\n/**\n * Shows how far a task has come; a `null` value sweeps a short bar across the track instead of filling it.\n */\nexport const Progress = ({ className, max = 100, size, tone = 'gem', value = null, ...props }: ProgressProps) => {\n const isIndeterminate = value === null;\n const percentage = isIndeterminate ? 0 : Math.min(100, Math.max(0, (value / max) * 100));\n\n return (\n <ProgressPrimitive.Root\n className={cn(progressVariants({ size }), className)}\n data-slot=\"progress\"\n max={max}\n value={value}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className={cn('h-full rounded-full transition-transform duration-500 ease-out-expo', INDICATOR_CLASS_BY_TONE[tone], {\n 'w-full origin-left animate-indeterminate': isIndeterminate,\n })}\n style={isIndeterminate ? undefined : { transform: `translateX(-${100 - percentage}%)` }}\n />\n </ProgressPrimitive.Root>\n );\n};\n"],"mappings":";;;;;AAMA,IAAa,mBAAmB,IAC9B,CAEE,uDACF,GACA;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;CACN,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CACF;AAOA,IAAM,0BAA0B;CAC9B,QAAQ;CACR,KAAK;CACL,SAAS;CACT,SAAS;AACX;;;;AAKA,IAAaA,cAAY,EAAE,WAAW,MAAM,KAAK,MAAM,OAAO,OAAO,QAAQ,MAAM,GAAG,YAA2B;CAC/G,MAAM,kBAAkB,UAAU;CAClC,MAAM,aAAa,kBAAkB,IAAI,KAAK,IAAI,KAAK,KAAK,IAAI,GAAI,QAAQ,MAAO,GAAG,CAAC;CAEvF,OACE,oBAACC,SAAkB,MAAnB;EACE,WAAW,GAAG,iBAAiB,EAAE,KAAK,CAAC,GAAG,SAAS;EACnD,aAAU;EACL;EACE;EACP,GAAI;EAEJ,UAAA,oBAACA,SAAkB,WAAnB;GACE,WAAW,GAAG,uEAAuE,wBAAwB,OAAO,EAClH,4CAA4C,gBAC9C,CAAC;GACD,OAAO,kBAAkB,KAAA,IAAY,EAAE,WAAW,eAAe,MAAM,WAAW,IAAI;EACvF,CAAA;CACqB,CAAA;AAE5B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Lays out a set of mutually exclusive `RadioGroupItem`s with roving arrow-key focus.
|
|
5
|
+
*/
|
|
6
|
+
export declare const RadioGroup: ({ className, ...props }: ComponentProps<typeof RadioGroupPrimitive.Root>) => import("react").JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* Renders one option of a `RadioGroup` as a ring that fills with a dot when selected.
|
|
9
|
+
*/
|
|
10
|
+
export declare const RadioGroupItem: ({ className, ...props }: ComponentProps<typeof RadioGroupPrimitive.Item>) => import("react").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import { useField, useFieldControl } from "../field/field.js";
|
|
4
|
+
import { RadioGroup } from "radix-ui";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
// src/components/radio-group/radio-group.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Lays out a set of mutually exclusive `RadioGroupItem`s with roving arrow-key focus.
|
|
9
|
+
*/
|
|
10
|
+
var RadioGroup$1 = ({ className, ...props }) => {
|
|
11
|
+
const field = useField();
|
|
12
|
+
const controlProps = useFieldControl(props);
|
|
13
|
+
return /* @__PURE__ */ jsx(RadioGroup.Root, {
|
|
14
|
+
"aria-labelledby": field?.labelId,
|
|
15
|
+
className: cn("grid gap-3", className),
|
|
16
|
+
"data-slot": "radio-group",
|
|
17
|
+
...controlProps
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Renders one option of a `RadioGroup` as a ring that fills with a dot when selected.
|
|
22
|
+
*/
|
|
23
|
+
var RadioGroupItem = ({ className, ...props }) => {
|
|
24
|
+
return /* @__PURE__ */ jsx(RadioGroup.Item, {
|
|
25
|
+
className: cn("peer inline-flex size-4.5 shrink-0 items-center justify-center rounded-full border border-input bg-background", "transition-[border-color,background-color] duration-150 ease-out-expo", "focus-ring", "hover:border-foreground/40", "data-[state=checked]:border-primary data-[state=checked]:bg-primary", "aria-invalid:border-danger", "active:scale-90", "disabled:cursor-not-allowed disabled:opacity-45", className),
|
|
26
|
+
"data-slot": "radio-group-item",
|
|
27
|
+
...props,
|
|
28
|
+
children: /* @__PURE__ */ jsx(RadioGroup.Indicator, { className: "size-2 rounded-full bg-primary-foreground animate-in zoom-in-0 duration-150" })
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export { RadioGroup$1 as RadioGroup, RadioGroupItem };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=radio-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.js","names":["RadioGroup","RadioGroupPrimitive"],"sources":["../../../src/components/radio-group/radio-group.tsx"],"sourcesContent":["'use client';\n\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../lib/cn';\nimport { useField, useFieldControl } from '../field/field';\n\n/**\n * Lays out a set of mutually exclusive `RadioGroupItem`s with roving arrow-key focus.\n */\nexport const RadioGroup = ({ className, ...props }: ComponentProps<typeof RadioGroupPrimitive.Root>) => {\n const field = useField();\n const controlProps = useFieldControl(props);\n\n return (\n <RadioGroupPrimitive.Root\n aria-labelledby={field?.labelId}\n className={cn('grid gap-3', className)}\n data-slot=\"radio-group\"\n {...controlProps}\n />\n );\n};\n\n/**\n * Renders one option of a `RadioGroup` as a ring that fills with a dot when selected.\n */\nexport const RadioGroupItem = ({ className, ...props }: ComponentProps<typeof RadioGroupPrimitive.Item>) => {\n return (\n <RadioGroupPrimitive.Item\n className={cn(\n // base\n 'peer inline-flex size-4.5 shrink-0 items-center justify-center rounded-full border border-input bg-background',\n 'transition-[border-color,background-color] duration-150 ease-out-expo',\n 'focus-ring',\n // hover\n 'hover:border-foreground/40',\n // checked\n 'data-[state=checked]:border-primary data-[state=checked]:bg-primary',\n // invalid\n 'aria-invalid:border-danger',\n // active\n 'active:scale-90',\n // disabled\n 'disabled:cursor-not-allowed disabled:opacity-45',\n className,\n )}\n data-slot=\"radio-group-item\"\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"size-2 rounded-full bg-primary-foreground animate-in zoom-in-0 duration-150\" />\n </RadioGroupPrimitive.Item>\n );\n};\n"],"mappings":";;;;;;;;;AAWA,IAAaA,gBAAc,EAAE,WAAW,GAAG,YAA6D;CACtG,MAAM,QAAQ,SAAS;CACvB,MAAM,eAAe,gBAAgB,KAAK;CAE1C,OACE,oBAACC,WAAoB,MAArB;EACE,mBAAiB,OAAO;EACxB,WAAW,GAAG,cAAc,SAAS;EACrC,aAAU;EACV,GAAI;CACL,CAAA;AAEL;;;;AAKA,IAAa,kBAAkB,EAAE,WAAW,GAAG,YAA6D;CAC1G,OACE,oBAACA,WAAoB,MAArB;EACE,WAAW,GAET,iHACA,yEACA,cAEA,8BAEA,uEAEA,8BAEA,mBAEA,mDACA,SACF;EACA,aAAU;EACV,GAAI;EAEJ,UAAA,oBAACA,WAAoB,WAArB,EAA+B,WAAU,8EAA+E,CAAA;CAChG,CAAA;AAE9B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
declare const sectionHeadingTitleVariants: (props?: ({
|
|
4
|
+
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
interface SectionHeadingProps extends Omit<ComponentProps<'div'>, 'title'>, VariantProps<typeof sectionHeadingTitleVariants> {
|
|
7
|
+
align?: 'center' | 'start';
|
|
8
|
+
as?: 'h1' | 'h2' | 'h3';
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
eyebrow?: ReactNode;
|
|
11
|
+
number?: number | string;
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Sets a black-weight display headline over a giant faded section number, the way refine.studio numbers its sections.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SectionHeading: ({ align, as: Heading, className, description, eyebrow, number, size, title, ...props }: SectionHeadingProps) => import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { Eyebrow } from "../eyebrow/eyebrow.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
// src/components/section-heading/section-heading.tsx
|
|
6
|
+
var sectionHeadingTitleVariants = cva(["relative font-display text-balance text-foreground"], {
|
|
7
|
+
variants: { size: {
|
|
8
|
+
sm: "font-black text-headline-lg",
|
|
9
|
+
md: "text-display-sm",
|
|
10
|
+
lg: "md:text-display-lg text-display-md",
|
|
11
|
+
xl: "md:text-display-xl text-display-lg"
|
|
12
|
+
} },
|
|
13
|
+
defaultVariants: { size: "lg" }
|
|
14
|
+
});
|
|
15
|
+
var sectionHeadingNumberVariants = cva(["font-black tracking-tighter pointer-events-none absolute font-display leading-none text-muted-foreground/15 tabular-nums select-none dark:text-muted-foreground/25"], {
|
|
16
|
+
variants: { size: {
|
|
17
|
+
sm: "-top-8 left-0 text-6xl",
|
|
18
|
+
md: "-top-12 left-0 text-8xl",
|
|
19
|
+
lg: "-top-16 left-0 text-9xl",
|
|
20
|
+
xl: "-top-16 left-0 text-9xl"
|
|
21
|
+
} },
|
|
22
|
+
defaultVariants: { size: "lg" }
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Sets a black-weight display headline over a giant faded section number, the way refine.studio numbers its sections.
|
|
26
|
+
*/
|
|
27
|
+
var SectionHeading = ({ align = "start", as: Heading = "h2", className, description, eyebrow, number, size, title, ...props }) => {
|
|
28
|
+
const formattedNumber = typeof number === "number" ? number.toString().padStart(2, "0") : number;
|
|
29
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
30
|
+
className: cn("gap-4 relative flex flex-col", { "items-center text-center": align === "center" }, className),
|
|
31
|
+
"data-slot": "section-heading",
|
|
32
|
+
...props,
|
|
33
|
+
children: [
|
|
34
|
+
formattedNumber !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
35
|
+
"aria-hidden": true,
|
|
36
|
+
className: cn(sectionHeadingNumberVariants({ size }), { "xl:left-1/2 left-1/2 -translate-x-1/2": align === "center" }),
|
|
37
|
+
role: "presentation",
|
|
38
|
+
children: formattedNumber
|
|
39
|
+
}),
|
|
40
|
+
eyebrow && /* @__PURE__ */ jsx(Eyebrow, {
|
|
41
|
+
number: formattedNumber,
|
|
42
|
+
children: eyebrow
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsx(Heading, {
|
|
45
|
+
className: sectionHeadingTitleVariants({ size }),
|
|
46
|
+
children: title
|
|
47
|
+
}),
|
|
48
|
+
description && /* @__PURE__ */ jsx("p", {
|
|
49
|
+
className: "relative max-w-[65ch] text-body-lg text-muted-foreground",
|
|
50
|
+
children: description
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
export { SectionHeading };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=section-heading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-heading.js","names":[],"sources":["../../../src/components/section-heading/section-heading.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../../lib/cn';\nimport { Eyebrow } from '../eyebrow/eyebrow';\n\nconst sectionHeadingTitleVariants = cva(\n [\n // base\n 'relative font-display text-balance text-foreground',\n ],\n {\n variants: {\n size: {\n sm: 'font-black text-headline-lg',\n md: 'text-display-sm',\n lg: 'md:text-display-lg text-display-md',\n xl: 'md:text-display-xl text-display-lg',\n },\n },\n defaultVariants: {\n size: 'lg',\n },\n },\n);\n\nconst sectionHeadingNumberVariants = cva(\n [\n // base\n 'font-black tracking-tighter pointer-events-none absolute font-display leading-none text-muted-foreground/15 tabular-nums select-none dark:text-muted-foreground/25',\n ],\n {\n variants: {\n size: {\n sm: '-top-8 left-0 text-6xl',\n md: '-top-12 left-0 text-8xl',\n lg: '-top-16 left-0 text-9xl',\n xl: '-top-16 left-0 text-9xl',\n },\n },\n defaultVariants: {\n size: 'lg',\n },\n },\n);\n\ninterface SectionHeadingProps\n extends Omit<ComponentProps<'div'>, 'title'>, VariantProps<typeof sectionHeadingTitleVariants> {\n align?: 'center' | 'start';\n as?: 'h1' | 'h2' | 'h3';\n description?: ReactNode;\n eyebrow?: ReactNode;\n number?: number | string;\n title: ReactNode;\n}\n\n/**\n * Sets a black-weight display headline over a giant faded section number, the way refine.studio numbers its sections.\n */\nexport const SectionHeading = ({\n align = 'start',\n as: Heading = 'h2',\n className,\n description,\n eyebrow,\n number,\n size,\n title,\n ...props\n}: SectionHeadingProps) => {\n const formattedNumber = typeof number === 'number' ? number.toString().padStart(2, '0') : number;\n\n return (\n <div\n className={cn('gap-4 relative flex flex-col', { 'items-center text-center': align === 'center' }, className)}\n data-slot=\"section-heading\"\n {...props}\n >\n {formattedNumber !== undefined && (\n <span\n aria-hidden\n className={cn(sectionHeadingNumberVariants({ size }), {\n 'xl:left-1/2 left-1/2 -translate-x-1/2': align === 'center',\n })}\n role=\"presentation\"\n >\n {formattedNumber}\n </span>\n )}\n {eyebrow && <Eyebrow number={formattedNumber}>{eyebrow}</Eyebrow>}\n <Heading className={sectionHeadingTitleVariants({ size })}>{title}</Heading>\n {description && <p className=\"relative max-w-[65ch] text-body-lg text-muted-foreground\">{description}</p>}\n </div>\n );\n};\n"],"mappings":";;;;;AAMA,IAAM,8BAA8B,IAClC,CAEE,oDACF,GACA;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;CACN,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CACF;AAEA,IAAM,+BAA+B,IACnC,CAEE,oKACF,GACA;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;CACN,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CACF;;;;AAeA,IAAa,kBAAkB,EAC7B,QAAQ,SACR,IAAI,UAAU,MACd,WACA,aACA,SACA,QACA,MACA,OACA,GAAG,YACsB;CACzB,MAAM,kBAAkB,OAAO,WAAW,WAAW,OAAO,SAAS,CAAC,CAAC,SAAS,GAAG,GAAG,IAAI;CAE1F,OACE,qBAAC,OAAD;EACE,WAAW,GAAG,gCAAgC,EAAE,4BAA4B,UAAU,SAAS,GAAG,SAAS;EAC3G,aAAU;EACV,GAAI;EAHN,UAAA;GAKG,oBAAoB,KAAA,KACnB,oBAAC,QAAD;IACE,eAAA;IACA,WAAW,GAAG,6BAA6B,EAAE,KAAK,CAAC,GAAG,EACpD,yCAAyC,UAAU,SACrD,CAAC;IACD,MAAK;IAEJ,UAAA;GACG,CAAA;GAEP,WAAW,oBAAC,SAAD;IAAS,QAAQ;IAAkB,UAAA;GAAiB,CAAA;GAChE,oBAAC,SAAD;IAAS,WAAW,4BAA4B,EAAE,KAAK,CAAC;IAAI,UAAA;GAAe,CAAA;GAC1E,eAAe,oBAAC,KAAD;IAAG,WAAU;IAA4D,UAAA;GAAe,CAAA;EACrG;;AAET"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from 'radix-ui';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
export declare const Select: import("react").FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
export declare const SelectGroup: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
/**
|
|
6
|
+
* Shows the selected option inside the trigger; Radix drops its className, so the item text styles its own row.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SelectValue: (props: ComponentProps<typeof SelectPrimitive.Value>) => import("react").JSX.Element;
|
|
9
|
+
interface SelectTriggerProps extends ComponentProps<typeof SelectPrimitive.Trigger> {
|
|
10
|
+
size?: 'lg' | 'md' | 'sm';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Renders the closed select as an input-shaped button that shows the current value and a chevron.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SelectTrigger: ({ children, className, size, ...props }: SelectTriggerProps) => import("react").JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* Floats the option list in a portal, sized to the trigger, with scroll buttons for long lists.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SelectContent: ({ children, className, position, sideOffset, ...props }: ComponentProps<typeof SelectPrimitive.Content>) => import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Titles a `SelectGroup`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const SelectLabel: ({ className, ...props }: ComponentProps<typeof SelectPrimitive.Label>) => import("react").JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* Renders one option, with a check mark when it is the selected value.
|
|
26
|
+
*/
|
|
27
|
+
export declare const SelectItem: ({ children, className, ...props }: ComponentProps<typeof SelectPrimitive.Item>) => import("react").JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* Draws a hairline between groups of options.
|
|
30
|
+
*/
|
|
31
|
+
export declare const SelectSeparator: ({ className, ...props }: ComponentProps<typeof SelectPrimitive.Separator>) => import("react").JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import { useFieldControl } from "../field/field.js";
|
|
4
|
+
import { inputShellVariants } from "../input/input.js";
|
|
5
|
+
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
|
6
|
+
import { Select } from "radix-ui";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
// src/components/select/select.tsx
|
|
9
|
+
var Select$1 = Select.Root;
|
|
10
|
+
var SelectGroup = Select.Group;
|
|
11
|
+
/**
|
|
12
|
+
* Shows the selected option inside the trigger; Radix drops its className, so the item text styles its own row.
|
|
13
|
+
*/
|
|
14
|
+
var SelectValue = (props) => {
|
|
15
|
+
return /* @__PURE__ */ jsx(Select.Value, {
|
|
16
|
+
"data-slot": "select-value",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Renders the closed select as an input-shaped button that shows the current value and a chevron.
|
|
22
|
+
*/
|
|
23
|
+
var SelectTrigger = ({ children, className, size, ...props }) => {
|
|
24
|
+
const controlProps = useFieldControl(props);
|
|
25
|
+
return /* @__PURE__ */ jsxs(Select.Trigger, {
|
|
26
|
+
className: cn(inputShellVariants({ size }), "justify-between text-left outline-none", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/20", "aria-invalid:border-danger data-placeholder:text-subtle", "disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-60", "[&_svg:not([class*='text-'])]:text-muted-foreground", className),
|
|
27
|
+
"data-slot": "select-trigger",
|
|
28
|
+
...controlProps,
|
|
29
|
+
children: [children, /* @__PURE__ */ jsx(Select.Icon, {
|
|
30
|
+
asChild: true,
|
|
31
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "text-muted-foreground transition-transform duration-200 group-data-[state=open]/input:rotate-180" })
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Floats the option list in a portal, sized to the trigger, with scroll buttons for long lists.
|
|
37
|
+
*/
|
|
38
|
+
var SelectContent = ({ children, className, position = "popper", sideOffset = 6, ...props }) => {
|
|
39
|
+
return /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsxs(Select.Content, {
|
|
40
|
+
className: cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-(--radix-select-trigger-width) overflow-hidden rounded-card border bg-popover text-popover-foreground shadow-float", "origin-(--radix-select-content-transform-origin)", "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2", className),
|
|
41
|
+
"data-slot": "select-content",
|
|
42
|
+
position,
|
|
43
|
+
sideOffset,
|
|
44
|
+
...props,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx(Select.ScrollUpButton, {
|
|
47
|
+
className: "flex h-6 items-center justify-center text-muted-foreground",
|
|
48
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { className: "size-4" })
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ jsx(Select.Viewport, {
|
|
51
|
+
className: "p-1",
|
|
52
|
+
children
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ jsx(Select.ScrollDownButton, {
|
|
55
|
+
className: "flex h-6 items-center justify-center text-muted-foreground",
|
|
56
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" })
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
}) });
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Titles a `SelectGroup`.
|
|
63
|
+
*/
|
|
64
|
+
var SelectLabel = ({ className, ...props }) => {
|
|
65
|
+
return /* @__PURE__ */ jsx(Select.Label, {
|
|
66
|
+
className: cn("eyebrow px-2.5 pt-2.5 pb-1.5 text-muted-foreground", className),
|
|
67
|
+
"data-slot": "select-label",
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Renders one option, with a check mark when it is the selected value.
|
|
73
|
+
*/
|
|
74
|
+
var SelectItem = ({ children, className, ...props }) => {
|
|
75
|
+
return /* @__PURE__ */ jsxs(Select.Item, {
|
|
76
|
+
className: cn("relative flex min-h-control-sm w-full cursor-default items-center gap-2 rounded-inner py-1.5 pr-8 pl-2.5 text-body-sm outline-none select-none", "[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", "data-highlighted:bg-hover", "data-[state=checked]:font-medium", "data-disabled:pointer-events-none data-disabled:opacity-45", className),
|
|
77
|
+
"data-slot": "select-item",
|
|
78
|
+
...props,
|
|
79
|
+
children: [/* @__PURE__ */ jsx(Select.ItemText, { children: /* @__PURE__ */ jsx("span", {
|
|
80
|
+
className: "flex min-w-0 items-center gap-2 truncate",
|
|
81
|
+
children
|
|
82
|
+
}) }), /* @__PURE__ */ jsx("span", {
|
|
83
|
+
className: "absolute right-2.5 flex items-center",
|
|
84
|
+
children: /* @__PURE__ */ jsx(Select.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "text-gem-ink" }) })
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Draws a hairline between groups of options.
|
|
90
|
+
*/
|
|
91
|
+
var SelectSeparator = ({ className, ...props }) => {
|
|
92
|
+
return /* @__PURE__ */ jsx(Select.Separator, {
|
|
93
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
94
|
+
"data-slot": "select-separator",
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
export { Select$1 as Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue };
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","names":["Select","SelectPrimitive"],"sources":["../../../src/components/select/select.tsx"],"sourcesContent":["'use client';\n\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\nimport { Select as SelectPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../lib/cn';\nimport { useFieldControl } from '../field/field';\nimport { inputShellVariants } from '../input/input';\n\nexport const Select = SelectPrimitive.Root;\n\nexport const SelectGroup = SelectPrimitive.Group;\n\n/**\n * Shows the selected option inside the trigger; Radix drops its className, so the item text styles its own row.\n */\nexport const SelectValue = (props: ComponentProps<typeof SelectPrimitive.Value>) => {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n};\n\ninterface SelectTriggerProps extends ComponentProps<typeof SelectPrimitive.Trigger> {\n size?: 'lg' | 'md' | 'sm';\n}\n\n/**\n * Renders the closed select as an input-shaped button that shows the current value and a chevron.\n */\nexport const SelectTrigger = ({ children, className, size, ...props }: SelectTriggerProps) => {\n const controlProps = useFieldControl(props);\n\n return (\n <SelectPrimitive.Trigger\n className={cn(\n inputShellVariants({ size }),\n 'justify-between text-left outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/20',\n 'aria-invalid:border-danger data-placeholder:text-subtle',\n 'disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-60',\n \"[&_svg:not([class*='text-'])]:text-muted-foreground\",\n className,\n )}\n data-slot=\"select-trigger\"\n {...controlProps}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"text-muted-foreground transition-transform duration-200 group-data-[state=open]/input:rotate-180\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n};\n\n/**\n * Floats the option list in a portal, sized to the trigger, with scroll buttons for long lists.\n */\nexport const SelectContent = ({\n children,\n className,\n position = 'popper',\n sideOffset = 6,\n ...props\n}: ComponentProps<typeof SelectPrimitive.Content>) => {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n className={cn(\n // base\n 'relative z-50 max-h-(--radix-select-content-available-height) min-w-(--radix-select-trigger-width) overflow-hidden rounded-card border bg-popover text-popover-foreground shadow-float',\n 'origin-(--radix-select-content-transform-origin)',\n // animation\n 'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n data-slot=\"select-content\"\n position={position}\n sideOffset={sideOffset}\n {...props}\n >\n <SelectPrimitive.ScrollUpButton className=\"flex h-6 items-center justify-center text-muted-foreground\">\n <ChevronUp className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n <SelectPrimitive.Viewport className=\"p-1\">{children}</SelectPrimitive.Viewport>\n <SelectPrimitive.ScrollDownButton className=\"flex h-6 items-center justify-center text-muted-foreground\">\n <ChevronDown className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n};\n\n/**\n * Titles a `SelectGroup`.\n */\nexport const SelectLabel = ({ className, ...props }: ComponentProps<typeof SelectPrimitive.Label>) => {\n return (\n <SelectPrimitive.Label\n className={cn('eyebrow px-2.5 pt-2.5 pb-1.5 text-muted-foreground', className)}\n data-slot=\"select-label\"\n {...props}\n />\n );\n};\n\n/**\n * Renders one option, with a check mark when it is the selected value.\n */\nexport const SelectItem = ({ children, className, ...props }: ComponentProps<typeof SelectPrimitive.Item>) => {\n return (\n <SelectPrimitive.Item\n className={cn(\n // base\n 'relative flex min-h-control-sm w-full cursor-default items-center gap-2 rounded-inner py-1.5 pr-8 pl-2.5 text-body-sm outline-none select-none',\n \"[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n // hover\n 'data-highlighted:bg-hover',\n // selected\n 'data-[state=checked]:font-medium',\n // disabled\n 'data-disabled:pointer-events-none data-disabled:opacity-45',\n className,\n )}\n data-slot=\"select-item\"\n {...props}\n >\n <SelectPrimitive.ItemText>\n {/* Radix strips className from ItemText and portals this span into the trigger, keeping icon and text inline in both. */}\n <span className=\"flex min-w-0 items-center gap-2 truncate\">{children}</span>\n </SelectPrimitive.ItemText>\n <span className=\"absolute right-2.5 flex items-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"text-gem-ink\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n};\n\n/**\n * Draws a hairline between groups of options.\n */\nexport const SelectSeparator = ({ className, ...props }: ComponentProps<typeof SelectPrimitive.Separator>) => {\n return (\n <SelectPrimitive.Separator className={cn('-mx-1 my-1 h-px bg-border', className)} data-slot=\"select-separator\" {...props} />\n );\n};\n"],"mappings":";;;;;;;;AAUA,IAAaA,WAASC,OAAgB;AAEtC,IAAa,cAAcA,OAAgB;;;;AAK3C,IAAa,eAAe,UAAwD;CAClF,OAAO,oBAACA,OAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;;;;AASA,IAAa,iBAAiB,EAAE,UAAU,WAAW,MAAM,GAAG,YAAgC;CAC5F,MAAM,eAAe,gBAAgB,KAAK;CAE1C,OACE,qBAACA,OAAgB,SAAjB;EACE,WAAW,GACT,mBAAmB,EAAE,KAAK,CAAC,GAC3B,0CACA,6EACA,2DACA,qEACA,uDACA,SACF;EACA,aAAU;EACV,GAAI;EAXN,UAAA,CAaG,UACD,oBAACA,OAAgB,MAAjB;GAAsB,SAAA;GACpB,UAAA,oBAAC,aAAD,EAAa,WAAU,mGAAoG,CAAA;EACvG,CAAA,CACC;;AAE7B;;;;AAKA,IAAa,iBAAiB,EAC5B,UACA,WACA,WAAW,UACX,aAAa,GACb,GAAG,YACiD;CACpD,OACE,oBAACA,OAAgB,QAAjB,EAAA,UACE,qBAACA,OAAgB,SAAjB;EACE,WAAW,GAET,0LACA,oDAEA,yFACA,kGACA,iFACA,SACF;EACA,aAAU;EACA;EACE;EACZ,GAAI;EAdN,UAAA;GAgBE,oBAACA,OAAgB,gBAAjB;IAAgC,WAAU;IACxC,UAAA,oBAAC,WAAD,EAAW,WAAU,SAAU,CAAA;GACD,CAAA;GAChC,oBAACA,OAAgB,UAAjB;IAA0B,WAAU;IAAO;GAAmC,CAAA;GAC9E,oBAACA,OAAgB,kBAAjB;IAAkC,WAAU;IAC1C,UAAA,oBAAC,aAAD,EAAa,WAAU,SAAU,CAAA;GACD,CAAA;EACX;CACH,CAAA,EAAA,CAAA;AAE5B;;;;AAKA,IAAa,eAAe,EAAE,WAAW,GAAG,YAA0D;CACpG,OACE,oBAACA,OAAgB,OAAjB;EACE,WAAW,GAAG,sDAAsD,SAAS;EAC7E,aAAU;EACV,GAAI;CACL,CAAA;AAEL;;;;AAKA,IAAa,cAAc,EAAE,UAAU,WAAW,GAAG,YAAyD;CAC5G,OACE,qBAACA,OAAgB,MAAjB;EACE,WAAW,GAET,kJACA,6GAEA,6BAEA,oCAEA,8DACA,SACF;EACA,aAAU;EACV,GAAI;EAdN,UAAA,CAgBE,oBAACA,OAAgB,UAAjB,EAAA,UAEE,oBAAC,QAAD;GAAM,WAAU;GAA4C;EAAe,CAAA,EACnD,CAAA,GAC1B,oBAAC,QAAD;GAAM,WAAU;GACd,UAAA,oBAACA,OAAgB,eAAjB,EAAA,UACE,oBAAC,OAAD,EAAO,WAAU,eAAgB,CAAA,EACJ,CAAA;EAC3B,CAAA,CACc;;AAE1B;;;;AAKA,IAAa,mBAAmB,EAAE,WAAW,GAAG,YAA8D;CAC5G,OACE,oBAACA,OAAgB,WAAjB;EAA2B,WAAW,GAAG,6BAA6B,SAAS;EAAG,aAAU;EAAmB,GAAI;CAAQ,CAAA;AAE/H"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Separator as SeparatorPrimitive } from 'radix-ui';
|
|
2
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
interface SeparatorProps extends Omit<ComponentProps<typeof SeparatorPrimitive.Root>, 'children'> {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A hairline divider; a horizontal one can carry a centred mono `label` such as "or" or a date.
|
|
8
|
+
*/
|
|
9
|
+
export declare const Separator: ({ className, decorative, label, orientation, ...props }: SeparatorProps) => import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { Separator } from "radix-ui";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/components/separator/separator.tsx
|
|
5
|
+
/**
|
|
6
|
+
* A hairline divider; a horizontal one can carry a centred mono `label` such as "or" or a date.
|
|
7
|
+
*/
|
|
8
|
+
var Separator$1 = ({ className, decorative = true, label, orientation = "horizontal", ...props }) => {
|
|
9
|
+
if (label && orientation === "horizontal") return /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: cn("flex items-center gap-3", className),
|
|
11
|
+
"data-slot": "separator",
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ jsx(Separator.Root, {
|
|
14
|
+
className: "h-px flex-1 bg-border",
|
|
15
|
+
decorative: true
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ jsx("span", {
|
|
18
|
+
className: "eyebrow text-muted-foreground",
|
|
19
|
+
children: label
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ jsx(Separator.Root, {
|
|
22
|
+
className: "h-px flex-1 bg-border",
|
|
23
|
+
decorative: true
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ jsx(Separator.Root, {
|
|
28
|
+
className: cn("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className),
|
|
29
|
+
"data-slot": "separator",
|
|
30
|
+
decorative,
|
|
31
|
+
orientation,
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
export { Separator$1 as Separator };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.js","names":["Separator","SeparatorPrimitive"],"sources":["../../../src/components/separator/separator.tsx"],"sourcesContent":["import { Separator as SeparatorPrimitive } from 'radix-ui';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../../lib/cn';\n\ninterface SeparatorProps extends Omit<ComponentProps<typeof SeparatorPrimitive.Root>, 'children'> {\n label?: ReactNode;\n}\n\n/**\n * A hairline divider; a horizontal one can carry a centred mono `label` such as \"or\" or a date.\n */\nexport const Separator = ({\n className,\n decorative = true,\n label,\n orientation = 'horizontal',\n ...props\n}: SeparatorProps) => {\n if (label && orientation === 'horizontal') {\n return (\n <div className={cn('flex items-center gap-3', className)} data-slot=\"separator\">\n <SeparatorPrimitive.Root className=\"h-px flex-1 bg-border\" decorative />\n <span className=\"eyebrow text-muted-foreground\">{label}</span>\n <SeparatorPrimitive.Root className=\"h-px flex-1 bg-border\" decorative />\n </div>\n );\n }\n\n return (\n <SeparatorPrimitive.Root\n className={cn(\n 'shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',\n className,\n )}\n data-slot=\"separator\"\n decorative={decorative}\n orientation={orientation}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;AAYA,IAAaA,eAAa,EACxB,WACA,aAAa,MACb,OACA,cAAc,cACd,GAAG,YACiB;CACpB,IAAI,SAAS,gBAAgB,cAC3B,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,2BAA2B,SAAS;EAAG,aAAU;EAApE,UAAA;GACE,oBAACC,UAAmB,MAApB;IAAyB,WAAU;IAAwB,YAAA;GAAY,CAAA;GACvE,oBAAC,QAAD;IAAM,WAAU;IAAiC,UAAA;GAAY,CAAA;GAC7D,oBAACA,UAAmB,MAApB;IAAyB,WAAU;IAAwB,YAAA;GAAY,CAAA;EACpE;;CAIT,OACE,oBAACA,UAAmB,MAApB;EACE,WAAW,GACT,kKACA,SACF;EACA,aAAU;EACE;EACC;EACb,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { Dialog as SheetPrimitive } from 'radix-ui';
|
|
3
|
+
import type { ComponentProps } from 'react';
|
|
4
|
+
declare const sheetContentVariants: (props?: ({
|
|
5
|
+
side?: "bottom" | "left" | "right" | "top" | null | undefined;
|
|
6
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Holds the open state of a panel that slides in from an edge of the screen.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Sheet: (props: ComponentProps<typeof SheetPrimitive.Root>) => import("react").JSX.Element;
|
|
12
|
+
export declare const SheetTrigger: (props: ComponentProps<typeof SheetPrimitive.Trigger>) => import("react").JSX.Element;
|
|
13
|
+
export declare const SheetClose: (props: ComponentProps<typeof SheetPrimitive.Close>) => import("react").JSX.Element;
|
|
14
|
+
interface SheetContentProps extends ComponentProps<typeof SheetPrimitive.Content>, VariantProps<typeof sheetContentVariants> {
|
|
15
|
+
showClose?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Portals the sliding panel above a blurred scrim, from the given `side`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SheetContent: ({ children, className, showClose, side, size, ...props }: SheetContentProps) => import("react").JSX.Element;
|
|
21
|
+
export declare const SheetHeader: ({ className, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* Scrolls the sheet's main content between its header and footer.
|
|
24
|
+
*/
|
|
25
|
+
export declare const SheetBody: ({ className, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
26
|
+
export declare const SheetFooter: ({ className, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
27
|
+
export declare const SheetTitle: ({ className, ...props }: ComponentProps<typeof SheetPrimitive.Title>) => import("react").JSX.Element;
|
|
28
|
+
export declare const SheetDescription: ({ className, ...props }: ComponentProps<typeof SheetPrimitive.Description>) => import("react").JSX.Element;
|
|
29
|
+
export {};
|