@acronis-platform/ui-react 0.61.0 → 0.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,55 @@
1
+ import { CalendarPanelSelected, CalendarPanelVariant } from './calendar-panel';
2
+ import { DayPickerLocale, DayPickerProps } from 'react-day-picker';
3
+ /** Number of years offered on each side of the current year by default. */
4
+ export declare const DEFAULT_YEAR_SPAN = 50;
5
+ /** A `{value, label}` pair for one `InputSelect` option in the header dropdowns. */
6
+ export interface CalendarSelectItem<T> {
7
+ value: T;
8
+ label: string;
9
+ }
10
+ /**
11
+ * Resolves the year dropdown's bounds: an explicit `fromYear`/`toYear` wins,
12
+ * otherwise falls back to `currentYear` ± `span`.
13
+ */
14
+ export declare function resolveYearRange(fromYear: number | undefined, toYear: number | undefined, currentYear: number, span?: number): {
15
+ fromYear: number;
16
+ toYear: number;
17
+ };
18
+ /** Day-of-week index DayPicker accepts for `weekStartsOn` (0 = Sunday). */
19
+ export type WeekStartsOn = 0 | 1 | 2 | 3 | 4 | 5 | 6;
20
+ /**
21
+ * Resolves the week's first day: an explicit `weekStartsOn` wins, then the
22
+ * `locale`'s own week start, then Monday (per the design default).
23
+ */
24
+ export declare function resolveWeekStartsOn(weekStartsOn: WeekStartsOn | undefined, locale: DayPickerLocale | undefined): WeekStartsOn;
25
+ /**
26
+ * Builds the 12 month dropdown items. Formats each from year 2000 (a leap
27
+ * year), so every month — including February 29 — formats from a valid date.
28
+ */
29
+ export declare function buildMonthItems(formatMonthLabel: (date: Date) => string): CalendarSelectItem<number>[];
30
+ /**
31
+ * Builds the year dropdown items spanning `fromYear`..`toYear` inclusive.
32
+ * An inverted range (`toYear < fromYear`) clamps to a single `fromYear` item
33
+ * rather than producing an empty or negative-length list.
34
+ */
35
+ export declare function buildYearItems(fromYear: number, toYear: number): CalendarSelectItem<number>[];
36
+ /**
37
+ * Backs a header-dropdown navigation target off so the last of `numberOfMonths`
38
+ * displayed months doesn't run past `endMonth`. Mirrors react-day-picker's own
39
+ * `getInitialMonth` back-off — its `goToMonth` only clamps the *first* displayed
40
+ * month to `endMonth`, so for a two-month `range` panel, requesting a first month
41
+ * within one month of `endMonth` (e.g. `endMonth` itself) leaves the second month
42
+ * past the bound, and `getDisplayMonths` silently drops it instead of the pair
43
+ * sliding back.
44
+ */
45
+ export declare function clampNavigationTarget(target: Date, endMonth: Date, numberOfMonths: number): Date;
46
+ /**
47
+ * Assembles DayPicker's mode-specific selection props from `variant`. DayPicker's
48
+ * props are a discriminated union keyed by a literal `mode`, so each branch is
49
+ * built separately (rather than a single object with `mode: variant`) — a
50
+ * literal tag is what lets TypeScript pick the matching union member without
51
+ * an `as DayPickerProps` assertion. `selected`/`onSelect` are cast per branch
52
+ * to their branch-specific shape only, which the discriminated `CalendarPanelProps`
53
+ * union above guarantees is safe at the call site.
54
+ */
55
+ export declare function buildModeProps(variant: CalendarPanelVariant, selected: CalendarPanelSelected, onSelect: ((selected: CalendarPanelSelected, triggerDate: Date) => void) | undefined, min: number | undefined, max: number | undefined): DayPickerProps;
@@ -0,0 +1,112 @@
1
+ import { DateRange, DayButton, DayPickerLocale, Matcher, MonthCaptionProps } from 'react-day-picker';
2
+ import * as React from 'react';
3
+ export type CalendarPanelVariant = 'single' | 'multiple' | 'range';
4
+ /** Selected value, shaped by the active `variant`. */
5
+ export type CalendarPanelSelected = Date | Date[] | DateRange | undefined;
6
+ /**
7
+ * The header of one month column: a month `InputSelect` and a year `InputSelect`.
8
+ * Replaces DayPicker's `MonthCaption`.
9
+ */
10
+ declare function CalendarHeader({ calendarMonth, displayIndex, className, ...props }: MonthCaptionProps): import("react/jsx-runtime").JSX.Element;
11
+ declare namespace CalendarHeader {
12
+ var displayName: string;
13
+ }
14
+ /**
15
+ * One day cell (Figma's "CalendarItem") — a flat 32×32 square. `data-active`
16
+ * (a selected day or either range endpoint) and `data-range-middle` are mutually
17
+ * exclusive, so their backgrounds never compete.
18
+ */
19
+ declare function CalendarItem({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
20
+ declare namespace CalendarItem {
21
+ var displayName: string;
22
+ }
23
+ interface CalendarPanelSharedProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect' | 'defaultValue'> {
24
+ /**
25
+ * Text direction. Forwarded to `DayPicker` explicitly — an ancestor's `dir`
26
+ * mirrors the panel's CSS layout automatically (logical properties), but
27
+ * `react-day-picker` only flips its Arrow Left/Right keyboard roaming when
28
+ * `dir` is passed to it directly, so it must also be passed here.
29
+ */
30
+ dir?: 'ltr' | 'rtl';
31
+ /** Uncontrolled initial month shown. */
32
+ defaultMonth?: Date;
33
+ /** Controlled month shown (the first month, for `range`). */
34
+ month?: Date;
35
+ /** Called when the displayed month changes (header dropdowns). */
36
+ onMonthChange?: (month: Date) => void;
37
+ /** Days that cannot be selected. */
38
+ disabled?: Matcher | Matcher[];
39
+ /** Minimum number of selectable days (`multiple` / `range`; ignored for `single`). */
40
+ min?: number;
41
+ /** Maximum number of selectable days (`multiple` / `range`; ignored for `single`). */
42
+ max?: number;
43
+ /** Render the leading/trailing days of the adjacent months. */
44
+ showOutsideDays?: boolean;
45
+ /**
46
+ * First day of the week (0 = Sunday). Defaults to `locale`'s own week start,
47
+ * falling back to Monday (per the design) when no `locale` is given.
48
+ */
49
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
50
+ /**
51
+ * First year offered by the year dropdown and the earliest month the grid
52
+ * can navigate to. Defaults to 50 years back.
53
+ */
54
+ fromYear?: number;
55
+ /**
56
+ * Last year offered by the year dropdown and the latest month the grid can
57
+ * navigate to. Defaults to 50 years ahead.
58
+ */
59
+ toYear?: number;
60
+ /**
61
+ * Localizes weekday names and DayPicker's default day-cell/caption accessible
62
+ * labels (e.g. `import { es } from 'react-day-picker/locale'`). Defaults to
63
+ * date-fns `enUS`. Does not translate `monthLabel`/`yearLabel`/`cancelLabel`/
64
+ * `applyLabel`/`formatMonthLabel` — those are separate props the consumer
65
+ * must localize themselves.
66
+ */
67
+ locale?: DayPickerLocale;
68
+ /** Accessible name of the month dropdown. */
69
+ monthLabel?: string;
70
+ /** Accessible name of the year dropdown. */
71
+ yearLabel?: string;
72
+ /** Formats a month's name for the month dropdown. Defaults to `locale`-aware `date-fns` formatting. */
73
+ formatMonthLabel?: (date: Date) => string;
74
+ /** Footer "Cancel" button label (`multiple` / `range`). */
75
+ cancelLabel?: string;
76
+ /** Footer "Apply" button label (`multiple` / `range`). */
77
+ applyLabel?: string;
78
+ /** Called when the footer's Cancel button is pressed. */
79
+ onCancel?: () => void;
80
+ /** Called when the footer's Apply button is pressed. */
81
+ onApply?: () => void;
82
+ }
83
+ /** `variant="single"` (the default) — `selected` is a single optional `Date`. */
84
+ export interface CalendarPanelSingleProps extends CalendarPanelSharedProps {
85
+ /** Selection mode + panel structure. `multiple`/`range` add the Cancel/Apply footer; `range` shows two months. */
86
+ variant?: 'single';
87
+ /** The selected date. Uncontrolled unless `onSelect` is provided. */
88
+ selected?: Date;
89
+ /** Called when the selection changes. Providing it makes `selected` controlled. */
90
+ onSelect?: (selected: Date | undefined, triggerDate: Date) => void;
91
+ }
92
+ /** `variant="multiple"` — `selected` is a `Date[]`, and the footer is shown. */
93
+ export interface CalendarPanelMultipleProps extends CalendarPanelSharedProps {
94
+ variant: 'multiple';
95
+ selected?: Date[];
96
+ onSelect?: (selected: Date[] | undefined, triggerDate: Date) => void;
97
+ }
98
+ /** `variant="range"` — `selected` is a `DateRange`, two months render, and the footer is shown. */
99
+ export interface CalendarPanelRangeProps extends CalendarPanelSharedProps {
100
+ variant: 'range';
101
+ selected?: DateRange;
102
+ onSelect?: (selected: DateRange | undefined, triggerDate: Date) => void;
103
+ }
104
+ /**
105
+ * `CalendarPanel`'s props, discriminated by `variant` — a `single` panel only
106
+ * accepts a `Date`, `multiple` only a `Date[]`, `range` only a `DateRange`, so
107
+ * mismatched `selected`/`onSelect` shapes are caught at the call site instead
108
+ * of silently reaching `react-day-picker` with the wrong shape at runtime.
109
+ */
110
+ export type CalendarPanelProps = CalendarPanelSingleProps | CalendarPanelMultipleProps | CalendarPanelRangeProps;
111
+ declare const CalendarPanel: React.ForwardRefExoticComponent<CalendarPanelProps & React.RefAttributes<HTMLDivElement>>;
112
+ export { CalendarPanel, CalendarItem, CalendarHeader };
@@ -0,0 +1 @@
1
+ export { CalendarPanel, CalendarItem, CalendarHeader, type CalendarPanelProps, type CalendarPanelSingleProps, type CalendarPanelMultipleProps, type CalendarPanelRangeProps, type CalendarPanelSelected, type CalendarPanelVariant, } from './calendar-panel';
@@ -0,0 +1,11 @@
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ import * as React from 'react';
3
+ export interface FilterCardsProps extends React.ComponentPropsWithoutRef<'div'> {
4
+ /**
5
+ * Replace the rendered `<div>` with another element or component
6
+ * (Base UI composition).
7
+ */
8
+ render?: useRender.RenderProp;
9
+ }
10
+ declare const FilterCards: React.ForwardRefExoticComponent<FilterCardsProps & React.RefAttributes<HTMLDivElement>>;
11
+ export { FilterCards };
@@ -0,0 +1 @@
1
+ export { FilterCards, type FilterCardsProps } from './filter-cards';
@@ -14,6 +14,7 @@ export * from './components/ui/breadcrumb';
14
14
  export * from './components/ui/button';
15
15
  export * from './components/ui/button-menu';
16
16
  export * from './components/ui/calendar';
17
+ export * from './components/ui/calendar-panel';
17
18
  export * from './components/ui/card';
18
19
  export * from './components/ui/card-filter';
19
20
  export * from './components/ui/category-bar';
@@ -35,6 +36,7 @@ export * from './components/ui/dialog-welcome';
35
36
  export * from './components/ui/dropdown-menu';
36
37
  export * from './components/ui/empty';
37
38
  export * from './components/ui/field';
39
+ export * from './components/ui/filter-cards';
38
40
  export * from './components/ui/funnel-chart';
39
41
  export * from './components/ui/grid';
40
42
  export * from './components/ui/histogram';