Skip to content

Commit

Permalink
Merge branch 'next' of https://github.com/HolodexNet/Holodex into next
Browse files Browse the repository at this point in the history
  • Loading branch information
sphinxrave committed Oct 11, 2023
2 parents d0c526b + a9d1df5 commit e2ccc46
Show file tree
Hide file tree
Showing 7 changed files with 266 additions and 10 deletions.
150 changes: 150 additions & 0 deletions packages/react/package-lock.json

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

7 changes: 5 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
},
"dependencies": {
"@radix-ui/colors": "^3.0.0",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-context-menu": "^2.1.5",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-toast": "^1.1.5",
"@react-oauth/google": "^0.11.1",
"@tanstack/react-query": "^4.36.1",
Expand Down Expand Up @@ -75,4 +78,4 @@
"unocss-preset-autoprefixer": "^0.0.6",
"vite": "^4.4.9"
}
}
}
35 changes: 29 additions & 6 deletions packages/react/src/Kitchensink.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
import { useState } from "react";
import { Button } from "./shadcn/ui/button";
import { FancyMultiSelect } from './shadcn/ui/fancy-multiselect';
import { Switch } from "./shadcn/ui/switch";
import { Label } from "./shadcn/ui/label";

function App() {
const [count, setCount] = useState(0);

return (
<div className="p-4">
This page is for testing components and styling.
<div className="p-4 space-y-4">
<h3>This page is for testing components and styling.</h3>

Regular spacing:
<hr className="border-base" />

<h3>Regular spacing:</h3>
<div className="space-x-2">
<Button>OK</Button>
<Button variant="outline" size="lg">Cancel</Button>
</div>

Color and variants:
<hr className="border-base" />

<h3>Color and variants:</h3>
<div className="flex flex-row max-w-5xl flex-wrap tems-start justify-start gap-4">
<Button>Default button</Button>
<Button variant="ghost">Ghost button</Button>
Expand Down Expand Up @@ -44,9 +50,26 @@ function App() {
<Button size="icon-lg" variant="link"><div className="i-heroicons:academic-cap"></div></Button>
</div>

Some fancy Multiselect:
<hr className="border-base" />
<h3>Some fancy Multiselect:</h3>

<FancyMultiSelect />

<FancyMultiSelect/>
<hr className="border-base" />
<h3>Toggles and Checkboxes</h3>
<div className="flex items-center space-x-2">
<Switch id="airplane-mode" />
<Label htmlFor="airplane-mode">Airplane Mode</Label>
</div>
<div className="flex items-center space-x-2">
{/* <Checkbox id="terms" /> */}
<label
htmlFor="terms"
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
>
Accept terms and conditions
</label>
</div>
</div>
);
}
Expand Down
5 changes: 3 additions & 2 deletions packages/react/src/components/layout/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { RouterProvider } from 'react-router-dom'
import router from '@/routes/router'
import { ReactPropTypes, useEffect } from 'react'
import classNames from 'classnames'
import { Sidebar } from '@/components/sidebar/Sidebar.tsx'
import { Sidebar } from '@/components/sidebar/Sidebar'
import { isFloatingAtom, isMobileAtom, onResizeAtom, sidebarOpenAtom, sidebarShouldBeFullscreenAtom, toggleAtom } from '@/hooks/useFrame'
import { useAtom } from 'jotai/react'
import { darkAtom } from '@/hooks/useTheme'
import { Header } from "@/components/header/header"
import { Toaster } from '@/shadcn/ui/toaster'
import clsx from 'clsx'

export function Frame() {

Expand All @@ -28,7 +29,7 @@ export function Frame() {
const [fs] = useAtom(sidebarShouldBeFullscreenAtom)
console.log(fs)

const mainClasses = classNames({
const mainClasses = clsx({
'mobile-footer': isMobile,
'sidebar-static': !floating,
'sidebar-floating': floating,
Expand Down
28 changes: 28 additions & 0 deletions packages/react/src/shadcn/ui/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as React from "react"
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
import { CheckIcon } from "@radix-ui/react-icons"

import { cn } from "@/lib/utils"

const Checkbox = React.forwardRef<
React.ElementRef<typeof CheckboxPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
>(({ className, ...props }, ref) => (
<CheckboxPrimitive.Root
ref={ref}
className={cn(
"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
className
)}
{...props}
>
<CheckboxPrimitive.Indicator
className={cn("flex items-center justify-center text-current")}
>
<CheckIcon className="h-4 w-4" />
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
))
Checkbox.displayName = CheckboxPrimitive.Root.displayName

export { Checkbox }
24 changes: 24 additions & 0 deletions packages/react/src/shadcn/ui/label.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as React from "react"
import * as LabelPrimitive from "@radix-ui/react-label"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "@/lib/utils"

const labelVariants = cva(
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
)

const Label = React.forwardRef<
React.ElementRef<typeof LabelPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
VariantProps<typeof labelVariants>
>(({ className, ...props }, ref) => (
<LabelPrimitive.Root
ref={ref}
className={cn(labelVariants(), className)}
{...props}
/>
))
Label.displayName = LabelPrimitive.Root.displayName

export { Label }
Loading

0 comments on commit e2ccc46

Please sign in to comment.