@tedi-design-system/react 18.0.0-rc.5 → 18.0.0-rc.6
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/bundle-stats.html +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/content/calendar/calendar.cjs.js +1 -1
- package/src/tedi/components/content/calendar/calendar.d.ts +9 -1
- package/src/tedi/components/content/calendar/calendar.es.js +72 -71
- package/src/tedi/components/content/calendar/calendar.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/calendar/calendar.module.scss.es.js +3 -2
- package/src/tedi/components/filter/filter/filter-group-context.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter-group-context.d.ts +8 -0
- package/src/tedi/components/filter/filter/filter-group-context.es.js +5 -0
- package/src/tedi/components/filter/filter/filter-group.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter-group.d.ts +94 -0
- package/src/tedi/components/filter/filter/filter-group.es.js +64 -0
- package/src/tedi/components/filter/filter/filter.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter.d.ts +98 -0
- package/src/tedi/components/filter/filter/filter.es.js +236 -0
- package/src/tedi/components/filter/filter/filter.module.scss.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter.module.scss.es.js +21 -0
- package/src/tedi/components/filter/filter/index.d.ts +3 -0
- package/src/tedi/components/form/search/search.cjs.js +1 -1
- package/src/tedi/components/form/search/search.es.js +22 -20
- package/src/tedi/index.d.ts +1 -0
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +14 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +17 -3
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +116 -110
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),S=require("../../../../../external/classnames/index.cjs.js"),a=require("./calendar.module.scss.cjs.js"),F=require("./components/calendar-header/calendar-header.cjs.js"),H=require("./components/calendar-month-grid/calendar-month-grid.cjs.js"),M=require("./components/calendar-year-grid/calendar-year-grid.cjs.js"),R=require("../../../../../external/react-day-picker/dist/esm/DayPicker.cjs.js"),T=require("../../../../../external/react-day-picker/dist/esm/locale/et.cjs.js"),j=({view:o="days",selectionLevel:f="days",currentMonth:c,setCurrentMonth:i,setView:l=()=>"days",mode:q="single",value:d,locale:x=T.et,localeCode:m="et-EE",showOutsideDays:N=!0,disabledMatchers:k,required:G,availableDays:t,unavailableDays:n,footer:Y,monthYearSelectType:C,handleSelect:P,applyValue:g,showNavigation:_=!0,className:y,bordered:O=!0,...w})=>{const h=O?void 0:a.default["tedi-calendar--borderless"],p=S.default(h,y),b=e=>t?Array.isArray(t)?t.some(u=>u.toDateString()===e.toDateString()):t(e):!0,A=e=>n?Array.isArray(n)?n.some(u=>u.toDateString()===e.toDateString()):n(e):!1,s=[...k??[],...t?[e=>!b(e)]:[],...n?[e=>A(e)]:[]],E=(()=>{switch(q){case"multiple":return{mode:"multiple",selected:Array.isArray(d)?d:void 0};case"range":return{mode:"range",selected:d&&!Array.isArray(d)&&!(d instanceof Date)?d:void 0};default:return{mode:"single",selected:d instanceof Date?d:void 0}}})();return r.jsxs("div",{className:a.default["tedi-calendar__wrapper"],children:[o==="years"&&r.jsx(M.YearGrid,{currentMonth:c,onNavigate:i,showNavigation:_,onSelectYear:e=>{i(e),f==="years"?g(new Date(e.getFullYear(),0,1)):l("months")},className:p}),o==="months"&&r.jsx(H.MonthGrid,{currentMonth:c,onNavigate:i,showNavigation:_,localeCode:m,onSelectMonth:e=>{i(e),f==="months"?g(e):l("days")},className:p}),o==="days"&&r.jsx(R.DayPicker,{...w,...E,locale:x,month:c,onMonthChange:i,showOutsideDays:N,disabled:s.length?s:void 0,required:G,components:{MonthCaption:e=>r.jsx(F.CalendarHeader,{...e,monthYearSelectType:C,onOpenMonthGrid:()=>l("months"),onOpenYearGrid:()=>l("years"),showNavigation:_,localeCode:m,disabledMatchers:s.length?s:void 0}),Nav:()=>r.jsx(r.Fragment,{})},footer:Y,classNames:{root:S.default(a.default["tedi-calendar"],h,y),month_caption:a.default["tedi-calendar__caption"],head:a.default["tedi-calendar__head"],row:a.default["tedi-calendar__row"],day:a.default["tedi-calendar__day"],selected:a.default["tedi-calendar__day--selected"],weekday:a.default["tedi-calendar__weekday"],outside:a.default["tedi-calendar__outside-days"],range_start:a.default["tedi-calendar__range-start"],range_middle:a.default["tedi-calendar__range-middle"],range_end:a.default["tedi-calendar__range-end"],today:a.default["tedi-calendar__today"],disabled:a.default["tedi-calendar__disabled"],month:a.default["tedi-calendar__month"],months:a.default["tedi-calendar__months-container"],footer:a.default["tedi-calendar__footer"],week_number:a.default["tedi-calendar__week-number"]},modifiers:{available:e=>t?b(e):!1,unavailable:e=>n?A(e):!1},modifiersClassNames:{available:a.default["tedi-calendar__available-day"],unavailable:a.default["tedi-calendar__unavailable-day"]},onSelect:P})]})};j.displayName="Calendar";exports.Calendar=j;
|
|
@@ -107,8 +107,16 @@ export interface CalendarProps extends Omit<DayPickerProps, 'mode' | 'selected'
|
|
|
107
107
|
* Optional additional CSS class for the calendar container.
|
|
108
108
|
*/
|
|
109
109
|
className?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Whether to render the surrounding card (border, background, radius).
|
|
112
|
+
* Set to `false` when embedding inside a parent that already provides
|
|
113
|
+
* its own surface — e.g. alongside a calendar inside `DateTimeField`.
|
|
114
|
+
* The inner gradient masks and column separators are preserved either way.
|
|
115
|
+
* @default true
|
|
116
|
+
*/
|
|
117
|
+
bordered?: boolean;
|
|
110
118
|
}
|
|
111
119
|
export declare const Calendar: {
|
|
112
|
-
({ view, selectionLevel, currentMonth, setCurrentMonth, setView, mode, value, locale, localeCode, showOutsideDays, disabledMatchers, required, availableDays, unavailableDays, footer, monthYearSelectType, handleSelect, applyValue, showNavigation, className, ...dayPickerProps }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
120
|
+
({ view, selectionLevel, currentMonth, setCurrentMonth, setView, mode, value, locale, localeCode, showOutsideDays, disabledMatchers, required, availableDays, unavailableDays, footer, monthYearSelectType, handleSelect, applyValue, showNavigation, className, bordered, ...dayPickerProps }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
113
121
|
displayName: string;
|
|
114
122
|
};
|
|
@@ -1,106 +1,107 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as P, jsx as o, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import u from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import r from "./calendar.module.scss.es.js";
|
|
4
|
-
import { CalendarHeader as
|
|
5
|
-
import { MonthGrid as
|
|
6
|
-
import { YearGrid as
|
|
7
|
-
import { DayPicker as
|
|
8
|
-
import { et as
|
|
9
|
-
const
|
|
10
|
-
view:
|
|
11
|
-
selectionLevel:
|
|
12
|
-
currentMonth:
|
|
4
|
+
import { CalendarHeader as U } from "./components/calendar-header/calendar-header.es.js";
|
|
5
|
+
import { MonthGrid as q } from "./components/calendar-month-grid/calendar-month-grid.es.js";
|
|
6
|
+
import { YearGrid as z } from "./components/calendar-year-grid/calendar-year-grid.es.js";
|
|
7
|
+
import { DayPicker as B } from "../../../../../external/react-day-picker/dist/esm/DayPicker.es.js";
|
|
8
|
+
import { et as I } from "../../../../../external/react-day-picker/dist/esm/locale/et.es.js";
|
|
9
|
+
const J = ({
|
|
10
|
+
view: c = "days",
|
|
11
|
+
selectionLevel: f = "days",
|
|
12
|
+
currentMonth: l,
|
|
13
13
|
setCurrentMonth: n,
|
|
14
|
-
setView:
|
|
14
|
+
setView: i = () => "days",
|
|
15
15
|
mode: S = "single",
|
|
16
|
-
value:
|
|
17
|
-
locale:
|
|
18
|
-
localeCode:
|
|
19
|
-
showOutsideDays:
|
|
20
|
-
disabledMatchers:
|
|
21
|
-
required:
|
|
22
|
-
availableDays:
|
|
16
|
+
value: a,
|
|
17
|
+
locale: k = I,
|
|
18
|
+
localeCode: p = "et-EE",
|
|
19
|
+
showOutsideDays: G = !0,
|
|
20
|
+
disabledMatchers: Y,
|
|
21
|
+
required: x,
|
|
22
|
+
availableDays: d,
|
|
23
23
|
unavailableDays: t,
|
|
24
|
-
footer:
|
|
25
|
-
monthYearSelectType:
|
|
26
|
-
handleSelect:
|
|
27
|
-
applyValue:
|
|
28
|
-
showNavigation:
|
|
29
|
-
className:
|
|
30
|
-
|
|
24
|
+
footer: C,
|
|
25
|
+
monthYearSelectType: j,
|
|
26
|
+
handleSelect: w,
|
|
27
|
+
applyValue: g,
|
|
28
|
+
showNavigation: m = !0,
|
|
29
|
+
className: y,
|
|
30
|
+
bordered: E = !0,
|
|
31
|
+
...F
|
|
31
32
|
}) => {
|
|
32
|
-
const h = (e) =>
|
|
33
|
-
...
|
|
34
|
-
...
|
|
35
|
-
...t ? [(e) =>
|
|
36
|
-
],
|
|
33
|
+
const h = E ? void 0 : r["tedi-calendar--borderless"], A = u(h, y), N = (e) => d ? Array.isArray(d) ? d.some((_) => _.toDateString() === e.toDateString()) : d(e) : !0, b = (e) => t ? Array.isArray(t) ? t.some((_) => _.toDateString() === e.toDateString()) : t(e) : !1, s = [
|
|
34
|
+
...Y ?? [],
|
|
35
|
+
...d ? [(e) => !N(e)] : [],
|
|
36
|
+
...t ? [(e) => b(e)] : []
|
|
37
|
+
], O = (() => {
|
|
37
38
|
switch (S) {
|
|
38
39
|
case "multiple":
|
|
39
|
-
return { mode: "multiple", selected: Array.isArray(
|
|
40
|
+
return { mode: "multiple", selected: Array.isArray(a) ? a : void 0 };
|
|
40
41
|
case "range":
|
|
41
42
|
return {
|
|
42
43
|
mode: "range",
|
|
43
|
-
selected:
|
|
44
|
+
selected: a && !Array.isArray(a) && !(a instanceof Date) ? a : void 0
|
|
44
45
|
};
|
|
45
46
|
default:
|
|
46
|
-
return { mode: "single", selected:
|
|
47
|
+
return { mode: "single", selected: a instanceof Date ? a : void 0 };
|
|
47
48
|
}
|
|
48
49
|
})();
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
return /* @__PURE__ */ P("div", { className: r["tedi-calendar__wrapper"], children: [
|
|
51
|
+
c === "years" && /* @__PURE__ */ o(
|
|
52
|
+
z,
|
|
52
53
|
{
|
|
53
|
-
currentMonth:
|
|
54
|
+
currentMonth: l,
|
|
54
55
|
onNavigate: n,
|
|
55
|
-
showNavigation:
|
|
56
|
+
showNavigation: m,
|
|
56
57
|
onSelectYear: (e) => {
|
|
57
|
-
n(e),
|
|
58
|
+
n(e), f === "years" ? g(new Date(e.getFullYear(), 0, 1)) : i("months");
|
|
58
59
|
},
|
|
59
|
-
className:
|
|
60
|
+
className: A
|
|
60
61
|
}
|
|
61
62
|
),
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
c === "months" && /* @__PURE__ */ o(
|
|
64
|
+
q,
|
|
64
65
|
{
|
|
65
|
-
currentMonth:
|
|
66
|
+
currentMonth: l,
|
|
66
67
|
onNavigate: n,
|
|
67
|
-
showNavigation:
|
|
68
|
-
localeCode:
|
|
68
|
+
showNavigation: m,
|
|
69
|
+
localeCode: p,
|
|
69
70
|
onSelectMonth: (e) => {
|
|
70
|
-
n(e),
|
|
71
|
+
n(e), f === "months" ? g(e) : i("days");
|
|
71
72
|
},
|
|
72
|
-
className:
|
|
73
|
+
className: A
|
|
73
74
|
}
|
|
74
75
|
),
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
c === "days" && /* @__PURE__ */ o(
|
|
77
|
+
B,
|
|
77
78
|
{
|
|
78
|
-
...
|
|
79
|
-
...
|
|
80
|
-
locale:
|
|
81
|
-
month:
|
|
79
|
+
...F,
|
|
80
|
+
...O,
|
|
81
|
+
locale: k,
|
|
82
|
+
month: l,
|
|
82
83
|
onMonthChange: n,
|
|
83
|
-
showOutsideDays:
|
|
84
|
+
showOutsideDays: G,
|
|
84
85
|
disabled: s.length ? s : void 0,
|
|
85
|
-
required:
|
|
86
|
+
required: x,
|
|
86
87
|
components: {
|
|
87
|
-
MonthCaption: (e) => /* @__PURE__ */
|
|
88
|
-
|
|
88
|
+
MonthCaption: (e) => /* @__PURE__ */ o(
|
|
89
|
+
U,
|
|
89
90
|
{
|
|
90
91
|
...e,
|
|
91
|
-
monthYearSelectType:
|
|
92
|
-
onOpenMonthGrid: () =>
|
|
93
|
-
onOpenYearGrid: () =>
|
|
94
|
-
showNavigation:
|
|
95
|
-
localeCode:
|
|
92
|
+
monthYearSelectType: j,
|
|
93
|
+
onOpenMonthGrid: () => i("months"),
|
|
94
|
+
onOpenYearGrid: () => i("years"),
|
|
95
|
+
showNavigation: m,
|
|
96
|
+
localeCode: p,
|
|
96
97
|
disabledMatchers: s.length ? s : void 0
|
|
97
98
|
}
|
|
98
99
|
),
|
|
99
|
-
Nav: () => /* @__PURE__ */
|
|
100
|
+
Nav: () => /* @__PURE__ */ o(H, {})
|
|
100
101
|
},
|
|
101
|
-
footer:
|
|
102
|
+
footer: C,
|
|
102
103
|
classNames: {
|
|
103
|
-
root:
|
|
104
|
+
root: u(r["tedi-calendar"], h, y),
|
|
104
105
|
month_caption: r["tedi-calendar__caption"],
|
|
105
106
|
head: r["tedi-calendar__head"],
|
|
106
107
|
row: r["tedi-calendar__row"],
|
|
@@ -119,19 +120,19 @@ const z = ({
|
|
|
119
120
|
week_number: r["tedi-calendar__week-number"]
|
|
120
121
|
},
|
|
121
122
|
modifiers: {
|
|
122
|
-
available: (e) =>
|
|
123
|
-
unavailable: (e) => t ?
|
|
123
|
+
available: (e) => d ? N(e) : !1,
|
|
124
|
+
unavailable: (e) => t ? b(e) : !1
|
|
124
125
|
},
|
|
125
126
|
modifiersClassNames: {
|
|
126
127
|
available: r["tedi-calendar__available-day"],
|
|
127
128
|
unavailable: r["tedi-calendar__unavailable-day"]
|
|
128
129
|
},
|
|
129
|
-
onSelect:
|
|
130
|
+
onSelect: w
|
|
130
131
|
}
|
|
131
132
|
)
|
|
132
133
|
] });
|
|
133
134
|
};
|
|
134
|
-
|
|
135
|
+
J.displayName = "Calendar";
|
|
135
136
|
export {
|
|
136
|
-
|
|
137
|
+
J as Calendar
|
|
137
138
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-calendar__picker-grid-container":"tedi-calendar__picker-grid-container-1b2bfc55","tedi-calendar__week-number":"tedi-calendar__week-number-c1a67f28","tedi-calendar__day":"tedi-calendar__day-baa13412","tedi-calendar__weekday":"tedi-calendar__weekday-9dce46ba","tedi-calendar":"tedi-calendar-a8c2a0a4","tedi-calendar__months-container":"tedi-calendar__months-container-793f3f7b","tedi-calendar__month":"tedi-calendar__month-b0e4d350","tedi-calendar__footer":"tedi-calendar__footer-bb297fb5","tedi-calendar__head":"tedi-calendar__head-bbd962e1","tedi-calendar__disabled":"tedi-calendar__disabled-30620859","tedi-calendar__day--selected":"tedi-calendar__day--selected-9f3dc090","tedi-calendar__today":"tedi-calendar__today-fa050850","tedi-calendar__available-day":"tedi-calendar__available-day-a0b09cf3","tedi-calendar__unavailable-day":"tedi-calendar__unavailable-day-05d8742d","tedi-calendar__range-middle":"tedi-calendar__range-middle-fa3459d1","tedi-calendar__range-start":"tedi-calendar__range-start-aaf20ea3","tedi-calendar__range-end":"tedi-calendar__range-end-097f2a3b","tedi-calendar__outside-days":"tedi-calendar__outside-days-703857de","tedi-calendar__picker-grid":"tedi-calendar__picker-grid-9b167adf","tedi-calendar__picker-grid-header":"tedi-calendar__picker-grid-header-30f8748f","tedi-calendar__picker--no-navigation":"tedi-calendar__picker--no-navigation-695a34ca","tedi-calendar__grid-button":"tedi-calendar__grid-button-889a2a85","tedi-calendar__grid-button--selected":"tedi-calendar__grid-button--selected-2019301b"};exports.default=e;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-calendar__picker-grid-container":"tedi-calendar__picker-grid-container-1b2bfc55","tedi-calendar__week-number":"tedi-calendar__week-number-c1a67f28","tedi-calendar__day":"tedi-calendar__day-baa13412","tedi-calendar__weekday":"tedi-calendar__weekday-9dce46ba","tedi-calendar":"tedi-calendar-a8c2a0a4","tedi-calendar--borderless":"tedi-calendar--borderless-22d5d627","tedi-calendar__months-container":"tedi-calendar__months-container-793f3f7b","tedi-calendar__month":"tedi-calendar__month-b0e4d350","tedi-calendar__footer":"tedi-calendar__footer-bb297fb5","tedi-calendar__head":"tedi-calendar__head-bbd962e1","tedi-calendar__disabled":"tedi-calendar__disabled-30620859","tedi-calendar__day--selected":"tedi-calendar__day--selected-9f3dc090","tedi-calendar__today":"tedi-calendar__today-fa050850","tedi-calendar__available-day":"tedi-calendar__available-day-a0b09cf3","tedi-calendar__unavailable-day":"tedi-calendar__unavailable-day-05d8742d","tedi-calendar__range-middle":"tedi-calendar__range-middle-fa3459d1","tedi-calendar__range-start":"tedi-calendar__range-start-aaf20ea3","tedi-calendar__range-end":"tedi-calendar__range-end-097f2a3b","tedi-calendar__outside-days":"tedi-calendar__outside-days-703857de","tedi-calendar__picker-grid":"tedi-calendar__picker-grid-9b167adf","tedi-calendar__picker-grid-header":"tedi-calendar__picker-grid-header-30f8748f","tedi-calendar__picker--no-navigation":"tedi-calendar__picker--no-navigation-695a34ca","tedi-calendar__grid-button":"tedi-calendar__grid-button-889a2a85","tedi-calendar__grid-button--selected":"tedi-calendar__grid-button--selected-2019301b"};exports.default=e;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = {
|
|
2
2
|
"tedi-calendar__picker-grid-container": "tedi-calendar__picker-grid-container-1b2bfc55",
|
|
3
3
|
"tedi-calendar__week-number": "tedi-calendar__week-number-c1a67f28",
|
|
4
4
|
"tedi-calendar__day": "tedi-calendar__day-baa13412",
|
|
5
5
|
"tedi-calendar__weekday": "tedi-calendar__weekday-9dce46ba",
|
|
6
6
|
"tedi-calendar": "tedi-calendar-a8c2a0a4",
|
|
7
|
+
"tedi-calendar--borderless": "tedi-calendar--borderless-22d5d627",
|
|
7
8
|
"tedi-calendar__months-container": "tedi-calendar__months-container-793f3f7b",
|
|
8
9
|
"tedi-calendar__month": "tedi-calendar__month-b0e4d350",
|
|
9
10
|
"tedi-calendar__footer": "tedi-calendar__footer-bb297fb5",
|
|
@@ -24,5 +25,5 @@ const a = {
|
|
|
24
25
|
"tedi-calendar__grid-button--selected": "tedi-calendar__grid-button--selected-2019301b"
|
|
25
26
|
};
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
+
e as default
|
|
28
29
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),e=t.createContext(null);exports.FilterGroupContext=e;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface FilterGroupContextValue {
|
|
2
|
+
isManaged: boolean;
|
|
3
|
+
multiselect: boolean;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
isSelected: (value: string) => boolean;
|
|
6
|
+
selectFilter: (value: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const FilterGroupContext: import('react').Context<FilterGroupContextValue | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),N=require("../../../../../external/classnames/index.cjs.js"),a=require("react"),P=require("./filter.module.scss.cjs.js"),C=require("./filter-group-context.cjs.js"),G=new Set,F=S=>{const{label:d,ariaLabelledBy:p,disabled:v=!1,className:g,children:q,multiselect:t=!1,value:l,defaultValue:f,onValueChange:o,values:s,defaultValues:x,onValuesChange:n}=S,u=l!==void 0||f!==void 0||o!==void 0||s!==void 0||x!==void 0||n!==void 0||!!d||t,[h,j]=a.useState(f??null),[w,k]=a.useState(x??[]),c=l!==void 0?l:h,r=s!==void 0?s:w,m=a.useCallback(e=>{if(t){const i=r.includes(e)?r.filter(M=>M!==e):[...r,e];s===void 0&&k(i),n==null||n(i)}else{const i=c===e?null:e;l===void 0&&j(i),o==null||o(i)}},[t,r,c,s,l,n,o]),V=a.useCallback(e=>t?r.includes(e):c===e,[t,r,c]),B=a.useMemo(()=>({isManaged:u,multiselect:t,disabled:v,isSelected:V,selectFilter:m}),[u,t,v,V,m]),b=u?t?"group":"radiogroup":void 0;if(u&&!d&&!p){const e=b+"|"+(l??f??"")+"|"+t;G.has(e)||(G.add(e),console.warn(`[FilterGroup] role="${b}" needs an accessible name. Pass either \`label\` or \`ariaLabelledBy\` so screen readers can announce the group with context.`))}return y.jsx(C.FilterGroupContext.Provider,{value:B,children:y.jsx("div",{className:N.default(P.default["tedi-filter-group"],g),role:b,"aria-label":d,"aria-labelledby":p,children:q})})};F.displayName="FilterGroup";exports.FilterGroup=F;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface FilterGroupCommonProps {
|
|
3
|
+
/**
|
|
4
|
+
* Accessible label for the group, exposed as `aria-label` on the container.
|
|
5
|
+
*
|
|
6
|
+
* **Required when the group is managed** (single- or multi-select). The container then
|
|
7
|
+
* has `role="radiogroup"` / `role="group"`, and ARIA requires every role to carry an
|
|
8
|
+
* accessible name — otherwise screen readers announce e.g. "radio group" with no context.
|
|
9
|
+
* Use `ariaLabelledBy` instead if the name lives in an existing heading.
|
|
10
|
+
*
|
|
11
|
+
* Setting `label` also implicitly turns the group into managed mode.
|
|
12
|
+
*/
|
|
13
|
+
label?: string;
|
|
14
|
+
/**
|
|
15
|
+
* ID of an existing element that labels the group (alternative to `label`). Useful when
|
|
16
|
+
* the group is preceded by a heading that should also act as the accessible name —
|
|
17
|
+
* avoids duplicating the text. Sets `aria-labelledby` on the container.
|
|
18
|
+
*/
|
|
19
|
+
ariaLabelledBy?: string;
|
|
20
|
+
/**
|
|
21
|
+
* When `true`, every `<Filter>` inside the group is disabled, regardless of their own
|
|
22
|
+
* `disabled` props. Useful for "this section isn't applicable yet" UX.
|
|
23
|
+
*
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Extra class name appended to the group container `<div>`. Use this for spacing/layout;
|
|
29
|
+
* the per-filter radius and border-collapsing already comes from the group's own styles.
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
/**
|
|
33
|
+
* `<Filter>` children that participate in the group. Non-`<Filter>` nodes are rendered
|
|
34
|
+
* verbatim but do not contribute to the managed selection state.
|
|
35
|
+
*/
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
interface FilterGroupSingleProps extends FilterGroupCommonProps {
|
|
39
|
+
/**
|
|
40
|
+
* When `false` or omitted, the group enforces single-select (radio-like) semantics —
|
|
41
|
+
* picking a child deselects the others; re-clicking the active one toggles it to `null`.
|
|
42
|
+
*
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
multiselect?: false;
|
|
46
|
+
/**
|
|
47
|
+
* **Controlled** selected value. The string identifier matches the `value` prop on the
|
|
48
|
+
* `<Filter>` child you want highlighted, or `null` for "nothing selected".
|
|
49
|
+
*
|
|
50
|
+
* Pair with `onValueChange` to fully own the state.
|
|
51
|
+
*/
|
|
52
|
+
value?: string | null;
|
|
53
|
+
/**
|
|
54
|
+
* **Uncontrolled** initial selected value. Ignored once `value` is provided.
|
|
55
|
+
*/
|
|
56
|
+
defaultValue?: string | null;
|
|
57
|
+
/**
|
|
58
|
+
* Fires whenever the selected value changes — when a child is clicked, or when the
|
|
59
|
+
* currently-active child is re-clicked to toggle it back to `null`.
|
|
60
|
+
*/
|
|
61
|
+
onValueChange?: (value: string | null) => void;
|
|
62
|
+
values?: never;
|
|
63
|
+
defaultValues?: never;
|
|
64
|
+
onValuesChange?: never;
|
|
65
|
+
}
|
|
66
|
+
interface FilterGroupMultiProps extends FilterGroupCommonProps {
|
|
67
|
+
/**
|
|
68
|
+
* Set to `true` to switch the group into multi-select (toggle-group) semantics — multiple
|
|
69
|
+
* children can be active at once and `aria-pressed` is used in place of `aria-checked`.
|
|
70
|
+
*/
|
|
71
|
+
multiselect: true;
|
|
72
|
+
/**
|
|
73
|
+
* **Controlled** selected values array. Each entry should match the `value` prop of one
|
|
74
|
+
* `<Filter>` child. Order is preserved as the user toggles entries.
|
|
75
|
+
*/
|
|
76
|
+
values?: string[];
|
|
77
|
+
/**
|
|
78
|
+
* **Uncontrolled** initial selected values array. Ignored once `values` is provided.
|
|
79
|
+
*/
|
|
80
|
+
defaultValues?: string[];
|
|
81
|
+
/**
|
|
82
|
+
* Fires whenever the selected values array changes (any child toggled on or off).
|
|
83
|
+
*/
|
|
84
|
+
onValuesChange?: (values: string[]) => void;
|
|
85
|
+
value?: never;
|
|
86
|
+
defaultValue?: never;
|
|
87
|
+
onValueChange?: never;
|
|
88
|
+
}
|
|
89
|
+
export type FilterGroupProps = FilterGroupSingleProps | FilterGroupMultiProps;
|
|
90
|
+
export declare const FilterGroup: {
|
|
91
|
+
(props: FilterGroupProps): JSX.Element;
|
|
92
|
+
displayName: string;
|
|
93
|
+
};
|
|
94
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import L from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import n from "react";
|
|
4
|
+
import M from "./filter.module.scss.es.js";
|
|
5
|
+
import { FilterGroupContext as P } from "./filter-group-context.es.js";
|
|
6
|
+
const F = /* @__PURE__ */ new Set(), _ = (G) => {
|
|
7
|
+
const {
|
|
8
|
+
label: d,
|
|
9
|
+
ariaLabelledBy: p,
|
|
10
|
+
disabled: b = !1,
|
|
11
|
+
className: h,
|
|
12
|
+
children: w,
|
|
13
|
+
multiselect: l = !1,
|
|
14
|
+
value: o,
|
|
15
|
+
defaultValue: f,
|
|
16
|
+
onValueChange: r,
|
|
17
|
+
values: s,
|
|
18
|
+
defaultValues: v,
|
|
19
|
+
onValuesChange: a
|
|
20
|
+
} = G, c = o !== void 0 || f !== void 0 || r !== void 0 || s !== void 0 || v !== void 0 || a !== void 0 || !!d || l, [N, S] = n.useState(f ?? null), [g, k] = n.useState(v ?? []), u = o !== void 0 ? o : N, t = s !== void 0 ? s : g, V = n.useCallback(
|
|
21
|
+
(e) => {
|
|
22
|
+
if (l) {
|
|
23
|
+
const i = t.includes(e) ? t.filter((I) => I !== e) : [...t, e];
|
|
24
|
+
s === void 0 && k(i), a == null || a(i);
|
|
25
|
+
} else {
|
|
26
|
+
const i = u === e ? null : e;
|
|
27
|
+
o === void 0 && S(i), r == null || r(i);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
[l, t, u, s, o, a, r]
|
|
31
|
+
), x = n.useCallback(
|
|
32
|
+
(e) => l ? t.includes(e) : u === e,
|
|
33
|
+
[l, t, u]
|
|
34
|
+
), B = n.useMemo(
|
|
35
|
+
() => ({
|
|
36
|
+
isManaged: c,
|
|
37
|
+
multiselect: l,
|
|
38
|
+
disabled: b,
|
|
39
|
+
isSelected: x,
|
|
40
|
+
selectFilter: V
|
|
41
|
+
}),
|
|
42
|
+
[c, l, b, x, V]
|
|
43
|
+
), m = c ? l ? "group" : "radiogroup" : void 0;
|
|
44
|
+
if (c && !d && !p) {
|
|
45
|
+
const e = m + "|" + (o ?? f ?? "") + "|" + l;
|
|
46
|
+
F.has(e) || (F.add(e), console.warn(
|
|
47
|
+
`[FilterGroup] role="${m}" needs an accessible name. Pass either \`label\` or \`ariaLabelledBy\` so screen readers can announce the group with context.`
|
|
48
|
+
));
|
|
49
|
+
}
|
|
50
|
+
return /* @__PURE__ */ y(P.Provider, { value: B, children: /* @__PURE__ */ y(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: L(M["tedi-filter-group"], h),
|
|
54
|
+
role: m,
|
|
55
|
+
"aria-label": d,
|
|
56
|
+
"aria-labelledby": p,
|
|
57
|
+
children: w
|
|
58
|
+
}
|
|
59
|
+
) });
|
|
60
|
+
};
|
|
61
|
+
_.displayName = "FilterGroup";
|
|
62
|
+
export {
|
|
63
|
+
_ as FilterGroup
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),oe=require("../../../../../external/classnames/index.cjs.js"),l=require("react"),ce=require("../../base/icon/icon.cjs.js"),E=require("../../buttons/button/button.cjs.js"),de=require("../../form/checkbox/checkbox.cjs.js"),We=require("../../form/search/search.cjs.js"),d=require("../../overlays/dropdown/dropdown.cjs.js"),Ze=require("../../tags/status-badge/status-badge.cjs.js"),n=require("./filter.module.scss.cjs.js"),He=require("./filter-group-context.cjs.js"),Je=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),Ke=require("../../../providers/label-provider/use-labels.cjs.js"),ue=v=>v==="large"?24:18,Qe=v=>{const b=l.useId();return v??`tedi-filter-${b.replace(/[^a-zA-Z0-9-]/g,"")}`},W=l.forwardRef((v,b)=>{const{getCurrentBreakpointProps:fe}=Je.useBreakpointProps(v.defaultServerBreakpoint),{text:g,value:_,disabled:he=!1,className:pe,id:Z,selected:k,defaultSelected:H=!1,onSelectedChange:C,selectedValue:j,defaultSelectedValue:me,onSelectedValueChange:u,multiselect:J=!1,selectedValues:f,defaultSelectedValues:be,onSelectedValuesChange:a,options:S=[],searchable:xe=!1,showSelectAll:ve=!1,selectAllLabel:ge,showClear:K=!1,clearLabel:je,preserveLabel:Q=!1,children:U,onClear:B,prepend:y,hidePrependWhenSelected:Se=!0,append:I,placement:we="bottom-start",variant:_e="primary",size:D="default",searchLabel:V}=fe(v),{getLabel:X}=Ke.useLabels(),ke=ge??X("filter.select-all"),Y=je??X("filter.clear-selection"),i=l.useContext(He.FilterGroupContext),L=Qe(Z),Ce=l.useRef(null),P=S.length>0,F=!!U,x=P||F,h=P&&!J,p=P&&J,N=!!(i!=null&&i.isManaged)&&_!==void 0&&!x,O=N&&!(i!=null&&i.multiselect),ee=he||((i==null?void 0:i.disabled)??!1),[Le,Fe]=l.useState(H),[Ne,te]=l.useState(me??""),[Be,T]=l.useState(be??[]);F&&(H||C)&&k===void 0&&console.warn("[Filter] `defaultSelected` and `onSelectedChange` are not honoured in custom-content mode (when `children` is provided). Drive the selected state yourself via the controlled `selected` prop, e.g. `selected={Boolean(value)}`.");const M=k!==void 0?k:Le,m=j!==void 0?j:Ne,r=f!==void 0?f:Be,w=l.useMemo(()=>N?i.isSelected(_):p?r.length>0:h?m!=="":M,[N,_,i,p,r,h,m,M]),q=l.useMemo(()=>{var e;return!h||!m?null:((e=S.find(s=>s.value===m))==null?void 0:e.label)??null},[h,m,S]),Me=l.useMemo(()=>h?q&&Q?`${g}: ${q}`:q??g:g,[h,q,Q,g]),[$,le]=l.useState(!1),[z,se]=l.useState("");l.useEffect(()=>{$||se("")},[$]);const R=l.useMemo(()=>{const e=z.trim().toLowerCase();return e?S.filter(s=>s.label.toLowerCase().includes(e)):S},[z,S]),o=l.useMemo(()=>R.filter(e=>!e.disabled),[R]),A=l.useMemo(()=>o.length===0?!1:o.every(e=>r.includes(e.value)),[o,r]),qe=l.useMemo(()=>{if(o.length===0)return!1;const e=o.filter(s=>r.includes(s.value)).length;return e>0&&e<o.length},[o,r]),ye=l.useCallback(e=>{Ce.current=e,typeof b=="function"?b(e):b&&(b.current=e)},[b]),Ie=l.useCallback(()=>{if(N){i.selectFilter(_);return}const e=!M;k===void 0&&Fe(e),C==null||C(e)},[N,i,_,M,k,C]),De=l.useCallback(e=>{const s=m===e?"":e;j===void 0&&te(s),u==null||u(s)},[m,j,u]),Pe=l.useCallback(e=>{const s=r.includes(e)?r.filter(c=>c!==e):[...r,e];f===void 0&&T(s),a==null||a(s)},[r,f,a]),Oe=l.useCallback(()=>{let e;if(A){const s=new Set(o.map(c=>c.value));e=r.filter(c=>!s.has(c))}else{const s=new Set(r);o.forEach(c=>s.add(c.value)),e=[...s]}f===void 0&&T(e),a==null||a(e)},[A,o,r,f,a]),re=l.useCallback(()=>{F?B==null||B():p?(f===void 0&&T([]),a==null||a([])):h&&(j===void 0&&te(""),u==null||u("")),le(!1)},[F,B,p,f,a,h,j,u]),Te=w&&Se,$e=O?"radio":void 0,ze=O?w:void 0,Re=!x&&!O?w:void 0,Ae=t.jsxs(t.Fragment,{children:[!x&&w&&t.jsx(ce.Icon,{className:n.default["tedi-filter__icon"],name:"check",size:ue(D),color:"inherit"}),y!=null&&t.jsx("span",{className:oe.default(n.default["tedi-filter__prepend"],{[n.default["tedi-filter__prepend--hidden"]]:Te}),children:y}),t.jsx("span",{className:n.default["tedi-filter__text"],children:Me}),I!=null&&t.jsx("span",{className:n.default["tedi-filter__append"],children:I}),p&&w&&r.length>0&&t.jsx(Ze.StatusBadge,{className:n.default["tedi-filter__count"],color:ee?"neutral":"brand",children:String(r.length)}),x&&t.jsx(ce.Icon,{className:n.default["tedi-filter__icon"],name:"arrow_drop_down",filled:!0,size:ue(D),color:"inherit"})]}),ne=oe.default(n.default["tedi-filter"],n.default[`tedi-filter--${_e}`],D==="large"&&n.default["tedi-filter--large"],w&&n.default["tedi-filter--selected"],pe),ie=t.jsx(E.Button,{ref:ye,id:Z,type:"button",disabled:ee,className:n.default["tedi-filter__button"],onClick:x?void 0:Ie,role:x?void 0:$e,"aria-checked":ze,"aria-pressed":Re,noStyle:!0,children:Ae});if(!x)return t.jsx("div",{className:ne,children:ie});const G=p&&ve?0:null,Ge=G!==null?1:0,Ee=()=>R.map((e,s)=>{const c=p?r.includes(e.value):m===e.value,ae=s+Ge;return p?t.jsx(d.Dropdown.Item,{index:ae,asChild:!0,disabled:e.disabled,closeOnSelect:!1,children:t.jsx(de.Checkbox,{id:`${L}-option-${s}`,label:e.label,value:e.value,checked:c,disabled:e.disabled,onChange:()=>Pe(e.value),name:`${L}-options`})},e.value):t.jsx(d.Dropdown.Item,{index:ae,disabled:e.disabled,active:c,onClick:()=>De(e.value),children:e.label},e.value)});return t.jsx("div",{className:ne,children:t.jsxs(d.Dropdown,{open:$,onOpenChange:le,placement:we,width:"auto",children:[t.jsx(d.Dropdown.Trigger,{children:ie}),t.jsx(d.Dropdown.Content,{children:F?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:n.default["tedi-filter-dropdown__custom-content"],children:U}),K&&t.jsxs(t.Fragment,{children:[t.jsx(d.Dropdown.Separator,{}),t.jsx("div",{className:n.default["tedi-filter-dropdown__clear"],children:t.jsx(E.Button,{visualType:"neutral",size:"small",type:"button",iconLeft:"refresh",onClick:re,children:Y})})]})]}):t.jsxs(t.Fragment,{children:[xe&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:n.default["tedi-filter-dropdown__search"],children:t.jsx(We.Search,{id:`${L}-search`,label:V??g,hideLabel:!0,ariaLabel:V??g,value:z,onChange:se})}),t.jsx(d.Dropdown.Separator,{})]}),G!==null&&t.jsxs(t.Fragment,{children:[t.jsx(d.Dropdown.Item,{index:G,asChild:!0,closeOnSelect:!1,children:t.jsx(de.Checkbox,{id:`${L}-select-all`,label:ke,value:"select-all",checked:A,indeterminate:qe,onChange:Oe,name:`${L}-select-all`})}),t.jsx(d.Dropdown.Separator,{})]}),Ee(),K&&t.jsxs(t.Fragment,{children:[t.jsx(d.Dropdown.Separator,{}),t.jsx("div",{className:n.default["tedi-filter-dropdown__clear"],children:t.jsx(E.Button,{visualType:"neutral",size:"small",type:"button",iconLeft:"refresh",onClick:re,children:Y})})]})]})})]})})});W.displayName="Filter";exports.Filter=W;exports.default=W;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BreakpointSupport } from '../../../helpers';
|
|
3
|
+
import { Dropdown } from '../../overlays/dropdown/dropdown';
|
|
4
|
+
export type FilterVariant = 'primary' | 'secondary';
|
|
5
|
+
export type FilterSize = 'default' | 'large';
|
|
6
|
+
export interface FilterOption {
|
|
7
|
+
/** Display label of the option. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Stable identifier returned via selection callbacks. */
|
|
10
|
+
value: string;
|
|
11
|
+
/** Whether the option cannot be selected. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
type FilterBreakpointProps = {
|
|
15
|
+
/**
|
|
16
|
+
* Visual variant of the filter.
|
|
17
|
+
* @default primary
|
|
18
|
+
*/
|
|
19
|
+
variant?: FilterVariant;
|
|
20
|
+
/**
|
|
21
|
+
* Visual size of the filter.
|
|
22
|
+
* @default default
|
|
23
|
+
*/
|
|
24
|
+
size?: FilterSize;
|
|
25
|
+
};
|
|
26
|
+
export interface FilterProps extends BreakpointSupport<FilterBreakpointProps> {
|
|
27
|
+
/** Trigger label. In single-select mode it's replaced by the picked option (or prefixed when `preserveLabel`). */
|
|
28
|
+
text: string;
|
|
29
|
+
/** Identifier for participating in a managed `<FilterGroup>`. Unused outside a group. */
|
|
30
|
+
value?: string;
|
|
31
|
+
/** @default false */
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
/** Class on the root wrapper `<div>` (not the inner `<button>`). */
|
|
34
|
+
className?: string;
|
|
35
|
+
/** Trigger `<button>` id. Auto-generated when omitted; also used as a prefix for sub-element ids. */
|
|
36
|
+
id?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Selected appearance.
|
|
39
|
+
* - Toggle mode (no `options`, no `children`): controlled or uncontrolled (`defaultSelected`).
|
|
40
|
+
* - Custom-content mode (`children`): controlled-only — derive it from your own state.
|
|
41
|
+
* - Dropdown mode (`options`): ignored; derived from `selectedValue` / `selectedValues`.
|
|
42
|
+
*/
|
|
43
|
+
selected?: boolean;
|
|
44
|
+
/** Toggle-mode initial state. Ignored when `selected` is set. @default false */
|
|
45
|
+
defaultSelected?: boolean;
|
|
46
|
+
/** Toggle-mode change callback. Not fired in custom-content or dropdown modes. */
|
|
47
|
+
onSelectedChange?: (selected: boolean) => void;
|
|
48
|
+
/** Single-select controlled value (`''` = nothing selected). Pair with `options`. */
|
|
49
|
+
selectedValue?: string;
|
|
50
|
+
/** Single-select initial value. Ignored when `selectedValue` is set. */
|
|
51
|
+
defaultSelectedValue?: string;
|
|
52
|
+
/** Single-select change callback — fires on commit or clear (`''`). */
|
|
53
|
+
onSelectedValueChange?: (value: string) => void;
|
|
54
|
+
/** Switch the dropdown to multi-select (checkboxes). Requires `options`. @default false */
|
|
55
|
+
multiselect?: boolean;
|
|
56
|
+
/** Multi-select controlled values. */
|
|
57
|
+
selectedValues?: string[];
|
|
58
|
+
/** Multi-select initial values. Ignored when `selectedValues` is set. */
|
|
59
|
+
defaultSelectedValues?: string[];
|
|
60
|
+
/** Multi-select change callback — fires on toggle, "Select all", or clear. */
|
|
61
|
+
onSelectedValuesChange?: (values: string[]) => void;
|
|
62
|
+
/** Dropdown options. Mutually exclusive with `children` (children wins if both). */
|
|
63
|
+
options?: FilterOption[];
|
|
64
|
+
/** Search input that filters `options` by label (case-insensitive substring). @default false */
|
|
65
|
+
searchable?: boolean;
|
|
66
|
+
/** Multi-select "Select all" toggle; targets enabled + visible options. @default false */
|
|
67
|
+
showSelectAll?: boolean;
|
|
68
|
+
/** Override the `filter.select-all` i18n label. */
|
|
69
|
+
selectAllLabel?: string;
|
|
70
|
+
/**
|
|
71
|
+
* "Clear selection" button below the panel. Dropdown modes clear automatically;
|
|
72
|
+
* custom-content mode delegates to `onClear`. @default false
|
|
73
|
+
*/
|
|
74
|
+
showClear?: boolean;
|
|
75
|
+
/** Override the `filter.clear-selection` i18n label. */
|
|
76
|
+
clearLabel?: string;
|
|
77
|
+
/** Single-select: keep `text` as a prefix once a value is picked ("Teenus: …"). @default false */
|
|
78
|
+
preserveLabel?: boolean;
|
|
79
|
+
/** Custom dropdown content. Switches the filter into controlled custom-content mode. */
|
|
80
|
+
children?: React.ReactNode;
|
|
81
|
+
/** Fires when "Clear" is clicked in custom-content mode — reset your own state here. */
|
|
82
|
+
onClear?: () => void;
|
|
83
|
+
/**
|
|
84
|
+
* Slot before `text` (icon, status). Auto-replaced by a check icon when toggle-mode
|
|
85
|
+
* selected — disable via `hidePrependWhenSelected={false}`.
|
|
86
|
+
*/
|
|
87
|
+
prepend?: React.ReactNode;
|
|
88
|
+
/** Hide `prepend` while selected so the check icon can take its place. @default true */
|
|
89
|
+
hidePrependWhenSelected?: boolean;
|
|
90
|
+
/** Slot after `text`. In multi-select sits alongside the built-in count badge. */
|
|
91
|
+
append?: React.ReactNode;
|
|
92
|
+
/** Floating UI placement; flips when room is tight. @default bottom-start */
|
|
93
|
+
placement?: React.ComponentProps<typeof Dropdown>['placement'];
|
|
94
|
+
/** Accessible label for the search input. Falls back to `text`. */
|
|
95
|
+
searchLabel?: string;
|
|
96
|
+
}
|
|
97
|
+
export declare const Filter: React.ForwardRefExoticComponent<FilterProps & React.RefAttributes<HTMLButtonElement>>;
|
|
98
|
+
export default Filter;
|