GithubHelp home page GithubHelp logo

getspacetime / makani Goto Github PK

View Code? Open in Web Editor NEW
61.0 6.0 5.0 45.3 MB

Collection of UI components built specifically for .NET MAUI Blazor

License: MIT License

C# 28.67% HTML 60.90% CSS 7.73% JavaScript 2.70%
blazor blazor-ui-components dotnet maui-blazor tailwindcss component-library components wasm blazor-components blazor-server blazor-webassembly csharp

makani's Introduction

Build nuget nuget GitHub stars last commit Discord

๐Ÿ–๏ธ makani

Headless UI Components for Blazor.

Note This repository is now archived. All future development will take place in Pure Blazor Components.

  1. Why Makani
  2. Getting Started
  3. Contributing
  4. Live Documentation
  5. Roadmap & Components

Why Makani?

Makani was born based on the need for lightweight, performant, and customizable UI components for .NET MAUI Blazor. Makani is built on the wonderful CSS framework, Tailwind CSS. While a simple theme will be included, the hope is that the community is able to customize the theme to fit their needs.

The main focus of the Makani library is to provide a powerful set of components that work flawlessly with .NET MAUI Blazor.

๐Ÿ—๏ธ Design Principles

  • Built first and foremost for .NET MAUI Blazor
  • Components should be easy to customize
  • Components should be composable, extensible, and performant
  • Always listen to the community

โš ๏ธ This library is currently under active development. You may experience bugs, breaking changes, or missing functionality.

๐Ÿš€ Getting Started

Quick Start

1. Install via NuGet

dotnet add package Makani

2. Update your _Imports.razor

@using Makani

3. Add Makani

builder.Services.AddMakani();

4. Add Static Assets

<head>
    <link href="_content/Makani/dist/makani.css" rel="stylesheet" />
</head>

5. Build away!

<MkButton Color="MkColor.Primary">Hello world!</MkButton>

Using Syntax Highlighting

The syntax highlighting component is an optional feature. If you don't need this feature, skip this section and avoid loading the additional resources.

Makani is using Prism for syntax highlighting, so if you need this component, a few more steps are needed.

In your index.html, add only one of the following themes to the <head>...</head> section:

<!-- vscode-dark-plus is the one used in the Makani docs -->
<link href="_content/Makani/css/vscode-dark-plus.css" rel="stylesheet" />

<!--<link href="_content/Makani/css/atom-dark.css" rel="stylesheet" />
<link href="_content/Makani/css/coy.css" rel="stylesheet" />
<link href="_content/Makani/css/okaidia.css" rel="stylesheet" />
<link href="_content/Makani/css/tomorrow-night.css" rel="stylesheet" />-->

Add the following JS to the end of the <body>...</body> section:

<script src="_content/Makani/prism.js"></script>

Further Customization with Tailwind

At the core of this library is the ability to customize components using Tailwind CSS. For further customization, extra steps are required:

  1. Install the Tailwind CLI

In the wwwroot of your application, follow the Tailwind CLI installation

  1. Configure .razor and your index.html files in tailwind.config.js

Example

module.exports = {
  content: ["../**/*.razor", "../*.razor", "index.html"],
  theme: {
    extend: {},
  },
  plugins: [],
}
  1. Update your .csproj file to run the Tailwind CLI

Example

<Target Name="NpmInstall" BeforeTargets="BeforeBuild">
    <Exec WorkingDirectory="wwwroot" Command="npm install" />
</Target>

<Target Name="Tailwind" DependsOnTargets="NpmInstall" BeforeTargets="Build">
    <Exec WorkingDirectory="wwwroot" Command="npx tailwindcss -i app.css -o ./dist/styles.css" />
</Target>
  1. Add the CSS to your index.html
<head>
    <link href="dist/styles.css" rel="stylesheet" />
</head>

Performance / Benchmarks

Providing a lightweight and performant component library is a major goal of this project.

