{"id":15099401,"url":"https://github.com/substrate-system/text-input","last_synced_at":"2025-04-15T00:45:13.105Z","repository":{"id":247118678,"uuid":"824855772","full_name":"substrate-system/text-input","owner":"substrate-system","description":"Web component input","archived":false,"fork":false,"pushed_at":"2025-03-26T05:18:54.000Z","size":52,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T00:44:58.954Z","etag":null,"topics":["component","input","web","webcomponent"],"latest_commit_sha":null,"homepage":"https://substrate-system.github.io/text-input/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/substrate-system.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-06T06:15:31.000Z","updated_at":"2025-03-26T05:18:51.000Z","dependencies_parsed_at":"2024-07-06T18:25:16.234Z","dependency_job_id":"3f58d94b-2e90-41b9-b5b5-939ed2b16609","html_url":"https://github.com/substrate-system/text-input","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":0.06896551724137934,"last_synced_commit":"98b34bc6d2317472943889a947092a803e31ca2b"},"previous_names":["substrate-system/text-input"],"tags_count":14,"template":false,"template_full_name":"substrate-system/template-web-component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/substrate-system%2Ftext-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/substrate-system%2Ftext-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/substrate-system%2Ftext-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/substrate-system%2Ftext-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/substrate-system","download_url":"https://codeload.github.com/substrate-system/text-input/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986274,"owners_count":21194024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component","input","web","webcomponent"],"created_at":"2024-09-25T17:12:15.468Z","updated_at":"2025-04-15T00:45:13.075Z","avatar_url":"https://github.com/substrate-system.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# text input\n![tests](https://github.com/substrate-system/text-input/actions/workflows/nodejs.yml/badge.svg)\n[![types](https://img.shields.io/npm/types/@substrate-system/text-input?style=flat-square)](README.md)\n[![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md)\n[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver\u0026style=flat-square)](https://semver.org/)\n[![dependencies](https://img.shields.io/badge/dependencies-zero-brightgreen.svg?style=flat-square)](package.json)\n[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n\nA text input web component.\n\n[See a live demo](https://substrate-system.github.io/text-input/).\n\n\u003c!-- toc --\u003e\n\n- [install](#install)\n- [API](#api)\n  * [ESM](#esm)\n  * [Common JS](#common-js)\n- [CSS](#css)\n  * [Import CSS](#import-css)\n  * [Customize CSS via some variables](#customize-css-via-some-variables)\n- [use](#use)\n  * [JS](#js)\n  * [HTML](#html)\n  * [pre-built JS](#pre-built-js)\n\n\u003c!-- tocstop --\u003e\n\n## install\n\n```sh\nnpm i -S @substrate-system/text-input\n```\n\n## API\nThis exposes ESM and common JS via [package.json `exports` field](https://nodejs.org/api/packages.html#exports).\n\n### ESM\n```js\nimport '@substrate-system/text-input'\n```\n\n### Common JS\n```js\nrequire('@substrate-system/text-input')\n```\n\n## CSS\n\n### Import CSS\n\n```js\nimport '@substrate-system/text-input/css'\n```\n\nOr minified:\n```js\nimport '@substrate-system/text-input/css/min'\n```\n\n### Customize CSS via some variables\n\n```css\ntext-input {\n    --text-input-error-border: pink;\n    --gray-text: #999999;\n    --radius: 4px;\n}\n```\n\n## use\n\nThis calls the global function `customElements.define`. Just import, then use\nthe tag in your HTML.\n\n### JS\n```js\nimport '@substrate-system/text-input'\nimport '@substrate-system/text-input/css'\n```\n\n\u003e\n\u003e [!NOTE]\n\u003e The `name` attribute is used as an `id` also, so it should be unique\n\u003e per page.\n\u003e\n\n### HTML\n```html\n\u003cdiv\u003e\n    \u003ctext-input\n        display-name=\"text input component\"\n        title=\"At least 3 letters, but less than 7\"\n        required\n        minlength=3\n        maxlength=7\n        name=\"text-input\"\n    \u003e\u003c/text-input\u003e\n\u003c/div\u003e\n```\n\n### pre-built JS\nThis package exposes minified files too. Copy them to a location that is\naccessible to your web server, then link to them in HTML.\n\n#### copy\n```sh\ncp ./node_modules/@substrate-system/text-input/dist/index.min.js ./public/text-input.js\ncp ./node_modules/@substrate-system/text-input/dist/style.min.css ./public/text-input.css\n```\n\n#### HTML\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\n\u003chead\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n    \u003ctitle\u003eExample\u003c/title\u003e\n    \u003c!-- CSS --\u003e\n    \u003clink rel=\"stylesheet\" href=\"./text-input.css\"\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n    \u003c!-- use the tag --\u003e\n    \u003ctext-input\n        display-name=\"text input component\"\n        title=\"At least 3 letters, but less than 7\"\n        required\n        minlength=3\n        maxlength=7\n        name=\"text-input\"\n    \u003e\u003c/text-input\u003e\n\n    \u003c!-- JS --\u003e\n    \u003cscript type=\"module\" src=\"./text-input.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubstrate-system%2Ftext-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubstrate-system%2Ftext-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubstrate-system%2Ftext-input/lists"}