Skip to content

Commit

Permalink
chore(dev): merge recent developments (#11)
Browse files Browse the repository at this point in the history
build: package markdown path fixup, add homepage url.
docs: completed existed components documents.
perf: cornered shape naming & `sm` size params of badge component.
fix: loader bar-bounce component visibility.
fix: docs site header logo wrong height.

Signed-off-by: Ricco Xie <ricco@riccox.com>
  • Loading branch information
riccox committed Jan 23, 2023
1 parent d8e0518 commit a71a853
Show file tree
Hide file tree
Showing 29 changed files with 2,287 additions and 20 deletions.
20 changes: 9 additions & 11 deletions apps/experiments/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ <h2 class="text-xl">Shape</h2>
<div class="badge solid success">
badge
</div>
<div class="badge solid success rounded">
rounded
<div class="badge solid success cornered">
cornered
</div>
<div class="badge solid success square">
square
Expand Down Expand Up @@ -316,19 +316,19 @@ <h2 class="text-xl">Light</h2>
<h2 class="text-xl">Size</h2>
<div class="grid gap-4">
<div class="badge solid success xs">
xs
size-xs
</div>
<div class="badge solid success sm">
sm
size-sm
</div>
<div class="badge solid success md">
md
size-md
</div>
<div class="badge solid success lg">
lg
size-lg
</div>
<div class="badge solid success xl">
xl
size-xl
</div>
</div>
</div>
Expand Down Expand Up @@ -1115,9 +1115,9 @@ <h2 class="text-xl">Title</h2>
</div>
</div>
<div class="grid grid-cols-2 gap-4 p-4 has-border rounded-xl">
<h1 class="text-3xl col-span-full">Breadcrumb</h1>
<h1 class="text-3xl col-span-full">Breadcrumbs</h1>
<div class="">
<h2 class="text-xl">Type</h2>
<h2 class="text-xl">Color</h2>
<div class="grid gap-4">
<div class="breadcrumbs bw">
<ul>
Expand Down Expand Up @@ -1265,7 +1265,6 @@ <h2 class="text-xl">Your content</h2>
<label class="btn solid danger w-fit" onclick="toggleDrawer('top')">Open top</label>
<label class="drawer-overlay" onclick="toggleDrawer('top')"></label>
<div class="drawer top" id="drawer-top">
<label class="overlay" onclick="toggleDrawer('top')"></label>
<div class="content flex flex-col h-full">
<label class="btn sm circle ghost absolute right-2 top-2"
onclick="toggleDrawer('top')"></label>
Expand All @@ -1277,7 +1276,6 @@ <h2 class="text-xl">Your content</h2>
<label class="btn solid danger w-fit" onclick="toggleDrawer('bottom')">Open bottom</label>
<label class="drawer-overlay" onclick="toggleDrawer('bottom')"></label>
<div class="drawer bottom" id="drawer-bottom">
<label class="overlay" onclick="toggleDrawer('bottom')"></label>
<div class="content flex flex-col h-full">
<label class="btn sm circle ghost absolute right-2 top-2"
onclick="toggleDrawer('bottom')"></label>
Expand Down
2 changes: 1 addition & 1 deletion apps/website/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const Footer = () => {
<div className="grid grid-cols-4 gap-10 place-items-stretch">
<div className="col-span-2 flex flex-col gap-3">
<div className="flex items-center gap-5">
<LogoIcon className={"w-8 h-10"} />
<LogoIcon className={"w-8 h-fit"} />
<span className="whitespace-nowrap text-2xl font-semibold">
Sira UI
</span>
Expand Down
2 changes: 1 addition & 1 deletion apps/website/components/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {
export const Logo = ({ className = "" }: Props) => {
return (
<span className={`${className} flex items-center gap-3`}>
<LogoIcon className={`w-5`} />
<LogoIcon className={`w-5 h-fit`} />
<span className={"font-bold text-xl"}>Sira</span>
</span>
);
Expand Down
61 changes: 61 additions & 0 deletions apps/website/components/demo/drawer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import _ from "lodash";
import React, { useCallback, useState } from "react";

interface Props {
position: "top" | "bottom" | "left" | "right";
labelText?: string;
content?: string;

pauseScroll?: boolean;
overlay?: boolean;
overlayClickClose?: boolean;
}

export const DrawerDemo = ({
position = "left",
pauseScroll = false,
overlay = true,
overlayClickClose = true,
labelText = "Open Drawer",
content = "Your content",
}: Props) => {
const [drawerId] = useState(_.uniqueId("sira-demo-drawer-"));

const toggleDrawer = useCallback(() => {
let ele = document.getElementById(drawerId);
let show = ele!.classList.contains("show");
if (show) {
ele!.classList.remove("show");
} else {
ele!.classList.add("show");
}
}, [drawerId]);

return (
<div>
<label className="btn solid success w-fit" onClick={toggleDrawer}>
{labelText}
</label>
{overlay && (
<label
className="drawer-overlay"
onClick={overlayClickClose ? toggleDrawer : () => {}}
></label>
)}
<div
className={`drawer ${position} ${pauseScroll ? "pause-scroll" : ""}`}
id={drawerId}
>
<div className="content flex flex-col h-full">
<label
className="btn sm circle ghost absolute right-2 top-2"
onClick={toggleDrawer}
>
</label>
<h2 className="text-xl">{content}</h2>
</div>
</div>
</div>
);
};
45 changes: 45 additions & 0 deletions apps/website/components/demo/dropdown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React from "react";

interface Props {
position:
| "top"
| "bottom"
| "left"
| "right"
| "top-left"
| "top-right"
| "bottom-left"
| "bottom-right"
| "left-top"
| "right-top"
| "left-bottom"
| "right-bottom";
labelText?: string;
className?: string;
divider?: boolean;
}

export const DropdownDemo = ({
position = "bottom",
divider = false,
labelText = "Open Dropdown",
className = "",
}: Props) => {
return (
<div className={`dropdown success ${className}`}>
<label className="btn solid" tabIndex={0}>
{labelText}
</label>
<div className={`menu ${position}`}>
<a className="item text-sm">Profile</a>
{divider && <div className="divider" role="separator"></div>}
<a className="item text-sm" tabIndex={-1}>
Account settings
</a>
<a className="item text-sm" tabIndex={-1}>
Subscriptions
</a>
</div>
</div>
);
};
58 changes: 58 additions & 0 deletions apps/website/components/demo/modal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React, { useCallback, useState } from "react";
import _ from "lodash";

interface Props {
labelText?: string;
pauseScroll?: boolean;
overlay?: boolean;
}

export const ModalDemo = ({
labelText = "Open Modal",
pauseScroll = false,
overlay = true,
}: Props) => {
const [eleId] = useState(_.uniqueId("sira-demo-modal-"));

const toggle = useCallback(() => {
let ele = document.getElementById(eleId);
let show = ele!.classList.contains("show");
if (show) {
ele!.classList.remove("show");
} else {
ele!.classList.add("show");
}
}, [eleId]);

return (
<div>
<label className="btn success solid" onClick={toggle}>
{labelText}
</label>
{overlay && <label className="modal-overlay" onClick={toggle}></label>}
<div
className={`modal ${
pauseScroll ? "pause-scroll" : ""
} flex flex-col gap-5`}
id={eleId}
>
<button className="absolute right-4 top-3" onClick={toggle}>
</button>
<h2 className="text-xl">Modal title</h2>
<span>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Tenetur
dolorum voluptate ratione dicta. Maxime cupiditate, est commodi
consectetur earum iure, optio, obcaecati in nulla saepe maiores nobis
iste quasi alias!
</span>
<div className="flex gap-3">
<button className="btn solid danger flex-1">Delete</button>
<button className="btn solid bw flex-1" onClick={toggle}>
Cancel
</button>
</div>
</div>
</div>
);
};
19 changes: 18 additions & 1 deletion apps/website/pages/docs/components/_meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
{
"overview": "Overview",
"button": "Button"
"accordion": "Accordion",
"avatar": "Avatar",
"badge": "Badge",
"breadcrumbs": "Breadcrumbs",
"button": "Button",
"checkbox": "Checkbox",
"drawer": "Drawer",
"dropdown": "Dropdown",
"input": "Input",
"loader": "Loader",
"modal": "Modal",
"prompt": "Prompt",
"radio": "Radio",
"select": "Select",
"switch": "Switch",
"table": "Table",
"tabs": "Tabs",
"tooltip": "Tooltip"
}
Loading

1 comment on commit a71a853

@vercel
Copy link

@vercel vercel bot commented on a71a853 Jan 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sira – ./

sira-git-main-riccox.vercel.app
sira.vercel.app
sira-riccox.vercel.app
sira.riccox.com

Please sign in to comment.