Skip to content

Commit

Permalink
rename to crossed
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Bertrand committed Aug 14, 2023
1 parent 0968771 commit 43f3e76
Show file tree
Hide file tree
Showing 101 changed files with 265 additions and 265 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ body:
required: false
- type: textarea
attributes:
label: Mergeui Version
label: Crossed Version
render: markdown
validations:
required: true
Expand All @@ -25,7 +25,7 @@ body:
label: Reproduction
render: markdown
# description: |
# # - If this is a bug with Mergeui, fork [this CodeSandbox](https://codesandbox.io/p/sandbox/github/tamagui/tamagui/tree/master/starters/next-expo-solito) to reproduce the issue.
# # - If this is a bug with Crossed, fork [this CodeSandbox](https://codesandbox.io/p/sandbox/github/tamagui/tamagui/tree/master/starters/next-expo-solito) to reproduce the issue.
# # - If you need a simple webpack repo to fork, try [this one](https://github.com/tamagui/issue-template-webpack) and run `yarn upgrade` to update tamagui to latest.
# # - For native-only bugs, please fork this repo and use `apps/kitchen-sink` to reproduce the bug. Once reproduced, submit a PR with the title `[Issue] ...`
validations:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Build
run: pnpm build
- name: Build
run: pnpm -F mergeui-docs build
run: pnpm -F crossed-docs build
# 👆 Build steps
- name: Setup Pages
uses: actions/configure-pages@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: Build
run: pnpm build
- name: Build
run: pnpm -F mergeui-docs build
run: pnpm -F crossed-docs build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# mergeui
# crossed
4 changes: 2 additions & 2 deletions apps/docs/components/CodeDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { UilCheck } from '@iconscout/react-native-unicons';
import { Props } from '@mergeui/demo/lib/typescript/props';
import { Props } from '@crossed/demo/lib/typescript/props';
import {
Box,
Button,
Expand All @@ -9,7 +9,7 @@ import {
XBox,
YBox,
colorVariants,
} from '@mergeui/ui';
} from '@crossed/ui';
import { useData } from 'nextra/data';
import { useState, ComponentType } from 'react';
import { CopyBlock, dracula } from 'react-code-blocks';
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { withStaticProperties, type GetProps } from '@mergeui/ui';
import { withStaticProperties, type GetProps } from '@crossed/ui';
import { useRouter } from 'next/router';
import { Tabs as TabsNext, Tab as TabNext } from 'nextra-theme-docs';
import { memo, useEffect } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/getStaticDemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path';

