@adam-milo/ui 1.0.129 → 1.0.130
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.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +2 -2
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +1 -1
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +1 -1
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +1 -1
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +1 -1
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +1 -1
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +1 -1
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +1 -1
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +1 -1
- package/dist/index108.cjs +1 -0
- package/dist/index108.js +1 -0
- package/dist/index109.cjs +1 -0
- package/dist/index109.js +1 -0
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index110.cjs +1 -0
- package/dist/index110.js +1 -0
- package/dist/index111.cjs +1 -0
- package/dist/index111.js +1 -0
- package/dist/index112.cjs +1 -0
- package/dist/index112.js +1 -0
- package/dist/index113.cjs +1 -0
- package/dist/index113.js +1 -0
- package/dist/index114.cjs +1 -0
- package/dist/index114.js +1 -0
- package/dist/index115.cjs +1 -0
- package/dist/index115.js +1 -0
- package/dist/index116.cjs +1 -0
- package/dist/index116.js +1 -0
- package/dist/index117.cjs +1 -0
- package/dist/index117.js +1 -0
- package/dist/index118.cjs +1 -0
- package/dist/index118.js +1 -0
- package/dist/index119.cjs +1 -0
- package/dist/index119.js +1 -0
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +1 -1
- package/dist/index120.cjs +1 -0
- package/dist/index120.js +1 -0
- package/dist/index121.cjs +1 -0
- package/dist/index121.js +1 -0
- package/dist/index122.cjs +1 -0
- package/dist/index122.js +1 -0
- package/dist/index123.cjs +1 -0
- package/dist/index123.js +1 -0
- package/dist/index124.cjs +1 -0
- package/dist/index124.js +1 -0
- package/dist/index125.cjs +1 -0
- package/dist/index125.js +1 -0
- package/dist/index126.cjs +1 -0
- package/dist/index126.js +1 -0
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +1 -1
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +8 -3
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +3 -6
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +6 -2
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +2 -2
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +2 -2
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -2
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +2 -2
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +2 -2
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +2 -2
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +2 -2
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +2 -2
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +2 -2
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +2 -2
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +2 -4
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +4 -2
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +2 -2
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +2 -4
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +4 -8
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +8 -2
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +2 -4
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +4 -8
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +8 -8
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +8 -9
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +9 -2
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +2 -5
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +5 -2
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +2 -10
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +2 -9
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +3 -2
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +3 -2
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +24 -2
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +10 -4
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +13 -2
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +38 -3
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +10 -2
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +1 -2
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +9 -2
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +2 -2
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +2 -10
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +2 -11
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +4 -1
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +2 -1
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +1 -1
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +3 -1
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +2 -1
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +2 -1
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +2 -1
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +2 -1
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +10 -9
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +11 -1
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +1 -1
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +1 -1
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +1 -1
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +1 -2
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +1 -1
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +1 -1
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +1 -1
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +9 -1
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +1 -7
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +1 -1
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +1 -1
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +1 -1
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +2 -1
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +1 -1
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +1 -1
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +1 -1
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +1 -1
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +1 -1
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +7 -1
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +1 -1
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +1 -1
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +1 -1
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +1 -1
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +1 -1
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +1 -1
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +1 -1
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +1 -1
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +1 -1
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +1 -1
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +1 -1
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +1 -1
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +1 -1
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +1 -1
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +1 -1
- package/dist/src/components/data-display/check-filter/CheckFilter.component.d.ts +8 -0
- package/dist/src/components/data-display/check-filter/CheckFilter.component.d.ts.map +1 -0
- package/dist/src/components/data-display/check-filter/CheckFilter.styles.d.ts +6 -0
- package/dist/src/components/data-display/check-filter/CheckFilter.styles.d.ts.map +1 -0
- package/dist/src/components/data-display/check-filter/CheckFilter.types.d.ts +68 -0
- package/dist/src/components/data-display/check-filter/CheckFilter.types.d.ts.map +1 -0
- package/dist/src/components/data-display/date-filter/DateFilter.component.d.ts +9 -0
- package/dist/src/components/data-display/date-filter/DateFilter.component.d.ts.map +1 -0
- package/dist/src/components/data-display/date-filter/DateFilter.styles.d.ts +96 -0
- package/dist/src/components/data-display/date-filter/DateFilter.styles.d.ts.map +1 -0
- package/dist/src/components/data-display/date-filter/DateFilter.types.d.ts +102 -0
- package/dist/src/components/data-display/date-filter/DateFilter.types.d.ts.map +1 -0
- package/dist/src/components/data-display/date-filter/dateUtils.d.ts +100 -0
- package/dist/src/components/data-display/date-filter/dateUtils.d.ts.map +1 -0
- package/dist/src/components/data-display/filter/Filter.component.d.ts +21 -0
- package/dist/src/components/data-display/filter/Filter.component.d.ts.map +1 -0
- package/dist/src/components/data-display/filter/Filter.styles.d.ts +27 -0
- package/dist/src/components/data-display/filter/Filter.styles.d.ts.map +1 -0
- package/dist/src/components/data-display/filter/Filter.types.d.ts +141 -0
- package/dist/src/components/data-display/filter/Filter.types.d.ts.map +1 -0
- package/dist/src/components/data-display/filter-button/FilterButton.component.d.ts +5 -0
- package/dist/src/components/data-display/filter-button/FilterButton.component.d.ts.map +1 -0
- package/dist/src/components/data-display/filter-button/FilterButton.styles.d.ts +10 -0
- package/dist/src/components/data-display/filter-button/FilterButton.styles.d.ts.map +1 -0
- package/dist/src/components/data-display/filter-button/FilterButton.types.d.ts +18 -0
- package/dist/src/components/data-display/filter-button/FilterButton.types.d.ts.map +1 -0
- package/dist/src/components/data-display/numeric-filter/NumericFilter.component.d.ts +8 -0
- package/dist/src/components/data-display/numeric-filter/NumericFilter.component.d.ts.map +1 -0
- package/dist/src/components/data-display/numeric-filter/NumericFilter.styles.d.ts +14 -0
- package/dist/src/components/data-display/numeric-filter/NumericFilter.styles.d.ts.map +1 -0
- package/dist/src/components/data-display/numeric-filter/NumericFilter.types.d.ts +53 -0
- package/dist/src/components/data-display/numeric-filter/NumericFilter.types.d.ts.map +1 -0
- package/dist/src/components/data-display/range-filter/RangeFilter.component.d.ts +8 -0
- package/dist/src/components/data-display/range-filter/RangeFilter.component.d.ts.map +1 -0
- package/dist/src/components/data-display/range-filter/RangeFilter.styles.d.ts +18 -0
- package/dist/src/components/data-display/range-filter/RangeFilter.styles.d.ts.map +1 -0
- package/dist/src/components/data-display/range-filter/RangeFilter.types.d.ts +44 -0
- package/dist/src/components/data-display/range-filter/RangeFilter.types.d.ts.map +1 -0
- package/dist/src/components/data-display/sort-button/SortButton.component.d.ts +5 -0
- package/dist/src/components/data-display/sort-button/SortButton.component.d.ts.map +1 -0
- package/dist/src/components/data-display/sort-button/SortButton.styles.d.ts +5 -0
- package/dist/src/components/data-display/sort-button/SortButton.styles.d.ts.map +1 -0
- package/dist/src/components/data-display/sort-button/SortButton.types.d.ts +27 -0
- package/dist/src/components/data-display/sort-button/SortButton.types.d.ts.map +1 -0
- package/dist/src/components/forms/numeric-input/NumericInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/numeric-input/NumericInput.types.d.ts +14 -0
- package/dist/src/components/forms/numeric-input/NumericInput.types.d.ts.map +1 -1
- package/dist/src/components/forms/slider/Slider.component.d.ts +5 -0
- package/dist/src/components/forms/slider/Slider.component.d.ts.map +1 -0
- package/dist/src/components/forms/slider/Slider.styles.d.ts +21 -0
- package/dist/src/components/forms/slider/Slider.styles.d.ts.map +1 -0
- package/dist/src/components/forms/slider/Slider.types.d.ts +72 -0
- package/dist/src/components/forms/slider/Slider.types.d.ts.map +1 -0
- package/dist/src/components/overlays/popover/Popover.component.d.ts +27 -0
- package/dist/src/components/overlays/popover/Popover.component.d.ts.map +1 -0
- package/dist/src/components/overlays/popover/Popover.styles.d.ts +2 -0
- package/dist/src/components/overlays/popover/Popover.styles.d.ts.map +1 -0
- package/dist/src/components/overlays/popover/Popover.types.d.ts +18 -0
- package/dist/src/components/overlays/popover/Popover.types.d.ts.map +1 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date utilities for the `DateFilter`.
|
|
3
|
+
*
|
|
4
|
+
* Everything here is *local-time* arithmetic — the filter is a UI for picking
|
|
5
|
+
* calendar days (no time-of-day), so we normalize to midnight and never call
|
|
6
|
+
* `toISOString()` or other UTC-coerced APIs. Two `Date` objects represent
|
|
7
|
+
* the same calendar day iff `.getFullYear() / .getMonth() / .getDate()`
|
|
8
|
+
* match.
|
|
9
|
+
*
|
|
10
|
+
* The functions are kept side-effect free and return *new* `Date` instances —
|
|
11
|
+
* never mutate the input.
|
|
12
|
+
*/
|
|
13
|
+
/** Sunday-based weekday short names — matches the Figma reference order. */
|
|
14
|
+
export declare const WEEKDAY_SHORT: readonly ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
15
|
+
export declare const MONTHS_SHORT: readonly string[];
|
|
16
|
+
export declare const MONTHS_LONG: readonly string[];
|
|
17
|
+
/** Strip the time component, returning midnight of the same local day. */
|
|
18
|
+
export declare function startOfDay(date: Date): Date;
|
|
19
|
+
/** First day of the month containing `date` (00:00 local). */
|
|
20
|
+
export declare function startOfMonth(date: Date): Date;
|
|
21
|
+
/** Last day of the month containing `date` (00:00 local). */
|
|
22
|
+
export declare function endOfMonth(date: Date): Date;
|
|
23
|
+
/**
|
|
24
|
+
* Add `n` months while preserving the day-of-month, clamping to the last
|
|
25
|
+
* day of the target month when the source day doesn't exist there (e.g.
|
|
26
|
+
* Jan 31 + 1 month → Feb 28/29 rather than spilling into March).
|
|
27
|
+
*/
|
|
28
|
+
export declare function addMonths(date: Date, n: number): Date;
|
|
29
|
+
/**
|
|
30
|
+
* Add `n` years, preserving month + day-of-month. Feb 29 in a leap year
|
|
31
|
+
* clamps to Feb 28 when the target year isn't a leap year.
|
|
32
|
+
*/
|
|
33
|
+
export declare function addYears(date: Date, n: number): Date;
|
|
34
|
+
/** Add `n` days, preserving the time-of-day (typically 00:00 from `startOfDay`). */
|
|
35
|
+
export declare function addDays(date: Date, n: number): Date;
|
|
36
|
+
/** Same calendar day in local time. */
|
|
37
|
+
export declare function isSameDay(a: Date | null | undefined, b: Date | null | undefined): boolean;
|
|
38
|
+
/** Same calendar month + year in local time. */
|
|
39
|
+
export declare function isSameMonth(a: Date | null | undefined, b: Date | null | undefined): boolean;
|
|
40
|
+
/** -1 if `a` is earlier, 1 if later, 0 if same day. */
|
|
41
|
+
export declare function compareDay(a: Date, b: Date): number;
|
|
42
|
+
/** Inclusive `from <= date <= to`. Either bound may be `null`. */
|
|
43
|
+
export declare function isInRange(date: Date, from: Date | null, to: Date | null): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Build the Sunday-aligned 7-col grid of `Date` cells for the month
|
|
46
|
+
* containing `viewMonth`. Each cell is a real `Date`; cells that fall
|
|
47
|
+
* outside the focused month are tagged so the renderer can grey them
|
|
48
|
+
* out *and* make them unclickable.
|
|
49
|
+
*
|
|
50
|
+
* Row count is the **minimum** needed to cover every in-month day. A
|
|
51
|
+
* Sunday-starting February (28 days) needs 4 rows, most months need 5,
|
|
52
|
+
* and only the worst case (a 31-day month that begins on Saturday) needs
|
|
53
|
+
* 6. We intentionally do NOT pad to a fixed 6 rows — the design (and
|
|
54
|
+
* Figma reference) crops trailing all-next-month rows.
|
|
55
|
+
*/
|
|
56
|
+
export declare function buildMonthGrid(viewMonth: Date): {
|
|
57
|
+
date: Date;
|
|
58
|
+
outside: boolean;
|
|
59
|
+
}[];
|
|
60
|
+
/**
|
|
61
|
+
* Format a `Date` as `"1 June 2026"`. This is the literal format shown in
|
|
62
|
+
* the Figma footer; using `toLocaleDateString` here would silently change
|
|
63
|
+
* the wording when the host's locale differs.
|
|
64
|
+
*/
|
|
65
|
+
export declare function formatDateLong(date: Date): string;
|
|
66
|
+
/**
|
|
67
|
+
* Parse the inverse of `formatDateLong`. Accepts a few user-friendly
|
|
68
|
+
* variants — `"1 June 2026"`, `"1 Jun 2026"`, `"1/6/2026"`,
|
|
69
|
+
* `"2026-06-01"` — and returns `null` if it can't make sense of the input.
|
|
70
|
+
*
|
|
71
|
+
* Returning `null` (rather than throwing) keeps callers' onChange paths
|
|
72
|
+
* simple: keep the existing draft and ignore unparseable text.
|
|
73
|
+
*/
|
|
74
|
+
export declare function parseDateInput(input: string): Date | null;
|
|
75
|
+
/**
|
|
76
|
+
* Value-equality for two `DateFilterValue`s. Plain JSON comparison would
|
|
77
|
+
* stringify `Date` objects via `toISOString`, which is *almost* right, but
|
|
78
|
+
* we want `null === null` to be `true` without serializing — and we want
|
|
79
|
+
* to defend against accidental TZ drift, so we explicitly compare local
|
|
80
|
+
* calendar days.
|
|
81
|
+
*/
|
|
82
|
+
export declare function dateRangeEquals(a: {
|
|
83
|
+
from: Date | null;
|
|
84
|
+
to: Date | null;
|
|
85
|
+
}, b: {
|
|
86
|
+
from: Date | null;
|
|
87
|
+
to: Date | null;
|
|
88
|
+
}): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Range presets used by the header shortcut buttons. Each preset returns
|
|
91
|
+
* a `[from, to]` pair anchored on `today` (defaults to *now*). The product
|
|
92
|
+
* convention is "last N days inclusive" — e.g. "Last Week" = the last 7
|
|
93
|
+
* days, where today is the 7th — so the trigger pill reads as "X – today".
|
|
94
|
+
*/
|
|
95
|
+
export type DateRangePreset = 'today' | 'last-week' | 'last-month' | 'last-year';
|
|
96
|
+
export declare function getPresetRange(preset: DateRangePreset, today?: Date): {
|
|
97
|
+
from: Date;
|
|
98
|
+
to: Date;
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=dateUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateUtils.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/date-filter/dateUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAgCH,4EAA4E;AAC5E,eAAO,MAAM,aAAa,qDAAsD,CAAC;AAEjF,eAAO,MAAM,YAAY,mBAAkC,CAAC;AAC5D,eAAO,MAAM,WAAW,mBAAiC,CAAC;AAE1D,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAE3C;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAE7C;AAED,6DAA6D;AAC7D,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAE3C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAMrD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAKpD;AAED,oFAAoF;AACpF,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAInD;AAED,uCAAuC;AACvC,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAOzF;AAED,gDAAgD;AAChD,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAG3F;AAED,uDAAuD;AACvD,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAInD;AAED,kEAAkE;AAClE,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAIjF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,IAAI,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAAE,CAelF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAEjD;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CA+CzD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,CAAC,EAAE;IAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,EAAE,EAAE,IAAI,GAAG,IAAI,CAAA;CAAE,EACzC,CAAC,EAAE;IAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,EAAE,EAAE,IAAI,GAAG,IAAI,CAAA;CAAE,GACxC,OAAO,CAOT;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,CAAC;AAEjF,wBAAgB,cAAc,CAC5B,MAAM,EAAE,eAAe,EACvB,KAAK,GAAE,IAAiB,GACvB;IACD,IAAI,EAAE,IAAI,CAAC;IACX,EAAE,EAAE,IAAI,CAAC;CACV,CAgBA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FilterApplyProps, FilterBodyProps, FilterContentProps, FilterContextValue, FilterFooterProps, FilterProps, FilterResetProps, FilterTitleProps, FilterTriggerProps } from './Filter.types';
|
|
2
|
+
|
|
3
|
+
export type { FilterApplyProps, FilterBodyProps, FilterContentProps, FilterContextValue, FilterFooterProps, FilterProps, FilterResetProps, FilterTitleProps, FilterTriggerProps, } from './Filter.types';
|
|
4
|
+
/**
|
|
5
|
+
* Access the surrounding `Filter` context. The `T` generic must match the
|
|
6
|
+
* shape passed to the `Filter` provider — TypeScript can't infer this through
|
|
7
|
+
* context, so consumers cast at the call site.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const { draftValue, setDraftValue, isActive } = useFilter<string[]>();
|
|
11
|
+
*/
|
|
12
|
+
export declare function useFilter<T = unknown>(): FilterContextValue<T>;
|
|
13
|
+
export declare function Filter<T>({ value: controlledValue, defaultValue, emptyValue, onApply, open: controlledOpen, defaultOpen, onOpenChange, isActive: customIsActive, compareValues, normalizeValue, children, }: FilterProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const FilterTrigger: import('react').ForwardRefExoticComponent<FilterTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export declare const FilterContent: import('react').ForwardRefExoticComponent<FilterContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export declare const FilterTitle: import('react').ForwardRefExoticComponent<FilterTitleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export declare const FilterBody: import('react').ForwardRefExoticComponent<FilterBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export declare const FilterFooter: import('react').ForwardRefExoticComponent<FilterFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export declare const FilterApply: import('react').ForwardRefExoticComponent<FilterApplyProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export declare const FilterReset: import('react').ForwardRefExoticComponent<FilterResetProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
//# sourceMappingURL=Filter.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/filter/Filter.component.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AASxB,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAQxB;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,CAAC,GAAG,OAAO,KAAK,kBAAkB,CAAC,CAAC,CAAC,CAM9D;AAkBD,wBAAgB,MAAM,CAAC,CAAC,EAAE,EACxB,KAAK,EAAE,eAAe,EACtB,YAAY,EACZ,UAAU,EACV,OAAO,EACP,IAAI,EAAE,cAAc,EACpB,WAAmB,EACnB,YAAY,EACZ,QAAQ,EAAE,cAAc,EACxB,aAAa,EACb,cAAc,EACd,QAAQ,GACT,EAAE,WAAW,CAAC,CAAC,CAAC,2CA8FhB;AAMD,eAAO,MAAM,aAAa,kHAgBzB,CAAC;AAOF,eAAO,MAAM,aAAa,+GAYzB,CAAC;AAOF,eAAO,MAAM,WAAW,6GAUvB,CAAC;AAGF,eAAO,MAAM,UAAU,4GAUtB,CAAC;AAGF,eAAO,MAAM,YAAY,8GAUxB,CAAC;AAOF,eAAO,MAAM,WAAW,gHAuCvB,CAAC;AAGF,eAAO,MAAM,WAAW,gHAkEvB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const contentStyles: string;
|
|
2
|
+
export declare const titleStyles: string;
|
|
3
|
+
export declare const bodyStyles: string;
|
|
4
|
+
export declare const footerStyles: string;
|
|
5
|
+
/**
|
|
6
|
+
* `FilterReset` button — Figma-exact 40 × 40 square with a 16 × 16 glyph
|
|
7
|
+
* centered inside 12 px padding on every side.
|
|
8
|
+
*
|
|
9
|
+
* Why these tokens:
|
|
10
|
+
* - **Outer:** `--spacing-10` (2.5 rem = 40 px) matches the Figma frame.
|
|
11
|
+
* - **Padding:** `--spacing-3` (0.75 rem = 12 px) matches Figma's 12 px gap
|
|
12
|
+
* from the frame edge to the glyph on every side.
|
|
13
|
+
* - **Glyph:** 16 × 16 supplied by `Icon size="md"` at the call site.
|
|
14
|
+
* - **Radius:** `rounded-12` matches the IconButton convention (also a
|
|
15
|
+
* token-derived value, not a magic px).
|
|
16
|
+
* - **Hover:** `--color-bg-secondary` (#f3f3f5) — quiet light-gray fill,
|
|
17
|
+
* matching the option-row hover so the popover feels cohesive.
|
|
18
|
+
* - **Focus:** `btn-focus-text` — the design system's standard text-color
|
|
19
|
+
* focus ring effect.
|
|
20
|
+
*
|
|
21
|
+
* The component renders a plain `<button>` (not `IconButton`) and uses
|
|
22
|
+
* `<Icon color="system-text">` so the muted stroke color comes from a
|
|
23
|
+
* **token, via the Icon's own color API** — no `!important`, no inline-
|
|
24
|
+
* style override fight.
|
|
25
|
+
*/
|
|
26
|
+
export declare const resetButtonStyles: string;
|
|
27
|
+
//# sourceMappingURL=Filter.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/filter/Filter.styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,QAWf,CAAC;AAEZ,eAAO,MAAM,WAAW,QAAgE,CAAC;AAEzF,eAAO,MAAM,UAAU,QAWZ,CAAC;AAEZ,eAAO,MAAM,YAAY,QAOd,CAAC;AAEZ;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,iBAAiB,QAYnB,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { PopoverContentProps } from '../../overlays/popover/Popover.types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Context shared by every `Filter` sub-component. The `T` generic carries the
|
|
6
|
+
* filter's value shape (e.g. `string[]` for a checkbox filter, `[number, number]`
|
|
7
|
+
* for a range filter). Consumer code reads it via `useFilter<T>()`.
|
|
8
|
+
*/
|
|
9
|
+
export interface FilterContextValue<T = unknown> {
|
|
10
|
+
/** Value the popover is currently editing (uncommitted). */
|
|
11
|
+
draftValue: T;
|
|
12
|
+
/** Update the in-progress draft. */
|
|
13
|
+
setDraftValue: (value: T) => void;
|
|
14
|
+
/** Value currently applied to the data outside the popover. */
|
|
15
|
+
committedValue: T;
|
|
16
|
+
/** The "empty" sentinel value used by `reset()` and `isActive`. */
|
|
17
|
+
emptyValue: T;
|
|
18
|
+
/** Whether the committed value differs from `emptyValue`. */
|
|
19
|
+
isActive: boolean;
|
|
20
|
+
/** Whether the popover is open. */
|
|
21
|
+
open: boolean;
|
|
22
|
+
/** Programmatically open/close the popover. */
|
|
23
|
+
setOpen: (open: boolean) => void;
|
|
24
|
+
/** Commit the current draft and close the popover. */
|
|
25
|
+
apply: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Clear the filter entirely — commits `emptyValue`, fires `onApply`, and
|
|
28
|
+
* closes the popover. Behaves as if the user manually cleared all
|
|
29
|
+
* inputs and clicked Apply. The draft is also cleared so the next open
|
|
30
|
+
* starts fresh.
|
|
31
|
+
*/
|
|
32
|
+
reset: () => void;
|
|
33
|
+
/** Close without committing. Draft is discarded on next open. */
|
|
34
|
+
cancel: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* Value equality used internally by sub-components (e.g. `FilterApply`
|
|
37
|
+
* checks whether `draftValue` equals `committedValue`). Honors the
|
|
38
|
+
* `compareValues` prop on `Filter`, falling back to JSON equality.
|
|
39
|
+
*/
|
|
40
|
+
areEqual: (a: T, b: T) => boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface FilterProps<T> {
|
|
43
|
+
/** Controlled committed value. */
|
|
44
|
+
value?: T;
|
|
45
|
+
/** Initial committed value in uncontrolled mode. */
|
|
46
|
+
defaultValue?: T;
|
|
47
|
+
/** Sentinel representing "no filter applied" (e.g. `[]`, `null`, `''`). */
|
|
48
|
+
emptyValue: T;
|
|
49
|
+
/** Called when the user clicks `FilterApply`. */
|
|
50
|
+
onApply?: (value: T) => void;
|
|
51
|
+
/** Controlled open state of the popover. */
|
|
52
|
+
open?: boolean;
|
|
53
|
+
/** Initial open state for uncontrolled mode. */
|
|
54
|
+
defaultOpen?: boolean;
|
|
55
|
+
/** Called when the popover open state changes. */
|
|
56
|
+
onOpenChange?: (open: boolean) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Optional custom check for whether a value should be considered "active".
|
|
59
|
+
* Defaults to a JSON-equality check against `emptyValue`.
|
|
60
|
+
*/
|
|
61
|
+
isActive?: (value: T) => boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Compare draft vs committed (and committed vs empty) for equality. Used by
|
|
64
|
+
* `FilterApply` to decide when the draft is "unchanged" and by `isActive`'s
|
|
65
|
+
* default implementation. Defaults to a JSON-equality check, which is fine
|
|
66
|
+
* for primitives / plain objects but breaks for `Date` and other non-JSON
|
|
67
|
+
* shapes — pass a custom predicate in those cases.
|
|
68
|
+
*/
|
|
69
|
+
compareValues?: (a: T, b: T) => boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Optional last-mile transform applied to the draft just before it's
|
|
72
|
+
* committed via `apply()`. Runs for both the controlled and uncontrolled
|
|
73
|
+
* paths and for the value passed to `onApply`, so the consumer never sees
|
|
74
|
+
* a semantically broken draft state that the UI tolerated during editing.
|
|
75
|
+
*
|
|
76
|
+
* Use cases:
|
|
77
|
+
* - RangeFilter swapping `{min: 80, max: 20}` → `{min: 20, max: 80}`
|
|
78
|
+
* when the user typed an inverted pair (the slider sorts visually but
|
|
79
|
+
* the underlying draft preserved the typed order).
|
|
80
|
+
*
|
|
81
|
+
* Reset is unaffected — it always commits `emptyValue` verbatim.
|
|
82
|
+
*/
|
|
83
|
+
normalizeValue?: (value: T) => T;
|
|
84
|
+
children: ReactNode;
|
|
85
|
+
}
|
|
86
|
+
export interface FilterTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
87
|
+
/**
|
|
88
|
+
* Render the trigger as the child element (passing trigger handlers down).
|
|
89
|
+
* Use when wrapping a custom button or anchor.
|
|
90
|
+
*/
|
|
91
|
+
asChild?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Override the auto-derived `active` state on the default `FilterButton`.
|
|
94
|
+
* Ignored when `asChild` is true.
|
|
95
|
+
*/
|
|
96
|
+
active?: boolean;
|
|
97
|
+
}
|
|
98
|
+
export interface FilterContentProps extends Omit<PopoverContentProps, 'data-cy' | 'data-testid'> {
|
|
99
|
+
'data-cy'?: string;
|
|
100
|
+
'data-testid'?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface FilterTitleProps extends HTMLAttributes<HTMLDivElement> {
|
|
103
|
+
'data-cy'?: string;
|
|
104
|
+
'data-testid'?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface FilterBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
107
|
+
'data-cy'?: string;
|
|
108
|
+
'data-testid'?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface FilterFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
111
|
+
'data-cy'?: string;
|
|
112
|
+
'data-testid'?: string;
|
|
113
|
+
}
|
|
114
|
+
export interface FilterApplyProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
115
|
+
/** Override the default "Apply" text. */
|
|
116
|
+
children?: ReactNode;
|
|
117
|
+
/**
|
|
118
|
+
* Disable Apply when the draft equals the committed value. Defaults to
|
|
119
|
+
* `true` — the typical UX is that the orange Apply button only "lights up"
|
|
120
|
+
* once the user has actually changed something. Set to `false` to allow
|
|
121
|
+
* re-applying the same value (e.g. to trigger a refetch).
|
|
122
|
+
*/
|
|
123
|
+
disabledWhenUnchanged?: boolean;
|
|
124
|
+
}
|
|
125
|
+
export interface FilterResetProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
126
|
+
/** Custom label for the (default) text variant. Defaults to "Reset". */
|
|
127
|
+
children?: ReactNode;
|
|
128
|
+
/**
|
|
129
|
+
* Auto-hide the reset control when the filter has no committed value
|
|
130
|
+
* (`isActive === false`). Defaults to `true`, matching the spec —
|
|
131
|
+
* "Reset is visible only when an applied value exists". Set to `false` to
|
|
132
|
+
* always render the button (e.g. for layout stability).
|
|
133
|
+
*/
|
|
134
|
+
autoHide?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Accessible label used when no text `children` are supplied (icon-only
|
|
137
|
+
* mode). Defaults to "Reset filter".
|
|
138
|
+
*/
|
|
139
|
+
'aria-label'?: string;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=Filter.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/filter/Filter.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FilterButtonProps } from './FilterButton.types';
|
|
2
|
+
|
|
3
|
+
export type { FilterButtonProps } from './FilterButton.types';
|
|
4
|
+
export declare const FilterButton: import('react').ForwardRefExoticComponent<FilterButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
//# sourceMappingURL=FilterButton.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterButton.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/filter-button/FilterButton.component.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,eAAO,MAAM,YAAY,iHAiDxB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const baseStyles: string;
|
|
2
|
+
/**
|
|
3
|
+
* When the filter has a value applied: the icon stays teal even at rest and
|
|
4
|
+
* the hover background switches to the neutral `--color-paper-blue` so the
|
|
5
|
+
* orange "active" dot remains visually dominant (matches the Figma
|
|
6
|
+
* "Active + H" spec).
|
|
7
|
+
*/
|
|
8
|
+
export declare const activeStyles: string;
|
|
9
|
+
export declare const dotStyles: string;
|
|
10
|
+
//# sourceMappingURL=FilterButton.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterButton.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/filter-button/FilterButton.styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAYZ,CAAC;AAEZ;;;;;GAKG;AACH,eAAO,MAAM,YAAY,QAGd,CAAC;AAEZ,eAAO,MAAM,SAAS,QAKX,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface FilterButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the filter has any value applied. Renders the orange-dot
|
|
6
|
+
* indicator and keeps the icon in its "active" (teal) color even when
|
|
7
|
+
* not hovered. Equivalent to the Figma "Active" / "Active + H" states.
|
|
8
|
+
*/
|
|
9
|
+
active?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Accessible label describing the filter (e.g. "Filter by status").
|
|
12
|
+
* Required when the button has no visible text content.
|
|
13
|
+
*/
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
'data-testid'?: string;
|
|
16
|
+
'data-cy'?: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=FilterButton.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterButton.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/filter-button/FilterButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAChF;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NumericFilterProps } from './NumericFilter.types';
|
|
2
|
+
|
|
3
|
+
export type { NumericFilterProps, NumericFilterValue } from './NumericFilter.types';
|
|
4
|
+
export declare function NumericFilter({ value, defaultValue, onApply, min, max, step, title, inputPlaceholder, open, defaultOpen, onOpenChange, disabled, hideReset, allowMin, 'aria-label': ariaLabel, 'data-cy': dataCy, 'data-testid': dataTestId, }: NumericFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare namespace NumericFilter {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=NumericFilter.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumericFilter.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/numeric-filter/NumericFilter.component.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,kBAAkB,EAAsB,MAAM,uBAAuB,CAAC;AAGpF,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AA0GpF,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,YAAY,EACZ,OAAO,EACP,GAAO,EACP,GAAS,EACT,IAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,SAAiB,EACjB,QAAgB,EAChB,YAAY,EAAE,SAAS,EACvB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,UAAU,GAC1B,EAAE,kBAAkB,2CAiDpB;yBAnEe,aAAa"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-row layout: slider on the left (flex-1), numeric input on the right
|
|
3
|
+
* (fixed token-aligned width). Vertical alignment is centered so the rail
|
|
4
|
+
* sits at the input's mid-line.
|
|
5
|
+
*
|
|
6
|
+
* Figma reference (1 — SaaS / 45041:18776):
|
|
7
|
+
* gap-3 (12px) between slider and input
|
|
8
|
+
* small input ~58px — we use --spacing-16 (64px) as the closest design
|
|
9
|
+
* token; this also leaves room for 3-digit values without clipping.
|
|
10
|
+
*/
|
|
11
|
+
export declare const rowStyles: string;
|
|
12
|
+
export declare const sliderColumnStyles: string;
|
|
13
|
+
export declare const inputColumnStyles: string;
|
|
14
|
+
//# sourceMappingURL=NumericFilter.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumericFilter.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/numeric-filter/NumericFilter.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,QAAgE,CAAC;AAEvF,eAAO,MAAM,kBAAkB,QAA+B,CAAC;AAE/D,eAAO,MAAM,iBAAiB,QAA+C,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Value shape used by `NumericFilter`. `null` means "no filter applied". */
|
|
4
|
+
export type NumericFilterValue = number | null;
|
|
5
|
+
export interface NumericFilterProps {
|
|
6
|
+
/** Controlled committed value. */
|
|
7
|
+
value?: NumericFilterValue;
|
|
8
|
+
/** Initial committed value (uncontrolled). */
|
|
9
|
+
defaultValue?: NumericFilterValue;
|
|
10
|
+
/** Fires on Apply. */
|
|
11
|
+
onApply?: (value: NumericFilterValue) => void;
|
|
12
|
+
/** Minimum allowed integer. Defaults to `0`. */
|
|
13
|
+
min?: number;
|
|
14
|
+
/** Maximum allowed integer. Defaults to `100`. */
|
|
15
|
+
max?: number;
|
|
16
|
+
/** Step granularity (slider arrow-key increments). Defaults to `1`. */
|
|
17
|
+
step?: number;
|
|
18
|
+
/** Optional title shown above the slider/input. */
|
|
19
|
+
title?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Placeholder for the numeric input. Defaults to `String(min)` so the
|
|
22
|
+
* empty state shows the lower bound (e.g. `"0"`) in the muted placeholder
|
|
23
|
+
* colour — mirroring the `RangeFilter` "Min"/"Max" pattern.
|
|
24
|
+
*/
|
|
25
|
+
inputPlaceholder?: string;
|
|
26
|
+
/** Accessible label for the trigger button. */
|
|
27
|
+
'aria-label'?: string;
|
|
28
|
+
/** Controlled popover open state. */
|
|
29
|
+
open?: boolean;
|
|
30
|
+
defaultOpen?: boolean;
|
|
31
|
+
onOpenChange?: (open: boolean) => void;
|
|
32
|
+
/** Disable the trigger entirely. */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** Suppress the Reset button. Defaults to `false`. */
|
|
35
|
+
hideReset?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Treat `min` as a valid committable value rather than the "unbounded /
|
|
38
|
+
* clear" sentinel. Defaults to `false` — i.e. dragging the slider thumb
|
|
39
|
+
* onto the lower rail edge snaps the draft back to `null`, the input
|
|
40
|
+
* clears, and the trigger shows "no filter applied". The trade-off is
|
|
41
|
+
* that the exact `min` value is unreachable via the slider; typed input
|
|
42
|
+
* still commits the literal digit.
|
|
43
|
+
*
|
|
44
|
+
* Set to `true` when `min` is a real selectable value (e.g. `min={1}`
|
|
45
|
+
* for a 1–5 score filter where `1` is meaningful). With `allowMin`, the
|
|
46
|
+
* slider edge commits `min` and Reset (or clearing the input) becomes
|
|
47
|
+
* the only way to return to the "no filter" state.
|
|
48
|
+
*/
|
|
49
|
+
allowMin?: boolean;
|
|
50
|
+
'data-cy'?: string;
|
|
51
|
+
'data-testid'?: string;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=NumericFilter.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumericFilter.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/numeric-filter/NumericFilter.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,6EAA6E;AAC7E,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,IAAI,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,sBAAsB;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC9C,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sDAAsD;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RangeFilterProps } from './RangeFilter.types';
|
|
2
|
+
|
|
3
|
+
export type { RangeFilterProps, RangeFilterValue } from './RangeFilter.types';
|
|
4
|
+
export declare function RangeFilter({ value, defaultValue, onApply, min, max, step, title, minPlaceholder, maxPlaceholder, open, defaultOpen, onOpenChange, disabled, hideReset, 'aria-label': ariaLabel, 'data-cy': dataCy, 'data-testid': dataTestId, }: RangeFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare namespace RangeFilter {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=RangeFilter.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeFilter.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/range-filter/RangeFilter.component.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,qBAAqB,CAAC;AAQ9E,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAmK9E,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,YAAY,EACZ,OAAO,EACP,GAAO,EACP,GAAS,EACT,IAAQ,EACR,KAAK,EACL,cAAsB,EACtB,cAAsB,EACtB,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,SAAiB,EACjB,YAAY,EAAE,SAAS,EACvB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,UAAU,GAC1B,EAAE,gBAAgB,2CA8ClB;yBAhEe,WAAW"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two stacked sections (Figma 45041:18832):
|
|
3
|
+
* 1. Slider row (full width) with scale labels under the rail
|
|
4
|
+
* 2. Inputs row — two equal-width inputs separated by an em-dash
|
|
5
|
+
*
|
|
6
|
+
* Gaps come from spacing tokens: 16px between the two sections, 16px between
|
|
7
|
+
* the inputs themselves.
|
|
8
|
+
*/
|
|
9
|
+
export declare const bodyStackStyles: string;
|
|
10
|
+
export declare const inputRowStyles: string;
|
|
11
|
+
/** Input column wrapper — keeps both inputs balanced via `flex-1 min-w-0`. */
|
|
12
|
+
export declare const inputGroupStyles: string;
|
|
13
|
+
/**
|
|
14
|
+
* En-dash separator between Min and Max. Aligns to the input's vertical
|
|
15
|
+
* center; no padding shift needed because the parent row uses `items-center`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const separatorStyles: string;
|
|
18
|
+
//# sourceMappingURL=RangeFilter.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeFilter.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/range-filter/RangeFilter.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,QAGjB,CAAC;AAEZ,eAAO,MAAM,cAAc,QAAgE,CAAC;AAE5F,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,QAA+B,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,eAAe,QAGjB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Value shape used by `RangeFilter`. Either bound may be `null` independently
|
|
5
|
+
* — useful when the user wants e.g. "≥ 50" without an upper bound. Both
|
|
6
|
+
* `null` means "no filter applied".
|
|
7
|
+
*/
|
|
8
|
+
export interface RangeFilterValue {
|
|
9
|
+
min: number | null;
|
|
10
|
+
max: number | null;
|
|
11
|
+
}
|
|
12
|
+
export interface RangeFilterProps {
|
|
13
|
+
/** Controlled committed value. */
|
|
14
|
+
value?: RangeFilterValue;
|
|
15
|
+
/** Initial committed value (uncontrolled). */
|
|
16
|
+
defaultValue?: RangeFilterValue;
|
|
17
|
+
/** Fires on Apply. */
|
|
18
|
+
onApply?: (value: RangeFilterValue) => void;
|
|
19
|
+
/** Minimum allowed integer. Defaults to `0`. */
|
|
20
|
+
min?: number;
|
|
21
|
+
/** Maximum allowed integer. Defaults to `100`. */
|
|
22
|
+
max?: number;
|
|
23
|
+
/** Step granularity (slider arrow-key increments). Defaults to `1`. */
|
|
24
|
+
step?: number;
|
|
25
|
+
/** Optional title shown above the slider/inputs. */
|
|
26
|
+
title?: ReactNode;
|
|
27
|
+
/** Placeholder for the min input. Defaults to `"Min"`. */
|
|
28
|
+
minPlaceholder?: string;
|
|
29
|
+
/** Placeholder for the max input. Defaults to `"Max"`. */
|
|
30
|
+
maxPlaceholder?: string;
|
|
31
|
+
/** Accessible label for the trigger button. */
|
|
32
|
+
'aria-label'?: string;
|
|
33
|
+
/** Controlled popover open state. */
|
|
34
|
+
open?: boolean;
|
|
35
|
+
defaultOpen?: boolean;
|
|
36
|
+
onOpenChange?: (open: boolean) => void;
|
|
37
|
+
/** Disable the trigger entirely. */
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/** Suppress the Reset button. Defaults to `false`. */
|
|
40
|
+
hideReset?: boolean;
|
|
41
|
+
'data-cy'?: string;
|
|
42
|
+
'data-testid'?: string;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=RangeFilter.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeFilter.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/range-filter/RangeFilter.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,kCAAkC;IAClC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,8CAA8C;IAC9C,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,sBAAsB;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC5C,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sDAAsD;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SortButtonProps } from './SortButton.types';
|
|
2
|
+
|
|
3
|
+
export type { SortButtonProps, SortDirection } from './SortButton.types';
|
|
4
|
+
export declare const SortButton: import('react').ForwardRefExoticComponent<SortButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
//# sourceMappingURL=SortButton.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortButton.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/sort-button/SortButton.component.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,oBAAoB,CAAC;AAGzE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUzE,eAAO,MAAM,UAAU,+GAsEtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortButton.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/sort-button/SortButton.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,eAAO,MAAM,UAAU,QAYZ,CAAC;AAEZ,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAIzD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Logical state of a sort control.
|
|
5
|
+
* - `none`: no sort applied (idle / "disabled" in the design)
|
|
6
|
+
* - `asc`: A → Z (ascending)
|
|
7
|
+
* - `desc`: Z → A (descending)
|
|
8
|
+
*/
|
|
9
|
+
export type SortDirection = 'none' | 'asc' | 'desc';
|
|
10
|
+
export interface SortButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
|
|
11
|
+
/** Controlled sort direction. */
|
|
12
|
+
direction?: SortDirection;
|
|
13
|
+
/** Initial direction for uncontrolled mode. Defaults to `'none'`. */
|
|
14
|
+
defaultDirection?: SortDirection;
|
|
15
|
+
/** Called whenever the direction changes (click cycle). */
|
|
16
|
+
onDirectionChange?: (direction: SortDirection) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Order to cycle through on each click.
|
|
19
|
+
* Defaults to `['none', 'asc', 'desc']` (idle → A-Z → Z-A → idle).
|
|
20
|
+
*/
|
|
21
|
+
cycle?: readonly SortDirection[];
|
|
22
|
+
/** Accessible label describing what's being sorted (e.g. "Sort by name"). */
|
|
23
|
+
'aria-label'?: string;
|
|
24
|
+
'data-testid'?: string;
|
|
25
|
+
'data-cy'?: string;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=SortButton.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortButton.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/sort-button/SortButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAEpD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAChG,iCAAiC;IACjC,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,aAAa,CAAC;IACjC,2DAA2D;IAC3D,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,IAAI,CAAC;IACvD;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACjC,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumericInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/numeric-input/NumericInput.component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"NumericInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/numeric-input/NumericInput.component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA8B9D,eAAO,MAAM,YAAY,gHA0KxB,CAAC;AAIF,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -5,5 +5,19 @@ export interface NumericInputProps extends Omit<InputProps, 'type'> {
|
|
|
5
5
|
max?: number;
|
|
6
6
|
step?: number;
|
|
7
7
|
allowDecimals?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Strict integer-only mode. When `true`, the input:
|
|
10
|
+
* - renders as `type="text"` with `inputMode="numeric"` (so the browser
|
|
11
|
+
* does not accept `e`, `+`, `.` or scientific notation that `type="number"`
|
|
12
|
+
* silently permits),
|
|
13
|
+
* - blocks every non-digit character at the keystroke layer via an
|
|
14
|
+
* `onKeyDown` filter,
|
|
15
|
+
* - sanitises pasted content via an `onPaste` filter (the whole paste
|
|
16
|
+
* is rejected and re-inserted as a digits-only slice),
|
|
17
|
+
* - allows a leading `-` only when `min` is undefined or negative.
|
|
18
|
+
*
|
|
19
|
+
* Defaults to `false`. Implies and supersedes `allowDecimals={false}`.
|
|
20
|
+
*/
|
|
21
|
+
integerOnly?: boolean;
|
|
8
22
|
}
|
|
9
23
|
//# sourceMappingURL=NumericInput.types.d.ts.map
|