Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout #187

Merged
merged 75 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
eaef5d0
progress check
sikhote Apr 19, 2024
171ce20
progress check
sikhote Apr 23, 2024
ec128b8
progress check
sikhote Apr 24, 2024
48dd0ab
progress check
sikhote Apr 24, 2024
a89f272
progress check
sikhote Apr 30, 2024
bd01061
progress check
sikhote May 1, 2024
30d4ff9
progress check
sikhote May 31, 2024
2b9f0fc
progress check
sikhote May 31, 2024
ca1aa2a
progress check
sikhote May 31, 2024
2cf92b0
progress check
sikhote Jun 3, 2024
ec3f7aa
progress check
sikhote Jun 3, 2024
be88487
progress check
sikhote Jun 4, 2024
4750555
progress check
sikhote Jun 18, 2024
c51959e
progress check
sikhote Jun 20, 2024
b57035e
progress check
sikhote Jun 25, 2024
8e00b52
progress check
sikhote Jul 2, 2024
c338043
progress check
sikhote Jul 2, 2024
a0e9fe7
test complete
sikhote Jul 10, 2024
bc211dd
merge main
sikhote Jul 25, 2024
f740d08
progress
sikhote Jul 25, 2024
1a3ac56
progress
sikhote Jul 30, 2024
beee45d
progress
sikhote Jul 31, 2024
41e8d48
progress
sikhote Aug 5, 2024
3939f28
progress
sikhote Aug 5, 2024
8bd16de
progress
sikhote Aug 5, 2024
7d8018d
progress
sikhote Aug 19, 2024
4d2eead
progress
sikhote Aug 19, 2024
a524543
progress
sikhote Aug 19, 2024
9879074
progress
sikhote Aug 19, 2024
384b32c
progress
sikhote Aug 19, 2024
ef9bd15
progress
sikhote Aug 20, 2024
b747723
progress
sikhote Aug 20, 2024
2749010
progress
sikhote Aug 20, 2024
f7bc529
progress
sikhote Aug 20, 2024
9d22ce5
progress
sikhote Aug 22, 2024
007178d
progress
sikhote Aug 22, 2024
d13f9c3
progress
sikhote Aug 22, 2024
0f7fb82
progress
sikhote Aug 22, 2024
e10f7e0
progress
sikhote Aug 22, 2024
7c88cd4
progress
sikhote Aug 27, 2024
bf708d8
progress
sikhote Aug 27, 2024
69cb4e6
progress
sikhote Aug 27, 2024
5ce6314
progress
sikhote Aug 27, 2024
bee7e6e
progress
sikhote Aug 27, 2024
3581983
progress
sikhote Aug 27, 2024
3633922
progress
sikhote Aug 27, 2024
71ff96a
progress
sikhote Aug 28, 2024
ca1ffdc
progress
sikhote Aug 29, 2024
1735e58
progress
sikhote Aug 29, 2024
f5411dc
progress
sikhote Aug 29, 2024
78f3591
progress
sikhote Aug 29, 2024
be80bff
progress
sikhote Aug 30, 2024
cc2b7a5
progress
sikhote Sep 3, 2024
905a6ad
progress
sikhote Sep 3, 2024
10b8f05
progress
sikhote Sep 3, 2024
7bc063e
progress
sikhote Sep 3, 2024
8465cef
progress
sikhote Sep 3, 2024
86a13fb
media object
sikhote Sep 9, 2024
7f959de
Merge branch 'main' of github.com:rei/rei-cedar into pr/media-object
sikhote Oct 2, 2024
19d0adf
media object
sikhote Oct 2, 2024
cab99e8
media-object
sikhote Oct 17, 2024
d2bbf3c
media-object
sikhote Oct 17, 2024
f25e4b8
media-object
sikhote Oct 18, 2024
098508e
media-object
sikhote Oct 18, 2024
d5582e4
media-object
sikhote Oct 18, 2024
d21f183
media-object
sikhote Oct 18, 2024
b92a4f2
media-object
sikhote Oct 18, 2024
e869fcb
progress
sikhote Nov 6, 2024
fad20e9
layout integration
sikhote Nov 11, 2024
458509a
layout integration
sikhote Nov 11, 2024
f4c953a
merge master
sikhote Nov 11, 2024
df68ae8
cleanup
sikhote Nov 11, 2024
a1c5184
tests
sikhote Nov 11, 2024
80d60bd
media-object-layout
sikhote Nov 25, 2024
7a15177
media-object
sikhote Nov 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
root = true

