@apotech-os/ui-sdk 2.5.0 → 2.6.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/index.d.cts CHANGED
@@ -444,6 +444,12 @@ interface PeriodPreset {
444
444
  /** The rail, in the order it is offered. `custom` is reached by picking days. */
445
445
  declare const PERIOD_PRESETS: readonly PeriodPreset[];
446
446
  declare const COMPARE_LABELS: Record<PeriodCompareMode, string>;
447
+ /**
448
+ * The comparison as the trigger says it, next to a range that already takes the
449
+ * width. `COMPARE_LABELS` is what the panel offers; this is what a button can
450
+ * afford to show.
451
+ */
452
+ declare const COMPARE_SHORT_LABELS: Record<PeriodCompareMode, string>;
447
453
  /**
448
454
  * The window a comparison mode resolves to, or undefined when there is nothing
449
455
  * to compare against — `none`, an unbounded period, or `custom`, whose range the
@@ -472,11 +478,18 @@ interface DateRangeCompareProps {
472
478
  comparable?: boolean;
473
479
  /** Override the rail — a subset, or presets in another order. */
474
480
  presets?: readonly PeriodPreset[];
481
+ /**
482
+ * How many months the grid shows. `'auto'` widens to two whenever the range
483
+ * straddles them. One by default: two doubles the panel's width, which a
484
+ * dashboard header rarely has, and a range wider than the grid stays correctly
485
+ * highlighted on the part that is visible.
486
+ */
487
+ months?: 1 | 2 | 'auto';
475
488
  align?: 'start' | 'end';
476
489
  disabled?: boolean;
477
490
  className?: string;
478
491
  }
479
- declare function DateRangeCompare({ value, onChange, comparable, presets, align, disabled, className, }: DateRangeCompareProps): React.JSX.Element;
492
+ declare function DateRangeCompare({ value, onChange, comparable, presets, months, align, disabled, className, }: DateRangeCompareProps): React.JSX.Element;
480
493
  /** A day range with both ends — what the pre-contract-2 picker spoke. */
