@vamos-ui/react 0.3.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-image.js +1 -1
- package/dist/blocks/block-link.js +2 -2
- package/dist/blocks/index.d.ts +5 -5
- package/dist/blocks/index.js +5 -5
- 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/_kit-1.js +1 -1
- package/dist/blocks/site/announcement-bar.js +1 -1
- package/dist/blocks/site/article-layout.d.ts +1 -0
- package/dist/blocks/site/article-layout.js +2 -1
- package/dist/blocks/site/blog-list.d.ts +1 -0
- package/dist/blocks/site/blog-list.js +3 -2
- package/dist/blocks/site/contact-dock.js +3 -1
- package/dist/blocks/site/contact-form.js +1 -1
- package/dist/blocks/site/cta.d.ts +2 -2
- package/dist/blocks/site/cta.js +6 -4
- package/dist/blocks/site/feature-grid.d.ts +1 -0
- package/dist/blocks/site/feature-grid.js +5 -4
- package/dist/blocks/site/feature-tabs.js +1 -1
- package/dist/blocks/site/footer.d.ts +11 -2
- package/dist/blocks/site/footer.js +36 -11
- package/dist/blocks/site/gallery-section.d.ts +6 -1
- package/dist/blocks/site/gallery-section.js +5 -4
- package/dist/blocks/site/hero.d.ts +3 -2
- package/dist/blocks/site/hero.js +7 -5
- package/dist/blocks/site/logo-strip.d.ts +1 -0
- package/dist/blocks/site/logo-strip.js +1 -1
- package/dist/blocks/site/map-hours.d.ts +2 -2
- package/dist/blocks/site/map-hours.js +4 -2
- package/dist/blocks/site/media-text.d.ts +4 -1
- package/dist/blocks/site/media-text.js +4 -3
- package/dist/blocks/site/menu-list.d.ts +7 -3
- package/dist/blocks/site/menu-list.js +34 -7
- package/dist/blocks/site/navbar.d.ts +1 -0
- package/dist/blocks/site/navbar.js +6 -5
- package/dist/blocks/site/not-found.js +2 -1
- package/dist/blocks/site/page-intro.d.ts +1 -0
- package/dist/blocks/site/page-intro.js +2 -1
- package/dist/blocks/site/process.d.ts +1 -0
- package/dist/blocks/site/process.js +2 -1
- package/dist/blocks/site/registry-1.d.ts +1 -1
- package/dist/blocks/site/registry-2.d.ts +5 -0
- package/dist/blocks/site/registry-2.js +5 -3
- package/dist/blocks/site/rich-text-section.js +2 -1
- package/dist/blocks/site/shared/heading-lines.d.ts +9 -0
- package/dist/blocks/site/shared/heading-lines.js +32 -0
- package/dist/blocks/site/shared/image-sizes.d.ts +25 -0
- package/dist/blocks/site/shared/image-sizes.js +37 -0
- package/dist/blocks/site/shared/island-keys.d.ts +1 -1
- package/dist/blocks/site/shared/island-keys.js +1 -1
- package/dist/blocks/site/shared/labels-2.d.ts +17 -1
- package/dist/blocks/site/shared/labels-2.js +832 -6
- package/dist/blocks/site/shared/open-now.d.ts +1 -1
- package/dist/blocks/site/shared/open-now.js +1 -1
- package/dist/blocks/site/shared/opening-hours.d.ts +18 -2
- package/dist/blocks/site/shared/opening-hours.js +36 -7
- package/dist/blocks/site/shared/tap.d.ts +9 -0
- package/dist/blocks/site/shared/tap.js +16 -0
- package/dist/blocks/site/site-shell.js +3 -3
- package/dist/blocks/site/team.d.ts +1 -1
- package/dist/blocks/site/team.js +4 -3
- package/dist/blocks/site/testimonials.d.ts +2 -2
- package/dist/blocks/site/testimonials.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-chart.js +1 -1
- package/dist/charts/bar-list.js +1 -1
- package/dist/charts/chart-shell.d.ts +9 -2
- package/dist/charts/chart-shell.js +11 -5
- package/dist/charts/chart.js +1 -1
- package/dist/charts/combo-chart.js +5 -7
- package/dist/charts/donut-chart.js +1 -1
- package/dist/charts/funnel.js +1 -1
- package/dist/charts/gauge.js +2 -2
- package/dist/charts/utils.d.ts +10 -0
- package/dist/charts/utils.js +46 -0
- package/dist/components/accordion.d.ts +1 -1
- package/dist/components/accordion.js +8 -8
- package/dist/components/activity-timeline.js +11 -11
- 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.d.ts +26 -0
- package/dist/components/aspect-ratio.js +42 -0
- 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.d.ts +12 -3
- package/dist/components/carousel.js +17 -14
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +6 -6
- package/dist/components/collapsible.d.ts +36 -0
- package/dist/components/collapsible.js +37 -0
- 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.d.ts +18 -2
- package/dist/components/image.js +16 -9
- 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 +96 -0
- package/dist/components/menubar.js +123 -0
- 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.d.ts +51 -0
- package/dist/components/placeholder-art.js +82 -0
- 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 -90
- package/dist/index.js +94 -90
- 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/value-format.js +1 -1
- package/dist/lib/variants.js +2 -2
- package/dist/locales/ar.d.ts +2087 -0
- package/dist/locales/ar.js +2088 -0
- package/dist/locales/de.d.ts +2087 -0
- package/dist/locales/de.js +2088 -0
- package/dist/locales/en.d.ts +1 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/es.d.ts +2087 -0
- package/dist/locales/es.js +2087 -0
- package/dist/locales/fr.d.ts +2087 -0
- package/dist/locales/fr.js +2088 -0
- package/dist/locales/tr.d.ts +1 -0
- package/dist/locales/tr.js +1 -0
- 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 +4 -4
- 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.d.ts +3 -1
- package/dist/motion/text-reveal.js +6 -4
- package/dist/motion/ticker.js +1 -1
- package/dist/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/dist/render/block-renderer.js +1 -1
- 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/dist/styles/blocks.css +18 -9
- package/dist/styles/editors.css +2 -1
- package/dist/styles/media.css +31 -5
- package/dist/styles.css +39 -9
- package/package.json +1 -1
|
@@ -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);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import
|
|
4
|
+
import * as Collapsible from "radix-ui/collapsible";
|
|
5
|
+
import * as PopoverPrimitive from "radix-ui/popover";
|
|
5
6
|
import { ArrowUpRight, Check, ChevronDown, ChevronRight, ChevronsUpDown, PanelLeftClose, PanelLeftOpen } from "lucide-react";
|
|
6
7
|
import { cn } from "../lib/cn.js";
|
|
7
8
|
import { useLabels } from "../lib/labels.js";
|
|
@@ -27,7 +28,7 @@ const sidebarLabels = {
|
|
|
27
28
|
workspaces: "Workspaces",
|
|
28
29
|
loading: "Loading menu",
|
|
29
30
|
};
|
|
30
|
-
const SidebarContext = React.createContext(null);
|
|
31
|
+
const SidebarContext = /*#__PURE__*/ React.createContext(null);
|
|
31
32
|
/** Collapsed state and helpers of the nearest `Sidebar`. */
|
|
32
33
|
export function useSidebar() {
|
|
33
34
|
const ctx = React.useContext(SidebarContext);
|
|
@@ -42,8 +43,8 @@ const useSidebarCtx = () => {
|
|
|
42
43
|
return ctx;
|
|
43
44
|
};
|
|
44
45
|
/** Active trail from `SidebarNav` (data-driven); `null` in the compound API (each item checks its own href). */
|
|
45
|
-
const TrailContext = React.createContext(null);
|
|
46
|
-
const SubContext = React.createContext({ placement: "inline", depth: 1 });
|
|
46
|
+
const TrailContext = /*#__PURE__*/ React.createContext(null);
|
|
47
|
+
const SubContext = /*#__PURE__*/ React.createContext({ placement: "inline", depth: 1 });
|
|
47
48
|
/**
|
|
48
49
|
* The primary app navigation. Dark in both themes; the active section's submenu stays open in
|
|
49
50
|
* place, other sections open as flyouts, and the rail turns every submenu into a flyout.
|
|
@@ -57,7 +58,7 @@ const SubContext = React.createContext({ placement: "inline", depth: 1 });
|
|
|
57
58
|
* </Sidebar>
|
|
58
59
|
* ```
|
|
59
60
|
*/
|
|
60
|
-
export const Sidebar = React.forwardRef(function Sidebar({ variant = "nav", collapsed: collapsedProp, defaultCollapsed = false, onCollapsedChange, collapsible = true, mode = "desktop", shortcut = false, onNavigate, labels, className, children, ...props }, ref) {
|
|
61
|
+
export const Sidebar = /*#__PURE__*/ React.forwardRef(function Sidebar({ variant = "nav", collapsed: collapsedProp, defaultCollapsed = false, onCollapsedChange, collapsible = true, mode = "desktop", shortcut = false, onNavigate, labels, className, children, ...props }, ref) {
|
|
61
62
|
const t = useLabels("sidebar", sidebarLabels, labels);
|
|
62
63
|
const [collapsedState, setCollapsed] = useControllableState({ value: collapsedProp, defaultValue: defaultCollapsed, onChange: onCollapsedChange, name: "Sidebar" });
|
|
63
64
|
const collapsed = mode === "desktop" && collapsible && collapsedState;
|
|
@@ -66,20 +67,20 @@ export const Sidebar = React.forwardRef(function Sidebar({ variant = "nav", coll
|
|
|
66
67
|
return (_jsx(SidebarContext.Provider, { value: ctx, children: _jsx("aside", { ref: ref, "data-slot": "sidebar", "data-variant": variant, "data-mode": mode, "data-collapsed": collapsed ? "" : undefined, className: cn("vui-sidebar surface-nav relative flex h-full min-h-0 shrink-0 flex-col text-[13.5px]", mode === "desktop" && "border-e border-nav-line", variant === "surface" && "border-line", className), ...props, children: children }) }));
|
|
67
68
|
});
|
|
68
69
|
/** Top slot: app switcher, workspace switcher, logo. */
|
|
69
|
-
export const SidebarHeader = React.forwardRef(function SidebarHeader({ className, ...props }, ref) {
|
|
70
|
+
export const SidebarHeader = /*#__PURE__*/ React.forwardRef(function SidebarHeader({ className, ...props }, ref) {
|
|
70
71
|
return _jsx("div", { ref: ref, "data-slot": "sidebar-header", className: cn("grid gap-1 border-b border-nav-line p-2", className), ...props });
|
|
71
72
|
});
|
|
72
73
|
/** The scrolling `<nav>` with the menu. */
|
|
73
|
-
export const SidebarContent = React.forwardRef(function SidebarContent({ className, ...props }, ref) {
|
|
74
|
+
export const SidebarContent = /*#__PURE__*/ React.forwardRef(function SidebarContent({ className, ...props }, ref) {
|
|
74
75
|
const { t } = useSidebarCtx();
|
|
75
76
|
return (_jsx("nav", { ref: ref, "data-slot": "sidebar-content", "aria-label": props["aria-label"] ?? t("label"), className: cn("min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain py-2 scrollbar-none", className), ...props }));
|
|
76
77
|
});
|
|
77
78
|
/** Bottom slot: shared menu, collapse button, user. */
|
|
78
|
-
export const SidebarFooter = React.forwardRef(function SidebarFooter({ className, ...props }, ref) {
|
|
79
|
+
export const SidebarFooter = /*#__PURE__*/ React.forwardRef(function SidebarFooter({ className, ...props }, ref) {
|
|
79
80
|
return _jsx("div", { ref: ref, "data-slot": "sidebar-footer", className: cn("border-t border-nav-line", className), ...props });
|
|
80
81
|
});
|
|
81
82
|
/** A section: optional heading plus a list of `SidebarItem`s. */
|
|
82
|
-
export const SidebarGroup = React.forwardRef(function SidebarGroup({ label, className, children, ...props }, ref) {
|
|
83
|
+
export const SidebarGroup = /*#__PURE__*/ React.forwardRef(function SidebarGroup({ label, className, children, ...props }, ref) {
|
|
83
84
|
const { collapsed } = useSidebarCtx();
|
|
84
85
|
const id = React.useId();
|
|
85
86
|
return (_jsxs("div", { ref: ref, "data-slot": "sidebar-group", role: label ? "group" : undefined, "aria-labelledby": label ? id : undefined, className: cn("grid", className), ...props, children: [label ? (collapsed ? (_jsxs(_Fragment, { children: [_jsx("span", { id: id, className: "sr-only", children: label }), _jsx("span", { "aria-hidden": true, className: "mx-4 my-2 h-px bg-nav-line" })] })) : (_jsx("span", { id: id, className: "px-4.5 pt-4 pb-1.5 text-[11px] font-medium tracking-[0.06em] text-nav-fg/70", children: label }))) : null, _jsx("ul", { className: "grid gap-px", children: children })] }));
|
|
@@ -149,7 +150,7 @@ function useItemActive(id, href, children, explicit) {
|
|
|
149
150
|
}
|
|
150
151
|
const rowBase = "relative flex w-full items-center gap-3 rounded-ui-sm text-start outline-none transition-colors focus-ring";
|
|
151
152
|
/** An `<a>` through the app router, a `<button>` (no href) or a disabled `<span>`. */
|
|
152
|
-
const LinkRow = React.forwardRef(function LinkRow({ href, external, disabled, className, children, onClick, buttonProps, ...rest }, ref) {
|
|
153
|
+
const LinkRow = /*#__PURE__*/ React.forwardRef(function LinkRow({ href, external, disabled, className, children, onClick, buttonProps, ...rest }, ref) {
|
|
153
154
|
const Link = useLink();
|
|
154
155
|
const { onNavigate } = useSidebarCtx();
|
|
155
156
|
if (disabled) {
|
|
@@ -356,7 +357,7 @@ export function SidebarNav({ items, badges, features, trail: trailProp, classNam
|
|
|
356
357
|
/* Collapse button, skeleton */
|
|
357
358
|
/* ------------------------------------------------------------------ */
|
|
358
359
|
/** Toggles the rail. `aria-pressed` is true while collapsed. */
|
|
359
|
-
export const SidebarCollapseButton = React.forwardRef(function SidebarCollapseButton({ className, onClick, ...props }, ref) {
|
|
360
|
+
export const SidebarCollapseButton = /*#__PURE__*/ React.forwardRef(function SidebarCollapseButton({ className, onClick, ...props }, ref) {
|
|
360
361
|
const { collapsed, setCollapsed, collapsible, mode, t } = useSidebarCtx();
|
|
361
362
|
const { dir } = useLocale();
|
|
362
363
|
if (!collapsible || mode === "mobile")
|
|
@@ -109,7 +109,7 @@ const signatureLabels = {
|
|
|
109
109
|
* <Field label="Customer signature" required><SignaturePad name="signature" exportPng /></Field>
|
|
110
110
|
* ```
|
|
111
111
|
*/
|
|
112
|
-
export const SignaturePad = React.forwardRef(function SignaturePad(props, ref) {
|
|
112
|
+
export const SignaturePad = /*#__PURE__*/ React.forwardRef(function SignaturePad(props, ref) {
|
|
113
113
|
const { value, defaultValue, onValueChange, modes = ["draw", "type"], height = 176, penColor = "fg", exportPng = false, name, disabled: disabledProp, readOnly: readOnlyProp, invalid: invalidProp, required: requiredProp, labels, className, id, "aria-describedby": describedBy, ...rest } = props;
|
|
114
114
|
const field = useFieldContext();
|
|
115
115
|
const disabled = disabledProp ?? field?.disabled ?? false;
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { cn } from "../lib/cn.js";
|
|
5
5
|
import { LocalizedText } from "../lib/islands.js";
|
|
6
|
-
export const skeletonVariants = cva("block bg-skeleton", {
|
|
6
|
+
export const skeletonVariants = /*#__PURE__*/ cva("block bg-skeleton", {
|
|
7
7
|
variants: {
|
|
8
8
|
shape: {
|
|
9
9
|
rect: "rounded-ui-sm",
|
|
@@ -22,11 +22,11 @@ export const skeletonVariants = cva("block bg-skeleton", {
|
|
|
22
22
|
*
|
|
23
23
|
* The shimmer runs in the reading direction (RTL-aware) and stops under `prefers-reduced-motion`.
|
|
24
24
|
*/
|
|
25
|
-
export const Skeleton = React.forwardRef(function Skeleton({ className, shape, shimmer, ...props }, ref) {
|
|
25
|
+
export const Skeleton = /*#__PURE__*/ React.forwardRef(function Skeleton({ className, shape, shimmer, ...props }, ref) {
|
|
26
26
|
return _jsx("div", { ref: ref, "aria-hidden": true, "data-slot": "skeleton", className: cn(skeletonVariants({ shape, shimmer }), className), ...props });
|
|
27
27
|
});
|
|
28
28
|
/** Paragraph placeholder: full-width lines with a shorter last line. */
|
|
29
|
-
export const SkeletonText = React.forwardRef(function SkeletonText({ lines = 3, lastLineWidth = "62%", shimmer, lineClassName, className, ...props }, ref) {
|
|
29
|
+
export const SkeletonText = /*#__PURE__*/ React.forwardRef(function SkeletonText({ lines = 3, lastLineWidth = "62%", shimmer, lineClassName, className, ...props }, ref) {
|
|
30
30
|
return (_jsx("div", { ref: ref, "aria-hidden": true, "data-slot": "skeleton-text", className: cn("grid gap-2.5 text-sm", className), ...props, children: Array.from({ length: lines }, (_, i) => (_jsx(Skeleton, { shape: "text", shimmer: shimmer, className: lineClassName, style: i === lines - 1 && lines > 1 ? { width: lastLineWidth } : undefined }, i))) }));
|
|
31
31
|
});
|
|
32
32
|
const AVATAR = { xs: "size-5", sm: "size-6", md: "size-8", lg: "size-10", xl: "size-14" };
|
|
@@ -36,7 +36,7 @@ export function SkeletonAvatar({ size = "md", shape = "circle", className, ...pr
|
|
|
36
36
|
}
|
|
37
37
|
const COLUMN_WIDTHS = ["72%", "48%", "60%", "36%", "54%", "40%"];
|
|
38
38
|
/** A table/list row placeholder; height follows `--row-h`, padding `--cell-px`. */
|
|
39
|
-
export const SkeletonRow = React.forwardRef(function SkeletonRow({ columns = 4, avatar, shimmer, className, ...props }, ref) {
|
|
39
|
+
export const SkeletonRow = /*#__PURE__*/ React.forwardRef(function SkeletonRow({ columns = 4, avatar, shimmer, className, ...props }, ref) {
|
|
40
40
|
return (_jsx("div", { ref: ref, "aria-hidden": true, "data-slot": "skeleton-row", className: cn("grid h-(--row-h) items-center gap-4 border-b border-line px-(--cell-px) text-sm last:border-b-0", className), style: { gridTemplateColumns: `minmax(0,2fr) repeat(${Math.max(columns - 1, 0)}, minmax(0,1fr))` }, ...props, children: Array.from({ length: columns }, (_, i) => i === 0 && avatar ? (_jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [_jsx(SkeletonAvatar, { size: "md", shimmer: shimmer }), _jsxs("div", { className: "grid min-w-0 flex-1 gap-1.5", children: [_jsx(Skeleton, { shape: "text", shimmer: shimmer, style: { width: "70%" } }), _jsx(Skeleton, { shape: "text", shimmer: shimmer, className: "h-[0.65em]", style: { width: "45%" } })] })] }, i)) : (_jsx(Skeleton, { shape: "text", shimmer: shimmer, style: { width: COLUMN_WIDTHS[i % COLUMN_WIDTHS.length] } }, i))) }));
|
|
41
41
|
});
|
|
42
42
|
const skeletonLabels = { loading: "Loading…" };
|
|
@@ -48,6 +48,6 @@ const skeletonLabels = { loading: "Loading…" };
|
|
|
48
48
|
* <SkeletonGroup loading={isLoading}>{isLoading ? <SkeletonText /> : <Article />}</SkeletonGroup>
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
export const SkeletonGroup = React.forwardRef(function SkeletonGroup({ label, loading = true, children, ...props }, ref) {
|
|
51
|
+
export const SkeletonGroup = /*#__PURE__*/ React.forwardRef(function SkeletonGroup({ label, loading = true, children, ...props }, ref) {
|
|
52
52
|
return (_jsxs("div", { ref: ref, "data-slot": "skeleton-group", "aria-busy": loading || undefined, ...props, children: [loading ? (_jsx("span", { role: "status", className: "sr-only", children: label ?? _jsx(LocalizedText, { namespace: "skeleton", id: "loading", defaults: skeletonLabels }) })) : null, children] }));
|
|
53
53
|
});
|
|
@@ -40,7 +40,7 @@ export function slaState({ due, start, completedAt, pausedAt, now, warnAt = 0.25
|
|
|
40
40
|
const threshold = warnMinutes != null ? warnMinutes * 60_000 : startMs != null ? (dueMs - startMs) * warnAt : 30 * 60_000;
|
|
41
41
|
return { state: remaining <= threshold ? "at-risk" : "on-track", remaining, used };
|
|
42
42
|
}
|
|
43
|
-
const slaTimerVariants = cva("inline-flex items-center gap-1.5 whitespace-nowrap font-medium tabular", {
|
|
43
|
+
const slaTimerVariants = /*#__PURE__*/ cva("inline-flex items-center gap-1.5 whitespace-nowrap font-medium tabular", {
|
|
44
44
|
variants: {
|
|
45
45
|
variant: {
|
|
46
46
|
/** Tinted pill — list rows, inbox items. */
|
|
@@ -117,7 +117,7 @@ function useNow(fixed, remaining, live) {
|
|
|
117
117
|
* <SlaTimer variant="bar" label="Resolution" start={t.createdAt} due={t.resolveDue} completedAt={t.solvedAt} />
|
|
118
118
|
* ```
|
|
119
119
|
*/
|
|
120
|
-
export const SlaTimer = React.forwardRef(function SlaTimer({ due, start, completedAt, pausedAt, now: fixedNow, warnAt, warnMinutes, variant = "badge", label, seconds = true, hideIcon, labels, className, ...props }, ref) {
|
|
120
|
+
export const SlaTimer = /*#__PURE__*/ React.forwardRef(function SlaTimer({ due, start, completedAt, pausedAt, now: fixedNow, warnAt, warnMinutes, variant = "badge", label, seconds = true, hideIcon, labels, className, ...props }, ref) {
|
|
121
121
|
const t = useLabels("slaTimer", slaTimerLabels, labels);
|
|
122
122
|
const f = useFormat();
|
|
123
123
|
const frozen = completedAt != null || pausedAt != null;
|