@algolia/satellite 1.0.0-beta.155 → 1.0.0-beta.157

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.
Files changed (43) hide show
  1. package/cjs/Avatars/UserAvatar.d.ts +7 -3
  2. package/cjs/Avatars/UserAvatar.js +28 -28
  3. package/cjs/Button/Button.tailwind.js +0 -2
  4. package/cjs/Button/IconButton.d.ts +3 -0
  5. package/cjs/Button/IconButton.js +4 -2
  6. package/cjs/EmptyState/EmptyState.js +1 -1
  7. package/cjs/FlexGrid/FlexGrid.js +1 -1
  8. package/cjs/Pagination/DotPagination/DotPagination.d.ts +6 -5
  9. package/cjs/RangeSlider/RangeSlider.js +1 -1
  10. package/cjs/Satellite/locale.d.ts +2 -0
  11. package/cjs/Sidebar/SidebarHeading.js +1 -1
  12. package/cjs/Sidebar/SidebarLink.js +8 -5
  13. package/cjs/Sidebar/SidebarLinksGroup/SidebarGroupLink.js +7 -4
  14. package/cjs/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +1 -1
  15. package/cjs/Tables/DataTable/DataTable.js +12 -12
  16. package/cjs/Tooltip/Tooltip.tailwind.js +2 -1
  17. package/cjs/index.d.ts +1 -0
  18. package/cjs/index.js +12 -0
  19. package/cjs/utils/NumberUnion.d.ts +5 -0
  20. package/cjs/utils/NumberUnion.js +5 -0
  21. package/cjs/utils/isCssPropertySupported.d.ts +1 -1
  22. package/esm/Avatars/UserAvatar.d.ts +7 -3
  23. package/esm/Avatars/UserAvatar.js +28 -28
  24. package/esm/Button/Button.tailwind.js +0 -2
  25. package/esm/Button/IconButton.d.ts +3 -0
  26. package/esm/Button/IconButton.js +4 -2
  27. package/esm/EmptyState/EmptyState.js +1 -1
  28. package/esm/Pagination/DotPagination/DotPagination.d.ts +6 -5
  29. package/esm/RangeSlider/RangeSlider.js +2 -0
  30. package/esm/Satellite/locale.d.ts +2 -0
  31. package/esm/Sidebar/SidebarHeading.js +1 -1
  32. package/esm/Sidebar/SidebarLink.js +8 -5
  33. package/esm/Sidebar/SidebarLinksGroup/SidebarGroupLink.js +7 -4
  34. package/esm/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +1 -1
  35. package/esm/Tables/DataTable/DataTable.js +12 -12
  36. package/esm/Tooltip/Tooltip.tailwind.js +2 -1
  37. package/esm/index.d.ts +1 -0
  38. package/esm/index.js +1 -0
  39. package/esm/utils/NumberUnion.d.ts +5 -0
  40. package/esm/utils/NumberUnion.js +1 -0
  41. package/esm/utils/isCssPropertySupported.d.ts +1 -1
  42. package/package.json +2 -1
  43. package/satellite.min.css +1 -1
@@ -1,6 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import type { MinimalUser } from "./types";
3
- export declare type UserAvatarProps = {
3
+ export declare type UserAvatarLocale = {
4
+ fallbackText?: string;
5
+ };
6
+ export interface UserAvatarProps {
4
7
  /** A minimal user object containing `name`, `email` and `avatar`. */
5
8
  user: MinimalUser;
6
9
  /**
@@ -10,7 +13,8 @@ export declare type UserAvatarProps = {
10
13
  size?: number;
11
14
  /** @ignore */
12
15
  className?: string;
13
- };
16
+ locale?: UserAvatarLocale;
17
+ }
14
18
  /** The `UserAvatar` is used as a visual representation of a user. */
15
- export declare const UserAvatar: ({ className, user, size }: UserAvatarProps) => JSX.Element;
19
+ export declare const UserAvatar: ({ className, user, size, locale: propsLocale }: UserAvatarProps) => JSX.Element;
16
20
  export default UserAvatar;
@@ -6,49 +6,49 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports["default"] = exports.UserAvatar = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _reactAvatar = require("@radix-ui/react-avatar");
10
11
  var _clsx = _interopRequireDefault(require("clsx"));