481
494
  interface DateRange {
482
495
  from: string;
@@ -494,6 +507,9 @@ interface DateRangePickerProps {
494
507
  *
495
508
  * It stays because removing an export breaks the contract, and its signature is
496
509
  * unchanged: a caller that only ever wanted two days keeps passing two days.
510
+ * `months` is pinned to the old behaviour for the same reason — one month is the
511
+ * answer to a panel crowding a dashboard header, a problem a picker with no rail
512
+ * does not have.
497
513
  */
498
514
  declare function DateRangePicker({ value, onChange, className, disabled }: DateRangePickerProps): React.JSX.Element;
499
515
 
@@ -655,4 +671,4 @@ declare function toCsv(rows: string[][]): string;
655
671
  */
656
672
  declare function downloadCsv(rows: string[][], filename: string): void;
657
673
 
658
- export { type AppApiClient, AppApiProvider, AppContextProvider, type AppContextValue, AppInvokeError, AreaChart, Badge, type BadgeProps, BarChart, Button, type ButtonProps, COMPARE_LABELS, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CartesianChartProps, type ChartRow, type ChartSeries, Checkbox, type CheckboxProps, CopyButton, type CopyButtonProps, DataTable, type DataTableColumn, type DataTableFacet, type DataTableFilter, type DataTableFilterOperator, type DataTablePagination, type DataTableProps, type DataTableSort, type DataTableState, type DateRange, DateRangeCompare, type DateRangeCompareProps, DateRangePicker, type DateRangePickerProps, DropdownMenu, type DropdownMenuItem, type DropdownMenuProps, FunnelChart, type FunnelChartProps, type FunnelStep, Input, KpiCard, type KpiCardProps, LineChart, Link, type LinkProps, Modal, type ModalProps, PERIOD_PRESETS, type PeriodCompareMode, type PeriodPreset, type PeriodPresetKey, type PeriodRange, type PeriodValue, Popover, type PopoverProps, Select, type SelectOption, type SelectProps, SidePanel, type SidePanelProps, Spinner, type SpinnerProps, StackedBarChart, Switch, type SwitchProps, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, type TabsProps, TabsTrigger, Textarea, type TextareaProps, type ToastInput, ToastProvider, Tooltip, type TooltipProps, type ValueFormatter, badgeVariants, buttonVariants, cn, comparisonRange, copyToClipboard, downloadBlob, downloadCsv, formatPeriod, formatRange, makePeriod, periodFromPreset, relativeDelta, toCsv, useAppApi, useAppContext, useAppRun, useAppRuns, useAppSettings, useToast };
674
+ export { type AppApiClient, AppApiProvider, AppContextProvider, type AppContextValue, AppInvokeError, AreaChart, Badge, type BadgeProps, BarChart, Button, type ButtonProps, COMPARE_LABELS, COMPARE_SHORT_LABELS, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CartesianChartProps, type ChartRow, type ChartSeries, Checkbox, type CheckboxProps, CopyButton, type CopyButtonProps, DataTable, type DataTableColumn, type DataTableFacet, type DataTableFilter, type DataTableFilterOperator, type DataTablePagination, type DataTableProps, type DataTableSort, type DataTableState, type DateRange, DateRangeCompare, type DateRangeCompareProps, DateRangePicker, type DateRangePickerProps, DropdownMenu, type DropdownMenuItem, type DropdownMenuProps, FunnelChart, type FunnelChartProps, type FunnelStep, Input, KpiCard, type KpiCardProps, LineChart, Link, type LinkProps, Modal, type ModalProps, PERIOD_PRESETS, type PeriodCompareMode, type PeriodPreset, type PeriodPresetKey, type PeriodRange, type PeriodValue, Popover, type PopoverProps, Select, type SelectOption, type SelectProps, SidePanel, type SidePanelProps, Spinner, type SpinnerProps, StackedBarChart, Switch, type SwitchProps, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, type TabsProps, TabsTrigger, Textarea, type TextareaProps, type ToastInput, ToastProvider, Tooltip, type TooltipProps, type ValueFormatter, badgeVariants, buttonVariants, cn, comparisonRange, copyToClipboard, downloadBlob, downloadCsv, formatPeriod, formatRange, makePeriod, periodFromPreset, relativeDelta, toCsv, useAppApi, useAppContext, useAppRun, useAppRuns, useAppSettings, useToast };
package/dist/index.d.ts CHANGED
@@ -444,6 +444,12 @@ interface PeriodPreset {
444
444
  /** The rail, in the order it is offered. `custom` is reached by picking days. */
445
445
  declare const PERIOD_PRESETS: readonly PeriodPreset[];
446
446
  declare const COMPARE_LABELS: Record<PeriodCompareMode, string>;
447
+ /**
448
+ * The comparison as the trigger says it, next to a range that already takes the
449
+ * width. `COMPARE_LABELS` is what the panel offers; this is what a button can
450
+ * afford to show.
451
+ */
452
+ declare const COMPARE_SHORT_LABELS: Record<PeriodCompareMode, string>;
447
453
  /**
448
454
  * The window a comparison mode resolves to, or undefined when there is nothing
449
455
  * to compare against — `none`, an unbounded period, or `custom`, whose range the
@@ -472,11 +478,18 @@ interface DateRangeCompareProps {
472
478
  comparable?: boolean;
473
479
  /** Override the rail — a subset, or presets in another order. */
474
480
  presets?: readonly PeriodPreset[];
481
+ /**
482
+ * How many months the grid shows. `'auto'` widens to two whenever the range
483
+ * straddles them. One by default: two doubles the panel's width, which a
484
+ * dashboard header rarely has, and a range wider than the grid stays correctly
485
+ * highlighted on the part that is visible.
486
+ */
487
+ months?: 1 | 2 | 'auto';
475
488
  align?: 'start' | 'end';
476
489
  disabled?: boolean;
477
490
  className?: string;
478
491
  }
479
- declare function DateRangeCompare({ value, onChange, comparable, presets, align, disabled, className, }: DateRangeCompareProps): React.JSX.Element;
492
+ declare function DateRangeCompare({ value, onChange, comparable, presets, months, align, disabled, className, }: DateRangeCompareProps): React.JSX.Element;
480
493
  /** A day range with both ends — what the pre-contract-2 picker spoke. */
481
494
  interface DateRange {
482
495
  from: string;
@@ -494,6 +507,9 @@ interface DateRangePickerProps {
494
507
  *
495
508
  * It stays because removing an export breaks the contract, and its signature is
496
509
  * unchanged: a caller that only ever wanted two days keeps passing two days.
510
+ * `months` is pinned to the old behaviour for the same reason — one month is the
511
+ * answer to a panel crowding a dashboard header, a problem a picker with no rail
512
+ * does not have.
497
513
  */
498
514
  declare function DateRangePicker({ value, onChange, className, disabled }: DateRangePickerProps): React.JSX.Element;
499
515
 
@@ -655,4 +671,4 @@ declare function toCsv(rows: string[][]): string;
655
671
  */
656
672
  declare function downloadCsv(rows: string[][], filename: string): void;
657
673
 
658
- export { type AppApiClient, AppApiProvider, AppContextProvider, type AppContextValue, AppInvokeError, AreaChart, Badge, type BadgeProps, BarChart, Button, type ButtonProps, COMPARE_LABELS, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CartesianChartProps, type ChartRow, type ChartSeries, Checkbox, type CheckboxProps, CopyButton, type CopyButtonProps, DataTable, type DataTableColumn, type DataTableFacet, type DataTableFilter, type DataTableFilterOperator, type DataTablePagination, type DataTableProps, type DataTableSort, type DataTableState, type DateRange, DateRangeCompare, type DateRangeCompareProps, DateRangePicker, type DateRangePickerProps, DropdownMenu, type DropdownMenuItem, type DropdownMenuProps, FunnelChart, type FunnelChartProps, type FunnelStep, Input, KpiCard, type KpiCardProps, LineChart, Link, type LinkProps, Modal, type ModalProps, PERIOD_PRESETS, type PeriodCompareMode, type PeriodPreset, type PeriodPresetKey, type PeriodRange, type PeriodValue, Popover, type PopoverProps, Select, type SelectOption, type SelectProps, SidePanel, type SidePanelProps, Spinner, type SpinnerProps, StackedBarChart, Switch, type SwitchProps, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, type TabsProps, TabsTrigger, Textarea, type TextareaProps, type ToastInput, ToastProvider, Tooltip, type TooltipProps, type ValueFormatter, badgeVariants, buttonVariants, cn, comparisonRange, copyToClipboard, downloadBlob, downloadCsv, formatPeriod, formatRange, makePeriod, periodFromPreset, relativeDelta, toCsv, useAppApi, useAppContext, useAppRun, useAppRuns, useAppSettings, useToast };
674
+ export { type AppApiClient, AppApiProvider, AppContextProvider, type AppContextValue, AppInvokeError, AreaChart, Badge, type BadgeProps, BarChart, Button, type ButtonProps, COMPARE_LABELS, COMPARE_SHORT_LABELS, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CartesianChartProps, type ChartRow, type ChartSeries, Checkbox, type CheckboxProps, CopyButton, type CopyButtonProps, DataTable, type DataTableColumn, type DataTableFacet, type DataTableFilter, type DataTableFilterOperator, type DataTablePagination, type DataTableProps, type DataTableSort, type DataTableState, type DateRange, DateRangeCompare, type DateRangeCompareProps, DateRangePicker, type DateRangePickerProps, DropdownMenu, type DropdownMenuItem, type DropdownMenuProps, FunnelChart, type FunnelChartProps, type FunnelStep, Input, KpiCard, type KpiCardProps, LineChart, Link, type LinkProps, Modal, type ModalProps, PERIOD_PRESETS, type PeriodCompareMode, type PeriodPreset, type PeriodPresetKey, type PeriodRange, type PeriodValue, Popover, type PopoverProps, Select, type SelectOption, type SelectProps, SidePanel, type SidePanelProps, Spinner, type SpinnerProps, StackedBarChart, Switch, type SwitchProps, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, type TabsProps, TabsTrigger, Textarea, type TextareaProps, type ToastInput, ToastProvider, Tooltip, type TooltipProps, type ValueFormatter, badgeVariants, buttonVariants, cn, comparisonRange, copyToClipboard, downloadBlob, downloadCsv, formatPeriod, formatRange, makePeriod, periodFromPreset, relativeDelta, toCsv, useAppApi, useAppContext, useAppRun, useAppRuns, useAppSettings, useToast };