@gpichot/spectacle-deck 1.6.0 → 1.8.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.
@@ -1,8 +1,9 @@
1
1
  import React from "react";
2
- declare function FilePane({ name, children, priority, ...divProps }: React.ComponentProps<"div"> & {
2
+ declare function FilePane({ name, children, priority, minWidth, ...divProps }: React.ComponentProps<"div"> & {
3
3
  name: string;
4
4
  priority?: number;
5
- }): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>> | React.DetailedReactHTMLElement<unknown, HTMLElement>;
5
+ minWidth?: string;
6
+ }): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>> | import("react/jsx-runtime").JSX.Element;
6
7
  declare namespace FilePane {
7
8
  var mdxType: string;
8
9
  }
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
- export default function Timeline(props: React.ComponentPropsWithoutRef<"div">): import("react/jsx-runtime").JSX.Element;
2
+ export default function Timeline(props: React.ComponentPropsWithoutRef<"div"> & {
3
+ activeIndex?: number;
4
+ }): import("react/jsx-runtime").JSX.Element;
3
5
  export declare function TimelineItem(props: React.ComponentPropsWithoutRef<"div"> & {
4
6
  isPhantom?: boolean;
5
7
  isLast?: boolean;
package/index.cjs CHANGED
@@ -1096,7 +1096,10 @@ function FullImageLayout({
1096
1096
  children,
1097
1097
  image,
1098
1098
  position = "bottom",
1099
- dim = 0.4
1099
+ dim = 0.4,
1100
+ fit = "cover",
1101
+ backgroundColor,
1102
+ margin
1100
1103
  }) {
1101
1104
  const [images, rest] = getMatchingMdxType(children, "Image");
1102
1105
  const firstImage = images[0];
@@ -1121,8 +1124,11 @@ function FullImageLayout({
1121
1124
  position: "absolute",
1122
1125
  inset: 0,
1123
1126
  backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0,
1124
- backgroundSize: "cover",
1125
- backgroundPosition: "center"
1127
+ backgroundSize: fit,
1128
+ backgroundPosition: "center",
1129
+ backgroundRepeat: "no-repeat",
1130
+ backgroundColor,
1131
+ margin
1126
1132
  }
1127
1133
  }
1128
1134
  ),
@@ -2002,17 +2008,23 @@ function DocItem({ label, link }) {
2002
2008
 
2003
2009
  // src/components/FilePane.tsx
2004
2010
  var import_react12 = __toESM(require("react"));
2011
+ var import_jsx_runtime28 = require("react/jsx-runtime");
2005
2012
  function FilePane({
2006
2013
  name,
2007
2014
  children,
2008
2015
  priority,
2016
+ minWidth,
2009
2017
  ...divProps
2010
2018
  }) {
2011
- return import_react12.default.isValidElement(children) ? import_react12.default.cloneElement(children, {
2019
+ const content = import_react12.default.isValidElement(children) ? import_react12.default.cloneElement(children, {
2012
2020
  // @ts-expect-error cloning
2013
2021
  priority,
2014
2022
  name
2015
2023
  }) : children;
2024
+ if (minWidth) {
2025
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { ...divProps, style: { minWidth, ...divProps.style }, children: content });
2026
+ }
2027
+ return content;
2016
2028
  }
2017
2029
  FilePane.mdxType = "FilePane";
2018
2030
 
@@ -2021,7 +2033,7 @@ var import_web6 = require("@react-spring/web");
2021
2033
  var import_react13 = __toESM(require("react"));
2022
2034
  var import_spectacle8 = require("spectacle");
2023
2035
  var import_styled_components15 = __toESM(require("styled-components"));
2024
- var import_jsx_runtime28 = require("react/jsx-runtime");
2036
+ var import_jsx_runtime29 = require("react/jsx-runtime");
2025
2037
  var Container = import_styled_components15.default.div`
2026
2038
  display: grid;
2027
2039
  grid-gap: 2rem;
@@ -2031,7 +2043,7 @@ function HorizontalList({
2031
2043
  columns = 3
2032
2044
  }) {
2033
2045
  const items = import_react13.default.Children.toArray(children);
2034
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_spectacle8.Stepper, { values: items, children: (_, step) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2046
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_spectacle8.Stepper, { values: items, children: (_, step) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2035
2047
  Container,
2036
2048
  {
2037
2049
  style: {
@@ -2052,11 +2064,11 @@ function HorizontalList({
2052
2064
  ) });
2053
2065
  }
2054
2066
  function Pill({ position }) {
2055
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2067
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2056
2068
  "div",
2057
2069
  {
2058
2070
  style: { width: 48, transform: "translate(-25%, -25%)", opacity: 0.9 },
2059
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2071
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
2060
2072
  "svg",
2061
2073
  {
2062
2074
  width: "48",
@@ -2065,14 +2077,14 @@ function Pill({ position }) {
2065
2077
  fill: "none",
2066
2078
  xmlns: "http://www.w3.org/2000/svg",
2067
2079
  children: [
2068
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2080
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2069
2081
  "path",
2070
2082
  {
2071
2083
  d: "M8.64717 20L0 15.0094V5.00134L8.64717 0L17.289 5.00134V15.0094L8.64717 20ZM1.48222 14.141L8.64717 18.2846L15.8068 14.141V5.85902L8.64717 1.71536L1.48222 5.85902V14.141Z",
2072
2084
  fill: "#ffffff"
2073
2085
  }
2074
2086
  ),
2075
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2087
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2076
2088
  "text",
2077
2089
  {
2078
2090
  x: "9",
@@ -2084,7 +2096,7 @@ function Pill({ position }) {
2084
2096
  children: position
2085
2097
  }
2086
2098
  ),
2087
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2099
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2088
2100
  "path",
2089
2101
  {
2090
2102
  d: "M 8.758 16.01 L 3.549 13.004 L 3.549 6.975 L 8.758 3.963 L 13.964 6.975 L 13.964 13.004 L 8.758 16.01 Z",
@@ -2138,18 +2150,18 @@ function HorizontalListItem({
2138
2150
  const opacityStyles = (0, import_web6.useSpring)({
2139
2151
  opacity: getItemOpacity({ isVisible, isLast })
2140
2152
  });
2141
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Item, { style: opacityStyles, children: [
2142
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(ItemHead, { children: [
2143
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Pill, { position }),
2144
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: title })
2153
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Item, { style: opacityStyles, children: [
2154
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(ItemHead, { children: [
2155
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Pill, { position }),
2156
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { children: title })
2145
2157
  ] }),
2146
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ItemContent, { children })
2158
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ItemContent, { children })
2147
2159
  ] });
2148
2160
  }
2149
2161
 
2150
2162
  // src/components/IconBox.tsx
2151
2163
  var import_styled_components16 = __toESM(require("styled-components"));
2152
- var import_jsx_runtime29 = require("react/jsx-runtime");
2164
+ var import_jsx_runtime30 = require("react/jsx-runtime");
2153
2165
  var IconBoxContent = import_styled_components16.default.div`
2154
2166
  * {
2155
2167
  margin: 0.2rem !important;
@@ -2160,7 +2172,7 @@ function IconBox({
2160
2172
  children,
2161
2173
  icon
2162
2174
  }) {
2163
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
2175
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2164
2176
  "div",
2165
2177
  {
2166
2178
  style: {
@@ -2170,8 +2182,8 @@ function IconBox({
2170
2182
  padding: "1rem 0"
2171
2183
  },
2172
2184
  children: [
2173
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { style: { fontSize: 60 }, children: icon }),
2174
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(IconBoxContent, { children })
2185
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { style: { fontSize: 60 }, children: icon }),
2186
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(IconBoxContent, { children })
2175
2187
  ]
2176
2188
  }
2177
2189
  );
@@ -2182,11 +2194,11 @@ var import_web7 = require("@react-spring/web");
2182
2194
  var import_react14 = __toESM(require("react"));
2183
2195
  var import_spectacle9 = require("spectacle");
2184
2196
  var import_styled_components17 = __toESM(require("styled-components"));
2185
- var import_jsx_runtime30 = require("react/jsx-runtime");
2197
+ var import_jsx_runtime31 = require("react/jsx-runtime");
2186
2198
  function ItemsColumn(divProps) {
2187
2199
  const { style: style2, children, ...props } = divProps;
2188
2200
  const childrenArray = import_react14.default.Children.toArray(children);
2189
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_spectacle9.Stepper, { values: childrenArray, children: (_value, step) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2201
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_spectacle9.Stepper, { values: childrenArray, children: (_value, step) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2190
2202
  "div",
2191
2203
  {
2192
2204
  style: {
@@ -2204,7 +2216,7 @@ function ItemsColumn(divProps) {
2204
2216
  if (!import_react14.default.isValidElement(child)) {
2205
2217
  return child;
2206
2218
  }
2207
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemColumnWrapper, { isVisible, children: child }, index);
2219
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ItemColumnWrapper, { isVisible, children: child }, index);
2208
2220
  })
2209
2221
  }
2210
2222
  ) });
@@ -2222,7 +2234,7 @@ function ItemColumnWrapper({
2222
2234
  ...props
2223
2235
  }) {
2224
2236
  const styles = (0, import_web7.useSpring)({ opacity: isVisible ? 1 : 0 });
2225
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemColumnWrapperStyled, { style: styles, ...props, children });
2237
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ItemColumnWrapperStyled, { style: styles, ...props, children });
2226
2238
  }
2227
2239
 
2228
2240
  // src/components/Timeline.tsx
@@ -2255,7 +2267,7 @@ var TimelineItemTitle = import_styled_components18.default.div`
2255
2267
  `;
2256
2268
 
2257
2269
  // src/components/Timeline.tsx
2258
- var import_jsx_runtime31 = require("react/jsx-runtime");
2270
+ var import_jsx_runtime32 = require("react/jsx-runtime");
2259
2271
  var TimelineItemStyled = (0, import_styled_components19.default)(import_web8.animated.div)`
2260
2272
  flex: 1;
2261
2273
  flex-flow: column nowrap;
@@ -2301,11 +2313,24 @@ var style = {
2301
2313
  alignItems: "center"
2302
2314
  };
2303
2315
  function Timeline(props) {
2304
- const children = import_react15.default.Children.toArray(props.children);
2305
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2316
+ const { activeIndex, ...rest } = props;
2317
+ const children = import_react15.default.Children.toArray(rest.children);
2318
+ if (activeIndex != null) {
2319
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ...rest, style: { ...style, ...rest.style }, children: children.map((child, index) => {
2320
+ if (!import_react15.default.isValidElement(child)) {
2321
+ return child;
2322
+ }
2323
+ return import_react15.default.cloneElement(child, {
2324
+ // @ts-expect-error cloning
2325
+ isPhantom: activeIndex < index,
2326
+ isLast: activeIndex === index
2327
+ });
2328
+ }) });
2329
+ }
2330
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2306
2331
  import_spectacle10.Stepper,
2307
2332
  {
2308
- ...props,
2333
+ ...rest,
2309
2334
  values: children,
2310
2335
  activeStyle: style,
2311
2336
  inactiveStyle: style,
@@ -2341,7 +2366,7 @@ function TimelineItem(props) {
2341
2366
  opacity: getItemOpacity2({ isPhantom, isLast })
2342
2367
  });
2343
2368
  const colorStyles = (0, import_web8.useSpring)({ opacity: isPhantom || isLast ? 1 : 0.15 });
2344
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
2369
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
2345
2370
  TimelineItemStyled,
2346
2371
  {
2347
2372
  ...rest,
@@ -2349,24 +2374,24 @@ function TimelineItem(props) {
2349
2374
  ...appearStyles
2350
2375
  },
2351
2376
  children: [
2352
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(TimelineItemContentPhantom, { children: [
2353
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TimelineItemTitle, { children: title }),
2354
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TimelineItemBody, { children })
2377
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(TimelineItemContentPhantom, { children: [
2378
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TimelineItemTitle, { children: title }),
2379
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TimelineItemBody, { children })
2355
2380
  ] }),
2356
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(TimelineItemGuide, { style: colorStyles, children: [
2357
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Hexagon, {}),
2358
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TimelineItemGuideLine, { style: guideLineProps })
2381
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(TimelineItemGuide, { style: colorStyles, children: [
2382
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Hexagon, {}),
2383
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TimelineItemGuideLine, { style: guideLineProps })
2359
2384
  ] }),
2360
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(TimelineItemContent, { children: [
2361
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TimelineItemTitle, { children: title }),
2362
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TimelineItemBody, { children })
2385
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(TimelineItemContent, { children: [
2386
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TimelineItemTitle, { children: title }),
2387
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TimelineItemBody, { children })
2363
2388
  ] })
2364
2389
  ]
2365
2390
  }
2366
2391
  );
2367
2392
  }
2368
2393
  function Hexagon() {
2369
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
2394
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
2370
2395
  "svg",
2371
2396
  {
2372
2397
  width: "18",
@@ -2375,14 +2400,14 @@ function Hexagon() {
2375
2400
  fill: "none",
2376
2401
  xmlns: "http://www.w3.org/2000/svg",
2377
2402
  children: [
2378
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2403
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2379
2404
  "path",
2380
2405
  {
2381
2406
  d: "M8.64717 20L0 15.0094V5.00134L8.64717 0L17.289 5.00134V15.0094L8.64717 20ZM1.48222 14.141L8.64717 18.2846L15.8068 14.141V5.85902L8.64717 1.71536L1.48222 5.85902V14.141Z",
2382
2407
  fill: "#F49676"
2383
2408
  }
2384
2409
  ),
2385
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2410
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2386
2411
  "path",
2387
2412
  {
2388
2413
  d: "M 8.758 16.01 L 3.549 13.004 L 3.549 6.975 L 8.758 3.963 L 13.964 6.975 L 13.964 13.004 L 8.758 16.01 Z",
@@ -2395,9 +2420,9 @@ function Hexagon() {
2395
2420
  }
2396
2421
 
2397
2422
  // src/index.tsx
2398
- var import_jsx_runtime32 = require("react/jsx-runtime");
2423
+ var import_jsx_runtime33 = require("react/jsx-runtime");
2399
2424
  function PassThrough({ children }) {
2400
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children });
2425
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children });
2401
2426
  }
2402
2427
  var layouts = layouts_default;
2403
2428
  var componentsMap2 = {
@@ -2433,9 +2458,9 @@ function Deck({
2433
2458
  }
2434
2459
  `;
2435
2460
  }, [theme, mergedTheme]);
