@gpichot/spectacle-deck 1.5.0 → 1.7.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
@@ -61,8 +61,8 @@ __export(src_exports, {
61
61
  noneTransition: () => noneTransition,
62
62
  resolveTransition: () => resolveTransition
63
63
  });
64
- var import_react15 = require("@mdx-js/react");
65
- var import_react16 = __toESM(require("react"));
64
+ var import_react16 = require("@mdx-js/react");
65
+ var import_react17 = __toESM(require("react"));
66
66
  var import_spectacle11 = require("spectacle");
67
67
  var import_styled_components20 = require("styled-components");
68
68
 
@@ -528,6 +528,11 @@ var HeadingTwo = import_styled_components2.default.h2`
528
528
  font-family: Bitter, \"Helvetica Neue\", Helvetica, Arial, sans-serif;
529
529
  font-size: 55px;
530
530
  font-weight: 400;
531
+
532
+ strong {
533
+ color: var(--color-secondary);
534
+ font-weight: 500;
535
+ }
531
536
  `;
532
537
  var HeadingThree = import_styled_components2.default.h3`
533
538
  font-family: Bitter, \"Helvetica Neue\", Helvetica, Arial, sans-serif;
@@ -1066,6 +1071,7 @@ var Default3Layout = ({
1066
1071
  };
1067
1072
 
1068
1073
  // src/layouts/FullImageLayout.tsx
1074
+ var import_react7 = __toESM(require("react"));
1069
1075
  var import_styled_components6 = __toESM(require("styled-components"));
1070
1076
  var import_jsx_runtime10 = require("react/jsx-runtime");
1071
1077
  var Overlay = import_styled_components6.default.div`
@@ -1092,6 +1098,9 @@ function FullImageLayout({
1092
1098
  position = "bottom",
1093
1099
  dim = 0.4
1094
1100
  }) {
1101
+ const [images, rest] = getMatchingMdxType(children, "Image");
1102
+ const firstImage = images[0];
1103
+ const backgroundImage = image || (import_react7.default.isValidElement(firstImage) ? firstImage.props.src : void 0);
1095
1104
  const justifyMap = {
1096
1105
  top: "flex-start",
1097
1106
  center: "center",
@@ -1111,7 +1120,7 @@ function FullImageLayout({
1111
1120
  style: {
1112
1121
  position: "absolute",
1113
1122
  inset: 0,
1114
- backgroundImage: `url(${image})`,
1123
+ backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0,
1115
1124
  backgroundSize: "cover",
1116
1125
  backgroundPosition: "center"
1117
1126
  }
@@ -1127,7 +1136,7 @@ function FullImageLayout({
1127
1136
  }
1128
1137
  }
1129
1138
  ),
1130
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Overlay, { style: { justifyContent: justifyMap[position] }, children })
1139
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Overlay, { style: { justifyContent: justifyMap[position] }, children: firstImage ? rest : children })
1131
1140
  ]
1132
1141
  }
1133
1142
  );
@@ -1281,7 +1290,7 @@ var SectionLayout = import_styled_components8.default.div`
1281
1290
  var import_styled_components10 = __toESM(require("styled-components"));
1282
1291
 
1283
1292
  // src/layouts/columns.tsx
1284
- var import_react7 = __toESM(require("react"));
1293
+ var import_react8 = __toESM(require("react"));
1285
1294
  var import_styled_components9 = __toESM(require("styled-components"));
1286
1295
  var import_jsx_runtime13 = require("react/jsx-runtime");
1287
1296
  var DivWithHeading = import_styled_components9.default.div`
