@algolia/satellite 1.0.0-beta.150 → 1.0.0-beta.154
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/README.md +1 -1
- package/cjs/AnnouncementBadge/AnnouncementBadge.d.ts +6 -0
- package/cjs/AutoComplete/AutoComplete.d.ts +0 -1
- package/cjs/AutoComplete/AutoComplete.js +7 -11
- package/cjs/AutoComplete/components/AutoCompleteEmptyState.js +1 -1
- package/cjs/AutoComplete/types.d.ts +0 -1
- package/cjs/Avatars/UserAvatar.d.ts +4 -1
- package/cjs/Badge/Badge.js +3 -2
- package/cjs/Banners/Alert/Alert.d.ts +4 -0
- package/cjs/Banners/Alert/Alert.js +1 -1
- package/cjs/Banners/Promote/Promote.js +3 -3
- package/cjs/Card/Card.d.ts +1 -1
- package/cjs/Card/components/CardHeader.d.ts +5 -3
- package/cjs/Card/components/CardHeader.js +4 -2
- package/cjs/Checkbox/Checkbox.js +2 -1
- package/cjs/EmptyState/EmptyState.js +4 -4
- package/cjs/EmptyState/types.d.ts +1 -1
- package/cjs/Field/Field.js +1 -1
- package/cjs/Flag/Flag.js +2 -1
- package/cjs/Flag/types.d.ts +6 -1
- package/cjs/FlexGrid/FlexGrid.d.ts +34 -0
- package/cjs/Input/Input.d.ts +1 -1
- package/cjs/Input/Input.js +2 -2
- package/cjs/Modal/Modal.d.ts +8 -1
- package/cjs/Modal/Modal.js +1 -1
- package/cjs/Pagination/CompactPagination/CompactPagination.js +1 -1
- package/cjs/RangeSlider/RangeSlider.d.ts +22 -6
- package/cjs/RangeSlider/RangeSlider.js +69 -78
- package/cjs/Sidebar/SidebarButtonLink.js +8 -3
- package/cjs/Sidebar/SidebarHeading.js +1 -1
- package/cjs/Sidebar/SidebarLink.js +10 -5
- package/cjs/Sidebar/SidebarLinksGroup/SidebarGroupLink.js +9 -4
- package/cjs/Tables/Table/Table.js +1 -1
- package/cjs/Tabs/ContentTabs.js +2 -2
- package/cjs/Tabs/components/LinkTab.js +1 -1
- package/cjs/Tooltip/OverflowTooltipWrapper.js +1 -1
- package/cjs/Tooltip/TooltipWrapper.d.ts +1 -1
- package/cjs/styles/helpers/makePurgeCssExtractor.js +1 -1
- package/cjs/styles/tailwind.config.js +1 -1
- package/cjs/utils/index.d.ts +0 -1
- package/cjs/utils/isCssPropertySupported.d.ts +1 -1
- package/esm/AnnouncementBadge/AnnouncementBadge.d.ts +6 -0
- package/esm/AutoComplete/AutoComplete.d.ts +0 -1
- package/esm/AutoComplete/AutoComplete.js +7 -11
- package/esm/AutoComplete/components/AutoCompleteEmptyState.js +1 -1
- package/esm/AutoComplete/types.d.ts +0 -1
- package/esm/Avatars/UserAvatar.d.ts +4 -1
- package/esm/Badge/Badge.js +3 -2
- package/esm/Banners/Alert/Alert.d.ts +4 -0
- package/esm/Banners/Alert/Alert.js +1 -1
- package/esm/Banners/Promote/Promote.js +3 -3
- package/esm/Card/Card.d.ts +1 -1
- package/esm/Card/components/CardHeader.d.ts +5 -3
- package/esm/Card/components/CardHeader.js +4 -2
- package/esm/Checkbox/Checkbox.js +2 -1
- package/esm/EmptyState/EmptyState.js +4 -4
- package/esm/EmptyState/types.d.ts +1 -1
- package/esm/Field/Field.js +1 -1
- package/esm/Flag/Flag.js +2 -1
- package/esm/Flag/types.d.ts +6 -1
- package/esm/FlexGrid/FlexGrid.d.ts +34 -0
- package/esm/Input/Input.d.ts +1 -1
- package/esm/Input/Input.js +2 -2
- package/esm/Modal/Modal.d.ts +8 -1
- package/esm/Modal/Modal.js +1 -1
- package/esm/Pagination/CompactPagination/CompactPagination.js +1 -1
- package/esm/RangeSlider/RangeSlider.d.ts +22 -6
- package/esm/RangeSlider/RangeSlider.js +69 -78
- package/esm/Sidebar/SidebarButtonLink.js +8 -3
- package/esm/Sidebar/SidebarHeading.js +1 -1
- package/esm/Sidebar/SidebarLink.js +10 -5
- package/esm/Sidebar/SidebarLinksGroup/SidebarGroupLink.js +10 -4
- package/esm/Tables/Table/Table.js +1 -1
- package/esm/Tabs/ContentTabs.js +2 -2
- package/esm/Tabs/components/LinkTab.js +1 -1
- package/esm/Tooltip/OverflowTooltipWrapper.js +1 -1
- package/esm/Tooltip/TooltipWrapper.d.ts +1 -1
- package/esm/styles/helpers/makePurgeCssExtractor.js +1 -1
- package/esm/styles/tailwind.config.js +1 -1
- package/esm/utils/index.d.ts +0 -1
- package/esm/utils/isCssPropertySupported.d.ts +1 -1
- package/package.json +9 -8
- package/satellite.min.css +1 -1
- package/cjs/RangeSlider/RangeSlider.tailwind.d.ts +0 -5
- package/cjs/RangeSlider/RangeSlider.tailwind.js +0 -73
- package/esm/RangeSlider/RangeSlider.tailwind.d.ts +0 -5
- package/esm/RangeSlider/RangeSlider.tailwind.js +0 -73
@@ -6,106 +6,97 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports["default"] = exports.RangeSlider = void 0;
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
11
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
11
|
+
var _reactSlider = require("@radix-ui/react-slider");
|
12
12
|
var _clsx = _interopRequireDefault(require("clsx"));
|
13
|
-
var _react = require("react");
|
14
13
|
var _colors = _interopRequireDefault(require("../styles/colors"));
|
15
14
|
var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
|
16
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
17
|
-
var
|
18
|
-
var
|
16
|
+
var _excluded = ["className", "value", "defaultValue", "onChange", "onCommit", "disabled", "min", "max", "track1Color", "track2Color"];
|
17
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
19
18
|
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; }
|
20
19
|
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; }
|
21
|
-
var
|
22
|
-
|
23
|
-
|
24
|
-
return value;
|
20
|
+
var TRACK_SHADOWS_CLASSNAME = (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["shadow-[inset_0_1px_3px_0_rgb(0_0_0_/_10%),0_0.5px_0_0_rgb(255_255_255_/_5%)]"])));
|
21
|
+
var coerceToRadixValue = function coerceToRadixValue(value) {
|
22
|
+
return typeof value === "number" ? [value] : value;
|
25
23
|
};
|
26
|
-
var
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
var getThumbCount = function getThumbCount(value) {
|
25
|
+
return Array.isArray(value) ? value.length : 1;
|
26
|
+
};
|
27
|
+
var ThumbGroove = function ThumbGroove(_ref) {
|
28
|
+
var className = _ref.className;
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
30
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["h-3 w-px bg-grey-200"]))), className)
|
31
|
+
});
|
30
32
|
};
|
31
33
|
|
32
34
|
/**
|
33
|
-
* A range slider is an input field where users select
|
35
|
+
* A range slider is an input field where users select one or two numeric values within a given range (minimum and maximum values).
|
34
36
|
*
|
35
37
|
* - Range sliders should always be used with a label
|
36
38
|
* - Provide min and max value whenever possible
|
37
39
|
* - Provide text input for better accessibility
|
38
40
|
*/
|
39
|
-
var RangeSlider =
|
40
|
-
var className =
|
41
|
-
value =
|
42
|
-
defaultValue =
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
55
|
-
internalValue = _useState2[0],
|
56
|
-
setInternalValue = _useState2[1];
|
57
|
-
var _getScaleValues = getScaleValues(internalValue, min, max),
|
58
|
-
_getScaleValues2 = (0, _slicedToArray2["default"])(_getScaleValues, 2),
|
59
|
-
track1 = _getScaleValues2[0],
|
60
|
-
track2 = _getScaleValues2[1];
|
61
|
-
(0, _react.useEffect)(function () {
|
62
|
-
if (typeof value !== "undefined" && value !== internalValue) {
|
63
|
-
setInternalValue(value);
|
64
|
-
}
|
65
|
-
}, [internalValue, value]);
|
66
|
-
var handleChange = function handleChange(evt) {
|
67
|
-
if (otherProps.onChange) {
|
68
|
-
otherProps.onChange(evt);
|
69
|
-
}
|
70
|
-
if (!evt.defaultPrevented) {
|
71
|
-
setInternalValue(evt.currentTarget.valueAsNumber);
|
72
|
-
}
|
73
|
-
};
|
41
|
+
var RangeSlider = function RangeSlider(_ref2) {
|
42
|
+
var className = _ref2.className,
|
43
|
+
value = _ref2.value,
|
44
|
+
defaultValue = _ref2.defaultValue,
|
45
|
+
onChange = _ref2.onChange,
|
46
|
+
onCommit = _ref2.onCommit,
|
47
|
+
disabled = _ref2.disabled,
|
48
|
+
_ref2$min = _ref2.min,
|
49
|
+
min = _ref2$min === void 0 ? 0 : _ref2$min,
|
50
|
+
_ref2$max = _ref2.max,
|
51
|
+
max = _ref2$max === void 0 ? 100 : _ref2$max,
|
52
|
+
track1Color = _ref2.track1Color,
|
53
|
+
track2Color = _ref2.track2Color,
|
54
|
+
otherProps = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
|
55
|
+
var thumbsCount = getThumbCount(value !== null && value !== void 0 ? value : defaultValue);
|
74
56
|
var trackColors = {
|
75
57
|
track1: disabled ? _colors["default"].grey[200] : track1Color,
|
76
58
|
track2: disabled ? _colors["default"].grey[100] : track2Color
|
77
59
|
};
|
78
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
79
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(
|
80
|
-
|
81
|
-
|
60
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactSlider.Root, _objectSpread(_objectSpread({}, otherProps), {}, {
|
61
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["relative h-6 min-w-[200px] flex items-center select-none touch-none aria-disabled:opacity-70 cursor-pointer aria-disabled:cursor-not-allowed"]))), className),
|
62
|
+
value: coerceToRadixValue(value),
|
63
|
+
defaultValue: coerceToRadixValue(defaultValue),
|
64
|
+
onValueChange: function onValueChange(value) {
|
65
|
+
return (// @ts-expect-error
|
66
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value.length === 1 ? value[0] : value)
|
67
|
+
);
|
68
|
+
},
|
69
|
+
onValueCommit: function onValueCommit(value) {
|
70
|
+
return (// @ts-expect-error
|
71
|
+
onCommit === null || onCommit === void 0 ? void 0 : onCommit(value.length === 1 ? value[0] : value)
|
72
|
+
);
|
73
|
+
},
|
74
|
+
disabled: disabled,
|
75
|
+
max: max,
|
76
|
+
min: min,
|
77
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSlider.SliderTrack, {
|
78
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["relative h-1 flex-1 rounded bg-grey-100"]))), TRACK_SHADOWS_CLASSNAME),
|
82
79
|
style: {
|
83
|
-
width: "".concat(track1 * 100, "%"),
|
84
|
-
backgroundColor: trackColors.track1
|
85
|
-
}
|
86
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
87
|
-
className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["range-slider-track-2"]))),
|
88
|
-
style: {
|
89
|
-
width: "".concat(track2 * 100, "%"),
|
90
80
|
backgroundColor: trackColors.track2
|
91
|
-
}
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
});
|
81
|
+
},
|
82
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSlider.SliderRange, {
|
83
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["absolute rounded-full h-full bg-accent-600"]))), TRACK_SHADOWS_CLASSNAME),
|
84
|
+
style: {
|
85
|
+
backgroundColor: trackColors.track1
|
86
|
+
}
|
87
|
+
})
|
88
|
+
}), Array(thumbsCount).fill(undefined).map(function (_, idx) {
|
89
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactSlider.SliderThumb, {
|
90
|
+
className: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n absolute -translate-x-1.5 -translate-y-3\n w-3 h-6 rounded-[2px] border border-grey-200\n bg-white bg-gradient-to-b from-white to-grey-50 shadow-[0_1px_0_0_rgb(35_38_59_/_5%)]\n "]))),
|
91
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ThumbGroove, {
|
92
|
+
className: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["absolute top-1.5 right-1.5"])))
|
93
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ThumbGroove, {
|
94
|
+
className: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["absolute top-1.5 left-1.5"])))
|
95
|
+
})]
|
96
|
+
}, "thumb_".concat(idx));
|
97
|
+
})]
|
98
|
+
}));
|
99
|
+
};
|
109
100
|
exports.RangeSlider = RangeSlider;
|
110
101
|
RangeSlider.displayName = "RangeSlider";
|
111
102
|
var _default = RangeSlider;
|
@@ -9,12 +9,13 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
11
11
|
var _react = require("react");
|
12
|
+
var _reactFeather = require("react-feather");
|
12
13
|
var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
|
13
14
|
var _Tooltip = require("../Tooltip");
|
14
15
|
var _useLinkProps = _interopRequireDefault(require("../utils/useLinkProps"));
|
15
16
|
var _SidebarContext = require("./SidebarContext");
|
16
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
17
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
18
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
18
19
|
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; }
|
19
20
|
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; }
|
20
21
|
var Tooltip = function Tooltip(_ref) {
|
@@ -50,7 +51,8 @@ var SidebarButtonLink = function SidebarButtonLink(props) {
|
|
50
51
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
51
52
|
isInteractedWith = _useState2[0],
|
52
53
|
setIsInteractedWith = _useState2[1];
|
53
|
-
var
|
54
|
+
var isExternalLink = linkProps.target === "_blank";
|
55
|
+
var isActive = !disabled && !isExternalLink && isLinkActive(href);
|
54
56
|
var showColors = !disabled && (isActive || isInteractedWith);
|
55
57
|
var Icon = "active" in icon ? showColors ? icon.active : icon.inactive : icon;
|
56
58
|
var tooltipContent = "tooltipContent" in props ? props.tooltipContent : children;
|
@@ -77,8 +79,11 @@ var SidebarButtonLink = function SidebarButtonLink(props) {
|
|
77
79
|
height: 20,
|
78
80
|
width: 20
|
79
81
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
80
|
-
className: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n
|
82
|
+
className: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n ", "\n ", "\n "])), collapsed && "sr-only", showColors ? "text-accent-600" : "typo-subdued", isActive && "font-bold"),
|
81
83
|
children: children
|
84
|
+
}), isExternalLink && !collapsed && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFeather.ExternalLink, {
|
85
|
+
className: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["", " !ml-1 shrink-0"])), showColors ? "text-accent-600" : "typo-subdued"),
|
86
|
+
size: "1em"
|
82
87
|
})]
|
83
88
|
}))
|
84
89
|
});
|
@@ -19,7 +19,7 @@ var SidebarHeading = function SidebarHeading(_ref) {
|
|
19
19
|
collapsed = _useSidebarContext.collapsed;
|
20
20
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
21
21
|
id: id,
|
22
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n h-8 block leading-[2rem]\n display-subheading typo-subdued uppercase select-none\n ", "\n "])), collapsed && "
|
22
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n h-8 block leading-[2rem]\n display-subheading typo-subdued uppercase select-none\n ", "\n "])), collapsed && "sr-only"), className),
|
23
23
|
children: children
|
24
24
|
});
|
25
25
|
};
|
@@ -8,11 +8,12 @@ exports.SidebarLink = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
10
10
|
var _clsx = _interopRequireDefault(require("clsx"));
|
11
|
+
var _reactFeather = require("react-feather");
|
11
12
|
var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
|
12
13
|
var _useLinkProps = _interopRequireDefault(require("../utils/useLinkProps"));
|
13
14
|
var _SidebarContext = require("./SidebarContext");
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
15
|
-
var _templateObject, _templateObject2, _templateObject3;
|
16
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
16
17
|
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; }
|
17
18
|
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; }
|
18
19
|
var SidebarLink = function SidebarLink(props) {
|
@@ -25,7 +26,8 @@ var SidebarLink = function SidebarLink(props) {
|
|
25
26
|
Icon = props.icon,
|
26
27
|
children = props.children;
|
27
28
|
var linkProps = (0, _useLinkProps["default"])(props);
|
28
|
-
var
|
29
|
+
var isExternalLink = linkProps.target === "_blank";
|
30
|
+
var isActive = !disabled && !isExternalLink && isLinkActive((_linkProps$href = linkProps.href) !== null && _linkProps$href !== void 0 ? _linkProps$href : "");
|
29
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("a", _objectSpread(_objectSpread({}, linkProps), {}, {
|
30
32
|
id: id,
|
31
33
|
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n flex items-center\n group hover:no-underline focus:outline-none\n ", "\n "])), disabled ? "cursor-not-allowed" : "cursor-pointer"), className),
|
@@ -34,9 +36,12 @@ var SidebarLink = function SidebarLink(props) {
|
|
34
36
|
className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["shrink-0 mr-3 ", ""])), disabled ? "text-grey-300" : "text-grey-500"),
|
35
37
|
width: "1rem",
|
36
38
|
height: "1rem"
|
37
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
38
|
-
className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n flex-1 truncate\n ", ""])), disabled ? "text-grey-300" : isActive ? "font-semibold text-accent-600" : "typo-subdued focus:text-accent-600 group-hover:text-accent-600"),
|
39
|
-
children: children
|
39
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
40
|
+
className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n flex-1 inline-flex items-center truncate\n ", ""])), disabled ? "text-grey-300" : isActive ? "font-semibold text-accent-600" : "typo-subdued focus:text-accent-600 group-hover:text-accent-600"),
|
41
|
+
children: [children, isExternalLink && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFeather.ExternalLink, {
|
42
|
+
className: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["", " ml-1 shrink-0"])), disabled ? "text-grey-300" : "text-grey-500"),
|
43
|
+
size: "1em"
|
44
|
+
})]
|
40
45
|
})]
|
41
46
|
}));
|
42
47
|
};
|
@@ -7,10 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
exports.SidebarGroupLink = void 0;
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
10
|
+
var _reactFeather = require("react-feather");
|
10
11
|
var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
|
11
12
|
var _useLinkProps = _interopRequireDefault(require("../../utils/useLinkProps"));
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
13
|
-
var _templateObject;
|
14
|
+
var _templateObject, _templateObject2;
|
14
15
|
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; }
|
15
16
|
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; }
|
16
17
|
var SidebarGroupLink = function SidebarGroupLink(props) {
|
@@ -19,11 +20,15 @@ var SidebarGroupLink = function SidebarGroupLink(props) {
|
|
19
20
|
id = props.id,
|
20
21
|
disabled = props.disabled;
|
21
22
|
var linkProps = (0, _useLinkProps["default"])(props);
|
22
|
-
|
23
|
+
var isExternalLink = linkProps.target === "_blank";
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("a", _objectSpread(_objectSpread({}, linkProps), {}, {
|
23
25
|
id: id,
|
24
|
-
className: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n
|
26
|
+
className: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n inline-flex items-center hover:no-underline focus:outline-none leading-md\n ", "\n ", ""])), disabled ? "cursor-not-allowed" : "cursor-pointer", disabled ? "text-grey-300" : active ? "font-semibold text-accent-600" : "typo-subdued hover:text-accent-600 focus:text-accent-600"),
|
25
27
|
"aria-current": active,
|
26
|
-
children: label
|
28
|
+
children: [label, isExternalLink && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFeather.ExternalLink, {
|
29
|
+
className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["ml-1 shrink-0"]))),
|
30
|
+
size: "1em"
|
31
|
+
})]
|
27
32
|
}));
|
28
33
|
};
|
29
34
|
exports.SidebarGroupLink = SidebarGroupLink;
|
@@ -51,7 +51,7 @@ var Table = function Table(_ref) {
|
|
51
51
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("table", _objectSpread(_objectSpread({}, props), {}, {
|
52
52
|
className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["table ", " ", ""])), hasActions && "table-with-actions", highlight && "table-with-highlight")
|
53
53
|
}))
|
54
|
-
}), footer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableFooter["default"], {
|
54
|
+
}), !!footer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableFooter["default"], {
|
55
55
|
size: smallFooter ? "small" : "default",
|
56
56
|
children: footer
|
57
57
|
})]
|
package/cjs/Tabs/ContentTabs.js
CHANGED
@@ -39,10 +39,10 @@ var ContentTabs = function ContentTabs(_ref) {
|
|
39
39
|
value: String(index),
|
40
40
|
disabled: disabled,
|
41
41
|
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),
|
42
|
-
children: [label, value && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge["default"], {
|
42
|
+
children: [label, !!value && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge["default"], {
|
43
43
|
size: "small",
|
44
44
|
variant: variant,
|
45
|
-
className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["ml-2
|
45
|
+
className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["ml-2"]))),
|
46
46
|
children: value
|
47
47
|
})]
|
48
48
|
}, index);
|
@@ -73,7 +73,7 @@ var LinkTab = function LinkTab(_ref3) {
|
|
73
73
|
previousElement === null || previousElement === void 0 ? void 0 : previousElement.focus();
|
74
74
|
}
|
75
75
|
},
|
76
|
-
children: [tab.label, tab.value && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge["default"], {
|
76
|
+
children: [tab.label, !!tab.value && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge["default"], {
|
77
77
|
size: "small",
|
78
78
|
variant: variant,
|
79
79
|
className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["ml-2 text-grey-600"]))),
|
@@ -80,7 +80,7 @@ var OverflowTooltipWrapper = function OverflowTooltipWrapper(_ref) {
|
|
80
80
|
onMouseEnter: onMouseEnter,
|
81
81
|
onMouseLeave: onMouseLeave,
|
82
82
|
children: children
|
83
|
-
}), tooltipText && createPortal( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, attributes.popper), {}, {
|
83
|
+
}), !!tooltipText && createPortal( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, attributes.popper), {}, {
|
84
84
|
style: styles.popper,
|
85
85
|
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["tooltip-wrapper-popper"]))), tooltipClassName),
|
86
86
|
ref: setPopperEl,
|
@@ -11,7 +11,7 @@ export interface TooltipWrapperProps extends TooltipWrapperBaseProps {
|
|
11
11
|
delay?: number;
|
12
12
|
/**
|
13
13
|
* Controls how long the tooltip should stay displayed when leaving the wrapped element (in ms)
|
14
|
-
* @default
|
14
|
+
* @default 500
|
15
15
|
* */
|
16
16
|
hideDelay?: number;
|
17
17
|
/**
|
@@ -10,7 +10,7 @@ var prefixTailwindClassName = require("./prefixTailwindClassName");
|
|
10
10
|
* Regexp lifted and modified from https://tailwindcss.com/docs/optimizing-for-production#writing-purgeable-html because
|
11
11
|
* it does not handle cases like foo\\n
|
12
12
|
*/
|
13
|
-
var TAILWIND_REGEXP = /[
|
13
|
+
var TAILWIND_REGEXP = /[^<"'`\s\\]*[^<"'`\s:\\]/g;
|
14
14
|
|
15
15
|
/**
|
16
16
|
* Creates a PurgeCSS extractor
|
@@ -140,5 +140,5 @@ module.exports = {
|
|
140
140
|
}
|
141
141
|
}
|
142
142
|
},
|
143
|
-
plugins: [require("./base.tailwind"), require("../utilities/utilities.tailwind"), require("../Typography/Typography.tailwind"), require("../FlexGrid/FlexGrid.tailwind"), require("../AutoComplete/AutoComplete.tailwind"), require("../Button/Button.tailwind"), require("../Card/Card.tailwind"), require("../Checkbox/Checkbox.tailwind"), require("../EmptyState/EmptyState.tailwind"), require("../Flag/Flag.tailwind"), require("../HelpUnderline/HelpUnderline.tailwind"), require("../Input/Input.tailwind"), require("../InstantSearch/InstantSearch.tailwind"), require("../KeyboardKey/KeyboardKey.tailwind"), require("../Medallion/Medallion.tailwind"), require("../Modal/Modal.tailwind"), require("../ProgressBar/ProgressBar.tailwind"), require("../ProgressSpinner/ProgressSpinner.tailwind"), require("../RadioGroup/RadioButton.tailwind"), require("../
|
143
|
+
plugins: [require("./base.tailwind"), require("../utilities/utilities.tailwind"), require("../Typography/Typography.tailwind"), require("../FlexGrid/FlexGrid.tailwind"), require("../AutoComplete/AutoComplete.tailwind"), require("../Button/Button.tailwind"), require("../Card/Card.tailwind"), require("../Checkbox/Checkbox.tailwind"), require("../EmptyState/EmptyState.tailwind"), require("../Flag/Flag.tailwind"), require("../HelpUnderline/HelpUnderline.tailwind"), require("../Input/Input.tailwind"), require("../InstantSearch/InstantSearch.tailwind"), require("../KeyboardKey/KeyboardKey.tailwind"), require("../Medallion/Medallion.tailwind"), require("../Modal/Modal.tailwind"), require("../ProgressBar/ProgressBar.tailwind"), require("../ProgressSpinner/ProgressSpinner.tailwind"), require("../RadioGroup/RadioButton.tailwind"), require("../ScrollIndicator/ScrollIndicator.tailwind"), require("../Select/Select.tailwind"), require("../Switch/Switch.tailwind"), require("../Tabs/Tabs.tailwind"), require("../Tables/DataTable/DataTable.tailwind"), require("../Tables/Table/Table.tailwind"), require("../Tag/Tag.tailwind"), require("../TextArea/TextArea.tailwind"), require("../Toggle/Toggle.tailwind"), require("../Tooltip/Tooltip.tailwind"), require("../UserContent/UserContent.tailwind"), require("../DatePicker/DatePicker.tailwind")]
|
144
144
|
};
|
package/cjs/utils/index.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const isCssPropertySupported: <P extends number | "filter" | "fill" | "animationName" | "all" | "offset" | "height" | "width" | "left" | "top" | "item" | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "alignmentBaseline" | "animation" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationPlayState" | "animationTimingFunction" | "appearance" | "aspectRatio" | "backfaceVisibility" | "background" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "baselineShift" | "blockSize" | "border" | "borderBlock" | "borderBlockColor" | "borderBlockEnd" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStart" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBlockStyle" | "borderBlockWidth" | "borderBottom" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderColor" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImage" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInline" | "borderInlineColor" | "borderInlineEnd" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStart" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderInlineStyle" | "borderInlineWidth" | "borderLeft" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRadius" | "borderRight" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderStyle" | "borderTop" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "borderWidth" | "bottom" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "clear" | "clip" | "clipPath" | "clipRule" | "color" | "colorInterpolation" | "colorInterpolationFilters" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRule" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "columns" | "contain" | "content" | "counterIncrement" | "counterReset" | "counterSet" | "cssFloat" | "cssText" | "cursor" | "direction" | "display" | "dominantBaseline" | "emptyCells" | "fillOpacity" | "fillRule" | "flex" | "flexBasis" | "flexDirection" | "flexFlow" | "flexGrow" | "flexShrink" | "flexWrap" | "float" | "floodColor" | "floodOpacity" | "font" | "fontFamily" | "fontFeatureSettings" | "fontKerning" | "fontOpticalSizing" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontSynthesis" | "fontVariant" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontVariationSettings" | "fontWeight" | "gap" | "grid" | "gridArea" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumn" | "gridColumnEnd" | "gridColumnGap" | "gridColumnStart" | "gridGap" | "gridRow" | "gridRowEnd" | "gridRowGap" | "gridRowStart" | "gridTemplate" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hyphens" | "imageOrientation" | "imageRendering" | "inlineSize" | "inset" | "insetBlock" | "insetBlockEnd" | "insetBlockStart" | "insetInline" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lightingColor" | "lineBreak" | "lineHeight" | "listStyle" | "listStyleImage" | "listStylePosition" | "listStyleType" | "margin" | "marginBlock" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInline" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "marker" | "markerEnd" | "markerMid" | "markerStart" | "mask" | "maskType" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offsetAnchor" | "offsetDistance" | "offsetPath" | "offsetRotate" | "opacity" | "order" | "orphans" | "outline" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflow" | "overflowAnchor" | "overflowWrap" | "overflowX" | "overflowY" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "padding" | "paddingBlock" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInline" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "paintOrder" | "perspective" | "perspectiveOrigin" | "placeContent" | "placeItems" | "placeSelf" | "pointerEvents" | "position" | "quotes" | "resize" | "right" | "rotate" | "rowGap" | "rubyPosition" | "scale" | "scrollBehavior" | "scrollMargin" | "scrollMarginBlock" | "scrollMarginBlockEnd" | "scrollMarginBlockStart" | "scrollMarginBottom" | "scrollMarginInline" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPadding" | "scrollPaddingBlock" | "scrollPaddingBlockEnd" | "scrollPaddingBlockStart" | "scrollPaddingBottom" | "scrollPaddingInline" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textAnchor" | "textCombineUpright" | "textDecoration" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasis" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transition" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "translate" | "unicodeBidi" | "userSelect" | "verticalAlign" | "visibility" | "webkitAlignContent" | "webkitAlignItems" | "webkitAlignSelf" | "webkitAnimation" | "webkitAnimationDelay" | "webkitAnimationDirection" | "webkitAnimationDuration" | "webkitAnimationFillMode" | "webkitAnimationIterationCount" | "webkitAnimationName" | "webkitAnimationPlayState" | "webkitAnimationTimingFunction" | "webkitAppearance" | "webkitBackfaceVisibility" | "webkitBackgroundClip" | "webkitBackgroundOrigin" | "webkitBackgroundSize" | "webkitBorderBottomLeftRadius" | "webkitBorderBottomRightRadius" | "webkitBorderRadius" | "webkitBorderTopLeftRadius" | "webkitBorderTopRightRadius" | "webkitBoxAlign" | "webkitBoxFlex" | "webkitBoxOrdinalGroup" | "webkitBoxOrient" | "webkitBoxPack" | "webkitBoxShadow" | "webkitBoxSizing" | "webkitFilter" | "webkitFlex" | "webkitFlexBasis" | "webkitFlexDirection" | "webkitFlexFlow" | "webkitFlexGrow" | "webkitFlexShrink" | "webkitFlexWrap" | "webkitJustifyContent" | "webkitLineClamp" | "webkitMask" | "webkitMaskBoxImage" | "webkitMaskBoxImageOutset" | "webkitMaskBoxImageRepeat" | "webkitMaskBoxImageSlice" | "webkitMaskBoxImageSource" | "webkitMaskBoxImageWidth" | "webkitMaskClip" | "webkitMaskComposite" | "webkitMaskImage" | "webkitMaskOrigin" | "webkitMaskPosition" | "webkitMaskRepeat" | "webkitMaskSize" | "webkitOrder" | "webkitPerspective" | "webkitPerspectiveOrigin" | "webkitTextFillColor" | "webkitTextStroke" | "webkitTextStrokeColor" | "webkitTextStrokeWidth" | "webkitTransform" | "webkitTransformOrigin" | "webkitTransformStyle" | "webkitTransition" | "webkitTransitionDelay" | "webkitTransitionDuration" | "webkitTransitionProperty" | "webkitTransitionTimingFunction" | "webkitUserSelect" | "whiteSpace" | "widows" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "zIndex" | "getPropertyPriority" | "getPropertyValue" | "removeProperty" | "setProperty">(prop: P, value: CSSStyleDeclaration[P]) => boolean;
|
1
|
+
declare const isCssPropertySupported: <P extends number | "filter" | "fill" | "animationName" | "all" | "offset" | "height" | "width" | "left" | "top" | "item" | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "alignmentBaseline" | "animation" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationPlayState" | "animationTimingFunction" | "appearance" | "aspectRatio" | "backfaceVisibility" | "background" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "baselineShift" | "blockSize" | "border" | "borderBlock" | "borderBlockColor" | "borderBlockEnd" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStart" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBlockStyle" | "borderBlockWidth" | "borderBottom" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderColor" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImage" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInline" | "borderInlineColor" | "borderInlineEnd" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStart" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderInlineStyle" | "borderInlineWidth" | "borderLeft" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRadius" | "borderRight" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderStyle" | "borderTop" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "borderWidth" | "bottom" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "clear" | "clip" | "clipPath" | "clipRule" | "color" | "colorInterpolation" | "colorInterpolationFilters" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRule" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "columns" | "contain" | "content" | "counterIncrement" | "counterReset" | "counterSet" | "cssFloat" | "cssText" | "cursor" | "direction" | "display" | "dominantBaseline" | "emptyCells" | "fillOpacity" | "fillRule" | "flex" | "flexBasis" | "flexDirection" | "flexFlow" | "flexGrow" | "flexShrink" | "flexWrap" | "float" | "floodColor" | "floodOpacity" | "font" | "fontFamily" | "fontFeatureSettings" | "fontKerning" | "fontOpticalSizing" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontSynthesis" | "fontVariant" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontVariationSettings" | "fontWeight" | "gap" | "grid" | "gridArea" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumn" | "gridColumnEnd" | "gridColumnGap" | "gridColumnStart" | "gridGap" | "gridRow" | "gridRowEnd" | "gridRowGap" | "gridRowStart" | "gridTemplate" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hyphens" | "imageOrientation" | "imageRendering" | "inlineSize" | "inset" | "insetBlock" | "insetBlockEnd" | "insetBlockStart" | "insetInline" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lightingColor" | "lineBreak" | "lineHeight" | "listStyle" | "listStyleImage" | "listStylePosition" | "listStyleType" | "margin" | "marginBlock" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInline" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "marker" | "markerEnd" | "markerMid" | "markerStart" | "mask" | "maskType" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offsetAnchor" | "offsetDistance" | "offsetPath" | "offsetRotate" | "opacity" | "order" | "orphans" | "outline" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflow" | "overflowAnchor" | "overflowWrap" | "overflowX" | "overflowY" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "padding" | "paddingBlock" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInline" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "paintOrder" | "perspective" | "perspectiveOrigin" | "placeContent" | "placeItems" | "placeSelf" | "pointerEvents" | "position" | "quotes" | "resize" | "right" | "rotate" | "rowGap" | "rubyPosition" | "scale" | "scrollBehavior" | "scrollMargin" | "scrollMarginBlock" | "scrollMarginBlockEnd" | "scrollMarginBlockStart" | "scrollMarginBottom" | "scrollMarginInline" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPadding" | "scrollPaddingBlock" | "scrollPaddingBlockEnd" | "scrollPaddingBlockStart" | "scrollPaddingBottom" | "scrollPaddingInline" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "scrollbarGutter" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textAnchor" | "textCombineUpright" | "textDecoration" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasis" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transition" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "translate" | "unicodeBidi" | "userSelect" | "verticalAlign" | "visibility" | "webkitAlignContent" | "webkitAlignItems" | "webkitAlignSelf" | "webkitAnimation" | "webkitAnimationDelay" | "webkitAnimationDirection" | "webkitAnimationDuration" | "webkitAnimationFillMode" | "webkitAnimationIterationCount" | "webkitAnimationName" | "webkitAnimationPlayState" | "webkitAnimationTimingFunction" | "webkitAppearance" | "webkitBackfaceVisibility" | "webkitBackgroundClip" | "webkitBackgroundOrigin" | "webkitBackgroundSize" | "webkitBorderBottomLeftRadius" | "webkitBorderBottomRightRadius" | "webkitBorderRadius" | "webkitBorderTopLeftRadius" | "webkitBorderTopRightRadius" | "webkitBoxAlign" | "webkitBoxFlex" | "webkitBoxOrdinalGroup" | "webkitBoxOrient" | "webkitBoxPack" | "webkitBoxShadow" | "webkitBoxSizing" | "webkitFilter" | "webkitFlex" | "webkitFlexBasis" | "webkitFlexDirection" | "webkitFlexFlow" | "webkitFlexGrow" | "webkitFlexShrink" | "webkitFlexWrap" | "webkitJustifyContent" | "webkitLineClamp" | "webkitMask" | "webkitMaskBoxImage" | "webkitMaskBoxImageOutset" | "webkitMaskBoxImageRepeat" | "webkitMaskBoxImageSlice" | "webkitMaskBoxImageSource" | "webkitMaskBoxImageWidth" | "webkitMaskClip" | "webkitMaskComposite" | "webkitMaskImage" | "webkitMaskOrigin" | "webkitMaskPosition" | "webkitMaskRepeat" | "webkitMaskSize" | "webkitOrder" | "webkitPerspective" | "webkitPerspectiveOrigin" | "webkitTextFillColor" | "webkitTextStroke" | "webkitTextStrokeColor" | "webkitTextStrokeWidth" | "webkitTransform" | "webkitTransformOrigin" | "webkitTransformStyle" | "webkitTransition" | "webkitTransitionDelay" | "webkitTransitionDuration" | "webkitTransitionProperty" | "webkitTransitionTimingFunction" | "webkitUserSelect" | "whiteSpace" | "widows" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "zIndex" | "getPropertyPriority" | "getPropertyValue" | "removeProperty" | "setProperty">(prop: P, value: CSSStyleDeclaration[P]) => boolean;
|
2
2
|
export default isCssPropertySupported;
|
@@ -5,8 +5,14 @@ export declare type AnnouncementBadgeLocale = {
|
|
5
5
|
[key in AnnouncementBadgeTexts]?: string;
|
6
6
|
};
|
7
7
|
export interface AnnouncementBadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
8
|
+
/** @default "default" */
|
8
9
|
size?: AnnouncementBadgeSizes;
|
10
|
+
/**
|
11
|
+
* Define which text to display in the `AnnouncementBadge`
|
12
|
+
* @default "new"
|
13
|
+
*/
|
9
14
|
text?: AnnouncementBadgeTexts;
|
15
|
+
/** @default "accent" */
|
10
16
|
variant?: "accent" | "red";
|
11
17
|
locale?: AnnouncementBadgeLocale;
|
12
18
|
children?: never;
|
@@ -37,7 +37,6 @@ export declare class AutoComplete<T extends Option = Option> extends Component<A
|
|
37
37
|
maxResults: number;
|
38
38
|
createFromInputValue: <T_1 extends Option = Option>(options: T_1[] | undefined, inputValue: string) => Option[];
|
39
39
|
options: never[];
|
40
|
-
separatorKeyCodes: never[];
|
41
40
|
separatorKeys: never[];
|
42
41
|
optionItemComponent: ({ optionItemPrefix, ...props }: DefaultOptionProps) => JSX.Element;
|
43
42
|
noWrap: boolean;
|
@@ -89,7 +89,6 @@ var MENU_POPPER_MODFIERS = [{
|
|
89
89
|
offset: [0, 8]
|
90
90
|
}
|
91
91
|
}];
|
92
|
-
var BACKSPACE_KEY_CODE = 8;
|
93
92
|
/** @ignore */
|
94
93
|
var DefaultEmptyState = function DefaultEmptyState(_ref) {
|
95
94
|
var emptyStateTitle = _ref.emptyStateTitle;
|
@@ -212,10 +211,8 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
212
211
|
var _this$props2 = _this.props,
|
213
212
|
_this$props2$value = _this$props2.value,
|
214
213
|
value = _this$props2$value === void 0 ? [] : _this$props2$value,
|
215
|
-
_this$props2$separato = _this$props2.
|
216
|
-
|
217
|
-
_this$props2$separato2 = _this$props2.separatorKeys,
|
218
|
-
separatorKeys = _this$props2$separato2 === void 0 ? AutoComplete.defaultProps.separatorKeys : _this$props2$separato2,
|
214
|
+
_this$props2$separato = _this$props2.separatorKeys,
|
215
|
+
separatorKeys = _this$props2$separato === void 0 ? AutoComplete.defaultProps.separatorKeys : _this$props2$separato,
|
219
216
|
creatable = _this$props2.creatable,
|
220
217
|
_this$props2$createFr = _this$props2.createFromInputValue,
|
221
218
|
createFromInputValue = _this$props2$createFr === void 0 ? AutoComplete.defaultProps.createFromInputValue : _this$props2$createFr,
|
@@ -223,9 +220,9 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
223
220
|
onChange = _this$props2.onChange;
|
224
221
|
var inputValue = state.inputValue || "";
|
225
222
|
var canCreate = creatable && inputValue.trim().length > 0;
|
226
|
-
if (evt.
|
223
|
+
if (evt.key === "Backspace" && !inputValue.length) {
|
227
224
|
onChange(value.slice(0, -1));
|
228
|
-
} else if (canCreate &&
|
225
|
+
} else if (canCreate && separatorKeys.includes(evt.key)) {
|
229
226
|
evt.preventDefault();
|
230
227
|
var _createFromInputValue = createFromInputValue(options, inputValue),
|
231
228
|
_createFromInputValue2 = _slicedToArray(_createFromInputValue, 1),
|
@@ -372,9 +369,9 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
372
369
|
}), /*#__PURE__*/_jsx("input", _objectSpread(_objectSpread({}, inputProps), {}, {
|
373
370
|
"data-lpignore": true
|
374
371
|
}))]
|
375
|
-
}), (showClearButton || endItem) && /*#__PURE__*/_jsxs("div", {
|
372
|
+
}), (showClearButton || !!endItem) && /*#__PURE__*/_jsxs("div", {
|
376
373
|
className: cx(showClearButton && endItem && stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["my-2 flex self-end space-x-4"])))),
|
377
|
-
children: [endItem && /*#__PURE__*/_jsx("div", {
|
374
|
+
children: [!!endItem && /*#__PURE__*/_jsx("div", {
|
378
375
|
className: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["text-grey-700 my-auto"]))),
|
379
376
|
children: endItem
|
380
377
|
}), showClearButton && /*#__PURE__*/_jsx("button", {
|
@@ -491,7 +488,7 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
491
488
|
})
|
492
489
|
})]
|
493
490
|
}))
|
494
|
-
}), menuFooter && /*#__PURE__*/_jsx("footer", {
|
491
|
+
}), !!menuFooter && /*#__PURE__*/_jsx("footer", {
|
495
492
|
className: stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["flex items-center justify-center min-h-12 p-4 bg-grey-100 border-t border-grey-200 text-grey-600"]))),
|
496
493
|
children: menuFooter
|
497
494
|
})]
|
@@ -581,7 +578,6 @@ _defineProperty(AutoComplete, "defaultProps", {
|
|
581
578
|
maxResults: 7,
|
582
579
|
createFromInputValue: defaultCreateFromInputValue,
|
583
580
|
options: [],
|
584
|
-
separatorKeyCodes: [],
|
585
581
|
separatorKeys: [],
|
586
582
|
optionItemComponent: DefaultOption,
|
587
583
|
noWrap: false
|
@@ -20,7 +20,7 @@ export var AutoCompleteEmptyState = function AutoCompleteEmptyState(_ref) {
|
|
20
20
|
}), /*#__PURE__*/_jsx("span", {
|
21
21
|
className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["font-semibold pt-4"]))),
|
22
22
|
children: title
|
23
|
-
}), description && /*#__PURE__*/_jsx("p", {
|
23
|
+
}), !!description && /*#__PURE__*/_jsx("p", {
|
24
24
|
className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["display-caption typo-subdued pt-4"]))),
|
25
25
|
children: description
|
26
26
|
})]
|
@@ -29,7 +29,6 @@ export interface AutoCompleteBaseProps<T extends Option = Option> {
|
|
29
29
|
selectOnBlur?: boolean;
|
30
30
|
maxResults?: number;
|
31
31
|
createFromInputValue?: CreateFromInputValue<T>;
|
32
|
-
separatorKeyCodes?: number[];
|
33
32
|
separatorKeys?: string[];
|
34
33
|
renderValueTemplate?: (args: RenderValueTemplateArgs<T>) => JSX.Element;
|
35
34
|
emptyState?: ReactNode;
|
@@ -3,7 +3,10 @@ import type { MinimalUser } from "./types";
|
|
3
3
|
export declare type UserAvatarProps = {
|
4
4
|
/** A minimal user object containing `name`, `email` and `avatar`. */
|
5
5
|
user: MinimalUser;
|
6
|
-
/**
|
6
|
+
/**
|
7
|
+
* in px
|
8
|
+
* @default 32
|
9
|
+
* */
|
7
10
|
size?: number;
|
8
11
|
/** @ignore */
|
9
12
|
className?: string;
|
package/esm/Badge/Badge.js
CHANGED
@@ -7,6 +7,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
7
7
|
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; }
|
8
8
|
import cx from "clsx";
|
9
9
|
import stl from "../styles/helpers/satellitePrefixer";
|
10
|
+
import isRenderedChild from "../utils/isRenderedChild";
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
11
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
13
|
var BASE_CLASSNAMES = stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n inline-flex items-center justify-center\n rounded-full border\n overflow-hidden\n"])));
|
@@ -56,10 +57,10 @@ export var Badge = function Badge(_ref) {
|
|
56
57
|
children: /*#__PURE__*/_jsx(Icon, {
|
57
58
|
size: ".8em"
|
58
59
|
})
|
59
|
-
}), children && /*#__PURE__*/_jsx("span", {
|
60
|
+
}), isRenderedChild(children) && /*#__PURE__*/_jsx("span", {
|
60
61
|
className: stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["truncate"]))),
|
61
62
|
children: children
|
62
|
-
}), value && /*#__PURE__*/_jsx("span", {
|
63
|
+
}), isRenderedChild(value) && /*#__PURE__*/_jsx("span", {
|
63
64
|
children: value
|
64
65
|
})]
|
65
66
|
}));
|