Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/pr-badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- icon: visualstudio
label: 'GitHub.dev'
message: 'PR-$prNumber'
color: 'blue'
url: 'https://github.dev/$owner/$repo/pull/$prNumber'

- icon: github
label: 'GitHub codespaces'
message: 'PR-$prNumber'
color: 'black'
url: 'https://codespaces.new/$owner/$repo/pull/$prNumber'

- icon: git
label: 'GitPod.io'
message: 'PR-$prNumber'
color: 'orange'
url: 'https://gitpod.io/?autostart=true#https://github.com/$owner/$repo/pull/$prNumber'
85 changes: 85 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# These settings are synced to GitHub by https://probot.github.io/apps/settings/

repository:
allow_merge_commit: false

delete_branch_on_merge: true

enable_vulnerability_alerts: true

labels:
- name: bug
color: '#d73a4a'
description: Something isn't working

- name: documentation
color: '#0075ca'
description: Improvements or additions to documentation

- name: duplicate
color: '#cfd3d7'
description: This issue or pull request already exists

- name: enhancement
color: '#a2eeef'
description: Some improvements

- name: feature
color: '#16b33f'
description: New feature or request

- name: good first issue
color: '#7057ff'
description: Good for newcomers

- name: help wanted
color: '#008672'
description: Extra attention is needed

- name: invalid
color: '#e4e669'
description: This doesn't seem right

- name: question
color: '#d876e3'
description: Further information is requested

- name: wontfix
color: '#ffffff'
description: This will not be worked on

branches:
- name: main
# https://docs.github.com/en/rest/reference/repos#update-branch-protection
protection:
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
required_pull_request_reviews:
# The number of approvals required. (1-6)
required_approving_review_count: 1
# Dismiss approved reviews automatically when a new commit is pushed.
dismiss_stale_reviews: true
# Blocks merge until code owners have reviewed.
require_code_owner_reviews: true
# Specify which users and teams can dismiss pull request reviews.
# Pass an empty dismissal_restrictions object to disable.
# User and team dismissal_restrictions are only available for organization-owned repositories.
# Omit this parameter for personal repositories.
dismissal_restrictions:
# users: []
# teams: []
# Required. Require status checks to pass before merging. Set to null to disable
required_status_checks:
# Required. Require branches to be up to date before merging.
strict: true
# Required. The list of status checks to require in order to merge into this branch
contexts: []
# Required. Enforce all configured restrictions for administrators.
# Set to true to enforce required status checks for repository administrators.
# Set to null to disable.
enforce_admins: true
# Prevent merge commits from being pushed to matching branches
required_linear_history: true
# Required. Restrict who can push to this branch.
# Team and user restrictions are only available for organization-owned repositories.
# Set to null to disable.
restrictions: null
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm test
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run build
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,25 @@ A **Pagination Table** & **Scroll List** component suite for [CRUD operation][1]

## Installation

### `components.json`

```json
{
"registries": {
"@mobx-restful-shadcn": "https://mobx-restful-shadcn.idea2.app/r/{name}.json"
}
}
```

### Adding components

```shell
npx shadcn-helper add https://mobx-restful-shadcn.idea2.app/r/rest-table.json
npx shadcn-helper add @mobx-restful-shadcn/rest-table
```

Replace `rest-table` with any component name from the list above.

## Configuration
## Initialization

### Internationalization

Expand Down Expand Up @@ -129,7 +141,7 @@ export class RepositoryTable extends Component {
),
},
{ key: "stargazers_count", type: "number", renderHead: "Star Count" },
{ key: "description", renderHead: "Description", rows: 3 },
{ key: "description", renderHead: "Description", contentEditable: true },
];
}

Expand Down
5 changes: 3 additions & 2 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@