@@ -1307,7 +1316,7 @@ function ColumnsLayout({
1307
1316
  children,
1308
1317
  reverse
1309
1318
  }) {
1310
- const childrenArray = import_react7.default.Children.toArray(children);
1319
+ const childrenArray = import_react8.default.Children.toArray(children);
1311
1320
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1312
1321
  ColumnsContainer,
1313
1322
  {
@@ -1636,11 +1645,11 @@ __reExport(src_exports, require("spectacle"));
1636
1645
  var import_web = require("@react-spring/web");
1637
1646
 
1638
1647
  // src/components/animations/useInView.ts
1639
- var import_react8 = __toESM(require("react"));
1648
+ var import_react9 = __toESM(require("react"));
1640
1649
  function useInView() {
1641
- const ref = import_react8.default.useRef(null);
1642
- const [isInView, setIsInView] = import_react8.default.useState(false);
1643
- import_react8.default.useEffect(() => {
1650
+ const ref = import_react9.default.useRef(null);
1651
+ const [isInView, setIsInView] = import_react9.default.useState(false);
1652
+ import_react9.default.useEffect(() => {
1644
1653
  const el = ref.current;
1645
1654
  if (!el) return;
1646
1655
  const observer = new IntersectionObserver(
@@ -1838,7 +1847,7 @@ function Spotlight({
1838
1847
 
1839
1848
  // src/components/animations/StaggerChildren.tsx
1840
1849
  var import_web5 = require("@react-spring/web");
1841
- var import_react9 = __toESM(require("react"));
1850
+ var import_react10 = __toESM(require("react"));
1842
1851
  var import_jsx_runtime25 = require("react/jsx-runtime");
1843
1852
  function StaggerChildren({
1844
1853
  children,
@@ -1849,7 +1858,7 @@ function StaggerChildren({
1849
1858
  distance = 20
1850
1859
  }) {
1851
1860
  const [ref, isInView] = useInView();
1852
- const items = import_react9.default.Children.toArray(children);
1861
+ const items = import_react10.default.Children.toArray(children);
1853
1862
  const translateMap = {
1854
1863
  up: `translateY(${distance}px)`,
1855
1864
  down: `translateY(-${distance}px)`,
@@ -1870,14 +1879,14 @@ function StaggerChildren({
1870
1879
  }
1871
1880
 
1872
1881
  // src/components/animations/TypeWriter.tsx
1873
- var import_react10 = __toESM(require("react"));
1882
+ var import_react11 = __toESM(require("react"));
1874
1883
  var import_jsx_runtime26 = require("react/jsx-runtime");
1875
1884
  function extractText(node) {
1876
1885
  if (typeof node === "string") return node;
1877
1886
  if (typeof node === "number") return String(node);
1878
1887
  if (!node) return "";
1879
1888
  if (Array.isArray(node)) return node.map(extractText).join("");
1880
- if (import_react10.default.isValidElement(node)) {
1889
+ if (import_react11.default.isValidElement(node)) {
1881
1890
  const props = node.props;
1882
1891
  return extractText(props.children);
1883
1892
  }
@@ -1891,9 +1900,9 @@ function TypeWriter({
1891
1900
  }) {
1892
1901
  const text = extractText(children);
1893
1902
  const [ref, isInView] = useInView();
1894
- const [displayed, setDisplayed] = import_react10.default.useState("");
1895
- const [done, setDone] = import_react10.default.useState(false);
1896
- import_react10.default.useEffect(() => {
1903
+ const [displayed, setDisplayed] = import_react11.default.useState("");
1904
+ const [done, setDone] = import_react11.default.useState(false);
1905
+ import_react11.default.useEffect(() => {
1897
1906
  if (!isInView) return;
1898
1907
  let index = 0;
1899
1908
  setDisplayed("");
@@ -1992,27 +2001,33 @@ function DocItem({ label, link }) {
1992
2001
  }
1993
2002
 
1994
2003
  // src/components/FilePane.tsx
1995
- var import_react11 = __toESM(require("react"));
2004
+ var import_react12 = __toESM(require("react"));
2005
+ var import_jsx_runtime28 = require("react/jsx-runtime");
1996
2006
  function FilePane({
1997
2007
  name,
1998
2008
  children,
1999
2009
  priority,
2010
+ minWidth,
2000
2011
  ...divProps
2001
2012
  }) {
2002
- return import_react11.default.isValidElement(children) ? import_react11.default.cloneElement(children, {
2013
+ const content = import_react12.default.isValidElement(children) ? import_react12.default.cloneElement(children, {
2003
2014
  // @ts-expect-error cloning
2004
2015
  priority,
2005
2016
  name
2006
2017
  }) : children;
2018
+ if (minWidth) {
2019
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { ...divProps, style: { minWidth, ...divProps.style }, children: content });
2020
+ }
2021
+ return content;
2007
2022
  }
2008
2023
  FilePane.mdxType = "FilePane";
2009
2024
 
2010
2025
  // src/components/HorizontalList.tsx
2011
2026
  var import_web6 = require("@react-spring/web");
2012
- var import_react12 = __toESM(require("react"));
2027
+ var import_react13 = __toESM(require("react"));
2013
2028
  var import_spectacle8 = require("spectacle");
2014
2029
  var import_styled_components15 = __toESM(require("styled-components"));
2015
- var import_jsx_runtime28 = require("react/jsx-runtime");
2030
+ var import_jsx_runtime29 = require("react/jsx-runtime");
2016
2031
  var Container = import_styled_components15.default.div`
2017
2032
  display: grid;
2018
2033
  grid-gap: 2rem;
@@ -2021,18 +2036,18 @@ function HorizontalList({
2021
2036
  children,
2022
2037
  columns = 3
2023
2038
  }) {
2024
- const items = import_react12.default.Children.toArray(children);
2025
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_spectacle8.Stepper, { values: items, children: (_, step) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2039
+ const items = import_react13.default.Children.toArray(children);
2040
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_spectacle8.Stepper, { values: items, children: (_, step) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2026
2041
  Container,
2027
2042
  {
2028
2043
  style: {
2029
2044
  gridTemplateColumns: `repeat(${columns}, 1fr)`
2030
2045
  },
2031
2046
  children: items.map((item, k) => {
2032
- if (!import_react12.default.isValidElement(item)) {
2047
+ if (!import_react13.default.isValidElement(item)) {
2033
2048
  return item;
2034
2049
  }
2035
- return import_react12.default.cloneElement(item, {
2050
+ return import_react13.default.cloneElement(item, {
2036
2051
  // @ts-expect-error cloning
2037
2052
  position: k + 1,
2038
2053
  isVisible: k <= step,
@@ -2043,11 +2058,11 @@ function HorizontalList({
2043
2058
  ) });
2044
2059
  }
2045
2060
  function Pill({ position }) {
2046
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2061
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2047
2062
  "div",
2048
2063
  {
2049
2064
  style: { width: 48, transform: "translate(-25%, -25%)", opacity: 0.9 },
2050
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2065
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
2051
2066
  "svg",
2052
2067
  {
2053
2068
  width: "48",
@@ -2056,14 +2071,14 @@ function Pill({ position }) {
2056
2071
  fill: "none",
2057
2072
  xmlns: "http://www.w3.org/2000/svg",
2058
2073
  children: [
2059
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2074
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2060
2075
  "path",
2061
2076
  {
2062
2077
  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",
2063
2078
  fill: "#ffffff"
2064
2079
  }
2065
2080
  ),
2066
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2081
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2067
2082
  "text",
2068
2083
  {
2069
2084
  x: "9",
@@ -2075,7 +2090,7 @@ function Pill({ position }) {
2075
2090
  children: position
2076
2091
  }
2077
2092
  ),
2078
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2093
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2079
2094
  "path",
2080
2095
  {
2081
2096
  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",
@@ -2129,18 +2144,18 @@ function HorizontalListItem({
2129
2144
  const opacityStyles = (0, import_web6.useSpring)({
2130
2145
  opacity: getItemOpacity({ isVisible, isLast })
2131
2146
  });
2132
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Item, { style: opacityStyles, children: [
2133
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(ItemHead, { children: [
2134
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Pill, { position }),
2135
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: title })
2147
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Item, { style: opacityStyles, children: [
2148
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(ItemHead, { children: [
2149
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Pill, { position }),
2150
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { children: title })
2136
2151
  ] }),
2137
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ItemContent, { children })
2152
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ItemContent, { children })
2138
2153
  ] });
2139
2154
  }
2140
2155
 
2141
2156
  // src/components/IconBox.tsx
2142
2157
  var import_styled_components16 = __toESM(require("styled-components"));
2143
- var import_jsx_runtime29 = require("react/jsx-runtime");
2158
+ var import_jsx_runtime30 = require("react/jsx-runtime");
2144
2159
  var IconBoxContent = import_styled_components16.default.div`
2145
2160
  * {
2146
2161
  margin: 0.2rem !important;
@@ -2151,7 +2166,7 @@ function IconBox({
2151
2166
  children,
2152
2167
  icon
2153
2168
  }) {
2154
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
2169
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2155
2170
  "div",
2156
2171
  {
2157
2172
  style: {
@@ -2161,8 +2176,8 @@ function IconBox({
2161
2176
  padding: "1rem 0"
2162
2177
  },
2163
2178
  children: [
2164
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { style: { fontSize: 60 }, children: icon }),
2165
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(IconBoxContent, { children })
2179
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { style: { fontSize: 60 }, children: icon }),
2180
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(IconBoxContent, { children })
2166
2181
  ]
2167
2182
  }
2168
2183
  );
@@ -2170,14 +2185,14 @@ function IconBox({
2170
2185
 
2171
2186
  // src/components/ItemsColumn.tsx
2172
2187
  var import_web7 = require("@react-spring/web");
2173
- var import_react13 = __toESM(require("react"));
2188
+ var import_react14 = __toESM(require("react"));
2174
2189
  var import_spectacle9 = require("spectacle");
2175
2190
  var import_styled_components17 = __toESM(require("styled-components"));
2176
- var import_jsx_runtime30 = require("react/jsx-runtime");
2191
+ var import_jsx_runtime31 = require("react/jsx-runtime");
2177
2192
  function ItemsColumn(divProps) {
2178
2193
  const { style: style2, children, ...props } = divProps;
2179
- const childrenArray = import_react13.default.Children.toArray(children);
2180
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_spectacle9.Stepper, { values: childrenArray, children: (_value, step) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2194
+ const childrenArray = import_react14.default.Children.toArray(children);
2195
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_spectacle9.Stepper, { values: childrenArray, children: (_value, step) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2181
2196
  "div",
2182
2197
  {
2183
2198
  style: {
@@ -2192,10 +2207,10 @@ function ItemsColumn(divProps) {
2192
2207
  ...props,
2193
2208
  children: childrenArray.map((child, index) => {
2194
2209
  const isVisible = index <= step;
2195
- if (!import_react13.default.isValidElement(child)) {
2210
+ if (!import_react14.default.isValidElement(child)) {
2196
2211
  return child;
2197
2212
  }
2198
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemColumnWrapper, { isVisible, children: child }, index);
2213
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ItemColumnWrapper, { isVisible, children: child }, index);
2199
2214
  })
2200
2215
  }
2201
2216
  ) });
@@ -2213,12 +2228,12 @@ function ItemColumnWrapper({
2213
2228
  ...props
2214
2229
  }) {
2215
2230
  const styles = (0, import_web7.useSpring)({ opacity: isVisible ? 1 : 0 });
2216
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemColumnWrapperStyled, { style: styles, ...props, children });
2231
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ItemColumnWrapperStyled, { style: styles, ...props, children });
2217
2232
  }
2218
2233
 
2219
2234
  // src/components/Timeline.tsx
2220
2235
  var import_web8 = require("@react-spring/web");
2221
- var import_react14 = __toESM(require("react"));
2236
+ var import_react15 = __toESM(require("react"));
2222
2237
  var import_spectacle10 = require("spectacle");
2223
2238
  var import_styled_components19 = __toESM(require("styled-components"));
2224
2239
 
@@ -2246,7 +2261,7 @@ var TimelineItemTitle = import_styled_components18.default.div`
2246
2261
  `;
2247
2262
 
2248
2263
  // src/components/Timeline.tsx
2249
- var import_jsx_runtime31 = require("react/jsx-runtime");
2264
+ var import_jsx_runtime32 = require("react/jsx-runtime");
2250
2265
  var TimelineItemStyled = (0, import_styled_components19.default)(import_web8.animated.div)`
2251
2266
  flex: 1;
2252
2267
  flex-flow: column nowrap;
@@ -2292,20 +2307,33 @@ var style = {
2292
2307
  alignItems: "center"
2293
2308
  };
2294
2309
  function Timeline(props) {
2295
- const children = import_react14.default.Children.toArray(props.children);
2296
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2310
+ const { activeIndex, ...rest } = props;
2311
+ const children = import_react15.default.Children.toArray(rest.children);
2312
+ if (activeIndex != null) {
2313
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ...rest, style: { ...style, ...rest.style }, children: children.map((child, index) => {
2314
+ if (!import_react15.default.isValidElement(child)) {
2315
+ return child;
2316
+ }
2317
+ return import_react15.default.cloneElement(child, {
2318
+ // @ts-expect-error cloning
2319
+ isPhantom: activeIndex < index,
2320
+ isLast: activeIndex === index
2321
+ });
2322
+ }) });
2323
+ }
2324
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2297
2325
  import_spectacle10.Stepper,
2298
2326
  {
2299
- ...props,
2327
+ ...rest,
2300
2328
  values: children,
2301
2329
  activeStyle: style,
2302
2330
  inactiveStyle: style,
2303
2331
  children: (_value, step) => {
2304
2332
  return children.map((child, index) => {
2305
- if (!import_react14.default.isValidElement(child)) {
2333
+ if (!import_react15.default.isValidElement(child)) {
2306
2334
  return child;
2307
2335
  }
2308
- return import_react14.default.cloneElement(child, {
2336
+ return import_react15.default.cloneElement(child, {
2309
2337
  // @ts-expect-error cloning
2310
2338
  isPhantom: step < index,
2311
2339
  isLast: step === index
@@ -2332,7 +2360,7 @@ function TimelineItem(props) {
2332
2360
  opacity: getItemOpacity2({ isPhantom, isLast })
2333
2361
  });
2334
2362
  const colorStyles = (0, import_web8.useSpring)({ opacity: isPhantom || isLast ? 1 : 0.15 });
2335
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
2363
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
2336
2364
  TimelineItemStyled,
2337
2365
  {
2338
2366
  ...rest,
@@ -2340,24 +2368,24 @@ function TimelineItem(props) {
2340
2368
  ...appearStyles
2341
2369
  },
2342
2370
  children: [
2343
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(TimelineItemContentPhantom, { children: [
2344
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TimelineItemTitle, { children: title }),
2345
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TimelineItemBody, { children })
2371
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(TimelineItemContentPhantom, { children: [
2372
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TimelineItemTitle, { children: title }),
2373
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TimelineItemBody, { children })
2346
2374
  ] }),
2347
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(TimelineItemGuide, { style: colorStyles, children: [
2348
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Hexagon, {}),
2349
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TimelineItemGuideLine, { style: guideLineProps })
2375
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(TimelineItemGuide, { style: colorStyles, children: [
2376
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Hexagon, {}),
2377
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TimelineItemGuideLine, { style: guideLineProps })
2350
2378
  ] }),
2351
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(TimelineItemContent, { children: [
2352
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TimelineItemTitle, { children: title }),
2353
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TimelineItemBody, { children })
2379
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(TimelineItemContent, { children: [
2380
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TimelineItemTitle, { children: title }),
2381
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TimelineItemBody, { children })
2354
2382
  ] })
2355
2383
  ]
2356
2384
  }
2357
2385
  );
2358
2386
  }
2359
2387
  function Hexagon() {
2360
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
2388
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
2361
2389
  "svg",
2362
2390
  {
2363
2391
  width: "18",
@@ -2366,14 +2394,14 @@ function Hexagon() {
2366
2394
  fill: "none",
2367
2395
  xmlns: "http://www.w3.org/2000/svg",
2368
2396
  children: [
2369
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2397
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2370
2398
  "path",
2371
2399
  {
2372
2400
  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",
2373
2401
  fill: "#F49676"
2374
2402
  }
2375
2403
  ),
2376
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2404
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2377
2405
  "path",
2378
2406
  {
2379
2407
  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",
@@ -2386,9 +2414,9 @@ function Hexagon() {
2386
2414
  }
2387
2415
 
2388
2416
  // src/index.tsx
2389
- var import_jsx_runtime32 = require("react/jsx-runtime");
2417
+ var import_jsx_runtime33 = require("react/jsx-runtime");
2390
2418
  function PassThrough({ children }) {
2391
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children });
2419
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children });
2392
2420
  }
2393
2421
  var layouts = layouts_default;
2394
2422
  var componentsMap2 = {
@@ -2401,10 +2429,10 @@ function Deck({
2401
2429
  layouts: layouts2 = layouts_default,
2402
2430
  transition
2403
2431
  }) {
2404
- import_react16.default.useEffect(() => {
2432
+ import_react17.default.useEffect(() => {
2405
2433
  document.title = deck.metadata.title || "Untitled";
2406
2434
  }, [deck.metadata.title]);
2407
- const mergedTheme = import_react16.default.useMemo(() => {
2435
+ const mergedTheme = import_react17.default.useMemo(() => {
2408
2436
  const fonts = {
2409
2437
  ...theme_default.fonts,
2410
2438
  ...theme.themeTokens.fonts ?? {}
@@ -2415,7 +2443,7 @@ function Deck({
2415
2443
  fonts
2416
2444
  };
2417
2445
  }, [theme]);
2418
- const GlobalStyle = import_react16.default.useMemo(() => {
2446
+ const GlobalStyle = import_react17.default.useMemo(() => {
2419
2447
  const cssVariables = createCssVariables(theme.themeTokens.colors);
2420
2448
  return import_styled_components20.createGlobalStyle`
2421
2449
  :root {
@@ -2424,9 +2452,9 @@ function Deck({
2424
2452
  }
2425
2453
  `;
2426
2454
  }, [theme, mergedTheme]);
2427
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react16.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PestacleProvider, { layouts: layouts2, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react15.MDXProvider, { components: componentsMap2, children: [
2428
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(GlobalStyle, {}),
2429
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2455
+ 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: [
2456
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GlobalStyle, {}),
2457
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2430
2458
  import_spectacle11.Deck,
2431
2459
  {
2432
2460
  theme: mergedTheme,
@@ -2437,33 +2465,33 @@ function Deck({
2437
2465
  const Component = slide.slideComponent;
2438
2466
  const slideTransitionName = (_a = slide.metadata) == null ? void 0 : _a.transition;
2439
2467
  const slideTransition2 = resolveTransition(slideTransitionName);
2440
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_spectacle11.Slide, { transition: slideTransition2, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Component, {}) }, i);
2468
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_spectacle11.Slide, { transition: slideTransition2, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Component, {}) }, i);
2441
2469
  })
2442
2470
  }
2443
2471
  )
2444
2472
  ] }) }) });
2445
2473
  }
2446
2474
  function Danger({ children }) {
2447
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: { color: "red" }, children });
2475
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { color: "red" }, children });
2448
2476
  }
2449
2477
  function Information({ children }) {
2450
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: { color: "orange" }, children });
2478
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { color: "orange" }, children });
2451
2479
  }
2452
2480
  function Success({ children }) {
2453
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: { color: "green" }, children });
2481
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { color: "green" }, children });
2454
2482
  }
2455
2483
  function Warning({ children }) {
2456
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: { color: "yellow" }, children });
2484
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { color: "yellow" }, children });
2457
2485
  }
2458
2486
  function Side({ children }) {
2459
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children });
2487
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children });
2460
2488
  }
2461
2489
  Side.mdxType = "Side";
2462
2490
  function Documentation({ children }) {
2463
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children });
2491
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children });
2464
2492
  }
2465
2493
  function Box2({ children }) {
2466
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children });
2494
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children });
2467
2495
  }
2468
2496
 
2469
2497
  // <stdin>
package/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/index.tsx
2
2
  import { MDXProvider } from "@mdx-js/react";
3
- import React15 from "react";
3
+ import React16 from "react";
4
4
  import { Slide, Deck as SpectacleDeck } from "spectacle";
5
5
  import { createGlobalStyle } from "styled-components";
6
6
 
@@ -470,6 +470,11 @@ var HeadingTwo = styled2.h2`
470
470
  font-family: Bitter, \"Helvetica Neue\", Helvetica, Arial, sans-serif;
471
471
  font-size: 55px;
472
472
  font-weight: 400;
473
+
474
+ strong {
475
+ color: var(--color-secondary);
476
+ font-weight: 500;
477
+ }
473
478
  `;
474
479
  var HeadingThree = styled2.h3`
475
480
  font-family: Bitter, \"Helvetica Neue\", Helvetica, Arial, sans-serif;
@@ -1008,6 +1013,7 @@ var Default3Layout = ({
1008
1013
  };
1009
1014
 
1010
1015
  // src/layouts/FullImageLayout.tsx
1016
+ import React7 from "react";
1011
1017
  import styled6 from "styled-components";
1012
1018
  import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
1013
1019
  var Overlay = styled6.div`
@@ -1034,6 +1040,9 @@ function FullImageLayout({
1034
1040
  position = "bottom",
1035
1041
  dim = 0.4
1036
1042
  }) {
1043
+ const [images, rest] = getMatchingMdxType(children, "Image");
1044
+ const firstImage = images[0];
1045
+ const backgroundImage = image || (React7.isValidElement(firstImage) ? firstImage.props.src : void 0);
1037
1046
  const justifyMap = {
1038
1047
  top: "flex-start",
1039
1048
  center: "center",
@@ -1053,7 +1062,7 @@ function FullImageLayout({
1053
1062
  style: {
1054
1063
  position: "absolute",
1055
1064
  inset: 0,
1056
- backgroundImage: `url(${image})`,
1065
+ backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0,
1057
1066
  backgroundSize: "cover",
1058
1067
  backgroundPosition: "center"
1059
1068
  }
@@ -1069,7 +1078,7 @@ function FullImageLayout({
1069
1078
  }
1070
1079
  }
1071
1080
  ),
1072
- /* @__PURE__ */ jsx10(Overlay, { style: { justifyContent: justifyMap[position] }, children })
1081
+ /* @__PURE__ */ jsx10(Overlay, { style: { justifyContent: justifyMap[position] }, children: firstImage ? rest : children })
1073
1082
  ]
1074
1083
  }
1075
1084
  );
@@ -1223,7 +1232,7 @@ var SectionLayout = styled8.div`
1223
1232
  import styled10 from "styled-components";
1224
1233
 
1225
1234
  // src/layouts/columns.tsx
1226
- import React7 from "react";
1235
+ import React8 from "react";
1227
1236
  import styled9 from "styled-components";
1228
1237
  import { jsx as jsx13 } from "react/jsx-runtime";
1229
1238
  var DivWithHeading = styled9.div`
@@ -1249,7 +1258,7 @@ function ColumnsLayout({
1249
1258
  children,
1250
1259
  reverse
1251
1260
  }) {
1252
- const childrenArray = React7.Children.toArray(children);
1261
+ const childrenArray = React8.Children.toArray(children);
1253
1262
  return /* @__PURE__ */ jsx13(
1254
1263
  ColumnsContainer,
1255
1264
  {
@@ -1581,11 +1590,11 @@ export * from "spectacle";
1581
1590
  import { animated, useSpring } from "@react-spring/web";
1582
1591
 
1583
1592
  // src/components/animations/useInView.ts
1584
- import React8 from "react";
1593
+ import React9 from "react";
1585
1594
  function useInView() {
1586
- const ref = React8.useRef(null);
1587
- const [isInView, setIsInView] = React8.useState(false);
1588
- React8.useEffect(() => {
1595
+ const ref = React9.useRef(null);
1596
+ const [isInView, setIsInView] = React9.useState(false);
1597
+ React9.useEffect(() => {
1589
1598
  const el = ref.current;
1590
1599
  if (!el) return;
1591
1600
  const observer = new IntersectionObserver(
@@ -1783,7 +1792,7 @@ function Spotlight({
1783
1792
 
1784
1793
  // src/components/animations/StaggerChildren.tsx
1785
1794
  import { animated as animated5, useSprings } from "@react-spring/web";
1786
- import React9 from "react";
1795
+ import React10 from "react";
1787
1796
  import { jsx as jsx25 } from "react/jsx-runtime";
1788
1797
  function StaggerChildren({
1789
1798
  children,
@@ -1794,7 +1803,7 @@ function StaggerChildren({
1794
1803
  distance = 20
1795
1804
  }) {
1796
1805
  const [ref, isInView] = useInView();
1797
- const items = React9.Children.toArray(children);
1806
+ const items = React10.Children.toArray(children);
1798
1807
  const translateMap = {
1799
1808
  up: `translateY(${distance}px)`,
1800
1809
  down: `translateY(-${distance}px)`,
@@ -1815,14 +1824,14 @@ function StaggerChildren({
1815
1824
  }
1816
1825
 
1817
1826
  // src/components/animations/TypeWriter.tsx
1818
- import React10 from "react";
1827
+ import React11 from "react";
1819
1828
  import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
1820
1829
  function extractText(node) {
1821
1830
  if (typeof node === "string") return node;
1822
1831
  if (typeof node === "number") return String(node);
1823
1832
  if (!node) return "";
1824
1833
  if (Array.isArray(node)) return node.map(extractText).join("");
1825
- if (React10.isValidElement(node)) {
1834
+ if (React11.isValidElement(node)) {
1826
1835
  const props = node.props;
1827
1836
  return extractText(props.children);
1828
1837
  }
@@ -1836,9 +1845,9 @@ function TypeWriter({
1836
1845
  }) {
1837
1846
  const text = extractText(children);
1838
1847
  const [ref, isInView] = useInView();
1839
- const [displayed, setDisplayed] = React10.useState("");
1840
- const [done, setDone] = React10.useState(false);
1841
- React10.useEffect(() => {
1848
+ const [displayed, setDisplayed] = React11.useState("");
1849
+ const [done, setDone] = React11.useState(false);
1850
+ React11.useEffect(() => {
1842
1851
  if (!isInView) return;
1843
1852
  let index = 0;
1844
1853
  setDisplayed("");
@@ -1937,27 +1946,33 @@ function DocItem({ label, link }) {
1937
1946
  }
1938
1947
 
1939
1948
  // src/components/FilePane.tsx
1940
- import React11 from "react";
1949
+ import React12 from "react";
1950
+ import { jsx as jsx28 } from "react/jsx-runtime";
1941
1951
  function FilePane({
1942
1952
  name,
1943
1953
  children,
1944
1954
  priority,
1955
+ minWidth,
1945
1956
  ...divProps
1946
1957
  }) {
1947
- return React11.isValidElement(children) ? React11.cloneElement(children, {
1958
+ const content = React12.isValidElement(children) ? React12.cloneElement(children, {
1948
1959
  // @ts-expect-error cloning
1949
1960
  priority,
1950
1961
  name
1951
1962
  }) : children;
1963
+ if (minWidth) {
1964
+ return /* @__PURE__ */ jsx28("div", { ...divProps, style: { minWidth, ...divProps.style }, children: content });
1965
+ }
1966
+ return content;
1952
1967
  }
1953
1968
  FilePane.mdxType = "FilePane";
1954
1969
 
1955
1970
  // src/components/HorizontalList.tsx
1956
1971
  import { animated as animated6, useSpring as useSpring5 } from "@react-spring/web";
1957
- import React12 from "react";
1972
+ import React13 from "react";
1958
1973
  import { Stepper as Stepper2 } from "spectacle";
1959
1974
  import styled15 from "styled-components";
1960
- import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
1975
+ import { jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
1961
1976
  var Container = styled15.div`
1962
1977
  display: grid;
1963
1978
  grid-gap: 2rem;
@@ -1966,18 +1981,18 @@ function HorizontalList({
1966
1981
  children,
1967
1982
  columns = 3
1968
1983
  }) {
1969
- const items = React12.Children.toArray(children);
1970
- return /* @__PURE__ */ jsx28(Stepper2, { values: items, children: (_, step) => /* @__PURE__ */ jsx28(
1984
+ const items = React13.Children.toArray(children);
1985
+ return /* @__PURE__ */ jsx29(Stepper2, { values: items, children: (_, step) => /* @__PURE__ */ jsx29(
1971
1986
  Container,
1972
1987
  {
1973
1988
  style: {
1974
1989
  gridTemplateColumns: `repeat(${columns}, 1fr)`
1975
1990
  },
1976
1991
  children: items.map((item, k) => {
1977
- if (!React12.isValidElement(item)) {
1992
+ if (!React13.isValidElement(item)) {
1978
1993
  return item;
1979
1994
  }
1980
- return React12.cloneElement(item, {
1995
+ return React13.cloneElement(item, {
1981
1996
  // @ts-expect-error cloning
1982
1997
  position: k + 1,
1983
1998
  isVisible: k <= step,
@@ -1988,7 +2003,7 @@ function HorizontalList({
1988
2003
  ) });
1989
2004
  }
1990
2005
  function Pill({ position }) {
1991
- return /* @__PURE__ */ jsx28(
2006
+ return /* @__PURE__ */ jsx29(
1992
2007
  "div",
1993
2008
  {
1994
2009
  style: { width: 48, transform: "translate(-25%, -25%)", opacity: 0.9 },
@@ -2001,14 +2016,14 @@ function Pill({ position }) {
2001
2016
  fill: "none",
2002
2017
  xmlns: "http://www.w3.org/2000/svg",
2003
2018
  children: [
2004
- /* @__PURE__ */ jsx28(
2019
+ /* @__PURE__ */ jsx29(
2005
2020
  "path",
2006
2021
  {
2007
2022
  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",
2008
2023
  fill: "#ffffff"
2009
2024
  }
2010
2025
  ),
2011
- /* @__PURE__ */ jsx28(
2026
+ /* @__PURE__ */ jsx29(
2012
2027
  "text",
2013
2028
  {
2014
2029
  x: "9",
@@ -2020,7 +2035,7 @@ function Pill({ position }) {
2020
2035
  children: position
2021
2036
  }
2022
2037
  ),
2023
- /* @__PURE__ */ jsx28(
2038
+ /* @__PURE__ */ jsx29(
2024
2039
  "path",
2025
2040
  {
2026
2041
  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",
@@ -2076,16 +2091,16 @@ function HorizontalListItem({
2076
2091
  });
2077
2092
  return /* @__PURE__ */ jsxs19(Item, { style: opacityStyles, children: [
2078
2093
  /* @__PURE__ */ jsxs19(ItemHead, { children: [
2079
- /* @__PURE__ */ jsx28(Pill, { position }),
2080
- /* @__PURE__ */ jsx28("p", { children: title })
2094
+ /* @__PURE__ */ jsx29(Pill, { position }),
2095
+ /* @__PURE__ */ jsx29("p", { children: title })
2081
2096
  ] }),
2082
- /* @__PURE__ */ jsx28(ItemContent, { children })
2097
+ /* @__PURE__ */ jsx29(ItemContent, { children })
2083
2098
  ] });
2084
2099
  }
2085
2100
 
2086
2101
  // src/components/IconBox.tsx
2087
2102
  import styled16 from "styled-components";
2088
- import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
2103
+ import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
2089
2104
  var IconBoxContent = styled16.div`
2090
2105
  * {
2091
2106
  margin: 0.2rem !important;
@@ -2106,8 +2121,8 @@ function IconBox({
2106
2121
  padding: "1rem 0"
2107
2122
  },
2108
2123
  children: [
2109
- /* @__PURE__ */ jsx29("div", { style: { fontSize: 60 }, children: icon }),
2110
- /* @__PURE__ */ jsx29(IconBoxContent, { children })
2124
+ /* @__PURE__ */ jsx30("div", { style: { fontSize: 60 }, children: icon }),
2125
+ /* @__PURE__ */ jsx30(IconBoxContent, { children })
2111
2126
  ]
2112
2127
  }
2113
2128
  );
@@ -2115,14 +2130,14 @@ function IconBox({
2115
2130
 
2116
2131
  // src/components/ItemsColumn.tsx
2117
2132
  import { animated as animated7, useSpring as useSpring6 } from "@react-spring/web";
2118
- import React13 from "react";
2133
+ import React14 from "react";
2119
2134
  import { Stepper as Stepper3 } from "spectacle";
2120
2135
  import styled17 from "styled-components";
2121
- import { jsx as jsx30 } from "react/jsx-runtime";
2136
+ import { jsx as jsx31 } from "react/jsx-runtime";
2122
2137
  function ItemsColumn(divProps) {
2123
2138
  const { style: style2, children, ...props } = divProps;
2124
- const childrenArray = React13.Children.toArray(children);
2125
- return /* @__PURE__ */ jsx30(Stepper3, { values: childrenArray, children: (_value, step) => /* @__PURE__ */ jsx30(
2139
+ const childrenArray = React14.Children.toArray(children);
2140
+ return /* @__PURE__ */ jsx31(Stepper3, { values: childrenArray, children: (_value, step) => /* @__PURE__ */ jsx31(
2126
2141
  "div",
2127
2142
  {
2128
2143
  style: {
@@ -2137,10 +2152,10 @@ function ItemsColumn(divProps) {
2137
2152
  ...props,
2138
2153
  children: childrenArray.map((child, index) => {
2139
2154
  const isVisible = index <= step;
2140
- if (!React13.isValidElement(child)) {
2155
+ if (!React14.isValidElement(child)) {
2141
2156
  return child;
2142
2157
  }
2143
- return /* @__PURE__ */ jsx30(ItemColumnWrapper, { isVisible, children: child }, index);
2158
+ return /* @__PURE__ */ jsx31(ItemColumnWrapper, { isVisible, children: child }, index);
2144
2159
  })
2145
2160
  }
2146
2161
  ) });
@@ -2158,12 +2173,12 @@ function ItemColumnWrapper({
2158
2173
  ...props
2159
2174
  }) {
2160
2175
  const styles = useSpring6({ opacity: isVisible ? 1 : 0 });
2161
- return /* @__PURE__ */ jsx30(ItemColumnWrapperStyled, { style: styles, ...props, children });
2176
+ return /* @__PURE__ */ jsx31(ItemColumnWrapperStyled, { style: styles, ...props, children });
2162
2177
  }
2163
2178
 
2164
2179
  // src/components/Timeline.tsx
2165
2180
  import { animated as animated8, useSpring as useSpring7 } from "@react-spring/web";
2166
- import React14 from "react";
2181
+ import React15 from "react";
2167
2182
  import { Stepper as Stepper4 } from "spectacle";
2168
2183
  import styled19 from "styled-components";
2169
2184
 
@@ -2191,7 +2206,7 @@ var TimelineItemTitle = styled18.div`
2191
2206
  `;
2192
2207
 
2193
2208
  // src/components/Timeline.tsx
2194
- import { jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
2209
+ import { jsx as jsx32, jsxs as jsxs21 } from "react/jsx-runtime";
2195
2210
  var TimelineItemStyled = styled19(animated8.div)`
2196
2211
  flex: 1;
2197
2212
  flex-flow: column nowrap;
@@ -2237,20 +2252,33 @@ var style = {
2237
2252
  alignItems: "center"
2238
2253
  };
2239
2254
  function Timeline(props) {
2240
- const children = React14.Children.toArray(props.children);
2241
- return /* @__PURE__ */ jsx31(
2255
+ const { activeIndex, ...rest } = props;
2256
+ const children = React15.Children.toArray(rest.children);
2257
+ if (activeIndex != null) {
2258
+ return /* @__PURE__ */ jsx32("div", { ...rest, style: { ...style, ...rest.style }, children: children.map((child, index) => {
2259
+ if (!React15.isValidElement(child)) {
2260
+ return child;
2261
+ }
2262
+ return React15.cloneElement(child, {
2263
+ // @ts-expect-error cloning
2264
+ isPhantom: activeIndex < index,
2265
+ isLast: activeIndex === index
2266
+ });
2267
+ }) });
2268
+ }
2269
+ return /* @__PURE__ */ jsx32(
2242
2270
  Stepper4,
2243
2271
  {
2244
- ...props,
2272
+ ...rest,
2245
2273
  values: children,
2246
2274
  activeStyle: style,
2247
2275
  inactiveStyle: style,
2248
2276
  children: (_value, step) => {
2249
2277
  return children.map((child, index) => {
2250
- if (!React14.isValidElement(child)) {
2278
+ if (!React15.isValidElement(child)) {
2251
2279
  return child;
2252
2280
  }
2253
- return React14.cloneElement(child, {
2281
+ return React15.cloneElement(child, {
2254
2282
  // @ts-expect-error cloning
2255
2283
  isPhantom: step < index,
2256
2284
  isLast: step === index
@@ -2286,16 +2314,16 @@ function TimelineItem(props) {
2286
2314
  },
2287
2315
  children: [
2288
2316
  /* @__PURE__ */ jsxs21(TimelineItemContentPhantom, { children: [
2289
- /* @__PURE__ */ jsx31(TimelineItemTitle, { children: title }),
2290
- /* @__PURE__ */ jsx31(TimelineItemBody, { children })
2317
+ /* @__PURE__ */ jsx32(TimelineItemTitle, { children: title }),
2318
+ /* @__PURE__ */ jsx32(TimelineItemBody, { children })
2291
2319
  ] }),
2292
2320
  /* @__PURE__ */ jsxs21(TimelineItemGuide, { style: colorStyles, children: [
2293
- /* @__PURE__ */ jsx31(Hexagon, {}),
2294
- /* @__PURE__ */ jsx31(TimelineItemGuideLine, { style: guideLineProps })
2321
+ /* @__PURE__ */ jsx32(Hexagon, {}),
2322
+ /* @__PURE__ */ jsx32(TimelineItemGuideLine, { style: guideLineProps })
2295
2323
  ] }),
2296
2324
  /* @__PURE__ */ jsxs21(TimelineItemContent, { children: [
2297
- /* @__PURE__ */ jsx31(TimelineItemTitle, { children: title }),
2298
- /* @__PURE__ */ jsx31(TimelineItemBody, { children })
2325
+ /* @__PURE__ */ jsx32(TimelineItemTitle, { children: title }),
2326
+ /* @__PURE__ */ jsx32(TimelineItemBody, { children })
2299
2327
  ] })
2300
2328
  ]
2301
2329
  }
@@ -2311,14 +2339,14 @@ function Hexagon() {
2311
2339
  fill: "none",
2312
2340
  xmlns: "http://www.w3.org/2000/svg",
2313
2341
  children: [
2314
- /* @__PURE__ */ jsx31(
2342
+ /* @__PURE__ */ jsx32(
2315
2343
  "path",
2316
2344
  {
2317
2345
  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",
2318
2346
  fill: "#F49676"
2319
2347
  }
2320
2348
  ),
2321
- /* @__PURE__ */ jsx31(
2349
+ /* @__PURE__ */ jsx32(
2322
2350
  "path",
2323
2351
  {
2324
2352
  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",
@@ -2331,9 +2359,9 @@ function Hexagon() {
2331
2359
  }
2332
2360
 
2333
2361
  // src/index.tsx
2334
- import { Fragment as Fragment3, jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
2362
+ import { Fragment as Fragment3, jsx as jsx33, jsxs as jsxs22 } from "react/jsx-runtime";
2335
2363
  function PassThrough({ children }) {
2336
- return /* @__PURE__ */ jsx32(Fragment3, { children });
2364
+ return /* @__PURE__ */ jsx33(Fragment3, { children });
2337
2365
  }
2338
2366
  var layouts = layouts_default;
2339
2367
  var componentsMap2 = {
@@ -2346,10 +2374,10 @@ function Deck({
2346
2374
  layouts: layouts2 = layouts_default,
2347
2375
  transition
2348
2376
  }) {
2349
- React15.useEffect(() => {
2377
+ React16.useEffect(() => {
2350
2378
  document.title = deck.metadata.title || "Untitled";
2351
2379
  }, [deck.metadata.title]);
2352
- const mergedTheme = React15.useMemo(() => {
2380
+ const mergedTheme = React16.useMemo(() => {
2353
2381
  const fonts = {
2354
2382
  ...theme_default.fonts,
2355
2383
  ...theme.themeTokens.fonts ?? {}
@@ -2360,7 +2388,7 @@ function Deck({
2360
2388
  fonts
2361
2389
  };
2362
2390
  }, [theme]);
2363
- const GlobalStyle = React15.useMemo(() => {
2391
+ const GlobalStyle = React16.useMemo(() => {
2364
2392
  const cssVariables = createCssVariables(theme.themeTokens.colors);
2365
2393
  return createGlobalStyle`
2366
2394
  :root {
@@ -2369,9 +2397,9 @@ function Deck({
2369
2397
  }
2370
2398
  `;
2371
2399
  }, [theme, mergedTheme]);
2372
- return /* @__PURE__ */ jsx32(React15.StrictMode, { children: /* @__PURE__ */ jsx32(PestacleProvider, { layouts: layouts2, children: /* @__PURE__ */ jsxs22(MDXProvider, { components: componentsMap2, children: [
2373
- /* @__PURE__ */ jsx32(GlobalStyle, {}),
2374
- /* @__PURE__ */ jsx32(
2400
+ return /* @__PURE__ */ jsx33(React16.StrictMode, { children: /* @__PURE__ */ jsx33(PestacleProvider, { layouts: layouts2, children: /* @__PURE__ */ jsxs22(MDXProvider, { components: componentsMap2, children: [
2401
+ /* @__PURE__ */ jsx33(GlobalStyle, {}),
2402
+ /* @__PURE__ */ jsx33(
2375
2403
  SpectacleDeck,
2376
2404
  {
2377
2405
  theme: mergedTheme,
@@ -2382,33 +2410,33 @@ function Deck({
2382
2410
  const Component = slide.slideComponent;
2383
2411
  const slideTransitionName = (_a = slide.metadata) == null ? void 0 : _a.transition;
2384
2412
  const slideTransition2 = resolveTransition(slideTransitionName);
2385
- return /* @__PURE__ */ jsx32(Slide, { transition: slideTransition2, children: /* @__PURE__ */ jsx32(Component, {}) }, i);
2413
+ return /* @__PURE__ */ jsx33(Slide, { transition: slideTransition2, children: /* @__PURE__ */ jsx33(Component, {}) }, i);
2386
2414
  })
2387
2415
  }
2388
2416
  )
2389
2417
  ] }) }) });
2390
2418
  }
2391
2419
  function Danger({ children }) {
2392
- return /* @__PURE__ */ jsx32("div", { style: { color: "red" }, children });
2420
+ return /* @__PURE__ */ jsx33("div", { style: { color: "red" }, children });
2393
2421
  }
2394
2422
  function Information({ children }) {
2395
- return /* @__PURE__ */ jsx32("div", { style: { color: "orange" }, children });
2423
+ return /* @__PURE__ */ jsx33("div", { style: { color: "orange" }, children });
2396
2424
  }
2397
2425
  function Success({ children }) {
2398
- return /* @__PURE__ */ jsx32("div", { style: { color: "green" }, children });
2426
+ return /* @__PURE__ */ jsx33("div", { style: { color: "green" }, children });
2399
2427
  }
2400
2428
  function Warning({ children }) {
2401
- return /* @__PURE__ */ jsx32("div", { style: { color: "yellow" }, children });
2429
+ return /* @__PURE__ */ jsx33("div", { style: { color: "yellow" }, children });
2402
2430
  }
2403
2431
  function Side({ children }) {
2404
- return /* @__PURE__ */ jsx32("div", { children });
2432
+ return /* @__PURE__ */ jsx33("div", { children });
2405
2433
  }
2406
2434
  Side.mdxType = "Side";
2407
2435
  function Documentation({ children }) {
2408
- return /* @__PURE__ */ jsx32("div", { children });
2436
+ return /* @__PURE__ */ jsx33("div", { children });
2409
2437
  }
2410
2438
  function Box2({ children }) {
2411
- return /* @__PURE__ */ jsx32("div", { children });
2439
+ return /* @__PURE__ */ jsx33("div", { children });
2412
2440
  }
2413
2441
  export {
2414
2442
  AnimatedCounter,
@@ -1,7 +1,7 @@
1
- import type React from "react";
1
+ import React from "react";
2
2
  export declare function FullImageLayout({ children, image, position, dim, }: {
3
3
  children: React.ReactNode;
4
- image: string;
4
+ image?: string;
5
5
  position?: "center" | "bottom" | "top";
6
6
  dim?: number;
7
7
  }): 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.5.0",
3
+ "version": "1.7.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "index.cjs",