@squiz/resource-browser 3.0.1-rc.7 → 3.1.0-rc.1

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 CHANGED
@@ -1,8 +1,23 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.1.0-rc.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated modal to use sds button, removed scroll bar from search panel
8
+ - ce9ae92: Version control via changesets added
9
+ - Updated dependencies [ce9ae92]
10
+ - @squiz/resource-browser-ui-lib@1.0.0-rc.8
11
+
3
12
  All notable changes to this project will be documented in this file.
4
13
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
14
 
15
+ # [3.1.0-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@3.0.1-rc.7...@squiz/resource-browser@3.1.0-rc.0) (2024-12-16)
16
+
17
+ ### Features
18
+
19
+ - **prodam-489:** close modal hover and mobile input with fix ([135c695](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/135c695bdcc1c5d6cbbd26d850e402d3cc208a8a))
20
+
6
21
  ## [3.0.1-rc.7](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@3.0.1-rc.6...@squiz/resource-browser@3.0.1-rc.7) (2024-12-13)
7
22
 
8
23
  **Note:** Version bump only for package @squiz/resource-browser
@@ -52,9 +52,11 @@ function MainContainer({ title, titleAriaProps, allowedTypes, sources, selectedS
52
52
  !plugin.createHeaderPortal && sources.length > 1 && (react_1.default.createElement(SourceDropdownContainer_1.default, { isCollapsed: false, onExpand: () => { } },
53
53
  react_1.default.createElement("div", { className: `border-l border-blue-200 pl-1 w-[204px]` },
54
54
  react_1.default.createElement(SourceDropdown_1.default, { sources: sources, selectedSource: selectedSource, onSourceSelect: onSourceSelect })))))),
