@apipass/design-system 1.15.0 → 1.16.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.
@@ -0,0 +1,47 @@
1
+ import { type DateValue } from "@internationalized/date";
2
+ import { type DateRangePresetKey } from "./dateRangePresets";
3
+ import "./daterangepicker.css";
4
+ export interface DateRangePreset {
5
+ id: string;
6
+ label: string;
7
+ getValue: () => {
8
+ start: DateValue;
9
+ end: DateValue;
10
+ };
11
+ }
12
+ export interface DateRangePickerValue {
13
+ preset?: DateRangePreset;
14
+ start: DateValue | null;
15
+ end: DateValue | null;
16
+ }
17
+ export interface DateRangePickerLabels {
18
+ placeholder: string;
19
+ relativeLabel: string;
20
+ absoluteLabel: string;
21
+ startDateLabel: string;
22
+ endDateLabel: string;
23
+ cancelLabel?: string | null;
24
+ applyLabel?: string | null;
25
+ }
26
+ export interface DateRangePickerProps {
27
+ className?: string;
28
+ locale?: string;
29
+ label?: string;
30
+ "aria-label"?: string;
31
+ description?: string;
32
+ errorMessage?: string;
33
+ labels: DateRangePickerLabels;
34
+ intervals?: DateRangePreset[];
35
+ presetKeys?: DateRangePresetKey[];
36
+ presetLabels?: Record<DateRangePresetKey, string>;
37
+ hideTime?: boolean;
38
+ minValue?: DateValue;
39
+ maxValue?: DateValue;
40
+ timezone?: string;
41
+ isDisabled?: boolean;
42
+ isRequired?: boolean;
43
+ value?: DateRangePickerValue;
44
+ defaultValue?: DateRangePickerValue;
45
+ onChange?: (value: DateRangePickerValue) => void;
46
+ }
47
+ export declare function DateRangePicker({ className, locale: localeProp, label, "aria-label": ariaLabel, description, errorMessage, labels, intervals: intervalsProp, presetKeys, presetLabels, hideTime, minValue, maxValue, timezone: timezoneProp, isDisabled, isRequired, value, defaultValue, onChange, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { DateRangePreset } from "./DateRangePicker";
2
+ export type DateRangePresetKey = "last5m" | "last15m" | "last30m" | "last1h" | "last3h" | "last6h" | "last12h" | "last24h" | "today" | "yesterday" | "last7d" | "last30d" | "thisWeek" | "lastWeek" | "thisMonth" | "lastMonth" | "thisYear" | "lastYear";
3
+ export declare const DATE_RANGE_PRESET_ORDER: DateRangePresetKey[];
4
+ export interface CreateDateRangePresetsOptions {
5
+ labels: Record<DateRangePresetKey, string>;
6
+ timezone?: string;
7
+ locale?: string;
8
+ include?: DateRangePresetKey[];
9
+ }
10
+ export declare function createDateRangePresets(options: CreateDateRangePresetsOptions): DateRangePreset[];
@@ -5,6 +5,8 @@ export * from "./CodeEditor/CodeEditor";
5
5
  export * from "./Avatar/Avatar";
6
6
  export * from "./Button/Button";
7
7
  export * from "./Checkbox/Checkbox";
8
+ export * from "./DateRangePicker/DateRangePicker";
9
+ export * from "./DateRangePicker/dateRangePresets";
8
10
  export * from "./Dialog/Dialog";
9
11
  export * from "./Divider/Divider";
10
12
  export * from "./Fieldset/Fieldset";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apipass/design-system",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "type": "module",
5
5
  "description": "APIPass React Design System",
6
6
  "sideEffects": [
@@ -67,6 +67,7 @@
67
67
  }
68
68
  },
69
69
  "dependencies": {
70
+ "@internationalized/date": "^3.10.0",
70
71
  "clsx": "^2.1.1",
71
72
  "react-toastify": "^11.1.0"
72
73
  },