11
- var _react = require("react");
12
+ var _Satellite = require("../Satellite");
12
13
  var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
13
14
  var _utils = require("./utils");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
- var _templateObject, _templateObject2, _templateObject3;
16
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
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; }
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; }
19
+ var DEFAULT_LOCALE = {
20
+ fallbackText: "User's avatar"
21
+ };
16
22
  /** The `UserAvatar` is used as a visual representation of a user. */
17
23
  var UserAvatar = function UserAvatar(_ref) {
18
24
  var _user$email;
19
25
  var className = _ref.className,
20
26
  user = _ref.user,
21
27
  _ref$size = _ref.size,
22
- size = _ref$size === void 0 ? 32 : _ref$size;
23
- var _useState = (0, _react.useState)(false),
24
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
25
- imageLoaded = _useState2[0],
26
- setImageLoaded = _useState2[1];
27
- var initials = (0, _utils.getUserInitials)(user);
28
- (0, _react.useEffect)(function () {
29
- return setImageLoaded(false);
30
- }, [user.avatar]);
31
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
32
- role: "img",
33
- "aria-label": imageLoaded ? (user === null || user === void 0 ? void 0 : user.name) || "User's avatar" : "User's avatar",
34
- className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["relative overflow-hidden flex justify-center items-center rounded-full uppercase transition-colors"]))), imageLoaded ? (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["bg-white"]))) : (0, _utils.getUserBackgroundClassName)((_user$email = user.email) !== null && _user$email !== void 0 ? _user$email : "no-email"), className),
28
+ size = _ref$size === void 0 ? 32 : _ref$size,
29
+ propsLocale = _ref.locale;
30
+ var contextLocale = (0, _Satellite.useLocale)("userAvatar");
31
+ var locale = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_LOCALE), contextLocale), propsLocale);
32
+ var fallbackName = user.name || user.email || locale.fallbackText;
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactAvatar.Root, {
34
+ className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["overflow-hidden flex justify-center items-center rounded-full"]))), (0, _utils.getUserBackgroundClassName)((_user$email = user.email) !== null && _user$email !== void 0 ? _user$email : "no-email"), className),
35
35
  style: {
36
36
  width: size,
37
37
  height: size
38
38
  },
39
- children: [!imageLoaded && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
40
- children: initials
41
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
42
- className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n w-full absolute top-0 left-0\n transition-opacity ", "\n "])), imageLoaded ? "opacity-100" : "opacity-0"),
39
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactAvatar.Image, {
40
+ className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["h-full w-full object-cover"]))),
43
41
  src: user.avatar,
44
- role: "presentation",
45
- alt: "",
46
- onLoad: function onLoad() {
47
- return setImageLoaded(true);
48
- },
49
- onError: function onError() {
50
- return setImageLoaded(false);
51
- }
42
+ alt: fallbackName
43
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactAvatar.AvatarFallback, {
44
+ className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["flex h-full w-full items-center justify-center uppercase"]))),
45
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
46
+ "aria-hidden": true,
47
+ children: (0, _utils.getUserInitials)(user)
48
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
49
+ className: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["sr-only"]))),
50
+ children: fallbackName
51
+ })]
52
52
  })]
53
53
  });
54
54
  };
