@algolia/satellite 1.0.0-beta.123 → 1.0.0-beta.127

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 (69) hide show
  1. package/cjs/Banner/Banner.d.ts +3 -0
  2. package/cjs/Banner/Banner.js +13 -5
  3. package/cjs/Banners/Alert/Alert.d.ts +69 -0
  4. package/cjs/Banners/Alert/Alert.js +144 -0
  5. package/cjs/Banners/Alert/index.d.ts +2 -0
  6. package/cjs/Banners/Alert/index.js +32 -0
  7. package/cjs/Banners/BigBertha/BigBertha.d.ts +40 -0
  8. package/cjs/Banners/BigBertha/BigBertha.js +68 -0
  9. package/cjs/Banners/BigBertha/index.d.ts +2 -0
  10. package/cjs/Banners/BigBertha/index.js +32 -0
  11. package/cjs/Banners/Promote/Promote.d.ts +56 -0
  12. package/cjs/Banners/Promote/Promote.js +113 -0
  13. package/cjs/Banners/Promote/index.d.ts +2 -0
  14. package/cjs/Banners/Promote/index.js +32 -0
  15. package/cjs/Banners/index.d.ts +3 -0
  16. package/cjs/Banners/index.js +44 -0
  17. package/cjs/Button/Button.tailwind.js +1 -1
  18. package/cjs/Dropzone/Dropzone.d.ts +16 -0
  19. package/cjs/Dropzone/Dropzone.js +179 -0
  20. package/cjs/Dropzone/index.d.ts +2 -0
  21. package/cjs/Dropzone/index.js +32 -0
  22. package/cjs/Insert/Insert.d.ts +43 -0
  23. package/cjs/Insert/Insert.js +80 -0
  24. package/cjs/Insert/index.d.ts +2 -0
  25. package/cjs/Insert/index.js +32 -0
  26. package/cjs/Tables/DataTable/DataTable.d.ts +14 -5
  27. package/cjs/Tables/DataTable/DataTable.js +11 -16
  28. package/cjs/Tables/DataTable/components/Header.js +2 -2
  29. package/cjs/Tables/DataTable/types.d.ts +1 -1
  30. package/cjs/index.d.ts +3 -0
  31. package/cjs/index.js +42 -0
  32. package/cjs/utils/formatters.d.ts +25 -0
  33. package/cjs/utils/formatters.js +51 -0
  34. package/esm/Banner/Banner.d.ts +3 -0
  35. package/esm/Banner/Banner.js +12 -5
  36. package/esm/Banners/Alert/Alert.d.ts +69 -0
  37. package/esm/Banners/Alert/Alert.js +127 -0
  38. package/esm/Banners/Alert/index.d.ts +2 -0
  39. package/esm/Banners/Alert/index.js +2 -0
  40. package/esm/Banners/BigBertha/BigBertha.d.ts +40 -0
  41. package/esm/Banners/BigBertha/BigBertha.js +54 -0
  42. package/esm/Banners/BigBertha/index.d.ts +2 -0
  43. package/esm/Banners/BigBertha/index.js +2 -0
  44. package/esm/Banners/Promote/Promote.d.ts +56 -0
  45. package/esm/Banners/Promote/Promote.js +95 -0
  46. package/esm/Banners/Promote/index.d.ts +2 -0
  47. package/esm/Banners/Promote/index.js +2 -0
  48. package/esm/Banners/index.d.ts +3 -0
  49. package/esm/Banners/index.js +3 -0
  50. package/esm/Button/Button.tailwind.js +1 -1
  51. package/esm/Dropzone/Dropzone.d.ts +16 -0
  52. package/esm/Dropzone/Dropzone.js +148 -0
  53. package/esm/Dropzone/index.d.ts +2 -0
  54. package/esm/Dropzone/index.js +2 -0
  55. package/esm/Insert/Insert.d.ts +43 -0
  56. package/esm/Insert/Insert.js +66 -0
  57. package/esm/Insert/index.d.ts +2 -0
  58. package/esm/Insert/index.js +2 -0
  59. package/esm/Tables/DataTable/DataTable.d.ts +14 -5
  60. package/esm/Tables/DataTable/DataTable.js +11 -16
  61. package/esm/Tables/DataTable/components/Header.js +2 -2
  62. package/esm/Tables/DataTable/types.d.ts +1 -1
  63. package/esm/index.d.ts +3 -0
  64. package/esm/index.js +3 -0
  65. package/esm/utils/formatters.d.ts +25 -0
  66. package/esm/utils/formatters.js +40 -0
  67. package/package.json +2 -1
  68. package/satellite.css +1 -1
  69. package/satellite.min.css +1 -1
