@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.
Files changed (87) hide show
  1. package/README.md +1 -1
  2. package/cjs/AnnouncementBadge/AnnouncementBadge.d.ts +6 -0
  3. package/cjs/AutoComplete/AutoComplete.d.ts +0 -1
  4. package/cjs/AutoComplete/AutoComplete.js +7 -11
  5. package/cjs/AutoComplete/components/AutoCompleteEmptyState.js +1 -1
  6. package/cjs/AutoComplete/types.d.ts +0 -1
  7. package/cjs/Avatars/UserAvatar.d.ts +4 -1
  8. package/cjs/Badge/Badge.js +3 -2
  9. package/cjs/Banners/Alert/Alert.d.ts +4 -0
  10. package/cjs/Banners/Alert/Alert.js +1 -1
  11. package/cjs/Banners/Promote/Promote.js +3 -3
  12. package/cjs/Card/Card.d.ts +1 -1
  13. package/cjs/Card/components/CardHeader.d.ts +5 -3
  14. package/cjs/Card/components/CardHeader.js +4 -2
  15. package/cjs/Checkbox/Checkbox.js +2 -1
  16. package/cjs/EmptyState/EmptyState.js +4 -4
  17. package/cjs/EmptyState/types.d.ts +1 -1
  18. package/cjs/Field/Field.js +1 -1
  19. package/cjs/Flag/Flag.js +2 -1
  20. package/cjs/Flag/types.d.ts +6 -1
  21. package/cjs/FlexGrid/FlexGrid.d.ts +34 -0
  22. package/cjs/Input/Input.d.ts +1 -1
  23. package/cjs/Input/Input.js +2 -2
  24. package/cjs/Modal/Modal.d.ts +8 -1
  25. package/cjs/Modal/Modal.js +1 -1
  26. package/cjs/Pagination/CompactPagination/CompactPagination.js +1 -1
  27. package/cjs/RangeSlider/RangeSlider.d.ts +22 -6
  28. package/cjs/RangeSlider/RangeSlider.js +69 -78
  29. package/cjs/Sidebar/SidebarButtonLink.js +8 -3
  30. package/cjs/Sidebar/SidebarHeading.js +1 -1
  31. package/cjs/Sidebar/SidebarLink.js +10 -5
  32. package/cjs/Sidebar/SidebarLinksGroup/SidebarGroupLink.js +9 -4
  33. package/cjs/Tables/Table/Table.js +1 -1
  34. package/cjs/Tabs/ContentTabs.js +2 -2
  35. package/cjs/Tabs/components/LinkTab.js +1 -1
  36. package/cjs/Tooltip/OverflowTooltipWrapper.js +1 -1
  37. package/cjs/Tooltip/TooltipWrapper.d.ts +1 -1
  38. package/cjs/styles/helpers/makePurgeCssExtractor.js +1 -1
  39. package/cjs/styles/tailwind.config.js +1 -1
  40. package/cjs/utils/index.d.ts +0 -1
  41. package/cjs/utils/isCssPropertySupported.d.ts +1 -1
  42. package/esm/AnnouncementBadge/AnnouncementBadge.d.ts +6 -0
  43. package/esm/AutoComplete/AutoComplete.d.ts +0 -1
  44. package/esm/AutoComplete/AutoComplete.js +7 -11
  45. package/esm/AutoComplete/components/AutoCompleteEmptyState.js +1 -1
  46. package/esm/AutoComplete/types.d.ts +0 -1
  47. package/esm/Avatars/UserAvatar.d.ts +4 -1
  48. package/esm/Badge/Badge.js +3 -2
  49. package/esm/Banners/Alert/Alert.d.ts +4 -0
  50. package/esm/Banners/Alert/Alert.js +1 -1
  51. package/esm/Banners/Promote/Promote.js +3 -3
  52. package/esm/Card/Card.d.ts +1 -1
  53. package/esm/Card/components/CardHeader.d.ts +5 -3
  54. package/esm/Card/components/CardHeader.js +4 -2
  55. package/esm/Checkbox/Checkbox.js +2 -1
  56. package/esm/EmptyState/EmptyState.js +4 -4
  57. package/esm/EmptyState/types.d.ts +1 -1
  58. package/esm/Field/Field.js +1 -1
  59. package/esm/Flag/Flag.js +2 -1
  60. package/esm/Flag/types.d.ts +6 -1
  61. package/esm/FlexGrid/FlexGrid.d.ts +34 -0
  62. package/esm/Input/Input.d.ts +1 -1
  63. package/esm/Input/Input.js +2 -2
  64. package/esm/Modal/Modal.d.ts +8 -1
  65. package/esm/Modal/Modal.js +1 -1
  66. package/esm/Pagination/CompactPagination/CompactPagination.js +1 -1
  67. package/esm/RangeSlider/RangeSlider.d.ts +22 -6
  68. package/esm/RangeSlider/RangeSlider.js +69 -78
  69. package/esm/Sidebar/SidebarButtonLink.js +8 -3
  70. package/esm/Sidebar/SidebarHeading.js +1 -1
  71. package/esm/Sidebar/SidebarLink.js +10 -5
  72. package/esm/Sidebar/SidebarLinksGroup/SidebarGroupLink.js +10 -4
  73. package/esm/Tables/Table/Table.js +1 -1
  74. package/esm/Tabs/ContentTabs.js +2 -2
  75. package/esm/Tabs/components/LinkTab.js +1 -1
  76. package/esm/Tooltip/OverflowTooltipWrapper.js +1 -1
  77. package/esm/Tooltip/TooltipWrapper.d.ts +1 -1
  78. package/esm/styles/helpers/makePurgeCssExtractor.js +1 -1
  79. package/esm/styles/tailwind.config.js +1 -1
  80. package/esm/utils/index.d.ts +0 -1
  81. package/esm/utils/isCssPropertySupported.d.ts +1 -1
  82. package/package.json +9 -8
  83. package/satellite.min.css +1 -1
  84. package/cjs/RangeSlider/RangeSlider.tailwind.d.ts +0 -5
  85. package/cjs/RangeSlider/RangeSlider.tailwind.js +0 -73
  86. package/esm/RangeSlider/RangeSlider.tailwind.d.ts +0 -5
  87. package/esm/RangeSlider/RangeSlider.tailwind.js +0 -73
