Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the Bulma component elements as Yew components. #41

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

@filipdutescu filipdutescu added the feature New feature or request label Apr 14, 2023
@filipdutescu filipdutescu added this to the 0.5.0 milestone Apr 14, 2023
@filipdutescu filipdutescu self-assigned this Apr 14, 2023
@codecov
Copy link

codecov bot commented Apr 14, 2023

Codecov Report

Patch coverage: 20.40% and project coverage change: +4.51 🎉

Comparison is base (02f5285) 57.91% compared to head (c103309) 62.42%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
+ Coverage   57.91%   62.42%   +4.51%     
==========================================
  Files          31       39       +8     
  Lines        2975     2965      -10     
==========================================
+ Hits         1723     1851     +128     
+ Misses       1252     1114     -138     
Impacted Files Coverage Δ
yew-and-bulma/src/columns.rs 0.00% <0.00%> (ø)
yew-and-bulma/src/components/breadcrumb.rs 0.00% <0.00%> (ø)
yew-and-bulma/src/components/dropdown.rs 0.00% <0.00%> (ø)
yew-and-bulma/src/components/menu.rs 0.00% <0.00%> (ø)
yew-and-bulma/src/components/message.rs 0.00% <0.00%> (ø)
yew-and-bulma/src/components/modal.rs 0.00% <0.00%> (ø)
yew-and-bulma/src/components/pagination.rs 0.00% <0.00%> (ø)
yew-and-bulma/src/components/panel.rs 0.00% <0.00%> (ø)
yew-and-bulma/src/components/tabs.rs 0.00% <0.00%> (ø)
yew-and-bulma/src/elements/block.rs 0.00% <0.00%> (ø)
... and 22 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@filipdutescu filipdutescu force-pushed the feat/component_elements branch 5 times, most recently from d491aac to 42457c8 Compare April 16, 2023 10:08
Implement the [Bulma breadcrumb component][bd] as a [Yew][yew]
component. Document it and its properties and add an example showcasing
how it's used. Update the module tree to include the breadcrumb module
and document the new additions to the crate.

[bd]: https://bulma.io/documentation/components/breadcrumb/
[yew]: https://yew.rs

Fixes: #31
Signed-off-by: Filip Dutescu <[email protected]>
Implement the [Bulma tabs component][bd] as a [Yew][yew] component.
Document it and its properties and add an example showcasing how it's
used. Update the module tree to include the tabs module and document
the new additions to the crate.

[bd]: https://bulma.io/documentation/components/tabs/
[yew]: https://yew.rs

Fixes: #40
Signed-off-by: Filip Dutescu <[email protected]>
Implement the [Bulma pagination components][bd] as a [Yew][yew]
component. Document them and their properties and add an example
showcasing how it's used. Update the module tree to include the
pagination module and document the new additions to the crate.

[bd]: https://bulma.io/documentation/components/pagination/
[yew]: https://yew.rs

Fixes: #38
Signed-off-by: Filip Dutescu <[email protected]>
The examples used the [`0.9.3`][prev] version of [Bulma][bulma], which
does not have a some of the features that the components provide, as
the docs are now on [`0.9.4`][next]. To mitigate the need for such bumps
in the future, change the CDN linking to use the `latest` tag, instead
of a fixed version one.

[prev]: https://github.com/jgthms/bulma/releases/tag/0.9.3
[next]: https://github.com/jgthms/bulma/releases/tag/0.9.4
[bulma]: https://bulma.io

Signed-off-by: Filip Dutescu <[email protected]>
Implement the [Bulma message components][bd] as a [Yew][yew]
component. Document them and their properties and add an example
showcasing how it's used. Update the module tree to include the
message module and document the new additions to the crate.

[bd]: https://bulma.io/documentation/components/message/
[yew]: https://yew.rs

Fixes: #35
Signed-off-by: Filip Dutescu <[email protected]>
Add a `TypedChildren` derive macro, used to automate the need to
implement `From<T>` and `Into<T>` for component typed children.
Update all components that made use of typed children to use the new
macro.

In this context, typed children refer to children from an enum.

Signed-off-by: Filip Dutescu <[email protected]>
Implement the [Bulma modal components][bd] as a [Yew][yew]
component. Document them and their properties and add an example
showcasing how it's used. Update the module tree to include the
modal module and document the new additions to the crate.

Add a macro for making it easier to set all base component attributes.

[bd]: https://bulma.io/documentation/components/modal/
[yew]: https://yew.rs

Fixes: #36
Signed-off-by: Filip Dutescu <[email protected]>
@filipdutescu filipdutescu force-pushed the feat/component_elements branch from b9aacf5 to c9b8b0e Compare April 22, 2023 11:20
Add a `BaseComponent` which is tasked with adding all the base HTML
attributes that each component should expose. It takes a tag, children
and the base attributes. It also defines a new property, `attrs` which
contains the extra attributes that a component should have defined. This
includes non-standard ones, such as `data-*`.

Add some [ARIA attributes][aria] to the base properties. Modify the
`base_component_properties` to also implement `From<T>` for
`BaseComponentProperties`, in order to make it easy to pass the default
properties down to the `BaseComponent`. This is also implemented for a
reference to `T`.

This also updates all components and their examples.

[aria]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes

Fixes: #14
Signed-off-by: Filip Dutescu <[email protected]>
Fix the buttons example icons that use Material Symbols. The URL has
changed and the fix is to update it to the new version.

Signed-off-by: Filip Dutescu <[email protected]>
Implement the [Bulma menu components][bd] as a [Yew][yew] component.
Document them and their properties and add an example showcasing how
how it's used. Update the module tree to include the menu module and
document the new additions to the crate.

[bd]: https://bulma.io/documentation/components/menu/
[yew]: https://yew.rs

Fixes: #34
Signed-off-by: Filip Dutescu <[email protected]>
@filipdutescu filipdutescu force-pushed the feat/component_elements branch from c9b8b0e to bf0b186 Compare April 22, 2023 12:46
Implement the [Bulma panel components][bd] as a [Yew][yew] component.
Document them and their properties and add an example showcasing how
how it's used. Update the module tree to include the panel module and
document the new additions to the crate.

Update the `class` base component property to not be an `Option<T>` in
order to have a more intuitive API.

[bd]: https://bulma.io/documentation/components/panel/
[yew]: https://yew.rs

Fixes: #39
Signed-off-by: Filip Dutescu <[email protected]>
Some of the documentation comments from components, such as `Tabs` or
`Menu`, had various errors, from copy pasting, wrong namespace in use
etc. Correct all of the mistakes to ensure docs are generated properly.

Signed-off-by: Filip Dutescu <[email protected]>
Implement the [Bulma dropdown components][bd] as a [Yew][yew] component.
Document them and their properties and add an example showcasing how
how it's used. Update the module tree to include the dropdown module and
document the new additions to the crate.

[bd]: https://bulma.io/documentation/components/dropdown/
[yew]: https://yew.rs

Fixes: #33
Signed-off-by: Filip Dutescu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment