Compare commits

...

341 commits

Author SHA1 Message Date
358288c03c
Merge branch 'astro-reactive:main' into main
Some checks failed
Build and Test / build-and-test (18.x) (push) Has been cancelled
Release / Release (push) Has been cancelled
2025-03-09 20:12:10 +01:00
Ayo Ayco
97b3342cf9
chore: add build.yml; update announcement link (#314)
* chore: add build.yml

* chore: update announcement link on readme

* chore: update readme

* chore: trigger build
2025-03-09 20:11:22 +01:00
c4e15708d2 chore: trigger build 2025-03-09 20:10:04 +01:00
0aeb2b7ec3 chore: update readme 2025-03-09 20:07:44 +01:00
9268f33ab6 chore: update announcement link on readme 2025-03-09 20:05:49 +01:00
d5f5ce808e chore: add build.yml 2025-03-09 20:03:38 +01:00
ac0a61d0ea chore: patch version 2025-01-08 14:19:04 +01:00
a9782bb50d chore: update peerdeps 2025-01-08 14:15:39 +01:00
Ayo Ayco
1efa01f4e3
chore: update README.md (#313) 2025-01-03 13:37:42 +01:00
Ayo
680e8c906b chore: update deps on site 2023-12-07 16:04:28 +01:00
Ayo
e7ec98b178 fix: remove logomark 2023-12-07 16:04:20 +01:00
Ayo
14f7760ff3 chore: support Astro 4 2023-12-07 15:47:28 +01:00
Ayo Ayco
5c8517266c
chore: add warning to README.md (#312) 2023-11-30 14:34:52 +01:00
Ayo Ayco
7ef5a41ec0
chore: update docs site URL (#311) 2023-11-13 14:24:05 +01:00
github-actions[bot]
4c67ac0e8c
chore: Update version for release (#310) 2023-11-11 20:56:38 +01:00
Ayo Ayco
a1cc4b006b
chore: update homepage to astro-reactive.js.org (#309) 2023-11-11 20:48:52 +01:00
Ayo Ayco
6298cadce2
feat(site): update docs link (#308) 2023-11-11 20:34:10 +01:00
Ayo Ayco
591b4eafe6
feat(landing-page): slower animation (#307) 2023-09-25 17:54:30 +02:00
Ayo Ayco
4f745b59b1
chore: update deps (#306) 2023-09-25 17:50:34 +02:00
Ayo
118f5cfa60 chore: add simulate ci scripts 2023-09-25 17:27:48 +02:00
Ayo
bf745dd7ce chore: update vitest 2023-09-25 17:23:44 +02:00
Ayo
643b1ff1e6 chore: add build to CI 2023-09-25 17:18:59 +02:00
Ayo
4bd37804a9 chore: update package-lock 2023-09-25 17:13:43 +02:00
Ayo
929f3a1e69 chore: remove netlify 2023-09-25 17:01:49 +02:00
Ayo
392eebd7d1 chore: add netlify 2023-09-25 16:59:58 +02:00
Ayo
29c25dde87 chore: use netlify() 2023-09-25 16:54:03 +02:00
Ayo
5ad276cbf9 chore: add netlify integration 2023-09-25 16:49:14 +02:00
Ayo
6f608e470e chore: clean up integrations 2023-09-25 16:47:28 +02:00
Ayo
e85bf59b0f chore: remove adapter 2023-09-25 16:45:30 +02:00
Ayo
633f94ce25 chore: remove unused functions 2023-09-25 16:43:32 +02:00
Ayo
81c1e1d1a9 chore: remove svgo dep 2023-09-25 16:41:42 +02:00
Ayo
af4c6e3253 chore: tailwind as dep 2023-09-25 16:38:43 +02:00
Ayo
78b9ae07cf chore: integrate netlify 2023-09-25 16:37:20 +02:00
github-actions[bot]
c0f3ca1fa3
chore: Update version for release (#295)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-25 16:29:43 +02:00
Ayo Ayco
4d2a577b0e
chore: update deps (#305)
* chore: update deps

* chore: update deps for apps/docs

* chore: update landing-page deps

* chore: update monorepo deps

* chore: add astro as dep to config

* chore: update package lock

* fix: tailwind import on landing-page

* chore: type module

* chore: remove ci run for node 16

* chore: ci run ci

* chore: remove astro check from ci

* chore: remove lint check from ci

* fix: tailwindcss import

* fix: check errors on apps

* chore: fix npm run check

* chore: updat emonorepo deps

* chore: not a module

* chore: use astro-iconify instead

* chore: update prettier

* chore: use prettier formatter

* chore: update lint deps

* chore: run lint on ci

* chore: add changeset
2023-09-25 16:27:50 +02:00
Ayo Ayco
92b11031c3
Update README.md (#302) 2023-05-16 12:40:06 +02:00
Ayo Ayco
6e27739d7e
feat(landing-page): shorter install script (#280) 2023-03-28 11:21:10 +02:00
github-actions[bot]
c2384944fb
chore: Update version for release (#293)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-25 21:15:40 +01:00
Ayo Ayco
334a4c552b
chore: move from release to changelog (#292) 2023-03-25 21:10:33 +01:00
Ayo
06d4ce1126 chore: move RELEASE content to CHANGELOG 2023-03-25 20:52:53 +01:00
github-actions[bot]
b07d926e02
chore: Update version for release (#291) 2023-03-25 20:36:19 +01:00
Ayo Ayco
fb11b738f4
feat: initialize create-astro-reactive package (#281) 2023-03-25 20:02:36 +01:00
Ayo Ayco
d50d8c1329
devops: fix last changeset (#289) 2023-03-25 10:13:29 +01:00
Ayo Ayco
e50aa4c5e9
update readme (#287)
* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md
2023-03-25 10:07:00 +01:00
Ayo Ayco
30de5161f2
feat(form): change validate on load to true by default (#284) 2023-03-25 09:47:46 +01:00
github-actions[bot]
b4901e87f9
chore: Update version for release (#276)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-24 22:34:47 +01:00
Ayo Ayco
414a0bd854
devops: fix dependencies for Astro v2+ support (#275) 2023-03-24 21:43:09 +01:00
Ayo Ayco
f3420f9272
Rollback publish (#274)
* chore: rollback release

* roll back deps

* update package-lock
2023-03-24 14:57:40 +01:00
Ayo Ayco
9bd2bde88c
chore: release form@0.7.0, validator@0.3.0, common@0.1.6 (#272) 2023-03-24 14:10:38 +01:00
Fazza Razaq Amiarso
1cba4be635
chore: update astro to v2 (#269) 2023-03-16 22:39:47 +01:00
Ayo Ayco
aa14ddd8dc
docs: indicate work in progress (#265) 2023-02-16 17:38:26 +01:00
Ayo
4d16865561 docs: update FormGroup documentation 2023-02-16 14:55:42 +01:00
Ayo Ayco
b1a6b11486
chore: update discord links (#264) 2023-02-16 14:32:55 +01:00
09d154575c
Update README.md 2023-02-12 13:24:16 +01:00
Fazza Razaq Amiarso
d6cf10f9fd
chore: install changeset (#261) 2023-02-02 19:33:51 +01:00
Ayo Ayco
13f96a4fe9
chore: set up test:coverage scripts (#260)
* chore: set up test:coverage scripts

* devops: bring back form test CI workaround
2023-02-01 18:05:27 +01:00
Ayo Ayco
a4db6e4680
refactor: remove fart (#259) 2023-02-01 17:28:00 +01:00
Ayo Ayco
d0ff3fecea
docs: update example in form readme (#258)
* docs: update example in form readme

* chore: update readme

* chore: update validator readme
2023-02-01 17:16:03 +01:00
Ayo Ayco
c0c0f941eb
chore: fix old links in some docs (#256)
* chore: fix old links in some docs

* chore: update package lock

* chore: update turbo

* chore:  remove commented out temporary fix
2023-02-01 15:00:00 +01:00
Lalit
f79ce72a1c
chore(apps): Setup prettier + eslint for all our apps (#254)
* chore(apps): setup prettier + eslint for all our apps

* fix(docs): Fixed the use of implicit any type

* chore(apps): Added .eslintignore files
2023-01-14 10:40:40 +01:00
Fazza Razaq Amiarso
0abe83aea9
feat: sharing config files (#253) 2023-01-11 19:09:35 +01:00
Ayo
b3d765f96f chore: update discord link 2023-01-05 14:53:45 +01:00
Ayo
d1844bad55 feat(demo): update example code boolean attrributes 2023-01-04 14:12:26 +01:00
Ayo
944548dc63 docs: update readme example code 2023-01-04 14:11:49 +01:00
Ayo
ad65225131 chore: release form@0.6.7, validator@0.2.7, common@0.1.5 2023-01-04 13:52:57 +01:00
Ayo Ayco
986151fe3e
docs(form): update Form properties and respective documentation (#248)
* chore: project clean up

* feat(form): update Form properties

* docs: update documentation for the Form properties

* fix(demo): update form method demo
2023-01-04 13:43:50 +01:00
Madhav Setia
dd285e72a4
docs: update links to the repository (#247)
* Link to repo updated

* Update introduction.md

* docs: update links to change logs

Co-authored-by: Ayo <ramon.aycojr@gmail.com>
2023-01-04 11:48:37 +01:00
Ayo
814692d9c9 chore: release form@0.6.6, validator@0.2.6, common@0.1.4 2023-01-02 17:52:12 +01:00
Ayo
8ed98ad1f1 chore: fix dependency 2023-01-02 17:40:10 +01:00
Fazza Razaq Amiarso
9bdff22174
fix: change wrong internal package dependencies version (#241) 2023-01-02 17:29:24 +01:00
Woramat Ngamkham
234ffaf38c
feat(form): add form action for submit (#237) 2022-12-27 20:42:34 +01:00
Ayo
5256243858 chore: add mastodon verification 2022-12-20 23:46:48 +01:00
Preet Sojitra
e502d1d9cf
docs: modify validators docs (#233) 2022-12-18 19:31:04 +01:00
Neil An
c73675710f
chore: create script for updating RELEASE.md before PR (#232)
* added prompt-sync and semver libraries

* added a release update script

* removed semver package as dependency

* removed versioning, updated descriptions

* resolve conflict in package.json
2022-12-16 13:43:48 +01:00
Alexander Samaniego
5aa7c19874
feat(validator): add validation support for RadioGroup (#234)
* Removed div element from RadioGroup

* Fixed first RadioGroup unit test
2022-12-12 20:54:03 +07:00
Fazza Razaq Amiarso
25ce684d23
feat: Types and Intellisense Improvements (#231) 2022-12-07 20:56:27 +01:00
Alexander Samaniego
5b539c809c
feat(form): implement FormControl and ControlConfig prop triggerValidationOn (#224)
* Added ValidationHooks and attribute to FormControl

* Event listener uses data attribute to set type

* Changed default event listener to blur

* Add validation data attribute to other components

* Adjusted querySelector to remove condition

* Added nullish operator to prevent error

* Added optional chaining to validator
2022-12-06 18:44:52 +07:00
Ayo
4b5b81a2b5 chore: update package-lock 2022-12-05 21:36:21 +01:00
Ayo
e6dd753196 chore: release form@0.6.5, validator@0.2.5 2022-12-05 21:08:34 +01:00
Ayo
1a19aea1fd chore: release form@0.6.4, validator@0.2.4, common@0.1.3 2022-12-05 20:47:32 +01:00
Lalit
4c46aa1518
docs(validator): Added initial docs for validators (#226) 2022-12-05 20:06:46 +01:00
Lalit
7e4c05a2c7
docs: Mentioned validateOnLoad prop for Form component (#223)
* docs: Mentioned validateOnLoad prop

* refactor: Changed some class name for better readability
2022-12-02 15:18:17 +01:00
Lalit
29c8c870b7
style(landing-page): Displaying toast on clicking copy button (#222) 2022-12-02 14:53:16 +01:00
Ayo
26e099e2cf feat(apps/docs): fix contributors path 2022-12-02 09:22:29 +01:00
Neil An
924edc017a
generate a favicon.ico for our apps (#221)
* generated new favicon.ico

* updated icon

* added white circular background to icon
2022-12-02 09:13:19 +01:00
Woramat Ngamkham
975b2e821a
feat(form): add validateOnLoad prop (#213)
* feat(form): add validateOnLoad prop

* feat(form): add FormConfig interface

* refactor(form): refactor FormConfig

* refactor(demo): change params to FormConfig

* chore(demo): remove FormConfig on demo

* feat(form): make validateOnLoad to be false by default

* feat(form): add setValidateOnLoad method

* chore(form): edit comment on validateOnLoad

* feat(form): remove setValidateOnLoad in FormGroup

* revert(form): add FormConfig interface

This reverts commit 44b58d4a43d4d2e8bcd3dc799e3110f9b8f23604.

* revert(demo): change params to FormConfig

This reverts commit 98f8602000505a29d04493617043aa0cfb00a969.
2022-11-30 15:28:48 +07:00
Ayo Ayco
a4ea634b5c
exploration(hyperdrive): problem statement (#219) 2022-11-29 21:00:43 +01:00
Lalit
bcbb517828
test(form): Added test Field.astro to test for category validation prop (#217)
* test(form): Added test Field.astro to test for category validation prop

* test(form): Testing all categories instead of just one for better test coverage
2022-11-29 20:34:11 +01:00
Ayo Ayco
03565d1f78
initial experimental demo page for hyperdrive (#218)
* create button component with disabled prop

* feat(demo): Layout component (#214)

* refactor(form): validation attributes set null instead of false (#215)

* create button component with disabled prop

* refactor: remove unused import

* refactor: clean up nav; new experimental demo

* create button component with disabled prop

* refactor: remove unused import

* refactor: remove unused component
2022-11-29 20:33:46 +01:00
Ayo Ayco
1d77e18f31
refactor(form): validation attributes set null instead of false (#215) 2022-11-28 19:46:22 +01:00
Ayo Ayco
033d0322bb
feat(demo): Layout component (#214) 2022-11-28 22:46:10 +07:00
Lalit
965a16aaec
feat(validator): Adding error, warn, info categories support. (#204) 2022-11-26 18:34:14 +01:00
Woramat Ngamkham
2f2c28b13f
fix(validator): use a checked attribute for required validation in checkboxes (#205) 2022-11-25 21:35:42 +01:00
Ayo Ayco
21cd3f1775
feat(docs, landing-page): mention turborepo and link to discord (#210)
* docs: update contributing for turborepo and discord

* feat(docs, landing-page): link to the new discord server
2022-11-25 15:47:39 +01:00
Fazza Razaq Amiarso
0853ca3b8f
fix: extends timeout for timed out test (#208)
* fix: extends timeout for timed out test

* fix: add dependent script to turbo test

* fix: disable threading for test

* fix: add timeout to vitest config

* chore: remove test-ci script

* fix: extends timeout to validator vitest config

* chore: conditionally disabling vitest threading on CI
2022-11-25 14:37:23 +01:00
Ayo Ayco
7d05ecc580
chore(library): implement turporepo (#206) 2022-11-23 20:05:07 +01:00
Ayo
89d1fde3d2 chore: remove unused pnpm lock 2022-11-22 16:22:06 +01:00
Fazza Razaq Amiarso
59d76181db
test(migrate): migrate test tooling from chai + mocha to vitest (#203)
* test(migrate): migrate test tooling from chai + mocha to vitest

* fix: fix wrong vitest cli command for watch
2022-11-21 13:15:58 +01:00
Ayo
fcde7eb14f add mastodon ownership verification 2022-11-13 18:52:46 +01:00
Neil An
31884a1757
feat(form): add setValue method to FormGroup class (#191) 2022-11-12 22:15:54 +01:00
Woramat Ngamkham
3faabb2348
chore(docs): change site option (#198) 2022-11-12 19:54:13 +01:00
Ayo
1ea41f658a devops: test commit to trigger landing page build and deploy 2022-11-12 10:23:48 +01:00
Ayo Ayco
a0a20c33b2
feat(form): add index to radio group item id (#193)
* feat(form): add index to radio group item id

* feat(form): radio-option label for prop

* fe-test(form): update tests for radio group
2022-11-12 07:57:31 +01:00
Ayo
061cec876e chore: test commit for auto deploy 2022-11-10 20:11:15 +01:00
Ayo
fb4bc0c6c1 chore: test commit to trigger deploy 2022-11-10 20:06:12 +01:00
Ayo
b054f29e74 feat(landing-page): test auto deploy commit 2022-11-10 19:08:07 +01:00
Ayo
6b96cd1e34 chore: update check and build scripts 2022-11-10 19:03:45 +01:00
Ayo
d407f0e379 chore(form): update package homepage 2022-11-10 18:54:33 +01:00
Ayo
b3ec749aaf landing-page: commit to test auto deploy 2022-11-10 15:38:50 +01:00
Ayo
661ea9039c feat(landing-page): force dark theme 2022-11-10 15:32:55 +01:00
Ayo Ayco
7bf0df9ec9
fix(landing-page): js error (#187) 2022-11-09 23:09:26 +01:00
Ayo Ayco
f86253d66f
fix(landing-page): js not shipped (#185)
* fix(landing-page): js not shipped

* refactor: remove hydration directive
2022-11-09 22:46:29 +01:00
Ayo Ayco
ce1d4df9e8
chore: update deps (#183) 2022-11-08 10:18:25 +01:00
Ayo
3aab9b640e docs: reactivity, motivation, and tradeoffs 2022-11-08 09:52:57 +01:00
Alexander Samaniego
93a8d49f0a
feat(form): implement unique IDs (#182)
* Added Short Unique ID npm library

* Added unique ID to form-control

* Added unique ID to form-group

* Unique ID added to <form>

* Added unique IDs to control components

* Added IDs to label and fieldset

* Update Form.astro with requested changes

Co-authored-by: Ayo Ayco <ayo@ayco.io>

* Adjustments for requested changes.

Co-authored-by: Ayo Ayco <ayo@ayco.io>
2022-11-08 08:53:22 +01:00
Ayo
d02c1e4081 style(docs): move notice; update note icon 2022-11-07 22:14:34 +01:00
Ayo
6bab48f485 style(landing-page): remove title 2022-11-07 22:03:04 +01:00
Ayo
ab410926af style(landing-page): splash padding; copy color 2022-11-07 21:59:16 +01:00
Ayo Ayco
205d1f27b2
style(landing-page): force dark theme (#181)
* style(landing-page): force dark theme

* fix(landing-page): wrong title and url
2022-11-07 19:48:04 +01:00
Ayo Ayco
47c0b5e90e
docs: clean up (#180)
* docs: clean up

* landing-page: remove image; update deps

* landing-page: remove twitter icon

* style(landing-page): set md maxwidth for copylink
2022-11-07 19:32:29 +01:00
Ayo
0158fd636a landing-page: load splash immediately 2022-11-07 12:33:47 +01:00
Ayo
29ce2fe3b1 refactor(landing-page): starfield script on splash component 2022-11-07 12:10:18 +01:00
Ayo
80d92ae81f fix(landing-page): starfield not loading 2022-11-07 12:04:08 +01:00
Ayo
251c7681d5 fix(landing-page): make starfield load first 2022-11-07 11:56:46 +01:00
Ayo
007f56c1b9 fix(landing-page): make starfield load 2022-11-07 11:52:17 +01:00
Ayo
7dc741e3b3 feat(landing-page): make splash presentable 2022-11-07 11:42:25 +01:00
Ayo
0775cf571f feat(landing-page): link to our docs site 2022-11-07 11:10:45 +01:00
Ayo
e6ca1f85bd Docs: update community invite link 2022-11-07 10:58:58 +01:00
Ayo
0ff115fdfb docs: fix typo 2022-11-06 22:06:42 +01:00
Ayo Ayco
31b95cbe2b
docs: setting up submit control (#177)
* docs: setting up submit control

* refactor: remove new line
2022-11-06 21:23:55 +01:00
Ayo Ayco
cec0a02c46
docs: initial Form, FormGroup documentation (#176)
* docs: initial structure and form api docs

* feat(docs): warning underconstruction

* docs: initial FormGroup and FormControl docs

* docs: initial example usage

* fix: docs build errors
2022-11-06 20:11:42 +01:00
Ayo
ec19766202 chore: release common, form, validator 2022-11-05 09:23:42 +01:00
Ayo
6ae1bec42f chore: update deps 2022-11-05 08:53:22 +01:00
Ayo
5635c5461e chore: update release notes 2022-11-05 08:51:33 +01:00
Ayo
380e88c72f refactor: remove unused import 2022-11-05 08:51:21 +01:00
Ayo
e089626f81 refactor: make checked optional prop 2022-11-05 08:50:54 +01:00
Ayo
2888c766b7 chore: release form, common, validator 2022-11-05 08:36:47 +01:00
Ayo
1eca8f2e27 chore: update build script to run astro check 2022-11-05 08:30:11 +01:00
Ayo
9e54d2b0a9 fix: broken types 2022-11-05 08:29:43 +01:00
Ayo
a868e4f550 fix: broken config type 2022-11-05 08:29:16 +01:00
Ayo
0a0b8ae809 chore: mention conventional commits 2022-11-04 17:31:42 +01:00
Ayo
e9de68fe49 chore: release patch for wrong dependency version 2022-11-02 21:58:42 +01:00
Ayo
89e0353c47 chore: add pnpm yaml 2022-11-02 21:48:27 +01:00
Ayo
fcf32cb21b chore: update release docs for common@0.1.0 2022-11-02 21:43:36 +01:00
Ayo
56f597708c chore: sync package lock 2022-11-02 21:39:25 +01:00
Ayo
b42c0de131 chore: sync package-lock 2022-11-02 21:35:17 +01:00
Ayo
f27f96c9dc chore: release validator@0.2.0 2022-11-02 21:33:37 +01:00
Ayo
c28b117fd1 chore: release form@0.6.0 2022-11-02 21:32:32 +01:00
Ayo
33e421fffb chore: release common@0.0.4 2022-11-02 21:28:08 +01:00
Ayo
b01d829819 chore: update deps 2022-11-02 21:10:27 +01:00
Woramat Ngamkham
b4c33eec66
refactor(form): deprecate labelPosition (#172) 2022-11-01 16:24:29 +01:00
Woramat Ngamkham
f93f8b6484
feat(form): implement TextArea control (#169) 2022-11-01 00:21:39 +01:00
Chase Reynolds
c38e5dfbe3
feat(form): add method setValidators to FormControl (#170) 2022-10-31 19:27:06 +01:00
Allan Siqueira
f502e6ca24
feat(form): readOnly flag (#166)
* feat: add readOnly flag on form

* fix: resolve PR coments

* fix: add flag disabled to fields that dont have effect on readonly attr
2022-10-31 17:27:43 +01:00
Ayo
640e945959 docs: hacktoberfest end 2022-10-30 09:45:44 +01:00
Ayo Ayco
d5c2b7786d
Chore clean up demo app (#165)
* feat(demo): new nav component

* refactor: remove hr
2022-10-29 21:26:11 +02:00
Ayo
6d9907a06c chore: update deps 2022-10-29 12:55:34 +02:00
Neil An
a37b6c80df
feat: add a new demo page! (#164)
* integrated tailwind

* added links to job application page

* feat: add a new demo page
2022-10-29 12:45:21 +02:00
Ayo
b9a3e5a8fc docs: update package column 2022-10-28 22:56:58 +02:00
Ayo
f341a23414 docs: update column for release notes 2022-10-28 22:56:06 +02:00
Ayo
0f0ec230d0 docs: update play with section badges 2022-10-28 22:41:59 +02:00
Ayo
e49791fe55 docs: add section "Play around" 2022-10-28 22:39:26 +02:00
Ayo
ba31f1b046 docs: add github logo to commits badge 2022-10-28 22:36:41 +02:00
Ayo
d2a4cb1635 docs: clean badges 2022-10-28 22:33:52 +02:00
Woramat Ngamkham
5677222258
fix(form): asterisks on Label.astro (#160) 2022-10-28 22:14:50 +02:00
Munyaneza Armel
4b3e4c9f50
docs(codesandbox): added link to codesandbox example (#159)
* configure codesandbox

* docs(codesandbox):changed bagde

* docs(codesandbox):changed bagde
2022-10-28 22:13:13 +02:00
Woramat Ngamkham
304cad0151
feat(form): add Dropdown control (#158) 2022-10-28 19:48:26 +02:00
Anish Sarawgi
5a96395280
docs: fix stackblitz link on readme (#157) 2022-10-28 16:39:36 +02:00
Aiden Jolley-Ruhn
4180f78d95
docs: updating readme.md package tables (#153) 2022-10-28 14:07:32 +02:00
Munyaneza Armel
539c701cd7
docs(add link stackblitz) (#155) 2022-10-28 14:06:10 +02:00
Ayo
796fb962ae chore: bump patch, update deps 2022-10-28 13:24:39 +02:00
Ayo
42a53522db chore: update deps 2022-10-28 13:23:22 +02:00
Ayo
9513ef2134 chore: bump patch and publish common 2022-10-28 13:17:46 +02:00
Ayo
606e455e6e chore: bump patch and publish form 2022-10-28 12:57:00 +02:00
Ayo
30fc4f48c9 fix(form): wrong import in form-control.ts 2022-10-28 12:54:18 +02:00
Ayo
54e4287b5f chore: bump patch and publish form, validator 2022-10-28 12:49:07 +02:00
Ayo
3cba6e8e9c chore: bump patch and publish common 2022-10-28 12:46:49 +02:00
Ayo
79882fd9b1 refactor: use @astro-reactive/common 2022-10-28 12:41:32 +02:00
Ayo
40dba08c6a chore: initialize common package 2022-10-28 12:34:30 +02:00
Lalit
426c5ab303
ui(landing-page): Added astro section (#150) 2022-10-28 10:41:47 +02:00
Woramat Ngamkham
ebff4940f2
refactor(form): implement options prop for Radio (#147) 2022-10-25 09:56:06 +02:00
Woramat Ngamkham
c8ace159da
fix(form): asterisks ::before pseudoclass (#131) 2022-10-25 08:35:34 +02:00
Rishabhraghwendra18
facefc4da5
chore: added npm outdated command for patch,minor, and major commands (#146) 2022-10-24 17:13:23 +02:00
Ayo
b2eeed0663 docs: update package descriptions 2022-10-24 11:18:25 +02:00
Ayo
5147cd982f doc: update packages 2022-10-24 11:01:15 +02:00
Ayo
6ac9100a2f docs: update readme and TODO comment 2022-10-24 10:59:43 +02:00
Ayo
819d6e4526 chore: bump patch form 2022-10-23 23:25:58 +02:00
Ayo
715eaaa408 fix(form): import of validator causes error if not installed 2022-10-23 23:23:23 +02:00
Ayo
66ba7fa292 chore: bump minor version for form, validator 2022-10-23 23:13:23 +02:00
Ayo Ayco
3d361fcb5b
refactor: form package cleanup (#135)
* refactor: form package cleanup

* refactor: organize components folder
2022-10-23 23:04:40 +02:00
Ayo
b9995b8a63 docs: update project and packages readme 2022-10-23 20:26:32 +02:00
Munyaneza Armel
a396969513
added gitpod (#129) 2022-10-22 22:31:16 +02:00
Ayo
21486e1baa chore: update pull request template 2022-10-22 21:21:53 +02:00
Ayo
f081304d6f chore: update github templates 2022-10-22 21:17:59 +02:00
Mukesh Singh
d235fb7552
Copy to Clipboard Functionality Added on Landing Page (#128) 2022-10-22 19:38:18 +02:00
Utkarsh Singh
052ab3bdb3
Update README.md (#127) 2022-10-22 15:14:57 +02:00
Preet Sojitra
70ae327f02
fix responsiveness of landing-page (#125) 2022-10-22 10:18:59 +02:00
Ayo Ayco
d128747240
feat(validator): server-side rendered validation errors (#123)
* feat(validator): server-side rendered validation errors

* test(form): field should render error

* refactor: remove comment

* fix: incorrect imports

* chore: update deps

* chore: update build commands
2022-10-22 04:35:16 +02:00
Ayo
82c121a85d fix(form): incorrect imports 2022-10-21 15:21:50 +02:00
Ayo
304100fa5f chore: update pull request template 2022-10-21 14:24:20 +02:00
Ayo
ddccd5cf80 chore: remove test step for packages/common 2022-10-21 14:10:35 +02:00
Ayo
4fd6f33fe9 core: common directory for packages (#114) 2022-10-21 14:05:23 +02:00
Chase Reynolds
b96e3383dc
[feat]: Add a new demo page (#120) 2022-10-21 00:52:35 +02:00
Lalit
0cb3167a04
test(packages/form): Added some tests for Field and FieldSet components (#119) 2022-10-20 16:14:33 +02:00
Lalit
97a5edd746
chore: Shared eslint + prettier for packages (#117) 2022-10-20 11:59:04 +02:00
Woramat Ngamkham
030752b4cc
feat(form): Add radio (#111) 2022-10-20 07:58:40 +02:00
Lalit
8d7ef9e879
feat(landing-page): call-to-actions buttons (#116) 2022-10-19 16:35:38 +02:00
Ayo
6e39c882ae docs: update link to issues accepting PRs 2022-10-19 13:48:23 +02:00
Ayo Ayco
964e800dae
chore: patch packages (#108) 2022-10-18 12:16:58 +02:00
Ayo Ayco
31a8e8c77d
chore: update deps (#107) 2022-10-18 11:04:16 +02:00
Ayo
17d1487913 feat(landing-page): social links 2022-10-17 19:01:39 +02:00
Ayo
065b84f93c docs: initial form api documentation 2022-10-17 17:37:26 +02:00
Ayo
a90ceec55e docs: initial getting-started document 2022-10-17 16:21:46 +02:00
Ayo
98c4b77648 chore: update packages homepages 2022-10-17 11:33:59 +02:00
Ayo
685ba32d82 docs(form): remove typo on readme 2022-10-16 13:36:35 +02:00
Ayo
0aa0deac32 chore(packages): bump patch 2022-10-16 10:33:35 +02:00
Ayo Ayco
5e1a44c79e
docs(apps,packages): update content (#93)
* docs(apps,packages): update content

* chore: update pull request template
2022-10-16 10:26:20 +02:00
Ayo
36742b7239 docs(package): update release docs 2022-10-15 19:35:16 +02:00
Ayo Ayco
4f1578aa72
Chore update project for new package validator (#91)
* chore: updates for new validator package and landing-page app

* docs: update packages examples

* chore: bump patch, update docs
2022-10-15 19:16:48 +02:00
Ayo Ayco
4dc020027f
feat: create astro reactive validator (#90)
* feat: initial validator component

* chore: fix eslint for validator

* chore: update package info for validator

* chore: remove vscode settings for docs

* chore: put docs and demo into apps

* chore: move package scope @astro-reactive

* test: update tests for validator

* feat: validator functions, hooks

* feat: validator sets haserrors attribute

* feat: use data-validator attributes

* feat: showValidationHints

* feature: add logic for all validators

* refactor: remove Validator component usage

* docs(validator): initial readme

* chore: comment out unsupported validator

* docs(validator): update installation

* chore: package docs and publish

* chore: update deps

* docs: update npm info on docs

* docs(validator): update docs for validator

* fix(form): handle undefined form

* test(validator): update tests

* chore: organize files; update deps

* chore: fix build scripts
2022-10-15 16:32:02 +02:00
Preet Sojitra
e5d4e90805
feat: initial landing page (#89)
* create basic landing page

* change name in package.json
2022-10-15 16:30:40 +02:00
Ayo
d6a7f98e3f chore: bump minor version for astro-reactive-form 2022-10-13 17:34:44 +02:00
Ayo
8fe968fbc6 feat: new type for control configuration ControlConfig 2022-10-13 17:29:20 +02:00
Ayo Ayco
7db1be51e6
docs:update email (#85) 2022-10-13 13:55:38 +02:00
Ayo Ayco
1b27b1553c
chore: update release docs (#84) 2022-10-13 10:17:11 +02:00
Ayo Ayco
d8577871b4
docs: update readmes (#83) 2022-10-13 10:10:31 +02:00
Ayo Ayco
a18fc82c89
docs: update project logo (#82)
* chore: organize assets

* docs: update logo in readme docs

* update logo

* readme formatting

* readme formatting

* add min-banner

* update banner

* update readmes
2022-10-13 10:03:31 +02:00
Rutvikk :D
14cb33854e
design: added logo for the website (#81) 2022-10-13 09:01:07 +02:00
Ayo Ayco
2c2c8d19f7
Chore update pull request template (#76)
* chore: update pull request template

* chore: update PR template
2022-10-08 23:15:43 +02:00
Ayo Ayco
ddbd910981
feat: update release notes (#75) 2022-10-08 23:04:32 +02:00
Ayo Ayco
d41738776d
devops: prioritize tests over linting (#74)
* devops: prioritize tests over linting

* docs: update release
2022-10-08 22:53:48 +02:00
Ayo Ayco
9a35744142
chore: bump patch, update commands (#73) 2022-10-08 22:51:08 +02:00
Ayo Ayco
06f53bc78f
docs: update astro-reactive-form readme (#72)
* docs: update astro-reactive-form readme

* docs: formatting
2022-10-08 22:46:21 +02:00
Ayo Ayco
0acc1968c1
feat: support single form group (#71) 2022-10-08 22:29:08 +02:00
Fazza Razaq Amiarso
1491135302
[feat]: Implement form theme (#69) 2022-10-07 21:23:32 +02:00
Ayo Ayco
ef779de6d4
chore: update docs and commands for the docs website (#67) 2022-10-07 15:58:05 +02:00
Ayo Ayco
4e2d1562e6
chore: update package lock (#65) 2022-10-07 15:45:00 +02:00
Rishav Mitra
a359349086
docs: add documentation site as new workspace (#64)
* add documentation site as new workspace

* update package-lock.json

* Update docs/package.json

Co-authored-by: Ayo Ayco <ramon.aycojr@gmail.com>

* Update docs/src/components/Footer/AvatarList.astro with correct URL's

Co-authored-by: Ayo Ayco <ramon.aycojr@gmail.com>

* Update docs/src/config.ts

Co-authored-by: Ayo Ayco <ramon.aycojr@gmail.com>

* Update docs/src/config.ts

Correct GITHUB_EDIT_URL

Co-authored-by: Ayo Ayco <ramon.aycojr@gmail.com>

Co-authored-by: Ayo Ayco <ramon.aycojr@gmail.com>
2022-10-07 15:41:56 +02:00
Ayo Ayco
e924e56d38
docs: update links to new issue (#63) 2022-10-07 10:56:43 +02:00
Ayo Ayco
3605a76037
docs: update link to new issues (#62) 2022-10-07 10:54:33 +02:00
Ayo Ayco
798753ab77
docs: contributing next actions section (#61) 2022-10-07 10:47:42 +02:00
Fazza Razaq Amiarso
2fd25b7d93
feat: initial form control state (#60)
* Form control tries

* feat: implement form-control state

* fix: organize client methods

* fix(client): return undefined instead of throwing error

* fix: fix exports and lint

* fix: Change implementation of setting isPristine with proxy
2022-10-07 07:35:01 +02:00
Mark
f164bdfb6a
#49 [docs]: add links to docs (#50) 2022-10-06 23:20:47 +02:00
Fazza Razaq Amiarso
a002593b02
[feat]:Form control state #4 (#58) 2022-10-06 23:19:49 +02:00
Ayo Ayco
2da037944b
feat: implement only one submit control (#59)
* feat: implement submit control

* refactor: remove label
2022-10-06 17:57:39 +02:00
Ayo Ayco
96657a9c38
devops: build step checks packages (#57) 2022-10-06 16:53:28 +02:00
Ayo Ayco
7c31381d76
devops: set up package tsc build check (#56) 2022-10-06 16:46:44 +02:00
Ayo Ayco
be195e93e6
docs: add instruction to run the linter (#55) 2022-10-06 16:21:32 +02:00
Ayo Ayco
a5d5b35376
fix: linting errors (#54) 2022-10-06 16:10:49 +02:00
jmakhack
97128a0816
feat: implement form submit button limit (#47)
* feat: implement form submit button limit

* feat: add submit control to form
2022-10-06 16:07:02 +02:00
Ayo Ayco
f1485808c9
devops: set up package linting (#53) 2022-10-06 16:01:23 +02:00
Ayo Ayco
955b9ca27c
refactor: form-control types (#52) 2022-10-06 15:58:12 +02:00
Fazza Razaq Amiarso
a8bfaaa964
feat: Form control placeholder attribute (#48)
* feat: Add placeholder attribute

* fix: remove wrong interface

* fix: fix spacing issue

Co-authored-by: Ayo Ayco <ramon.aycojr@gmail.com>

Co-authored-by: Ayo Ayco <ramon.aycojr@gmail.com>
2022-10-05 18:30:47 +02:00
Ayo Ayco
3c1ab5c40e
Chore project clean up (#42)
* chore: project clean up

* docs: update package release
2022-10-04 19:18:17 +02:00
Amit Kumar Sharma
29abefd605
refactor: astro-reactive-form types (#40)
* [refactor]: astro-reactive-form types
* cleanup: comments and empty lines
Co-authored-by: Amit Kumar Sharma <91947037+amit-2k1@users.noreply.github.com>
2022-10-04 18:26:09 +02:00
Ayo Ayco
66d782bdf0
chore: bump patch; update script (#39) 2022-10-04 17:36:15 +02:00
Ayo Ayco
ca9cd27b0d
chore: update deps (#38) 2022-10-04 17:32:30 +02:00
Ayo Ayco
d4ac8dbec0
chore: update pull request template (#37) 2022-10-04 17:31:43 +02:00
Ayo Ayco
49d2e17ca1
Docs update readme (#36)
* docs: display last commit badge
* chore: simplify pull request template
2022-10-04 17:13:34 +02:00
Ayo Ayco
3f0b3b106d
devops: update build stage; ignore dist (#35) 2022-10-04 17:09:08 +02:00
Ayo Ayco
599db41b00
docs: display build and test badge (#34) 2022-10-04 16:44:40 +02:00
Ayo Ayco
cb7d8cfa26
devops: update build and test pipeline (#33)
* devops: remove test run on node 14
* fix: main branch tests
* chore: update pull request template
* devops: update unit test CI
* devops: fix unit test pipeline
* devops: rename pipeline to "build and test"
2022-10-04 16:38:58 +02:00
Ayo
6e96ce5b52 fix: main branch tests 2022-10-04 16:12:19 +02:00
Ayo
b3dd15b781 experiment: breaking commit 2022-10-04 14:47:10 +02:00
Ayo
bc676af5e7 chore: update package-lock 2022-10-04 14:44:43 +02:00
Ayo Ayco
bbfccc00f3
chore: implement initial CI action 2022-10-04 14:37:22 +02:00
Ayo
da3ceb901d chore: clean up package information 2022-10-04 14:34:21 +02:00
Ayo
d2a9c77724 chore: update project command scripts 2022-10-04 14:30:00 +02:00
Ayo
509cece7d5 docs: update astro-reactive-form RELEASE 2022-10-04 14:04:35 +02:00
Ayo
b386cbb006 chore: bump patch astro-reactive-form 2022-10-04 13:52:54 +02:00
Ayo
fd11d674ea chore: update library and package readme; update license; add assets 2022-10-04 13:51:30 +02:00
Ayo
abf7c33b20 docs: update link to astro-reactive-form 2022-10-04 13:42:04 +02:00
Ayo
8514727e1d style: initial dark and light style scaffold 2022-10-04 13:17:05 +02:00
Ayo
9fe00b3ac7 docs: clean up readme, move release to package 2022-10-04 13:04:25 +02:00
Ayo
7d222239ed docs: update project readme 2022-10-04 13:00:29 +02:00
Ayo
5d6936bff1 chore: update pull request template 2022-10-04 12:59:12 +02:00
Ayo
cb83cd3386 docs: mention running tests in CONTRIBUTING 2022-10-04 12:57:07 +02:00
Ayo
32b37ea9f9 chore: update pull request template (#22)
fixes #22
2022-10-04 12:56:52 +02:00
ramadevsign
47accdf654
chore: implement recommended community standards (#27)
Adds the recommended github community standards to make the project contributor friendly.
2022-10-04 12:47:39 +02:00
Ayo
00a453fe47 docs: update project description 2022-10-04 11:24:20 +02:00
Manish⚡
b21c746d91
Added Description for packages in Readme (#25) 2022-10-03 15:44:56 +02:00
Ayo
9f4c840c87 fix: demo app not using local package (#21) 2022-10-03 08:26:04 +02:00
Ayo
7809a2728d fix: removed default export 2022-10-03 07:56:52 +02:00
Amit Kumar Sharma
ea594da817
[feat]: export all from Form.astro (#20)
[feat]: export all from Form.astro (#20)
2022-10-03 07:38:13 +02:00
Ayo
315e28bc39 docs: update contributing guide 2022-10-02 19:01:12 +02:00
Ayo
373e018c66 docs: add link to contributing guide 2022-10-02 18:53:23 +02:00
Ayo Ayco
0368417e32
docs: Add contributor pictures to the project README (#16)
Add contributor pictures to the project README
2022-10-02 18:49:47 +02:00
Adetoye Adewoye
55feb87027
Update contributor list in Readme 2022-10-02 17:47:35 +01:00
Adetoye Adewoye
3658257bd0
Add contributor pictures to the project README 2022-10-02 16:50:25 +01:00
Ayo Ayco
2393186c43
refactor: IFormControl to FormControlBase and added radio prop (#6)
Fixes #6: refactored IFormControl to FormControlBase and added radio prop.
2022-10-02 17:17:01 +02:00
Shivam Chourasia
5fb10d9b8c
Fix #6: refactored IFormControl to FormControlBase and added radio prop. 2022-10-02 20:41:47 +05:30
Ayo Ayco
24b571f440
Merge pull request #14 from Jaspreet099/main
Updated name in contributors
2022-10-02 17:07:20 +02:00
Jaspreet Singh Saini
eaaade22d2
Updated name in contributors 2022-10-02 20:35:37 +05:30
Ayo Ayco
ead1ee2aba
docs: initial RELEASE.md (#10)
Create RELEASE.md
2022-10-02 16:49:22 +02:00
Jaspreet Singh Saini
9009c013b2
Create RELEASE.md
Created initial release file (#10)
2022-10-02 20:10:59 +05:30
Ayo
fd118e2c41 docs: add link to the issues page 2022-10-02 10:34:32 +02:00
Ayo
a3c09c8bca docs: update readme instructions 2022-10-02 09:56:32 +02:00
Ayo
cee89447db docs: correct typo 2022-10-02 09:54:46 +02:00
Ayo
30826e6180 docs: add hacktoberfest link 2022-10-02 09:54:02 +02:00
Ayo
cf6fa87f0d docs: add contributors to readme 2022-10-02 09:38:01 +02:00
Ayo
4eaa35394f docs: update email on readme 2022-10-02 09:36:34 +02:00
Ayo
e6f5248dcc docs: update readme and contributing 2022-10-02 09:35:36 +02:00
Ayo
1238356ebf docs: update project readme 2022-10-01 22:09:22 +02:00
Ayo
48892f31d3 docs: add astro-reactive-datagrid 2022-10-01 21:58:22 +02:00
Ayo
c1dfdb8a8d docs: move the contributing.md 2022-10-01 21:53:20 +02:00
Ayo
431493cb16 docs: initial CONTRIBUTING.md 2022-10-01 21:52:10 +02:00
Ayo
32dd989fdf refactor(Field.astro): handling of labelPosition 2022-10-01 20:33:47 +02:00
Ayo
8a9f70a254 docs: update reactive form future plans 2022-10-01 20:23:59 +02:00
Ayo
43bef7ab36 deps: bump version 2022-10-01 19:37:00 +02:00
Ayo
56806e8225 docs: update readme example 2022-10-01 19:36:14 +02:00
Ayo
63868e4587 feat: update demo app and package readme 2022-10-01 19:32:55 +02:00
Ayo
d85810621b feat: FormGroup.get(), FormControl.setValue() 2022-10-01 19:25:08 +02:00
Ayo
a348c7a4ed docs: update readme image 2022-10-01 18:41:48 +02:00
Ayo
a38a003553 docs: update readme image 2022-10-01 18:41:48 +02:00
Ayo
e811da3860 chore: update monorepo scripts and readme 2022-10-01 17:15:24 +02:00
Ayo
a3da67c90c fix: linting errors 2022-10-01 17:15:00 +02:00
Ayo
d00c7bc5d5 chore: fix repository links 2022-10-01 16:48:20 +02:00
Ayo
4c841b67a2 docs: add instructions for running demo locally 2022-10-01 16:42:24 +02:00
Ayo
019b0523ec chore: update package info; monorepo readme 2022-10-01 16:39:35 +02:00
Ayo
1805c235ed docs: update monorepo readme image 2022-10-01 16:33:26 +02:00
Ayo
6984787040 docs: update monorepo readme 2022-10-01 16:25:07 +02:00
Ayo
d265e31d29 docs: update monorepo library 2022-10-01 16:20:13 +02:00
Ayo
de4bc4e3b0 docs: update monorepo readme 2022-10-01 16:14:24 +02:00
Ayo
0556f69a62 chore: bump patch astro-reactive-form 2022-10-01 15:58:01 +02:00
Ayo
96beb00422 chore: add scripts for package management 2022-10-01 15:57:23 +02:00
Ayo
21536ded4b docs: update monorepo readme 2022-10-01 15:56:46 +02:00
Ayo
eddf262add chore: clean up monorepo 2022-10-01 15:44:39 +02:00
Ayo
c6dc470b07 test: re-scope of Form.astro tests 2022-10-01 15:44:00 +02:00
Ayo
fdd1f7cf50 fix: imported as type only 2022-10-01 14:32:34 +02:00
Ayo
76e57c5fd5 chore: initial validator library; monorepo readme 2022-10-01 14:31:32 +02:00
Ayo
c1f9716d8b move astro-reactive-form to separate workspace 2022-10-01 14:18:16 +02:00
Ayo
5caf3d9cde feat: support all HTML input types 2022-10-01 13:28:18 +02:00
Ayo
e91c060c9e chore: script for running the demo app 2022-10-01 13:10:53 +02:00
Ayo
f2dfe8aa8a chore: deps for demo app 2022-10-01 13:08:39 +02:00
Ayo
158f817d5a feat: support password type 2022-10-01 13:08:16 +02:00
Ayo
1927b14b66 initial demo app 2022-10-01 13:07:05 +02:00
Ayo
2cde19237e docs: update plan for validation 2022-10-01 09:26:29 +02:00
Ayo
677c68d706 0.1.1 2022-09-27 22:45:58 +02:00
Ayo
994a903342 docs: update example in readme 2022-09-27 22:45:50 +02:00
Ayo
f725d089a8 0.1.0 2022-09-27 22:37:45 +02:00
Ayo
abdacca8bf feat: support multiple form groups with legend 2022-09-27 22:37:27 +02:00
201 changed files with 28387 additions and 10302 deletions

11
.build.yml Normal file
View file

@ -0,0 +1,11 @@
image: alpine/edge
secrets:
- bbfcb6dc-7c4a-42ee-a11a-022f0339a133
environment:
REPO: astro-reactive
GH_USER: ayoayco
tasks:
- push-mirror: |
cd ~/"${REPO}"
git config --global credential.helper store
git push --mirror "https://github.com/${GH_USER}/${REPO}"

8
.changeset/README.md Normal file
View file

@ -0,0 +1,8 @@
# Changesets
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

11
.changeset/config.json Normal file
View file

@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}

View file

@ -1,17 +1,4 @@
/** @type {import("@types/eslint").Linter.Config} */
module.exports = {
env: {
node: true,
},
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: {
// We don't want to leak logging into our user's console unless it's an error
'no-console': ['error', { allow: ['warn', 'error'] }],
},
extends: ["turbo"],
};

76
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View file

@ -0,0 +1,76 @@
---
name: "Bug Report"
about: "Report an issue to help the project improve."
title: "bug(scope): description "
labels: "Type: Bug"
---
<!--
☝️ "scope" in the title could be one of our apps or packages:
- form, validator, demo, landing-page, docs...
-->
<!-- Fill up as much information as you can to help us investigate 🙏 -->
## **Bug Report**
### **Describe the bug**
<!-- A clear and concise description of what the bug is. -->
- ***
### **Is this a regression?**
<!-- Did this behaviour used to work in the previous version? -->
<!-- Yes, the previous version in which this bug was not present was: ... -->
---
### **To Reproduce**
<!-- Steps to reproduce the error:
(e.g.:)
1. Use x argument / navigate to
2. Fill this information
3. Go to...
4. See error -->
<!-- Write the steps here (add or remove as many steps as needed)-->
1.
2.
3.
4.
---
### **Expected behaviour**
<!-- A clear and concise description of what you expected to happen. -->
- ***
### **Media proof**
<!-- If applicable, add screenshots or videos to help explain your problem. -->
---
### **Your environment**
<!-- use all the applicable bulleted list element for this specific issue,
and remove all the bulleted list elements that are not relevant for this issue. -->
- OS: <!--[e.g. Ubuntu 5.4.0-26-generic x86_64 / Windows 1904 ...]-->
- Node version:
- Npm version:
- Browser name and version:
---
### **Additional context**
<!-- Add any other context or additional information about the problem here.-->
-
<!-- THANK YOU FOR THE CONTRIBUTION! 🚀 -->

View file

@ -0,0 +1,39 @@
---
name: "Feature Request"
about: "Suggest an idea or new feature for this project."
title: "feat(scope): description "
labels: "Type: Feature"
---
<!--
☝️ "scope" in the title could be one of our apps or packages:
- form, validator, demo, landing-page, docs...
-->
<!-- Fill up as much information as you can to help us understand the request 🙏 -->
## **Feature Request**
## **Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
- ***
## **Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->
- ***
## **Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
- ***
### **Additional context**
<!-- Add any other context or additional information about the problem here.-->
-
<!-- THANK YOU FOR THE CONTRIBUTION! 🚀 -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="500" zoomAndPan="magnify" viewBox="0 0 375 374.999991" height="300" preserveAspectRatio="xMidYMid meet" version="1.0"><defs><clipPath id="702d27c854"><path d="M 124.9375 112.5 L 265 112.5 L 265 262.5 L 124.9375 262.5 Z M 124.9375 112.5 " clip-rule="nonzero"/></clipPath><clipPath id="db9c64370c"><path d="M 169 153 L 189 153 L 189 262.5 L 169 262.5 Z M 169 153 " clip-rule="nonzero"/></clipPath></defs><g clip-path="url(#702d27c854)"><path fill="#004aad" d="M 124.9375 262.386719 C 150.457031 262.386719 167.863281 230.78125 175.042969 207.984375 C 174.734375 207.984375 174.421875 207.984375 174.117188 207.984375 C 172.316406 207.984375 171.382812 206.539062 170.707031 204.882812 C 168.757812 204.882812 166.808594 204.882812 164.859375 204.882812 C 164.226562 206.949219 162.894531 208.851562 161.359375 209.652344 C 158.1875 211.300781 155.019531 212.949219 151.84375 214.597656 C 149.707031 215.710938 147.953125 214.273438 147.953125 211.40625 C 147.953125 208.566406 147.953125 205.730469 147.953125 202.894531 C 147.953125 200.027344 150.296875 197.605469 151.84375 195.644531 C 154.96875 191.703125 158.089844 187.757812 161.214844 183.808594 C 160.820312 178.402344 160.429688 172.996094 160.035156 167.585938 C 160.035156 150.964844 167.257812 136.027344 178.738281 125.710938 C 190.214844 136.027344 197.433594 150.964844 197.433594 167.585938 C 197.042969 172.992188 196.652344 178.402344 196.261719 183.808594 C 199.386719 187.757812 202.507812 191.699219 205.632812 195.644531 C 207.179688 197.605469 209.523438 200.027344 209.523438 202.894531 C 209.523438 205.730469 209.523438 208.570312 209.523438 211.40625 C 209.523438 214.273438 207.769531 215.714844 205.632812 214.597656 C 202.460938 212.949219 199.289062 211.300781 196.117188 209.652344 C 194.582031 208.851562 193.25 206.949219 192.613281 204.882812 C 190.664062 204.882812 188.714844 204.882812 186.769531 204.882812 C 186.09375 206.539062 185.164062 207.984375 183.359375 207.984375 C 183.050781 207.984375 182.746094 207.984375 182.433594 207.984375 C 189.613281 230.777344 207.019531 262.386719 232.539062 262.386719 C 241.136719 262.386719 256.164062 262.386719 264.761719 262.386719 L 227.265625 210.183594 C 264.992188 194.1875 265.183594 149.125 244.851562 128.890625 C 234.769531 118.621094 218.894531 112.628906 195.941406 112.628906 C 172.269531 112.628906 148.605469 112.628906 124.9375 112.628906 C 124.9375 162.550781 124.9375 212.46875 124.9375 262.386719 Z M 124.9375 262.386719 " fill-opacity="1" fill-rule="nonzero"/></g><g clip-path="url(#db9c64370c)"><path fill="#ff1616" d="M 186.925781 231.277344 C 187.671875 231.277344 188.273438 231.886719 188.273438 232.617188 L 188.273438 254.832031 C 188.273438 255.566406 187.664062 256.175781 186.929688 256.175781 L 186.925781 256.175781 C 186.191406 256.175781 185.582031 255.574219 185.582031 254.832031 L 185.582031 232.617188 C 185.578125 231.878906 186.183594 231.277344 186.925781 231.277344 Z M 170.546875 231.277344 C 171.292969 231.277344 171.894531 231.886719 171.894531 232.617188 L 171.894531 254.832031 C 171.894531 255.566406 171.28125 256.175781 170.550781 256.175781 L 170.546875 256.175781 C 169.8125 256.175781 169.203125 255.574219 169.203125 254.832031 L 169.203125 232.617188 C 169.203125 231.878906 169.804688 231.277344 170.546875 231.277344 Z M 178.738281 169.320312 C 183.066406 169.320312 186.578125 165.816406 186.578125 161.5 C 186.578125 157.183594 183.066406 153.683594 178.738281 153.683594 C 174.40625 153.683594 170.898438 157.183594 170.898438 161.5 C 170.894531 165.820312 174.40625 169.320312 178.738281 169.320312 Z M 178.734375 221.804688 C 179.480469 221.804688 180.082031 222.414062 180.082031 223.144531 L 180.082031 261.042969 C 180.082031 261.773438 179.46875 262.382812 178.738281 262.382812 L 178.734375 262.382812 C 178 262.382812 177.390625 261.78125 177.390625 261.042969 L 177.390625 223.148438 C 177.390625 222.410156 177.992188 221.804688 178.734375 221.804688 Z M 178.734375 221.804688 " fill-opacity="1" fill-rule="evenodd"/></g></svg>

After

Width:  |  Height:  |  Size: 4 KiB

BIN
.github/assets/logo/min-banner.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

30
.github/pull_request_template.md vendored Normal file
View file

@ -0,0 +1,30 @@
## type(scope): description
<!--
☝️ Put your PR title up here!
"scope" could be one of our apps or packages:
- form, validator, demo, landing-page, docs...
✨ Example PR titles:
- feat(form): implement new FormControl isValid state
- fix(validator): correct the variable name typo causing errors
- style(landing-page): update the logo in the landing page app
- docs: update content project CONTRIBUTING.md
-->
Fixes # <!-- 👈🏻 Put the issue number here! -->
Description of changes: <!-- 👇🏻 List the changes done! -->
-
-
Tag a reviewer: @
Tasks:
- [ ] I have ran the build command to make sure apps are working: `npm run build`
- [ ] I have ran the tests to make sure nothing is broken: `npm run test`
- [ ] I have ran the Astro checker: `npm run check`
- [ ] I have ran the linter to make sure code is clean: `npm run lint`
- [ ] I have reviewed my own code to remove changes that are not needed
<!-- THANK YOU FOR THE CONTRIBUTION! 🚀 -->

32
.github/workflows/build-and-test.yml vendored Normal file
View file

@ -0,0 +1,32 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build and Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run check
- run: npm run build
- run: npm run test
- run: npm run lint

26
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: npm i
- name: Create Release Pull Request
uses: changesets/action@v1
with:
commit: "chore: Update version for release"
title: "chore: Update version for release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

5
.gitignore vendored
View file

@ -1,4 +1,6 @@
node_modules
coverage
dist
npm-debug.log*
yarn-debug.log*
@ -10,3 +12,6 @@ pnpm-debug.log*
*~
*swp
*swo
.turbo/

9
.gitpod.yml Normal file
View file

@ -0,0 +1,9 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
# and commit this file to your remote git repository to share the goodness with others.
tasks:
- init: npm install && npm run build
command: npm run start

1
.npmrc Normal file
View file

@ -0,0 +1 @@
legacy-peer-deps=true

View file

@ -3,6 +3,9 @@
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"cSpell.words": ["Astro"],
"prettier.documentSelectors": ["**/*.astro"]
"cSpell.words": ["Astro", "maxlength"],
"prettier.documentSelectors": ["**/*.astro"],
"[astro]": {
"editor.defaultFormatter": "astro-build.astro-vscode"
}
}

129
CODE_OF_CONDUCT.md Normal file
View file

@ -0,0 +1,129 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
ayo@ayco.io.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

150
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,150 @@
![Astro Reactive Library](https://user-images.githubusercontent.com/4262489/193419437-6e437743-47bf-482b-8f7e-de3c7f5285f8.png)
# Hi, explorer! 🚀
Thanks for checking out the Astro Reactive Library! Welcome to a new adventure.
This is a library of components and utilities for building reactive user interfaces with [Astro](https://astro.build)--a modern web framework.
There's a lot of opportunity to contribute. A good start will be to understand what Astro is, and how to set up a basic Astro project. For this, the [Astro website](https://astro.build) and [documentation](https://docs.astro.build/en/getting-started/) are good places to start.
## Contributing
Any contribution is welcome. Feel free to look around to find something that interests you. :)
The [issues page](https://github.com/astro-reactive/astro-reactive/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+PRs%22) contains some ideas, but they should not limit your contribution.
If you don't find anything there, we are happy to help you get your contribution in.
You can always [create a new issue](https://github.com/astro-reactive/astro-reactive/issues/new/choose) for your own idea, [post on our discussions](https://github.com/astro-reactive/astro-reactive/discussions) or join our [Discord](https://discord.gg/kkvW7GYNAp).
## The Astro Reactive Library
This project aims to be a library that developers will use to create reactive UIs with Astro.
The project is made up of [NPM workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces), which are node projects that share a singular root package. It is good to understand the basics of this, but basically, the project will have multiple packages (under the `packages` directory) that share a common root package information.
We are using [Turborepo](https://turbo.build/repo) as our monorepo build system.
### Packages:
1. [demo](https://github.com/astro-reactive/astro-reactive/tree/main/apps/demo) in the directory `apps/demo`
- Astro web application that we use to test and demonstrate the library components
1. [form](https://github.com/astro-reactive/astro-reactive/tree/main/packages/form) in the directory `packages/form`
- component that allows developers to programmatically build a form
1. [validator](https://github.com/astro-reactive/astro-reactive/tree/main/packages/validator) in the directory `packages/astro-reactive-validator`
- component that allows developers to set up validators for their forms easily
### Apps
1. [docs](https://github.com/astro-reactive/astro-reactive/tree/main/apps/docs) - in the directory `apps/docs`
- Astro website for the library's extensive documentation
1. [landing-page](https://github.com/astro-reactive/astro-reactive/tree/main/apps/landing-page) - in the directory `apps/landing-page`
- Astro website for the library's introductory landing page
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/astro-reactive/astro-reactive.git)
## Running locally
We mainly use the `demo` app to see changes we make on the packages. Do the following to start hacking:
1. Fork the project then clone to your computer
```
git clone git@github.com:<your-user-name>/astro-reactive.git
```
2. Go into the project directory
```
cd astro-reactive
```
3. Install the node dependencies
```
npm i
```
4. Run the demo application
```
npm start
```
5. Open the demo application on you browser. Browse to the address
```
https://localhost:3000
```
# Applications
We also maintain the documentation website and the project landing page in this repository. The source for these applications is found in the `apps` directory.
You can start the dev server for the docs and landing-page websites with the following commands:
```
npm run docs
```
```
npm run landing-page
```
## Running the linter and tests
Please run the linter and tests before creating a PR to avoid delays in PR reviews. Fix all linting errors or failing tests whey you run the following commands.
```
npm run lint
```
```
npm test
```
✨ _HINT: Some linting errors could be automatically fixed with a command_
```
npm run lint:fix
```
## Hacking with the packages
As mentioned above, this project involves packages that are intended to be used in Astro applications. The demo app is our way to test and play with the packages.
If you plan to add features or fix bugs that are found in the packages, such as `@astro-reactive/form`, you can find the source code for this inside the `packages` directory.
Thank you again for your interest in contributing!
## Next Actions
✍️ Read on [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/); you'll see this used around issues, PRs, and commit messages
🏘️ Read our [community guidelines](https://github.com/astro-reactive/astro-reactive/blob/main/CODE_OF_CONDUCT.md)
📝 Check the [discussion board](https://github.com/astro-reactive/astro-reactive/discussions) for announcements or post your messages and questions
💬 Hang-out with the team on our [Discord](https://discord.gg/kkvW7GYNAp) to share feedback, get support, or just have some laughs over memes 😅
🛠️ Create a [new issue](https://github.com/astro-reactive/astro-reactive/issues/new/choose) for bugs found or improvement ideas
<!--
## Play around examples:
<a href="https://stackblitz.com/edit/github-ze9ebb-tthuka?file=package.json,src%2Fpages%2Findex.astro">
<img
src="https://developer.stackblitz.com/img/open_in_stackblitz_small.svg"
alt="Play around in Stackblitz"
/>
</a>
<a href="https://codesandbox.io/s/astro-reactive-library-u72dgj?file=/src/pages/index.astro">
<img
src="https://img.shields.io/badge/Open%20in-CodeSandbox-040404?logo=codesandbox"
alt="CodeSandbox"
/>
</a>
-->

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Astro Reactive
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 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.

54
MONOREPO.md Normal file
View file

@ -0,0 +1,54 @@
# Monorepo Guide
This project is a monorepo configured with Turborepo + NPM workspace. Here are some common development scripts.
## Scripts
To clean and remove files, such as `node_modules`, `dist`, `.turbo` in every workspace.
```bash
npm run clean
```
Filtering workspaces. For more detail [https://turbo.build/repo/docs/core-concepts/monorepos/filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering).
```bash
# Append the `npm run` command with `-- --filter=<workspace>`
# with workspace name
npm run test -- --filter=validator
# Or equivalent
npm run test -- --filter=packages/validator
```
To run tests.
```bash
# Run all tests in every workspace.
npm run test
# Run test in selected workspace.
npm run test -- --filter=<workspace>
npm run test -- --filter=form
# Run test in watch mode. Can be filtered too.
npm run test:watch -- --filter=<workspace>
```
To lint workspaces.
```bash
# Lint all workspaces. Can be filtered.
npm run lint
# Lint and fix.
npm run lint:fix
```
To build workspaces.
```bash
# Build all workspaces. Can be filtered.
npm run build
```
To typecheck workspaces.
```bash
# Typecheck all workspaces. Can be filtered.
npm run check
```

168
README.md
View file

@ -1,81 +1,121 @@
# Astro Reactive Form 🔥
> [!WARNING]
>
> Please read: [an important announcement about the project](https://github.com/astro-reactive/astro-reactive/discussions/304)
>
> *As of now we still are in an exploratory phase and the library is not ready for production. We appreciate the interest. We look forward to your feedback and welcome all kinds of contribution. :)*
[![npm](https://img.shields.io/npm/v/astro-reactive-form)](https://www.npmjs.com/package/astro-reactive-form)
[![npm](https://img.shields.io/npm/l/astro-reactive-form)](https://www.npmjs.com/package/astro-reactive-form)
[![npm](https://img.shields.io/npm/dt/astro-reactive-form)](https://www.npmjs.com/package/astro-reactive-form)
[![github](https://img.shields.io/github/last-commit/ayoayco/astro-reactive-form)](https://github.com/ayoayco/astro-reactive-form)
<p align="center">
<img src="https://raw.githubusercontent.com/astro-reactive/astro-reactive/main/.github/assets/logo/min-banner.png" alt="Astro Reactive Library Logo">
<br />
<strong>Astro Reactive Library</strong>
<br />
Server-Side Rendered, Dynamic Components
<br />
Let your data build your UI with <a href="https://astro.build">Astro</a>
<br />
<br />
<a href="https://github.com/astro-reactive/astro-reactive/actions/workflows/build-and-test.yml">
<img src="https://github.com/astro-reactive/astro-reactive/actions/workflows/build-and-test.yml/badge.svg?branch=main" alt="Build & Test Result" />
</a>
<a href="https://github.com/astro-reactive/astro-reactive">
<img alt="Last Commit" src="https://img.shields.io/github/last-commit/astro-reactive/astro-reactive?logo=github" />
</a>
<a href="https://gitpod.io/#https://github.com/astro-reactive/astro-reactive.git">
<img
src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
alt="Contribute with Gitpod"
/>
</a>
The Reactive Form component for [Astro](https://astro.build) 🔥
<br />
<br />
<p>
_[All contributions are welcome.](https://github.com/ayoayco/astro-reactive-form/issues)_
| Package | Release notes | Description |
| ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| [form](https://github.com/astro-reactive/astro-reactive/blob/main/packages/form/README.md) | [![npm](https://img.shields.io/npm/v/@astro-reactive/form)](./packages/form/CHANGELOG.md) | a dynamic form which can be modified programmatically |
| [validator](https://github.com/astro-reactive/astro-reactive/blob/main/packages/validator/README.md) | [![npm](https://img.shields.io/npm/v/@astro-reactive/validator)](./packages/validator/CHANGELOG.md) | validators for editable fields |
| data-grid | 🛠 | a dynamic data grid of values |
| themes | 🛠 | easy-to-use, accessible, consistent cross-browser styles |
| viz | 🛠 | data visualization that emits and responds to events |
## Installation
# Running locally
We mainly use the `demo` app to see changes we make on the packages. Do the following to start hacking:
1. Fork the project then clone to your computer
```
npm i astro-reactive-form
git clone git@github.com:<your-user-name>/astro-reactive.git
```
## Usage
2. Go into the project directory
```astro
---
import Form, { FormControl, FormGroup } from 'astro-reactive-form';
// example of a form control
const radio: FormControl = {
name: 'is-good-looking',
type: 'radio',
label: 'Is Good Looking?',
value: 'checked',
labelPosition: 'right',
};
const form = new FormGroup([
// this is just an array of FormControl
{
name: 'first-name',
value: 'Ayo',
label: 'First Name',
},
{
name: 'last-name',
value: 'Ayco',
label: 'Last Name',
},
{
name: 'is-awesome',
type: 'checkbox',
label: 'Is Awesome?',
value: 'checked',
labelPosition: 'right',
},
radio, // the form control we declared earlier
]);
---
<Form formGroup={form} />
```
cd astro-reactive
```
### Result:
3. Install the node dependencies
![Screen Shot 2022-09-27 at 5 41 46 PM](https://user-images.githubusercontent.com/4262489/192572310-f83af2cc-53b9-4024-9ada-e64b34b66a15.png)
```
npm i
```
# Future Plans
4. Run the demo application
Currently this only supports very basic form creation, but the goal of the project is ambitious:
```
npm start
```
1. Themes - unstyled, light mode, dark mode, compact, large
1. FormGroup class
1. `get(controlName: string)` - returns the FormControl with matching name
1. `statusChanges` - observable that emits the form status when it changes
1. `valueChanges` - observable that emits the values of all controls when they change
1. FormControl class
1. `setValue(value)` - set the value of the control programmatically
1. `statusChanges` - observable that emits the control status when it changes
1. `valueChanges` - observable that emits the control value when it changes
1. `value` - property that reflects the control value
1. Validator library for common validation scenarios
5. Open the demo application on your browser. Browse to the address:
... and so much more
```
https://localhost:3000
```
_All contributions are welcome. Let's make the fastest web form component powered by Astro_
6. To run the tests:
```
npm test
```
## Other apps
We also maintain the docs website and the project landing page in this repository. Run the following to start the dev servers:
```
npm run docs
```
```
npm run landing-page
```
# Contributors
This project is only possible because of the support and contribution of our community ❤️
<a href="https://github.com/astro-reactive/astro-reactive/graphs/contributors">
<img src="https://contrib.rocks/image?repo=astro-reactive/astro-reactive" />
</a>
👉 _[Join our contributors!](https://github.com/astro-reactive/astro-reactive/blob/main/CONTRIBUTING.md)_
<!--
## Play around examples:
<a href="https://stackblitz.com/edit/github-ze9ebb-tthuka?file=package.json,src%2Fpages%2Findex.astro">
<img
src="https://developer.stackblitz.com/img/open_in_stackblitz_small.svg"
alt="Play around in Stackblitz"
/>
</a>
<a href="https://codesandbox.io/s/astro-reactive-library-u72dgj?file=/src/pages/index.astro">
<img
src="https://img.shields.io/badge/Open%20in-CodeSandbox-040404?logo=codesandbox"
alt="CodeSandbox"
/>
</a>
-->

2
apps/demo/.eslintignore Normal file
View file

@ -0,0 +1,2 @@
dist
node_modules

5
apps/demo/.eslintrc.cjs Normal file
View file

@ -0,0 +1,5 @@
/** @type {import("@types/eslint").Linter.Config} */
module.exports = {
root: true,
extends: ['@astro-reactive/eslint-config-custom'],
};

25
apps/demo/.prettierrc.cjs Normal file
View file

@ -0,0 +1,25 @@
/** @type {import("@types/prettier").Options} */
module.exports = {
printWidth: 100,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
useTabs: true,
plugins: ['prettier-plugin-astro'],
overrides: [
{
files: '*.astro',
options: {
parser: 'astro',
astroAllowShorthand: false,
},
},
{
files: ['.*', '*.json', '*.md', '*.toml', '*.yml'],
options: {
useTabs: false,
},
},
],
};

36
apps/demo/CHANGELOG.md Normal file
View file

@ -0,0 +1,36 @@
# @astro-reactive/demo
## 0.1.1
### Patch Changes
- a1cc4b0: Update homepage to https://astro-reactive.js.org
- Updated dependencies [a1cc4b0]
- @astro-reactive/validator@0.4.1
- @astro-reactive/form@0.9.1
## 0.1.0
### Minor Changes
- 4d2a577: Support Astro 3
### Patch Changes
- Updated dependencies [4d2a577]
- @astro-reactive/validator@0.4.0
- @astro-reactive/form@0.9.0
## 0.0.2
### Patch Changes
- fb11b73: Initial `create-astro-reactive` package
Update packages' meta information (author, homepage)
Upadte LICENSE owner info to `astro-reactive` organization
- 30de516: Change the default of `validateOnLoad` property to true, making server-side rendering validation the default behavior for the `Form` component.
Update the demo `index.astro` page by removing the `validateOnLoad` property/directive on the example which should still result to server-side rendered validation results.
- Updated dependencies [fb11b73]
- Updated dependencies [30de516]
- @astro-reactive/validator@0.3.3
- @astro-reactive/form@0.8.0

7
apps/demo/README.md Normal file
View file

@ -0,0 +1,7 @@
![Astro Reactive Library](https://user-images.githubusercontent.com/4262489/193419437-6e437743-47bf-482b-8f7e-de3c7f5285f8.png)
# Demo App for Astro Reactive Library
Start the dev server by running: `npm start`
👉 _[Join our contributors!](https://github.com/astro-reactive/astro-reactive/blob/main/CONTRIBUTING.md)_

View file

@ -0,0 +1,4 @@
import { defineConfig } from 'astro/config';
// https://astro.build/config
export default defineConfig({});

46
apps/demo/package.json Normal file
View file

@ -0,0 +1,46 @@
{
"name": "@astro-reactive/demo",
"description": "Demo App for Astro Reactive Library",
"version": "0.1.1",
"author": "astro-reactive",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"check": "astro check",
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"format": "prettier -w .",
"lint": "eslint . --ext .ts,.js",
"lint:fix": "eslint --fix . --ext .ts,.js",
"clean": "rimraf node_modules .turbo dist"
},
"dependencies": {
"@astro-reactive/form": "*",
"@astro-reactive/validator": "*",
"@astrojs/check": "^0.2.0",
"astro": "^4.0.3",
"typescript": "^5.2.2"
},
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/astro-reactive/astro-reactive.git"
},
"license": "ISC",
"bugs": {
"url": "https://github.com/astro-reactive/astro-reactive/issues"
},
"homepage": "https://astro-reactive.js.org",
"devDependencies": {
"@astro-reactive/eslint-config-custom": "*",
"@astro-reactive/tsconfig": "*",
"@types/eslint": "^8.44.3",
"@types/prettier": "^3.0.0",
"eslint": "^8.50.0",
"prettier": "^3.0.3",
"prettier-plugin-astro": "^0.12.0",
"rimraf": "^5.0.1"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 36 36">
<path fill="#000" d="M22.25 4h-8.5a1 1 0 0 0-.96.73l-5.54 19.4a.5.5 0 0 0 .62.62l5.05-1.44a2 2 0 0 0 1.38-1.4l3.22-11.66a.5.5 0 0 1 .96 0l3.22 11.67a2 2 0 0 0 1.38 1.39l5.05 1.44a.5.5 0 0 0 .62-.62l-5.54-19.4a1 1 0 0 0-.96-.73Z"/>
<path fill="url(#gradient)" d="M18 28a7.63 7.63 0 0 1-5-2c-1.4 2.1-.35 4.35.6 5.55.14.17.41.07.47-.15.44-1.8 2.93-1.22 2.93.6 0 2.28.87 3.4 1.72 3.81.34.16.59-.2.49-.56-.31-1.05-.29-2.46 1.29-3.25 3-1.5 3.17-4.83 2.5-6-.67.67-2.6 2-5 2Z"/>
<defs>
<linearGradient id="gradient" x1="16" x2="16" y1="32" y2="24" gradientUnits="userSpaceOnUse">
<stop stop-color="#000"/>
<stop offset="1" stop-color="#000" stop-opacity="0"/>
</linearGradient>
</defs>
<style>
@media (prefers-color-scheme:dark){:root{filter:invert(100%)}}
</style>
</svg>

After

Width:  |  Height:  |  Size: 873 B

View file

@ -0,0 +1,30 @@
---
import Nav from './Nav.astro';
export interface Props {
title: string;
theme?: 'dark' | 'light';
}
const { theme = 'light', title } = Astro.props;
---
<html lang="en" class={theme}>
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<title>{title} | Astro Reactive Demo</title>
</head>
<body class={theme}>
<Nav />
<h1>{title}</h1>
<slot />
</body>
<style>
html.dark,
body.dark {
color-scheme: dark;
}
</style>
</html>

View file

@ -0,0 +1,25 @@
---
const links = [
{ label: 'Home', url: '/' },
{ label: 'Pizza Delivery', url: '/pizza-delivery' },
{ label: 'Job Application', url: '/job-application' },
{ label: 'Docs Examples', url: '/examples' },
{ label: 'Experimental', url: '/experimental' },
];
---
<nav>
{links.map((link) => <a href={link.url}>{link.label}</a>)}
</nav>
<style>
nav a::after {
content: ' | ';
}
nav a {
text-decoration: none;
}
nav a:hover {
text-decoration: underline;
}
</style>

1
apps/demo/src/env.d.ts vendored Normal file
View file

@ -0,0 +1 @@
/// <reference types="astro/client" />

View file

@ -0,0 +1,85 @@
---
import type { Submit } from '@astro-reactive/common';
import Form, { FormGroup } from '@astro-reactive/form';
import Layout from '../../components/Layout.astro';
const simpleForm = new FormGroup([
{
name: 'username',
label: 'Username',
value: 'awesome_dev',
},
{
name: 'comment',
label: 'Feedback',
type: 'textarea',
value: 'Nice!',
},
{
name: 'size',
label: 'Size',
type: 'dropdown',
options: ['S', 'M', 'L', 'XL', 'XXL'],
placeholder: '-- Please choose an option --',
},
]);
const nameForm = new FormGroup(
[
{
name: 'firstName',
label: 'First Name',
value: 'John',
},
{
name: 'lastName',
label: 'Last Name',
value: 'Doe',
},
],
'Name'
);
const skills = new FormGroup(
[
{
name: 'JavaScript',
type: 'checkbox',
label: 'JavaScript',
},
{
name: 'TypeScript',
type: 'checkbox',
label: 'TypeScript',
},
{
name: 'React',
type: 'checkbox',
label: 'React',
},
{
name: 'Vue',
type: 'checkbox',
label: 'Vue',
},
],
'Skills'
);
/**
* comment
*/
const submitControl: Submit = {
name: 'submit',
type: 'submit',
};
---
<Layout title="Form API examples">
<h2>Simple Form</h2>
<Form formGroups={simpleForm} submitControl={submitControl} />
<h2>Form with nested form groups</h2>
<Form formGroups={[nameForm, skills]} />
</Layout>

View file

@ -0,0 +1,9 @@
---
import Layout from '../../components/Layout.astro';
---
<Layout title="Docs Examples">
<ul>
<li><a href="./examples/form-component">Form Component</a></li>
</ul>
</Layout>

View file

@ -0,0 +1,23 @@
---
import Layout from '../../components/Layout.astro';
const Counter = {
count: 0,
increment() {
this.count++;
},
decrement() {
this.count--;
},
};
---
<Layout title="Hyperdrive Experiment">
<!-- PROBLEM STATEMENT
This is the problem that `hyperdrive` is trying to solve.
After this is rendered in the server, the Counter object is not serialized.
When the HTML reaches the browser, it has no idea what Counter is.
-->
<button onclick="Counter.increment()">
{Counter.count}
</button>
</Layout>

View file

@ -0,0 +1,9 @@
---
import Layout from '../../components/Layout.astro';
---
<Layout title="Experimental Demos">
<ul>
<li><a href="./experimental/hyperdrive">Hyperdrive</a></li>
</ul>
</Layout>

View file

@ -0,0 +1,114 @@
---
import Form, { FormGroup, FormControl } from '@astro-reactive/form';
import type { ControlConfig } from '@astro-reactive/form';
import type { Submit } from '@astro-reactive/common';
import { Validators } from '@astro-reactive/validator';
import Layout from '../components/Layout.astro';
const form = new FormGroup([
{
name: 'username',
label: 'Username',
validators: [
{
validator: Validators.required,
category: 'info',
},
],
},
{
name: 'email',
label: 'Email',
validators: [
{ validator: Validators.required },
{ validator: Validators.email, category: 'warn' },
],
},
{
name: 'password',
label: 'Password',
type: 'password',
validators: [Validators.required, Validators.minLength(8)],
},
{
name: 'rating',
label: 'Rating',
type: 'radio',
options: ['1', '2', '3', '4', '5'],
},
{
name: 'agreement',
label: 'Agreement',
type: 'radio',
value: 'yes',
options: [
{ label: 'Agree', value: 'yes' },
{ label: 'Disagree', value: 'no' },
],
},
{
name: 'size',
label: 'Size',
type: 'dropdown',
options: ['S', 'M', 'L', 'XL', 'XXL'],
placeholder: '-- Please choose an option --',
},
{
name: 'comment',
label: 'Feedback',
type: 'textarea',
value: 'Nice!',
},
{
name: 'terms',
label: 'Terms and Conditions',
type: 'checkbox',
validators: [Validators.requiredChecked],
},
]);
form.name = 'Simple Form';
const config: ControlConfig = {
type: 'checkbox',
name: 'isAwesome',
label: 'is Awesome?',
};
// insert a control
form.controls.push(new FormControl(config));
// set the value of multiple controls
form.setValue({
username: 'RAMOOOON',
isAwesome: 'checked',
});
// set the value of a specific control
const ratingControl = form.get('rating');
ratingControl?.setValue('5');
// setting an invalid value will cause errors as server-rendered
form.get('email')?.setValue('invalid-email');
// switch between light and dark mode
const title = 'Form Demo';
const theme = 'dark';
const submit: Submit = {
name: 'submit',
type: 'submit',
value: "Let's go!",
};
---
<Layout title={title} theme={theme}>
<Form
showValidationHints
formGroups={form}
theme={theme}
submitControl={submit}
action="https://localhost"
method="post"
/>
</Layout>

View file

@ -0,0 +1,112 @@
---
import Form, { FormControl, FormGroup } from '@astro-reactive/form';
import type { ControlConfig } from '@astro-reactive/form';
import { Validators } from '@astro-reactive/validator';
import type { Submit } from '@astro-reactive/common';
import Layout from '../components/Layout.astro';
const infoForm = new FormGroup([
{
name: 'firstName',
label: 'First Name',
placeholder: 'ex. John',
validators: [Validators.required],
},
{
name: 'lastName',
label: 'Last Name',
placeholder: 'ex. Doe',
validators: [Validators.required],
},
{
name: 'email',
label: 'Email',
placeholder: 'ex. john.doe@email.com',
validators: [Validators.email, Validators.required],
},
{
name: 'whyHire',
label: 'Why should we hire you?',
},
{
name: 'country',
label: 'Country of Residence',
type: 'dropdown',
options: ['U.S.A', 'Canada', 'Mexico', 'Cuba', 'Guatamala', 'Greenland', 'Haiti'],
placeholder: 'Choose Your Country',
},
{
name: 'eligible',
label: 'Are you eligible to work?',
type: 'radio',
options: [
{ label: 'Yes', value: 'yes' },
{ label: 'No', value: 'no' },
],
},
]);
const skillsForm = new FormGroup([
{
name: 'js',
label: 'Javascript',
type: 'checkbox',
},
{
name: 'java',
label: 'Java',
type: 'checkbox',
},
{
name: 'astro',
label: 'Astro',
type: 'checkbox',
},
{
name: 'cpp',
label: 'C/C++',
type: 'checkbox',
},
{
name: 'sql',
label: 'SQL',
type: 'checkbox',
},
{
name: 'devops',
label: 'DevOps',
type: 'checkbox',
},
]);
const resume: ControlConfig = {
name: 'resume',
label: 'Upload Resume',
type: 'file',
};
const submit: Submit = {
name: 'submit',
type: 'submit',
value: "Let's go!",
};
const values = {
firstName: 'James',
lastName: 'Bond',
email: 'james.bond@gmail.com',
country: 'U.S.A',
eligible: 'yes',
};
infoForm.setValue(values);
infoForm.name = 'Application Form';
skillsForm.name = 'Skills';
skillsForm.controls.push(new FormControl(resume));
---
<Layout title="Programmer Job Application">
<Form showValidationHints formGroups={[infoForm, skillsForm]} submitControl={submit} />
</Layout>

View file

@ -0,0 +1,96 @@
---
import Form, { FormGroup } from '@astro-reactive/form';
import { Validators } from '@astro-reactive/validator';
import Layout from '../components/Layout.astro';
const baseForm = new FormGroup([
{
name: 'crust',
label: 'Crust',
type: 'radio',
options: [{ label: 'Garlic', value: 'garlic' }],
},
{
name: 'size',
label: 'Size',
type: 'radio',
options: ['Small', 'Medium', 'Large'],
},
{
name: 'sauce',
label: 'Sauce',
type: 'radio',
options: ['Tomato', 'Barbeque'],
},
]);
const toppingsForm = new FormGroup([
{
name: 'mushrooms',
label: 'Mushrooms',
type: 'checkbox',
},
{
name: 'extraCheese',
label: 'Extra Cheese',
type: 'checkbox',
},
{
name: 'onions',
label: 'Onions',
type: 'checkbox',
},
{
name: 'peppers',
label: 'Peppers',
type: 'checkbox',
},
{
name: 'pepperoni',
label: 'Pepperoni',
type: 'checkbox',
},
{
name: 'sausage',
label: 'Sausage',
type: 'checkbox',
},
{
name: 'chicken',
label: 'Chicken',
type: 'checkbox',
},
{
name: 'pineapple',
label: 'Pineapple',
type: 'checkbox',
},
]);
const infoForm = new FormGroup([
{
name: 'name',
label: 'Name',
validators: [Validators.required],
},
{
name: 'address',
label: 'Delivery Address',
validators: [Validators.required],
},
{
name: 'contact',
label: 'Contact Number',
validators: [Validators.required],
},
]);
baseForm.name = 'Base';
toppingsForm.name = 'Toppings';
infoForm.name = 'Customer Info';
infoForm.get('contact')?.setValidators([Validators.minLength(9)]);
---
<Layout title="Pizza Form Demo">
<Form showValidationHints formGroups={[baseForm, toppingsForm, infoForm]} />
</Layout>

6
apps/demo/tsconfig.json Normal file
View file

@ -0,0 +1,6 @@
{
"extends": "@astro-reactive/tsconfig/base.json",
"compilerOptions": {
"skipLibCheck": true
}
}

2
apps/docs/.eslintignore Normal file
View file

@ -0,0 +1,2 @@
dist
node_modules

5
apps/docs/.eslintrc.cjs Normal file
View file

@ -0,0 +1,5 @@
/** @type {import("@types/eslint").Linter.Config} */
module.exports = {
root: true,
extends: ['@astro-reactive/eslint-config-custom'],
};

19
apps/docs/.gitignore vendored Normal file
View file

@ -0,0 +1,19 @@
# build output
dist/
# dependencies
node_modules/
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# environment variables
.env
.env.production
# macOS-specific files
.DS_Store

24
apps/docs/.prettierrc.cjs Normal file
View file

@ -0,0 +1,24 @@
/** @type {import("@types/prettier").Options} */
module.exports = {
printWidth: 100,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: "es5",
useTabs: true,
plugins: ['prettier-plugin-astro'],
overrides: [
{
files: "*.astro",
options: {
parser: "astro",
},
},
{
files: [".*", "*.json", "*.md", "*.toml", "*.yml"],
options: {
useTabs: false,
},
},
],
};

27
apps/docs/CHANGELOG.md Normal file
View file

@ -0,0 +1,27 @@
# @astro-reactive/docs
## 0.1.1
### Patch Changes
- a1cc4b0: Update homepage to https://astro-reactive.js.org
## 0.1.0
### Minor Changes
- 4d2a577: Support Astro 3
## 0.0.3
### Patch Changes
- 334a4c5: - Update documentation links to release notes
## 0.0.2
### Patch Changes
- fb11b73: Initial `create-astro-reactive` package
Update packages' meta information (author, homepage)
Upadte LICENSE owner info to `astro-reactive` organization

7
apps/docs/README.md Normal file
View file

@ -0,0 +1,7 @@
![Astro Reactive Library](https://user-images.githubusercontent.com/4262489/193419437-6e437743-47bf-482b-8f7e-de3c7f5285f8.png)
# Documentation Website
Start the dev server by running: `npm run docs`
👉 _[Join our contributors!](https://github.com/astro-reactive/astro-reactive/blob/main/CONTRIBUTING.md)_

View file

@ -0,0 +1,14 @@
import { defineConfig } from 'astro/config';
import preact from '@astrojs/preact';
import react from '@astrojs/react';
// https://astro.build/config
export default defineConfig({
integrations: [
// Enable Preact to support Preact JSX components.
preact(),
// Enable React for the Algolia search component.
react(),
],
site: `https://docs.astro-reactive.js.org`,
});

55
apps/docs/package.json Normal file
View file

@ -0,0 +1,55 @@
{
"name": "@astro-reactive/docs",
"type": "module",
"version": "0.1.1",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"docs": "astro dev",
"check": "astro check",
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"format": "prettier -w .",
"lint": "eslint . --ext .ts,.js",
"lint:fix": "eslint --fix . --ext .ts,.js",
"clean": "rimraf node_modules .turbo dist"
},
"dependencies": {
"@algolia/client-search": "^4.20.0",
"@astrojs/preact": "^3.0.0",
"@astrojs/react": "^3.0.2",
"@docsearch/css": "^3.5.2",
"@docsearch/react": "^3.5.2",
"@types/node": "^20.6.5",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"astro": "^4.0.3",
"preact": "^10.17.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"description": "```bash npm create astro@latest -- --template docs ```",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/astro-reactive/astro-reactive.git"
},
"author": "astro-reactive",
"license": "ISC",
"bugs": {
"url": "https://github.com/astro-reactive/astro-reactive/issues"
},
"homepage": "https://astro-reactive.js.org",
"devDependencies": {
"@astro-reactive/eslint-config-custom": "*",
"@astro-reactive/tsconfig": "*",
"@types/eslint": "^8.44.3",
"@types/prettier": "^2.7.3",
"eslint": "^8.50.0",
"prettier": "^3.0.3",
"prettier-plugin-astro": "^0.12.0",
"rimraf": "^3.0.2"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 36 36">
<path fill="#000" d="M22.25 4h-8.5a1 1 0 0 0-.96.73l-5.54 19.4a.5.5 0 0 0 .62.62l5.05-1.44a2 2 0 0 0 1.38-1.4l3.22-11.66a.5.5 0 0 1 .96 0l3.22 11.67a2 2 0 0 0 1.38 1.39l5.05 1.44a.5.5 0 0 0 .62-.62l-5.54-19.4a1 1 0 0 0-.96-.73Z"/>
<path fill="url(#gradient)" d="M18 28a7.63 7.63 0 0 1-5-2c-1.4 2.1-.35 4.35.6 5.55.14.17.41.07.47-.15.44-1.8 2.93-1.22 2.93.6 0 2.28.87 3.4 1.72 3.81.34.16.59-.2.49-.56-.31-1.05-.29-2.46 1.29-3.25 3-1.5 3.17-4.83 2.5-6-.67.67-2.6 2-5 2Z"/>
<defs>
<linearGradient id="gradient" x1="16" x2="16" y1="32" y2="24" gradientUnits="userSpaceOnUse">
<stop stop-color="#000"/>
<stop offset="1" stop-color="#000" stop-opacity="0"/>
</linearGradient>
</defs>
<style>
@media (prefers-color-scheme:dark){:root{filter:invert(100%)}}
</style>
</svg>

After

Width:  |  Height:  |  Size: 873 B

View file

@ -0,0 +1,4 @@
// eslint-disable-next-line no-undef
Array.from(document.getElementsByTagName('pre')).forEach((element) => {
element.setAttribute('tabindex', '0');
});

View file

@ -0,0 +1,171 @@
---
// fetch all commits for just this page's path
type Props = {
path: string;
};
const { path } = Astro.props as Props;
const resolvedPath = `apps/docs/${path}`;
const url = `https://api.github.com/repos/astro-reactive/astro-reactive/commits?path=${resolvedPath}`;
const commitsURL = `https://github.com/astro-reactive/astro-reactive/commits/main/${resolvedPath}`;
type Commit = {
author: {
id: string;
login: string;
};
};
async function getCommits(url: string) {
try {
const token = import.meta.env.SNOWPACK_PUBLIC_GITHUB_TOKEN ?? 'hello';
if (!token) {
throw new Error(
'Cannot find "SNOWPACK_PUBLIC_GITHUB_TOKEN" used for escaping rate-limiting.'
);
}
const auth = `Basic ${Buffer.from(token, 'binary').toString('base64')}`;
const res = await fetch(url, {
method: 'GET',
headers: {
Authorization: auth,
'User-Agent': 'astro-docs/1.0',
},
});
const data = await res.json();
if (!res.ok) {
throw new Error(
`Request to fetch commits failed. Reason: ${res.statusText}
Message: ${data.message}`
);
}
return data as Commit[];
} catch (e) {
console.warn(`[error] /src/components/AvatarList.astro
${(e as any)?.message ?? e}`);
return [] as Commit[];
}
}
function removeDups(arr: Commit[]) {
const map = new Map<string, Commit['author']>();
for (let item of arr) {
const author = item.author;
// Deduplicate based on author.id
map.set(author.id, { login: author.login, id: author.id });
}
return [...map.values()];
}
const data = await getCommits(url);
const unique = removeDups(data);
const recentContributors = unique.slice(0, 3); // only show avatars for the 3 most recent contributors
const additionalContributors = unique.length - recentContributors.length; // list the rest of them as # of extra contributors
---
<!-- Thanks to @5t3ph for https://smolcss.dev/#smol-avatar-list! -->
<div class="contributors">
<ul class="avatar-list" style={`--avatar-count: ${recentContributors.length}`}>
{
recentContributors.map((item) => (
<li>
<a href={`https://github.com/${item.login}`}>
<img
alt={`Contributor ${item.login}`}
title={`Contributor ${item.login}`}
width="64"
height="64"
src={`https://avatars.githubusercontent.com/u/${item.id}`}
/>
</a>
</li>
))
}
</ul>
{
additionalContributors > 0 && (
<span>
<a href={commitsURL}>{`and ${additionalContributors} additional contributor${
additionalContributors > 1 ? 's' : ''
}.`}</a>
</span>
)
}
{unique.length === 0 && <a href={commitsURL}>Contributors</a>}
</div>
<style>
.avatar-list {
--avatar-size: 2.5rem;
--avatar-count: 3;
display: grid;
list-style: none;
/* Default to displaying most of the avatar to
enable easier access on touch devices, ensuring
the WCAG touch target size is met or exceeded */
grid-template-columns: repeat(var(--avatar-count), max(44px, calc(var(--avatar-size) / 1.15)));
/* `padding` matches added visual dimensions of
the `box-shadow` to help create a more accurate
computed component size */
padding: 0.08em;
font-size: var(--avatar-size);
}
@media (any-hover: hover) and (any-pointer: fine) {
.avatar-list {
/* We create 1 extra cell to enable the computed
width to match the final visual width */
grid-template-columns: repeat(calc(var(--avatar-count) + 1), calc(var(--avatar-size) / 1.75));
}
}
.avatar-list li {
width: var(--avatar-size);
height: var(--avatar-size);
}
.avatar-list li:hover ~ li a,
.avatar-list li:focus-within ~ li a {
transform: translateX(33%);
}
.avatar-list img,
.avatar-list a {
display: block;
border-radius: 50%;
}
.avatar-list a {
transition: transform 180ms ease-in-out;
}
.avatar-list img {
width: 100%;
height: 100%;
object-fit: cover;
background-color: #fff;
box-shadow: 0 0 0 0.05em #fff, 0 0 0 0.08em rgba(0, 0, 0, 0.15);
}
.avatar-list a:focus {
outline: 2px solid transparent;
/* Double-layer trick to work for dark and light backgrounds */
box-shadow: 0 0 0 0.08em var(--theme-accent), 0 0 0 0.12em white;
}
.contributors {
display: flex;
align-items: center;
}
.contributors > * + * {
margin-left: 0.75rem;
}
</style>

View file

@ -0,0 +1,19 @@
---
import AvatarList from './AvatarList.astro';
type Props = {
path: string;
};
const { path } = Astro.props as Props;
---
<footer>
<AvatarList path={path} />
</footer>
<style>
footer {
margin-top: auto;
padding: 2rem;
border-top: 3px solid var(--theme-divider);
}
</style>

View file

@ -0,0 +1,44 @@
---
import '../styles/theme.css';
import '../styles/index.css';
---
<!-- Global Metadata -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="sitemap" href="/sitemap.xml" />
<!-- Preload Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital@0;1&display=swap"
rel="stylesheet"
/>
<!-- Scrollable a11y code helper -->
<script src="/make-scrollable-code-focusable.js" is:inline></script>
<!-- This is intentionally inlined to avoid FOUC -->
<script is:inline>
const root = document.documentElement;
const theme = localStorage.getItem('theme');
if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
root.classList.add('theme-dark');
} else {
root.classList.remove('theme-dark');
}
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<!-- <script async src="https://www.googletagmanager.com/gtag/js?id=G-TEL60V1WM9" is:inline></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-TEL60V1WM9');
</script> -->

View file

@ -0,0 +1,47 @@
---
import { SITE, OPEN_GRAPH } from '../config';
import type { Frontmatter } from '../config';
export interface Props {
frontmatter: Frontmatter;
canonicalUrl: URL;
}
const { frontmatter, canonicalUrl } = Astro.props as Props;
const formattedContentTitle = `${frontmatter.title} 🚀 ${SITE.title}`;
const imageSrc = frontmatter.image?.src ?? OPEN_GRAPH.image.src;
const canonicalImageSrc = new URL(imageSrc, Astro.site);
const imageAlt = frontmatter.image?.alt ?? OPEN_GRAPH.image.alt;
---
<!-- Page Metadata -->
<link rel="canonical" href={canonicalUrl} />
<!-- OpenGraph Tags -->
<meta property="og:title" content={formattedContentTitle} />
<meta property="og:type" content="article" />
<meta property="og:url" content={canonicalUrl} />
<meta property="og:locale" content={frontmatter.ogLocale ?? SITE.defaultLanguage} />
<meta property="og:image" content={canonicalImageSrc} />
<meta property="og:image:alt" content={imageAlt} />
<meta
name="description"
property="og:description"
content={frontmatter.description ?? SITE.description}
/>
<meta property="og:site_name" content={SITE.title} />
<!-- Twitter Tags -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content={OPEN_GRAPH.twitter} />
<meta name="twitter:title" content={formattedContentTitle} />
<meta name="twitter:description" content={frontmatter.description ?? SITE.description} />
<meta name="twitter:image" content={canonicalImageSrc} />
<meta name="twitter:image:alt" content={imageAlt} />
<!--
TODO: Add json+ld data, maybe https://schema.org/APIReference makes sense?
Docs: https://developers.google.com/search/docs/advanced/structured-data/intro-structured-data
https://www.npmjs.com/package/schema-dts seems like a great resource for implementing this.
Even better, there's a React component that integrates with `schema-dts`: https://github.com/google/react-schemaorg
-->

View file

@ -0,0 +1,152 @@
---
import { getLanguageFromURL, KNOWN_LANGUAGE_CODES } from '../../languages';
import ThemeToggleButton from './ThemeToggleButton';
import * as CONFIG from '../../config';
// import AstroLogo from "./AstroLogo.astro";
import SkipToContent from './SkipToContent.astro';
import SidebarToggle from './SidebarToggle';
import LanguageSelect from './LanguageSelect';
// import Search from "./Search";
type Props = {
currentPage: string;
};
const { currentPage } = Astro.props as Props;
const lang = getLanguageFromURL(currentPage);
---
<header>
<SkipToContent />
<nav class="nav-wrapper" title="Top Navigation">
<div class="menu-toggle">
<SidebarToggle client:idle />
</div>
<div class="logo flex">
<a href="/">
<h1>{CONFIG.SITE.title ?? 'Documentation'}</h1>
</a>
</div>
<div style="flex-grow: 1;"></div>
{KNOWN_LANGUAGE_CODES.length > 1 && <LanguageSelect lang={lang} client:idle />}
<!-- TODO: enable search -->
<!-- <div class="search-item">
<Search client:idle />
</div> -->
<ThemeToggleButton client:visible />
</nav>
</header>
<style>
header {
z-index: 11;
height: var(--theme-navbar-height);
width: 100%;
background-color: var(--theme-navbar-bg);
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
position: sticky;
top: 0;
}
.logo {
flex: 1;
display: flex;
overflow: hidden;
width: 30px;
font-size: 2rem;
flex-shrink: 0;
font-weight: 600;
line-height: 1;
color: hsla(var(--color-base-white), 100%, 1);
gap: 0.25em;
z-index: -1;
}
.logo a {
display: flex;
padding: 0.5em 0.25em;
margin: -0.5em -0.25em;
text-decoration: none;
font-weight: bold;
}
.logo a {
transition: color 100ms ease-out;
color: var(--theme-text);
}
.logo a:hover,
.logo a:focus {
color: var(--theme-text-accent);
}
.logo h1 {
display: none;
font: inherit;
color: inherit;
margin: 0;
}
.nav-wrapper {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 1em;
width: 100%;
max-width: 82em;
padding: 0 2rem;
}
@media (min-width: 50em) {
header {
position: static;
padding: 2rem 0rem;
}
.logo {
width: auto;
margin: 0;
z-index: 0;
}
.logo h1 {
display: initial;
}
.menu-toggle {
display: none;
}
}
/** Style Algolia */
:root {
--docsearch-primary-color: var(--theme-accent);
--docsearch-logo-color: var(--theme-text);
}
.search-item {
display: none;
position: relative;
z-index: 10;
flex-grow: 1;
padding-right: 0.7rem;
display: flex;
max-width: 200px;
}
@media (min-width: 50em) {
.search-item {
max-width: 400px;
}
}
</style>
<style is:global>
.search-item > * {
flex-grow: 1;
}
</style>

View file

@ -0,0 +1,47 @@
.language-select {
flex-grow: 1;
width: 48px;
box-sizing: border-box;
margin: 0;
padding: 0.33em 0.5em;
overflow: visible;
font-weight: 500;
font-size: 1rem;
font-family: inherit;
line-height: inherit;
background-color: var(--theme-bg);
border-color: var(--theme-text-lighter);
color: var(--theme-text-light);
border-style: solid;
border-width: 1px;
border-radius: 0.25rem;
outline: 0;
cursor: pointer;
transition-timing-function: ease-out;
transition-duration: 0.2s;
transition-property: border-color, color;
-webkit-font-smoothing: antialiased;
padding-left: 30px;
padding-right: 1rem;
}
.language-select-wrapper .language-select:hover,
.language-select-wrapper .language-select:focus {
color: var(--theme-text);
border-color: var(--theme-text-light);
}
.language-select-wrapper {
color: var(--theme-text-light);
position: relative;
}
.language-select-wrapper > svg {
position: absolute;
top: 7px;
left: 10px;
pointer-events: none;
}
@media (min-width: 50em) {
.language-select {
width: 100%;
}
}

View file

@ -0,0 +1,49 @@
/** @jsxImportSource react */
import type { FunctionComponent } from 'react';
import './LanguageSelect.css';
import { KNOWN_LANGUAGES, langPathRegex } from '../../languages';
const LanguageSelect: FunctionComponent<{ lang: string }> = ({ lang }) => {
return (
<div className="language-select-wrapper">
<svg
aria-hidden="true"
focusable="false"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 88.6 77.3"
height="1.2em"
width="1.2em"
>
<path
fill="currentColor"
d="M61,24.6h7.9l18.7,51.6h-7.7l-5.4-15.5H54.3l-5.6,15.5h-7.2L61,24.6z M72.6,55l-8-22.8L56.3,55H72.6z"
/>
<path
fill="currentColor"
d="M53.6,60.6c-10-4-16-9-22-14c0,0,1.3,1.3,0,0c-6,5-20,13-20,13l-4-6c8-5,10-6,19-13c-2.1-1.9-12-13-13-19h8 c4,9,10,14,10,14c10-8,10-19,10-19h8c0,0-1,13-12,24l0,0c5,5,10,9,19,13L53.6,60.6z M1.6,16.6h56v-8h-23v-7h-9v7h-24V16.6z"
/>
</svg>
<select
className="language-select"
value={lang}
onChange={(e) => {
const newLang = e.target.value;
let actualDest = window.location.pathname.replace(langPathRegex, '/');
if (actualDest == '/') actualDest = `/introduction`;
window.location.pathname = '/' + newLang + actualDest;
}}
>
{Object.entries(KNOWN_LANGUAGES).map(([key, value]) => {
return (
<option value={value} key={value}>
<span>{key}</span>
</option>
);
})}
</select>
</div>
);
};
export default LanguageSelect;

View file

@ -0,0 +1,76 @@
/** Style Algolia */
:root {
--docsearch-primary-color: var(--theme-accent);
--docsearch-logo-color: var(--theme-text);
}
.search-input {
flex-grow: 1;
box-sizing: border-box;
width: 100%;
margin: 0;
padding: 0.33em 0.5em;
overflow: visible;
font-weight: 500;
font-size: 1rem;
font-family: inherit;
line-height: inherit;
background-color: var(--theme-divider);
border-color: var(--theme-divider);
color: var(--theme-text-light);
border-style: solid;
border-width: 1px;
border-radius: 0.25rem;
outline: 0;
cursor: pointer;
transition-timing-function: ease-out;
transition-duration: 0.2s;
transition-property: border-color, color;
-webkit-font-smoothing: antialiased;
}
.search-input:hover,
.search-input:focus {
color: var(--theme-text);
border-color: var(--theme-text-light);
}
.search-input:hover::placeholder,
.search-input:focus::placeholder {
color: var(--theme-text-light);
}
.search-input::placeholder {
color: var(--theme-text-light);
}
.search-hint {
position: absolute;
top: 7px;
right: 19px;
padding: 3px 5px;
display: none;
display: none;
align-items: center;
justify-content: center;
letter-spacing: 0.125em;
font-size: 13px;
font-family: var(--font-mono);
pointer-events: none;
border-color: var(--theme-text-lighter);
color: var(--theme-text-light);
border-style: solid;
border-width: 1px;
border-radius: 0.25rem;
line-height: 14px;
}
@media (min-width: 50em) {
.search-hint {
display: flex;
}
}
/* ------------------------------------------------------------ *\
DocSearch (Algolia)
\* ------------------------------------------------------------ */
.DocSearch-Modal .DocSearch-Hit a {
box-shadow: none;
border: 1px solid var(--theme-accent);
}

View file

@ -0,0 +1,97 @@
/** @jsxImportSource react */
import { useState, useCallback, useRef } from 'react';
import { ALGOLIA } from '../../config';
import '@docsearch/css';
import './Search.css';
import { createPortal } from 'react-dom';
import * as docSearchReact from '@docsearch/react';
/** FIXME: This is still kinda nasty, but DocSearch is not ESM ready. */
const DocSearchModal =
docSearchReact.DocSearchModal || (docSearchReact as any).default.DocSearchModal;
const useDocSearchKeyboardEvents =
docSearchReact.useDocSearchKeyboardEvents ||
(docSearchReact as any).default.useDocSearchKeyboardEvents;
export default function Search() {
const [isOpen, setIsOpen] = useState(false);
const searchButtonRef = useRef<HTMLButtonElement>(null);
const [initialQuery, setInitialQuery] = useState('');
const onOpen = useCallback(() => {
setIsOpen(true);
}, [setIsOpen]);
const onClose = useCallback(() => {
setIsOpen(false);
}, [setIsOpen]);
const onInput = useCallback(
(e: KeyboardEvent) => {
setIsOpen(true);
setInitialQuery(e.key);
},
[setIsOpen, setInitialQuery]
);
useDocSearchKeyboardEvents({
isOpen,
onOpen,
onClose,
onInput,
searchButtonRef,
});
return (
<>
<button type="button" ref={searchButtonRef} onClick={onOpen} className="search-input">
<svg width="24" height="24" fill="none">
<path
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
<span>Search</span>
<span className="search-hint">
<span className="sr-only">Press </span>
<kbd>/</kbd>
<span className="sr-only"> to search</span>
</span>
</button>
{isOpen &&
createPortal(
<DocSearchModal
initialQuery={initialQuery}
initialScrollY={window.scrollY}
onClose={onClose}
indexName={ALGOLIA.indexName}
appId={ALGOLIA.appId}
apiKey={ALGOLIA.apiKey}
transformItems={(items) => {
return items.map((item) => {
// We transform the absolute URL into a relative URL to
// work better on localhost, preview URLS.
const a = document.createElement('a');
a.href = item.url;
const hash = a.hash === '#overview' ? '' : a.hash;
return {
...item,
url: `${a.pathname}${hash}`,
};
});
}}
/>,
document.body
)}
</>
);
}

View file

@ -0,0 +1,44 @@
/** @jsxImportSource preact */
import type { FunctionalComponent } from 'preact';
import { useState, useEffect } from 'preact/hooks';
const MenuToggle: FunctionalComponent = () => {
const [sidebarShown, setSidebarShown] = useState(false);
useEffect(() => {
const body = document.querySelector('body')!;
if (sidebarShown) {
body.classList.add('mobile-sidebar-toggle');
} else {
body.classList.remove('mobile-sidebar-toggle');
}
}, [sidebarShown]);
return (
<button
type="button"
aria-pressed={sidebarShown ? 'true' : 'false'}
id="menu-toggle"
onClick={() => setSidebarShown(!sidebarShown)}
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
<span className="sr-only">Toggle sidebar</span>
</button>
);
};
export default MenuToggle;

View file

@ -0,0 +1,26 @@
---
type Props = {};
---
<a href="#article" class="sr-only focus:not-sr-only skiplink"><span>Skip to Content</span></a>
<style>
.skiplink,
.skiplink:focus,
.skiplink:focus-visible {
position: absolute;
padding: 0.25em;
font-size: larger;
top: 0;
left: 0;
right: 0;
z-index: 9;
display: block;
text-align: center;
background-color: var(--theme-text-accent);
color: var(--theme-bg);
border-radius: 0.25em;
outline: var(--theme-bg) solid 1px;
outline-offset: 0;
}
</style>

View file

@ -0,0 +1,37 @@
.theme-toggle {
display: inline-flex;
align-items: center;
gap: 0.25em;
padding: 0.33em 0.67em;
border-radius: 99em;
background-color: var(--theme-code-inline-bg);
}
.theme-toggle > label:focus-within {
outline: 2px solid transparent;
box-shadow: 0 0 0 0.08em var(--theme-accent), 0 0 0 0.12em white;
}
.theme-toggle > label {
color: var(--theme-code-inline-text);
position: relative;
display: flex;
align-items: center;
justify-content: center;
opacity: 0.5;
}
.theme-toggle .checked {
color: var(--theme-accent);
opacity: 1;
}
input[name='theme-toggle'] {
position: absolute;
opacity: 0;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
}

View file

@ -0,0 +1,82 @@
import type { FunctionalComponent } from 'preact';
import { useState, useEffect } from 'preact/hooks';
import './ThemeToggleButton.css';
const themes = ['light', 'dark'];
const icons = [
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
fillRule="evenodd"
d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
clipRule="evenodd"
/>
</svg>,
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 20 20"
fill="currentColor"
>
<path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z" />
</svg>,
];
const ThemeToggle: FunctionalComponent = () => {
const [theme, setTheme] = useState(() => {
if (import.meta.env.SSR) {
return undefined;
}
if (typeof localStorage !== undefined && localStorage.getItem('theme')) {
return localStorage.getItem('theme');
}
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
return 'dark';
}
return 'light';
});
useEffect(() => {
const root = document.documentElement;
if (theme === 'light') {
root.classList.remove('theme-dark');
} else {
root.classList.add('theme-dark');
}
}, [theme]);
return (
<div className="theme-toggle">
{themes.map((t, i) => {
const icon = icons[i];
const checked = t === theme;
return (
<label className={checked ? ' checked' : ''}>
{icon}
<input
type="radio"
name="theme-toggle"
checked={checked}
value={t}
title={`Use ${t} theme`}
aria-label={`Use ${t} theme`}
onChange={() => {
localStorage.setItem('theme', t);
setTheme(t);
}}
/>
</label>
);
})}
</div>
);
};
export default ThemeToggle;

View file

@ -0,0 +1,119 @@
---
import { getLanguageFromURL } from '../../languages';
import { SIDEBAR } from '../../config';
type Props = {
currentPage: string;
};
const { currentPage } = Astro.props as Props;
const currentPageMatch = currentPage.endsWith('/')
? currentPage.slice(1, -1)
: currentPage.slice(1);
const langCode = getLanguageFromURL(currentPage);
const sidebar = SIDEBAR[langCode];
---
<nav aria-labelledby="grid-left">
<ul class="nav-groups">
{
Object.entries(sidebar).map(([header, children]) => (
<li>
<div class="nav-group">
<h2>{header}</h2>
<ul>
{children.map((child) => {
const url = Astro.site?.pathname + child.link;
return (
<li class="nav-link">
<a href={url} aria-current={currentPageMatch === child.link ? 'page' : false}>
{child.text}
</a>
</li>
);
})}
</ul>
</div>
</li>
))
}
</ul>
</nav>
<script is:inline>
window.addEventListener('DOMContentLoaded', () => {
var target = document.querySelector('[aria-current="page"]');
if (target && target.offsetTop > window.innerHeight - 100) {
document.querySelector('.nav-groups').scrollTop = target.offsetTop;
}
});
</script>
<style>
nav {
width: 100%;
margin-right: 1rem;
}
.nav-groups {
height: 100%;
padding: 2rem;
overflow-x: visible;
overflow-y: auto;
max-height: 100vh;
}
.nav-groups > li + li {
margin-top: 2rem;
}
.nav-groups > :first-child {
padding-top: var(--doc-padding);
}
.nav-groups > :last-child {
padding-bottom: 2rem;
margin-bottom: var(--theme-navbar-height);
}
.nav-group-title {
font-size: 1rem;
font-weight: 700;
padding: 0.1rem 1rem;
text-transform: uppercase;
margin-bottom: 0.5rem;
}
.nav-link a {
font-size: 1rem;
margin: 1px;
padding: 0.3rem 1rem;
font: inherit;
color: inherit;
text-decoration: none;
display: block;
}
.nav-link a:hover,
.nav-link a:focus {
background-color: var(--theme-bg-hover);
}
.nav-link a[aria-current='page'] {
color: var(--theme-text-accent);
background-color: var(--theme-bg-accent);
font-weight: 600;
}
@media (min-width: 50em) {
.nav-groups {
padding: 0;
}
}
</style>
<style is:global>
:root.theme-dark .nav-link a[aria-current='page'] {
color: hsla(var(--color-base-white), 100%, 1);
}
</style>

View file

@ -0,0 +1,53 @@
---
import type { Frontmatter } from '../../config';
import MoreMenu from '../RightSidebar/MoreMenu.astro';
import TableOfContents from '../RightSidebar/TableOfContents';
import type { MarkdownHeading } from 'astro';
type Props = {
frontmatter: Frontmatter;
headings: MarkdownHeading[];
githubEditUrl: string;
};
const { frontmatter, headings, githubEditUrl } = Astro.props as Props;
const title = frontmatter.title;
---
<article id="article" class="content">
<section class="main-section">
<h1 class="content-title" id="overview">{title}</h1>
<nav class="block sm:hidden">
<TableOfContents client:media="(max-width: 50em)" headings={headings} />
</nav>
<slot />
</section>
<nav class="block sm:hidden">
<MoreMenu editHref={githubEditUrl} />
</nav>
</article>
<style>
.content {
padding: 0;
max-width: 75ch;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.content > section {
margin-bottom: 4rem;
}
.block {
display: block;
}
@media (min-width: 50em) {
.sm\:hidden {
display: none;
}
}
</style>

View file

@ -0,0 +1,75 @@
---
import * as CONFIG from '../../config';
type Props = {
editHref: string;
};
const { editHref } = Astro.props as Props;
const showMoreSection = CONFIG.COMMUNITY_INVITE_URL;
---
{showMoreSection && <h2 class="heading">More</h2>}
<ul>
{
editHref && (
<li class={`heading-link depth-2`}>
<a class="edit-on-github" href={editHref} target="_blank">
<svg
aria-hidden="true"
focusable="false"
data-prefix="fas"
data-icon="pen"
class="svg-inline--fa fa-pen fa-w-16"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
height="1em"
width="1em"
>
<path
fill="currentColor"
d="M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"
/>
</svg>
<span>Edit this page</span>
</a>
</li>
)
}
{
CONFIG.COMMUNITY_INVITE_URL && (
<li class={`heading-link depth-2`}>
<a href={CONFIG.COMMUNITY_INVITE_URL} target="_blank">
<svg
aria-hidden="true"
focusable="false"
data-prefix="fas"
data-icon="comment-alt"
class="svg-inline--fa fa-comment-alt fa-w-16"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
height="1em"
width="1em"
>
<path
fill="currentColor"
d="M448 0H64C28.7 0 0 28.7 0 64v288c0 35.3 28.7 64 64 64h96v84c0 9.8 11.2 15.5 19.1 9.7L304 416h144c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64z"
/>
</svg>
<span>Join our community</span>
</a>
</li>
)
}
</ul>
<style>
.edit-on-github {
text-decoration: none;
font: inherit;
color: inherit;
font-size: 1rem;
}
</style>

View file

@ -0,0 +1,34 @@
---
import TableOfContents from './TableOfContents';
import MoreMenu from './MoreMenu.astro';
import type { MarkdownHeading } from 'astro';
type Props = {
headings: MarkdownHeading[];
githubEditUrl: string;
};
const { headings, githubEditUrl } = Astro.props as Props;
---
<nav class="sidebar-nav" aria-labelledby="grid-right">
<div class="sidebar-nav-inner">
<TableOfContents client:media="(min-width: 50em)" headings={headings} />
<MoreMenu editHref={githubEditUrl} />
</div>
</nav>
<style>
.sidebar-nav {
width: 100%;
position: sticky;
top: 0;
}
.sidebar-nav-inner {
height: 100%;
padding: 0;
padding-top: var(--doc-padding);
overflow: auto;
}
</style>

View file

@ -0,0 +1,56 @@
import type { FunctionalComponent } from 'preact';
import { useState, useEffect, useRef } from 'preact/hooks';
import type { MarkdownHeading } from 'astro';
type ItemOffsets = {
id: string;
topOffset: number;
};
const TableOfContents: FunctionalComponent<{ headings: MarkdownHeading[] }> = ({
headings = [],
}) => {
const itemOffsets = useRef<ItemOffsets[]>([]);
// FIXME: Not sure what this state is doing. It was never set to anything truthy.
const [activeId] = useState<string>('');
useEffect(() => {
const getItemOffsets = () => {
const titles = document.querySelectorAll('article :is(h1, h2, h3, h4)');
itemOffsets.current = Array.from(titles).map((title) => ({
id: title.id,
topOffset: title.getBoundingClientRect().top + window.scrollY,
}));
};
getItemOffsets();
window.addEventListener('resize', getItemOffsets);
return () => {
window.removeEventListener('resize', getItemOffsets);
};
}, []);
return (
<>
<h2 className="heading">On this page</h2>
<ul>
<li className={`heading-link depth-2 ${activeId === 'overview' ? 'active' : ''}`.trim()}>
<a href="#overview">Overview</a>
</li>
{headings
.filter(({ depth }) => depth > 1 && depth < 4)
.map((heading) => (
<li
className={`heading-link depth-${heading.depth} ${
activeId === heading.slug ? 'active' : ''
}`.trim()}
>
<a href={`#${heading.slug}`}>{heading.text}</a>
</li>
))}
</ul>
</>
);
};
export default TableOfContents;

68
apps/docs/src/config.ts Normal file
View file

@ -0,0 +1,68 @@
export const SITE = {
title: 'Astro Reactive Docs',
description: 'Let your data build your UI with native Astro components and architecture.',
defaultLanguage: 'en_US',
};
export const OPEN_GRAPH = {
image: {
src: 'https://github.com/astro-reactive/astro-reactive/blob/main/.github/assets/astro-reactive-library-cover.png?raw=true',
alt: 'astro logo and astro reactive library text on a starry expanse of space',
},
twitter: 'astroreactive',
};
// This is the type of the frontmatter you put in the docs markdown files.
export type Frontmatter = {
title: string;
description: string;
layout: string;
image?: { src: string; alt: string };
dir?: 'ltr' | 'rtl';
ogLocale?: string;
lang?: string;
};
export const KNOWN_LANGUAGES = {
English: 'en',
} as const;
export const KNOWN_LANGUAGE_CODES = Object.values(KNOWN_LANGUAGES);
export const GITHUB_EDIT_URL = `https://github.com/astro-reactive/astro-reactive/tree/main/apps/docs`;
export const COMMUNITY_INVITE_URL = `https://discord.gg/kkvW7GYNAp`;
// See "Algolia" section of the README for more information.
export const ALGOLIA = {
indexName: 'XXXXXXXXXX',
appId: 'XXXXXXXXXX',
apiKey: 'XXXXXXXXXX',
};
export type Sidebar = Record<
(typeof KNOWN_LANGUAGE_CODES)[number],
Record<string, { text: string; link: string }[]>
>;
export const SIDEBAR: Sidebar = {
en: {
// TODO: create tutorial
// Tutorial: [
// { text: "Getting Started", link: "en/getting-started" },
// { text: "Page 2", link: "en/page-2" },
// { text: "Page 3", link: "en/page-3" },
// ],
// TODO: create overview
Introduction: [
{ text: 'Overview', link: 'en/introduction' },
// { text: "Philosophy", link: "en/philosophy" },
],
'API Docs': [
{ text: 'Form', link: 'en/api/form/form-component' },
{ text: 'FormGroup', link: 'en/api/form/form-group' },
{ text: 'FormControl', link: 'en/api/form/form-control' },
{ text: 'Validators', link: 'en/api/validator/validators' },
],
},
};

1
apps/docs/src/env.d.ts vendored Normal file
View file

@ -0,0 +1 @@
/// <reference types="astro/client" />

View file

@ -0,0 +1,10 @@
import { KNOWN_LANGUAGES, KNOWN_LANGUAGE_CODES } from './config';
export { KNOWN_LANGUAGES, KNOWN_LANGUAGE_CODES };
export const langPathRegex = /\/([a-z]{2}-?[A-Z]{0,2})\//;
export function getLanguageFromURL(pathname: string) {
const langCodeMatch = pathname.match(langPathRegex);
const langCode = langCodeMatch ? langCodeMatch[1] : 'en';
return langCode as (typeof KNOWN_LANGUAGE_CODES)[number];
}

View file

@ -0,0 +1,153 @@
---
import HeadCommon from '../components/HeadCommon.astro';
import HeadSEO from '../components/HeadSEO.astro';
import Header from '../components/Header/Header.astro';
import PageContent from '../components/PageContent/PageContent.astro';
import LeftSidebar from '../components/LeftSidebar/LeftSidebar.astro';
import RightSidebar from '../components/RightSidebar/RightSidebar.astro';
import * as CONFIG from '../config';
import type { MarkdownHeading } from 'astro';
import Footer from '../components/Footer/Footer.astro';
type Props = {
frontmatter: CONFIG.Frontmatter;
headings: MarkdownHeading[];
};
const { frontmatter, headings } = Astro.props as Props;
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
const currentPage = Astro.url.pathname;
const currentFile = `src/pages${currentPage.replace(/\/$/, '')}.md`;
const githubEditUrl = `${CONFIG.GITHUB_EDIT_URL}/${currentFile}`;
---
<html dir={frontmatter.dir ?? 'ltr'} lang={frontmatter.lang ?? 'en-us'} class="initial">
<head>
<HeadCommon />
<HeadSEO frontmatter={frontmatter} canonicalUrl={canonicalURL} />
<title>
{frontmatter.title ? `${frontmatter.title} | ${CONFIG.SITE.title}` : CONFIG.SITE.title}
</title>
<style>
body {
width: 100%;
display: grid;
grid-template-rows: var(--theme-navbar-height) 1fr;
--gutter: 0.5rem;
--doc-padding: 2rem;
}
.layout {
display: grid;
grid-auto-flow: column;
grid-template-columns:
minmax(var(--gutter), 1fr) minmax(0, var(--max-width))
minmax(var(--gutter), 1fr);
overflow-x: hidden;
}
.grid-sidebar {
height: 100vh;
position: sticky;
top: 0;
padding: 0;
}
#grid-left {
position: fixed;
background-color: var(--theme-bg);
z-index: 10;
display: none;
}
#grid-main {
padding: 0 var(--gutter);
grid-column: 2;
display: flex;
flex-direction: column;
height: 100%;
}
#grid-right {
display: none;
}
@media (min-width: 50em) {
.layout {
overflow: initial;
grid-template-columns: 20rem minmax(0, var(--max-width));
gap: 1em;
}
#grid-left {
display: flex;
padding-left: 2rem;
position: sticky;
grid-column: 1;
}
}
@media (min-width: 72em) {
.layout {
grid-template-columns: 20rem minmax(0, var(--max-width)) 18rem;
padding-left: 0;
padding-right: 0;
margin: 0 auto;
}
#grid-right {
grid-column: 3;
display: flex;
}
}
</style>
<style is:global>
.warning {
background-color: var(--theme-bg-accent);
color: var(--theme-text-accent);
margin: 2rem 0;
padding: 1.25em 1.5rem;
border-radius: 0 0.25rem 0.25rem 0;
border-left: 3px solid var(--theme-text-accent);
}
.layout > * {
width: 100%;
height: 100%;
}
.mobile-sidebar-toggle {
overflow: hidden;
}
.mobile-sidebar-toggle #grid-left {
display: block;
top: 2rem;
}
</style>
</head>
<body>
<Header currentPage={currentPage} />
<main class="layout">
<aside id="grid-left" class="grid-sidebar" title="Site Navigation">
<LeftSidebar currentPage={currentPage} />
</aside>
<div id="grid-main">
<div class="warning">
<strong>🛠 Under Construction:</strong> This library and the documentation are works in progress.
Read and join our <a href="https://github.com/astro-reactive/astro-reactive/discussions"
>discussions</a
> for questions, suggestions, or feedback.
</div>
<PageContent frontmatter={frontmatter} headings={headings} githubEditUrl={githubEditUrl}>
<slot />
</PageContent>
</div>
<aside id="grid-right" class="grid-sidebar" title="Table of Contents">
<RightSidebar headings={headings} githubEditUrl={githubEditUrl} />
</aside>
</main>
<Footer path={currentFile} />
</body>
</html>

View file

@ -0,0 +1,236 @@
---
title: Form
type: component
package: '@astro-reactive/form'
description: The Reactive Form component for Astro
layout: ../../../../layouts/MainLayout.astro
---
The `Form` component renders a form element and various control components (e.g., `Input`, `TextArea`, `Select`) depending on the data that you provide through its `formGroups` property.
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
const form = new FormGroup();
// your controls configuration data
---
<Form formGroups={form} />
```
## Installation
```
npm i @astro-reactive/form
```
## Usage
Setting up the `Form` component is mainly done by providing it your configuration via the `formGroups` property which takes either a `FormGroup` or an array `FormGroup[]`.
_See the documentation for the [FormGroup](/en/api/form/form-group) class._
### Setting up a form
Assigning a `FormGroup` object to the `formGroup` property will set up a form.
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
const form = new FormGroup([
{
name: 'username',
label: 'Username',
value: 'awesome_dev',
},
{
name: 'comment',
label: 'Feedback',
type: 'textarea',
value: 'Nice!',
},
{
name: 'size',
label: 'Size',
type: 'dropdown',
options: ['S', 'M', 'L', 'XL', 'XXL'],
placeholder: '-- Please choose an option --',
},
]);
---
<Form formGroups={form} />
```
The example above will result in a form containing three controls: a text field `username`, a textarea `comment`, and a `size` dropdown.
![single-form](https://user-images.githubusercontent.com/4262489/200187918-95052561-e02c-453d-9a9b-940303a80046.png)
The `FormGroup` constructor takes an array `ControlConfig[]`.
> **📝 Note:** The `ControlConfig` type will be defined in the [FormControl](/en/api/form/form-control) class documentation.
### Setting up multiple field sets
To render a form with multiple field sets, assign an array `FormGroup[]` to the `formGroups` property.
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
const nameForm = new FormGroup(
[
{
name: 'firstName',
label: 'First Name',
value: 'John',
},
{
name: 'lastName',
label: 'Last Name',
value: 'Doe',
},
],
'Name'
);
const skills = new FormGroup(
[
{
name: 'JavaScript',
type: 'checkbox',
label: 'JavaScript',
},
{
name: 'TypeScript',
type: 'checkbox',
label: 'TypeScript',
},
{
name: 'React',
type: 'checkbox',
label: 'React',
},
{
name: 'Vue',
type: 'checkbox',
label: 'Vue',
},
],
'Skills'
);
---
<Form formGroups={[nameForm, skills]} />
```
The example above renders a form with two field sets with legend `Name` and `Skills`.
![multiple form groups](https://user-images.githubusercontent.com/4262489/200191529-ff5fed93-2cd4-4337-9eb2-f47e64259206.png)
The `FormGroup` constructor optionally takes a name property to set the legend for the field set.
### Setting up the Submit button
The `Form` component takes an optional `submitControl` property. This property is of type `Submit` which is a special type for the submit button.
This implementation is to distinguish the submit button from other buttons and limit the form to only have one of it.
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
const form = new FormGroup([]);
const submitControl: Submit = {
name: 'submit',
type: 'submit',
};
---
<Form formGroups={form} submitControl={submitControl} />
```
This is a very crude solution to prevent having multiple submit buttons. For suggestions to improve this, join our [discussions](https://github.com/astro-reactive/astro-reactive/discussions).
---
## Properties
The following are input properties a `Form` component can take. Only the `formGroups` property is required.
| Property | Type | |
| ------------------------------------------- | ----------------------------- | -------- |
| [formGroups](#formgroups) | `FormGroup \| FormGroup[]` | required |
| [action](#action) | `string` | optional |
| [method](#method) | `'get' \| 'post' \| 'dialog'` | optional |
| [readOnly](#readonly) | `boolean` | optional |
| [showValidationHints](#showvalidationhints) | `boolean` | optional |
| [submitControl](#submitcontrol) | `Submit` | optional |
| [theme](#theme) | `'light' \| 'dark'` | optional |
| [validateOnLoad](#validateOnLoad) | `boolean` | optional |
### `formGroups`
Type: `FormGroup | FormGroup[]`
Determines how the form is rendered
### action
Type: `string`
Sets the `action` [attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#attr-action) for the form. Set this to the URL that processes the form submission.
### method
Type: HTTPSubmitMethod
Sets the `method` [attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#attr-method) for the form. Set this to the HTTP method to submit the form: 'post', 'get', or 'dialog'.
From [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#attr-method):
- `post` - The POST method; form data sent as the request body.
- `get (default)` - The GET method; form data appended to the action URL with a ? separator. Use this method when the form has no side effects.
- `dialog` - When the form is inside a <dialog>, closes the dialog and throws a submit event on submission without submitting data or clearing the form.
### `readOnly`
Type: `boolean`
Sets the whole form as read-only.
### `showValidationHints`
Type: `boolean`
When used with our `validator` package, the `Form` component is able to render validation hints when `showValidationHints` is set to true:
- asterisks on required controls' labels
- controls with validation errors are colored red
### `submitControl`
Type: `Submit`
A special button that triggers the submit event for a form.
```ts
const submit: Submit = {
type: 'submit',
value: "Let's go!",
};
```
### `theme`
Type: `'light' | 'dark'`
Sets the form to use light or dark mode.
### `validateOnLoad`
Type: `boolean`
When used with our `validator` package, the `Form` component is able to render validation errors on server-side rendering when `validateOnLoad` is set to true. Otherwise, the validation errors will only be rendered on the client-side upon user interaction.

View file

@ -0,0 +1,9 @@
---
title: FormControl
type: class
package: '@astro-reactive/form'
description: FormControl class
layout: ../../../../layouts/MainLayout.astro
---
> **❗ Note:** This documentation is incomplete.

View file

@ -0,0 +1,29 @@
---
title: FormGroup
type: class
package: '@astro-reactive/form'
description: The FormGroup class represents a group of controls that will be rendered as a fieldset element in a form.
layout: ../../../../layouts/MainLayout.astro
---
The `FormGroup` class represents a group of controls that will be rendered as a fieldset element in a form.
> **❗ Note:** This documentation is incomplete.
## Properties
| Property | Type | |
| --------------------- | --------------- | -------- |
| [controls](#controls) | `FormControl[]` | required |
| [name](#name) | `string` | optional |
### controls
### name
## Methods
| Method | Parameters | Returns |
| ------------- | ------------ | ------------ |
| [get](#get) | name: string | `FormControl | undefined` |
| [name](#name) | `string` | optional |

View file

@ -0,0 +1,5 @@
<script is:inline>
// Redirect your homepage to the first page of documentation.
// If you have a landing page, remove this script and add it here!
window.location.pathname = `/en/api/form/form-component`;
</script>

View file

@ -0,0 +1,5 @@
<script is:inline>
// Redirect your homepage to the first page of documentation.
// If you have a landing page, remove this script and add it here!
window.location.pathname = `/en/api/form/form-component`;
</script>

View file

@ -0,0 +1,3 @@
<script is:inline>
window.location.pathname = `/en/api/validator/validators`;
</script>

View file

@ -0,0 +1,193 @@
---
title: Validators
type: class
package: '@astro-reactive/validators'
description: Validator package for @astro-reactive/forms package for providing validation to forms.
layout: ../../../../layouts/MainLayout.astro
---
The `Validators` class provides a set of built-in validators that can be used by form controls right out of the box.
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
import { Validators } from '@astro-reactive/validator';
const form = new FormGroup([
{
name: 'username',
label: 'Username',
validators: [Validators.required],
},
{
name: 'password',
label: 'Password',
validators: [Validators.required, Validators.minLength(8)],
},
]);
---
<Form formGroups={form} />
```
_See the documentation for the [validators prop](#) here._
## Installation
```
npm i @astro-reactive/validator
```
## Usage
Simply import the `Validators` class from the `@astro-reactive/validator` package and use the validators as needed.
### `Validators.required`
The `Validators.required` validator is used to ensure that a form control has a non-empty value.
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
import { Validators } from '@astro-reactive/validator';
const form = new FormGroup([
{
name: 'username',
label: 'Username',
validators: [Validators.required],
},
]);
---
<Form formGroups={form} />
```
### `Validators.requiredChecked`
The `Validators.requiredChecked` validator is used to ensure that a checkbox is checked.
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
import { Validators } from '@astro-reactive/validator';
const form = new FormGroup([
{
name: 'terms',
label: 'Terms and Conditions',
type: 'checkbox',
validators: [Validators.requiredChecked],
},
]);
---
<Form formGroups={form} />
```
### `Validators.email`
The `Validators.email` validator is used to ensure that a form control has a valid email address. It uses a regular expression to validate the email address.
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
import { Validators } from '@astro-reactive/validator';
const form = new FormGroup([
{
name: 'email',
label: 'Email',
validators: [Validators.email],
},
]);
---
<Form formGroups={form} />
```
### `Validators.min`
The `Validators.min` validator is used to ensure that the numeric value of form control is greater than or equal to given value.
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
import { Validators } from '@astro-reactive/validator';
const form = new FormGroup([
{
name: 'price',
label: 'Price',
type: 'number',
validators: [Validators.min(8)],
},
]);
---
<Form formGroups={forms} />
```
### `Validators.max`
The `Validators.max` validator is used to ensure that the numeric value of form control is less than or equal to given value.
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
import { Validators } from '@astro-reactive/validator';
const form = new FormGroup([
{
name: 'price',
label: 'Price',
type: 'number',
validators: [Validators.max(8)],
},
]);
---
<Form formGroups={forms} />
```
### `Validators.minLength`
The `Validators.minLength` validator is used to ensure that the length of the value of form control is greater than or equal to given value.
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
import { Validators } from '@astro-reactive/validator';
const form = new FormGroup([
{
name: 'password',
label: 'Password',
validators: [Validators.minLength(8)],
},
]);
---
<Form formGroups={forms} />
```
### `Validators.maxLength`
The `Validators.maxLength` validator is used to ensure that the length of the value of form control is less than or equal to given value.
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
import { Validators } from '@astro-reactive/validator';
const form = new FormGroup([
{
name: 'password',
label: 'Password',
validators: [Validators.maxLength(8)],
},
]);
---
<Form formGroups={forms} />
```

View file

@ -0,0 +1,5 @@
<script is:inline>
// Redirect your homepage to the first page of documentation.
// If you have a landing page, remove this script and add it here!
window.location.pathname = `/en/introduction`;
</script>

View file

@ -0,0 +1,57 @@
---
title: Hi, explorer!
description: Astro Reactive Library Docs
layout: ../../layouts/MainLayout.astro
---
Thanks for checking out the Astro Reactive Library! Welcome to a new adventure.
This project aims to be a new library of components and utilities for building reactive user interfaces with [Astro](https://astro.build).
We will update this documentation with a fun and easy tutorial so you can start building reactive UIs with Astro from scratch using our packages.
> **📝 Note:** See our [API Docs](/en/api) for example usage.
## Reactive what?
We are in pursuit of an easy developer experience for implementing reactive UIs in an Astro app. By this we mean components that are able to emit and listen to events, and a huge part of the challenge is "hibernating" the state after server-rendering and "waking" it up on the browser.
This will be released as a core package of the library to support reactivity across our packages, and hopefully as a utility to use for your own components.
As of now this is still a _goal_. In other words, we see this as researching the [hyperdrive](https://starwars.fandom.com/wiki/Hyperdrive/Legends) engine to explore new frontiers with Astro.
And we're having fun.
_👉 [Join us!](https://github.com/astro-reactive/astro-reactive/blob/main/CONTRIBUTING.md#readme)_
## Project Motivation
When you build a page with Astro right now, you have to keep in mind that everything is built into HTML with very minimal, and even zero, JS.
This is what makes astro great for content-focused web applications.
However we also see that Astro has given us a good baseline framework to potentially build more complex interactions.
The challenge right now is that there is no opinionated way to "resume" what your components did from the server to the browser. So I thought: What if there is a library of components and utilities to help us do this?
In this project, our motivation is to get to this future. This is our _next frontier 🚀_
## Some Tradeoffs
The Astro framework is very clear and focused on what they provide: top-tier performance for content-focused websites. In doing so, it has introduced a new world of architecture to a lot of developers.
Once we take off in pursuit of our project goals, we are aware of some tradeoffs that will be made.
As we build, we aim to minimize the performance hit to your applications.
We will also make this clear in our library documentation as we see them.
## Packages
| Package | Release notes | Description |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| [form](/en/api/form/form-component) | [![npm](https://img.shields.io/npm/v/@astro-reactive/form)](https://github.com/astro-reactive/astro-reactive/blob/main/packages/form/CHANGELOG.md) | a dynamic form which can be modified programmatically |
| [validator](https://github.com/astro-reactive/astro-reactive/blob/main/packages/validator/README.md) | [![npm](https://img.shields.io/npm/v/@astro-reactive/validator)](https://github.com/astro-reactive/astro-reactive/blob/main/packages/validator/CHANGELOG.md) | validators for editable fields |
| data-grid | 🛠 | a dynamic data grid of values |
| themes | 🛠 | easy-to-use, accessible, consistent cross-browser styles |
| viz | 🛠 | data visualization that emits and responds to events |

View file

@ -0,0 +1,5 @@
---
title: Philosophy
description: Library homepage
layout: ../../layouts/MainLayout.astro
---

View file

@ -0,0 +1,29 @@
---
title: Getting Started
description: Library homepage
layout: ../../../layouts/MainLayout.astro
---
Consider the following code:
```astro
---
import Form, { FormGroup } from '@astro-reactive/form';
import { Validators } from '@astro-reactive/validator';
const form = new FormGroup([
{
name: 'username',
label: 'Username',
validators: [Validators.required],
},
{
name: 'password',
label: 'Password',
validators: [Validators.required, Validators.minLength(8)],
},
]);
---
<Form formGroups={form} />
```

View file

@ -0,0 +1,106 @@
---
title: Reactive Form
description: Lorem ipsum dolor sit amet - 2
layout: ../../../layouts/MainLayout.astro
---
![package-form-cover](https://user-images.githubusercontent.com/4262489/193812095-1cffa287-e2ac-4671-b604-1e2ff2e6f19e.png)
[![version](https://img.shields.io/npm/v/@astro-reactive/form)](https://www.npmjs.com/package/@astro-reactive/form)
[![license](https://img.shields.io/npm/l/@astro-reactive/form)](https://www.npmjs.com/package/@astro-reactive/form)
[![downloads](https://img.shields.io/npm/dt/@astro-reactive/form)](https://www.npmjs.com/package/@astro-reactive/form)
[![dependencies](https://img.shields.io/librariesio/release/npm/@astro-reactive/form)](https://www.npmjs.com/package/@astro-reactive/form)
# Astro Reactive Form 🔥
Generate a dynamic form based on your data, and modify programatically.
The Reactive Form component for [Astro](https://astro.build) 🔥
_[All contributions are welcome.](https://github.com/astro-reactive/astro-reactive/issues)_
## Installation
In your Astro project:
```
npm i @astro-reactive/form
```
## Usage
Use in an Astro page:
```astro
---
import { FormControl, FormGroup } from '@astro-reactive/form/core';
import Form from '@astro-reactive/form';
// create a form group
const form = new FormGroup([
{
name: 'username',
label: 'Username',
},
{
name: 'password',
label: 'Password',
type: 'password',
},
]);
// set the name optionally
form.name = 'Simple Form';
// you can insert a control at any point
form.controls.push(
new FormControl({
type: 'checkbox',
name: 'is-awesome',
label: 'is Awesome?',
})
);
// you can get a FormControl object
const userNameControl = form.get('username');
// you can set values dynamically
userNameControl?.setValue('RAMOOOON');
form.get('is-awesome')?.setValue('checked');
---
<!-- the formGroups attribute takes an array of FormGroup-->
<Form formGroups={[form]} />
```
# Screenshots
Result of example above:
<img width="535" alt="Screen Shot 2022-10-01 at 7 29 00 PM" src="https://user-images.githubusercontent.com/4262489/193421174-5c604aca-7d16-4cd6-a7b1-f5b8752c838e.png">
Example of multiple form groups:
![Screen Shot 2022-09-27 at 10 44 03 PM](https://user-images.githubusercontent.com/4262489/192631524-3139ac60-8d84-4c12-9231-fe2d49962756.png)
# Future Plans
Currently this only supports very basic form creation, but the goal of the project is ambitious:
1. Validator library for common validation scenarios
1. Client-side validation
1. Server-side validation
1. validation hooks - onFocus, onBlur, onSubmit
1. Themes - unstyled, light mode, dark mode, compact, large
1. FormGroup class
1. `statusChanges` - observable that emits the form status when it changes
1. `valueChanges` - observable that emits the values of all controls when they change
1. FormControl class
1. `statusChanges` - observable that emits the control status when it changes
1. `valueChanges` - observable that emits the control value when it changes
1. `value` - property that reflects the control value
1. Documentation website
... and so much more
_All contributions are welcome. Let's make the fastest web form component powered by Astro_

View file

@ -0,0 +1,37 @@
---
title: Page 3
description: Lorem ipsum dolor sit amet - 3
layout: ../../../layouts/MainLayout.astro
---
This is a fully-featured page, written in Markdown!
## Section A
Lorem ipsum dolor sit amet, **consectetur adipiscing elit**. Sed ut tortor _suscipit_, posuere ante id, vulputate urna. Pellentesque molestie aliquam dui sagittis aliquet. Sed sed felis convallis, lacinia lorem sit amet, fermentum ex. Etiam hendrerit mauris at elementum egestas. Vivamus id gravida ante. Praesent consectetur fermentum turpis, quis blandit tortor feugiat in. Aliquam erat volutpat. In elementum purus et tristique ornare. Suspendisse sollicitudin dignissim est a ultrices. Pellentesque sed ipsum finibus, condimentum metus eget, sagittis elit. Sed id lorem justo. Vivamus in sem ac mi molestie ornare.
## Section B
Nam quam dolor, pellentesque sed odio euismod, feugiat tempus tellus. Quisque arcu velit, ultricies in faucibus sed, ultrices ac enim. Nunc eget dictum est. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam ex nisi, egestas mollis ultricies ut, laoreet suscipit libero. Nam condimentum molestie turpis. Sed vestibulum sagittis congue. Maecenas tristique enim et tincidunt tempor. Curabitur ac scelerisque nulla, in malesuada libero. Praesent eu tempus odio. Pellentesque aliquam ullamcorper quam at gravida. Sed non fringilla mauris. Aenean sit amet ultrices erat. Vestibulum congue venenatis tortor, nec suscipit tortor. Aenean pellentesque mauris eget tortor tincidunt pharetra.
## Section C
```markdown
---
title: Markdown Page!
lang: en
layout: ~/layouts/MainLayout.astro
---
# Markdown example
This is a fully-featured page, written in Markdown!
## Section A
Lorem ipsum dolor sit amet, **consectetur adipiscing elit**. Sed ut tortor _suscipit_, posuere ante id, vulputate urna. Pellentesque molestie aliquam dui sagittis aliquet. Sed sed felis convallis, lacinia lorem sit amet, fermentum ex. Etiam hendrerit mauris at elementum egestas. Vivamus id gravida ante. Praesent consectetur fermentum turpis, quis blandit tortor feugiat in. Aliquam erat volutpat. In elementum purus et tristique ornare. Suspendisse sollicitudin dignissim est a ultrices. Pellentesque sed ipsum finibus, condimentum metus eget, sagittis elit. Sed id lorem justo. Vivamus in sem ac mi molestie ornare.
## Section B
Nam quam dolor, pellentesque sed odio euismod, feugiat tempus tellus. Quisque arcu velit, ultricies in faucibus sed, ultrices ac enim. Nunc eget dictum est. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam ex nisi, egestas mollis ultricies ut, laoreet suscipit libero. Nam condimentum molestie turpis. Sed vestibulum sagittis congue. Maecenas tristique enim et tincidunt tempor. Curabitur ac scelerisque nulla, in malesuada libero. Praesent eu tempus odio. Pellentesque aliquam ullamcorper quam at gravida. Sed non fringilla mauris. Aenean sit amet ultrices erat. Vestibulum congue venenatis tortor, nec suscipit tortor. Aenean pellentesque mauris eget tortor tincidunt pharetra.
```

View file

@ -0,0 +1,5 @@
<script is:inline>
// Redirect your homepage to the first page of documentation.
// If you have a landing page, remove this script and add it here!
window.location.pathname = `/en/introduction/`;
</script>

View file

@ -0,0 +1,382 @@
* {
box-sizing: border-box;
margin: 0;
}
/* Global focus outline reset */
*:focus:not(:focus-visible) {
outline: none;
}
:root {
--user-font-scale: 1rem - 16px;
--max-width: calc(100% - 1rem);
}
@media (min-width: 50em) {
:root {
--max-width: 46em;
}
}
body {
display: flex;
flex-direction: column;
min-height: 100vh;
font-family: var(--font-body);
font-size: 1rem;
font-size: clamp(0.9rem, 0.75rem + 0.375vw + var(--user-font-scale), 1rem);
line-height: 1.5;
max-width: 100vw;
}
nav ul {
list-style: none;
padding: 0;
}
.content > section > * + * {
margin-top: 1.25rem;
}
.content > section > :first-child {
margin-top: 0;
}
/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
margin-bottom: 1rem;
font-weight: bold;
line-height: 1;
}
h1,
h2 {
max-width: 40ch;
}
:is(h2, h3):not(:first-child) {
margin-top: 3rem;
}
:is(h4, h5, h6):not(:first-child) {
margin-top: 2rem;
}
h1 {
font-size: 3.25rem;
font-weight: 800;
}
h2 {
font-size: 2.5rem;
}
h3 {
font-size: 1.75rem;
}
h4 {
font-size: 1.3rem;
}
h5 {
font-size: 1rem;
}
p {
line-height: 1.65em;
}
.content ul {
line-height: 1.1em;
}
p,
.content ul {
color: var(--theme-text-light);
}
small,
.text_small {
font-size: 0.833rem;
}
a {
color: var(--theme-text-accent);
font-weight: 400;
text-underline-offset: 0.08em;
align-items: center;
gap: 0.5rem;
}
article > section :is(ul, ol) > * + * {
margin-top: 0.75rem;
}
article > section nav :is(ul, ol) > * + * {
margin-top: inherit;
}
article > section li > :is(p, pre, blockquote):not(:first-child) {
margin-top: 1rem;
}
article > section :is(ul, ol) {
padding-left: 1em;
}
article > section nav :is(ul, ol) {
padding-left: inherit;
}
article > section nav {
margin-top: 1rem;
margin-bottom: 2rem;
}
article > section ::marker {
font-weight: bold;
color: var(--theme-text-light);
}
article > section iframe {
width: 100%;
height: auto;
aspect-ratio: 16 / 9;
}
a > code {
position: relative;
color: var(--theme-text-accent);
background: transparent;
text-underline-offset: var(--padding-block);
}
a > code::before {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: block;
background: var(--theme-accent);
opacity: var(--theme-accent-opacity);
border-radius: var(--border-radius);
}
a:hover,
a:focus {
text-decoration: underline;
}
a:focus {
outline: 2px solid currentColor;
outline-offset: 0.25em;
}
strong {
font-weight: 600;
color: inherit;
}
/* Supporting Content */
code {
--border-radius: 3px;
--padding-block: 0.2rem;
--padding-inline: 0.33rem;
font-family: var(--font-mono);
font-size: 0.85em;
color: inherit;
background-color: var(--theme-code-inline-bg);
padding: var(--padding-block) var(--padding-inline);
margin: calc(var(--padding-block) * -1) -0.125em;
border-radius: var(--border-radius);
word-break: break-word;
}
pre.astro-code > code {
all: unset;
}
pre > code {
font-size: 1em;
}
table,
pre {
position: relative;
--padding-block: 1rem;
--padding-inline: 2rem;
padding: var(--padding-block) var(--padding-inline);
padding-right: calc(var(--padding-inline) * 2);
margin-left: calc(var(--padding-inline) * -1);
margin-right: calc(var(--padding-inline) * -1);
font-family: var(--font-mono);
line-height: 1.5;
font-size: 0.85em;
overflow-y: hidden;
overflow-x: auto;
}
table {
width: 100%;
padding: var(--padding-block) 0;
margin: 0;
border-collapse: collapse;
}
/* Zebra striping */
tr:nth-of-type(odd) {
background: var(--theme-bg-hover);
}
th {
background: var(--color-black);
color: var(--theme-color);
font-weight: bold;
}
td,
th {
padding: 6px;
text-align: left;
}
pre {
background-color: var(--theme-code-bg);
color: var(--theme-code-text);
}
blockquote code {
background-color: var(--theme-bg);
}
@media (min-width: 37.75em) {
pre {
--padding-inline: 1.25rem;
border-radius: 8px;
margin-left: 0;
margin-right: 0;
}
}
blockquote {
margin: 2rem 0;
padding: 1.25em 1.5rem;
border-left: 3px solid var(--theme-text-light);
background-color: var(--theme-bg-offset);
border-radius: 0 0.25rem 0.25rem 0;
line-height: 1.7;
}
img {
max-width: 100%;
}
.flex {
display: flex;
align-items: center;
}
button {
display: flex;
align-items: center;
justify-items: center;
gap: 0.25em;
padding: 0.33em 0.67em;
border: 0;
background: var(--theme-bg);
display: flex;
font-size: 1rem;
align-items: center;
gap: 0.25em;
border-radius: 99em;
color: var(--theme-text);
background-color: var(--theme-bg);
}
h2.heading {
font-size: 1rem;
font-weight: 700;
padding: 0.1rem 1rem;
text-transform: uppercase;
margin-bottom: 0.5rem;
}
.heading-link {
font-size: 1rem;
padding: 0.1rem 0 0.1rem 1rem;
border-left: 4px solid var(--theme-divider);
}
.heading-link:hover,
.heading-link:focus {
border-left-color: var(--theme-accent);
color: var(--theme-accent);
}
.heading-link:focus-within {
color: var(--theme-text-light);
border-left-color: hsla(var(--color-gray-40), 1);
}
.heading-link svg {
opacity: 0.6;
}
.heading-link:hover svg {
opacity: 0.8;
}
.heading-link a {
display: inline-flex;
gap: 0.5em;
width: 100%;
padding: 0.15em 0 0.15em 0;
}
.heading-link.depth-3 {
padding-left: 2rem;
}
.heading-link.depth-4 {
padding-left: 3rem;
}
.heading-link a {
font: inherit;
color: inherit;
text-decoration: none;
}
/* Screenreader Only Text */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
.focus\:not-sr-only:focus,
.focus\:not-sr-only:focus-visible {
position: static;
width: auto;
height: auto;
padding: 0;
margin: 0;
overflow: visible;
clip: auto;
white-space: normal;
}
:target {
scroll-margin: calc(var(--theme-sidebar-offset, 5rem) + 2rem) 0 2rem;
}

View file

@ -0,0 +1,125 @@
:root {
--font-fallback: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif,
Apple Color Emoji, Segoe UI Emoji;
--font-body: system-ui, var(--font-fallback);
--font-mono: 'IBM Plex Mono', Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console',
'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono',
'Nimbus Mono L', Monaco, 'Courier New', Courier, monospace;
/*
* Variables with --color-base prefix define
* the hue, and saturation values to be used for
* hsla colors.
*
* ex:
*
* --color-base-{color}: {hue}, {saturation};
*
*/
--color-base-white: 0, 0%;
--color-base-black: 240, 100%;
--color-base-gray: 215, 14%;
--color-base-blue: 212, 100%;
--color-base-blue-dark: 212, 72%;
--color-base-green: 158, 79%;
--color-base-orange: 22, 100%;
--color-base-purple: 269, 79%;
--color-base-red: 351, 100%;
--color-base-yellow: 41, 100%;
/*
* Color palettes are made using --color-base
* variables, along with a lightness value to
* define different variants.
*
*/
--color-gray-5: var(--color-base-gray), 5%;
--color-gray-10: var(--color-base-gray), 10%;
--color-gray-20: var(--color-base-gray), 20%;
--color-gray-30: var(--color-base-gray), 30%;
--color-gray-40: var(--color-base-gray), 40%;
--color-gray-50: var(--color-base-gray), 50%;
--color-gray-60: var(--color-base-gray), 60%;
--color-gray-70: var(--color-base-gray), 70%;
--color-gray-80: var(--color-base-gray), 80%;
--color-gray-90: var(--color-base-gray), 90%;
--color-gray-95: var(--color-base-gray), 95%;
--color-blue: var(--color-base-blue), 61%;
--color-blue-dark: var(--color-base-blue-dark), 39%;
--color-green: var(--color-base-green), 42%;
--color-orange: var(--color-base-orange), 50%;
--color-purple: var(--color-base-purple), 54%;
--color-red: var(--color-base-red), 54%;
--color-yellow: var(--color-base-yellow), 59%;
}
:root {
color-scheme: light;
--theme-accent: hsla(var(--color-blue), 1);
--theme-text-accent: hsla(var(--color-blue), 1);
--theme-accent-opacity: 0.15;
--theme-divider: hsla(var(--color-gray-95), 1);
--theme-text: hsla(var(--color-gray-10), 1);
--theme-text-light: hsla(var(--color-gray-40), 1);
/* @@@: not used anywhere */
--theme-text-lighter: hsla(var(--color-gray-80), 1);
--theme-bg: hsla(var(--color-base-white), 100%, 1);
--theme-bg-hover: hsla(var(--color-gray-95), 1);
--theme-bg-offset: hsla(var(--color-gray-90), 1);
--theme-bg-accent: hsla(var(--color-blue), var(--theme-accent-opacity));
--theme-code-inline-bg: hsla(var(--color-gray-95), 1);
--theme-code-inline-text: var(--theme-text);
--theme-code-bg: hsla(217, 19%, 27%, 1);
--theme-code-text: hsla(var(--color-gray-95), 1);
--theme-navbar-bg: hsla(var(--color-base-white), 100%, 1);
--theme-navbar-height: 6rem;
--theme-selection-color: hsla(var(--color-blue), 1);
--theme-selection-bg: hsla(var(--color-blue), var(--theme-accent-opacity));
}
body {
background: var(--theme-bg);
color: var(--theme-text);
}
:root.theme-dark {
color-scheme: dark;
--theme-accent-opacity: 0.15;
--theme-accent: hsla(var(--color-blue), 1);
--theme-text-accent: hsla(var(--color-blue), 1);
--theme-divider: hsla(var(--color-gray-10), 1);
--theme-text: hsla(var(--color-gray-90), 1);
--theme-text-light: hsla(var(--color-gray-80), 1);
/* @@@: not used anywhere */
--theme-text-lighter: hsla(var(--color-gray-40), 1);
--theme-bg: hsla(215, 28%, 17%, 1);
--theme-bg-hover: hsla(var(--color-gray-40), 1);
--theme-bg-offset: hsla(var(--color-gray-5), 1);
--theme-code-inline-bg: hsla(var(--color-gray-10), 1);
--theme-code-inline-text: hsla(var(--color-base-white), 100%, 1);
--theme-code-bg: hsla(var(--color-gray-5), 1);
--theme-code-text: hsla(var(--color-base-white), 100%, 1);
--theme-navbar-bg: hsla(215, 28%, 17%, 1);
--theme-selection-color: hsla(var(--color-base-white), 100%, 1);
--theme-selection-bg: hsla(var(--color-purple), var(--theme-accent-opacity));
/* DocSearch [Algolia] */
--docsearch-modal-background: var(--theme-bg);
--docsearch-searchbox-focus-background: var(--theme-divider);
--docsearch-footer-background: var(--theme-divider);
--docsearch-text-color: var(--theme-text);
--docsearch-hit-background: var(--theme-divider);
--docsearch-hit-shadow: none;
--docsearch-hit-color: var(--theme-text);
--docsearch-footer-shadow: inset 0 2px 10px #000;
--docsearch-modal-shadow: inset 0 0 8px #000;
}
::selection {
color: var(--theme-selection-color);
background-color: var(--theme-selection-bg);
}

6
apps/docs/tsconfig.json Normal file
View file

@ -0,0 +1,6 @@
{
"extends": "@astro-reactive/tsconfig/astro-library.json",
"compilerOptions": {
"jsx": "preserve"
}
}

View file

@ -0,0 +1,2 @@
dist
node_modules

View file

@ -0,0 +1,5 @@
/** @type {import("@types/eslint").Linter.Config} */
module.exports = {
root: true,
extends: ['@astro-reactive/eslint-config-custom'],
};

2
apps/landing-page/.npmrc Normal file
View file

@ -0,0 +1,2 @@
# Expose Astro dependencies for `pnpm` users
shamefully-hoist=true

View file

@ -0,0 +1,2 @@
dist/
.output/

View file

@ -6,7 +6,7 @@ module.exports = {
tabWidth: 2,
trailingComma: 'es5',
useTabs: true,
plugins: ['./node_modules/prettier-plugin-astro'],
plugins: ['prettier-plugin-astro'],
overrides: [
{
files: '*.astro',

View file

@ -0,0 +1,25 @@
# @astro-reactive/landing-page
## 1.0.1
### Patch Changes
- a1cc4b0: Update homepage to https://astro-reactive.js.org
## 1.0.0
### Major Changes
- 6e27739: Make the npm install script shorter
### Minor Changes
- 4d2a577: Support Astro 3
## 0.0.2
### Patch Changes
- fb11b73: Initial `create-astro-reactive` package
Update packages' meta information (author, homepage)
Upadte LICENSE owner info to `astro-reactive` organization

View file

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2022-present Markus Hsi-Yang Fritz
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 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.

Some files were not shown because too many files have changed in this diff Show more