Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish the example app #10

Merged
merged 10 commits into from Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added .github/banner.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/porting-embed-demo.mp4
Binary file not shown.
10 changes: 0 additions & 10 deletions CONTRIBUTING.md
Expand Up @@ -40,16 +40,6 @@ npm run storybook

The [storybook](/storybook/) is used to develop the UI of an embed without having to initialize it. Changes to the library's JavaScript code will be reflected in Storybook without a rebuild.

## Publishing to npm

We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.

To publish new versions, run the following:

```sh
npm run release
```

## Linting

Make sure your code passes TypeScript and ESLint. Run the following to verify:
Expand Down
6 changes: 4 additions & 2 deletions README.md
@@ -1,14 +1,16 @@
# Gigs Embeds for JavaScript (Web)

<img width="600" height="390" src=".github/banner.png" alt="Gigs Embeds">

Embeddable prebuilt and highly customizable UI components to use in your own JavaScript apps for web.

> [!NOTE]
> This library is currently under development.
> This is currently a v0.x release. Anything may change at any time.

## Installation

```sh
npm install @gigs/gigs-embeds-js
npm install @gigscom/embeds-js
```

## Getting started
Expand Down
16 changes: 13 additions & 3 deletions docs/porting-embed.md
Expand Up @@ -14,6 +14,10 @@ Each step will only be shown if the porting requires these fields, and if the us
> [!IMPORTANT]
> The Porting Embed currently only supports portings in the status of `informationRequired`.

## Demo

https://github.com/gigs/gigs-embeds-js/assets/4227520/0f51d5e1-ff03-4b85-b661-8f4851b63d49

## Minimal example

The embed mounts into an element on your site. Add a `<div id="portingEmbed">` to your site wherever the embed should be mounted to.
Expand All @@ -29,9 +33,9 @@ You have to specify your Gigs Project ID when initializing the embed.

```js
// Optional. Adds styling to the embed.
import '@gigs/gigs-embeds-js/style.css'
import '@gigscom/embeds-js/style.css'

import { PortingEmbed } from '@gigs/gigs-embeds-js'
import { PortingEmbed } from '@gigscom/embeds-js'

// Fetch a new ConnectSession from an internal API endpoint, or any other way
// to obtain a new ConnectSession.
Expand All @@ -48,7 +52,13 @@ embed.on('completed', ({ porting }) => {
})
```

## Example app

See [`src/PortingEmbedExample.tsx`](/src/PortingEmbedExample.tsx) for a full example implementation.

- [Demo](#demo)
- [Minimal example](#minimal-example)
- [Example app](#example-app)
- [Usage](#usage)
- [Show a loading spinner while the embed is initializing](#show-a-loading-spinner-while-the-embed-is-initializing)
- [Show UI depending on the current step](#show-ui-depending-on-the-current-step)
Expand Down Expand Up @@ -118,7 +128,7 @@ See also:
The embed ships with default styles which you can import in your app.

```js
import '@gigs/gigs-embeds-js/style.css'
import '@gigscom/embeds-js/style.css'
```

### CSS customization
Expand Down
5 changes: 2 additions & 3 deletions index.html
Expand Up @@ -4,11 +4,10 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>Gigs Embeds Playground</title>
</head>
<body>
<body class="bg-gray-50">
<div id="root"></div>
<div id="welcomeEmbed"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
2 changes: 2 additions & 0 deletions lib/styles/styles.css
@@ -1,5 +1,7 @@
@import './preflight.css';

@config "../tailwind.config.js";

@tailwind base;
@tailwind components;
@tailwind utilities;
Expand Down
13 changes: 13 additions & 0 deletions lib/tailwind.config.js
@@ -0,0 +1,13 @@
import forms from '@tailwindcss/forms'

/** @type {import('tailwindcss').Config} */
export default {
content: [],
theme: {
extend: {},
},
corePlugins: {
preflight: false,
},
plugins: [forms({ strategy: 'class' })],
}