package/README.md CHANGED
@@ -115,7 +115,7 @@ const { makePurgeCssExtractor } = require('@algolia/satellite');
115
115
  const satelliteConfig = require("@algolia/satellite/cjs/styles/tailwind.config.js");
116
116
 
117
117
  module.exports = {
118
- presets: [satellite],
118
+ presets: [satelliteConfig],
119
119
  content: [
120
120
  files: [
121
121
  `node_modules/@algolia/satellite/**/*.js`,
@@ -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;
@@ -95,7 +95,6 @@ var MENU_POPPER_MODFIERS = [{
95
95
  offset: [0, 8]
96
96
  }
97
97
  }];
98
- var BACKSPACE_KEY_CODE = 8;
99
98
  /** @ignore */
100
99
  var DefaultEmptyState = function DefaultEmptyState(_ref) {
101
100
  var emptyStateTitle = _ref.emptyStateTitle;
@@ -218,10 +217,8 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
218
217
  var _this$props2 = _this.props,
219
218
  _this$props2$value = _this$props2.value,
220
219
  value = _this$props2$value === void 0 ? [] : _this$props2$value,
221
- _this$props2$separato = _this$props2.separatorKeyCodes,
222
- separatorKeyCodes = _this$props2$separato === void 0 ? AutoComplete.defaultProps.separatorKeyCodes : _this$props2$separato,
223
- _this$props2$separato2 = _this$props2.separatorKeys,
224
- separatorKeys = _this$props2$separato2 === void 0 ? AutoComplete.defaultProps.separatorKeys : _this$props2$separato2,
220
+ _this$props2$separato = _this$props2.separatorKeys,
221
+ separatorKeys = _this$props2$separato === void 0 ? AutoComplete.defaultProps.separatorKeys : _this$props2$separato,
225
222
  creatable = _this$props2.creatable,
226
223
  _this$props2$createFr = _this$props2.createFromInputValue,
227
224
  createFromInputValue = _this$props2$createFr === void 0 ? AutoComplete.defaultProps.createFromInputValue : _this$props2$createFr,
@@ -229,9 +226,9 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
229
226
  onChange = _this$props2.onChange;
230
227
  var inputValue = state.inputValue || "";
231
228
  var canCreate = creatable && inputValue.trim().length > 0;
232
- if (evt.keyCode === BACKSPACE_KEY_CODE && !inputValue.length) {
229
+ if (evt.key === "Backspace" && !inputValue.length) {
233
230
  onChange(value.slice(0, -1));
234
- } else if (canCreate && (separatorKeyCodes.includes(evt.keyCode) || separatorKeys.includes(evt.key))) {
231
+ } else if (canCreate && separatorKeys.includes(evt.key)) {
235
232
  evt.preventDefault();
236
233
  var _createFromInputValue = createFromInputValue(options, inputValue),
237
234
  _createFromInputValue2 = (0, _slicedToArray2["default"])(_createFromInputValue, 1),
@@ -378,9 +375,9 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
378
375
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", _objectSpread(_objectSpread({}, inputProps), {}, {
379
376
  "data-lpignore": true
380
377
  }))]
381
- }), (showClearButton || endItem) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
378
+ }), (showClearButton || !!endItem) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
382
379
  className: (0, _clsx["default"])(showClearButton && endItem && (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["my-2 flex self-end space-x-4"])))),
