Skip to content

Commit

Permalink
lfg
Browse files Browse the repository at this point in the history
  • Loading branch information
irsyadadl committed Oct 25, 2024
1 parent 6706f3c commit 62ed610
Show file tree
Hide file tree
Showing 11 changed files with 506 additions and 271 deletions.
14 changes: 7 additions & 7 deletions components/docs/generated/previews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,21 +326,21 @@ export const previews: Record<string, any> = {
"buttons/button/button-link-demo": {
component: React.lazy(() => import("@/components/docs/buttons/button/button-link-demo")),
},
"overlays/drawer/drawer-direction-demo": {
component: React.lazy(() => import("@/components/docs/overlays/drawer/drawer-direction-demo")),
},
"overlays/drawer/drawer-hide-notch-demo": {
component: React.lazy(() => import("@/components/docs/overlays/drawer/drawer-hide-notch-demo")),
"overlays/drawer/drawer-nested-demo": {
component: React.lazy(() => import("@/components/docs/overlays/drawer/drawer-nested-demo")),
},
"overlays/drawer/drawer-basic-demo": {
component: React.lazy(() => import("@/components/docs/overlays/drawer/drawer-basic-demo")),
},
"overlays/drawer/drawer-is-not-centered-demo": {
component: React.lazy(() => import("@/components/docs/overlays/drawer/drawer-is-not-centered-demo")),
"overlays/drawer/drawer-sticky-demo": {
component: React.lazy(() => import("@/components/docs/overlays/drawer/drawer-sticky-demo")),
},
"overlays/drawer/drawer-controlled-demo": {
component: React.lazy(() => import("@/components/docs/overlays/drawer/drawer-controlled-demo")),
},
"overlays/drawer/drawer-without-notch-demo": {
component: React.lazy(() => import("@/components/docs/overlays/drawer/drawer-without-notch-demo")),
},
"overlays/tooltip/tooltip-delay-demo": {
component: React.lazy(() => import("@/components/docs/overlays/tooltip/tooltip-delay-demo")),
},
Expand Down
11 changes: 6 additions & 5 deletions components/docs/overlays/drawer/drawer-basic-demo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"use client"

import { Button, buttonStyles, Drawer, TextField } from "ui"
import React from "react"

import { buttonStyles, Drawer, TextField } from "ui"

export default function DrawerBasicDemo() {
return (
Expand All @@ -14,12 +16,11 @@ export default function DrawerBasicDemo() {
</Drawer.Description>
</Drawer.Header>
<Drawer.Body className="space-y-4">
<TextField autoFocus label="Email" placeholder="john.doe@example.com" />
<TextField label="Password" type="password" placeholder="••••••••••••" />
<TextField type="email" placeholder="john.doe@example.com" />
<TextField label="Password" type="password" placeholder="••••••••••••" isRevealable />
</Drawer.Body>
<Drawer.Footer>
<Drawer.Close>Cancel</Drawer.Close>
<Button>Login</Button>
<Drawer.Close className="w-full">Login</Drawer.Close>
</Drawer.Footer>
</Drawer.Content>
</Drawer>
Expand Down
21 changes: 16 additions & 5 deletions components/docs/overlays/drawer/drawer-controlled-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,35 @@

import React from "react"

import { Button, Drawer } from "ui"
import { Button, Drawer, TextField } from "ui"

export default function DrawerControlledDemo() {
const [isOpen, setIsOpen] = React.useState(false)
return (
<>
<Button onPress={() => setIsOpen(true)}>Open Drawer</Button>
<Button onPress={() => setIsOpen(!isOpen)} appearance="outline">
Login
</Button>
<Drawer isOpen={isOpen} onOpenChange={setIsOpen}>
<Drawer.Content>
<Drawer.Header>
<Drawer.Title>Drawer</Drawer.Title>
<Drawer.Title>Login</Drawer.Title>
<Drawer.Description>
A slide-in overlay for extra content or options.
Please enter your credentials to access your account.
</Drawer.Description>
</Drawer.Header>
<Drawer.Body className="flex flex-col gap-4">
<TextField label="Email" isRequired type="email" placeholder="Enter your email" />
<TextField
label="Password"
isRequired
type="password"
placeholder="Enter your password"
/>
</Drawer.Body>
<Drawer.Footer>
<Drawer.Close>Close</Drawer.Close>
<Button>Done</Button>
<Button onPress={() => setIsOpen(false)}>Login</Button>
</Drawer.Footer>
</Drawer.Content>
</Drawer>
Expand Down
42 changes: 0 additions & 42 deletions components/docs/overlays/drawer/drawer-direction-demo.tsx

This file was deleted.

23 changes: 0 additions & 23 deletions components/docs/overlays/drawer/drawer-hide-notch-demo.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions components/docs/overlays/drawer/drawer-is-not-centered-demo.tsx

This file was deleted.

78 changes: 78 additions & 0 deletions components/docs/overlays/drawer/drawer-nested-demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
"use client"

import React from "react"

import { toast } from "sonner"
import { Button, Drawer, Form, Textarea } from "ui"

export default function DrawerNestedDemo() {
const [isRegistrationDrawerOpen, setIsRegistrationDrawerOpen] = React.useState(false)
const [isProfileSetupDrawerOpen, setIsProfileSetupDrawerOpen] = React.useState(false)
const [isTyping, setIsTyping] = React.useState(false)

return (
<>
<Button onPress={() => setIsRegistrationDrawerOpen(true)}>Register</Button>

<Drawer
isOpen={isRegistrationDrawerOpen}
onOpenChange={() => setIsRegistrationDrawerOpen(false)}
>
<Drawer.Content>
<Drawer.Header>
<Drawer.Title>Confirm Registration</Drawer.Title>
<Drawer.Description>Please confirm your registration details.</Drawer.Description>
</Drawer.Header>
<Drawer.Footer>
<Drawer.Close>Cancel</Drawer.Close>
<Button
onPress={() => {
setIsProfileSetupDrawerOpen(true)
}}
>
Confirm
</Button>
</Drawer.Footer>
</Drawer.Content>
</Drawer>

<Drawer
isOpen={isProfileSetupDrawerOpen}
onOpenChange={(isOpen) => {
if (!isOpen && isTyping) toast("Profile setup incomplete", { position: "top-center" })
setIsProfileSetupDrawerOpen(isOpen)
}}
>
<Drawer.Content>
<Drawer.Header>
<Drawer.Title>Set Up Your Profile</Drawer.Title>
<Drawer.Description>
We need a bit more information before you can get started.
</Drawer.Description>
</Drawer.Header>
<Form
onSubmit={(e) => {
e.preventDefault()
toast.success("Profile setup complete", { position: "top-center" })
setIsProfileSetupDrawerOpen(false)
setIsRegistrationDrawerOpen(false)
}}
>
<Drawer.Body className="space-y-4">
<Textarea
isRequired
label="Bio"
placeholder="Tell us something about yourself"
onInput={() => setIsTyping(true)}
/>
</Drawer.Body>
<Drawer.Footer>
<Drawer.Close>Skip for now</Drawer.Close>
<Button type="submit">Complete Setup</Button>
</Drawer.Footer>
</Form>
</Drawer.Content>
</Drawer>
</>
)
}
114 changes: 114 additions & 0 deletions components/docs/overlays/drawer/drawer-sticky-demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
"use client"

import React from "react"

import { buttonStyles, Drawer } from "ui"

export default function DrawerStickyDemo() {
return (
<Drawer>
<Drawer.Trigger className={buttonStyles({ shape: "circle", appearance: "outline" })}>
Open
</Drawer.Trigger>
<Drawer.Content>
<Drawer.Header>The Beatles</Drawer.Header>
<Drawer.Body>
<div className="prose dark:prose-invert prose-zinc">
<p>
Welcome to our Terms of Use. By accessing or using our services, you agree to be bound
by these terms. If you do not agree to these terms, please refrain from using our
services.
</p>
<h3> User Obligations</h3>
<h4>Account Responsibility</h4>
<p>
When you create an account with us, you are responsible for maintaining the
confidentiality of your account and password.
</p>{" "}
<p>
You agree to accept responsibility for all activities that occur under your account.
You must notify us immediately of any breach of security or unauthorized use of your
account.
</p>
<h4>Compliance with Laws</h4>
<p>
You agree to comply with all applicable laws, regulations, and policies in connection
with your use of our services. This includes adhering to intellectual property laws
and refraining from any unlawful behavior while using our platform.
</p>
<h3> Prohibited Activities</h3>
<p>
You are not permitted to access or attempt to access any of our services by any means
other than through the interface provided by us. Any form of hacking, bypassing, or
circumventing our security protocols is strictly prohibited.
</p>
<h4>Misuse of Content</h4>
<p>
You agree not to misuse, reproduce, distribute, or modify any content from our
services unless explicitly authorized by us. This includes engaging in activities such
as scraping, data mining, or using automated systems to extract data.
</p>
<h4>Harassment and Abuse</h4>
<p>
You are prohibited from using our services to harass, abuse, or harm other users. This
includes sending unsolicited messages, stalking, or engaging in any form of
cyberbullying. We reserve the right to terminate accounts found in violation of this
policy.
</p>
<h4>Ownership of Content</h4>
<p>
All content, trademarks, service marks, logos, and other intellectual property
displayed on our services are the property of their respective owners. You may not
use, copy, or distribute any content without prior written permission from the owner.
</p>
<h4>User-Generated Content</h4>
<p>
By submitting content to our services, you grant us a worldwide, royalty-free,
non-exclusive license to use, distribute, modify, and display that content for the
purpose of providing our services.
</p>
<p>
You retain all ownership rights to your content but agree to allow us to use it in
accordance with these terms.
</p>
<h3> Termination</h3>
<h4>Right to Terminate</h4>
We reserve the right to terminate or suspend your access to our services at any time,
without notice, for any reason, including but not limited to a breach of these terms.
Upon termination, your right to use our services will immediately cease.
<h4>Effect of Termination</h4>
Upon termination of your account, all provisions of these terms that, by their nature,
should survive termination shall remain in effect. This includes, but is not limited to,
ownership provisions, warranty disclaimers, and limitations of liability.
<h3> Limitation of Liability</h3>
<h4>Service Availability</h4>
We do not guarantee that our services will be available at all times or without
interruption. We are not liable for any downtime or technical issues that may prevent
access to our services.
<h4>No Warranties</h4>
Our services are provided "as is" and "as available" without any warranties of any kind,
whether express or implied. We do not warrant that our services will meet your
requirements or that they will be error-free or secure.
<h4>Limitation of Damages</h4>
In no event shall we be liable for any indirect, incidental, special, consequential, or
punitive damages arising out of or related to your use of our services. This includes,
but is not limited to, damages for loss of profits, data, or other intangibles.
<h3> Changes to These Terms</h3>
We reserve the right to modify or replace these terms at any time. If a revision is
material, we will provide at least 30 days' notice prior to any new terms taking effect.
What constitutes a material change will be determined at our sole discretion.
<h3> Governing Law</h3>
These terms shall be governed and construed in accordance with the laws of [Your
Jurisdiction], without regard to its conflict of law provisions. Any disputes arising
from or relating to these terms shall be resolved in the courts of [Your Jurisdiction].
<h3> Contact Information</h3>
If you have any questions about these terms, please contact us at xxx@example.com.
</div>
</Drawer.Body>
<Drawer.Footer>
<Drawer.Close shape="circle">Close</Drawer.Close>
</Drawer.Footer>
</Drawer.Content>
</Drawer>
)
}
Loading

0 comments on commit 62ed610

Please sign in to comment.