Giter Club home page Giter Club logo

elm-ui-explorer's People

Contributors

clarus avatar dependabot[bot] avatar derrickbeining avatar dseebacher avatar jgrenat avatar jouderianjr avatar jsdelivrbot avatar kalutheo avatar lemol avatar leojpod avatar lisardo avatar razzeee avatar theocar avatar vtsatskin 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  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  avatar  avatar  avatar  avatar  avatar

elm-ui-explorer's Issues

Flags?

Hi

We are trying this and seems really nice. However we pass some information to the app via flags (e.g. paths for assets).
It doesn't appear there is a way to pass flags, at least not with explore.
Is it possible, any examples?

Thanks

Consider displaying the story in the iframe?

Hi. Very nice project.

I've run into a problem with a component I have that uses the css display: fixed to take over the whole screen. The problem is that once it takes over the whole screen, there no way to click on the Elm UI Explorer "chrome". If the story was displayed in an iframe (like Storybook does), then it would only take over the iframe, and UI Explore menu and buttons would remain usable. I'd also like to make a plugin that displays the story inside various mobile device dimensions (instead of the entire page). I think that's only possible if the story is displayed in a frame (the iframe changes size depending on which device dimensions you choose).

Example:
image

Put config at the end of renderStories

The config (UIViewConfig) should be the last parameter of renderStories so that a user can call the app like this (without the need of intermediary function):

app
        [ ( "Default"
          , [ { id = "dropdown"
              , description = "A dropdown Menu"
              , viewStories = renderStories viewStoriesWrapper stories
              }
            ]
          )
        ]

Instead of (at the moment):

app
        [ ( "Default"
          , [ { id = "dropdown"
              , description = "A dropdown Menu"
              , viewStories = viewStories
              }
            ]
          )
        ]

viewStories config =
    renderStories config viewStoriesWrapper stories

Remove the story menu bar when only has 1 story

Hey, we are using elm-ui-explorer in our company and I was wondering about the possibility of removing the story menu bar only has 1 story. Some of our components only have 1 story, so I think it's makes sense to hide it when only have 1 story. What do you think about it?

I can do the PR if you agree to the idea.

Before

Screenshot 2020-07-20 at 20 07 02

After

Screenshot 2020-07-20 at 20 03 29

Note plugin viewEnhancer takes too few arguments

Was just trying to upgrade a project from 5.0.0 to 7.0.1, ran into an issue where I was using the Notes plugin as the viewEnhancer โ€• Elm is unhappy with this declaration:

viewEnhancer : ViewEnhancer {} Msg Model
viewEnhancer =
    UIExplorer.Plugins.Note.viewEnhancer
-- TYPE MISMATCH --------------------------------------------- src/Storybook.elm

Something is off with the body of the `viewEnhancer` definition:

49|     UIExplorer.Plugins.Note.viewEnhancer
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This `viewEnhancer` value is a:

    UIExplorer.Model {} Msg Model -> Html (UIExplorer.Msg Msg)

But the type annotation on `viewEnhancer` says it should be:

    ViewEnhancer {} Msg Model

Looks like the Note plugin had that signature at some point, but it was undone in this commit?

Upgrade to 0.19

We use this package for our project and I was wondering if there's any time estimation when it will be ready to be used with Elm 0.19?

Change UI and UICategory to opaque types

In order to avoid major version bumps when changing the model (even for not breaking changes), you should turn your exposed types to opaque types.

Here is the way to do it (for UI):

type UI
    = UIType InternalUI

type alias InternalUI =
    { id : String
    , description : String
    , viewStories : UIViewConfig -> Html Msg
    }

When a function needs a UI as parameter just do like this:

funcWithUI : UI -> String
funcWithUI (UIType ui) =
    ui.description

You don't have to change your current exposes (you have to expose UI and not UI(..), otherwise the type is not opaque anymore as anyone using the module can create a UI object like this: UIType {.....}

But you will have to create helper functions to create these opaque objects. Try to keep these functions small and atomic so that any change in the model won't force you to rewrite these helper functions. This way you won't have breaking changes, only new features ;)

