@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 +11 -0
- package/.husky/pre-commit +4 -0
- package/README.md +58 -3
- package/dist/Card.d.ts +1 -1
- package/dist/Code/CodeBlock.d.ts +2 -2
- package/dist/Code/CodeGroup.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/main.css +1 -1
- package/dist/utils/delay.d.ts +1 -0
- package/package.json +30 -4
- package/build-storybook.log +0 -368
- package/dist/CodeBlock/CodeBlock.d.ts +0 -9
- package/dist/CodeBlock/CodeGroup.d.ts +0 -11
- package/dist/CodeBlock/CodeTabBar.d.ts +0 -6
- package/dist/CodeBlock/CopyToClipboard.d.ts +0 -2
- package/dist/CodeBlock/CopyToClipboardButton.d.ts +0 -5
- package/dist/CodeBlock/index.d.ts +0 -3
- package/dist/CodeGroup.d.ts +0 -12
- package/dist/LightDarkToggle.d.ts +0 -14
- package/dist/UserDefinedIcon.d.ts +0 -7
package/.eslintrc.json
ADDED
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
package/dist/Code/CodeBlock.d.ts
CHANGED
|
@@ -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
|
|
19
|
+
export declare const CodeBlock: React.ForwardRefExoticComponent<CodeBlockPropsBase & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof CodeBlockPropsBase> & React.RefAttributes<HTMLDivElement>>;
|
package/dist/Code/CodeGroup.d.ts
CHANGED
|
@@ -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?:
|
|
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
|
|
29
|
+
export declare const CodeGroup: React.ForwardRefExoticComponent<CodeGroupPropsBase & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof CodeGroupPropsBase> & React.RefAttributes<HTMLDivElement>>;
|