383
- children: [endItem && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
380
+ children: [!!endItem && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
384
381
  className: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["text-grey-700 my-auto"]))),
385
382
  children: endItem
386
383
  }), showClearButton && /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
@@ -497,7 +494,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
497
494
  })
498
495
  })]
499
496
  }))
500
- }), menuFooter && /*#__PURE__*/(0, _jsxRuntime.jsx)("footer", {
497
+ }), !!menuFooter && /*#__PURE__*/(0, _jsxRuntime.jsx)("footer", {
501
498
  className: (0, _satellitePrefixer["default"])(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2["default"])(["flex items-center justify-center min-h-12 p-4 bg-grey-100 border-t border-grey-200 text-grey-600"]))),
502
499
  children: menuFooter
503
500
  })]
@@ -588,7 +585,6 @@ exports.AutoComplete = AutoComplete;
588
585
  maxResults: 7,
589
586
  createFromInputValue: _utils.defaultCreateFromInputValue,
590
587
  options: [],
591
- separatorKeyCodes: [],
592
588
  separatorKeys: [],
593
589
  optionItemComponent: DefaultOption,
594
590
  noWrap: false
@@ -26,7 +26,7 @@ var AutoCompleteEmptyState = function AutoCompleteEmptyState(_ref) {
26
26
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
27
27
  className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["font-semibold pt-4"]))),
28
28
  children: title
29
- }), description && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
29
+ }), !!description && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
30
30
  className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["display-caption typo-subdued pt-4"]))),
31
31
  children: description
32
32
  })]
@@ -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
- /** @default 32 */
6
+ /**
7
+ * in px
8
+ * @default 32
9
+ * */
7
10
  size?: number;
8
11
  /** @ignore */
9
12
  className?: string;
@@ -10,6 +10,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
10
10
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
11
  var _clsx = _interopRequireDefault(require("clsx"));
12
12
  var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
13
+ var _isRenderedChild = _interopRequireDefault(require("../utils/isRenderedChild"));
13
14
  var _jsxRuntime = require("react/jsx-runtime");
14
15
  var _excluded = ["children", "value", "icon", "variant", "size", "className"];
15
16
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
@@ -62,10 +63,10 @@ var Badge = function Badge(_ref) {
62
63
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
63
64
  size: ".8em"
64
65
  })
65
- }), children && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
66
+ }), (0, _isRenderedChild["default"])(children) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
66
67
  className: (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["truncate"]))),
67
68
  children: children
68
- }), value && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
69
+ }), (0, _isRenderedChild["default"])(value) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
69
70
  children: value
70
71
  })]
71
72
  }));