Area Target Actual Passing
DLL Size 200kb 26.4kb โœ”๏ธ
JS Bundle Size 10kb 392b โœ”๏ธ
CSS Bundle Size 50kb 4.6kb โœ”๏ธ
Time to Interactive 1s 0.6s โœ”๏ธ
Total Blocking Time 200ms 140ms โœ”๏ธ
Cumulative Layout Shift 0 0 โœ”๏ธ
First Contentful Paint 0.5s 0.3s โœ”๏ธ
RAM Usage TBD
CPU Usage TBD
First Input Delay TBD

The targets specified are only initial estimates and are open to change over time based on a reasonable standard.

Sources

Accessibility

A UI component library isn't helpful if it isn't useful to everyone.

TBD

Contributing

We encourage you to contribute! People of all ages / occupations / experience are welcome.

Please read the Contribution Guidelines for how to proceed.

makani's People

Contributors

codymullins avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

makani's Issues

Radio component

  • Light mode
  • Dark Mode
  • Labels
  • Auto-generated ID
  • Validation - choose at least one option

docs: mobile friendly nav

We're currently hiding the navigation on the docs page for small screens. We need to have navigation for the docs page that works for mobile.

image

image

image

image

Card component

Acceptance Criteria

  • Component API design
  • Should accept an optional card title
  • Should accept a card body
  • Should accept an optional card footer
  • Should accept an optional image (placed at top or left)
  • Styling is optional

Modal component

Good first issue for a more experienced dev.

  • Modal Service (see: ToastService as a possible start)
  • Other Modal implementations seem to have performance issues in some cases, especially on MacOS when using .NET MAUI. Modal performance should be tested in this scenario (e.g. minimal delays, no pixelated shadows)
  • Spacetime API Client had a version of this but has since been removed. May be useful to reference.
    - Alert.razor
    - Modal.razor

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog

toast service: assertions for removing based on time are failing

In ToastServiceTests.cs the assertions in AddToast_ShouldRemoveMessages to check if items are being removed are failing on the server. They pass locally "works on my machine".

Need to dig in and see why they're failing and potentially better way to test this.

docs: title of docs page is "Dark mode disabled"

The title of the Docs page is "Dark mode disabled" - this started appearing when the MkDarkModeToggle was added. We're using this title in the SVG as the caption for accessibility.

Need to find out:

  1. Why the addition to the SVG causes this?
  2. What is the fix?
  3. Does the SVG code need to change?

image

TextField component

  • Basic input field light/dark theme
  • Data binding a value
  • Built in validations
    • Required
    • Numbers only satisfied by regex validator
    • Min number / Max number
    • Min length / Max length
    • Regex
    • Email* probably not now, but should be covered by regex support
    • Phone* probably not now, but should be covered by regex support
  • Validation hooks for custom / a la carte validations new issue: #49
  • Error state
  • Debounce / rate limiting
  • Helper text
  • Placeholder text
  • #51
  • Adornments new issue: #50
  • Labels
    • Default
    • Floating

syntax highlighter: support dark theme switching

The current implementation of the syntax highlighter does not support switching to a light theme when the overall theme of the library changes.

  • Add Parameter AutomaticDarkMode
  • AutomaticDarkMode should default to false and be opt-in since this introduces more JS and could have a minor impact on performance.
  • If AutomaticDarkMode is true, the component should automatically switch between light/dark themes.
  • Add parameter to manually specify dark vs light mode.
  • This parameter should default to dark mode.

Outstanding questions

  • Prism, the library behind the syntax highlighter component, utilizes the presence of the CSS on the index.html page. Need to investigate the best way to integrate this appropriately.
  • There could be an opportunity to better support theming. Themes in general utilize this CSS on the index page.

docs: side nav should be sticky so you can always navigate, even when scrolling

The docs page is being used to "dog food" the new sidebar component. This would

  1. Add support to the docs page sidebar to always float along the page
  2. Optionally, build this support into the sidebar. (this can be done later as a separate issue)

Notes

  • Can this be done with only Tailwind / CSS?
  • If JS is required, need to document the impact of including this and potentially making it "opt-in"

image

Screen Shot 2022-06-20 at 6 52 56 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.