-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add stencil component library (web components) #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Queentaker
wants to merge
20
commits into
main
Choose a base branch
from
StencilJSComponents
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d574238
initial trials with a V3 setup using vite and shadcn
rschlaefli c2cd369
scaffold button
rschlaefli 89ed7fa
working build with vite
rschlaefli 6b8872b
build tailwind
rschlaefli 12bbc1b
add: stencilJS Webcomponents
Queentaker 0ddc142
Merge branch 'dev' of https://github.com/uzh-bf/design-system into V3
rschlaefli afbf105
Merge branch 'V3' of https://github.com/uzh-bf/design-system into Ste…
rschlaefli 8aedffd
move tc-web to packages folder
rschlaefli 9b7823c
#95 removing dynamic column assignment
Queentaker d1fedfc
#92 enum columns and gaps
Queentaker 594fadc
#92 renaming segment-container attribute: seg-title to title
Queentaker 3eb00f3
Merge branch 'dev' of https://github.com/uzh-bf/design-system into St…
rschlaefli c0c5d20
add gitignore, move editorconfig, package.json updates
rschlaefli 62551e7
remove unnecessary CSS files
rschlaefli 1ea104b
use one base css
rschlaefli acb6769
install tailwind-merge, prettier, clsx
rschlaefli 840f46c
setup prettier and reformat
rschlaefli 139c52b
prettier esm
rschlaefli bb94d88
add df-container as example
rschlaefli 2ca286a
chore: updates
rschlaefli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # http://editorconfig.org | ||
|
|
||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| indent_style = space | ||
| indent_size = 2 | ||
| end_of_line = lf | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
|
|
||
| [*.md] | ||
| insert_final_newline = false | ||
| trim_trailing_whitespace = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| module.exports = { | ||
| root: true, | ||
| env: { browser: true, es2020: true }, | ||
| extends: [ | ||
| 'eslint:recommended', | ||
| 'plugin:@typescript-eslint/recommended', | ||
| 'plugin:react-hooks/recommended', | ||
| ], | ||
| ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
| parser: '@typescript-eslint/parser', | ||
| plugins: ['react-refresh'], | ||
| rules: { | ||
| 'react-refresh/only-export-components': [ | ||
| 'warn', | ||
| { allowConstantExport: true }, | ||
| ], | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
|
|
||
| node_modules | ||
| dist | ||
| dist-ssr | ||
| *.local | ||
|
|
||
| # Editor directories and files | ||
| .vscode/* | ||
| !.vscode/extensions.json | ||
| .idea | ||
| .DS_Store | ||
| *.suo | ||
| *.ntvs* | ||
| *.njsproj | ||
| *.sln | ||
| *.sw? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "$schema": "https://ui.shadcn.com/schema.json", | ||
| "style": "default", | ||
| "rsc": false, | ||
| "tsx": true, | ||
| "tailwind": { | ||
| "config": "tailwind.config.js", | ||
| "css": "src/globals.css", | ||
| "baseColor": "slate", | ||
| "cssVariables": true, | ||
| "prefix": "" | ||
| }, | ||
| "aliases": { | ||
| "components": "@/components", | ||
| "utils": "@/lib/utils" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| "name": "@uzh-bf/design-system-v3", | ||
| "private": true, | ||
| "version": "0.0.0", | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "vite", | ||
| "build": "tsc && vite build", | ||
| "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0" | ||
| }, | ||
| "peerDependencies": { | ||
| "react": "^18.2.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^20.11.5", | ||
| "@types/react": "^18.2.43", | ||
| "@typescript-eslint/eslint-plugin": "^6.14.0", | ||
| "@typescript-eslint/parser": "^6.14.0", | ||
| "@vitejs/plugin-react-swc": "^3.5.0", | ||
| "autoprefixer": "^10.4.17", | ||
| "eslint": "^8.55.0", | ||
| "eslint-plugin-react-hooks": "^4.6.0", | ||
| "eslint-plugin-react-refresh": "^0.4.5", | ||
| "postcss": "^8.4.33", | ||
| "tailwindcss": "^3.4.1", | ||
| "tailwindcss-animate": "1.0.7", | ||
| "typescript": "^5.2.2", | ||
| "vite": "^5.0.8" | ||
| }, | ||
| "volta": { | ||
| "extends": "../../package.json" | ||
| }, | ||
| "dependencies": { | ||
| "@radix-ui/react-slot": "1.0.2", | ||
| "class-variance-authority": "0.7.0" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export default { | ||
| plugins: { | ||
| tailwindcss: {}, | ||
| autoprefixer: {}, | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import * as React from "react" | ||
| import { Slot } from "@radix-ui/react-slot" | ||
| import { cva, type VariantProps } from "class-variance-authority" | ||
|
|
||
| import { cn } from "@/lib/utils" | ||
|
|
||
| const buttonVariants = cva( | ||
| "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", | ||
| { | ||
| variants: { | ||
| variant: { | ||
| default: "bg-primary text-primary-foreground hover:bg-primary/90", | ||
| destructive: | ||
| "bg-destructive text-destructive-foreground hover:bg-destructive/90", | ||
| outline: | ||
| "border border-input bg-background hover:bg-accent hover:text-accent-foreground", | ||
| secondary: | ||
| "bg-secondary text-secondary-foreground hover:bg-secondary/80", | ||
| ghost: "hover:bg-accent hover:text-accent-foreground", | ||
| link: "text-primary underline-offset-4 hover:underline", | ||
| }, | ||
| size: { | ||
| default: "h-10 px-4 py-2", | ||
| sm: "h-9 rounded-md px-3", | ||
| lg: "h-11 rounded-md px-8", | ||
| icon: "h-10 w-10", | ||
| }, | ||
| }, | ||
| defaultVariants: { | ||
| variant: "default", | ||
| size: "default", | ||
| }, | ||
| } | ||
| ) | ||
|
|
||
| export interface ButtonProps | ||
| extends React.ButtonHTMLAttributes<HTMLButtonElement>, | ||
| VariantProps<typeof buttonVariants> { | ||
| asChild?: boolean | ||
| } | ||
|
|
||
| const Button = React.forwardRef<HTMLButtonElement, ButtonProps>( | ||
| ({ className, variant, size, asChild = false, ...props }, ref) => { | ||
| const Comp = asChild ? Slot : "button" | ||
| return ( | ||
| <Comp | ||
| className={cn(buttonVariants({ variant, size, className }))} | ||
| ref={ref} | ||
| {...props} | ||
| /> | ||
| ) | ||
| } | ||
| ) | ||
| Button.displayName = "Button" | ||
|
|
||
| export { Button, buttonVariants } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| @tailwind base; | ||
| @tailwind components; | ||
| @tailwind utilities; | ||
|
|
||
| @layer base { | ||
| :root { | ||
| --background: 0 0% 100%; | ||
| --foreground: 222.2 84% 4.9%; | ||
|
|
||
| --card: 0 0% 100%; | ||
| --card-foreground: 222.2 84% 4.9%; | ||
|
|
||
| --popover: 0 0% 100%; | ||
| --popover-foreground: 222.2 84% 4.9%; | ||
|
|
||
| --primary: 222.2 47.4% 11.2%; | ||
| --primary-foreground: 210 40% 98%; | ||
|
|
||
| --secondary: 210 40% 96.1%; | ||
| --secondary-foreground: 222.2 47.4% 11.2%; | ||
|
|
||
| --muted: 210 40% 96.1%; | ||
| --muted-foreground: 215.4 16.3% 46.9%; | ||
|
|
||
| --accent: 210 40% 96.1%; | ||
| --accent-foreground: 222.2 47.4% 11.2%; | ||
|
|
||
| --destructive: 0 84.2% 60.2%; | ||
| --destructive-foreground: 210 40% 98%; | ||
|
|
||
| --border: 214.3 31.8% 91.4%; | ||
| --input: 214.3 31.8% 91.4%; | ||
| --ring: 222.2 84% 4.9%; | ||
|
|
||
| --radius: 0.5rem; | ||
| } | ||
|
|
||
| .dark { | ||
| --background: 222.2 84% 4.9%; | ||
| --foreground: 210 40% 98%; | ||
|
|
||
| --card: 222.2 84% 4.9%; | ||
| --card-foreground: 210 40% 98%; | ||
|
|
||
| --popover: 222.2 84% 4.9%; | ||
| --popover-foreground: 210 40% 98%; | ||
|
|
||
| --primary: 210 40% 98%; | ||
| --primary-foreground: 222.2 47.4% 11.2%; | ||
|
|
||
| --secondary: 217.2 32.6% 17.5%; | ||
| --secondary-foreground: 210 40% 98%; | ||
|
|
||
| --muted: 217.2 32.6% 17.5%; | ||
| --muted-foreground: 215 20.2% 65.1%; | ||
|
|
||
| --accent: 217.2 32.6% 17.5%; | ||
| --accent-foreground: 210 40% 98%; | ||
|
|
||
| --destructive: 0 62.8% 30.6%; | ||
| --destructive-foreground: 210 40% 98%; | ||
|
|
||
| --border: 217.2 32.6% 17.5%; | ||
| --input: 217.2 32.6% 17.5%; | ||
| --ring: 212.7 26.8% 83.9%; | ||
| } | ||
| } | ||
|
|
||
| @layer base { | ||
| * { | ||
| @apply border-border; | ||
| } | ||
| body { | ||
| @apply bg-background text-foreground; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import './globals.css' | ||
|
|
||
| export { Button } from '@/components/Button' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import { type ClassValue, clsx } from "clsx" | ||
| import { twMerge } from "tailwind-merge" | ||
|
|
||
| export function cn(...inputs: ClassValue[]) { | ||
| return twMerge(clsx(inputs)) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /// <reference types="vite/client" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| /** @type {import('tailwindcss').Config} */ | ||
| module.exports = { | ||
| darkMode: ["class"], | ||
| content: [ | ||
| './src/**/*.{ts,tsx}', | ||
| ], | ||
| prefix: "", | ||
| theme: { | ||
| container: { | ||
| center: true, | ||
| padding: "2rem", | ||
| screens: { | ||
| "2xl": "1400px", | ||
| }, | ||
| }, | ||
| extend: { | ||
| colors: { | ||
| border: "hsl(var(--border))", | ||
| input: "hsl(var(--input))", | ||
| ring: "hsl(var(--ring))", | ||
| background: "hsl(var(--background))", | ||
| foreground: "hsl(var(--foreground))", | ||
| primary: { | ||
| DEFAULT: "hsl(var(--primary))", | ||
| foreground: "hsl(var(--primary-foreground))", | ||
| }, | ||
| secondary: { | ||
| DEFAULT: "hsl(var(--secondary))", | ||
| foreground: "hsl(var(--secondary-foreground))", | ||
| }, | ||
| destructive: { | ||
| DEFAULT: "hsl(var(--destructive))", | ||
| foreground: "hsl(var(--destructive-foreground))", | ||
| }, | ||
| muted: { | ||
| DEFAULT: "hsl(var(--muted))", | ||
| foreground: "hsl(var(--muted-foreground))", | ||
| }, | ||
| accent: { | ||
| DEFAULT: "hsl(var(--accent))", | ||
| foreground: "hsl(var(--accent-foreground))", | ||
| }, | ||
| popover: { | ||
| DEFAULT: "hsl(var(--popover))", | ||
| foreground: "hsl(var(--popover-foreground))", | ||
| }, | ||
| card: { | ||
| DEFAULT: "hsl(var(--card))", | ||
| foreground: "hsl(var(--card-foreground))", | ||
| }, | ||
| }, | ||
| borderRadius: { | ||
| lg: "var(--radius)", | ||
| md: "calc(var(--radius) - 2px)", | ||
| sm: "calc(var(--radius) - 4px)", | ||
| }, | ||
| keyframes: { | ||
| "accordion-down": { | ||
| from: { height: "0" }, | ||
| to: { height: "var(--radix-accordion-content-height)" }, | ||
| }, | ||
| "accordion-up": { | ||
| from: { height: "var(--radix-accordion-content-height)" }, | ||
| to: { height: "0" }, | ||
| }, | ||
| }, | ||
| animation: { | ||
| "accordion-down": "accordion-down 0.2s ease-out", | ||
| "accordion-up": "accordion-up 0.2s ease-out", | ||
| }, | ||
| }, | ||
| }, | ||
| plugins: [require("tailwindcss-animate")], | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "ES2020", | ||
| "useDefineForClassFields": true, | ||
| "lib": [ | ||
| "ES2020", | ||
| "DOM", | ||
| "DOM.Iterable" | ||
| ], | ||
| "module": "ESNext", | ||
| "skipLibCheck": true, | ||
| /* Bundler mode */ | ||
| "moduleResolution": "bundler", | ||
| "allowImportingTsExtensions": true, | ||
| "resolveJsonModule": true, | ||
| "isolatedModules": true, | ||
| "noEmit": true, | ||
| "jsx": "react-jsx", | ||
| /* Linting */ | ||
| "strict": true, | ||
| "noUnusedLocals": true, | ||
| "noUnusedParameters": true, | ||
| "noFallthroughCasesInSwitch": true, | ||
| /* Paths */ | ||
| "baseUrl": ".", | ||
| "paths": { | ||
| "@/*": [ | ||
| "./src/*" | ||
| ] | ||
| } | ||
| }, | ||
| "include": [ | ||
| "src" | ||
| ], | ||
| "references": [ | ||
| { | ||
| "path": "./tsconfig.node.json" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "composite": true, | ||
| "skipLibCheck": true, | ||
| "module": "ESNext", | ||
| "moduleResolution": "bundler", | ||
| "allowSyntheticDefaultImports": true | ||
| }, | ||
| "include": ["vite.config.ts"] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Missing required dependencies in package.json
The
cnutility function depends onclsxandtailwind-mergepackages, but these dependencies are not declared in either the package's or root's package.json. The function is currently being used in Button.tsx component.packages/design-system-v3/package.json:{ "dependencies": { "clsx": "^2.0.0", "tailwind-merge": "^2.0.0" } }🔗 Analysis chain
Verify dependencies and usage patterns
Let's ensure the implementation is properly supported and consistently used.
Let me gather more information to verify the dependencies and usage patterns thoroughly.
Let me check one more thing to verify the dependencies and their installation status.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 417
Script:
Length of output: 3178
Script:
Length of output: 657