Example for UI type, assuming a description is optional and defaults to empty string (you should turn it to a Maybe then, but let's assume it is a simple String for the example):

newUI : String -> (UIViewConfig> Html Msg) -> UI
newUI id viewStories =
    UIType {id = id, description = "", viewStories = viewStories}

withDescription : String -> UI -> UI
withDescription description (UIType ui) =
    UIType { ui | description = description }

Don't forget to expose these functions and to write a documentation for them ;)
And don't forget to separate your documentation in categories:

module UIExplorer exposing (app, renderStories, UI, UICategory, newUI, withDescription)

{-|
Component Explorers and Style Guides have been around for a while now.
We don't build pages anymore but components that are assembled together to build Systems.
In the ELM world, components are just called views, and are defined as pure functions.
ELM UI Explorer takes advantage of the composability and the purity of ELM and offers a way to showcase
your views and their states in a single tool.
Inspired by [React Storybook](https://storybook.js.org/)

# UIExplorer
@docs app, renderStories

# Models
@docs UI, UICategory

# UI Helpers
@docs newUI, withDescription
-}

Cannot run the music storybook

I did the following steps to start the music storybook:

elm-package install
cd examples/music-player
elm-package install
cd storybook
elm-package install
elm-app start

but got the following error:

Compilation failed.

Error in ./src/App.elm
Module build failed: Error: Compiler process exited with error Compilation failed
I cannot find module 'Storybook.Msg'.

Module 'StoryBook.Index' is trying to import it.

Potential problems could be:
  * Misspelled the module name
  * Need to add a source directory or new dependency to elm-package.json
 @ ./src/index.js 1:10-30

Customize the logo

I'm setting the UI Explorer to use it internally and I was trying to customize the logo, but the type only accepts string, what do you be able to pass an Html msg also? This way I could customize the way I want.

If you agree with the idea I could create a PR :)

Changing NoOp to ExternalMsg allows for having interactive stories.

I've been using elm-ui-explorer to implement an app using atomic design principle. It was perfect until I wanted to test basic interactivity. By default all Html messages are mapped to NoOp. It is surprising because simply by wrapping them with ExternalMsg interaction works honoring the update function defined in the config.

Do you think it is ok to have Html.map ExternalMsg instead of (\_ -> NoOp)?

Difficulty figuring out how to make Knobs plugin work for multiple UIs/stories

The example given for the knob plugin only shows wiring up a single story. I'm trying to figure out how to wire it up for many categories, UIs, and stories so they all have their own knobs and knob state. It's unclear to me how this is intended to be achieved within config.viewEnhancer. Am I supposed to use model.selectedCategory, model.selectedUIId, and model.selectedStoryId to determine which story is currently selected and therefore which arguments to pass to viewKnobsForUI?

Disable color mode button

The current design I'm working on doesn't have any dark mode support. Do you think it makes sense be able do remove the button from the header?

I'm glad to do the PR if you agree.

Less invasive CSS framework?

Bluma is cool however I find that it pollutes the namespace if you are using something else. Meaning it effects the buttons and other primative HTML tags so that they'll look different than they would outside of the UI-explorer.

I think some alternative would be:

  • Tachyons, it doesn't effect the HTML primitives much and it would be quick for me to switch it over if you want.
  • Inline CSS. This is good because it doesn't bleed out probably.
  • Styled elements, Elm CSS, raw CSS: just write a custom theme which is more effort but as long as you namespace your CSS classes well it shouldn't affect the internals

Maybe allow spaces in storiesOf

If I add a space into storiesOf the navigation will be broken e.g.

storiesOf "Checkout Widget"

Same for the labels in the tuple

[  ( "Not loaded", \_ -> GreatUI.viewLoading, {} )

Would be great if this could handle labels with spaces and not just ids.
Thanks

Consider a mechanism to query elm-ui-explorer for all story URLs?

We are considering this project to replace our storybook usage simply because the maintenance of the JS dependencies in storybook is larger than expected. Furthermore, it would remove the need to write some JS interop code to let the elm work inside storybook.

While a translation to elm-ui-explorer would be quite simple, for the internal testing of the UI components we would like to use visual testing of the stories. We can specify the list of URLs manually but I was curious if we couldn't just query them from elm-ui-explorer directly because all categories and stories are already defined?

Replace css cdn to the new one in examples

For examples in exaplorer's index.html
https://rawgit.com/kalutheo/elm-ui-explorer/tailwindcss/assets/styles.css
returns 404.
The right one is
https://cdn.rawgit.com/kalutheo/elm-ui-explorer/master/assets/styles.css

UIExplorer not exposing types

When I try to write the following code

viewStories : UIExplorer.UIViewConfig -> Html.Html UIExplorer.Msg
viewStories =
    renderStories render stories

The compiler throws an error saying UIExplorer does not expose Msg. Is there a way to write type annotation for this case?

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.