[*.{js,css,scss}]
[*.{js,css,scss,yml}]
charset = utf-8
end_of_line = lf
indent_size = 2
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/deploy.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,3 @@ jobs:
run: |
npm install
npm run build
- name: Deploy
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: . # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
23 changes: 23 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: GitHub Pages
on: [push]
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Node version
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install and Build 🔧
run: |
npm ci
npm run pages
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: pages
clean: true
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# REI Cedar Style Framework!

[![codecov](https://codecov.io/gh/rei/rei-cedar/branch/master/graph/badge.svg)](https://codecov.io/gh/rei/rei-cedar)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)


Welcome to REI's style framework! The overall goals of this project are to provide a common scaffolding for UI elements,
and a set of themes that build on this scaffolding. We started this project in 2015 as a fork of
[Bootstrap](http://getbootstrap.com/).
Expand Down Expand Up @@ -57,8 +57,13 @@ Publishes package to npm with a prerelease tag. You must increment the component

## Commits

This project is Commitizen friendly. To install: `npm install -g commitizen`
This project is Commitizen friendly. To install: `npm install -g commitizen`
When creating a pull request run `git cz` rather than `git commit` and follow the prompts.

This projects Changelogs are generated.

- Generate the Changelog: `npm run changelog`

## Developer demo

The main documentation site for Cedar is our separate [Cedar docs](https://cedar.rei.com) website. With that in mind, we also have a playground for developing components and sharing ideas with others and within our team. The Cedar team produces this *developer demo* through GitHub Pages that can be accessed at [https://rei.github.io/rei-cedar/](https://rei.github.io/rei-cedar/), but we do not guarantee it will always be up to date or be an accurate representation of the Cedar library.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"build:copycss": "node build/copy-css.js",
"build:umd": "vite build --config vite.umd.config.ts",
"build:variables": "node build/component-variables-transfer.js",
"preview": "vite preview",
"pages": "vite build --config vite.pages.config.mts",
"preview": "vite preview --config vite.pages.config.mts",
"unit": "vitest run",
"watch": "vitest",
"coverage": "vitest run --coverage",
Expand Down
14 changes: 7 additions & 7 deletions src/components/card/examples/demo/complexCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div>
<cdr-img
alt="card test image"
src="/src/dev/static/test-image.png"
:src="testImage"
modifier="responsive"
/>
</div>
Expand All @@ -14,18 +14,14 @@
class="cdr-card__link"
href="#foo"
>
<h2>
Complex Card Title
</h2>
<h2>Complex Card Title</h2>
</cdr-link>
<cdr-rating
rating="4.2"
count="12"
size="small"
/>
<cdr-text class="cdr-text-dev--body-300">
Card content
</cdr-text>
<cdr-text class="cdr-text-dev--body-300">Card content</cdr-text>
</div>
</section>
</cdr-card>
Expand All @@ -34,10 +30,14 @@

<script>
import * as Components from 'srcdir/lib';
import testImage from '../../../../dev/static/test-image.png';

export default {
name: 'ComplexCard',
components: Components,
data() {
return { testImage };
},
};
</script>

Expand Down
18 changes: 9 additions & 9 deletions src/components/card/examples/demo/fluidHeadingCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div>
<cdr-img
alt="card test image"
src="/src/dev/static/test-image.png"
:src="testImage"
modifier="responsive"
/>
</div>
Expand All @@ -14,13 +14,9 @@
class="cdr-card__link"
href="#foo"
>
<CdrTitle tag="p">
Fluid title component
</CdrTitle>
<CdrTitle tag="p">Fluid title component</CdrTitle>
</cdr-link>
<cdr-text class="cdr-text-dev--body-300">
Card content
</cdr-text>
<cdr-text class="cdr-text-dev--body-300">Card content</cdr-text>
</div>
</section>
</cdr-card>
Expand All @@ -29,10 +25,14 @@

<script>
import * as Components from 'srcdir/lib';
import testImage from '/src/dev/static/test-image.png';

export default {
name: 'FluidHeadingCard',
components: Components,
name: 'FluidHeadingCard',
components: Components,
data() {
return { testImage };
},
};
</script>

Expand Down
4 changes: 4 additions & 0 deletions src/components/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import images from 'componentsdir/image/examples/Images.vue';
import inputs from 'componentsdir/input/examples/Inputs.vue';
import kicker from 'componentsdir/kicker/examples/Kicker.vue';
import landingLead from 'componentsdir/landingLead/examples/LandingLead.vue';
import layout from 'componentsdir/layout/examples/Layout.vue';
import links from 'componentsdir/link/examples/Links.vue';
import list from 'componentsdir/list/examples/Lists.vue';
// import mediaObject from 'componentsdir/mediaObject/examples/MediaObject.vue';
import modal from 'componentsdir/modal/examples/Modal.vue';
import pagination from 'componentsdir/pagination/examples/Pagination.vue';
import picture from 'componentsdir/picture/examples/Picture.vue';
Expand Down Expand Up @@ -62,8 +64,10 @@ export default {
inputs,
kicker,
landingLead,
layout,
links,
list,
// mediaObject,
modal,
pagination,
picture,
Expand Down
36 changes: 21 additions & 15 deletions src/components/fulfillmentTile/CdrFulfillmentTile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { useCssModule, computed } from 'vue';
import mapClasses from '../../utils/mapClasses';
import { surfaceSelection } from '../../types/interfaces';
import { getSurfaceSelectionProps } from '../../utils/surface';
import CdrFulfillmentTileLayout from './CdrFulfillmentTileLayout.vue';
import { getSurfaceSelectionProps, getDefaultLayout } from '../../utils/surface';
import CdrLayout from '../layout/CdrLayout.vue';
import CdrFulfillmentTileHeader from './CdrFulfillmentTileHeader.vue';
import CdrFulfillmentTileContent from './CdrFulfillmentTileContent.vue';
import CdrSkeleton from '../skeleton/CdrSkeleton.vue';
Expand All @@ -20,25 +20,33 @@ const props = withDefaults(defineProps<surfaceSelection>(), {
checked: false,
disabled: false,
loading: false,
orientation: 'vertical',
layout: () => getDefaultLayout({ flow: 'row' }),
});

const style = useCssModule();
const baseClass = 'cdr-fulfillment-tile';

// Manages the props passed along to CdrSurface
const rootProps = computed(() => {
const { classes, ...additionalProps } = getSurfaceSelectionProps(props, baseClass);
const { classes, ...additionalProps } = getSurfaceSelectionProps(props, baseClass);
return { ...additionalProps, class: mapClasses(style, ...classes) || undefined };
});

// Merge layout props
const layoutProps = computed(() =>
Object.assign(getDefaultLayout({ flow: 'row', rows: [1] }), props.layout),
);
</script>

<template>
<component
:is="tag"
v-bind="rootProps"
>
<div :class="style['cdr-fulfillment-tile__inner']">
<CdrLayout
sikhote marked this conversation as resolved.
Show resolved Hide resolved
:rows="['auto', 1]"
:class="style['cdr-fulfillment-tile__inner']"
>
<CdrFulfillmentTileHeader>
<template
v-if="$slots['icon-left']"
Expand All @@ -60,23 +68,21 @@ const rootProps = computed(() => {
</template>
</CdrFulfillmentTileHeader>
<div :class="style['cdr-fulfillment-tile__main']">
<CdrFulfillmentTileLayout
:orientation="orientation"
<CdrLayout
v-bind="layoutProps"
:class="style['cdr-fulfillment-tile__layout']"
>
<template v-if="$slots['body']">
<CdrFulfillmentTileContent :stretch="true">
<!-- @slot Default font size is a step down. Placed just below the header. -->
<slot name="body" />
</CdrFulfillmentTileContent>
</template>
<CdrFulfillmentTileContent>
<!-- @slot Default font size is a step down. Placed just below the header. -->
<slot name="body" />
</CdrFulfillmentTileContent>
<template v-if="$slots['footer']">
<CdrFulfillmentTileContent scale="-1">
<!-- @slot Footer content will be at the bottom of the component. -->
<slot name="footer" />
</CdrFulfillmentTileContent>
</template>
</CdrFulfillmentTileLayout>
</CdrLayout>
<div :class="style['cdr-fulfillment-tile__loading']">
<!-- @slot Custom content when component is loading. -->
<slot name="loading">
Expand All @@ -86,7 +92,7 @@ const rootProps = computed(() => {
</slot>
</div>
</div>
</div>
</CdrLayout>
</component>
</template>

Expand Down
6 changes: 1 addition & 5 deletions src/components/fulfillmentTile/CdrFulfillmentTileContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { fulfillmentTileContent } from '../../types/interfaces';
defineOptions({ name: 'CdrFulfillmentTileContent' });
sikhote marked this conversation as resolved.
Show resolved Hide resolved

const props = withDefaults(defineProps<fulfillmentTileContent>(), {
stretch: false,
scale: '-2',
});

Expand All @@ -19,10 +18,7 @@ const rootProps = computed(
(): bodyTextProps => ({
tag: 'div',
scale: props.scale,
class: {
[style[baseClass]]: true,
[style[`${baseClass}--stretch`]]: props.stretch,
},
class: [style[baseClass]],
}),
);
</script>
Expand Down
16 changes: 3 additions & 13 deletions src/components/fulfillmentTile/CdrFulfillmentTileHeader.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
<script setup lang="ts">
import { useCssModule, computed } from 'vue';
import { useCssModule } from 'vue';
import CdrSubheadingSans from '../text/presets/CdrSubheadingSans.vue';
import CdrFulfillmentTileLayout from './CdrFulfillmentTileLayout.vue';
import { surfaceSelectionLayout } from '../../types/interfaces';

/** Header component with icon slot for fulfillment tile */

defineOptions({ name: 'CdrFulfillmentTileHeader' });

const style = useCssModule();
const baseClass = 'cdr-fulfillment-tile-header';

const rootProps = computed(
(): surfaceSelectionLayout => ({
orientation: 'horizontal',
class: { [style[baseClass]]: true },
}),
);
</script>

<template>
<CdrFulfillmentTileLayout v-bind="rootProps">
<div :class="[style['cdr-fulfillment-tile-header']]">
sikhote marked this conversation as resolved.
Show resolved Hide resolved
<span
v-if="$slots['icon-left']"
:class="style['cdr-fulfillment-tile-header__icon']"
Expand All @@ -44,7 +34,7 @@ const rootProps = computed(
<!-- @slot Place an icon to the right of the header content -->
<slot name="icon-right" />
</span>
</CdrFulfillmentTileLayout>
</div>
</template>

<style lang="scss" module src="./styles/CdrFulfillmentTileHeader.module.scss"></style>
36 changes: 0 additions & 36 deletions src/components/fulfillmentTile/CdrFulfillmentTileLayout.vue

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('CdrFulfillmentTile', () => {
},
});
expect(wrapper.element).toMatchSnapshot();
expect(wrapper.find('.cdr-fulfillment-tile-content--stretch').text()).toBe('Body slot');
expect(wrapper.find('.cdr-fulfillment-tile-content').text()).toBe('Body slot');
});

it('shows footer', () => {
Expand All @@ -97,7 +97,7 @@ describe('CdrFulfillmentTile', () => {
footer: 'Footer slot',
},
});
expect(wrapper.find('.cdr-fulfillment-tile-content').text()).toBe('Footer slot');
expect(wrapper.find('.cdr-fulfillment-tile-content:nth-child(2)').text()).toBe('Footer slot');
expect(wrapper.element).toMatchSnapshot();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ describe('CdrFulfillmentTileContent', () => {
},
});
expect(wrapper.element).toMatchSnapshot();
expect(wrapper.classes()).toEqual([
'cdr-body',
'cdr-fulfillment-tile-content',
'cdr-fulfillment-tile-content--stretch',
]);
expect(wrapper.classes()).toEqual(['cdr-body', 'cdr-fulfillment-tile-content']);
});
});
Loading