@nkootstra/block-kit 0.0.1 → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/dist/index-BV_5_J_Q.d.ts +909 -0
- package/dist/index-gBduJdQh.d.ts +127 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +10870 -0
- package/dist/index.js.map +1 -0
- package/dist/mrkdwn.d.ts +3 -0
- package/dist/mrkdwn.js +3 -0
- package/dist/parser-GbXBz4_f.js +441 -0
- package/dist/parser-GbXBz4_f.js.map +1 -0
- package/dist/server.d.ts +60 -0
- package/dist/server.js +83 -0
- package/dist/server.js.map +1 -0
- package/dist/styles.css +4780 -0
- package/dist/transport.d.ts +50 -0
- package/dist/transport.js +84 -0
- package/dist/transport.js.map +1 -0
- package/dist/web-api.d.ts +45 -0
- package/dist/web-api.js +121 -0
- package/dist/web-api.js.map +1 -0
- package/package.json +65 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Niels Kootstra
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Block Kit for React
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@nkootstra/block-kit` renders Slack [Block Kit](https://docs.slack.dev/block-kit/) JSON in React, pixel-for-pixel the way Slack does. Pass it the `blocks` your app sends to `chat.postMessage` or `views.open` and it draws the message, modal or Home tab, with working buttons, menus, date pickers and inputs.
|
|
4
|
+
|
|
5
|
+
Documentation: **<https://block-kit.kootstra.io>**
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
The package needs React 19 or later.
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
bun add @nkootstra/block-kit @fontsource/lato @fontsource/roboto-mono
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Import the stylesheet and fonts once, near the root of your app, then render a message:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import "@nkootstra/block-kit/styles.css";
|
|
19
|
+
import "@fontsource/lato/400.css";
|
|
20
|
+
import "@fontsource/lato/700.css";
|
|
21
|
+
import { BlockKitProvider, Message } from "@nkootstra/block-kit";
|
|
22
|
+
|
|
23
|
+
export function App() {
|
|
24
|
+
return (
|
|
25
|
+
<BlockKitProvider>
|
|
26
|
+
<Message
|
|
27
|
+
blocks={[
|
|
28
|
+
{ type: "section", text: { type: "mrkdwn", text: "*Hello* from Block Kit :wave:" } },
|
|
29
|
+
]}
|
|
30
|
+
/>
|
|
31
|
+
</BlockKitProvider>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The [installation guide](https://block-kit.kootstra.io/installation) lists the remaining font weights and the entry points, and the [quickstart](https://block-kit.kootstra.io/quickstart) wires up an interactive approval message.
|
|
37
|
+
|
|
38
|
+
## Entry points
|
|
39
|
+
|
|
40
|
+
| Import | What it contains |
|
|
41
|
+
| --------------------------------- | ----------------------------------------------------------------- |
|
|
42
|
+
| `@nkootstra/block-kit` | Components, the provider, hooks and payload builders |
|
|
43
|
+
| `@nkootstra/block-kit/styles.css` | The stylesheet |
|
|
44
|
+
| `@nkootstra/block-kit/mrkdwn` | The mrkdwn parser, without React |
|
|
45
|
+
| `@nkootstra/block-kit/transport` | Sends interactions to your app's request URL from the browser |
|
|
46
|
+
| `@nkootstra/block-kit/server` | Signs and relays interactions to your app from your server |
|
|
47
|
+
| `@nkootstra/block-kit/web-api` | User, channel and usergroup resolvers backed by the Slack Web API |
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
[MIT](./LICENSE)
|