Skip to content

Commit

Permalink
feat: update modals
Browse files Browse the repository at this point in the history
  • Loading branch information
Pagebakers committed Nov 9, 2024
1 parent 0e95b70 commit 77043a5
Show file tree
Hide file tree
Showing 56 changed files with 1,513 additions and 419 deletions.
4 changes: 2 additions & 2 deletions packages/saas-ui-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"publishConfig": {
"access": "public"
},
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"homepage": "https://saas-ui.dev/",
"repository": {
"type": "git",
"url": "https://github.com/saas-js/saas-ui",
"url": "git+https://github.com/saas-js/saas-ui.git",
"directory": "packages/saas-ui-auth"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/saas-ui-auth-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"publishConfig": {
"access": "public"
},
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"homepage": "https://saas-ui.dev/",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/saas-ui-auth0/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
"publishConfig": {
"access": "public"
},
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"homepage": "https://saas-ui.dev/",
"repository": {
"type": "git",
"url": "https://github.com/saas-js/saas-ui",
"url": "git+https://github.com/saas-js/saas-ui.git",
"directory": "packages/saas-ui-auth0"
},
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/saas-ui-clerk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"publishConfig": {
"access": "public"
},
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"homepage": "https://saas-ui.dev/",
"repository": {
"type": "git",
"url": "https://github.com/saas-js/saas-ui",
"url": "git+https://github.com/saas-js/saas-ui.git",
"directory": "packages/saas-ui-clerk"
},
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/saas-ui-command-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
"publishConfig": {
"access": "public"
},
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"homepage": "https://saas-ui.dev/",
"repository": {
"type": "git",
"url": "https://github.com/saas-js/saas-ui",
"url": "git+https://github.com/saas-js/saas-ui.git",
"directory": "packages/saas-ui-command-bar"
},
"keywords": [
Expand Down
18 changes: 4 additions & 14 deletions packages/saas-ui-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@saas-ui/core",
"version": "2.5.5",
"description": "Saas UI - The React component library for startups.",
"description": "Unstyled primitives for building React applications.",
"type": "module",
"exports": {
".": {
Expand Down Expand Up @@ -60,24 +60,22 @@
"publishConfig": {
"access": "public"
},
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"homepage": "https://saas-ui.dev/",
"repository": {
"type": "git",
"url": "https://github.com/saas-js/saas-ui",
"directory": "packages/saas-ui-react"
"url": "git+https://github.com/saas-js/saas-ui.git",
"directory": "packages/saas-ui-core"
},
"keywords": [
"react",
"ui",
"chakra-ui",
"design-system",
"react-components",
"uikit",
"accessible",
"components",
"emotion",
"library"
],
"storybook": {
Expand All @@ -86,24 +84,16 @@
},
"dependencies": {
"@ark-ui/react": "^4.2.0",
"@react-aria/interactions": "^3.22.4",
"@react-aria/utils": "^3.25.3",
"@saas-ui/theme": "workspace:*",
"@zag-js/dom-event": "^0.77.0",
"@zag-js/dom-utils": "^0.2.4"
},
"peerDependencies": {
"@chakra-ui/react": ">=3.0.0-next.13",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"react": ">=18",
"react-dom": ">=18"
},
"devDependencies": {
"@chakra-ui/react": "^3.0.2",
"@react-types/shared": "^3.25.0",
"jotai": "^2.10.1",
"react-icons": "^5.3.0",
"tsup": "^8.3.5"
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
import * as React from 'react'

import { Button, EmptyState } from '@chakra-ui/react'
import { Meta } from '@storybook/react'

import { system } from '../preset.ts'
import { SuiProvider } from '../provider/sui-provider.tsx'
import { ErrorBoundary } from './'
import { ErrorBoundary, ErrorProvider } from './'

export default {
title: 'Utilities/ErrorBoundary',
component: ErrorBoundary,
decorators: [
(Story) => {
return (
<SuiProvider
value={system}
onError={(err) => console.log('ERROR', err)}
>
<ErrorProvider onError={(err) => console.log('ERROR', err)}>
<Story />
</SuiProvider>
</ErrorProvider>
)
},
],
Expand All @@ -41,15 +35,10 @@ export const CustomFallback = () => {
return (
<ErrorBoundary
fallback={
<EmptyState.Root>
<EmptyState.Title>Whoops, this was not expected</EmptyState.Title>
<EmptyState.Description>
Something terribly went wrong, but it's not your fault.
</EmptyState.Description>
<EmptyState.Content>
<Button>Refresh</Button>
</EmptyState.Content>
</EmptyState.Root>
<div>
<h1>Whoops, this was unexpected</h1>
<p>Something terribly went wrong, but it's not your fault.</p>
</div>
}
>
<Err />
Expand Down
22 changes: 22 additions & 0 deletions packages/saas-ui-core/src/error-boundary/error-provider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react'

export interface ErrorProviderProps {
children: React.ReactNode
onError?: (error: Error, errorInfo: React.ErrorInfo) => void
}

export interface ErrorContextValue {
onError?: (error: Error, errorInfo: React.ErrorInfo) => void
}

const context = React.createContext<ErrorContextValue>({})

export const ErrorProvider = (props: ErrorProviderProps) => {
const { children, onError } = props

const value = React.useMemo(() => ({ onError }), [onError])

return <context.Provider value={value}>{children}</context.Provider>
}

export const useErrorContext = () => React.useContext(context)
2 changes: 2 additions & 0 deletions packages/saas-ui-core/src/error-boundary/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export { ErrorBoundary } from './error-boundary'
export type { ErrorBoundaryProps, ErrorBoundaryState } from './error-boundary'
export { ErrorProvider, useErrorContext } from './error-provider'
export type { ErrorProviderProps } from './error-provider'
4 changes: 2 additions & 2 deletions packages/saas-ui-data-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"publishConfig": {
"access": "public"
},
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"homepage": "https://saas-ui.dev/",
"repository": {
"type": "git",
"url": "https://github.com/saas-js/saas-ui",
"url": "git+https://github.com/saas-js/saas-ui.git",
"directory": "packages/saas-ui-data-table"
},
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/saas-ui-date-picker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"publishConfig": {
"access": "public"
},
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"homepage": "https://saas-ui.dev/",
"repository": {
"type": "git",
"url": "https://github.com/saas-js/saas-ui",
"url": "git+https://github.com/saas-js/saas-ui.git",
"directory": "packages/saas-ui-date-picker"
},
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/saas-ui-file-upload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"publishConfig": {
"access": "public"
},
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"homepage": "https://saas-ui.dev/",
"repository": {
"type": "git",
"url": "https://github.com/saas-js/saas-ui",
"url": "git+https://github.com/saas-js/saas-ui.git",
"directory": "packages/saas-ui-dropzone"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/saas-ui-forms/ajv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"main": "../dist/ajv/index.js",
"module": "../dist/ajv/index.mjs",
"types": "../dist/ajv/index.d.ts",
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"peerDependencies": {
"@chakra-ui/utils": "^2.0.14",
Expand Down
4 changes: 2 additions & 2 deletions packages/saas-ui-forms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@
"publishConfig": {
"access": "public"
},
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"homepage": "https://saas-ui.dev/",
"repository": {
"type": "git",
"url": "https://github.com/saas-js/saas-ui",
"url": "git+https://github.com/saas-js/saas-ui.git",
"directory": "packages/saas-ui-forms"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/saas-ui-forms/yup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"main": "../dist/yup/index.js",
"module": "../dist/yup/index.mjs",
"types": "../dist/yup/index.d.ts",
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"peerDependencies": {
"@hookform/resolvers": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/saas-ui-forms/zod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"main": "../dist/zod/index.js",
"module": "../dist/zod/index.mjs",
"types": "../dist/zod/index.d.ts",
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"peerDependencies": {
"@saas-ui/modals": "*",
Expand Down
4 changes: 2 additions & 2 deletions packages/saas-ui-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"publishConfig": {
"access": "public"
},
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"homepage": "https://saas-ui.dev/",
"repository": {
"type": "git",
"url": "https://github.com/saas-js/saas-ui",
"url": "git+https://github.com/saas-js/saas-ui.git",
"directory": "packages/saas-ui-system"
},
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/saas-ui-hotkeys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"publishConfig": {
"access": "public"
},
"author": "Eelco Wiersma <eelco@appulse.nl>",
"author": "Eelco Wiersma <eelco@saas-ui.dev>",
"license": "MIT",
"homepage": "https://saas-ui.dev/",
"repository": {
"type": "git",
"url": "https://github.com/saas-js/saas-ui",
"url": "git+https://github.com/saas-js/saas-ui.git",
"directory": "packages/hotkeys"
},
"keywords": [
Expand Down
Loading

0 comments on commit 77043a5

Please sign in to comment.