@rei/cedar 13.0.0-vite.6 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +2 -19
  2. package/dist/cdr-fonts.css +4 -0
  3. package/dist/cedar-compiled.css +2378 -0
  4. package/dist/cedar.mjs +8788 -0
  5. package/dist/cedar.umd.js +4 -1
  6. package/dist/reset.css +3 -0
  7. package/dist/style/cdr-accordion-group.css +1 -0
  8. package/dist/style/cdr-accordion.css +1 -0
  9. package/dist/style/cdr-banner.css +1 -0
  10. package/dist/style/cdr-breadcrumb.css +1 -0
  11. package/dist/style/cdr-button.css +1 -0
  12. package/dist/style/cdr-caption.css +1 -0
  13. package/dist/style/cdr-card.css +1 -0
  14. package/dist/style/cdr-checkbox.css +1 -0
  15. package/dist/style/cdr-chip-group.css +1 -0
  16. package/dist/style/cdr-chip.css +1 -0
  17. package/dist/style/cdr-container.css +1 -0
  18. package/dist/style/cdr-form-error.css +1 -0
  19. package/dist/style/cdr-form-group.css +1 -0
  20. package/dist/style/cdr-grid.css +1 -0
  21. package/dist/style/cdr-icon.css +1 -0
  22. package/dist/style/cdr-img.css +1 -0
  23. package/dist/style/cdr-input.css +1 -0
  24. package/dist/style/cdr-label-standalone.css +1 -0
  25. package/dist/style/cdr-label-wrapper.css +1 -0
  26. package/dist/style/cdr-link.css +1 -0
  27. package/dist/style/cdr-list.css +1 -0
  28. package/dist/style/cdr-modal.css +1 -0
  29. package/dist/style/cdr-pagination.css +1 -0
  30. package/dist/style/cdr-popover.css +1 -0
  31. package/dist/style/cdr-popup.css +1 -0
  32. package/dist/style/cdr-quote.css +1 -0
  33. package/dist/style/cdr-radio.css +1 -0
  34. package/dist/style/cdr-rating.css +1 -0
  35. package/dist/style/cdr-select.css +1 -0
  36. package/dist/style/cdr-switch.css +1 -0
  37. package/dist/style/cdr-tab-panel.css +1 -0
  38. package/dist/style/cdr-table.css +1 -0
  39. package/dist/style/cdr-tabs.css +1 -0
  40. package/dist/style/cdr-text.css +1 -0
  41. package/dist/style/cdr-toast.css +1 -0
  42. package/dist/style/cdr-toggle-button.css +1 -0
  43. package/dist/style/cdr-toggle-group.css +1 -0
  44. package/dist/style/cdr-tooltip.css +1 -0
  45. package/dist/style/cedar-full.css +39 -0
  46. package/dist/style.css +1 -1
  47. package/dist/svg/star-0.svg +2 -5
  48. package/dist/svg/star-100.svg +2 -5
  49. package/dist/svg/star-25.svg +5 -6
  50. package/dist/svg/star-50.svg +6 -6
  51. package/dist/svg/star-75.svg +5 -6
  52. package/package.json +30 -24
  53. package/dist/cedar.es.js +0 -9173
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Work In Progress
6
6
 