@@ -17,6 +17,10 @@ export interface AlertProps {
17
17
  */
18
18
  usageContext?: AlertContextType;
19
19
  icon?: IconComponentType;
20
+ /**
21
+ * Function triggered when the dismiss button is clicked.
22
+ * Dismiss button won't be rendered if absent.
23
+ * */
20
24
  onDismiss?(): void;
21
25
  children: ReactNode;
22
26
  }
@@ -114,7 +114,7 @@ var Alert = function Alert(_ref) {
114
114
  size: "1rem"
115
115
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
116
116
  className: (0, _satellitePrefixer["default"])(_templateObject22 || (_templateObject22 = (0, _taggedTemplateLiteral2["default"])(["flex flex-1 flex-col ", ""])), onDismiss && "mr-6"),
117
- children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("h4", {
117
+ children: [!!title && /*#__PURE__*/(0, _jsxRuntime.jsx)("h4", {
118
118
  className: (0, _satellitePrefixer["default"])(_templateObject23 || (_templateObject23 = (0, _taggedTemplateLiteral2["default"])(["font-bold text-grey-900 mb-1"]))),
119
119
  children: title
120
120
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -73,12 +73,12 @@ var Promote = function Promote(_ref) {
73
73
  className: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["relative flex"]))),
74
74
  fullBleed: true,
75
75
  as: "section",
76
- children: [illustration && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
76
+ children: [!!illustration && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
77
77
  className: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["w-full min-w-24 max-w-64 flex items-center justify-center bg-grey-100"]))),
78
78
  children: illustration
79
79
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
80
80
  className: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["", ""])), variant === "large" ? "p-6" : "p-4"),
81
- children: [context && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
81
+ children: [!!context && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
82
82
  className: (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["block mb-1"]))),
83
83
  children: context
84
84
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("header", {
@@ -87,7 +87,7 @@ var Promote = function Promote(_ref) {
87
87
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
88
88
  className: BODY_VARIANT_CLASSNAMES[variant],
89
89
  children: children
90
- }), actions && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
90
+ }), !!actions && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
91
91
  className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["flex space-x-2"]))), ACTIONS_VARIANT_CLASSNAMES[variant]),
92
92
  children: actions
93
93
  })]
@@ -11,7 +11,7 @@ export interface CardProps {
11
11
  style?: CSSProperties;
12
12
  /**
13
13
  * Specify HTML element `Card` should be presented as.
14
- * @default "div"
14
+ * @default "section"
15
15
  */
16
16
  as?: CardAs;
17
17
  /** Should the content take up full full width of the `Card`. */
@@ -1,4 +1,6 @@
1
- /// <reference types="react" />
2
- export declare type CardHeaderProps = JSX.IntrinsicElements["div"];
3
- export declare const CardHeader: ({ className, ...props }: CardHeaderProps) => JSX.Element;
1
+ import type { FunctionComponent, ReactNode } from "react";
2
+ export declare type CardHeaderProps = JSX.IntrinsicElements["div"] & {
3
+ children: ReactNode;
4
+ };
5
+ export declare const CardHeader: FunctionComponent<CardHeaderProps>;
4
6
  export default CardHeader;
@@ -12,14 +12,16 @@ var _clsx = _interopRequireDefault(require("clsx"));
12
12
  var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
14
  var _templateObject;
15
- var _excluded = ["className"];
15
+ var _excluded = ["className", "children"];
16
16
  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
17
  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
18
  var CardHeader = function CardHeader(_ref) {
19
19
  var className = _ref.className,
20
+ children = _ref.children,
20
21
  props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
21
22
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, props), {}, {
22
- className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["flex justify-between"]))), className)
23
+ className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["flex justify-between"]))), className),
24
+ children: children
23
25
  }));
24
26
  };
25
27
  exports.CardHeader = CardHeader;
@@ -14,6 +14,7 @@ var _react = require("react");
14
14
  var _reactFeather = require("react-feather");
15
15
  var _Field = require("../Field");
16
16
  var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
17
+ var _isRenderedChild = _interopRequireDefault(require("../utils/isRenderedChild"));
17
18
  var _jsxRuntime = require("react/jsx-runtime");