2436
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react17.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PestacleProvider, { layouts: layouts2, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react16.MDXProvider, { components: componentsMap2, children: [
2437
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(GlobalStyle, {}),
2438
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2461
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react17.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PestacleProvider, { layouts: layouts2, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react16.MDXProvider, { components: componentsMap2, children: [
2462
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GlobalStyle, {}),
2463
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2439
2464
  import_spectacle11.Deck,
2440
2465
  {
2441
2466
  theme: mergedTheme,
@@ -2446,33 +2471,33 @@ function Deck({
2446
2471
  const Component = slide.slideComponent;
2447
2472
  const slideTransitionName = (_a = slide.metadata) == null ? void 0 : _a.transition;
2448
2473
  const slideTransition2 = resolveTransition(slideTransitionName);
2449
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_spectacle11.Slide, { transition: slideTransition2, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Component, {}) }, i);
2474
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_spectacle11.Slide, { transition: slideTransition2, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Component, {}) }, i);
2450
2475
  })
2451
2476
  }
2452
2477
  )
2453
2478
  ] }) }) });
2454
2479
  }
2455
2480
  function Danger({ children }) {
2456
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: { color: "red" }, children });
2481
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { color: "red" }, children });
2457
2482
  }
2458
2483
  function Information({ children }) {
2459
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: { color: "orange" }, children });
2484
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { color: "orange" }, children });
2460
2485
  }