@@ -59,7 +59,6 @@ var buttonPlugin = plugin(function (_ref) {
59
59
  },
60
60
  "&:active, &.btn-active": {
61
61
  borderColor: theme("colors.grey.200"),
62
- backgroundImage: theme("color.grey.100"),
63
62
  boxShadow: "\n inset 0 1px 4px 0 ".concat(rgba(theme("colors.grey.500"), 0.4), ",\n inset 0 1px 1px 0 ").concat(rgba(theme("colors.grey.500"), 0.4), ",\n 0 1px 0 0 ").concat(theme("colors.shadow.5"), "\n ")
64
63
  },
65
64
  "&:disabled, &.btn-disabled": {
@@ -114,7 +113,6 @@ var buttonPlugin = plugin(function (_ref) {
114
113
  boxShadow: "\n inset 0 1px 0 0 ".concat(rgba(theme("colors.white"), 0.06), ",\n 0 0 0 1px ").concat(theme("colors.red.800"), ",\n 0 2px 0 1px ").concat(theme("colors.shadow.10"), "\n ")
115
114
  },
116
115
  "&:active, &.btn-active": {
117
- backgroundImage: theme("colors.red.700"),
118
116
  borderColor: theme("colors.red.800"),
119
117
  boxShadow: "\n inset 0 1px 4px 0 ".concat(rgba(theme("colors.red.900"), 0.4), ",\n inset 0 1px 1px 0 ").concat(rgba(theme("colors.red.900"), 0.6), ",\n 0 1px 0 0 ").concat(theme("colors.shadow.5"), "\n ")
120
118
  },
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import type { TooltipWrapperBaseProps } from "../Tooltip/types";
2
3
  import type { IconComponentType } from "../types";
3
4
  import { AcceptableButtonType, ButtonSize, ButtonVariant, ExtractProps } from "./types";
4
5
  export interface IconButtonBaseProps {
@@ -8,6 +9,8 @@ export interface IconButtonBaseProps {
8
9
  icon: IconComponentType;
9
10
  title: string;
10
11
  showTooltip?: boolean;
12
+ /** @default "top" */
13
+ tooltipPlacement?: TooltipWrapperBaseProps["placement"];
11
14
  loading?: boolean;
12
15
  }
13
16
  export declare type IconButtonProps<T extends AcceptableButtonType> = IconButtonBaseProps & ExtractProps<T> & {
@@ -15,7 +15,7 @@ var _Tooltip = require("../Tooltip");
15
15
  var _styles = require("./styles");
16
16
  var _types = require("./types");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
- var _excluded = ["as", "className", "variant", "size", "icon", "title", "showTooltip", "loading"];
18
+ var _excluded = ["as", "className", "variant", "size", "icon", "title", "showTooltip", "tooltipPlacement", "loading"];
19
19
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
20
20
  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; }
21
21
  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; }
@@ -39,6 +39,8 @@ var IconButton = function IconButton(props) {
39
39
  Icon = props.icon,
40
40
  title = props.title,
41
41
  showTooltip = props.showTooltip,
42
+ _props$tooltipPlaceme = props.tooltipPlacement,
43
+ tooltipPlacement = _props$tooltipPlaceme === void 0 ? "top" : _props$tooltipPlaceme,
42
44
  _props$loading = props.loading,
43
45
  loading = _props$loading === void 0 ? false : _props$loading,
44
46
  cleanedProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
@@ -54,7 +56,7 @@ var IconButton = function IconButton(props) {
54
56
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.TooltipWrapper, {
55
57
  delay: 500,
56
58
  show: showTooltip,
57
- placement: "top",
59
+ placement: tooltipPlacement,
58
60
  content: title,
59
61
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Tag, _objectSpread(_objectSpread({}, cleanedProps), {}, {
60
62
  className: iconButtonClassName,
@@ -75,7 +75,7 @@ var renderEmptyState = function renderEmptyState(_ref) {
75
75
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
76
76
  className: titleClassNames,
77
77
  children: title
78
- }), !!description && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
78
+ }), !!description && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
79
79
  className: descriptionClassNames,
80
80
  children: description
81
81
  }), !!actions && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FlexGrid["default"], {
@@ -11,7 +11,7 @@ var _react = require("react");
11
11
  var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
12
12
  var _isRenderedChild = _interopRequireDefault(require("../utils/isRenderedChild"));
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22;
14
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22; // Heavily inspired by https://github.com/Shopify/polaris-react/blob/2b34f8609e9f08c1a767abea0a235bcc17706b63/src/components/Stack/Stack.tsx#L1
15
15
  var SPACING_CLASSNAMES = {
16
16
  none: "",
17
17
  sm: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["flex-grid-sm"]))),
@@ -1,14 +1,15 @@
1
1
  /// <reference types="react" />
2
+ import type { NumberUnion } from "utils/NumberUnion";
2
3
  export declare type DotPaginationLocale = {
3
4
  goToPageText?(page: number): string;
4
5
  };
5
- export declare type DotPaginationProps = {
6
+ export declare type DotPaginationProps<T extends number> = {
6
7
  /** Currently selected page (1 based index) */
7
- currentPage: number;
8
- onChange: (page: number) => void;
9
- nbPages: number;
8
+ currentPage: NumberUnion<T>;
9
+ onChange: (page: NumberUnion<T>) => void;
10
+ nbPages: T;
10
11
  size?: "small" | "medium";
11
12
  locale?: DotPaginationLocale;
12
13
  };
13
- export declare const DotPagination: ({ currentPage, onChange, nbPages, size, locale: propsLocale, }: DotPaginationProps) => JSX.Element;
14
+ export declare const DotPagination: <T extends number>({ currentPage, onChange, nbPages, size, locale: propsLocale, }: DotPaginationProps<T>) => JSX.Element;
14
15
  export default DotPagination;
@@ -14,7 +14,7 @@ var _colors = _interopRequireDefault(require("../styles/colors"));
14
14
  var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
16
  var _excluded = ["className", "value", "defaultValue", "onChange", "onCommit", "disabled", "min", "max", "track1Color", "track2Color"];
17
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
17
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8; // Prevents unwanted number narrowing
18
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; }
19
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; }
20
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%)]"])));
@@ -1,5 +1,6 @@
1
1
  import type { AnnouncementBadgeLocale } from "../AnnouncementBadge";
