@algolia/satellite 1.0.0-beta.134 → 1.0.0-beta.135
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 +3 -1
- package/cjs/DatePicker/components/Modal.js +5 -4
- package/cjs/Dropdown/Dropdown.js +5 -4
- package/cjs/Dropdown/components/DropdownButtonItem.js +2 -2
- package/cjs/Dropdown/components/DropdownLinkItem.js +0 -1
- package/cjs/Dropdown/useDropdownItemProps.d.ts +9 -1
- package/cjs/Dropdown/useDropdownItemProps.js +16 -7
- package/cjs/Flag/Flags.d.ts +1 -1
- package/cjs/Flag/Flags.js +5 -4
- package/cjs/Link/ButtonLink.js +1 -10
- package/cjs/Modal/Modal.d.ts +1 -1
- package/cjs/Modal/Modal.js +3 -4
- package/cjs/Satellite/Satellite.d.ts +1 -0
- package/cjs/Satellite/Satellite.js +3 -1
- package/cjs/Satellite/SatelliteContext.d.ts +1 -0
- package/cjs/Satellite/index.d.ts +1 -0
- package/cjs/Satellite/index.js +14 -0
- package/cjs/Satellite/locale.d.ts +5 -3
- package/cjs/Satellite/useCreatePortal.d.ts +4 -0
- package/cjs/Satellite/useCreatePortal.js +29 -0
- package/cjs/ScrollIndicator/ScrollIndicator.js +2 -1
- package/cjs/Sidebar/Sidebar.d.ts +33 -12
- package/cjs/Sidebar/Sidebar.js +48 -38
- package/cjs/Sidebar/SidebarButtonLink.d.ts +14 -0
- package/cjs/Sidebar/SidebarButtonLink.js +110 -0
- package/cjs/Sidebar/SidebarContext.d.ts +7 -8
- package/cjs/Sidebar/SidebarContext.js +10 -11
- package/cjs/Sidebar/SidebarHeader.d.ts +6 -0
- package/cjs/Sidebar/SidebarHeader.js +29 -0
- package/cjs/Sidebar/SidebarHeading.d.ts +6 -0
- package/cjs/Sidebar/SidebarHeading.js +35 -0
- package/cjs/Sidebar/SidebarLink.d.ts +8 -0
- package/cjs/Sidebar/SidebarLink.js +58 -0
- package/cjs/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.d.ts +8 -0
- package/cjs/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.js +47 -0
- package/cjs/Sidebar/SidebarLinksGroup/SidebarGroupLink.d.ts +7 -0
- package/cjs/Sidebar/{components/SidebarHeader.js → SidebarLinksGroup/SidebarGroupLink.js} +14 -23
- package/cjs/Sidebar/SidebarLinksGroup/SidebarLinksGroup.d.ts +23 -0
- package/cjs/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +120 -0
- package/cjs/Sidebar/SidebarLinksGroup/index.d.ts +2 -0
- package/cjs/Sidebar/SidebarLinksGroup/index.js +18 -0
- package/cjs/Sidebar/SidebarLinksGroup/types.d.ts +10 -0
- package/cjs/Sidebar/SidebarLinksGroup/types.js +5 -0
- package/cjs/Sidebar/SidebarNav.d.ts +9 -0
- package/cjs/Sidebar/SidebarNav.js +46 -0
- package/cjs/Sidebar/index.d.ts +7 -4
- package/cjs/Sidebar/index.js +61 -21
- package/cjs/Sidebar/types.d.ts +6 -2
- package/cjs/Tabs/Tabs.tailwind.js +8 -8
- package/cjs/Tabs/components/LinkTab.js +7 -9
- package/cjs/Tooltip/OverflowTooltipWrapper.js +5 -4
- package/cjs/Tooltip/TooltipWrapper.js +5 -4
- package/cjs/index.d.ts +0 -1
- package/cjs/index.js +0 -14
- package/cjs/styles/tailwind.config.js +1 -1
- package/cjs/utils/useLinkProps.d.ts +5 -2
- package/cjs/utils/useLinkProps.js +9 -2
- package/esm/AutoComplete/AutoComplete.js +3 -1
- package/esm/DatePicker/components/Modal.js +4 -3
- package/esm/Dropdown/Dropdown.js +4 -3
- package/esm/Dropdown/components/DropdownButtonItem.js +2 -2
- package/esm/Dropdown/components/DropdownLinkItem.js +0 -1
- package/esm/Dropdown/useDropdownItemProps.d.ts +9 -1
- package/esm/Dropdown/useDropdownItemProps.js +15 -7
- package/esm/Flag/Flags.d.ts +1 -1
- package/esm/Flag/Flags.js +4 -3
- package/esm/Link/ButtonLink.js +1 -10
- package/esm/Modal/Modal.d.ts +1 -1
- package/esm/Modal/Modal.js +4 -4
- package/esm/Satellite/Satellite.d.ts +1 -0
- package/esm/Satellite/Satellite.js +3 -1
- package/esm/Satellite/SatelliteContext.d.ts +1 -0
- package/esm/Satellite/index.d.ts +1 -0
- package/esm/Satellite/index.js +1 -0
- package/esm/Satellite/locale.d.ts +5 -3
- package/esm/Satellite/useCreatePortal.d.ts +4 -0
- package/esm/Satellite/useCreatePortal.js +16 -0
- package/esm/ScrollIndicator/ScrollIndicator.js +2 -1
- package/esm/Sidebar/Sidebar.d.ts +33 -12
- package/esm/Sidebar/Sidebar.js +44 -29
- package/esm/Sidebar/SidebarButtonLink.d.ts +14 -0
- package/esm/Sidebar/SidebarButtonLink.js +92 -0
- package/esm/Sidebar/SidebarContext.d.ts +7 -8
- package/esm/Sidebar/SidebarContext.js +9 -8
- package/esm/Sidebar/SidebarHeader.d.ts +6 -0
- package/esm/Sidebar/SidebarHeader.js +15 -0
- package/esm/Sidebar/SidebarHeading.d.ts +6 -0
- package/esm/Sidebar/SidebarHeading.js +20 -0
- package/esm/Sidebar/SidebarLink.d.ts +8 -0
- package/esm/Sidebar/SidebarLink.js +42 -0
- package/esm/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.d.ts +8 -0
- package/esm/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.js +32 -0
- package/esm/Sidebar/SidebarLinksGroup/SidebarGroupLink.d.ts +7 -0
- package/esm/Sidebar/{components/SidebarHeader.js → SidebarLinksGroup/SidebarGroupLink.js} +13 -19
- package/esm/Sidebar/SidebarLinksGroup/SidebarLinksGroup.d.ts +23 -0
- package/esm/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +100 -0
- package/esm/Sidebar/SidebarLinksGroup/index.d.ts +2 -0
- package/esm/Sidebar/SidebarLinksGroup/index.js +2 -0
- package/esm/Sidebar/SidebarLinksGroup/types.d.ts +10 -0
- package/esm/Sidebar/SidebarLinksGroup/types.js +1 -0
- package/esm/Sidebar/SidebarNav.d.ts +9 -0
- package/esm/Sidebar/SidebarNav.js +31 -0
- package/esm/Sidebar/index.d.ts +7 -4
- package/esm/Sidebar/index.js +7 -4
- package/esm/Sidebar/types.d.ts +6 -2
- package/esm/Tabs/Tabs.tailwind.js +8 -8
- package/esm/Tabs/components/LinkTab.js +7 -9
- package/esm/Tooltip/OverflowTooltipWrapper.js +4 -3
- package/esm/Tooltip/TooltipWrapper.js +4 -3
- package/esm/index.d.ts +0 -1
- package/esm/index.js +0 -1
- package/esm/styles/tailwind.config.js +1 -1
- package/esm/utils/useLinkProps.d.ts +5 -2
- package/esm/utils/useLinkProps.js +9 -2
- package/package.json +1 -1
- package/satellite.min.css +1 -1
- package/cjs/Banner/Banner.d.ts +0 -86
- package/cjs/Banner/Banner.js +0 -176
- package/cjs/Banner/index.d.ts +0 -2
- package/cjs/Banner/index.js +0 -32
- package/cjs/Sidebar/Sidebar.tailwind.d.ts +0 -5
- package/cjs/Sidebar/Sidebar.tailwind.js +0 -66
- package/cjs/Sidebar/components/SidebarHeader.d.ts +0 -5
- package/cjs/Sidebar/components/SidebarLink.d.ts +0 -10
- package/cjs/Sidebar/components/SidebarLink.js +0 -98
- package/esm/Banner/Banner.d.ts +0 -86
- package/esm/Banner/Banner.js +0 -161
- package/esm/Banner/index.d.ts +0 -2
- package/esm/Banner/index.js +0 -2
- package/esm/Sidebar/Sidebar.tailwind.d.ts +0 -5
- package/esm/Sidebar/Sidebar.tailwind.js +0 -64
- package/esm/Sidebar/components/SidebarHeader.d.ts +0 -5
- package/esm/Sidebar/components/SidebarLink.d.ts +0 -10
- package/esm/Sidebar/components/SidebarLink.js +0 -78
package/esm/Banner/index.d.ts
DELETED
package/esm/Banner/index.js
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
import _plugin from "tailwindcss/plugin";
|
2
|
-
// @ts-check
|
3
|
-
var plugin = _plugin;
|
4
|
-
var sidebarPlugin = plugin(function (_ref) {
|
5
|
-
var addComponents = _ref.addComponents,
|
6
|
-
theme = _ref.theme;
|
7
|
-
|
8
|
-
/**
|
9
|
-
* Returns a left border built with a box-shadow
|
10
|
-
* @param {string} color
|
11
|
-
*/
|
12
|
-
var borderLeftInsetShadow = function borderLeftInsetShadow(color) {
|
13
|
-
return "inset 3px 0 0 ".concat(color);
|
14
|
-
};
|
15
|
-
|
16
|
-
addComponents({
|
17
|
-
".sidebar": {
|
18
|
-
backgroundColor: theme("colors.grey.900"),
|
19
|
-
color: theme("colors.grey.200"),
|
20
|
-
width: "256px"
|
21
|
-
},
|
22
|
-
".sidebar-light": {
|
23
|
-
backgroundColor: theme("colors.white"),
|
24
|
-
boxShadow: "\n 0 0 0 1px ".concat(theme("colors.shadow.5"), ",\n 0 1px 3px 0 ").concat(theme("colors.shadow.15"), "\n ")
|
25
|
-
},
|
26
|
-
".sidebar-collapsed": {
|
27
|
-
width: "80px"
|
28
|
-
}
|
29
|
-
});
|
30
|
-
addComponents({
|
31
|
-
".sidebar-link": {
|
32
|
-
display: "flex",
|
33
|
-
alignItems: "center",
|
34
|
-
padding: "".concat(theme("spacing.2"), " ").concat(theme("spacing.6")),
|
35
|
-
color: "inherit",
|
36
|
-
height: "2.5rem",
|
37
|
-
cursor: "pointer",
|
38
|
-
transition: "background-color 100ms ease-in-out",
|
39
|
-
"&, &:hover": {
|
40
|
-
textDecoration: "none",
|
41
|
-
outline: "none"
|
42
|
-
},
|
43
|
-
"&:hover, &:focus, &.sidebar-link-active": {
|
44
|
-
backgroundColor: theme("colors.grey.950"),
|
45
|
-
color: theme("colors.white")
|
46
|
-
},
|
47
|
-
"&.sidebar-link-active": {
|
48
|
-
boxShadow: borderLeftInsetShadow(theme("colors.accent.500"))
|
49
|
-
}
|
50
|
-
},
|
51
|
-
".sidebar-link-light": {
|
52
|
-
backgroundColor: "transparent",
|
53
|
-
color: theme("colors.grey.600"),
|
54
|
-
"&:hover, &:focus, &.sidebar-link-active": {
|
55
|
-
backgroundColor: theme("colors.grey.100"),
|
56
|
-
color: theme("colors.grey.900")
|
57
|
-
},
|
58
|
-
"&.sidebar-link-active": {
|
59
|
-
boxShadow: borderLeftInsetShadow(theme("colors.accent.600"))
|
60
|
-
}
|
61
|
-
}
|
62
|
-
});
|
63
|
-
});
|
64
|
-
export default sidebarPlugin;
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import type { DetailedHTMLProps, HTMLAttributes } from "react";
|
2
|
-
export interface SidebarHeaderProps extends DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement> {
|
3
|
-
}
|
4
|
-
export declare const SidebarHeader: ({ className, children, ...headingProps }: SidebarHeaderProps) => JSX.Element;
|
5
|
-
export default SidebarHeader;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { AnchorHTMLAttributes, DetailedHTMLProps, FunctionComponent, ReactNode } from "react";
|
2
|
-
import type { IconComponentType } from "../../types";
|
3
|
-
import matchLocation from "../../utils/matchLocation";
|
4
|
-
export interface SidebarLinkProps extends DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
|
5
|
-
icon?: IconComponentType;
|
6
|
-
active?: typeof matchLocation | boolean;
|
7
|
-
children: ReactNode;
|
8
|
-
}
|
9
|
-
export declare const SidebarLink: FunctionComponent<SidebarLinkProps>;
|
10
|
-
export default SidebarLink;
|
@@ -1,78 +0,0 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
|
-
|
5
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
6
|
-
|
7
|
-
var _excluded = ["className", "children", "active", "icon"];
|
8
|
-
|
9
|
-
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; }
|
10
|
-
|
11
|
-
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; }
|
12
|
-
|
13
|
-
import cx from "classnames";
|
14
|
-
import { ExternalLink } from "react-feather";
|
15
|
-
import useLocation from "react-use/lib/useLocation";
|
16
|
-
import stl from "../../styles/helpers/satellitePrefixer";
|
17
|
-
import { TooltipWrapper } from "../../Tooltip";
|
18
|
-
import matchLocation from "../../utils/matchLocation";
|
19
|
-
import useLinkProps from "../../utils/useLinkProps";
|
20
|
-
import { useSidebarContext } from "../SidebarContext";
|
21
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
22
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
23
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
24
|
-
|
25
|
-
var IdentityWrapper = function IdentityWrapper(_ref) {
|
26
|
-
var children = _ref.children;
|
27
|
-
return /*#__PURE__*/_jsx(_Fragment, {
|
28
|
-
children: children
|
29
|
-
});
|
30
|
-
};
|
31
|
-
|
32
|
-
export var SidebarLink = function SidebarLink(_ref2) {
|
33
|
-
var className = _ref2.className,
|
34
|
-
children = _ref2.children,
|
35
|
-
_ref2$active = _ref2.active,
|
36
|
-
active = _ref2$active === void 0 ? matchLocation : _ref2$active,
|
37
|
-
Icon = _ref2.icon,
|
38
|
-
anchorProps = _objectWithoutProperties(_ref2, _excluded);
|
39
|
-
|
40
|
-
var _useLocation = useLocation(),
|
41
|
-
_useLocation$pathname = _useLocation.pathname,
|
42
|
-
pathname = _useLocation$pathname === void 0 ? "" : _useLocation$pathname;
|
43
|
-
|
44
|
-
var satelliteLinkProps = useLinkProps(anchorProps);
|
45
|
-
|
46
|
-
var _useSidebarContext = useSidebarContext(),
|
47
|
-
variant = _useSidebarContext.variant,
|
48
|
-
collapsed = _useSidebarContext.collapsed;
|
49
|
-
|
50
|
-
var showActive = Boolean(anchorProps.href && typeof active === "function" ? active(anchorProps.href, {
|
51
|
-
pathname: pathname
|
52
|
-
}) : active);
|
53
|
-
var activeIconBackground = variant === "light" ? "bg-accent-200" : "bg-grey-800";
|
54
|
-
var Wrapper = collapsed ? TooltipWrapper : IdentityWrapper;
|
55
|
-
var isExternalLink = satelliteLinkProps.target === "_blank";
|
56
|
-
return /*#__PURE__*/_jsx(Wrapper, {
|
57
|
-
wrapperClassName: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["w-full"]))),
|
58
|
-
content: children,
|
59
|
-
tooltipVariant: "light",
|
60
|
-
placement: "right",
|
61
|
-
children: /*#__PURE__*/_jsxs("a", _objectSpread(_objectSpread(_objectSpread({}, anchorProps), satelliteLinkProps), {}, {
|
62
|
-
className: cx(stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["sidebar-link display-body\n ", "\n ", "\n "])), variant === "light" && "sidebar-link-light", showActive && "sidebar-link-active"), className),
|
63
|
-
children: [Icon && /*#__PURE__*/_jsx("span", {
|
64
|
-
className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n shrink-0\n ml-1 mr-2 h-6 w-6\n flex items-center justify-center\n text-inherit rounded\n ", "\n "])), showActive && activeIconBackground),
|
65
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
66
|
-
size: "1rem"
|
67
|
-
})
|
68
|
-
}), !collapsed && /*#__PURE__*/_jsx("span", {
|
69
|
-
className: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["flex-1 truncate ", ""])), !Icon && "ml-2"),
|
70
|
-
children: children
|
71
|
-
}), !collapsed && isExternalLink && /*#__PURE__*/_jsx(ExternalLink, {
|
72
|
-
className: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["ml-1"]))),
|
73
|
-
size: "1em"
|
74
|
-
})]
|
75
|
-
}))
|
76
|
-
});
|
77
|
-
};
|
78
|
-
export default SidebarLink;
|