package/cjs/index.js CHANGED
@@ -142,6 +142,20 @@ Object.keys(_Banner).forEach(function (key) {
142
142
  });
143
143
  });
144
144
 
145
+ var _Banners = require("./Banners");
146
+
147
+ Object.keys(_Banners).forEach(function (key) {
148
+ if (key === "default" || key === "__esModule") return;
149
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
150
+ if (key in exports && exports[key] === _Banners[key]) return;
151
+ Object.defineProperty(exports, key, {
152
+ enumerable: true,
153
+ get: function get() {
154
+ return _Banners[key];
155
+ }
156
+ });
157
+ });
158
+
145
159
  var _Button = require("./Button");
146
160
 
147
161
  Object.keys(_Button).forEach(function (key) {
@@ -226,6 +240,20 @@ Object.keys(_Dropdown).forEach(function (key) {
226
240
  });
227
241
  });
228
242
 
243
+ var _Dropzone = require("./Dropzone");
244
+
245
+ Object.keys(_Dropzone).forEach(function (key) {
246
+ if (key === "default" || key === "__esModule") return;
247
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
248
+ if (key in exports && exports[key] === _Dropzone[key]) return;
249
+ Object.defineProperty(exports, key, {
250
+ enumerable: true,
251
+ get: function get() {
252
+ return _Dropzone[key];
253
+ }
254
+ });
255
+ });
256
+
229
257
  var _EmptyState = require("./EmptyState");
230
258
 
231
259
  Object.keys(_EmptyState).forEach(function (key) {
@@ -310,6 +338,20 @@ Object.keys(_Input).forEach(function (key) {
310
338
  });
311
339
  });
312
340
 
341
+ var _Insert = require("./Insert");
342
+
343
+ Object.keys(_Insert).forEach(function (key) {
344
+ if (key === "default" || key === "__esModule") return;
345
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
346
+ if (key in exports && exports[key] === _Insert[key]) return;
347
+ Object.defineProperty(exports, key, {
348
+ enumerable: true,
349
+ get: function get() {
350
+ return _Insert[key];
351
+ }
352
+ });
353
+ });
354
+
313
355
  var _Link = require("./Link");
314
356
 
