@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
@@ -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:
@@ -15,6 +15,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
15
15
 
16
16
  var _reactFeather = require("react-feather");
17
17
 
18
+ var _Button = require("../Button");
19
+
18
20
  var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
19
21
 
20
22
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36;
@@ -70,7 +72,11 @@ var TITLE_CLASSNAME_VARIANTS = {
70
72
  orange: (0, _satellitePrefixer["default"])(_templateObject26 || (_templateObject26 = (0, _taggedTemplateLiteral2["default"])(["text-orange-900"]))),
71
73
  red: (0, _satellitePrefixer["default"])(_templateObject27 || (_templateObject27 = (0, _taggedTemplateLiteral2["default"])(["text-red-900"])))
72
74
  };
75
+ /** @deprecated use the new `Alert` component instead */
76
+
73
77
  /**
78
+ * <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>
79
+ *
74
80
  * Banners inform users about important changes or persistent conditions. Use this component if you need
75
81
  * to communicate to users in a prominent way. Take in consideration 3 levels of hierarchy when deciding
76
82
  * on the appropriate banner to use:
@@ -146,15 +152,17 @@ var Banner = function Banner(props) {
146
152
  className: (0, _classnames["default"])((0, _satellitePrefixer["default"])(_templateObject34 || (_templateObject34 = (0, _taggedTemplateLiteral2["default"])(["display-heading mb-1"]))), TITLE_CLASSNAME_VARIANTS[variant])
147
153
  }, props.title), /*#__PURE__*/_react["default"].createElement("div", {
148
154
  className: (0, _satellitePrefixer["default"])(_templateObject35 || (_templateObject35 = (0, _taggedTemplateLiteral2["default"])(["", " ", ""])), usageContext === "page" && "text-center", subduedContent && "text-grey-600")
149
- }, children)), onDismiss && /*#__PURE__*/_react["default"].createElement("button", {
150
- className: (0, _satellitePrefixer["default"])(_templateObject36 || (_templateObject36 = (0, _taggedTemplateLiteral2["default"])(["absolute top-0 right-0 mt-2 mr-2"]))),
151
- "aria-label": "Close banner",
155
+ }, children)), onDismiss && /*#__PURE__*/_react["default"].createElement("span", {
156
+ className: (0, _satellitePrefixer["default"])(_templateObject36 || (_templateObject36 = (0, _taggedTemplateLiteral2["default"])(["absolute top-2 right-2"])))
157
+ }, /*#__PURE__*/_react["default"].createElement(_Button.IconButton, {
158
+ title: "Close banner",
159
+ variant: "subtle",
160
+ size: "small",
161
+ icon: _reactFeather.X,
152
162
  onClick: function onClick(evt) {
153
163
  evt.stopPropagation();
154
164
  onDismiss();
155
165
  }
156
- }, /*#__PURE__*/_react["default"].createElement(_reactFeather.X, {
157
- size: "1rem"
158
166
  })));
159
167
  };
160
168
 
