Commit Graph

221 Commits

Author SHA1 Message Date
Brooke
35e1473ad4 add text input to styleguide app 2018-05-29 10:52:39 -07:00
Marica Odagaki
87792bedff Combine autoResize and minimumHeight into height
Writing the changelog drove home the fact that minimumHeight
only makes sense when the textarea is set to auto-resize.
2018-05-23 17:41:49 -08:00
Marica Odagaki
e0596c1159 Fix the bug where scrollHeight gets padded if we use auto 2018-05-23 17:41:49 -08:00
Marica Odagaki
03ffe17413 Look at computed min-height before falling back to computed height
Now that min-height is specified through an auto-generated class,
it's not available through the element's style attribute.
2018-05-23 17:41:49 -08:00
Marica Odagaki
80695f1cbe Autoresize textarea upon initialization 2018-05-23 17:41:49 -08:00
Marica Odagaki
942865b140 Make it easier to specifiy the minimumHeight while reducing freedom
If we want to allow specifying arbitrary height as the minimum height
in the future, it could be added as `Custom someUnit` in the future.
2018-05-23 17:41:49 -08:00
Jasper Woudenberg
fee5596960 Fix TextArea example 2018-05-18 11:23:32 +02:00
Jasper Woudenberg
2a77a03efc Migrate TextArea.V2 to Html.Styled
This does not actually migrate the styles themselves yet, it just
changes the Html type of the `TextArea` exposed from the module.
2018-05-18 10:35:31 +02:00
Jasper Woudenberg
716efba4dd Use TextArea.V2 in styleguide app 2018-05-18 10:17:51 +02:00
Jasper Woudenberg
93f101abaf
Merge branch 'master' into ink--upgrade-text 2018-05-17 08:38:47 +02:00
Tessa Kelly
3253e3466d Add V2 of Nri.Ui.Text using Html.Styled 2018-05-16 17:09:17 -07:00
James Gary
e89d96e2a9 Add mastery badge icon svg 2018-05-16 16:27:17 -07:00
James Gary
e443ddb7a9 Merge branch 'master' of github.com:NoRedInk/noredink-ui into ink-james--add-mastery-badge-icon 2018-05-15 12:11:51 -07:00
Michael Glass
6132797f8c
move styleguide images to lfs 2018-05-12 13:50:01 +02:00
James Gary
37c4d95bc3 Add mastery badge icon 2018-05-11 13:39:15 -07:00
Jasper Woudenberg
75cfeb731b
Merge branch 'master' into add-icons-to-styleguide 2018-05-04 13:51:11 +02:00
Jasper Woudenberg
eec2962006 Only store images in git lfs 2018-05-04 13:44:30 +02:00
Jasper Woudenberg
fa34fd7bd4 Pull in new changes from the monolith
Also add a `noPermission` page.
2018-05-03 14:32:26 +02:00
Jasper Woudenberg
d6a10d1ed4 Merge branch 'master' into extract-nri-page 2018-05-03 14:19:22 +02:00
Jasper Woudenberg
44c58c2bc0 Merge branch 'master' into table-v2 2018-05-03 09:39:18 +02:00
Jasper Woudenberg
03c460f80e Add icons to styleguide application 2018-05-02 10:46:44 +02:00
Jasper Woudenberg
f8bd18a8a0 Add Nri.Ui.Page.V1 to styleguide 2018-05-01 17:34:16 +02:00
Jasper Woudenberg
14fd3c142e 🎨 elm-format 2018-04-30 13:24:03 +02:00
Jasper Woudenberg
dcf42a0f37 Nri.Table example uses latest Button module 2018-04-30 13:16:36 +02:00
Jasper Woudenberg
1edf7da0ab Add buttons to the styleguide 2018-04-30 13:14:20 +02:00
Jasper Woudenberg
72a4a1c5e6 elm-format 2018-04-25 19:29:22 +02:00
Jasper Woudenberg
8f344774c3 Switch Table.V2 over to Html.Styled
This is probably better then relying on more deprecated elm css
functionality, like we were before.
2018-04-25 19:25:34 +02:00
Jasper Woudenberg
de10ffb43e New table version that takes any css width
This way you're not limited to creating tables with fixed-width columns.
This also makes the table take up the maximum available width space by
default.
2018-04-25 19:10:34 +02:00
Jasper Woudenberg
4c8f2cae89 Add keyframe animations to styleguide example
Also provide a function for easily embedding said keyframes into a page.
2018-04-24 18:36:37 +02:00
Jasper Woudenberg
e950661c8b Add Table to the styleguide application 2018-04-24 17:49:29 +02:00
Hardy Jones
1647b2f358
Make selects expand to the full width of parent
There are places where we need the select to be as wide as possible.
Since it seems like a sensible default to have all the selects expand,
we take that approach.