7
- This project tracks the migration of [@rei/cedar](https://github.com/rei/rei-cedar) to Vue 3. This is a work in progress and the code contained in this repo is not production ready. Please reach out to the Cedar team if you have any questions.
7
+ This project tracks the migration of [@rei/cedar](https://github.com/rei/rei-cedar) to Vue 3. The library is currently in release candidate testing and will eventually be renamed to `@rei/cedar`
8
8
 
9
9
 
10
10
  Welcome to REI's style framework! The overall goals of this project are to provide a common scaffolding for UI elements,
@@ -15,24 +15,7 @@ the Cedar grow and learn from what we are doing, or jump in and provide some rec
15
15
 
16
16
  ### Migration Status
17
17
 
18
- Vue 2 Cedar was written in JSX because at that time it was the only way to generate a tree-shakeable vue component library. We have migrated to .vue SFC's for vue 3 and have also adopted the "composition API" which should make the Cedar bundle significantly smaller as it will no longer need to import all of Vue. All of the "view-model" logic for a component is exported as part of it's `setup()` function. There are definitely opportunities to DRY up this code by extracting common computed property logic or to simply better organize the contents of the setup functions. Helper functions could be moved into `/utils` or simply a `.js` file in the component directory and imported rather than defined in the setup function itself. The Vue mastery courses around vue 3, particularly the one by Evan You are the best resource I have found for understanding the composition API
19
-
20
- Vue 2 private API usage: Cedar used the `vnode` API in a few places in vue 2 which simply does not work in vue 3. This is particularly problematic for CdrTabs which maintains a close parent-child relationship between the CdrTabs wrapper and CdrTabPanel contents. Will need to refactor that component to use a flux architecture, with CdrTabs using provide/inject to pass data into the tab panels, and CdrTabPanel's emitting events that CdrTabs listens for.
21
-
22
- Unit Tests: many unit tests are commented out or `xit`'d currently. Searching for `xit(` in the spec files should point out where tests either need work or bugs in components themselves. I know CdrModal, CdrSelect, and CdrTabs definitely have some issues, with CdrTabs being the most broken. In some cases, Vue/VTU have just changed such that our old method of unit testing no longer works and those tests may need to be removed or replaced (i.e, test a instance method directly rather than triggering an event on a component and validating that the component updates based on what the instance method does). That's a much better unit testing pattern in general, complex stuff like "click a button and see what happens" is more of an integration test. May make sense to set up a proper integration testing framework against the kitchen sink for validating these more complex use cases. Most of the broken unit tests are around triggering events, applying focus, etc. and all those would be better handled by testing the function that gets called by those events rather than trying to trigger the events themselves. VTU has also dropped the ability to forcibly set data or methods on components which makes things a lot harder to fake.
23
-
24
- Unit Test Slots: Note that when passing slots into a component in VTU you have to use the `h()` render function helper to have it work properly. This might get resolved in a future version of VTU. Search for `h(` in the .spec.js files for examples of how to do this. Essentially using h() you are creating a new component that gets passed to the VTU `mount` function.
25
-
26
- Build: The dev/test/prod builds should all work. However there are still breaking bugs in the vue ecosystem that prevent tree-shaking from working which will be the biggest blocker for release. It may be possible to bypass the tree shaking issues by having consumers import Cedar components directly rather than from the index entry point, for example
27
-
28
- ```
29
- import { CdrButton, CdrLink } from '@rei/cedar'; // imports from entry point, if tree-shaking is broken this imports ALL of cedar
30
-
31
- import CdrButton from '@rei/cedar/dist/components/CdrButton.vue'; // Importing components individually would allow febs/webpack to tree-shake Cedar
32
- import CdrLink from '@rei/cedar/dist/components/CdrLink.vue'; // Might be possible to make a webpack alias in FEBS that would automagically do this so consumers could maintain the old import syntax.
33
- ```
34
-
35
- Visual Regression: It should be possible to generate backstop reference images in the vue 2 Cedar repo and then copy them into `/backstop_data` in this repo to validate that components are rendering the same.
18
+ Cedar has been fully migrated to Vue 3 using the composition API and is using [vite](https://vitejs.dev/) for its build system. Additionally, [vitest](https://vitest.dev/) is now being used as our testing framework.
36
19
 
37
20
  ## Using Cedar
38
21
 
@@ -1,20 +1,24 @@
1
1
  @font-face {
2
+ font-display: swap;
2
3
  font-family: Stuart;
3
4
  font-weight: 1 999;
4
5
  src: url("//www.rei.com/satchel/media/font-optimized/Stuart/REIStuart-VF-Web-Subset.woff2") format("woff2-variations"), url("//www.rei.com/satchel/media/font-optimized/Stuart/REIStuart-VF-Web-Subset.woff2") format("woff2"); }
5
6
 
6
7
  @font-face {
8
+ font-display: swap;
7
9
  font-family: Stuart;
8
10
  font-weight: 1 999;
9
11
  font-style: italic;
10
12
  src: url("//www.rei.com/satchel/media/font-optimized/Stuart/REIStuartWebItalics-VF-Web-Subset.woff2") format("woff2-variations"), url("//www.rei.com/satchel/media/font-optimized/Stuart/REIStuartWebItalics-VF-Web-Subset.woff2") format("woff2"); }
11
13
 
12
14
  @font-face {
15
+ font-display: swap;
13
16
  font-family: Graphik;
14
17
  font-weight: 1 999;
15
18
  src: url("//www.rei.com/satchel/media/font-optimized/Graphik/Graphik-VF-Web-Subset.woff2") format("woff2-variations"), url("//www.rei.com/satchel/media/font-optimized/Graphik/Graphik-VF-Web-Subset.woff2") format("woff2"); }
16
19
 
17
20
  @font-face {
21
+ font-display: swap;
18
22
  font-family: Graphik;
19
23
  font-weight: 1 999;
20
24
  font-style: italic;