export const getStaticDemo = (pathTmp: string) => () => {
const code = readFileSync(
path.resolve(`./node_modules/@mergeui/demo/src/${pathTmp}.tsx`),
path.resolve(`./node_modules/@crossed/demo/src/${pathTmp}.tsx`),
'utf8'
);
return {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/getStaticPaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path';

export const getStaticPaths = async ({ params: { slug } }) => {
const code = readFileSync(
path.resolve(`./node_modules/@mergeui/demo/src/typography/${slug}.tsx`),
path.resolve(`./node_modules/@crossed/demo/src/typography/${slug}.tsx`),
'utf8'
);

Expand Down
10 changes: 5 additions & 5 deletions apps/docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ const withNextra = require('nextra')({
});
const path = require('path');

const { withMergeui } = require('@mergeui/next-adapter');
const { withCrossed } = require('@crossed/next-adapter');
/** @type {import('next').NextConfig} */
module.exports = withNextra(
withMergeui({
withCrossed({
images: {
unoptimized: true,
},
basePath: process.env.NODE_ENV === 'development' ? undefined : '/mergeui',
assetPrefix: process.env.NODE_ENV === 'development' ? '/' : '/mergeui/',
basePath: process.env.NODE_ENV === 'development' ? undefined : '/crossed',
assetPrefix: process.env.NODE_ENV === 'development' ? '/' : '/crossed/',
output: 'export',
transpilePackages: ['@mergeui/core'],
transpilePackages: ['@crossed/core'],
webpack: (config, { isServer, dev, webpack } = {}) => {
if (!config.plugins) {
config.plugins = [];
Expand Down
10 changes: 5 additions & 5 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mergeui-docs",
"name": "crossed-docs",
"version": "0.0.1",
"description": "Nextra docs template",
"scripts": {
Expand All @@ -17,10 +17,10 @@
},
"homepage": "https://github.com/shuding/nextra-docs-template#readme",
"dependencies": {
"@mergeui/core": "workspace:^1.0.0",
"@mergeui/demo": "1.0.0",
"@mergeui/next-adapter": "1.0.0",
"@mergeui/ui": "1.0.0",
"@crossed/core": "workspace:^1.0.0",
"@crossed/demo": "1.0.0",
"@crossed/next-adapter": "1.0.0",
"@crossed/ui": "1.0.0",
"autoprefixer": "^10.4.14",
"next": "^13.0.6",
"next-themes": "^0.2.1",
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/pages/_app.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import '../styles/global.css';
import { MergeuiProvider } from '@mergeui/ui';
import { CrossedProvider } from '@crossed/ui';

export default function App({ Component, pageProps }) {
return (
<MergeuiProvider defaultTheme={'dark'}>
<CrossedProvider defaultTheme={'dark'}>
<Component {...pageProps} />
</MergeuiProvider>
</CrossedProvider>
);
}
8 changes: 4 additions & 4 deletions apps/docs/pages/_meta.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"index": "Introduction",
"class-variance-authority": {
"title": "@mergeui/class-variance-authority"
"title": "@crossed/class-variance-authority"
},
"core": {
"title": "@mergeui/core",
"title": "@crossed/core",
"display": "hidden"
},
"ui": {
"title": "@mergeui/ui"
"title": "@crossed/ui"
},
"unicons": {
"title": "@mergeui/unicons"
"title": "@crossed/unicons"
}
}
8 changes: 4 additions & 4 deletions apps/docs/pages/class-variance-authority/api-reference.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# API Reference

## `mergeui`
## `crossed`

Builds a `mergeui` component
Builds a `crossed` component

```ts
const component = mergeui('base', options);
const component = crossed('base', options);
```

### Parameters
Expand All @@ -19,7 +19,7 @@ const component = mergeui('base', options);

### Returns

A `mergeui` component function
A `crossed` component function

## `cx`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Composing Components

Whilst `mergeui` doesn't yet offer a built-in method for composing components, it does offer the tools to _extend_ components on your own terms…
Whilst `crossed` doesn't yet offer a built-in method for composing components, it does offer the tools to _extend_ components on your own terms…

For example; two `mergeui` components, concatenated together with `cx`:
For example; two `crossed` components, concatenated together with `cx`:

```ts
// components/card.ts
import type { VariantProps } from '@mergeui/class-variance-authority';
import { mergeui, cx } from '@mergeui/class-variance-authority';
import type { VariantProps } from '@crossed/class-variance-authority';
import { crossed, cx } from '@crossed/class-variance-authority';

/**
* Box
*/
export type BoxProps = VariantProps<typeof box>;
export const box = mergeui(['box', 'box-border'], {
export const box = crossed(['box', 'box-border'], {
variants: {
margin: { 0: 'm-0', 2: 'm-2', 4: 'm-4', 8: 'm-8' },
padding: { 0: 'p-0', 2: 'p-2', 4: 'p-4', 8: 'p-8' },
Expand All @@ -28,7 +28,7 @@ export const box = mergeui(['box', 'box-border'], {
* Card
*/
type CardBaseProps = VariantProps<typeof cardBase>;
const cardBase = mergeui(
const cardBase = crossed(
['card', 'border-solid', 'border-slate-300', 'rounded'],
{
variants: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Extending Components

All `mergeui` components provide an optional `class` **or** `className` prop, which can be used to pass additional classes to the component.
All `crossed` components provide an optional `class` **or** `className` prop, which can be used to pass additional classes to the component.

```ts
// components/button.ts
import { mergeui } from '@mergeui/class-variance-authority';
import { crossed } from '@crossed/class-variance-authority';

const button = mergeui(/**/);
const button = crossed(/**/);

button({ class: 'm-4' });
// => "…buttonClasses m-4"
Expand Down
24 changes: 12 additions & 12 deletions apps/docs/pages/class-variance-authority/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@ import { Tabs } from 'components/Tabs';
<Tabs.Tab>

```sh
pnpm i @mergeui/class-variance-authority
pnpm i @crossed/class-variance-authority
```

</Tabs.Tab>
<Tabs.Tab>

```sh
npm i @mergeui/class-variance-authority
npm i @crossed/class-variance-authority
```

</Tabs.Tab>
<Tabs.Tab>

```sh
yarn add @mergeui/class-variance-authority
yarn add @crossed/class-variance-authority
```

</Tabs.Tab>
</Tabs>

## Tailwind CSS

If you're a Tailwind user, here are some additional (optional) steps to get the most out of `mergeui`:
If you're a Tailwind user, here are some additional (optional) steps to get the most out of `crossed`:
### IntelliSense
You can enable autocompletion inside `mergeui` using the steps below:
You can enable autocompletion inside `crossed` using the steps below:
<Tabs items={["Visual Studio Code", "Neovim", "WebStorm"]}>
<Tabs.Tab>
Expand All @@ -44,7 +44,7 @@ You can enable autocompletion inside `mergeui` using the steps below:
```json
{
"tailwindCSS.experimental.classRegex": [
["mergeui\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
["crossed\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
]
}
```
Expand All @@ -62,7 +62,7 @@ You can enable autocompletion inside `mergeui` using the steps below:
tailwindCSS = {
experimental = {
classRegex = {
{ "mergeui\\(([^)]*)\\)",
{ "crossed\\(([^)]*)\\)",
"[\"'`]([^\"'`]*).*?[\"'`]" },
},
},
Expand All @@ -83,7 +83,7 @@ You can enable autocompletion inside `mergeui` using the steps below:
```json
{
"experimental": {
"classRegex": ["mergeui\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
"classRegex": ["crossed\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
}
}
```
Expand All @@ -93,21 +93,21 @@ You can enable autocompletion inside `mergeui` using the steps below:
### Handling Style Conflicts
Although `mergeui`'s API is designed to help you avoid styling conflicts, there's still a small margin of error.
Although `crossed`'s API is designed to help you avoid styling conflicts, there's still a small margin of error.
If you're keen to lift that burden altogether, check out the wonderful [`tailwind-merge`](https://github.com/dcastil/tailwind-merge) package.
For bulletproof components, wrap your `mergeui` component with `twMerge`.
For bulletproof components, wrap your `crossed` component with `twMerge`.
<details>
<summary>Example with tailwind-merge</summary>
```ts
import { mergeui, type VariantProps } from '@mergeui/class-variance-authority';
import { crossed, type VariantProps } from '@crossed/class-variance-authority';
import { twMerge } from 'tailwind-merge';
const buttonVariants = mergeui(['your', 'base', 'classes'], {
const buttonVariants = crossed(['your', 'base', 'classes'], {
variants: {
intent: {
primary: ['your', 'primary', 'classes'],
Expand Down
14 changes: 7 additions & 7 deletions apps/docs/pages/class-variance-authority/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@

## Extracting Variant Types

`mergeui` offers the `VariantProps` helper to extract variant types
`crossed` offers the `VariantProps` helper to extract variant types

```ts
// components/button.ts
import type { VariantProps } from '@mergeui/class-variance-authority';
import { mergeui, cx } from '@mergeui/class-variance-authority';
import type { VariantProps } from '@crossed/class-variance-authority';
import { crossed, cx } from '@crossed/class-variance-authority';

/**
* Button
*/
export type ButtonProps = VariantProps<typeof button>;
export const button = mergeui(/**/);
export const button = crossed(/**/);
```

## Required Variants

To keep the API small and unopinionated, `mergeui` **doesn't** offer a built-in solution for setting required variants.
To keep the API small and unopinionated, `crossed` **doesn't** offer a built-in solution for setting required variants.

Instead, we recommend using TypeScript's [Utility Types](https://www.typescriptlang.org/docs/handbook/utility-types.html):

```ts
// components/button.ts
import { mergeui, type VariantProps } from '@mergeui/class-variance-authority';
import { crossed, type VariantProps } from '@crossed/class-variance-authority';

export type ButtonVariantProps = VariantProps<typeof buttonVariants>;
export const buttonVariants = mergeui('', {
export const buttonVariants = crossed('', {
variants: {
optional: { a: '', b: '' },
required: { a: '', b: '' },
Expand Down
Loading

0 comments on commit 43f3e76

Please sign in to comment.