If we find out that this is harder, we can release use the old version.
2018-04-18 07:58:19 -07:00
Hardy Jones
5036c63e28
Merge branch 'master' into extract-select 2018-04-17 07:56:22 -07:00
Hardy Jones
4977d00361
Style the selector
We need some styling that was implicit in the monolith.
2018-04-16 15:50:28 -07:00
Hardy Jones
bffaae0e3f
Extract Nri.Select from the monolith 2018-04-16 15:43:01 -07:00
Hardy Jones
199689abd0
Style the dropdown 2018-04-16 13:12:17 -07:00
Hardy Jones
1b86ec442f
Extract Nri.Dropdown to noredink-ui
There are a couple of minor differences here.
Some of the dependencies we had were inlined.
_Should_ be no behavioral changes though.
2018-04-16 12:19:43 -07:00
James Gary
a4d3448b47 Add skip icon 2018-04-04 09:34:42 -07:00
Tessa Kelly
eb3d9f038c Adds sumitting, rating, and revising helpers 2018-04-02 17:17:42 -07:00
Tessa Kelly
1d28d9c617 :bowtie: move assignment type icons to the assignment type section 2018-04-02 17:10:32 -07:00
Hardy Jones
e5a56486d7
Allow segmented control to expand to parent's width
We want to allow the control to take up the full width of the parent.
This will most likely break something if you try to upgrade directly.
Should be fixable by putting the control in an element with
the appropriate width.
2018-03-30 09:10:33 -07:00
Hardy Jones
d4d6991643
Style the segmented control tabs directly
tl;dr; Use a class for each variant instead of overriding one variant.

Before, we relied on CSS specificity in an unclear way.
The `Focused` class was applying properly because it was ordered later
than the `Tab` class in the stylesheet.
The ordering that is important is the ordering in `styles` value.
Since `elm-css` generates the stylesheet in the order of the lists,
the `Focused` rule would be generated after the `Tab` rule.
Meaning the `Focused` rule would take precedence over the `Tab` rule
if an element had both classes as it was defined later in the stylesheet.

There are some concerns with this approach:
1. It's not readily apparent that the ordering in `styles` is important.
    It is pretty easy to change the ordering of the list
    and have it break the styling.
2. We rely on `elm-css` to generate the stylesheet in a specific order.
    If it changes the order of rules it generates,
    we're almost surely going to break the styling.
