@mintlify/components 0.3.11 → 0.3.12

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/.eslintrc.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": [
3
+ "eslint:recommended",
4
+ "plugin:react/recommended",
5
+ "plugin:react-hooks/recommended",
6
+ "@mintlify/eslint-config-typescript"
7
+ ],
8
+ "rules": {
9
+ "react/prop-types": "off"
10
+ }
11
+ }
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ yarn lint-staged
package/README.md CHANGED
@@ -48,7 +48,46 @@ This repo contains the components Mintlify uses in our open-source documentation
48
48
 
49
49
  ## Installation
50
50
 
51
- `npm install @mintlify/components`
51
+ ## Add Dependencies
52
+
53
+ Install this package and peerDependencies of this package,
54
+ using [install-peerdeps](https://github.com/nathanhleung/install-peerdeps).
55
+
56
+ ```sh
57
+ npx install-peerdeps @mintlify/components
58
+ ```
59
+
60
+ ### React is already installed
61
+
62
+ You already have `react` installed or are using `preact` and just need `@headlessui/react` and `@mintlify/components`.
63
+
64
+ ```sh
65
+ # yarn
66
+ yarn add @headlessui/react @mintlify/components
67
+
68
+ # npm
69
+ npm i @headlessui/react @mintlify/components
70
+
71
+ # pnpm
72
+ pnpm add @headlessui/react @mintlify/components
73
+ ```
74
+
75
+ ### React and headlessui are already installed
76
+
77
+ You already have `react` and `@headlessui/react` installed and just need `@mintlify/components`.
78
+
79
+ ```sh
80
+ # yarn
81
+ yarn add @mintlify/components
82
+
83
+ # npm
84
+ npm i @mintlify/components
85
+
86
+ # pnpm
87
+ pnpm add @mintlify/components
88
+ ```
89
+
90
+ ## CSS import
52
91
 
53
92
  Add the following at the start of your `main.css` file:
54
93
 
@@ -66,11 +105,27 @@ The project is designed for use with static side rendering where we don't have a
66
105
 
67
106
  # Documentation
68
107
 
69
- The [repo wiki](https://github.com/mintlify/components/wiki) explains how to contribute to the repo.
108
+ Go to [mintlify.com/docs/components](https://mintlify.com/docs/components) to see how to use the components in Mintlify's documentation platform.
70
109
 
71
110
  [Storybook](https://main--63134bd5ae01f2a7717a0e47.chromatic.com/) has interactive demos.
72
111
 
73
- Go to [mintlify.com/docs/components](https://mintlify.com/docs/components) for how to use the components in Mintlify's documentation platform.
112
+ ## Contributing
113
+
114
+ Read the [Contributing guide](https://mintlify.com/docs/contributing) to learn about our development process, the standards and tools used, and how to propose fixes, bugs or open issues.
115
+
116
+ The [repo wiki](https://github.com/mintlify/components/wiki) explains how to contribute to this repo.
117
+
118
+ ### Code Quality
119
+
120
+ Check out the [Contribution Tools](https://mintlify.com/docs/contributing#contribution-tools) section in our [Contributing guide](https://mintlify.com/docs/contributing).
121
+
122
+ #### Formatting
123
+
124
+ This project uses [prettier](https://prettier.io/) for code formatting. You can auto-format across the codebase by running `yarn format`.
125
+
126
+ #### Linting
127
+
128
+ This project uses [eslint](https://eslint.org/) for code linting. You can check linter warnings and errors by running `yarn lint`.
74
129
 
75
130
  # Long Term Vision
76
131
 
package/dist/Card.d.ts CHANGED
@@ -5,7 +5,7 @@ export interface CardPropsBase<T> {
5
5
  */
6
6
  title?: string;
7
7
  /**
8
- * Icon to the top-left of the title.
8
+ * Icon to the top-left of the title. Can be a ReactNode or a string equal to an image source.
9
9
  */
10
10
  icon?: ReactNode;
11
11
  /**
@@ -1,4 +1,4 @@
1
- import { ComponentPropsWithoutRef } from 'react';
1
+ import React, { ComponentPropsWithoutRef } from 'react';
2
2
  import { CopyToClipboardResult } from '../utils/copyToClipboard';
3
3
  export interface CodeBlockPropsBase {
4
4
  filename?: string;
@@ -16,4 +16,4 @@ export interface CodeBlockPropsBase {
16
16
  onCopied?: (result: CopyToClipboardResult, textToCopy?: string) => void;
17
17
  }
18
18
  export type CodeBlockProps = CodeBlockPropsBase & Omit<ComponentPropsWithoutRef<'div'>, keyof CodeBlockPropsBase>;
19
- export declare function CodeBlock({ filename, filenameColor, tooltipColor, onCopied, children, className, ...props }: CodeBlockProps): JSX.Element;
19
+ export declare const CodeBlock: React.ForwardRefExoticComponent<CodeBlockPropsBase & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof CodeBlockPropsBase> & React.RefAttributes<HTMLDivElement>>;
@@ -1,4 +1,4 @@
1
- import React, { ComponentPropsWithoutRef } from 'react';
1
+ import React, { ComponentPropsWithoutRef, FormEventHandler, ReactElement } from 'react';
2
2
  import { CopyToClipboardResult } from '../utils/copyToClipboard';
3
3
  import { CodeBlockProps } from './CodeBlock';
4
4
  export type CodeGroupPropsBase = {
@@ -15,7 +15,8 @@ export type CodeGroupPropsBase = {
15
15
  */
16
16
  onCopied?: (result: CopyToClipboardResult, textToCopy?: string) => void;
17
17
  isSmallText?: boolean;
18
- children?: React.ReactElement<CodeBlockProps>[] | React.ReactElement<CodeBlockProps>;
18
+ children?: ReactElement<CodeBlockProps>[] | ReactElement<CodeBlockProps>;
19
+ onChange?: FormEventHandler<HTMLDivElement> & ((index: number) => void);
19
20
  };
20
21
  export type CodeGroupProps = CodeGroupPropsBase & Omit<ComponentPropsWithoutRef<'div'>, keyof CodeGroupPropsBase>;
21
22
  /**
@@ -25,4 +26,4 @@ export type CodeGroupProps = CodeGroupPropsBase & Omit<ComponentPropsWithoutRef<
25
26
  *
26
27
  * @param {CodeBlock[]} - children
27
28
  */
28
- export declare function CodeGroup({ children, selectedColor, tooltipColor, onCopied, isSmallText, }: CodeGroupProps): JSX.Element | null;
29
+ export declare const CodeGroup: React.ForwardRefExoticComponent<CodeGroupPropsBase & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof CodeGroupPropsBase> & React.RefAttributes<HTMLDivElement>>;