@vamos-ui/react 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/blocks/block-heading.js +1 -1
- package/dist/blocks/block-link.js +1 -1
- package/dist/blocks/index.d.ts +3 -3
- package/dist/blocks/index.js +3 -3
- package/dist/blocks/labels.d.ts +8 -0
- package/dist/blocks/labels.js +60 -0
- package/dist/blocks/section-header.js +1 -1
- package/dist/blocks/section.js +2 -2
- package/dist/blocks/site/feature-tabs.js +1 -1
- package/dist/blocks/site/footer.d.ts +10 -1
- package/dist/blocks/site/footer.js +28 -4
- package/dist/blocks/site/registry-2.js +3 -1
- package/dist/blocks/site/shared/labels-2.d.ts +8 -0
- package/dist/blocks/site/shared/labels-2.js +808 -0
- package/dist/blocks/site/site-shell.js +3 -3
- package/dist/business/approval-flow.js +2 -2
- package/dist/business/import-wizard.js +1 -1
- package/dist/business/line-items.js +1 -1
- package/dist/business/multi-step-form.js +2 -2
- package/dist/business/permission-matrix.js +1 -1
- package/dist/business/setup-checklist.js +2 -2
- package/dist/business/signer-status.js +1 -1
- package/dist/charts/bar-list.js +1 -1
- package/dist/charts/chart-shell.js +1 -1
- package/dist/charts/donut-chart.js +1 -1
- package/dist/charts/funnel.js +1 -1
- package/dist/charts/gauge.js +2 -2
- package/dist/components/accordion.d.ts +1 -1
- package/dist/components/accordion.js +8 -8
- package/dist/components/activity-timeline.js +6 -6
- package/dist/components/address-field.js +3 -3
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog.js +8 -8
- package/dist/components/alert.js +2 -2
- package/dist/components/app-shell.js +3 -3
- package/dist/components/aspect-ratio.js +2 -2
- package/dist/components/attachment-list.js +2 -2
- package/dist/components/audit-log.js +1 -1
- package/dist/components/avatar.d.ts +1 -1
- package/dist/components/avatar.js +8 -8
- package/dist/components/backup-codes.js +1 -1
- package/dist/components/badge.js +3 -3
- package/dist/components/breadcrumb.js +10 -9
- package/dist/components/button-group.js +4 -4
- package/dist/components/button.js +4 -4
- package/dist/components/calendar.js +5 -5
- package/dist/components/card.js +8 -8
- package/dist/components/carousel.js +9 -9
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +6 -6
- package/dist/components/collapsible.d.ts +1 -1
- package/dist/components/collapsible.js +4 -4
- package/dist/components/color-picker.js +3 -3
- package/dist/components/combobox.js +1 -1
- package/dist/components/command.js +9 -9
- package/dist/components/comment-thread.js +3 -3
- package/dist/components/context-menu.d.ts +1 -1
- package/dist/components/context-menu.js +9 -9
- package/dist/components/currency-input.js +1 -1
- package/dist/components/date-picker.js +2 -2
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/description-list.js +2 -2
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/dialog.js +9 -9
- package/dist/components/dropdown-menu.d.ts +1 -1
- package/dist/components/dropdown-menu.js +9 -9
- package/dist/components/editor-layout.js +9 -9
- package/dist/components/empty-state.js +2 -2
- package/dist/components/entity-card.js +1 -1
- package/dist/components/file-upload.js +5 -5
- package/dist/components/formatted-input.js +3 -3
- package/dist/components/hierarchy-chart.js +1 -1
- package/dist/components/hover-card.d.ts +1 -1
- package/dist/components/hover-card.js +3 -3
- package/dist/components/iban-input.js +1 -1
- package/dist/components/id-input.js +3 -3
- package/dist/components/image.js +5 -5
- package/dist/components/input-otp.js +6 -6
- package/dist/components/input.d.ts +1 -1
- package/dist/components/input.js +6 -6
- package/dist/components/item.js +4 -4
- package/dist/components/kbd.js +3 -3
- package/dist/components/list-layout.js +9 -9
- package/dist/components/menubar.d.ts +1 -1
- package/dist/components/menubar.js +12 -12
- package/dist/components/native-select.js +1 -1
- package/dist/components/navigation-menu.d.ts +1 -1
- package/dist/components/navigation-menu.js +12 -11
- package/dist/components/notification-center.js +4 -4
- package/dist/components/page-header.js +3 -3
- package/dist/components/pagination.js +9 -9
- package/dist/components/phone-input.js +1 -1
- package/dist/components/pin-map.js +1 -1
- package/dist/components/placeholder-art.js +1 -1
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +7 -7
- package/dist/components/progress.js +3 -3
- package/dist/components/qr-code.js +1 -1
- package/dist/components/radio-group.d.ts +1 -1
- package/dist/components/radio-group.js +4 -4
- package/dist/components/record-detail-layout.js +10 -10
- package/dist/components/record-picker.js +2 -2
- package/dist/components/resizable.js +2 -2
- package/dist/components/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area.js +4 -4
- package/dist/components/select.d.ts +1 -1
- package/dist/components/select.js +10 -10
- package/dist/components/separator.d.ts +1 -1
- package/dist/components/separator.js +3 -3
- package/dist/components/settings-layout.js +6 -6
- package/dist/components/sheet.js +3 -3
- package/dist/components/sidebar.js +12 -11
- package/dist/components/signature-pad.js +1 -1
- package/dist/components/skeleton.js +5 -5
- package/dist/components/sla-timer.js +2 -2
- package/dist/components/slider.d.ts +1 -1
- package/dist/components/slider.js +2 -2
- package/dist/components/slug-input.js +1 -1
- package/dist/components/sparkline.js +1 -1
- package/dist/components/spinner.js +2 -2
- package/dist/components/stat.js +5 -5
- package/dist/components/status-picker.js +2 -2
- package/dist/components/stepper.js +1 -1
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/switch.js +3 -3
- package/dist/components/table.js +10 -10
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/tabs.js +11 -11
- package/dist/components/tag-input.js +1 -1
- package/dist/components/task-list.js +1 -1
- package/dist/components/time-picker.js +3 -3
- package/dist/components/toggle.d.ts +2 -1
- package/dist/components/toggle.js +7 -6
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +5 -4
- package/dist/components/top-bar.js +4 -4
- package/dist/components/tour.js +1 -1
- package/dist/components/tree-select.js +2 -2
- package/dist/components/tree-view.js +3 -3
- package/dist/components/typography.js +11 -11
- package/dist/components/user-picker.js +2 -2
- package/dist/components/version-history.js +3 -3
- package/dist/data-table/data-table.js +1 -1
- package/dist/data-table/filter-bar.js +2 -2
- package/dist/data-table/index.d.ts +15 -8
- package/dist/data-table/index.js +9 -8
- package/dist/data-table/saved-views.js +1 -1
- package/dist/editor/block-editor.js +1 -1
- package/dist/editor/context.js +1 -1
- package/dist/editor/menus.js +1 -1
- package/dist/fonts/font-picker.js +3 -3
- package/dist/fonts/pairing-picker.js +1 -1
- package/dist/fonts/provider.js +1 -1
- package/dist/index.d.ts +188 -94
- package/dist/index.js +94 -94
- package/dist/lib/data-islands.js +1 -1
- package/dist/lib/field-context.js +1 -1
- package/dist/lib/floating-arrow.js +1 -1
- package/dist/lib/islands.js +1 -1
- package/dist/lib/layer.js +3 -3
- package/dist/lib/locale.js +2 -2
- package/dist/lib/menu.js +2 -2
- package/dist/lib/provider.js +4 -4
- package/dist/lib/theme-scope.js +4 -3
- package/dist/lib/variants.js +2 -2
- package/dist/media/focal-point.js +1 -1
- package/dist/media/gallery.js +1 -1
- package/dist/media/image-cropper.js +1 -1
- package/dist/media/image-field.js +2 -2
- package/dist/media/lightbox.js +4 -3
- package/dist/media/link-preview.js +3 -3
- package/dist/media/media-library.js +3 -3
- package/dist/media/media-picker.js +1 -1
- package/dist/media/media-provider.js +1 -1
- package/dist/media/video-player.js +4 -4
- package/dist/motion/count-up.js +1 -1
- package/dist/motion/motion-scope.js +2 -2
- package/dist/motion/page-transition.js +1 -1
- package/dist/motion/parallax.js +2 -2
- package/dist/motion/pointer.js +3 -3
- package/dist/motion/reveal.js +3 -3
- package/dist/motion/skeleton-swap.js +1 -1
- package/dist/motion/text-reveal.js +1 -1
- package/dist/motion/ticker.js +1 -1
- package/dist/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/dist/scheduler/gantt.js +2 -2
- package/dist/scheduler/resource-calendar.js +2 -2
- package/dist/scheduler/scheduler.js +3 -3
- package/dist/scheduler/time-tracker.js +4 -4
- package/dist/sortable/kanban.js +2 -2
- package/dist/sortable/sortable-list.js +2 -2
- package/dist/sortable/sortable.js +4 -4
- package/package.json +1 -1
|
@@ -69,7 +69,7 @@ function niceStep(span, target) {
|
|
|
69
69
|
* selectedId={selected} onSelectedIdChange={setSelected} />
|
|
70
70
|
* ```
|
|
71
71
|
*/
|
|
72
|
-
export const PinMap = React.forwardRef(function PinMap({ pins, bounds, aspectRatio = 16 / 10, variant = "pin", selectedId: selectedProp, defaultSelectedId = null, onSelectedIdChange, callout, showLabels, backdrop, bare, className, style, children, ...props }, ref) {
|
|
72
|
+
export const PinMap = /*#__PURE__*/ React.forwardRef(function PinMap({ pins, bounds, aspectRatio = 16 / 10, variant = "pin", selectedId: selectedProp, defaultSelectedId = null, onSelectedIdChange, callout, showLabels, backdrop, bare, className, style, children, ...props }, ref) {
|
|
73
73
|
const f = useFormat();
|
|
74
74
|
const [selectedId, setSelectedId] = useControllableState({ value: selectedProp, defaultValue: defaultSelectedId, onChange: onSelectedIdChange, name: "PinMap" });
|
|
75
75
|
const [focusId, setFocusId] = React.useState(null);
|
|
@@ -74,7 +74,7 @@ export function placeholderArtStyle(recipe, strength = "subtle") {
|
|
|
74
74
|
* <AspectRatio ratio="4/3"><PlaceholderArt seed="harbour-terrace" label="Harbour terrace at dusk" /></AspectRatio>
|
|
75
75
|
* ```
|
|
76
76
|
*/
|
|
77
|
-
export const PlaceholderArt = React.forwardRef(function PlaceholderArt({ seed, pattern = "auto", icon, label, caption, strength = "subtle", className, style, ...props }, ref) {
|
|
77
|
+
export const PlaceholderArt = /*#__PURE__*/ React.forwardRef(function PlaceholderArt({ seed, pattern = "auto", icon, label, caption, strength = "subtle", className, style, ...props }, ref) {
|
|
78
78
|
const recipe = placeholderArtRecipe(seed ?? label ?? "", pattern);
|
|
79
79
|
const a11y = label ? { role: "img", "aria-label": label } : { "aria-hidden": true };
|
|
80
80
|
const captionNode = caption === true ? label : caption || null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import * as PopoverPrimitive from "radix-ui/popover";
|
|
3
3
|
import { type VariantProps } from "class-variance-authority";
|
|
4
4
|
/** Root. Controlled (`open` / `onOpenChange`) or uncontrolled (`defaultOpen`). */
|
|
5
5
|
export declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import
|
|
4
|
+
import * as PopoverPrimitive from "radix-ui/popover";
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
6
|
import { cn } from "../lib/cn.js";
|
|
7
7
|
import { usePortalContainer } from "../lib/theme-scope.js";
|
|
@@ -14,7 +14,7 @@ export const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
|
14
14
|
export const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
15
15
|
/** Closes the popover; use `asChild` with a Button. */
|
|
16
16
|
export const PopoverClose = PopoverPrimitive.Close;
|
|
17
|
-
export const popoverContentVariants = cva(["surface-popover ui-pop z-(--z-popover) rounded-ui-lg outline-none", "max-h-(--radix-popover-content-available-height) overflow-y-auto overscroll-contain"], {
|
|
17
|
+
export const popoverContentVariants = /*#__PURE__*/ cva(["surface-popover ui-pop z-(--z-popover) rounded-ui-lg outline-none", "max-h-(--radix-popover-content-available-height) overflow-y-auto overscroll-contain"], {
|
|
18
18
|
variants: {
|
|
19
19
|
size: {
|
|
20
20
|
auto: "w-auto max-w-[calc(100vw-1.5rem)]",
|
|
@@ -31,13 +31,13 @@ export const popoverContentVariants = cva(["surface-popover ui-pop z-(--z-popove
|
|
|
31
31
|
},
|
|
32
32
|
defaultVariants: { size: "md", padded: true },
|
|
33
33
|
});
|
|
34
|
-
const PopoverTitleContext = React.createContext(null);
|
|
34
|
+
const PopoverTitleContext = /*#__PURE__*/ React.createContext(null);
|
|
35
35
|
/**
|
|
36
36
|
* The floating panel. Portals into the nearest `ThemeScope`, sets the layer depth
|
|
37
37
|
* (only the first layer blurs in glass mode; a popover inside a dialog turns opaque),
|
|
38
38
|
* and is labelled by its `PopoverTitle` when one is rendered.
|
|
39
39
|
*/
|
|
40
|
-
export const PopoverContent = React.forwardRef(function PopoverContent({ className, size, padded, arrow = false, sideOffset = 6, collisionPadding = 12, align = "center", children, ...props }, ref) {
|
|
40
|
+
export const PopoverContent = /*#__PURE__*/ React.forwardRef(function PopoverContent({ className, size, padded, arrow = false, sideOffset = 6, collisionPadding = 12, align = "center", children, ...props }, ref) {
|
|
41
41
|
const container = usePortalContainer();
|
|
42
42
|
const titleId = React.useId();
|
|
43
43
|
const [hasTitle, setHasTitle] = React.useState(false);
|
|
@@ -45,11 +45,11 @@ export const PopoverContent = React.forwardRef(function PopoverContent({ classNa
|
|
|
45
45
|
return (_jsx(PopoverPrimitive.Portal, { container: container, children: _jsx(Layer, { asChild: true, children: _jsxs(PopoverPrimitive.Content, { ref: ref, "data-slot": "popover-content", sideOffset: sideOffset, collisionPadding: collisionPadding, align: align, "aria-labelledby": hasTitle ? titleId : undefined, className: cn(popoverContentVariants({ size, padded }), className), ...props, children: [_jsx(PopoverTitleContext.Provider, { value: titleCtx, children: children }), arrow ? (_jsx(PopoverPrimitive.Arrow, { asChild: true, width: 14, height: 7, children: _jsx(FloatingArrow, {}) })) : null] }) }) }));
|
|
46
46
|
});
|
|
47
47
|
/** Title + optional description at the top of the content. */
|
|
48
|
-
export const PopoverHeader = React.forwardRef(function PopoverHeader({ title, description, action, className, children, ...props }, ref) {
|
|
48
|
+
export const PopoverHeader = /*#__PURE__*/ React.forwardRef(function PopoverHeader({ title, description, action, className, children, ...props }, ref) {
|
|
49
49
|
return (_jsxs("div", { ref: ref, "data-slot": "popover-header", className: cn("mb-3 flex items-start gap-3", className), ...props, children: [_jsxs("div", { className: "grid min-w-0 flex-1 gap-0.5", children: [title != null ? _jsx(PopoverTitle, { children: title }) : null, description != null ? _jsx(PopoverDescription, { children: description }) : null, children] }), action ? _jsx("div", { className: "-me-1 -mt-1 shrink-0", children: action }) : null] }));
|
|
50
50
|
});
|
|
51
51
|
/** Heading inside the content; wired to `aria-labelledby`. */
|
|
52
|
-
export const PopoverTitle = React.forwardRef(function PopoverTitle({ className, id, ...props }, ref) {
|
|
52
|
+
export const PopoverTitle = /*#__PURE__*/ React.forwardRef(function PopoverTitle({ className, id, ...props }, ref) {
|
|
53
53
|
const ctx = React.useContext(PopoverTitleContext);
|
|
54
54
|
const register = ctx?.register;
|
|
55
55
|
React.useEffect(() => {
|
|
@@ -64,6 +64,6 @@ export function PopoverDescription({ className, ...props }) {
|
|
|
64
64
|
return _jsx("p", { "data-slot": "popover-description", className: cn("text-[13px] leading-snug text-fg-muted", className), ...props });
|
|
65
65
|
}
|
|
66
66
|
/** Bottom row for actions. Bleeds to the panel edge with a hairline on top. */
|
|
67
|
-
export const PopoverFooter = React.forwardRef(function PopoverFooter({ className, ...props }, ref) {
|
|
67
|
+
export const PopoverFooter = /*#__PURE__*/ React.forwardRef(function PopoverFooter({ className, ...props }, ref) {
|
|
68
68
|
return (_jsx("div", { ref: ref, "data-slot": "popover-footer", className: cn("-mx-(--popover-p) -mb-(--popover-p) mt-4 flex items-center justify-end gap-2 border-t border-line px-(--popover-p) py-[calc(var(--popover-p)*0.7)]", className), ...props }));
|
|
69
69
|
});
|
|
@@ -46,7 +46,7 @@ const valueColor = {
|
|
|
46
46
|
/* ------------------------------------------------------------------ */
|
|
47
47
|
/* Linear */
|
|
48
48
|
/* ------------------------------------------------------------------ */
|
|
49
|
-
export const progressTrackVariants = cva("relative w-full overflow-hidden rounded-full bg-track", {
|
|
49
|
+
export const progressTrackVariants = /*#__PURE__*/ cva("relative w-full overflow-hidden rounded-full bg-track", {
|
|
50
50
|
variants: {
|
|
51
51
|
size: { xs: "h-0.5", sm: "h-1", md: "h-2" },
|
|
52
52
|
},
|
|
@@ -63,7 +63,7 @@ export const progressTrackVariants = cva("relative w-full overflow-hidden rounde
|
|
|
63
63
|
* <Progress aria-label="Loading" value={null} />
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
export const Progress = React.forwardRef(function Progress({ value, max, tone, display, valueText, labels, size, label, showValue, hint, className, id, ...props }, ref) {
|
|
66
|
+
export const Progress = /*#__PURE__*/ React.forwardRef(function Progress({ value, max, tone, display, valueText, labels, size, label, showValue, hint, className, id, ...props }, ref) {
|
|
67
67
|
const m = useProgressModel({ value, max, tone, display, valueText, labels });
|
|
68
68
|
const autoId = React.useId();
|
|
69
69
|
const baseId = id ?? `progress${autoId.replace(/:/g, "")}`;
|
|
@@ -87,7 +87,7 @@ const CIRCLE = { sm: { px: 18, stroke: 2.5 }, md: { px: 40, stroke: 3.5 }, lg: {
|
|
|
87
87
|
* <ProgressCircle aria-label="Profile complete" value={72} size="lg" />
|
|
88
88
|
* ```
|
|
89
89
|
*/
|
|
90
|
-
export const ProgressCircle = React.forwardRef(function ProgressCircle({ value, max, tone, display, valueText, labels, size = "md", showValue, children, className, ...props }, ref) {
|
|
90
|
+
export const ProgressCircle = /*#__PURE__*/ React.forwardRef(function ProgressCircle({ value, max, tone, display, valueText, labels, size = "md", showValue, children, className, ...props }, ref) {
|
|
91
91
|
const m = useProgressModel({ value, max, tone, display, valueText, labels });
|
|
92
92
|
const { px, stroke } = CIRCLE[size];
|
|
93
93
|
const r = (px - stroke) / 2;
|
|
@@ -11,7 +11,7 @@ export { encodeQr, qrPath };
|
|
|
11
11
|
* <QrCode value={otpauthUri} aria-label="QR code for your authenticator app" />
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
export const QrCode = React.forwardRef(function QrCode({ value, errorCorrection, size = 176, margin, plate = true, fallback = "Too long for a QR code", children, className, style, ...props }, ref) {
|
|
14
|
+
export const QrCode = /*#__PURE__*/ React.forwardRef(function QrCode({ value, errorCorrection, size = 176, margin, plate = true, fallback = "Too long for a QR code", children, className, style, ...props }, ref) {
|
|
15
15
|
const ecl = errorCorrection ?? (children ? "H" : "M");
|
|
16
16
|
let qr = null;
|
|
17
17
|
try {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import
|
|
4
|
+
import * as RadioGroupPrimitive from "radix-ui/radio-group";
|
|
5
5
|
import { cn } from "../lib/cn.js";
|
|
6
6
|
import { mergeIds } from "../lib/compose-refs.js";
|
|
7
7
|
import { FieldContextReset, useFieldContext } from "../lib/field-context.js";
|
|
8
8
|
import { useControllableState } from "../lib/use-controllable-state.js";
|
|
9
|
-
const RadioGroupContext = React.createContext({ variant: "default", size: "md", value: null });
|
|
9
|
+
const RadioGroupContext = /*#__PURE__*/ React.createContext({ variant: "default", size: "md", value: null });
|
|
10
10
|
const segmentedTrack = "inline-flex w-fit max-w-full items-stretch gap-0.5 rounded-ui border border-line bg-selected p-[3px] has-[:focus-visible]:border-ring aria-invalid:border-danger";
|
|
11
11
|
/**
|
|
12
12
|
* Pick exactly one of a small set: post visibility, invoice type, plan. WAI-ARIA radio group on
|
|
@@ -51,10 +51,10 @@ function RadioGroupInner({ value: valueProp, defaultValue, onValueChange, items,
|
|
|
51
51
|
? "flex flex-wrap items-start gap-x-6 gap-y-2.5"
|
|
52
52
|
: "grid gap-2.5", className), children: _jsx(FieldContextReset, { children: _jsxs(RadioGroupContext.Provider, { value: ctx, children: [items?.map((item) => (_jsx(RadioGroupItem, { value: item.value, label: item.label, description: item.description, icon: item.icon, disabled: item.disabled }, item.value))), children] }) }) }));
|
|
53
53
|
}
|
|
54
|
-
export const RadioGroup = React.forwardRef(RadioGroupInner);
|
|
54
|
+
export const RadioGroup = /*#__PURE__*/ React.forwardRef(RadioGroupInner);
|
|
55
55
|
const circle = "peer relative inline-flex shrink-0 items-center justify-center rounded-full border border-field-border-hover bg-field outline-none transition-[border-color,box-shadow,background-color] duration-150 hover:border-fg-subtle focus-visible:border-ring focus-visible:shadow-[0_0_0_3px_var(--accent-soft)] data-[state=checked]:border-accent-ink disabled:cursor-not-allowed disabled:opacity-45 group-aria-invalid/radio:border-danger";
|
|
56
56
|
/** One option inside a `RadioGroup`. */
|
|
57
|
-
export const RadioGroupItem = React.forwardRef(function RadioGroupItem({ label, description, icon, children, className, controlClassName, id: idProp, "aria-describedby": describedBy, onKeyDown, ...props }, ref) {
|
|
57
|
+
export const RadioGroupItem = /*#__PURE__*/ React.forwardRef(function RadioGroupItem({ label, description, icon, children, className, controlClassName, id: idProp, "aria-describedby": describedBy, onKeyDown, ...props }, ref) {
|
|
58
58
|
const { variant, size, value: selected, readOnly } = React.useContext(RadioGroupContext);
|
|
59
59
|
const autoId = React.useId();
|
|
60
60
|
const id = idProp ?? `rd${autoId.replace(/:/g, "")}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import
|
|
4
|
+
import * as Collapsible from "radix-ui/collapsible";
|
|
5
5
|
import { ArrowLeft, ChevronDown, ChevronLeft, ChevronRight, LockKeyhole, SearchX } from "lucide-react";
|
|
6
6
|
import { cn } from "../lib/cn.js";
|
|
7
7
|
import { useLabels } from "../lib/labels.js";
|
|
@@ -36,7 +36,7 @@ const recordLabels = {
|
|
|
36
36
|
};
|
|
37
37
|
/** Below this container width (42rem) the side column moves under the header as collapsed sections. Matches navigation.css. */
|
|
38
38
|
const NARROW = 672;
|
|
39
|
-
const RecordLayoutContext = React.createContext({
|
|
39
|
+
const RecordLayoutContext = /*#__PURE__*/ React.createContext({
|
|
40
40
|
narrow: false,
|
|
41
41
|
readOnly: false,
|
|
42
42
|
asidePosition: "end",
|
|
@@ -52,7 +52,7 @@ const RecordLayoutContext = React.createContext({
|
|
|
52
52
|
* `aria-valuenow`; arrows resize, Shift+arrows in bigger steps, Home/End jump to min/max,
|
|
53
53
|
* double-click resets). Logical: works in RTL.
|
|
54
54
|
*/
|
|
55
|
-
export const SidePaneHandle = React.forwardRef(function SidePaneHandle({ value, min = 240, max = 560, defaultValue, onValueChange, edge = "start", step = 16, className, onKeyDown, onDoubleClick, ...props }, ref) {
|
|
55
|
+
export const SidePaneHandle = /*#__PURE__*/ React.forwardRef(function SidePaneHandle({ value, min = 240, max = 560, defaultValue, onValueChange, edge = "start", step = 16, className, onKeyDown, onDoubleClick, ...props }, ref) {
|
|
56
56
|
const innerRef = React.useRef(null);
|
|
57
57
|
const composed = useComposedRefs(ref, innerRef);
|
|
58
58
|
const [dragging, setDragging] = React.useState(false);
|
|
@@ -122,7 +122,7 @@ export const SidePaneHandle = React.forwardRef(function SidePaneHandle({ value,
|
|
|
122
122
|
* </RecordLayout>
|
|
123
123
|
* ```
|
|
124
124
|
*/
|
|
125
|
-
export const RecordLayout = React.forwardRef(function RecordLayout({ asidePosition = "end", asideWidth: asideWidthProp, defaultAsideWidth = 320, onAsideWidthChange, resizable = false, minAsideWidth = 260, maxAsideWidth = 520, state = "ready", notFound, forbidden, readOnly = false, labels, className, style, children, ...props }, ref) {
|
|
125
|
+
export const RecordLayout = /*#__PURE__*/ React.forwardRef(function RecordLayout({ asidePosition = "end", asideWidth: asideWidthProp, defaultAsideWidth = 320, onAsideWidthChange, resizable = false, minAsideWidth = 260, maxAsideWidth = 520, state = "ready", notFound, forbidden, readOnly = false, labels, className, style, children, ...props }, ref) {
|
|
126
126
|
const t = useLabels("record", recordLabels, labels);
|
|
127
127
|
const { ref: measureRef, width } = useContainerWidth();
|
|
128
128
|
const composed = useComposedRefs(ref, measureRef);
|
|
@@ -147,7 +147,7 @@ function RecordLayoutSkeleton({ label }) {
|
|
|
147
147
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { role: "status", "aria-label": label, "aria-busy": "true", className: "flex items-center gap-4 [grid-area:header]", children: [_jsx(SkeletonAvatar, { size: "xl" }), _jsxs("div", { className: "grid flex-1 gap-2", children: [_jsx(Skeleton, { className: "h-6 w-56 rounded-ui-sm" }), _jsx(Skeleton, { className: "h-4 w-40 rounded-ui-sm" })] })] }), _jsxs("div", { className: "grid gap-(--gap) [grid-area:main]", children: [_jsx("div", { className: "surface rounded-ui-lg p-(--gap)", children: _jsx(SkeletonText, { lines: 4 }) }), _jsx("div", { className: "surface rounded-ui-lg p-(--gap)", children: _jsx(SkeletonText, { lines: 3 }) })] }), _jsx("div", { className: "grid gap-3 [grid-area:aside]", children: _jsx("div", { className: "surface-2 rounded-ui-lg p-4", children: _jsx(SkeletonText, { lines: 5 }) }) })] }));
|
|
148
148
|
}
|
|
149
149
|
/** The record's header: back link + pager, media, h1, status, subtitle, actions and key facts. */
|
|
150
|
-
export const RecordHeader = React.forwardRef(function RecordHeader({ media, title, subtitle, status, facts, actions, back, pager, saving, size = "md", loading, labels, className, children, ...props }, ref) {
|
|
150
|
+
export const RecordHeader = /*#__PURE__*/ React.forwardRef(function RecordHeader({ media, title, subtitle, status, facts, actions, back, pager, saving, size = "md", loading, labels, className, children, ...props }, ref) {
|
|
151
151
|
const ctx = React.useContext(RecordLayoutContext);
|
|
152
152
|
const t = useLabels("record", recordLabels, labels ?? ctx.labels);
|
|
153
153
|
const showActions = actions && !ctx.readOnly;
|
|
@@ -156,7 +156,7 @@ export const RecordHeader = React.forwardRef(function RecordHeader({ media, titl
|
|
|
156
156
|
return (_jsxs("header", { ref: ref, "data-slot": "record-header", "data-size": size, className: cn("flex min-w-0 flex-col gap-4 [grid-area:header]", className), ...props, children: [back || pager ? (_jsxs("div", { className: "flex min-h-8 items-center justify-between gap-3", children: [back ? (_jsxs(SmartLink, { href: back.href, className: "-ms-0.5 inline-flex w-fit items-center gap-1.5 rounded-ui-sm text-[13px] text-fg-muted transition-colors hover:text-fg focus-ring", children: [_jsx(ArrowLeft, { "aria-hidden": true, className: "size-3.5 rtl:-scale-x-100" }), back.label] })) : (_jsx("span", {})), pager] })) : null, _jsxs("div", { className: "flex flex-wrap items-start gap-x-5 gap-y-4", children: [media ? _jsx("div", { "data-slot": "record-header-media", className: "shrink-0", children: media }) : null, _jsxs("div", { className: "min-w-0 flex-[1_1_16rem] self-center", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1.5", children: [_jsx("h1", { "aria-busy": loading || undefined, className: cn("font-display min-w-0 text-fg [text-wrap:balance]", size === "md" ? "text-[length:calc(28px*var(--display-scale))] leading-[1.1]" : "text-[length:calc(20px*var(--display-scale))] leading-[1.15]"), children: loading ? _jsx(Skeleton, { className: "inline-block h-[0.8em] w-[min(16rem,55vw)] rounded-ui-sm align-middle" }) : title }), status && !loading ? _jsx("span", { className: "inline-flex items-center gap-2", children: status }) : null, saving ? (_jsxs("span", { role: "status", className: "inline-flex items-center gap-1.5 text-[13px] text-fg-subtle", children: [_jsx(Spinner, { size: "xs" }), " ", t("saving")] })) : null] }), loading ? (_jsx(Skeleton, { className: "mt-2 h-4 w-48 rounded-ui-sm" })) : subtitle ? (_jsx("p", { className: "mt-1 text-[14px] text-fg-muted", children: subtitle })) : null] }), showActions ? _jsx("div", { "data-slot": "record-header-actions", className: "flex flex-wrap items-center gap-2 self-center", children: actions }) : null] }), facts?.length ? (_jsx("div", { ref: factsRef, role: "group", "aria-label": t("facts"), tabIndex: 0, "data-slot": "record-facts", "data-edge-fade": "x", className: "-mx-1 overflow-x-auto scrollbar-none rounded-ui-sm px-1 focus-ring @2xl/record:overflow-visible", children: _jsx("dl", { className: "flex w-max min-w-full items-stretch @2xl/record:w-auto @2xl/record:flex-wrap @2xl/record:gap-y-3", children: facts.map((f, i) => (_jsxs("div", { className: "flex min-w-0 shrink-0 flex-col gap-1 border-s border-line px-5 first:border-s-0 first:ps-0", children: [_jsx("dt", { className: "text-[12px] text-fg-subtle", children: f.label }), _jsx("dd", { className: "tabular text-[14px] font-medium text-fg", children: f.value })] }, i))) }) })) : null, children] }));
|
|
157
157
|
});
|
|
158
158
|
/** "3 of 128" with previous/next buttons and `j` / `k` shortcuts. */
|
|
159
|
-
export const RecordPager = React.forwardRef(function RecordPager({ index, total, prevHref, nextHref, onPrevious, onNext, shortcuts = true, labels, className, ...props }, ref) {
|
|
159
|
+
export const RecordPager = /*#__PURE__*/ React.forwardRef(function RecordPager({ index, total, prevHref, nextHref, onPrevious, onNext, shortcuts = true, labels, className, ...props }, ref) {
|
|
160
160
|
const ctx = React.useContext(RecordLayoutContext);
|
|
161
161
|
const t = useLabels("record", recordLabels, labels ?? ctx.labels);
|
|
162
162
|
const f = useFormat();
|
|
@@ -194,23 +194,23 @@ export const RecordPager = React.forwardRef(function RecordPager({ index, total,
|
|
|
194
194
|
return (_jsxs("nav", { ref: ref, "aria-label": t("pagerLabel"), "data-slot": "record-pager", className: cn("inline-flex items-center gap-1", className), ...props, children: [_jsx("span", { className: "tabular me-1 text-[13px] text-fg-muted", children: t("pager", { index: f.number(index), total: f.number(total) }) }), _jsxs("span", { className: "inline-flex items-center rounded-ui-sm border border-line", children: [step("prev"), _jsx("span", { "aria-hidden": true, className: "h-4 w-px bg-line" }), step("next")] })] }));
|
|
195
195
|
});
|
|
196
196
|
/** The main column: tabs, overview, activity, related lists. */
|
|
197
|
-
export const RecordMain = React.forwardRef(function RecordMain({ tabs, className, children, ...props }, ref) {
|
|
197
|
+
export const RecordMain = /*#__PURE__*/ React.forwardRef(function RecordMain({ tabs, className, children, ...props }, ref) {
|
|
198
198
|
return (_jsxs("div", { ref: ref, "data-slot": "record-main", className: cn("flex min-w-0 flex-col gap-(--gap) [grid-area:main]", className), ...props, children: [tabs ? _jsx("div", { "data-slot": "record-main-tabs", className: "-mb-1", children: tabs }) : null, children] }));
|
|
199
199
|
});
|
|
200
200
|
/** A titled card in the main column: overview, activity, related deals. `<section aria-labelledby>`. */
|
|
201
|
-
export const RecordSection = React.forwardRef(function RecordSection({ title, description, action, padding = "md", className, children, id, ...props }, ref) {
|
|
201
|
+
export const RecordSection = /*#__PURE__*/ React.forwardRef(function RecordSection({ title, description, action, padding = "md", className, children, id, ...props }, ref) {
|
|
202
202
|
const autoId = React.useId();
|
|
203
203
|
const titleId = `${id ?? `record-section${autoId.replace(/:/g, "")}`}-title`;
|
|
204
204
|
return (_jsxs("section", { ref: ref, id: id, "aria-labelledby": titleId, "data-slot": "record-section", className: cn("surface overflow-hidden rounded-ui-lg", className), ...props, children: [_jsxs("div", { className: "flex items-start justify-between gap-3 px-(--gap) pt-[calc(var(--gap)*0.8)]", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("h2", { id: titleId, className: "text-[15px] font-semibold text-fg", children: title }), description ? _jsx("p", { className: "mt-0.5 text-[13px] text-fg-muted", children: description }) : null] }), action ? _jsx("div", { className: "-me-1 -mt-1 flex shrink-0 items-center gap-1.5", children: action }) : null] }), _jsx("div", { className: cn(padding === "md" ? "p-(--gap) pt-3" : "pt-3"), children: children })] }));
|
|
205
205
|
});
|
|
206
206
|
/** The side column (`<aside>`): description lists, owners, tags, related records. */
|
|
207
|
-
export const RecordAside = React.forwardRef(function RecordAside({ className, children, labels, ...props }, ref) {
|
|
207
|
+
export const RecordAside = /*#__PURE__*/ React.forwardRef(function RecordAside({ className, children, labels, ...props }, ref) {
|
|
208
208
|
const ctx = React.useContext(RecordLayoutContext);
|
|
209
209
|
const t = useLabels("record", recordLabels, labels ?? ctx.labels);
|
|
210
210
|
return (_jsxs("aside", { ref: ref, "aria-label": props["aria-label"] ?? t("details"), "data-slot": "record-aside", className: cn("relative flex min-w-0 flex-col gap-3 [grid-area:aside]", className), ...props, children: [ctx.resizable && !ctx.narrow ? (_jsx(SidePaneHandle, { "aria-label": t("resizeAside"), edge: ctx.asidePosition === "end" ? "start" : "end", value: ctx.asideWidth, min: ctx.minAsideWidth, max: ctx.maxAsideWidth, defaultValue: ctx.defaultAsideWidth, onValueChange: ctx.setAsideWidth })) : null, children] }));
|
|
211
211
|
});
|
|
212
212
|
/** A titled block in the side column; folds like an accordion item when space is short. */
|
|
213
|
-
export const RecordAsideSection = React.forwardRef(function RecordAsideSection({ title, action, collapsible = false, defaultOpen = true, open: openProp, onOpenChange, headingLevel = 2, className, children, ...props }, ref) {
|
|
213
|
+
export const RecordAsideSection = /*#__PURE__*/ React.forwardRef(function RecordAsideSection({ title, action, collapsible = false, defaultOpen = true, open: openProp, onOpenChange, headingLevel = 2, className, children, ...props }, ref) {
|
|
214
214
|
const { narrow } = React.useContext(RecordLayoutContext);
|
|
215
215
|
const foldable = collapsible || narrow;
|
|
216
216
|
const touched = React.useRef(false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import
|
|
4
|
+
import * as PopoverPrimitive from "radix-ui/popover";
|
|
5
5
|
import { Check, ChevronsUpDown, ExternalLink, LayoutList, Plus, RotateCw, Search, TriangleAlert, X } from "lucide-react";
|
|
6
6
|
import { cn } from "../lib/cn.js";
|
|
7
7
|
import { mergeIds } from "../lib/compose-refs.js";
|
|
@@ -647,4 +647,4 @@ function RecordPickerInner(props, forwardedRef) {
|
|
|
647
647
|
* <Field label="Company"><RecordPicker source={companies} value={companyId} onValueChange={setCompanyId} /></Field>
|
|
648
648
|
* ```
|
|
649
649
|
*/
|
|
650
|
-
export const RecordPicker = React.forwardRef(RecordPickerInner);
|
|
650
|
+
export const RecordPicker = /*#__PURE__*/ React.forwardRef(RecordPickerInner);
|
|
@@ -7,7 +7,7 @@ import { cn } from "../lib/cn.js";
|
|
|
7
7
|
export const useResizablePanelRef = usePanelRef;
|
|
8
8
|
/** Typed ref for a `ResizableGroup`'s `groupRef` (`getLayout()`, `setLayout()`). */
|
|
9
9
|
export const useResizableGroupRef = useGroupRef;
|
|
10
|
-
const OrientationContext = React.createContext("horizontal");
|
|
10
|
+
const OrientationContext = /*#__PURE__*/ React.createContext("horizontal");
|
|
11
11
|
/** localStorage that never throws (private mode, SSR, blocked storage). */
|
|
12
12
|
const safeLocalStorage = {
|
|
13
13
|
getItem(key) {
|
|
@@ -45,7 +45,7 @@ const safeLocalStorage = {
|
|
|
45
45
|
* units (`"35%"`, `"280px"`, `"20rem"`). In glass mode surfaces inside stop blurring while a
|
|
46
46
|
* handle is dragged. On phones, show one pane and open the other in a Sheet (not automatic).
|
|
47
47
|
*/
|
|
48
|
-
export const ResizableGroup = React.forwardRef(function ResizableGroup(props, ref) {
|
|
48
|
+
export const ResizableGroup = /*#__PURE__*/ React.forwardRef(function ResizableGroup(props, ref) {
|
|
49
49
|
return props.autoSaveId ? _jsx(PersistedGroup, { ...props, forwardedRef: ref }) : _jsx(BaseGroup, { ...props, forwardedRef: ref });
|
|
50
50
|
});
|
|
51
51
|
function PersistedGroup({ autoSaveId, storage, onLayoutChanged, defaultLayout, ...props }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import * as RadixScrollArea from "radix-ui/scroll-area";
|
|
3
3
|
type BarSize = "sm" | "md";
|
|
4
4
|
export interface ScrollAreaProps extends Omit<React.ComponentPropsWithoutRef<typeof RadixScrollArea.Root>, "dir"> {
|
|
5
5
|
/** Which scrollbars to render. Default `"vertical"`. */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import
|
|
4
|
+
import * as RadixScrollArea from "radix-ui/scroll-area";
|
|
5
5
|
import { cn } from "../lib/cn.js";
|
|
6
6
|
import { useComposedRefs } from "../lib/compose-refs.js";
|
|
7
7
|
import { useEdgeFade } from "../lib/use-edge-fade.js";
|
|
8
8
|
import { useIsomorphicLayoutEffect } from "../lib/use-controllable-state.js";
|
|
9
|
-
const BarSizeContext = React.createContext("sm");
|
|
9
|
+
const BarSizeContext = /*#__PURE__*/ React.createContext("sm");
|
|
10
10
|
const FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"]),[contenteditable="true"]';
|
|
11
11
|
/**
|
|
12
12
|
* A consistent thin scrollbar for bounded, embedded regions: popover and command lists, the
|
|
@@ -21,7 +21,7 @@ const FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:n
|
|
|
21
21
|
* only for embedded regions (performance and iOS momentum). The viewport is keyboard-focusable only
|
|
22
22
|
* when its content has nothing focusable of its own.
|
|
23
23
|
*/
|
|
24
|
-
export const ScrollArea = React.forwardRef(function ScrollArea({ orientation = "vertical", maxHeight, fade, size = "sm", type = "hover", viewportRef, viewportClassName, className, children, style, "aria-label": ariaLabel, ...props }, ref) {
|
|
24
|
+
export const ScrollArea = /*#__PURE__*/ React.forwardRef(function ScrollArea({ orientation = "vertical", maxHeight, fade, size = "sm", type = "hover", viewportRef, viewportClassName, className, children, style, "aria-label": ariaLabel, ...props }, ref) {
|
|
25
25
|
const innerRef = React.useRef(null);
|
|
26
26
|
const composed = useComposedRefs(viewportRef, innerRef);
|
|
27
27
|
const axis = orientation === "horizontal" ? "x" : "y";
|
|
@@ -49,7 +49,7 @@ export const ScrollArea = React.forwardRef(function ScrollArea({ orientation = "
|
|
|
49
49
|
return (_jsx(BarSizeContext.Provider, { value: size, children: _jsxs(RadixScrollArea.Root, { ref: ref, type: type, "data-slot": "scroll-area", className: cn("relative overflow-hidden", className), style: style, ...props, children: [_jsx(RadixScrollArea.Viewport, { ref: composed, "data-slot": "scroll-area-viewport", "data-orientation": orientation, "data-edge-fade": fade && orientation !== "both" ? axis : undefined, tabIndex: focusable ? 0 : undefined, role: ariaLabel ? "region" : undefined, "aria-label": ariaLabel, className: cn("size-full rounded-[inherit] outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring", viewportClassName), style: maxHeight !== undefined ? { maxHeight } : undefined, children: children }), orientation !== "horizontal" ? _jsx(ScrollBar, { orientation: "vertical" }) : null, orientation !== "vertical" ? _jsx(ScrollBar, { orientation: "horizontal" }) : null, _jsx(RadixScrollArea.Corner, {})] }) }));
|
|
50
50
|
});
|
|
51
51
|
/** A scrollbar for `ScrollArea`. Rendered automatically from `orientation`; use it directly for custom layouts. */
|
|
52
|
-
export const ScrollBar = React.forwardRef(function ScrollBar({ orientation = "vertical", size, className, ...props }, ref) {
|
|
52
|
+
export const ScrollBar = /*#__PURE__*/ React.forwardRef(function ScrollBar({ orientation = "vertical", size, className, ...props }, ref) {
|
|
53
53
|
const ctxSize = React.useContext(BarSizeContext);
|
|
54
54
|
const s = size ?? ctxSize;
|
|
55
55
|
return (_jsx(RadixScrollArea.Scrollbar, { ref: ref, orientation: orientation, "data-slot": "scroll-area-bar", className: cn("z-(--z-sticky) flex touch-none select-none p-px transition-[opacity,background-color] duration-150", "data-[state=hidden]:opacity-0 data-[state=visible]:opacity-100", orientation === "vertical" ? (s === "sm" ? "w-2" : "w-2.5") : s === "sm" ? "h-2 flex-col" : "h-2.5 flex-col", orientation === "vertical" ? "h-full border-s border-s-transparent" : "border-t border-t-transparent", "hover:bg-[color-mix(in_srgb,var(--track)_50%,transparent)]", className), ...props, children: _jsx(RadixScrollArea.Thumb, { "data-slot": "scroll-area-thumb", className: "relative flex-1 rounded-full before:absolute before:top-1/2 before:left-1/2 before:size-full before:min-h-8 before:min-w-8 before:-translate-x-1/2 before:-translate-y-1/2" }) }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import
|
|
4
|
+
import * as SelectPrimitive from "radix-ui/select";
|
|
5
5
|
import { Check, ChevronDown, ChevronUp, X } from "lucide-react";
|
|
6
6
|
import { cn } from "../lib/cn.js";
|
|
7
7
|
import { useFieldContext, useFieldControl } from "../lib/field-context.js";
|
|
@@ -19,7 +19,7 @@ const selectLabels = {
|
|
|
19
19
|
loading: "Loading options…",
|
|
20
20
|
empty: "No options",
|
|
21
21
|
};
|
|
22
|
-
const SelectContext = React.createContext({ size: "md", itemSize: "md" });
|
|
22
|
+
const SelectContext = /*#__PURE__*/ React.createContext({ size: "md", itemSize: "md" });
|
|
23
23
|
/* ------------------------------------------------------------------ */
|
|
24
24
|
/* Composite parts */
|
|
25
25
|
/* ------------------------------------------------------------------ */
|
|
@@ -29,21 +29,21 @@ export const SelectRoot = SelectPrimitive.Root;
|
|
|
29
29
|
* The button that shows the value. Uses `controlVariants`, so it lines up with Input.
|
|
30
30
|
* Reads the surrounding Field (id, description, invalid, disabled).
|
|
31
31
|
*/
|
|
32
|
-
export const SelectTrigger = React.forwardRef(function SelectTrigger({ className, size = "md", variant = "default", invalid, readOnly, loading, children, ...rest }, ref) {
|
|
32
|
+
export const SelectTrigger = /*#__PURE__*/ React.forwardRef(function SelectTrigger({ className, size = "md", variant = "default", invalid, readOnly, loading, children, ...rest }, ref) {
|
|
33
33
|
const props = useFieldControl({ ...rest, readOnly, "aria-invalid": invalid ? true : rest["aria-invalid"] });
|
|
34
34
|
const { readOnly: ro, required, name: _name, ...triggerProps } = props;
|
|
35
35
|
void _name;
|
|
36
36
|
return (_jsxs(SelectPrimitive.Trigger, { ref: ref, "data-slot": "select-trigger", "data-size": size, "data-readonly": ro ? "" : undefined, "aria-readonly": ro || undefined, "aria-required": required || undefined, "aria-busy": loading || undefined, className: cn(controlVariants({ size, variant: variant === "pill" ? "default" : variant, pill: variant === "pill" }), "justify-between text-start whitespace-nowrap cursor-default", "data-placeholder:text-fg-subtle [&>span]:min-w-0 [&>span]:truncate", ro && "cursor-default", className), ...triggerProps, children: [children, loading ? (_jsx(Spinner, { size: size === "lg" ? "md" : "sm", tone: "muted" })) : ro ? null : (_jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { "aria-hidden": true, className: "shrink-0 text-fg-subtle transition-transform duration-150 [[data-state=open]>&]:rotate-180" }) }))] }));
|
|
37
37
|
});
|
|
38
38
|
/** Shows the selected item's text, or the placeholder. Children override the rendering. */
|
|
39
|
-
export const SelectValue = React.forwardRef(function SelectValue({ className, ...props }, ref) {
|
|
39
|
+
export const SelectValue = /*#__PURE__*/ React.forwardRef(function SelectValue({ className, ...props }, ref) {
|
|
40
40
|
return _jsx(SelectPrimitive.Value, { ref: ref, "data-slot": "select-value", className: cn("min-w-0 truncate", className), ...props });
|
|
41
41
|
});
|
|
42
42
|
/**
|
|
43
43
|
* The floating list. Popper-positioned under the trigger, at least as wide as it, portalled into
|
|
44
44
|
* the nearest ThemeScope, and one layer deep (glass blur only at depth 1).
|
|
45
45
|
*/
|
|
46
|
-
export const SelectContent = React.forwardRef(function SelectContent({ className, children, position = "popper", sideOffset = 6, collisionPadding = 12, itemSize, ...props }, ref) {
|
|
46
|
+
export const SelectContent = /*#__PURE__*/ React.forwardRef(function SelectContent({ className, children, position = "popper", sideOffset = 6, collisionPadding = 12, itemSize, ...props }, ref) {
|
|
47
47
|
const container = usePortalContainer();
|
|
48
48
|
const parent = React.useContext(SelectContext);
|
|
49
49
|
const ctx = React.useMemo(() => ({ ...parent, itemSize: itemSize ?? parent.itemSize }), [parent, itemSize]);
|
|
@@ -54,20 +54,20 @@ export const SelectContent = React.forwardRef(function SelectContent({ className
|
|
|
54
54
|
* One option. Typeahead uses a locale-folded copy of the text, so typing "i" finds "İstanbul"
|
|
55
55
|
* and "c" finds "Çanakkale". Pass `textValue` when children aren't plain text.
|
|
56
56
|
*/
|
|
57
|
-
export const SelectItem = React.forwardRef(function SelectItem({ className, children, icon, description, textValue, ...props }, ref) {
|
|
57
|
+
export const SelectItem = /*#__PURE__*/ React.forwardRef(function SelectItem({ className, children, icon, description, textValue, ...props }, ref) {
|
|
58
58
|
const { itemSize } = React.useContext(SelectContext);
|
|
59
59
|
const { locale } = useLocale();
|
|
60
60
|
const plain = textValue ?? (typeof children === "string" ? children : undefined);
|
|
61
61
|
return (_jsxs(SelectPrimitive.Item, { ref: ref, "data-slot": "select-item", textValue: plain !== undefined ? foldText(plain, locale) : undefined, className: cn(itemVariants({ size: itemSize }), "pe-8", description ? "items-start" : undefined, className), ...props, children: [icon ? _jsx("span", { className: cn(itemSlots.icon, "flex items-center justify-center", description && "mt-0.5"), children: icon }) : null, _jsxs("span", { className: "grid min-w-0 flex-1", children: [_jsx(SelectPrimitive.ItemText, { children: _jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [icon ? _jsx("span", { "aria-hidden": true, className: "hidden items-center text-fg-muted [[data-slot=select-trigger]_&]:flex", children: icon }) : null, _jsx("span", { className: "truncate", children: children })] }) }), description ? _jsx("span", { className: itemSlots.description, children: description }) : null] }), _jsx("span", { className: cn("absolute end-2 flex size-4 items-center justify-center text-accent-ink", description && "top-2"), children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { "aria-hidden": true, strokeWidth: 2.5, className: "size-4" }) }) })] }));
|
|
62
62
|
});
|
|
63
63
|
/** Groups items under a heading; announced as a group. */
|
|
64
|
-
export const SelectGroup = React.forwardRef(function SelectGroup({ label, children, ...props }, ref) {
|
|
64
|
+
export const SelectGroup = /*#__PURE__*/ React.forwardRef(function SelectGroup({ label, children, ...props }, ref) {
|
|
65
65
|
return (_jsxs(SelectPrimitive.Group, { ref: ref, "data-slot": "select-group", ...props, children: [label != null ? _jsx(SelectLabel, { children: label }) : null, children] }));
|
|
66
66
|
});
|
|
67
|
-
export const SelectLabel = React.forwardRef(function SelectLabel({ className, ...props }, ref) {
|
|
67
|
+
export const SelectLabel = /*#__PURE__*/ React.forwardRef(function SelectLabel({ className, ...props }, ref) {
|
|
68
68
|
return _jsx(SelectPrimitive.Label, { ref: ref, "data-slot": "select-label", className: cn(itemSlots.groupLabel, className), ...props });
|
|
69
69
|
});
|
|
70
|
-
export const SelectSeparator = React.forwardRef(function SelectSeparator({ className, ...props }, ref) {
|
|
70
|
+
export const SelectSeparator = /*#__PURE__*/ React.forwardRef(function SelectSeparator({ className, ...props }, ref) {
|
|
71
71
|
return _jsx(SelectPrimitive.Separator, { ref: ref, "data-slot": "select-separator", className: cn(itemSlots.separator, className), ...props });
|
|
72
72
|
});
|
|
73
73
|
function groupItems(items) {
|
|
@@ -134,4 +134,4 @@ function SelectInner({ value: valueProp, defaultValue, onValueChange, items, chi
|
|
|
134
134
|
* </Field>
|
|
135
135
|
* ```
|
|
136
136
|
*/
|
|
137
|
-
export const Select = React.forwardRef(SelectInner);
|
|
137
|
+
export const Select = /*#__PURE__*/ React.forwardRef(SelectInner);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import * as SeparatorPrimitive from "radix-ui/separator";
|
|
3
3
|
import { type VariantProps } from "class-variance-authority";
|
|
4
4
|
export declare const separatorVariants: (props?: ({
|
|
5
5
|
tone?: "nav" | "strong" | "line" | null | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import
|
|
3
|
+
import * as SeparatorPrimitive from "radix-ui/separator";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { cn } from "../lib/cn.js";
|
|
6
|
-
export const separatorVariants = cva("shrink-0 border-0", {
|
|
6
|
+
export const separatorVariants = /*#__PURE__*/ cva("shrink-0 border-0", {
|
|
7
7
|
variants: {
|
|
8
8
|
tone: {
|
|
9
9
|
line: "bg-line",
|
|
@@ -32,7 +32,7 @@ export const separatorVariants = cva("shrink-0 border-0", {
|
|
|
32
32
|
* <Separator label="or continue with" />
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export const Separator = React.forwardRef(function Separator({ className, orientation = "horizontal", decorative = true, tone, inset, label, labelAlign = "center", ...props }, ref) {
|
|
35
|
+
export const Separator = /*#__PURE__*/ React.forwardRef(function Separator({ className, orientation = "horizontal", decorative = true, tone, inset, label, labelAlign = "center", ...props }, ref) {
|
|
36
36
|
if (label != null && orientation === "horizontal") {
|
|
37
37
|
const line = _jsx(SeparatorPrimitive.Root, { decorative: true, className: cn(separatorVariants({ tone, orientation: "horizontal" }), "w-auto flex-1") });
|
|
38
38
|
return (_jsxs("div", { ref: ref, "data-slot": "separator", "data-orientation": "horizontal", className: cn("flex w-full items-center gap-3 text-xs text-fg-subtle", inset && "px-(--gap)", className), ...props, children: [labelAlign !== "start" ? line : null, _jsx("span", { className: "shrink-0 tracking-[0.01em]", children: label }), labelAlign !== "end" ? line : null] }));
|
|
@@ -25,7 +25,7 @@ const settingsLabels = {
|
|
|
25
25
|
error: "Couldn't save your changes",
|
|
26
26
|
loading: "Loading settings",
|
|
27
27
|
};
|
|
28
|
-
const SettingsLayoutContext = React.createContext({ readOnly: false });
|
|
28
|
+
const SettingsLayoutContext = /*#__PURE__*/ React.createContext({ readOnly: false });
|
|
29
29
|
/**
|
|
30
30
|
* A shared skeleton for settings pages: section nav, titled sections of label | control rows,
|
|
31
31
|
* a sticky save bar that rises when there are unsaved changes, and a danger zone. Not bound to
|
|
@@ -41,7 +41,7 @@ const SettingsLayoutContext = React.createContext({ readOnly: false });
|
|
|
41
41
|
* </SettingsLayout>
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
|
-
export const SettingsLayout = React.forwardRef(function SettingsLayout({ nav, width = "md", readOnly = false, notice, stickyTop, labels, className, style, children, ...props }, ref) {
|
|
44
|
+
export const SettingsLayout = /*#__PURE__*/ React.forwardRef(function SettingsLayout({ nav, width = "md", readOnly = false, notice, stickyTop, labels, className, style, children, ...props }, ref) {
|
|
45
45
|
const ctx = React.useMemo(() => ({ readOnly, labels }), [readOnly, labels]);
|
|
46
46
|
const top = stickyTop === undefined ? undefined : typeof stickyTop === "number" ? `${stickyTop}px` : stickyTop;
|
|
47
47
|
return (_jsx(SettingsLayoutContext.Provider, { value: ctx, children: _jsx("div", { ref: ref, "data-slot": "settings-layout", "data-read-only": readOnly ? "" : undefined, className: cn("@container/settings mx-auto w-full min-w-0", width === "md" ? "max-w-[64rem]" : "max-w-[80rem]", className), style: top !== undefined ? { "--settings-sticky-top": top, ...style } : style, ...props, children: _jsxs("div", { className: cn("grid min-w-0 gap-x-10 gap-y-5", nav && "@2xl/settings:grid-cols-[11.5rem_minmax(0,1fr)]"), children: [nav ? (_jsx("div", { "data-slot": "settings-layout-nav", className: "min-w-0 @2xl/settings:sticky @2xl/settings:top-[calc(var(--settings-sticky-top,var(--topbar-h))+1.5rem)] @2xl/settings:self-start", children: nav })) : null, _jsxs("div", { "data-slot": "settings-layout-content", className: "flex min-w-0 flex-col gap-[calc(var(--gap)*1.6)]", children: [notice, children] })] }) }) }));
|
|
@@ -50,7 +50,7 @@ export const SettingsLayout = React.forwardRef(function SettingsLayout({ nav, wi
|
|
|
50
50
|
* Section navigation: a `nav` with `aria-current`. Anchor items scroll to their section, move focus
|
|
51
51
|
* to its heading, and follow the scroll (scroll-spy). Link items use the app's router.
|
|
52
52
|
*/
|
|
53
|
-
export const SettingsNav = React.forwardRef(function SettingsNav({ items: itemsProp, value: valueProp, defaultValue, onValueChange, scrollSpy = true, labels, className, ...props }, ref) {
|
|
53
|
+
export const SettingsNav = /*#__PURE__*/ React.forwardRef(function SettingsNav({ items: itemsProp, value: valueProp, defaultValue, onValueChange, scrollSpy = true, labels, className, ...props }, ref) {
|
|
54
54
|
const ctx = React.useContext(SettingsLayoutContext);
|
|
55
55
|
const t = useLabels("settings", settingsLabels, labels ?? ctx.labels);
|
|
56
56
|
const can = useCan();
|
|
@@ -121,7 +121,7 @@ export const SettingsNav = React.forwardRef(function SettingsNav({ items: itemsP
|
|
|
121
121
|
}) }) }));
|
|
122
122
|
});
|
|
123
123
|
/** A titled group of setting rows. `<section aria-labelledby>`. */
|
|
124
|
-
export const SettingsSection = React.forwardRef(function SettingsSection({ id, title, description, layout = "stacked", tone = "default", footer, loading, headingLevel = 2, labels, className, children, ...props }, ref) {
|
|
124
|
+
export const SettingsSection = /*#__PURE__*/ React.forwardRef(function SettingsSection({ id, title, description, layout = "stacked", tone = "default", footer, loading, headingLevel = 2, labels, className, children, ...props }, ref) {
|
|
125
125
|
const ctx = React.useContext(SettingsLayoutContext);
|
|
126
126
|
const t = useLabels("settings", settingsLabels, labels ?? ctx.labels);
|
|
127
127
|
const autoId = React.useId();
|
|
@@ -135,7 +135,7 @@ export const SettingsSection = React.forwardRef(function SettingsSection({ id, t
|
|
|
135
135
|
* One setting: label + description | control. Acts like a `Field` for kit controls (Input,
|
|
136
136
|
* Switch, Select…): the id, `aria-describedby` and disabled/invalid state are wired for you.
|
|
137
137
|
*/
|
|
138
|
-
export const SettingsRow = React.forwardRef(function SettingsRow({ label, description, htmlFor, layout = "split", badge, error, disabled, className, children, ...props }, ref) {
|
|
138
|
+
export const SettingsRow = /*#__PURE__*/ React.forwardRef(function SettingsRow({ label, description, htmlFor, layout = "split", badge, error, disabled, className, children, ...props }, ref) {
|
|
139
139
|
const { readOnly } = React.useContext(SettingsLayoutContext);
|
|
140
140
|
const autoId = React.useId().replace(/:/g, "");
|
|
141
141
|
const controlId = htmlFor ?? `setting-${autoId}`;
|
|
@@ -160,7 +160,7 @@ export const SettingsRow = React.forwardRef(function SettingsRow({ label, descri
|
|
|
160
160
|
* The sticky "Unsaved changes · Discard · Save" bar. It rises from the bottom of the content when
|
|
161
161
|
* the form is dirty, announces itself politely, and `mod+s` saves.
|
|
162
162
|
*/
|
|
163
|
-
export const SettingsSaveBar = React.forwardRef(function SettingsSaveBar({ dirty, saving = false, onSave, onReset, message, error, blockNavigation = true, shortcuts = true, saveLabel, labels, className, ...props }, ref) {
|
|
163
|
+
export const SettingsSaveBar = /*#__PURE__*/ React.forwardRef(function SettingsSaveBar({ dirty, saving = false, onSave, onReset, message, error, blockNavigation = true, shortcuts = true, saveLabel, labels, className, ...props }, ref) {
|
|
164
164
|
const ctx = React.useContext(SettingsLayoutContext);
|
|
165
165
|
const t = useLabels("settings", settingsLabels, labels ?? ctx.labels);
|
|
166
166
|
const visible = dirty || saving || Boolean(error);
|
package/dist/components/sheet.js
CHANGED
|
@@ -34,7 +34,7 @@ export const SheetBody = LayerBody;
|
|
|
34
34
|
/** `LayerFooter` for sheets. */
|
|
35
35
|
export const SheetFooter = LayerFooter;
|
|
36
36
|
const sideAlias = { left: "start", right: "end" };
|
|
37
|
-
export const SheetContent = React.forwardRef(function SheetContent({ side: sideProp = "end", size = "md", inset, className, ...props }, ref) {
|
|
37
|
+
export const SheetContent = /*#__PURE__*/ React.forwardRef(function SheetContent({ side: sideProp = "end", size = "md", inset, className, ...props }, ref) {
|
|
38
38
|
const side = sideProp === "left" || sideProp === "right" ? sideAlias[sideProp] : sideProp;
|
|
39
39
|
return (_jsx(LayerContentShell, { ref: ref, "data-slot": "sheet-content", "data-side": side, "data-size": size, "data-inset": inset ? "" : undefined, className: cn("vui-sheet", `ui-sheet-${side}`, className), ...props }));
|
|
40
40
|
});
|
|
@@ -138,14 +138,14 @@ export const DrawerClose = DialogClose;
|
|
|
138
138
|
export const DrawerHeader = LayerHeader;
|
|
139
139
|
export const DrawerFooter = LayerFooter;
|
|
140
140
|
/** The scrolling body of a drawer; dragging starts from it only while it is scrolled to the top. */
|
|
141
|
-
export const DrawerBody = React.forwardRef(function DrawerBody(props, ref) {
|
|
141
|
+
export const DrawerBody = /*#__PURE__*/ React.forwardRef(function DrawerBody(props, ref) {
|
|
142
142
|
return _jsx(LayerBody, { ref: ref, "data-slot": "drawer-body", ...props });
|
|
143
143
|
});
|
|
144
144
|
/** The grab line at the top of a drawer. Decorative (`aria-hidden`). */
|
|
145
145
|
export function DrawerHandle({ className }) {
|
|
146
146
|
return _jsx("div", { "aria-hidden": true, "data-slot": "drawer-handle", className: cn("vui-drawer-handle", className) });
|
|
147
147
|
}
|
|
148
|
-
export const DrawerContent = React.forwardRef(function DrawerContent({ dragToDismiss = true, handle = true, size = "lg", className, children, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, ...props }, ref) {
|
|
148
|
+
export const DrawerContent = /*#__PURE__*/ React.forwardRef(function DrawerContent({ dragToDismiss = true, handle = true, size = "lg", className, children, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, ...props }, ref) {
|
|
149
149
|
const root = useDialogRoot();
|
|
150
150
|
const { ref: dragRef, handlers } = useDragDismiss({ onDismiss: () => root.requestOpenChange(false), enabled: dragToDismiss });
|
|
151
151
|
const composed = useComposedRefs(ref, dragRef);
|