55
- react_1.default.createElement("button", { type: "button", "aria-label": `Close ${title} dialog`, onClick: onClose, className: "absolute top-2 right-2 p-2.5 rounded hover:bg-blue-100 focus:bg-blue-100" },
56
- react_1.default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
57
- react_1.default.createElement("path", { 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", fill: "currentColor" })))),
55
+ react_1.default.createElement("div", { className: "flex gap-3 p-3 absolute right-0 top-0" },
56
+ react_1.default.createElement("button", { type: "button", "aria-label": `Close ${title} dialog`, onClick: onClose, className: "border-0 bg-transparent cursor-pointer p-0 relative" },
57
+ react_1.default.createElement("svg", { height: "24px", viewBox: "0 0 24 24", width: "24px", xmlns: "http://www.w3.org/2000/svg", className: "text-gray-600 hover:text-gray-800 fill-current" },
58
+ react_1.default.createElement("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
59
+ react_1.default.createElement("path", { d: "M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z" }))))),
58
60
  react_1.default.createElement("div", { className: "border-t border-gray-300 overflow-y-hidden" },
59
61
  plugin && selectedSource && (react_1.default.createElement("div", { className: `squiz-rb-plugin squiz-rb-plugin--${pluginMode?.type}` },
60
62
  pluginToRender === types_1.PluginLaunchModeType.Browse && SourceBrowser && (react_1.default.createElement(SourceBrowser, { source: selectedSource, sources: sources, onSourceSelect: onSourceSelect, allowedTypes: allowedTypes, headerPortal: plugin.createHeaderPortal && headerPortal ? headerPortal : undefined, searchEnabled: searchEnabled, preselectedResource: preselectedResource || undefined, browseTo: pluginMode?.args?.browseTo, onSelected: (resource) => {
@@ -11,9 +11,9 @@ const InlineLoadingErrorState = ({ title, titleAriaProps, onClose, onRetry, isLo
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
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", { type: "button", "aria-label": `Close ${title} dialog`, onClick: onClose, className: "absolute top-2 right-2 p-2.5 rounded hover:bg-blue-100 focus:bg-blue-100" },
15
- react_1.default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
16
- react_1.default.createElement("path", { 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", fill: "currentColor" })))),
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-scroll 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" },
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" },
package/lib/index.css CHANGED
@@ -4826,6 +4826,9 @@
4826
4826
  .squiz-rb-scope .left-1:not(.squiz-rb-plugin *) {
4827
4827
  left: 0.25rem;
4828
4828
  }
4829
+ .squiz-rb-scope .right-0:not(.squiz-rb-plugin *) {
4830
+ right: 0px;
4831
+ }
4829
4832
  .squiz-rb-scope .right-2:not(.squiz-rb-plugin *) {
4830
4833
  right: 0.5rem;
4831
4834
  }
@@ -4838,8 +4841,8 @@
4838
4841
  .squiz-rb-scope .right-5:not(.squiz-rb-plugin *) {
4839
4842
  right: 1.25rem;
4840
4843
  }
4841
- .squiz-rb-scope .top-2:not(.squiz-rb-plugin *) {
4842
- top: 0.5rem;
4844
+ .squiz-rb-scope .top-0:not(.squiz-rb-plugin *) {
4845
+ top: 0px;
4843
4846
  }
4844
4847
  .squiz-rb-scope .top-3:not(.squiz-rb-plugin *) {
4845
4848
  top: 0.75rem;
@@ -5127,6 +5130,9 @@
5127
5130
  .squiz-rb-scope .cursor-not-allowed:not(.squiz-rb-plugin *) {
5128
5131
  cursor: not-allowed;
5129
5132
  }
5133
+ .squiz-rb-scope .cursor-pointer:not(.squiz-rb-plugin *) {
5134
+ cursor: pointer;
5135
+ }
5130
5136
  .squiz-rb-scope .grid-cols-\[24px_1fr_45px\]:not(.squiz-rb-plugin *) {
5131
5137
  grid-template-columns: 24px 1fr 45px;
5132
5138
  }
@@ -5192,6 +5198,9 @@
5192
5198
  .squiz-rb-scope .rounded-lg:not(.squiz-rb-plugin *) {
5193
5199
  border-radius: 0.5rem;
5194
5200
  }
5201
+ .squiz-rb-scope .border-0:not(.squiz-rb-plugin *) {
5202
+ border-width: 0px;
5203
+ }
5195
5204
  .squiz-rb-scope .border-1:not(.squiz-rb-plugin *) {
5196
5205
  border-width: 1px;
5197
5206
  }
@@ -5262,6 +5271,9 @@
5262
5271
  --tw-bg-opacity: 1;
5263
5272
  background-color: rgb(237 237 237 / var(--tw-bg-opacity));
5264
5273
  }
5274
+ .squiz-rb-scope .bg-transparent:not(.squiz-rb-plugin *) {
5275
+ background-color: transparent;
5276
+ }
5265
5277
  .squiz-rb-scope .bg-white:not(.squiz-rb-plugin *) {
5266
5278
  --tw-bg-opacity: 1;
5267
5279
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -5272,6 +5284,9 @@
5272
5284
  .squiz-rb-scope .fill-blue-300:not(.squiz-rb-plugin *) {
5273
5285
  fill: #0774d2;
5274
5286
  }
5287
+ .squiz-rb-scope .fill-current:not(.squiz-rb-plugin *) {
5288
+ fill: currentColor;
5289
+ }
5275
5290
  .squiz-rb-scope .object-cover:not(.squiz-rb-plugin *) {
5276
5291
  -o-object-fit: cover;
5277
5292
  object-fit: cover;
@@ -5289,8 +5304,8 @@
5289
5304
  .squiz-rb-scope .p-2:not(.squiz-rb-plugin *) {
5290
5305
  padding: 0.5rem;
5291
5306
  }
5292
- .squiz-rb-scope .p-2\.5:not(.squiz-rb-plugin *) {
5293
- padding: 0.625rem;
5307
+ .squiz-rb-scope .p-3:not(.squiz-rb-plugin *) {
5308
+ padding: 0.75rem;
5294
5309
  }
5295
5310
  .squiz-rb-scope .p-4:not(.squiz-rb-plugin *) {
5296
5311
  padding: 1rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squiz/resource-browser",
3
- "version": "3.0.1-rc.7",
3
+ "version": "3.1.0-rc.1",
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.6",
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": "b1ca30987b9284691e8d455792e65f13a32fdceb"
91
+ }
93
92
  }
@@ -83,19 +83,25 @@ function MainContainer({
83
83
  </>
84
84
  )}
85
85
 
86
- <button
87
- type="button"
88
- aria-label={`Close ${title} dialog`}
89
- onClick={onClose}
90
- className="absolute top-2 right-2 p-2.5 rounded hover:bg-blue-100 focus:bg-blue-100"
91
- >
92
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
93
- <path
94
- 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"
95
- fill="currentColor"
96
- />
97
- </svg>
98
- </button>
86
+ <div className="flex gap-3 p-3 absolute right-0 top-0">
87
+ <button
88
+ type="button"
89
+ aria-label={`Close ${title} dialog`}
90
+ onClick={onClose}
91
+ className="border-0 bg-transparent cursor-pointer p-0 relative"
92
+ >
93
+ <svg
94
+ height="24px"
95
+ viewBox="0 0 24 24"
96
+ width="24px"
97
+ xmlns="http://www.w3.org/2000/svg"
98
+ className="text-gray-600 hover:text-gray-800 fill-current"
99
+ >
100
+ <path d="M0 0h24v24H0V0z" fill="none"></path>
101
+ <path d="M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"></path>
102
+ </svg>
103
+ </button>
104
+ </div>
99
105
  </div>
100
106
  <div className="border-t border-gray-300 overflow-y-hidden">
101
107
  {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;
@@ -20,18 +20,9 @@ export const InlineLoadingErrorState = ({ title, titleAriaProps, onClose, onRetr
20
20
  <h2 {...titleAriaProps} className="text-xl leading-6 text-gray-800 font-semibold mr-6">
21
21
  {title}
22
22
  </h2>
23
- <button
24
- type="button"
25
- aria-label={`Close ${title} dialog`}
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-scroll 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">
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();
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.