315
357
  Object.keys(_Link).forEach(function (key) {
@@ -0,0 +1,25 @@
1
+ declare const defaultHumanSizes: string[];
2
+ export declare function numberWithCommas(x: number | string, precision?: number): string;
3
+ export declare function formatHumanNumber(bytes: number, options?: {
4
+ /** @default 2 */
5
+ decimals?: number;
6
+ /** @default ['', 'K', 'M', 'B', 'T'] */
7
+ sizes?: typeof defaultHumanSizes;
8
+ /** @default 1000 */
9
+ divider?: number;
10
+ /**
11
+ * Hides the decimal points if they're 0
12
+ * @default false
13
+ */
14
+ prettyDecimals?: boolean;
15
+ }): string;
16
+ export declare function formatHumanSize(nb: number, options?: {
17
+ /** @default 2 */
18
+ decimals?: number;
19
+ /**
20
+ * Hides the decimal points if they're 0
21
+ * @default false
22
+ */
23
+ prettyDecimals?: boolean;
24
+ }): string;
25
+ export {};
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatHumanNumber = formatHumanNumber;
7
+ exports.formatHumanSize = formatHumanSize;
8
+ exports.numberWithCommas = numberWithCommas;
9
+ var defaultHumanSizes = ["", "K", "M", "B", "T"];
10
+
11
+ function numberWithCommas(x) {
12
+ var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
13
+
14
+ if (typeof x !== "number") {
15
+ return x;
16
+ }
17
+
18
+ return (x || 0).toFixed(precision).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
19
+ }
20
+
21
+ function formatHumanNumber(bytes, options) {
22
+ var _ref = options !== null && options !== void 0 ? options : {},
23
+ _ref$decimals = _ref.decimals,
24
+ decimals = _ref$decimals === void 0 ? 2 : _ref$decimals,
25
+ _ref$sizes = _ref.sizes,
26
+ sizes = _ref$sizes === void 0 ? defaultHumanSizes : _ref$sizes,
27
+ _ref$divider = _ref.divider,
28
+ divider = _ref$divider === void 0 ? 1000 : _ref$divider,
29
+ _ref$prettyDecimals = _ref.prettyDecimals,
30
+ prettyDecimals = _ref$prettyDecimals === void 0 ? false : _ref$prettyDecimals;
31
+
32
+ if (bytes === 0) return "0";
33
+ var i = Math.min(Math.max(0, Math.floor(Math.log(Math.abs(bytes)) / Math.log(divider))), sizes.length - 1);
34
+ var nb = bytes / Math.pow(divider, i);
35
+ return (Math.abs(nb) > 1000 ? numberWithCommas(nb, decimals) : prettyDecimals ? parseFloat(nb.toFixed(decimals)) : nb.toFixed(decimals)) + sizes[i];
36
+ }
37
+
38
+ function formatHumanSize(nb, options) {
39
+ var _ref2 = options !== null && options !== void 0 ? options : {},
40
+ _ref2$decimals = _ref2.decimals,
41
+ decimals = _ref2$decimals === void 0 ? 2 : _ref2$decimals,
42
+ _ref2$prettyDecimals = _ref2.prettyDecimals,
43
+ prettyDecimals = _ref2$prettyDecimals === void 0 ? false : _ref2$prettyDecimals;
44
+
45
+ return formatHumanNumber(nb, {
46
+ decimals: decimals,
47
+ sizes: ["", "K", "M", "G", "T"],
48
+ divider: 1000,
49
+ prettyDecimals: prettyDecimals
50
+ }) + "B";
51
+ }
@@ -25,7 +25,10 @@ export interface BannerDefaultProps extends BannerPropsBase {
25
25
  title?: React.ReactNode;
26
26
  }
27
27
  export declare type BannerProps = BannerPageProps | BannerDefaultProps;
28
+ /** @deprecated use the new `Alert` component instead */
28
29
  /**
30
+ * <p className="stl-space-x-2"><span className="stl-bg-orange-200 stl-font-bold stl-text-orange-800 stl-px-2 stl-py-1.5 stl-rounded">🌇 Sunsetting</span><span>use the new `Alert` component instead</span></p>
31
+ *
29
32
  * Banners inform users about important changes or persistent conditions. Use this component if you need
30
33
  * to communicate to users in a prominent way. Take in consideration 3 levels of hierarchy when deciding
31
34
  * on the appropriate banner to use:
@@ -5,6 +5,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
5
5
  import React from "react";
6
6
  import cx from "classnames";
7
7
  import { AlertCircle, AlertTriangle, AlertOctagon, CheckCircle, X } from "react-feather";
8
+ import { IconButton } from "../Button";
8
9
  import stl from "../styles/helpers/satellitePrefixer";
9
10
 
10
11
  function isBannerDefaultProps(props) {
@@ -58,7 +59,11 @@ var TITLE_CLASSNAME_VARIANTS = {
58
59
  orange: stl(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["text-orange-900"]))),
59
60
  red: stl(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["text-red-900"])))
60
61
  };
62
+ /** @deprecated use the new `Alert` component instead */
63
+
61
64
  /**
65
+ * <p className="stl-space-x-2"><span className="stl-bg-orange-200 stl-font-bold stl-text-orange-800 stl-px-2 stl-py-1.5 stl-rounded">🌇 Sunsetting</span><span>use the new `Alert` component instead</span></p>
66
+ *
62
67
  * Banners inform users about important changes or persistent conditions. Use this component if you need
63
68
  * to communicate to users in a prominent way. Take in consideration 3 levels of hierarchy when deciding
64
69
  * on the appropriate banner to use:
@@ -134,15 +139,17 @@ export var Banner = function Banner(props) {
134
139
  className: cx(stl(_templateObject34 || (_templateObject34 = _taggedTemplateLiteral(["display-heading mb-1"]))), TITLE_CLASSNAME_VARIANTS[variant])
135
140
  }, props.title), /*#__PURE__*/React.createElement("div", {
136
141
  className: stl(_templateObject35 || (_templateObject35 = _taggedTemplateLiteral(["", " ", ""])), usageContext === "page" && "text-center", subduedContent && "text-grey-600")
137
- }, children)), onDismiss && /*#__PURE__*/React.createElement("button", {
138
- className: stl(_templateObject36 || (_templateObject36 = _taggedTemplateLiteral(["absolute top-0 right-0 mt-2 mr-2"]))),
139
- "aria-label": "Close banner",
142
+ }, children)), onDismiss && /*#__PURE__*/React.createElement("span", {
143
+ className: stl(_templateObject36 || (_templateObject36 = _taggedTemplateLiteral(["absolute top-2 right-2"])))
144
+ }, /*#__PURE__*/React.createElement(IconButton, {
145
+ title: "Close banner",
146
+ variant: "subtle",
147
+ size: "small",
148
+ icon: X,
140
149
  onClick: function onClick(evt) {
141
150
  evt.stopPropagation();
142
151
  onDismiss();
143
152
  }
144
- }, /*#__PURE__*/React.createElement(X, {
145
- size: "1rem"
146
153
  })));