18
19
  var _excluded = ["children", "className", "textPosition", "indeterminate", "defaultChecked", "checkedColor", "checked", "disabled"];
19
20
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
@@ -84,7 +85,7 @@ var Checkbox = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
84
85
  checked: isChecked,
85
86
  disabled: disabled
86
87
  }))]
87
- }), children && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
88
+ }), (0, _isRenderedChild["default"])(children) && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
88
89
  className: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display-body\n ", "\n ", "\n "])), disabled && "text-grey-300 cursor-not-allowed", textPosition === "left" ? "pr-2" : "pl-2"),
89
90
  htmlFor: id,
90
91
  children: children
@@ -69,16 +69,16 @@ var renderEmptyState = function renderEmptyState(_ref) {
69
69
  className: containerClassNames,
70
70
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
71
71
  className: (0, _satellitePrefixer["default"])(_templateObject23 || (_templateObject23 = (0, _taggedTemplateLiteral2["default"])(["min-w-2/5"]))),
72
- children: [centered && medallion && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
72
+ children: [centered && !!medallion && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
73
73
  className: MEDALLION_CONTEXT_CLASSNAMES[usageContext],
74
74
  children: medallion
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)("p", {
79
79
  className: descriptionClassNames,
80
80
  children: description
81
- }), actions && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FlexGrid["default"], {
81
+ }), !!actions && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FlexGrid["default"], {
82
82
  className: actionsClassNames,
83
83
  alignment: centered ? "center" : "leading",
84
84
  distribution: centered ? "center" : "leading",
@@ -86,7 +86,7 @@ var renderEmptyState = function renderEmptyState(_ref) {
86
86
  spacing: "sm",
87
87
  children: actions
88
88
  })]
89
- }), illustration && !centered && usageContext === "page" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
89
+ }), !!illustration && !centered && usageContext === "page" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
90
90
  className: (0, _satellitePrefixer["default"])(_templateObject24 || (_templateObject24 = (0, _taggedTemplateLiteral2["default"])(["empty-state-illustration ml-16 hidden lg:flex items-center justify-center"]))),
91
91
  children: illustration
92
92
  })]
@@ -21,7 +21,7 @@ export interface EmptyStatePropsAll {
21
21
  */
22
22
  usageContext?: EmptyStateUsageContexts;
23
23
  /**
24
- * Define wether or not content should be centered
24
+ * Define whether or not content should be centered
25
25
  * @default false
26
26
  */
27
27
  centered?: boolean;
@@ -66,7 +66,7 @@ var Field = function Field(_ref) {
66
66
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
67
67
  className: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["cursor-pointer flex ", ""])), !inline && "flex-col"),
68
68
  htmlFor: labelFor,
69
- children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
69
+ children: [!!label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
70
70
  className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["truncate ", ""])), inline ? "mr-2" : "mb-1"),
71
71
  children: label
72
72
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
package/cjs/Flag/Flag.js CHANGED
@@ -16,6 +16,7 @@ var _Card = require("../Card");
16
16
  var _ProgressSpinner = _interopRequireDefault(require("../ProgressSpinner"));
17
17
  var _Satellite = require("../Satellite");
18
18
  var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
19
+ var _isRenderedChild = _interopRequireDefault(require("../utils/isRenderedChild"));
19
20
  var _jsxRuntime = require("react/jsx-runtime");
20
21
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21;
21
22
  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; }
@@ -104,7 +105,7 @@ var Flag = function Flag(_ref) {
104
105
  size: "small",
105
106
  onClick: onDismiss
106
107
  })]
107
- }), hasTitle && children && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
108
+ }), hasTitle && (0, _isRenderedChild["default"])(children) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
108
109
  className: (0, _satellitePrefixer["default"])(_templateObject21 || (_templateObject21 = (0, _taggedTemplateLiteral2["default"])(["text-grey-600 mt-2"]))),
109
110
  children: children
110
111
  })]