2461
2486
  function Success({ children }) {
2462
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: { color: "green" }, children });
2487
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { color: "green" }, children });
2463
2488
  }
2464
2489
  function Warning({ children }) {
2465
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: { color: "yellow" }, children });
2490
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { color: "yellow" }, children });
2466
2491
  }
2467
2492
  function Side({ children }) {
2468
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children });
2493
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children });
2469
2494
  }
2470
2495
  Side.mdxType = "Side";
2471
2496
  function Documentation({ children }) {
2472
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children });
2497
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children });
2473
2498
  }
2474
2499
  function Box2({ children }) {
2475
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children });
2500
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children });
2476
2501
  }
2477
2502
 
2478
2503
  // <stdin>
package/index.mjs CHANGED
@@ -1038,7 +1038,10 @@ function FullImageLayout({
1038
1038
  children,
1039
1039
  image,
1040
1040
  position = "bottom",
1041
- dim = 0.4
1041
+ dim = 0.4,
1042
+ fit = "cover",
1043
+ backgroundColor,
1044
+ margin
1042
1045
  }) {
1043
1046
  const [images, rest] = getMatchingMdxType(children, "Image");
1044
1047
  const firstImage = images[0];
@@ -1063,8 +1066,11 @@ function FullImageLayout({
1063
1066
  position: "absolute",
1064
1067
  inset: 0,
1065
1068
  backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0,
1066
- backgroundSize: "cover",
1067
- backgroundPosition: "center"
1069
+ backgroundSize: fit,
1070
+ backgroundPosition: "center",
1071
+ backgroundRepeat: "no-repeat",
1072
+ backgroundColor,
1073
+ margin
1068
1074
  }
1069
1075
  }
1070
1076
  ),
