@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
package/cjs/Tabs/ContentTabs.js
CHANGED
@@ -9,14 +9,10 @@ exports["default"] = exports.ContentTabs = void 0;
|
|
9
9
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
11
11
|
|
12
|
-
var
|
13
|
-
|
14
|
-
var _tabs = require("@reach/tabs");
|
12
|
+
var _reactTabs = require("@radix-ui/react-tabs");
|
15
13
|
|
16
14
|
var _clsx = _interopRequireDefault(require("clsx"));
|
17
15
|
|
18
|
-
var _react = require("react");
|
19
|
-
|
20
16
|
var _Badge = _interopRequireDefault(require("../Badge"));
|
21
17
|
|
22
18
|
var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
|
@@ -34,31 +30,13 @@ var ContentTabs = function ContentTabs(_ref) {
|
|
34
30
|
_ref$defaultIndex = _ref.defaultIndex,
|
35
31
|
defaultIndex = _ref$defaultIndex === void 0 ? 0 : _ref$defaultIndex,
|
36
32
|
onChange = _ref.onChange;
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
if (tabIndex !== undefined && internalTabIndex !== tabIndex) {
|
45
|
-
setInternalTabIndex(tabIndex);
|
46
|
-
}
|
47
|
-
}, [internalTabIndex, tabIndex]);
|
48
|
-
|
49
|
-
var handleTabsChange = function handleTabsChange(index) {
|
50
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(index);
|
51
|
-
|
52
|
-
if (tabIndex === undefined) {
|
53
|
-
setInternalTabIndex(index);
|
54
|
-
}
|
55
|
-
};
|
56
|
-
|
57
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_tabs.Tabs, {
|
58
|
-
index: internalTabIndex,
|
59
|
-
onChange: handleTabsChange,
|
60
|
-
defaultIndex: internalTabIndex,
|
61
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_tabs.TabList, {
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactTabs.Tabs, {
|
34
|
+
value: typeof tabIndex !== "undefined" ? String(tabIndex) : undefined,
|
35
|
+
defaultValue: typeof defaultIndex !== "undefined" ? String(defaultIndex) : undefined,
|
36
|
+
onValueChange: function onValueChange(value) {
|
37
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(Number(value));
|
38
|
+
},
|
39
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTabs.TabsList, {
|
62
40
|
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["tabs-tabbar border-b border-grey-200 flex overflow-x-auto whitespace-nowrap space-x-6"]))), className),
|
63
41
|
children: tabs.map(function (_ref2, index) {
|
64
42
|
var _ref2$variant = _ref2.variant,
|
@@ -67,9 +45,10 @@ var ContentTabs = function ContentTabs(_ref) {
|
|
67
45
|
disabled = _ref2.disabled,
|
68
46
|
label = _ref2.label,
|
69
47
|
value = _ref2.value;
|
70
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
71
|
-
|
48
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactTabs.TabsTrigger, {
|
49
|
+
value: String(index),
|
72
50
|
disabled: disabled,
|
51
|
+
className: (0, _clsx["default"])(_utils.ACTIVE_UNDERLINE_VARIANT_CLASSNAMES[variant], (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["tab pb-3 text-base leading-sm"]))), className),
|
73
52
|
children: [label, value && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge["default"], {
|
74
53
|
size: "small",
|
75
54
|
variant: variant,
|
@@ -78,15 +57,13 @@ var ContentTabs = function ContentTabs(_ref) {
|
|
78
57
|
})]
|
79
58
|
}, index);
|
80
59
|
})
|
81
|
-
}),
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
}, index);
|
89
|
-
})
|
60
|
+
}), tabs.map(function (_ref3, index) {
|
61
|
+
var content = _ref3.content;
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTabs.TabsContent, {
|
63
|
+
value: String(index),
|
64
|
+
className: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["focus:outline-none"]))),
|
65
|
+
children: content
|
66
|
+
}, index);
|
90
67
|
})]
|
91
68
|
});
|
92
69
|
};
|
@@ -19,8 +19,8 @@ var typographyPlugin = plugin(function (_ref) {
|
|
19
19
|
addUtilities = _ref.addUtilities,
|
20
20
|
addComponents = _ref.addComponents,
|
21
21
|
e = _ref.e;
|
22
|
-
var desktop = theme("
|
23
|
-
var mobile = theme("
|
22
|
+
var desktop = theme("stlTypography.desktop", {});
|
23
|
+
var mobile = theme("stlTypography.mobile", {});
|
24
24
|
var common = {
|
25
25
|
reversed: {
|
26
26
|
color: theme("colors.white")
|
@@ -65,7 +65,7 @@ var typographyPlugin = plugin(function (_ref) {
|
|
65
65
|
content: [],
|
66
66
|
theme: {
|
67
67
|
// @ts-ignore
|
68
|
-
|
68
|
+
stlTypography: function stlTypography(_ref2) {
|
69
69
|
var theme = _ref2.theme;
|
70
70
|
// Need to transform it to a string because in this context, Tailwind doesn't automagically turn it into a string value
|
71
71
|
// Asked here https://github.com/tailwindlabs/tailwindcss/discussions/8755
|
@@ -7,8 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
});
|
8
8
|
exports["default"] = exports.UserContent = void 0;
|
9
9
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
|
-
|
12
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
13
11
|
|
14
12
|
var _clsx = _interopRequireDefault(require("clsx"));
|
@@ -24,12 +22,13 @@ var UserContent = function UserContent(_ref) {
|
|
24
22
|
content = _ref.content,
|
25
23
|
_ref$styled = _ref.styled,
|
26
24
|
styled = _ref$styled === void 0 ? true : _ref$styled;
|
27
|
-
|
28
|
-
|
25
|
+
if (!content) return null;
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
27
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["", ""])), styled && "usercontent"), className),
|
29
28
|
dangerouslySetInnerHTML: {
|
30
29
|
__html: content
|
31
30
|
}
|
32
|
-
})
|
31
|
+
});
|
33
32
|
};
|
34
33
|
|
35
34
|
exports.UserContent = UserContent;
|
@@ -21,10 +21,10 @@ module.exports = plugin(function (_ref) {
|
|
21
21
|
theme = _ref.theme;
|
22
22
|
|
23
23
|
/** @type {any} */
|
24
|
-
var desktop = theme("
|
24
|
+
var desktop = theme("stlTypography.desktop", {});
|
25
25
|
/** @type {any} */
|
26
26
|
|
27
|
-
var mobile = theme("
|
27
|
+
var mobile = theme("stlTypography.mobile", {});
|
28
28
|
addComponents({
|
29
29
|
".usercontent": (0, _defineProperty2["default"])({
|
30
30
|
"h1, h2, h3, h4, h5, h6, p, ul, ol, blockquote, table": {
|
@@ -8,21 +8,21 @@
|
|
8
8
|
* @param {string} classname
|
9
9
|
*/
|
10
10
|
function prefixTailwindClassName(tailwindPrefix, classname) {
|
11
|
-
var
|
12
|
-
|
13
|
-
var
|
14
|
-
var prefixInsertIndex = classNameSafeZone.lastIndexOf("!");
|
11
|
+
var searchZone = classname.replace(/-\[[^\]]+\]$/, ""); // important marker
|
12
|
+
|
13
|
+
var prefixInsertIndex = searchZone.lastIndexOf("!"); // modifier separator
|
15
14
|
|
16
15
|
if (prefixInsertIndex === -1) {
|
17
|
-
prefixInsertIndex =
|
18
|
-
}
|
16
|
+
prefixInsertIndex = searchZone.lastIndexOf(":");
|
17
|
+
} // container marker
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
|
20
|
+
if (prefixInsertIndex === -1) {
|
21
|
+
prefixInsertIndex = searchZone.lastIndexOf("@");
|
23
22
|
}
|
24
23
|
|
25
|
-
|
24
|
+
prefixInsertIndex += 1;
|
25
|
+
return classname.slice(0, prefixInsertIndex) + tailwindPrefix + classname.slice(prefixInsertIndex);
|
26
26
|
}
|
27
27
|
|
28
28
|
module.exports = prefixTailwindClassName;
|
@@ -10,7 +10,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
11
11
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
12
12
|
|
13
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
|
13
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17;
|
14
14
|
|
15
15
|
var _excluded = ["optionItemPrefix"],
|
16
16
|
_excluded2 = ["ref"];
|
@@ -379,7 +379,7 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
379
379
|
var shouldRenderCustomTemplate = Boolean(!multiple && !inputFocused && value && renderValueTemplate);
|
380
380
|
var status = fieldState.status;
|
381
381
|
var inputContainerClassName = stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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");
|
382
|
-
var inputClassName = stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n autocomplete-input\n ", "\n ", "\n "])), multiple && "ml-1", shouldRenderCustomTemplate && hasValue && "h-0 w-0 opacity-0");
|
382
|
+
var inputClassName = stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n autocomplete-input py-1.5\n ", "\n ", "\n "])), multiple && "ml-1", shouldRenderCustomTemplate && hasValue && "h-0 w-0 opacity-0");
|
383
383
|
var inputProps = getInputProps({
|
384
384
|
id: id,
|
385
385
|
name: name,
|
@@ -422,7 +422,7 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
422
422
|
className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["mr-4 shrink-0 ", ""])), disabled ? "text-grey-200" : inputFocused ? "text-accent-600" : "text-grey-500"),
|
423
423
|
size: "1rem"
|
424
424
|
}), /*#__PURE__*/_jsxs("div", {
|
425
|
-
className: cx(stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["flex items-center flex-1 ", " ", ""])), !noWrap && "flex-wrap", multiple && "-ml-1"), valuesClassName),
|
425
|
+
className: cx(stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["flex items-center flex-1 max-h-full ", " ", ""])), !noWrap && "flex-wrap overflow-y-scroll no-scrollbar", multiple && "-ml-1"), valuesClassName),
|
426
426
|
children: [multiple && Array.isArray(value) && value.map(function (option) {
|
427
427
|
return renderValueTemplate ? renderValueTemplate({
|
428
428
|
option: option,
|
@@ -598,7 +598,7 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
598
598
|
}
|
599
599
|
|
600
600
|
return /*#__PURE__*/_jsxs("div", {
|
601
|
-
className: className,
|
601
|
+
className: cx(stl(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["flex"]))), className),
|
602
602
|
children: [_this.renderInput(autocompleteHelpers, fieldState), _this.inputContainerRef && /*#__PURE__*/createPortal(_this.renderMenu(results, autocompleteHelpers), (_this$context$portalT = _this.context["portalTarget"]) !== null && _this$context$portalT !== void 0 ? _this$context$portalT : document.body)]
|
603
603
|
});
|
604
604
|
});
|
@@ -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
|
};
|
@@ -95,7 +95,7 @@ var datePickerPlugin = plugin(function (_ref) {
|
|
95
95
|
textTransform: "capitalize",
|
96
96
|
fontWeight: "normal",
|
97
97
|
fontSize: "0.95em",
|
98
|
-
color: theme("colors.grey.
|
98
|
+
color: theme("colors.grey.600")
|
99
99
|
},
|
100
100
|
"& .rdp-day": (_rdpDay2 = {
|
101
101
|
borderRadius: defaultRadius
|
@@ -6,7 +6,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
6
6
|
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) { _defineProperty(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; }
|
7
7
|
|
8
8
|
import { DayPicker } from "react-day-picker";
|
9
|
-
import { getDateFnsLocale } from "../utils";
|
10
9
|
import NavBar from "./NavBar";
|
11
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
12
11
|
var excludedDayPickerPropsList = ["captionElement", "showOutsideDays", "enableOutsideDaysClick", "fixedWeeks", "labels", "navbarElement", "onTodayButtonClick", "pagedNavigation", "renderDay", "renderWeek", "reverseMonths", "showWeekNumber", "showWeekDays", "weekdayElement", "weekdaysLong", "weekdaysShort"];
|
@@ -34,14 +33,11 @@ var Calendar = function Calendar(props) {
|
|
34
33
|
//stl`bg-grey-600 text-white rounded-l border-0`,
|
35
34
|
displayedRangesEnd: "rdp-day_displayedRangesEnd" //stl`bg-grey-600 text-white rounded-r border-0`,
|
36
35
|
|
37
|
-
};
|
38
|
-
// https://react-day-picker.js.org/basics/localization#adopting-other-numbering-systems
|
39
|
-
|
40
|
-
var dateFnsLocale = getDateFnsLocale(props.locale.code);
|
36
|
+
};
|
41
37
|
return /*#__PURE__*/_jsx(DayPicker, _objectSpread(_objectSpread({
|
42
38
|
mode: props.mode
|
43
39
|
}, curatedProps), {}, {
|
44
|
-
locale:
|
40
|
+
locale: props.locale.formatter,
|
45
41
|
dir: props.locale.rtl ? "rtl" : "ltr",
|
46
42
|
modifiersClassNames: modifierClassNames,
|
47
43
|
showOutsideDays: false,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
3
3
|
|
4
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
4
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
5
5
|
|
6
6
|
import cx from "clsx";
|
7
7
|
import { add, eachYearOfInterval, getYear, setYear } from "date-fns";
|
@@ -11,6 +11,7 @@ import { useDayPicker, useNavigation } from "react-day-picker";
|
|
11
11
|
import { ChevronLeft, ChevronRight } from "react-feather";
|
12
12
|
import { IconButton } from "../../Button";
|
13
13
|
import stl from "../../styles/helpers/satellitePrefixer";
|
14
|
+
import { uniqueId } from "../../utils";
|
14
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
15
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
16
17
|
|
@@ -75,6 +76,9 @@ var NavBar = function NavBar(props) {
|
|
75
76
|
return i + minYear;
|
76
77
|
});
|
77
78
|
}, [props, initialDate]);
|
79
|
+
var yearSelectId = useMemo(function () {
|
80
|
+
return uniqueId("year-select");
|
81
|
+
}, []);
|
78
82
|
return /*#__PURE__*/_jsxs("div", {
|
79
83
|
className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["w-full top-3 left-0 pt-1 px-2 pb-2 flex justify-between"]))),
|
80
84
|
children: [showPrevious ? /*#__PURE__*/_jsx(IconButton, {
|
@@ -89,18 +93,25 @@ var NavBar = function NavBar(props) {
|
|
89
93
|
className: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["font-medium text-md"]))),
|
90
94
|
children: [formatMonthCaption(props.displayMonth, {
|
91
95
|
locale: locale
|
92
|
-
}), " ", props.editableYear ? /*#__PURE__*/
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
},
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
96
|
+
}), " ", props.editableYear ? /*#__PURE__*/_jsxs("label", {
|
97
|
+
htmlFor: yearSelectId,
|
98
|
+
children: [/*#__PURE__*/_jsx("span", {
|
99
|
+
className: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["sr-only"]))),
|
100
|
+
children: "Select a year"
|
101
|
+
}), /*#__PURE__*/_jsx("select", {
|
102
|
+
id: yearSelectId,
|
103
|
+
className: cx("rdp-year", stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["pl-0.5 font-medium outline-none border-transparent border-2 rounded focus:border-accent-600 focus:shadow-z100 appearance-none"])))),
|
104
|
+
value: props.displayMonth.getFullYear(),
|
105
|
+
onChange: function onChange(e) {
|
106
|
+
return goToDate(setYear(props.displayMonth, parseInt(e.currentTarget.value)));
|
107
|
+
},
|
108
|
+
children: years.map(function (year) {
|
109
|
+
return /*#__PURE__*/_jsx("option", {
|
110
|
+
value: year,
|
111
|
+
children: year
|
112
|
+
}, year);
|
113
|
+
})
|
114
|
+
})]
|
104
115
|
}) : props.displayMonth.getFullYear()]
|
105
116
|
})
|
106
117
|
}), showNext ? /*#__PURE__*/_jsx(IconButton, {
|
@@ -108,7 +119,7 @@ var NavBar = function NavBar(props) {
|
|
108
119
|
title: nextMonthLabel,
|
109
120
|
onClick: handleNextClick
|
110
121
|
}) : /*#__PURE__*/_jsx("span", {
|
111
|
-
className: stl(
|
122
|
+
className: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["w-8"])))
|
112
123
|
})]
|
113
124
|
});
|
114
125
|
};
|
@@ -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/esm/DatePicker/utils.js
CHANGED
@@ -1,30 +1,12 @@
|
|
1
1
|
import format from "date-fns/format";
|
2
|
-
import * as Locales from "date-fns/locale";
|
3
2
|
export var formatDate = function formatDate(date) {
|
4
3
|
return format(date, "MMM do, yyyy");
|
5
4
|
};
|
6
5
|
export var DEFAULT_DATE_PICKER_LOCALE = {
|
7
|
-
code: "enUS",
|
8
6
|
rtl: false,
|
9
7
|
apply: "Apply",
|
10
8
|
cancel: "Cancel",
|
11
9
|
openButton: "Enter a date...",
|
12
10
|
previousMonth: "Previous month",
|
13
11
|
nextMonth: "Next month"
|
14
|
-
};
|
15
|
-
/**
|
16
|
-
* Looks up a date-fns locale. This falls back to `en`
|
17
|
-
* @param locale the ISO 639-1 language code to look up @link https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
|
18
|
-
* @returns date-fns locale.
|
19
|
-
*/
|
20
|
-
|
21
|
-
export function getDateFnsLocale(locale) {
|
22
|
-
var _allLocales$locale;
|
23
|
-
|
24
|
-
if (!locale) {
|
25
|
-
return Locales.enUS;
|
26
|
-
}
|
27
|
-
|
28
|
-
var allLocales = Locales;
|
29
|
-
return (_allLocales$locale = allLocales[locale]) !== null && _allLocales$locale !== void 0 ? _allLocales$locale : Locales.enUS;
|
30
|
-
}
|
12
|
+
};
|
@@ -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/esm/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/esm/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;
|