@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
@@ -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/esm/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;
|
@@ -22,9 +22,13 @@ var DEFAULT_COMPACT_PAGINATION_LOCALE = {
|
|
22
22
|
return typeof nbPages === "number" ? "Page ".concat(page, " of ").concat(nbPages) : "Page ".concat(page, " of many");
|
23
23
|
}
|
24
24
|
};
|
25
|
+
|
26
|
+
/** @ignore */
|
25
27
|
export var isDeterminateCompactPaginationProps = function isDeterminateCompactPaginationProps(props) {
|
26
28
|
return "nbPages" in props;
|
27
29
|
};
|
30
|
+
/** @ignore */
|
31
|
+
|
28
32
|
export var isIndeterminateCompactPaginationProps = function isIndeterminateCompactPaginationProps(props) {
|
29
33
|
return !isDeterminateCompactPaginationProps(props);
|
30
34
|
};
|
@@ -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>;
|
@@ -9,7 +9,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
9
9
|
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; }
|
10
10
|
|
11
11
|
import { useState } from "react";
|
12
|
-
import { BaseLink } from "../Link";
|
13
12
|
import stl from "../styles/helpers/satellitePrefixer";
|
14
13
|
import { TooltipWrapper } from "../Tooltip";
|
15
14
|
import useLinkProps from "../utils/useLinkProps";
|
@@ -18,7 +17,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
19
18
|
|
20
19
|
var Tooltip = function Tooltip(_ref) {
|
21
|
-
var
|
20
|
+
var content = _ref.content,
|
22
21
|
children = _ref.children;
|
23
22
|
return /*#__PURE__*/_jsx(TooltipWrapper, {
|
24
23
|
placement: "right",
|
@@ -30,40 +29,38 @@ var Tooltip = function Tooltip(_ref) {
|
|
30
29
|
offset: [0, 32]
|
31
30
|
}
|
32
31
|
}],
|
33
|
-
content:
|
32
|
+
content: content,
|
34
33
|
wrapperClassName: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["block"]))),
|
35
34
|
interactive: false,
|
36
35
|
children: children
|
37
36
|
});
|
38
37
|
};
|
39
38
|
|
40
|
-
export var SidebarButtonLink = function SidebarButtonLink(
|
41
|
-
var id =
|
42
|
-
icon =
|
43
|
-
href =
|
44
|
-
|
45
|
-
|
39
|
+
export var SidebarButtonLink = function SidebarButtonLink(props) {
|
40
|
+
var id = props.id,
|
41
|
+
icon = props.icon,
|
42
|
+
href = props.href,
|
43
|
+
disabled = props.disabled,
|
44
|
+
children = props.children;
|
46
45
|
|
47
46
|
var _useSidebarContext = useSidebarContext(),
|
48
47
|
isLinkActive = _useSidebarContext.isLinkActive,
|
49
48
|
collapsed = _useSidebarContext.collapsed;
|
50
49
|
|
51
|
-
var linkProps = useLinkProps(
|
52
|
-
href: href,
|
53
|
-
onClick: onClick
|
54
|
-
});
|
50
|
+
var linkProps = useLinkProps(props);
|
55
51
|
|
56
52
|
var _useState = useState(false),
|
57
53
|
_useState2 = _slicedToArray(_useState, 2),
|
58
54
|
isInteractedWith = _useState2[0],
|
59
55
|
setIsInteractedWith = _useState2[1];
|
60
56
|
|
61
|
-
var isActive = isLinkActive(href);
|
62
|
-
var showColors = isActive || isInteractedWith;
|
57
|
+
var isActive = !disabled && isLinkActive(href);
|
58
|
+
var showColors = !disabled && (isActive || isInteractedWith);
|
63
59
|
var Icon = "active" in icon ? showColors ? icon.active : icon.inactive : icon;
|
60
|
+
var tooltipContent = "tooltipContent" in props ? props.tooltipContent : children;
|
64
61
|
return /*#__PURE__*/_jsx(Tooltip, {
|
65
|
-
|
66
|
-
children: /*#__PURE__*/_jsxs(
|
62
|
+
content: collapsed ? tooltipContent : null,
|
63
|
+
children: /*#__PURE__*/_jsxs("a", _objectSpread(_objectSpread({}, linkProps), {}, {
|
67
64
|
id: id,
|
68
65
|
onMouseEnter: function onMouseEnter() {
|
69
66
|
return setIsInteractedWith(true);
|
@@ -77,7 +74,7 @@ export var SidebarButtonLink = function SidebarButtonLink(_ref2) {
|
|
77
74
|
onBlur: function onBlur() {
|
78
75
|
return setIsInteractedWith(false);
|
79
76
|
},
|
80
|
-
className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n h-8 min-w-8 w-full rounded\n flex items-center space-x-3\n border border-transparent\n display-body
|
77
|
+
className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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"),
|
81
78
|
"aria-current": isActive,
|
82
79
|
children: [/*#__PURE__*/_jsx(Icon, {
|
83
80
|
className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["", " 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>;
|
package/esm/Tabs/ContentTabs.js
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
2
|
|
4
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
5
4
|
|
6
|
-
import { Tabs
|
5
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@radix-ui/react-tabs";
|
7
6
|
import cx from "clsx";
|
8
|
-
import { useEffect, useState } from "react";
|
9
7
|
import Badge from "../Badge";
|
10
8
|
import stl from "../styles/helpers/satellitePrefixer";
|
11
9
|
import { ACTIVE_UNDERLINE_VARIANT_CLASSNAMES } from "./utils";
|
@@ -18,31 +16,13 @@ export var ContentTabs = function ContentTabs(_ref) {
|
|
18
16
|
_ref$defaultIndex = _ref.defaultIndex,
|
19
17
|
defaultIndex = _ref$defaultIndex === void 0 ? 0 : _ref$defaultIndex,
|
20
18
|
onChange = _ref.onChange;
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
if (tabIndex !== undefined && internalTabIndex !== tabIndex) {
|
29
|
-
setInternalTabIndex(tabIndex);
|
30
|
-
}
|
31
|
-
}, [internalTabIndex, tabIndex]);
|
32
|
-
|
33
|
-
var handleTabsChange = function handleTabsChange(index) {
|
34
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(index);
|
35
|
-
|
36
|
-
if (tabIndex === undefined) {
|
37
|
-
setInternalTabIndex(index);
|
38
|
-
}
|
39
|
-
};
|
40
|
-
|
41
|
-
return /*#__PURE__*/_jsxs(ReachTabs, {
|
42
|
-
index: internalTabIndex,
|
43
|
-
onChange: handleTabsChange,
|
44
|
-
defaultIndex: internalTabIndex,
|
45
|
-
children: [/*#__PURE__*/_jsx(TabList, {
|
19
|
+
return /*#__PURE__*/_jsxs(Tabs, {
|
20
|
+
value: typeof tabIndex !== "undefined" ? String(tabIndex) : undefined,
|
21
|
+
defaultValue: typeof defaultIndex !== "undefined" ? String(defaultIndex) : undefined,
|
22
|
+
onValueChange: function onValueChange(value) {
|
23
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(Number(value));
|
24
|
+
},
|
25
|
+
children: [/*#__PURE__*/_jsx(TabsList, {
|
46
26
|
className: cx(stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["tabs-tabbar border-b border-grey-200 flex overflow-x-auto whitespace-nowrap space-x-6"]))), className),
|
47
27
|
children: tabs.map(function (_ref2, index) {
|
48
28
|
var _ref2$variant = _ref2.variant,
|
@@ -51,9 +31,10 @@ export var ContentTabs = function ContentTabs(_ref) {
|
|
51
31
|
disabled = _ref2.disabled,
|
52
32
|
label = _ref2.label,
|
53
33
|
value = _ref2.value;
|
54
|
-
return /*#__PURE__*/_jsxs(
|
55
|
-
|
34
|
+
return /*#__PURE__*/_jsxs(TabsTrigger, {
|
35
|
+
value: String(index),
|
56
36
|
disabled: disabled,
|
37
|
+
className: cx(ACTIVE_UNDERLINE_VARIANT_CLASSNAMES[variant], stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["tab pb-3 text-base leading-sm"]))), className),
|
57
38
|
children: [label, value && /*#__PURE__*/_jsx(Badge, {
|
58
39
|
size: "small",
|
59
40
|
variant: variant,
|
@@ -62,15 +43,13 @@ export var ContentTabs = function ContentTabs(_ref) {
|
|
62
43
|
})]
|
63
44
|
}, index);
|
64
45
|
})
|
65
|
-
}),
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
}, index);
|
73
|
-
})
|
46
|
+
}), tabs.map(function (_ref3, index) {
|
47
|
+
var content = _ref3.content;
|
48
|
+
return /*#__PURE__*/_jsx(TabsContent, {
|
49
|
+
value: String(index),
|
50
|
+
className: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["focus:outline-none"]))),
|
51
|
+
children: content
|
52
|
+
}, index);
|
74
53
|
})]
|
75
54
|
});
|
76
55
|
};
|
@@ -15,8 +15,8 @@ var typographyPlugin = plugin(function (_ref) {
|
|
15
15
|
addUtilities = _ref.addUtilities,
|
16
16
|
addComponents = _ref.addComponents,
|
17
17
|
e = _ref.e;
|
18
|
-
var desktop = theme("
|
19
|
-
var mobile = theme("
|
18
|
+
var desktop = theme("stlTypography.desktop", {});
|
19
|
+
var mobile = theme("stlTypography.mobile", {});
|
20
20
|
var common = {
|
21
21
|
reversed: {
|
22
22
|
color: theme("colors.white")
|
@@ -61,7 +61,7 @@ var typographyPlugin = plugin(function (_ref) {
|
|
61
61
|
content: [],
|
62
62
|
theme: {
|
63
63
|
// @ts-ignore
|
64
|
-
|
64
|
+
stlTypography: function stlTypography(_ref2) {
|
65
65
|
var theme = _ref2.theme;
|
66
66
|
// Need to transform it to a string because in this context, Tailwind doesn't automagically turn it into a string value
|
67
67
|
// Asked here https://github.com/tailwindlabs/tailwindcss/discussions/8755
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
3
2
|
|
4
3
|
var _templateObject;
|
@@ -11,11 +10,12 @@ export var UserContent = function UserContent(_ref) {
|
|
11
10
|
content = _ref.content,
|
12
11
|
_ref$styled = _ref.styled,
|
13
12
|
styled = _ref$styled === void 0 ? true : _ref$styled;
|
14
|
-
|
15
|
-
|
13
|
+
if (!content) return null;
|
14
|
+
return /*#__PURE__*/_jsx("div", {
|
15
|
+
className: cx(stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["", ""])), styled && "usercontent"), className),
|
16
16
|
dangerouslySetInnerHTML: {
|
17
17
|
__html: content
|
18
18
|
}
|
19
|
-
})
|
19
|
+
});
|
20
20
|
};
|
21
21
|
export default UserContent;
|
@@ -17,10 +17,10 @@ export default plugin(function (_ref) {
|
|
17
17
|
theme = _ref.theme;
|
18
18
|
|
19
19
|
/** @type {any} */
|
20
|
-
var desktop = theme("
|
20
|
+
var desktop = theme("stlTypography.desktop", {});
|
21
21
|
/** @type {any} */
|
22
22
|
|
23
|
-
var mobile = theme("
|
23
|
+
var mobile = theme("stlTypography.mobile", {});
|
24
24
|
addComponents({
|
25
25
|
".usercontent": _defineProperty({
|
26
26
|
"h1, h2, h3, h4, h5, h6, p, ul, ol, blockquote, table": {
|
@@ -6,21 +6,21 @@
|
|
6
6
|
* @param {string} classname
|
7
7
|
*/
|
8
8
|
function prefixTailwindClassName(tailwindPrefix, classname) {
|
9
|
-
var
|
10
|
-
|
11
|
-
var
|
12
|
-
var prefixInsertIndex = classNameSafeZone.lastIndexOf("!");
|
9
|
+
var searchZone = classname.replace(/-\[[^\]]+\]$/, ""); // important marker
|
10
|
+
|
11
|
+
var prefixInsertIndex = searchZone.lastIndexOf("!"); // modifier separator
|
13
12
|
|
14
13
|
if (prefixInsertIndex === -1) {
|
15
|
-
prefixInsertIndex =
|
16
|
-
}
|
14
|
+
prefixInsertIndex = searchZone.lastIndexOf(":");
|
15
|
+
} // container marker
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
|
18
|
+
if (prefixInsertIndex === -1) {
|
19
|
+
prefixInsertIndex = searchZone.lastIndexOf("@");
|
21
20
|
}
|
22
21
|
|
23
|
-
|
22
|
+
prefixInsertIndex += 1;
|
23
|
+
return classname.slice(0, prefixInsertIndex) + tailwindPrefix + classname.slice(prefixInsertIndex);
|
24
24
|
}
|
25
25
|
|
26
26
|
export default prefixTailwindClassName;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@algolia/satellite",
|
3
|
-
"version": "1.0.0-beta.
|
3
|
+
"version": "1.0.0-beta.147",
|
4
4
|
"description": "Algolia design system React components",
|
5
5
|
"scripts": {
|
6
6
|
"clean": "rimraf dist",
|
@@ -67,7 +67,7 @@
|
|
67
67
|
"dependencies": {
|
68
68
|
"@babel/runtime": "^7.17.7",
|
69
69
|
"@popperjs/core": "^2.4.4",
|
70
|
-
"@
|
70
|
+
"@radix-ui/react-tabs": "^1.0.1",
|
71
71
|
"clsx": "^1.2.1",
|
72
72
|
"color": "^4.2.3",
|
73
73
|
"date-fns": "2.22.1",
|
@@ -79,7 +79,7 @@
|
|
79
79
|
"react-popper": "^2.2.5",
|
80
80
|
"react-transition-group": "4.4.2",
|
81
81
|
"react-use": "^15.3.8",
|
82
|
-
"tailwindcss": "^3.
|
82
|
+
"tailwindcss": "^3.2.2"
|
83
83
|
},
|
84
84
|
"main": "./cjs/index.js",
|
85
85
|
"module": "./esm/index.js",
|