@@ -1947,17 +1953,23 @@ function DocItem({ label, link }) {
1947
1953
 
1948
1954
  // src/components/FilePane.tsx
1949
1955
  import React12 from "react";
1956
+ import { jsx as jsx28 } from "react/jsx-runtime";
1950
1957
  function FilePane({
1951
1958
  name,
1952
1959
  children,
1953
1960
  priority,
1961
+ minWidth,
1954
1962
  ...divProps
1955
1963
  }) {
1956
- return React12.isValidElement(children) ? React12.cloneElement(children, {
1964
+ const content = React12.isValidElement(children) ? React12.cloneElement(children, {
1957
1965
  // @ts-expect-error cloning
1958
1966
  priority,
1959
1967
  name
1960
1968
  }) : children;
1969
+ if (minWidth) {
1970
+ return /* @__PURE__ */ jsx28("div", { ...divProps, style: { minWidth, ...divProps.style }, children: content });
1971
+ }
1972
+ return content;
1961
1973
  }
1962
1974
  FilePane.mdxType = "FilePane";
1963
1975
 
@@ -1966,7 +1978,7 @@ import { animated as animated6, useSpring as useSpring5 } from "@react-spring/we
1966
1978
  import React13 from "react";
1967
1979
  import { Stepper as Stepper2 } from "spectacle";
1968
1980
  import styled15 from "styled-components";
1969
- import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
1981
+ import { jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
1970
1982
  var Container = styled15.div`
1971
1983
  display: grid;
1972
1984
  grid-gap: 2rem;
@@ -1976,7 +1988,7 @@ function HorizontalList({
1976
1988
  columns = 3
1977
1989
  }) {
1978
1990
  const items = React13.Children.toArray(children);
1979
- return /* @__PURE__ */ jsx28(Stepper2, { values: items, children: (_, step) => /* @__PURE__ */ jsx28(
1991
+ return /* @__PURE__ */ jsx29(Stepper2, { values: items, children: (_, step) => /* @__PURE__ */ jsx29(
1980
1992
  Container,
1981
1993
  {
1982
1994
  style: {
@@ -1997,7 +2009,7 @@ function HorizontalList({
1997
2009
  ) });
1998
2010
  }
1999
2011
  function Pill({ position }) {
2000
- return /* @__PURE__ */ jsx28(
2012
+ return /* @__PURE__ */ jsx29(
2001
2013
  "div",
2002
2014
  {
2003
2015
  style: { width: 48, transform: "translate(-25%, -25%)", opacity: 0.9 },
@@ -2010,14 +2022,14 @@ function Pill({ position }) {
2010
2022
  fill: "none",
2011
2023
  xmlns: "http://www.w3.org/2000/svg",
2012
2024
  children: [
2013
- /* @__PURE__ */ jsx28(
2025
+ /* @__PURE__ */ jsx29(
2014
2026
  "path",
2015
2027
  {
2016
2028
  d: "M8.64717 20L0 15.0094V5.00134L8.64717 0L17.289 5.00134V15.0094L8.64717 20ZM1.48222 14.141L8.64717 18.2846L15.8068 14.141V5.85902L8.64717 1.71536L1.48222 5.85902V14.141Z",
2017
2029
  fill: "#ffffff"
2018
2030
  }
2019
2031
  ),
2020
- /* @__PURE__ */ jsx28(
2032
+ /* @__PURE__ */ jsx29(
2021
2033
  "text",
2022
2034
  {
2023
2035
  x: "9",
@@ -2029,7 +2041,7 @@ function Pill({ position }) {
2029
2041
  children: position
2030
2042
  }
2031
2043
  ),
2032
- /* @__PURE__ */ jsx28(
2044
+ /* @__PURE__ */ jsx29(
2033
2045
  "path",
2034
2046
  {
2035
2047
  d: "M 8.758 16.01 L 3.549 13.004 L 3.549 6.975 L 8.758 3.963 L 13.964 6.975 L 13.964 13.004 L 8.758 16.01 Z",
@@ -2085,16 +2097,16 @@ function HorizontalListItem({
2085
2097
  });
2086
2098
  return /* @__PURE__ */ jsxs19(Item, { style: opacityStyles, children: [
2087
2099
  /* @__PURE__ */ jsxs19(ItemHead, { children: [
2088
- /* @__PURE__ */ jsx28(Pill, { position }),
2089
- /* @__PURE__ */ jsx28("p", { children: title })
2100
+ /* @__PURE__ */ jsx29(Pill, { position }),
2101
+ /* @__PURE__ */ jsx29("p", { children: title })
2090
2102
  ] }),
2091
- /* @__PURE__ */ jsx28(ItemContent, { children })
2103
+ /* @__PURE__ */ jsx29(ItemContent, { children })
2092
2104
  ] });
2093
2105
  }
2094
2106
 
2095
2107
  // src/components/IconBox.tsx
2096
2108
  import styled16 from "styled-components";
2097
- import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
2109
+ import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
2098
2110
  var IconBoxContent = styled16.div`
2099
2111
  * {
2100
2112
  margin: 0.2rem !important;
@@ -2115,8 +2127,8 @@ function IconBox({
2115
2127
  padding: "1rem 0"
2116
2128
  },
2117
2129
  children: [
2118
- /* @__PURE__ */ jsx29("div", { style: { fontSize: 60 }, children: icon }),
2119
- /* @__PURE__ */ jsx29(IconBoxContent, { children })
2130
+ /* @__PURE__ */ jsx30("div", { style: { fontSize: 60 }, children: icon }),
2131
+ /* @__PURE__ */ jsx30(IconBoxContent, { children })
2120
2132
  ]
2121
2133
  }
2122
2134
  );
@@ -2127,11 +2139,11 @@ import { animated as animated7, useSpring as useSpring6 } from "@react-spring/we
2127
2139
  import React14 from "react";
2128
2140
  import { Stepper as Stepper3 } from "spectacle";
2129
2141
  import styled17 from "styled-components";
2130
- import { jsx as jsx30 } from "react/jsx-runtime";
2142
+ import { jsx as jsx31 } from "react/jsx-runtime";
2131
2143
  function ItemsColumn(divProps) {
2132
2144
  const { style: style2, children, ...props } = divProps;
2133
2145
  const childrenArray = React14.Children.toArray(children);
2134
- return /* @__PURE__ */ jsx30(Stepper3, { values: childrenArray, children: (_value, step) => /* @__PURE__ */ jsx30(
2146
+ return /* @__PURE__ */ jsx31(Stepper3, { values: childrenArray, children: (_value, step) => /* @__PURE__ */ jsx31(
2135
2147
  "div",
2136
2148
  {
2137
2149
  style: {
@@ -2149,7 +2161,7 @@ function ItemsColumn(divProps) {
2149
2161
  if (!React14.isValidElement(child)) {
2150
2162
  return child;
2151
2163
  }
2152
- return /* @__PURE__ */ jsx30(ItemColumnWrapper, { isVisible, children: child }, index);
2164
+ return /* @__PURE__ */ jsx31(ItemColumnWrapper, { isVisible, children: child }, index);
2153
2165
  })
2154
2166
  }
2155
2167
  ) });
@@ -2167,7 +2179,7 @@ function ItemColumnWrapper({
2167
2179
  ...props
2168
2180
  }) {
2169
2181
  const styles = useSpring6({ opacity: isVisible ? 1 : 0 });
2170
- return /* @__PURE__ */ jsx30(ItemColumnWrapperStyled, { style: styles, ...props, children });
2182
+ return /* @__PURE__ */ jsx31(ItemColumnWrapperStyled, { style: styles, ...props, children });
2171
2183
  }
2172
2184
 
2173
2185
  // src/components/Timeline.tsx
@@ -2200,7 +2212,7 @@ var TimelineItemTitle = styled18.div`
2200
2212
  `;
2201
2213
 
2202
2214
  // src/components/Timeline.tsx
2203
- import { jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
2215
+ import { jsx as jsx32, jsxs as jsxs21 } from "react/jsx-runtime";
2204
2216
  var TimelineItemStyled = styled19(animated8.div)`
2205
2217
  flex: 1;
2206
2218
  flex-flow: column nowrap;
@@ -2246,11 +2258,24 @@ var style = {
2246
2258
  alignItems: "center"
2247
2259
  };
2248
2260
  function Timeline(props) {
2249
- const children = React15.Children.toArray(props.children);
2250
- return /* @__PURE__ */ jsx31(
2261
+ const { activeIndex, ...rest } = props;
2262
+ const children = React15.Children.toArray(rest.children);
2263
+ if (activeIndex != null) {
2264
+ return /* @__PURE__ */ jsx32("div", { ...rest, style: { ...style, ...rest.style }, children: children.map((child, index) => {
2265
+ if (!React15.isValidElement(child)) {
2266
+ return child;
2267
+ }
2268
+ return React15.cloneElement(child, {
2269
+ // @ts-expect-error cloning
2270
+ isPhantom: activeIndex < index,
2271
+ isLast: activeIndex === index
2272
+ });
2273
+ }) });
2274
+ }
2275
+ return /* @__PURE__ */ jsx32(
2251
2276
  Stepper4,
2252
2277
  {
2253
- ...props,
2278
+ ...rest,
2254
2279
  values: children,
2255
2280
  activeStyle: style,
2256
2281
  inactiveStyle: style,
@@ -2295,16 +2320,16 @@ function TimelineItem(props) {
2295
2320
  },
2296
2321
  children: [
2297
2322
  /* @__PURE__ */ jsxs21(TimelineItemContentPhantom, { children: [
2298
- /* @__PURE__ */ jsx31(TimelineItemTitle, { children: title }),
2299
- /* @__PURE__ */ jsx31(TimelineItemBody, { children })
2323
+ /* @__PURE__ */ jsx32(TimelineItemTitle, { children: title }),
2324
+ /* @__PURE__ */ jsx32(TimelineItemBody, { children })
2300
2325
  ] }),
2301
2326
  /* @__PURE__ */ jsxs21(TimelineItemGuide, { style: colorStyles, children: [
2302
- /* @__PURE__ */ jsx31(Hexagon, {}),
2303
- /* @__PURE__ */ jsx31(TimelineItemGuideLine, { style: guideLineProps })
2327
+ /* @__PURE__ */ jsx32(Hexagon, {}),
2328
+ /* @__PURE__ */ jsx32(TimelineItemGuideLine, { style: guideLineProps })
2304
2329
  ] }),
2305
2330
  /* @__PURE__ */ jsxs21(TimelineItemContent, { children: [
2306
- /* @__PURE__ */ jsx31(TimelineItemTitle, { children: title }),
2307
- /* @__PURE__ */ jsx31(TimelineItemBody, { children })
2331
+ /* @__PURE__ */ jsx32(TimelineItemTitle, { children: title }),
2332
+ /* @__PURE__ */ jsx32(TimelineItemBody, { children })
2308
2333
  ] })
2309
2334
  ]
2310
2335
  }
@@ -2320,14 +2345,14 @@ function Hexagon() {
2320
2345
  fill: "none",
2321
2346
  xmlns: "http://www.w3.org/2000/svg",
2322
2347
  children: [
2323
- /* @__PURE__ */ jsx31(
2348
+ /* @__PURE__ */ jsx32(
2324
2349
  "path",
2325
2350
  {
2326
2351
  d: "M8.64717 20L0 15.0094V5.00134L8.64717 0L17.289 5.00134V15.0094L8.64717 20ZM1.48222 14.141L8.64717 18.2846L15.8068 14.141V5.85902L8.64717 1.71536L1.48222 5.85902V14.141Z",
2327
2352
  fill: "#F49676"
2328
2353
  }
2329
2354
  ),
2330
- /* @__PURE__ */ jsx31(
2355
+ /* @__PURE__ */ jsx32(
2331
2356
  "path",
2332
2357
  {
2333
2358
  d: "M 8.758 16.01 L 3.549 13.004 L 3.549 6.975 L 8.758 3.963 L 13.964 6.975 L 13.964 13.004 L 8.758 16.01 Z",
@@ -2340,9 +2365,9 @@ function Hexagon() {
2340
2365
  }
2341
2366
 
2342
2367
  // src/index.tsx
2343
- import { Fragment as Fragment3, jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
2368
+ import { Fragment as Fragment3, jsx as jsx33, jsxs as jsxs22 } from "react/jsx-runtime";
2344
2369
  function PassThrough({ children }) {
2345
- return /* @__PURE__ */ jsx32(Fragment3, { children });
2370
+ return /* @__PURE__ */ jsx33(Fragment3, { children });
2346
2371
  }
2347
2372
  var layouts = layouts_default;
2348
2373
  var componentsMap2 = {
@@ -2378,9 +2403,9 @@ function Deck({
2378
2403
  }
2379
2404
  `;
2380
2405
  }, [theme, mergedTheme]);
2381
- return /* @__PURE__ */ jsx32(React16.StrictMode, { children: /* @__PURE__ */ jsx32(PestacleProvider, { layouts: layouts2, children: /* @__PURE__ */ jsxs22(MDXProvider, { components: componentsMap2, children: [
2382
- /* @__PURE__ */ jsx32(GlobalStyle, {}),
2383
- /* @__PURE__ */ jsx32(
2406
+ return /* @__PURE__ */ jsx33(React16.StrictMode, { children: /* @__PURE__ */ jsx33(PestacleProvider, { layouts: layouts2, children: /* @__PURE__ */ jsxs22(MDXProvider, { components: componentsMap2, children: [
2407
+ /* @__PURE__ */ jsx33(GlobalStyle, {}),
2408
+ /* @__PURE__ */ jsx33(
2384
2409
  SpectacleDeck,
2385
2410
  {
2386
2411
  theme: mergedTheme,
@@ -2391,33 +2416,33 @@ function Deck({
2391
2416
  const Component = slide.slideComponent;
2392
2417
  const slideTransitionName = (_a = slide.metadata) == null ? void 0 : _a.transition;
2393
2418
  const slideTransition2 = resolveTransition(slideTransitionName);
2394
- return /* @__PURE__ */ jsx32(Slide, { transition: slideTransition2, children: /* @__PURE__ */ jsx32(Component, {}) }, i);
2419
+ return /* @__PURE__ */ jsx33(Slide, { transition: slideTransition2, children: /* @__PURE__ */ jsx33(Component, {}) }, i);
2395
2420
  })
2396
2421
  }
2397
2422
  )
2398
2423
  ] }) }) });
2399
2424
  }
2400
2425
  function Danger({ children }) {
2401
- return /* @__PURE__ */ jsx32("div", { style: { color: "red" }, children });
2426
+ return /* @__PURE__ */ jsx33("div", { style: { color: "red" }, children });
2402
2427
  }
2403
2428
  function Information({ children }) {
2404
- return /* @__PURE__ */ jsx32("div", { style: { color: "orange" }, children });
2429
+ return /* @__PURE__ */ jsx33("div", { style: { color: "orange" }, children });
2405
2430
  }
2406
2431
  function Success({ children }) {
2407
- return /* @__PURE__ */ jsx32("div", { style: { color: "green" }, children });
2432
+ return /* @__PURE__ */ jsx33("div", { style: { color: "green" }, children });
2408
2433
  }
2409
2434
  function Warning({ children }) {
2410
- return /* @__PURE__ */ jsx32("div", { style: { color: "yellow" }, children });
2435
+ return /* @__PURE__ */ jsx33("div", { style: { color: "yellow" }, children });
2411
2436
  }
2412
2437
  function Side({ children }) {
2413
- return /* @__PURE__ */ jsx32("div", { children });
2438
+ return /* @__PURE__ */ jsx33("div", { children });
2414
2439
  }
2415
2440
  Side.mdxType = "Side";
2416
2441
  function Documentation({ children }) {
2417
- return /* @__PURE__ */ jsx32("div", { children });
2442
+ return /* @__PURE__ */ jsx33("div", { children });
2418
2443
  }
2419
2444
  function Box2({ children }) {
2420
- return /* @__PURE__ */ jsx32("div", { children });
2445
+ return /* @__PURE__ */ jsx33("div", { children });
2421
2446
  }
2422
2447
  export {
2423
2448
  AnimatedCounter,
@@ -1,7 +1,10 @@
1
1
  import React from "react";
2
- export declare function FullImageLayout({ children, image, position, dim, }: {
2
+ export declare function FullImageLayout({ children, image, position, dim, fit, backgroundColor, margin, }: {
3
3
  children: React.ReactNode;
4
4
  image?: string;
5
5
  position?: "center" | "bottom" | "top";
6
6
  dim?: number;
7
+ fit?: "cover" | "contain";
8
+ backgroundColor?: string;
9
+ margin?: string;
7
10
  }): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpichot/spectacle-deck",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "index.cjs",