@@ -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,144 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = exports.Alert = void 0;
9
+
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _classnames = _interopRequireDefault(require("classnames"));
15
+
16
+ var _reactFeather = require("react-feather");
17
+
18
+ var _Button = require("../../Button");
19
+
20
+ var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
21
+
22
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23;
23
+
24
+ var BASE_CLASSNAME = (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["relative flex text-grey-900 display-body"])));
25
+ var BACKGROUND_CLASSNAMES = {
26
+ grey: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["bg-grey-100"]))),
27
+ accent: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["bg-accent-100"]))),
28
+ green: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["bg-green-100"]))),
29
+ orange: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["bg-orange-100"]))),
30
+ red: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["bg-red-100"])))
31
+ };
32
+ var BORDER_CLASSNAMES = {
33
+ grey: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["border-grey-200"]))),
34
+ accent: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["border-accent-200"]))),
35
+ green: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["border-green-200"]))),
36
+ orange: (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["border-orange-200"]))),
37
+ red: (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["border-red-200"])))
38
+ };
39
+ var ICON_VARIANTS = {
40
+ grey: _reactFeather.AlertCircle,
41
+ accent: _reactFeather.AlertCircle,
42
+ green: _reactFeather.CheckCircle,
43
+ orange: _reactFeather.AlertTriangle,
44
+ red: _reactFeather.AlertOctagon
45
+ };
46
+ var ICON_CLASSNAME_VARIANTS = {
47
+ grey: (0, _satellitePrefixer["default"])(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["text-grey-600"]))),
48
+ accent: (0, _satellitePrefixer["default"])(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["text-accent-600"]))),
49
+ green: (0, _satellitePrefixer["default"])(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["text-green-600"]))),
50
+ orange: (0, _satellitePrefixer["default"])(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["text-orange-600"]))),
51
+ red: (0, _satellitePrefixer["default"])(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2["default"])(["text-red-600"])))
52
+ };
53
+ /**
54
+ * Alerts inform users about important changes or temporally conditions. Use this component if you need to communicate something to users in a prominent way.
55
+
56
+ * ## Examples
57
+ * [See the component in Figma](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components?node-id=2912%3A262266)
58
+
59
+ * ## Current Status
60
+ * - [x] Figma
61
+ * - [x] React
62
+ * - [ ] Documentation
63
+
64
+ * ## Component structure
65
+ * 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.
66
+
67
+ * ## Guidelines
68
+ * ### How to use it?
69
+ * Use the `Alert` if you want to inform the user about a specific action they need to do after something happened.
70
+
71
+ * ### How to NOT use it?
72
+ * 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.
73
+ * 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.
74
+ * Do not use a product wide `Alert` to display features information.
75
+
76
+ * ### Variants
77
+ * This component comes with two sets of Variants:
78
+
79
+ * #### Color
80
+ * - `Grey` `Default`
81
+ * Use this as your default Alert if no other color matches your use-case.
82
+ * - `Accent` `Primary`
83
+ * Use this to represent something that is currently happening with no level of severity.
84
+ * - `Green` `Success`
85
+ * 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.
86
+ * - `Orange` `Warning`
87
+ * Use this to show the user that something important requires their attention. The warning should be used for low to medium errors.
88
+ * - `Red` `Failure`
89
+ * 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.
90
+
91
+ * #### Usage Context
92
+ * - `Page`
93
+ * This is for global and product wide alerts, use that with extreme caution as it's will impact every page and every feature.
94
+ * - `Section`
95
+ * This alert should be inside the frame of a section and linked to the content it impacts
96
+
97
+ * ### Do's and Don't
98
+ * TODO
99
+
100
+ * ## Accessibility
101
+ * TODO
102
+ */
103
+
104
+ var Alert = function Alert(_ref) {
105
+ var title = _ref.title,
106
+ _ref$usageContext = _ref.usageContext,
107
+ usageContext = _ref$usageContext === void 0 ? "section" : _ref$usageContext,
108
+ _ref$variant = _ref.variant,
109
+ variant = _ref$variant === void 0 ? "grey" : _ref$variant,
110
+ onDismiss = _ref.onDismiss,
111
+ icon = _ref.icon,
112
+ className = _ref.className,
113
+ style = _ref.style,
114
+ children = _ref.children;
115
+ var containerClassName = (0, _classnames["default"])(BASE_CLASSNAME, title ? (0, _satellitePrefixer["default"])(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2["default"])(["p-4"]))) : (0, _satellitePrefixer["default"])(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2["default"])(["py-2 px-3"]))), BACKGROUND_CLASSNAMES[variant], BORDER_CLASSNAMES[variant], usageContext !== "page" && (0, _satellitePrefixer["default"])(_templateObject19 || (_templateObject19 = (0, _taggedTemplateLiteral2["default"])(["rounded border"]))), className);
116
+ var internalIcon = icon === undefined ? true : icon;
117
+ var Icon = typeof internalIcon === "boolean" && internalIcon ? ICON_VARIANTS[variant] : internalIcon;
118
+ return /*#__PURE__*/_react["default"].createElement("div", {
119
+ className: containerClassName,
120
+ style: style
121
+ }, /*#__PURE__*/_react["default"].createElement(Icon, {
122
+ className: (0, _classnames["default"])((0, _satellitePrefixer["default"])(_templateObject20 || (_templateObject20 = (0, _taggedTemplateLiteral2["default"])(["\n flex-shrink-0 mr-2\n ", "\n "])), title ? "mt-1" : "mt-2px"), ICON_CLASSNAME_VARIANTS[variant]),
123
+ size: "1rem"
124
+ }), /*#__PURE__*/_react["default"].createElement("div", {
125
+ className: (0, _satellitePrefixer["default"])(_templateObject21 || (_templateObject21 = (0, _taggedTemplateLiteral2["default"])(["flex flex-1 flex-col ", ""])), onDismiss && "mr-6")
126
+ }, title && /*#__PURE__*/_react["default"].createElement("h4", {
127
+ className: (0, _satellitePrefixer["default"])(_templateObject22 || (_templateObject22 = (0, _taggedTemplateLiteral2["default"])(["display-heading text-grey-900 mb-1"])))
128
+ }, title), /*#__PURE__*/_react["default"].createElement("div", null, children)), onDismiss && /*#__PURE__*/_react["default"].createElement("span", {
129
+ className: (0, _satellitePrefixer["default"])(_templateObject23 || (_templateObject23 = (0, _taggedTemplateLiteral2["default"])(["absolute top-2 right-2"])))
130
+ }, /*#__PURE__*/_react["default"].createElement(_Button.IconButton, {
131
+ icon: _reactFeather.X,
132
+ title: "Close banner",
133
+ variant: "subtle",
134
+ size: "small",
135
+ onClick: function onClick(evt) {
136
+ evt.stopPropagation();
137
+ onDismiss();
138
+ }
139
+ })));
140
+ };
141
+
142
+ exports.Alert = Alert;
143
+ var _default = Alert;
144
+ exports["default"] = _default;
@@ -0,0 +1,2 @@
1
+ export * from "./Alert";
2
+ export { default } from "./Alert";
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ var _exportNames = {};
9
+ Object.defineProperty(exports, "default", {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return _Alert["default"];
13
+ }
14
+ });
15
+
16
+ var _Alert = _interopRequireWildcard(require("./Alert"));
17
+
18
+ Object.keys(_Alert).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
21
+ if (key in exports && exports[key] === _Alert[key]) return;
22
+ Object.defineProperty(exports, key, {
23
+ enumerable: true,
24
+ get: function get() {
25
+ return _Alert[key];
26
+ }
27
+ });
28
+ });
29
+
30
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
+
32
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -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,68 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = exports.BigBertha = void 0;
9
+
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _reactFeather = require("react-feather");
15
+
16
+ var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
17
+
18
+ var _templateObject, _templateObject2;
19
+
20
+ /**
21
+ * Major product wide announcement from Algolia to the users.
22
+
23
+ * ## Examples
24
+ * [See the component in Figma](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components?node-id=2912%3A279476)
25
+
26
+ * ## Current Status
27
+ * - [x] Figma
28
+ * - [x] React
29
+ * - [ ] Documentation
30
+
31
+ * ## Component structure
32
+ * 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.
33
+
34
+ * ## Guidelines
35
+
36
+ * ### How to use it?
37
+ * 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.
38
+
39
+ * ### How to NOT use it?
40
+ * - Do not use this banner for any non critical announcement or any non product wide announcement.
41
+ * - 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.
42
+ * - 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.
43
+
44
+ * ### Variants
45
+ * - Blue banner : Default state of this component
46
+
47
+ * ### Do's and Don't
48
+ * TODO
49
+
50
+ * ## Accessibility
51
+ * TODO
52
+ */
53
+ var BigBertha = function BigBertha(_ref) {
54
+ var icon = _ref.icon,
55
+ children = _ref.children;
56
+ var InternalIcon = icon || _reactFeather.AlertCircle;
57
+ return /*#__PURE__*/_react["default"].createElement("div", {
58
+ className: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["flex items-center justify-center space-x-4 bg-accent-600 text-white w-full p-4"])))
59
+ }, /*#__PURE__*/_react["default"].createElement(InternalIcon, {
60
+ size: "1rem"
61
+ }), /*#__PURE__*/_react["default"].createElement("span", {
62
+ className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["display-body"])))
63
+ }, children));
64
+ };
65
+
66
+ exports.BigBertha = BigBertha;
67
+ var _default = BigBertha;
68
+ exports["default"] = _default;
@@ -0,0 +1,2 @@
1
+ export * from "./BigBertha";
2
+ export { default } from "./BigBertha";
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ var _exportNames = {};
9
+ Object.defineProperty(exports, "default", {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return _BigBertha["default"];
13
+ }
14
+ });
15
+
16
+ var _BigBertha = _interopRequireWildcard(require("./BigBertha"));
17
+
18
+ Object.keys(_BigBertha).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
21
+ if (key in exports && exports[key] === _BigBertha[key]) return;
22
+ Object.defineProperty(exports, key, {
23
+ enumerable: true,
24
+ get: function get() {
25
+ return _BigBertha[key];
26
+ }
27
+ });
28
+ });
29
+
30
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
+
32
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -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,113 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = exports.Promote = void 0;
9
+
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _classnames = _interopRequireDefault(require("classnames"));
15
+
16
+ var _reactFeather = require("react-feather");
17
+
18
+ var _Card = _interopRequireDefault(require("../../Card"));
19
+
20
+ var _Button = require("../../Button");
21
+
22
+ var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
23
+
24
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
25
+
26
+ var TITLE_VARIANT_CLASSNAMES = {
27
+ compact: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["display-heading mb-2"]))),
28
+ large: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["display-medium mb-4"])))
29
+ };
30
+ var BODY_VARIANT_CLASSNAMES = {
31
+ compact: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["display-caption typo-subdued"]))),
32
+ large: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["display-body typo-subdued"])))
33
+ };
34
+ var ACTIONS_VARIANT_CLASSNAMES = {
35
+ compact: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["mt-1"]))),
36
+ large: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["mt-3"])))
37
+ };
38
+ /**
39
+ * A contextual way of showing our user that a new feature / product is available to them on a higher plan or as an option.
40
+
41
+ * ## Examples
42
+ * [See the component in Figma](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components?node-id=2912%3A279945)
43
+
44
+ * ## Current Status
45
+ * - [x] Figma
46
+ * - [x] React
47
+ * - [ ] Documentation
48
+
49
+ * ## Component structure
50
+ * 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`.
51
+
52
+ * ## Guidelines
53
+ * ### How to use it?
54
+ * 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.
55
+
56
+ * This component is permanently dismissible by default.
57
+
58
+ * ### How to NOT use it?
59
+ * - Do not use this banner as a regular [Alert](https://algolia-satellite.netlify.app/?path=/docs/indicators-banners-alert--variants).
60
+ * - You can only use one `large` promotion banner per context and two/four compact per context.
61
+
62
+ * ### Variants
63
+ * - `large`
64
+ * - `compact`
65
+
66
+ * ### Do's and Don't
67
+ * TODO
68
+
69
+ * ## Accessibility
70
+ * TODO
71
+ */
72
+
73
+ var Promote = function Promote(_ref) {
74
+ var context = _ref.context,
75
+ title = _ref.title,
76
+ _ref$variant = _ref.variant,
77
+ variant = _ref$variant === void 0 ? "large" : _ref$variant,
78
+ illustration = _ref.illustration,
79
+ actions = _ref.actions,
80
+ children = _ref.children,
81
+ onDismiss = _ref.onDismiss;
82
+ return /*#__PURE__*/_react["default"].createElement(_Card["default"], {
83
+ className: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["relative flex"]))),
84
+ fullBleed: true
85
+ }, illustration && /*#__PURE__*/_react["default"].createElement("div", {
86
+ 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"])))
87
+ }, illustration), /*#__PURE__*/_react["default"].createElement("div", {
88
+ className: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["", ""])), variant === "large" ? "p-6" : "p-4")
89
+ }, context && /*#__PURE__*/_react["default"].createElement("span", {
90
+ className: (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["block mb-1"])))
91
+ }, context), /*#__PURE__*/_react["default"].createElement("header", {
92
+ className: TITLE_VARIANT_CLASSNAMES[variant]
93
+ }, title), /*#__PURE__*/_react["default"].createElement("div", {
94
+ className: BODY_VARIANT_CLASSNAMES[variant]
95
+ }, children), actions && /*#__PURE__*/_react["default"].createElement("div", {
96
+ className: (0, _classnames["default"])((0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["flex space-x-2"]))), ACTIONS_VARIANT_CLASSNAMES[variant])
97
+ }, actions)), onDismiss && /*#__PURE__*/_react["default"].createElement("span", {
98
+ className: (0, _satellitePrefixer["default"])(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["absolute top-2 right-2"])))
99
+ }, /*#__PURE__*/_react["default"].createElement(_Button.IconButton, {
100
+ icon: _reactFeather.X,
101
+ title: "Close banner",
102
+ variant: "subtle",
103
+ size: "small",
104
+ onClick: function onClick(evt) {
105
+ evt.stopPropagation();
106
+ onDismiss();
107
+ }
108
+ })));
109
+ };
110
+
111
+ exports.Promote = Promote;
112
+ var _default = Promote;
113
+ exports["default"] = _default;
@@ -0,0 +1,2 @@
1
+ export * from "./Promote";
2
+ export { default } from "./Promote";