Skip to content

Commit 96f158e

Browse files
authored
fix: v2 api ready, just need to clean up and write docs
1 parent 5eb1083 commit 96f158e

27 files changed

+818
-558
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
# Work in progress!
44

55
Hold off using this until `v2` is out, or you're gonna have a _bad time_!
6+
7+
# Credits
8+
9+
- Play icon used on frame overlays: https://fontawesome.com/icons/play-circle?style=regular
10+
- Phone frame used in logo: https://www.figma.com/community/file/896042888090872154/Mono-Devices-1.0
11+
- iPhone frame used to wrap examples: https://www.figma.com/community/file/858143367356468985/(Variants)-iOS-%26-iPadOS-14-UI-Kit-for-Figma

TODO.md

Lines changed: 0 additions & 82 deletions
This file was deleted.

defaults.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"customProperties": {
3+
"--rsbs-antigap-scale-y": "0",
4+
"--rsbs-backdrop-bg": "rgba(0, 0, 0, 0.6)",
5+
"--rsbs-backdrop-opacity": "1",
6+
"--rsbs-bg": "#fff",
7+
"--rsbs-content-opacity": "1",
8+
"--rsbs-handle-bg": "hsla(0, 0%, 0%, 0.14)",
9+
"--rsbs-max-w": "auto",
10+
"--rsbs-ml": "env(safe-area-inset-left)",
11+
"--rsbs-mr": "env(safe-area-inset-right)",
12+
"--rsbs-overlay-rounded": "16px",
13+
"--rsbs-overlay-translate-y": "0px",
14+
"--rsbs-overlay-h": "0px"
15+
}
16+
}

docs/fixtures/Button.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
1-
import cx from 'classnames'
1+
import cx from 'classnames/dedupe'
22
import { forwardRef } from 'react'
33
import styles from './Button.module.css'
44

55
type Props = {
6-
textSize?: string
7-
padding?: string
6+
className?: Parameters<typeof cx>[0]
87
children: React.ReactNode
9-
} & Omit<React.PropsWithoutRef<JSX.IntrinsicElements['button']>, 'children'>
8+
} & Omit<
9+
React.PropsWithoutRef<JSX.IntrinsicElements['button']>,
10+
'children' | 'className'
11+
>
1012

1113
const Button = forwardRef<HTMLButtonElement, Props>(
12-
(
13-
{ className, textSize = 'text-xl', padding = 'px-7 py-3', ...props },
14-
ref
15-
) => (
14+
({ className, ...props }, ref) => (
1615
<button
1716
className={cx(
1817
styles.rounded,
19-
textSize,
20-
padding,
21-
'rounded-2xl border-solid border-gray-300 border-2',
18+
'text-xl px-7 py-3 rounded-2xl border-solid border-gray-300 border-2',
2219
'transition-colors duration-150 focus-visible:duration-0',
2320
'bg-gray-100 text-gray-900 hover:bg-gray-300 focus-visible:bg-gray-300',
2421
'focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-white focus-visible:ring-gray-300',

docs/fixtures/Container.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
import cx from 'classnames'
1+
import cx from 'classnames/dedupe'
22
import { useEffect } from 'react'
33
import { useDetectEnv } from './hooks'
44

5-
export default function Container({ children }: { children: React.ReactNode }) {
5+
export default function Container({
6+
children,
7+
className,
8+
}: {
9+
children: React.ReactNode
10+
className?: Parameters<typeof cx>[0]
11+
}) {
612
const env = useDetectEnv()
713
useEffect(() => {
814
const className = cx({
@@ -16,7 +22,12 @@ export default function Container({ children }: { children: React.ReactNode }) {
1622
}, [env])
1723

1824
return (
19-
<main className="grid place-content-evenly min-h-screen bg-white">
25+
<main
26+
className={cx(
27+
'grid place-content-evenly min-h-screen bg-white',
28+
className
29+
)}
30+
>
2031
{children}
2132
</main>
2233
)

docs/style.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@
1515
--rsbs-backdrop-bg: rgba(15, 23, 42, 0.7);
1616
}
1717
}
18-
@layer utilities {
18+
@layer components {
1919
.is-window {
2020
--rsbs-max-w: 640px;
2121
--rsbs-ml: auto;
2222
--rsbs-mr: auto;
23+
@screen sm {
24+
& [data-rsbs-overlay] {
25+
--rsbs-overlay-rounded: 16px;
26+
}
27+
}
2328
}
2429
.is-iframe {
2530
--rsbs-ml: 0px;

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"build": "next build",
1818
"prebuild:dist": "rimraf dist/**",
1919
"build:dist": "npm run build:postcss && npm run build:microbundle",
20-
"build:microbundle": "microbundle --tsconfig tsconfig.microbundle.json -f cjs,es",
20+
"build:microbundle": "NODE_ENV=production microbundle --define process.env.NODE_ENV=production --tsconfig tsconfig.microbundle.json -f cjs,es",
2121
"build:postcss": "postcss -d dist --no-map src/style.css",
2222
"dev": "next",
2323
"lint": "eslint . --ext ts,tsx,js,jsx --max-warnings 0 && tsc",
@@ -47,6 +47,7 @@
4747
"@semantic-release/github": "^7.2.0",
4848
"@semantic-release/npm": "^7.0.8",
4949
"@semantic-release/release-notes-generator": "^9.0.1",
50+
"@types/classnames": "^2.2.11",
5051
"@types/node": "^14.14.10",
5152
"@types/react": "^17.0.0",
5253
"@typescript-eslint/eslint-plugin": "^4.9.0",

0 commit comments

Comments
 (0)