2
2
  import type { AutoCompleteLocale } from "../AutoComplete";
3
+ import type { UserAvatarLocale } from "../Avatars/UserAvatar";
3
4
  import type { DatePickerLocale } from "../DatePicker/types";
4
5
  import type { DropzoneLocale } from "../Dropzone";
5
6
  import type { FlagLocale } from "../Flag";
@@ -25,5 +26,6 @@ export declare type ComponentsLocales = {
25
26
  pagination?: PaginationLocale;
26
27
  sidebar?: SidebarLocale;
27
28
  tag?: TagLocale;
29
+ userAvatar?: UserAvatarLocale;
28
30
  };
29
31
  export declare const useLocale: <ComponentKey extends keyof ComponentsLocales>(componentKey: ComponentKey) => ComponentsLocales[ComponentKey];
@@ -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 && "sr-only"), className),
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 && "opacity-0"), className),
23
23
  children: children
24
24
  });
25
25
  };
@@ -13,7 +13,7 @@ var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satel
13
13
  var _useLinkProps = _interopRequireDefault(require("../utils/useLinkProps"));
14
14
  var _SidebarContext = require("./SidebarContext");
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
16
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
17
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; }
18
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; }
19
19
  var SidebarLink = function SidebarLink(props) {
@@ -30,16 +30,19 @@ var SidebarLink = function SidebarLink(props) {
30
30
  var isActive = !disabled && !isExternalLink && isLinkActive((_linkProps$href = linkProps.href) !== null && _linkProps$href !== void 0 ? _linkProps$href : "");
31
31
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("a", _objectSpread(_objectSpread({}, linkProps), {}, {
32
32
  id: id,
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),
33
+ className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n flex items-center overflow-hidden w-full\n group hover:no-underline focus:outline-none\n ", "\n "])), disabled ? "cursor-not-allowed" : "cursor-pointer"), className),
34
34
  "aria-current": isActive,
35
35
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
36
36
  className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["shrink-0 mr-3 ", ""])), disabled ? "text-grey-300" : "text-grey-500"),
37
37
  width: "1rem",
38
38
  height: "1rem"
39
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 group-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"),
40
+ className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n flex-1 inline-flex items-center overflow-hidden\n ", ""])), disabled ? "text-grey-300" : isActive ? "font-semibold text-accent-600" : "typo-subdued group-focus:text-accent-600 group-hover:text-accent-600"),
41
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
42
+ className: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["truncate"]))),
43
+ children: children
44
+ }), isExternalLink && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFeather.ExternalLink, {
45
+ className: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["shrink-0 ml-1 ", ""])), disabled ? "text-grey-300" : "text-grey-500 group-focus:text-accent-600 group-hover:text-accent-600"),
43
46
  size: "1em"
44
47
  })]
45
48
  })]
@@ -11,7 +11,7 @@ var _reactFeather = require("react-feather");
11
11
  var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
