@wistia/ui 0.20.9 → 0.20.10-beta.1bf75ea0.e893702

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ import { Color } from 'culori/fn';
8
8
  import * as Ariakit from '@ariakit/react';
9
9
  import * as styled_components from 'styled-components';
10
10
  import { Schema } from 'yup';
11
- import ReactMarkdown from 'react-markdown';
11
+ import ReactMarkdown, { Options } from 'react-markdown';
12
12
  import * as _radix_ui_react_dropdown_menu from '@radix-ui/react-dropdown-menu';
13
13
  import { DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuRadioGroupProps, DropdownMenuRadioItemProps, DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';
14
14
  import { PopoverContentProps } from '@radix-ui/react-popover';
@@ -2748,16 +2748,23 @@ declare const Mark: {
2748
2748
  displayName: string;
2749
2749
  };
2750
2750
 
2751
- type MarkdownTextSize = 'body-2' | 'body-3';
2751
+ type MarkdownTextSize = 'body2' | 'body3';
2752
2752
 
2753
- type MarkdownProps = ComponentProps<typeof ReactMarkdown> & {
2753
+ type MarkdownProps = Omit<ComponentProps<typeof ReactMarkdown>, 'rehypePlugins'> & {
2754
2754
  /**
2755
2755
  * A string of markdown to render.
2756
2756
  */
2757
2757
  children: string;
2758
+ /**
2759
+ * If true, allows HTML in markdown to be rendered. By default, HTML is escaped and rendered as plain text.
2760
+ */
2761
+ renderHtml?: boolean;
2762
+ /**
2763
+ * A list of rehype plugins to apply to the markdown.
2764
+ */
2765
+ rehypePlugins?: Options['rehypePlugins'];
2758
2766
  /**
2759
2767
  * Adjusts the type scale based on the font size of the `<p>` element.
2760
- * Supports responsive values.
2761
2768
  */
2762
2769
  textSize?: MarkdownTextSize | ResponsiveObject<MarkdownTextSize>;
2763
2770
  };
@@ -2765,7 +2772,7 @@ type MarkdownProps = ComponentProps<typeof ReactMarkdown> & {
2765
2772
  * This is a simple wrapper around `react-markdown` that applies some basic styles.
2766
2773
  */
2767
2774
  declare const Markdown: {
2768
- ({ children, textSize, ...otherProps }: MarkdownProps): JSX.Element;
2775
+ ({ children, textSize, renderHtml, rehypePlugins: userRehypePlugins, ...otherProps }: MarkdownProps): JSX.Element;
2769
2776
  displayName: string;
2770
2777
  };
2771
2778
 
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.20.9
3
+ * @license @wistia/ui v0.20.10-beta.1bf75ea0.e893702
4
4
  *
5
5
  * Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
6
6
  *
@@ -16112,11 +16112,16 @@ Mark.displayName = "Mark_UI";
16112
16112
  // src/components/Markdown/Markdown.tsx
16113
16113
  import { styled as styled76 } from "styled-components";
16114
16114
  import ReactMarkdown from "react-markdown";
16115
+ import rehypeRaw from "rehype-raw";
16115
16116
 
16116
16117
  // src/css/baseMarkdownCss.tsx
16117
16118
  import { css as css39 } from "styled-components";
16118
- var baseMarkdownCss = (textSize = "body-2") => css39`
16119
- --wui-markdown-base-unit: var(--wui-typography-${textSize}-size);
16119
+ var textSizeToTokenMap = {
16120
+ body2: "--wui-typography-body-2-size",
16121
+ body3: "--wui-typography-body-3-size"
16122
+ };
16123
+ var baseMarkdownCss = (textSize = "body2") => css39`
16124
+ --wui-markdown-base-unit: var(${textSizeToTokenMap[textSize]});
16120
16125
 
16121
16126
  font-size: var(--wui-markdown-base-unit);
16122
16127
 
@@ -16240,18 +16245,27 @@ var StyledMarkdownWrapper = styled76.div`
16240
16245
  `;
16241
16246
  var Markdown = ({
16242
16247
  children,
16243
- textSize = "body-2",
16248
+ textSize = "body2",
16249
+ renderHtml = false,
16250
+ rehypePlugins: userRehypePlugins,
16244
16251
  ...otherProps
16245
16252
  }) => {
16246
16253
  const responsiveTextSize = useResponsiveProp(textSize);
16247
- return /* @__PURE__ */ jsx313(
16248
- StyledMarkdownWrapper,
16254
+ const rehypePlugins = [];
16255
+ if (renderHtml) {
16256
+ rehypePlugins.push(rehypeRaw);
16257
+ }
16258
+ if (userRehypePlugins) {
16259
+ rehypePlugins.push(...userRehypePlugins);
16260
+ }
16261
+ return /* @__PURE__ */ jsx313(StyledMarkdownWrapper, { $textSize: responsiveTextSize, children: /* @__PURE__ */ jsx313(
16262
+ ReactMarkdown,
16249
16263
  {
16250
- $textSize: responsiveTextSize,
16251
16264
  ...otherProps,
16252
- children: /* @__PURE__ */ jsx313(ReactMarkdown, { children })
16265
+ rehypePlugins,
16266
+ children
16253
16267
  }
16254
- );
16268
+ ) });
16255
16269
  };
16256
16270
  Markdown.displayName = "Markdown_UI";
16257
16271