Skip to content

Commit

Permalink
fix: v2 api ready, just need to clean up and write docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan authored Dec 3, 2020
1 parent 5eb1083 commit 96f158e
Show file tree
Hide file tree
Showing 27 changed files with 818 additions and 558 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
# Work in progress!

Hold off using this until `v2` is out, or you're gonna have a _bad time_!

# Credits

- Play icon used on frame overlays: https://fontawesome.com/icons/play-circle?style=regular
- Phone frame used in logo: https://www.figma.com/community/file/896042888090872154/Mono-Devices-1.0
- iPhone frame used to wrap examples: https://www.figma.com/community/file/858143367356468985/(Variants)-iOS-%26-iPadOS-14-UI-Kit-for-Figma
82 changes: 0 additions & 82 deletions TODO.md

This file was deleted.

16 changes: 16 additions & 0 deletions defaults.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"customProperties": {
"--rsbs-antigap-scale-y": "0",
"--rsbs-backdrop-bg": "rgba(0, 0, 0, 0.6)",
"--rsbs-backdrop-opacity": "1",
"--rsbs-bg": "#fff",
"--rsbs-content-opacity": "1",
"--rsbs-handle-bg": "hsla(0, 0%, 0%, 0.14)",
"--rsbs-max-w": "auto",
"--rsbs-ml": "env(safe-area-inset-left)",
"--rsbs-mr": "env(safe-area-inset-right)",
"--rsbs-overlay-rounded": "16px",
"--rsbs-overlay-translate-y": "0px",
"--rsbs-overlay-h": "0px"
}
}
19 changes: 8 additions & 11 deletions docs/fixtures/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
import cx from 'classnames'
import cx from 'classnames/dedupe'
import { forwardRef } from 'react'
import styles from './Button.module.css'

type Props = {
textSize?: string
padding?: string
className?: Parameters<typeof cx>[0]
children: React.ReactNode
} & Omit<React.PropsWithoutRef<JSX.IntrinsicElements['button']>, 'children'>
} & Omit<
React.PropsWithoutRef<JSX.IntrinsicElements['button']>,
'children' | 'className'
>

const Button = forwardRef<HTMLButtonElement, Props>(
(
{ className, textSize = 'text-xl', padding = 'px-7 py-3', ...props },
ref
) => (
({ className, ...props }, ref) => (
<button
className={cx(
styles.rounded,
textSize,
padding,
'rounded-2xl border-solid border-gray-300 border-2',
'text-xl px-7 py-3 rounded-2xl border-solid border-gray-300 border-2',
'transition-colors duration-150 focus-visible:duration-0',
'bg-gray-100 text-gray-900 hover:bg-gray-300 focus-visible:bg-gray-300',
'focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-white focus-visible:ring-gray-300',
Expand Down
17 changes: 14 additions & 3 deletions docs/fixtures/Container.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import cx from 'classnames'
import cx from 'classnames/dedupe'
import { useEffect } from 'react'
import { useDetectEnv } from './hooks'

export default function Container({ children }: { children: React.ReactNode }) {
export default function Container({
children,
className,
}: {
children: React.ReactNode
className?: Parameters<typeof cx>[0]
}) {
const env = useDetectEnv()
useEffect(() => {
const className = cx({
Expand All @@ -16,7 +22,12 @@ export default function Container({ children }: { children: React.ReactNode }) {
}, [env])

return (
<main className="grid place-content-evenly min-h-screen bg-white">
<main
className={cx(
'grid place-content-evenly min-h-screen bg-white',
className
)}
>
{children}
</main>
)
Expand Down
7 changes: 6 additions & 1 deletion docs/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@
--rsbs-backdrop-bg: rgba(15, 23, 42, 0.7);
}
}
@layer utilities {
@layer components {
.is-window {
--rsbs-max-w: 640px;
--rsbs-ml: auto;
--rsbs-mr: auto;
@screen sm {
& [data-rsbs-overlay] {
--rsbs-overlay-rounded: 16px;
}
}
}
.is-iframe {
--rsbs-ml: 0px;
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build": "next build",
"prebuild:dist": "rimraf dist/**",
"build:dist": "npm run build:postcss && npm run build:microbundle",
"build:microbundle": "microbundle --tsconfig tsconfig.microbundle.json -f cjs,es",
"build:microbundle": "NODE_ENV=production microbundle --define process.env.NODE_ENV=production --tsconfig tsconfig.microbundle.json -f cjs,es",
"build:postcss": "postcss -d dist --no-map src/style.css",
"dev": "next",
"lint": "eslint . --ext ts,tsx,js,jsx --max-warnings 0 && tsc",
Expand Down Expand Up @@ -47,6 +47,7 @@
"@semantic-release/github": "^7.2.0",
"@semantic-release/npm": "^7.0.8",
"@semantic-release/release-notes-generator": "^9.0.1",
"@types/classnames": "^2.2.11",
"@types/node": "^14.14.10",
"@types/react": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^4.9.0",
Expand Down
Loading

0 comments on commit 96f158e

Please sign in to comment.