Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
!.storybook/**/*.js
!.storybook/**/*.d.ts

# Sass build output
*.css
*.css.map

# Vite
*.timestamp-*

Expand Down
10 changes: 10 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { StorybookConfig } from '@storybook/react-webpack5'
import CopyPlugin from 'copy-webpack-plugin'
import sass from 'sass'

import webpackTsconfigpaths from './webpack-tsconfigpaths.js'

Expand All @@ -11,6 +12,15 @@ const config: StorybookConfig = {
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'storybook-addon-designs',
{
name: '@storybook/addon-styling',
options: {
sass: {
implementation: sass,
includePaths: ['node_modules'],
},
},
},
],
framework: {
name: '@storybook/react-webpack5',
Expand Down
4 changes: 4 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
/>
2 changes: 2 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '../src/index.scss'

import { SeamProvider } from '@seamapi/react'
import type { Preview } from '@storybook/react'

Expand Down
3 changes: 3 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["stylelint-config-standard-scss"]
}
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ $ npm install @seamapi/react
```ts
import { SeamProvider, DeviceManager } from '@seamapi/react'

import '@seamapi/react/index.css'

export const App = () => {
return (
<SeamProvider publishableKey='your_publishable_key'>
Expand All @@ -50,6 +52,20 @@ export const App = () => {

[Seam Console]: https://console.seam.co/

### Fonts

The components are optimized for use with [Source Sans Pro], but will fallback to other system sans-serif fonts.
Load the font from Google Fonts by placing the following in the `<head>` tag:

```html
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
/>
```

[Source Sans Pro]: https://fonts.google.com/specimen/Source+Sans+Pro

## Development and Testing

### Quickstart
Expand Down
4 changes: 4 additions & 0 deletions examples/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Basic example - Seam React Components</title>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
/>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 2 additions & 0 deletions examples/basic/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@seamapi/react/index.css'

import { DeviceManager, SeamProvider } from '@seamapi/react'
import type { ReactElement } from 'react'

Expand Down
7 changes: 7 additions & 0 deletions examples/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ export default defineConfig(async ({ command }) => {
// @ts-expect-error https://github.com/vitejs/vite-plugin-react/issues/104
react(),
],
resolve: {
alias: {
'@seamapi/react/index.css': fileURLToPath(
new URL('../src/index.scss', import.meta.url)
),
},
},
build: {
rollupOptions: {
// UPSTREAM: https://github.com/vitejs/vite/issues/3429
Expand Down
Loading