├── public
├── logo.png
├── favicon.ico
├── logo-dark.png
├── logo-light.png
├── favicon copy.ico
├── favicon-16x16.png
├── favicon-32x32.png
├── apple-touch-icon.png
├── thumbnails
│ ├── cards.png
│ ├── faqs.png
│ ├── alerts.png
│ ├── badges.png
│ ├── gicons.png
│ ├── headers.png
│ ├── landing.png
│ ├── pricing.png
│ ├── carousels.png
│ ├── pagination.png
│ ├── paginator.png
│ ├── pill-pity.png
│ ├── autocomplete.png
│ └── formlayouts.png
├── sponsors
│ ├── Oaksprout.jpeg
│ └── Anu50640461.jpg
├── android-chrome-192x192.png
├── android-chrome-512x512.png
├── site.webmanifest
├── manifest.json
└── vercel.svg
├── components
├── utils
│ ├── string.ts
│ ├── constants.ts
│ └── route-categories
│ │ ├── forms.json
│ │ ├── !fresh.json
│ │ ├── getting-started.json
│ │ ├── lists.json
│ │ ├── application-shells.json
│ │ ├── navigation.json
│ │ └── parse-categories.ts
├── component-demo
│ ├── machine
│ │ ├── index.ts
│ │ ├── component-demo.dom.ts
│ │ ├── component-demo.machine.utils.ts
│ │ ├── component-demo.types.ts
│ │ └── component-demo.connect.ts
│ ├── edit-online.ts
│ ├── codesandbox
│ │ ├── package.json
│ │ ├── src.ts
│ │ └── html.ts
│ ├── demo-scope.ts
│ └── transform-code.ts
├── layouts
│ ├── docs
│ │ ├── container.tsx
│ │ ├── page-transition.tsx
│ │ ├── index.tsx
│ │ ├── SidebarSection.tsx
│ │ └── sidebar.tsx
│ └── site.tsx
├── head
│ ├── index.tsx
│ ├── dynamic.tsx
│ └── static.tsx
├── codes
│ └── configuration
│ │ ├── provider.js
│ │ └── custom-theme.js
├── doc-search
│ ├── processSearchResult.ts
│ ├── result-list.tsx
│ ├── handleSearch.ts
│ ├── result.tsx
│ └── index.tsx
├── splitbee.tsx
├── navbar
│ ├── color-mode-toggle.tsx
│ ├── action-button.tsx
│ ├── sponsor-button.tsx
│ └── index.tsx
├── home-link.tsx
├── theme-toggle.tsx
├── nav-link.tsx
├── to-top.tsx
├── docs
│ ├── index.tsx
│ ├── configuration
│ │ ├── custom-theme.js
│ │ └── provider.js
│ ├── installation
│ │ ├── installation.js
│ │ ├── introduction.js
│ │ └── variables.js
│ └── codeblock.tsx
├── sidebar
│ ├── sidebar-content.tsx
│ ├── index.tsx
│ └── sidebar-section.tsx
├── copy-code.tsx
├── site-settings.tsx
├── logo.tsx
├── credits.tsx
└── landing
│ ├── component-sample.tsx
│ ├── sponsors.tsx
│ └── landing-hero.tsx
├── .github
├── dependabot.yml
└── workflows
│ └── push.yml
├── next-env.d.ts
├── theme
├── foundations
│ ├── styles-mode.ts
│ └── layerStyles.ts
├── styles.ts
├── context.tsx
└── index.tsx
├── .eslintrc.json
├── styles
├── globals.css
└── Home.module.css
├── pages
├── preview
│ ├── new.tsx
│ ├── packages
│ │ ├── choc-paginator
│ │ │ ├── index.js
│ │ │ ├── cpz.js
│ │ │ ├── more.js
│ │ │ ├── prs.js
│ │ │ ├── spj.js
│ │ │ ├── cpn.js
│ │ │ ├── css.js
│ │ │ ├── csz.js
│ │ │ ├── sm.js
│ │ │ ├── fr.js
│ │ │ ├── sht.js
│ │ │ ├── itr.js
│ │ │ └── rpg.js
│ │ ├── autocomplete
│ │ │ ├── index.js
│ │ │ ├── plg.js
│ │ │ ├── cur.js
│ │ │ ├── ais.js
│ │ │ └── group.js
│ │ └── pill-pity
│ │ │ └── plg.js
│ ├── pagination
│ │ ├── bp
│ │ │ └── index.tsx
│ │ ├── bpi
│ │ │ └── index.tsx
│ │ └── rpg
│ │ │ └── index.tsx
│ ├── alerts
│ │ ├── error
│ │ │ └── index.tsx
│ │ ├── info
│ │ │ └── index.tsx
│ │ ├── success
│ │ │ └── index.tsx
│ │ ├── notification
│ │ │ └── index.tsx
│ │ └── warning
│ │ │ └── index.tsx
│ ├── cards
│ │ ├── muser
│ │ │ └── index.tsx
│ │ ├── mtes
│ │ │ └── index.tsx
│ │ ├── mpro
│ │ │ └── index.tsx
│ │ ├── pwi
│ │ │ └── index.tsx
│ │ ├── cpwe
│ │ │ └── index.tsx
│ │ ├── pwe
│ │ │ └── index.tsx
│ │ ├── msp
│ │ │ └── index.tsx
│ │ └── muwd
│ │ │ └── index.tsx
│ ├── extrael
│ │ ├── rpb
│ │ │ └── index.tsx
│ │ └── snackbar
│ │ │ └── index.tsx
│ ├── badges
│ │ ├── unt
│ │ │ └── index.tsx
│ │ ├── bwb
│ │ │ └── index.tsx
│ │ └── bwi
│ │ │ └── index.tsx
│ ├── heros
│ │ └── kh2
│ │ │ └── index.tsx
│ ├── gicons
│ │ ├── dum
│ │ │ └── index.tsx
│ │ └── cm
│ │ │ └── index.tsx
│ ├── cta
│ │ ├── was
│ │ │ └── index.tsx
│ │ ├── swi
│ │ │ └── index.tsx
│ │ ├── sj
│ │ │ └── index.tsx
│ │ └── sc
│ │ │ └── index.tsx
│ ├── tables
│ │ └── mrtm
│ │ │ └── index.tsx
│ └── carousels
│ │ └── smc
│ │ └── index.tsx
├── _app.tsx
├── docs
│ ├── installation.tsx
│ ├── configuration.tsx
│ ├── [category]
│ │ └── [section].tsx
│ └── packages
│ │ └── pill-pity.tsx
├── _document.tsx
└── index.tsx
├── patches
└── re-resizable+6.9.9.patch
├── categories
├── forms.json
├── !fresh.json
├── getting-started.json
├── lists.json
├── application-shells.json
├── navigation.json
└── parse-categories.ts
├── next.config.js
├── analytics
├── ga-script.tsx
└── ads.tsx
├── .gitignore
├── .vscode
└── settings.json
├── tsconfig.json
├── LICENSE.md
└── package.json
/public/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/logo.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/logo-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/logo-dark.png
--------------------------------------------------------------------------------
/public/logo-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/logo-light.png
--------------------------------------------------------------------------------
/public/favicon copy.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/favicon copy.ico
--------------------------------------------------------------------------------
/public/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/favicon-16x16.png
--------------------------------------------------------------------------------
/public/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/favicon-32x32.png
--------------------------------------------------------------------------------
/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/public/thumbnails/cards.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/cards.png
--------------------------------------------------------------------------------
/public/thumbnails/faqs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/faqs.png
--------------------------------------------------------------------------------
/public/sponsors/Oaksprout.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/sponsors/Oaksprout.jpeg
--------------------------------------------------------------------------------
/public/thumbnails/alerts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/alerts.png
--------------------------------------------------------------------------------
/public/thumbnails/badges.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/badges.png
--------------------------------------------------------------------------------
/public/thumbnails/gicons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/gicons.png
--------------------------------------------------------------------------------
/public/thumbnails/headers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/headers.png
--------------------------------------------------------------------------------
/public/thumbnails/landing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/landing.png
--------------------------------------------------------------------------------
/public/thumbnails/pricing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/pricing.png
--------------------------------------------------------------------------------
/public/sponsors/Anu50640461.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/sponsors/Anu50640461.jpg
--------------------------------------------------------------------------------
/public/thumbnails/carousels.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/carousels.png
--------------------------------------------------------------------------------
/public/thumbnails/pagination.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/pagination.png
--------------------------------------------------------------------------------
/public/thumbnails/paginator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/paginator.png
--------------------------------------------------------------------------------
/public/thumbnails/pill-pity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/pill-pity.png
--------------------------------------------------------------------------------
/public/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/android-chrome-192x192.png
--------------------------------------------------------------------------------
/public/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/android-chrome-512x512.png
--------------------------------------------------------------------------------
/public/thumbnails/autocomplete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/autocomplete.png
--------------------------------------------------------------------------------
/public/thumbnails/formlayouts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anubra266/choc-ui/HEAD/public/thumbnails/formlayouts.png
--------------------------------------------------------------------------------
/components/utils/string.ts:
--------------------------------------------------------------------------------
1 | export const toCapitalCase = (string: string) => {
2 | return string.charAt(0).toUpperCase() + string.slice(1);
3 | };
4 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "npm"
4 | directory: "/"
5 | open-pull-requests-limit: 10
6 | schedule:
7 | interval: "monthly"
8 |
--------------------------------------------------------------------------------
/components/component-demo/machine/index.ts:
--------------------------------------------------------------------------------
1 | export { connect } from "./component-demo.connect";
2 | export { machine } from "./component-demo.machine";
3 | export type { UserDefinedContext as Context } from "./component-demo.types";
4 |
--------------------------------------------------------------------------------
/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
4 | // NOTE: This file should not be edited
5 | // see https://nextjs.org/docs/basic-features/typescript for more information.
6 |
--------------------------------------------------------------------------------
/components/layouts/docs/container.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box } from "@chakra-ui/react";
3 |
4 | export const Container = (props) => (
5 |
6 | );
7 |
8 | export default Container;
9 |
--------------------------------------------------------------------------------
/theme/foundations/styles-mode.ts:
--------------------------------------------------------------------------------
1 | type modeProps = [prop: string, light: string, dark: string];
2 | export const mode = (...[prop, light, dark]: modeProps) => {
3 | return {
4 | [prop]: light,
5 | ".chakra-ui-dark &": {
6 | [prop]: dark,
7 | },
8 | };
9 | };
10 |
--------------------------------------------------------------------------------
/components/layouts/site.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Navbar from "components/navbar";
3 |
4 | const Site = ({ children }) => {
5 | return (
6 |
7 |
8 | {children}
9 |
10 | );
11 | };
12 | export default Site;
13 |
--------------------------------------------------------------------------------
/theme/foundations/layerStyles.ts:
--------------------------------------------------------------------------------
1 | import { BoxProps } from "@chakra-ui/react";
2 | import { mode } from "./styles-mode";
3 |
4 | const layerStyles: { [key: string]: BoxProps } = {
5 | card: {
6 | ...mode("bg", "white", "gray.700"),
7 | shadow: "base",
8 | },
9 | };
10 | export default layerStyles;
11 |
--------------------------------------------------------------------------------
/components/head/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Static from "./static";
3 | import Dynamic from "./dynamic";
4 |
5 | const PageHead = (props) => {
6 | return (
7 |
8 |
9 |
10 |
11 | );
12 | };
13 |
14 | export default PageHead;
15 |
--------------------------------------------------------------------------------
/components/codes/configuration/provider.js:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | // 1. import 'ChakraProvider' component
3 | import { ChakraProvider } from "@chakra-ui/react";
4 | function App() {
5 | // 2. Use at the root of your app
6 | return (
7 |
8 |
9 |
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/components/layouts/docs/page-transition.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { motion } from "framer-motion";
3 |
4 | const PageTransition = (props) => (
5 |
10 | );
11 |
12 | export default PageTransition;
13 |
--------------------------------------------------------------------------------
/theme/styles.ts:
--------------------------------------------------------------------------------
1 | const styles = {
2 | global: {
3 | body: {
4 | fontFamily: "body",
5 | _dark: {
6 | bg: "#141517",
7 | color: "white",
8 | },
9 | transition: "background .4s ease-in-out",
10 | },
11 | html: {
12 | minH: "100%",
13 | },
14 | },
15 | };
16 |
17 | export default styles;
18 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["next/core-web-vitals", "prettier"],
3 | "plugins": ["prettier", "unused-imports"],
4 | "rules": {
5 | "react/no-unescaped-entities": "off",
6 | "react/display-name": "off",
7 | "no-unused-vars": "off",
8 | "prettier/prettier": ["error"],
9 | "unused-imports/no-unused-imports": "error"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/styles/globals.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | padding: 0;
4 | margin: 0;
5 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
6 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
7 | }
8 |
9 | a {
10 | color: inherit;
11 | text-decoration: none;
12 | }
13 |
14 | * {
15 | box-sizing: border-box;
16 | }
17 |
--------------------------------------------------------------------------------
/pages/preview/new.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | return (
6 |
14 | );
15 | };
16 |
17 | export default Choc;
18 |
--------------------------------------------------------------------------------
/theme/context.tsx:
--------------------------------------------------------------------------------
1 | import { createContext } from "react";
2 |
3 | export type ThemeContextProps = {
4 | brand?: Record;
5 | setBrand?: (brand: Record) => void;
6 | presets?: (brand?: string) => any;
7 | };
8 |
9 | export const ThemeContext = createContext({});
10 |
11 | export const ThemeProvider = (props) => {
12 | return ;
13 | };
14 |
--------------------------------------------------------------------------------
/public/site.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "name": "",
3 | "short_name": "",
4 | "icons": [
5 | {
6 | "src": "/android-chrome-192x192.png",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | },
10 | {
11 | "src": "/android-chrome-512x512.png",
12 | "sizes": "512x512",
13 | "type": "image/png"
14 | }
15 | ],
16 | "theme_color": "#ffffff",
17 | "background_color": "#ffffff",
18 | "display": "standalone"
19 | }
20 |
--------------------------------------------------------------------------------
/components/utils/constants.ts:
--------------------------------------------------------------------------------
1 | export const CONSTANTS = {
2 | CHOC_TWITTER: "https://twitter.com/choc_ui",
3 | CHOC_DISCORD: "https://discord.gg/XcD8bNv7Ne",
4 | CHOC_GITHUB: "https://github.com/anubra266/choc-ui",
5 |
6 | SPONSOR_LINK: "https://patreon.com/anubra266",
7 | AUTHOR_GITHUB: "https://github.com/anubra266",
8 | AUTHOR_TWITTER: "https://twitter.com/anubra266",
9 | AUTHOR_LINKEDIN: "https://linkedin.com/in/anubra266",
10 | AUTHOR_EMAIL: "abraham@anubra266.com",
11 | };
12 |
--------------------------------------------------------------------------------
/patches/re-resizable+6.9.9.patch:
--------------------------------------------------------------------------------
1 | diff --git a/node_modules/re-resizable/lib/index.d.ts b/node_modules/re-resizable/lib/index.d.ts
2 | index 6cd235f..39b5029 100644
3 | --- a/node_modules/re-resizable/lib/index.d.ts
4 | +++ b/node_modules/re-resizable/lib/index.d.ts
5 | @@ -56,6 +56,7 @@ export interface ResizableProps {
6 | style?: React.CSSProperties;
7 | className?: string;
8 | grid?: [number, number];
9 | + id: string;
10 | snap?: {
11 | x?: number[];
12 | y?: number[];
13 |
--------------------------------------------------------------------------------
/categories/forms.json:
--------------------------------------------------------------------------------
1 | {
2 | "forms": {
3 | "title": "forms",
4 | "prefix": "/docs/forms/",
5 | "sections": {
6 | "form-layouts": {
7 | "title": "Form Layouts",
8 | "route": "form-layouts",
9 | "image": "formlayouts.png",
10 | "components": [
11 | {
12 | "name": "Two-column cards with separate submit actions",
13 | "url": "#",
14 | "preview": "forms/tccst"
15 | }
16 | ]
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/components/utils/route-categories/forms.json:
--------------------------------------------------------------------------------
1 | {
2 | "forms": {
3 | "title": "forms",
4 | "prefix": "/docs/forms/",
5 | "sections": {
6 | "form-layouts": {
7 | "title": "Form Layouts",
8 | "route": "form-layouts",
9 | "image": "formlayouts.png",
10 | "components": [
11 | {
12 | "name": "Two-column cards with separate submit actions",
13 | "url": "#",
14 | "preview": "forms/tccst"
15 | }
16 | ]
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Choc UI",
3 | "short_name": "choc-ui",
4 | "icons": [
5 | {
6 | "src": "/android-chrome-192x192.png",
7 | "sizes": "192x192",
8 | "type": "image/png",
9 | "purpose": "any maskable"
10 | },
11 | {
12 | "src": " /android-chrome-512x512.png",
13 | "sizes": "512x512",
14 | "type": "image/png"
15 | }
16 | ],
17 | "theme_color": "#666db3",
18 | "background_color": "#171c37",
19 | "start_url": "/",
20 | "display": "standalone",
21 | "orientation": "portrait"
22 | }
23 |
--------------------------------------------------------------------------------
/components/codes/configuration/custom-theme.js:
--------------------------------------------------------------------------------
1 | // 1. Import the extendTheme function
2 | import { ChakraProvider, extendTheme } from "@chakra-ui/react";
3 | // 2. Extend the theme to include custom colors, fonts, etc
4 | const colors = {
5 | brand: {
6 | 900: "#1a365d",
7 | 800: "#153e75",
8 | 700: "#2a69ac",
9 | },
10 | };
11 | const theme = extendTheme({ colors });
12 | // 3. Pass the 'theme' prop to the 'ChakraProvider'
13 | function App() {
14 | return (
15 |
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/pages/_app.tsx:
--------------------------------------------------------------------------------
1 | import type { AppProps } from "next/app";
2 | import Theme from "theme";
3 | import SiteSettings from "components/site-settings";
4 | import PageHead from "components/head/static";
5 |
6 | import splitbee from "@splitbee/web";
7 | import ToTop from "components/to-top";
8 |
9 | splitbee.init();
10 |
11 | function MyApp({ Component, pageProps }: AppProps) {
12 | return (
13 |
14 |
15 |
16 |
17 |
18 |
19 | );
20 | }
21 |
22 | export default MyApp;
23 |
--------------------------------------------------------------------------------
/components/doc-search/processSearchResult.ts:
--------------------------------------------------------------------------------
1 | export const processSearchResult = (searchResults) => {
2 | const processedResult = {};
3 | const totalSections = Object.keys(searchResults).reduce((a, category) => {
4 | const sections = searchResults[category];
5 | const categoryWithSectionIndex = sections.map((section, index) => ({
6 | ...section,
7 | sectionIndex: a + index,
8 | }));
9 | processedResult[category] = categoryWithSectionIndex;
10 |
11 | return a + sections.length;
12 | }, 0);
13 |
14 | return { totalSections, processedResult };
15 | };
16 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | return (
7 |
15 |
20 |
21 | );
22 | };
23 | export default Choc;
24 |
--------------------------------------------------------------------------------
/components/splitbee.tsx:
--------------------------------------------------------------------------------
1 | import { Link, chakra, useColorModeValue } from "@chakra-ui/react";
2 |
3 | export const Splitbee = () => {
4 | const splitbeeBadge = useColorModeValue("", "-dark");
5 | return (
6 |
7 |
8 |
12 |
13 |
14 | );
15 | };
16 |
--------------------------------------------------------------------------------
/next.config.js:
--------------------------------------------------------------------------------
1 | const withPWA = require("next-pwa");
2 |
3 | module.exports = {
4 | env: {
5 | siteUrl: "https://choc-ui.tech",
6 | githubRepo: "anubra266/choc-ui",
7 | githubChoc: "https://github.com/anubra266/choc-ui",
8 | githubUrl: "https://github.com/anubra266",
9 | twitterUrl: "https://twitter.com/anubra266",
10 | linkedinUrl: "https://linkedin.com/in/anubra266",
11 | emailAddress: "anubra266@gmail.com",
12 | discordUrl: "https://discord.gg/XcD8bNv7Ne",
13 | twitterChoc: "https://twitter.com/choc_ui",
14 | sponsorLink: "https://patreon.com/anubra266",
15 | },
16 | };
17 |
--------------------------------------------------------------------------------
/pages/docs/installation.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import PageHead from "components/head";
3 | import DocsLayout from "components/layouts/docs";
4 | import { PageHeader } from "components/docs";
5 | import Installation from "components/docs/installation/installation";
6 | import { AdBox } from "analytics/ads";
7 |
8 | const InstallationView = () => {
9 | return (
10 |
11 |
12 | Installation
13 |
14 |
15 |
16 | );
17 | };
18 |
19 | export default InstallationView;
20 |
--------------------------------------------------------------------------------
/components/navbar/color-mode-toggle.tsx:
--------------------------------------------------------------------------------
1 | import { useColorMode, useColorModeValue } from "@chakra-ui/react";
2 | import { FaMoon, FaSun } from "react-icons/fa";
3 | import { ActionButton } from "components/navbar/action-button";
4 |
5 | export const ColorModeToggle = () => {
6 | const { toggleColorMode: toggleMode } = useColorMode();
7 | const text = useColorModeValue("dark", "light");
8 | const SwitchIcon = useColorModeValue(FaMoon, FaSun);
9 |
10 | return (
11 | }
15 | />
16 | );
17 | };
18 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/cpz.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | return (
7 |
15 |
21 |
22 | );
23 | };
24 | export default Choc;
25 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/more.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | return (
7 |
15 |
21 |
22 | );
23 | };
24 | export default Choc;
25 |
--------------------------------------------------------------------------------
/analytics/ga-script.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | const GA_TRACKING_ID = "G-YVRM2PTZFG";
4 |
5 | const GAScript = () => (
6 | <>
7 |
11 |
21 | >
22 | );
23 |
24 | export default GAScript;
25 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/prs.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | return (
7 |
15 |
22 |
23 | );
24 | };
25 | export default Choc;
26 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/spj.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | return (
7 |
15 |
22 |
23 | );
24 | };
25 | export default Choc;
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # PWA
4 | /public/workbox-*.js
5 | /public/workbox-*.js.map
6 | /public/sw.js
7 | /public/sw.js.map
8 | /public/fallback-*.js
9 |
10 | # dependencies
11 | /node_modules
12 | /.pnp
13 | .pnp.js
14 |
15 | # testing
16 | /coverage
17 |
18 | # next.js
19 | /.next/
20 | /out/
21 |
22 | # production
23 | /build
24 |
25 | # misc
26 | .DS_Store
27 | *.pem
28 |
29 | # debug
30 | npm-debug.log*
31 | yarn-debug.log*
32 | yarn-error.log*
33 |
34 | # local env files
35 | .env.local
36 | .env.development.local
37 | .env.test.local
38 | .env.production.local
39 |
40 | # vercel
41 | .vercel
42 |
--------------------------------------------------------------------------------
/categories/!fresh.json:
--------------------------------------------------------------------------------
1 | {
2 | "elements": {
3 | "title": "elements",
4 | "prefix": "/docs/elements/",
5 | "sections": {
6 | "alerts": {
7 | "title": "Alerts",
8 | "route": "alerts",
9 | "alert": {
10 | "variant": "green",
11 | "message": "New"
12 | },
13 | "components": [
14 | {
15 | "name": "success",
16 | "url": "https://merakiui.com/",
17 | "preview": "alerts/success",
18 | "alerts": {
19 | "status": "warning",
20 | "content": ["Alert in HTML"]
21 | }
22 | }
23 | ]
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/components/home-link.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { IconButton, Icon, Link, Tooltip } from "@chakra-ui/react";
3 | import { MdHome } from "react-icons/md";
4 |
5 | export const HomeLink = () => {
6 | return (
7 |
13 |
14 | }
21 | />
22 |
23 |
24 | );
25 | };
26 |
--------------------------------------------------------------------------------
/pages/docs/configuration.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import PageHead from "components/head";
3 | import DocsLayout from "components/layouts/docs/index";
4 | import Provider from "components/docs/configuration/provider";
5 | import CustomTheme from "components/docs/configuration/custom-theme";
6 | import { PageHeader } from "components/docs";
7 | import { AdBox } from "analytics/ads";
8 |
9 | const Configuration = () => {
10 | return (
11 |
12 |
13 | Configuration
14 |
15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export default Configuration;
22 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "eslint.format.enable": true,
3 | "[javascript]": {
4 | "editor.defaultFormatter": "dbaeumer.vscode-eslint",
5 | "editor.formatOnSave": true
6 | },
7 | "[javascriptreact]": {
8 | "editor.defaultFormatter": "dbaeumer.vscode-eslint",
9 | "editor.formatOnSave": true
10 | },
11 | "[typescript]": {
12 | "editor.defaultFormatter": "dbaeumer.vscode-eslint",
13 | "editor.formatOnSave": true
14 | },
15 | "[typescriptreact]": {
16 | "editor.defaultFormatter": "dbaeumer.vscode-eslint",
17 | "editor.formatOnSave": true
18 | },
19 | "typescript.tsdk": "node_modules/typescript/lib",
20 | "typescript.preferences.importModuleSpecifier": "non-relative"
21 | }
22 |
--------------------------------------------------------------------------------
/components/utils/route-categories/!fresh.json:
--------------------------------------------------------------------------------
1 | {
2 | "elements": {
3 | "title": "elements",
4 | "prefix": "/docs/elements/",
5 | "sections": {
6 | "alerts": {
7 | "title": "Alerts",
8 | "route": "alerts",
9 | "alert": {
10 | "variant": "green",
11 | "message": "New"
12 | },
13 | "components": [
14 | {
15 | "name": "success",
16 | "url": "https://merakiui.com/",
17 | "preview": "alerts/success",
18 | "alerts": {
19 | "status": "warning",
20 | "content": ["Alert in HTML"]
21 | }
22 | }
23 | ]
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/cpn.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | const [current, setCurrent] = React.useState(3);
7 | return (
8 |
16 | setCurrent(page)}
22 | />
23 |
24 | );
25 | };
26 | export default Choc;
27 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/css.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | return (
7 |
15 |
23 |
24 | );
25 | };
26 | export default Choc;
27 |
--------------------------------------------------------------------------------
/categories/getting-started.json:
--------------------------------------------------------------------------------
1 | {
2 | "getting-started": {
3 | "title": "getting started",
4 | "prefix": "/docs/",
5 | "sections": {
6 | "installation": {
7 | "title": "installation",
8 | "route": "installation",
9 | "components": [
10 | {
11 | "name": "Installation",
12 | "url": "#",
13 | "preview": ""
14 | }
15 | ]
16 | },
17 | "configuration": {
18 | "title": "configuration",
19 | "route": "configuration",
20 | "components": [
21 | {
22 | "name": "configuration",
23 | "url": "#",
24 | "preview": ""
25 | }
26 | ]
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/categories/lists.json:
--------------------------------------------------------------------------------
1 | {
2 | "lists": {
3 | "title": "lists",
4 | "prefix": "/docs/lists/",
5 | "sections": {
6 | "tables": {
7 | "title": "tables",
8 | "route": "tables",
9 | "components": [
10 | {
11 | "name": "Mobile Responsive Table Minimal",
12 | "url": "#",
13 | "preview": "tables/mrtm"
14 | },
15 | {
16 | "name": "Mobile Responsive Table",
17 | "url": "#",
18 | "preview": "tables/mrt"
19 | },
20 | {
21 | "name": "Mobile Responsive Table with Print support",
22 | "url": "#",
23 | "preview": "tables/mrtp"
24 | }
25 | ]
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/components/utils/route-categories/getting-started.json:
--------------------------------------------------------------------------------
1 | {
2 | "getting-started": {
3 | "title": "getting started",
4 | "prefix": "/docs/",
5 | "sections": {
6 | "installation": {
7 | "title": "installation",
8 | "route": "installation",
9 | "components": [
10 | {
11 | "name": "Installation",
12 | "url": "#",
13 | "preview": ""
14 | }
15 | ]
16 | },
17 | "configuration": {
18 | "title": "configuration",
19 | "route": "configuration",
20 | "components": [
21 | {
22 | "name": "configuration",
23 | "url": "#",
24 | "preview": ""
25 | }
26 | ]
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/components/utils/route-categories/lists.json:
--------------------------------------------------------------------------------
1 | {
2 | "lists": {
3 | "title": "lists",
4 | "prefix": "/docs/lists/",
5 | "sections": {
6 | "tables": {
7 | "title": "tables",
8 | "route": "tables",
9 | "components": [
10 | {
11 | "name": "Mobile Responsive Table Minimal",
12 | "url": "#",
13 | "preview": "tables/mrtm"
14 | },
15 | {
16 | "name": "Mobile Responsive Table",
17 | "url": "#",
18 | "preview": "tables/mrt"
19 | },
20 | {
21 | "name": "Mobile Responsive Table with Print support",
22 | "url": "#",
23 | "preview": "tables/mrtp"
24 | }
25 | ]
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/csz.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | return (
7 |
16 | {["xs", "sm", "md", "lg"].map((size, key) => (
17 |
25 | ))}
26 |
27 | );
28 | };
29 | export default Choc;
30 |
--------------------------------------------------------------------------------
/pages/_document.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import NextDocument, {
3 | Html,
4 | Head,
5 | Main,
6 | NextScript,
7 | DocumentContext,
8 | } from "next/document";
9 | import GAScript from "analytics/ga-script";
10 | import { ColorModeScript } from "@chakra-ui/react";
11 | import { config } from "theme";
12 |
13 | class Document extends NextDocument {
14 | static getInitialProps(ctx: DocumentContext) {
15 | return NextDocument.getInitialProps(ctx);
16 | }
17 |
18 | render() {
19 | return (
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | );
30 | }
31 | }
32 |
33 | export default Document;
34 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/sm.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | return (
7 |
16 |
22 |
23 |
30 |
31 | );
32 | };
33 | export default Choc;
34 |
--------------------------------------------------------------------------------
/categories/application-shells.json:
--------------------------------------------------------------------------------
1 | {
2 | "application-shells": {
3 | "title": "application shells",
4 | "prefix": "/docs/application-shells/",
5 | "sections": {
6 | "sidebar-layouts": {
7 | "title": "sidebar layouts",
8 | "route": "sidebar-layouts",
9 | "alert": {
10 | "variant": "green",
11 | "message": "New"
12 | },
13 | "components": [
14 | {
15 | "name": "simple with icons, and brand color",
16 | "url": "https://kutty.netlify.app/components/light-sidebar/",
17 | "preview": "sidebar/swibc"
18 | },
19 | {
20 | "name": "Brand Sidebar",
21 | "url": "https://tailwindui.com/components/application-ui/application-shells/sidebar",
22 | "preview": "sidebar/bs"
23 | }
24 | ]
25 | }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/components/theme-toggle.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {
3 | IconButton,
4 | Tooltip,
5 | useColorMode,
6 | useColorModeValue,
7 | } from "@chakra-ui/react";
8 | import { FaMoon, FaSun } from "react-icons/fa";
9 |
10 | export const ThemeToggle = () => {
11 | const SwitchIcon = useColorModeValue(FaMoon, FaSun);
12 | const text = useColorModeValue("dark", "light");
13 | const { toggleColorMode: toggleMode } = useColorMode();
14 | return (
15 |
21 | }
29 | />
30 |
31 | );
32 | };
33 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/fr.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex, useToken } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | const focusRing = useToken("colors", ["brand.400"])[0];
7 | return (
8 |
17 |
23 |
24 |
30 |
31 | );
32 | };
33 | export default Choc;
34 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/sht.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex, Button } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | return (
7 |
16 | `${total} Items`}
21 | />
22 |
23 | }
28 | />
29 |
30 | );
31 | };
32 | export default Choc;
33 |
--------------------------------------------------------------------------------
/components/utils/route-categories/application-shells.json:
--------------------------------------------------------------------------------
1 | {
2 | "application-shells": {
3 | "title": "application shells",
4 | "prefix": "/docs/application-shells/",
5 | "sections": {
6 | "sidebar-layouts": {
7 | "title": "sidebar layouts",
8 | "route": "sidebar-layouts",
9 | "alert": {
10 | "variant": "green",
11 | "message": "New"
12 | },
13 | "components": [
14 | {
15 | "name": "simple with icons, and brand color",
16 | "url": "https://kutty.netlify.app/components/light-sidebar/",
17 | "preview": "sidebar/swibc"
18 | },
19 | {
20 | "name": "Brand Sidebar",
21 | "url": "https://tailwindui.com/components/application-ui/application-shells/sidebar",
22 | "preview": "sidebar/bs"
23 | }
24 | ]
25 | }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/components/nav-link.tsx:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 | import { useRouter } from "next/router";
3 | import Link from "next/link";
4 | import React from "react";
5 | import { runIfFn } from "@chakra-ui/utils";
6 |
7 | const NavLink = ({ children, href, ...props }) => {
8 | const { asPath, isReady } = useRouter();
9 |
10 | const [active, setActive] = useState(false);
11 |
12 | useEffect(() => {
13 | // Check if the router fields are updated client-side
14 | if (isReady) {
15 | // Using URL().pathname to get rid of query and hash
16 | const activePathname = new URL(asPath, location.href).pathname;
17 |
18 | setActive(activePathname === href);
19 | }
20 | }, [asPath, isReady, props.as, href]);
21 |
22 | return (
23 |
24 | {runIfFn(children, { isActive: active })}
25 |
26 | );
27 | };
28 |
29 | export default NavLink;
30 |
--------------------------------------------------------------------------------
/components/component-demo/machine/component-demo.dom.ts:
--------------------------------------------------------------------------------
1 | import type { MachineContext as Ctx } from "./component-demo.types";
2 |
3 | export const dom = {
4 | getDoc: (ctx: Ctx) => ctx.doc ?? document,
5 | getRootNode: (ctx: Ctx) => ctx.rootNode ?? dom.getDoc(ctx),
6 |
7 | getRootId: (ctx: Ctx) => ctx.ids?.root ?? `component:demo:${ctx.uid}`,
8 | getToggleButtonId: (ctx: Ctx) =>
9 | ctx.ids?.toggleButton ?? `component:demo:${ctx.uid}:toggle:button`,
10 | getDeviceToggleId: (ctx: Ctx) =>
11 | ctx.ids?.deviceToggle ?? `component:demo:${ctx.uid}:device:toggle`,
12 | getFrameId: (ctx: Ctx) => ctx.ids?.frame ?? `component:demo:${ctx.uid}:frame`,
13 |
14 | getFrameEl: (ctx: Ctx) =>
15 | dom
16 | .getRootNode(ctx)
17 | .getElementById(dom.getFrameId(ctx)) as HTMLIFrameElement | null,
18 | getFrameWrapperEl: (ctx: Ctx) =>
19 | dom
20 | .getRootNode(ctx)
21 | .getElementById("frameWrapper") as HTMLIFrameElement | null,
22 | };
23 |
--------------------------------------------------------------------------------
/components/to-top.tsx:
--------------------------------------------------------------------------------
1 | import { IconButton } from "@chakra-ui/react";
2 | import React, { useEffect, useState } from "react";
3 | import { FiArrowUp } from "react-icons/fi";
4 |
5 | const ToTop = () => {
6 | const scrollToTop = () => window.scroll({ top: 0, behavior: "smooth" });
7 | const getVisible = () =>
8 | document.body.scrollTop > 20 || document.documentElement.scrollTop > 20;
9 | const [isVisible, setIsVisible] = useState(false);
10 | useEffect(() => {
11 | setIsVisible(() => getVisible());
12 | window.onscroll = () => setIsVisible(() => getVisible());
13 | }, []);
14 | return (
15 | }
19 | rounded="full"
20 | pos="fixed"
21 | bottom="30"
22 | right="4"
23 | colorScheme="brand"
24 | onClick={scrollToTop}
25 | visibility={isVisible ? "visible" : "hidden"}
26 | />
27 | );
28 | };
29 |
30 | export default ToTop;
31 |
--------------------------------------------------------------------------------
/components/docs/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Text, Box, Link } from "@chakra-ui/react";
3 |
4 | export const linkStyle = {
5 | textDecoration: "underline",
6 | };
7 |
8 | export const PageHeader = (props) => {
9 | return (
10 |
17 | );
18 | };
19 |
20 | export const Section = (props) => {
21 | return ;
22 | };
23 | Section.Header = (props) => {
24 | return (
25 |
35 | );
36 | };
37 | Section.Content = (props) => {
38 | return ;
39 | };
40 | Section.p = (props) => ;
41 | Section.a = (props) => ;
42 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowSyntheticDefaultImports": true,
4 | "baseUrl": "./",
5 | "paths": {},
6 | "target": "es5",
7 | "lib": [
8 | "dom",
9 | "dom.iterable",
10 | "esnext"
11 | ],
12 | "allowJs": true,
13 | "skipLibCheck": true,
14 | "strict": false,
15 | "forceConsistentCasingInFileNames": true,
16 | "noEmit": true,
17 | "esModuleInterop": true,
18 | "module": "esnext",
19 | "moduleResolution": "node",
20 | "resolveJsonModule": true,
21 | "isolatedModules": true,
22 | "jsx": "preserve",
23 | "incremental": true
24 | },
25 | "exclude": [
26 | "node_modules",
27 | "dist"
28 | ],
29 | "include": [
30 | "next-env.d.ts",
31 | "**/*.ts",
32 | "**/*.tsx",
33 | "components/component-demo/preview-frame.js",
34 | "components/component-demo-2/frame.js",
35 | "../../Packages/sticky-react/src/Context.tsx",
36 | "pages/preview/headers/cwbb/index.js"
37 | ]
38 | }
39 |
--------------------------------------------------------------------------------
/components/sidebar/sidebar-content.tsx:
--------------------------------------------------------------------------------
1 | import { Flex, Text, chakra } from "@chakra-ui/react";
2 | import type { FlexProps } from "@chakra-ui/react";
3 |
4 | import { useRoutes } from "components/utils/route-categories/parse-categories";
5 | import { SidebarSection } from "components/sidebar/sidebar-section";
6 |
7 | export const SidebarContent = (props: FlexProps) => {
8 | const routes = useRoutes();
9 |
10 | return (
11 |
12 | {routes.map((category, cid) => (
13 |
14 |
20 | {category.title}
21 |
22 | {category.sections.map((section: any) => (
23 |
24 | ))}
25 |
26 | ))}
27 |
28 | );
29 | };
30 |
--------------------------------------------------------------------------------
/categories/navigation.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigation": {
3 | "title": "navigation",
4 | "prefix": "/docs/navigation/",
5 | "sections": {
6 | "navbars": {
7 | "title": "navbars",
8 | "route": "navbars",
9 | "components": [
10 | {
11 | "name": "Guest Simple Links Right",
12 | "url": "https://kutty.netlify.app/components/headers/",
13 | "preview": "navbars/gslr"
14 | },
15 | {
16 | "name": "Dashboard Simple Links Left",
17 | "url": "https://kutty.netlify.app/components/headers/",
18 | "preview": "navbars/dsll"
19 | },
20 | {
21 | "name": "Dashboard Sub-Navigation Links",
22 | "url": "https://kutty.netlify.app/components/headers/",
23 | "preview": "navbars/dsnl"
24 | },
25 | {
26 | "name": "With Quick Action",
27 | "url": "#",
28 | "preview": "navbars/wqa"
29 | }
30 | ]
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/components/copy-code.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { IconButton, Icon, useClipboard, Tooltip } from "@chakra-ui/react";
3 | import { IoCopy, IoCheckmarkDoneSharp } from "react-icons/io5";
4 | import { useRouter } from "next/router";
5 |
6 | export const CopyCode = () => {
7 | const url = useRouter().pathname;
8 | const arr = url.split("/");
9 | const code =
10 | require(`!!raw-loader!pages/preview/${arr[2]}/${arr[3]}`).default;
11 | const { hasCopied, onCopy } = useClipboard(code);
12 | return (
13 |
19 |
28 | }
29 | />
30 |
31 | );
32 | };
33 |
--------------------------------------------------------------------------------
/components/utils/route-categories/navigation.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigation": {
3 | "title": "navigation",
4 | "prefix": "/docs/navigation/",
5 | "sections": {
6 | "navbars": {
7 | "title": "navbars",
8 | "route": "navbars",
9 | "components": [
10 | {
11 | "name": "Guest Simple Links Right",
12 | "url": "https://kutty.netlify.app/components/headers/",
13 | "preview": "navbars/gslr"
14 | },
15 | {
16 | "name": "Dashboard Simple Links Left",
17 | "url": "https://kutty.netlify.app/components/headers/",
18 | "preview": "navbars/dsll"
19 | },
20 | {
21 | "name": "Dashboard Sub-Navigation Links",
22 | "url": "https://kutty.netlify.app/components/headers/",
23 | "preview": "navbars/dsnl"
24 | },
25 | {
26 | "name": "With Quick Action",
27 | "url": "#",
28 | "preview": "navbars/wqa"
29 | }
30 | ]
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/components/docs/configuration/custom-theme.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { CodeBlock } from "components/docs/codeblock";
3 | import { Section } from "components/docs";
4 | import customTheme from "!!raw-loader!components/codes/configuration/custom-theme";
5 |
6 | const CustomTheme = () => {
7 | return (
8 |
9 | Add custom theme (Optional)
10 |
11 |
12 | If you need to customize the default chakra theme to match your design
13 | requirements, you can extend the theme from
14 | @chakra-ui/react.
15 |
16 |
17 |
18 | Chakra UI provides an extendTheme function that deep
19 | merges the default theme with your customizations.
20 |
21 |
22 | {customTheme}
23 |
24 |
25 |
26 | );
27 | };
28 |
29 | export default CustomTheme;
30 |
--------------------------------------------------------------------------------
/components/navbar/action-button.tsx:
--------------------------------------------------------------------------------
1 | import { IconButton, forwardRef, useButtonGroup } from "@chakra-ui/react";
2 | import type { IconButtonProps } from "@chakra-ui/react";
3 |
4 | type LinkType =
5 | | {
6 | isLink: true;
7 | href: string;
8 | }
9 | | {
10 | isLink?: false;
11 | href?: never;
12 | };
13 | export type ActionButtonProps = IconButtonProps & LinkType;
14 |
15 | const linkProps = { as: "a", target: "_blank", rel: "noreferrer" } as const;
16 |
17 | export const ActionButton = forwardRef(
18 | (props, ref) => {
19 | const { isLink, ...rest } = props;
20 | const group = useButtonGroup() as
21 | | ReturnType
22 | | undefined;
23 |
24 | return (
25 |
34 | );
35 | }
36 | );
37 |
--------------------------------------------------------------------------------
/components/site-settings.tsx:
--------------------------------------------------------------------------------
1 | import { HomeLink } from "components/home-link";
2 | import { CopyCode } from "components/copy-code";
3 | import { ThemeToggle } from "components/theme-toggle";
4 | import { useColorModeValue, Stack } from "@chakra-ui/react";
5 | import { useRouter } from "next/router";
6 |
7 | function inIframe() {
8 | try {
9 | return window.self !== window.top;
10 | } catch (e) {
11 | return true;
12 | }
13 | }
14 |
15 | export default function Ss() {
16 | const router = useRouter();
17 | const isPreview = router.pathname.includes("preview");
18 | const bg = useColorModeValue("white", "gray.700");
19 |
20 | return (
21 | isPreview &&
22 | !inIframe() && (
23 |
35 |
36 |
37 |
38 |
39 | )
40 | );
41 | }
42 |
--------------------------------------------------------------------------------
/components/component-demo/machine/component-demo.machine.utils.ts:
--------------------------------------------------------------------------------
1 | import { dom } from "components/component-demo/machine/component-demo.dom";
2 | import { DeviceView } from "components/component-demo/machine/component-demo.types";
3 | import type { MachineContext } from "components/component-demo/machine/component-demo.types";
4 |
5 | export function getDefaultFramesize(ctx: MachineContext) {
6 | const frameEl = dom.getFrameEl(ctx);
7 | const positionInfo = frameEl?.getBoundingClientRect();
8 |
9 | return {
10 | width: positionInfo?.width || 0,
11 | height: positionInfo?.height || 0,
12 | };
13 | }
14 |
15 | export function getDefaultFrameWrappersize(ctx: MachineContext) {
16 | const frameEl = dom.getFrameWrapperEl(ctx);
17 | const positionInfo = frameEl?.getBoundingClientRect();
18 |
19 | return {
20 | width: positionInfo?.width || 0,
21 | height: positionInfo?.height || 0,
22 | };
23 | }
24 |
25 | export const getDeviceWidths = (ctx: MachineContext) => ({
26 | [DeviceView.MOBILE]: 480,
27 | [DeviceView.TABLET]: 768,
28 | [DeviceView.DESKTOP]: ctx.frameWrapperSize.width,
29 | });
30 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) Anubra266
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/pages/preview/packages/autocomplete/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import {
4 | AutoComplete,
5 | AutoCompleteInput,
6 | AutoCompleteItem,
7 | AutoCompleteList,
8 | } from "@choc-ui/chakra-autocomplete";
9 |
10 | const Choc = () => {
11 | const options = ["apple", "appoint", "zap", "cap", "japan"];
12 |
13 | return (
14 |
23 |
24 |
25 |
26 | {options.map((option, oid) => (
27 |
32 | {option}
33 |
34 | ))}
35 |
36 |
37 |
38 | );
39 | };
40 | export default Choc;
41 |
--------------------------------------------------------------------------------
/components/component-demo/edit-online.ts:
--------------------------------------------------------------------------------
1 | import { getParameters } from "codesandbox/lib/api/define";
2 | import package_json from "./codesandbox/package.json";
3 | import { App, index } from "./codesandbox/src";
4 | import { html } from "./codesandbox/html";
5 |
6 | export const editOnlineCds = (code: string, path?: string) => {
7 | if (!path || !code) return "";
8 | const section = path.split("/")[0];
9 | const json_config = {
10 | ...package_json,
11 | name: `Choc UI ${section} Codesandbox`,
12 | description: `Edit Choc UI ${section} Code`,
13 | };
14 |
15 | const parameters = getParameters({
16 | files: {
17 | "public/index.html": {
18 | content: html(path),
19 | isBinary: false,
20 | },
21 | "src/index.tsx": {
22 | content: index,
23 | isBinary: false,
24 | },
25 | "src/App.tsx": {
26 | content: App(code),
27 | isBinary: false,
28 | },
29 | "package.json": {
30 | content: JSON.stringify(json_config),
31 | isBinary: false,
32 | },
33 | },
34 | });
35 |
36 | return `https://codesandbox.io/api/v1/sandboxes/define?parameters=${parameters}`;
37 | };
38 |
--------------------------------------------------------------------------------
/components/layouts/docs/index.tsx:
--------------------------------------------------------------------------------
1 | // a
2 |
3 | import { Flex, chakra } from "@chakra-ui/react";
4 | import React from "react";
5 | import SiteLayout from "components/layouts/site";
6 | import Credits from "components/credits";
7 | import { Splitbee } from "components/splitbee";
8 | import { motion } from "framer-motion";
9 | import { Sidebar } from "components/sidebar";
10 | import { useRouter } from "next/router";
11 |
12 | const Docs = ({ children }) => {
13 | const router = useRouter();
14 | return (
15 |
16 |
17 |
18 |
25 |
30 | {children}
31 |
32 |
33 |
34 |
35 |
36 |
37 | );
38 | };
39 |
40 | export default Docs;
41 |
--------------------------------------------------------------------------------
/components/component-demo/codesandbox/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "choc_ui",
3 | "version": "1.0.0",
4 | "description": "Choc UI",
5 | "keywords": [
6 | "react",
7 | "choc-ui",
8 | "chakra-ui"
9 | ],
10 | "main": "src/index.js",
11 | "dependencies": {
12 | "@chakra-ui/icons": "latest",
13 | "@chakra-ui/react": "latest",
14 | "@emotion/react": "latest",
15 | "@emotion/styled": "latest",
16 | "framer-motion": "latest",
17 | "react": "latest",
18 | "react-dom": "latest",
19 | "react-icons": "latest",
20 | "react-scripts": "latest",
21 | "@choc-ui/chakra-autocomplete": "latest",
22 | "@choc-ui/paginator": "latest",
23 | "@choc-ui/logo": "latest",
24 | "pill-pity": "latest"
25 | },
26 | "devDependencies": {
27 | "typescript": "4.1.3",
28 | "@types/react": "latest",
29 | "@types/react-dom": "latest"
30 | },
31 | "scripts": {
32 | "start": "react-scripts start",
33 | "build": "react-scripts build",
34 | "test": "react-scripts test --env=jsdom",
35 | "eject": "react-scripts eject"
36 | },
37 | "browserslist": [
38 | ">0.2%",
39 | "not dead",
40 | "not ie <= 11",
41 | "not op_mini all"
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/.github/workflows/push.yml:
--------------------------------------------------------------------------------
1 | name: Push checks
2 | on: [push]
3 | jobs:
4 | Checkout:
5 | runs-on: ubuntu-latest
6 | timeout-minutes: 4
7 | steps:
8 | - name: Setup Node.js environment
9 | uses: actions/setup-node@v1.4.4
10 | with:
11 | cache: yarn
12 | cache-dependency-path: yarn.lock
13 | node-version: 14
14 |
15 | - name: Check out code
16 | uses: actions/checkout@v2
17 | with:
18 | fetch-depth: 1
19 |
20 | - name: Get yarn cache directory path
21 | id: yarn-cache-dir-path
22 | run: echo "::set-output name=dir::$(yarn cache dir)"
23 |
24 | - uses: actions/cache@v2
25 | id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
26 | with:
27 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
28 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
29 | restore-keys: |
30 | ${{ runner.os }}-yarn-
31 |
32 | - name: Installing dependencies
33 | run: yarn install --frozen-lockfile
34 | - name: Lint
35 | run: yarn lint
36 | - name: Build
37 | run: yarn build
38 | - name: Tests
39 | run: yarn test
40 |
--------------------------------------------------------------------------------
/components/docs/installation/installation.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Section } from "components/docs";
3 | import { CodeBlock } from "components/docs/codeblock";
4 |
5 | const Installation = () => {
6 | return (
7 |
8 | Installation
9 |
10 | This is quite straightforward.
11 |
12 |
13 | {`npm i @chakra-ui/react @chakra-ui/icons @emotion/react @emotion/styled framer-motion react-icons`}
14 |
15 |
16 | {`yarn add @chakra-ui/react @chakra-ui/icons @emotion/react @emotion/styled framer-motion react-icons`}
17 |
18 |
19 |
20 | If you meet any complexities, just head along to{" "}
21 |
25 | Chakra UI's site
26 | {" "}
27 | and follow the Instructions there.
28 |
29 |
30 |
31 | );
32 | };
33 |
34 | export default Installation;
35 |
--------------------------------------------------------------------------------
/pages/preview/packages/autocomplete/plg.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex, VStack } from "@chakra-ui/react";
3 | import {
4 | AutoComplete,
5 | AutoCompleteInput,
6 | AutoCompleteItem,
7 | AutoCompleteList,
8 | } from "@choc-ui/chakra-autocomplete";
9 |
10 | const Choc = () => {
11 | const options = ["apple", "appoint", "zap", "cap", "japan"];
12 |
13 | return (
14 |
23 |
24 |
25 |
30 |
31 | {options.map((option, oid) => (
32 |
37 | {option}
38 |
39 | ))}
40 |
41 |
42 |
43 |
44 | );
45 | };
46 | export default Choc;
47 |
--------------------------------------------------------------------------------
/components/navbar/sponsor-button.tsx:
--------------------------------------------------------------------------------
1 | import { chakra, Icon } from "@chakra-ui/react";
2 | import type { HTMLChakraProps } from "@chakra-ui/react";
3 | import { FaHeart } from "react-icons/fa";
4 | import { CONSTANTS } from "components/utils/constants";
5 |
6 | const SponsorButton = (props: HTMLChakraProps<"div">) => (
7 |
37 |
38 |
39 | Sponsor
40 |
41 |
42 | );
43 |
44 | export default SponsorButton;
45 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/itr.js:
--------------------------------------------------------------------------------
1 | import React, { forwardRef } from "react";
2 | import { Flex, Button } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | const Prev = forwardRef((props, ref) => (
7 |
10 | ));
11 | const Next = forwardRef((props, ref) => (
12 |
15 | ));
16 | const Page = forwardRef((props, ref) => (
17 |
20 | ));
21 |
22 | const itemRender = (_, type) => {
23 | if (type === "prev") {
24 | return Prev;
25 | }
26 | if (type === "next") {
27 | return Next;
28 | }
29 | if (type === "page") {
30 | return Page;
31 | }
32 | };
33 | return (
34 |
42 |
48 |
49 | );
50 | };
51 | export default Choc;
52 |
--------------------------------------------------------------------------------
/pages/preview/packages/choc-paginator/rpg.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import Pagination from "@choc-ui/paginator";
4 |
5 | const Choc = () => {
6 | return (
7 |
16 |
22 | `${total} Items`}
28 | showSizeChanger
29 | showQuickJumper
30 | responsive={{ activePage: true }}
31 | />{" "}
32 | `${total} Items`}
38 | showSizeChanger
39 | showQuickJumper
40 | responsive={{ activePage: true, pageSize: true }}
41 | />
42 |
43 | );
44 | };
45 | export default Choc;
46 |
--------------------------------------------------------------------------------
/components/component-demo/codesandbox/src.ts:
--------------------------------------------------------------------------------
1 | export const App = (code: string) => {
2 | // Handle components initiated as constants
3 | code = code.replace(
4 | /const\s\w+\s=\s\(\)\s=>\s/,
5 | "export default function App()"
6 | );
7 | //Handle The bottom Exports of the const components
8 | code = code.replace(/\s?export\sdefault\s\w+;/g, "");
9 | //Handle components initiated as default exports
10 | code = code.replace(
11 | /export\sdefault\sfunction\s\w+/,
12 | "export default function App"
13 | );
14 | return code;
15 | };
16 |
17 | export const index = `import React from "react";
18 | import ReactDOM from "react-dom";
19 | import App from "./App";
20 |
21 | import { ChakraProvider, extendTheme } from "@chakra-ui/react";
22 |
23 | const colors = {
24 | brand: {
25 | 50: "#ecefff",
26 | 100: "#cbceeb",
27 | 200: "#a9aed6",
28 | 300: "#888ec5",
29 | 400: "#666db3",
30 | 500: "#4d5499",
31 | 600: "#3c4178",
32 | 700: "#2a2f57",
33 | 800: "#181c37",
34 | 900: "#080819"
35 | }
36 | };
37 | const config = {
38 | initialColorMode: "dark",
39 | useSystemColorMode: false
40 | };
41 |
42 | const theme = extendTheme({ colors, config });
43 |
44 | const rootElement = document.getElementById("root");
45 | ReactDOM.render(
46 |
47 |
48 | ,
49 | rootElement
50 | );
51 |
52 | `;
53 |
--------------------------------------------------------------------------------
/pages/preview/pagination/bp/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex, chakra } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | const PagButton = (props) => {
6 | const activeStyle = {
7 | bg: "brand.600",
8 | _dark: { bg: "brand.500" },
9 | color: "white",
10 | };
11 | return (
12 |
25 | {props.children}
26 |
27 | );
28 | };
29 | return (
30 |
38 |
39 | previous
40 | 1
41 | 2
42 | 3
43 | 4
44 | 5
45 | Next
46 |
47 |
48 | );
49 | };
50 |
51 | export default Choc;
52 |
--------------------------------------------------------------------------------
/components/docs/codeblock.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { LiveProvider, LiveEditor, LiveError } from "react-live";
3 |
4 | import { Box, Button, useClipboard } from "@chakra-ui/react";
5 |
6 | export const CodeBlock = (props) => {
7 | const { hasCopied, onCopy } = useClipboard(props.children);
8 | return (
9 |
21 |
22 |
26 |
34 | {props.showError && }
35 |
36 |
37 |
51 |
52 | );
53 | };
54 |
--------------------------------------------------------------------------------
/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { NextPage } from "next";
2 | import path from "path";
3 | import * as fs from "fs";
4 | import PageHead from "components/head";
5 | import SiteLayout from "components/layouts/site";
6 | import Credits from "components/credits";
7 | import { Box } from "@chakra-ui/react";
8 | import Feature2 from "components/landing/feature2";
9 | import OpenSource from "components/landing/open-source";
10 | import Sponsors from "components/landing/sponsors";
11 | import { Splitbee } from "components/splitbee";
12 | import { LandingHero } from "components/landing/landing-hero";
13 | import { ComponentSample } from "components/landing/component-sample";
14 |
15 | const Home: NextPage = (props: any) => {
16 | return (
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | );
30 | };
31 |
32 | export async function getStaticProps() {
33 | // Get contributors from .all-contributorsrc
34 | const contributorsRaw = path.resolve(".all-contributorsrc");
35 | const { contributors } = JSON.parse(
36 | fs.readFileSync(contributorsRaw, "utf-8")
37 | );
38 | return {
39 | props: { contributors },
40 | };
41 | }
42 | export default Home;
43 |
--------------------------------------------------------------------------------
/pages/preview/alerts/error/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Icon, chakra } from "@chakra-ui/react";
3 |
4 | import { BsLightningFill } from "react-icons/bs";
5 |
6 | const Choc = () => {
7 | return (
8 |
16 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
37 | Error
38 |
39 |
44 | Your email is already used!
45 |
46 |
47 |
48 |
49 |
50 | );
51 | };
52 |
53 | export default Choc;
54 |
--------------------------------------------------------------------------------
/pages/preview/alerts/info/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Icon, chakra } from "@chakra-ui/react";
3 |
4 | import { IoMdAlert } from "react-icons/io";
5 |
6 | const Choc = () => {
7 | return (
8 |
16 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
37 | Info
38 |
39 |
44 | This channel archived by the owner!{" "}
45 |
46 |
47 |
48 |
49 |
50 | );
51 | };
52 |
53 | export default Choc;
54 |
--------------------------------------------------------------------------------
/pages/preview/cards/muser/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Image, Link, chakra } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | return (
6 |
14 |
23 |
30 |
31 |
32 |
39 | John Doe
40 |
41 |
46 | Software Engineer
47 |
48 |
49 |
50 |
51 | );
52 | };
53 |
54 | export default Choc;
55 |
--------------------------------------------------------------------------------
/pages/preview/alerts/success/index.tsx:
--------------------------------------------------------------------------------
1 | import { Box, Flex, Icon, chakra } from "@chakra-ui/react";
2 |
3 | import React from "react";
4 | import { IoMdCheckmarkCircle } from "react-icons/io";
5 |
6 | const Choc = () => {
7 | return (
8 |
17 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
37 | Success
38 |
39 |
44 | Your account was registered!
45 |
46 |
47 |
48 |
49 |
50 | );
51 | };
52 |
53 | export default Choc;
54 |
--------------------------------------------------------------------------------
/pages/preview/alerts/notification/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Avatar, Box, Flex, Link, chakra } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | return (
6 |
14 | {" "}
15 |
25 |
26 |
27 |
28 |
33 |
34 |
35 | Dan has replied on the{" "}
36 |
41 | uploaded image
42 |
43 | .
44 |
45 |
46 |
47 |
48 |
49 | );
50 | };
51 |
52 | export default Choc;
53 |
--------------------------------------------------------------------------------
/pages/preview/alerts/warning/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Icon, chakra } from "@chakra-ui/react";
3 |
4 | import { IoMdAlert } from "react-icons/io";
5 |
6 | const Choc = () => {
7 | return (
8 |
16 |
26 |
32 |
33 |
34 |
35 |
36 |
37 |
42 | Warning
43 |
44 |
49 | Your image size is too large!
50 |
51 |
52 |
53 |
54 |
55 | );
56 | };
57 |
58 | export default Choc;
59 |
--------------------------------------------------------------------------------
/pages/preview/extrael/rpb/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Button, Stack, useColorModeValue } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | const scheme = "brand";
6 | const step1 = useColorModeValue("600", "300");
7 | const step2 = useColorModeValue("500", "400");
8 | const step3 = useColorModeValue("300", "500");
9 |
10 | const sizes = ["lg", "md", "sm", "xs"];
11 | return (
12 |
20 | {sizes.map((size, k) => (
21 |
48 | ))}
49 |
50 | );
51 | };
52 |
53 | export default Choc;
54 |
--------------------------------------------------------------------------------
/components/head/dynamic.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Head from "next/head";
3 |
4 | const Dynamic = (props) => {
5 | const capitalize = (s) => {
6 | if (typeof s !== "string") return "";
7 | return s.charAt(0).toUpperCase() + s.slice(1);
8 | };
9 | const description =
10 | "Choc UI is a set of accessible and reusable components that are commonly used in web applications.";
11 | return (
12 |
13 | {capitalize(props.title)} | Choc UI
14 |
15 |
16 |
17 |
18 |
22 |
26 |
30 |
34 |
40 |
46 |
47 | );
48 | };
49 |
50 | export default Dynamic;
51 |
--------------------------------------------------------------------------------
/pages/preview/packages/autocomplete/cur.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Avatar, Text, Flex } from "@chakra-ui/react";
3 | import {
4 | AutoComplete,
5 | AutoCompleteInput,
6 | AutoCompleteItem,
7 | AutoCompleteList,
8 | } from "@choc-ui/chakra-autocomplete";
9 |
10 | const Choc = () => {
11 | const people = [
12 | { name: "Dan Abramov", image: "https://bit.ly/dan-abramov" },
13 | { name: "Kent Dodds", image: "https://bit.ly/kent-c-dodds" },
14 | { name: "Segun Adebayo", image: "https://bit.ly/sage-adebayo" },
15 | { name: "Prosper Otemuyiwa", image: "https://bit.ly/prosper-baba" },
16 | { name: "Ryan Florence", image: "https://bit.ly/ryan-florence" },
17 | ];
18 |
19 | return (
20 |
29 |
30 |
31 |
32 | {people.map((person, oid) => (
33 |
39 |
40 | {person.name}
41 |
42 | ))}
43 |
44 |
45 |
46 | );
47 | };
48 | export default Choc;
49 |
--------------------------------------------------------------------------------
/components/component-demo/demo-scope.ts:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import * as ChakraComps from "@chakra-ui/react";
3 | import * as ChakraIcons from "@chakra-ui/icons";
4 | import * as fMotion from "framer-motion";
5 | import * as REmotion from "@emotion/react";
6 |
7 | import * as ai from "react-icons/ai";
8 | import * as bi from "react-icons/bi";
9 | import * as bs from "react-icons/bs";
10 | import * as cg from "react-icons/cg";
11 | import * as di from "react-icons/di";
12 | import * as fa from "react-icons/fa";
13 | import * as fc from "react-icons/fc";
14 | import * as fi from "react-icons/fi";
15 | import * as gi from "react-icons/gi";
16 | import * as go from "react-icons/go";
17 | import * as gr from "react-icons/gr";
18 | import * as hi from "react-icons/hi";
19 | import * as im from "react-icons/im";
20 | import * as io from "react-icons/io";
21 | import * as io5 from "react-icons/io5";
22 | import * as md from "react-icons/md";
23 | import * as ri from "react-icons/ri";
24 | import * as si from "react-icons/si";
25 | import * as ti from "react-icons/ti";
26 | import * as vsc from "react-icons/vsc";
27 | import * as wi from "react-icons/wi";
28 |
29 | import { Logo } from "@choc-ui/logo";
30 |
31 | export const demoScope = {
32 | ...React,
33 | ...ChakraComps,
34 | ...ChakraIcons,
35 | ...fMotion,
36 | ...REmotion,
37 | Logo,
38 | ...ai,
39 | ...bi,
40 | ...bs,
41 | ...cg,
42 | ...di,
43 | ...fa,
44 | ...fc,
45 | ...fi,
46 | ...gi,
47 | ...go,
48 | ...gr,
49 | ...hi,
50 | ...im,
51 | ...io,
52 | ...io5,
53 | ...md,
54 | ...ri,
55 | ...si,
56 | ...ti,
57 | ...vsc,
58 | ...wi,
59 | };
60 |
--------------------------------------------------------------------------------
/components/component-demo/transform-code.ts:
--------------------------------------------------------------------------------
1 | import { registerPlugin, transform } from "@babel/standalone";
2 | import type { Visitor } from "@babel/traverse";
3 | import type { Dict } from "@chakra-ui/utils";
4 | const prettier = require("prettier/standalone");
5 |
6 | export function transformCode(code?: string) {
7 | if (!code) return "Code not found for this component ";
8 | function chocCode(): Dict {
9 | return {
10 | visitor: {
11 | ImportDeclaration(path) {
12 | path.remove();
13 | },
14 | ExportDeclaration(path) {
15 | path.remove();
16 | },
17 | },
18 | };
19 | }
20 |
21 | try {
22 | registerPlugin("chocCode", chocCode);
23 | } catch (error) {
24 | console.error("error", error);
25 | }
26 |
27 | var output = transform(code, {
28 | plugins: ["chocCode"],
29 | presets: [["typescript", { allExtensions: true, isTSX: true }]],
30 | });
31 |
32 | let newCode: string = output.code;
33 |
34 | newCode = newCode.substring(newCode.indexOf("=") + 1);
35 |
36 | if (!newCode) return "";
37 |
38 | const codeAfterBrace = newCode.trimStart().split("{")[1];
39 | const charactersAfterBrace = codeAfterBrace.substring(
40 | codeAfterBrace.search(/\S/)
41 | );
42 |
43 | const onlyReturn = charactersAfterBrace.startsWith("return");
44 |
45 | newCode = onlyReturn
46 | ? newCode.substring(newCode.indexOf("<") - 1, newCode.lastIndexOf(">") + 1)
47 | : newCode;
48 |
49 | newCode = prettier.format(newCode, {
50 | parser: "babel",
51 | plugins: [require("prettier/parser-babel")],
52 | });
53 |
54 | return newCode;
55 | }
56 |
--------------------------------------------------------------------------------
/pages/preview/packages/autocomplete/ais.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import {
4 | AutoComplete,
5 | AutoCompleteInput,
6 | AutoCompleteItem,
7 | AutoCompleteList,
8 | } from "@choc-ui/chakra-autocomplete";
9 | import { ChevronDownIcon, ChevronRightIcon } from "@chakra-ui/icons";
10 | import { Icon, InputGroup, InputRightElement } from "@chakra-ui/react";
11 |
12 | const Choc = () => {
13 | const options = ["apple", "appoint", "zap", "cap", "japan"];
14 |
15 | return (
16 |
25 |
26 | {({ isOpen }) => (
27 | <>
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | {options.map((option, oid) => (
36 |
42 | {option}
43 |
44 | ))}
45 |
46 | >
47 | )}
48 |
49 |
50 | );
51 | };
52 | export default Choc;
53 |
--------------------------------------------------------------------------------
/components/docs/configuration/provider.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { CodeBlock } from "components/docs/codeblock";
3 | import { Section } from "components/docs";
4 | import { Alert, Stack } from "@chakra-ui/react";
5 | import provider from "!!raw-loader!components/codes/configuration/provider";
6 |
7 | const Provider = () => {
8 | return (
9 |
10 | Setup Provider
11 |
12 |
13 | For Chakra UI to work correctly, you need to setup the{" "}
14 | ChakraProvider at the root of your application.
15 |
16 |
17 | Go to the root of your application and do this:
18 | {provider}
19 |
20 |
21 |
22 |
23 |
24 | For Next.js, you need to set this up in
25 | pages/_app.js or pages/_app.tsx{" "}
26 |
27 |
28 | For Gatsby, install the
29 | @chakra-ui/gatsby-plugin . It does it
30 | automatically for you.{" "}
31 |
32 |
33 | For Create React App, you need to set this up in
34 | index.js or index.tsx{" "}
35 |
36 |
37 |
38 |
39 |
40 |
41 | );
42 | };
43 |
44 | export default Provider;
45 |
--------------------------------------------------------------------------------
/components/component-demo/machine/component-demo.types.ts:
--------------------------------------------------------------------------------
1 | import type { StateMachine as S } from "@zag-js/core";
2 | import type { Context, DirectionProperty } from "@zag-js/types";
3 |
4 | type ElementIds = Partial<{
5 | root: string;
6 | toggleButton: string;
7 | deviceToggle: string;
8 | frame: string;
9 | }>;
10 |
11 | export enum DeviceView {
12 | MOBILE,
13 | TABLET,
14 | DESKTOP,
15 | }
16 |
17 | type PublicContext = DirectionProperty & {
18 | /**
19 | * The ids of the elements in the toggle. Useful for composition.
20 | */
21 | ids?: ElementIds;
22 |
23 | /**
24 | * The initial code for the component.
25 | */
26 | initialCode?: string;
27 |
28 | /**
29 | * Function to call when the toggle is clicked.
30 | */
31 | onChange?: (details: { pressed: boolean }) => void;
32 | };
33 |
34 | export type UserDefinedContext = Partial;
35 |
36 | type ComputedContext = Readonly<{
37 | /**
38 | * @computed
39 | * Whether the code has been modified
40 | */
41 | readonly isDirty: boolean;
42 | }>;
43 |
44 | type PrivateContext = Context<{
45 | deviceView: DeviceView;
46 | /**
47 | * @internal
48 | * The current code in the editor
49 | */
50 | code: string;
51 |
52 | /**
53 | * @internal
54 | * The current code in the editor
55 | */
56 | frameSize: { width: number; height: number };
57 |
58 | frameWrapperSize: { width: number; height: number };
59 | }>;
60 |
61 | export type MachineContext = PublicContext & PrivateContext & ComputedContext;
62 |
63 | export type MachineState = {
64 | value: "unknown" | "code" | "preview";
65 | };
66 |
67 | export type State = S.State;
68 |
69 | export type Send = S.Send;
70 |
--------------------------------------------------------------------------------
/components/layouts/docs/SidebarSection.tsx:
--------------------------------------------------------------------------------
1 | import { ChevronDownIcon, ChevronRightIcon } from "@chakra-ui/icons";
2 | import React, { useEffect } from "react";
3 |
4 | import { Icon, IconButton, useDisclosure, Collapse } from "@chakra-ui/react";
5 | import { MenuLink, CompLink } from "./sidebar-content";
6 |
7 | const SidebarSection = (props: any) => {
8 | const { section } = props;
9 | const subComps = useDisclosure();
10 | useEffect(() => {
11 | section.active ? subComps.onOpen() : subComps.onClose();
12 | }, [section, subComps]);
13 |
14 | return (
15 | <>
16 | 0 && (
22 |
31 | }
32 | ml={2}
33 | onClick={subComps.onToggle}
34 | _focus={{ shadow: "none" }}
35 | />
36 | )
37 | }
38 | >
39 | {section.title}
40 |
41 |
42 | {section.components?.map((component: any, cid: any) => (
43 |
48 | ))}
49 |
50 | >
51 | );
52 | };
53 |
54 | export default SidebarSection;
55 |
--------------------------------------------------------------------------------
/pages/preview/packages/autocomplete/group.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex } from "@chakra-ui/react";
3 | import {
4 | AutoComplete,
5 | AutoCompleteGroup,
6 | AutoCompleteInput,
7 | AutoCompleteItem,
8 | AutoCompleteList,
9 | } from "@choc-ui/chakra-autocomplete";
10 |
11 | const Choc = () => {
12 | const fruits = ["Apple", "Grape", "Pawpaw"];
13 | const countries = ["Korea", "Nigeria", "India"];
14 |
15 | return (
16 |
25 |
26 |
27 |
28 |
29 | {fruits.map((option, oid) => (
30 |
35 | {option}
36 |
37 | ))}
38 |
39 |
40 | {countries.map((option, oid) => (
41 |
46 | {option}
47 |
48 | ))}
49 |
50 |
51 |
52 |
53 | );
54 | };
55 | export default Choc;
56 |
--------------------------------------------------------------------------------
/pages/preview/badges/unt/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { AiOutlineMessage, AiOutlineShoppingCart } from "react-icons/ai";
3 | import { Flex, IconButton, chakra } from "@chakra-ui/react";
4 |
5 | const Choc = () => {
6 | return (
7 |
15 |
21 |
22 |
35 | >
36 | }
37 | />
38 |
39 |
47 |
48 |
61 | >
62 | }
63 | />
64 |
65 | );
66 | };
67 |
68 | export default Choc;
69 |
--------------------------------------------------------------------------------
/components/docs/installation/introduction.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { Section } from "components/docs";
4 |
5 | import {
6 | me,
7 | antd,
8 | chakraui,
9 | pagelayouts,
10 | navbars,
11 | sidebars,
12 | hoc,
13 | gissue,
14 | chrisham,
15 | } from "./variables";
16 | const Introduction = () => {
17 | return (
18 |
19 | Introduction
20 |
21 |
22 | This is developed by the worst designer I've ever known; {me} 🙄. I
23 | used {antd} for a very long time. It had every thing I needed in my
24 | projects.
25 |
26 |
27 | Then I came across {chakraui}. Hard to explain but
28 | {chakraui} felt free and fluid. Looking back at {antd}, it
29 | was stern and serious. - `The Rich but Tough Dad`.
30 |
31 |
32 | After a lot of consideration, I concluded that what mostly held me
33 | back to {antd} was it's depth in ready made components. There were
34 | ready made {pagelayouts} with {navbars}, {sidebars} and all the {hoc}{" "}
35 | I could think of.
36 |
37 |
38 | So I went crying; I created a {gissue} on the {chakraui} Repository.
39 | Then a Wonderful Designer {chrisham} posted code for some components
40 | she had converted into {chakraui} from other libraries. I studied her
41 | code, and tried to understand the conversion. Then I took some time
42 | studying the internals of {chakraui}. The result is Choc UI.
43 |
44 |
45 |
46 | );
47 | };
48 |
49 | export default Introduction;
50 |
--------------------------------------------------------------------------------
/components/docs/installation/variables.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Link as CLink } from "@chakra-ui/react";
3 | import { linkStyle } from "components/docs";
4 | import Link from "next/link";
5 |
6 | export const me = (
7 |
8 | {" "}
9 | Me
10 |
11 | );
12 |
13 | export const antd = (
14 |
15 | {" "}
16 | Ant Design
17 |
18 | );
19 | export const chakraui = (
20 |
21 | {" "}
22 | Chakra UI
23 |
24 | );
25 |
26 | export const gissue = (
27 |
32 | {" "}
33 | Github Issue
34 |
35 | );
36 |
37 | export const chrisham = (
38 |
39 | {" "}
40 | Christine Ham
41 |
42 | );
43 |
44 | export const pagelayouts = (
45 |
46 | {" "}
47 |
48 | Page Layouts
49 | {" "}
50 |
51 | );
52 |
53 | export const navbars = (
54 |
55 | {" "}
56 |
57 | Navbars
58 | {" "}
59 |
60 | );
61 | export const sidebars = (
62 |
63 | {" "}
64 |
65 | Sidebars
66 | {" "}
67 |
68 | );
69 | export const hoc = (
70 |
71 | {" "}
72 |
73 | Molecular Components
74 | {" "}
75 |
76 | );
77 |
--------------------------------------------------------------------------------
/components/doc-search/result-list.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Stack } from "@chakra-ui/react";
3 |
4 | import Result from "./result";
5 | import { Sticky, StickyBoundary, StickyViewport } from "@anubra266/stickyreact";
6 | import type { Dict } from "@chakra-ui/utils";
7 |
8 | const Category = (props: any) => {
9 | const { results, close, category, activeSectionIndex } = props;
10 |
11 | return (
12 | <>
13 |
25 | {category}
26 |
27 |
28 | {results[category].map(
29 | ({ section, name, url, sectionIndex }: Dict, sid: any) => {
30 | return (
31 |
39 | );
40 | }
41 | )}
42 |
43 | >
44 | );
45 | };
46 | function SearchResults(props: any) {
47 | const { results } = props;
48 | return (
49 |
50 | {Object.keys(results).map((category, cid) => {
51 | return (
52 |
53 |
54 |
55 | );
56 | })}
57 |
58 | );
59 | }
60 |
61 | export default SearchResults;
62 |
--------------------------------------------------------------------------------
/pages/preview/pagination/bpi/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { chakra, Flex, Icon } from "@chakra-ui/react";
3 |
4 | import { IoIosArrowBack, IoIosArrowForward } from "react-icons/io";
5 |
6 | const Choc = () => {
7 | const PagButton = (props) => {
8 | const activeStyle = {
9 | bg: "brand.600",
10 | _dark: { bg: "brand.500" },
11 | color: "white",
12 | };
13 | return (
14 |
27 | {props.children}
28 |
29 | );
30 | };
31 | return (
32 |
40 |
41 |
42 |
48 |
49 | 1
50 | 2
51 | 3
52 | 4
53 | 5
54 |
55 |
61 |
62 |
63 |
64 | );
65 | };
66 |
67 | export default Choc;
68 |
--------------------------------------------------------------------------------
/components/doc-search/handleSearch.ts:
--------------------------------------------------------------------------------
1 | import Fuse from "fuse.js";
2 | import { categoriesObj } from "components/utils/route-categories/parse-categories";
3 |
4 | export const handleSearch = (keyword: any) => {
5 | const data = parser();
6 | const options: any = {
7 | includeScore: true,
8 | includeMatches: true,
9 | ignoreLocation: true,
10 | ignoreFieldNorm: true,
11 | threshold: 0.3,
12 | minMatchCharLength: 2,
13 | keys: [{ name: "section" }, { name: "name" }],
14 | };
15 | const myIndex = Fuse.createIndex(options.keys, data);
16 | const fuse = new Fuse(data, options, myIndex);
17 |
18 | const searchRes = fuse.search(keyword);
19 | const result = catGroup(searchRes);
20 | return result;
21 | };
22 |
23 | const catGroup = (res: any) => {
24 | return res.reduce((acc: any, nxt: any) => {
25 | const result = nxt.item;
26 | const value = result.category;
27 | acc[value] = (acc[value] || []).concat(result);
28 | return acc;
29 | }, {});
30 | };
31 |
32 | const parser = () => {
33 | var collection: any[] = [];
34 | Object.keys(categoriesObj).forEach((catKey) => {
35 | const { title: catTitle, prefix, sections } = categoriesObj[catKey];
36 |
37 | Object.keys(sections).forEach((secKey) => {
38 | const { title: secTitle, route, display, components } = sections[secKey];
39 |
40 | const parsedComponents = components?.reduce((comps, comp) => {
41 | const { name, preview } = comp;
42 |
43 | comps.push({
44 | category: catTitle,
45 | section: display || secTitle,
46 | name,
47 | preview,
48 | url: prefix + route + `#${preview}`,
49 | });
50 | return comps;
51 | }, []);
52 | collection = collection.concat(parsedComponents);
53 | });
54 | });
55 |
56 | return collection.filter((collection) => collection);
57 | };
58 |
--------------------------------------------------------------------------------
/pages/preview/heros/kh2/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { chakra, Box, Flex, Button, HStack } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | return (
6 |
7 |
8 |
16 | For Developers
17 |
18 |
26 | Focus on your apps
27 |
28 |
29 | Today every company needs apps to engage their customers and run their
30 | businesses. Step up your ability to build, manage, and deploy great
31 | apps at scale with us.
32 |
33 |
34 |
45 |
54 |
55 |
56 |
57 | );
58 | };
59 |
60 | export default Choc;
61 |
--------------------------------------------------------------------------------
/theme/index.tsx:
--------------------------------------------------------------------------------
1 | import { extendTheme, ThemeConfig, ThemeOverride } from "@chakra-ui/react";
2 | import styles from "./styles";
3 | import { presets } from "./colors";
4 | import Fonts, { fonts } from "./fonts";
5 | import layerStyles from "./foundations/layerStyles";
6 | import { ChakraProvider } from "@chakra-ui/react";
7 | import { ThemeProvider } from "theme/context";
8 | import { useEffect, useMemo, useState } from "react";
9 | import NextNprogress from "nextjs-progressbar";
10 |
11 | const choc = {
12 | bg: "#1A202C",
13 | primary: "#2D3748",
14 | secondary: "#4A5567",
15 | };
16 |
17 | export const config: ThemeConfig = {
18 | useSystemColorMode: false,
19 | initialColorMode: "dark",
20 | };
21 |
22 | const Theme = (props: any) => {
23 | const [brand, setBrand] = useState>(
24 | presets("default")
25 | );
26 |
27 | const overrides: ThemeOverride = {
28 | colors: { brand, choc },
29 | config,
30 | layerStyles,
31 | styles,
32 | fonts,
33 | };
34 | const theme = extendTheme(overrides);
35 |
36 | useEffect(() => {
37 | setBrand(
38 | JSON.parse(window.localStorage.getItem("brand")) || presets("default")
39 | );
40 | }, []);
41 | useEffect(() => {
42 | window.localStorage.setItem("brand", JSON.stringify(brand));
43 | }, [brand]);
44 |
45 | const themeProps = useMemo(
46 | () => ({
47 | brand,
48 | setBrand,
49 | presets,
50 | }),
51 | [brand]
52 | );
53 |
54 | return (
55 |
56 |
57 |
58 |
64 | {props.children}
65 |
66 |
67 | );
68 | };
69 |
70 | export default Theme;
71 |
--------------------------------------------------------------------------------
/pages/preview/badges/bwb/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { AiOutlineMessage, AiOutlineShoppingCart } from "react-icons/ai";
3 | import { Flex, IconButton, chakra } from "@chakra-ui/react";
4 |
5 | const Choc = () => {
6 | return (
7 |
15 |
21 |
22 |
36 | 99
37 |
38 | >
39 | }
40 | />
41 |
42 |
49 |
50 |
64 | 99
65 |
66 | >
67 | }
68 | />
69 |
70 | );
71 | };
72 |
73 | export default Choc;
74 |
--------------------------------------------------------------------------------
/components/sidebar/index.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | IconButton,
3 | chakra,
4 | useBoolean,
5 | useDisclosure,
6 | } from "@chakra-ui/react";
7 | import { IoCloseSharp } from "react-icons/io5";
8 | import { BiExpand } from "react-icons/bi";
9 | import { SidebarContent } from "components/sidebar/sidebar-content";
10 |
11 | export const Sidebar = () => {
12 | const { isOpen, onClose, onOpen } = useDisclosure({ defaultIsOpen: true });
13 | const [hovered, setHovered] = useBoolean();
14 |
15 | return (
16 |
17 | {!isOpen && (
18 | }
21 | size="xs"
22 | opacity={hovered ? 1 : 0}
23 | _hover={{ opacity: 1 }}
24 | onClick={onOpen}
25 | pos="absolute"
26 | rounded="none"
27 | roundedRight="md"
28 | />
29 | )}
30 |
45 | }
48 | size="xs"
49 | pos="absolute"
50 | top="0"
51 | right="0"
52 | opacity="0"
53 | _groupHover={{
54 | opacity: "1",
55 | }}
56 | onClick={onClose}
57 | rounded="none"
58 | roundedBottomLeft="md"
59 | />
60 |
61 |
62 |
63 | );
64 | };
65 |
--------------------------------------------------------------------------------
/pages/preview/pagination/rpg/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { chakra, Flex, Icon } from "@chakra-ui/react";
3 | import { IoIosArrowBack, IoIosArrowForward } from "react-icons/io";
4 |
5 | const Choc = () => {
6 | const PagButton = (props) => {
7 | const activeStyle = {
8 | bg: "brand.600",
9 | _dark: { bg: "brand.500" },
10 | color: "white",
11 | };
12 | return (
13 |
27 | {props.children}
28 |
29 | );
30 | };
31 | return (
32 |
40 |
41 |
42 |
48 |
49 | 1
50 |
51 | 2
52 |
53 | 3
54 | 4
55 | 5
56 |
57 |
63 |
64 |
65 |
66 | );
67 | };
68 |
69 | export default Choc;
70 |
--------------------------------------------------------------------------------
/pages/docs/[category]/[section].tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import PageHead from "components/head";
3 | import { PageHeader, Section } from "components/docs";
4 | import { ComponentDemo } from "components/component-demo";
5 | import DocsLayout from "components/layouts/docs/index";
6 | import { Alert, Stack } from "@chakra-ui/react";
7 |
8 | import ReactHtmlParser from "react-html-parser";
9 |
10 | import { componentsObj } from "categories/parse-categories";
11 | import { AdBox } from "analytics/ads";
12 |
13 | const Element = ({ category, section }) => {
14 | const ComponentObj = componentsObj[category]?.sections[section];
15 | return (
16 |
17 |
18 |
19 | {ComponentObj?.title}
20 |
21 | {ComponentObj?.components.map((comp: any) => (
22 |
23 |
24 |
25 | {comp.alerts && (
26 |
27 |
33 |
34 | {comp.alerts.content.map((al: any, alid: any) => (
35 | {ReactHtmlParser(al)}
36 | ))}
37 |
38 |
39 |
40 | )}
41 |
42 |
43 | ))}
44 |
45 |
46 | );
47 | };
48 |
49 | Element.getInitialProps = async (ctx) => {
50 | return { category: ctx.query.category, section: ctx.query.section };
51 | };
52 |
53 | export default Element;
54 |
--------------------------------------------------------------------------------
/components/logo.tsx:
--------------------------------------------------------------------------------
1 | import { Icon } from "@chakra-ui/react";
2 | import type { IconProps } from "@chakra-ui/react";
3 |
4 | export const Logo = (props: IconProps) => {
5 | return (
6 |
22 |
26 |
30 |
34 |
38 |
39 |
43 |
47 |
48 |
52 |
56 |
60 |
61 |
62 | );
63 | };
64 |
--------------------------------------------------------------------------------
/components/component-demo/machine/component-demo.connect.ts:
--------------------------------------------------------------------------------
1 | import { dataAttr } from "@zag-js/dom-utils";
2 | import type { PropTypes, ReactPropTypes } from "@zag-js/types";
3 | import { normalizeProp } from "@zag-js/types";
4 | import type { ResizableProps } from "re-resizable";
5 | import { dom } from "./component-demo.dom";
6 | import type { DeviceView, Send, State } from "./component-demo.types";
7 |
8 | export function connect(
9 | state: State,
10 | send: Send,
11 | normalize = normalizeProp
12 | ) {
13 | const isCodeMode = state.matches("code");
14 | const isPreviewMode = state.matches("preview");
15 |
16 | const code = state.context.code;
17 | const isDirty = state.context.isDirty;
18 |
19 | const frameSize = state.context.frameSize;
20 |
21 | return {
22 | code,
23 | isCodeMode,
24 | isDirty,
25 | isPreviewMode,
26 | resetCode() {
27 | send("RESET_CODE");
28 | },
29 | toggleButtonProps: normalize.button({
30 | id: dom.getToggleButtonId(state.context),
31 | type: "button",
32 | onClick() {
33 | send({ type: "TOGGLE" });
34 | },
35 | }),
36 | getDeviceToggleProps: (deviceView: DeviceView) =>
37 | normalize.button({
38 | id: dom.getDeviceToggleId(state.context),
39 | type: "button",
40 | onClick() {
41 | send({ type: "UPDATE_DEVICE_VIEW", deviceView });
42 | },
43 | "data-active": dataAttr(state.context.deviceView === deviceView),
44 | }),
45 | editorProps: {
46 | onChange(code: string) {
47 | send({ type: "UPDATE_CODE", code });
48 | },
49 | },
50 | frameProps: {
51 | id: dom.getFrameId(state.context),
52 | resizableProps: {
53 | ...(frameSize.width === 0 ? {} : { size: frameSize }),
54 | onResizeStop: (e, direction, ref, d) => {
55 | send({ type: "UPDATE_FRAME_SIZE", direction, d });
56 | },
57 | } as ResizableProps,
58 | },
59 | };
60 | }
61 |
--------------------------------------------------------------------------------
/components/layouts/docs/sidebar.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, useDisclosure, IconButton } from "@chakra-ui/react";
3 | import SidebarContent from "./sidebar-content";
4 | import { MdMenu, MdClose } from "react-icons/md";
5 |
6 | const Sidebar = () => {
7 | const { isOpen, onClose, onOpen } = useDisclosure({ defaultIsOpen: true });
8 | const SidebarIcon = isOpen ? MdClose : MdMenu;
9 |
10 | return (
11 |
12 |
49 | {!isOpen && (
50 | }
63 | />
64 | )}
65 |
66 | );
67 | };
68 |
69 | export default Sidebar;
70 |
--------------------------------------------------------------------------------
/components/credits.tsx:
--------------------------------------------------------------------------------
1 | import { Text, Icon, Link, VStack, HStack } from "@chakra-ui/react";
2 |
3 | import { FaGithub, FaTwitter, FaLinkedin, FaEnvelope } from "react-icons/fa";
4 | export default function Credits() {
5 | return (
6 |
7 |
16 | Proudly developed in{" "}
17 |
18 |
19 |
20 | {" "}
21 | by{" "}
22 |
28 | Anuoluwapo Abraham
29 |
30 |
31 |
32 |
38 |
39 |
40 |
46 |
47 |
48 |
54 |
55 |
56 |
62 |
63 |
64 |
65 |
66 | );
67 | }
68 |
--------------------------------------------------------------------------------
/components/component-demo/codesandbox/html.ts:
--------------------------------------------------------------------------------
1 | const section = (path) => path.split("/")[0];
2 |
3 | export const html = (path) => {
4 | const name = section(path);
5 | const htmlContent = `
6 |
7 |
8 |
9 |
10 |
11 |
12 |
16 |
17 |
18 |
27 | Choc UI - ${name} demo
28 |
29 |
30 |
31 |
34 |
35 |
45 |
46 |
47 | `;
48 | return htmlContent;
49 | };
50 |
--------------------------------------------------------------------------------
/components/sidebar/sidebar-section.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Collapse,
3 | Flex,
4 | IconButton,
5 | chakra,
6 | useDisclosure,
7 | } from "@chakra-ui/react";
8 | import NavLink from "components/nav-link";
9 | import { HiChevronRight } from "react-icons/hi";
10 |
11 | export type SidebarSectionProps = { section: any };
12 |
13 | export const SidebarSection = (props: SidebarSectionProps) => {
14 | const { section } = props;
15 | const subComps = useDisclosure();
16 |
17 | return (
18 | <>
19 |
20 |
21 | {({ isActive }) => (
22 |
33 | {section.title}
34 |
35 | )}
36 |
37 | {!!section.components.length && (
38 | }
40 | aria-label="Toggle Section"
41 | size="xs"
42 | isRound
43 | ml="auto"
44 | mr="2"
45 | variant="ghost"
46 | onClick={subComps.onToggle}
47 | />
48 | )}
49 |
50 |
51 | {section.components?.map((component: any, cid: any) => (
52 |
53 |
61 | {component.name}
62 |
63 |
64 | ))}
65 |
66 | >
67 | );
68 | };
69 |
--------------------------------------------------------------------------------
/pages/preview/cards/mtes/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Image, Link, chakra } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | return (
6 |
14 |
24 |
25 |
37 |
38 |
39 |
46 | Design Tools
47 |
48 |
49 |
50 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae dolores
51 | deserunt ea doloremque natus error, rerum quas odio quaerat nam ex
52 | commodi hic, suscipit in a veritatis pariatur minus consequuntur!
53 |
54 |
55 |
56 |
57 | John Doe
58 |
59 |
60 |
61 |
62 | );
63 | };
64 |
65 | export default Choc;
66 |
--------------------------------------------------------------------------------
/components/landing/component-sample.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, chakra, useColorModeValue } from "@chakra-ui/react";
3 | import { ComponentDemo } from "components/component-demo";
4 |
5 | export const ComponentSample = () => {
6 | const card = randomCard();
7 | return (
8 |
15 |
16 |
17 |
18 |
32 | Faster design and delivery.
33 |
34 |
41 | Spend less time building blocks and more time building a great
42 | experience for your customers.
43 |
44 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | );
57 | };
58 |
59 | const randomCard = () => {
60 | const { elements } = require("categories/elements.json");
61 | const { components } = elements.sections.cards;
62 | return components[Math.floor(Math.random() * components.length)];
63 | };
64 |
--------------------------------------------------------------------------------
/pages/preview/gicons/dum/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { HStack, Icon } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | const gradient = `url("data:image/svg+xml,#grad") `;
6 | return (
7 |
16 |
17 |
18 | {" "}
19 |
20 |
25 | {" "}
26 |
27 |
32 |
33 |
34 | );
35 | };
36 |
37 | export default Choc;
38 |
--------------------------------------------------------------------------------
/components/landing/sponsors.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { FiExternalLink } from "react-icons/fi";
3 | import {
4 | chakra,
5 | Box,
6 | Link,
7 | Text,
8 | VStack,
9 | Icon,
10 | useColorModeValue,
11 | } from "@chakra-ui/react";
12 |
13 | const Sponsors = () => {
14 | return (
15 |
16 |
17 |
22 | Our Sponsors
23 |
24 |
25 | Your financial contributions help ensure Choc UI continues to be
26 | developed and maintained! Sponsor Choc UI with any price of your
27 | choice.
28 |
29 |
30 |
31 |
50 | Support Choc UI
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
65 |
66 |
67 | );
68 | };
69 |
70 | export default Sponsors;
71 |
--------------------------------------------------------------------------------
/analytics/ads.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { useRouter } from "next/router";
4 | import { Box } from "@chakra-ui/react";
5 | import Carbon from "react-carbon";
6 |
7 | export const AdBox = () => {
8 | const router = useRouter();
9 | const { category } = router.query;
10 | return (
11 |
72 |
78 |
79 | );
80 | };
81 |
--------------------------------------------------------------------------------
/categories/parse-categories.ts:
--------------------------------------------------------------------------------
1 | import { useRouter } from "next/router";
2 |
3 | import GStartObj from "categories/getting-started.json";
4 | import ElementObj from "categories/elements.json";
5 | import PSectionsObj from "categories/page-sections.json";
6 | import NavigationObj from "categories/navigation.json";
7 | import ListsObj from "categories/lists.json";
8 | import FormsObj from "categories/forms.json";
9 | import PackagesObj from "categories/packages.json";
10 | import AppShells from "categories/application-shells.json";
11 |
12 | export const componentsObj = {
13 | ...ElementObj,
14 | ...PSectionsObj,
15 | ...NavigationObj,
16 | ...ListsObj,
17 | ...FormsObj,
18 | ...AppShells,
19 | };
20 | export const categoriesObj = {
21 | ...GStartObj,
22 | ...componentsObj,
23 | ...PackagesObj,
24 | };
25 |
26 | export const useRoutes = () => {
27 | const router = useRouter();
28 | const { category, section } = router.query;
29 |
30 | return Object.keys(categoriesObj).reduce((acc, nxt) => {
31 | const { title: catTitle, prefix, sections } = categoriesObj[nxt];
32 |
33 | const routeCategory: any = { title: catTitle, prefix };
34 | const fullSections = sections;
35 | const routeSections = Object.keys(fullSections).reduce((racc, rnxt) => {
36 | const fullSection = fullSections[rnxt];
37 | const { title: secTitle, route, ...secProps } = fullSection;
38 | const url = prefix + route;
39 |
40 | const components = !["getting-started"].includes(nxt)
41 | ? secProps.components?.reduce((comps: any, comp: any) => {
42 | comps.push({
43 | ...comp,
44 | url: url + `#${comp.preview}`,
45 | });
46 | return comps;
47 | }, [])
48 | : [];
49 | const active =
50 | router.pathname === url ||
51 | (category === prefix.replace(/docs|[/]/g, "") && section === route);
52 | racc.push({
53 | ...secProps,
54 | title: secTitle,
55 | components,
56 | url,
57 | active,
58 | route,
59 | });
60 | return racc;
61 | }, []);
62 | routeCategory.sections = routeSections;
63 | acc.push(routeCategory);
64 | return acc;
65 | }, []);
66 | };
67 |
--------------------------------------------------------------------------------
/components/utils/route-categories/parse-categories.ts:
--------------------------------------------------------------------------------
1 | import { useRouter } from "next/router";
2 |
3 | import GStartObj from "categories/getting-started.json";
4 | import ElementObj from "categories/elements.json";
5 | import PSectionsObj from "categories/page-sections.json";
6 | import NavigationObj from "categories/navigation.json";
7 | import ListsObj from "categories/lists.json";
8 | import FormsObj from "categories/forms.json";
9 | import PackagesObj from "categories/packages.json";
10 | import AppShells from "categories/application-shells.json";
11 |
12 | export const componentsObj = {
13 | ...ElementObj,
14 | ...PSectionsObj,
15 | ...NavigationObj,
16 | ...ListsObj,
17 | ...FormsObj,
18 | ...AppShells,
19 | };
20 | export const categoriesObj = {
21 | ...GStartObj,
22 | ...componentsObj,
23 | ...PackagesObj,
24 | };
25 |
26 | export const useRoutes = () => {
27 | const router = useRouter();
28 | const { category, section } = router.query;
29 |
30 | return Object.keys(categoriesObj).reduce((acc, nxt) => {
31 | const { title: catTitle, prefix, sections } = categoriesObj[nxt];
32 |
33 | const routeCategory: any = { title: catTitle, prefix };
34 | const fullSections = sections;
35 | const routeSections = Object.keys(fullSections).reduce((racc, rnxt) => {
36 | const fullSection = fullSections[rnxt];
37 | const { title: secTitle, route, ...secProps } = fullSection;
38 | const url = prefix + route;
39 |
40 | const components = !["getting-started"].includes(nxt)
41 | ? secProps.components?.reduce((comps: any, comp: any) => {
42 | comps.push({
43 | ...comp,
44 | url: url + `#${comp.preview}`,
45 | });
46 | return comps;
47 | }, [])
48 | : [];
49 | const active =
50 | router.pathname === url ||
51 | (category === prefix.replace(/docs|[/]/g, "") && section === route);
52 | racc.push({
53 | ...secProps,
54 | title: secTitle,
55 | components,
56 | url,
57 | active,
58 | route,
59 | });
60 | return racc;
61 | }, []);
62 | routeCategory.sections = routeSections;
63 | acc.push(routeCategory);
64 | return acc;
65 | }, []);
66 | };
67 |
--------------------------------------------------------------------------------
/pages/preview/badges/bwi/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex, Icon, chakra } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | return (
6 |
14 |
15 |
24 |
25 |
26 |
40 | 99
41 |
42 |
43 |
44 |
45 |
54 |
59 |
60 |
74 | 99
75 |
76 |
77 |
78 | );
79 | };
80 |
81 | export default Choc;
82 |
--------------------------------------------------------------------------------
/pages/preview/cards/mpro/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Image, chakra } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | return (
6 |
14 |
22 |
23 |
30 | NIKE AIR
31 |
32 |
38 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Modi quos
39 | quidem sequi illum facere recusandae voluptatibus
40 |
41 |
42 |
43 |
51 |
52 |
60 |
61 | $129
62 |
63 |
79 | Add to cart
80 |
81 |
82 |
83 |
84 | );
85 | };
86 |
87 | export default Choc;
88 |
--------------------------------------------------------------------------------
/pages/preview/cards/pwi/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Link, chakra } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | return (
6 |
14 |
23 |
24 |
33 |
34 |
35 |
36 |
42 | Build Your New{" "}
43 |
44 | Idea
45 |
46 |
47 |
48 | Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quidem
49 | modi reprehenderit vitae exercitationem aliquid dolores ullam
50 | temporibus enim expedita aperiam mollitia iure consectetur dicta
51 | tenetur, porro consequuntur saepe accusantium consequatur.
52 |
53 |
54 |
55 |
64 | Start Now
65 |
66 |
67 |
68 |
69 |
70 | );
71 | };
72 |
73 | export default Choc;
74 |
--------------------------------------------------------------------------------
/styles/Home.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | min-height: 100vh;
3 | padding: 0 0.5rem;
4 | display: flex;
5 | flex-direction: column;
6 | justify-content: center;
7 | align-items: center;
8 | }
9 |
10 | .main {
11 | padding: 5rem 0;
12 | flex: 1;
13 | display: flex;
14 | flex-direction: column;
15 | justify-content: center;
16 | align-items: center;
17 | }
18 |
19 | .footer {
20 | width: 100%;
21 | height: 100px;
22 | border-top: 1px solid #eaeaea;
23 | display: flex;
24 | justify-content: center;
25 | align-items: center;
26 | }
27 |
28 | .footer img {
29 | margin-left: 0.5rem;
30 | }
31 |
32 | .footer a {
33 | display: flex;
34 | justify-content: center;
35 | align-items: center;
36 | }
37 |
38 | .title a {
39 | color: #0070f3;
40 | text-decoration: none;
41 | }
42 |
43 | .title a:hover,
44 | .title a:focus,
45 | .title a:active {
46 | text-decoration: underline;
47 | }
48 |
49 | .title {
50 | margin: 0;
51 | line-height: 1.15;
52 | font-size: 4rem;
53 | }
54 |
55 | .title,
56 | .description {
57 | text-align: center;
58 | }
59 |
60 | .description {
61 | line-height: 1.5;
62 | font-size: 1.5rem;
63 | }
64 |
65 | .code {
66 | background: #fafafa;
67 | border-radius: 5px;
68 | padding: 0.75rem;
69 | font-size: 1.1rem;
70 | font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
71 | Bitstream Vera Sans Mono, Courier New, monospace;
72 | }
73 |
74 | .grid {
75 | display: flex;
76 | align-items: center;
77 | justify-content: center;
78 | flex-wrap: wrap;
79 | max-width: 800px;
80 | margin-top: 3rem;
81 | }
82 |
83 | .card {
84 | margin: 1rem;
85 | flex-basis: 45%;
86 | padding: 1.5rem;
87 | text-align: left;
88 | color: inherit;
89 | text-decoration: none;
90 | border: 1px solid #eaeaea;
91 | border-radius: 10px;
92 | transition: color 0.15s ease, border-color 0.15s ease;
93 | }
94 |
95 | .card:hover,
96 | .card:focus,
97 | .card:active {
98 | color: #0070f3;
99 | border-color: #0070f3;
100 | }
101 |
102 | .card h3 {
103 | margin: 0 0 1rem 0;
104 | font-size: 1.5rem;
105 | }
106 |
107 | .card p {
108 | margin: 0;
109 | font-size: 1.25rem;
110 | line-height: 1.5;
111 | }
112 |
113 | .logo {
114 | height: 1em;
115 | }
116 |
117 | @media (max-width: 600px) {
118 | .grid {
119 | width: 100%;
120 | flex-direction: column;
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/pages/preview/gicons/cm/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { HStack, Icon, chakra, useToken } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | const [red500, brand600] = useToken("colors", ["red.500", "brand.600"]);
6 | const gradient = (
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | );
15 | return (
16 |
25 | {gradient}
26 |
32 | {" "}
37 |
38 |
44 |
49 |
50 |
56 |
61 |
62 |
63 | );
64 | };
65 |
66 | export default Choc;
67 |
--------------------------------------------------------------------------------
/pages/preview/extrael/snackbar/index.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | Button,
4 | HStack,
5 | Text,
6 | useColorModeValue,
7 | useToast,
8 | VStack,
9 | } from "@chakra-ui/react";
10 | import React from "react";
11 | const SnackBarExample = () => {
12 | const scheme = "brand";
13 | const step1 = useColorModeValue("600", "300");
14 | const step2 = useColorModeValue("500", "400");
15 | const step3 = useColorModeValue("300", "500");
16 | const toast = useToast();
17 | const toastIdRef = React.useRef();
18 | const closeSnackBar = () => toast.close(toastIdRef.current);
19 | const renderToast = () => {
20 | return (
21 |
22 |
23 | Custom Snackbar using toast
24 |
36 |
37 |
38 | );
39 | };
40 |
41 | const showToast = () => {
42 | toastIdRef.current = toast({
43 | position: "bottom",
44 | render: () => renderToast(),
45 | containerStyle: {
46 | width: "100%",
47 | minWidth: "100%",
48 | margin: "10px 10px",
49 | },
50 | });
51 | };
52 | return (
53 |
59 | Click the button below
60 |
84 |
85 | );
86 | };
87 |
88 | export default SnackBarExample;
89 |
--------------------------------------------------------------------------------
/components/navbar/index.tsx:
--------------------------------------------------------------------------------
1 | import { ButtonGroup, Flex, Heading, chakra } from "@chakra-ui/react";
2 | import Link from "next/link";
3 | import { useViewportScroll } from "framer-motion";
4 | import React from "react";
5 | import { FaDiscord, FaGithub, FaTwitter } from "react-icons/fa";
6 | import { DocSearch } from "components/doc-search";
7 |
8 | import { Logo } from "components/logo";
9 | import { ActionButton } from "components/navbar/action-button";
10 | import { ColorModeToggle } from "components/navbar/color-mode-toggle";
11 | import SponsorButton from "components/navbar/sponsor-button";
12 | import { CONSTANTS } from "components/utils/constants";
13 |
14 | function Navbar() {
15 | const ref = React.useRef(null);
16 | const [y, setY] = React.useState(0);
17 | const height = ref.current ? ref.current.getBoundingClientRect() : 0;
18 | const { scrollY } = useViewportScroll();
19 | React.useEffect(() => {
20 | return scrollY.onChange(() => setY(scrollY.get()));
21 | }, [scrollY]);
22 |
23 | return (
24 | height ? "md" : undefined}
33 | sx={{
34 | "& > div": {
35 | flex: 1,
36 | },
37 | }}
38 | >
39 |
40 |
41 |
42 |
43 |
44 | Choc UI
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | }
61 | />
62 | }
67 | />
68 | }
73 | />
74 |
75 |
76 |
77 |
78 |
79 | );
80 | }
81 |
82 | export default Navbar;
83 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "choc",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "PORT=4000 next dev",
7 | "build": "next build",
8 | "lint": "next lint",
9 | "lintFix": "eslint --fix",
10 | "start": "next start",
11 | "postinstall": "patch-package"
12 | },
13 | "dependencies": {
14 | "@anubra266/stickyreact": "^1.0.1",
15 | "@babel/standalone": "^7.18.4",
16 | "@babel/traverse": "^7.25.6",
17 | "@chakra-ui/icons": "^1.1.7",
18 | "@chakra-ui/react": "^2.2.1",
19 | "@chakra-ui/utils": "^2.0.14",
20 | "@choc-ui/chakra-autocomplete": "^4.22.0",
21 | "@choc-ui/logo": "^1.0.0",
22 | "@choc-ui/paginator": "^3.4.0",
23 | "@ctrl/tinycolor": "^4.1.0",
24 | "@emotion/cache": "^11.13.1",
25 | "@emotion/react": "^11.9.0",
26 | "@emotion/server": "^11.4.0",
27 | "@emotion/styled": "^11.8.1",
28 | "@emotion/weak-memoize": "^0.4.0",
29 | "@loadable/component": "^5.15.2",
30 | "@splitbee/web": "^0.2.4",
31 | "@visx/hierarchy": "^2.1.2",
32 | "@visx/responsive": "^2.10.0",
33 | "@zag-js/core": "^0.1.6",
34 | "@zag-js/dom-utils": "^0.1.3",
35 | "@zag-js/react": "^0.1.8",
36 | "@zag-js/types": "^0.1.2",
37 | "codesandbox": "^2.2.3",
38 | "framer-motion": "^6.3.11",
39 | "fuse.js": "^6.6.2",
40 | "next": "^13.1.0",
41 | "next-pwa": "^5.5.2",
42 | "nextjs-progressbar": "^0.0.14",
43 | "patch-package": "^6.4.7",
44 | "pill-pity": "^0.2.3",
45 | "raw-loader": "^4.0.2",
46 | "re-resizable": "^6.9.2",
47 | "react": "^18.2.0",
48 | "react-carbon": "^1.0.7",
49 | "react-dom": "^18.2.0",
50 | "react-dom-confetti": "^0.2.0",
51 | "react-html-parser": "^2.0.2",
52 | "react-icons": "^4.4.0",
53 | "react-live": "^2.4.0",
54 | "react-remove-scroll": "^2.4.1",
55 | "react-scroll": "^1.8.7",
56 | "transform-imports": "^2.1.1"
57 | },
58 | "devDependencies": {
59 | "@types/node": "^17.0.38",
60 | "@types/react": "^18.0.5",
61 | "@types/react-dom": "^18.0.5",
62 | "@types/react-scroll": "^1.8.3",
63 | "all-contributors-cli": "^6.19.0",
64 | "eslint": "8.14.0",
65 | "eslint-config-next": "^13.1.0",
66 | "eslint-config-prettier": "^8.5.0",
67 | "eslint-plugin-prettier": "^4.0.0",
68 | "eslint-plugin-unused-imports": "^2.0.0",
69 | "husky": "^8.0.1",
70 | "prettier": "^2.6.2",
71 | "pretty-quick": "^3.1.0",
72 | "typescript": "^4.9.5"
73 | },
74 | "husky": {
75 | "hooks": {
76 | "pre-commit": "pretty-quick --staged --pattern './**/*.{js,jsx,ts,tsx,json,css,scss,md,html}'"
77 | }
78 | },
79 | "engines": {
80 | "node": "18.x"
81 | }
82 | }
--------------------------------------------------------------------------------
/pages/docs/packages/pill-pity.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import PageHead from "components/head";
3 | import { PageHeader, Section } from "components/docs";
4 | import { ComponentDemo } from "components/component-demo";
5 | import DocsLayout from "components/layouts/docs/index";
6 | import { CodeBlock } from "components/docs/codeblock";
7 | import PillPity from "pill-pity";
8 | import { Alert, Stack } from "@chakra-ui/react";
9 | import { AdBox } from "analytics/ads";
10 |
11 | const PillPityPackage = () => {
12 | return (
13 |
14 |
18 |
19 |
24 | Pill-Pity
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | Our Code Editor is editable, and the preview is live.
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | Installation
41 |
42 |
43 |
44 |
45 | {`npm i pill-pity`}
46 |
47 | {`yarn add pill-pity`}
48 |
49 |
50 |
51 |
52 |
53 |
54 | Import
55 |
56 |
57 |
58 |
59 | {`import PillPity from 'pill-pity';`}
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
74 |
75 |
76 |
77 |
78 | );
79 | };
80 |
81 | export default PillPityPackage;
82 |
--------------------------------------------------------------------------------
/pages/preview/cards/cpwe/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Badge, Box, Flex, Image, Text } from "@chakra-ui/react";
3 | import { StarIcon } from "@chakra-ui/icons";
4 |
5 | const Choc = () => {
6 | const property = {
7 | imageUrl: "https://bit.ly/2Z4KKcF",
8 | imageAlt: "Rear view of modern home with pool",
9 | beds: 3,
10 | baths: 2,
11 | title: "Modern home in city center in the heart of historic Los Angeles",
12 | formattedPrice: "$1,900.00",
13 | reviewCount: 34,
14 | rating: 4,
15 | };
16 |
17 | return (
18 |
26 |
34 |
39 |
40 |
41 |
42 |
43 | New
44 |
45 |
53 | {property.beds} beds • {property.baths} baths
54 |
55 |
56 |
57 |
65 | {property.title}
66 |
67 |
68 |
69 | {property.formattedPrice}
70 |
71 | / wk
72 |
73 |
74 |
75 |
76 | {Array(5)
77 | .fill("")
78 | .map((_, i) => (
79 |
83 | ))}
84 |
85 | {property.reviewCount} reviews
86 |
87 |
88 |
89 |
90 |
91 | );
92 | };
93 |
94 | export default Choc;
95 |
--------------------------------------------------------------------------------
/components/head/static.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Head from "next/head";
3 | import { useRouter } from "next/router";
4 |
5 | const Static = () => {
6 | const router = useRouter();
7 | const isPreview = router.pathname.includes("preview");
8 | return (
9 |
10 | {isPreview && (
11 | <>
12 | Component Preview | Choc UI
13 |
14 |
15 |
16 |
20 |
21 |
22 |
26 |
27 | >
28 | )}
29 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
58 |
64 |
70 |
71 | );
72 | };
73 |
74 | export default Static;
75 |
--------------------------------------------------------------------------------
/pages/preview/cta/was/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { chakra, Box, Stack, Image, Flex } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | return (
6 |
13 |
18 |
26 | Ready to dive in?
27 |
32 | Start your free trial today.
33 |
34 |
35 |
41 | Hellonext is a feature voting software where you can allow your users
42 | to vote on features, publish roadmap, and complete your customer
43 | feedback loop.
44 |
45 |
50 |
51 |
69 | Sign up for free
70 |
71 |
72 |
73 |
74 |
75 |
82 |
83 |
84 | );
85 | };
86 |
87 | export default Choc;
88 |
--------------------------------------------------------------------------------
/pages/preview/cards/pwe/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, HStack, chakra } from "@chakra-ui/react";
3 | import { StarIcon } from "@chakra-ui/icons";
4 |
5 | const Choc = () => {
6 | return (
7 |
15 |
24 |
32 |
33 |
34 |
40 | Backpack
41 |
42 |
43 |
49 | Lorem ipsum dolor sit amet consectetur adipisicing elit In odit
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | $220
63 |
64 |
80 | Add to cart
81 |
82 |
83 |
84 |
85 |
86 | );
87 | };
88 |
89 | export default Choc;
90 |
--------------------------------------------------------------------------------
/pages/preview/tables/mrtm/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {
3 | Button,
4 | Flex,
5 | SimpleGrid,
6 | Stack,
7 | chakra,
8 | useColorModeValue,
9 | } from "@chakra-ui/react";
10 |
11 | const Choc = () => {
12 | const data = [
13 | { name: "Segun Adebayo", email: "sage@chakra.com" },
14 | { name: "Josef Nikolas", email: "Josef@mail.com" },
15 | { name: "Lazar Nikolov", email: "Lazar@mail.com" },
16 | { name: "Abraham", email: "abraham@anu.com" },
17 | ];
18 | const dataColor = useColorModeValue("white", "gray.800");
19 | const bg = useColorModeValue("white", "gray.800");
20 | const bg2 = useColorModeValue("gray.100", "gray.700");
21 |
22 | return (
23 |
31 |
37 | {data.map((person, pid) => {
38 | return (
39 |
44 |
56 | Name
57 | Email
58 | Actions
59 |
60 |
68 | {person.name}
69 |
74 | {person.email}
75 |
76 |
77 |
80 |
81 |
82 |
83 | );
84 | })}
85 |
86 |
87 | );
88 | };
89 |
90 | export default Choc;
91 |
--------------------------------------------------------------------------------
/components/landing/landing-hero.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Button,
3 | Flex,
4 | Heading,
5 | Icon,
6 | Stack,
7 | Text,
8 | chakra,
9 | } from "@chakra-ui/react";
10 | import Link from "next/link";
11 | import { FaGithub } from "react-icons/fa";
12 | import { CONSTANTS } from "components/utils/constants";
13 |
14 | export const LandingHero = () => {
15 | return (
16 |
23 |
34 | Prebuilt{" "}
35 |
42 | Chakra UI Components
43 | {" "}
44 | for faster development
45 |
46 |
47 |
56 | Choc UI is a set of accessible and reusable components that are commonly
57 | used in web applications. Provides premade responsive and color mode
58 | flexible components to help you build faster than ever.
59 |
60 |
61 |
78 |
79 |
82 |
83 |
94 |
95 |
96 | );
97 | };
98 |
--------------------------------------------------------------------------------
/components/doc-search/result.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useRef } from "react";
2 | import { Box, Flex, Icon, Spacer, Stack } from "@chakra-ui/react";
3 | import { BsArrowReturnLeft } from "react-icons/bs";
4 | import Link from "next/link";
5 |
6 | type ResultProps = {
7 | active: boolean;
8 | url: string;
9 | onClick: () => void;
10 | section: string;
11 | component: string;
12 | };
13 |
14 | const Result = (props: ResultProps) => {
15 | const hoverColor = "gray.100";
16 | const resultsTextColor = props.active
17 | ? hoverColor
18 | : "inactiveResultsTextColor";
19 | const resultsIconColor = props.active
20 | ? hoverColor
21 | : "inactiveResultsIconColor";
22 |
23 | const ref = useRef<(HTMLAnchorElement & HTMLDivElement) | null>(null);
24 |
25 | useEffect(() => {
26 | if (props.active) {
27 | ref.current?.scrollIntoView({ behavior: "smooth", block: "center" });
28 | }
29 | }, [props.active]);
30 |
31 | const ACTIVE_BACKGROUND = "brand.500";
32 |
33 | return (
34 |
35 |
51 |
57 |
64 |
65 |
66 |
72 | {props.section}
73 |
74 |
80 | {props.component}
81 |
82 |
83 |
84 |
91 |
92 |
93 | );
94 | };
95 |
96 | export default Result;
97 |
--------------------------------------------------------------------------------
/pages/preview/carousels/smc/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState } from "react";
2 | import { Box, Flex, Image, Text } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | const slides = [
6 | {
7 | img: "https://images.pexels.com/photos/2599537/pexels-photo-2599537.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",
8 | },
9 | {
10 | img: "https://images.pexels.com/photos/2714581/pexels-photo-2714581.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",
11 | },
12 | {
13 | img: "https://images.pexels.com/photos/2878019/pexels-photo-2878019.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260",
14 | },
15 | {
16 | img: "https://images.pexels.com/photos/1142950/pexels-photo-1142950.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",
17 | },
18 | {
19 | img: "https://images.pexels.com/photos/3124111/pexels-photo-3124111.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",
20 | },
21 | ];
22 | const [currentSlide, setCurrentSlide] = useState(0);
23 |
24 | const slidesCount = slides.length;
25 |
26 | const carouselStyle = {
27 | transition: "all .5s",
28 | ml: `-${currentSlide * 100}%`,
29 | };
30 |
31 | const SLIDES_INTERVAL_TIME = 3000;
32 | const ANIMATION_DIRECTION = "right";
33 |
34 | useEffect(() => {
35 | const prevSlide = () => {
36 | setCurrentSlide((s) => (s === 0 ? slidesCount - 1 : s - 1));
37 | };
38 |
39 | const nextSlide = () => {
40 | setCurrentSlide((s) => (s === slidesCount - 1 ? 0 : s + 1));
41 | };
42 |
43 | const automatedSlide = setInterval(() => {
44 | ANIMATION_DIRECTION.toLowerCase() === "left" ? prevSlide() : nextSlide();
45 | }, SLIDES_INTERVAL_TIME);
46 | return () => clearInterval(automatedSlide);
47 | }, [slidesCount]);
48 |
49 | return (
50 |
58 |
59 |
60 | {slides.map((slide, sid) => (
61 |
62 |
70 | {sid + 1} / {slidesCount}
71 |
72 |
78 |
79 | ))}
80 |
81 |
82 |
83 | );
84 | };
85 | export default Choc;
86 |
--------------------------------------------------------------------------------
/components/doc-search/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import type { FlexProps, UseDisclosureReturn } from "@chakra-ui/react";
3 | import {
4 | Flex,
5 | HStack,
6 | Kbd,
7 | Text,
8 | VisuallyHidden,
9 | chakra,
10 | useEventListener,
11 | } from "@chakra-ui/react";
12 | import { SearchIcon } from "@chakra-ui/icons";
13 | import SearchModal from "./modal";
14 |
15 | const ACTION_KEY_DEFAULT = ["Ctrl", "Control"];
16 | const ACTION_KEY_APPLE = ["⌘", "Command"];
17 |
18 | export function DocSearch(props: FlexProps) {
19 | const searchModal = React.useRef(null);
20 | const [actionKey, setActionKey] = React.useState(ACTION_KEY_APPLE);
21 | React.useEffect(() => {
22 | if (typeof navigator === "undefined") return;
23 | const isMac = /(Mac|iPhone|iPod|iPad)/i.test(navigator.userAgent);
24 | if (!isMac) {
25 | setActionKey(ACTION_KEY_DEFAULT);
26 | }
27 | }, []);
28 | useEventListener("keydown", (event) => {
29 | const isMac = /(Mac|iPhone|iPod|iPad)/i.test(navigator?.userAgent);
30 | const hotkey = isMac ? "metaKey" : "ctrlKey";
31 | if (event.key.toLowerCase() === "k" && event[hotkey]) {
32 | event.preventDefault();
33 | openSearchModal();
34 | }
35 | });
36 |
37 | const openSearchModal = () => {
38 | searchModal.current?.onOpen();
39 | };
40 | return (
41 |
42 |
43 |
64 |
65 |
66 |
67 | Search the collection...
68 |
69 |
70 | Press
71 |
72 |
77 | {actionKey[0]}
78 |
79 |
80 | and
81 |
82 | K
83 |
84 | to search
85 |
86 |
87 |
88 |
89 | );
90 | }
91 |
--------------------------------------------------------------------------------
/pages/preview/cards/msp/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { chakra, Box, Flex } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | return (
6 |
14 |
21 |
34 |
35 |
44 |
53 | Nike Revolt
54 |
55 |
56 |
64 |
69 | $129
70 |
71 |
90 | Add to cart
91 |
92 |
93 |
94 |
95 |
96 | );
97 | };
98 |
99 | export default Choc;
100 |
--------------------------------------------------------------------------------
/pages/preview/cta/swi/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { chakra, Box, Flex, SimpleGrid, Icon, Image } from "@chakra-ui/react";
3 |
4 | import { FiExternalLink } from "react-icons/fi";
5 |
6 | const Choc = () => {
7 | return (
8 |
9 |
10 |
20 |
21 |
29 |
36 | Award winning support
37 |
38 |
47 | We're here to help
48 |
49 |
57 | Get the #1 Business Messenger and start delivering personalized
58 | experiences at every stage of the customer journey.
59 |
60 |
61 |
80 | Visit the Help Centre
81 |
82 |
83 |
84 |
85 |
86 | );
87 | };
88 |
89 | export default Choc;
90 |
--------------------------------------------------------------------------------
/pages/preview/cta/sj/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { chakra, Box, Flex, Stack, Link } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | return (
6 |
14 |
15 |
25 |
33 | Ready to dive in?
34 |
39 | Start your free trial today.
40 |
41 |
42 |
47 |
66 | Get started
67 |
68 |
85 | Learn More
86 |
87 |
88 |
89 |
90 |
91 | );
92 | };
93 | export default Choc;
94 |
--------------------------------------------------------------------------------
/pages/preview/packages/pill-pity/plg.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex, SimpleGrid, useColorModeValue } from "@chakra-ui/react";
3 | import PillPity from "pill-pity";
4 |
5 | const Choc = () => {
6 | const patterns = [
7 | "jigsaw",
8 | "overcast",
9 | "formal-invitation",
10 | "topography",
11 | "texture",
12 | "jupiter",
13 | "architect",
14 | "cutout",
15 | "hideout",
16 | "graph-paper",
17 | "yyy",
18 | "squares",
19 | "falling-triangles",
20 | "piano-man",
21 | "pie-factory",
22 | "dominos",
23 | "hexagons",
24 | "charlie-brown",
25 | "autumn",
26 | "temple",
27 | "stamp-collection",
28 | "death-star",
29 | "church-on-sunday",
30 | "i-like-food",
31 | "overlapping-hexagons",
32 | "four-point-stars",
33 | "bamboo",
34 | "bathroom-floor",
35 | "cork-screw",
36 | "happy-intersection",
37 | "kiwi",
38 | "lips",
39 | "lisbon",
40 | "random-shapes",
41 | "steel-beams",
42 | "tiny-checkers",
43 | "x-equals",
44 | "anchors-away",
45 | "bevel-circle",
46 | "brick-wall",
47 | "fancy-rectangles",
48 | "heavy-rain",
49 | "overlapping-circles",
50 | "plus",
51 | "rounded-plus-connected",
52 | "volcano-lamp",
53 | "wiggle",
54 | "bubbles",
55 | "cage",
56 | "connections",
57 | "current",
58 | "diagonal-stripes",
59 | "flipped-diamonds",
60 | "floating-cogs",
61 | "glamorous",
62 | "houndstooth",
63 | "leaf",
64 | "lines-in-motion",
65 | "moroccan",
66 | "morphing-diamonds",
67 | "rails",
68 | "rain",
69 | "skulls",
70 | "squares-in-squares",
71 | "stripes",
72 | "tic-tac-toe",
73 | "zig-zag",
74 | "aztec",
75 | "bank-note",
76 | "boxes",
77 | "circles-squares",
78 | "circuit-board",
79 | "curtain",
80 | "diagonal-lines",
81 | "endless-clouds",
82 | "eyes",
83 | "floor-tile",
84 | "groovy",
85 | "intersecting-circles",
86 | "melt",
87 | "overlapping-diamonds",
88 | "parkay-floor",
89 | "pixel-dots",
90 | "polka-dots",
91 | "signal",
92 | "slanted-stars",
93 | "wallpaper",
94 | ];
95 | const patterFill = useColorModeValue("brand.200", "brand.300");
96 |
97 | return (
98 |
99 | {patterns.map((pattern, pid) => (
100 |
112 | {pattern}
113 |
114 | ))}
115 |
116 | );
117 | };
118 |
119 | export default Choc;
120 |
--------------------------------------------------------------------------------
/pages/preview/cta/sc/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { chakra, Box, Stack, Flex, Link } from "@chakra-ui/react";
3 |
4 | const Choc = () => {
5 | return (
6 |
14 |
15 |
21 |
30 | Ready to dive in?
31 |
36 | Start your free trial today.
37 |
38 |
39 |
45 |
46 |
66 | Get started
67 |
68 |
69 |
70 |
86 | Learn more
87 |
88 |
89 |
90 |
91 |
92 |
93 | );
94 | };
95 |
96 | export default Choc;
97 |
--------------------------------------------------------------------------------
/pages/preview/cards/muwd/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Icon, Image, chakra } from "@chakra-ui/react";
3 |
4 | import { MdEmail, MdHeadset, MdLocationOn } from "react-icons/md";
5 | import { BsFillBriefcaseFill } from "react-icons/bs";
6 |
7 | const Choc = () => {
8 | return (
9 |
17 |
26 |
34 |
35 |
36 |
37 |
38 |
39 | Focusing
40 |
41 |
42 |
43 |
44 |
50 | Patterson johnson
51 |
52 |
53 |
54 | Full Stack maker & UI / UX Designer , love hip hop music Author of
55 | Building UI.
56 |
57 |
58 |
64 |
65 |
66 |
67 | Choc UI
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 | California
81 |
82 |
83 |
89 |
90 |
91 |
92 | patterson@example.com
93 |
94 |
95 |
96 |
97 |
98 | );
99 | };
100 |
101 | export default Choc;
102 |
--------------------------------------------------------------------------------