diff --git a/packages/components/.gitignore b/packages/components/.gitignore new file mode 100644 index 000000000..5d86f9d0f --- /dev/null +++ b/packages/components/.gitignore @@ -0,0 +1,19 @@ +# Dependencies +node_modules/ + +# Build outputs +dist/ + +# Logs +*.log +npm-debug.log* + +# OS files +.DS_Store +Thumbs.db + +# IDE +.vscode/ +.idea/ +*.swp +*.swo diff --git a/packages/components/.prettierrc b/packages/components/.prettierrc new file mode 100644 index 000000000..29b9d1f86 --- /dev/null +++ b/packages/components/.prettierrc @@ -0,0 +1,8 @@ +{ + "semi": true, + "trailingComma": "es5", + "singleQuote": true, + "printWidth": 100, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/components/CONTRIBUTING.md b/packages/components/CONTRIBUTING.md new file mode 100644 index 000000000..7893d15f6 --- /dev/null +++ b/packages/components/CONTRIBUTING.md @@ -0,0 +1,72 @@ +# Contributing to ODE Components + +Thank you for contributing to the ODE Component Library! This guide will help you add, modify, or update components. + +## Structure + +``` +packages/components/ +├── src/ +│ ├── shared/ # Platform-agnostic types and utilities +│ ├── react-web/ # React Web implementations +│ └── react-native/ # React Native implementations +├── package.json +└── README.md +``` + +## Adding a New Component + +1. **Define Types** (in `src/shared/types.ts`): + ```typescript + export interface MyComponentProps { + children: React.ReactNode; + // ... other props + } + ``` + +2. **Create React Web Implementation** (`src/react-web/MyComponent.tsx`): + - Use CSS for styling + - Import tokens from `@ode/tokens/dist/json/tokens.json` + - Follow the existing component patterns + +3. **Create React Native Implementation** (`src/react-native/MyComponent.tsx`): + - Use StyleSheet for styling + - Import tokens from `@ode/tokens/dist/react-native/tokens` + - Match the API of the web version + +4. **Export** from platform-specific index files: + - `src/react-web/index.ts` + - `src/react-native/index.ts` + +## Design Principles + +All components must follow: + +1. **Minimalism** - Clean, uncluttered design +2. **Consistency** - Use ODE tokens for all values +3. **Accessibility** - WCAG compliant, proper ARIA attributes +4. **Responsiveness** - Works on all screen sizes +5. **Performance** - Lightweight and optimized + +## Button Component Special Requirements + +The Button component has unique requirements: + +- **Fading Border**: Border fades on one end (left button fades right, right button fades left) +- **Hover States**: Background fills on hover, text changes to contrast color +- **Paired Buttons**: When two buttons are together, they have opposite styles +- **Smooth Transitions**: All state changes use smooth animations + +## Testing + +- Test on both platforms (web and native) +- Verify accessibility with screen readers +- Test with different screen sizes +- Ensure dark mode support + +## Commit Guidelines + +Follow conventional commits: +- `feat(components): add new Card component` +- `fix(components): fix Button hover state` +- `docs(components): update README` diff --git a/packages/components/README.md b/packages/components/README.md new file mode 100644 index 000000000..5ed39861b --- /dev/null +++ b/packages/components/README.md @@ -0,0 +1,215 @@ +# @ode/components + +**ODE Design System - Unified UI Components** + +A comprehensive component library for the Open Data Ensemble (ODE) ecosystem. This package provides platform-specific implementations of modern, minimalist UI components that use ODE design tokens for consistent styling across React Native and React Web applications. + +## Features + +- **Modern Minimalist Design** - Clean, simple, and aesthetically beautiful components +- **Platform-Specific** - Optimized implementations for React Native and React Web +- **Token-Based** - Built on `@ode/tokens` for consistent design +- **Accessible** - WCAG compliant with proper ARIA attributes +- **Responsive** - Works seamlessly across all device sizes +- **Dark Mode Ready** - Supports light and dark themes + +## Installation + +```bash +npm install @ode/components @ode/tokens +``` + +## Quick Start + +### React Web + +```tsx +import { Button, ButtonGroup, Input, Card, Badge } from '@ode/components/react-web'; + +function App() { + return ( +
+ + + + + + + + console.log(text)} + /> + + +

Card content goes here

+
+ + Active +
+ ); +} +``` + +### React Native + +```tsx +import { Button, ButtonGroup, Input, Card, Badge } from '@ode/components/react-native'; + +function App() { + return ( + + + + + + + + + console.log(text)} + /> + + + Card content goes here + + + Active + + ); +} +``` + +## Components + +### Button + +Modern minimalist button with a unique fading border effect. When two buttons are placed together in a `ButtonGroup`, they automatically have opposite styles. + +**Features:** +- Fading border effect on one end (left button fades on right, right button fades on left) +- Transparent background with border-colored text by default +- On hover: background fills with border color, text changes to contrast color +- Automatic opposite styling when paired + +```tsx +// Single button + + +// Paired buttons with opposite styles + + + + +``` + +**Props:** +- `variant`: `'primary' | 'secondary' | 'neutral'` (default: `'primary'`) +- `size`: `'small' | 'medium' | 'large'` (default: `'medium'`) +- `disabled`: `boolean` (default: `false`) +- `loading`: `boolean` (default: `false`) +- `onPress`: `() => void` + +### Input + +Clean, minimalist input field with focus states and error handling. + +```tsx + +``` + +**Props:** +- `label`: `string` +- `placeholder`: `string` +- `value`: `string` +- `onChangeText`: `(text: string) => void` +- `error`: `string` +- `disabled`: `boolean` +- `required`: `boolean` +- `type`: `'text' | 'email' | 'password' | 'number' | 'tel'` (web only) + +### Card + +Modern card component with subtle elevation and optional click handler. + +```tsx + +

Card content