12
12
  var _useLinkProps = _interopRequireDefault(require("../../utils/useLinkProps"));
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
- var _templateObject, _templateObject2;
14
+ var _templateObject, _templateObject2, _templateObject3;
15
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; }
16
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; }
17
17
  var SidebarGroupLink = function SidebarGroupLink(props) {
@@ -23,10 +23,13 @@ var SidebarGroupLink = function SidebarGroupLink(props) {
23
23
  var isExternalLink = linkProps.target === "_blank";
24
24
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("a", _objectSpread(_objectSpread({}, linkProps), {}, {
25
25
  id: id,
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"),
26
+ className: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n inline-flex w-full 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"),
27
27
  "aria-current": active,
28
- children: [label, isExternalLink && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFeather.ExternalLink, {
29
- className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["ml-1 shrink-0"]))),
28
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
29
+ className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["truncate"]))),
30
+ children: label
31
+ }), isExternalLink && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFeather.ExternalLink, {
32
+ className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["ml-1 shrink-0"]))),
30
33
  size: "1em"
31
34
  })]
32
35
  }));
@@ -84,7 +84,7 @@ var SidebarLinksGroup = function SidebarLinksGroup(props) {
84
84
  className: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["flex-1 space-y-2 overflow-hidden"]))),
85
85
  children: links.map(function (link, idx) {
86
86
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
87
- className: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["truncate"]))),
87
+ className: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["overflow-hidden"]))),
88
88
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SidebarGroupLink.SidebarGroupLink, _objectSpread(_objectSpread({}, link), {}, {
89
89
  active: activeLinkIndex === idx
90
90
  }))
@@ -24,7 +24,7 @@ var _Header = _interopRequireDefault(require("./components/Header"));
24
24
  var _Loader = _interopRequireDefault(require("./components/Loader"));
25
25
  var _utils2 = require("./utils");
26
26
  var _jsxRuntime = require("react/jsx-runtime");
27
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
27
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
28
28
  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; }
29
29
  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; }
30
30
  var DEFAULT_DATATABLE_LOCALE = {
@@ -36,6 +36,9 @@ var DEFAULT_DATATABLE_LOCALE = {
36
36
  errorTitle: "Error",
37
37
  errorDescription: "An error occurred while loading data."
38
38
  };
39
+
40
+ // Selection
41
+
39
42
  var DEFAULT_GET_ITEM_ID = function DEFAULT_GET_ITEM_ID(_, idx) {
40
43
  return String(idx);
41
44
  };
@@ -139,10 +142,7 @@ var DataTable = function DataTable(_ref) {
139
142
  var isChecked = selectionLength === dataLength;
140
143
  var isIndeterminate = selectionLength > 0 && selectionLength !== dataLength;
141
144
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox["default"], {
142
- "aria-label": locale.selectAllButton
143
- // Small hack to position the checkbox in the center of the header
144
- ,
145
- className: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["absolute mb-2.5"]))),
145
+ "aria-label": locale.selectAllButton,
146
146
  checked: isChecked,
147
147
  indeterminate: isIndeterminate,
148
148
  onClick: function onClick() {
@@ -153,15 +153,15 @@ var DataTable = function DataTable(_ref) {
153
153
  Cell: function Cell(_ref3) {
154
154
  var row = _ref3.row;
155
155
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
156
- className: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["flex"]))),
156
+ className: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["flex"]))),
157
157
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox["default"], {
158
158
  checked: row.selected,
159
159
  disabled: !row.selectable,
160
- className: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["", ""])), row.hovered || row.selected ? "opacity-100" : "opacity-0 select-none")
160
+ className: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["", ""])), row.hovered || row.selected ? "opacity-100" : "opacity-0 select-none")
161
161
  })
162
162
  });
163
163
  },
164
- className: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["w-3"])))
164
+ className: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["w-3"])))
165
165
  }].concat((0, _toConsumableArray2["default"])(columns.map(function (c) {
166
166
  var _c$Header;
167
167
  return typeof c === "string" ? {
@@ -221,15 +221,15 @@ var DataTable = function DataTable(_ref) {
221
221
  return onChange === null || onChange === void 0 ? void 0 : onChange(dataConfiguration);
222
222
  };
223
223
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
224
- className: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["relative"]))),
224
+ className: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["relative"]))),
225
225
  children: [status === "loading" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
226
- className: (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["absolute bg-white/50 z-10 w-full h-full flex items-center justify-center"]))),
226
+ className: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["absolute bg-white/50 z-10 w-full h-full flex items-center justify-center"]))),
227
227
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loader["default"], {
228
- className: (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["-mt-12"]))),
228
+ className: (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["-mt-12"]))),
229
229
  locale: locale
