@ably/ui 7.8.2 → 7.8.4-dev.f992ca8

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/README.md CHANGED
@@ -73,8 +73,16 @@ import "@ably/ui/core/styles.css";
73
73
  Currently, AblyUI CSS is built to work with TailwindCSS. To integrate it into your app:
74
74
 
75
75
  1. Add AblyUI to your project
76
- 1. Add TailwindCSS to your project https://tailwindcss.com/docs/installation#installing-tailwind-css-as-a-post-css-plugin
77
- 1. Add the following to your `tailwind.config.js`. Note how different config properties are always extended by the `ablyUIConfig`:
76
+ 2. Add TailwindCSS to your project
77
+ 1. By project type:
78
+ 1. In [HTML](https://tailwindcss.com/docs/installation#installing-tailwind-css-as-a-post-css-plugin)
79
+ 2. In [Gatsby](https://tailwindcss.com/docs/guides/gatsby)
80
+ 1. Add postCSS import with `npm install postcss-import`
81
+ 1. Further to the instructions, if installation is hanging for over 5 minutes or otherwise problematic, try installing the libraries one at a time
82
+ 2. Make sure you are installing v2 with `npm install -D tailwindcss@2.X`
83
+ 3. Make sure that tailwindcss-filters is also set to v2 in your package.json: otherwise `npm install -D tailwindcss-filters@2.X`
84
+ 3. Make sure you are using the format `@import 'tailwindcss/base';...` in your `global.css` file rather than the `@tailwind/base` format from Tailwind v3
85
+ 4. Add the following to your `tailwind.config.js`. Note how different config properties are always extended by the `ablyUIConfig`:
78
86
 
79
87
  ```js
80
88
  const extendConfig = require("@ably/ui/tailwind.extend.js");
@@ -93,7 +101,7 @@ module.exports = extendConfig((ablyUIConfig) => ({
93
101
  }));
94
102
  ```
95
103
 
96
- 1. In the CSS file you added your tailwind declarations too, import the CSS for the modules and components you need:
104
+ 1. In the CSS file you added your tailwind declarations to, import the CSS for the modules and components you need:
97
105
 
98
106
  ```css
99
107
  @import "tailwindcss/base";
@@ -136,7 +144,7 @@ Note that this loads neither CSS nor JS — these need to still be loaded by a b
136
144
 
137
145
  ### Icons
138
146
 
139
- Putting SVG files inside and `src/MODULE_NAME/icons` folder will add them to a per-module sprites file that will be available at the root of the module (e.g., `core/sprites.svg`). This file can be loaded with the `loadSprites` helper available in the `core` module or include in the page directly.
147
+ Putting SVG files inside a`src/MODULE_NAME/icons` folder will add them to a per-module sprites file that will be available at the root of the module (e.g., `core/sprites.svg`). This file can be loaded with the `loadSprites` helper available in the `core` module or include in the page directly.
140
148
 
141
149
  Usage with the `Icon` React component:
142
150
 
package/core/Logo.jsx CHANGED
@@ -202,14 +202,57 @@ var __webpack_exports__ = {};
202
202
  // This entry need to be wrapped in an IIFE because it need to be in strict mode.
203
203
  (() => {
204
204
  "use strict";
205
+ // ESM COMPAT FLAG
205
206
  __webpack_require__.r(__webpack_exports__);
206
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
207
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
208
- /* harmony export */ });
209
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
210
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
211
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5697);
212
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
207
+
208
+ // EXPORTS
209
+ __webpack_require__.d(__webpack_exports__, {
210
+ "default": () => (/* binding */ component)
211
+ });
212
+
213
+ // EXTERNAL MODULE: external {"commonjs":"react","commonjs2":"react"}
214
+ var external_commonjs_react_commonjs2_react_ = __webpack_require__(9281);
215
+ var external_commonjs_react_commonjs2_react_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_react_commonjs2_react_);
216
+ // EXTERNAL MODULE: ./node_modules/prop-types/index.js
217
+ var prop_types = __webpack_require__(5697);
218
+ var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
219
+ ;// CONCATENATED MODULE: ./node_modules/nanoid/index.browser.js
220
+
221
+ let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))
222
+ let customRandom = (alphabet, defaultSize, getRandom) => {
223
+ let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1
224
+ let step = -~((1.6 * mask * defaultSize) / alphabet.length)
225
+ return (size = defaultSize) => {
226
+ let id = ''
227
+ while (true) {
228
+ let bytes = getRandom(step)
229
+ let j = step
230
+ while (j--) {
231
+ id += alphabet[bytes[j] & mask] || ''
232
+ if (id.length === size) return id
233
+ }
234
+ }
235
+ }
236
+ }
237
+ let customAlphabet = (alphabet, size = 21) =>
238
+ customRandom(alphabet, size, random)
239
+ let nanoid = (size = 21) =>
240
+ crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
241
+ byte &= 63
242
+ if (byte < 36) {
243
+ id += byte.toString(36)
244
+ } else if (byte < 62) {
245
+ id += (byte - 26).toString(36).toUpperCase()
246
+ } else if (byte > 62) {
247
+ id += '-'
248
+ } else {
249
+ id += '_'
250
+ }
251
+ return id
252
+ }, '')
253
+
254
+ ;// CONCATENATED MODULE: ./src/core/Logo/component.jsx
255
+
213
256
 
214
257
 
215
258
 
@@ -217,93 +260,88 @@ var Logo = function Logo(_ref) {
217
260
  var dataId = _ref.dataId,
218
261
  _ref$href = _ref.href,
219
262
  href = _ref$href === void 0 ? "/" : _ref$href;
220
-
221
263
  // This fixes a bug where if the logo is rendered more than once on the page, and one of the instances
222
264
  // if it is hidden, the other instance will not show the ably shape from the logo.
223
265
  // This is because the defs in this SVG reference ids that need to be unique ids. The browser discards the "newer"
224
266
  // linearGradients defined in the other logo, and inherits the `hidden` style from the first.
225
- var createID = function createID() {
226
- return "paint_gradient_".concat(Date.now());
227
- };
228
-
229
- var gradientIds = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
230
- return [createID(), createID()];
267
+ var gradientIds = (0,external_commonjs_react_commonjs2_react_.useMemo)(function () {
268
+ return [nanoid(), nanoid()];
231
269
  }, []);
232
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
270
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("a", {
233
271
  href: href,
234
272
  className: "h-32"
235
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
273
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("svg", {
236
274
  "data-id": dataId,
237
275
  className: "text-cool-black transition-colors",
238
276
  width: "108",
239
277
  height: "32",
240
278
  viewBox: "0 0 108 32",
241
279
  xmlns: "http://www.w3.org/2000/svg"
242
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
280
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("path", {
243
281
  d: "M62.922 24.9786V4.08813H66.6933V11.6512C67.9709 10.435 69.6164 9.76044 71.3538 9.76044C75.4318 9.76044 79.0498 12.8674 79.0498 17.5484C79.0498 22.2293 75.4318 25.3465 71.3538 25.3465C69.5244 25.3465 67.7971 24.6209 66.5094 23.3024V24.9786H62.922ZM75.2785 17.5484C75.2785 14.932 73.4183 13.1025 70.9859 13.1025C68.6148 13.1025 66.7853 14.84 66.6933 17.3644V17.5484C66.6933 20.1648 68.5534 21.9942 70.9859 21.9942C73.4183 21.9942 75.2785 20.1648 75.2785 17.5484ZM80.7975 24.9786V4.08813H84.5688V24.9786H80.7975ZM89.8425 30.3954L92.0399 25.1523L86.0712 10.1284H90.1491L93.9511 20.6247L97.8144 10.1284H101.954L93.8591 30.4056H89.8425V30.3954ZM56.9329 10.1284V12.0191C55.6247 10.5883 53.7952 9.77066 51.9147 9.77066C47.8367 9.77066 44.2187 12.8777 44.2187 17.5586C44.2187 22.2497 47.8367 25.3465 51.9147 25.3465C53.8668 25.3465 55.7166 24.4982 57.0555 22.9754V24.9888H60.3465V10.1284H56.9329ZM56.5649 17.5484C56.5649 20.1341 54.7048 21.9942 52.2724 21.9942C49.8399 21.9942 47.9798 20.1341 47.9798 17.5484C47.9798 14.9626 49.8399 13.1025 52.2724 13.1025C54.6435 13.1025 56.473 14.8706 56.5649 17.3644V17.5484Z",
244
282
  fill: "currentColor"
245
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
283
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("path", {
246
284
  d: "M19.2858 0L3.14788 29.5369L0 27.3293L14.932 0H19.2858ZM19.5107 0L35.6487 29.5369L38.7965 27.3293L23.8646 0H19.5107Z",
247
285
  fill: "url(#".concat(gradientIds[0], ")")
248
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
286
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("path", {
249
287
  d: "M35.4238 29.7107L19.3983 17.16L3.37271 29.7107L6.64323 32L19.3983 22.0147L32.1533 32L35.4238 29.7107Z",
250
288
  fill: "url(#".concat(gradientIds[1], ")")
251
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("linearGradient", {
289
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("defs", null, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("linearGradient", {
252
290
  id: gradientIds[0],
253
291
  x1: "5.47361",
254
292
  y1: "37.4219",
255
293
  x2: "32.4603",
256
294
  y2: "7.45023",
257
295
  gradientUnits: "userSpaceOnUse"
258
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
296
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
259
297
  stopColor: "#FF5416"
260
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
298
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
261
299
  offset: "0.2535",
262
300
  stopColor: "#FF5115"
263
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
301
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
264
302
  offset: "0.461",
265
303
  stopColor: "#FF4712"
266
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
304
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
267
305
  offset: "0.6523",
268
306
  stopColor: "#FF350E"
269
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
307
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
270
308
  offset: "0.8327",
271
309
  stopColor: "#FF1E08"
272
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
310
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
273
311
  offset: "1",
274
312
  stopColor: "#FF0000"
275
- })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("linearGradient", {
313
+ })), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("linearGradient", {
276
314
  id: gradientIds[1],
277
315
  x1: "10.7084",
278
316
  y1: "39.3593",
279
317
  x2: "26.6583",
280
318
  y2: "21.6452",
281
319
  gradientUnits: "userSpaceOnUse"
282
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
320
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
283
321
  stopColor: "#FF5416"
284
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
322
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
285
323
  offset: "0.2535",
286
324
  stopColor: "#FF5115"
287
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
325
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
288
326
  offset: "0.461",
289
327
  stopColor: "#FF4712"
290
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
328
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
291
329
  offset: "0.6523",
292
330
  stopColor: "#FF350E"
293
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
331
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
294
332
  offset: "0.8327",
295
333
  stopColor: "#FF1E08"
296
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
334
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
297
335
  offset: "1",
298
336
  stopColor: "#FF0000"
299
337
  })))));
300
338
  };
301
339
 
302
340
  Logo.propTypes = {
303
- dataId: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
304
- href: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
341
+ dataId: (prop_types_default()).string,
342
+ href: (prop_types_default()).string
305
343
  };
306
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(Logo));
344
+ /* harmony default export */ const component = (/*#__PURE__*/external_commonjs_react_commonjs2_react_default().memo(Logo));
307
345
  })();
308
346
 
309
347
  /******/ return __webpack_exports__;
package/core/Meganav.jsx CHANGED
@@ -463,17 +463,59 @@ Icon.propTypes = {
463
463
 
464
464
  /***/ }),
465
465
 
466
- /***/ 3774:
466
+ /***/ 3925:
467
467
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
468
468
 
469
469
  "use strict";
470
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
471
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
472
- /* harmony export */ });
473
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
474
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
475
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5697);
476
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
470
+
471
+ // EXPORTS
472
+ __webpack_require__.d(__webpack_exports__, {
473
+ "default": () => (/* binding */ component)
474
+ });
475
+
476
+ // EXTERNAL MODULE: external {"commonjs":"react","commonjs2":"react"}
477
+ var external_commonjs_react_commonjs2_react_ = __webpack_require__(9281);
478
+ var external_commonjs_react_commonjs2_react_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_react_commonjs2_react_);
479
+ // EXTERNAL MODULE: ./node_modules/prop-types/index.js
480
+ var prop_types = __webpack_require__(5697);
481
+ var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
482
+ ;// CONCATENATED MODULE: ./node_modules/nanoid/index.browser.js
483
+
484
+ let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))
485
+ let customRandom = (alphabet, defaultSize, getRandom) => {
486
+ let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1
487
+ let step = -~((1.6 * mask * defaultSize) / alphabet.length)
488
+ return (size = defaultSize) => {
489
+ let id = ''
490
+ while (true) {
491
+ let bytes = getRandom(step)
492
+ let j = step
493
+ while (j--) {
494
+ id += alphabet[bytes[j] & mask] || ''
495
+ if (id.length === size) return id
496
+ }
497
+ }
498
+ }
499
+ }
500
+ let customAlphabet = (alphabet, size = 21) =>
501
+ customRandom(alphabet, size, random)
502
+ let nanoid = (size = 21) =>
503
+ crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
504
+ byte &= 63
505
+ if (byte < 36) {
506
+ id += byte.toString(36)
507
+ } else if (byte < 62) {
508
+ id += (byte - 26).toString(36).toUpperCase()
509
+ } else if (byte > 62) {
510
+ id += '-'
511
+ } else {
512
+ id += '_'
513
+ }
514
+ return id
515
+ }, '')
516
+
517
+ ;// CONCATENATED MODULE: ./src/core/Logo/component.jsx
518
+
477
519
 
478
520
 
479
521
 
@@ -481,93 +523,88 @@ var Logo = function Logo(_ref) {
481
523
  var dataId = _ref.dataId,
482
524
  _ref$href = _ref.href,
483
525
  href = _ref$href === void 0 ? "/" : _ref$href;
484
-
485
526
  // This fixes a bug where if the logo is rendered more than once on the page, and one of the instances
486
527
  // if it is hidden, the other instance will not show the ably shape from the logo.
487
528
  // This is because the defs in this SVG reference ids that need to be unique ids. The browser discards the "newer"
488
529
  // linearGradients defined in the other logo, and inherits the `hidden` style from the first.
489
- var createID = function createID() {
490
- return "paint_gradient_".concat(Date.now());
491
- };
492
-
493
- var gradientIds = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
494
- return [createID(), createID()];
530
+ var gradientIds = (0,external_commonjs_react_commonjs2_react_.useMemo)(function () {
531
+ return [nanoid(), nanoid()];
495
532
  }, []);
496
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
533
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("a", {
497
534
  href: href,
498
535
  className: "h-32"
499
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
536
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("svg", {
500
537
  "data-id": dataId,
501
538
  className: "text-cool-black transition-colors",
502
539
  width: "108",
503
540
  height: "32",
504
541
  viewBox: "0 0 108 32",
505
542
  xmlns: "http://www.w3.org/2000/svg"
506
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
543
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("path", {
507
544
  d: "M62.922 24.9786V4.08813H66.6933V11.6512C67.9709 10.435 69.6164 9.76044 71.3538 9.76044C75.4318 9.76044 79.0498 12.8674 79.0498 17.5484C79.0498 22.2293 75.4318 25.3465 71.3538 25.3465C69.5244 25.3465 67.7971 24.6209 66.5094 23.3024V24.9786H62.922ZM75.2785 17.5484C75.2785 14.932 73.4183 13.1025 70.9859 13.1025C68.6148 13.1025 66.7853 14.84 66.6933 17.3644V17.5484C66.6933 20.1648 68.5534 21.9942 70.9859 21.9942C73.4183 21.9942 75.2785 20.1648 75.2785 17.5484ZM80.7975 24.9786V4.08813H84.5688V24.9786H80.7975ZM89.8425 30.3954L92.0399 25.1523L86.0712 10.1284H90.1491L93.9511 20.6247L97.8144 10.1284H101.954L93.8591 30.4056H89.8425V30.3954ZM56.9329 10.1284V12.0191C55.6247 10.5883 53.7952 9.77066 51.9147 9.77066C47.8367 9.77066 44.2187 12.8777 44.2187 17.5586C44.2187 22.2497 47.8367 25.3465 51.9147 25.3465C53.8668 25.3465 55.7166 24.4982 57.0555 22.9754V24.9888H60.3465V10.1284H56.9329ZM56.5649 17.5484C56.5649 20.1341 54.7048 21.9942 52.2724 21.9942C49.8399 21.9942 47.9798 20.1341 47.9798 17.5484C47.9798 14.9626 49.8399 13.1025 52.2724 13.1025C54.6435 13.1025 56.473 14.8706 56.5649 17.3644V17.5484Z",
508
545
  fill: "currentColor"
509
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
546
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("path", {
510
547
  d: "M19.2858 0L3.14788 29.5369L0 27.3293L14.932 0H19.2858ZM19.5107 0L35.6487 29.5369L38.7965 27.3293L23.8646 0H19.5107Z",
511
548
  fill: "url(#".concat(gradientIds[0], ")")
512
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
549
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("path", {
513
550
  d: "M35.4238 29.7107L19.3983 17.16L3.37271 29.7107L6.64323 32L19.3983 22.0147L32.1533 32L35.4238 29.7107Z",
514
551
  fill: "url(#".concat(gradientIds[1], ")")
515
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("linearGradient", {
552
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("defs", null, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("linearGradient", {
516
553
  id: gradientIds[0],
517
554
  x1: "5.47361",
518
555
  y1: "37.4219",
519
556
  x2: "32.4603",
520
557
  y2: "7.45023",
521
558
  gradientUnits: "userSpaceOnUse"
522
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
559
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
523
560
  stopColor: "#FF5416"
524
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
561
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
525
562
  offset: "0.2535",
526
563
  stopColor: "#FF5115"
527
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
564
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
528
565
  offset: "0.461",
529
566
  stopColor: "#FF4712"
530
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
567
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
531
568
  offset: "0.6523",
532
569
  stopColor: "#FF350E"
533
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
570
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
534
571
  offset: "0.8327",
535
572
  stopColor: "#FF1E08"
536
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
573
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
537
574
  offset: "1",
538
575
  stopColor: "#FF0000"
539
- })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("linearGradient", {
576
+ })), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("linearGradient", {
540
577
  id: gradientIds[1],
541
578
  x1: "10.7084",
542
579
  y1: "39.3593",
543
580
  x2: "26.6583",
544
581
  y2: "21.6452",
545
582
  gradientUnits: "userSpaceOnUse"
546
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
583
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
547
584
  stopColor: "#FF5416"
548
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
585
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
549
586
  offset: "0.2535",
550
587
  stopColor: "#FF5115"
551
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
588
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
552
589
  offset: "0.461",
553
590
  stopColor: "#FF4712"
554
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
591
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
555
592
  offset: "0.6523",
556
593
  stopColor: "#FF350E"
557
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
594
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
558
595
  offset: "0.8327",
559
596
  stopColor: "#FF1E08"
560
- }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("stop", {
597
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("stop", {
561
598
  offset: "1",
562
599
  stopColor: "#FF0000"
563
600
  })))));
564
601
  };
565
602
 
566
603
  Logo.propTypes = {
567
- dataId: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
568
- href: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
604
+ dataId: (prop_types_default()).string,
605
+ href: (prop_types_default()).string
569
606
  };
570
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(Logo));
607
+ /* harmony default export */ const component = (/*#__PURE__*/external_commonjs_react_commonjs2_react_default().memo(Logo));
571
608
 
572
609
  /***/ }),
573
610
 
@@ -5961,8 +5998,8 @@ var selectSessionData = function selectSessionData(store) {
5961
5998
  };
5962
5999
 
5963
6000
 
5964
- // EXTERNAL MODULE: ./src/core/Logo/component.jsx
5965
- var component = __webpack_require__(3774);
6001
+ // EXTERNAL MODULE: ./src/core/Logo/component.jsx + 1 modules
6002
+ var component = __webpack_require__(3925);
5966
6003
  // EXTERNAL MODULE: ./node_modules/lodash.throttle/index.js
5967
6004
  var lodash_throttle = __webpack_require__(3096);
5968
6005
  var lodash_throttle_default = /*#__PURE__*/__webpack_require__.n(lodash_throttle);
Binary file
@@ -0,0 +1,3 @@
1
+ @layer base {
2
+ @import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@600&display=swap");
3
+ }
Binary file
package/core/styles.css CHANGED
@@ -15,9 +15,10 @@
15
15
  --color-charcoal-grey: #292831;
16
16
  --color-gui-default: #0073e6;
17
17
  --color-gui-hover: #0867c4;
18
- --color-gui-focus: #80b9f2;
18
+ --color-gui-focus: #0073e6;
19
+ --color-gui-focus-outline: #80b9f2;
19
20
  --color-gui-active: #074095;
20
- --color-gui-viewed: #4887c2;
21
+ --color-gui-visited: #4887c2;
21
22
  --color-gui-unavailable: #a8a8a8;
22
23
  --color-gui-error: #fb0c0c;
23
24
  --color-gui-success: #11cb24;
@@ -155,7 +156,7 @@
155
156
  /* In components, when looking at implementing viewport margin and spacing between elements,
156
157
  the values in the comments can be used as guide as they represent the grid the elements (should) sit on.
157
158
  alternatively, look for ui-grid-* helpers. */
158
- --bp-xs: 375px; /* gutters 8px, side-margin 24px */
159
+ --bp-xs: 428px; /* gutters 8px, side-margin 24px */
159
160
  --bp-sm: 768px; /* gutters 16px, side-margin 32px */
160
161
  --bp-md: 1040px; /* gutters 24px, side-margin 40px, meganav desktop */
161
162
  --bp-lg: 1280px; /* gutters 24px, side-margin 64px */
@@ -343,17 +344,17 @@
343
344
  }
344
345
 
345
346
  .ui-text-p1 {
346
- @apply font-sans font-light text-cool-black;
347
+ @apply font-sans font-light text-charcoal-grey;
347
348
  @apply text-p1;
348
349
  }
349
350
 
350
351
  .ui-text-p2 {
351
- @apply font-sans font-light text-cool-black;
352
+ @apply font-sans font-light text-charcoal-grey;
352
353
  @apply text-p2;
353
354
  }
354
355
 
355
356
  .ui-text-p3 {
356
- @apply font-sans font-light text-cool-black;
357
+ @apply font-sans font-light text-charcoal-grey;
357
358
  @apply text-p3;
358
359
  }
359
360
 
@@ -459,24 +460,18 @@
459
460
  @apply list-square;
460
461
  }
461
462
 
462
- /* visited needs to come before :hover et all else it overrides them */
463
- .ui-link:visited {
464
- @apply text-gui-viewed;
463
+ .ui-link {
464
+ @apply visited:text-gui-visited;
465
+ @apply hover:text-gui-hover active:text-gui-active disabled:text-gui-unavailable;
466
+ @apply focus:text-gui-focus focus:outline-gui-focus;
467
+ @apply underline;
465
468
  }
466
469
 
467
- .ui-link {
468
- @apply hover:text-active-orange active:text-red-orange;
469
- -webkit-text-decoration-color: var(--color-active-orange);
470
- text-decoration-color: var(--color-active-orange);
471
- text-underline-offset: 4px; /* px used here as behaves weird with rem's */
472
- -webkit-text-decoration-line: underline;
473
- text-decoration-line: underline;
474
- text-decoration-thickness: 0.125rem;
475
- }
476
-
477
- .ui-link:focus {
478
- @apply focus:text-white focus:bg-active-orange focus:outline-none;
479
- text-decoration: none;
470
+ .ui-link-neutral {
471
+ @apply visited:text-dark-grey;
472
+ @apply hover:text-dark-grey active:text-cool-black disabled:text-gui-unavailable;
473
+ @apply focus:text-gui-focus focus:outline-gui-focus-neutral;
474
+ @apply underline;
480
475
  }
481
476
  }
482
477
  @layer components {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ably/ui",
3
- "version": "7.8.2",
3
+ "version": "7.8.4-dev.f992ca8",
4
4
  "description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -70,6 +70,7 @@
70
70
  "js-cookie": "^2.2.1",
71
71
  "lodash.debounce": "^4.0.8",
72
72
  "lodash.throttle": "^4.1.1",
73
+ "nanoid": "^4.0.0",
73
74
  "react": "^17.0.1",
74
75
  "react-dom": "^17.0.1",
75
76
  "redux": "^4.0.5",
package/src/.DS_Store ADDED
Binary file
Binary file
@@ -1,6 +1,4 @@
1
- @layer base {
2
- @import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@600&display=swap");
3
- }
1
+ @import "../fonts/source-code-pro.css";
4
2
 
5
3
  @layer components {
6
4
  .hljs {
@@ -1,5 +1,6 @@
1
1
  import React, { useMemo } from "react";
2
2
  import T from "prop-types";
3
+ import { nanoid } from "nanoid";
3
4
 
4
5
  const Logo = ({ dataId, href = "/" }) => {
5
6
  // This fixes a bug where if the logo is rendered more than once on the page, and one of the instances
@@ -7,8 +8,7 @@ const Logo = ({ dataId, href = "/" }) => {
7
8
 
8
9
  // This is because the defs in this SVG reference ids that need to be unique ids. The browser discards the "newer"
9
10
  // linearGradients defined in the other logo, and inherits the `hidden` style from the first.
10
- const createID = () => `paint_gradient_${Date.now()}`;
11
- const gradientIds = useMemo(() => [createID(), createID()], []);
11
+ const gradientIds = useMemo(() => [nanoid(), nanoid()], []);
12
12
 
13
13
  return (
14
14
  <a href={href} className="h-32">
Binary file
@@ -0,0 +1,3 @@
1
+ @layer base {
2
+ @import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@600&display=swap");
3
+ }
Binary file
@@ -15,9 +15,10 @@
15
15
  --color-charcoal-grey: #292831;
16
16
  --color-gui-default: #0073e6;
17
17
  --color-gui-hover: #0867c4;
18
- --color-gui-focus: #80b9f2;
18
+ --color-gui-focus: #0073e6;
19
+ --color-gui-focus-outline: #80b9f2;
19
20
  --color-gui-active: #074095;
20
- --color-gui-viewed: #4887c2;
21
+ --color-gui-visited: #4887c2;
21
22
  --color-gui-unavailable: #a8a8a8;
22
23
  --color-gui-error: #fb0c0c;
23
24
  --color-gui-success: #11cb24;
@@ -155,7 +156,7 @@
155
156
  /* In components, when looking at implementing viewport margin and spacing between elements,
156
157
  the values in the comments can be used as guide as they represent the grid the elements (should) sit on.
157
158
  alternatively, look for ui-grid-* helpers. */
158
- --bp-xs: 375px; /* gutters 8px, side-margin 24px */
159
+ --bp-xs: 428px; /* gutters 8px, side-margin 24px */
159
160
  --bp-sm: 768px; /* gutters 16px, side-margin 32px */
160
161
  --bp-md: 1040px; /* gutters 24px, side-margin 40px, meganav desktop */
161
162
  --bp-lg: 1280px; /* gutters 24px, side-margin 64px */
@@ -30,17 +30,17 @@
30
30
  }
31
31
 
32
32
  .ui-text-p1 {
33
- @apply font-sans font-light text-cool-black;
33
+ @apply font-sans font-light text-charcoal-grey;
34
34
  @apply text-p1;
35
35
  }
36
36
 
37
37
  .ui-text-p2 {
38
- @apply font-sans font-light text-cool-black;
38
+ @apply font-sans font-light text-charcoal-grey;
39
39
  @apply text-p2;
40
40
  }
41
41
 
42
42
  .ui-text-p3 {
43
- @apply font-sans font-light text-cool-black;
43
+ @apply font-sans font-light text-charcoal-grey;
44
44
  @apply text-p3;
45
45
  }
46
46
 
@@ -146,21 +146,17 @@
146
146
  @apply list-square;
147
147
  }
148
148
 
149
- /* visited needs to come before :hover et all else it overrides them */
150
- .ui-link:visited {
151
- @apply text-gui-viewed;
152
- }
153
-
154
149
  .ui-link {
155
- @apply hover:text-active-orange active:text-red-orange;
156
- text-decoration-color: var(--color-active-orange);
157
- text-underline-offset: 4px; /* px used here as behaves weird with rem's */
158
- text-decoration-line: underline;
159
- text-decoration-thickness: 0.125rem;
150
+ @apply visited:text-gui-visited;
151
+ @apply hover:text-gui-hover active:text-gui-active disabled:text-gui-unavailable;
152
+ @apply focus:text-gui-focus focus:outline-gui-focus;
153
+ @apply underline;
160
154
  }
161
155
 
162
- .ui-link:focus {
163
- @apply focus:text-white focus:bg-active-orange focus:outline-none;
164
- text-decoration: none;
156
+ .ui-link-neutral {
157
+ @apply visited:text-dark-grey;
158
+ @apply hover:text-dark-grey active:text-cool-black disabled:text-gui-unavailable;
159
+ @apply focus:text-gui-focus focus:outline-gui-focus-neutral;
160
+ @apply underline;
165
161
  }
166
162
  }
Binary file
@@ -17,7 +17,7 @@ module.exports = {
17
17
  theme: {
18
18
  screens: {
19
19
  // CSS custom properties can't be used in media queries
20
- xs: "375px",
20
+ xs: "428px",
21
21
  sm: "768px",
22
22
  md: "1040px",
23
23
  lg: "1280px",
@@ -74,7 +74,7 @@ module.exports = {
74
74
  "gui-hover": "var(--color-gui-hover)",
75
75
  "gui-focus": "var(--color-gui-focus)",
76
76
  "gui-active": "var(--color-gui-active)",
77
- "gui-viewed": "var(--color-gui-viewed)",
77
+ "gui-visited": "var(--color-gui-visited)",
78
78
  "gui-unavailable": "var(--color-gui-unavailable)",
79
79
  "gui-error": "var(--color-gui-error)",
80
80
  "gui-success": "var(--color-gui-success)",
@@ -181,7 +181,8 @@ module.exports = {
181
181
  filter: "filter",
182
182
  },
183
183
  outline: {
184
- "gui-focus": "4px solid var(--color-gui-focus)",
184
+ "gui-focus": "1.5px solid var(--color-gui-focus-outline)",
185
+ "gui-focus-neutral": "2px solid var(--color-white)",
185
186
  },
186
187
  width: {
187
188
  "extend-8": "calc(100% + var(--spacing-8))",
@@ -208,7 +209,14 @@ module.exports = {
208
209
  variants: {
209
210
  extend: {
210
211
  borderColor: ["hover", "focus", "active", "group-focus", "disabled"],
211
- textColor: ["hover", "focus", "active", "group-focus", "disabled"],
212
+ textColor: [
213
+ "hover",
214
+ "focus",
215
+ "active",
216
+ "group-focus",
217
+ "disabled",
218
+ "visited",
219
+ ],
212
220
  display: ["group-focus"],
213
221
  backgroundColor: ["hover", "focus", "active", "group-focus", "disabled"],
214
222
  backgroundImage: ["hover", "active", "focus"],