@squiz/resource-browser 1.32.1-alpha.35 → 1.32.1-alpha.37

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.
@@ -19,7 +19,7 @@ function ModalTrigger({ label, showLabel, icon, isDisabled, children, ...props }
19
19
  return (react_1.default.createElement(react_1.default.Fragment, null,
20
20
  react_1.default.createElement(ModalOpeningButton_1.default, { type: "button", ...triggerProps, ...ariaAttr, isDisabled: isDisabled, className: (0, clsx_1.default)('flex p-1 px-1.5 rounded mr-auto text-blue-300 hover:bg-blue-100 focus:bg-blue-100 focus:outline-none', isDisabled && 'hover:bg-transparent cursor-not-allowed text-gray-600') },
21
21
  icon,
22
- showLabel && react_1.default.createElement("span", { className: "ml-1 text-sm leading-4" }, label)),
22
+ showLabel && react_1.default.createElement("span", { className: "ml-1 text-sm font-semibold leading-4" }, label)),
23
23
  state.isOpen && (react_1.default.createElement(Modal_1.default, { isDismissable: true, state: state, overlayProps: overlayProps }, (titleProps) => children(state.close, titleProps)))));
24
24
  }
25
25
  exports.default = ModalTrigger;
@@ -40,7 +40,7 @@ const ResourceList = function ({ resources, selectedResource, previewModalState,
40
40
  });
41
41
  }
42
42
  }, [resources]);