+
+``` + +**Props:** +- `title`: `string` +- `subtitle`: `string` +- `elevated`: `boolean` (default: `true`) +- `onPress`: `() => void` (makes card clickable) + +### Badge + +Minimalist badge for labels and status indicators. + +```tsx + + Active + +``` + +**Props:** +- `variant`: `'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | 'neutral'` (default: `'neutral'`) +- `size`: `'small' | 'medium' | 'large'` (default: `'medium'`) + +## Design Principles + +All components follow these design principles: + +1. **Minimalism** - Clean, uncluttered interfaces that enhance usability +2. **Consistency** - Unified design language using ODE tokens +3. **Accessibility** - WCAG compliant with proper contrast ratios and touch targets +4. **Responsiveness** - Adapts seamlessly to all screen sizes +5. **Performance** - Lightweight and optimized for fast rendering + +## Button Design Details + +The button component features a unique design inspired by modern minimalist aesthetics: + +- **Default State**: Transparent background with colored border and matching text +- **Fading Border**: Border fades on one end (left button fades right, right button fades left) +- **Hover State**: Background fills with border color, text changes to high-contrast color +- **Paired Buttons**: When two buttons are together, they have opposite color schemes +- **Smooth Transitions**: All state changes use smooth cubic-bezier animations + +## Platform Differences + +While components share the same API, platform-specific implementations optimize for: + +- **React Web**: Uses CSS for styling, supports hover states, uses semantic HTML +- **React Native**: Uses StyleSheet, supports press states, uses native components + +## Contributing + +See the main [ODE README](../../README.md) for contribution guidelines. + +## License + +MIT diff --git a/packages/components/package-lock.json b/packages/components/package-lock.json new file mode 100644 index 000000000..d3dc56849 --- /dev/null +++ b/packages/components/package-lock.json @@ -0,0 +1,1840 @@ +{ + "name": "@ode/components", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@ode/components", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@ode/tokens": "file:../tokens" + }, + "devDependencies": { + "@types/react": "^19.0.0", + "@typescript-eslint/eslint-plugin": "^6.0.0", + "@typescript-eslint/parser": "^6.0.0", + "eslint": "^8.57.0", + "prettier": "^2.8.8", + "typescript": "^5.0.4" + }, + "peerDependencies": { + "@ode/tokens": "file:../tokens", + "react": ">=18.0.0" + } + }, + "../tokens": { + "name": "@ode/tokens", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "style-dictionary": "^3.9.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@ode/tokens": { + "resolved": "../tokens", + "link": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.2.7", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.7.tgz", + "integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", + "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", + "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", + "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true, + "license": "ISC" + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/react": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", + "integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/packages/components/package.json b/packages/components/package.json new file mode 100644 index 000000000..1569c72c2 --- /dev/null +++ b/packages/components/package.json @@ -0,0 +1,56 @@ +{ + "name": "@ode/components", + "version": "1.0.0", + "description": "ODE Design System - Unified UI components for React Native and React Web", + "main": "src/index.ts", + "types": "src/index.ts", + "sideEffects": false, + "exports": { + ".": "./src/index.ts", + "./react-web": "./src/react-web/index.ts", + "./react-native": "./src/react-native/index.ts", + "./src/react-web": "./src/react-web/index.ts", + "./src/react-native": "./src/react-native/index.ts", + "./src/shared/types": "./src/shared/types.ts" + }, + "files": [ + "src", + "README.md" + ], + "scripts": { + "build": "tsc", + "clean": "rm -rf dist", + "lint": "eslint src --ext ts,tsx", + "format": "prettier \"src/**/*.{ts,tsx}\" --write" + }, + "keywords": [ + "design-system", + "components", + "ode", + "react-native", + "react", + "ui-components" + ], + "author": "ODE Design System Team", + "license": "MIT", + "peerDependencies": { + "@ode/tokens": "file:../tokens", + "react": ">=18.0.0" + }, + "dependencies": { + "@ode/tokens": "file:../tokens" + }, + "devDependencies": { + "@types/react": "^19.0.0", + "@typescript-eslint/eslint-plugin": "^6.0.0", + "@typescript-eslint/parser": "^6.0.0", + "eslint": "^8.57.0", + "prettier": "^2.8.8", + "typescript": "^5.0.4" + }, + "repository": { + "type": "git", + "url": "https://github.com/OpenDataEnsemble/ode.git", + "directory": "packages/components" + } +} diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts new file mode 100644 index 000000000..48c1266d9 --- /dev/null +++ b/packages/components/src/index.ts @@ -0,0 +1,25 @@ +/** + * ODE Components + * + * Main entry point - exports platform-specific components + * + * Usage: + * - For React Web: import { Button } from '@ode/components/react-web' + * - For React Native: import { Button } from '@ode/components/react-native' + */ + +// Re-export shared types +export type { + ButtonProps, + InputProps, + CardProps, + BadgeProps, + ButtonVariant, + ButtonSize, + ButtonPosition, + ThemeMode, +} from './shared/types'; + +// Platform-specific exports should be imported directly: +// import { Button } from '@ode/components/react-web' +// import { Button } from '@ode/components/react-native' diff --git a/packages/components/src/react-native/Badge.tsx b/packages/components/src/react-native/Badge.tsx new file mode 100644 index 000000000..af28d658d --- /dev/null +++ b/packages/components/src/react-native/Badge.tsx @@ -0,0 +1,122 @@ +/** + * ODE Badge Component - React Native + * + * Modern minimalist badge for labels and status indicators + */ + +import React from 'react'; +import { View, Text, StyleSheet, ViewStyle } from 'react-native'; +import { BadgeProps } from '../shared/types'; +import { tokens } from '@ode/tokens/dist/react-native/tokens'; + +const Badge: React.FC = ({ + children, + variant = 'neutral', + size = 'medium', + style, + testID, +}) => { + const getVariantColors = () => { + switch (variant) { + case 'primary': + return { + bg: tokens.color.brand.primary[50], + text: tokens.color.brand.primary[700], + }; + case 'secondary': + return { + bg: tokens.color.brand.secondary[50], + text: tokens.color.brand.secondary[700], + }; + case 'success': + return { + bg: tokens.color.semantic.success[50], + text: tokens.color.semantic.success[600], + }; + case 'error': + return { + bg: tokens.color.semantic.error[50], + text: tokens.color.semantic.error[600], + }; + case 'warning': + return { + bg: tokens.color.semantic.warning[50], + text: tokens.color.semantic.warning[600], + }; + case 'info': + return { + bg: tokens.color.semantic.info[50], + text: tokens.color.semantic.info[600], + }; + case 'neutral': + default: + return { + bg: tokens.color.neutral[100], + text: tokens.color.neutral[700], + }; + } + }; + + const colors = getVariantColors(); + const borderRadius = parseInt(tokens.border.radius.md.replace('px', '')); + + const sizeMap = { + small: { + paddingVertical: parseInt(tokens.spacing[1].replace('px', '')), + paddingHorizontal: parseInt(tokens.spacing[2].replace('px', '')), + fontSize: parseInt(tokens.font.size.xs.replace('px', '')), + }, + medium: { + paddingVertical: parseInt(tokens.spacing[2].replace('px', '')), + paddingHorizontal: parseInt(tokens.spacing[3].replace('px', '')), + fontSize: parseInt(tokens.font.size.sm.replace('px', '')), + }, + large: { + paddingVertical: parseInt(tokens.spacing[2].replace('px', '')), + paddingHorizontal: parseInt(tokens.spacing[4].replace('px', '')), + fontSize: parseInt(tokens.font.size.base.replace('px', '')), + }, + }; + + return ( + + + {children} + + + ); +}; + +const styles = StyleSheet.create({ + badge: { + alignSelf: 'flex-start', + alignItems: 'center', + justifyContent: 'center', + }, + text: { + fontWeight: tokens.font.weight.medium, + fontFamily: tokens.font.family.sans, + lineHeight: parseFloat(tokens.font.lineHeight.none), + }, +}); + +export default Badge; diff --git a/packages/components/src/react-native/Button.tsx b/packages/components/src/react-native/Button.tsx new file mode 100644 index 000000000..093570c25 --- /dev/null +++ b/packages/components/src/react-native/Button.tsx @@ -0,0 +1,196 @@ +/** + * ODE Button Component - React Native + * + * Modern minimalist button with fading border effect. + * When two buttons are placed together, they have opposite styles. + */ + +import React, { useState, useMemo } from 'react'; +import { + TouchableOpacity, + Text, + StyleSheet, + View, + ActivityIndicator, + ViewStyle, + TextStyle, +} from 'react-native'; +import { ButtonProps, ButtonVariant, ButtonPosition } from '../shared/types'; +import { getOppositeVariant, getFadeDirection } from '../shared/utils'; +import { tokens } from '@ode/tokens/dist/react-native/tokens'; + +export interface NativeButtonProps extends ButtonProps { + /** + * Whether this button is part of a pair (for opposite styling) + */ + isPaired?: boolean; + + /** + * The variant of the paired button (if any) + */ + pairedVariant?: ButtonVariant; +} + +const Button: React.FC = ({ + children, + onPress, + variant = 'primary', + size = 'medium', + disabled = false, + loading = false, + position = 'standalone', + isPaired = false, + pairedVariant, + style, + testID, + accessibilityLabel, +}) => { + const [isPressed, setIsPressed] = useState(false); + + // Determine actual variant - if paired, use opposite of paired variant + const actualVariant: ButtonVariant = useMemo(() => { + if (isPaired && pairedVariant) { + return getOppositeVariant(pairedVariant); + } + return variant; + }, [isPaired, pairedVariant, variant]); + + // Get fade direction based on position + const fadeDirection = getFadeDirection(position); + + // Get colors from tokens + const borderColor = useMemo(() => { + switch (actualVariant) { + case 'primary': + return tokens.color.brand.primary[500]; + case 'secondary': + return tokens.color.brand.secondary[500]; + case 'neutral': + return tokens.color.neutral[600]; + default: + return tokens.color.brand.primary[500]; + } + }, [actualVariant]); + + const textColor = isPressed + ? '#FFFFFF' // Light text on dark background when pressed + : borderColor; + + const backgroundColor = isPressed ? borderColor : 'transparent'; + + // Size-based spacing + const paddingMap = { + small: { vertical: tokens.spacing[2], horizontal: tokens.spacing[4] }, + medium: { vertical: tokens.spacing[3], horizontal: tokens.spacing[6] }, + large: { vertical: tokens.spacing[4], horizontal: tokens.spacing[8] }, + }; + + const fontSizeMap = { + small: parseInt(tokens.font.size.sm.replace('px', '')), + medium: parseInt(tokens.font.size.base.replace('px', '')), + large: parseInt(tokens.font.size.lg.replace('px', '')), + }; + + const padding = paddingMap[size]; + const fontSize = fontSizeMap[size]; + const borderRadius = parseInt(tokens.border.radius.full.replace('px', '')) || 9999; + const borderWidth = parseInt(tokens.border.width.thin.replace('px', '')) || 1; + + + return ( + setIsPressed(true)} + onPressOut={() => setIsPressed(false)} + disabled={disabled || loading} + style={[ + styles.button, + { + paddingVertical: padding.vertical, + paddingHorizontal: padding.horizontal, + borderRadius, + backgroundColor, + borderWidth, + borderColor: isPressed ? 'transparent' : borderColor, + opacity: disabled ? 0.5 : 1, + }, + style, + ]} + testID={testID} + accessibilityLabel={accessibilityLabel || (typeof children === 'string' ? children : undefined)} + accessibilityRole="button" + accessibilityState={{ disabled: disabled || loading }} + > + {/* Border fade effect - simplified approach for React Native */} + {!isPressed && ( + + )} + + {loading ? ( + + + + {children} + + + ) : ( + + {children} + + )} + + ); +}; + +const styles = StyleSheet.create({ + button: { + position: 'relative', + alignItems: 'center', + justifyContent: 'center', + minHeight: 48, // tokens.touchTarget.comfortable + overflow: 'visible', // Allow border fade to be visible + }, + borderFadeOverlay: { + position: 'absolute', + top: 0, + bottom: 0, + backgroundColor: 'transparent', + }, + text: { + fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', + fontWeight: '500', + letterSpacing: 0.025, + textAlign: 'center', + zIndex: 1, + }, + loadingContainer: { + flexDirection: 'row', + alignItems: 'center', + gap: 8, + zIndex: 1, + }, + loader: { + marginRight: 4, + }, +}); + +export default Button; diff --git a/packages/components/src/react-native/ButtonGroup.tsx b/packages/components/src/react-native/ButtonGroup.tsx new file mode 100644 index 000000000..bd226b910 --- /dev/null +++ b/packages/components/src/react-native/ButtonGroup.tsx @@ -0,0 +1,82 @@ +/** + * ODE Button Group Component - React Native + * + * Container for paired buttons with opposite styling + */ + +import React from 'react'; +import { View, StyleSheet, ViewStyle } from 'react-native'; +import Button from './Button'; +import { ButtonVariant, ButtonProps } from '../shared/types'; + +interface NativeButtonProps extends ButtonProps { + isPaired?: boolean; + pairedVariant?: ButtonVariant; + position?: 'left' | 'right' | 'standalone'; +} + +interface ButtonGroupProps { + /** + * Buttons to render + */ + children: React.ReactElement[]; + + /** + * Variant for the first button (second will be opposite) + */ + variant?: ButtonVariant; + + /** + * Additional style + */ + style?: ViewStyle; +} + +const ButtonGroup: React.FC = ({ + children, + variant = 'primary', + style, +}) => { + const buttons = React.Children.toArray(children) as React.ReactElement[]; + + return ( + + {buttons.map((button, index) => { + const isFirst = index === 0; + const isLast = index === buttons.length - 1; + const position = isFirst ? 'left' : isLast ? 'right' : 'standalone'; + const isPaired = buttons.length > 1; + + return React.cloneElement(button, { + key: index, + position, + isPaired, + pairedVariant: isFirst ? variant : getOppositeVariant(variant), + variant: isFirst ? variant : undefined, // Let the button determine its own variant if paired + } as any); + })} + + ); +}; + +function getOppositeVariant(variant: ButtonVariant): ButtonVariant { + switch (variant) { + case 'primary': + return 'secondary'; + case 'secondary': + return 'primary'; + case 'neutral': + return 'neutral'; + default: + return 'primary'; + } +} + +const styles = StyleSheet.create({ + container: { + flexDirection: 'row', + gap: 12, + }, +}); + +export default ButtonGroup; diff --git a/packages/components/src/react-native/Card.tsx b/packages/components/src/react-native/Card.tsx new file mode 100644 index 000000000..80383f7fd --- /dev/null +++ b/packages/components/src/react-native/Card.tsx @@ -0,0 +1,78 @@ +/** + * ODE Card Component - React Native + * + * Modern minimalist card with subtle elevation and clean styling + */ + +import React from 'react'; +import { View, Text, TouchableOpacity, StyleSheet, ViewStyle } from 'react-native'; +import { CardProps } from '../shared/types'; +import { tokens } from '@ode/tokens/dist/react-native/tokens'; + +const Card: React.FC = ({ + children, + title, + subtitle, + elevated = true, + style, + onPress, + testID, +}) => { + const borderRadius = parseInt(tokens.border.radius.lg.replace('px', '')); + + const CardWrapper = onPress ? TouchableOpacity : View; + + return ( + + {title && {title}} + {subtitle && {subtitle}} + {children} + + ); +}; + +const styles = StyleSheet.create({ + card: { + padding: parseInt(tokens.spacing[6].replace('px', '')), + }, + title: { + fontSize: parseInt(tokens.font.size.xl.replace('px', '')), + fontWeight: tokens.font.weight.semibold, + color: tokens.color.neutral[900], + marginBottom: parseInt(tokens.spacing[2].replace('px', '')), + fontFamily: tokens.font.family.sans, + lineHeight: parseFloat(tokens.font.lineHeight.tight), + }, + subtitle: { + fontSize: parseInt(tokens.font.size.sm.replace('px', '')), + fontWeight: tokens.font.weight.regular, + color: tokens.color.neutral[600], + marginBottom: parseInt(tokens.spacing[4].replace('px', '')), + fontFamily: tokens.font.family.sans, + lineHeight: parseFloat(tokens.font.lineHeight.normal), + }, +}); + +export default Card; diff --git a/packages/components/src/react-native/Input.tsx b/packages/components/src/react-native/Input.tsx new file mode 100644 index 000000000..5a74f38e9 --- /dev/null +++ b/packages/components/src/react-native/Input.tsx @@ -0,0 +1,104 @@ +/** + * ODE Input Component - React Native + * + * Modern minimalist input with clean styling and error states + */ + +import React, { useState } from 'react'; +import { View, Text, TextInput, StyleSheet, ViewStyle, TextStyle } from 'react-native'; +import { InputProps } from '../shared/types'; +import { tokens } from '@ode/tokens/dist/react-native/tokens'; + +const Input: React.FC = ({ + label, + placeholder, + value, + onChangeText, + error, + disabled = false, + required = false, + style, + testID, +}) => { + const [isFocused, setIsFocused] = useState(false); + + const borderColor = error + ? tokens.color.semantic.error[500] + : isFocused + ? tokens.color.brand.primary[500] + : tokens.color.neutral[400]; + + const borderWidth = isFocused ? parseInt(tokens.border.width.medium.replace('px', '')) : parseInt(tokens.border.width.thin.replace('px', '')); + const borderRadius = parseInt(tokens.border.radius.sm.replace('px', '')); + + return ( + + {label && ( + + {label} + {required && *} + + )} + setIsFocused(true)} + onBlur={() => setIsFocused(false)} + placeholder={placeholder} + placeholderTextColor={tokens.color.neutral[400]} + editable={!disabled} + style={[ + styles.input, + { + borderColor, + borderWidth, + borderRadius, + backgroundColor: disabled ? tokens.color.neutral[100] : tokens.color.neutral.white, + color: tokens.color.neutral[900], + }, + ]} + testID={testID ? `${testID}-input` : undefined} + accessibilityLabel={label || placeholder} + accessibilityState={{ disabled, invalid: !!error }} + /> + {error && ( + + {error} + + )} + + ); +}; + +const styles = StyleSheet.create({ + container: { + marginBottom: parseInt(tokens.spacing[4].replace('px', '')), + width: '100%', + }, + label: { + fontSize: parseInt(tokens.font.size.sm.replace('px', '')), + fontWeight: tokens.font.weight.medium, + color: tokens.color.neutral[900], + marginBottom: parseInt(tokens.spacing[2].replace('px', '')), + fontFamily: tokens.font.family.sans, + }, + required: { + color: tokens.color.semantic.error[500], + }, + input: { + width: '100%', + padding: parseInt(tokens.spacing[4].replace('px', '')), + fontSize: parseInt(tokens.font.size.base.replace('px', '')), + fontFamily: tokens.font.family.sans, + lineHeight: parseFloat(tokens.font.lineHeight.normal), + minHeight: 56, // tokens.touchTarget.large + }, + error: { + marginTop: parseInt(tokens.spacing[1].replace('px', '')), + fontSize: parseInt(tokens.font.size.sm.replace('px', '')), + color: tokens.color.semantic.error[500], + fontFamily: tokens.font.family.sans, + }, +}); + +export default Input; diff --git a/packages/components/src/react-native/index.ts b/packages/components/src/react-native/index.ts new file mode 100644 index 000000000..c76bd2020 --- /dev/null +++ b/packages/components/src/react-native/index.ts @@ -0,0 +1,13 @@ +/** + * ODE Components - React Native + * + * Export all React Native components + */ + +export { default as Button } from './Button'; +export { default as ButtonGroup } from './ButtonGroup'; +export { default as Input } from './Input'; +export { default as Card } from './Card'; +export { default as Badge } from './Badge'; + +// Types are available via the components themselves or can be imported from '../shared/types' diff --git a/packages/components/src/react-web/Badge.tsx b/packages/components/src/react-web/Badge.tsx new file mode 100644 index 000000000..97bf5ac99 --- /dev/null +++ b/packages/components/src/react-web/Badge.tsx @@ -0,0 +1,110 @@ +/** + * ODE Badge Component - React Web + * + * Modern minimalist badge for labels and status indicators + */ + +import React from 'react'; +import { BadgeProps } from '../shared/types'; +import tokensJson from '@ode/tokens/dist/json/tokens.json'; + +const tokens = tokensJson as any; + +const getColor = (colorPath: string): string => { + const parts = colorPath.split('.'); + let value: any = tokens; + for (const part of parts) { + value = value?.[part]; + } + return value?.value || value || '#000000'; +}; + +const Badge: React.FC = ({ + children, + variant = 'neutral', + size = 'medium', + className = '', + style, + testID, +}) => { + const getVariantColors = () => { + switch (variant) { + case 'primary': + return { + bg: getColor('color.brand.primary.50'), + text: getColor('color.brand.primary.700'), + }; + case 'secondary': + return { + bg: getColor('color.brand.secondary.50'), + text: getColor('color.brand.secondary.700'), + }; + case 'success': + return { + bg: getColor('color.semantic.success.50'), + text: getColor('color.semantic.success.600'), + }; + case 'error': + return { + bg: getColor('color.semantic.error.50'), + text: getColor('color.semantic.error.600'), + }; + case 'warning': + return { + bg: getColor('color.semantic.warning.50'), + text: getColor('color.semantic.warning.600'), + }; + case 'info': + return { + bg: getColor('color.semantic.info.50'), + text: getColor('color.semantic.info.600'), + }; + case 'neutral': + default: + return { + bg: getColor('color.neutral.100'), + text: getColor('color.neutral.700'), + }; + } + }; + + const colors = getVariantColors(); + const borderRadius = getColor('border.radius.md'); + + const sizeMap = { + small: { + padding: `${getColor('spacing.1')} ${getColor('spacing.2')}`, + fontSize: getColor('font.size.xs'), + }, + medium: { + padding: `${getColor('spacing.2')} ${getColor('spacing.3')}`, + fontSize: getColor('font.size.sm'), + }, + large: { + padding: `${getColor('spacing.2')} ${getColor('spacing.4')}`, + fontSize: getColor('font.size.base'), + }, + }; + + const badgeStyle: React.CSSProperties = { + display: 'inline-flex', + alignItems: 'center', + justifyContent: 'center', + backgroundColor: colors.bg, + color: colors.text, + borderRadius, + fontWeight: getColor('font.weight.medium'), + fontFamily: getColor('font.family.sans'), + lineHeight: getColor('font.lineHeight.none'), + ...sizeMap[size], + ...style, + }; + + return ( + + {children} + + ); +}; + +export default Badge; diff --git a/packages/components/src/react-web/Button.tsx b/packages/components/src/react-web/Button.tsx new file mode 100644 index 000000000..36b22c998 --- /dev/null +++ b/packages/components/src/react-web/Button.tsx @@ -0,0 +1,227 @@ +/** + * ODE Button Component - React Web + * + * Modern minimalist button with fading border effect. + * When two buttons are placed together, they have opposite styles. + */ + +import React, { useState, useMemo } from 'react'; +import { ButtonProps, ButtonVariant, ButtonPosition } from '../shared/types'; +import { getOppositeVariant, getFadeDirection } from '../shared/utils'; +import tokensJson from '@ode/tokens/dist/json/tokens.json'; + +export interface WebButtonProps extends ButtonProps { + /** + * Whether this button is part of a pair (for opposite styling) + */ + isPaired?: boolean; + + /** + * The variant of the paired button (if any) + */ + pairedVariant?: ButtonVariant; +} + +// Extract token values +const tokens = tokensJson as any; + +const Button: React.FC = ({ + children, + onPress, + variant = 'primary', + size = 'medium', + disabled = false, + loading = false, + position = 'standalone', + isPaired = false, + pairedVariant, + className = '', + style, + testID, + accessibilityLabel, +}) => { + const [isHovered, setIsHovered] = useState(false); + + // Determine actual variant - if paired, use opposite of paired variant + const actualVariant: ButtonVariant = useMemo(() => { + if (isPaired && pairedVariant) { + return getOppositeVariant(pairedVariant); + } + return variant; + }, [isPaired, pairedVariant, variant]); + + // Get fade direction based on position + const fadeDirection = getFadeDirection(position); + + // Get colors from tokens + const getColor = (colorPath: string): string => { + const parts = colorPath.split('.'); + let value: any = tokens; + for (const part of parts) { + value = value?.[part]; + } + return value?.value || value || '#000000'; + }; + + const borderColor = useMemo(() => { + switch (actualVariant) { + case 'primary': + return getColor('color.brand.primary.500'); + case 'secondary': + return getColor('color.brand.secondary.500'); + case 'neutral': + return getColor('color.neutral.600'); + default: + return getColor('color.brand.primary.500'); + } + }, [actualVariant]); + + const borderRadius = getColor('border.radius.full'); + const borderWidth = getColor('border.width.thin'); + + // Size-based spacing + const paddingMap = { + small: { vertical: getColor('spacing.2'), horizontal: getColor('spacing.4') }, + medium: { vertical: getColor('spacing.3'), horizontal: getColor('spacing.6') }, + large: { vertical: getColor('spacing.4'), horizontal: getColor('spacing.8') }, + }; + + const fontSizeMap = { + small: getColor('font.size.sm'), + medium: getColor('font.size.base'), + large: getColor('font.size.lg'), + }; + + const padding = paddingMap[size]; + const fontSize = fontSizeMap[size]; + + // Create gradient mask for fading border effect + const createFadeMask = () => { + if (fadeDirection === 'right') { + // Fade on right end - gradient from opaque to transparent + return `linear-gradient(to right, black 0%, black 85%, transparent 100%)`; + } else { + // Fade on left end - gradient from transparent to opaque + return `linear-gradient(to right, transparent 0%, black 15%, black 100%)`; + } + }; + + const buttonStyle: React.CSSProperties = { + position: 'relative', + padding: `${padding.vertical} ${padding.horizontal}`, + fontSize, + fontFamily: getColor('font.family.sans'), + fontWeight: getColor('font.weight.medium'), + color: isHovered + ? (document.documentElement.classList.contains('dark') ? '#000000' : '#FFFFFF') + : borderColor, + backgroundColor: isHovered ? borderColor : 'transparent', + border: 'none', + borderRadius, + cursor: disabled || loading ? 'not-allowed' : 'pointer', + opacity: disabled ? 0.5 : 1, + transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)', + outline: 'none', + display: 'inline-flex', + alignItems: 'center', + justifyContent: 'center', + minHeight: getColor('touchTarget.comfortable') || '48px', + textTransform: 'none', + letterSpacing: getColor('font.letterSpacing.wide'), + overflow: 'hidden', + ...style, + }; + + // Border effect using SVG mask for better fade control + const borderId = `border-fade-${fadeDirection}-${actualVariant}`; + + const handleClick = () => { + if (!disabled && !loading && onPress) { + onPress(); + } + }; + + return ( + + ); +}; + +export default Button; diff --git a/packages/components/src/react-web/ButtonGroup.tsx b/packages/components/src/react-web/ButtonGroup.tsx new file mode 100644 index 000000000..cb3a6c071 --- /dev/null +++ b/packages/components/src/react-web/ButtonGroup.tsx @@ -0,0 +1,88 @@ +/** + * ODE Button Group Component - React Web + * + * Container for paired buttons with opposite styling + */ + +import React from 'react'; +import Button from './Button'; +import { ButtonVariant } from '../shared/types'; +import { ButtonProps } from '../shared/types'; + +interface WebButtonProps extends ButtonProps { + isPaired?: boolean; + pairedVariant?: ButtonVariant; + position?: 'left' | 'right' | 'standalone'; +} + +interface ButtonGroupProps { + /** + * Buttons to render + */ + children: React.ReactElement[]; + + /** + * Variant for the first button (second will be opposite) + */ + variant?: ButtonVariant; + + /** + * Additional className + */ + className?: string; + + /** + * Additional style + */ + style?: React.CSSProperties; +} + +const ButtonGroup: React.FC = ({ + children, + variant = 'primary', + className = '', + style, +}) => { + const buttons = React.Children.toArray(children) as React.ReactElement[]; + + return ( +
+ {buttons.map((button, index) => { + const isFirst = index === 0; + const isLast = index === buttons.length - 1; + const position = isFirst ? 'left' : isLast ? 'right' : 'standalone'; + const isPaired = buttons.length > 1; + + return React.cloneElement(button, { + key: index, + position, + isPaired, + pairedVariant: isFirst ? variant : getOppositeVariant(variant), + variant: isFirst ? variant : undefined, // Let the button determine its own variant if paired + } as any); + })} +
+ ); +}; + +function getOppositeVariant(variant: ButtonVariant): ButtonVariant { + switch (variant) { + case 'primary': + return 'secondary'; + case 'secondary': + return 'primary'; + case 'neutral': + return 'neutral'; + default: + return 'primary'; + } +} + +export default ButtonGroup; diff --git a/packages/components/src/react-web/Card.tsx b/packages/components/src/react-web/Card.tsx new file mode 100644 index 000000000..12316cc29 --- /dev/null +++ b/packages/components/src/react-web/Card.tsx @@ -0,0 +1,102 @@ +/** + * ODE Card Component - React Web + * + * Modern minimalist card with subtle elevation and clean styling + */ + +import React from 'react'; +import { CardProps } from '../shared/types'; +import tokensJson from '@ode/tokens/dist/json/tokens.json'; + +const tokens = tokensJson as any; + +const getColor = (colorPath: string): string => { + const parts = colorPath.split('.'); + let value: any = tokens; + for (const part of parts) { + value = value?.[part]; + } + return value?.value || value || '#000000'; +}; + +const Card: React.FC = ({ + children, + title, + subtitle, + elevated = true, + className = '', + style, + onPress, + testID, +}) => { + const borderRadius = getColor('border.radius.lg'); + const shadow = elevated ? getColor('shadow.sm') : 'none'; + + const cardStyle: React.CSSProperties = { + backgroundColor: getColor('color.neutral.white'), + borderRadius, + padding: getColor('spacing.6'), + boxShadow: shadow, + border: `1px solid ${getColor('color.neutral.200')}`, + transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)', + cursor: onPress ? 'pointer' : 'default', + ...style, + }; + + const titleStyle: React.CSSProperties = { + fontSize: getColor('font.size.xl'), + fontWeight: getColor('font.weight.semibold'), + color: getColor('color.neutral.900'), + marginBottom: subtitle ? getColor('spacing.2') : getColor('spacing.4'), + fontFamily: getColor('font.family.sans'), + lineHeight: getColor('font.lineHeight.tight'), + }; + + const subtitleStyle: React.CSSProperties = { + fontSize: getColor('font.size.sm'), + fontWeight: getColor('font.weight.regular'), + color: getColor('color.neutral.600'), + marginBottom: getColor('spacing.4'), + fontFamily: getColor('font.family.sans'), + lineHeight: getColor('font.lineHeight.normal'), + }; + + const handleClick = () => { + if (onPress) { + onPress(); + } + }; + + return ( + <> + +
{ + if (onPress && (e.key === 'Enter' || e.key === ' ')) { + e.preventDefault(); + onPress(); + } + }} + > + {title &&

{title}

} + {subtitle &&

{subtitle}

} + {children} +
+ + ); +}; + +export default Card; diff --git a/packages/components/src/react-web/Input.tsx b/packages/components/src/react-web/Input.tsx new file mode 100644 index 000000000..017644f47 --- /dev/null +++ b/packages/components/src/react-web/Input.tsx @@ -0,0 +1,129 @@ +/** + * ODE Input Component - React Web + * + * Modern minimalist input with clean styling and error states + */ + +import React, { useState, useRef, useEffect } from 'react'; +import { InputProps } from '../shared/types'; +import tokensJson from '@ode/tokens/dist/json/tokens.json'; + +const tokens = tokensJson as any; + +const getColor = (colorPath: string): string => { + const parts = colorPath.split('.'); + let value: any = tokens; + for (const part of parts) { + value = value?.[part]; + } + return value?.value || value || '#000000'; +}; + +const Input: React.FC = ({ + label, + placeholder, + value, + onChangeText, + error, + disabled = false, + type = 'text', + required = false, + className = '', + style, + testID, +}) => { + const [isFocused, setIsFocused] = useState(false); + const [hasValue, setHasValue] = useState(!!value); + const inputRef = useRef(null); + + useEffect(() => { + setHasValue(!!value); + }, [value]); + + const handleChange = (e: React.ChangeEvent) => { + const newValue = e.target.value; + setHasValue(!!newValue); + if (onChangeText) { + onChangeText(newValue); + } + }; + + const borderColor = error + ? getColor('color.semantic.error.500') + : isFocused + ? getColor('color.brand.primary.500') + : getColor('color.neutral.400'); + + const borderWidth = isFocused ? getColor('border.width.medium') : getColor('border.width.thin'); + const borderRadius = getColor('border.radius.sm'); + + const containerStyle: React.CSSProperties = { + marginBottom: getColor('spacing.4'), + width: '100%', + ...style, + }; + + const labelStyle: React.CSSProperties = { + display: 'block', + fontSize: getColor('font.size.sm'), + fontWeight: getColor('font.weight.medium'), + color: getColor('color.neutral.900'), + marginBottom: getColor('spacing.2'), + fontFamily: getColor('font.family.sans'), + }; + + const inputStyle: React.CSSProperties = { + width: '100%', + padding: getColor('spacing.4'), + fontSize: getColor('font.size.base'), + fontFamily: getColor('font.family.sans'), + lineHeight: getColor('font.lineHeight.normal'), + color: getColor('color.neutral.900'), + backgroundColor: disabled ? getColor('color.neutral.100') : getColor('color.neutral.white'), + border: `${borderWidth} solid ${borderColor}`, + borderRadius, + minHeight: getColor('touchTarget.large') || '56px', + outline: 'none', + transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)', + boxSizing: 'border-box', + }; + + const errorStyle: React.CSSProperties = { + marginTop: getColor('spacing.1'), + fontSize: getColor('font.size.sm'), + color: getColor('color.semantic.error.500'), + fontFamily: getColor('font.family.sans'), + }; + + return ( +
+ {label && ( + + )} + setIsFocused(true)} + onBlur={() => setIsFocused(false)} + placeholder={placeholder} + disabled={disabled} + required={required} + style={inputStyle} + aria-invalid={!!error} + aria-describedby={error ? `${testID}-error` : undefined} + /> + {error && ( + + )} +
+ ); +}; + +export default Input; diff --git a/packages/components/src/react-web/index.ts b/packages/components/src/react-web/index.ts new file mode 100644 index 000000000..a767325cd --- /dev/null +++ b/packages/components/src/react-web/index.ts @@ -0,0 +1,13 @@ +/** + * ODE Components - React Web + * + * Export all React Web components + */ + +export { default as Button } from './Button'; +export { default as ButtonGroup } from './ButtonGroup'; +export { default as Input } from './Input'; +export { default as Card } from './Card'; +export { default as Badge } from './Badge'; + +// Types are available via the components themselves or can be imported from '../shared/types' diff --git a/packages/components/src/shared/types.ts b/packages/components/src/shared/types.ts new file mode 100644 index 000000000..cdf090e00 --- /dev/null +++ b/packages/components/src/shared/types.ts @@ -0,0 +1,192 @@ +/** + * Shared Types for ODE Components + * + * Platform-agnostic type definitions used across React Native and React Web implementations + */ + +export type ButtonVariant = 'primary' | 'secondary' | 'neutral'; +export type ButtonSize = 'small' | 'medium' | 'large'; +export type ButtonPosition = 'left' | 'right' | 'standalone'; + +export interface ButtonProps { + /** + * Button text content + */ + children: React.ReactNode; + + /** + * Click handler + */ + onPress?: () => void; + + /** + * Button variant (affects color scheme) + * @default 'primary' + */ + variant?: ButtonVariant; + + /** + * Button size + * @default 'medium' + */ + size?: ButtonSize; + + /** + * Whether button is disabled + * @default false + */ + disabled?: boolean; + + /** + * Whether button is in loading state + * @default false + */ + loading?: boolean; + + /** + * Position when used in a button group + * 'left' = first button, 'right' = last button, 'standalone' = single button + * @default 'standalone' + */ + position?: ButtonPosition; + + /** + * Additional className/style (platform-specific) + */ + className?: string; + style?: any; + + /** + * Test ID for testing + */ + testID?: string; + + /** + * Accessibility label + */ + accessibilityLabel?: string; +} + +export interface InputProps { + /** + * Input label + */ + label?: string; + + /** + * Input placeholder + */ + placeholder?: string; + + /** + * Input value + */ + value?: string; + + /** + * Change handler + */ + onChangeText?: (text: string) => void; + + /** + * Error message + */ + error?: string; + + /** + * Whether input is disabled + */ + disabled?: boolean; + + /** + * Input type (web only) + */ + type?: 'text' | 'email' | 'password' | 'number' | 'tel'; + + /** + * Whether input is required + */ + required?: boolean; + + /** + * Additional className/style + */ + className?: string; + style?: any; + + /** + * Test ID + */ + testID?: string; +} + +export interface CardProps { + /** + * Card content + */ + children: React.ReactNode; + + /** + * Card title + */ + title?: string; + + /** + * Card subtitle + */ + subtitle?: string; + + /** + * Whether card is elevated (has shadow) + * @default true + */ + elevated?: boolean; + + /** + * Additional className/style + */ + className?: string; + style?: any; + + /** + * Click handler (makes card clickable) + */ + onPress?: () => void; + + /** + * Test ID + */ + testID?: string; +} + +export interface BadgeProps { + /** + * Badge content + */ + children: React.ReactNode; + + /** + * Badge variant + * @default 'neutral' + */ + variant?: 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | 'neutral'; + + /** + * Badge size + * @default 'medium' + */ + size?: 'small' | 'medium' | 'large'; + + /** + * Additional className/style + */ + className?: string; + style?: any; + + /** + * Test ID + */ + testID?: string; +} + +export type ThemeMode = 'light' | 'dark'; diff --git a/packages/components/src/shared/utils.ts b/packages/components/src/shared/utils.ts new file mode 100644 index 000000000..bd56cbe5d --- /dev/null +++ b/packages/components/src/shared/utils.ts @@ -0,0 +1,82 @@ +/** + * Shared Utilities for ODE Components + * + * Platform-agnostic utility functions + */ + +import { ButtonVariant, ButtonPosition, ThemeMode } from './types'; + +/** + * Get the opposite button variant for paired buttons + */ +export function getOppositeVariant(variant: ButtonVariant): ButtonVariant { + switch (variant) { + case 'primary': + return 'secondary'; + case 'secondary': + return 'primary'; + case 'neutral': + return 'neutral'; + default: + return 'primary'; + } +} + +/** + * Get text color for button based on variant and mode + */ +export function getButtonTextColor( + variant: ButtonVariant, + isHovered: boolean, + mode: ThemeMode = 'light' +): string { + if (isHovered) { + // When hovered, text should contrast with the background + return mode === 'light' ? '#FFFFFF' : '#000000'; + } + + // When not hovered, text matches border color + // This will be handled by the component implementation + return 'inherit'; +} + +/** + * Get border color for button variant + */ +export function getButtonBorderColor(variant: ButtonVariant): string { + // These will be replaced with actual token values in implementations + switch (variant) { + case 'primary': + return '#4F7F4E'; // brand.primary[500] + case 'secondary': + return '#E9B85B'; // brand.secondary[500] + case 'neutral': + return '#757575'; // neutral[600] + default: + return '#4F7F4E'; + } +} + +/** + * Get background color for button variant (used on hover) + */ +export function getButtonBackgroundColor(variant: ButtonVariant): string { + return getButtonBorderColor(variant); +} + +/** + * Determine if button should fade on left or right + * Left button fades on right, right button fades on left + */ +export function getFadeDirection(position: ButtonPosition): 'left' | 'right' { + switch (position) { + case 'left': + return 'right'; + case 'right': + return 'left'; + case 'standalone': + return 'right'; // Default fade on right for standalone + default: + return 'right'; + } +} diff --git a/packages/components/tsconfig.json b/packages/components/tsconfig.json new file mode 100644 index 000000000..3b3807dce --- /dev/null +++ b/packages/components/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "lib": ["ES2020", "DOM"], + "jsx": "react", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./dist", + "rootDir": "./src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +}