@squiz/resource-browser 3.1.0-rc.0 → 3.1.0-rc.2
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/CHANGELOG.md +16 -0
- package/lib/MainContainer/MainContainer.js +1 -1
- package/lib/ResourceBrowserInlineButton/InlineLoadingErrorState/InlineLoadingErrorState.js +4 -4
- package/lib/ResourceLauncher/ResourceLauncher.js +1 -1
- package/lib/SourceDropdown/SourceDropdown.js +1 -1
- package/lib/index.css +0 -10
- package/package.json +3 -4
- package/src/MainContainer/MainContainer.spec.tsx +10 -1
- package/src/MainContainer/MainContainer.tsx +1 -1
- package/src/ResourceBrowserInlineButton/InlineLoadingErrorState/InlineLoadingErrorState.tsx +5 -14
- package/src/ResourceLauncher/ResourceLauncher.tsx +1 -1
- package/src/SourceDropdown/SourceDropdown.tsx +1 -1
- package/LICENSE.md +0 -15
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 3.1.0-rc.2
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 1cfe0fe: Updated title for modal to be sentence case when displayed
|
8
|
+
- f28383e: Changed background colour of hovered source on source selector
|
9
|
+
|
10
|
+
## 3.1.0-rc.1
|
11
|
+
|
12
|
+
### Patch Changes
|
13
|
+
|
14
|
+
- Updated modal to use sds button, removed scroll bar from search panel
|
15
|
+
- ce9ae92: Version control via changesets added
|
16
|
+
- Updated dependencies [ce9ae92]
|
17
|
+
- @squiz/resource-browser-ui-lib@1.0.0-rc.8
|
18
|
+
|
3
19
|
All notable changes to this project will be documented in this file.
|
4
20
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
21
|
|
@@ -46,7 +46,7 @@ function MainContainer({ title, titleAriaProps, allowedTypes, sources, selectedS
|
|
46
46
|
// MainContainer will either render the source list view if no source is set or the plugins UI if a source has been selected
|
47
47
|
return (react_1.default.createElement("div", { className: "relative flex flex-col h-full text-gray-800" },
|
48
48
|
react_1.default.createElement("div", { className: "flex items-center py-3 pl-6 pr-10 min-h-[68px]" },
|
49
|
-
react_1.default.createElement("h2", { ...titleAriaProps, className: "text-xl leading-6 text-gray-800 font-semibold mr-6" }, title),
|
49
|
+
react_1.default.createElement("h2", { ...titleAriaProps, className: "text-xl leading-6 text-gray-800 font-semibold mr-6" }, title?.charAt(0).toUpperCase() + title?.slice(1).toLowerCase()),
|
50
50
|
plugin && selectedSource && (react_1.default.createElement(react_1.default.Fragment, null,
|
51
51
|
plugin.createHeaderPortal && react_1.default.createElement("div", { ref: setHeaderPortalRef, className: "squiz-rb-plugin" }),
|
52
52
|
!plugin.createHeaderPortal && sources.length > 1 && (react_1.default.createElement(SourceDropdownContainer_1.default, { isCollapsed: false, onExpand: () => { } },
|
@@ -10,10 +10,10 @@ const sds_1 = require("@squiz/sds");
|
|
10
10
|
const InlineLoadingErrorState = ({ title, titleAriaProps, onClose, onRetry, isLoading, error }) => {
|
11
11
|
return (react_1.default.createElement("div", { className: "relative flex flex-col h-full text-gray-800" },
|
12
12
|
react_1.default.createElement("div", { className: "flex items-center py-3 pl-6 pr-10 min-h-[68px]" },
|
13
|
-
react_1.default.createElement("h2", { ...titleAriaProps, className: "text-xl leading-6 text-gray-800 font-semibold mr-6" }, title),
|
14
|
-
react_1.default.createElement("button", {
|
15
|
-
react_1.default.createElement("
|
16
|
-
|
13
|
+
react_1.default.createElement("h2", { ...titleAriaProps, className: "text-xl leading-6 text-gray-800 font-semibold mr-6" }, title?.charAt(0).toUpperCase() + title?.slice(1).toLowerCase()),
|
14
|
+
react_1.default.createElement("button", { className: "sds-dialog__close", "aria-label": `Close ${title} dialog`, onClick: onClose, tabIndex: 0 },
|
15
|
+
react_1.default.createElement("span", { className: "sr-only" }, `Close ${title} dialog`),
|
16
|
+
react_1.default.createElement(sds_1.SdsIcon, { svg: sds_1.ICON_CLOSE }))),
|
17
17
|
react_1.default.createElement("div", { className: "border-t border-gray-300 overflow-y-hidden" },
|
18
18
|
react_1.default.createElement("div", { className: "w-screen max-w-[400px] min-h-[320px] flex-1 grow-[3] border-r border-gray-300 bg-gray-100 pl-6 pr-6 pb-6 pt-4 flex justify-center items-center text-gray-500" },
|
19
19
|
isLoading && react_1.default.createElement(sds_1.Spinner, { type: "lg" }),
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
7
7
|
const types_1 = require("../types");
|
8
8
|
function ResourceLauncher({ sources, onSourceSelect }) {
|
9
|
-
return (react_1.default.createElement("div", { className: "overflow-y-
|
9
|
+
return (react_1.default.createElement("div", { className: "overflow-y-auto w-screen max-w-[400px] min-h-[290px] flex-1 grow-[3] border-r border-gray-300 bg-gray-100 pl-6 pr-6 pb-6 pt-4" },
|
10
10
|
react_1.default.createElement("ul", { tabIndex: -1, "aria-label": `sources list`, className: "flex flex-col bg-gray-100 min-h-full focus-visible:outline-0" }, sources.map((source, index) => {
|
11
11
|
const SourceLauncher = source.plugin.renderResourceLauncher();
|
12
12
|
return (react_1.default.createElement("li", { key: index, className: "flex items-stretch relative" },
|
@@ -55,7 +55,7 @@ function SourceDropdown({ sources, selectedSource, onSourceSelect, }) {
|
|
55
55
|
return react_1.default.createElement(react_1.default.Fragment, null);
|
56
56
|
}
|
57
57
|
return (react_1.default.createElement("div", { ...focusWithinProps, ...keyboardProps, className: "relative w-full " },
|
58
|
-
react_1.default.createElement("button", { ref: buttonRef, type: "button", "aria-label": "Source quick select", "aria-expanded": isOpen, "aria-controls": `${uniqueId}-button-menu`, onClick: () => setIsOpen(!isOpen), className: "relative flex items-center p-2 w-full rounded bg-blue-100
|
58
|
+
react_1.default.createElement("button", { ref: buttonRef, type: "button", "aria-label": "Source quick select", "aria-expanded": isOpen, "aria-controls": `${uniqueId}-button-menu`, onClick: () => setIsOpen(!isOpen), className: "relative flex items-center p-2 w-full rounded bg-blue-100" },
|
59
59
|
react_1.default.createElement("span", { className: "sr-only" }, "current source "),
|
60
60
|
react_1.default.createElement("div", { className: "truncate max-w-[200px] text-md font-semibold text-blue-400" }, selectedSource.name),
|
61
61
|
react_1.default.createElement(ArrowDownIcon_1.ArrowDownIcon, { "aria-hidden": true, className: "absolute right-2 fill-blue-300" })),
|
package/lib/index.css
CHANGED
@@ -4844,9 +4844,6 @@
|
|
4844
4844
|
.squiz-rb-scope .top-0:not(.squiz-rb-plugin *) {
|
4845
4845
|
top: 0px;
|
4846
4846
|
}
|
4847
|
-
.squiz-rb-scope .top-2:not(.squiz-rb-plugin *) {
|
4848
|
-
top: 0.5rem;
|
4849
|
-
}
|
4850
4847
|
.squiz-rb-scope .top-3:not(.squiz-rb-plugin *) {
|
4851
4848
|
top: 0.75rem;
|
4852
4849
|
}
|
@@ -5307,9 +5304,6 @@
|
|
5307
5304
|
.squiz-rb-scope .p-2:not(.squiz-rb-plugin *) {
|
5308
5305
|
padding: 0.5rem;
|
5309
5306
|
}
|
5310
|
-
.squiz-rb-scope .p-2\.5:not(.squiz-rb-plugin *) {
|
5311
|
-
padding: 0.625rem;
|
5312
|
-
}
|
5313
5307
|
.squiz-rb-scope .p-3:not(.squiz-rb-plugin *) {
|
5314
5308
|
padding: 0.75rem;
|
5315
5309
|
}
|
@@ -6324,10 +6318,6 @@
|
|
6324
6318
|
--tw-bg-opacity: 1;
|
6325
6319
|
background-color: rgb(230 241 250 / var(--tw-bg-opacity));
|
6326
6320
|
}
|
6327
|
-
.squiz-rb-scope .hover\:bg-blue-150:hover:not(.squiz-rb-plugin *) {
|
6328
|
-
--tw-bg-opacity: 1;
|
6329
|
-
background-color: rgb(199 223 245 / var(--tw-bg-opacity));
|
6330
|
-
}
|
6331
6321
|
.squiz-rb-scope .hover\:bg-gray-100:hover:not(.squiz-rb-plugin *) {
|
6332
6322
|
--tw-bg-opacity: 1;
|
6333
6323
|
background-color: rgb(245 245 245 / var(--tw-bg-opacity));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@squiz/resource-browser",
|
3
|
-
"version": "3.1.0-rc.
|
3
|
+
"version": "3.1.0-rc.2",
|
4
4
|
"main": "lib/index.js",
|
5
5
|
"types": "lib/index.d.ts",
|
6
6
|
"private": false,
|
@@ -28,7 +28,7 @@
|
|
28
28
|
"@react-types/shared": "^3.23.1",
|
29
29
|
"@squiz/dx-json-schema-lib": "^1.67.0",
|
30
30
|
"@squiz/generic-browser-lib": "1.67.2",
|
31
|
-
"@squiz/resource-browser-ui-lib": "^1.0.0-rc.
|
31
|
+
"@squiz/resource-browser-ui-lib": "^1.0.0-rc.8",
|
32
32
|
"@squiz/sds": "^1.3.1",
|
33
33
|
"clsx": "^2.1.0",
|
34
34
|
"expiry-map": "^2.0.0",
|
@@ -88,6 +88,5 @@
|
|
88
88
|
},
|
89
89
|
"volta": {
|
90
90
|
"node": "18.18.0"
|
91
|
-
}
|
92
|
-
"gitHead": "827a766f573da634daf63817dde6ef62314e66fa"
|
91
|
+
}
|
93
92
|
}
|
@@ -56,10 +56,19 @@ describe('MainContainer', () => {
|
|
56
56
|
|
57
57
|
it('should render Environment Selector title', () => {
|
58
58
|
render(<MainContainer {...defaultProps} title="Select MyAsset" />);
|
59
|
-
expect(screen.getByText('Select
|
59
|
+
expect(screen.getByText('Select myasset')).toBeInTheDocument();
|
60
60
|
expect(screen.queryByText('Environment Selector')).not.toBeInTheDocument();
|
61
61
|
});
|
62
62
|
|
63
|
+
it('should render title in Sentence case', () => {
|
64
|
+
const titles = ['Select Asset', 'Select MyAsset', 'another title'];
|
65
|
+
titles.forEach((title) => {
|
66
|
+
render(<MainContainer {...defaultProps} title={title} />);
|
67
|
+
const expectedTitle = title.charAt(0).toUpperCase() + title.slice(1).toLowerCase();
|
68
|
+
expect(screen.getByText(expectedTitle)).toBeInTheDocument();
|
69
|
+
});
|
70
|
+
});
|
71
|
+
|
63
72
|
describe('no source selected', () => {
|
64
73
|
it('should not render source selector dropdown', () => {
|
65
74
|
render(<MainContainer {...defaultProps} />);
|
@@ -65,7 +65,7 @@ function MainContainer({
|
|
65
65
|
<div className="relative flex flex-col h-full text-gray-800">
|
66
66
|
<div className="flex items-center py-3 pl-6 pr-10 min-h-[68px]">
|
67
67
|
<h2 {...titleAriaProps} className="text-xl leading-6 text-gray-800 font-semibold mr-6">
|
68
|
-
{title}
|
68
|
+
{title?.charAt(0).toUpperCase() + title?.slice(1).toLowerCase()}
|
69
69
|
</h2>
|
70
70
|
|
71
71
|
{plugin && selectedSource && (
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { DOMAttributes, FocusableElement } from '@react-types/shared';
|
3
3
|
import { Error } from '@squiz/resource-browser-ui-lib';
|
4
|
-
import { Spinner } from '@squiz/sds';
|
4
|
+
import { Spinner, SdsIcon, ICON_CLOSE } from '@squiz/sds';
|
5
5
|
|
6
6
|
export type InlineLoadingErrorStateProps = {
|
7
7
|
title: string;
|
@@ -18,20 +18,11 @@ export const InlineLoadingErrorState = ({ title, titleAriaProps, onClose, onRetr
|
|
18
18
|
<div className="relative flex flex-col h-full text-gray-800">
|
19
19
|
<div className="flex items-center py-3 pl-6 pr-10 min-h-[68px]">
|
20
20
|
<h2 {...titleAriaProps} className="text-xl leading-6 text-gray-800 font-semibold mr-6">
|
21
|
-
{title}
|
21
|
+
{title?.charAt(0).toUpperCase() + title?.slice(1).toLowerCase()}
|
22
22
|
</h2>
|
23
|
-
<button
|
24
|
-
|
25
|
-
|
26
|
-
onClick={onClose}
|
27
|
-
className="absolute top-2 right-2 p-2.5 rounded hover:bg-blue-100 focus:bg-blue-100"
|
28
|
-
>
|
29
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
30
|
-
<path
|
31
|
-
d="M13.3 0.710017C13.1131 0.522765 12.8595 0.417532 12.595 0.417532C12.3305 0.417532 12.0768 0.522765 11.89 0.710017L6.99997 5.59002L2.10997 0.700017C1.92314 0.512765 1.66949 0.407532 1.40497 0.407532C1.14045 0.407532 0.886802 0.512765 0.699971 0.700017C0.309971 1.09002 0.309971 1.72002 0.699971 2.11002L5.58997 7.00002L0.699971 11.89C0.309971 12.28 0.309971 12.91 0.699971 13.3C1.08997 13.69 1.71997 13.69 2.10997 13.3L6.99997 8.41002L11.89 13.3C12.28 13.69 12.91 13.69 13.3 13.3C13.69 12.91 13.69 12.28 13.3 11.89L8.40997 7.00002L13.3 2.11002C13.68 1.73002 13.68 1.09002 13.3 0.710017Z"
|
32
|
-
fill="currentColor"
|
33
|
-
/>
|
34
|
-
</svg>
|
23
|
+
<button className="sds-dialog__close" aria-label={`Close ${title} dialog`} onClick={onClose} tabIndex={0}>
|
24
|
+
<span className="sr-only">{`Close ${title} dialog`}</span>
|
25
|
+
<SdsIcon svg={ICON_CLOSE} />
|
35
26
|
</button>
|
36
27
|
</div>
|
37
28
|
<div className="border-t border-gray-300 overflow-y-hidden">
|
@@ -8,7 +8,7 @@ interface ResourceLauncherProps {
|
|
8
8
|
|
9
9
|
function ResourceLauncher({ sources, onSourceSelect }: ResourceLauncherProps) {
|
10
10
|
return (
|
11
|
-
<div className="overflow-y-
|
11
|
+
<div className="overflow-y-auto w-screen max-w-[400px] min-h-[290px] flex-1 grow-[3] border-r border-gray-300 bg-gray-100 pl-6 pr-6 pb-6 pt-4">
|
12
12
|
<ul tabIndex={-1} aria-label={`sources list`} className="flex flex-col bg-gray-100 min-h-full focus-visible:outline-0">
|
13
13
|
{sources.map((source, index) => {
|
14
14
|
const SourceLauncher = source.plugin.renderResourceLauncher();
|
@@ -54,7 +54,7 @@ export default function SourceDropdown({
|
|
54
54
|
aria-expanded={isOpen}
|
55
55
|
aria-controls={`${uniqueId}-button-menu`}
|
56
56
|
onClick={() => setIsOpen(!isOpen)}
|
57
|
-
className="relative flex items-center p-2 w-full rounded bg-blue-100
|
57
|
+
className="relative flex items-center p-2 w-full rounded bg-blue-100"
|
58
58
|
>
|
59
59
|
<span className="sr-only">current source </span>
|
60
60
|
<div className="truncate max-w-[200px] text-md font-semibold text-blue-400">{selectedSource.name}</div>
|
package/LICENSE.md
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
This software is copyright Squiz and may only be used with the explicit
|
2
|
-
permission of the copyright holder.
|
3
|
-
|
4
|
-
1. Squiz shall make the Services available to You pursuant to your Agreement and these terms.
|
5
|
-
2. Squiz shall provide the Services only in accordance with applicable laws and government regulations and where applicable your Agreement.
|
6
|
-
3. You shall:
|
7
|
-
(a) be responsible for Your compliance with these terms and the Agreement;
|
8
|
-
(b) prevent unauthorised access to or use of the Services, and notify Squiz promptly of any such unauthorised access or use, and
|
9
|
-
(c) use the Services only in accordance with the Documentation and applicable laws and government regulations.
|
10
|
-
4. You shall not:
|
11
|
-
(a) sell, resell, rent or lease the Services;
|
12
|
-
(b) use the Services to store or transmit Malicious Code;
|
13
|
-
(c) interfere with or disrupt the integrity or performance of the Services or third-party data contained therein, or
|
14
|
-
(d) attempt to gain unauthorised access to the Services or their related systems or networks.
|
15
|
-
5. You acknowledge that Squiz retains ownership of the Software, the Documentation and the source code and all proprietary rights relating thereto and You agree all Intellectual Property Rights in the Software and Documentation are and shall remain the exclusive property of Squiz and its third party suppliers, as applicable. Unless expressly permitted in this Subscription Agreement, You must not use any of Squiz's or its third party suppliers' intellectual property without Squiz or its third party suppliers' prior written consent. Nothing in these terms should be construed as transferring any aspects of such rights mentioned in this clause to You or any Third Party. Squiz reserves any and all rights not expressly granted herein.
|