3. Altering styles for tabs that are not focused is even less intuitive.
    Since the specificity is the same,
    you might not know why a given rule applies (or doesn't apply).

Rather, we can eschew the specificity/precedence issues
by applying a different class to each tab.
The stuff that is the same can stay on the `Tab` class,
and the stuff that differs can be on different classes.

We are now able to set the background color for `Unfocused` tabs.
We were relying on the control being placed atop a white background.
When we moved to using the control atop a non-whitebackground,
it showed that the `Unfocused` tabs had a transparent backround.
All of our designs show `Unfocused` tabs with a white backround.

See https://github.com/NoRedInk/noredink-ui/pull/14 for more information.
2018-03-30 09:10:33 -07:00
Hardy Jones
55ce63dbfc
Fix filename
The style guide is currently for V4.
2018-03-30 09:10:33 -07:00
Jasper Woudenberg
6e041d9364 Styleguide uses latest Icon / SegmentedControl 2018-03-29 12:58:41 +02:00
Hardy Jones
fb2dbbfb47
Extract updated segmented control from the monolith
This version is like `Nri.Ui.SegmentedControl.V1` with the icon changes.
It has the fix for `box-sizing`.

All the other caveats from `Nri.Ui.SegmentedControl.V1`
(if there were any) apply here as well.
2018-03-28 18:20:58 -07:00
Hardy Jones
0a75e8229b
Extract Nri.Icon from the monolith
The recommendation is to break the styles API rather than the view API
when moving something out of the monolith into this repo.

`Nri.Icon` is not really setup for that sort of breakage.
If we would prefer to have the styles break rather than the view,
that will take more work.
Work that can be done independent of the extraction.

The transition in the monolith ought to look something like:

```elm
module Nri.Icon exposing (..)

import Html exposing (Html)
import Nri.SvgSprite
import Nri.Ui.Icon.V1 exposing (Assets, IconType)

icon : { alt : String, icon : IconType } -> Html msg
icon config =
  Nri.Ui.Icon.V1.icon assets

assets : Assets {}
assets =
  { activity = Nri.SvgSprite.activity
  , arrowDown = Nri.SvgSprite.arrowDown
  , attention_svg = Nri.Assets.attention_svg
  ...
  }
```

So hopefully, the change is still very small on the monolith side.

There's maybe a bigger concern than which API breaks.
`Nri.Icon` has some behavior for a11y.
We could definitely change the internals over during the extraction.
But, since all of these changes are value-level changes,
it's very likely that we'll break something in the process.
That's a bigger concern because instead of affecting
the handful of Engineers working at NRI,
we would be affecting the millions of people using the site.

We shouldn't fear making those kinds of changes.
However, we should make them when we can give them the appropriate
attention they deserve.
Not when one person is trying to move as fast as possible to avoid
race conditions of moving modules between repos.
2018-03-28 18:20:16 -07:00
Hardy Jones
349e9760a3
Use V2 of the segmented control in the style guide 2018-03-26 19:56:20 -07:00
Hardy Jones
3b99ba56a7
Add SegmentedControl 2018-03-23 19:05:34 -07:00
Tessa Kelly
e869f064ff Adds new version of the checkbox 2018-03-19 15:55:04 -07:00
Tessa Kelly
98a8a5458c Remove dependency on nri-elm-css 2018-03-16 17:33:24 -07:00
Tessa Kelly
63d7178b32 🐛 fix duplicated package install (not sure how this every worked 😬:) 2018-03-16 17:33:24 -07:00
Tessa Kelly
e7b5d0e878 Nri.Colors -> Nri.Ui.Colors.V1 2018-03-16 17:33:24 -07:00
Tessa Kelly
ef390c606c Nri.Fonts -> Nri.Ui.Fonts.V1 2018-03-16 17:15:03 -07:00
Tessa Kelly
4ca27fc05c 🎨 clean up example code styles 2018-03-16 16:24:29 -07:00
Tessa Kelly
f9c3884e6a Adds Colors 2018-03-16 16:24:29 -07:00
Tessa Kelly
186a19e7f4 Adds user generated font style 2018-03-16 16:24:09 -07:00
Tessa Kelly
c406c5353d Adds Fonts as a category 2018-03-16 16:24:09 -07:00
Tessa Kelly
7f7826bcae Display the Fonts 2018-03-16 16:24:09 -07:00
Jasper Woudenberg
cf2dec09fd Add text area for content creation
The styling used for this textarea is not quite the same as the one of
the default or writing textareas currently in use.
2018-03-13 10:08:07 +01:00
Jasper Woudenberg
f19903e3d3
Merge pull request #5 from NoRedInk/update-textarea
Update textarea
2018-03-12 20:04:18 +01:00
Tessa Kelly
12ed44549e Adds missing smallHeading example 2018-03-07 14:38:32 -08:00
Tessa Kelly
e3edcafc15 Adds the ugMediumBody and ugSmallBody to the examples 2018-03-07 14:37:21 -08:00
Jasper Woudenberg
12dd71a68d Merge branch 'master' into update-textarea 2018-03-02 09:45:27 -08:00
Stoeffel
b9c913ec19 rename to Writing and use Html.Styled 2018-03-01 13:37:58 -08:00
Jasper Woudenberg
2f92a1ec4a Add TextArea to styleguide 2018-02-28 16:22:48 -08:00
Stoeffel
168bf35682 upgrade styleguide-app to latest version of elm-css 2018-02-28 14:18:52 -08:00
Stoeffel
c8d9d6cc09 update style guide 2018-02-28 14:04:22 -08:00
Jasper Woudenberg
8ea6b7360a Include text styles in example 2018-02-21 15:49:12 +01:00
Jasper Woudenberg
892b238aaa Add instructions on starting the styleguide app 2018-02-20 15:19:42 +01:00
Jasper Woudenberg
2748dcdf8f Add Muli font 2018-02-20 15:19:32 +01:00
Jasper Woudenberg
9614fe8e91 Remove and .gitignore elm.js
This is a compilation artifact.
2018-02-20 15:09:29 +01:00
Brooke
0c33c83d73 add mini styleguide for ui components 2018-02-12 13:32:38 -08:00