230
230
  })
231
231
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Table["default"], {
232
- className: (0, _satellitePrefixer["default"])(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["datatable ", " ", ""])), status === "loading" && "pointer-events-none select-none", status === "loading" && data.length === 0 && "h-48"),
232
+ className: (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["datatable ", " ", ""])), status === "loading" && "pointer-events-none select-none", status === "loading" && data.length === 0 && "h-48"),
233
233
  highlight: false,
234
234
  footer: shouldRenderPagination() && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Footer["default"], {
235
235
  pagination: pagination,
@@ -29,7 +29,8 @@ var tooltipPlugin = plugin(function (_ref) {
29
29
  },
30
30
  ".tooltip-dark": {
31
31
  ".typo-link": {
32
- color: theme("colors.accent.300")
32
+ color: theme("colors.accent.300"),
33
+ textDecoration: "underline"
33
34
  }
34
35
  },
35
36
  ".tooltip-light": {
package/cjs/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export { default as colors } from "./styles/colors";
3
3
  export { default as brandColors } from "./styles/brandColors";
4
4
  export { default as stl } from "./styles/helpers/satellitePrefixer";
5
5
  export { default as makePurgeCssExtractor } from "./styles/helpers/makePurgeCssExtractor";
6
+ export * from "./utils/NumberUnion";
6
7
  export * from "./utils/parseUrl";
7
8
  export * from "./utils/useLinkProps";
8
9
  export * from "./AnnouncementBadge";
package/cjs/index.js CHANGED
@@ -50,6 +50,18 @@ var _colors = _interopRequireDefault(require("./styles/colors"));
50
50
  var _brandColors = _interopRequireDefault(require("./styles/brandColors"));
51
51
  var _satellitePrefixer = _interopRequireDefault(require("./styles/helpers/satellitePrefixer"));
52
52
  var _makePurgeCssExtractor = _interopRequireDefault(require("./styles/helpers/makePurgeCssExtractor"));
53
+ var _NumberUnion = require("./utils/NumberUnion");
54
+ Object.keys(_NumberUnion).forEach(function (key) {
55
+ if (key === "default" || key === "__esModule") return;
56
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
57
+ if (key in exports && exports[key] === _NumberUnion[key]) return;
58
+ Object.defineProperty(exports, key, {
59
+ enumerable: true,
60
+ get: function get() {
61
+ return _NumberUnion[key];
62
+ }
63
+ });
64
+ });
53
65
  var _parseUrl = require("./utils/parseUrl");
54
66
  Object.keys(_parseUrl).forEach(function (key) {
55
67
  if (key === "default" || key === "__esModule") return;
@@ -0,0 +1,5 @@
1
+ declare type AscendingArray<length extends number, accumulator extends Array<number> = []> = accumulator["length"] extends length ? accumulator : AscendingArray<length, [...accumulator, accumulator["length"]]>;
2
+ declare type ArrayToUnion<T extends Array<any>> = T[number];
3
+ /** example: `NumberUnion<3> = 1 | 2 | 3` */
4
+ export declare type NumberUnion<T extends number> = Exclude<ArrayToUnion<AscendingArray<T>>, 0> | T;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -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" | "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;
1
+ declare const isCssPropertySupported: <P extends number | typeof Symbol.iterator | "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;
@@ -1,6 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import type { MinimalUser } from "./types";
3
- export declare type UserAvatarProps = {
3
+ export declare type UserAvatarLocale = {
4
+ fallbackText?: string;
5
+ };
6
+ export interface UserAvatarProps {
4
7
  /** A minimal user object containing `name`, `email` and `avatar`. */
5
8
  user: MinimalUser;
6
9
  /**
@@ -10,7 +13,8 @@ export declare type UserAvatarProps = {
10
13
  size?: number;
11
14
  /** @ignore */
12
15
  className?: string;
13
- };
16
+ locale?: UserAvatarLocale;
17
+ }
14
18
  /** The `UserAvatar` is used as a visual representation of a user. */
15
- export declare const UserAvatar: ({ className, user, size }: UserAvatarProps) => JSX.Element;
19
+ export declare const UserAvatar: ({ className, user, size, locale: propsLocale }: UserAvatarProps) => JSX.Element;
16
20
  export default UserAvatar;