• Stars
    star
    171
  • Rank 216,119 (Top 5 %)
  • Language
    Elixir
  • License
    MIT License
  • Created over 3 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Moon Design System for Elixir

Moon Design System

Set of UI components built with Surface UI library and Tailwind CSS

Conventional Commits semantic-release

Moon Design System

Note: This project uses semantic-release and conventional-commits spec, please use Commitizen to write commit messages

Resources

πŸ“– Documentation

Setup

Clone the repository: git clone [email protected]:coingaming/moon.git

Start local development server by running run-locally-dev.sh

If ./run-locally-dev.sh is not working, try the following steps:

  1. Install asdf and plugins asdf plugin add erlang
    asdf plugin add elixir
    asdf plugin add nodejs

  2. Run asdf install. This will install all the tool versions specified in the .tool_versions file Or you can install each tool version manually by typing: asdf install erlang # and follow https://github.com/asdf-vm/asdf-erlang#asdf-erlang on fail (e.g. export KERL_CONFIGURE_OPTIONS="--without-wx --without-javac") For fixing error "OTP compiled without EEP48 documentation chunks" u can use KERL_BUILD_DOCS=yes asdf install elixir
    asdf install nodejs

  3. Install assets dependencies with cd assets && npm i && cd -

  4. Try running iex -S mix phx.server

  5. Stop the command above, then try running ./run-locally-dev.sh

  6. If you do see error in ElixirLS extension "no elixir command found", you'll need to cp .tool-versions ~

Install dependencies: mix deps.get

To format your code, run mix format , mix surface.format

Running .run-auto-importers.sh

This script imports figma assets and icons. You need to set the values in the .env file. You also need read access to the assets tool repo https://github.com/coingaming/assets Kindly check if you can clone this repo, if not, ask YulianaYarema @yarema184

Tests

All newly added components must come with tests. In order to run the tests, run mix test

Creating new component

There is a mix task/generator for it. For creating new component Moon.Design.Form.SomethingAwesome use following command: mix moon.gen.component Form.SomethingAwesome It will create component, page and give instructions what to insert to router & left menu

Preferences to consider when writing code

In writing code try to remember following rules:

  1. Code should be as short and simple as possible (less lines is better)
  2. Code should be as explicit as possible (and compiler should catch as many errors as possible)
  3. Moon Design System follows headless design approach - emphasis is on building smart, functional and reusable UI components.
  4. Use slots
  5. Add and run tests
  6. Create component's page in moon_web application with API described and state shown
  7. Use following classes for TW-way styling:
    • Use Moon classes for: (see ds-moon-preset.js for full list of variables, and themes/moon-design-*.css for values)
      • font sizes
      • border-radius - rounded-moon-{s - big elements, e.g cart, i - interactive, e.g button}
      • shadows
      • font-weight - only 2
    • Use TailWind classes for following reasons
      • transition
      • breakpoints - @media
    • And do not forget to use RTL features
      • use rtl: and ltr: prefixes for according write-direction styles
      • use ps & pe instead of pl & pr accordingly
alias Moon.Components.TextInput
alias Moon.Assets.Icons.IconCloseRounded
alias Moon.Assets.Icons.IconZoom

<TextInput placeholder="Search for dashboard, segments and more">
  <:left_icon>
    <IconZoom>
  </:left_icon>
  <:right_icon>
    <IconCloseRounded on_click="clear_search">
  </:right_icon>
</TextInput>
mix test

More Repositories

1

moon-design

Moon Design System for React
TypeScript
268
star
2

moon_flutter

Moon Design System for Flutter
Dart
67
star
3

defnamed

compile-time named arguments for Elixir functions and macros
Elixir
19
star
4

exprotobuf2

exprotobuf with renamed Protobuf module
Elixir
15
star
5

elixir-test

12
star
6

money-elixir

Elixir
12
star
7

live_store

Elixir
11
star
8

crystal

Elixir wrapper around Gradualizer
Elixir
10
star
9

asset_import

Elixir
9
star
10

ex_env

Elixir
8
star
11

lnd-client

Lightning Network Daemon (LND) client library for Haskell
Haskell
8
star
12

comparable

Comparable Elixir protocol
Elixir
7
star
13

gen_enum

Better enumerations support for Elixir and Ecto
Elixir
7
star
14

moon-light

TypeScript
7
star
15

boot_env

configuration provider to load and validate immutable application configs during boot process
Elixir
6
star
16

Hub88-Examples

Examples of code to interact with Hub88 API
5
star
17

loggable

Protocol for custom views of data in logs (hide sensitive data etc)
Elixir
5
star
18

bb2tcp

Byteball to TCP proxy
JavaScript
5
star
19

readable

read type class families
Elixir
4
star
20

signable

Deterministic serialisation and signatures with proto-lens and protobuf-elixir support
Haskell
3
star
21

semantic-release-elixir

Semantic Release for Elixir apps
JavaScript
3
star
22

devtools

Elixir
2
star
23

phoenix_view_assets

Elixir
2
star
24

bennu

Component system and rendering engine for Phoenix and LiveView
Elixir
2
star
25

hub88-devops-challenge

2
star
26

moon-icons-react

Moon Design System react icons
TypeScript
2
star
27

comparable_decimal

Comparable (Ord) protocol implementation for Decimal type
Elixir
1
star
28

node-money

TypeScript
1
star
29

phoenix_live_view_singleton

JavaScript
1
star
30

moon-icons

Moon Design System icons
Elixir
1
star
31

currency-config

JavaScript
1
star
32

hub88-fe

Hub88 Frontend Developer Challenge
1
star
33

elixir-liveview-test

1
star
34

trading-team-orb

Shell
1
star
35

trendy

LangChain Agents for Github trends
Python
1
star