43
- return (react_1.default.createElement("ul", { ref: listRef, tabIndex: -1, "aria-label": `${isLoading ? 'loading' : ''} Resource list`, className: "flex flex-col text-sm font-semibold px-7 my-4" },
43
+ return (react_1.default.createElement("ul", { ref: listRef, tabIndex: -1, "aria-label": `${isLoading ? 'loading' : ''} Resource list`, className: "flex flex-col text-sm font-semibold px-7 my-4 focus-visible:outline-0" },
44
44
  isLoading && (react_1.default.createElement(react_1.default.Fragment, null, [...Array(8)].map((_item, index) => {
45
45
  return react_1.default.createElement(SkeletonListItem_1.SkeletonListItem, { key: index });
46
46
  }))),
@@ -17,7 +17,7 @@ const ResourcePicker = ({ resource, allowedTypes, error, isLoading, isDisabled,
17
17
  const isEmpty = resource === null && !isLoading && !error;
18
18
  return (react_1.default.createElement("div", { className: (0, clsx_1.default)('resource-picker', isDisabled && 'bg-gray-300') },
19
19
  isImagePicker ? (react_1.default.createElement(PhotoLibraryRounded_1.default, { "aria-hidden": true, className: "w-6 h-6" })) : (react_1.default.createElement(AdsClickRounded_1.default, { "aria-hidden": true, className: "w-6 h-6" })),
20
- isEmpty ? (react_1.default.createElement(ModalTrigger_1.default, { showLabel: true, label: isImagePicker ? `Choose image` : `Choose asset`, icon: react_1.default.createElement(AddCircleOutlineRounded_1.default, { "aria-hidden": true, className: "!w-4 !h-4" }), isDisabled: isDisabled }, children)) : (react_1.default.createElement("div", { className: "resource-picker-info" },
20
+ isEmpty ? (react_1.default.createElement(ModalTrigger_1.default, { showLabel: true, label: isImagePicker ? `Choose image` : `Choose asset`, icon: react_1.default.createElement(AddCircleOutlineRounded_1.default, { "aria-hidden": true, className: `!w-4 !h-4 text-blue-300 ${isDisabled ? 'text-gray-600' : ''}` }), isDisabled: isDisabled }, children)) : (react_1.default.createElement("div", { className: "resource-picker-info" },
21
21
  react_1.default.createElement("div", { className: "resource-picker-info__layout" },
22
22
  isLoading && react_1.default.createElement(Loading_1.LoadingState, null),
23
23
  error && react_1.default.createElement(Error_1.ErrorState, { error: error, onClear: onClear }),
@@ -7,5 +7,5 @@ exports.LoadingState = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const Spinner_1 = __importDefault(require("../../Spinner/Spinner"));
9
9
  const LoadingState = () => (react_1.default.createElement("div", { className: "col-start-2 col-end-2" },
10
- react_1.default.createElement(Spinner_1.default, { label: "Loading selection", className: "text-gray-600 m-2" })));
10
+ react_1.default.createElement(Spinner_1.default, { label: "Loading selection", className: "m-2" })));
11
11
  exports.LoadingState = LoadingState;
@@ -67,7 +67,7 @@ function ResourcePickerContainer({ title, titleAriaProps, allowedTypes, onReques
67
67
  (0, react_1.useEffect)(() => {
68
68
  setSelectedResource(null);
69
69
  }, [hierarchy]);
70
- return (react_1.default.createElement("div", { className: "relative flex flex-col h-full text-gray-800 antialiased" },
70
+ return (react_1.default.createElement("div", { className: "relative flex flex-col h-full text-gray-800" },
71
71
  react_1.default.createElement("div", { className: "flex items-center p-4.5" },
72
72
  react_1.default.createElement("h2", { ...titleAriaProps, className: "text-xl leading-6 text-gray-800 font-semibold mr-6" }, title),
73
73
  react_1.default.createElement("div", { className: "px-3 border-l border-gray-300 w-300px" },
@@ -78,7 +78,7 @@ function SourceDropdown({ sources, selectedSource, isLoading, onRootSelect, onSo
78
78
  react_1.default.createElement("button", { type: "button", onClick: handleRootSelect, className: `relative grow flex items-center p-2.5 hover:bg-gray-100 focus:bg-gray-100` },
79
79
  react_1.default.createElement(Icon_1.default, { icon: 'root', "aria-hidden": true, className: "mr-2.5" }),
80
80
  "All available sources")),
81
- isLoading && (react_1.default.createElement("li", { className: "mt-6" },
81
+ isLoading && (react_1.default.createElement("li", { className: "mt-2" },
82
82
  react_1.default.createElement(Spinner_1.default, { size: "sm", label: "Loading sources", className: "m-3" }))),
83
83
  !isLoading &&
84
84
  categorisedSources.map(({ key, label, sources }, index) => {
@@ -42,7 +42,7 @@ const SourceList = function ({ sources, previewModalState, isLoading, onSourceSe
42
42
  });
43
43
  }
44
44
  }, []);
45
- return (react_1.default.createElement("ul", { ref: listRef, tabIndex: -1, "aria-label": `${isLoading ? 'loading' : ''} Source list`, className: (0, clsx_1.default)('flex flex-col bg-gray-100 min-h-full', !isLoading && 'px-7 py-4') },
45
+ return (react_1.default.createElement("ul", { ref: listRef, tabIndex: -1, "aria-label": `${isLoading ? 'loading' : ''} Source list`, className: (0, clsx_1.default)('flex flex-col bg-gray-100 min-h-full focus-visible:outline-0', !isLoading && 'px-7 py-4') },
46
46
  isLoading && (react_1.default.createElement(react_1.default.Fragment, null,
47
47
  react_1.default.createElement("li", null,
48
48
  react_1.default.createElement(SkeletonList_1.SkeletonList, { itemCount: 3 })),
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
7
  const clsx_1 = __importDefault(require("clsx"));
8
8
  const Spinner = ({ size = 'sm', className, label = 'Loading' }) => {
9
- return (react_1.default.createElement("div", { className: "spinner__wrapper", "aria-label": label },
10
- react_1.default.createElement("div", { className: (0, clsx_1.default)(`spinner`, size && `spinner--${size}`, className), role: "status" })));
9
+ return (react_1.default.createElement("div", { className: "spinner__wrapper text-gray-600", "aria-label": label },
10
+ react_1.default.createElement("div", { className: (0, clsx_1.default)('spinner', size && `spinner--${size}`, className), role: "status" })));
11
11
  };
12
12
  exports.default = Spinner;
package/lib/index.css CHANGED
@@ -514,9 +514,6 @@
514
514
  .squiz-rb-scope .mt-4 {
515
515
  margin-top: 1rem;
516
516
  }
517
- .squiz-rb-scope .mt-6 {
518
- margin-top: 1.5rem;
519
- }
520
517
  .squiz-rb-scope .mt-7 {
521
518
  margin-top: 1.75rem;
522
519
  }
@@ -913,10 +910,6 @@
913
910
  --tw-text-opacity: 1;
914
911
  color: rgb(255 255 255 / var(--tw-text-opacity));
915
912
  }
916
- .squiz-rb-scope .antialiased {
917
- -webkit-font-smoothing: antialiased;
918
- -moz-osx-font-smoothing: grayscale;
919
- }
920
913
  .squiz-rb-scope .opacity-40 {
921
914
  opacity: 0.4;
922
915
  }
@@ -959,8 +952,6 @@
959
952
  display: flex;
960
953
  align-items: center;
961
954
  justify-content: center;
962
- --tw-text-opacity: 1;
963
- color: rgb(224 224 224 / var(--tw-text-opacity));
964
955
  }
965
956
  .squiz-rb-scope .spinner--md {
966
957
  height: 32px;
@@ -1049,6 +1040,8 @@
1049
1040
  }
1050
1041
  .squiz-rb-scope *,
1051
1042
  .squiz-rb-scope button {
1043
+ -webkit-font-smoothing: antialiased;
1044
+ -moz-osx-font-smoothing: grayscale;
1052
1045
  letter-spacing: -0.02em;
1053
1046
  }
1054
1047
  .squiz-rb-scope svg {
@@ -1198,6 +1191,9 @@
1198
1191
  outline: 2px solid transparent;
1199
1192
  outline-offset: 2px;
1200
1193
  }
1194
+ .squiz-rb-scope .focus-visible\:outline-0:focus-visible {
1195
+ outline-width: 0px;
1196
+ }
1201
1197
  .squiz-rb-scope .disabled\:cursor-not-allowed:disabled {
1202
1198
  cursor: not-allowed;
1203
1199
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squiz/resource-browser",
3
- "version": "1.32.1-alpha.35",
3
+ "version": "1.32.1-alpha.37",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@mui/icons-material": "5.11.16",
18
- "@squiz/dx-json-schema-lib": "1.32.1-alpha.35",
18
+ "@squiz/dx-json-schema-lib": "1.32.1-alpha.37",
19
19
  "pretty-bytes": "5.6.0",
20
20
  "react-aria": "3.23.1",
21
21
  "react-responsive": "9.0.2",
@@ -73,5 +73,5 @@
73
73
  "volta": {
74
74
  "node": "18.15.0"
75
75
  },
76
- "gitHead": "97839c928c7b60a55020aedbf8ae28b02ddb9c6f"
76
+ "gitHead": "6e4ee93a747ad55fa408403fadbf5b7319152a91"
77
77
  }
@@ -43,7 +43,7 @@ function ModalTrigger({
43
43
  )}
44
44
  >
45
45
  {icon}
46
- {showLabel && <span className="ml-1 text-sm leading-4">{label}</span>}
46
+ {showLabel && <span className="ml-1 text-sm font-semibold leading-4">{label}</span>}
47
47
  </ModalOpeningButton>
48
48
  {state.isOpen && (
49
49
  <Modal isDismissable state={state} overlayProps={overlayProps}>
@@ -48,7 +48,7 @@ const ResourceList = function ({
48
48
  ref={listRef}
49
49
  tabIndex={-1}
50
50
  aria-label={`${isLoading ? 'loading' : ''} Resource list`}
51
- className="flex flex-col text-sm font-semibold px-7 my-4"
51
+ className="flex flex-col text-sm font-semibold px-7 my-4 focus-visible:outline-0"
52
52
  >
53
53
  {isLoading && (
54
54
  <>
@@ -43,7 +43,12 @@ const ResourcePicker = ({
43
43
  <ModalTrigger
44
44
  showLabel={true}
45
45
  label={isImagePicker ? `Choose image` : `Choose asset`}
46
- icon={<AddCircleOutlineRoundedIcon aria-hidden className="!w-4 !h-4" />}
46
+ icon={
47
+ <AddCircleOutlineRoundedIcon
48
+ aria-hidden
49
+ className={`!w-4 !h-4 text-blue-300 ${isDisabled ? 'text-gray-600' : ''}`}
50
+ />
51
+ }
47
52
  isDisabled={isDisabled}
48
53
  >
49
54
  {children}
@@ -4,6 +4,6 @@ import Spinner from '../../Spinner/Spinner';
4
4
 
5
5
  export const LoadingState = () => (
6
6
  <div className="col-start-2 col-end-2">
7
- <Spinner label="Loading selection" className="text-gray-600 m-2" />
7
+ <Spinner label="Loading selection" className="m-2" />
8
8
  </div>
9
9
  );
@@ -92,7 +92,7 @@ function ResourcePickerContainer({
92
92
  }, [hierarchy]);
93
93
 
94
94
  return (
95
- <div className="relative flex flex-col h-full text-gray-800 antialiased">
95
+ <div className="relative flex flex-col h-full text-gray-800">
96
96
  <div className="flex items-center p-4.5">
97
97
  <h2 {...titleAriaProps} className="text-xl leading-6 text-gray-800 font-semibold mr-6">
98
98
  {title}
@@ -110,7 +110,7 @@ export default function SourceDropdown({
110
110
  </button>
111
111
  </li>
112
112
  {isLoading && (
113
- <li className="mt-6">
113
+ <li className="mt-2">
114
114
  <Spinner size="sm" label="Loading sources" className="m-3" />
115
115
  </li>
116
116
  )}
@@ -42,7 +42,7 @@ const SourceList = function ({
42
42
  ref={listRef}
43
43
  tabIndex={-1}
44
44
  aria-label={`${isLoading ? 'loading' : ''} Source list`}
45
- className={clsx('flex flex-col bg-gray-100 min-h-full', !isLoading && 'px-7 py-4')}
45
+ className={clsx('flex flex-col bg-gray-100 min-h-full focus-visible:outline-0', !isLoading && 'px-7 py-4')}
46
46
  >
47
47
  {isLoading && (
48
48
  <>
@@ -9,8 +9,8 @@ export type SpinnerProps = {
9
9
 
10
10
  const Spinner = ({ size = 'sm', className, label = 'Loading' }: SpinnerProps): ReactElement => {
11
11
  return (
12
- <div className="spinner__wrapper" aria-label={label}>
13
- <div className={clsx(`spinner`, size && `spinner--${size}`, className)} role="status" />
12
+ <div className="spinner__wrapper text-gray-600" aria-label={label}>
13
+ <div className={clsx('spinner', size && `spinner--${size}`, className)} role="status" />
14
14
  </div>
15
15
  );
16
16
  };
@@ -5,7 +5,7 @@
5
5
  height: 20px;
6
6
  width: 20px;
7
7
  &__wrapper {
8
- @apply flex items-center justify-center text-gray-300;
8
+ @apply flex items-center justify-center;
9
9
  }
10
10
  &--md {
11
11
  height: 32px;
package/src/index.scss CHANGED
@@ -11,6 +11,7 @@
11
11
 
12
12
  *,
13
13
  button {
14
+ @apply antialiased;
14
15
  letter-spacing: -0.02em;
15
16
  }
16
17