147
154
  };
148
155
  export default Banner;
@@ -0,0 +1,69 @@
1
+ import React, { FunctionComponent } from "react";
2
+ import { ColorVariant, IconComponentType } from "../../types";
3
+ export declare type AlertContextType = "page" | "section";
4
+ declare type AlertColorVariant = Exclude<ColorVariant, "blue">;
5
+ export interface AlertProps {
6
+ /** @ignore */
7
+ className?: string;
8
+ /** @ignore */
9
+ style?: React.CSSProperties;
10
+ title?: React.ReactNode;
11
+ /** @default grey */
12
+ variant?: AlertColorVariant;
13
+ /** @default section */
14
+ usageContext?: AlertContextType;
15
+ icon?: IconComponentType;
16
+ onDismiss?(): void;
17
+ }
18
+ /**
19
+ * Alerts inform users about important changes or temporally conditions. Use this component if you need to communicate something to users in a prominent way.
20
+
21
+ * ## Examples
22
+ * [See the component in Figma](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components?node-id=2912%3A262266)
23
+
24
+ * ## Current Status
25
+ * - [x] Figma
26
+ * - [x] React
27
+ * - [ ] Documentation
28
+
29
+ * ## Component structure
30
+ * This component uses a common banner structure. It uses an icon that should match the intent of the message, an optional title _(Highly recommended)_, a short paragraph of text and optional buttons for follow up actions. The `Alert` is dismissible by default, to do so a cross icon is displayed on the top-right corner.
31
+
32
+ * ## Guidelines
33
+ * ### How to use it?
34
+ * Use the `Alert` if you want to inform the user about a specific action they need to do after something happened.
35
+
36
+ * ### How to NOT use it?
37
+ * Do not use the component to give higher visibility to trivial information, use the [Insert](https://algolia-satellite.netlify.app/?path=/docs/indicators-banners-insert--basic) component instead.
38
+ * Make sure that alerts are not stacking, We highly recommend to have only one per page if possible, though we understand that sometimes this is not possible.
39
+ * Do not use a product wide `Alert` to display features information.
40
+
41
+ * ### Variants
42
+ * This component comes with two sets of Variants:
43
+
44
+ * #### Color
45
+ * - `Grey` `Default`
46
+ * Use this as your default Alert if no other color matches your use-case.
47
+ * - `Accent` `Primary`
48
+ * Use this to represent something that is currently happening with no level of severity.
49
+ * - `Green` `Success`
50
+ * Use this to inform the user that an action has been completed in the background while the user wasn't on that page and/or needs further exploration from the user. For smaller and quick processes use the [Flag](https://algolia-satellite.netlify.app/?path=/docs/indicators-flag--basic) instead.
51
+ * - `Orange` `Warning`
52
+ * Use this to show the user that something important requires their attention. The warning should be used for low to medium errors.
53
+ * - `Red` `Failure`
54
+ * Use this to show the user that something requires their full attention and actions. Only use red for critical warnings that will result in a loss of data of production down time.
55
+
56
+ * #### Usage Context
57
+ * - `Page`
58
+ * This is for global and product wide alerts, use that with extreme caution as it's will impact every page and every feature.
59
+ * - `Section`
60
+ * This alert should be inside the frame of a section and linked to the content it impacts
61
+
62
+ * ### Do's and Don't
63
+ * TODO
64
+
65
+ * ## Accessibility
66
+ * TODO
67
+ */
68
+ export declare const Alert: FunctionComponent<AlertProps>;
69
+ export default Alert;
@@ -0,0 +1,127 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23;
4
+
5
+ import React from "react";
6
+ import cx from "classnames";
7
+ import { AlertCircle, AlertTriangle, AlertOctagon, CheckCircle, X } from "react-feather";
8
+ import { IconButton } from "../../Button";
9
+ import stl from "../../styles/helpers/satellitePrefixer";
10
+ var BASE_CLASSNAME = stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["relative flex text-grey-900 display-body"])));
11
+ var BACKGROUND_CLASSNAMES = {
12
+ grey: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["bg-grey-100"]))),
13
+ accent: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["bg-accent-100"]))),
14
+ green: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["bg-green-100"]))),
15
+ orange: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["bg-orange-100"]))),
16
+ red: stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["bg-red-100"])))
17
+ };
18
+ var BORDER_CLASSNAMES = {
19
+ grey: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["border-grey-200"]))),
20
+ accent: stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["border-accent-200"]))),
21
+ green: stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["border-green-200"]))),
22
+ orange: stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["border-orange-200"]))),
23
+ red: stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["border-red-200"])))
24
+ };
25
+ var ICON_VARIANTS = {
26
+ grey: AlertCircle,
27
+ accent: AlertCircle,
28
+ green: CheckCircle,
29
+ orange: AlertTriangle,
30
+ red: AlertOctagon
31
+ };
32
+ var ICON_CLASSNAME_VARIANTS = {
33
+ grey: stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["text-grey-600"]))),
34
+ accent: stl(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["text-accent-600"]))),
35
+ green: stl(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["text-green-600"]))),
36
+ orange: stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["text-orange-600"]))),
37
+ red: stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["text-red-600"])))
38
+ };
39
+ /**
40
+ * Alerts inform users about important changes or temporally conditions. Use this component if you need to communicate something to users in a prominent way.
41
+
42
+ * ## Examples
43
+ * [See the component in Figma](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components?node-id=2912%3A262266)
44
+
45
+ * ## Current Status
46
+ * - [x] Figma
47
+ * - [x] React
48
+ * - [ ] Documentation
49
+
50
+ * ## Component structure
51
+ * This component uses a common banner structure. It uses an icon that should match the intent of the message, an optional title _(Highly recommended)_, a short paragraph of text and optional buttons for follow up actions. The `Alert` is dismissible by default, to do so a cross icon is displayed on the top-right corner.
52
+
53
+ * ## Guidelines
54
+ * ### How to use it?
55
+ * Use the `Alert` if you want to inform the user about a specific action they need to do after something happened.
56
+
57
+ * ### How to NOT use it?
58
+ * Do not use the component to give higher visibility to trivial information, use the [Insert](https://algolia-satellite.netlify.app/?path=/docs/indicators-banners-insert--basic) component instead.
59
+ * Make sure that alerts are not stacking, We highly recommend to have only one per page if possible, though we understand that sometimes this is not possible.
60
+ * Do not use a product wide `Alert` to display features information.
61
+
62
+ * ### Variants
63
+ * This component comes with two sets of Variants:
64
+
65
+ * #### Color
66
+ * - `Grey` `Default`
67
+ * Use this as your default Alert if no other color matches your use-case.
68
+ * - `Accent` `Primary`
69
+ * Use this to represent something that is currently happening with no level of severity.
70
+ * - `Green` `Success`
71
+ * Use this to inform the user that an action has been completed in the background while the user wasn't on that page and/or needs further exploration from the user. For smaller and quick processes use the [Flag](https://algolia-satellite.netlify.app/?path=/docs/indicators-flag--basic) instead.
72
+ * - `Orange` `Warning`
73
+ * Use this to show the user that something important requires their attention. The warning should be used for low to medium errors.
74
+ * - `Red` `Failure`
75
+ * Use this to show the user that something requires their full attention and actions. Only use red for critical warnings that will result in a loss of data of production down time.
76
+
77
+ * #### Usage Context
78
+ * - `Page`
79
+ * This is for global and product wide alerts, use that with extreme caution as it's will impact every page and every feature.
80
+ * - `Section`
81
+ * This alert should be inside the frame of a section and linked to the content it impacts
82
+
83
+ * ### Do's and Don't
84
+ * TODO
85
+
86
+ * ## Accessibility
87
+ * TODO
88
+ */
89
+
90
+ export var Alert = function Alert(_ref) {
91
+ var title = _ref.title,
92
+ _ref$usageContext = _ref.usageContext,
93
+ usageContext = _ref$usageContext === void 0 ? "section" : _ref$usageContext,
94
+ _ref$variant = _ref.variant,
95
+ variant = _ref$variant === void 0 ? "grey" : _ref$variant,
96
+ onDismiss = _ref.onDismiss,
97
+ icon = _ref.icon,
98
+ className = _ref.className,
99
+ style = _ref.style,
100
+ children = _ref.children;
101
+ var containerClassName = cx(BASE_CLASSNAME, title ? stl(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["p-4"]))) : stl(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["py-2 px-3"]))), BACKGROUND_CLASSNAMES[variant], BORDER_CLASSNAMES[variant], usageContext !== "page" && stl(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["rounded border"]))), className);
102
+ var internalIcon = icon === undefined ? true : icon;
103
+ var Icon = typeof internalIcon === "boolean" && internalIcon ? ICON_VARIANTS[variant] : internalIcon;
104
+ return /*#__PURE__*/React.createElement("div", {
105
+ className: containerClassName,
106
+ style: style
107
+ }, /*#__PURE__*/React.createElement(Icon, {
108
+ className: cx(stl(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n flex-shrink-0 mr-2\n ", "\n "])), title ? "mt-1" : "mt-2px"), ICON_CLASSNAME_VARIANTS[variant]),
109
+ size: "1rem"
110
+ }), /*#__PURE__*/React.createElement("div", {
111
+ className: stl(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["flex flex-1 flex-col ", ""])), onDismiss && "mr-6")
112
+ }, title && /*#__PURE__*/React.createElement("h4", {
113
+ className: stl(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["display-heading text-grey-900 mb-1"])))
114
+ }, title), /*#__PURE__*/React.createElement("div", null, children)), onDismiss && /*#__PURE__*/React.createElement("span", {
115
+ className: stl(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["absolute top-2 right-2"])))
116
+ }, /*#__PURE__*/React.createElement(IconButton, {
117
+ icon: X,
118
+ title: "Close banner",
119
+ variant: "subtle",
120
+ size: "small",
121
+ onClick: function onClick(evt) {
122
+ evt.stopPropagation();
123
+ onDismiss();
124
+ }
125
+ })));
126
+ };
127
+ export default Alert;
@@ -0,0 +1,2 @@
1
+ export * from "./Alert";
2
+ export { default } from "./Alert";
@@ -0,0 +1,2 @@
1
+ export * from "./Alert";
2
+ export { default } from "./Alert";
@@ -0,0 +1,40 @@
1
+ import { FC } from "react";
2
+ import { IconComponentType } from "../../types";
3
+ export interface BigBerthaProps {
4
+ icon?: IconComponentType;
5
+ }
6
+ /**
7
+ * Major product wide announcement from Algolia to the users.
8
+
9
+ * ## Examples
10
+ * [See the component in Figma](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components?node-id=2912%3A279476)
11
+
12
+ * ## Current Status
13
+ * - [x] Figma
14
+ * - [x] React
15
+ * - [ ] Documentation
16
+
17
+ * ## Component structure
18
+ * This is a simple high contrast banner. It use an icon that should match the content of the message, a short text that describe the situation and can contain "Learn more" links.
19
+
20
+ * ## Guidelines
21
+
22
+ * ### How to use it?
23
+ * This component should only be used to inform the user about an on-going situation at Algolia that will impact the users' or end-users' experience with our products. The content of the message should be concise and explicit. Make sure that the tone used in the text does not generate stress.
24
+
25
+ * ### How to NOT use it?
26
+ * - Do not use this banner for any non critical announcement or any non product wide announcement.
27
+ * - If you want to inform the user about something in your features, please use the [Alert](https://algolia-satellite.netlify.app/?path=/docs/indicators-banners-alert--variants) component.
28
+ * - If you want to promote a specific feature, please use the [Promote Banner](https://algolia-satellite.netlify.app/?path=/docs/indicators-banners-promote--basic) component.
29
+
30
+ * ### Variants
31
+ * - Blue banner : Default state of this component
32
+
33
+ * ### Do's and Don't
34
+ * TODO
35
+
36
+ * ## Accessibility
37
+ * TODO
38
+ */
39
+ export declare const BigBertha: FC<BigBerthaProps>;
40
+ export default BigBertha;
@@ -0,0 +1,54 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject, _templateObject2;
4
+
5
+ import React from "react";
6
+ import { AlertCircle } from "react-feather";
7
+ import stl from "../../styles/helpers/satellitePrefixer";
8
+
9
+ /**
10
+ * Major product wide announcement from Algolia to the users.
11
+
12
+ * ## Examples
13
+ * [See the component in Figma](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components?node-id=2912%3A279476)
14
+
15
+ * ## Current Status
16
+ * - [x] Figma
17
+ * - [x] React
18
+ * - [ ] Documentation
19
+
20
+ * ## Component structure
21
+ * This is a simple high contrast banner. It use an icon that should match the content of the message, a short text that describe the situation and can contain "Learn more" links.
22
+
23
+ * ## Guidelines
24
+
25
+ * ### How to use it?
26
+ * This component should only be used to inform the user about an on-going situation at Algolia that will impact the users' or end-users' experience with our products. The content of the message should be concise and explicit. Make sure that the tone used in the text does not generate stress.
27
+
28
+ * ### How to NOT use it?
29
+ * - Do not use this banner for any non critical announcement or any non product wide announcement.
30
+ * - If you want to inform the user about something in your features, please use the [Alert](https://algolia-satellite.netlify.app/?path=/docs/indicators-banners-alert--variants) component.
31
+ * - If you want to promote a specific feature, please use the [Promote Banner](https://algolia-satellite.netlify.app/?path=/docs/indicators-banners-promote--basic) component.
32
+
33
+ * ### Variants
34
+ * - Blue banner : Default state of this component
35
+
36
+ * ### Do's and Don't
37
+ * TODO
38
+
39
+ * ## Accessibility
40
+ * TODO
41
+ */
42
+ export var BigBertha = function BigBertha(_ref) {
43
+ var icon = _ref.icon,
44
+ children = _ref.children;
45
+ var InternalIcon = icon || AlertCircle;
46
+ return /*#__PURE__*/React.createElement("div", {
47
+ className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["flex items-center justify-center space-x-4 bg-accent-600 text-white w-full p-4"])))
48
+ }, /*#__PURE__*/React.createElement(InternalIcon, {
49
+ size: "1rem"
50
+ }), /*#__PURE__*/React.createElement("span", {
51
+ className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["display-body"])))
52
+ }, children));
53
+ };
54
+ export default BigBertha;
@@ -0,0 +1,2 @@
1
+ export * from "./BigBertha";
2
+ export { default } from "./BigBertha";
@@ -0,0 +1,2 @@
1
+ export * from "./BigBertha";
2
+ export { default } from "./BigBertha";
@@ -0,0 +1,56 @@
1
+ import React, { FC } from "react";
2
+ declare type PromoteVariants = "large" | "compact";
3
+ interface CompactPromoteProps {
4
+ variant?: Extract<PromoteVariants, "compact">;
5
+ illustration?: never;
6
+ }
7
+ interface WidePromoteProps {
8
+ variant?: Extract<PromoteVariants, "large">;
9
+ /** Plop in an `img` element or `svg` here */
10
+ illustration?: React.ReactNode;
11
+ }
12
+ export declare type PromoteProps = {
13
+ /** Product context for the banner (either a string or a React component) */
14
+ context?: React.ReactNode;
15
+ /** Descriptive title for banner (either a string or a React component) */
16
+ title: React.ReactNode;
17
+ /** Buttons */
18
+ actions?: React.ReactNode;
19
+ onDismiss?(): void;
20
+ } & (CompactPromoteProps | WidePromoteProps);
21
+ /**
22
+ * A contextual way of showing our user that a new feature / product is available to them on a higher plan or as an option.
23
+
24
+ * ## Examples
25
+ * [See the component in Figma](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components?node-id=2912%3A279945)
26
+
27
+ * ## Current Status
28
+ * - [x] Figma
29
+ * - [x] React
30
+ * - [ ] Documentation
31
+
32
+ * ## Component structure
33
+ * This component is a bigger banner. It include an optional image, an optional product context, a title, a short text (2 lines maximum without an image and 3 lines maximum with an image), optional CTAs (one primary and one secondary). It comes in two different variants: `large` and `compact`.
34
+
35
+ * ## Guidelines
36
+ * ### How to use it?
37
+ * You should use this component to display to the users that a new features/product is now available for them in the current context they are in. This feature can be automatically available or locked behind higher plan tier, please make sure you adapt the content to not give false impression of availability to the user.
38
+
39
+ * This component is permanently dismissible by default.
40
+
41
+ * ### How to NOT use it?
42
+ * - Do not use this banner as a regular [Alert](https://algolia-satellite.netlify.app/?path=/docs/indicators-banners-alert--variants).
43
+ * - You can only use one `large` promotion banner per context and two/four compact per context.
44
+
45
+ * ### Variants
46
+ * - `large`
47
+ * - `compact`
48
+
49
+ * ### Do's and Don't
50
+ * TODO
51
+
52
+ * ## Accessibility
53
+ * TODO
54
+ */
55
+ export declare const Promote: FC<PromoteProps>;
56
+ export default Promote;
@@ -0,0 +1,95 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
4
+
5
+ import React from "react";
6
+ import cx from "classnames";
7
+ import { X } from "react-feather";
8
+ import Card from "../../Card";
9
+ import { IconButton } from "../../Button";
10
+ import stl from "../../styles/helpers/satellitePrefixer";
11
+ var TITLE_VARIANT_CLASSNAMES = {
12
+ compact: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["display-heading mb-2"]))),
13
+ large: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["display-medium mb-4"])))
14
+ };
15
+ var BODY_VARIANT_CLASSNAMES = {
16
+ compact: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["display-caption typo-subdued"]))),
17
+ large: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["display-body typo-subdued"])))
18
+ };
19
+ var ACTIONS_VARIANT_CLASSNAMES = {
20
+ compact: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["mt-1"]))),
21
+ large: stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["mt-3"])))
22
+ };
23
+ /**
24
+ * A contextual way of showing our user that a new feature / product is available to them on a higher plan or as an option.
25
+
26
+ * ## Examples
27
+ * [See the component in Figma](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components?node-id=2912%3A279945)
28
+
29
+ * ## Current Status
30
+ * - [x] Figma
31
+ * - [x] React
32
+ * - [ ] Documentation
33
+
34
+ * ## Component structure
35
+ * This component is a bigger banner. It include an optional image, an optional product context, a title, a short text (2 lines maximum without an image and 3 lines maximum with an image), optional CTAs (one primary and one secondary). It comes in two different variants: `large` and `compact`.
36
+
37
+ * ## Guidelines
38
+ * ### How to use it?
39
+ * You should use this component to display to the users that a new features/product is now available for them in the current context they are in. This feature can be automatically available or locked behind higher plan tier, please make sure you adapt the content to not give false impression of availability to the user.
40
+
41
+ * This component is permanently dismissible by default.
42
+
43
+ * ### How to NOT use it?
44
+ * - Do not use this banner as a regular [Alert](https://algolia-satellite.netlify.app/?path=/docs/indicators-banners-alert--variants).
45
+ * - You can only use one `large` promotion banner per context and two/four compact per context.
46
+
47
+ * ### Variants
48
+ * - `large`
49
+ * - `compact`
50
+
51
+ * ### Do's and Don't
52
+ * TODO
53
+
54
+ * ## Accessibility
55
+ * TODO
56
+ */
57
+
58
+ export var Promote = function Promote(_ref) {
59
+ var context = _ref.context,
60
+ title = _ref.title,
61
+ _ref$variant = _ref.variant,
62
+ variant = _ref$variant === void 0 ? "large" : _ref$variant,
63
+ illustration = _ref.illustration,
64
+ actions = _ref.actions,
65
+ children = _ref.children,
66
+ onDismiss = _ref.onDismiss;
67
+ return /*#__PURE__*/React.createElement(Card, {
68
+ className: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["relative flex"]))),
69
+ fullBleed: true
70
+ }, illustration && /*#__PURE__*/React.createElement("div", {
71
+ className: stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["w-full min-w-24 max-w-64 flex items-center justify-center bg-grey-100"])))
72
+ }, illustration), /*#__PURE__*/React.createElement("div", {
73
+ className: stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["", ""])), variant === "large" ? "p-6" : "p-4")
74
+ }, context && /*#__PURE__*/React.createElement("span", {
75
+ className: stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["block mb-1"])))
76
+ }, context), /*#__PURE__*/React.createElement("header", {
77
+ className: TITLE_VARIANT_CLASSNAMES[variant]
78
+ }, title), /*#__PURE__*/React.createElement("div", {
79
+ className: BODY_VARIANT_CLASSNAMES[variant]
80
+ }, children), actions && /*#__PURE__*/React.createElement("div", {
81
+ className: cx(stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["flex space-x-2"]))), ACTIONS_VARIANT_CLASSNAMES[variant])
82
+ }, actions)), onDismiss && /*#__PURE__*/React.createElement("span", {
83
+ className: stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["absolute top-2 right-2"])))
84
+ }, /*#__PURE__*/React.createElement(IconButton, {
85
+ icon: X,
86
+ title: "Close banner",
87
+ variant: "subtle",
88
+ size: "small",
89
+ onClick: function onClick(evt) {
90
+ evt.stopPropagation();
91
+ onDismiss();
92
+ }
93
+ })));
94
+ };
95
+ export default Promote;
@@ -0,0 +1,2 @@
1
+ export * from "./Promote";
2
+ export { default } from "./Promote";