Skip to content

Commit f6818a7

Browse files
authored
feat: add new example for custom theme and copilot (#2052)
1 parent 3b76e41 commit f6818a7

39 files changed

+17568
-77
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"title": "DB UX Design System - React 18 + tailwind example",
3+
"description": "This is an example of using the DB UX Design System with React 18 and tailwind.",
4+
"tags": ["react", "tailwind", "typescript", "vite"],
5+
"published": true
6+
}

custom-theme-example/.eslintrc.cjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"plugin:react-hooks/recommended",
8+
],
9+
ignorePatterns: ["dist", ".eslintrc.cjs"],
10+
parser: "@typescript-eslint/parser",
11+
plugins: ["react-refresh"],
12+
rules: {
13+
"react-refresh/only-export-components": [
14+
"warn",
15+
{ allowConstantExport: true },
16+
],
17+
},
18+
};
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
--- START: DB UX Copilot Instructions ---
3+
4+
# @db-ux/core-components
5+
## Common AI mistakes
6+
7+
### `DBButton` or `db-button`
8+
9+
- available variants are `outline`, `brand`, `filled`, `ghost`
10+
- always use variant `outline` as default
11+
- use variant `brand` as CTA or primary action
12+
- if `noText`/`no-text` property is used add a `DBTooltip` or `db-tooltip` inside the Button
13+
- always add a `type` as property as best practise
14+
15+
16+
# @db-ux/core-foundations
17+
## CSS
18+
19+
- If you use CSS follow these rules:
20+
- use for `variables` like, sizing, spacing, elevation, border, container-size the file node_modules/@db-ux/core-foundations/css/Variables.md
21+
22+
## SCSS
23+
24+
- If you use SCSS follow these rules:
25+
- use for `variables` like, sizing, spacing, elevation, border, container-size the file node_modules/@db-ux/core-foundations/scss/Variables.md
26+
27+
## Tailwind
28+
29+
- If you use Tailwind follow these rules:
30+
- use for `variables` like, sizing, spacing, elevation, border, container-size the file node_modules/@db-ux/core-foundations/tailwind/Variables.md
31+
- Always stick with the variables don't use something like `p-4` or `m-[16px]` use `p-fix-xs` or `m-fix-md` instead.
32+
33+
34+
# @db-ux/react-core-components
35+
- Use "@db-ux/react-core-components" as import for components:
36+
- use for `DBDrawer` or `Drawer` the file node_modules/@db-ux/react-core-components/Drawer.md
37+
- use for `DBTooltip` or `Tooltip` the file node_modules/@db-ux/react-core-components/Tooltip.md
38+
- use for `DBTextarea` or `Textarea` the file node_modules/@db-ux/react-core-components/Textarea.md
39+
- use for `DBTag` or `Tag` the file node_modules/@db-ux/react-core-components/Tag.md
40+
- use for `DBTabs` or `Tabs` the file node_modules/@db-ux/react-core-components/Tabs.md
41+
- use for `DBTabItem` or `TabItem` the file node_modules/@db-ux/react-core-components/TabItem.md
42+
- use for `DBSwitch` or `Switch` the file node_modules/@db-ux/react-core-components/Switch.md
43+
- use for `DBStack` or `Stack` the file node_modules/@db-ux/react-core-components/Stack.md
44+
- use for `DBSelect` or `Select` the file node_modules/@db-ux/react-core-components/Select.md
45+
- use for `DBSection` or `Section` the file node_modules/@db-ux/react-core-components/Section.md
46+
- use for `DBRadio` or `Radio` the file node_modules/@db-ux/react-core-components/Radio.md
47+
- use for `DBPopover` or `Popover` the file node_modules/@db-ux/react-core-components/Popover.md
48+
- use for `DBPage` or `Page` the file node_modules/@db-ux/react-core-components/Page.md
49+
- use for `DBNotification` or `Notification` the file node_modules/@db-ux/react-core-components/Notification.md
50+
- use for `DBNavigationItem` or `NavigationItem` the file node_modules/@db-ux/react-core-components/NavigationItem.md
51+
- use for `DBNavigation` or `Navigation` the file node_modules/@db-ux/react-core-components/Navigation.md
52+
- use for `DBLink` or `Link` the file node_modules/@db-ux/react-core-components/Link.md
53+
- use for `DBInput` or `Input` the file node_modules/@db-ux/react-core-components/Input.md
54+
- use for `DBInfotext` or `Infotext` the file node_modules/@db-ux/react-core-components/Infotext.md
55+
- use for `DBIcon` or `Icon` the file node_modules/@db-ux/react-core-components/Icon.md
56+
- use for `DBHeader` or `Header` the file node_modules/@db-ux/react-core-components/Header.md
57+
- use for `DBDivider` or `Divider` the file node_modules/@db-ux/react-core-components/Divider.md
58+
- use for `DBCustomSelect` or `CustomSelect` the file node_modules/@db-ux/react-core-components/CustomSelect.md
59+
- use for `DBCheckbox` or `Checkbox` the file node_modules/@db-ux/react-core-components/Checkbox.md
60+
- use for `DBCard` or `Card` the file node_modules/@db-ux/react-core-components/Card.md
61+
- use for `DBButton` or `Button` the file node_modules/@db-ux/react-core-components/Button.md
62+
- use for `DBBrand` or `Brand` the file node_modules/@db-ux/react-core-components/Brand.md
63+
- use for `DBBadge` or `Badge` the file node_modules/@db-ux/react-core-components/Badge.md
64+
- use for `DBAccordionItem` or `AccordionItem` the file node_modules/@db-ux/react-core-components/AccordionItem.md
65+
- use for `DBAccordion` or `Accordion` the file node_modules/@db-ux/react-core-components/Accordion.md
66+
67+
--- END: DB UX Copilot Instructions ---

custom-theme-example/.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
!.vscode/extensions.json
17+
.idea
18+
.DS_Store
19+
*.suo
20+
*.ntvs*
21+
*.njsproj
22+
*.sln
23+
*.sw?
24+
**/fonts/all
25+
**/fonts/**/info.json
26+
**/fonts/**/*.eot
27+
**/fonts/**/*.svg
28+
**/fonts/**/*.ttf
29+
**/fonts/**/*.woff

custom-theme-example/.stackblitzrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"startCommand": "npm run dev"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

custom-theme-example/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>DB UX Custom Theme</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/src/main.tsx"></script>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)