@@ -11,9 +11,14 @@ export interface Notification {
11
11
  icon?: IconComponentType;
12
12
  /** @default false */
13
13
  loading?: boolean;
14
- /** @default blue */
14
+ /** @default "blue" */
15
15
  variant?: ColorVariant;
16
+ /**
17
+ * Function triggered when the dismiss button is clicked.
18
+ * Dismiss button won't be rendered if absent.
19
+ * */
16
20
  onDismiss?: () => void;
21
+ /** Defines if and how long before the notification should be dismissed (in ms) */
17
22
  autoDismissAfter?: number;
18
23
  locale?: {
19
24
  dismissText?: string;
@@ -4,12 +4,46 @@ export declare type FlexGridAlignment = "leading" | "trailing" | "center" | "fil
4
4
  export declare type FlexGridDistribution = "equalSpacing" | "leading" | "trailing" | "center" | "fill" | "fillEvenly";
5
5
  export declare type FlexGridSpacing = "none" | "sm" | "md" | "lg" | "xl";
6
6
  export interface FlexGridProps {
7
+ /** @ignore */
7
8
  className?: string;
9
+ /**
10
+ * Define which direction the content should flow
11
+ * @default "row"
12
+ */
8
13
  direction?: FlexGridDirection;
14
+ /**
15
+ * Define whether or not the contents be allowed to wrap
16
+ * @default false
17
+ */
9
18
  wrap?: boolean;
19
+ /**
20
+ * Define whether or not the content be wrapped in an inline-flex container
21
+ * @default false
22
+ */
10
23
  inline?: boolean;
24
+ /**
25
+ * @default "leading"
26
+ */
11
27
  alignment?: FlexGridAlignment;
28
+ /**
29
+ * @default "leading"
30
+ */
12
31
  distribution?: FlexGridDistribution;
32
+ /**
33
+ * The spacing directly corelates to our Tailwind spacing scale
34
+ *
35
+ * none: `spacing.0 → 0px`
36
+ *
37
+ * sm: `spacing.2 → 8px`
38
+ *
39
+ * md: `spacing.4 → 16px`
40
+ *
41
+ * lg: `spacing.6 → 24px`
42
+ *
43
+ * xl: `spacing.8 → 32px`
44
+ *
45
+ * @default "none"
46
+ */
13
47
  spacing?: FlexGridSpacing;
14
48
  children: ReactNode;
15
49
  }
@@ -12,7 +12,7 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
12
12
  variant?: InputVariant;
13
13
  startIcon?: IconComponentType;
14
14
  endItem?: ReactNode;
15
- /** Define wether or not a "clear input" x button should show on hover */
15
+ /** Define whether or not a "clear input" x button should show on hover */
16
16
  clearable?: boolean;
17
17
  locale?: InputPropsLocale;
18
18
  }
@@ -140,7 +140,7 @@ var Input = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, externalRef) {
140
140
  setFocused(false);
141
141
  (_inputProps$onBlur = inputProps.onBlur) === null || _inputProps$onBlur === void 0 ? void 0 : _inputProps$onBlur.call(inputProps, evt);
142
142
  }
143
- })), clearable && !disabled && !readOnly && !isValueEmpty && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
143
+ })), clearable && !disabled && !readOnly && !isValueEmpty ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
144
144
  className: (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["mr-2 ", ""])), focused ? "visible" : "invisible group-hover:visible"),
145
145
  title: locale.clearInput,
146
146
  icon: _reactFeather.X,
@@ -152,7 +152,7 @@ var Input = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, externalRef) {
152
152
  evt.preventDefault();
153
153
  triggerInputChange("");
154
154
  }
155
- }), endItem && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
155
+ }) : null, !!endItem && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
156
156
  className: (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["mr-4"]))),
157
157
  children: endItem
158
158
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(StatusIcon, {}), type === "number" && !disabled && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -5,13 +5,20 @@ export declare type ModalLocale = {
5
5
  };
