Start separating trivial components to their own categories outside the kitchen sink package.pull/1/head
@@ -0,0 +1,9 @@ | |||||
{ | |||||
"root": true, | |||||
"extends": [ | |||||
"lxsmnsyc/typescript" | |||||
], | |||||
"parserOptions": { | |||||
"project": "./tsconfig.eslint.json" | |||||
} | |||||
} |
@@ -0,0 +1,107 @@ | |||||
# Logs | |||||
logs | |||||
*.log | |||||
npm-debug.log* | |||||
yarn-debug.log* | |||||
yarn-error.log* | |||||
lerna-debug.log* | |||||
# Diagnostic reports (https://nodejs.org/api/report.html) | |||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | |||||
# Runtime data | |||||
pids | |||||
*.pid | |||||
*.seed | |||||
*.pid.lock | |||||
# Directory for instrumented libs generated by jscoverage/JSCover | |||||
lib-cov | |||||
# Coverage directory used by tools like istanbul | |||||
coverage | |||||
*.lcov | |||||
# nyc test coverage | |||||
.nyc_output | |||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | |||||
.grunt | |||||
# Bower dependency directory (https://bower.io/) | |||||
bower_components | |||||
# node-waf configuration | |||||
.lock-wscript | |||||
# Compiled binary addons (https://nodejs.org/api/addons.html) | |||||
build/Release | |||||
# Dependency directories | |||||
node_modules/ | |||||
jspm_packages/ | |||||
# TypeScript v1 declaration files | |||||
typings/ | |||||
# TypeScript cache | |||||
*.tsbuildinfo | |||||
# Optional npm cache directory | |||||
.npm | |||||
# Optional eslint cache | |||||
.eslintcache | |||||
# Microbundle cache | |||||
.rpt2_cache/ | |||||
.rts2_cache_cjs/ | |||||
.rts2_cache_es/ | |||||
.rts2_cache_umd/ | |||||
# Optional REPL history | |||||
.node_repl_history | |||||
# Output of 'npm pack' | |||||
*.tgz | |||||
# Yarn Integrity file | |||||
.yarn-integrity | |||||
# dotenv environment variables file | |||||
.env | |||||
.env.production | |||||
.env.development | |||||
# parcel-bundler cache (https://parceljs.org/) | |||||
.cache | |||||
# Next.js build output | |||||
.next | |||||
# Nuxt.js build / generate output | |||||
.nuxt | |||||
dist | |||||
# Gatsby files | |||||
.cache/ | |||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | |||||
# https://nextjs.org/blog/next-9-1#public-directory-support | |||||
# public | |||||
# vuepress build output | |||||
.vuepress/dist | |||||
# Serverless directories | |||||
.serverless/ | |||||
# FuseBox cache | |||||
.fusebox/ | |||||
# DynamoDB Local files | |||||
.dynamodb/ | |||||
# TernJS port file | |||||
.tern-port | |||||
.npmrc |
@@ -0,0 +1,7 @@ | |||||
MIT License Copyright (c) 2023 TheoryOfNekomata <allan.crisostomo@outlook.com> | |||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. | |||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@@ -0,0 +1,66 @@ | |||||
{ | |||||
"name": "@tesseract-design/web-base", | |||||
"version": "0.0.0", | |||||
"files": [ | |||||
"dist", | |||||
"src" | |||||
], | |||||
"engines": { | |||||
"node": ">=12" | |||||
}, | |||||
"license": "MIT", | |||||
"keywords": [ | |||||
"pridepack" | |||||
], | |||||
"devDependencies": { | |||||
"@types/node": "^18.14.1", | |||||
"eslint": "^8.35.0", | |||||
"eslint-config-lxsmnsyc": "^0.5.0", | |||||
"pridepack": "2.4.4", | |||||
"tslib": "^2.5.0", | |||||
"typescript": "^4.9.5", | |||||
"vitest": "^0.28.1" | |||||
}, | |||||
"scripts": { | |||||
"prepublishOnly": "pridepack clean && pridepack build", | |||||
"build": "pridepack build", | |||||
"type-check": "pridepack check", | |||||
"lint": "pridepack lint", | |||||
"clean": "pridepack clean", | |||||
"watch": "pridepack watch", | |||||
"start": "pridepack start", | |||||
"dev": "pridepack dev", | |||||
"test": "vitest" | |||||
}, | |||||
"private": false, | |||||
"description": "Base types for Tesseract.", | |||||
"repository": { | |||||
"url": "", | |||||
"type": "git" | |||||
}, | |||||
"homepage": "", | |||||
"bugs": { | |||||
"url": "" | |||||
}, | |||||
"author": "TheoryOfNekomata <allan.crisostomo@outlook.com>", | |||||
"publishConfig": { | |||||
"access": "public" | |||||
}, | |||||
"types": "./dist/types/index.d.ts", | |||||
"main": "./dist/cjs/production/index.js", | |||||
"module": "./dist/esm/production/index.js", | |||||
"exports": { | |||||
".": { | |||||
"development": { | |||||
"require": "./dist/cjs/development/index.js", | |||||
"import": "./dist/esm/development/index.js" | |||||
}, | |||||
"require": "./dist/cjs/production/index.js", | |||||
"import": "./dist/esm/production/index.js", | |||||
"types": "./dist/types/index.d.ts" | |||||
} | |||||
}, | |||||
"typesVersions": { | |||||
"*": {} | |||||
} | |||||
} |
@@ -0,0 +1,3 @@ | |||||
{ | |||||
"target": "es2018" | |||||
} |
@@ -0,0 +1,5 @@ | |||||
export type Type = 'submit' | 'reset' | 'button'; | |||||
export type Variant = 'bare' | 'filled' | 'outline'; | |||||
export type Size = 'small' | 'medium' | 'large'; |
@@ -0,0 +1,2 @@ | |||||
export * as Button from './button'; | |||||
export * as TextControl from './text-control'; |
@@ -0,0 +1,5 @@ | |||||
export type Size = 'small' | 'medium' | 'large'; | |||||
export type Variant = 'default' | 'alternate'; | |||||
export type InputType = 'text' | 'search'; |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types", "test"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./src", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,9 @@ | |||||
{ | |||||
"root": true, | |||||
"extends": [ | |||||
"lxsmnsyc/typescript/react" | |||||
], | |||||
"parserOptions": { | |||||
"project": "./tsconfig.eslint.json" | |||||
} | |||||
} |
@@ -0,0 +1,107 @@ | |||||
# Logs | |||||
logs | |||||
*.log | |||||
npm-debug.log* | |||||
yarn-debug.log* | |||||
yarn-error.log* | |||||
lerna-debug.log* | |||||
# Diagnostic reports (https://nodejs.org/api/report.html) | |||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | |||||
# Runtime data | |||||
pids | |||||
*.pid | |||||
*.seed | |||||
*.pid.lock | |||||
# Directory for instrumented libs generated by jscoverage/JSCover | |||||
lib-cov | |||||
# Coverage directory used by tools like istanbul | |||||
coverage | |||||
*.lcov | |||||
# nyc test coverage | |||||
.nyc_output | |||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | |||||
.grunt | |||||
# Bower dependency directory (https://bower.io/) | |||||
bower_components | |||||
# node-waf configuration | |||||
.lock-wscript | |||||
# Compiled binary addons (https://nodejs.org/api/addons.html) | |||||
build/Release | |||||
# Dependency directories | |||||
node_modules/ | |||||
jspm_packages/ | |||||
# TypeScript v1 declaration files | |||||
typings/ | |||||
# TypeScript cache | |||||
*.tsbuildinfo | |||||
# Optional npm cache directory | |||||
.npm | |||||
# Optional eslint cache | |||||
.eslintcache | |||||
# Microbundle cache | |||||
.rpt2_cache/ | |||||
.rts2_cache_cjs/ | |||||
.rts2_cache_es/ | |||||
.rts2_cache_umd/ | |||||
# Optional REPL history | |||||
.node_repl_history | |||||
# Output of 'npm pack' | |||||
*.tgz | |||||
# Yarn Integrity file | |||||
.yarn-integrity | |||||
# dotenv environment variables file | |||||
.env | |||||
.env.production | |||||
.env.development | |||||
# parcel-bundler cache (https://parceljs.org/) | |||||
.cache | |||||
# Next.js build output | |||||
.next | |||||
# Nuxt.js build / generate output | |||||
.nuxt | |||||
dist | |||||
# Gatsby files | |||||
.cache/ | |||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | |||||
# https://nextjs.org/blog/next-9-1#public-directory-support | |||||
# public | |||||
# vuepress build output | |||||
.vuepress/dist | |||||
# Serverless directories | |||||
.serverless/ | |||||
# FuseBox cache | |||||
.fusebox/ | |||||
# DynamoDB Local files | |||||
.dynamodb/ | |||||
# TernJS port file | |||||
.tern-port | |||||
.npmrc |
@@ -0,0 +1,7 @@ | |||||
MIT License Copyright (c) 2023 TheoryOfNekomata <allan.crisostomo@outlook.com> | |||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. | |||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@@ -0,0 +1,81 @@ | |||||
{ | |||||
"name": "@tesseract-design/web-action-react", | |||||
"version": "0.0.0", | |||||
"files": [ | |||||
"dist", | |||||
"src" | |||||
], | |||||
"engines": { | |||||
"node": ">=12" | |||||
}, | |||||
"license": "MIT", | |||||
"keywords": [ | |||||
"pridepack" | |||||
], | |||||
"devDependencies": { | |||||
"@testing-library/jest-dom": "^5.16.5", | |||||
"@testing-library/react": "^13.4.0", | |||||
"@types/node": "^18.14.1", | |||||
"@types/react": "^18.0.27", | |||||
"eslint": "^8.35.0", | |||||
"eslint-config-lxsmnsyc": "^0.5.0", | |||||
"jsdom": "^21.1.0", | |||||
"pridepack": "2.4.4", | |||||
"react": "^18.2.0", | |||||
"react-dom": "^18.2.0", | |||||
"react-test-renderer": "^18.2.0", | |||||
"tslib": "^2.5.0", | |||||
"typescript": "^4.9.5", | |||||
"vitest": "^0.28.1" | |||||
}, | |||||
"peerDependencies": { | |||||
"react": "^16.8 || ^17.0 || ^18.0", | |||||
"react-dom": "^16.8 || ^17.0 || ^18.0" | |||||
}, | |||||
"scripts": { | |||||
"prepublishOnly": "pridepack clean && pridepack build", | |||||
"build": "pridepack build", | |||||
"type-check": "pridepack check", | |||||
"lint": "pridepack lint", | |||||
"clean": "pridepack clean", | |||||
"watch": "pridepack watch", | |||||
"start": "pridepack start", | |||||
"dev": "pridepack dev", | |||||
"test": "vitest" | |||||
}, | |||||
"private": false, | |||||
"description": "Tesseract components for committing actions for forms.", | |||||
"repository": { | |||||
"url": "", | |||||
"type": "git" | |||||
}, | |||||
"homepage": "", | |||||
"bugs": { | |||||
"url": "" | |||||
}, | |||||
"author": "TheoryOfNekomata <allan.crisostomo@outlook.com>", | |||||
"publishConfig": { | |||||
"access": "public" | |||||
}, | |||||
"dependencies": { | |||||
"clsx": "^1.2.1", | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | |||||
"types": "./dist/types/index.d.ts", | |||||
"main": "./dist/cjs/production/index.js", | |||||
"module": "./dist/esm/production/index.js", | |||||
"exports": { | |||||
".": { | |||||
"development": { | |||||
"require": "./dist/cjs/development/index.js", | |||||
"import": "./dist/esm/development/index.js" | |||||
}, | |||||
"require": "./dist/cjs/production/index.js", | |||||
"import": "./dist/esm/production/index.js", | |||||
"types": "./dist/types/index.d.ts" | |||||
} | |||||
}, | |||||
"typesVersions": { | |||||
"*": {} | |||||
} | |||||
} |
@@ -0,0 +1,3 @@ | |||||
{ | |||||
"target": "es2018" | |||||
} |
@@ -1,17 +1,17 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import * as ButtonBase from '@tesseract-design/web-base-button'; | |||||
import { Button } from '@tesseract-design/web-base'; | |||||
export type ActionButtonDerivedElement = HTMLButtonElement; | export type ActionButtonDerivedElement = HTMLButtonElement; | ||||
export interface ActionButtonProps extends Omit<React.HTMLProps<ActionButtonDerivedElement>, 'type' | 'size'> { | export interface ActionButtonProps extends Omit<React.HTMLProps<ActionButtonDerivedElement>, 'type' | 'size'> { | ||||
type?: ButtonBase.ButtonType; | |||||
variant: ButtonBase.ButtonVariant; | |||||
type?: Button.Type; | |||||
variant: Button.Variant; | |||||
block?: boolean; | block?: boolean; | ||||
subtext?: React.ReactNode; | subtext?: React.ReactNode; | ||||
badge?: React.ReactNode; | badge?: React.ReactNode; | ||||
menuItem?: boolean; | menuItem?: boolean; | ||||
size?: ButtonBase.ButtonSize; | |||||
size?: Button.Size; | |||||
compact?: boolean; | compact?: boolean; | ||||
} | } | ||||
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types", "test"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./src", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,8 @@ | |||||
/// <reference types="vitest" /> | |||||
export default ({ | |||||
test: { | |||||
global: true, | |||||
environment: 'jsdom', | |||||
}, | |||||
}); |
@@ -0,0 +1,9 @@ | |||||
{ | |||||
"root": true, | |||||
"extends": [ | |||||
"lxsmnsyc/typescript/react" | |||||
], | |||||
"parserOptions": { | |||||
"project": "./tsconfig.eslint.json" | |||||
} | |||||
} |
@@ -0,0 +1,107 @@ | |||||
# Logs | |||||
logs | |||||
*.log | |||||
npm-debug.log* | |||||
yarn-debug.log* | |||||
yarn-error.log* | |||||
lerna-debug.log* | |||||
# Diagnostic reports (https://nodejs.org/api/report.html) | |||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | |||||
# Runtime data | |||||
pids | |||||
*.pid | |||||
*.seed | |||||
*.pid.lock | |||||
# Directory for instrumented libs generated by jscoverage/JSCover | |||||
lib-cov | |||||
# Coverage directory used by tools like istanbul | |||||
coverage | |||||
*.lcov | |||||
# nyc test coverage | |||||
.nyc_output | |||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | |||||
.grunt | |||||
# Bower dependency directory (https://bower.io/) | |||||
bower_components | |||||
# node-waf configuration | |||||
.lock-wscript | |||||
# Compiled binary addons (https://nodejs.org/api/addons.html) | |||||
build/Release | |||||
# Dependency directories | |||||
node_modules/ | |||||
jspm_packages/ | |||||
# TypeScript v1 declaration files | |||||
typings/ | |||||
# TypeScript cache | |||||
*.tsbuildinfo | |||||
# Optional npm cache directory | |||||
.npm | |||||
# Optional eslint cache | |||||
.eslintcache | |||||
# Microbundle cache | |||||
.rpt2_cache/ | |||||
.rts2_cache_cjs/ | |||||
.rts2_cache_es/ | |||||
.rts2_cache_umd/ | |||||
# Optional REPL history | |||||
.node_repl_history | |||||
# Output of 'npm pack' | |||||
*.tgz | |||||
# Yarn Integrity file | |||||
.yarn-integrity | |||||
# dotenv environment variables file | |||||
.env | |||||
.env.production | |||||
.env.development | |||||
# parcel-bundler cache (https://parceljs.org/) | |||||
.cache | |||||
# Next.js build output | |||||
.next | |||||
# Nuxt.js build / generate output | |||||
.nuxt | |||||
dist | |||||
# Gatsby files | |||||
.cache/ | |||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | |||||
# https://nextjs.org/blog/next-9-1#public-directory-support | |||||
# public | |||||
# vuepress build output | |||||
.vuepress/dist | |||||
# Serverless directories | |||||
.serverless/ | |||||
# FuseBox cache | |||||
.fusebox/ | |||||
# DynamoDB Local files | |||||
.dynamodb/ | |||||
# TernJS port file | |||||
.tern-port | |||||
.npmrc |
@@ -0,0 +1,7 @@ | |||||
MIT License Copyright (c) 2023 TheoryOfNekomata <allan.crisostomo@outlook.com> | |||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. | |||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@@ -0,0 +1,80 @@ | |||||
{ | |||||
"name": "@tesseract-design/web-color-react", | |||||
"version": "0.0.0", | |||||
"files": [ | |||||
"dist", | |||||
"src" | |||||
], | |||||
"engines": { | |||||
"node": ">=12" | |||||
}, | |||||
"license": "MIT", | |||||
"keywords": [ | |||||
"pridepack" | |||||
], | |||||
"devDependencies": { | |||||
"@testing-library/jest-dom": "^5.16.5", | |||||
"@testing-library/react": "^13.4.0", | |||||
"@types/node": "^18.14.1", | |||||
"@types/react": "^18.0.27", | |||||
"eslint": "^8.35.0", | |||||
"eslint-config-lxsmnsyc": "^0.5.0", | |||||
"jsdom": "^21.1.0", | |||||
"pridepack": "2.4.4", | |||||
"react": "^18.2.0", | |||||
"react-dom": "^18.2.0", | |||||
"react-test-renderer": "^18.2.0", | |||||
"tslib": "^2.5.0", | |||||
"typescript": "^4.9.5", | |||||
"vitest": "^0.28.1" | |||||
}, | |||||
"peerDependencies": { | |||||
"react": "^16.8 || ^17.0 || ^18.0", | |||||
"react-dom": "^16.8 || ^17.0 || ^18.0" | |||||
}, | |||||
"scripts": { | |||||
"prepublishOnly": "pridepack clean && pridepack build", | |||||
"build": "pridepack build", | |||||
"type-check": "pridepack check", | |||||
"lint": "pridepack lint", | |||||
"clean": "pridepack clean", | |||||
"watch": "pridepack watch", | |||||
"start": "pridepack start", | |||||
"dev": "pridepack dev", | |||||
"test": "vitest" | |||||
}, | |||||
"private": false, | |||||
"description": "Tesseract components for color data.", | |||||
"repository": { | |||||
"url": "", | |||||
"type": "git" | |||||
}, | |||||
"homepage": "", | |||||
"bugs": { | |||||
"url": "" | |||||
}, | |||||
"author": "TheoryOfNekomata <allan.crisostomo@outlook.com>", | |||||
"publishConfig": { | |||||
"access": "public" | |||||
}, | |||||
"dependencies": { | |||||
"clsx": "^1.2.1" | |||||
}, | |||||
"types": "./dist/types/index.d.ts", | |||||
"main": "./dist/cjs/production/index.js", | |||||
"module": "./dist/esm/production/index.js", | |||||
"exports": { | |||||
".": { | |||||
"development": { | |||||
"require": "./dist/cjs/development/index.js", | |||||
"import": "./dist/esm/development/index.js" | |||||
}, | |||||
"require": "./dist/cjs/production/index.js", | |||||
"import": "./dist/esm/production/index.js", | |||||
"types": "./dist/types/index.d.ts" | |||||
} | |||||
}, | |||||
"typesVersions": { | |||||
"*": {} | |||||
} | |||||
} |
@@ -0,0 +1,3 @@ | |||||
{ | |||||
"target": "es2018" | |||||
} |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types", "test"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./src", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,8 @@ | |||||
/// <reference types="vitest" /> | |||||
export default ({ | |||||
test: { | |||||
global: true, | |||||
environment: 'jsdom', | |||||
}, | |||||
}); |
@@ -0,0 +1,9 @@ | |||||
{ | |||||
"root": true, | |||||
"extends": [ | |||||
"lxsmnsyc/typescript/react" | |||||
], | |||||
"parserOptions": { | |||||
"project": "./tsconfig.eslint.json" | |||||
} | |||||
} |
@@ -0,0 +1,107 @@ | |||||
# Logs | |||||
logs | |||||
*.log | |||||
npm-debug.log* | |||||
yarn-debug.log* | |||||
yarn-error.log* | |||||
lerna-debug.log* | |||||
# Diagnostic reports (https://nodejs.org/api/report.html) | |||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | |||||
# Runtime data | |||||
pids | |||||
*.pid | |||||
*.seed | |||||
*.pid.lock | |||||
# Directory for instrumented libs generated by jscoverage/JSCover | |||||
lib-cov | |||||
# Coverage directory used by tools like istanbul | |||||
coverage | |||||
*.lcov | |||||
# nyc test coverage | |||||
.nyc_output | |||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | |||||
.grunt | |||||
# Bower dependency directory (https://bower.io/) | |||||
bower_components | |||||
# node-waf configuration | |||||
.lock-wscript | |||||
# Compiled binary addons (https://nodejs.org/api/addons.html) | |||||
build/Release | |||||
# Dependency directories | |||||
node_modules/ | |||||
jspm_packages/ | |||||
# TypeScript v1 declaration files | |||||
typings/ | |||||
# TypeScript cache | |||||
*.tsbuildinfo | |||||
# Optional npm cache directory | |||||
.npm | |||||
# Optional eslint cache | |||||
.eslintcache | |||||
# Microbundle cache | |||||
.rpt2_cache/ | |||||
.rts2_cache_cjs/ | |||||
.rts2_cache_es/ | |||||
.rts2_cache_umd/ | |||||
# Optional REPL history | |||||
.node_repl_history | |||||
# Output of 'npm pack' | |||||
*.tgz | |||||
# Yarn Integrity file | |||||
.yarn-integrity | |||||
# dotenv environment variables file | |||||
.env | |||||
.env.production | |||||
.env.development | |||||
# parcel-bundler cache (https://parceljs.org/) | |||||
.cache | |||||
# Next.js build output | |||||
.next | |||||
# Nuxt.js build / generate output | |||||
.nuxt | |||||
dist | |||||
# Gatsby files | |||||
.cache/ | |||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | |||||
# https://nextjs.org/blog/next-9-1#public-directory-support | |||||
# public | |||||
# vuepress build output | |||||
.vuepress/dist | |||||
# Serverless directories | |||||
.serverless/ | |||||
# FuseBox cache | |||||
.fusebox/ | |||||
# DynamoDB Local files | |||||
.dynamodb/ | |||||
# TernJS port file | |||||
.tern-port | |||||
.npmrc |
@@ -0,0 +1,7 @@ | |||||
MIT License Copyright (c) 2023 TheoryOfNekomata <allan.crisostomo@outlook.com> | |||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. | |||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@@ -0,0 +1,81 @@ | |||||
{ | |||||
"name": "@tesseract-design/web-formatted-react", | |||||
"version": "0.0.0", | |||||
"files": [ | |||||
"dist", | |||||
"src" | |||||
], | |||||
"engines": { | |||||
"node": ">=12" | |||||
}, | |||||
"license": "MIT", | |||||
"keywords": [ | |||||
"pridepack" | |||||
], | |||||
"devDependencies": { | |||||
"@testing-library/jest-dom": "^5.16.5", | |||||
"@testing-library/react": "^13.4.0", | |||||
"@types/node": "^18.14.1", | |||||
"@types/react": "^18.0.27", | |||||
"eslint": "^8.35.0", | |||||
"eslint-config-lxsmnsyc": "^0.5.0", | |||||
"jsdom": "^21.1.0", | |||||
"pridepack": "2.4.4", | |||||
"react": "^18.2.0", | |||||
"react-dom": "^18.2.0", | |||||
"react-test-renderer": "^18.2.0", | |||||
"tslib": "^2.5.0", | |||||
"typescript": "^4.9.5", | |||||
"vitest": "^0.28.1" | |||||
}, | |||||
"peerDependencies": { | |||||
"react": "^16.8 || ^17.0 || ^18.0", | |||||
"react-dom": "^16.8 || ^17.0 || ^18.0" | |||||
}, | |||||
"scripts": { | |||||
"prepublishOnly": "pridepack clean && pridepack build", | |||||
"build": "pridepack build", | |||||
"type-check": "pridepack check", | |||||
"lint": "pridepack lint", | |||||
"clean": "pridepack clean", | |||||
"watch": "pridepack watch", | |||||
"start": "pridepack start", | |||||
"dev": "pridepack dev", | |||||
"test": "vitest" | |||||
}, | |||||
"private": false, | |||||
"description": "Tesseract components for formatted data.", | |||||
"repository": { | |||||
"url": "", | |||||
"type": "git" | |||||
}, | |||||
"homepage": "", | |||||
"bugs": { | |||||
"url": "" | |||||
}, | |||||
"author": "TheoryOfNekomata <allan.crisostomo@outlook.com>", | |||||
"publishConfig": { | |||||
"access": "public" | |||||
}, | |||||
"dependencies": { | |||||
"clsx": "^1.2.1", | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | |||||
"types": "./dist/types/index.d.ts", | |||||
"main": "./dist/cjs/production/index.js", | |||||
"module": "./dist/esm/production/index.js", | |||||
"exports": { | |||||
".": { | |||||
"development": { | |||||
"require": "./dist/cjs/development/index.js", | |||||
"import": "./dist/esm/development/index.js" | |||||
}, | |||||
"require": "./dist/cjs/production/index.js", | |||||
"import": "./dist/esm/production/index.js", | |||||
"types": "./dist/types/index.d.ts" | |||||
} | |||||
}, | |||||
"typesVersions": { | |||||
"*": {} | |||||
} | |||||
} |
@@ -0,0 +1,3 @@ | |||||
{ | |||||
"target": "es2018" | |||||
} |
@@ -1,5 +1,5 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import * as TextControlBase from '@/base/textcontrol'; | |||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
export type EmailInputDerivedElement = HTMLInputElement; | export type EmailInputDerivedElement = HTMLInputElement; | ||||
@@ -16,7 +16,7 @@ export interface EmailInputProps extends Omit<React.HTMLProps<EmailInputDerivedE | |||||
/** | /** | ||||
* Size of the component. | * Size of the component. | ||||
*/ | */ | ||||
size?: TextControlBase.TextControlSize, | |||||
size?: TextControl.Size, | |||||
/** | /** | ||||
* Additional description, usually graphical, indicating the nature of the component's value. | * Additional description, usually graphical, indicating the nature of the component's value. | ||||
*/ | */ | ||||
@@ -32,7 +32,7 @@ export interface EmailInputProps extends Omit<React.HTMLProps<EmailInputDerivedE | |||||
/** | /** | ||||
* Style of the component. | * Style of the component. | ||||
*/ | */ | ||||
variant?: TextControlBase.TextControlVariant, | |||||
variant?: TextControl.Variant, | |||||
/** | /** | ||||
* Is the label hidden? | * Is the label hidden? | ||||
*/ | */ |
@@ -1,5 +1,5 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import * as TextControlBase from '@/base/textcontrol'; | |||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
export type PhoneNumberInputDerivedElement = HTMLInputElement; | export type PhoneNumberInputDerivedElement = HTMLInputElement; | ||||
@@ -16,7 +16,7 @@ export interface PhoneNumberInputProps extends Omit<React.HTMLProps<PhoneNumberI | |||||
/** | /** | ||||
* Size of the component. | * Size of the component. | ||||
*/ | */ | ||||
size?: TextControlBase.TextControlSize, | |||||
size?: TextControl.Size, | |||||
/** | /** | ||||
* Additional description, usually graphical, indicating the nature of the component's value. | * Additional description, usually graphical, indicating the nature of the component's value. | ||||
*/ | */ | ||||
@@ -32,7 +32,7 @@ export interface PhoneNumberInputProps extends Omit<React.HTMLProps<PhoneNumberI | |||||
/** | /** | ||||
* Style of the component. | * Style of the component. | ||||
*/ | */ | ||||
variant?: TextControlBase.TextControlVariant, | |||||
variant?: TextControl.Variant, | |||||
/** | /** | ||||
* Is the label hidden? | * Is the label hidden? | ||||
*/ | */ |
@@ -1,5 +1,5 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import * as TextControlBase from '@/base/textcontrol'; | |||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
export type UrlInputDerivedElement = HTMLInputElement; | export type UrlInputDerivedElement = HTMLInputElement; | ||||
@@ -16,7 +16,7 @@ export interface UrlInputProps extends Omit<React.HTMLProps<UrlInputDerivedEleme | |||||
/** | /** | ||||
* Size of the component. | * Size of the component. | ||||
*/ | */ | ||||
size?: TextControlBase.TextControlSize, | |||||
size?: TextControl.Size, | |||||
/** | /** | ||||
* Additional description, usually graphical, indicating the nature of the component's value. | * Additional description, usually graphical, indicating the nature of the component's value. | ||||
*/ | */ | ||||
@@ -32,7 +32,7 @@ export interface UrlInputProps extends Omit<React.HTMLProps<UrlInputDerivedEleme | |||||
/** | /** | ||||
* Style of the component. | * Style of the component. | ||||
*/ | */ | ||||
variant?: TextControlBase.TextControlVariant, | |||||
variant?: TextControl.Variant, | |||||
/** | /** | ||||
* Is the label hidden? | * Is the label hidden? | ||||
*/ | */ |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types", "test"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./src", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,8 @@ | |||||
/// <reference types="vitest" /> | |||||
export default ({ | |||||
test: { | |||||
global: true, | |||||
environment: 'jsdom', | |||||
}, | |||||
}); |
@@ -0,0 +1,9 @@ | |||||
{ | |||||
"root": true, | |||||
"extends": [ | |||||
"lxsmnsyc/typescript/react" | |||||
], | |||||
"parserOptions": { | |||||
"project": "./tsconfig.eslint.json" | |||||
} | |||||
} |
@@ -0,0 +1,107 @@ | |||||
# Logs | |||||
logs | |||||
*.log | |||||
npm-debug.log* | |||||
yarn-debug.log* | |||||
yarn-error.log* | |||||
lerna-debug.log* | |||||
# Diagnostic reports (https://nodejs.org/api/report.html) | |||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | |||||
# Runtime data | |||||
pids | |||||
*.pid | |||||
*.seed | |||||
*.pid.lock | |||||
# Directory for instrumented libs generated by jscoverage/JSCover | |||||
lib-cov | |||||
# Coverage directory used by tools like istanbul | |||||
coverage | |||||
*.lcov | |||||
# nyc test coverage | |||||
.nyc_output | |||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | |||||
.grunt | |||||
# Bower dependency directory (https://bower.io/) | |||||
bower_components | |||||
# node-waf configuration | |||||
.lock-wscript | |||||
# Compiled binary addons (https://nodejs.org/api/addons.html) | |||||
build/Release | |||||
# Dependency directories | |||||
node_modules/ | |||||
jspm_packages/ | |||||
# TypeScript v1 declaration files | |||||
typings/ | |||||
# TypeScript cache | |||||
*.tsbuildinfo | |||||
# Optional npm cache directory | |||||
.npm | |||||
# Optional eslint cache | |||||
.eslintcache | |||||
# Microbundle cache | |||||
.rpt2_cache/ | |||||
.rts2_cache_cjs/ | |||||
.rts2_cache_es/ | |||||
.rts2_cache_umd/ | |||||
# Optional REPL history | |||||
.node_repl_history | |||||
# Output of 'npm pack' | |||||
*.tgz | |||||
# Yarn Integrity file | |||||
.yarn-integrity | |||||
# dotenv environment variables file | |||||
.env | |||||
.env.production | |||||
.env.development | |||||
# parcel-bundler cache (https://parceljs.org/) | |||||
.cache | |||||
# Next.js build output | |||||
.next | |||||
# Nuxt.js build / generate output | |||||
.nuxt | |||||
dist | |||||
# Gatsby files | |||||
.cache/ | |||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | |||||
# https://nextjs.org/blog/next-9-1#public-directory-support | |||||
# public | |||||
# vuepress build output | |||||
.vuepress/dist | |||||
# Serverless directories | |||||
.serverless/ | |||||
# FuseBox cache | |||||
.fusebox/ | |||||
# DynamoDB Local files | |||||
.dynamodb/ | |||||
# TernJS port file | |||||
.tern-port | |||||
.npmrc |
@@ -0,0 +1,7 @@ | |||||
MIT License Copyright (c) 2023 TheoryOfNekomata <allan.crisostomo@outlook.com> | |||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. | |||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@@ -0,0 +1,81 @@ | |||||
{ | |||||
"name": "@tesseract-design/web-freeform-react", | |||||
"version": "0.0.0", | |||||
"files": [ | |||||
"dist", | |||||
"src" | |||||
], | |||||
"engines": { | |||||
"node": ">=12" | |||||
}, | |||||
"license": "MIT", | |||||
"keywords": [ | |||||
"pridepack" | |||||
], | |||||
"devDependencies": { | |||||
"@testing-library/jest-dom": "^5.16.5", | |||||
"@testing-library/react": "^13.4.0", | |||||
"@types/node": "^18.14.1", | |||||
"@types/react": "^18.0.27", | |||||
"eslint": "^8.35.0", | |||||
"eslint-config-lxsmnsyc": "^0.5.0", | |||||
"jsdom": "^21.1.0", | |||||
"pridepack": "2.4.4", | |||||
"react": "^18.2.0", | |||||
"react-dom": "^18.2.0", | |||||
"react-test-renderer": "^18.2.0", | |||||
"tslib": "^2.5.0", | |||||
"typescript": "^4.9.5", | |||||
"vitest": "^0.28.1" | |||||
}, | |||||
"peerDependencies": { | |||||
"react": "^16.8 || ^17.0 || ^18.0", | |||||
"react-dom": "^16.8 || ^17.0 || ^18.0" | |||||
}, | |||||
"scripts": { | |||||
"prepublishOnly": "pridepack clean && pridepack build", | |||||
"build": "pridepack build", | |||||
"type-check": "pridepack check", | |||||
"lint": "pridepack lint", | |||||
"clean": "pridepack clean", | |||||
"watch": "pridepack watch", | |||||
"start": "pridepack start", | |||||
"dev": "pridepack dev", | |||||
"test": "vitest" | |||||
}, | |||||
"private": false, | |||||
"description": "Tesseract components for freeform data.", | |||||
"repository": { | |||||
"url": "", | |||||
"type": "git" | |||||
}, | |||||
"homepage": "", | |||||
"bugs": { | |||||
"url": "" | |||||
}, | |||||
"author": "TheoryOfNekomata <allan.crisostomo@outlook.com>", | |||||
"publishConfig": { | |||||
"access": "public" | |||||
}, | |||||
"dependencies": { | |||||
"clsx": "^1.2.1", | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | |||||
"types": "./dist/types/index.d.ts", | |||||
"main": "./dist/cjs/production/index.js", | |||||
"module": "./dist/esm/production/index.js", | |||||
"exports": { | |||||
".": { | |||||
"development": { | |||||
"require": "./dist/cjs/development/index.js", | |||||
"import": "./dist/esm/development/index.js" | |||||
}, | |||||
"require": "./dist/cjs/production/index.js", | |||||
"import": "./dist/esm/production/index.js", | |||||
"types": "./dist/types/index.d.ts" | |||||
} | |||||
}, | |||||
"typesVersions": { | |||||
"*": {} | |||||
} | |||||
} |
@@ -0,0 +1,3 @@ | |||||
{ | |||||
"target": "es2018" | |||||
} |
@@ -1,5 +1,5 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import * as TextControlBase from '@tesseract-design/web-base-textcontrol'; | |||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
export type MaskedTextInputDerivedElement = HTMLInputElement; | export type MaskedTextInputDerivedElement = HTMLInputElement; | ||||
@@ -16,7 +16,7 @@ export interface MaskedTextInputProps extends Omit<React.HTMLProps<MaskedTextInp | |||||
/** | /** | ||||
* Size of the component. | * Size of the component. | ||||
*/ | */ | ||||
size?: TextControlBase.TextControlSize, | |||||
size?: TextControl.Size, | |||||
/** | /** | ||||
* Additional description, usually graphical, indicating the nature of the component's value. | * Additional description, usually graphical, indicating the nature of the component's value. | ||||
*/ | */ | ||||
@@ -32,7 +32,7 @@ export interface MaskedTextInputProps extends Omit<React.HTMLProps<MaskedTextInp | |||||
/** | /** | ||||
* Style of the component. | * Style of the component. | ||||
*/ | */ | ||||
variant?: TextControlBase.TextControlVariant, | |||||
variant?: TextControl.Variant, | |||||
/** | /** | ||||
* Is the label hidden? | * Is the label hidden? | ||||
*/ | */ |
@@ -1,5 +1,5 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import * as TextControlBase from '@tesseract-design/web-base-textcontrol'; | |||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
export type MultilineTextInputDerivedElement = HTMLTextAreaElement; | export type MultilineTextInputDerivedElement = HTMLTextAreaElement; | ||||
@@ -16,7 +16,7 @@ export interface MultilineTextInputProps extends Omit<React.HTMLProps<MultilineT | |||||
/** | /** | ||||
* Size of the component. | * Size of the component. | ||||
*/ | */ | ||||
size?: TextControlBase.TextControlSize, | |||||
size?: TextControl.Size, | |||||
/** | /** | ||||
* Additional description, usually graphical, indicating the nature of the component's value. | * Additional description, usually graphical, indicating the nature of the component's value. | ||||
*/ | */ | ||||
@@ -32,7 +32,7 @@ export interface MultilineTextInputProps extends Omit<React.HTMLProps<MultilineT | |||||
/** | /** | ||||
* Style of the component. | * Style of the component. | ||||
*/ | */ | ||||
variant?: TextControlBase.TextControlVariant, | |||||
variant?: TextControl.Variant, | |||||
/** | /** | ||||
* Is the label hidden? | * Is the label hidden? | ||||
*/ | */ |
@@ -1,5 +1,5 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import * as TextControlBase from '@tesseract-design/web-base-textcontrol'; | |||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
export type TextInputDerivedElement = HTMLInputElement; | export type TextInputDerivedElement = HTMLInputElement; | ||||
@@ -16,7 +16,7 @@ export interface TextInputProps extends Omit<React.HTMLProps<TextInputDerivedEle | |||||
/** | /** | ||||
* Size of the component. | * Size of the component. | ||||
*/ | */ | ||||
size?: TextControlBase.TextControlSize, | |||||
size?: TextControl.Size, | |||||
/** | /** | ||||
* Additional description, usually graphical, indicating the nature of the component's value. | * Additional description, usually graphical, indicating the nature of the component's value. | ||||
*/ | */ | ||||
@@ -32,11 +32,11 @@ export interface TextInputProps extends Omit<React.HTMLProps<TextInputDerivedEle | |||||
/** | /** | ||||
* Type of the component value. | * Type of the component value. | ||||
*/ | */ | ||||
type?: TextControlBase.TextControlInputType, | |||||
type?: TextControl.InputType, | |||||
/** | /** | ||||
* Style of the component. | * Style of the component. | ||||
*/ | */ | ||||
variant?: TextControlBase.TextControlVariant, | |||||
variant?: TextControl.Variant, | |||||
/** | /** | ||||
* Is the label hidden? | * Is the label hidden? | ||||
*/ | */ |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types", "test"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./src", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,8 @@ | |||||
/// <reference types="vitest" /> | |||||
export default ({ | |||||
test: { | |||||
global: true, | |||||
environment: 'jsdom', | |||||
}, | |||||
}); |
@@ -0,0 +1,9 @@ | |||||
{ | |||||
"root": true, | |||||
"extends": [ | |||||
"lxsmnsyc/typescript/react" | |||||
], | |||||
"parserOptions": { | |||||
"project": "./tsconfig.eslint.json" | |||||
} | |||||
} |
@@ -0,0 +1,107 @@ | |||||
# Logs | |||||
logs | |||||
*.log | |||||
npm-debug.log* | |||||
yarn-debug.log* | |||||
yarn-error.log* | |||||
lerna-debug.log* | |||||
# Diagnostic reports (https://nodejs.org/api/report.html) | |||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | |||||
# Runtime data | |||||
pids | |||||
*.pid | |||||
*.seed | |||||
*.pid.lock | |||||
# Directory for instrumented libs generated by jscoverage/JSCover | |||||
lib-cov | |||||
# Coverage directory used by tools like istanbul | |||||
coverage | |||||
*.lcov | |||||
# nyc test coverage | |||||
.nyc_output | |||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | |||||
.grunt | |||||
# Bower dependency directory (https://bower.io/) | |||||
bower_components | |||||
# node-waf configuration | |||||
.lock-wscript | |||||
# Compiled binary addons (https://nodejs.org/api/addons.html) | |||||
build/Release | |||||
# Dependency directories | |||||
node_modules/ | |||||
jspm_packages/ | |||||
# TypeScript v1 declaration files | |||||
typings/ | |||||
# TypeScript cache | |||||
*.tsbuildinfo | |||||
# Optional npm cache directory | |||||
.npm | |||||
# Optional eslint cache | |||||
.eslintcache | |||||
# Microbundle cache | |||||
.rpt2_cache/ | |||||
.rts2_cache_cjs/ | |||||
.rts2_cache_es/ | |||||
.rts2_cache_umd/ | |||||
# Optional REPL history | |||||
.node_repl_history | |||||
# Output of 'npm pack' | |||||
*.tgz | |||||
# Yarn Integrity file | |||||
.yarn-integrity | |||||
# dotenv environment variables file | |||||
.env | |||||
.env.production | |||||
.env.development | |||||
# parcel-bundler cache (https://parceljs.org/) | |||||
.cache | |||||
# Next.js build output | |||||
.next | |||||
# Nuxt.js build / generate output | |||||
.nuxt | |||||
dist | |||||
# Gatsby files | |||||
.cache/ | |||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | |||||
# https://nextjs.org/blog/next-9-1#public-directory-support | |||||
# public | |||||
# vuepress build output | |||||
.vuepress/dist | |||||
# Serverless directories | |||||
.serverless/ | |||||
# FuseBox cache | |||||
.fusebox/ | |||||
# DynamoDB Local files | |||||
.dynamodb/ | |||||
# TernJS port file | |||||
.tern-port | |||||
.npmrc |
@@ -0,0 +1,7 @@ | |||||
MIT License Copyright (c) 2023 TheoryOfNekomata <allan.crisostomo@outlook.com> | |||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. | |||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@@ -0,0 +1,80 @@ | |||||
{ | |||||
"name": "@tesseract-design/web-information-react", | |||||
"version": "0.0.0", | |||||
"files": [ | |||||
"dist", | |||||
"src" | |||||
], | |||||
"engines": { | |||||
"node": ">=12" | |||||
}, | |||||
"license": "MIT", | |||||
"keywords": [ | |||||
"pridepack" | |||||
], | |||||
"devDependencies": { | |||||
"@testing-library/jest-dom": "^5.16.5", | |||||
"@testing-library/react": "^13.4.0", | |||||
"@types/node": "^18.14.1", | |||||
"@types/react": "^18.0.27", | |||||
"eslint": "^8.35.0", | |||||
"eslint-config-lxsmnsyc": "^0.5.0", | |||||
"jsdom": "^21.1.0", | |||||
"pridepack": "2.4.4", | |||||
"react": "^18.2.0", | |||||
"react-dom": "^18.2.0", | |||||
"react-test-renderer": "^18.2.0", | |||||
"tslib": "^2.5.0", | |||||
"typescript": "^4.9.5", | |||||
"vitest": "^0.28.1" | |||||
}, | |||||
"peerDependencies": { | |||||
"react": "^16.8 || ^17.0 || ^18.0", | |||||
"react-dom": "^16.8 || ^17.0 || ^18.0" | |||||
}, | |||||
"scripts": { | |||||
"prepublishOnly": "pridepack clean && pridepack build", | |||||
"build": "pridepack build", | |||||
"type-check": "pridepack check", | |||||
"lint": "pridepack lint", | |||||
"clean": "pridepack clean", | |||||
"watch": "pridepack watch", | |||||
"start": "pridepack start", | |||||
"dev": "pridepack dev", | |||||
"test": "vitest" | |||||
}, | |||||
"private": false, | |||||
"description": "Tesseract components for displaying data.", | |||||
"repository": { | |||||
"url": "", | |||||
"type": "git" | |||||
}, | |||||
"homepage": "", | |||||
"bugs": { | |||||
"url": "" | |||||
}, | |||||
"author": "TheoryOfNekomata <allan.crisostomo@outlook.com>", | |||||
"publishConfig": { | |||||
"access": "public" | |||||
}, | |||||
"dependencies": { | |||||
"clsx": "^1.2.1" | |||||
}, | |||||
"types": "./dist/types/index.d.ts", | |||||
"main": "./dist/cjs/production/index.js", | |||||
"module": "./dist/esm/production/index.js", | |||||
"exports": { | |||||
".": { | |||||
"development": { | |||||
"require": "./dist/cjs/development/index.js", | |||||
"import": "./dist/esm/development/index.js" | |||||
}, | |||||
"require": "./dist/cjs/production/index.js", | |||||
"import": "./dist/esm/production/index.js", | |||||
"types": "./dist/types/index.d.ts" | |||||
} | |||||
}, | |||||
"typesVersions": { | |||||
"*": {} | |||||
} | |||||
} |
@@ -0,0 +1,3 @@ | |||||
{ | |||||
"target": "es2018" | |||||
} |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types", "test"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./src", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,8 @@ | |||||
/// <reference types="vitest" /> | |||||
export default ({ | |||||
test: { | |||||
global: true, | |||||
environment: 'jsdom', | |||||
}, | |||||
}); |
@@ -0,0 +1,9 @@ | |||||
{ | |||||
"root": true, | |||||
"extends": [ | |||||
"lxsmnsyc/typescript/react" | |||||
], | |||||
"parserOptions": { | |||||
"project": "./tsconfig.eslint.json" | |||||
} | |||||
} |
@@ -0,0 +1,107 @@ | |||||
# Logs | |||||
logs | |||||
*.log | |||||
npm-debug.log* | |||||
yarn-debug.log* | |||||
yarn-error.log* | |||||
lerna-debug.log* | |||||
# Diagnostic reports (https://nodejs.org/api/report.html) | |||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | |||||
# Runtime data | |||||
pids | |||||
*.pid | |||||
*.seed | |||||
*.pid.lock | |||||
# Directory for instrumented libs generated by jscoverage/JSCover | |||||
lib-cov | |||||
# Coverage directory used by tools like istanbul | |||||
coverage | |||||
*.lcov | |||||
# nyc test coverage | |||||
.nyc_output | |||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | |||||
.grunt | |||||
# Bower dependency directory (https://bower.io/) | |||||
bower_components | |||||
# node-waf configuration | |||||
.lock-wscript | |||||
# Compiled binary addons (https://nodejs.org/api/addons.html) | |||||
build/Release | |||||
# Dependency directories | |||||
node_modules/ | |||||
jspm_packages/ | |||||
# TypeScript v1 declaration files | |||||
typings/ | |||||
# TypeScript cache | |||||
*.tsbuildinfo | |||||
# Optional npm cache directory | |||||
.npm | |||||
# Optional eslint cache | |||||
.eslintcache | |||||
# Microbundle cache | |||||
.rpt2_cache/ | |||||
.rts2_cache_cjs/ | |||||
.rts2_cache_es/ | |||||
.rts2_cache_umd/ | |||||
# Optional REPL history | |||||
.node_repl_history | |||||
# Output of 'npm pack' | |||||
*.tgz | |||||
# Yarn Integrity file | |||||
.yarn-integrity | |||||
# dotenv environment variables file | |||||
.env | |||||
.env.production | |||||
.env.development | |||||
# parcel-bundler cache (https://parceljs.org/) | |||||
.cache | |||||
# Next.js build output | |||||
.next | |||||
# Nuxt.js build / generate output | |||||
.nuxt | |||||
dist | |||||
# Gatsby files | |||||
.cache/ | |||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | |||||
# https://nextjs.org/blog/next-9-1#public-directory-support | |||||
# public | |||||
# vuepress build output | |||||
.vuepress/dist | |||||
# Serverless directories | |||||
.serverless/ | |||||
# FuseBox cache | |||||
.fusebox/ | |||||
# DynamoDB Local files | |||||
.dynamodb/ | |||||
# TernJS port file | |||||
.tern-port | |||||
.npmrc |
@@ -0,0 +1,7 @@ | |||||
MIT License Copyright (c) 2023 TheoryOfNekomata <allan.crisostomo@outlook.com> | |||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. | |||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@@ -0,0 +1,81 @@ | |||||
{ | |||||
"name": "@tesseract-design/web-navigation-react", | |||||
"version": "0.0.0", | |||||
"files": [ | |||||
"dist", | |||||
"src" | |||||
], | |||||
"engines": { | |||||
"node": ">=12" | |||||
}, | |||||
"license": "MIT", | |||||
"keywords": [ | |||||
"pridepack" | |||||
], | |||||
"devDependencies": { | |||||
"@testing-library/jest-dom": "^5.16.5", | |||||
"@testing-library/react": "^13.4.0", | |||||
"@types/node": "^18.14.1", | |||||
"@types/react": "^18.0.27", | |||||
"eslint": "^8.35.0", | |||||
"eslint-config-lxsmnsyc": "^0.5.0", | |||||
"jsdom": "^21.1.0", | |||||
"pridepack": "2.4.4", | |||||
"react": "^18.2.0", | |||||
"react-dom": "^18.2.0", | |||||
"react-test-renderer": "^18.2.0", | |||||
"tslib": "^2.5.0", | |||||
"typescript": "^4.9.5", | |||||
"vitest": "^0.28.1" | |||||
}, | |||||
"peerDependencies": { | |||||
"react": "^16.8 || ^17.0 || ^18.0", | |||||
"react-dom": "^16.8 || ^17.0 || ^18.0" | |||||
}, | |||||
"scripts": { | |||||
"prepublishOnly": "pridepack clean && pridepack build", | |||||
"build": "pridepack build", | |||||
"type-check": "pridepack check", | |||||
"lint": "pridepack lint", | |||||
"clean": "pridepack clean", | |||||
"watch": "pridepack watch", | |||||
"start": "pridepack start", | |||||
"dev": "pridepack dev", | |||||
"test": "vitest" | |||||
}, | |||||
"private": false, | |||||
"description": "Tesseract components for navigation.", | |||||
"repository": { | |||||
"url": "", | |||||
"type": "git" | |||||
}, | |||||
"homepage": "", | |||||
"bugs": { | |||||
"url": "" | |||||
}, | |||||
"author": "TheoryOfNekomata <allan.crisostomo@outlook.com>", | |||||
"publishConfig": { | |||||
"access": "public" | |||||
}, | |||||
"dependencies": { | |||||
"clsx": "^1.2.1", | |||||
"@tesseract-design/web-base": "workspace:*" | |||||
}, | |||||
"types": "./dist/types/index.d.ts", | |||||
"main": "./dist/cjs/production/index.js", | |||||
"module": "./dist/esm/production/index.js", | |||||
"exports": { | |||||
".": { | |||||
"development": { | |||||
"require": "./dist/cjs/development/index.js", | |||||
"import": "./dist/esm/development/index.js" | |||||
}, | |||||
"require": "./dist/cjs/production/index.js", | |||||
"import": "./dist/esm/production/index.js", | |||||
"types": "./dist/types/index.d.ts" | |||||
} | |||||
}, | |||||
"typesVersions": { | |||||
"*": {} | |||||
} | |||||
} |
@@ -0,0 +1,3 @@ | |||||
{ | |||||
"target": "es2018" | |||||
} |
@@ -1,16 +1,16 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import * as ButtonBase from '@tesseract-design/web-base-button'; | |||||
import { Button } from '@tesseract-design/web-base'; | |||||
export type LinkButtonDerivedElement = HTMLAnchorElement; | export type LinkButtonDerivedElement = HTMLAnchorElement; | ||||
export interface LinkButtonProps extends Omit<React.HTMLProps<LinkButtonDerivedElement>, 'size'> { | export interface LinkButtonProps extends Omit<React.HTMLProps<LinkButtonDerivedElement>, 'size'> { | ||||
block?: boolean; | block?: boolean; | ||||
variant: ButtonBase.ButtonVariant; | |||||
variant: Button.Variant; | |||||
subtext?: React.ReactNode; | subtext?: React.ReactNode; | ||||
badge?: React.ReactNode; | badge?: React.ReactNode; | ||||
menuItem?: boolean; | menuItem?: boolean; | ||||
size?: ButtonBase.ButtonSize; | |||||
size?: Button.Size; | |||||
compact?: boolean; | compact?: boolean; | ||||
component?: React.ElementType; | component?: React.ElementType; | ||||
} | } |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types", "test"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./src", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,8 @@ | |||||
/// <reference types="vitest" /> | |||||
export default ({ | |||||
test: { | |||||
global: true, | |||||
environment: 'jsdom', | |||||
}, | |||||
}); |
@@ -0,0 +1,9 @@ | |||||
{ | |||||
"root": true, | |||||
"extends": [ | |||||
"lxsmnsyc/typescript/react" | |||||
], | |||||
"parserOptions": { | |||||
"project": "./tsconfig.eslint.json" | |||||
} | |||||
} |
@@ -0,0 +1,107 @@ | |||||
# Logs | |||||
logs | |||||
*.log | |||||
npm-debug.log* | |||||
yarn-debug.log* | |||||
yarn-error.log* | |||||
lerna-debug.log* | |||||
# Diagnostic reports (https://nodejs.org/api/report.html) | |||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | |||||
# Runtime data | |||||
pids | |||||
*.pid | |||||
*.seed | |||||
*.pid.lock | |||||
# Directory for instrumented libs generated by jscoverage/JSCover | |||||
lib-cov | |||||
# Coverage directory used by tools like istanbul | |||||
coverage | |||||
*.lcov | |||||
# nyc test coverage | |||||
.nyc_output | |||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | |||||
.grunt | |||||
# Bower dependency directory (https://bower.io/) | |||||
bower_components | |||||
# node-waf configuration | |||||
.lock-wscript | |||||
# Compiled binary addons (https://nodejs.org/api/addons.html) | |||||
build/Release | |||||
# Dependency directories | |||||
node_modules/ | |||||
jspm_packages/ | |||||
# TypeScript v1 declaration files | |||||
typings/ | |||||
# TypeScript cache | |||||
*.tsbuildinfo | |||||
# Optional npm cache directory | |||||
.npm | |||||
# Optional eslint cache | |||||
.eslintcache | |||||
# Microbundle cache | |||||
.rpt2_cache/ | |||||
.rts2_cache_cjs/ | |||||
.rts2_cache_es/ | |||||
.rts2_cache_umd/ | |||||
# Optional REPL history | |||||
.node_repl_history | |||||
# Output of 'npm pack' | |||||
*.tgz | |||||
# Yarn Integrity file | |||||
.yarn-integrity | |||||
# dotenv environment variables file | |||||
.env | |||||
.env.production | |||||
.env.development | |||||
# parcel-bundler cache (https://parceljs.org/) | |||||
.cache | |||||
# Next.js build output | |||||
.next | |||||
# Nuxt.js build / generate output | |||||
.nuxt | |||||
dist | |||||
# Gatsby files | |||||
.cache/ | |||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | |||||
# https://nextjs.org/blog/next-9-1#public-directory-support | |||||
# public | |||||
# vuepress build output | |||||
.vuepress/dist | |||||
# Serverless directories | |||||
.serverless/ | |||||
# FuseBox cache | |||||
.fusebox/ | |||||
# DynamoDB Local files | |||||
.dynamodb/ | |||||
# TernJS port file | |||||
.tern-port | |||||
.npmrc |
@@ -0,0 +1,7 @@ | |||||
MIT License Copyright (c) 2023 TheoryOfNekomata <allan.crisostomo@outlook.com> | |||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. | |||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@@ -0,0 +1,77 @@ | |||||
{ | |||||
"name": "@modal-sh/react-utils", | |||||
"version": "0.0.0", | |||||
"files": [ | |||||
"dist", | |||||
"src" | |||||
], | |||||
"engines": { | |||||
"node": ">=12" | |||||
}, | |||||
"license": "MIT", | |||||
"keywords": [ | |||||
"pridepack" | |||||
], | |||||
"devDependencies": { | |||||
"@testing-library/jest-dom": "^5.16.5", | |||||
"@testing-library/react": "^13.4.0", | |||||
"@types/node": "^18.14.1", | |||||
"@types/react": "^18.0.27", | |||||
"eslint": "^8.35.0", | |||||
"eslint-config-lxsmnsyc": "^0.5.0", | |||||
"jsdom": "^21.1.0", | |||||
"pridepack": "2.4.4", | |||||
"react": "^18.2.0", | |||||
"react-dom": "^18.2.0", | |||||
"react-test-renderer": "^18.2.0", | |||||
"tslib": "^2.5.0", | |||||
"typescript": "^4.9.5", | |||||
"vitest": "^0.28.1" | |||||
}, | |||||
"peerDependencies": { | |||||
"react": "^16.8 || ^17.0 || ^18.0", | |||||
"react-dom": "^16.8 || ^17.0 || ^18.0" | |||||
}, | |||||
"scripts": { | |||||
"prepublishOnly": "pridepack clean && pridepack build", | |||||
"build": "pridepack build", | |||||
"type-check": "pridepack check", | |||||
"lint": "pridepack lint", | |||||
"clean": "pridepack clean", | |||||
"watch": "pridepack watch", | |||||
"start": "pridepack start", | |||||
"dev": "pridepack dev", | |||||
"test": "vitest" | |||||
}, | |||||
"private": false, | |||||
"description": "Utilities for React.", | |||||
"repository": { | |||||
"url": "", | |||||
"type": "git" | |||||
}, | |||||
"homepage": "", | |||||
"bugs": { | |||||
"url": "" | |||||
}, | |||||
"author": "TheoryOfNekomata <allan.crisostomo@outlook.com>", | |||||
"publishConfig": { | |||||
"access": "public" | |||||
}, | |||||
"types": "./dist/types/index.d.ts", | |||||
"main": "./dist/cjs/production/index.js", | |||||
"module": "./dist/esm/production/index.js", | |||||
"exports": { | |||||
".": { | |||||
"development": { | |||||
"require": "./dist/cjs/development/index.js", | |||||
"import": "./dist/esm/development/index.js" | |||||
}, | |||||
"require": "./dist/cjs/production/index.js", | |||||
"import": "./dist/esm/production/index.js", | |||||
"types": "./dist/types/index.d.ts" | |||||
} | |||||
}, | |||||
"typesVersions": { | |||||
"*": {} | |||||
} | |||||
} |
@@ -0,0 +1,3 @@ | |||||
{ | |||||
"target": "es2018" | |||||
} |
@@ -40,4 +40,4 @@ export const delegateTriggerEvent = <T extends HTMLElement>(eventName: string, t | |||||
} | } | ||||
const simulatedEvent = new Event(eventName, {bubbles: true}); | const simulatedEvent = new Event(eventName, {bubbles: true}); | ||||
target.dispatchEvent(simulatedEvent); | target.dispatchEvent(simulatedEvent); | ||||
} | |||||
}; |
@@ -0,0 +1,18 @@ | |||||
import * as React from 'react'; | |||||
export interface UseEnhancedOptions { | |||||
clientSide: boolean; | |||||
initial?: boolean; | |||||
} | |||||
export const useClientSide = (options: UseEnhancedOptions) => { | |||||
const { clientSide: enhancedProp, initial = false } = options; | |||||
const [enhanced, setEnhanced] = React.useState(initial); | |||||
React.useEffect(() => { | |||||
setEnhanced(enhancedProp); | |||||
}, [enhancedProp]); | |||||
return React.useMemo(() => ({ | |||||
clientSide: enhanced, | |||||
}), [enhanced]); | |||||
}; |
@@ -0,0 +1,2 @@ | |||||
export * from './hooks/client-side'; | |||||
export * from './event'; |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types", "test"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./src", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,8 @@ | |||||
/// <reference types="vitest" /> | |||||
export default ({ | |||||
test: { | |||||
global: true, | |||||
environment: 'jsdom', | |||||
}, | |||||
}); |
@@ -33,7 +33,15 @@ | |||||
"@modal-soft/audio-utils": "workspace:*", | "@modal-soft/audio-utils": "workspace:*", | ||||
"@modal-soft/image-utils": "workspace:*", | "@modal-soft/image-utils": "workspace:*", | ||||
"@modal-soft/text-utils": "workspace:*", | "@modal-soft/text-utils": "workspace:*", | ||||
"@modal-soft/video-utils": "workspace:*" | |||||
"@modal-soft/video-utils": "workspace:*", | |||||
"@modal-sh/react-utils": "workspace:*", | |||||
"@tesseract-design/web-base": "workspace:*", | |||||
"@tesseract-design/web-action-react": "workspace:*", | |||||
"@tesseract-design/web-color-react": "workspace:*", | |||||
"@tesseract-design/web-formatted-react": "workspace:*", | |||||
"@tesseract-design/web-freeform-react": "workspace:*", | |||||
"@tesseract-design/web-information-react": "workspace:*", | |||||
"@tesseract-design/web-navigation-react": "workspace:*" | |||||
}, | }, | ||||
"devDependencies": { | "devDependencies": { | ||||
"@types/mime-types": "^2.1.1", | "@types/mime-types": "^2.1.1", | ||||
@@ -1,5 +0,0 @@ | |||||
export type ButtonType = 'submit' | 'reset' | 'button'; | |||||
export type ButtonVariant = 'bare' | 'filled' | 'outline'; | |||||
export type ButtonSize = 'small' | 'medium' | 'large'; |
@@ -1,5 +0,0 @@ | |||||
export type TextControlSize = 'small' | 'medium' | 'large'; | |||||
export type TextControlVariant = 'default' | 'alternate'; | |||||
export type TextControlInputType = 'text' | 'search'; |
@@ -13,8 +13,8 @@ import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {SpectrogramCanvas, WaveformCanvas} from '@modal-soft/react-wavesurfer'; | import {SpectrogramCanvas, WaveformCanvas} from '@modal-soft/react-wavesurfer'; | ||||
import {Slider} from '@/categories/number/react'; | import {Slider} from '@/categories/number/react'; | ||||
import {KeyValueTable} from '@/categories/information/react'; | |||||
import {useEnhanced} from '@modal-soft/react-utils'; | |||||
import {KeyValueTable} from '../../../../../../../../categories/information/react/src'; | |||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {CommonPreviewProps} from '@/categories/blob/react/common'; | import {CommonPreviewProps} from '@/categories/blob/react/common'; | ||||
export type AudioFilePreviewDerivedElement = HTMLAudioElement; | export type AudioFilePreviewDerivedElement = HTMLAudioElement; | ||||
@@ -62,7 +62,7 @@ export const AudioFilePreview = React.forwardRef<AudioFilePreviewDerivedElement, | |||||
controllerRef: forwardedRef, | controllerRef: forwardedRef, | ||||
visualizationMode: 'waveform', | visualizationMode: 'waveform', | ||||
}); | }); | ||||
const { enhanced } = useEnhanced({ enhanced: enhancedProp }); | |||||
const { clientSide } = useClientSide({ clientSide: enhancedProp }); | |||||
if (!fileWithMetadata) { | if (!fileWithMetadata) { | ||||
return null; | return null; | ||||
@@ -92,7 +92,7 @@ export const AudioFilePreview = React.forwardRef<AudioFilePreviewDerivedElement, | |||||
> | > | ||||
<audio | <audio | ||||
{...etcProps} | {...etcProps} | ||||
controls={!enhanced} | |||||
controls={!clientSide} | |||||
ref={mediaControllerRef} | ref={mediaControllerRef} | ||||
onLoadedMetadata={refreshControls} | onLoadedMetadata={refreshControls} | ||||
onDurationChange={refreshControls} | onDurationChange={refreshControls} | ||||
@@ -106,7 +106,7 @@ export const AudioFilePreview = React.forwardRef<AudioFilePreviewDerivedElement, | |||||
/> | /> | ||||
Audio playback not supported. | Audio playback not supported. | ||||
</audio> | </audio> | ||||
{enhanced && ( | |||||
{clientSide && ( | |||||
<> | <> | ||||
<div className="flex justify-end w-full h-full gap-4 absolute top-0 right-0 z-[5] px-4"> | <div className="flex justify-end w-full h-full gap-4 absolute top-0 right-0 z-[5] px-4"> | ||||
<div className="contents"> | <div className="contents"> | ||||
@@ -209,7 +209,7 @@ export const AudioFilePreview = React.forwardRef<AudioFilePreviewDerivedElement, | |||||
</> | </> | ||||
)} | )} | ||||
</div> | </div> | ||||
{enhanced && ( | |||||
{clientSide && ( | |||||
<div className="w-full flex-shrink-0 h-10 flex gap-4 items-center bg-[#000000] px-3"> | <div className="w-full flex-shrink-0 h-10 flex gap-4 items-center bg-[#000000] px-3"> | ||||
<div | <div | ||||
className="py-1 w-14 h-full flex-shrink-0 text-primary flex items-center justify-center" | className="py-1 w-14 h-full flex-shrink-0 text-primary flex items-center justify-center" | ||||
@@ -342,7 +342,7 @@ export const AudioFilePreview = React.forwardRef<AudioFilePreviewDerivedElement, | |||||
children: fileWithMetadata.name, | children: fileWithMetadata.name, | ||||
}, | }, | ||||
}, | }, | ||||
(enhanced && Boolean(getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)') || Boolean(fileWithMetadata.type)) && { | |||||
(clientSide && Boolean(getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)') || Boolean(fileWithMetadata.type)) && { | |||||
key: 'Type', | key: 'Type', | ||||
valueProps: { | valueProps: { | ||||
className: clsx( | className: clsx( | ||||
@@ -351,7 +351,7 @@ export const AudioFilePreview = React.forwardRef<AudioFilePreviewDerivedElement, | |||||
children: getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)', | children: getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)', | ||||
}, | }, | ||||
}, | }, | ||||
(enhanced && Boolean(formatFileSize(fileWithMetadata.size) || '(Loading)') || Boolean(fileWithMetadata.size)) && { | |||||
(clientSide && Boolean(formatFileSize(fileWithMetadata.size) || '(Loading)') || Boolean(fileWithMetadata.size)) && { | |||||
key: 'Size', | key: 'Size', | ||||
valueProps: { | valueProps: { | ||||
className: clsx( | className: clsx( | ||||
@@ -374,7 +374,7 @@ export const AudioFilePreview = React.forwardRef<AudioFilePreviewDerivedElement, | |||||
}, | }, | ||||
]} | ]} | ||||
/> | /> | ||||
{enhanced && ( | |||||
{clientSide && ( | |||||
<form | <form | ||||
id={formId} | id={formId} | ||||
onSubmit={handleAction} | onSubmit={handleAction} | ||||
@@ -5,7 +5,7 @@ import {useMediaControls} from '../../hooks/interactive'; | |||||
import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | ||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {SpectrogramCanvas, WaveformCanvas} from '@modal-soft/react-wavesurfer'; | import {SpectrogramCanvas, WaveformCanvas} from '@modal-soft/react-wavesurfer'; | ||||
import {useEnhanced} from '@modal-soft/react-utils'; | |||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
export type AudioMiniFilePreviewDerivedElement = HTMLAudioElement; | export type AudioMiniFilePreviewDerivedElement = HTMLAudioElement; | ||||
@@ -55,7 +55,7 @@ export const AudioMiniFilePreview = React.forwardRef<AudioMiniFilePreviewDerived | |||||
controllerRef: forwardedRef, | controllerRef: forwardedRef, | ||||
visualizationMode: 'waveform', | visualizationMode: 'waveform', | ||||
}); | }); | ||||
const { enhanced } = useEnhanced({ enhanced: enhancedProp }); | |||||
const { clientSide } = useClientSide({ clientSide: enhancedProp }); | |||||
if (!fileWithMetadata) { | if (!fileWithMetadata) { | ||||
return null; | return null; | ||||
@@ -86,7 +86,7 @@ export const AudioMiniFilePreview = React.forwardRef<AudioMiniFilePreviewDerived | |||||
> | > | ||||
<audio | <audio | ||||
{...etcProps} | {...etcProps} | ||||
controls={!enhanced} | |||||
controls={!clientSide} | |||||
ref={mediaControllerRef} | ref={mediaControllerRef} | ||||
onLoadedMetadata={refreshControls} | onLoadedMetadata={refreshControls} | ||||
onDurationChange={refreshControls} | onDurationChange={refreshControls} | ||||
@@ -100,7 +100,7 @@ export const AudioMiniFilePreview = React.forwardRef<AudioMiniFilePreviewDerived | |||||
/> | /> | ||||
Audio playback not supported. | Audio playback not supported. | ||||
</audio> | </audio> | ||||
{enhanced && ( | |||||
{clientSide && ( | |||||
<> | <> | ||||
<div className="flex justify-end w-full h-full gap-4 absolute top-0 right-0 z-[5] px-4"> | <div className="flex justify-end w-full h-full gap-4 absolute top-0 right-0 z-[5] px-4"> | ||||
<div className="contents"> | <div className="contents"> | ||||
@@ -3,9 +3,9 @@ import {augmentBinaryFile, getMimeTypeDescription} from '@/utils/blob'; | |||||
import {formatFileSize, formatNumeral} from '@/utils/numeral'; | import {formatFileSize, formatNumeral} from '@/utils/numeral'; | ||||
import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | ||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {KeyValueTable} from '@/categories/information/react'; | |||||
import {KeyValueTable} from '../../../../../../../../categories/information/react/src'; | |||||
import {BinaryDataCanvas} from '@modal-soft/react-binary-data-canvas'; | import {BinaryDataCanvas} from '@modal-soft/react-binary-data-canvas'; | ||||
import {useEnhanced} from '@modal-soft/react-utils'; | |||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {CommonPreviewProps} from '@/categories/blob/react/common'; | import {CommonPreviewProps} from '@/categories/blob/react/common'; | ||||
export type BinaryFilePreviewDerivedElement = HTMLDivElement; | export type BinaryFilePreviewDerivedElement = HTMLDivElement; | ||||
@@ -25,7 +25,7 @@ export const BinaryFilePreview = React.forwardRef<BinaryFilePreviewDerivedElemen | |||||
file: fileWithUrl, | file: fileWithUrl, | ||||
augmentFunction: augmentBinaryFile, | augmentFunction: augmentBinaryFile, | ||||
}); | }); | ||||
const { enhanced } = useEnhanced({ enhanced: enhancedProp }); | |||||
const { clientSide } = useClientSide({ clientSide: enhancedProp }); | |||||
if (!fileWithMetadata) { | if (!fileWithMetadata) { | ||||
return null; | return null; | ||||
@@ -124,7 +124,7 @@ export const BinaryFilePreview = React.forwardRef<BinaryFilePreviewDerivedElemen | |||||
title: fileWithMetadata.name, | title: fileWithMetadata.name, | ||||
}, | }, | ||||
}, | }, | ||||
(enhanced && Boolean(getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)') || Boolean(fileWithMetadata.type)) && { | |||||
(clientSide && Boolean(getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)') || Boolean(fileWithMetadata.type)) && { | |||||
key: 'Type', | key: 'Type', | ||||
valueProps: { | valueProps: { | ||||
className: clsx( | className: clsx( | ||||
@@ -133,7 +133,7 @@ export const BinaryFilePreview = React.forwardRef<BinaryFilePreviewDerivedElemen | |||||
children: getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)', | children: getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)', | ||||
}, | }, | ||||
}, | }, | ||||
(enhanced && Boolean(formatFileSize(fileWithMetadata.size) || '(Loading)') || Boolean(fileWithMetadata.size)) && { | |||||
(clientSide && Boolean(formatFileSize(fileWithMetadata.size) || '(Loading)') || Boolean(fileWithMetadata.size)) && { | |||||
key: 'Size', | key: 'Size', | ||||
valueProps: { | valueProps: { | ||||
className: clsx( | className: clsx( | ||||
@@ -7,9 +7,9 @@ import {ImageFilePreview} from '../ImageFilePreview'; | |||||
import {VideoFilePreview} from '../VideoFilePreview'; | import {VideoFilePreview} from '../VideoFilePreview'; | ||||
import {TextFilePreview} from '../TextFilePreview'; | import {TextFilePreview} from '../TextFilePreview'; | ||||
import {AudioMiniFilePreview} from '../AudioMiniFilePreview'; | import {AudioMiniFilePreview} from '../AudioMiniFilePreview'; | ||||
import {delegateTriggerEvent} from '@/utils/event'; | |||||
import {delegateTriggerEvent} from '@modal-sh/react-utils'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {useEnhanced} from '@modal-soft/react-utils'; | |||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {FilePreviewComponent} from '@/categories/blob/react/common'; | import {FilePreviewComponent} from '@/categories/blob/react/common'; | ||||
const FILE_PREVIEW_COMPONENTS: Record<ContentType, FilePreviewComponent> = { | const FILE_PREVIEW_COMPONENTS: Record<ContentType, FilePreviewComponent> = { | ||||
@@ -64,7 +64,7 @@ export const FileSelectBox = React.forwardRef<FileSelectBoxDerivedElement, FileS | |||||
}: FileSelectBoxProps, | }: FileSelectBoxProps, | ||||
forwardedRef, | forwardedRef, | ||||
) => { | ) => { | ||||
const { enhanced } = useEnhanced({ enhanced: enhancedProp }); | |||||
const { clientSide } = useClientSide({ clientSide: enhancedProp }); | |||||
const [fileList, setFileList] = React.useState<FileList>(); | const [fileList, setFileList] = React.useState<FileList>(); | ||||
const [lastUpdated, setLastUpdated] = React.useState<number>(); | const [lastUpdated, setLastUpdated] = React.useState<number>(); | ||||
const defaultRef = React.useRef<HTMLInputElement>(null); | const defaultRef = React.useRef<HTMLInputElement>(null); | ||||
@@ -153,7 +153,7 @@ export const FileSelectBox = React.forwardRef<FileSelectBoxDerivedElement, FileS | |||||
className={clsx( | className={clsx( | ||||
'peer', | 'peer', | ||||
{ | { | ||||
'sr-only': enhanced, | |||||
'sr-only': clientSide, | |||||
} | } | ||||
)} | )} | ||||
onChange={doSetFileList} | onChange={doSetFileList} | ||||
@@ -181,7 +181,7 @@ export const FileSelectBox = React.forwardRef<FileSelectBoxDerivedElement, FileS | |||||
} | } | ||||
{ | { | ||||
filesCount < 1 | filesCount < 1 | ||||
&& enhanced | |||||
&& clientSide | |||||
&& hint | && hint | ||||
&& ( | && ( | ||||
<div | <div | ||||
@@ -196,7 +196,7 @@ export const FileSelectBox = React.forwardRef<FileSelectBoxDerivedElement, FileS | |||||
} | } | ||||
{ | { | ||||
filesCount > 0 | filesCount > 0 | ||||
&& enhanced | |||||
&& clientSide | |||||
&& ( | && ( | ||||
<React.Fragment key={lastUpdated}> | <React.Fragment key={lastUpdated}> | ||||
<div className={`sm:absolute top-0 left-0 w-full h-full pointer-events-none pb-12 box-border overflow-hidden pt-8`}> | <div className={`sm:absolute top-0 left-0 w-full h-full pointer-events-none pb-12 box-border overflow-hidden pt-8`}> | ||||
@@ -261,7 +261,7 @@ export const FileSelectBox = React.forwardRef<FileSelectBoxDerivedElement, FileS | |||||
<FilePreviewComponent | <FilePreviewComponent | ||||
className="w-full h-full relative" | className="w-full h-full relative" | ||||
file={f} | file={f} | ||||
enhanced={enhanced} | |||||
enhanced={clientSide} | |||||
disabled={disabled} | disabled={disabled} | ||||
/> | /> | ||||
</div> | </div> | ||||
@@ -3,10 +3,10 @@ import {augmentImageFile, getMimeTypeDescription} from '@/utils/blob'; | |||||
import {formatFileSize, formatNumeral} from '@/utils/numeral'; | import {formatFileSize, formatNumeral} from '@/utils/numeral'; | ||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {useFileMetadata, useFileUrl, useImageControls} from '@/categories/blob/react'; | import {useFileMetadata, useFileUrl, useImageControls} from '@/categories/blob/react'; | ||||
import {KeyValueTable} from '@/categories/information/react'; | |||||
import {useEnhanced} from '@modal-soft/react-utils'; | |||||
import {KeyValueTable} from '../../../../../../../../categories/information/react/src'; | |||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {CommonPreviewProps} from '@/categories/blob/react/common'; | import {CommonPreviewProps} from '@/categories/blob/react/common'; | ||||
import {Swatch} from '@tesseract-design/web-color-react'; | |||||
import {Swatch} from '../../../../../../../../categories/color/react/src'; | |||||
export type ImageFilePreviewDerivedElement = HTMLImageElement; | export type ImageFilePreviewDerivedElement = HTMLImageElement; | ||||
@@ -36,7 +36,7 @@ export const ImageFilePreview = React.forwardRef<ImageFilePreviewDerivedElement, | |||||
forwardedRef, | forwardedRef, | ||||
}); | }); | ||||
const { enhanced } = useEnhanced({ enhanced: enhancedProp }); | |||||
const { clientSide } = useClientSide({ clientSide: enhancedProp }); | |||||
if (!(fileWithMetadata)) { | if (!(fileWithMetadata)) { | ||||
return null; | return null; | ||||
@@ -96,7 +96,7 @@ export const ImageFilePreview = React.forwardRef<ImageFilePreviewDerivedElement, | |||||
children: fileWithMetadata.name, | children: fileWithMetadata.name, | ||||
}, | }, | ||||
}, | }, | ||||
(enhanced && Boolean(getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)') || Boolean(fileWithMetadata.type)) && { | |||||
(clientSide && Boolean(getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)') || Boolean(fileWithMetadata.type)) && { | |||||
key: 'Type', | key: 'Type', | ||||
valueProps: { | valueProps: { | ||||
className: clsx( | className: clsx( | ||||
@@ -105,7 +105,7 @@ export const ImageFilePreview = React.forwardRef<ImageFilePreviewDerivedElement, | |||||
children: getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)', | children: getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)', | ||||
}, | }, | ||||
}, | }, | ||||
(enhanced && Boolean(formatFileSize(fileWithMetadata.size) || '(Loading)') || Boolean(fileWithMetadata.size)) && { | |||||
(clientSide && Boolean(formatFileSize(fileWithMetadata.size) || '(Loading)') || Boolean(fileWithMetadata.size)) && { | |||||
key: 'Size', | key: 'Size', | ||||
valueProps: { | valueProps: { | ||||
className: clsx( | className: clsx( | ||||
@@ -147,7 +147,7 @@ export const ImageFilePreview = React.forwardRef<ImageFilePreviewDerivedElement, | |||||
}, | }, | ||||
]} | ]} | ||||
/> | /> | ||||
{enhanced && ( | |||||
{clientSide && ( | |||||
<form | <form | ||||
onSubmit={handleAction} | onSubmit={handleAction} | ||||
className="flex gap-4 justify-end" | className="flex gap-4 justify-end" | ||||
@@ -3,9 +3,9 @@ import {formatFileSize, formatNumeral} from '@/utils/numeral'; | |||||
import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | ||||
import {augmentTextFile, getMimeTypeDescription} from '@/utils/blob'; | import {augmentTextFile, getMimeTypeDescription} from '@/utils/blob'; | ||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {KeyValueTable} from '@/categories/information/react'; | |||||
import {KeyValueTable} from '../../../../../../../../categories/information/react/src'; | |||||
import {Refractor} from '@modal-soft/react-refractor'; | import {Refractor} from '@modal-soft/react-refractor'; | ||||
import {useEnhanced} from '@modal-soft/react-utils'; | |||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {CommonPreviewProps} from '@/categories/blob/react/common'; | import {CommonPreviewProps} from '@/categories/blob/react/common'; | ||||
type TextFilePreviewDerivedComponent = HTMLDivElement; | type TextFilePreviewDerivedComponent = HTMLDivElement; | ||||
@@ -25,7 +25,7 @@ export const TextFilePreview = React.forwardRef<TextFilePreviewDerivedComponent, | |||||
file: fileWithUrl, | file: fileWithUrl, | ||||
augmentFunction: augmentTextFile, | augmentFunction: augmentTextFile, | ||||
}); | }); | ||||
const { enhanced } = useEnhanced({ enhanced: enhancedProp }); | |||||
const { clientSide } = useClientSide({ clientSide: enhancedProp }); | |||||
if (!fileWithMetadata) { | if (!fileWithMetadata) { | ||||
return null; | return null; | ||||
@@ -75,13 +75,13 @@ export const TextFilePreview = React.forwardRef<TextFilePreviewDerivedComponent, | |||||
title: fileWithMetadata.name, | title: fileWithMetadata.name, | ||||
}, | }, | ||||
}, | }, | ||||
(enhanced && Boolean(getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)') || Boolean(fileWithMetadata.type)) && { | |||||
(clientSide && Boolean(getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)') || Boolean(fileWithMetadata.type)) && { | |||||
key: 'Type', | key: 'Type', | ||||
valueProps: { | valueProps: { | ||||
children: typeof fileWithMetadata.metadata?.schemeTitle === 'string' ? `${fileWithMetadata.metadata.schemeTitle} Source` : 'Text File', | children: typeof fileWithMetadata.metadata?.schemeTitle === 'string' ? `${fileWithMetadata.metadata.schemeTitle} Source` : 'Text File', | ||||
}, | }, | ||||
}, | }, | ||||
(enhanced && Boolean(formatFileSize(fileWithMetadata.size) || '(Loading)') || Boolean(fileWithMetadata.size)) && { | |||||
(clientSide && Boolean(formatFileSize(fileWithMetadata.size) || '(Loading)') || Boolean(fileWithMetadata.size)) && { | |||||
key: 'Size', | key: 'Size', | ||||
valueProps: { | valueProps: { | ||||
className: clsx( | className: clsx( | ||||
@@ -4,8 +4,8 @@ import {formatFileSize, formatNumeral, formatSecondsDurationConcise} from '@/uti | |||||
import {useFileMetadata, useFileUrl, useMediaControls} from '@tesseract-design/web-blob-react'; | import {useFileMetadata, useFileUrl, useMediaControls} from '@tesseract-design/web-blob-react'; | ||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {Slider} from '@tesseract-design/web-number-react'; | import {Slider} from '@tesseract-design/web-number-react'; | ||||
import {KeyValueTable} from '@/categories/information/react'; | |||||
import {useEnhanced} from '@modal-soft/react-utils'; | |||||
import {KeyValueTable} from '../../../../../../../../categories/information/react/src'; | |||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {CommonPreviewProps} from '@/categories/blob/react/common'; | import {CommonPreviewProps} from '@/categories/blob/react/common'; | ||||
export type VideoFilePreviewDerivedComponent = HTMLVideoElement; | export type VideoFilePreviewDerivedComponent = HTMLVideoElement; | ||||
@@ -50,7 +50,7 @@ export const VideoFilePreview = React.forwardRef<VideoFilePreviewDerivedComponen | |||||
controllerRef: forwardedRef, | controllerRef: forwardedRef, | ||||
}); | }); | ||||
const { enhanced } = useEnhanced({ enhanced: enhancedProp }); | |||||
const { clientSide } = useClientSide({ clientSide: enhancedProp }); | |||||
if (!fileWithMetadata) { | if (!fileWithMetadata) { | ||||
return null; | return null; | ||||
@@ -88,7 +88,7 @@ export const VideoFilePreview = React.forwardRef<VideoFilePreviewDerivedComponen | |||||
onEnded={reset} | onEnded={reset} | ||||
onTimeUpdate={updateSeekFromPlayback} | onTimeUpdate={updateSeekFromPlayback} | ||||
data-testid="preview" | data-testid="preview" | ||||
controls={!enhanced} | |||||
controls={!clientSide} | |||||
> | > | ||||
<source | <source | ||||
src={fileWithMetadata.url} | src={fileWithMetadata.url} | ||||
@@ -109,7 +109,7 @@ export const VideoFilePreview = React.forwardRef<VideoFilePreviewDerivedComponen | |||||
</span> | </span> | ||||
</button> | </button> | ||||
</div> | </div> | ||||
{enhanced && ( | |||||
{clientSide && ( | |||||
<div className="w-full flex-shrink-0 h-10 flex gap-4 items-center bg-[#000000] px-3"> | <div className="w-full flex-shrink-0 h-10 flex gap-4 items-center bg-[#000000] px-3"> | ||||
<div | <div | ||||
className="py-1 w-14 h-full flex-shrink-0 text-primary flex items-center justify-center" | className="py-1 w-14 h-full flex-shrink-0 text-primary flex items-center justify-center" | ||||
@@ -244,7 +244,7 @@ export const VideoFilePreview = React.forwardRef<VideoFilePreviewDerivedComponen | |||||
children: fileWithMetadata.name, | children: fileWithMetadata.name, | ||||
}, | }, | ||||
}, | }, | ||||
(enhanced && Boolean(getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)') || Boolean(fileWithMetadata.type)) && { | |||||
(clientSide && Boolean(getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)') || Boolean(fileWithMetadata.type)) && { | |||||
key: 'Type', | key: 'Type', | ||||
valueProps: { | valueProps: { | ||||
className: clsx( | className: clsx( | ||||
@@ -253,7 +253,7 @@ export const VideoFilePreview = React.forwardRef<VideoFilePreviewDerivedComponen | |||||
children: getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)', | children: getMimeTypeDescription(fileWithMetadata.type, fileWithMetadata.name) || '(Loading)', | ||||
}, | }, | ||||
}, | }, | ||||
(enhanced && Boolean(formatFileSize(fileWithMetadata.size) || '(Loading)') || Boolean(fileWithMetadata.size)) && { | |||||
(clientSide && Boolean(formatFileSize(fileWithMetadata.size) || '(Loading)') || Boolean(fileWithMetadata.size)) && { | |||||
key: 'Size', | key: 'Size', | ||||
valueProps: { | valueProps: { | ||||
className: clsx( | className: clsx( | ||||
@@ -274,7 +274,7 @@ export const VideoFilePreview = React.forwardRef<VideoFilePreviewDerivedComponen | |||||
]} | ]} | ||||
/> | /> | ||||
{ | { | ||||
enhanced | |||||
clientSide | |||||
&& ( | && ( | ||||
<form | <form | ||||
id={formId} | id={formId} | ||||
@@ -1,5 +1,5 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import * as TextControlBase from '@tesseract-design/web-base-textcontrol'; | |||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import styles from './style.module.css'; | import styles from './style.module.css'; | ||||
@@ -17,7 +17,7 @@ export interface SpinnerProps extends Omit<React.HTMLProps<SpinnerDerivedElement | |||||
/** | /** | ||||
* Size of the component. | * Size of the component. | ||||
*/ | */ | ||||
size?: TextControlBase.TextControlSize, | |||||
size?: TextControl.Size, | |||||
/** | /** | ||||
* Additional description, usually graphical, indicating the nature of the component's value. | * Additional description, usually graphical, indicating the nature of the component's value. | ||||
*/ | */ | ||||
@@ -33,7 +33,7 @@ export interface SpinnerProps extends Omit<React.HTMLProps<SpinnerDerivedElement | |||||
/** | /** | ||||
* Style of the component. | * Style of the component. | ||||
*/ | */ | ||||
variant?: TextControlBase.TextControlVariant, | |||||
variant?: TextControl.Variant, | |||||
/** | /** | ||||
* Is the label hidden? | * Is the label hidden? | ||||
*/ | */ | ||||
@@ -1,5 +1,5 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import * as TextControlBase from '@tesseract-design/web-base-textcontrol'; | |||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
export type ComboBoxDerivedElement = HTMLInputElement; | export type ComboBoxDerivedElement = HTMLInputElement; | ||||
@@ -16,7 +16,7 @@ export interface ComboBoxProps extends Omit<React.HTMLProps<ComboBoxDerivedEleme | |||||
/** | /** | ||||
* Size of the component. | * Size of the component. | ||||
*/ | */ | ||||
size?: TextControlBase.TextControlSize, | |||||
size?: TextControl.Size, | |||||
/** | /** | ||||
* Additional description, usually graphical, indicating the nature of the component's value. | * Additional description, usually graphical, indicating the nature of the component's value. | ||||
*/ | */ | ||||
@@ -32,11 +32,11 @@ export interface ComboBoxProps extends Omit<React.HTMLProps<ComboBoxDerivedEleme | |||||
/** | /** | ||||
* Type of the component value. | * Type of the component value. | ||||
*/ | */ | ||||
type?: TextControlBase.TextControlInputType, | |||||
type?: TextControl.InputType, | |||||
/** | /** | ||||
* Style of the component. | * Style of the component. | ||||
*/ | */ | ||||
variant?: TextControlBase.TextControlVariant, | |||||
variant?: TextControl.Variant, | |||||
/** | /** | ||||
* Is the label hidden? | * Is the label hidden? | ||||
*/ | */ | ||||
@@ -1,5 +1,5 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import * as TextControlBase from '@tesseract-design/web-base-textcontrol'; | |||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
export type DropdownSelectDerivedElement = HTMLSelectElement; | export type DropdownSelectDerivedElement = HTMLSelectElement; | ||||
@@ -16,7 +16,7 @@ export interface DropdownSelectProps extends Omit<React.HTMLProps<DropdownSelect | |||||
/** | /** | ||||
* Size of the component. | * Size of the component. | ||||
*/ | */ | ||||
size?: TextControlBase.TextControlSize, | |||||
size?: TextControl.Size, | |||||
/** | /** | ||||
* Additional description, usually graphical, indicating the nature of the component's value. | * Additional description, usually graphical, indicating the nature of the component's value. | ||||
*/ | */ | ||||
@@ -29,14 +29,10 @@ export interface DropdownSelectProps extends Omit<React.HTMLProps<DropdownSelect | |||||
* Should the component occupy the whole width of its parent? | * Should the component occupy the whole width of its parent? | ||||
*/ | */ | ||||
block?: boolean, | block?: boolean, | ||||
/** | |||||
* Type of the component value. | |||||
*/ | |||||
type?: TextControlBase.TextControlInputType, | |||||
/** | /** | ||||
* Style of the component. | * Style of the component. | ||||
*/ | */ | ||||
variant?: TextControlBase.TextControlVariant, | |||||
variant?: TextControl.Variant, | |||||
/** | /** | ||||
* Is the label hidden? | * Is the label hidden? | ||||
*/ | */ | ||||
@@ -57,7 +53,6 @@ export const DropdownSelect = React.forwardRef<DropdownSelectDerivedElement, Dro | |||||
size = 'medium' as const, | size = 'medium' as const, | ||||
border = false, | border = false, | ||||
block = false, | block = false, | ||||
type = 'text' as const, | |||||
variant = 'default' as const, | variant = 'default' as const, | ||||
hiddenLabel = false, | hiddenLabel = false, | ||||
className, | className, | ||||
@@ -1,5 +1,5 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import * as TextControlBase from '@tesseract-design/web-base-textcontrol'; | |||||
import { TextControl } from '@tesseract-design/web-base'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
export type MenuSelectDerivedElement = HTMLSelectElement; | export type MenuSelectDerivedElement = HTMLSelectElement; | ||||
@@ -16,7 +16,7 @@ export interface MenuSelectProps extends Omit<React.HTMLProps<MenuSelectDerivedE | |||||
/** | /** | ||||
* Size of the component. | * Size of the component. | ||||
*/ | */ | ||||
size?: TextControlBase.TextControlSize, | |||||
size?: TextControl.Size, | |||||
/** | /** | ||||
* Additional description, usually graphical, indicating the nature of the component's value. | * Additional description, usually graphical, indicating the nature of the component's value. | ||||
*/ | */ | ||||
@@ -32,7 +32,7 @@ export interface MenuSelectProps extends Omit<React.HTMLProps<MenuSelectDerivedE | |||||
/** | /** | ||||
* Style of the component. | * Style of the component. | ||||
*/ | */ | ||||
variant?: TextControlBase.TextControlVariant, | |||||
variant?: TextControl.Variant, | |||||
/** | /** | ||||
* Is the label hidden? | * Is the label hidden? | ||||
*/ | */ | ||||