mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-09-17 10:17:09 +03:00
Rename folders to component catalog
This commit is contained in:
parent
66181bbbc1
commit
abb1423165
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1 +1 @@
|
||||
styleguide-app/assets/images/** filter=lfs diff=lfs merge=lfs -text
|
||||
component-catalog-app/assets/images/** filter=lfs diff=lfs merge=lfs -text
|
||||
|
4
.github/pull_request_template.md
vendored
4
.github/pull_request_template.md
vendored
@ -45,7 +45,7 @@ Please link to any relevant context and stories.
|
||||
- [ ] I've gone through the relevant sections of the [Development Accessibility guide](https://paper.dropbox.com/doc/Accessibility-guide-4-Development--BiIVdijSaoijjOuhz3iTCJJ1Ag-rGoHpC91pFg3zTrYpvOCQ) with this component in mind
|
||||
- [ ] Component has clear documentation
|
||||
- [ ] Component is in the component library example app
|
||||
- [ ] Component is categorized reasonably (see [Category](https://github.com/NoRedInk/noredink-ui/blob/master/styleguide-app/Category.elm) for all the currently available categories). The component can be in multiple categories, if appropriate.
|
||||
- [ ] Component is categorized reasonably (see [Category](https://github.com/NoRedInk/noredink-ui/blob/master/component-catalog-app/Category.elm) for all the currently available categories). The component can be in multiple categories, if appropriate.
|
||||
- [ ] Component has a representative preview for the component library example cards (bonus points for making it delightful!)
|
||||
- [ ] Component has a customizable example. Aim for having _every_ possible supported version of the component displayable through the configuration on this page. (Protip: This is handy for testing expected behavior!)
|
||||
- [ ] The customizable example produces sample code
|
||||
@ -54,7 +54,7 @@ Please link to any relevant context and stories.
|
||||
- [ ] Component is tested
|
||||
- axe checks and percy snapshots will be automatically added for every component. However, if you want to customize _when_ the checks and snapshots are made, you will need to make changes to [script/puppeteer-tests.js](https://github.com/NoRedInk/noredink-ui/blob/master/script/puppeteer-tests.js).
|
||||
- there are 2 ways to add Elm tests:
|
||||
- if you want to test the styleguide example directly, add ProgramTest-style tests under `styleguide/tests`
|
||||
- if you want to test the component-catalog example directly, add ProgramTest-style tests under `component-catalog/tests`
|
||||
- if you want to test the component directly, add tests under `tests/Spec`. Historically, this has been the more popular Elm testing strategy for noredink-ui.
|
||||
- [ ] Component API follows standard patterns in noredink-ui
|
||||
- e.g., as a dev, I can conveniently add an `nriDescription`
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,7 +7,7 @@ elm-stuff
|
||||
repl-temp-*
|
||||
|
||||
### Styleguide App
|
||||
styleguide-app/bundle.js
|
||||
component-catalog-app/bundle.js
|
||||
|
||||
### Emacs ###
|
||||
# -*- mode: gitignore; -*-
|
||||
|
@ -1,4 +1,4 @@
|
||||
elm-stuff/
|
||||
src/
|
||||
styleguide-app/
|
||||
component-catalog-app/
|
||||
tests/
|
||||
|
42
Shakefile.hs
42
Shakefile.hs
@ -26,7 +26,7 @@ main = do
|
||||
shakeLintIgnore =
|
||||
[ "node_modules/**/*",
|
||||
"elm-stuff/**/*",
|
||||
"styleguide/elm-stuff/**/*"
|
||||
"component-catalog/elm-stuff/**/*"
|
||||
]
|
||||
}
|
||||
$ do
|
||||
@ -38,7 +38,7 @@ main = do
|
||||
removeFilesAfter "log" ["//*"]
|
||||
removeFilesAfter "node_modules" ["//*"]
|
||||
removeFilesAfter "public" ["//*"]
|
||||
removeFilesAfter "styleguide" ["elm.js", "bundle.js", "elm-stuff"]
|
||||
removeFilesAfter "component-catalog" ["elm.js", "bundle.js", "elm-stuff"]
|
||||
|
||||
phony "public" $ need ["log/public.txt"]
|
||||
|
||||
@ -48,9 +48,9 @@ main = do
|
||||
"tests/elm-verify-examples.json",
|
||||
"log/elm-verify-examples.txt",
|
||||
"log/elm-test.txt",
|
||||
"log/elm-test-styleguide.txt",
|
||||
"log/elm-test-component-catalog.txt",
|
||||
"log/elm-review.txt",
|
||||
"log/elm-review-styleguide.txt",
|
||||
"log/elm-review-component-catalog.txt",
|
||||
"log/puppeteer-tests.txt",
|
||||
"log/forbidden-imports-report.txt",
|
||||
"log/check-exposed.txt",
|
||||
@ -71,7 +71,7 @@ main = do
|
||||
|
||||
"forbidden-imports.toml" %> \out -> do
|
||||
-- we always want to consume our own published deprecated modules list
|
||||
-- so that we're not presenting outdated stuff in the styleguide! This
|
||||
-- so that we're not presenting outdated stuff in the component-catalog! This
|
||||
-- file can change separately from the CSV, but should always have at
|
||||
-- least the deprecated modules in it.
|
||||
need ["deprecated-modules.csv"]
|
||||
@ -85,20 +85,20 @@ main = do
|
||||
need (["package.json", "elm.json"] ++ elmFiles)
|
||||
cmd (WithStdout True) (FileStdout out) "elm-test"
|
||||
|
||||
"log/elm-test-styleguide.txt" %> \out -> do
|
||||
elmFiles <- getDirectoryFiles "." ["styleguide/tests/**/*.elm"]
|
||||
need (["package.json", "styleguide/elm.json"] ++ elmFiles)
|
||||
cmd (Cwd "styleguide") (WithStdout True) (FileStdout out) "elm-test"
|
||||
"log/elm-test-component-catalog.txt" %> \out -> do
|
||||
elmFiles <- getDirectoryFiles "." ["component-catalog/tests/**/*.elm"]
|
||||
need (["package.json", "component-catalog/elm.json"] ++ elmFiles)
|
||||
cmd (Cwd "component-catalog") (WithStdout True) (FileStdout out) "elm-test"
|
||||
|
||||
"log/elm-review.txt" %> \out -> do
|
||||
elmFiles <- getDirectoryFiles "." ["src/**/*.elm", "tests/**/*.elm"]
|
||||
need (["package.json", "elm.json"] ++ elmFiles)
|
||||
cmd (WithStdout True) (FileStdout out) "elm-review"
|
||||
|
||||
"log/elm-review-styleguide.txt" %> \out -> do
|
||||
elmFiles <- getDirectoryFiles "." ["styleguide/**/*.elm", "styleguide-app/**/*.elm"]
|
||||
need (["package.json", "styleguide/elm.json"] ++ elmFiles)
|
||||
cmd (Cwd "styleguide") (WithStdout True) (FileStdout out) "elm-review"
|
||||
"log/elm-review-component-catalog.txt" %> \out -> do
|
||||
elmFiles <- getDirectoryFiles "." ["component-catalog/**/*.elm", "component-catalog-app/**/*.elm"]
|
||||
need (["package.json", "component-catalog/elm.json"] ++ elmFiles)
|
||||
cmd (Cwd "component-catalog") (WithStdout True) (FileStdout out) "elm-review"
|
||||
|
||||
"log/elm-verify-examples.txt" %> \out -> do
|
||||
elmFiles <- getDirectoryFiles "." ["src/**/*.elm"]
|
||||
@ -110,7 +110,7 @@ main = do
|
||||
writeFileChanged out "formatting checks passed"
|
||||
|
||||
"log/elm-format.txt" %> \out -> do
|
||||
let placesToLook = ["src", "tests", "styleguide", "styleguide-app"]
|
||||
let placesToLook = ["src", "tests", "component-catalog", "component-catalog-app"]
|
||||
elmFiles <- getDirectoryFiles "." (map (\place -> place </> "**" </> "*.elm") placesToLook)
|
||||
need elmFiles
|
||||
cmd (WithStdout True) (FileStdout out) "elm-format" "--validate" placesToLook
|
||||
@ -152,26 +152,26 @@ main = do
|
||||
|
||||
"public/bundle.js" %> \out -> do
|
||||
libJsFiles <- getDirectoryFiles "." ["lib/**/*.js"]
|
||||
need (["package.json", "lib/index.js", "styleguide/manifest.js", "log/npm-install.txt"] ++ libJsFiles)
|
||||
cmd_ "./node_modules/.bin/browserify" "--entry" "styleguide/manifest.js" "--outfile" out
|
||||
need (["package.json", "lib/index.js", "component-catalog/manifest.js", "log/npm-install.txt"] ++ libJsFiles)
|
||||
cmd_ "./node_modules/.bin/browserify" "--entry" "component-catalog/manifest.js" "--outfile" out
|
||||
|
||||
"public/elm.js" %> \out -> do
|
||||
elmSources <- getDirectoryFiles "." ["styleguide-app/**/*.elm", "src/**/*.elm"]
|
||||
elmSources <- getDirectoryFiles "." ["component-catalog-app/**/*.elm", "src/**/*.elm"]
|
||||
need elmSources
|
||||
cmd_ (Cwd "styleguide") "elm" "make" "Main.elm" "--output" (".." </> out)
|
||||
cmd_ (Cwd "component-catalog") "elm" "make" "Main.elm" "--output" (".." </> out)
|
||||
|
||||
"public/package.json" %> \out -> do
|
||||
copyFileChanged "elm.json" out
|
||||
|
||||
"public/application.json" %> \out -> do
|
||||
copyFileChanged "styleguide/elm.json" out
|
||||
copyFileChanged "component-catalog/elm.json" out
|
||||
|
||||
"public/**/*" %> \out ->
|
||||
copyFileChanged (replaceDirectory1 out "styleguide") out
|
||||
copyFileChanged (replaceDirectory1 out "component-catalog") out
|
||||
|
||||
"log/public.txt" %> \out -> do
|
||||
need (["public/index.html", "public/elm.js", "public/bundle.js", "public/package.json", "public/application.json"])
|
||||
writeFileChanged out "built styleguide app successfully"
|
||||
writeFileChanged out "built component-catalog app successfully"
|
||||
|
||||
-- dev deps we get dynamically instead of from Nix (frowny face)
|
||||
"log/npm-install.txt" %> \out -> do
|
||||
|
@ -53,7 +53,7 @@ example =
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
, preview =
|
||||
[ -- faking a mini version of the Accordion component to give styleguide users a sense of what the
|
||||
[ -- faking a mini version of the Accordion component to give component-catalog users a sense of what the
|
||||
-- component might look like
|
||||
Html.div []
|
||||
[ Html.div [ css [ Css.displayFlex, Css.alignItems Css.center ] ]
|
@ -149,7 +149,7 @@ example =
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
, preview =
|
||||
[ -- faking a mini version of the Carousel component to give styleguide users a sense of what the
|
||||
[ -- faking a mini version of the Carousel component to give component-catalog users a sense of what the
|
||||
-- component might look like
|
||||
Html.div []
|
||||
[ Html.text "1 slide"
|
@ -134,7 +134,7 @@ example =
|
||||
, update = update
|
||||
, subscriptions = subscriptions
|
||||
, preview =
|
||||
[ -- faking a mini version of the Modal component to give styleguide users a sense of what the
|
||||
[ -- faking a mini version of the Modal component to give component-catalog users a sense of what the
|
||||
-- component might look like
|
||||
div
|
||||
[ css
|
@ -63,7 +63,7 @@ example =
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
, preview =
|
||||
[ -- faking a mini version of the Page component to give styleguide users a sense of what the
|
||||
[ -- faking a mini version of the Page component to give component-catalog users a sense of what the
|
||||
-- component might look like
|
||||
Html.div
|
||||
[ css
|
@ -57,7 +57,7 @@ example =
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
, preview =
|
||||
[ -- faking a mini version of the Tabs component to give styleguide users a sense of what the
|
||||
[ -- faking a mini version of the Tabs component to give component-catalog users a sense of what the
|
||||
-- component might look like
|
||||
Html.div [ css [ Css.displayFlex, Css.flexWrap Css.wrap ] ]
|
||||
[ Html.div
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"type": "application",
|
||||
"source-directories": [
|
||||
"../styleguide-app",
|
||||
"../component-catalog-app",
|
||||
"../src"
|
||||
],
|
||||
"elm-version": "0.19.1",
|
@ -22,7 +22,7 @@ config : List Rule
|
||||
config =
|
||||
List.map
|
||||
(Review.Rule.ignoreErrorsForDirectories [ "../src" ]
|
||||
>> Review.Rule.ignoreErrorsForFiles [ "../styleguide-app/App.elm" ]
|
||||
>> Review.Rule.ignoreErrorsForFiles [ "../component-catalog-app/App.elm" ]
|
||||
)
|
||||
[ NoUnused.CustomTypeConstructors.rule []
|
||||
|
@ -16,7 +16,7 @@ app route =
|
||||
, onUrlRequest = OnUrlRequest
|
||||
, onUrlChange = OnUrlChange
|
||||
}
|
||||
|> ProgramTest.withBaseUrl ("https://styleguide.test/" ++ Routes.toString route)
|
||||
|> ProgramTest.withBaseUrl ("https://component-catalog.test/" ++ Routes.toString route)
|
||||
|> ProgramTest.withSimulatedEffects simulateEffect
|
||||
|> ProgramTest.start ()
|
||||
|
@ -1,7 +1,7 @@
|
||||
# WARNING: this file is managed with `elm-forbid-imports`. Manual edits will
|
||||
# be overwritten!
|
||||
|
||||
roots = ['styleguide']
|
||||
roots = ['component-catalog']
|
||||
[forbidden.Accessibility]
|
||||
hint = 'Use Accessibility.Styled'
|
||||
|
||||
@ -20,9 +20,9 @@ hint = 'Use Accessibility.Styled.Live'
|
||||
[forbidden."Accessibility.Role"]
|
||||
hint = 'Use Accessibility.Styled.Role'
|
||||
usages = [
|
||||
'styleguide-app/../src/Nri/Ui/Icon/V3.elm',
|
||||
'styleguide-app/../src/Nri/Ui/Icon/V4.elm',
|
||||
'styleguide-app/../src/Nri/Ui/Icon/V5.elm',
|
||||
'component-catalog-app/../src/Nri/Ui/Icon/V3.elm',
|
||||
'component-catalog-app/../src/Nri/Ui/Icon/V4.elm',
|
||||
'component-catalog-app/../src/Nri/Ui/Icon/V5.elm',
|
||||
]
|
||||
|
||||
[forbidden."Accessibility.Style"]
|
||||
@ -33,7 +33,7 @@ hint = 'Use Accessibility.Widgetd.Widget'
|
||||
|
||||
[forbidden.Html]
|
||||
hint = 'Use Html.Styled'
|
||||
usages = ['styleguide-app/../src/Nri/Ui/Button/V8.elm']
|
||||
usages = ['component-catalog-app/../src/Nri/Ui/Button/V8.elm']
|
||||
|
||||
[forbidden."Nri.Ui.Accordion.V1"]
|
||||
hint = 'upgrade to V3'
|
||||
@ -55,7 +55,7 @@ hint = 'upgrade to V2'
|
||||
|
||||
[forbidden."Nri.Ui.Button.V8"]
|
||||
hint = 'upgrade to V10'
|
||||
usages = ['styleguide-app/../src/Nri/Ui/SlideModal/V2.elm']
|
||||
usages = ['component-catalog-app/../src/Nri/Ui/SlideModal/V2.elm']
|
||||
|
||||
[forbidden."Nri.Ui.Checkbox.V5"]
|
||||
hint = 'upgrade to V7'
|
||||
@ -65,7 +65,7 @@ hint = 'upgrade to V7'
|
||||
|
||||
[forbidden."Nri.Ui.ClickableSvg.V1"]
|
||||
hint = 'upgrade to V2'
|
||||
usages = ['styleguide-app/Examples/Tooltip.elm']
|
||||
usages = ['component-catalog-app/Examples/Tooltip.elm']
|
||||
|
||||
[forbidden."Nri.Ui.Container.V1"]
|
||||
hint = 'upgrade to V2'
|
||||
@ -78,7 +78,7 @@ hint = 'upgrade to V2'
|
||||
|
||||
[forbidden."Nri.Ui.Icon.V3"]
|
||||
hint = 'upgrade to V5'
|
||||
usages = ['styleguide-app/../src/Nri/Ui/Modal/V3.elm']
|
||||
usages = ['component-catalog-app/../src/Nri/Ui/Modal/V3.elm']
|
||||
|
||||
[forbidden."Nri.Ui.Icon.V4"]
|
||||
hint = 'upgrade to V5'
|
||||
@ -88,11 +88,11 @@ hint = 'upgrade to V3'
|
||||
|
||||
[forbidden."Nri.Ui.InputStyles.V3"]
|
||||
hint = 'upgrade to V4'
|
||||
usages = ['styleguide/../src/Nri/Ui/TextArea/V4.elm']
|
||||
usages = ['component-catalog/../src/Nri/Ui/TextArea/V4.elm']
|
||||
|
||||
[forbidden."Nri.Ui.Mark.V1"]
|
||||
hint = 'upgrade to V2'
|
||||
usages = ['styleguide/../src/Nri/Ui/Block/V1.elm']
|
||||
usages = ['component-catalog/../src/Nri/Ui/Block/V1.elm']
|
||||
|
||||
[forbidden."Nri.Ui.Menu.V1"]
|
||||
hint = 'upgrade to V3'
|
||||
@ -111,7 +111,7 @@ hint = 'upgrade to V3'
|
||||
|
||||
[forbidden."Nri.Ui.Modal.V10"]
|
||||
hint = 'upgrade to V11'
|
||||
usages = ['styleguide-app/Examples/RadioButton.elm']
|
||||
usages = ['component-catalog-app/Examples/RadioButton.elm']
|
||||
|
||||
[forbidden."Nri.Ui.Modal.V3"]
|
||||
hint = 'upgrade to V11'
|
||||
@ -127,7 +127,7 @@ hint = 'upgrade to V3'
|
||||
|
||||
[forbidden."Nri.Ui.QuestionBox.V2"]
|
||||
hint = 'upgrade to V3'
|
||||
usages = ['styleguide/../src/Nri/Ui/Block/V3.elm']
|
||||
usages = ['component-catalog/../src/Nri/Ui/Block/V3.elm']
|
||||
|
||||
[forbidden."Nri.Ui.RadioButton.V1"]
|
||||
hint = 'upgrade to V2'
|
||||
@ -180,20 +180,20 @@ hint = 'upgrade to V7'
|
||||
[forbidden."Nri.Ui.Text.V2"]
|
||||
hint = 'upgrade to V5'
|
||||
usages = [
|
||||
'styleguide-app/../src/Nri/Ui/Page/V3.elm',
|
||||
'styleguide-app/../src/Nri/Ui/SlideModal/V2.elm',
|
||||
'styleguide-app/Examples/DisclosureIndicator.elm',
|
||||
'component-catalog-app/../src/Nri/Ui/Page/V3.elm',
|
||||
'component-catalog-app/../src/Nri/Ui/SlideModal/V2.elm',
|
||||
'component-catalog-app/Examples/DisclosureIndicator.elm',
|
||||
]
|
||||
|
||||
[forbidden."Nri.Ui.Text.V4"]
|
||||
hint = 'upgrade to V5'
|
||||
usages = [
|
||||
'styleguide-app/Examples/Accordion.elm',
|
||||
'styleguide-app/Examples/Icon.elm',
|
||||
'styleguide-app/Examples/IconExamples.elm',
|
||||
'styleguide-app/Examples/Loading.elm',
|
||||
'styleguide-app/Examples/Modal.elm',
|
||||
'styleguide-app/Examples/Tooltip.elm',
|
||||
'component-catalog-app/Examples/Accordion.elm',
|
||||
'component-catalog-app/Examples/Icon.elm',
|
||||
'component-catalog-app/Examples/IconExamples.elm',
|
||||
'component-catalog-app/Examples/Loading.elm',
|
||||
'component-catalog-app/Examples/Modal.elm',
|
||||
'component-catalog-app/Examples/Tooltip.elm',
|
||||
]
|
||||
|
||||
[forbidden."Nri.Ui.Text.V5"]
|
||||
@ -207,7 +207,7 @@ hint = 'upgrade to V7'
|
||||
|
||||
[forbidden."Nri.Ui.Tooltip.V1"]
|
||||
hint = 'upgrade to V3'
|
||||
usages = ['styleguide/../src/Nri/Ui/Menu/V1.elm']
|
||||
usages = ['component-catalog/../src/Nri/Ui/Menu/V1.elm']
|
||||
|
||||
[forbidden."Nri.Ui.Tooltip.V2"]
|
||||
hint = 'upgrade to V3'
|
||||
|
@ -12,7 +12,7 @@ shake --compact "$SHAKE_TARGET"
|
||||
cat <<EOF
|
||||
== 👋 Hello! ==================================================================
|
||||
|
||||
I'm watching files in styleguide, styleguide-app, and src for changes. If you make any
|
||||
I'm watching files in component-catalog, component-catalog-app, and src for changes. If you make any
|
||||
changes, I'll try to be smart about what should change (things end up in the
|
||||
"public" directory if you want to check my work.) If you remove a file and it's
|
||||
still showing up, delete the "public" directory and restart me.
|
||||
|
@ -15,10 +15,10 @@ if test -d public; then rm -rf public; fi
|
||||
mkdir public
|
||||
|
||||
# build the interactive parts
|
||||
(cd styleguide && npx elm make Main.elm --output ../public/elm.js)
|
||||
npx browserify --entry styleguide/manifest.js --outfile public/bundle.js
|
||||
(cd component-catalog && npx elm make Main.elm --output ../public/elm.js)
|
||||
npx browserify --entry component-catalog/manifest.js --outfile public/bundle.js
|
||||
|
||||
# copy static files
|
||||
cp styleguide/index.html public/index.html
|
||||
cp styleguide/elm.json public/application.json
|
||||
cp component-catalog/index.html public/index.html
|
||||
cp component-catalog/elm.json public/application.json
|
||||
cp elm.json public/package.json
|
||||
|
@ -527,7 +527,7 @@ and essentially make the anchor a disabled placeholder.
|
||||
|
||||
_Caveat!_
|
||||
|
||||
The styleguide example will NOT work correctly because of <https://github.com/elm/browser/issues/34>, which describes a problem where "a tags without href generate a navigation event".
|
||||
The component-catalog example will NOT work correctly because of <https://github.com/elm/browser/issues/34>, which describes a problem where "a tags without href generate a navigation event".
|
||||
|
||||
In most cases, if you're not using Browser.application, disabled links should work just fine.
|
||||
|
||||
|
@ -373,7 +373,7 @@ and essentially make the anchor a disabled placeholder.
|
||||
|
||||
_Caveat!_
|
||||
|
||||
The styleguide example will NOT work correctly because of <https://github.com/elm/browser/issues/34>, which describes a problem where "a tags without href generate a navigation event".
|
||||
The component-catalog example will NOT work correctly because of <https://github.com/elm/browser/issues/34>, which describes a problem where "a tags without href generate a navigation event".
|
||||
|
||||
In most cases, if you're not using Browser.application, disabled links should work just fine.
|
||||
|
||||
|
@ -42,7 +42,7 @@ module Nri.Ui.TextArea.V5 exposing
|
||||
- Adds field for onBlur
|
||||
|
||||
|
||||
## The Nri styleguide-specified textarea with overlapping label
|
||||
## The Nri component-catalog-specified textarea with overlapping label
|
||||
|
||||
|
||||
## Creating New Versions
|
||||
|
@ -332,7 +332,7 @@ getLabelPositionsSpec =
|
||||
]
|
||||
|> Dict.fromList
|
||||
)
|
||||
, test "styleguide example regression test: 3 labels on 1 line, with 1 overlap to resolve" <|
|
||||
, test "component-catalog example regression test: 3 labels on 1 line, with 1 overlap to resolve" <|
|
||||
\() ->
|
||||
let
|
||||
withElement element =
|
||||
|
Loading…
Reference in New Issue
Block a user