@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.
Files changed (51) 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/Insert/Insert.d.ts +43 -0
  19. package/cjs/Insert/Insert.js +80 -0
  20. package/cjs/Insert/index.d.ts +2 -0
  21. package/cjs/Insert/index.js +32 -0
  22. package/cjs/Tables/DataTable/DataTable.d.ts +14 -5
  23. package/cjs/index.d.ts +2 -0
  24. package/cjs/index.js +28 -0
  25. package/esm/Banner/Banner.d.ts +3 -0
  26. package/esm/Banner/Banner.js +12 -5
  27. package/esm/Banners/Alert/Alert.d.ts +69 -0
  28. package/esm/Banners/Alert/Alert.js +127 -0
  29. package/esm/Banners/Alert/index.d.ts +2 -0
  30. package/esm/Banners/Alert/index.js +2 -0
  31. package/esm/Banners/BigBertha/BigBertha.d.ts +40 -0
  32. package/esm/Banners/BigBertha/BigBertha.js +54 -0
  33. package/esm/Banners/BigBertha/index.d.ts +2 -0
  34. package/esm/Banners/BigBertha/index.js +2 -0
  35. package/esm/Banners/Promote/Promote.d.ts +56 -0
  36. package/esm/Banners/Promote/Promote.js +95 -0
  37. package/esm/Banners/Promote/index.d.ts +2 -0
  38. package/esm/Banners/Promote/index.js +2 -0
  39. package/esm/Banners/index.d.ts +3 -0
  40. package/esm/Banners/index.js +3 -0
  41. package/esm/Button/Button.tailwind.js +1 -1
  42. package/esm/Insert/Insert.d.ts +43 -0
  43. package/esm/Insert/Insert.js +66 -0
  44. package/esm/Insert/index.d.ts +2 -0
  45. package/esm/Insert/index.js +2 -0
  46. package/esm/Tables/DataTable/DataTable.d.ts +14 -5
  47. package/esm/index.d.ts +2 -0
  48. package/esm/index.js +2 -0
  49. package/package.json +1 -1
  50. package/satellite.css +1 -1
  51. package/satellite.min.css +1 -1
@@ -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";
@@ -0,0 +1,2 @@
1
+ export * from "./Promote";
2
+ export { default } from "./Promote";
@@ -0,0 +1,3 @@
1
+ export * from "./Alert";
2
+ export * from "./BigBertha";
3
+ export * from "./Promote";
@@ -0,0 +1,3 @@
1
+ export * from "./Alert";
2
+ export * from "./BigBertha";
3
+ export * from "./Promote";
@@ -29,7 +29,7 @@ var buttonPlugin = function buttonPlugin(_ref) {
29
29
  ".btn-subtle": {
30
30
  color: theme("colors.grey.600"),
31
31
  "&:hover": {
32
- background: theme("colors.grey.100")
32
+ background: rgba(theme("colors.grey.300"), 0.15)
33
33
  },
34
34
  "&:focus": {
35
35
  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,66 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
4
+
5
+ import React from "react";
6
+ import Badge from "../Badge";
7
+ import stl from "../styles/helpers/satellitePrefixer";
8
+
9
+ /**
10
+ * Put more emphasis on side content.
11
+
12
+ * ## Examples
13
+ * [See the component in Figma](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components?node-id=2912%3A279499)
14
+
15
+ * ## Current Status
16
+ * - [x] Figma
17
+ * - [x] React
18
+ * - [ ] Documentation
19
+
20
+ * ## Component structure
21
+ * 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.
22
+
23
+ * ## Guidelines
24
+
25
+ * ### How to use it?
26
+ * 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.
27
+
28
+ * ### How to NOT use it?
29
+ * - Don't use this component to display temporary and/or critical information, use an Alert instead.
30
+
31
+ * ### Variants
32
+ * - Grey background
33
+
34
+ * ### Do's and Don't
35
+ * TODO
36
+
37
+ * ## Accessibility
38
+ * TODO
39
+ */
40
+ export var Insert = function Insert(_ref) {
41
+ var title = _ref.title,
42
+ contexts = _ref.contexts,
43
+ children = _ref.children;
44
+ return /*#__PURE__*/React.createElement("aside", {
45
+ className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["inline-flex flex-col self-start p-4 bg-grey-100 rounded"])))
46
+ }, contexts ? /*#__PURE__*/React.createElement("span", {
47
+ className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["block space-x-2 mb-4"])))
48
+ }, contexts.map(function (context, idx) {
49
+ var _ref2 = typeof context === "string" ? {
50
+ label: context
51
+ } : context,
52
+ label = _ref2.label,
53
+ _ref2$variant = _ref2.variant,
54
+ variant = _ref2$variant === void 0 ? "grey" : _ref2$variant;
55
+
56
+ return /*#__PURE__*/React.createElement(Badge, {
57
+ key: idx,
58
+ variant: variant
59
+ }, label);
60
+ })) : null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
61
+ className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["display-heading mb-2"])))
62
+ }, title), /*#__PURE__*/React.createElement("span", {
63
+ className: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["display-body typo-subdued"])))
64
+ }, children)));
65
+ };
66
+ export default Insert;
@@ -0,0 +1,2 @@
1
+ export * from "./Insert";
2
+ export { default } from "./Insert";
@@ -0,0 +1,2 @@
1
+ export * from "./Insert";
2
+ export { default } from "./Insert";
@@ -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
- export interface DataTableProps<Item> {
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/esm/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/esm/index.js 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/satellite",
3
- "version": "1.0.0-beta.125",
3
+ "version": "1.0.0-beta.126",
4
4
  "description": "Algolia design system React components",
5
5
  "scripts": {
6
6
  "clean": "del dist",
package/satellite.css CHANGED
@@ -1165,7 +1165,7 @@ html, body {
1165
1165
  }
1166
1166
 
1167
1167
  .stl-btn-subtle:hover {
1168
- background: #f5f5fa;
1168
+ background: rgba(182, 183, 213, 0.15);
1169
1169
  }
1170
1170
 
1171
1171
  .stl-btn-subtle:focus {