:root {
--font-geist-sans: "Geist Sans", ui-sans-serif, system-ui, sans-serif;
--font-geist-mono: "Geist Mono", ui-monospace, "Cascadia Code",
"Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
--font-geist-mono:
"Geist Mono", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
Consolas, "DejaVu Sans Mono", monospace;
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
Expand Down
16 changes: 8 additions & 8 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { ComponentCard } from "@/components/example/component-card";
import { BadgeBarExample } from "@/registry/new-york/blocks/badge-bar/example";
import { PagerExample } from "@/registry/new-york/blocks/pager/example";
import { ImagePreviewExample } from "@/registry/new-york/blocks/image-preview/example";
import { FilePreviewExample } from "@/registry/new-york/blocks/file-preview/example";
import { ScrollBoundaryExample } from "@/registry/new-york/blocks/scroll-boundary/example";
import { ScrollListExample } from "@/registry/new-york/blocks/scroll-list/example";
import { ArrayFieldExample } from "@/registry/new-york/blocks/array-field/example";
import { BadgeBarExample } from "@/registry/new-york/blocks/badge-bar/example";
import { BadgeInputExample } from "@/registry/new-york/blocks/badge-input/example";
import { RangeInputExample } from "@/registry/new-york/blocks/range-input/example";
import { EditorExample } from "@/registry/new-york/blocks/editor/example";
import { FilePickerExample } from "@/registry/new-york/blocks/file-picker/example";
import { FilePreviewExample } from "@/registry/new-york/blocks/file-preview/example";
import { FormFieldExample } from "@/registry/new-york/blocks/form-field/example";
import { ImagePreviewExample } from "@/registry/new-york/blocks/image-preview/example";
import { PagerExample } from "@/registry/new-york/blocks/pager/example";
import { RangeInputExample } from "@/registry/new-york/blocks/range-input/example";
import { RestTableExample } from "@/registry/new-york/blocks/rest-table/example";
import { EditorExample } from "@/registry/new-york/blocks/editor/example";
import { ScrollBoundaryExample } from "@/registry/new-york/blocks/scroll-boundary/example";
import { ScrollListExample } from "@/registry/new-york/blocks/scroll-list/example";

export default function Home() {
return (
Expand Down
79 changes: 79 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
"linter": {
"enabled": true,
"rules": {
"style": {
"useSingleVarDeclarator": "off",
"useImportType": "off",
"noNonNullAssertion": "off",
"useTemplate": "off",
"noParameterAssign": "warn",
"useNodejsImportProtocol": "off"
},
"a11y": {
"useAltText": "warn",
"noSvgWithoutTitle": "warn",
"useKeyWithClickEvents": "off",
"useSemanticElements": "warn",
"noStaticElementInteractions": "warn"
},
"suspicious": {
"noAssignInExpressions": "warn",
"noExplicitAny": "off",
"noArrayIndexKey": "off"
},
"correctness": {
"noEmptyPattern": "off",
"noUnusedFunctionParameters": "warn"
},
"complexity": {
"noBannedTypes": "off",
"noCommaOperator": "warn"
},
"performance": {
"noDynamicNamespaceImportAccess": "warn"
}
}
},
"formatter": {
"enabled": true,
"formatWithErrors": true,
"indentStyle": "space",
"indentWidth": 2,
"bracketSpacing": true,
"bracketSameLine": false,
"lineWidth": 80
},
"javascript": {
"formatter": {
"arrowParentheses": "always",
"jsxQuoteStyle": "double",
"quoteStyle": "double",
"trailingCommas": "all",
"semicolons": "always"
}
},
"json": {
"formatter": {
"trailingCommas": "none"
}
},
"css": {
"parser": {
"tailwindDirectives": true
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"recommended": true
}
}
},
"files": {
"includes": ["**", "!.next", "!dist", "!build"],
"maxSize": 5242880
}
}
2 changes: 1 addition & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
}
10 changes: 5 additions & 5 deletions components/example/form.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { GitRepository } from "mobx-github";

import { i18n, topicStore } from "@/models/example";
import { BadgeBar } from "@/registry/new-york/blocks/badge-bar/badge-bar";
import { Field } from "@/registry/new-york/blocks/rest-form/rest-form";
import { Column } from "@/registry/new-york/blocks/rest-table/rest-table";
import { SearchableInput } from "@/registry/new-york/blocks/searchable-input/searchable-input";
import { BadgeBar } from "@/registry/new-york/blocks/badge-bar";
import { Field } from "@/registry/new-york/blocks/rest-form";
import { Column } from "@/registry/new-york/blocks/rest-table";
import { SearchableInput } from "@/registry/new-york/blocks/searchable-input";

export const columns: Column<GitRepository>[] = [
{
Expand Down Expand Up @@ -52,5 +52,5 @@ export const fields: Field<GitRepository>[] = columns.map(
({ renderHead, renderBody, ...meta }) => ({
...meta,
renderLabel: renderHead,
})
}),
);
6 changes: 4 additions & 2 deletions components/example/open-in-v0-button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentProps, FC } from "react";

import { cn } from "@/lib/utils";
import { Button } from "@/registry/new-york/ui/button";
import { Button } from "../ui/button";

export const OpenInV0Button: FC<
{ name: string } & ComponentProps<typeof Button>
Expand All @@ -11,7 +11,7 @@ export const OpenInV0Button: FC<
size="sm"
className={cn(
"shadow-none bg-black text-white hover:bg-black hover:text-white dark:bg-white dark:text-black",
className
className,
)}
asChild
>
Expand All @@ -26,7 +26,9 @@ export const OpenInV0Button: FC<
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="h-5 w-5 text-current"
aria-label="V0 logo"
>
<title>V0 logo</title>
<path
d="M23.3919 0H32.9188C36.7819 0 39.9136 3.13165 39.9136 6.99475V16.0805H36.0006V6.99475C36.0006 6.90167 35.9969 6.80925 35.9898 6.71766L26.4628 16.079C26.4949 16.08 26.5272 16.0805 26.5595 16.0805H36.0006V19.7762H26.5595C22.6964 19.7762 19.4788 16.6139 19.4788 12.7508V3.68923H23.3919V12.7508C23.3919 12.9253 23.4054 13.0977 23.4316 13.2668L33.1682 3.6995C33.0861 3.6927 33.003 3.68923 32.9188 3.68923H23.3919V0Z"
fill="currentColor"
Expand Down
16 changes: 0 additions & 16 deletions eslint.config.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { clsx, type ClassValue } from "clsx";
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));
4 changes: 2 additions & 2 deletions models/example.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { components, operations } from "@octokit/openapi-types";
import { githubClient, RepositoryModel } from "mobx-github";
import { TranslationModel } from "mobx-i18n";
import { ListModel, Filter, IDType } from "mobx-restful";
import { Filter, IDType, ListModel } from "mobx-restful";
import { buildURLData } from "web-utility";

export const i18n = new TranslationModel({
Expand Down Expand Up @@ -47,7 +47,7 @@ class GitHubTopicModel extends ListModel<Topic> {
q: name,
page: pageIndex,
per_page: pageSize,
})}`
})}`,
);
return { pageData: body!.items, totalCount: body!.total_count };
}
Expand Down
Loading