# @leafygreen-ui/code

## 20.2.7

### Patch Changes

- 1c0c03a: Updates the focus ring token to use the base blue color in light mode. [LG-5847](https://jira.mongodb.org/browse/LG-5847)
- Updated dependencies [1c0c03a]
  - @leafygreen-ui/button@25.2.1
  - @leafygreen-ui/hooks@9.3.1
  - @leafygreen-ui/icon-button@17.1.5
  - @leafygreen-ui/select@17.0.3
  - @leafygreen-ui/skeleton-loader@3.0.11
  - @leafygreen-ui/tokens@4.2.2
  - @leafygreen-ui/tooltip@14.3.1
  - @leafygreen-ui/typography@22.2.4

## 20.2.6

### Patch Changes

- 0b18230: Update highlight color in dark mode to be more visible

## 20.2.5

### Patch Changes

- 19c0cbe: Refactor `IconButton` instances to use compact tooltip UI

## 20.2.4

### Patch Changes

- cb31ce6: fix: remove unexpected @emotion imports from icon package dependency
- Updated dependencies [f7a63e2]
- Updated dependencies [43810b4]
- Updated dependencies [ec4fad8]
- Updated dependencies [cb31ce6]
  - @leafygreen-ui/tooltip@14.3.0
  - @leafygreen-ui/icon@14.7.1
  - @leafygreen-ui/tokens@4.1.0
  - @leafygreen-ui/icon-button@17.1.4
  - @leafygreen-ui/select@17.0.2
  - @leafygreen-ui/skeleton-loader@3.0.10
  - @leafygreen-ui/typography@22.2.3

## 20.2.3

### Patch Changes

- 9cf3b18: Updates provider peer dependency version string to correctly use `pnpm` `workspace` syntax
- Updated dependencies [9cf3b18]
  - @leafygreen-ui/skeleton-loader@3.0.9
  - @leafygreen-ui/icon-button@17.1.3
  - @leafygreen-ui/typography@22.2.2
  - @leafygreen-ui/tooltip@14.2.3
  - @leafygreen-ui/button@25.1.3
  - @leafygreen-ui/select@17.0.1

## 20.2.2

### Patch Changes

- Updated dependencies [6494d15]
- Updated dependencies [2463aa4]
- Updated dependencies [11cbe4f]
- Updated dependencies [2463aa4]
  - @leafygreen-ui/select@17.0.0
  - @leafygreen-ui/hooks@9.3.0
  - @leafygreen-ui/icon@14.7.0

## 20.2.1

### Patch Changes

- Updated dependencies [92693df]
- Updated dependencies [c6b4d3f]
- Updated dependencies [888a37d]
  - @leafygreen-ui/tokens@4.0.0
  - @leafygreen-ui/emotion@5.1.0
  - @leafygreen-ui/select@16.3.0
  - @leafygreen-ui/icon@14.6.1
  - @leafygreen-ui/typography@22.2.0
  - @leafygreen-ui/button@25.1.2
  - @leafygreen-ui/hooks@9.2.2
  - @leafygreen-ui/icon-button@17.1.2
  - @leafygreen-ui/skeleton-loader@3.0.8
  - @leafygreen-ui/tooltip@14.2.2

## 20.2.0

### Minor Changes

- 37be24b: Add `collapsedLines` prop to allow customization of the number of visible lines when code block is collapsed

### Patch Changes

- c8559f3: Widens the range of `@leafygreen-ui/leafygreen-provider` peer dependency to `>=3.2.0`
- Updated dependencies [f3a8bdc]
- Updated dependencies [7f7c385]
- Updated dependencies [7fc3077]
- Updated dependencies [c8559f3]
- Updated dependencies [51c453b]
  - @leafygreen-ui/emotion@5.0.4
  - @leafygreen-ui/skeleton-loader@3.0.7
  - @leafygreen-ui/select@16.2.0
  - @leafygreen-ui/icon-button@17.1.1
  - @leafygreen-ui/typography@22.1.4
  - @leafygreen-ui/tooltip@14.2.1
  - @leafygreen-ui/button@25.1.1

## 20.1.1

### Patch Changes

- 708b5fc: Replaces `postinstall` script with `prepare`. This ensures that the step is performed only pre-publish and not when the package is installed by consumers
- 6e0615c: Remove dev dependency from prod dependencies; Rename file to trigger a release
- Updated dependencies [6e0615c]
- Updated dependencies [a565b3f]
  - @leafygreen-ui/select@16.1.4
  - @leafygreen-ui/lib@15.6.2

## 20.1.0

### Minor Changes

- d027d4c: Mark default export as deprecated and add named export if missing. See [named-exports codemod documentation](https://github.com/mongodb/leafygreen-ui/tree/main/tools/codemods#named-exports) for migration assistance.

### Patch Changes

- e07939c: Remove mentions of props removed in v18
- Updated dependencies [88e25a1]
- Updated dependencies [579e8c7]
- Updated dependencies [d027d4c]
  - @leafygreen-ui/lib@15.6.1
  - @leafygreen-ui/hooks@9.2.0
  - @leafygreen-ui/icon-button@17.1.0
  - @leafygreen-ui/tooltip@14.2.0
  - @leafygreen-ui/button@25.1.0
  - @leafygreen-ui/icon@14.6.0

## 20.0.8

### Patch Changes

- 3471b94: Update React ref objects to be explicitly nullable
- Updated dependencies [1a5c69f]
- Updated dependencies [aeb3b3f]
- Updated dependencies [3471b94]
- Updated dependencies [6f30c55]
- Updated dependencies [cee1e79]
- Updated dependencies [6f30c55]
  - @leafygreen-ui/icon@14.5.1
  - @leafygreen-ui/icon-button@17.0.6
  - @leafygreen-ui/tooltip@14.1.4
  - @leafygreen-ui/select@16.1.3
  - @leafygreen-ui/hooks@9.1.4
  - @leafygreen-ui/lib@15.4.0
  - @leafygreen-ui/skeleton-loader@3.0.6
  - @leafygreen-ui/typography@22.1.3
  - @leafygreen-ui/emotion@5.0.3
  - @leafygreen-ui/a11y@3.0.5

## 20.0.7

### Patch Changes

- dc3299b: Adds "exports" field to all packages
  Enables TS downleveling to TS 4.9
- Updated dependencies [a9eb172]
- Updated dependencies [5ef631a]
- Updated dependencies [dc3299b]
  - @leafygreen-ui/lib@15.3.0
  - @leafygreen-ui/icon@14.5.0
  - @leafygreen-ui/a11y@3.0.4
  - @leafygreen-ui/button@25.0.4
  - @leafygreen-ui/emotion@5.0.2
  - @leafygreen-ui/hooks@9.1.3
  - @leafygreen-ui/icon-button@17.0.5
  - @leafygreen-ui/leafygreen-provider@5.0.4
  - @leafygreen-ui/palette@5.0.2
  - @leafygreen-ui/select@16.1.2
  - @leafygreen-ui/skeleton-loader@3.0.5
  - @leafygreen-ui/tokens@3.2.4
  - @leafygreen-ui/tooltip@14.1.3
  - @leafygreen-ui/typography@22.1.2
  - @lg-tools/test-harnesses@0.3.4

## 20.0.6

### Patch Changes

- 172c228: Removes `*.spec.ts` files from tsconfig `exclude` pattern, ensuring that tests are type-checked at build time.
  Also adds missing TS "references" for packages that are imported into test files
- Updated dependencies [172c228]
- Updated dependencies [172c228]
  - @leafygreen-ui/hooks@9.1.2
  - @leafygreen-ui/a11y@3.0.3
  - @leafygreen-ui/button@25.0.3
  - @leafygreen-ui/emotion@5.0.1
  - @leafygreen-ui/icon@14.4.1
  - @leafygreen-ui/icon-button@17.0.4
  - @leafygreen-ui/leafygreen-provider@5.0.3
  - @leafygreen-ui/lib@15.2.1
  - @leafygreen-ui/palette@5.0.1
  - @leafygreen-ui/select@16.1.1
  - @leafygreen-ui/skeleton-loader@3.0.4
  - @leafygreen-ui/tokens@3.2.3
  - @leafygreen-ui/tooltip@14.1.2
  - @leafygreen-ui/typography@22.1.1
  - @lg-tools/test-harnesses@0.3.3

## 20.0.5

### Patch Changes

- 43e812e: Fixes bug that prevented the language select from rendering if the `displayName` and `language` differed.

  ```tsx
  // languageOptions passed to `<Panel`>
  export const languageOptions = [
    {
      displayName: 'JavaScript',
      language: 'javascript',
    },
    {
      displayName: 'Python',
      language: 'python',
    },
    {
      displayName: 'macOS',
      language: 'shell',
    },
  ];

  // This will render the language selector.
  <Code
    language={languageOptions[2].language} // shell
    panel={<Panel languageOptions={languageOptions} />}
  />;
  ```

## 20.0.4

### Patch Changes

- f9558fa: Update types TSDocs for `onCopy`, `copyButtonAppearance`, and `panel` props.

## 20.0.3

### Patch Changes

- 56c0d3b: - Updates usages of `bold` weight token to `semiBold`.

  Note: This should have no visual impact since the font-face being used was already semi-bold/600px. It just updates the token used to better align with the font-face and Figma component.

- Updated dependencies [56c0d3b]
- Updated dependencies [56c0d3b]
- Updated dependencies [56c0d3b]
  - @leafygreen-ui/typography@22.1.0
  - @leafygreen-ui/tokens@3.2.0
  - @leafygreen-ui/button@25.0.1
  - @leafygreen-ui/select@16.0.3

## 20.0.2

### Patch Changes

- 2adba55: Refactor test utils usage to import from `@leafygreen-ui/button/testing` instead of `@leafygreen-ui/button`
- Updated dependencies [2adba55]
  - @leafygreen-ui/button@25.0.0
  - @leafygreen-ui/select@16.0.2
  - @leafygreen-ui/tooltip@14.1.1

## 20.0.1

### Patch Changes

- Updated dependencies [b67497a]
  - @leafygreen-ui/lib@15.2.0
  - @leafygreen-ui/a11y@3.0.2
  - @leafygreen-ui/button@24.0.3
  - @leafygreen-ui/hooks@9.1.1
  - @leafygreen-ui/icon@14.1.0
  - @leafygreen-ui/icon-button@17.0.3
  - @leafygreen-ui/leafygreen-provider@5.0.2
  - @leafygreen-ui/palette@5.0.0
  - @leafygreen-ui/select@16.0.1
  - @leafygreen-ui/skeleton-loader@3.0.3
  - @leafygreen-ui/tokens@3.1.2
  - @leafygreen-ui/tooltip@14.1.1
  - @leafygreen-ui/typography@22.0.1

## 20.0.0

### Major Changes

- 164b15f: - Move `lgIds` to context, use `LgIdString` type, and remove setting `DEFAULT_LGID_ROOT`.

  - Update all IDs to return the unique root identifier passed to `data-lgid`:

    **Before**

    ```tsx
    export const getLgIds = (root: LgIdString = DEFAULT_LGID_ROOT) => {
      const ids = {
        root,
        panel: `${DEFAULT_LGID_ROOT}-panel`,
        select: `${root}-select`,
        copyButton: `${DEFAULT_LGID_ROOT}-copy_button`,
        copyTooltip: `${DEFAULT_LGID_ROOT}-copy_tooltip`,
        expandButton: `${root}-expand_button`,
        skeleton: `${root}-skeleton`,
        pre: `${root}-pre`,
        title: `${DEFAULT_LGID_ROOT}-title`,
      } as const;
      return ids;
    };
    ```

    **After**

    ```tsx
    export const getLgIds = (root: LgIdString = DEFAULT_LGID_ROOT) => {
      const ids = {
        root,
        panel: `${root}-panel`, // Updated to use unique root identifier
        select: `${root}-select`,
        copyButton: `${root}-copy_button`, // Updated to use unique root identifier
        copyTooltip: `${root}-copy_tooltip`, // Updated to use unique root identifier
        expandButton: `${root}-expand_button`,
        skeleton: `${root}-skeleton`,
        pre: `${root}-pre`,
        title: `${root}-title`, // Updated to use unique root identifier
      } as const;
      return ids;
    };
    ```

### Minor Changes

- 04e55b3: Exports `CopyButton` component

### Patch Changes

- 4f601e3: Adds missing `@lg-tools/build` as a devDep in local `package.json`
- Updated dependencies [164b15f]
- Updated dependencies [518ce41]
- Updated dependencies [3bef1e7]
- Updated dependencies [3bef1e7]
- Updated dependencies [164b15f]
- Updated dependencies [164b15f]
- Updated dependencies [1eafbb5]
- Updated dependencies [da277d5]
- Updated dependencies [92c38b1]
- Updated dependencies [92c38b1]
  - @leafygreen-ui/lib@15.1.0
  - @leafygreen-ui/hooks@9.1.0
  - @leafygreen-ui/button@24.0.2
  - @leafygreen-ui/typography@22.0.0
  - @leafygreen-ui/select@16.0.0
  - @leafygreen-ui/icon@14.1.0
  - @lg-tools/test-harnesses@0.3.2
  - @leafygreen-ui/tooltip@14.1.0
  - @leafygreen-ui/a11y@3.0.1
  - @leafygreen-ui/icon-button@17.0.2
  - @leafygreen-ui/leafygreen-provider@5.0.1
  - @leafygreen-ui/palette@5.0.0
  - @leafygreen-ui/skeleton-loader@3.0.2
  - @leafygreen-ui/tokens@3.1.1

## 19.0.1

### Patch Changes

- Updated dependencies [caaaeeb]
- Updated dependencies [8df5cd4]
- Updated dependencies [caaaeeb]
- Updated dependencies [4bd4da3]
- Updated dependencies [caaaeeb]
  - @lg-tools/test-harnesses@0.3.1
  - @leafygreen-ui/tooltip@14.0.1
  - @leafygreen-ui/select@15.0.1
  - @leafygreen-ui/tokens@3.1.0
  - @leafygreen-ui/icon-button@17.0.1
  - @leafygreen-ui/button@24.0.1
  - @leafygreen-ui/skeleton-loader@3.0.1
  - @leafygreen-ui/typography@21.0.1

## 19.0.0

### Major Changes

- 0757cfbfc: Adds code splitting for test utilities

  - Adds `/testing` entry point
  - Removes `getTestUtils` from main bundle entry point

  When using the component, testing utilities won't be included into your final bundle

  ```tsx
  // App.tsx
  import { Component } from `@leafygreen-ui/<package>`
  ```

  Testing utilities (and their dependencies) will only be imported if you import them explicitly

  ```tsx
  import { getTestUtils } from `@leafygreen-ui/<package>/testing`
  ```

- 0757cfbfc: Updates Typescript build to TS5.8

### Minor Changes

- 0757cfbfc: Adds postinstall script to ensure dependency types are resolved correctly

### Patch Changes

- 0757cfbfc: Adds `@lg-tools/build` as a dev dependency
- 0757cfbfc: Adds missing `@lg-tools/` devDependencies.
  Updates `build`, `tsc` & `docs` scripts to use `lg-build *` cli
- 0757cfbfc: Updates `types` entry point to `./dist/types`.
  Removes redundant `compilerOptions` from TSConfig
- 0757cfbfc: Updates `main` entry point in package.json to `./dist/umd`
- Updated dependencies [0757cfbfc]
- Updated dependencies [0757cfbfc]
- Updated dependencies [0757cfbfc]
- Updated dependencies [0757cfbfc]
- Updated dependencies [0757cfbfc]
- Updated dependencies [0757cfbfc]
- Updated dependencies [0757cfbfc]
- Updated dependencies [0757cfbfc]
  - @leafygreen-ui/leafygreen-provider@5.0.0
  - @leafygreen-ui/skeleton-loader@3.0.0
  - @leafygreen-ui/icon-button@17.0.0
  - @lg-tools/test-harnesses@0.3.0
  - @leafygreen-ui/typography@21.0.0
  - @leafygreen-ui/emotion@5.0.0
  - @leafygreen-ui/palette@5.0.0
  - @leafygreen-ui/tooltip@14.0.0
  - @leafygreen-ui/button@24.0.0
  - @leafygreen-ui/select@15.0.0
  - @leafygreen-ui/tokens@3.0.0
  - @leafygreen-ui/hooks@9.0.0
  - @leafygreen-ui/a11y@3.0.0
  - @leafygreen-ui/icon@14.0.0
  - @leafygreen-ui/lib@15.0.0

## 18.1.0

### Minor Changes

- 5c80334ed: [LG-4972](https://jira.mongodb.org/browse/LG-4972): add language support for `markdown`

## 18.0.5

### Patch Changes

- Updated dependencies [eca6e3fdc]
  - @leafygreen-ui/icon@13.4.0
  - @leafygreen-ui/button@23.1.6
  - @leafygreen-ui/icon-button@16.0.12
  - @leafygreen-ui/select@14.1.8
  - @leafygreen-ui/skeleton-loader@2.0.12
  - @leafygreen-ui/tooltip@13.0.13
  - @leafygreen-ui/typography@20.1.9

## 18.0.4

### Patch Changes

- @leafygreen-ui/select@14.1.7
- @leafygreen-ui/tooltip@13.0.12

## 18.0.3

### Patch Changes

- 21bcd4195: Use latest version of `useBackdropClick` hook
- Updated dependencies [21bcd4195]
- Updated dependencies [21bcd4195]
- Updated dependencies [1dbfb7064]
  - @leafygreen-ui/hooks@8.4.1
  - @leafygreen-ui/tooltip@13.0.11
  - @leafygreen-ui/icon@13.3.0
  - @leafygreen-ui/a11y@2.0.7
  - @leafygreen-ui/leafygreen-provider@4.0.7
  - @leafygreen-ui/select@14.1.6
  - @leafygreen-ui/emotion@4.1.1
  - @leafygreen-ui/button@23.1.6
  - @leafygreen-ui/icon-button@16.0.11
  - @leafygreen-ui/skeleton-loader@2.0.11
  - @leafygreen-ui/typography@20.1.8

## 18.0.2

### Patch Changes

- Updated dependencies [936364416]
  - @leafygreen-ui/icon-button@16.0.10
  - @leafygreen-ui/select@14.1.5

## 18.0.1

### Patch Changes

- Updated dependencies [f2ed4b037]
- Updated dependencies [2ab660926]
- Updated dependencies [fd1696643]
  - @leafygreen-ui/emotion@4.1.1
  - @leafygreen-ui/icon@13.2.2
  - @leafygreen-ui/a11y@2.0.6
  - @leafygreen-ui/button@23.1.5
  - @leafygreen-ui/hooks@8.4.0
  - @leafygreen-ui/icon-button@16.0.9
  - @leafygreen-ui/palette@4.1.4
  - @leafygreen-ui/select@14.1.4
  - @leafygreen-ui/skeleton-loader@2.0.10
  - @leafygreen-ui/tokens@2.12.2
  - @leafygreen-ui/tooltip@13.0.10
  - @leafygreen-ui/typography@20.1.7

## 18.0.0

### Major Changes

- b175dcf79: The following props are deprecated and have been removed: `copyable`, `showCustomActionButtons`, `languageOptions`, `customActionButtons`, `chromeTitle`, `onChange`. Please use the Panel component instead.

### Patch Changes

- Updated dependencies [30b13adec]
- Updated dependencies [30b13adec]
- Updated dependencies [78a36d6bb]
  - @leafygreen-ui/hooks@8.4.0
  - @leafygreen-ui/lib@14.2.0
  - @leafygreen-ui/emotion@4.1.0
  - @leafygreen-ui/a11y@2.0.5
  - @leafygreen-ui/leafygreen-provider@4.0.6
  - @leafygreen-ui/select@14.1.3
  - @leafygreen-ui/tooltip@13.0.9
  - @leafygreen-ui/button@23.1.4
  - @leafygreen-ui/icon@13.2.1
  - @leafygreen-ui/icon-button@16.0.8
  - @leafygreen-ui/palette@4.1.4
  - @leafygreen-ui/skeleton-loader@2.0.9
  - @leafygreen-ui/tokens@2.12.1
  - @leafygreen-ui/typography@20.1.6

## 17.1.2

### Patch Changes

- Updated dependencies [b75c9b896]
- Updated dependencies [16dda633f]
  - @leafygreen-ui/icon-button@16.0.7
  - @leafygreen-ui/leafygreen-provider@4.0.5
  - @leafygreen-ui/button@23.1.3
  - @leafygreen-ui/select@14.1.2
  - @leafygreen-ui/skeleton-loader@2.0.8
  - @leafygreen-ui/tooltip@13.0.8
  - @leafygreen-ui/typography@20.1.5

## 17.1.1

### Patch Changes

- Updated dependencies [4b362e136]
  - @leafygreen-ui/tokens@2.12.0
  - @leafygreen-ui/button@23.1.2
  - @leafygreen-ui/icon-button@16.0.6
  - @leafygreen-ui/select@14.1.1
  - @leafygreen-ui/skeleton-loader@2.0.7
  - @leafygreen-ui/tooltip@13.0.7
  - @leafygreen-ui/typography@20.1.4

## 17.1.0

### Minor Changes

- 526da3348: Adds the `customKeywords` prop, which allows you to wrap custom keywords in a specified className for CSS customization. Reserved keywords will be ignored.

  E.g.

  ```js
  <Code customKeywords={{ password: 'custom' }}>{snippet}</Code>
  ```

  Renders as

  ```html
  <span className="lg-highlight-custom">password</span>
  ```

## 17.0.0

### Major Changes

- 0e4c5099b: ## What's new?

  ### `panel`

  Adds a new slot prop, `panel`, that accepts the new `<Panel/>` sub-component. This will render the top panel with a language switcher, custom action buttons, and copy button. If no props are passed to the panel sub-component, the panel will render with only the copy button.

  **_Note: `copyButtonAppearance` cannot be used with `panel`. Either use `copyButtonAppearance` or `panel`, not both._**

  e.g.

  ```js
  panel={
    <Panel
      onChange={() => {}}
      languageOptions={[]}
      showCustomActionButtons
      customActionButtons={[]}
      title="Title"
    />
  }
  ```

  or

  ```js
  panel={<Panel/>}
  ```

  ### `copyButtonAppearance`

  Adds a new prop, `copyButtonAppearance`. This prop determines the appearance of the copy button if the `panel` prop is not defined. If `panel` is defined, this prop will be ignored.

  If `hover`, the copy button will only appear when the user hovers over the code block. On mobile devices, the copy button will always be visible.

  If `persist`, the copy button will always be visible.

  If `none`, the copy button will not be rendered.

  **_Note: 'panel' cannot be used with `copyButtonAppearance`. Either use `copyButtonAppearance` or `panel`, not both._**

  e.g.

  ```js
  <Code language="javascript" copyButtonAppearance="hover">
    {snippet}
  </Code>
  ```

  ### `isLoading`

  Adds a new prop, `isLoading`. This prop determines whether or not the loading skeleton will be rendered in place of the code block. If `true`, the language switcher and copy button will be disabled in the top panel.

  e.g.

  ```js
  <Code language="javascript" isLoading>
    {snippet}
  </Code>
  ```

  ### `chromeTitle`

  `<Panel/>` accepts the [deprecated `Code` props](https://github.com/mongodb/leafygreen-ui/tree/main/packages/code#deprecated) listed below, with one key difference: the `chromeTitle` prop has been replaced by `title`. Instead of rendering inside the window chrome bar, the `title` now appears within the top panel, as the window chrome bar has been removed.

  e.g.

  **Before**:

  ```js
  <Code chromeTitle="title">{snippet}</Code>
  ```

  **After**:

  ```js
  <Code panel={<Panel title="Title" />}>{snippet}</Code>
  ```

  ### `baseFontSize`

  Adds `baseFontSize` prop, which allows you to override the `LeafyGreenProvider` value.

  ### Test Harnesses

  Exports `getTestUtils`, a util to reliably interact with LG `Code` in a product test suite. For more details, check out the [README](https://github.com/mongodb/leafygreen-ui/tree/main/packages/code#test-harnesses) [LG-4799](https://jira.mongodb.org/browse/LG-4799)

  Exports `getLgIds`, a util to instantiate an object of `data-lgid` values for a given LG `Code` component instance.

  ## What's changed?

  The `className` prop is no longer applied to the `<pre>` tag. Instead it is applied to the parent `<div>` wrapper.

  ## Deprecated

  The following props have been marked as `deprecated`:

  - `customActionButtons`
  - `showCustomActionButtons`
  - `chromeTitle`
  - `languageOptions`
  - `onChange`
  - `copyable`

  Moving forward these props should be passed to the new sub-component, `<Panel />`.

  **Before**:

  ```js
  <Code
    language="javascript"
    showLineNumbers
    onCopy={() => {}}
    darkMode={true}
    onChange={() => {}}
    languageOptions={[]}
    showCustomActionButtons
    customActionButtons={[]}
    chromeTitle="Title"
  >
    {snippet}
  </Code>
  ```

  **After**:

  ```js
  <Code
    language="javascript"
    showLineNumbers
    onCopy={() => {}}
    darkMode={true}
    // NEW PANEL PROP
    panel={
      <Panel
        onChange={() => {}}
        languageOptions={[]}
        showCustomActionButtons
        customActionButtons={[]}
        title="Title"
      />
    }
  >
    {snippet}
  </Code>
  ```

  Check out the [README](https://github.com/mongodb/leafygreen-ui/tree/main/packages/code#panel) for information on the `<Panel>` sub-component.

### Patch Changes

- Updated dependencies [0e4c5099b]
- Updated dependencies [a2fd85b23]
- Updated dependencies [0e4c5099b]
- Updated dependencies [0e4c5099b]
  - @leafygreen-ui/lib@14.1.0
  - @leafygreen-ui/icon@13.2.0
  - @leafygreen-ui/select@14.1.0
  - @leafygreen-ui/a11y@2.0.4
  - @leafygreen-ui/button@23.1.1
  - @leafygreen-ui/hooks@8.3.6
  - @leafygreen-ui/icon-button@16.0.5
  - @leafygreen-ui/leafygreen-provider@4.0.4
  - @leafygreen-ui/palette@4.1.4
  - @leafygreen-ui/skeleton-loader@2.0.6
  - @leafygreen-ui/tokens@2.11.5
  - @leafygreen-ui/tooltip@13.0.6
  - @leafygreen-ui/typography@20.1.3

## 16.0.6

### Patch Changes

- 541e12e75: Updates builds to leverage Rollup tree shaking. (see [`tools/build/config/rollup.config.mjs`](https://github.com/mongodb/leafygreen-ui/blob/main/tools/build/config/rollup.config.mjs))
- Updated dependencies [541e12e75]
- Updated dependencies [3111a76f3]
  - @leafygreen-ui/a11y@2.0.3
  - @leafygreen-ui/button@23.1.0
  - @leafygreen-ui/emotion@4.0.10
  - @leafygreen-ui/hooks@8.3.5
  - @leafygreen-ui/icon@13.1.3
  - @leafygreen-ui/icon-button@16.0.4
  - @leafygreen-ui/leafygreen-provider@4.0.3
  - @leafygreen-ui/lib@14.0.3
  - @leafygreen-ui/palette@4.1.4
  - @leafygreen-ui/select@14.0.6
  - @leafygreen-ui/tokens@2.11.4
  - @leafygreen-ui/tooltip@13.0.5

## 16.0.5

### Patch Changes

- Updated dependencies [1501381ee]
  - @leafygreen-ui/button@23.0.0
  - @leafygreen-ui/select@14.0.5
  - @leafygreen-ui/tooltip@13.0.4

## 16.0.4

### Patch Changes

- Updated dependencies [859e5b45f]
  - @leafygreen-ui/icon-button@16.0.3
  - @leafygreen-ui/select@14.0.4
  - @leafygreen-ui/tooltip@13.0.4
  - @leafygreen-ui/button@22.0.2

## 16.0.3

### Patch Changes

- Updated dependencies [eb108e93b]
  - @leafygreen-ui/select@14.0.3
  - @leafygreen-ui/tooltip@13.0.3
  - @leafygreen-ui/button@22.0.2

## 16.0.2

### Patch Changes

- e1955dd36: Fixes broken patch build
- Updated dependencies [e1955dd36]
  - @leafygreen-ui/a11y@2.0.2
  - @leafygreen-ui/button@22.0.2
  - @leafygreen-ui/emotion@4.0.9
  - @leafygreen-ui/hooks@8.3.4
  - @leafygreen-ui/icon@13.1.2
  - @leafygreen-ui/icon-button@16.0.2
  - @leafygreen-ui/leafygreen-provider@4.0.2
  - @leafygreen-ui/lib@14.0.2
  - @leafygreen-ui/palette@4.1.3
  - @leafygreen-ui/select@14.0.2
  - @leafygreen-ui/tokens@2.11.3
  - @leafygreen-ui/tooltip@13.0.2

## 16.0.1

### Patch Changes

- 53c67fba6: [LG-4650](https://jira.mongodb.org/browse/LG-4650): migrates from `yarn` to `pnpm`
- Updated dependencies [53c67fba6]
  - @leafygreen-ui/leafygreen-provider@4.0.1
  - @leafygreen-ui/icon-button@16.0.1
  - @leafygreen-ui/palette@4.1.2
  - @leafygreen-ui/tooltip@13.0.1
  - @leafygreen-ui/button@22.0.1
  - @leafygreen-ui/select@14.0.1
  - @leafygreen-ui/tokens@2.11.2
  - @leafygreen-ui/hooks@8.3.3
  - @leafygreen-ui/a11y@2.0.1
  - @leafygreen-ui/icon@13.1.1
  - @leafygreen-ui/lib@14.0.1

## 16.0.0

### Major Changes

- 274d7e1a7: Removes prop-types from LeafyGreen UI

### Patch Changes

- Updated dependencies [274d7e1a7]
  - @leafygreen-ui/leafygreen-provider@4.0.0
  - @leafygreen-ui/icon-button@16.0.0
  - @leafygreen-ui/tooltip@13.0.0
  - @leafygreen-ui/button@22.0.0
  - @leafygreen-ui/select@14.0.0
  - @leafygreen-ui/a11y@2.0.0
  - @leafygreen-ui/icon@13.0.0
  - @leafygreen-ui/lib@14.0.0
  - @leafygreen-ui/hooks@8.3.2
  - @leafygreen-ui/tokens@2.11.1

## 15.0.0

### Major Changes

- 04bb887c0: [LG-4121](https://jira.mongodb.org/browse/LG-4121): `Code` renders the copy button tooltip and language selector in the top layer using popover API. As a result, the following props are removed:

  - `popoverZIndex`
  - `portalClassName`
  - `portalContainer`
  - `scrollContainer`
  - `usePortal`

  #### Migration guide

  Use [popover-v12 codemod](https://github.com/mongodb/leafygreen-ui/tree/main/tools/codemods#popover-v12) for migration assistance.

  ##### Old

  ```js
  <Code popoverZIndex={9999} usePortal={false} />
  <Code portalClassName="portal-class" usePortal />
  ```

  ##### New

  ```js
  <Code />
  <Code />
  ```

### Patch Changes

- Updated dependencies [04bb887c0]

  - @leafygreen-ui/hooks@8.3.0
  - @leafygreen-ui/leafygreen-provider@3.2.0
  - @leafygreen-ui/select@13.0.0
  - @leafygreen-ui/tooltip@12.0.0

- Updated dependencies [117a463f8]
  - @leafygreen-ui/lib@13.8.1

## 14.4.0

### Minor Changes

- f827eb412: [LG-4319](https://jira.mongodb.org/browse/LG-4319) Adds `expandable` prop to `Code` component. This makes it so that a codeblock with more than 5 lines of code can be expanded and collapsed via the click of a button.

### Patch Changes

- Updated dependencies [e7bc12814]
- Updated dependencies [c1b8b633b]
- Updated dependencies [fe2483937]
  - @leafygreen-ui/icon-button@15.0.23
  - @leafygreen-ui/hooks@8.1.4

## 14.3.3

### Patch Changes

- Updated dependencies [c406ab85]
- Updated dependencies [c406ab85]
  - @leafygreen-ui/select@12.0.0
  - @leafygreen-ui/tokens@2.6.0

## 14.3.2

### Patch Changes

- 15185af0: Imports Storybook utilities from `@lg-tools/storybook-utils` (previously imported from `@leafygreen-ui/lib`)
- 356a53fd: Update TS builds to use `typescript@4.9.5`
- Updated dependencies [7a0ff1be]
- Updated dependencies [15185af0]
- Updated dependencies [356a53fd]
- Updated dependencies [66df9ab8]
  - @leafygreen-ui/button@21.1.0
  - @leafygreen-ui/leafygreen-provider@3.1.12
  - @leafygreen-ui/icon-button@15.0.21
  - @leafygreen-ui/select@11.2.3
  - @leafygreen-ui/icon@12.0.1
  - @leafygreen-ui/lib@13.3.0
  - @leafygreen-ui/a11y@1.4.13
  - @leafygreen-ui/emotion@4.0.8
  - @leafygreen-ui/hooks@8.1.3
  - @leafygreen-ui/palette@4.0.9
  - @leafygreen-ui/tokens@2.5.2
  - @leafygreen-ui/tooltip@11.0.3

## 14.3.1

### Patch Changes

- a384a3d4: Fix test mocks for `CopyButton` component

  [LG-3915](https://jira.mongodb.org/browse/LG-3915)

- Updated dependencies [74057388]
  - @leafygreen-ui/icon@12.0.0
  - @leafygreen-ui/icon-button@15.0.20
  - @leafygreen-ui/select@11.2.2
  - @leafygreen-ui/tooltip@11.0.2

## 14.3.0

### Minor Changes

- 9afcc3bd: Adds tooltip hover interaction for `Code` component copy button
  [LG-3915](https://jira.mongodb.org/browse/LG-3915)

## 14.2.19

### Patch Changes

- 12296e6c: Exports `Panel` component
  [LG-4076](https://jira.mongodb.org/browse/LG-4076)
- e487fb24: Renames story files from `.story.tsx` to `.stories.tsx`
- Updated dependencies [5ee54143]
- Updated dependencies [e487fb24]
  - @leafygreen-ui/tokens@2.5.1
  - @leafygreen-ui/select@11.2.1
  - @leafygreen-ui/hooks@8.1.2
  - @leafygreen-ui/icon@11.29.1

## 14.2.18

### Patch Changes

- fa135957: Code LiveExample now correctly works with 'language="none"'
- Updated dependencies [99848a0f]
- Updated dependencies [6c89b45b]
- Updated dependencies [ed0437ce]
  - @leafygreen-ui/lib@13.1.0
  - @leafygreen-ui/button@21.0.11
  - @leafygreen-ui/icon@11.25.1

## 14.2.17

### Patch Changes

- Updated dependencies [dd4f3da8]
- Updated dependencies [9a471879]
- Updated dependencies [784e9d8a]
- Updated dependencies [dd4f3da8]
  - @leafygreen-ui/lib@13.0.0
  - @leafygreen-ui/select@11.0.1
  - @leafygreen-ui/icon-button@15.0.19
  - @leafygreen-ui/a11y@1.4.11
  - @leafygreen-ui/button@21.0.9
  - @leafygreen-ui/leafygreen-provider@3.1.10

## 14.2.16

### Patch Changes

- Updated dependencies [c5d95794]
- Updated dependencies [a4b3b704]
  - @leafygreen-ui/select@11.0.0
  - @leafygreen-ui/button@21.0.8

## 14.2.15

### Patch Changes

- Updated dependencies [3a9b274d]
- Updated dependencies [3a9b274d]
  - @leafygreen-ui/lib@12.0.0
  - @leafygreen-ui/select@10.3.16
  - @leafygreen-ui/a11y@1.4.10
  - @leafygreen-ui/button@21.0.6
  - @leafygreen-ui/icon-button@15.0.18
  - @leafygreen-ui/leafygreen-provider@3.1.9

## 14.2.14

### Patch Changes

- Updated dependencies [3fe03b50]
- Updated dependencies [fd907503]
- Updated dependencies [c9f0055a]
- Updated dependencies [56459cde]
  - @leafygreen-ui/tokens@2.2.0
  - @leafygreen-ui/hooks@8.0.0
  - @leafygreen-ui/icon@11.23.0
  - @leafygreen-ui/a11y@1.4.9
  - @leafygreen-ui/leafygreen-provider@3.1.8
  - @leafygreen-ui/select@10.3.14

## 14.2.13

### Patch Changes

- 4fcf2e94: Move custom select menu button into separate components and passes custom select menu button props to new internal select prop, `__INTERNAL__menuButtonSlotProps__`.
- 4fcf2e94: Updates LanguageSwitcher hover styles specificity to `&:hover[aria-disabled='false']`.
- Updated dependencies [4fcf2e94]
- Updated dependencies [4fcf2e94]
- Updated dependencies [4fcf2e94]
- Updated dependencies [4fcf2e94]
- Updated dependencies [4fcf2e94]
- Updated dependencies [4fcf2e94]
  - @leafygreen-ui/icon@11.22.2
  - @leafygreen-ui/lib@11.0.0
  - @leafygreen-ui/select@10.3.13
  - @leafygreen-ui/a11y@1.4.8
  - @leafygreen-ui/button@21.0.5
  - @leafygreen-ui/icon-button@15.0.17
  - @leafygreen-ui/leafygreen-provider@3.1.7

## 14.2.12

### Patch Changes

- c11bbc29: Fixes problem with ts-docs not being available in bundle.
- Updated dependencies [c11bbc29]
  - @leafygreen-ui/a11y@1.4.7
  - @leafygreen-ui/button@21.0.3
  - @leafygreen-ui/emotion@4.0.7
  - @leafygreen-ui/hooks@7.7.8
  - @leafygreen-ui/icon@11.22.1
  - @leafygreen-ui/icon-button@15.0.16
  - @leafygreen-ui/leafygreen-provider@3.1.6
  - @leafygreen-ui/lib@10.4.3
  - @leafygreen-ui/palette@4.0.7
  - @leafygreen-ui/select@10.3.12
  - @leafygreen-ui/tokens@2.1.4

## 14.2.11

### Patch Changes

- c15ee2ac: Fixes missing documentation file
- Updated dependencies [f73807cf]
- Updated dependencies [31c09354]
- Updated dependencies [c15ee2ac]
  - @leafygreen-ui/icon@11.22.0
  - @leafygreen-ui/a11y@1.4.6
  - @leafygreen-ui/button@21.0.2
  - @leafygreen-ui/emotion@4.0.6
  - @leafygreen-ui/hooks@7.7.7
  - @leafygreen-ui/icon-button@15.0.15
  - @leafygreen-ui/leafygreen-provider@3.1.5
  - @leafygreen-ui/lib@10.4.2
  - @leafygreen-ui/palette@4.0.6
  - @leafygreen-ui/select@10.3.11
  - @leafygreen-ui/tokens@2.1.3

## 14.2.10

### Patch Changes

- Updated dependencies [cfba537d]
  - @leafygreen-ui/button@21.0.0
  - @leafygreen-ui/select@10.3.9

## 14.2.9

### Patch Changes

- 215268ff: Updates build tooling. No functional changes
- Updated dependencies [215268ff]
  - @leafygreen-ui/leafygreen-provider@3.1.4
  - @leafygreen-ui/icon-button@15.0.14
  - @leafygreen-ui/emotion@4.0.5
  - @leafygreen-ui/palette@4.0.5
  - @leafygreen-ui/button@20.3.1
  - @leafygreen-ui/select@10.3.8
  - @leafygreen-ui/tokens@2.1.2
  - @leafygreen-ui/hooks@7.7.6
  - @leafygreen-ui/a11y@1.4.5
  - @leafygreen-ui/icon@11.20.1
  - @leafygreen-ui/lib@10.4.1

## 14.2.8

### Patch Changes

- 4f03c6c5: Line highlight colors updated to use new palette, and consistent with design spec.
- Updated dependencies [547d828e]
  - @leafygreen-ui/icon-button@15.0.13

## 14.2.7

### Patch Changes

- 76161cf0: Updates stories for Chromatic testing
- Updated dependencies [76161cf0]
- Updated dependencies [76161cf0]
- Updated dependencies [735342e9]
- Updated dependencies [95f5107a]
- Updated dependencies [76161cf0]
- Updated dependencies [76161cf0]
- Updated dependencies [76161cf0]
  - @leafygreen-ui/lib@10.4.0
  - @leafygreen-ui/hooks@7.7.5
  - @leafygreen-ui/icon@11.17.0
  - @leafygreen-ui/button@20.2.1
  - @leafygreen-ui/icon-button@15.0.12
  - @leafygreen-ui/select@10.3.7
  - @leafygreen-ui/tokens@2.1.1

## 14.2.6

### Patch Changes

- 63b2deb0b: Upgrade button to v20.1.1
- Updated dependencies [63b2deb0b]
  - @leafygreen-ui/select@10.3.6

## 14.2.5

### Patch Changes

- d2ce54e2f: Updates story files for Storybook 7.x
- Updated dependencies [d2ce54e2f]
- Updated dependencies [d2ce54e2f]
- Updated dependencies [0cd471676]
- Updated dependencies [0cd471676]
- Updated dependencies [2dfc4d0ea]
  - @leafygreen-ui/button@20.1.0
  - @leafygreen-ui/hooks@7.7.4
  - @leafygreen-ui/icon@11.16.1
  - @leafygreen-ui/icon-button@15.0.11
  - @leafygreen-ui/leafygreen-provider@3.1.3
  - @leafygreen-ui/lib@10.3.4
  - @leafygreen-ui/select@10.3.5

## 14.2.4

### Patch Changes

- d3dd7aad5: Updates to TSDocs
- Updated dependencies [d3dd7aad5]
  - @leafygreen-ui/button@20.0.7

## 14.2.3

### Patch Changes

- 73cbbd02c: Uses fontWeight token from `@leafygreen-ui/tokens`
- Updated dependencies [73cbbd02c]
- Updated dependencies [32b3d3146]
- Updated dependencies [83fc5b31b]
- Updated dependencies [8ece56980]
- Updated dependencies [32b3d3146]
- Updated dependencies [73cbbd02c]
  - @leafygreen-ui/tokens@2.1.0
  - @leafygreen-ui/a11y@1.4.3
  - @leafygreen-ui/select@10.3.3
  - @leafygreen-ui/icon@11.14.0
  - @leafygreen-ui/hooks@7.7.2
  - @leafygreen-ui/button@20.0.6

## 14.2.2

### Patch Changes

- 8c0c2bdf9: Updates build script to include a transpiled copy of the story file in the bundle
- Updated dependencies [8c0c2bdf9]
  - @leafygreen-ui/a11y@1.4.2
  - @leafygreen-ui/button@20.0.4
  - @leafygreen-ui/emotion@4.0.4
  - @leafygreen-ui/hooks@7.7.1
  - @leafygreen-ui/icon@11.13.1
  - @leafygreen-ui/icon-button@15.0.9
  - @leafygreen-ui/leafygreen-provider@3.1.2
  - @leafygreen-ui/lib@10.3.2
  - @leafygreen-ui/palette@4.0.3
  - @leafygreen-ui/select@10.3.1
  - @leafygreen-ui/tokens@2.0.2

## 14.2.1

### Patch Changes

- Updated dependencies [5b036515e]
- Updated dependencies [26e341a0b]
- Updated dependencies [997121cc3]
  - @leafygreen-ui/palette@4.0.0
  - @leafygreen-ui/lib@10.2.2
  - @leafygreen-ui/icon@11.12.5
  - @leafygreen-ui/button@20.0.2
  - @leafygreen-ui/icon-button@15.0.7
  - @leafygreen-ui/select@10.2.3
  - @leafygreen-ui/tokens@2.0.1

## 14.2.0

### Minor Changes

- 1f8ebbba6: Exports `LanguageOption` type
- 7edcd1b0f: Adds support for C and C++. Adds HTML alias for XML

### Patch Changes

- bf2fedf6d: Version bumps lib
- Updated dependencies [1cff328a3]
- Updated dependencies [51c544e2e]
- Updated dependencies [ffb99f417]
- Updated dependencies [bf2fedf6d]
  - @leafygreen-ui/button@20.0.0
  - @leafygreen-ui/a11y@1.4.0
  - @leafygreen-ui/hooks@7.5.0
  - @leafygreen-ui/icon-button@15.0.6
  - @leafygreen-ui/leafygreen-provider@3.1.1
  - @leafygreen-ui/select@10.2.1

## 14.1.2

### Patch Changes

- b24b21462: Storybook: Updates story files to be on par with existing mongodb.design examples
- Updated dependencies [050f1f8a9]
- Updated dependencies [741cdd408]
- Updated dependencies [c82ed35d5]
- Updated dependencies [b24b21462]
  - @leafygreen-ui/icon@11.12.4
  - @leafygreen-ui/tokens@2.0.0
  - @leafygreen-ui/button@19.0.4
  - @leafygreen-ui/icon-button@15.0.4
  - @leafygreen-ui/select@10.1.1
  - @leafygreen-ui/palette@3.4.7

## 14.1.1

### Patch Changes

- 48ffa944d: Adds TSDoc annotations for `language`, `languageOptions` & `onChange`
- Updated dependencies [405636249]
  - @leafygreen-ui/hooks@7.4.0

## 14.1.0

### Minor Changes

- 10dd1dc50: Remove `useUsingKeyboardContext` hook and use `focus-visible` to show focus states.

### Patch Changes

- Updated dependencies [703db871f]
- Updated dependencies [c7f7fff56]
  - @leafygreen-ui/palette@3.4.6
  - @leafygreen-ui/button@19.0.3

## 14.0.2

### Patch Changes

- 48013291e: Fixing bug where numbered cells would stretch excessively in wide viewports
- Updated dependencies [75f26afbc]
- Updated dependencies [95bd93ef9]
- Updated dependencies [3bb4b7506]
  - @leafygreen-ui/icon-button@15.0.3
  - @leafygreen-ui/icon@11.12.3

## 14.0.1

### Patch Changes

- ed0e425e5: Adds `polished` as an explicit dependency
- ae5421cf6: Updates components to use internal transition tokens
- Updated dependencies [696adb1b6]
- Updated dependencies [ae5421cf6]
- Updated dependencies [ed0e425e5]
- Updated dependencies [4b4c2d27d]
- Updated dependencies [1a335d0b2]
- Updated dependencies [ae5421cf6]
- Updated dependencies [7ca2da507]
  - @leafygreen-ui/select@10.1.0
  - @leafygreen-ui/tokens@1.4.0
  - @leafygreen-ui/button@19.0.1
  - @leafygreen-ui/icon@11.12.1
  - @leafygreen-ui/icon-button@15.0.1

## 14.0.0

### Major Changes

- 30207122: Updates `Code` for dark mode brand refresh.

### Patch Changes

- Updated dependencies [b9b09a86]
  - @leafygreen-ui/leafygreen-provider@3.1.0
  - @leafygreen-ui/button@19.0.0
  - @leafygreen-ui/icon-button@15.0.0
  - @leafygreen-ui/select@10.0.0

## 13.0.1

### Patch Changes

- Updated dependencies [2195359a]
- Updated dependencies [209f77ed]
- Updated dependencies [f2d63a60]
  - @leafygreen-ui/icon-button@14.0.1
  - @leafygreen-ui/icon@11.12.0
  - @leafygreen-ui/button@18.0.0
  - @leafygreen-ui/lib@10.0.0
  - @leafygreen-ui/select@9.0.0
  - @leafygreen-ui/a11y@1.3.4
  - @leafygreen-ui/leafygreen-provider@3.0.1

## 13.0.0

### Patch Changes

- Updated dependencies [0b6435fa]
- Updated dependencies [f21e42a0]
- Updated dependencies [e399f1b9]
- Updated dependencies [e399f1b9]
  - @leafygreen-ui/button@17.0.0
  - @leafygreen-ui/select@8.0.0
  - @leafygreen-ui/leafygreen-provider@3.0.0
  - @leafygreen-ui/icon-button@14.0.0

## 12.1.1

### Patch Changes

- 24683433: - Remove an implicit dependency on `@emotion/react` fixing an issue where LG packages would not build if `@leafygreen/emotion@4.0.2` or greater was installed.
- Updated dependencies [24683433]
  - @leafygreen-ui/a11y@1.3.3
  - @leafygreen-ui/button@16.1.1
  - @leafygreen-ui/emotion@4.0.3
  - @leafygreen-ui/hooks@7.3.3
  - @leafygreen-ui/icon@11.11.1
  - @leafygreen-ui/icon-button@13.2.1
  - @leafygreen-ui/leafygreen-provider@2.3.5
  - @leafygreen-ui/lib@9.5.1
  - @leafygreen-ui/palette@3.4.4
  - @leafygreen-ui/select@7.1.1
  - @leafygreen-ui/tokens@1.3.4

## 12.1.0

### Minor Changes

- 3690df49: Updates TypeScript annotations, type structures and export format of some components

### Patch Changes

- 3690df49: Extends `code` element props
- 8c34ea32: Changing language picker button text color in dark mode
- Updated dependencies [3690df49]
- Updated dependencies [3690df49]
- Updated dependencies [3690df49]
- Updated dependencies [3690df49]
- Updated dependencies [3690df49]
- Updated dependencies [58a5a05e]
  - @leafygreen-ui/button@16.1.0
  - @leafygreen-ui/icon@11.11.0
  - @leafygreen-ui/icon-button@13.2.0
  - @leafygreen-ui/select@7.1.0
  - @leafygreen-ui/lib@9.5.0
  - @leafygreen-ui/a11y@1.3.2
  - @leafygreen-ui/emotion@4.0.2
  - @leafygreen-ui/hooks@7.3.2
  - @leafygreen-ui/leafygreen-provider@2.3.4
  - @leafygreen-ui/palette@3.4.3
  - @leafygreen-ui/tokens@1.3.3

## 12.0.2

### Patch Changes

- 8d7534e9: Adds `tsdoc.json` to published package files
- 6924b0be: Locking highlight.js dependency to 11.5 given bugs in 11.6
- ff69bdb6: Removes a misplaced shadow when `copyable` was `false`
- Updated dependencies [7caa1c3e]
- Updated dependencies [8d7534e9]
  - @leafygreen-ui/icon@11.10.2
  - @leafygreen-ui/a11y@1.3.1
  - @leafygreen-ui/hooks@7.3.1
  - @leafygreen-ui/icon-button@13.1.1
  - @leafygreen-ui/leafygreen-provider@2.3.3
  - @leafygreen-ui/lib@9.4.2
  - @leafygreen-ui/palette@3.4.2
  - @leafygreen-ui/select@7.0.2
  - @leafygreen-ui/tokens@1.3.2

## 12.0.1

### Patch Changes

- cfb82f90: Swap default icon from 'Copy' to 'File'
- Updated dependencies [b22cc41f]
- Updated dependencies [828c895d]
  - @leafygreen-ui/select@6.1.0

## 12.0.0

### Patch Changes

- Updated dependencies [85d46871]
- Updated dependencies [99e20bb9]
  - @leafygreen-ui/lib@9.4.0
  - @leafygreen-ui/leafygreen-provider@2.3.0
  - @leafygreen-ui/icon-button@13.0.0
  - @leafygreen-ui/select@6.0.0

## 11.0.1

### Patch Changes

- fd2f6de0: Updates to TSDocs, PropTypes, and Storybook files
- 96d1ff9c: Updates to propTypes, TSDocs, and Storybook controls
- Updated dependencies [6a89bc29]
- Updated dependencies [fd2f6de0]
- Updated dependencies [6792bc44]
- Updated dependencies [96d1ff9c]
- Updated dependencies [422dbfcd]
- Updated dependencies [9ff90d4b]
- Updated dependencies [6792bc44]
  - @leafygreen-ui/palette@3.4.0
  - @leafygreen-ui/hooks@7.3.0
  - @leafygreen-ui/icon-button@11.0.2
  - @leafygreen-ui/select@5.0.2
  - @leafygreen-ui/tokens@1.3.1
  - @leafygreen-ui/lib@9.3.0

## 11.0.0

### Major Changes

- e13d2487: Moving leafygreen-provider to peerDependencies.
- Updated dependencies [500d6c60]
  - @leafygreen-ui/leafygreen-provider@2.2.0

### Patch Changes

- 91e24dfe: Add `container` to copyable.js instance to help keep focus inside of a modal
- Updated dependencies [e13d2487]
- Updated dependencies [5f28fce1]
- Updated dependencies [c48e943e]
- Updated dependencies [500d6c60]
  - @leafygreen-ui/icon-button@11.0.0
  - @leafygreen-ui/tokens@1.3.0
  - @leafygreen-ui/icon@11.9.0
  - @leafygreen-ui/select@5.0.0

## 10.0.0

### Major Changes

- ab1fd9e: Updates Code to allign with visual brand update
  - Removes fixed width when Language picker is shown (`width` was formerly set to a static `700px`)

### Patch Changes

- Updated dependencies [ab1fd9e]
  - @leafygreen-ui/icon-button@10.0.0

## 9.5.0

### Minor Changes

- 1067fe9: Add support to specify starting value for line numbering.

## 9.4.0

### Minor Changes

- 548ca2c: Adds support for controlling the language switcher popover characteristics with `usePortal`, `portalClassName`, `portalContainer`, `scrollContainer`, and `popoverZIndex` props.
- 548ca2c: Add support for Dart language

## 9.3.0

### Minor Changes

- 70f3c2c: Add support for custom action buttons in the code component

### Patch Changes

- Updated dependencies [70f3c2c]
- Updated dependencies [70f3c2c]
  - @leafygreen-ui/hooks@7.1.1
  - @leafygreen-ui/select@3.1.0

## 9.2.0

### Minor Changes

- 2a945c7a: Adds support for Java `.properties` files

### Patch Changes

- Updated dependencies [d4a46e27]
- Updated dependencies [cec710ad]
  - @leafygreen-ui/icon@11.6.0
  - @leafygreen-ui/lib@9.0.1
  - @leafygreen-ui/select@3.0.7

## 9.1.0

### Minor Changes

- a30caf8f: Removes `clike` language support in Code component (previously removed by `highlight.js`)

## 9.0.0

### Major Changes

- 3c2fdcde: Upgrades `highlight.js` dependency from v10 to v11. This update will cause some syntax highlighting styles to change from previous versions of the Code component.

### Patch Changes

- Updated dependencies [cd4f9a27]
  - @leafygreen-ui/select@3.0.6

## 8.1.6

### Patch Changes

- Updated dependencies [f6e5655a]
- Updated dependencies [03388ff2]
- Updated dependencies [b8f03aa1]
  - @leafygreen-ui/palette@3.2.2
  - @leafygreen-ui/icon@11.3.0
  - @leafygreen-ui/lib@9.0.0
  - @leafygreen-ui/a11y@1.2.2
  - @leafygreen-ui/icon-button@9.1.6
  - @leafygreen-ui/select@3.0.5
  - @leafygreen-ui/leafygreen-provider@2.1.3
  - @leafygreen-ui/tokens@0.5.3

## 8.1.5

### Patch Changes

- Updated dependencies [e1af3278]
- Updated dependencies [047c1930]
- Updated dependencies [047c1930]
- Updated dependencies [e1af3278]
  - @leafygreen-ui/icon-button@9.1.5
  - @leafygreen-ui/lib@8.0.0
  - @leafygreen-ui/hooks@7.0.0
  - @leafygreen-ui/select@3.0.3
  - @leafygreen-ui/a11y@1.2.1
  - @leafygreen-ui/icon@11.1.1
  - @leafygreen-ui/leafygreen-provider@2.1.2
  - @leafygreen-ui/tokens@0.5.2

## 8.1.4

### Patch Changes

- 74ffc369: Announces "copied" to screenreaders when text is copied
- Updated dependencies [1ffbb84c]
  - @leafygreen-ui/select@3.0.2

## 8.1.3

### Patch Changes

- Updated dependencies [faeb0ce0]
- Updated dependencies [650f6334]
  - @leafygreen-ui/icon@11.0.0
  - @leafygreen-ui/select@3.0.1

## 8.1.2

### Patch Changes

- Updated dependencies [857a680a]
- Updated dependencies [857a680a]
  - @leafygreen-ui/leafygreen-provider@2.1.0
  - @leafygreen-ui/select@3.0.0

## 8.1.1

### Patch Changes

- 909ede70: Removes empty panel rendered when copyable is false

## 8.1.0

### Minor Changes

- 55ccd908: Adds ability for Code component to be rendered with a language switcher

### Patch Changes

- Updated dependencies [559ceb15]
  - @leafygreen-ui/select@2.1.0

## 8.0.9

### Patch Changes

- Updated dependencies [90321b36]
- Updated dependencies [90321b36]
  - @leafygreen-ui/icon-button@9.1.3
  - @leafygreen-ui/lib@7.0.0
  - @leafygreen-ui/icon@10.2.1
  - @leafygreen-ui/leafygreen-provider@2.0.3
  - @leafygreen-ui/tokens@0.5.1

## 8.0.8

### Patch Changes

- Updated dependencies [99ea9436]
- Updated dependencies [ec27f36e]
  - @leafygreen-ui/icon-button@9.1.2
  - @leafygreen-ui/icon@10.0.0

## 8.0.7

### Patch Changes

- 16b902b5: Provides callback to sort() function in renderingPlugin to ensure that line numbers are being properly sorted before determining whether or not to highlight a line.

## 8.0.6

### Patch Changes

- b905c17d: Fixes issue where sublanguages like JSX would not render.

## 8.0.5

### Patch Changes

- 63a6c2f6: - Fixes issue where many applications had global styles for pre tags that added a second border and border radius to the pre element.
  - Fixes issue where code examples would be detected as multi-line when a single line example has preceding or subsequent new line characters.

## 8.0.4

### Patch Changes

- 717c7023: Fix issue where border wouldn't stretch the full height of the component with a wrapping, single line code example.

## 8.0.3

### Patch Changes

- Updated dependencies [f805b772]
  - @leafygreen-ui/icon@9.0.0

## 8.0.2

### Patch Changes

- a85c6d8d: Prevent default behavior when copy button is clicked to prevent accidental form submissions.
- Updated dependencies [bf8b83e1]
  - @leafygreen-ui/icon@8.0.1

## 8.0.1

### Patch Changes

- Updated dependencies [ba56b1cc]
  - @leafygreen-ui/icon@8.0.0

## 8.0.0

### Major Changes

- 4f3f7b9f: Fixes various bugs, makes accessibility improvements, tweaks the design, and improves maintainability of the `Code` component.

  Design changes:

  - Updates the syntax highlighting theme to improve contrast between comments and regular code, as well as making several optimizations for red-green colorblindness.
  - Tightens the top and bottom padding for the code component, especially for single line code examples.
  - Significantly tightens the left padding when line numbers are shown.
  - Right-aligns line numbers in their column to improve readability.

  Bug fixes:

  - Fixes an issue where iOS browsers would render code examples at a `20px` size, rather than the `13px` font size they're supposed to render as.
  - Sometimes code that's written as multi-line statements wouldn't have line numbers applied to each line of the statement. That should now be fixed.
  - Fixes an issue where line highlight gradients in dark mode in Safari would render multiple gradients when line numbers were shown.

  Under the hood updates:

  - Removes the Syntax component. This component was extremely tightly coupled with the code component to a point where it wasn't a feasible component when used independently. All functionality is now self-contained within the Code component code.
  - Line highlighting definitions written with tuples expressing ranges are no longer expanded, making for a more efficient implementation, and allowing us to remove an arbitrary restriction on the number of lines possible to highlight.
  - Tokens can now have multiple classNames expressing their "kind", allowing for more precise code highlighting.

### Patch Changes

- Updated dependencies [7df69248]
  - @leafygreen-ui/lib@6.2.0

## 7.3.1

### Patch Changes

- aae1e47e: Adds component to browser's Tab order when scrollable so those navigating via keyboard are able to scroll and view content appropriately

## 7.3.0

### Minor Changes

- c18f16e6: Improves compatibility with React v17

### Patch Changes

- Updated dependencies [c18f16e6]
- Updated dependencies [9ee1d5fc]
  - @leafygreen-ui/hooks@6.0.0
  - @leafygreen-ui/lib@6.1.1

## 7.2.0

### Minor Changes

- 611012de: Adds support for `http` language

### Patch Changes

- Updated dependencies [611012de]
  - @leafygreen-ui/syntax@6.2.0

## 7.1.0

### Minor Changes

- 2643d4e7: Adds support for `xml` language

### Patch Changes

- Updated dependencies [5cf0c95c]
- Updated dependencies [2643d4e7]
  - @leafygreen-ui/lib@6.1.0
  - @leafygreen-ui/syntax@6.1.0

## 7.0.1

### Patch Changes

- f56f5ab1: Fixes an issue where line highlighting might not span the entire component.
- dac3f38b: Fixes a publishing error that prevented UMD modules from being distributed
- Updated dependencies [f56f5ab1]
- Updated dependencies [dac3f38b]
  - @leafygreen-ui/syntax@6.0.1
  - @leafygreen-ui/hooks@5.0.1
  - @leafygreen-ui/icon@7.0.1
  - @leafygreen-ui/icon-button@9.0.1
  - @leafygreen-ui/lib@6.0.1

## 7.0.0

### Major Changes

- 0267bfd2: The underlying structure of distributed module definition files have changed and now have official support for ES modules. Module definition files are now generated using Rollup instead of Webpack. This should not affect functionality, but some thorough testing and caution should be exercised when upgrading.

### Patch Changes

- Updated dependencies [0267bfd2]
  - @leafygreen-ui/hooks@5.0.0
  - @leafygreen-ui/icon-button@9.0.0
  - @leafygreen-ui/icon@7.0.0
  - @leafygreen-ui/lib@6.0.0
  - @leafygreen-ui/syntax@6.0.0

## 6.0.0

### Major Changes

- 50ea11ad: Deprecates the `multiline` prop in the Code component. Single line code examples are now detected automatically via the presence of line breaks in the string, and single line spacing is applied automatically.
- 50ea11ad: - Adds the line highlighting feature! This feature is supported through the `highlightLines` prop.
  - All code examples are now rendered as a table, making unhighlighted code render consistently with highlighted code.
  - Fixes an issue where users might be unable to manually copy code.

### Patch Changes

- 50ea11ad: Fixes issue where the Code and Syntax components would break when passed code with invalid syntax"
- Updated dependencies [65d5ed4d]
- Updated dependencies [50ea11ad]
- Updated dependencies [50ea11ad]
  - @leafygreen-ui/icon@6.7.0
  - @leafygreen-ui/syntax@5.0.0
  - @leafygreen-ui/icon-button@8.0.2

## 5.0.0

### Major Changes

- 729c79f8: Deprecates `variant` prop in favor of `darkMode` prop to control whether or not the component will appear in dark mode

### Patch Changes

- Updated dependencies [729c79f8]
  - @leafygreen-ui/syntax@4.0.0

## 4.0.4

### Patch Changes

- Updated dependencies [fe371e37]
- Updated dependencies [a84219f1]
  - @leafygreen-ui/syntax@3.1.0
  - @leafygreen-ui/icon-button@8.0.0

## 4.0.3

### Patch Changes

- e599707: Require lodash dependencies instead of inlining them.
- 8c867bb: Reduces server side effect warnings
- Updated dependencies [e49d66b]
- Updated dependencies [e599707]
- Updated dependencies [8c867bb]
  - @leafygreen-ui/icon@6.5.0
  - @leafygreen-ui/hooks@4.2.0
  - @leafygreen-ui/icon-button@7.0.5

## 4.0.2

### Patch Changes

- Updated dependencies [ab4c074]
  - @leafygreen-ui/icon-button@7.0.0

## 4.0.1

### Patch Changes

- 691eb05: Better support for UMD
- Updated dependencies [691eb05]
  - @leafygreen-ui/icon@6.3.2
  - @leafygreen-ui/icon-button@6.1.4
  - @leafygreen-ui/lib@5.1.1
  - @leafygreen-ui/syntax@3.0.1

## 4.0.0

### Major Changes

- 7373e7b: Updates Syntax component to use the Highlight.js plugin API to render syntax.

  This helps in a couple ways:

  - Lets us remove the only instance of `dangerouslySetInnerHTML` within LeafyGreen UI by rendering syntax highlighting through React directly.
  - Allows us to render the component's content as a Table. This allows us to fix an alignment issue between line numbers and wrapped text, as well as opens the door for future features.

### Patch Changes

- Updated dependencies [2eba736]
- Updated dependencies [1aa26ee]
- Updated dependencies [d2136a0]
- Updated dependencies [a571361]
- Updated dependencies [7373e7b]
  - @leafygreen-ui/lib@5.0.0
  - @leafygreen-ui/icon@6.3.0
  - @leafygreen-ui/syntax@3.0.0
  - @leafygreen-ui/icon-button@6.1.2

## 3.5.0

### Minor Changes

- 6233a34: Adds `onCopy` callback, invoked when copy button is clicked

## 3.4.6

### Patch Changes

- Updated dependencies [1d86d56]
- Updated dependencies [1d86d56]
  - @leafygreen-ui/icon@6.1.0
  - @leafygreen-ui/icon-button@6.0.0

## 3.4.5

### Patch Changes

- Updated dependencies [6fc022e]
  - @leafygreen-ui/icon@6.0.0
  - @leafygreen-ui/icon-button@5.0.4

## 3.4.4

### Patch Changes

- cf6167e: Build and consume individual glyph components
- Updated dependencies [2fc4ef9]
- Updated dependencies [e857861]
- Updated dependencies [cf6167e]
  - @leafygreen-ui/icon@5.2.0
  - @leafygreen-ui/icon-button@5.0.3

## 3.4.3

### Patch Changes

- 75c0693: Upgrades workspace dependencies
- Updated dependencies [75c0693]
- Updated dependencies [9c34e9f]
  - @leafygreen-ui/icon@5.0.3
  - @leafygreen-ui/syntax@2.6.0
  - @leafygreen-ui/icon-button@5.0.1

## 3.4.2

### Patch Changes

- Updated dependencies [5aafd72]
  - @leafygreen-ui/icon-button@5.0.0
  - @leafygreen-ui/icon@5.0.2
  - @leafygreen-ui/lib@4.4.1

## 3.4.1

### Patch Changes

- Updated dependencies [4c268a5]
  - @leafygreen-ui/icon@5.0.0
  - @leafygreen-ui/icon-button@4.1.5

## 3.4.0

### Minor Changes

- beccf70: Adds Objective-C language highlight support

### Patch Changes

- Updated dependencies [e1568c6]
- Updated dependencies [beccf70]
  - @leafygreen-ui/icon@4.3.0
  - @leafygreen-ui/syntax@2.5.0
  - @leafygreen-ui/icon-button@4.1.4

## 3.3.0

### Minor Changes

- f2fed7c: Adds copy functionality to Code component

### Patch Changes

- Updated dependencies [f2fed7c]
  - @leafygreen-ui/syntax@2.4.0

## 3.2.0

### Minor Changes

- c117a62: Enables Kotlin language support

### Patch Changes

- Updated dependencies [c117a62]
  - @leafygreen-ui/syntax@2.3.0

## 3.1.0

### Minor Changes

- a0d0d7b: Enables Swift language support

## 3.0.0

### Major Changes

- 464c09d: Introduces SSR compatibility though a change to our build process and files

### Patch Changes

- Updated dependencies [464c09d]
  - @leafygreen-ui/lib@4.0.0
  - @leafygreen-ui/syntax@2.0.0
