@ably/ui 12.0.0 → 13.0.0
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 +0 -1
- package/core/Showcase/component.js +1 -1
- package/core/Uptime/component.css +1 -2
- package/core/styles.css +6 -1
- package/package.json +2 -3
- package/src/core/Showcase/component.html.erb +2 -2
- package/src/core/Showcase/component.js +1 -1
- package/src/core/Uptime/component.css +1 -2
- package/src/core/styles/text.css +6 -1
- package/tailwind.config.js +17 -21
- package/tailwind.extend.js +1 -4
package/README.md
CHANGED
|
@@ -80,7 +80,6 @@ Currently, AblyUI CSS is built to work with TailwindCSS. To integrate it into yo
|
|
|
80
80
|
1. Add postCSS import with `npm install postcss-import`
|
|
81
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
82
|
1. Make sure you are installing v2 with `npm install -D tailwindcss@2.X`
|
|
83
|
-
1. Make sure that tailwindcss-filters is also set to v2 in your package.json: otherwise `npm install -D tailwindcss-filters@2.X`
|
|
84
83
|
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
84
|
4. Add the following to your `tailwind.config.js`. Note how different config properties are always extended by the `ablyUIConfig`:
|
|
86
85
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AblyUi=t():(e.AblyUi=e.AblyUi||{},e.AblyUi.Core=e.AblyUi.Core||{},e.AblyUi.Core.Showcase=t())}(this,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{default:()=>c});var n=function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("[data-id=".concat(e,"]"))};function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=function(e,t){var n=100*t*(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1);e.style.transform="translateX(".concat(n,"%)")},i=function(e){if("undefined"==typeof window)return!1;var t="".concat(e+64,"px");return!window.matchMedia("(min-width: ".concat(t,")")).matches};const c=function(e,t){var c=e||n("showcase"),u=Array.from(function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelectorAll("[data-id=".concat(e,"]"))}("showcase-control",c)),a=u.map((function(e){return e.querySelector("img")})),l=n("showcase-controls",c),f=n("showcase-index-bar",c),s=n("showcase-slides",c),d=s.children.length,m=("--ui-showcase-client-logo-min-width",window.getComputedStyle(document.documentElement).getPropertyValue("--ui-showcase-client-logo-min-width")),v=parseFloat(m)*parseFloat(getComputedStyle(document.documentElement).fontSize)*d;[".ui-showcase-logo-wrapper",".ui-showcase-index-bar"].forEach((function(e){var t=c.querySelector(e),n="".concat(v,"px");t.style.minWidth=n}));var p,h,
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AblyUi=t():(e.AblyUi=e.AblyUi||{},e.AblyUi.Core=e.AblyUi.Core||{},e.AblyUi.Core.Showcase=t())}(this,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{default:()=>c});var n=function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("[data-id=".concat(e,"]"))};function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=function(e,t){var n=100*t*(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1);e.style.transform="translateX(".concat(n,"%)")},i=function(e){if("undefined"==typeof window)return!1;var t="".concat(e+64,"px");return!window.matchMedia("(min-width: ".concat(t,")")).matches};const c=function(e,t){var c=e||n("showcase"),u=Array.from(function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelectorAll("[data-id=".concat(e,"]"))}("showcase-control",c)),a=u.map((function(e){return e.querySelector("img")})),l=n("showcase-controls",c),f=n("showcase-index-bar",c),s=n("showcase-slides",c),d=s.children.length,m=("--ui-showcase-client-logo-min-width",window.getComputedStyle(document.documentElement).getPropertyValue("--ui-showcase-client-logo-min-width")),v=parseFloat(m)*parseFloat(getComputedStyle(document.documentElement).fontSize)*d;[".ui-showcase-logo-wrapper",".ui-showcase-index-bar"].forEach((function(e){var t=c.querySelector(e),n="".concat(v,"px");t.style.minWidth=n}));var p,y,h,w=0,b=!1,g=function(e){o(s,e,-1),o(f,e,1),function(e,t){var n=["grayscale","grayscale-0"],o=[].concat(n).reverse();e.forEach((function(e,i){var c,u;(c=e.classList).replace.apply(c,function(e){if(Array.isArray(e))return r(e)}(u=i===t?n:o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(u)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}))}(a,e),i(v)&&function(e,t){var n=e.parentNode,r=e.children,o=n.clientWidth/2,i=r.length,c=Array.from(r).map((function(e){return e.clientWidth})).reduce((function(e,t){return e+t}))/i,u=t*c-((t&&i-t-1?o-c/2:0)>>0);n.scrollTo({left:u,behavior:"smooth"})}(l,e)},A=function e(){return p=setTimeout((function(){b||i(v)||(w=(w+1)%u.length,g(w),e())}),5e3)},E=function(){var e=function(){b=!0,clearTimeout(p)};return c.addEventListener("mouseover",e),function(){return c.removeEventListener("mouseover",e)}},S=function(){var e=function(){b=!1,A()};return c.addEventListener("mouseleave",e),function(){return c.removeEventListener("mouseleave",e)}},L=function(){var e=function(){clearTimeout(p),A()};return document.addEventListener("resize",e),function(){return document.removeEventListener("resize",e)}},j=(y=u.map((function(e,t){var n=function(e){return function(){g(w=e)}}(t);return e.addEventListener("click",n),n})),function(){y.forEach((function(e,t){return u[t].removeEventListener("click",e)}))}),x=(h=function(e){return e.preventDefault()},l.parentNode.addEventListener("wheel",h),function(){return l.parentNode.removeEventListener("wheel",h)}),U=function(){if(t){A(),c.setAttribute("aria-live","polite");var e=[E(),S(),L()];return function(){return e.forEach((function(e){return e()}))}}return function(){}}();return function(){g(0),clearTimeout(p),j(),U(),x()}};return t.default})()));
|
package/core/styles.css
CHANGED
|
@@ -583,10 +583,15 @@
|
|
|
583
583
|
|
|
584
584
|
.ui-link-neutral {
|
|
585
585
|
@apply hover:text-dark-grey active:text-cool-black disabled:text-gui-unavailable;
|
|
586
|
-
@apply focus:text-charcoal-grey
|
|
586
|
+
@apply focus:text-charcoal-grey;
|
|
587
587
|
@apply underline;
|
|
588
588
|
}
|
|
589
589
|
|
|
590
|
+
/* focus:outline-gui-focus-neutral does not get created under Tailwind 3.3.5, not sure why */
|
|
591
|
+
.ui-link-neutral:focus {
|
|
592
|
+
outline: 2px solid var(--color-neutral-000);
|
|
593
|
+
}
|
|
594
|
+
|
|
590
595
|
.ui-figcaption {
|
|
591
596
|
@apply font-mono text-p3 text-neutral-800;
|
|
592
597
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ably/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
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",
|
|
@@ -43,8 +43,7 @@
|
|
|
43
43
|
"postcss-loader": "^4.0.4",
|
|
44
44
|
"prettier": "^2.3.0",
|
|
45
45
|
"svg-spritemap-webpack-plugin": "^3.7.1",
|
|
46
|
-
"tailwindcss": "^
|
|
47
|
-
"tailwindcss-filters": "^3.0.0",
|
|
46
|
+
"tailwindcss": "^3.3.6",
|
|
48
47
|
"webpack": "^5.3.2",
|
|
49
48
|
"webpack-cli": "^4.2.0",
|
|
50
49
|
"yargs": "^16.2.0"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
type: 'button',
|
|
14
14
|
data: { id: 'showcase-control' },
|
|
15
15
|
aria: { controls: @random_id } do %>
|
|
16
|
-
<%= image_tag company[:logo], alt: "#{company[:name]} logo", class: ['ui-showcase-logo-img', index === 0 ? '
|
|
16
|
+
<%= image_tag company[:logo], alt: "#{company[:name]} logo", class: ['ui-showcase-logo-img', index === 0 ? 'grayscale-0' : 'grayscale', 'hover:grayscale-0'], srcset: [["#{company[:logo2x]}", "2x"]] %>
|
|
17
17
|
<% end %>
|
|
18
18
|
</li>
|
|
19
19
|
<% end %>
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
<div class="flex items-center">
|
|
42
42
|
<div class="flex-shrink-0 flex-grow-0 mr-16 overflow-hidden rounded-full flex align-center justify-center w-48 h-48">
|
|
43
|
-
<%= image_tag company[:author][:thumbnail], alt: "Picture of #{company[:author][:name]}, #{company[:author][:title]}", class: "w-48 h-48
|
|
43
|
+
<%= image_tag company[:author][:thumbnail], alt: "Picture of #{company[:author][:name]}, #{company[:author][:title]}", class: "w-48 h-48 grayscale" %>
|
|
44
44
|
</div>
|
|
45
45
|
<div>
|
|
46
46
|
<p class="ui-text-p2"><%= company[:author][:name] %></p>
|
|
@@ -6,7 +6,7 @@ import "./component.css";
|
|
|
6
6
|
const SLIDE_SHOW_INTERVAL = 5000;
|
|
7
7
|
|
|
8
8
|
const updateLogoOpacity = (logos, currentIndex) => {
|
|
9
|
-
const visible = ["
|
|
9
|
+
const visible = ["grayscale", "grayscale-0"];
|
|
10
10
|
const opaque = [...visible].reverse();
|
|
11
11
|
logos.forEach((logo, i) => {
|
|
12
12
|
logo.classList.replace(...(i === currentIndex ? visible : opaque));
|
package/src/core/styles/text.css
CHANGED
|
@@ -153,10 +153,15 @@
|
|
|
153
153
|
|
|
154
154
|
.ui-link-neutral {
|
|
155
155
|
@apply hover:text-dark-grey active:text-cool-black disabled:text-gui-unavailable;
|
|
156
|
-
@apply focus:text-charcoal-grey
|
|
156
|
+
@apply focus:text-charcoal-grey;
|
|
157
157
|
@apply underline;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
/* focus:outline-gui-focus-neutral does not get created under Tailwind 3.3.5, not sure why */
|
|
161
|
+
.ui-link-neutral:focus {
|
|
162
|
+
outline: 2px solid var(--color-neutral-000);
|
|
163
|
+
}
|
|
164
|
+
|
|
160
165
|
.ui-figcaption {
|
|
161
166
|
@apply font-mono text-p3 text-neutral-800;
|
|
162
167
|
}
|
package/tailwind.config.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
content: [
|
|
3
|
+
"./src/**/*.html.erb",
|
|
4
|
+
"./src/**/*.jsx",
|
|
5
|
+
"./src/**/*.js",
|
|
6
|
+
"./src/**/*.json",
|
|
7
|
+
"./src/**/*.css",
|
|
8
|
+
],
|
|
9
|
+
safelist: [
|
|
10
|
+
"w-1/2",
|
|
11
|
+
"w-1/3",
|
|
12
|
+
"w-1/4",
|
|
13
|
+
"w-1/5",
|
|
14
|
+
"w-1/6",
|
|
15
|
+
{ pattern: /^hljs.*/ },
|
|
16
|
+
{ pattern: /^ui-.*/ },
|
|
17
|
+
],
|
|
17
18
|
theme: {
|
|
18
19
|
screens: {
|
|
19
20
|
// CSS custom properties can't be used in media queries
|
|
@@ -299,10 +300,6 @@ module.exports = {
|
|
|
299
300
|
full: "9999px",
|
|
300
301
|
DEFAULT: "0.375rem",
|
|
301
302
|
},
|
|
302
|
-
filter: {
|
|
303
|
-
none: "none",
|
|
304
|
-
grayscale: "grayscale(1)",
|
|
305
|
-
},
|
|
306
303
|
extend: {
|
|
307
304
|
backgroundImage: {
|
|
308
305
|
"gradient-active-orange": "var(--gradient-active-orange)",
|
|
@@ -314,7 +311,6 @@ module.exports = {
|
|
|
314
311
|
},
|
|
315
312
|
outline: {
|
|
316
313
|
"gui-focus": "1.5px solid var(--color-gui-focus-outline)",
|
|
317
|
-
"gui-focus-neutral": "2px solid var(--color-neutral-000)",
|
|
318
314
|
},
|
|
319
315
|
width: {
|
|
320
316
|
"extend-8": "calc(100% + var(--spacing-8))",
|
|
@@ -360,5 +356,5 @@ module.exports = {
|
|
|
360
356
|
corePlugins: {
|
|
361
357
|
preflight: false,
|
|
362
358
|
},
|
|
363
|
-
plugins: [
|
|
359
|
+
plugins: [],
|
|
364
360
|
};
|
package/tailwind.extend.js
CHANGED
|
@@ -15,10 +15,7 @@ const ablyUItailwindConfig = (extend) => {
|
|
|
15
15
|
|
|
16
16
|
const configWithPlugin = {
|
|
17
17
|
...ablyUIConfig,
|
|
18
|
-
|
|
19
|
-
content: addPurgeContentPaths(),
|
|
20
|
-
options: ablyUIConfig.purge.options,
|
|
21
|
-
},
|
|
18
|
+
content: addPurgeContentPaths(),
|
|
22
19
|
};
|
|
23
20
|
|
|
24
21
|
return extend(configWithPlugin);
|