tembro 3.1.15 → 3.1.17
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/CHANGELOG.md +18 -0
- package/dist/components/calendar/date-picker.d.ts +2 -1
- package/dist/components/display/statistic.d.ts +4 -2
- package/dist/components/modern/calendar-scheduler.d.ts +24 -1
- package/dist/components/modern/resizable-panel.d.ts +1 -1
- package/dist/components/patterns/form-builder.d.ts +9 -4
- package/dist/components/ui/button/index.d.ts +2 -1
- package/dist/showcase/package-meta.d.ts +2 -2
- package/dist/src/components/calendar/date-picker.cjs +1 -1
- package/dist/src/components/calendar/date-picker.js +24 -22
- package/dist/src/components/display/statistic.cjs +1 -1
- package/dist/src/components/display/statistic.js +27 -23
- package/dist/src/components/display/status-legend.cjs +1 -1
- package/dist/src/components/display/status-legend.js +4 -4
- package/dist/src/components/modern/calendar-scheduler.cjs +1 -1
- package/dist/src/components/modern/calendar-scheduler.js +125 -59
- package/dist/src/components/modern/resizable-panel.cjs +1 -1
- package/dist/src/components/modern/resizable-panel.js +4 -4
- package/dist/src/components/patterns/detail-layout.cjs +1 -1
- package/dist/src/components/patterns/detail-layout.js +1 -1
- package/dist/src/components/patterns/form-builder.cjs +1 -1
- package/dist/src/components/patterns/form-builder.js +6 -6
- package/dist/src/components/patterns/resource-detail-page.cjs +1 -1
- package/dist/src/components/patterns/resource-detail-page.js +1 -1
- package/dist/src/components/patterns/resource-page.cjs +1 -1
- package/dist/src/components/patterns/resource-page.js +1 -1
- package/dist/src/components/ui/button/index.cjs +1 -1
- package/dist/src/components/ui/button/index.js +10 -9
- package/dist/src/components/ui/card/index.cjs +1 -1
- package/dist/src/components/ui/card/index.js +1 -0
- package/dist/src/showcase/package-meta.cjs +1 -1
- package/dist/src/showcase/package-meta.js +1 -1
- package/dist/src/showcase/premium/calendar-scheduler/mock.cjs +8 -4
- package/dist/src/showcase/premium/calendar-scheduler/mock.js +4 -4
- package/dist/src/showcase/premium/calendar-scheduler/showcase.cjs +1 -1
- package/dist/src/showcase/premium/calendar-scheduler/showcase.js +29 -5
- package/dist/src/showcase/registry-specific.cjs +1 -1
- package/dist/src/showcase/registry-specific.js +281 -233
- package/dist/src/showcase/site-data.cjs +1 -1
- package/dist/src/showcase/site-data.js +1 -1
- package/dist/src/showcase/tembro-registry.json.cjs +1 -1
- package/dist/src/showcase/tembro-registry.json.js +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +1 -1
- package/packages/cli/vendor/src/components/calendar/date-picker.tsx +11 -7
- package/packages/cli/vendor/src/components/display/statistic.tsx +20 -15
- package/packages/cli/vendor/src/components/display/status-legend.tsx +4 -4
- package/packages/cli/vendor/src/components/modern/calendar-scheduler.tsx +108 -48
- package/packages/cli/vendor/src/components/modern/resizable-panel.tsx +1 -1
- package/packages/cli/vendor/src/components/patterns/detail-layout.tsx +1 -1
- package/packages/cli/vendor/src/components/patterns/form-builder.tsx +30 -30
- package/packages/cli/vendor/src/components/patterns/resource-detail-page.tsx +1 -1
- package/packages/cli/vendor/src/components/patterns/resource-page.tsx +1 -1
- package/packages/cli/vendor/src/components/ui/button/index.tsx +3 -1
- package/packages/cli/vendor/src/components/ui/card/index.tsx +1 -0
- package/packages/cli/vendor/src/showcase/package-meta.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/calendar-scheduler/mock.ts +10 -7
- package/packages/cli/vendor/src/showcase/premium/calendar-scheduler/showcase.tsx +7 -5
- package/packages/cli/vendor/src/showcase/registry-specific.tsx +11 -1
- package/packages/cli/vendor/src/showcase/tembro-registry.json +1 -1
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/HeroSection.tsx +2 -2
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/WorkbenchSidebar.tsx +1 -1
- package/packages/cli/vendor/templates/styles/globals.css +60 -40
- package/registry.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 3.1.17 - 2026-07-16
|
|
6
|
+
|
|
7
|
+
- Added production-ready `agenda` and `board` variants, density controls, rich event metadata, selection state, hidden/disabled events, custom rendering, and formatted day labels to `CalendarScheduler`.
|
|
8
|
+
- Added a compact trigger variant to `DatePicker` for dense filters, headers, and scheduling toolbars.
|
|
9
|
+
- Added compact density to `StatisticCard` and configurable gaps to `StatisticGrid`.
|
|
10
|
+
- Added `labelClassName` and a stable inline-flex label layout to `Button`, fixing complex icon/value/action labels that previously stacked vertically.
|
|
11
|
+
- Updated the CalendarScheduler showcase and regression coverage for the expanded API.
|
|
12
|
+
|
|
13
|
+
## 3.1.16 - 2026-07-16
|
|
14
|
+
|
|
15
|
+
- Fixed composed Card surfaces so `StatisticCard`, `InfoCard`, `ActivityFeed`, and other Card-based components retain base border, background, radius, and variant styling.
|
|
16
|
+
- Added compatibility aliases for legacy theme tokens used by installed components.
|
|
17
|
+
- Fixed `StatusLegend` surfaces and item borders in light and dark themes.
|
|
18
|
+
- Reduced default Card elevation and strengthened the light-theme border for dense application layouts.
|
|
19
|
+
- Fixed `FormBuilder` field preset typing so discriminated input and select props remain usable in strongly typed React Hook Form schemas.
|
|
20
|
+
- Prevented `ResizablePanel` sizing props from leaking to DOM elements.
|
|
21
|
+
- Made `ResourcePage`, `ResourceDetailPage`, and `DetailLayout` reserve an aside column only when aside content exists.
|
|
22
|
+
|
|
5
23
|
## 3.1.15 - 2026-07-16
|
|
6
24
|
|
|
7
25
|
- Fixed `NotificationCenter` to use solid, fallback-safe popover surfaces when host apps do not define optional `--aui-*` theme tokens.
|
|
@@ -9,9 +9,10 @@ export type DatePickerProps = Omit<CalendarProps, "mode" | "range" | "onRangeCha
|
|
|
9
9
|
labels?: DatePickerLabels;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
clearable?: boolean;
|
|
12
|
+
triggerVariant?: "default" | "compact";
|
|
12
13
|
formatValue?: (value: string) => React.ReactNode;
|
|
13
14
|
triggerClassName?: string;
|
|
14
15
|
contentClassName?: string;
|
|
15
16
|
};
|
|
16
|
-
declare function DatePicker({ value, onValueChange, placeholder, labels, disabled, clearable, formatValue, triggerClassName, contentClassName, className, ...calendarProps }: DatePickerProps): React.JSX.Element;
|
|
17
|
+
declare function DatePicker({ value, onValueChange, placeholder, labels, disabled, clearable, triggerVariant, formatValue, triggerClassName, contentClassName, className, ...calendarProps }: DatePickerProps): React.JSX.Element;
|
|
17
18
|
export { DatePicker };
|
|
@@ -14,10 +14,12 @@ export type StatisticProps = React.ComponentProps<"div"> & {
|
|
|
14
14
|
declare function Statistic({ label, value, prefix, suffix, description, trend, change, loading, className, ...props }: StatisticProps): React.JSX.Element;
|
|
15
15
|
export type StatisticCardProps = React.ComponentProps<typeof Card> & StatisticProps & {
|
|
16
16
|
action?: React.ReactNode;
|
|
17
|
+
density?: "compact" | "default";
|
|
17
18
|
};
|
|
18
|
-
declare function StatisticCard({ action, label, value, prefix, suffix, description, trend, change, loading, className, ...props }: StatisticCardProps): React.JSX.Element;
|
|
19
|
+
declare function StatisticCard({ action, density, label, value, prefix, suffix, description, trend, change, loading, className, ...props }: StatisticCardProps): React.JSX.Element;
|
|
19
20
|
export type StatisticGridProps = React.ComponentProps<"div"> & {
|
|
20
21
|
columns?: 1 | 2 | 3 | 4;
|
|
22
|
+
gap?: "sm" | "default" | "lg";
|
|
21
23
|
};
|
|
22
|
-
declare function StatisticGrid({ columns, className, ...props }: StatisticGridProps): React.JSX.Element;
|
|
24
|
+
declare function StatisticGrid({ columns, gap, className, ...props }: StatisticGridProps): React.JSX.Element;
|
|
23
25
|
export { Statistic, StatisticCard, StatisticGrid };
|
|
@@ -6,14 +6,37 @@ export type CalendarSchedulerEvent = {
|
|
|
6
6
|
time?: string;
|
|
7
7
|
tone?: "default" | "success" | "warning" | "danger";
|
|
8
8
|
durationMinutes?: number;
|
|
9
|
+
description?: React.ReactNode;
|
|
10
|
+
meta?: React.ReactNode;
|
|
11
|
+
badge?: React.ReactNode;
|
|
12
|
+
icon?: React.ReactNode;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
className?: string;
|
|
9
16
|
};
|
|
10
17
|
export type CalendarSchedulerProps = React.ComponentProps<"div"> & {
|
|
11
18
|
events: CalendarSchedulerEvent[];
|
|
12
19
|
days?: string[];
|
|
13
20
|
view?: "day" | "week" | "month";
|
|
21
|
+
variant?: "board" | "agenda";
|
|
22
|
+
density?: "compact" | "default" | "comfortable";
|
|
23
|
+
title?: React.ReactNode;
|
|
24
|
+
description?: React.ReactNode;
|
|
25
|
+
actions?: React.ReactNode;
|
|
14
26
|
empty?: React.ReactNode;
|
|
27
|
+
selectedEventId?: string;
|
|
28
|
+
defaultSelectedEventId?: string;
|
|
29
|
+
onSelectedEventChange?: (eventId: string, event: CalendarSchedulerEvent) => void;
|
|
15
30
|
onCreateEvent?: (date: string) => void;
|
|
16
31
|
onEventClick?: (event: CalendarSchedulerEvent) => void;
|
|
32
|
+
renderEvent?: (event: CalendarSchedulerEvent, state: {
|
|
33
|
+
selected: boolean;
|
|
34
|
+
}) => React.ReactNode;
|
|
35
|
+
createLabel?: React.ReactNode;
|
|
36
|
+
showCount?: boolean;
|
|
37
|
+
dayClassName?: string;
|
|
38
|
+
eventClassName?: string;
|
|
39
|
+
formatDay?: (day: string) => React.ReactNode;
|
|
17
40
|
};
|
|
18
|
-
declare function CalendarScheduler({ events, days, view, empty, onCreateEvent, onEventClick, className, ...props }: CalendarSchedulerProps): React.JSX.Element;
|
|
41
|
+
declare function CalendarScheduler({ events, days, view, variant, density, title, description, actions, empty, selectedEventId, defaultSelectedEventId, onSelectedEventChange, onCreateEvent, onEventClick, renderEvent, createLabel, showCount, dayClassName, eventClassName, formatDay, className, ...props }: CalendarSchedulerProps): React.JSX.Element;
|
|
19
42
|
export { CalendarScheduler };
|
|
@@ -13,6 +13,6 @@ type ResizableHandleProps = React.ComponentProps<"button"> & {
|
|
|
13
13
|
"data-handle-index"?: number;
|
|
14
14
|
};
|
|
15
15
|
declare function ResizablePanelGroup({ direction, className, children, ...props }: ResizablePanelGroupProps): React.JSX.Element;
|
|
16
|
-
declare function ResizablePanel({ className, style, defaultSize, ...props }: ResizablePanelInternalProps): React.JSX.Element;
|
|
16
|
+
declare function ResizablePanel({ className, style, defaultSize, minSize: _minSize, ...props }: ResizablePanelInternalProps): React.JSX.Element;
|
|
17
17
|
declare function ResizableHandle({ className, ...props }: ResizableHandleProps): React.JSX.Element;
|
|
18
18
|
export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
|
|
@@ -7,6 +7,7 @@ import { type FormSwitchProps } from "@/components/form/form-switch";
|
|
|
7
7
|
import { type FormDateRangeInputProps } from "@/components/form/form-date-range-input";
|
|
8
8
|
export type FormBuilderLayout = "grid" | "stack";
|
|
9
9
|
export type FormBuilderDensity = "compact" | "default" | "comfortable";
|
|
10
|
+
type DistributiveOmit<T, TKey extends PropertyKey> = T extends unknown ? Omit<T, TKey> : never;
|
|
10
11
|
export type FormBuilderFieldRenderContext<TFieldValues extends FieldValues> = {
|
|
11
12
|
control: Control<TFieldValues>;
|
|
12
13
|
disabled?: boolean;
|
|
@@ -24,7 +25,7 @@ export type FormBuilderCustomField<TFieldValues extends FieldValues> = BaseFormB
|
|
|
24
25
|
};
|
|
25
26
|
export type FormBuilderInputField<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = BaseFormBuilderField & {
|
|
26
27
|
type: "input";
|
|
27
|
-
props:
|
|
28
|
+
props: DistributiveOmit<FormInputProps<TFieldValues, TName>, "control">;
|
|
28
29
|
};
|
|
29
30
|
export type FormBuilderTextareaField<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = BaseFormBuilderField & {
|
|
30
31
|
type: "textarea";
|
|
@@ -32,7 +33,7 @@ export type FormBuilderTextareaField<TFieldValues extends FieldValues, TName ext
|
|
|
32
33
|
};
|
|
33
34
|
export type FormBuilderSelectField<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = BaseFormBuilderField & {
|
|
34
35
|
type: "select";
|
|
35
|
-
props:
|
|
36
|
+
props: DistributiveOmit<FormSelectProps<TFieldValues, TName>, "control">;
|
|
36
37
|
};
|
|
37
38
|
export type FormBuilderAsyncSelectField<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = BaseFormBuilderField & {
|
|
38
39
|
type: "async-select";
|
|
@@ -58,7 +59,11 @@ export type FormBuilderDateRangeField<TFieldValues extends FieldValues, TFromNam
|
|
|
58
59
|
type: "date-range";
|
|
59
60
|
props: Omit<FormDateRangeInputProps<TFieldValues, TFromName, TToName>, "control">;
|
|
60
61
|
};
|
|
61
|
-
|
|
62
|
+
type FormBuilderStoredField = BaseFormBuilderField & {
|
|
63
|
+
type: "input" | "textarea" | "select" | "async-select" | "switch" | "number" | "phone" | "date" | "date-range";
|
|
64
|
+
props: object;
|
|
65
|
+
};
|
|
66
|
+
export type FormBuilderField<TFieldValues extends FieldValues> = FormBuilderCustomField<TFieldValues> | FormBuilderStoredField;
|
|
62
67
|
export type FormBuilderSection<TFieldValues extends FieldValues> = {
|
|
63
68
|
id: string;
|
|
64
69
|
title?: React.ReactNode;
|
|
@@ -100,6 +105,6 @@ declare function dateField<TFieldValues extends FieldValues, TName extends Field
|
|
|
100
105
|
declare function dateRangeField<TFieldValues extends FieldValues, TFromName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TToName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(options: FieldPresetOptions<FormBuilderDateRangeField<TFieldValues, TFromName, TToName>["props"]>): FormBuilderDateRangeField<TFieldValues, TFromName, TToName>;
|
|
101
106
|
declare function customField<TFieldValues extends FieldValues>(options: BaseFormBuilderField & Pick<FormBuilderCustomField<TFieldValues>, "render">): FormBuilderCustomField<TFieldValues>;
|
|
102
107
|
declare function formSection<TFieldValues extends FieldValues>(section: FormBuilderSection<TFieldValues>): FormBuilderSection<TFieldValues>;
|
|
103
|
-
declare function renderFormBuilderField<TFieldValues extends FieldValues>(field: FormBuilderField<TFieldValues>, context: FormBuilderFieldRenderContext<TFieldValues>):
|
|
108
|
+
declare function renderFormBuilderField<TFieldValues extends FieldValues>(field: FormBuilderField<TFieldValues>, context: FormBuilderFieldRenderContext<TFieldValues>): React.ReactNode;
|
|
104
109
|
declare function FormBuilder<TFieldValues extends FieldValues>({ className, control, fields, sections, layout, density, columns, disabled, readOnly, footer, submitLabel, resetLabel, onResetClick, isSubmitting, sectionClassName, fieldClassName, footerClassName, ...props }: FormBuilderProps<TFieldValues>): React.JSX.Element;
|
|
105
110
|
export { FormBuilder, asyncSelectField, customField, dateField, dateRangeField, formSection, inputField, numberField, phoneField, renderFormBuilderField, selectField, switchField, textareaField, };
|
|
@@ -13,6 +13,7 @@ export type ButtonProps = ButtonPrimitive.Props & VariantProps<typeof buttonVari
|
|
|
13
13
|
iconOnly?: boolean;
|
|
14
14
|
fullWidth?: boolean;
|
|
15
15
|
pressed?: boolean;
|
|
16
|
+
labelClassName?: string;
|
|
16
17
|
};
|
|
17
|
-
declare function Button({ className, variant, size, disabled, loading, loadingLabel, leftIcon, rightIcon, iconOnly, fullWidth, pressed, children, "aria-label": ariaLabel, ...props }: ButtonProps): React.JSX.Element;
|
|
18
|
+
declare function Button({ className, variant, size, disabled, loading, loadingLabel, leftIcon, rightIcon, iconOnly, fullWidth, pressed, labelClassName, children, "aria-label": ariaLabel, ...props }: ButtonProps): React.JSX.Element;
|
|
18
19
|
export { Button, buttonVariants };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const PACKAGE_LATEST_VERSION = "3.1.
|
|
1
|
+
export declare const PACKAGE_LATEST_VERSION = "3.1.17";
|
|
2
2
|
export declare const PACKAGE_LATEST_RELEASE_DATE = "July 15, 2026";
|
|
3
|
-
export declare const PACKAGE_DEPENDENCY_RANGE = "3.1.
|
|
3
|
+
export declare const PACKAGE_DEPENDENCY_RANGE = "3.1.17";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("../ui/popover/index.cjs"),i=require("./date-utils.cjs"),a=require("./calendar.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("lucide-react"),c=require("react/jsx-runtime");function l(e){let t=i.parseDateKey(e);return t?new Intl.DateTimeFormat(`en-US`,{dateStyle:`medium`}).format(t):e}function u({value:e,onValueChange:i,placeholder:u,labels:d,disabled:f=!1,clearable:p=!0,formatValue:
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("../ui/popover/index.cjs"),i=require("./date-utils.cjs"),a=require("./calendar.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("lucide-react"),c=require("react/jsx-runtime");function l(e){let t=i.parseDateKey(e);return t?new Intl.DateTimeFormat(`en-US`,{dateStyle:`medium`}).format(t):e}function u({value:e,onValueChange:i,placeholder:u,labels:d,disabled:f=!1,clearable:p=!0,triggerVariant:m=`default`,formatValue:h=l,triggerClassName:g,contentClassName:_,className:v,...y}){let[b,x]=o.useState(!1),S=!!e,C=e=>{i?.(e),x(!1)},w=()=>{i?.(``),x(!1)};return(0,c.jsx)(`div`,{"data-slot":`date-picker`,"data-trigger-variant":m,className:t.cn(`w-full`,v),children:(0,c.jsxs)(r.Popover,{open:b,onOpenChange:x,children:[(0,c.jsxs)(r.PopoverTrigger,{render:(0,c.jsx)(n.Button,{type:`button`,variant:`outline`,disabled:f,labelClassName:`flex-1`,className:t.cn(`group w-full justify-start rounded-[var(--aui-control-radius,var(--radius-md))] border-border/80 bg-background/96 text-left font-normal shadow-[var(--aui-control-shadow,0_1px_2px_rgba(15,23,42,0.04))]`,m==="default"?`min-h-11 gap-3 px-3`:`min-h-9 gap-2 px-2.5`,!S&&`text-muted-foreground`,g)}),children:[(0,c.jsx)(s.CalendarIcon,{"data-icon":`inline-start`,className:t.cn(S&&`text-primary`)}),(0,c.jsxs)(`span`,{className:t.cn(`grid min-w-0 flex-1`,m==="default"&&`gap-0.5`),children:[m==="default"?(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-[0.16em] text-muted-foreground`,children:d?.selected??`Date`}):null,(0,c.jsx)(`span`,{className:t.cn(`truncate text-sm`,S&&`font-semibold text-foreground`),children:S?h(String(e)):u??d?.placeholder??`Select date`})]}),p&&S?(0,c.jsx)(`span`,{role:`button`,tabIndex:0,"aria-label":d?.clear??`Clear date`,className:t.cn(`ml-auto inline-flex shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground opacity-80 transition hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,m==="default"?`size-7`:`size-6`),onClick:e=>{e.preventDefault(),e.stopPropagation(),w()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),w())},children:(0,c.jsx)(s.XIcon,{className:`size-3.5`})}):null]}),(0,c.jsx)(r.PopoverContent,{align:`start`,className:t.cn(`w-auto overflow-hidden rounded-[var(--aui-card-radius,var(--radius-lg))] border-border/70 bg-popover p-0 shadow-[var(--aui-control-panel-shadow,0_18px_40px_rgba(15,23,42,0.14))] backdrop-blur`,_),children:(0,c.jsx)(a.Calendar,{value:e,onValueChange:C,labels:d,showTodayShortcut:!0,showClearShortcut:p,showSelectionSummary:!0,...y})})]})})}exports.DatePicker=u;
|
|
@@ -12,65 +12,67 @@ function f(e) {
|
|
|
12
12
|
let t = a(e);
|
|
13
13
|
return t ? new Intl.DateTimeFormat("en-US", { dateStyle: "medium" }).format(t) : e;
|
|
14
14
|
}
|
|
15
|
-
function p({ value: a, onValueChange: p, placeholder: m, labels: h, disabled: g = !1, clearable: _ = !0,
|
|
16
|
-
let [
|
|
17
|
-
p?.(e),
|
|
18
|
-
},
|
|
19
|
-
p?.(""),
|
|
15
|
+
function p({ value: a, onValueChange: p, placeholder: m, labels: h, disabled: g = !1, clearable: _ = !0, triggerVariant: v = "default", formatValue: y = f, triggerClassName: b, contentClassName: x, className: S, ...C }) {
|
|
16
|
+
let [w, T] = s.useState(!1), E = !!a, D = (e) => {
|
|
17
|
+
p?.(e), T(!1);
|
|
18
|
+
}, O = () => {
|
|
19
|
+
p?.(""), T(!1);
|
|
20
20
|
};
|
|
21
21
|
return /* @__PURE__ */ u("div", {
|
|
22
22
|
"data-slot": "date-picker",
|
|
23
|
-
|
|
23
|
+
"data-trigger-variant": v,
|
|
24
|
+
className: e("w-full", S),
|
|
24
25
|
children: /* @__PURE__ */ d(n, {
|
|
25
|
-
open:
|
|
26
|
-
onOpenChange:
|
|
26
|
+
open: w,
|
|
27
|
+
onOpenChange: T,
|
|
27
28
|
children: [/* @__PURE__ */ d(i, {
|
|
28
29
|
render: /* @__PURE__ */ u(t, {
|
|
29
30
|
type: "button",
|
|
30
31
|
variant: "outline",
|
|
31
32
|
disabled: g,
|
|
32
|
-
|
|
33
|
+
labelClassName: "flex-1",
|
|
34
|
+
className: e("group w-full justify-start rounded-[var(--aui-control-radius,var(--radius-md))] border-border/80 bg-background/96 text-left font-normal shadow-[var(--aui-control-shadow,0_1px_2px_rgba(15,23,42,0.04))]", v === "default" ? "min-h-11 gap-3 px-3" : "min-h-9 gap-2 px-2.5", !E && "text-muted-foreground", b)
|
|
33
35
|
}),
|
|
34
36
|
children: [
|
|
35
37
|
/* @__PURE__ */ u(c, {
|
|
36
38
|
"data-icon": "inline-start",
|
|
37
|
-
className: e(
|
|
39
|
+
className: e(E && "text-primary")
|
|
38
40
|
}),
|
|
39
41
|
/* @__PURE__ */ d("span", {
|
|
40
|
-
className: "grid min-w-0 flex-1 gap-0.5",
|
|
41
|
-
children: [/* @__PURE__ */ u("span", {
|
|
42
|
+
className: e("grid min-w-0 flex-1", v === "default" && "gap-0.5"),
|
|
43
|
+
children: [v === "default" ? /* @__PURE__ */ u("span", {
|
|
42
44
|
className: "text-[11px] font-semibold uppercase tracking-[0.16em] text-muted-foreground",
|
|
43
45
|
children: h?.selected ?? "Date"
|
|
44
|
-
}), /* @__PURE__ */ u("span", {
|
|
45
|
-
className: e("truncate text-sm",
|
|
46
|
-
children:
|
|
46
|
+
}) : null, /* @__PURE__ */ u("span", {
|
|
47
|
+
className: e("truncate text-sm", E && "font-semibold text-foreground"),
|
|
48
|
+
children: E ? y(String(a)) : m ?? h?.placeholder ?? "Select date"
|
|
47
49
|
})]
|
|
48
50
|
}),
|
|
49
|
-
_ &&
|
|
51
|
+
_ && E ? /* @__PURE__ */ u("span", {
|
|
50
52
|
role: "button",
|
|
51
53
|
tabIndex: 0,
|
|
52
54
|
"aria-label": h?.clear ?? "Clear date",
|
|
53
|
-
className: "ml-auto inline-flex
|
|
55
|
+
className: e("ml-auto inline-flex shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground opacity-80 transition hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring", v === "default" ? "size-7" : "size-6"),
|
|
54
56
|
onClick: (e) => {
|
|
55
|
-
e.preventDefault(), e.stopPropagation(),
|
|
57
|
+
e.preventDefault(), e.stopPropagation(), O();
|
|
56
58
|
},
|
|
57
59
|
onKeyDown: (e) => {
|
|
58
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
60
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), O());
|
|
59
61
|
},
|
|
60
62
|
children: /* @__PURE__ */ u(l, { className: "size-3.5" })
|
|
61
63
|
}) : null
|
|
62
64
|
]
|
|
63
65
|
}), /* @__PURE__ */ u(r, {
|
|
64
66
|
align: "start",
|
|
65
|
-
className: e("w-auto overflow-hidden rounded-[var(--aui-card-radius,var(--radius-lg))] border-border/70 bg-popover p-0 shadow-[var(--aui-control-panel-shadow,0_18px_40px_rgba(15,23,42,0.14))] backdrop-blur",
|
|
67
|
+
className: e("w-auto overflow-hidden rounded-[var(--aui-card-radius,var(--radius-lg))] border-border/70 bg-popover p-0 shadow-[var(--aui-control-panel-shadow,0_18px_40px_rgba(15,23,42,0.14))] backdrop-blur", x),
|
|
66
68
|
children: /* @__PURE__ */ u(o, {
|
|
67
69
|
value: a,
|
|
68
|
-
onValueChange:
|
|
70
|
+
onValueChange: D,
|
|
69
71
|
labels: h,
|
|
70
72
|
showTodayShortcut: !0,
|
|
71
73
|
showClearShortcut: _,
|
|
72
74
|
showSelectionSummary: !0,
|
|
73
|
-
...
|
|
75
|
+
...C
|
|
74
76
|
})
|
|
75
77
|
})]
|
|
76
78
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime");function o({label:e,value:n,prefix:r,suffix:o,description:s,trend:c=`neutral`,change:l,loading:u=!1,className:d,...f}){let p=c===`up`?(0,a.jsx)(i.ArrowUpIcon,{className:`size-3`}):c===`down`?(0,a.jsx)(i.ArrowDownIcon,{className:`size-3`}):null;return(0,a.jsxs)(`div`,{"data-slot":`statistic`,"data-loading":u||void 0,"data-trend":c,"aria-busy":u||void 0,className:t.cn(`grid gap-1`,d),...f,children:[(0,a.jsx)(`div`,{"data-slot":`statistic-label`,className:`text-sm text-muted-foreground`,children:e}),(0,a.jsx)(`div`,{"data-slot":`statistic-value-row`,className:`flex flex-wrap items-baseline gap-1.5`,children:u?(0,a.jsx)(`div`,{"data-slot":`statistic-skeleton`,className:`h-8 w-28 animate-pulse rounded-md bg-muted`}):(0,a.jsxs)(a.Fragment,{children:[r&&(0,a.jsx)(`span`,{"data-slot":`statistic-prefix`,className:`text-base text-muted-foreground`,children:r}),(0,a.jsx)(`span`,{"data-slot":`statistic-value`,className:`text-2xl font-semibold tracking-tight`,children:n}),o&&(0,a.jsx)(`span`,{"data-slot":`statistic-suffix`,className:`text-sm text-muted-foreground`,children:o})]})}),(s||l)&&(0,a.jsxs)(`div`,{"data-slot":`statistic-meta`,className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[l&&(0,a.jsxs)(`span`,{"data-slot":`statistic-change`,"data-trend":c,className:t.cn(`inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 font-medium`,c===`up`&&`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400`,c===`down`&&`bg-destructive/10 text-destructive`,c===`neutral`&&`bg-muted text-muted-foreground`),children:[p,l]}),s&&(0,a.jsx)(`span`,{"data-slot":`statistic-description`,children:s})]})]})}function s({action:e,label:
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime");function o({label:e,value:n,prefix:r,suffix:o,description:s,trend:c=`neutral`,change:l,loading:u=!1,className:d,...f}){let p=c===`up`?(0,a.jsx)(i.ArrowUpIcon,{className:`size-3`}):c===`down`?(0,a.jsx)(i.ArrowDownIcon,{className:`size-3`}):null;return(0,a.jsxs)(`div`,{"data-slot":`statistic`,"data-loading":u||void 0,"data-trend":c,"aria-busy":u||void 0,className:t.cn(`grid gap-1`,d),...f,children:[(0,a.jsx)(`div`,{"data-slot":`statistic-label`,className:`text-sm text-muted-foreground`,children:e}),(0,a.jsx)(`div`,{"data-slot":`statistic-value-row`,className:`flex flex-wrap items-baseline gap-1.5`,children:u?(0,a.jsx)(`div`,{"data-slot":`statistic-skeleton`,className:`h-8 w-28 animate-pulse rounded-md bg-muted`}):(0,a.jsxs)(a.Fragment,{children:[r&&(0,a.jsx)(`span`,{"data-slot":`statistic-prefix`,className:`text-base text-muted-foreground`,children:r}),(0,a.jsx)(`span`,{"data-slot":`statistic-value`,className:`text-2xl font-semibold tracking-tight`,children:n}),o&&(0,a.jsx)(`span`,{"data-slot":`statistic-suffix`,className:`text-sm text-muted-foreground`,children:o})]})}),(s||l)&&(0,a.jsxs)(`div`,{"data-slot":`statistic-meta`,className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[l&&(0,a.jsxs)(`span`,{"data-slot":`statistic-change`,"data-trend":c,className:t.cn(`inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 font-medium`,c===`up`&&`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400`,c===`down`&&`bg-destructive/10 text-destructive`,c===`neutral`&&`bg-muted text-muted-foreground`),children:[p,l]}),s&&(0,a.jsx)(`span`,{"data-slot":`statistic-description`,children:s})]})]})}function s({action:e,density:r=`default`,label:i,value:s,prefix:c,suffix:l,description:u,trend:d,change:f,loading:p,className:m,...h}){return(0,a.jsxs)(n.Card,{"data-slot":`statistic-card`,"data-density":r,className:m,...h,children:[(0,a.jsxs)(n.CardHeader,{"data-slot":`statistic-card-header`,className:t.cn(`flex flex-row items-center justify-between gap-3 pb-2`,r===`compact`&&`px-4 pt-4 pb-1`),children:[(0,a.jsx)(n.CardTitle,{className:`text-sm font-medium text-muted-foreground`,children:i}),e?(0,a.jsx)(`div`,{"data-slot":`statistic-card-action`,children:e}):null]}),(0,a.jsx)(n.CardContent,{className:t.cn(r===`compact`&&`px-4 pb-4`),children:(0,a.jsx)(o,{label:(0,a.jsx)(`span`,{className:`sr-only`,children:i}),value:s,prefix:c,suffix:l,description:u,trend:d,change:f,loading:p})})]})}function c({columns:e=4,gap:n=`default`,className:r,...i}){return(0,a.jsx)(`div`,{"data-slot":`statistic-grid`,className:t.cn(`grid`,n===`sm`&&`gap-3`,n==="default"&&`gap-4`,n===`lg`&&`gap-6`,e===1&&`grid-cols-1`,e===2&&`grid-cols-1 sm:grid-cols-2`,e===3&&`grid-cols-1 sm:grid-cols-2 xl:grid-cols-3`,e===4&&`grid-cols-1 sm:grid-cols-2 xl:grid-cols-4`,r),...i})}exports.Statistic=o,exports.StatisticCard=s,exports.StatisticGrid=c;
|
|
@@ -59,41 +59,45 @@ function u({ label: t, value: n, prefix: r, suffix: i, description: u, trend: d
|
|
|
59
59
|
]
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
function d({ action:
|
|
62
|
+
function d({ action: a, density: o = "default", label: s, value: d, prefix: f, suffix: p, description: m, trend: h, change: g, loading: _, className: v, ...y }) {
|
|
63
63
|
return /* @__PURE__ */ l(t, {
|
|
64
64
|
"data-slot": "statistic-card",
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
"data-density": o,
|
|
66
|
+
className: v,
|
|
67
|
+
...y,
|
|
67
68
|
children: [/* @__PURE__ */ l(r, {
|
|
68
69
|
"data-slot": "statistic-card-header",
|
|
69
|
-
className: "flex flex-row items-center justify-between gap-3 pb-2",
|
|
70
|
+
className: e("flex flex-row items-center justify-between gap-3 pb-2", o === "compact" && "px-4 pt-4 pb-1"),
|
|
70
71
|
children: [/* @__PURE__ */ c(i, {
|
|
71
72
|
className: "text-sm font-medium text-muted-foreground",
|
|
72
|
-
children:
|
|
73
|
-
}),
|
|
73
|
+
children: s
|
|
74
|
+
}), a ? /* @__PURE__ */ c("div", {
|
|
74
75
|
"data-slot": "statistic-card-action",
|
|
75
|
-
children: e
|
|
76
|
-
}) : null]
|
|
77
|
-
}), /* @__PURE__ */ c(n, { children: /* @__PURE__ */ c(u, {
|
|
78
|
-
label: /* @__PURE__ */ c("span", {
|
|
79
|
-
className: "sr-only",
|
|
80
76
|
children: a
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
77
|
+
}) : null]
|
|
78
|
+
}), /* @__PURE__ */ c(n, {
|
|
79
|
+
className: e(o === "compact" && "px-4 pb-4"),
|
|
80
|
+
children: /* @__PURE__ */ c(u, {
|
|
81
|
+
label: /* @__PURE__ */ c("span", {
|
|
82
|
+
className: "sr-only",
|
|
83
|
+
children: s
|
|
84
|
+
}),
|
|
85
|
+
value: d,
|
|
86
|
+
prefix: f,
|
|
87
|
+
suffix: p,
|
|
88
|
+
description: m,
|
|
89
|
+
trend: h,
|
|
90
|
+
change: g,
|
|
91
|
+
loading: _
|
|
92
|
+
})
|
|
93
|
+
})]
|
|
90
94
|
});
|
|
91
95
|
}
|
|
92
|
-
function f({ columns: t = 4,
|
|
96
|
+
function f({ columns: t = 4, gap: n = "default", className: r, ...i }) {
|
|
93
97
|
return /* @__PURE__ */ c("div", {
|
|
94
98
|
"data-slot": "statistic-grid",
|
|
95
|
-
className: e("grid gap-4", t === 1 && "grid-cols-1", t === 2 && "grid-cols-1 sm:grid-cols-2", t === 3 && "grid-cols-1 sm:grid-cols-2 xl:grid-cols-3", t === 4 && "grid-cols-1 sm:grid-cols-2 xl:grid-cols-4",
|
|
96
|
-
...
|
|
99
|
+
className: e("grid", n === "sm" && "gap-3", n === "default" && "gap-4", n === "lg" && "gap-6", t === 1 && "grid-cols-1", t === 2 && "grid-cols-1 sm:grid-cols-2", t === 3 && "grid-cols-1 sm:grid-cols-2 xl:grid-cols-3", t === 4 && "grid-cols-1 sm:grid-cols-2 xl:grid-cols-4", r),
|
|
100
|
+
...i
|
|
97
101
|
});
|
|
98
102
|
}
|
|
99
103
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs"),r=require("../ui/badge/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o={default:`bg-primary`,success:`bg-emerald-500`,warning:`bg-amber-500`,danger:`bg-destructive`,info:`bg-blue-500`,muted:`bg-muted-foreground`};function s({title:e,description:i,actions:s,items:c,orientation:l=`vertical`,compact:u=!1,showCounts:d=!0,contentClassName:f,itemClassName:p,className:m,...h}){let g=c.filter(e=>!e.hidden),_=!!(e||i||s),v={vertical:`grid`,horizontal:`flex flex-wrap`,grid:`grid sm:grid-cols-2`};return(0,a.jsxs)(n.Card,{"data-slot":`status-legend`,className:t.cn(`min-w-0 border-[color:var(--aui-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs"),r=require("../ui/badge/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o={default:`bg-primary`,success:`bg-emerald-500`,warning:`bg-amber-500`,danger:`bg-destructive`,info:`bg-blue-500`,muted:`bg-muted-foreground`};function s({title:e,description:i,actions:s,items:c,orientation:l=`vertical`,compact:u=!1,showCounts:d=!0,contentClassName:f,itemClassName:p,className:m,...h}){let g=c.filter(e=>!e.hidden),_=!!(e||i||s),v={vertical:`grid`,horizontal:`flex flex-wrap`,grid:`grid sm:grid-cols-2`};return(0,a.jsxs)(n.Card,{"data-slot":`status-legend`,className:t.cn(`min-w-0 border-[color:var(--aui-card-border,var(--border))] bg-card shadow-[var(--aui-card-shadow,var(--aui-shadow-xs))]`,m),...h,children:[_&&(0,a.jsx)(n.CardHeader,{className:t.cn(`pb-3`,u&&`p-4 pb-2`),children:(0,a.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,a.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[e&&(0,a.jsx)(n.CardTitle,{className:`text-base tracking-tight`,children:e}),i&&(0,a.jsx)(n.CardDescription,{className:`leading-6`,children:i})]}),s&&(0,a.jsx)(`div`,{className:`shrink-0`,children:s})]})}),(0,a.jsx)(n.CardContent,{className:t.cn(`gap-3`,v[l],u?`p-4 pt-2`:`pt-0`,f),children:g.map(e=>(0,a.jsxs)(`div`,{"data-slot":`status-legend-item`,"data-tone":e.tone??`default`,className:t.cn(`flex min-w-0 items-start justify-between gap-3 rounded-lg border border-[color:var(--aui-card-border,var(--border))] bg-[color:var(--aui-control-surface,var(--background))] p-3 transition hover:border-[color:var(--aui-control-hover-border,var(--ring))]`,u&&`p-2.5`,p,e.className),children:[(0,a.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[e.icon?(0,a.jsx)(`span`,{className:`mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-xl bg-[color:var(--aui-page-bg)] text-muted-foreground [&_svg]:size-4`,children:e.icon}):(0,a.jsx)(`span`,{className:t.cn(`mt-1.5 size-2.5 shrink-0 rounded-full ring-4 ring-background`,o[e.tone??`default`])}),(0,a.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,a.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.label}),e.description&&(0,a.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground`,children:e.description})]})]}),d&&e.count!==void 0&&(0,a.jsx)(r.Badge,{variant:`secondary`,className:`shrink-0 rounded-full border border-[color:var(--aui-card-border,var(--border))] bg-background px-2.5 py-1 shadow-sm`,children:e.count})]},e.key))})]})}exports.StatusLegend=s;
|
|
@@ -20,7 +20,7 @@ function u({ title: u, description: d, actions: f, items: p, orientation: m = "v
|
|
|
20
20
|
};
|
|
21
21
|
return /* @__PURE__ */ c(t, {
|
|
22
22
|
"data-slot": "status-legend",
|
|
23
|
-
className: e("min-w-0 border-[color:var(--aui-
|
|
23
|
+
className: e("min-w-0 border-[color:var(--aui-card-border,var(--border))] bg-card shadow-[var(--aui-card-shadow,var(--aui-shadow-xs))]", y),
|
|
24
24
|
...b,
|
|
25
25
|
children: [S && /* @__PURE__ */ s(i, {
|
|
26
26
|
className: e("pb-3", h && "p-4 pb-2"),
|
|
@@ -45,13 +45,13 @@ function u({ title: u, description: d, actions: f, items: p, orientation: m = "v
|
|
|
45
45
|
children: x.map((t) => /* @__PURE__ */ c("div", {
|
|
46
46
|
"data-slot": "status-legend-item",
|
|
47
47
|
"data-tone": t.tone ?? "default",
|
|
48
|
-
className: e("flex min-w-0 items-start justify-between gap-3 rounded-
|
|
48
|
+
className: e("flex min-w-0 items-start justify-between gap-3 rounded-lg border border-[color:var(--aui-card-border,var(--border))] bg-[color:var(--aui-control-surface,var(--background))] p-3 transition hover:border-[color:var(--aui-control-hover-border,var(--ring))]", h && "p-2.5", v, t.className),
|
|
49
49
|
children: [/* @__PURE__ */ c("div", {
|
|
50
50
|
className: "flex min-w-0 items-start gap-2",
|
|
51
51
|
children: [t.icon ? /* @__PURE__ */ s("span", {
|
|
52
52
|
className: "mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-xl bg-[color:var(--aui-page-bg)] text-muted-foreground [&_svg]:size-4",
|
|
53
53
|
children: t.icon
|
|
54
|
-
}) : /* @__PURE__ */ s("span", { className: e("mt-1.5 size-2.5 shrink-0 rounded-full
|
|
54
|
+
}) : /* @__PURE__ */ s("span", { className: e("mt-1.5 size-2.5 shrink-0 rounded-full ring-4 ring-background", l[t.tone ?? "default"]) }), /* @__PURE__ */ c("div", {
|
|
55
55
|
className: "min-w-0 space-y-0.5",
|
|
56
56
|
children: [/* @__PURE__ */ s("div", {
|
|
57
57
|
className: "truncate text-sm font-medium text-foreground",
|
|
@@ -63,7 +63,7 @@ function u({ title: u, description: d, actions: f, items: p, orientation: m = "v
|
|
|
63
63
|
})]
|
|
64
64
|
}), g && t.count !== void 0 && /* @__PURE__ */ s(o, {
|
|
65
65
|
variant: "secondary",
|
|
66
|
-
className: "shrink-0 rounded-full border border-[color:var(--aui-
|
|
66
|
+
className: "shrink-0 rounded-full border border-[color:var(--aui-card-border,var(--border))] bg-background px-2.5 py-1 shadow-sm",
|
|
67
67
|
children: t.count
|
|
68
68
|
})]
|
|
69
69
|
}, t.key))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");var i={default:`border-border bg-muted`,success:`border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900 dark:bg-emerald-950 dark:text-emerald-300`,warning:`border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-300`,danger:`border-red-200 bg-red-50 text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-300`};function a({events:e,days:
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");var i={default:`border-border bg-muted`,success:`border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900 dark:bg-emerald-950 dark:text-emerald-300`,warning:`border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-300`,danger:`border-red-200 bg-red-50 text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-300`};function a({events:e,days:a,view:o=`week`,variant:s=`board`,density:c=`default`,title:l,description:u,actions:d,empty:f=`No events scheduled.`,selectedEventId:p,defaultSelectedEventId:m,onSelectedEventChange:h,onCreateEvent:g,onEventClick:_,renderEvent:v,createLabel:y=`Create event`,showCount:b=!0,dayClassName:x,eventClassName:S,formatDay:C,className:w,...T}){let[E,D]=n.useState(m),O=p??E,k=e.filter(e=>!e.hidden),A=a??Array.from(new Set(k.map(e=>e.date))),j=e=>{e.disabled||(p===void 0&&D(e.id),h?.(e.id,e),_?.(e))};return A.length===0?(0,r.jsx)(`div`,{"data-slot":`calendar-scheduler`,"data-view":o,"data-variant":s,"data-density":c,className:t.cn(`rounded-[var(--aui-card-radius,var(--radius-xl))] border border-[color:var(--aui-card-border,var(--border))] bg-card p-5 text-sm text-muted-foreground shadow-[var(--aui-card-shadow,var(--aui-control-shadow,none))]`,w),...T,children:(0,r.jsx)(`div`,{className:`flex min-h-32 items-center justify-center rounded-[var(--radius-lg)] border border-dashed border-[color:var(--aui-card-border,var(--border))] bg-muted/20 px-4 py-6 text-center`,children:(0,r.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,r.jsx)(`p`,{"data-empty":`true`,className:`text-sm font-medium text-foreground`,children:f}),g?(0,r.jsx)(`button`,{type:`button`,className:`rounded-md border border-dashed px-3 py-2 text-sm text-muted-foreground hover:bg-muted/50`,onClick:()=>g(`today`),children:y}):null]})})}):(0,r.jsxs)(`div`,{"data-slot":`calendar-scheduler`,"data-view":o,"data-variant":s,"data-density":c,className:t.cn(`grid`,c===`compact`?`gap-2`:c===`comfortable`?`gap-5`:`gap-3`,o===`month`&&s===`board`&&`md:grid-cols-2 xl:grid-cols-3`,s===`agenda`&&`rounded-[var(--aui-card-radius,var(--radius-xl))] border border-[color:var(--aui-card-border,var(--border))] bg-card p-4 shadow-[var(--aui-card-shadow,var(--aui-control-shadow,none))]`,w),...T,children:[l||u||d?(0,r.jsxs)(`div`,{"data-slot":`calendar-scheduler-header`,className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,r.jsxs)(`div`,{className:`min-w-[min(100%,16rem)] flex-1 space-y-1`,children:[l?(0,r.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:l}):null,u?(0,r.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:u}):null]}),d?(0,r.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:d}):null]}):null,A.map(e=>{let n=k.filter(t=>t.date===e);return(0,r.jsxs)(`section`,{"data-slot":`calendar-scheduler-day`,className:t.cn(s===`board`&&`rounded-[var(--aui-card-radius,var(--radius-xl))] border border-[color:var(--aui-card-border,var(--border))] bg-card p-4 shadow-[var(--aui-card-shadow,var(--aui-control-shadow,none))]`,x),children:[(0,r.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,r.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:C?.(e)??e}),b?(0,r.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[n.length,` items`]}):null]}),(0,r.jsx)(`div`,{className:t.cn(`grid`,c===`compact`?`gap-1.5`:`gap-2`),children:n.length===0?(0,r.jsx)(`div`,{className:`rounded-[var(--radius-md)] border border-dashed border-[color:var(--aui-card-border,var(--border))] px-3 py-4 text-sm text-muted-foreground`,children:f}):n.map(e=>{let n=O===e.id;return(0,r.jsx)(`button`,{type:`button`,disabled:e.disabled,"data-slot":`calendar-scheduler-event`,"data-selected":n||void 0,className:t.cn(`border text-left text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50`,s===`board`?`rounded-[var(--radius-md)] px-3 py-2.5 shadow-sm`:`grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-3 rounded-[var(--radius-md)] bg-background px-3 py-3 hover:bg-muted/35 data-[selected=true]:border-primary/40 data-[selected=true]:bg-primary/5`,s===`board`&&i[e.tone??`default`],S,e.className),onClick:()=>j(e),children:v?v(e,{selected:n}):s===`agenda`?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(`span`,{className:`inline-flex min-w-14 items-center gap-1.5 font-medium`,children:[e.icon,e.time??`—`]}),(0,r.jsxs)(`span`,{className:`min-w-0`,children:[(0,r.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.title}),e.description?(0,r.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description}):null,e.meta?(0,r.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:e.meta}):null]}),e.badge?(0,r.jsx)(`span`,{className:`shrink-0`,children:e.badge}):e.durationMinutes?(0,r.jsxs)(`span`,{className:`shrink-0 text-xs opacity-70`,children:[e.durationMinutes,` min`]}):null]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`div`,{className:`font-medium`,children:e.title}),e.description?(0,r.jsx)(`div`,{className:`mt-1 text-xs opacity-80`,children:e.description}):null,e.time?(0,r.jsx)(`div`,{className:`mt-1 text-xs opacity-70`,children:e.time}):null,e.durationMinutes?(0,r.jsxs)(`div`,{className:`mt-1 text-xs opacity-70`,children:[e.durationMinutes,` min`]}):null,e.meta?(0,r.jsx)(`div`,{className:`mt-1 text-xs opacity-70`,children:e.meta}):null]})},e.id)})}),g?(0,r.jsx)(`button`,{type:`button`,className:`mt-3 w-full rounded-md border border-dashed px-3 py-2 text-sm text-muted-foreground hover:bg-muted/50`,onClick:()=>g(e),children:y}):null]},e)})]})}exports.CalendarScheduler=a;
|