6
6
  export interface ModalProps {
7
7
  open?: boolean;
8
- title?: string | JSX.Element;
8
+ /** Descriptive title for `Modal` */
9
+ title?: ReactNode;
10
+ /** @ignore */
9
11
  className?: string;
12
+ /** Should the content take up full full width of the `Modal`. */
10
13
  fullBleed?: boolean;
14
+ /** Define whether or not the modal should animate on show and hide */
11
15
  animate?: boolean;
12
16
  size?: ModalSizeVariant;
17
+ /** Define whether or not the dismiss button should be hidden */
13
18
  hideCloseIcon?: boolean;
19
+ /** Define whether or not the modal should be vertically aligned */
14
20
  centerY?: boolean;
21
+ /** Function triggered when the dismiss button is clicked */
15
22
  onDismiss?: () => void;
16
23
  children: ReactNode;
17
24
  locale?: ModalLocale;
@@ -132,7 +132,7 @@ var Modal = function Modal(_ref) {
132
132
  "aria-label": title || "Modal",
133
133
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("header", {
134
134
  className: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n px-8 min-h-14\n flex items-center justify-between space-x-2\n ", "\n ", "\n "])), title ? "border-b border-grey-100" : "justify-end", !title && hideCloseIcon && "hidden"),
135
- children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
135
+ children: [!!title && /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
136
136
  id: modalTitleId,
137
137
  className: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["flex-1 display-heading truncate"]))),
138
138
  children: title
@@ -61,7 +61,7 @@ var CompactPagination = function CompactPagination(props) {
61
61
  return props.onChange(props.currentPage - 1);
62
62
  },
63
63
  disabled: isFirstPage
64
- }), label && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
64
+ }), !!label && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
65
65
  className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["inline-block text-center tabular-nums px-2"]))),
66
66
  children: label
67
67
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
@@ -1,18 +1,34 @@
1
- import type { DetailedHTMLProps, InputHTMLAttributes } from "react";
2
- export interface RangeSliderProps extends Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "defaultValue" | "checked" | "defaultChecked" | "type" | "children"> {
3
- value?: number;
4
- defaultValue?: number;
1
+ /// <reference types="react" />
2
+ declare type RangeSliderValue = number | [number, number];
3
+ declare type WidenNumber<T> = T extends number ? number : T;
4
+ export interface RangeSliderProps<Value extends RangeSliderValue = number> {
5
+ value?: WidenNumber<Value>;
6
+ defaultValue?: WidenNumber<Value>;
7
+ /** Event handler called when the value changes. */
8
+ onChange?: (value: WidenNumber<Value>) => void;
9
+ /** Event handler called when the value changes at the end of an interaction. */
10
+ onCommit?: (value: WidenNumber<Value>) => void;
11
+ id?: string;
12
+ name?: string;
13
+ className?: string;
14
+ "aria-label"?: string;
15
+ disabled?: boolean;
5
16
  min?: number;
6
17
  max?: number;
18
+ step?: number;
19
+ minStepsBetweenThumbs?: number;
7
20
  track1Color?: string;
8
21
  track2Color?: string;
9
22
  }
10
23
  /**
11
- * A range slider is an input field where users select a numeric value within a given range (minimum and maximum values).
24
+ * A range slider is an input field where users select one or two numeric values within a given range (minimum and maximum values).
12
25
  *
13
26
  * - Range sliders should always be used with a label
14
27
  * - Provide min and max value whenever possible
15
28
  * - Provide text input for better accessibility
16
29
  */
17
- export declare const RangeSlider: import("react").ForwardRefExoticComponent<Pick<RangeSliderProps, "max" | "required" | "key" | "id" | "height" | "width" | "name" | "color" | "translate" | "value" | "hidden" | "dir" | "form" | "slot" | "style" | "title" | "pattern" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "contentEditable" | "enterKeyHint" | "inputMode" | "tabIndex" | "disabled" | "multiple" | "size" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "list" | "maxLength" | "min" | "minLength" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "readOnly" | "src" | "step" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "track1Color" | "track2Color"> & import("react").RefAttributes<HTMLInputElement>>;
30
+ export declare const RangeSlider: {
31
+ <Value extends RangeSliderValue = number>({ className, value, defaultValue, onChange, onCommit, disabled, min, max, track1Color, track2Color, ...otherProps }: RangeSliderProps<Value>): JSX.Element;
32
+ displayName: string;
33
+ };
18
34
  export default RangeSlider;