@algolia/satellite 1.0.0-beta.125 → 1.0.0-beta.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/Banner/Banner.d.ts +3 -0
- package/cjs/Banner/Banner.js +13 -5
- package/cjs/Banners/Alert/Alert.d.ts +69 -0
- package/cjs/Banners/Alert/Alert.js +144 -0
- package/cjs/Banners/Alert/index.d.ts +2 -0
- package/cjs/Banners/Alert/index.js +32 -0
- package/cjs/Banners/BigBertha/BigBertha.d.ts +40 -0
- package/cjs/Banners/BigBertha/BigBertha.js +68 -0
- package/cjs/Banners/BigBertha/index.d.ts +2 -0
- package/cjs/Banners/BigBertha/index.js +32 -0
- package/cjs/Banners/Promote/Promote.d.ts +56 -0
- package/cjs/Banners/Promote/Promote.js +113 -0
- package/cjs/Banners/Promote/index.d.ts +2 -0
- package/cjs/Banners/Promote/index.js +32 -0
- package/cjs/Banners/index.d.ts +3 -0
- package/cjs/Banners/index.js +44 -0
- package/cjs/Button/Button.tailwind.js +1 -1
- package/cjs/Insert/Insert.d.ts +43 -0
- package/cjs/Insert/Insert.js +80 -0
- package/cjs/Insert/index.d.ts +2 -0
- package/cjs/Insert/index.js +32 -0
- package/cjs/Tables/DataTable/DataTable.d.ts +14 -5
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +28 -0
- package/esm/Banner/Banner.d.ts +3 -0
- package/esm/Banner/Banner.js +12 -5
- package/esm/Banners/Alert/Alert.d.ts +69 -0
- package/esm/Banners/Alert/Alert.js +127 -0
- package/esm/Banners/Alert/index.d.ts +2 -0
- package/esm/Banners/Alert/index.js +2 -0
- package/esm/Banners/BigBertha/BigBertha.d.ts +40 -0
- package/esm/Banners/BigBertha/BigBertha.js +54 -0
- package/esm/Banners/BigBertha/index.d.ts +2 -0
- package/esm/Banners/BigBertha/index.js +2 -0
- package/esm/Banners/Promote/Promote.d.ts +56 -0
- package/esm/Banners/Promote/Promote.js +95 -0
- package/esm/Banners/Promote/index.d.ts +2 -0
- package/esm/Banners/Promote/index.js +2 -0
- package/esm/Banners/index.d.ts +3 -0
- package/esm/Banners/index.js +3 -0
- package/esm/Button/Button.tailwind.js +1 -1
- package/esm/Insert/Insert.d.ts +43 -0
- package/esm/Insert/Insert.js +66 -0
- package/esm/Insert/index.d.ts +2 -0
- package/esm/Insert/index.js +2 -0
- package/esm/Tables/DataTable/DataTable.d.ts +14 -5
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/package.json +1 -1
- package/satellite.css +1 -1
- package/satellite.min.css +1 -1
@@ -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 _Promote["default"];
|
13
|
+
}
|
14
|
+
});
|
15
|
+
|
16
|
+
var _Promote = _interopRequireWildcard(require("./Promote"));
|
17
|
+
|
18
|
+
Object.keys(_Promote).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] === _Promote[key]) return;
|
22
|
+
Object.defineProperty(exports, key, {
|
23
|
+
enumerable: true,
|
24
|
+
get: function get() {
|
25
|
+
return _Promote[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,44 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
|
7
|
+
var _Alert = require("./Alert");
|
8
|
+
|
9
|
+
Object.keys(_Alert).forEach(function (key) {
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
11
|
+
if (key in exports && exports[key] === _Alert[key]) return;
|
12
|
+
Object.defineProperty(exports, key, {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _Alert[key];
|
16
|
+
}
|
17
|
+
});
|
18
|
+
});
|
19
|
+
|
20
|
+
var _BigBertha = require("./BigBertha");
|
21
|
+
|
22
|
+
Object.keys(_BigBertha).forEach(function (key) {
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
24
|
+
if (key in exports && exports[key] === _BigBertha[key]) return;
|
25
|
+
Object.defineProperty(exports, key, {
|
26
|
+
enumerable: true,
|
27
|
+
get: function get() {
|
28
|
+
return _BigBertha[key];
|
29
|
+
}
|
30
|
+
});
|
31
|
+
});
|
32
|
+
|
33
|
+
var _Promote = require("./Promote");
|
34
|
+
|
35
|
+
Object.keys(_Promote).forEach(function (key) {
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
37
|
+
if (key in exports && exports[key] === _Promote[key]) return;
|
38
|
+
Object.defineProperty(exports, key, {
|
39
|
+
enumerable: true,
|
40
|
+
get: function get() {
|
41
|
+
return _Promote[key];
|
42
|
+
}
|
43
|
+
});
|
44
|
+
});
|
@@ -31,7 +31,7 @@ var buttonPlugin = function buttonPlugin(_ref) {
|
|
31
31
|
".btn-subtle": {
|
32
32
|
color: theme("colors.grey.600"),
|
33
33
|
"&:hover": {
|
34
|
-
background: theme("colors.grey.
|
34
|
+
background: rgba(theme("colors.grey.300"), 0.15)
|
35
35
|
},
|
36
36
|
"&:focus": {
|
37
37
|
boxShadow: "0 0 0 1px ".concat(theme("colors.accent.600"))
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import React, { FC } from "react";
|
2
|
+
import { BadgeVariants } from "../Badge";
|
3
|
+
declare type InsertContext = {
|
4
|
+
label: string;
|
5
|
+
variant?: BadgeVariants;
|
6
|
+
};
|
7
|
+
export interface InsertProps {
|
8
|
+
title: React.ReactNode;
|
9
|
+
contexts?: Array<string | InsertContext>;
|
10
|
+
}
|
11
|
+
/**
|
12
|
+
* Put more emphasis on side content.
|
13
|
+
|
14
|
+
* ## Examples
|
15
|
+
* [See the component in Figma](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components?node-id=2912%3A279499)
|
16
|
+
|
17
|
+
* ## Current Status
|
18
|
+
* - [x] Figma
|
19
|
+
* - [x] React
|
20
|
+
* - [ ] Documentation
|
21
|
+
|
22
|
+
* ## Component structure
|
23
|
+
* The component is a simple and flexible container. It should include a Title and a short text. To give more context you can use optional badges and an optional link to forward users in the right direction.
|
24
|
+
|
25
|
+
* ## Guidelines
|
26
|
+
|
27
|
+
* ### How to use it?
|
28
|
+
* Use the `Insert` if you want to give extra information to the user about the flow they are in or to highlight and define some terms used. This component can be use on the side of existing content or as a block.
|
29
|
+
|
30
|
+
* ### How to NOT use it?
|
31
|
+
* - Don't use this component to display temporary and/or critical information, use an Alert instead.
|
32
|
+
|
33
|
+
* ### Variants
|
34
|
+
* - Grey background
|
35
|
+
|
36
|
+
* ### Do's and Don't
|
37
|
+
* TODO
|
38
|
+
|
39
|
+
* ## Accessibility
|
40
|
+
* TODO
|
41
|
+
*/
|
42
|
+
export declare const Insert: FC<InsertProps>;
|
43
|
+
export default Insert;
|
@@ -0,0 +1,80 @@
|
|
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.Insert = void 0;
|
9
|
+
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
11
|
+
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
13
|
+
|
14
|
+
var _Badge = _interopRequireDefault(require("../Badge"));
|
15
|
+
|
16
|
+
var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
|
17
|
+
|
18
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
19
|
+
|
20
|
+
/**
|
21
|
+
* Put more emphasis on side content.
|
22
|
+
|
23
|
+
* ## Examples
|
24
|
+
* [See the component in Figma](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components?node-id=2912%3A279499)
|
25
|
+
|
26
|
+
* ## Current Status
|
27
|
+
* - [x] Figma
|
28
|
+
* - [x] React
|
29
|
+
* - [ ] Documentation
|
30
|
+
|
31
|
+
* ## Component structure
|
32
|
+
* The component is a simple and flexible container. It should include a Title and a short text. To give more context you can use optional badges and an optional link to forward users in the right direction.
|
33
|
+
|
34
|
+
* ## Guidelines
|
35
|
+
|
36
|
+
* ### How to use it?
|
37
|
+
* Use the `Insert` if you want to give extra information to the user about the flow they are in or to highlight and define some terms used. This component can be use on the side of existing content or as a block.
|
38
|
+
|
39
|
+
* ### How to NOT use it?
|
40
|
+
* - Don't use this component to display temporary and/or critical information, use an Alert instead.
|
41
|
+
|
42
|
+
* ### Variants
|
43
|
+
* - Grey background
|
44
|
+
|
45
|
+
* ### Do's and Don't
|
46
|
+
* TODO
|
47
|
+
|
48
|
+
* ## Accessibility
|
49
|
+
* TODO
|
50
|
+
*/
|
51
|
+
var Insert = function Insert(_ref) {
|
52
|
+
var title = _ref.title,
|
53
|
+
contexts = _ref.contexts,
|
54
|
+
children = _ref.children;
|
55
|
+
return /*#__PURE__*/_react["default"].createElement("aside", {
|
56
|
+
className: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["inline-flex flex-col self-start p-4 bg-grey-100 rounded"])))
|
57
|
+
}, contexts ? /*#__PURE__*/_react["default"].createElement("span", {
|
58
|
+
className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["block space-x-2 mb-4"])))
|
59
|
+
}, contexts.map(function (context, idx) {
|
60
|
+
var _ref2 = typeof context === "string" ? {
|
61
|
+
label: context
|
62
|
+
} : context,
|
63
|
+
label = _ref2.label,
|
64
|
+
_ref2$variant = _ref2.variant,
|
65
|
+
variant = _ref2$variant === void 0 ? "grey" : _ref2$variant;
|
66
|
+
|
67
|
+
return /*#__PURE__*/_react["default"].createElement(_Badge["default"], {
|
68
|
+
key: idx,
|
69
|
+
variant: variant
|
70
|
+
}, label);
|
71
|
+
})) : null, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
|
72
|
+
className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["display-heading mb-2"])))
|
73
|
+
}, title), /*#__PURE__*/_react["default"].createElement("span", {
|
74
|
+
className: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["display-body typo-subdued"])))
|
75
|
+
}, children)));
|
76
|
+
};
|
77
|
+
|
78
|
+
exports.Insert = Insert;
|
79
|
+
var _default = Insert;
|
80
|
+
exports["default"] = _default;
|
@@ -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 _Insert["default"];
|
13
|
+
}
|
14
|
+
});
|
15
|
+
|
16
|
+
var _Insert = _interopRequireWildcard(require("./Insert"));
|
17
|
+
|
18
|
+
Object.keys(_Insert).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] === _Insert[key]) return;
|
22
|
+
Object.defineProperty(exports, key, {
|
23
|
+
enumerable: true,
|
24
|
+
get: function get() {
|
25
|
+
return _Insert[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; }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import type { ColumnDefinition, Row, Status, SelectMode, PaginationConfiguration, Sorting, DataConfiguration, GetItemId } from "./types";
|
3
3
|
declare type CanSelectItem<Item> = (item: Item, idx: number) => boolean;
|
4
|
-
|
4
|
+
interface BaseDataTableProps<Item> {
|
5
5
|
data: Item[];
|
6
6
|
itemId?: GetItemId<Item>;
|
7
7
|
pagination?: PaginationConfiguration;
|
@@ -11,13 +11,22 @@ export interface DataTableProps<Item> {
|
|
11
11
|
noDataContent?: React.ReactNode;
|
12
12
|
errorContent?: React.ReactNode;
|
13
13
|
columns: ColumnDefinition<Item>[];
|
14
|
-
selectMode?: SelectMode;
|
15
|
-
selection?: string[];
|
16
|
-
onSelectionChange?(rowId: string[]): void;
|
17
|
-
canSelectItem?: CanSelectItem<Item>;
|
18
14
|
canHoverRow?(row: Row<Item>): boolean;
|
19
15
|
onRowHoveredChanged?(row: Row<Item> | null): void;
|
20
16
|
}
|
17
|
+
declare type DataTableWithSelectMode<Item> = {
|
18
|
+
selectMode: Exclude<SelectMode, "none">;
|
19
|
+
selection?: string[];
|
20
|
+
onSelectionChange?(rowId: string[]): void;
|
21
|
+
canSelectItem?: CanSelectItem<Item>;
|
22
|
+
};
|
23
|
+
declare type DataTableWithoutSelectMode = {
|
24
|
+
selectMode?: Extract<SelectMode, "none">;
|
25
|
+
selection?: never;
|
26
|
+
onSelectionChange?: never;
|
27
|
+
canSelectItem?: never;
|
28
|
+
};
|
29
|
+
export declare type DataTableProps<Item> = BaseDataTableProps<Item> & (DataTableWithSelectMode<Item> | DataTableWithoutSelectMode);
|
21
30
|
/**
|
22
31
|
* Tables are used to structure content in a grid to make it easier to see relationships and to facilitate understanding.
|
23
32
|
*
|
package/cjs/index.d.ts
CHANGED
@@ -9,6 +9,7 @@ export * from "./AutoComplete";
|
|
9
9
|
export * from "./Avatars";
|
10
10
|
export * from "./Badge";
|
11
11
|
export * from "./Banner";
|
12
|
+
export * from "./Banners";
|
12
13
|
export * from "./Button";
|
13
14
|
export * from "./Card";
|
14
15
|
export * from "./Checkbox";
|
@@ -21,6 +22,7 @@ export * from "./Flag";
|
|
21
22
|
export * from "./FlexGrid";
|
22
23
|
export * from "./HelpUnderline";
|
23
24
|
export * from "./Input";
|
25
|
+
export * from "./Insert";
|
24
26
|
export * from "./Link";
|
25
27
|
export * from "./Medallion";
|
26
28
|
export * from "./Modal";
|
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) {
|
@@ -310,6 +324,20 @@ Object.keys(_Input).forEach(function (key) {
|
|
310
324
|
});
|
311
325
|
});
|
312
326
|
|
327
|
+
var _Insert = require("./Insert");
|
328
|
+
|
329
|
+
Object.keys(_Insert).forEach(function (key) {
|
330
|
+
if (key === "default" || key === "__esModule") return;
|
331
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
332
|
+
if (key in exports && exports[key] === _Insert[key]) return;
|
333
|
+
Object.defineProperty(exports, key, {
|
334
|
+
enumerable: true,
|
335
|
+
get: function get() {
|
336
|
+
return _Insert[key];
|
337
|
+
}
|
338
|
+
});
|
339
|
+
});
|
340
|
+
|
313
341
|
var _Link = require("./Link");
|
314
342
|
|
315
343
|
Object.keys(_Link).forEach(function (key) {
|
package/esm/Banner/Banner.d.ts
CHANGED
@@ -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:
|
package/esm/Banner/Banner.js
CHANGED
@@ -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("
|
138
|
-
className: stl(_templateObject36 || (_templateObject36 = _taggedTemplateLiteral(["absolute top-
|
139
|
-
|
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,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;
|