@canopy-iiif/app 0.10.9 → 0.10.11

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.
@@ -155,8 +155,16 @@ var Scroll = (props) => {
155
155
 
156
156
  // ui/src/iiif/Image.jsx
157
157
  import React5, { useEffect as useEffect4, useState as useState4 } from "react";
158
- var Image = (props) => {
158
+ var Image = (props = {}) => {
159
159
  const [CloverImage, setCloverImage] = useState4(null);
160
+ const baseClass = "canopy-iiif-image";
161
+ const {
162
+ height = `600px`,
163
+ backgroundColor = `var(--color-gray-200)`,
164
+ caption,
165
+ className: userClassName
166
+ } = props || {};
167
+ const rootClassName = [userClassName, baseClass].filter(Boolean).join(" ");
160
168
  useEffect4(() => {
161
169
  let mounted = true;
162
170
  const canUseDom = typeof window !== "undefined" && typeof document !== "undefined";
@@ -179,40 +187,26 @@ var Image = (props) => {
179
187
  } catch (_) {
180
188
  json = "{}";
181
189
  }
182
- const {
183
- height = `600px`,
184
- backgroundColor = `var(--color-gray-200)`,
185
- caption
186
- } = props || {};
187
- return /* @__PURE__ */ React5.createElement(
188
- "figure",
190
+ return /* @__PURE__ */ React5.createElement("figure", { className: rootClassName }, /* @__PURE__ */ React5.createElement(
191
+ "div",
189
192
  {
193
+ className: `${baseClass}__placeholder`,
194
+ "data-canopy-image": "1",
190
195
  style: {
191
- margin: `1.618rem 0 2.618rem`
196
+ "--canopy-iiif-image-height": height,
197
+ "--canopy-iiif-image-bg": backgroundColor
192
198
  }
193
199
  },
194
200
  /* @__PURE__ */ React5.createElement(
195
- "div",
201
+ "script",
196
202
  {
197
- "data-canopy-image": "1",
198
- style: {
199
- height,
200
- backgroundColor,
201
- borderRadius: `0.25rem`
202
- }
203
- },
204
- /* @__PURE__ */ React5.createElement(
205
- "script",
206
- {
207
- type: "application/json",
208
- dangerouslySetInnerHTML: { __html: json }
209
- }
210
- )
211
- ),
212
- caption && /* @__PURE__ */ React5.createElement("figcaption", null, caption)
213
- );
203
+ type: "application/json",
204
+ dangerouslySetInnerHTML: { __html: json }
205
+ }
206
+ )
207
+ ), caption && /* @__PURE__ */ React5.createElement("figcaption", { className: `${baseClass}__caption` }, caption));
214
208
  }
215
- return /* @__PURE__ */ React5.createElement(CloverImage, { ...props });
209
+ return /* @__PURE__ */ React5.createElement(CloverImage, { ...props, className: rootClassName });
216
210
  };
217
211
 
218
212
  // ui/src/iiif/MdxRelatedItems.jsx
@@ -282,9 +276,16 @@ function Button({
282
276
 
283
277
  // ui/src/layout/ButtonWrapper.jsx
284
278
  import React8 from "react";
285
- function ButtonWrapper({ className = "", children, ...rest }) {
286
- const classes = ["canopy-button-group", className].filter(Boolean).join(" ");
287
- return /* @__PURE__ */ React8.createElement("div", { className: classes, ...rest }, children);
279
+ function ButtonWrapper({
280
+ className = "",
281
+ children,
282
+ text = "",
283
+ variant = "default",
284
+ ...rest
285
+ }) {
286
+ const variantClass = variant && variant !== "default" ? `canopy-button-group--${variant}` : "";
287
+ const classes = ["canopy-button-group", variantClass, className].filter(Boolean).join(" ");
288
+ return /* @__PURE__ */ React8.createElement("div", { className: classes, ...rest }, text && /* @__PURE__ */ React8.createElement("span", { className: "canopy-button-group__text" }, text), /* @__PURE__ */ React8.createElement("div", { className: "canopy-button-group__actions" }, children));
288
289
  }
289
290
 
290
291
  // ui/src/interstitials/Hero.jsx