Commit Graph

95 Commits

Author SHA1 Message Date
Katie Hughes
b6a9b04ad2 Add SegmentedControl to the Inputs category too 2020-05-26 11:07:39 -07:00
Katie Hughes
36c4163943 Rename Toggle to Select in example and remove prefix 2020-05-26 11:06:16 -07:00
Katie Hughes
deb9e60067 Rename to clarify roles 2020-05-22 11:31:13 -07:00
Katie Hughes
f0d57573d4 Unify toggle select into one 2020-05-22 11:28:37 -07:00
Katie Hughes
6b2cabe74e Use v9 in the example 2020-05-22 11:22:38 -07:00
Katie Hughes
0a32833c29 Format 2020-05-22 08:44:20 -07:00
Katie Hughes
fd26b1e508 Detangle example state 2020-05-22 08:44:20 -07:00
Katie Hughes
8d2d77d75d Add optionallySelected to example state 2020-05-22 08:44:20 -07:00
Katie Hughes
80955205db Add a segmented control with an optional selection very lazily 2020-05-22 08:44:20 -07:00
Tessa Kelly
6d5184137f Adds Example type annotations 2020-03-31 16:35:17 -07:00
Tessa Kelly
de82a5c4ab Adds back in subscriptions 2020-03-31 16:35:17 -07:00
Tessa Kelly
dc9ed8ba7b Uncomment all the states 2020-03-31 16:35:17 -07:00
Tessa Kelly
5d1fb3c5ba Change category modeling to allow presence in multiple categories 2020-03-23 17:48:53 -07:00
Tessa Kelly
2b87eb84df 🎨 Pull Category out into its own module 2020-03-23 17:33:42 -07:00
Gavin Panella
28d36c6f64 Revert "Merge pull request #461 from NoRedInk/puffins/prepare-for-merge"
This reverts commit 4373c78d82, reversing
changes made to 6b78075f02.
2020-03-06 20:00:34 +01:00
Stoeffel
873f0ef521 move files into subdirectory 2020-03-02 10:45:03 +01:00
Brian Hicks
45574578ca remove duplicate IDs/active selectors in segmented control 2019-11-15 17:09:25 -06:00
Tessa Kelly
8360b1d387 Vary the icons used in the example 2019-10-24 13:23:52 -07:00
Tessa Kelly
8a52b74149 Show varied icons on the segmented control examples 2019-10-24 12:29:21 -07:00
Tessa Kelly
1622e09d7c Adds support for a different-colored svg 2019-10-24 11:29:27 -07:00
Tessa Kelly
ab6dab8926 Adds segmented control v8 2019-10-24 11:09:30 -07:00
Katie Hughes
753e34a272 fix some axe complaints 2019-09-16 16:08:08 -07:00
Katie Hughes
f4575fbac4 Add an example to the styleguide for the segmented toggle 2019-09-11 10:37:19 -07:00
Tessa Kelly
eb53f7661b Use avh4/elm-debug-controls 2019-07-30 12:55:55 -07:00
Aaron VonderHaar
1c75f4ab6d Add aria tabpanel to SegmentedControl.V7 2019-06-04 17:47:27 -07:00
Aaron VonderHaar
8e04ea9771 Add flexibility to SegmentedControl example 2019-06-04 16:01:20 -07:00
Aaron VonderHaar
75b6e8a9ee Remove id attribute from SegmentedControl.V7 2019-06-04 14:47:01 -07:00
Aaron VonderHaar
b05eefd421 Copy Nri.Ui.SegmentedControl.V7 from V6 2019-06-04 14:35:01 -07:00
Tessa Kelly
2bd5ccb61f filename -> name 2019-05-03 09:56:43 -07:00
Tessa Kelly
8e4bf3c412 Standardize the module example naming 2019-05-03 09:54:34 -07:00
Tessa Kelly
c21cee42e2 Behaviors -> widgets 2019-05-03 09:30:02 -07:00
Luke Westby
c1ff19f0d0
Add Html.Styled versions for everything (#139)
* make html.styled versions of remaining widgets

* upgrade all the examples

* change license name
2018-10-23 09:55:30 -07:00
Michael Glass
70d214957c
run elm-format 2018-09-26 16:02:28 +02:00
Juan Edi
9c06eff3f0 Fix elm-docs 2018-09-10 12:19:55 -03:00
Juan Edi
b600af7bbe Styleguide allows to toggle width settings for SegmentedControl 2018-09-10 12:19:15 -03:00
Juan Edi
265b83c393 Options for SegmentedControl's width: FitContent | FillContainer
Until V4 the control would always fit its contents. On V5 that behaviour was
changed to always fill the container. This means that to limit the element's
width one had to limit the value of its container (which might be hard to do
when the labels of the tabs are unknown or might change).

We now support both settings, and the user has to decide what to do for each use
case.
2018-09-10 11:56:26 -03:00
Juan Edi
7c3c2966be Nri.Ui.SegmentedControl.V6 now uses Html.Styled 2018-09-10 11:32:08 -03:00
Juan Edi
6bee811648 Create SegmentedControl.V6 (copy of V5 for the moment) 2018-09-10 11:07:11 -03: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
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