@algolia/satellite 1.0.0-beta.145 → 1.0.0-beta.147
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/AutoComplete/AutoComplete.js +4 -4
- package/cjs/AutoComplete/AutoComplete.tailwind.d.ts +1 -1
- package/cjs/Button/Button.tailwind.d.ts +1 -1
- package/cjs/Button/ButtonGroup.d.ts +2 -1
- package/cjs/Card/Card.tailwind.d.ts +1 -1
- package/cjs/Checkbox/Checkbox.tailwind.d.ts +1 -1
- package/cjs/DatePicker/DatePicker.tailwind.d.ts +2 -2
- package/cjs/DatePicker/DatePicker.tailwind.js +1 -1
- package/cjs/DatePicker/components/Calendar.js +2 -7
- package/cjs/DatePicker/components/NavBar.js +26 -14
- package/cjs/DatePicker/types.d.ts +3 -7
- package/cjs/DatePicker/utils.d.ts +1 -8
- package/cjs/DatePicker/utils.js +1 -28
- package/cjs/Dropdown/components/DropdownLinkItem.d.ts +1 -0
- package/cjs/EmptyState/EmptyState.tailwind.d.ts +1 -1
- package/cjs/Flag/Flag.tailwind.d.ts +1 -1
- package/cjs/FlexGrid/FlexGrid.tailwind.d.ts +1 -1
- package/cjs/HelpUnderline/HelpUnderline.tailwind.d.ts +1 -1
- package/cjs/Input/Input.tailwind.d.ts +1 -1
- package/cjs/InstantSearch/InstantSearch.tailwind.d.ts +1 -1
- package/cjs/KeyboardKey/KeyboardKey.tailwind.d.ts +1 -1
- package/cjs/Link/BaseLink.d.ts +6 -2
- package/cjs/Link/ButtonLink.d.ts +3 -1
- package/cjs/Link/IconButtonLink.d.ts +3 -1
- package/cjs/Link/Link.d.ts +2 -0
- package/cjs/Medallion/Medallion.tailwind.d.ts +1 -1
- package/cjs/Modal/Modal.tailwind.d.ts +1 -1
- package/cjs/Pagination/CompactPagination/CompactPagination.d.ts +2 -0
- package/cjs/Pagination/CompactPagination/CompactPagination.js +3 -0
- package/cjs/ProgressBar/ProgressBar.tailwind.d.ts +1 -1
- package/cjs/ProgressSpinner/ProgressSpinner.tailwind.d.ts +1 -1
- package/cjs/RadioGroup/RadioButton.tailwind.d.ts +1 -1
- package/cjs/RangeSlider/RangeSlider.tailwind.d.ts +1 -1
- package/cjs/ScrollIndicator/ScrollIndicator.tailwind.d.ts +1 -1
- package/cjs/Select/Select.tailwind.d.ts +1 -1
- package/cjs/Sidebar/SidebarButtonLink.d.ts +7 -1
- package/cjs/Sidebar/SidebarButtonLink.js +15 -19
- package/cjs/Sidebar/SidebarLink.d.ts +2 -1
- package/cjs/Switch/Switch.tailwind.d.ts +1 -1
- package/cjs/Tables/DataTable/DataTable.tailwind.d.ts +1 -1
- package/cjs/Tables/Table/Table.tailwind.d.ts +1 -1
- package/cjs/Tabs/ContentTabs.js +18 -41
- package/cjs/Tabs/Tabs.tailwind.d.ts +1 -1
- package/cjs/Tag/Tag.tailwind.d.ts +1 -1
- package/cjs/TextArea/TextArea.tailwind.d.ts +1 -1
- package/cjs/TextWrap/TextWrap.d.ts +1 -0
- package/cjs/Toggle/Toggle.tailwind.d.ts +1 -1
- package/cjs/Tooltip/Tooltip.tailwind.d.ts +1 -1
- package/cjs/Typography/Typography.tailwind.d.ts +1 -1
- package/cjs/Typography/Typography.tailwind.js +3 -3
- package/cjs/UserContent/UserContent.js +4 -5
- package/cjs/UserContent/UserContent.tailwind.d.ts +1 -1
- package/cjs/UserContent/UserContent.tailwind.js +2 -2
- package/cjs/styles/base.tailwind.d.ts +1 -1
- package/cjs/styles/helpers/prefixTailwindClassName.js +10 -10
- package/cjs/utilities/utilities.tailwind.d.ts +1 -1
- package/esm/AutoComplete/AutoComplete.js +4 -4
- package/esm/AutoComplete/AutoComplete.tailwind.d.ts +1 -1
- package/esm/Button/Button.tailwind.d.ts +1 -1
- package/esm/Button/ButtonGroup.d.ts +2 -1
- package/esm/Card/Card.tailwind.d.ts +1 -1
- package/esm/Checkbox/Checkbox.tailwind.d.ts +1 -1
- package/esm/DatePicker/DatePicker.tailwind.d.ts +2 -2
- package/esm/DatePicker/DatePicker.tailwind.js +1 -1
- package/esm/DatePicker/components/Calendar.js +2 -6
- package/esm/DatePicker/components/NavBar.js +25 -14
- package/esm/DatePicker/types.d.ts +3 -7
- package/esm/DatePicker/utils.d.ts +1 -8
- package/esm/DatePicker/utils.js +1 -19
- package/esm/Dropdown/components/DropdownLinkItem.d.ts +1 -0
- package/esm/EmptyState/EmptyState.tailwind.d.ts +1 -1
- package/esm/Flag/Flag.tailwind.d.ts +1 -1
- package/esm/FlexGrid/FlexGrid.tailwind.d.ts +1 -1
- package/esm/HelpUnderline/HelpUnderline.tailwind.d.ts +1 -1
- package/esm/Input/Input.tailwind.d.ts +1 -1
- package/esm/InstantSearch/InstantSearch.tailwind.d.ts +1 -1
- package/esm/KeyboardKey/KeyboardKey.tailwind.d.ts +1 -1
- package/esm/Link/BaseLink.d.ts +6 -2
- package/esm/Link/ButtonLink.d.ts +3 -1
- package/esm/Link/IconButtonLink.d.ts +3 -1
- package/esm/Link/Link.d.ts +2 -0
- package/esm/Medallion/Medallion.tailwind.d.ts +1 -1
- package/esm/Modal/Modal.tailwind.d.ts +1 -1
- package/esm/Pagination/CompactPagination/CompactPagination.d.ts +2 -0
- package/esm/Pagination/CompactPagination/CompactPagination.js +4 -0
- package/esm/ProgressBar/ProgressBar.tailwind.d.ts +1 -1
- package/esm/ProgressSpinner/ProgressSpinner.tailwind.d.ts +1 -1
- package/esm/RadioGroup/RadioButton.tailwind.d.ts +1 -1
- package/esm/RangeSlider/RangeSlider.tailwind.d.ts +1 -1
- package/esm/ScrollIndicator/ScrollIndicator.tailwind.d.ts +1 -1
- package/esm/Select/Select.tailwind.d.ts +1 -1
- package/esm/Sidebar/SidebarButtonLink.d.ts +7 -1
- package/esm/Sidebar/SidebarButtonLink.js +15 -18
- package/esm/Sidebar/SidebarLink.d.ts +2 -1
- package/esm/Switch/Switch.tailwind.d.ts +1 -1
- package/esm/Tables/DataTable/DataTable.tailwind.d.ts +1 -1
- package/esm/Tables/Table/Table.tailwind.d.ts +1 -1
- package/esm/Tabs/ContentTabs.js +18 -39
- package/esm/Tabs/Tabs.tailwind.d.ts +1 -1
- package/esm/Tag/Tag.tailwind.d.ts +1 -1
- package/esm/TextArea/TextArea.tailwind.d.ts +1 -1
- package/esm/TextWrap/TextWrap.d.ts +1 -0
- package/esm/Toggle/Toggle.tailwind.d.ts +1 -1
- package/esm/Tooltip/Tooltip.tailwind.d.ts +1 -1
- package/esm/Typography/Typography.tailwind.d.ts +1 -1
- package/esm/Typography/Typography.tailwind.js +3 -3
- package/esm/UserContent/UserContent.js +4 -4
- package/esm/UserContent/UserContent.tailwind.d.ts +1 -1
- package/esm/UserContent/UserContent.tailwind.js +2 -2
- package/esm/styles/base.tailwind.d.ts +1 -1
- package/esm/styles/helpers/prefixTailwindClassName.js +10 -10
- package/esm/utilities/utilities.tailwind.d.ts +1 -1
- package/package.json +3 -3
- package/satellite.min.css +1 -1
@@ -67,7 +67,7 @@ var _utils = require("./utils");
|
|
67
67
|
|
68
68
|
var _jsxRuntime = require("react/jsx-runtime");
|
69
69
|
|
70
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
|
70
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17;
|
71
71
|
|
72
72
|
var _excluded = ["optionItemPrefix"],
|
73
73
|
_excluded2 = ["ref"];
|
@@ -398,7 +398,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
398
398
|
var shouldRenderCustomTemplate = Boolean(!multiple && !inputFocused && value && renderValueTemplate);
|
399
399
|
var status = fieldState.status;
|
400
400
|
var inputContainerClassName = (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n autocomplete-container\n ", "\n ", "\n ", "\n ", "\n ", "\n "])), variant === "large" && "autocomplete-large py-1", inputFocused && "autocomplete-focused", disabled && "autocomplete-disabled", status === "invalid" && "autocomplete-invalid", noWrap && "autocomplete-nowrap");
|
401
|
-
var inputClassName = (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n autocomplete-input\n ", "\n ", "\n "])), multiple && "ml-1", shouldRenderCustomTemplate && hasValue && "h-0 w-0 opacity-0");
|
401
|
+
var inputClassName = (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n autocomplete-input py-1.5\n ", "\n ", "\n "])), multiple && "ml-1", shouldRenderCustomTemplate && hasValue && "h-0 w-0 opacity-0");
|
402
402
|
var inputProps = getInputProps({
|
403
403
|
id: id,
|
404
404
|
name: name,
|
@@ -441,7 +441,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
441
441
|
className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["mr-4 shrink-0 ", ""])), disabled ? "text-grey-200" : inputFocused ? "text-accent-600" : "text-grey-500"),
|
442
442
|
size: "1rem"
|
443
443
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
444
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["flex items-center flex-1 ", " ", ""])), !noWrap && "flex-wrap", multiple && "-ml-1"), valuesClassName),
|
444
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["flex items-center flex-1 max-h-full ", " ", ""])), !noWrap && "flex-wrap overflow-y-scroll no-scrollbar", multiple && "-ml-1"), valuesClassName),
|
445
445
|
children: [multiple && Array.isArray(value) && value.map(function (option) {
|
446
446
|
return renderValueTemplate ? renderValueTemplate({
|
447
447
|
option: option,
|
@@ -613,7 +613,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
613
613
|
}
|
614
614
|
|
615
615
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
616
|
-
className: className,
|
616
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2["default"])(["flex"]))), className),
|
617
617
|
children: [_this.renderInput(autocompleteHelpers, fieldState), _this.inputContainerRef && /*#__PURE__*/(0, _reactDom.createPortal)(_this.renderMenu(results, autocompleteHelpers), (_this$context$portalT = _this.context["portalTarget"]) !== null && _this$context$portalT !== void 0 ? _this$context$portalT : document.body)]
|
618
618
|
});
|
619
619
|
});
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import type { FunctionComponent, ReactNode } from "react";
|
2
2
|
export interface ButtonGroupProps {
|
3
|
-
className?: string;
|
4
3
|
/**
|
5
4
|
* Specify HTML element `ButtonGroup` should be presented as.
|
6
5
|
* @default "div"
|
7
6
|
*/
|
8
7
|
as?: keyof JSX.IntrinsicElements;
|
8
|
+
/** @ignore */
|
9
|
+
className?: string;
|
9
10
|
children: ReactNode;
|
10
11
|
}
|
11
12
|
/**
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export = datePickerPlugin;
|
2
2
|
declare const datePickerPlugin: {
|
3
|
-
handler: import("tailwindcss/types/config").PluginCreator;
|
4
|
-
config?: import("tailwindcss").Config | undefined;
|
3
|
+
handler: import("tailwindcss/types/config").PluginCreator;
|
4
|
+
config?: Partial<import("tailwindcss").Config> | undefined;
|
5
5
|
};
|
@@ -100,7 +100,7 @@ var datePickerPlugin = plugin(function (_ref) {
|
|
100
100
|
textTransform: "capitalize",
|
101
101
|
fontWeight: "normal",
|
102
102
|
fontSize: "0.95em",
|
103
|
-
color: theme("colors.grey.
|
103
|
+
color: theme("colors.grey.600")
|
104
104
|
},
|
105
105
|
"& .rdp-day": (_rdpDay2 = {
|
106
106
|
borderRadius: defaultRadius
|
@@ -13,8 +13,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
13
13
|
|
14
14
|
var _reactDayPicker = require("react-day-picker");
|
15
15
|
|
16
|
-
var _utils = require("../utils");
|
17
|
-
|
18
16
|
var _NavBar = _interopRequireDefault(require("./NavBar"));
|
19
17
|
|
20
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
@@ -48,14 +46,11 @@ var Calendar = function Calendar(props) {
|
|
48
46
|
//stl`bg-grey-600 text-white rounded-l border-0`,
|
49
47
|
displayedRangesEnd: "rdp-day_displayedRangesEnd" //stl`bg-grey-600 text-white rounded-r border-0`,
|
50
48
|
|
51
|
-
};
|
52
|
-
// https://react-day-picker.js.org/basics/localization#adopting-other-numbering-systems
|
53
|
-
|
54
|
-
var dateFnsLocale = (0, _utils.getDateFnsLocale)(props.locale.code);
|
49
|
+
};
|
55
50
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactDayPicker.DayPicker, _objectSpread(_objectSpread({
|
56
51
|
mode: props.mode
|
57
52
|
}, curatedProps), {}, {
|
58
|
-
locale:
|
53
|
+
locale: props.locale.formatter,
|
59
54
|
dir: props.locale.rtl ? "rtl" : "ltr",
|
60
55
|
modifiersClassNames: modifierClassNames,
|
61
56
|
showOutsideDays: false,
|
@@ -27,9 +27,11 @@ var _Button = require("../../Button");
|
|
27
27
|
|
28
28
|
var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
|
29
29
|
|
30
|
+
var _utils = require("../../utils");
|
31
|
+
|
30
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
31
33
|
|
32
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
34
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
33
35
|
|
34
36
|
var NavBar = function NavBar(props) {
|
35
37
|
var _useDayPicker = (0, _reactDayPicker.useDayPicker)(),
|
@@ -92,6 +94,9 @@ var NavBar = function NavBar(props) {
|
|
92
94
|
return i + minYear;
|
93
95
|
});
|
94
96
|
}, [props, initialDate]);
|
97
|
+
var yearSelectId = (0, _react.useMemo)(function () {
|
98
|
+
return (0, _utils.uniqueId)("year-select");
|
99
|
+
}, []);
|
95
100
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
96
101
|
className: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["w-full top-3 left-0 pt-1 px-2 pb-2 flex justify-between"]))),
|
97
102
|
children: [showPrevious ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
|
@@ -106,18 +111,25 @@ var NavBar = function NavBar(props) {
|
|
106
111
|
className: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["font-medium text-md"]))),
|
107
112
|
children: [formatMonthCaption(props.displayMonth, {
|
108
113
|
locale: locale
|
109
|
-
}), " ", props.editableYear ? /*#__PURE__*/(0, _jsxRuntime.
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
},
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
114
|
+
}), " ", props.editableYear ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
115
|
+
htmlFor: yearSelectId,
|
116
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
117
|
+
className: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["sr-only"]))),
|
118
|
+
children: "Select a year"
|
119
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("select", {
|
120
|
+
id: yearSelectId,
|
121
|
+
className: (0, _clsx["default"])("rdp-year", (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["pl-0.5 font-medium outline-none border-transparent border-2 rounded focus:border-accent-600 focus:shadow-z100 appearance-none"])))),
|
122
|
+
value: props.displayMonth.getFullYear(),
|
123
|
+
onChange: function onChange(e) {
|
124
|
+
return goToDate((0, _dateFns.setYear)(props.displayMonth, parseInt(e.currentTarget.value)));
|
125
|
+
},
|
126
|
+
children: years.map(function (year) {
|
127
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
128
|
+
value: year,
|
129
|
+
children: year
|
130
|
+
}, year);
|
131
|
+
})
|
132
|
+
})]
|
121
133
|
}) : props.displayMonth.getFullYear()]
|
122
134
|
})
|
123
135
|
}), showNext ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
|
@@ -125,7 +137,7 @@ var NavBar = function NavBar(props) {
|
|
125
137
|
title: nextMonthLabel,
|
126
138
|
onClick: handleNextClick
|
127
139
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
128
|
-
className: (0, _satellitePrefixer["default"])(
|
140
|
+
className: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["w-8"])))
|
129
141
|
})]
|
130
142
|
});
|
131
143
|
};
|
@@ -1,12 +1,8 @@
|
|
1
|
-
import type
|
1
|
+
import type { Locale as DateFnsLocale } from "date-fns";
|
2
2
|
import type { ModalProps } from "./components/Modal";
|
3
3
|
export declare type DatePickerLocale = {
|
4
|
-
/**
|
5
|
-
|
6
|
-
* for rendering the actual calendar component in the correct language. This has no effect on the custom translations
|
7
|
-
* listed below. (i.e. `openButton`, `apply`, etc.)
|
8
|
-
*/
|
9
|
-
code?: keyof typeof Locales;
|
4
|
+
/** The date-fns locale object used to localize dates. Defaults to* `en-US`. */
|
5
|
+
formatter?: DateFnsLocale;
|
10
6
|
/** rtl should be used optionally in conjunction with supported language codes, such as `rtl: true` when code is `arSA` */
|
11
7
|
rtl?: boolean;
|
12
8
|
/**
|
@@ -1,10 +1,3 @@
|
|
1
|
-
import type { Locale } from "date-fns";
|
2
1
|
import type { DatePickerLocale } from "./types";
|
3
2
|
export declare const formatDate: (date: Date | number) => string;
|
4
|
-
export declare const DEFAULT_DATE_PICKER_LOCALE: Required<DatePickerLocale
|
5
|
-
/**
|
6
|
-
* Looks up a date-fns locale. This falls back to `en`
|
7
|
-
* @param locale the ISO 639-1 language code to look up @link https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
|
8
|
-
* @returns date-fns locale.
|
9
|
-
*/
|
10
|
-
export declare function getDateFnsLocale(locale?: string): Locale;
|
3
|
+
export declare const DEFAULT_DATE_PICKER_LOCALE: Required<Omit<DatePickerLocale, "formatter">>;
|
package/cjs/DatePicker/utils.js
CHANGED
@@ -2,29 +2,19 @@
|
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
6
|
-
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
8
6
|
value: true
|
9
7
|
});
|
10
8
|
exports.formatDate = exports.DEFAULT_DATE_PICKER_LOCALE = void 0;
|
11
|
-
exports.getDateFnsLocale = getDateFnsLocale;
|
12
9
|
|
13
10
|
var _format = _interopRequireDefault(require("date-fns/format"));
|
14
11
|
|
15
|
-
var Locales = _interopRequireWildcard(require("date-fns/locale"));
|
16
|
-
|
17
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
18
|
-
|
19
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
20
|
-
|
21
12
|
var formatDate = function formatDate(date) {
|
22
13
|
return (0, _format["default"])(date, "MMM do, yyyy");
|
23
14
|
};
|
24
15
|
|
25
16
|
exports.formatDate = formatDate;
|
26
17
|
var DEFAULT_DATE_PICKER_LOCALE = {
|
27
|
-
code: "enUS",
|
28
18
|
rtl: false,
|
29
19
|
apply: "Apply",
|
30
20
|
cancel: "Cancel",
|
@@ -32,21 +22,4 @@ var DEFAULT_DATE_PICKER_LOCALE = {
|
|
32
22
|
previousMonth: "Previous month",
|
33
23
|
nextMonth: "Next month"
|
34
24
|
};
|
35
|
-
|
36
|
-
* Looks up a date-fns locale. This falls back to `en`
|
37
|
-
* @param locale the ISO 639-1 language code to look up @link https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
|
38
|
-
* @returns date-fns locale.
|
39
|
-
*/
|
40
|
-
|
41
|
-
exports.DEFAULT_DATE_PICKER_LOCALE = DEFAULT_DATE_PICKER_LOCALE;
|
42
|
-
|
43
|
-
function getDateFnsLocale(locale) {
|
44
|
-
var _allLocales$locale;
|
45
|
-
|
46
|
-
if (!locale) {
|
47
|
-
return Locales.enUS;
|
48
|
-
}
|
49
|
-
|
50
|
-
var allLocales = Locales;
|
51
|
-
return (_allLocales$locale = allLocales[locale]) !== null && _allLocales$locale !== void 0 ? _allLocales$locale : Locales.enUS;
|
52
|
-
}
|
25
|
+
exports.DEFAULT_DATE_PICKER_LOCALE = DEFAULT_DATE_PICKER_LOCALE;
|
@@ -2,6 +2,7 @@
|
|
2
2
|
import type { IconComponentType } from "../../types";
|
3
3
|
import { DropdownBaseItemProps } from "../useDropdownItemProps";
|
4
4
|
export declare type DropdownLinkItemProps = DropdownBaseItemProps<HTMLAnchorElement> & JSX.IntrinsicElements["a"] & {
|
5
|
+
href: string;
|
5
6
|
/** Left aligned icon */
|
6
7
|
startIcon?: IconComponentType;
|
7
8
|
};
|
package/cjs/Link/BaseLink.d.ts
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
import type { AnchorHTMLAttributes } from "react";
|
2
|
-
export declare type BaseLinkProps =
|
3
|
-
|
2
|
+
export declare type BaseLinkProps = {
|
3
|
+
href: string;
|
4
|
+
} & AnchorHTMLAttributes<HTMLAnchorElement>;
|
5
|
+
export declare const BaseLink: import("react").ForwardRefExoticComponent<{
|
6
|
+
href: string;
|
7
|
+
} & AnchorHTMLAttributes<HTMLAnchorElement> & import("react").RefAttributes<HTMLAnchorElement>>;
|
4
8
|
export default BaseLink;
|
package/cjs/Link/ButtonLink.d.ts
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { ButtonBaseProps, ExtractProps } from "../Button/types";
|
3
|
-
export declare type ButtonLinkProps = ButtonBaseProps & ExtractProps<"a"
|
3
|
+
export declare type ButtonLinkProps = ButtonBaseProps & ExtractProps<"a"> & {
|
4
|
+
href: string;
|
5
|
+
};
|
4
6
|
export declare const ButtonLink: ({ endIcon: EndIcon, href, onClick, ...props }: ButtonLinkProps) => JSX.Element;
|
5
7
|
export default ButtonLink;
|
@@ -1,6 +1,8 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { IconButtonBaseProps } from "../Button/IconButton";
|
3
3
|
import type { ExtractProps } from "../Button/types";
|
4
|
-
export declare type IconButtonLinkProps = IconButtonBaseProps & ExtractProps<"a"
|
4
|
+
export declare type IconButtonLinkProps = IconButtonBaseProps & ExtractProps<"a"> & {
|
5
|
+
href: string;
|
6
|
+
};
|
5
7
|
export declare const IconButtonLink: ({ href, onClick, ...props }: IconButtonLinkProps) => JSX.Element;
|
6
8
|
export default IconButtonLink;
|
package/cjs/Link/Link.d.ts
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
import type { AnchorHTMLAttributes } from "react";
|
2
2
|
import type { IconComponentType } from "../types";
|
3
3
|
export declare type LinkProps = {
|
4
|
+
href: string;
|
4
5
|
startIcon?: IconComponentType;
|
5
6
|
endIcon?: IconComponentType;
|
6
7
|
} & AnchorHTMLAttributes<HTMLAnchorElement>;
|
7
8
|
export declare const Link: import("react").ForwardRefExoticComponent<{
|
9
|
+
href: string;
|
8
10
|
startIcon?: IconComponentType | undefined;
|
9
11
|
endIcon?: IconComponentType | undefined;
|
10
12
|
} & AnchorHTMLAttributes<HTMLAnchorElement> & import("react").RefAttributes<HTMLAnchorElement>>;
|
@@ -23,7 +23,9 @@ export declare type IndeterminateCompactPaginationProps = BaseCompactPaginationP
|
|
23
23
|
nextDisabled?: boolean;
|
24
24
|
};
|
25
25
|
export declare type CompactPaginationProps = DeterminateCompactPaginationProps | IndeterminateCompactPaginationProps;
|
26
|
+
/** @ignore */
|
26
27
|
export declare const isDeterminateCompactPaginationProps: (props: CompactPaginationProps) => props is DeterminateCompactPaginationProps;
|
28
|
+
/** @ignore */
|
27
29
|
export declare const isIndeterminateCompactPaginationProps: (props: CompactPaginationProps) => props is IndeterminateCompactPaginationProps;
|
28
30
|
export declare const CompactPagination: (props: CompactPaginationProps) => JSX.Element;
|
29
31
|
export default CompactPagination;
|
@@ -37,9 +37,12 @@ var DEFAULT_COMPACT_PAGINATION_LOCALE = {
|
|
37
37
|
}
|
38
38
|
};
|
39
39
|
|
40
|
+
/** @ignore */
|
40
41
|
var isDeterminateCompactPaginationProps = function isDeterminateCompactPaginationProps(props) {
|
41
42
|
return "nbPages" in props;
|
42
43
|
};
|
44
|
+
/** @ignore */
|
45
|
+
|
43
46
|
|
44
47
|
exports.isDeterminateCompactPaginationProps = isDeterminateCompactPaginationProps;
|
45
48
|
|
@@ -8,7 +8,13 @@ export interface SidebarButtonLinkProps {
|
|
8
8
|
id?: string;
|
9
9
|
icon: SidebarButtonLinkIcon;
|
10
10
|
href: string;
|
11
|
-
children: ReactNode;
|
12
11
|
onClick?: MouseEventHandler<HTMLAnchorElement>;
|
12
|
+
disabled?: boolean;
|
13
|
+
/**
|
14
|
+
* Alternative content for the tooltip.
|
15
|
+
* @default children
|
16
|
+
*/
|
17
|
+
tooltipContent?: ReactNode;
|
18
|
+
children: ReactNode;
|
13
19
|
}
|
14
20
|
export declare const SidebarButtonLink: FC<SidebarButtonLinkProps>;
|
@@ -15,8 +15,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
15
15
|
|
16
16
|
var _react = require("react");
|
17
17
|
|
18
|
-
var _Link = require("../Link");
|
19
|
-
|
20
18
|
var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
|
21
19
|
|
22
20
|
var _Tooltip = require("../Tooltip");
|
@@ -34,7 +32,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
34
32
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
35
33
|
|
36
34
|
var Tooltip = function Tooltip(_ref) {
|
37
|
-
var
|
35
|
+
var content = _ref.content,
|
38
36
|
children = _ref.children;
|
39
37
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.TooltipWrapper, {
|
40
38
|
placement: "right",
|
@@ -46,40 +44,38 @@ var Tooltip = function Tooltip(_ref) {
|
|
46
44
|
offset: [0, 32]
|
47
45
|
}
|
48
46
|
}],
|
49
|
-
content:
|
47
|
+
content: content,
|
50
48
|
wrapperClassName: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["block"]))),
|
51
49
|
interactive: false,
|
52
50
|
children: children
|
53
51
|
});
|
54
52
|
};
|
55
53
|
|
56
|
-
var SidebarButtonLink = function SidebarButtonLink(
|
57
|
-
var id =
|
58
|
-
icon =
|
59
|
-
href =
|
60
|
-
|
61
|
-
|
54
|
+
var SidebarButtonLink = function SidebarButtonLink(props) {
|
55
|
+
var id = props.id,
|
56
|
+
icon = props.icon,
|
57
|
+
href = props.href,
|
58
|
+
disabled = props.disabled,
|
59
|
+
children = props.children;
|
62
60
|
|
63
61
|
var _useSidebarContext = (0, _SidebarContext.useSidebarContext)(),
|
64
62
|
isLinkActive = _useSidebarContext.isLinkActive,
|
65
63
|
collapsed = _useSidebarContext.collapsed;
|
66
64
|
|
67
|
-
var linkProps = (0, _useLinkProps["default"])(
|
68
|
-
href: href,
|
69
|
-
onClick: onClick
|
70
|
-
});
|
65
|
+
var linkProps = (0, _useLinkProps["default"])(props);
|
71
66
|
|
72
67
|
var _useState = (0, _react.useState)(false),
|
73
68
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
74
69
|
isInteractedWith = _useState2[0],
|
75
70
|
setIsInteractedWith = _useState2[1];
|
76
71
|
|
77
|
-
var isActive = isLinkActive(href);
|
78
|
-
var showColors = isActive || isInteractedWith;
|
72
|
+
var isActive = !disabled && isLinkActive(href);
|
73
|
+
var showColors = !disabled && (isActive || isInteractedWith);
|
79
74
|
var Icon = "active" in icon ? showColors ? icon.active : icon.inactive : icon;
|
75
|
+
var tooltipContent = "tooltipContent" in props ? props.tooltipContent : children;
|
80
76
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, {
|
81
|
-
|
82
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
77
|
+
content: collapsed ? tooltipContent : null,
|
78
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("a", _objectSpread(_objectSpread({}, linkProps), {}, {
|
83
79
|
id: id,
|
84
80
|
onMouseEnter: function onMouseEnter() {
|
85
81
|
return setIsInteractedWith(true);
|
@@ -93,7 +89,7 @@ var SidebarButtonLink = function SidebarButtonLink(_ref2) {
|
|
93
89
|
onBlur: function onBlur() {
|
94
90
|
return setIsInteractedWith(false);
|
95
91
|
},
|
96
|
-
className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n h-8 min-w-8 w-full rounded\n flex items-center space-x-3\n border border-transparent\n display-body
|
92
|
+
className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n h-8 min-w-8 w-full rounded\n flex items-center space-x-3\n border border-transparent\n display-body\n hover:no-underline focus:no-underline\n ", "\n ", "\n ", "\n ", "\n "])), disabled ? "cursor-not-allowed opacity-70" : "focus:border-grey-500", isActive ? "shadow-z100" : !disabled && "hover:border-grey-200", isActive && "bg-gradient-to-b from-white to-grey-50", collapsed ? "pl-2" : "px-2"),
|
97
93
|
"aria-current": isActive,
|
98
94
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
99
95
|
className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["", " ml-[-3px]"])), showColors ? "text-accent-600" : "text-grey-400"),
|
@@ -2,7 +2,8 @@ import type { FC, ReactNode } from "react";
|
|
2
2
|
import type { IconComponentType } from "../types";
|
3
3
|
export declare type SidebarLinkProps = {
|
4
4
|
icon: IconComponentType;
|
5
|
+
href: string;
|
5
6
|
disabled?: boolean;
|
6
7
|
children: ReactNode;
|
7
|
-
} & Pick<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "id" | "className" | "
|
8
|
+
} & Pick<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "id" | "className" | "target" | "rel" | "aria-label" | "onClick">;
|
8
9
|
export declare const SidebarLink: FC<SidebarLinkProps>;
|