@algolia/satellite 1.0.0-beta.132 → 1.0.0-beta.133
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/cjs/AnnouncementBadge/AnnouncementBadge.d.ts +1 -0
- package/cjs/AnnouncementBadge/AnnouncementBadge.js +3 -2
- package/cjs/AutoComplete/AutoComplete.d.ts +24 -14
- package/cjs/AutoComplete/AutoComplete.js +84 -15
- package/cjs/AutoComplete/components/DefaultOptionItem.d.ts +6 -2
- package/cjs/AutoComplete/components/DefaultOptionItem.js +5 -2
- package/cjs/AutoComplete/types.d.ts +26 -18
- package/cjs/AutoComplete/utils.d.ts +4 -4
- package/cjs/DatePicker/DatePicker/DatePicker.d.ts +5 -11
- package/cjs/DatePicker/DatePicker/DatePicker.js +10 -6
- package/cjs/DatePicker/DateRangePicker/DateRangePicker.d.ts +5 -11
- package/cjs/DatePicker/DateRangePicker/DateRangePicker.js +12 -6
- package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +2 -0
- package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.js +3 -2
- package/cjs/DatePicker/components/Calendar.d.ts +4 -1
- package/cjs/DatePicker/components/Calendar.js +3 -1
- package/cjs/DatePicker/components/Display.d.ts +1 -1
- package/cjs/DatePicker/components/FooterActions.d.ts +2 -0
- package/cjs/DatePicker/components/FooterActions.js +4 -3
- package/cjs/DatePicker/components/Modal.d.ts +2 -2
- package/cjs/DatePicker/components/NavBar.d.ts +4 -1
- package/cjs/DatePicker/components/NavBar.js +4 -3
- package/cjs/DatePicker/types.d.ts +17 -0
- package/cjs/DatePicker/types.js +5 -0
- package/cjs/HelpUnderline/HelpUnderline.d.ts +1 -0
- package/cjs/KeyboardKey/KeyboardKey.d.ts +1 -0
- package/cjs/Modal/Modal.d.ts +4 -2
- package/cjs/Modal/Modal.js +2 -3
- package/cjs/Pagination/CompactPagination/CompactPagination.d.ts +12 -0
- package/cjs/Pagination/CompactPagination/CompactPagination.js +6 -6
- package/cjs/Pagination/DotPagination/DotPagination.d.ts +4 -1
- package/cjs/Pagination/DotPagination/DotPagination.js +5 -2
- package/cjs/Pagination/Pagination/Pagination.d.ts +7 -1
- package/cjs/Pagination/Pagination/Pagination.js +15 -8
- package/cjs/ScrollIndicator/ScrollIndicator.d.ts +2 -0
- package/cjs/Sidebar/Sidebar.d.ts +2 -0
- package/cjs/Tables/DataTable/DataTable.d.ts +11 -1
- package/cjs/Tables/DataTable/DataTable.js +3 -2
- package/cjs/Tables/DataTable/components/Body.d.ts +2 -2
- package/cjs/Tables/DataTable/components/Body.js +6 -5
- package/cjs/Tables/DataTable/components/Loader.d.ts +3 -1
- package/cjs/Tables/DataTable/components/Loader.js +4 -3
- package/cjs/Tag/Tag.d.ts +4 -1
- package/cjs/Tag/Tag.js +3 -2
- package/cjs/Tooltip/OverflowTooltipWrapper.d.ts +1 -0
- package/cjs/Tooltip/OverflowTooltipWrapper.js +1 -0
- package/cjs/utils/pluralize.js +6 -1
- package/esm/AnnouncementBadge/AnnouncementBadge.d.ts +1 -0
- package/esm/AnnouncementBadge/AnnouncementBadge.js +3 -2
- package/esm/AutoComplete/AutoComplete.d.ts +24 -14
- package/esm/AutoComplete/AutoComplete.js +85 -15
- package/esm/AutoComplete/components/DefaultOptionItem.d.ts +6 -2
- package/esm/AutoComplete/components/DefaultOptionItem.js +5 -2
- package/esm/AutoComplete/types.d.ts +26 -18
- package/esm/AutoComplete/utils.d.ts +4 -4
- package/esm/DatePicker/DatePicker/DatePicker.d.ts +5 -11
- package/esm/DatePicker/DatePicker/DatePicker.js +10 -6
- package/esm/DatePicker/DateRangePicker/DateRangePicker.d.ts +5 -11
- package/esm/DatePicker/DateRangePicker/DateRangePicker.js +12 -6
- package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +2 -0
- package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.js +3 -2
- package/esm/DatePicker/components/Calendar.d.ts +4 -1
- package/esm/DatePicker/components/Calendar.js +3 -1
- package/esm/DatePicker/components/Display.d.ts +1 -1
- package/esm/DatePicker/components/FooterActions.d.ts +2 -0
- package/esm/DatePicker/components/FooterActions.js +4 -3
- package/esm/DatePicker/components/Modal.d.ts +2 -2
- package/esm/DatePicker/components/NavBar.d.ts +4 -1
- package/esm/DatePicker/components/NavBar.js +4 -3
- package/esm/DatePicker/types.d.ts +17 -0
- package/esm/DatePicker/types.js +1 -0
- package/esm/HelpUnderline/HelpUnderline.d.ts +1 -0
- package/esm/KeyboardKey/KeyboardKey.d.ts +1 -0
- package/esm/Modal/Modal.d.ts +4 -2
- package/esm/Modal/Modal.js +2 -3
- package/esm/Pagination/CompactPagination/CompactPagination.d.ts +12 -0
- package/esm/Pagination/CompactPagination/CompactPagination.js +6 -6
- package/esm/Pagination/DotPagination/DotPagination.d.ts +4 -1
- package/esm/Pagination/DotPagination/DotPagination.js +5 -2
- package/esm/Pagination/Pagination/Pagination.d.ts +7 -1
- package/esm/Pagination/Pagination/Pagination.js +15 -8
- package/esm/ScrollIndicator/ScrollIndicator.d.ts +2 -0
- package/esm/Sidebar/Sidebar.d.ts +2 -0
- package/esm/Tables/DataTable/DataTable.d.ts +11 -1
- package/esm/Tables/DataTable/DataTable.js +3 -2
- package/esm/Tables/DataTable/components/Body.d.ts +2 -2
- package/esm/Tables/DataTable/components/Body.js +6 -5
- package/esm/Tables/DataTable/components/Loader.d.ts +3 -1
- package/esm/Tables/DataTable/components/Loader.js +4 -3
- package/esm/Tag/Tag.d.ts +4 -1
- package/esm/Tag/Tag.js +3 -2
- package/esm/Tooltip/OverflowTooltipWrapper.d.ts +1 -0
- package/esm/Tooltip/OverflowTooltipWrapper.js +2 -0
- package/esm/utils/pluralize.js +6 -1
- package/package.json +1 -1
- package/satellite.min.css +1 -1
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { Dispatch, FunctionComponent, ReactNode } from "react";
|
2
|
-
import { CalendarProps } from "../components/Calendar";
|
3
|
-
import {
|
4
|
-
import { DateRangePickerDisplayProps } from "./DateRangePickerDisplay";
|
2
|
+
import type { CalendarProps } from "../components/Calendar";
|
3
|
+
import type { SharedDatePickerProps } from "../types";
|
4
|
+
import type { DateRangePickerDisplayProps } from "./DateRangePickerDisplay";
|
5
5
|
import { dateRangePickerReducer, DateRangePickerReducerAction, DateRangePickerReducerState } from "./dateRangePickerReducer";
|
6
|
-
import { DateRangePickerTimeRange } from "./dateRangePickerTimeRange";
|
6
|
+
import type { DateRangePickerTimeRange } from "./dateRangePickerTimeRange";
|
7
7
|
interface LeftFooterComponentArgs {
|
8
8
|
state: DateRangePickerReducerState;
|
9
9
|
dispatch: Dispatch<DateRangePickerReducerAction>;
|
@@ -29,12 +29,6 @@ export declare type DateRangePickerProps = {
|
|
29
29
|
renderLeftFooter?: (args: LeftFooterComponentArgs) => ReactNode;
|
30
30
|
renderRightPanel?: (args: RightSidePanelComponentArgs) => ReactNode;
|
31
31
|
buttonSize?: DateRangePickerDisplayProps["buttonSize"];
|
32
|
-
|
33
|
-
} & ({
|
34
|
-
editableYear?: false;
|
35
|
-
} | {
|
36
|
-
editableYear: true;
|
37
|
-
years?: number[];
|
38
|
-
});
|
32
|
+
} & SharedDatePickerProps;
|
39
33
|
declare const DateRangePicker: FunctionComponent<DateRangePickerProps>;
|
40
34
|
export default DateRangePicker;
|
@@ -5,7 +5,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
5
5
|
|
6
6
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
7
7
|
|
8
|
-
var _excluded = ["id", "range", "displayOnlyRanges", "calendarProps", "initialState", "stateReducer", "onAction", "validate", "renderTarget", "renderLeftFooter", "renderRightPanel", "buttonSize", "modalPlacement"];
|
8
|
+
var _excluded = ["id", "range", "displayOnlyRanges", "calendarProps", "initialState", "stateReducer", "onAction", "validate", "renderTarget", "renderLeftFooter", "renderRightPanel", "buttonSize", "modalPlacement", "locale"];
|
9
9
|
|
10
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
11
11
|
|
@@ -50,6 +50,7 @@ var DateRangePicker = function DateRangePicker(_ref2) {
|
|
50
50
|
renderRightPanel = _ref2.renderRightPanel,
|
51
51
|
buttonSize = _ref2.buttonSize,
|
52
52
|
modalPlacement = _ref2.modalPlacement,
|
53
|
+
locale = _ref2.locale,
|
53
54
|
props = _objectWithoutProperties(_ref2, _excluded);
|
54
55
|
|
55
56
|
var _useState = useState(null),
|
@@ -184,7 +185,8 @@ var DateRangePicker = function DateRangePicker(_ref2) {
|
|
184
185
|
start: null,
|
185
186
|
end: null
|
186
187
|
},
|
187
|
-
buttonSize: buttonSize
|
188
|
+
buttonSize: buttonSize,
|
189
|
+
locale: locale
|
188
190
|
})
|
189
191
|
}), /*#__PURE__*/_jsx(Modal, {
|
190
192
|
className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["date-range-picker"]))),
|
@@ -202,7 +204,7 @@ var DateRangePicker = function DateRangePicker(_ref2) {
|
|
202
204
|
children: /*#__PURE__*/_jsxs("div", {
|
203
205
|
className: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["flex"]))),
|
204
206
|
children: [/*#__PURE__*/_jsxs("div", {
|
205
|
-
children: [/*#__PURE__*/_jsx(Calendar, _objectSpread(_objectSpread({
|
207
|
+
children: [/*#__PURE__*/_jsx(Calendar, _objectSpread(_objectSpread(_objectSpread({
|
206
208
|
numberOfMonths: 2
|
207
209
|
}, calendarProps), {}, {
|
208
210
|
selectedDays: selectedDays,
|
@@ -210,7 +212,9 @@ var DateRangePicker = function DateRangePicker(_ref2) {
|
|
210
212
|
onDayClick: handleDayClick,
|
211
213
|
onDayMouseEnter: handleMouseEnter,
|
212
214
|
onDayMouseLeave: handleMouseLeave
|
213
|
-
}, yearProps)
|
215
|
+
}, yearProps), {}, {
|
216
|
+
locale: locale
|
217
|
+
})), /*#__PURE__*/_jsxs(Footer, {
|
214
218
|
children: [renderLeftFooter && /*#__PURE__*/_jsx("div", {
|
215
219
|
children: renderLeftFooter({
|
216
220
|
state: state,
|
@@ -219,7 +223,8 @@ var DateRangePicker = function DateRangePicker(_ref2) {
|
|
219
223
|
}), !renderRightPanel && /*#__PURE__*/_jsx(FooterActions, {
|
220
224
|
onCancel: handleCancel,
|
221
225
|
onApply: handleApply,
|
222
|
-
disableApply: !isValid
|
226
|
+
disableApply: !isValid,
|
227
|
+
locale: locale
|
223
228
|
})]
|
224
229
|
})]
|
225
230
|
}), renderRightPanel && /*#__PURE__*/_jsxs(_Fragment, {
|
@@ -232,7 +237,8 @@ var DateRangePicker = function DateRangePicker(_ref2) {
|
|
232
237
|
}), /*#__PURE__*/_jsx(FooterActions, {
|
233
238
|
onCancel: handleCancel,
|
234
239
|
onApply: handleApply,
|
235
|
-
disableApply: !isValid
|
240
|
+
disableApply: !isValid,
|
241
|
+
locale: locale
|
236
242
|
})]
|
237
243
|
})]
|
238
244
|
})]
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import type { FunctionComponent } from "react";
|
2
2
|
import { DisplayProps } from "../components/Display";
|
3
|
+
import type { DatePickerLocale } from "../types";
|
3
4
|
import { DateRangePickerTimeRange } from "./dateRangePickerTimeRange";
|
4
5
|
export interface DateRangePickerDisplayProps {
|
5
6
|
id?: string;
|
6
7
|
onClick: DisplayProps["onClick"];
|
7
8
|
range: DateRangePickerTimeRange;
|
8
9
|
buttonSize?: DisplayProps["size"];
|
10
|
+
locale?: DatePickerLocale;
|
9
11
|
}
|
10
12
|
declare const DateRangePickerDisplay: FunctionComponent<DateRangePickerDisplayProps>;
|
11
13
|
export default DateRangePickerDisplay;
|
@@ -14,7 +14,8 @@ var DateRangePickerDisplay = function DateRangePickerDisplay(_ref) {
|
|
14
14
|
var id = _ref.id,
|
15
15
|
onClick = _ref.onClick,
|
16
16
|
range = _ref.range,
|
17
|
-
buttonSize = _ref.buttonSize
|
17
|
+
buttonSize = _ref.buttonSize,
|
18
|
+
locale = _ref.locale;
|
18
19
|
return /*#__PURE__*/_jsx(Display, {
|
19
20
|
id: id,
|
20
21
|
onClick: onClick,
|
@@ -29,7 +30,7 @@ var DateRangePickerDisplay = function DateRangePickerDisplay(_ref) {
|
|
29
30
|
dateTime: range.end.toISOString(),
|
30
31
|
children: formatDate(range.end)
|
31
32
|
})]
|
32
|
-
}) : "Enter a date period..."
|
33
|
+
}) : (locale === null || locale === void 0 ? void 0 : locale.openButton) || "Enter a date period..."
|
33
34
|
});
|
34
35
|
};
|
35
36
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { FunctionComponent } from "react";
|
2
2
|
import { DayPickerProps } from "react-day-picker";
|
3
|
+
import type { DatePickerLocale } from "../types";
|
3
4
|
declare type ExcludedDayPickerProps = "captionElement" | "showOutsideDays" | "enableOutsideDaysClick" | "fixedWeeks" | "labels" | "navbarElement" | "onTodayButtonClick" | "pagedNavigation" | "renderDay" | "renderWeek" | "reverseMonths" | "showWeekNumbers" | "showWeekDays" | "todayButton" | "weekdayElement" | "weekdaysLong" | "weekdaysShort";
|
4
5
|
export declare type EditableYearProps = {
|
5
6
|
editableYear?: false;
|
@@ -8,6 +9,8 @@ export declare type EditableYearProps = {
|
|
8
9
|
years?: number[];
|
9
10
|
initialDate?: Date;
|
10
11
|
};
|
11
|
-
export declare type CalendarProps = Omit<DayPickerProps, ExcludedDayPickerProps> & EditableYearProps
|
12
|
+
export declare type CalendarProps = Omit<Omit<DayPickerProps, "locale">, ExcludedDayPickerProps> & EditableYearProps & {
|
13
|
+
locale?: DatePickerLocale;
|
14
|
+
};
|
12
15
|
declare const Calendar: FunctionComponent<CalendarProps>;
|
13
16
|
export default Calendar;
|
@@ -60,7 +60,9 @@ var Calendar = function Calendar(props) {
|
|
60
60
|
enableOutsideDaysClick: false,
|
61
61
|
fixedWeeks: false,
|
62
62
|
navbarElement: function navbarElement(navBarProps) {
|
63
|
-
return /*#__PURE__*/_jsx(NavBar, _objectSpread(_objectSpread({}, navBarProps), yearsProps)
|
63
|
+
return /*#__PURE__*/_jsx(NavBar, _objectSpread(_objectSpread(_objectSpread({}, navBarProps), yearsProps), {}, {
|
64
|
+
locale: props.locale
|
65
|
+
}));
|
64
66
|
},
|
65
67
|
captionElement: function captionElement() {
|
66
68
|
return null;
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import type { FunctionComponent } from "react";
|
2
2
|
import { ButtonProps } from "../../Button";
|
3
|
+
import type { DatePickerLocale } from "../types";
|
3
4
|
export interface FooterActionsProps {
|
4
5
|
onCancel: ButtonProps["onClick"];
|
5
6
|
onApply: ButtonProps["onClick"];
|
6
7
|
disableApply: boolean;
|
8
|
+
locale?: DatePickerLocale;
|
7
9
|
}
|
8
10
|
declare const FooterActions: FunctionComponent<FooterActionsProps>;
|
9
11
|
export default FooterActions;
|
@@ -10,18 +10,19 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
var FooterActions = function FooterActions(_ref) {
|
11
11
|
var onCancel = _ref.onCancel,
|
12
12
|
onApply = _ref.onApply,
|
13
|
-
disableApply = _ref.disableApply
|
13
|
+
disableApply = _ref.disableApply,
|
14
|
+
locale = _ref.locale;
|
14
15
|
return /*#__PURE__*/_jsxs("div", {
|
15
16
|
className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["ml-auto flex justify-end"]))),
|
16
17
|
children: [/*#__PURE__*/_jsx(Button, {
|
17
18
|
onClick: onCancel,
|
18
19
|
className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["mr-2"]))),
|
19
|
-
children: "Cancel"
|
20
|
+
children: (locale === null || locale === void 0 ? void 0 : locale.cancel) || "Cancel"
|
20
21
|
}), /*#__PURE__*/_jsx(Button, {
|
21
22
|
disabled: disableApply,
|
22
23
|
onClick: onApply,
|
23
24
|
variant: "primary",
|
24
|
-
children: "Apply"
|
25
|
+
children: (locale === null || locale === void 0 ? void 0 : locale.apply) || "Apply"
|
25
26
|
})]
|
26
27
|
});
|
27
28
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { Placement, StrictModifiers } from "@popperjs/core";
|
2
2
|
import type { FC, ReactNode } from "react";
|
3
|
-
import { StrictModifier } from "react-popper";
|
4
|
-
import { ClickAwayContainerProps } from "../../ClickAwayContainer";
|
3
|
+
import type { StrictModifier } from "react-popper";
|
4
|
+
import type { ClickAwayContainerProps } from "../../ClickAwayContainer";
|
5
5
|
export interface ModalProps {
|
6
6
|
children: ReactNode;
|
7
7
|
show: boolean;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { FunctionComponent } from "react";
|
2
2
|
import type { NavbarElementProps } from "react-day-picker";
|
3
|
+
import type { DatePickerLocale } from "../types";
|
3
4
|
export declare type NavBarYearProps = {
|
4
5
|
editableYear?: false;
|
5
6
|
} | {
|
@@ -7,6 +8,8 @@ export declare type NavBarYearProps = {
|
|
7
8
|
years: number[];
|
8
9
|
onYearChange: (year: number) => void;
|
9
10
|
};
|
10
|
-
export declare type NavBarProps = NavbarElementProps & NavBarYearProps
|
11
|
+
export declare type NavBarProps = Omit<NavbarElementProps, "locale"> & NavBarYearProps & {
|
12
|
+
locale?: DatePickerLocale;
|
13
|
+
};
|
11
14
|
declare const NavBar: FunctionComponent<NavBarProps>;
|
12
15
|
export default NavBar;
|
@@ -4,7 +4,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
4
4
|
|
5
5
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
6
6
|
|
7
|
-
var _excluded = ["onPreviousClick", "onNextClick", "showPreviousButton", "showNextButton", "month", "localeUtils"];
|
7
|
+
var _excluded = ["onPreviousClick", "onNextClick", "showPreviousButton", "showNextButton", "month", "locale", "localeUtils"];
|
8
8
|
import cx from "classnames";
|
9
9
|
import { useMemo } from "react";
|
10
10
|
import { ChevronLeft, ChevronRight } from "react-feather";
|
@@ -19,6 +19,7 @@ var NavBar = function NavBar(_ref) {
|
|
19
19
|
showPreviousButton = _ref.showPreviousButton,
|
20
20
|
showNextButton = _ref.showNextButton,
|
21
21
|
month = _ref.month,
|
22
|
+
locale = _ref.locale,
|
22
23
|
localeUtils = _ref.localeUtils,
|
23
24
|
props = _objectWithoutProperties(_ref, _excluded);
|
24
25
|
|
@@ -39,7 +40,7 @@ var NavBar = function NavBar(_ref) {
|
|
39
40
|
className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["w-full top-3 left-0 pt-5 px-5 pb-2 flex justify-between"]))),
|
40
41
|
children: [/*#__PURE__*/_jsx(IconButton, {
|
41
42
|
icon: ChevronLeft,
|
42
|
-
title: "Previous month",
|
43
|
+
title: (locale === null || locale === void 0 ? void 0 : locale.previousMonth) || "Previous month",
|
43
44
|
onClick: function onClick() {
|
44
45
|
return onPreviousClick();
|
45
46
|
},
|
@@ -64,7 +65,7 @@ var NavBar = function NavBar(_ref) {
|
|
64
65
|
})
|
65
66
|
}), /*#__PURE__*/_jsx(IconButton, {
|
66
67
|
icon: ChevronRight,
|
67
|
-
title: "Next month",
|
68
|
+
title: (locale === null || locale === void 0 ? void 0 : locale.nextMonth) || "Next month",
|
68
69
|
onClick: function onClick() {
|
69
70
|
return onNextClick();
|
70
71
|
},
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import type { ModalProps } from "./components/Modal";
|
2
|
+
export declare type DatePickerLocale = {
|
3
|
+
openButton?: string;
|
4
|
+
cancel?: string;
|
5
|
+
apply?: string;
|
6
|
+
nextMonth?: string;
|
7
|
+
previousMonth?: string;
|
8
|
+
};
|
9
|
+
export declare type SharedDatePickerProps = {
|
10
|
+
modalPlacement?: ModalProps["placement"];
|
11
|
+
locale?: DatePickerLocale;
|
12
|
+
} & ({
|
13
|
+
editableYear?: false;
|
14
|
+
} | {
|
15
|
+
editableYear: true;
|
16
|
+
years?: number[];
|
17
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { FunctionComponent } from "react";
|
2
2
|
import { TooltipWrapperProps } from "../Tooltip";
|
3
3
|
export interface HelpUnderlineProps {
|
4
|
+
/** @ignore */
|
4
5
|
className?: string;
|
5
6
|
placement?: TooltipWrapperProps["placement"];
|
6
7
|
tooltipClassName?: TooltipWrapperProps["tooltipClassName"];
|
package/esm/Modal/Modal.d.ts
CHANGED
@@ -11,10 +11,12 @@ export interface ModalProps {
|
|
11
11
|
centerY?: boolean;
|
12
12
|
onDismiss?: () => void;
|
13
13
|
children: ReactNode;
|
14
|
-
|
14
|
+
locale?: {
|
15
|
+
dismissText?: string;
|
16
|
+
};
|
15
17
|
}
|
16
18
|
export declare const Modal: {
|
17
|
-
({ title, className, children, open, fullBleed, onDismiss, animate, hideCloseIcon, size, centerY,
|
19
|
+
({ title, className, children, open, fullBleed, onDismiss, animate, hideCloseIcon, size, centerY, locale, }: ModalProps): import("react").ReactPortal;
|
18
20
|
Footer: import("react").FunctionComponent<import("./components/ModalFooter").ModalFooterProps>;
|
19
21
|
};
|
20
22
|
export default Modal;
|
package/esm/Modal/Modal.js
CHANGED
@@ -66,8 +66,7 @@ export var Modal = function Modal(_ref) {
|
|
66
66
|
size = _ref$size === void 0 ? "medium" : _ref$size,
|
67
67
|
_ref$centerY = _ref.centerY,
|
68
68
|
centerY = _ref$centerY === void 0 ? false : _ref$centerY,
|
69
|
-
|
70
|
-
closeIconText = _ref$closeIconText === void 0 ? "Dismiss" : _ref$closeIconText;
|
69
|
+
locale = _ref.locale;
|
71
70
|
|
72
71
|
var _useState = useState(null),
|
73
72
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -142,7 +141,7 @@ export var Modal = function Modal(_ref) {
|
|
142
141
|
children: title
|
143
142
|
}), !hideCloseIcon && /*#__PURE__*/_jsx(IconButton, {
|
144
143
|
icon: X,
|
145
|
-
title:
|
144
|
+
title: (locale === null || locale === void 0 ? void 0 : locale.dismissText) || "Dismiss",
|
146
145
|
variant: "subtle",
|
147
146
|
onClick: onDismiss,
|
148
147
|
className: stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["flex-shrink-0 -mr-2"])))
|
@@ -1,5 +1,11 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
export declare type CompactPaginationLabel = "complete" | "compact" | "none";
|
3
|
+
declare type BaseLocaleProps = {
|
4
|
+
goToFirstPage?: string;
|
5
|
+
goToLastPage?: string;
|
6
|
+
goToNextPage?: string;
|
7
|
+
goToPreviousPage?: string;
|
8
|
+
};
|
3
9
|
declare type BaseCompactPaginationProps = {
|
4
10
|
/** Currently selected page (1 based index) */
|
5
11
|
currentPage: number;
|
@@ -10,9 +16,15 @@ declare type BaseCompactPaginationProps = {
|
|
10
16
|
export declare type DeterminateCompactPaginationProps = BaseCompactPaginationProps & {
|
11
17
|
nbPages: number;
|
12
18
|
showGoToLastPage?: boolean;
|
19
|
+
locale?: BaseLocaleProps & {
|
20
|
+
label?(page: number, nbPages: number): string;
|
21
|
+
};
|
13
22
|
};
|
14
23
|
export declare type IndeterminateCompactPaginationProps = BaseCompactPaginationProps & {
|
15
24
|
nextDisabled?: boolean;
|
25
|
+
locale?: BaseLocaleProps & {
|
26
|
+
label?(page: number): string;
|
27
|
+
};
|
16
28
|
};
|
17
29
|
export declare type CompactPaginationProps = DeterminateCompactPaginationProps | IndeterminateCompactPaginationProps;
|
18
30
|
export declare const isDeterminateCompactPaginationProps: (props: CompactPaginationProps) => props is DeterminateCompactPaginationProps;
|
@@ -14,24 +14,24 @@ export var isIndeterminateCompactPaginationProps = function isIndeterminateCompa
|
|
14
14
|
return !isDeterminateCompactPaginationProps(props);
|
15
15
|
};
|
16
16
|
export var CompactPagination = function CompactPagination(props) {
|
17
|
-
var _props$label;
|
17
|
+
var _props$label, _props$locale, _props$locale$label, _props$locale2, _props$locale2$label, _props$locale3, _props$locale4, _props$locale5, _props$locale6;
|
18
18
|
|
19
19
|
var labelType = (_props$label = props.label) !== null && _props$label !== void 0 ? _props$label : isDeterminateCompactPaginationProps(props) ? "complete" : "compact";
|
20
|
-
var label = labelType === "none" ? null : labelType === "compact" ? "".concat(props.currentPage) : isDeterminateCompactPaginationProps(props) ? "Page ".concat(props.currentPage, " of ").concat(props.nbPages) : "Page ".concat(props.currentPage, " of many");
|
20
|
+
var label = labelType === "none" ? null : labelType === "compact" ? "".concat(props.currentPage) : isDeterminateCompactPaginationProps(props) ? ((_props$locale = props.locale) === null || _props$locale === void 0 ? void 0 : (_props$locale$label = _props$locale.label) === null || _props$locale$label === void 0 ? void 0 : _props$locale$label.call(_props$locale, props.currentPage, props.nbPages)) || "Page ".concat(props.currentPage, " of ").concat(props.nbPages) : ((_props$locale2 = props.locale) === null || _props$locale2 === void 0 ? void 0 : (_props$locale2$label = _props$locale2.label) === null || _props$locale2$label === void 0 ? void 0 : _props$locale2$label.call(_props$locale2, props.currentPage)) || "Page ".concat(props.currentPage, " of many");
|
21
21
|
var isFirstPage = props.currentPage === 1;
|
22
22
|
var isLastPage = isDeterminateCompactPaginationProps(props) ? props.currentPage === props.nbPages : !!props.nextDisabled;
|
23
23
|
return /*#__PURE__*/_jsxs("div", {
|
24
24
|
className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["flex items-center space-x-2"]))),
|
25
25
|
children: [props.showGoToFirstPage && /*#__PURE__*/_jsx(IconButton, {
|
26
26
|
icon: ChevronsLeft,
|
27
|
-
title: "Go to first page",
|
27
|
+
title: ((_props$locale3 = props.locale) === null || _props$locale3 === void 0 ? void 0 : _props$locale3.goToFirstPage) || "Go to first page",
|
28
28
|
onClick: function onClick() {
|
29
29
|
return props.onChange(1);
|
30
30
|
},
|
31
31
|
disabled: isFirstPage
|
32
32
|
}), /*#__PURE__*/_jsx(IconButton, {
|
33
33
|
icon: ArrowLeft,
|
34
|
-
title: "Go to previous page",
|
34
|
+
title: ((_props$locale4 = props.locale) === null || _props$locale4 === void 0 ? void 0 : _props$locale4.goToPreviousPage) || "Go to previous page",
|
35
35
|
onClick: function onClick() {
|
36
36
|
return props.onChange(props.currentPage - 1);
|
37
37
|
},
|
@@ -41,14 +41,14 @@ export var CompactPagination = function CompactPagination(props) {
|
|
41
41
|
children: label
|
42
42
|
}), /*#__PURE__*/_jsx(IconButton, {
|
43
43
|
icon: ArrowRight,
|
44
|
-
title: "Go to next page",
|
44
|
+
title: ((_props$locale5 = props.locale) === null || _props$locale5 === void 0 ? void 0 : _props$locale5.goToNextPage) || "Go to next page",
|
45
45
|
onClick: function onClick() {
|
46
46
|
return props.onChange(props.currentPage + 1);
|
47
47
|
},
|
48
48
|
disabled: isLastPage
|
49
49
|
}), isDeterminateCompactPaginationProps(props) && props.showGoToLastPage && /*#__PURE__*/_jsx(IconButton, {
|
50
50
|
icon: ChevronsRight,
|
51
|
-
title: "Go to last page",
|
51
|
+
title: ((_props$locale6 = props.locale) === null || _props$locale6 === void 0 ? void 0 : _props$locale6.goToLastPage) || "Go to last page",
|
52
52
|
onClick: function onClick() {
|
53
53
|
return props.onChange(props.nbPages);
|
54
54
|
},
|
@@ -5,6 +5,9 @@ export declare type DotPaginationProps = {
|
|
5
5
|
onChange: (page: number) => void;
|
6
6
|
nbPages: number;
|
7
7
|
size?: "small" | "medium";
|
8
|
+
locale?: {
|
9
|
+
goToPageText?(page: number): string;
|
10
|
+
};
|
8
11
|
};
|
9
|
-
export declare const DotPagination: ({ currentPage, onChange, nbPages, size }: DotPaginationProps) => JSX.Element;
|
12
|
+
export declare const DotPagination: ({ currentPage, onChange, nbPages, size, locale }: DotPaginationProps) => JSX.Element;
|
10
13
|
export default DotPagination;
|
@@ -9,14 +9,17 @@ export var DotPagination = function DotPagination(_ref) {
|
|
9
9
|
onChange = _ref.onChange,
|
10
10
|
nbPages = _ref.nbPages,
|
11
11
|
_ref$size = _ref.size,
|
12
|
-
size = _ref$size === void 0 ? "medium" : _ref$size
|
12
|
+
size = _ref$size === void 0 ? "medium" : _ref$size,
|
13
|
+
locale = _ref.locale;
|
13
14
|
return /*#__PURE__*/_jsx("ul", {
|
14
15
|
className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["flex"]))),
|
15
16
|
children: new Array(nbPages).fill(undefined).map(function (_, idx) {
|
17
|
+
var _locale$goToPageText;
|
18
|
+
|
16
19
|
var pageIdx = idx + 1;
|
17
20
|
return /*#__PURE__*/_jsx("li", {
|
18
21
|
children: /*#__PURE__*/_jsx("button", {
|
19
|
-
"aria-label": "Go to page ".concat(pageIdx),
|
22
|
+
"aria-label": (locale === null || locale === void 0 ? void 0 : (_locale$goToPageText = locale.goToPageText) === null || _locale$goToPageText === void 0 ? void 0 : _locale$goToPageText.call(locale, pageIdx)) || "Go to page ".concat(pageIdx),
|
20
23
|
className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n rounded-full mx-1\n ", "\n ", "\n "])), currentPage === pageIdx ? "bg-accent-600" : "bg-grey-200", size === "medium" ? "h-3 w-3" : "h-2 w-2"),
|
21
24
|
onClick: function onClick() {
|
22
25
|
return onChange(pageIdx);
|
@@ -1,9 +1,15 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
export declare type PaginationLocale = {
|
3
|
+
goToPage?(page: number): string;
|
4
|
+
goToNextPage?: string;
|
5
|
+
goToPreviousPage?: string;
|
6
|
+
};
|
2
7
|
export interface PaginationProps {
|
3
8
|
nbPages: number;
|
4
9
|
currentPage: number;
|
5
10
|
maxButtons?: number;
|
6
11
|
onChange: (page: number) => void;
|
12
|
+
locale?: PaginationLocale;
|
7
13
|
}
|
8
14
|
/**
|
9
15
|
* Use pagination to help our users to move through an ordered collection of items.
|
@@ -12,5 +18,5 @@ export interface PaginationProps {
|
|
12
18
|
* - Don't use on list with less than 20 items
|
13
19
|
* - Place the pagination at the bottom of the split item
|
14
20
|
*/
|
15
|
-
export declare const Pagination: ({ currentPage, nbPages, onChange, maxButtons: maxButtonsParam, }: PaginationProps) => JSX.Element;
|
21
|
+
export declare const Pagination: ({ currentPage, nbPages, onChange, maxButtons: maxButtonsParam, locale, }: PaginationProps) => JSX.Element;
|
16
22
|
export default Pagination;
|
@@ -23,11 +23,14 @@ var Ellipsis = function Ellipsis() {
|
|
23
23
|
var Group = function Group(_ref) {
|
24
24
|
var group = _ref.group,
|
25
25
|
currentPage = _ref.currentPage,
|
26
|
-
onChange = _ref.onChange
|
26
|
+
onChange = _ref.onChange,
|
27
|
+
locale = _ref.locale;
|
27
28
|
return /*#__PURE__*/_jsx(_Fragment, {
|
28
29
|
children: group.map(function (index) {
|
30
|
+
var _locale$goToPage;
|
31
|
+
|
29
32
|
return /*#__PURE__*/_jsx(Button, {
|
30
|
-
"aria-label": "Go to page ".concat(index),
|
33
|
+
"aria-label": (locale === null || locale === void 0 ? void 0 : (_locale$goToPage = locale.goToPage) === null || _locale$goToPage === void 0 ? void 0 : _locale$goToPage.call(locale, index)) || "Go to page ".concat(index),
|
31
34
|
variant: index === currentPage ? "primary" : "neutral",
|
32
35
|
onClick: function onClick() {
|
33
36
|
return onChange(index);
|
@@ -51,7 +54,8 @@ export var Pagination = function Pagination(_ref2) {
|
|
51
54
|
nbPages = _ref2.nbPages,
|
52
55
|
onChange = _ref2.onChange,
|
53
56
|
_ref2$maxButtons = _ref2.maxButtons,
|
54
|
-
maxButtonsParam = _ref2$maxButtons === void 0 ? DEFAULT_MAX_BUTTONS : _ref2$maxButtons
|
57
|
+
maxButtonsParam = _ref2$maxButtons === void 0 ? DEFAULT_MAX_BUTTONS : _ref2$maxButtons,
|
58
|
+
locale = _ref2.locale;
|
55
59
|
var padding = Math.floor((Math.min(nbPages, maxButtonsParam) - 1) / 2);
|
56
60
|
var maxButtons = 2 * padding + 1;
|
57
61
|
var currentPageGroupStart = Math.max(1, Math.min(currentPage - padding, nbPages - maxButtons));
|
@@ -69,7 +73,7 @@ export var Pagination = function Pagination(_ref2) {
|
|
69
73
|
return /*#__PURE__*/_jsxs(ButtonGroup, {
|
70
74
|
as: "nav",
|
71
75
|
children: [/*#__PURE__*/_jsx(Button, {
|
72
|
-
"aria-label": "Go to previous page",
|
76
|
+
"aria-label": (locale === null || locale === void 0 ? void 0 : locale.goToPreviousPage) || "Go to previous page",
|
73
77
|
disabled: currentPage === 1,
|
74
78
|
onClick: function onClick() {
|
75
79
|
return onChange(currentPage - 1);
|
@@ -80,17 +84,20 @@ export var Pagination = function Pagination(_ref2) {
|
|
80
84
|
}), /*#__PURE__*/_jsx(Group, {
|
81
85
|
currentPage: currentPage,
|
82
86
|
onChange: onChange,
|
83
|
-
group: groups[0]
|
87
|
+
group: groups[0],
|
88
|
+
locale: locale
|
84
89
|
}), groups[0].length !== 0 && groups[1][0] - groups[0][0] > 1 && /*#__PURE__*/_jsx(Ellipsis, {}), /*#__PURE__*/_jsx(Group, {
|
85
90
|
currentPage: currentPage,
|
86
91
|
onChange: onChange,
|
87
|
-
group: groups[1]
|
92
|
+
group: groups[1],
|
93
|
+
locale: locale
|
88
94
|
}), groups[2].length !== 0 && groups[2][0] - groups[1][groups[1].length - 1] > 1 && /*#__PURE__*/_jsx(Ellipsis, {}), /*#__PURE__*/_jsx(Group, {
|
89
95
|
currentPage: currentPage,
|
90
96
|
onChange: onChange,
|
91
|
-
group: groups[2]
|
97
|
+
group: groups[2],
|
98
|
+
locale: locale
|
92
99
|
}), /*#__PURE__*/_jsx(Button, {
|
93
|
-
"aria-label": "Go to next page",
|
100
|
+
"aria-label": (locale === null || locale === void 0 ? void 0 : locale.goToNextPage) || "Go to next page",
|
94
101
|
disabled: currentPage === nbPages,
|
95
102
|
onClick: function onClick() {
|
96
103
|
return onChange(currentPage + 1);
|
@@ -2,7 +2,9 @@ import type { CSSProperties, FunctionComponent, ReactHTML } from "react";
|
|
2
2
|
export declare type ScrollIndicatorVariant = "light" | "dark";
|
3
3
|
export interface ScrollIndicatorProps {
|
4
4
|
wrapperClassName?: string;
|
5
|
+
/** @ignore */
|
5
6
|
className?: string;
|
7
|
+
/** @ignore */
|
6
8
|
style?: CSSProperties;
|
7
9
|
tagName?: keyof ReactHTML;
|
8
10
|
variant?: ScrollIndicatorVariant;
|
package/esm/Sidebar/Sidebar.d.ts
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
import type { DetailedHTMLProps, HTMLAttributes } from "react";
|
2
2
|
import type { SidebarCollapsed, SidebarVariant } from "./types";
|
3
3
|
export interface SidebarProps extends DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> {
|
4
|
+
/** @default "dark" */
|
4
5
|
variant?: SidebarVariant;
|
6
|
+
/** @default false */
|
5
7
|
collapsed?: SidebarCollapsed;
|
6
8
|
}
|
7
9
|
export declare const Sidebar: {
|
@@ -1,6 +1,15 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
2
|
import type { ColumnDefinition, DataConfiguration, GetItemId, PaginationConfiguration, Row, SelectMode, Sorting, Status } from "./types";
|
3
3
|
declare type CanSelectItem<Item> = (item: Item, idx: number) => boolean;
|
4
|
+
export declare type DataTableLocale = {
|
5
|
+
selectAllButton?: string;
|
6
|
+
noDataTitle?: string;
|
7
|
+
noDataDescription?: string;
|
8
|
+
loadingTitle?: string;
|
9
|
+
loadingDescription?: string;
|
10
|
+
errorTitle?: string;
|
11
|
+
errorDescription?: string;
|
12
|
+
};
|
4
13
|
interface BaseDataTableProps<Item> {
|
5
14
|
data: Item[];
|
6
15
|
itemId?: GetItemId<Item>;
|
@@ -13,6 +22,7 @@ interface BaseDataTableProps<Item> {
|
|
13
22
|
columns: ColumnDefinition<Item>[];
|
14
23
|
canHoverRow?(row: Row<Item>): boolean;
|
15
24
|
onRowHoveredChanged?(row: Row<Item> | null): void;
|
25
|
+
locale?: DataTableLocale;
|
16
26
|
}
|
17
27
|
declare type DataTableWithSelectMode<Item> = {
|
18
28
|
selectMode: Exclude<SelectMode, "none">;
|
@@ -46,5 +56,5 @@ export declare type DataTableProps<Item> = BaseDataTableProps<Item> & (DataTable
|
|
46
56
|
* - If a cell is empty or unavailable, keep the cell empty to reduce noise and help with legibility.
|
47
57
|
* - Truncate long text to make it fit into a cell. However, choose column width wisely based on expected values, and adjust the table accordingly
|
48
58
|
*/
|
49
|
-
export declare const DataTable: <Item extends {}>({ data, itemId, columns, onChange, status, noDataContent, errorContent, sorting, pagination, selectMode, selection, onSelectionChange, canSelectItem, canHoverRow, onRowHoveredChanged, }: DataTableProps<Item>) => JSX.Element;
|
59
|
+
export declare const DataTable: <Item extends {}>({ data, itemId, columns, onChange, status, noDataContent, errorContent, sorting, pagination, selectMode, selection, onSelectionChange, canSelectItem, canHoverRow, onRowHoveredChanged, locale, }: DataTableProps<Item>) => JSX.Element;
|
50
60
|
export default DataTable;
|
@@ -67,7 +67,8 @@ export var DataTable = function DataTable(_ref) {
|
|
67
67
|
onSelectionChange = _ref.onSelectionChange,
|
68
68
|
canSelectItem = _ref.canSelectItem,
|
69
69
|
canHoverRow = _ref.canHoverRow,
|
70
|
-
onRowHoveredChanged = _ref.onRowHoveredChanged
|
70
|
+
onRowHoveredChanged = _ref.onRowHoveredChanged,
|
71
|
+
locale = _ref.locale;
|
71
72
|
|
72
73
|
if (process.env.NODE_ENV !== "production") {
|
73
74
|
var _selection$length;
|
@@ -129,7 +130,7 @@ export var DataTable = function DataTable(_ref) {
|
|
129
130
|
var isChecked = selectionLength === dataLength;
|
130
131
|
var isIndeterminate = selectionLength > 0 && selectionLength !== dataLength;
|
131
132
|
return /*#__PURE__*/_jsx(Checkbox, {
|
132
|
-
"aria-label": "Select all" // Small hack to position the checkbox in the center of the header
|
133
|
+
"aria-label": (locale === null || locale === void 0 ? void 0 : locale.selectAllButton) || "Select all" // Small hack to position the checkbox in the center of the header
|
133
134
|
,
|
134
135
|
className: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["absolute mb-2.5"]))),
|
135
136
|
checked: isChecked,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
2
|
import type { DataTableProps } from "../DataTable";
|
3
3
|
import type { AdvancedColumnDefinition, Row, SelectMode, Status } from "../types";
|
4
|
-
export interface BodyProps<Item> extends Pick<DataTableProps<Item>, "selection" | "onSelectionChange" | "canHoverRow"> {
|
4
|
+
export interface BodyProps<Item> extends Pick<DataTableProps<Item>, "selection" | "onSelectionChange" | "canHoverRow" | "locale"> {
|
5
5
|
rows: Row<Item>[];
|
6
6
|
status?: Status;
|
7
7
|
noDataContent?: ReactNode;
|
@@ -10,5 +10,5 @@ export interface BodyProps<Item> extends Pick<DataTableProps<Item>, "selection"
|
|
10
10
|
onRowHoverChange(row: Row<Item> | null): void;
|
11
11
|
selectMode: SelectMode;
|
12
12
|
}
|
13
|
-
export declare const Body: <Item extends {}>({ rows, columns, status, noDataContent, errorContent, selectMode, selection, onSelectionChange, onRowHoverChange, canHoverRow, }: BodyProps<Item>) => JSX.Element;
|
13
|
+
export declare const Body: <Item extends {}>({ rows, columns, status, noDataContent, errorContent, selectMode, selection, onSelectionChange, onRowHoverChange, canHoverRow, locale, }: BodyProps<Item>) => JSX.Element;
|
14
14
|
export default Body;
|