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

Finish card component #785

Merged
merged 94 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
3b29f02
restrict how far node 14 can go
joewhitsitt Oct 12, 2022
590c7ad
update readme with crucial setup step
joewhitsitt Oct 12, 2022
0045789
ignore the lock file
joewhitsitt Oct 12, 2022
ba6731c
update with storybook info
joewhitsitt Oct 12, 2022
422adb9
media component barebones
joewhitsitt Oct 12, 2022
df50dc4
initial slot work
joewhitsitt Oct 12, 2022
34b7af5
pivot to use similar borderless setup for media
joewhitsitt Oct 13, 2022
9acf6d2
fill in additional style info
joewhitsitt Oct 13, 2022
287b218
Updating dependencies as allowed by package.json. Fixed a few things …
pyrello Oct 14, 2022
8e695b3
Added prettier config and made some fixes based on it.
pyrello Oct 14, 2022
b44b8bc
establish story for person teaser card
joewhitsitt Oct 14, 2022
1add705
Merge branch 'finish-card-component' of github.com:uiowa/uids into fi…
joewhitsitt Oct 14, 2022
54cc9bc
switch to local image
joewhitsitt Oct 14, 2022
a7c8955
add borderless as default
joewhitsitt Oct 14, 2022
979647e
start cleaning up card scss
joewhitsitt Oct 14, 2022
16c5a3e
keep like items together
joewhitsitt Oct 14, 2022
3cab869
padding should use REM
joewhitsitt Oct 14, 2022
6612d05
adjust comment
joewhitsitt Oct 14, 2022
1a6ed06
move include to end
joewhitsitt Oct 14, 2022
19c4c7f
adjust spacing of standard properties and nested selectors
joewhitsitt Oct 14, 2022
060898f
i think card__media is replaced by media
joewhitsitt Oct 14, 2022
646e254
Merge branch '4.x' into finish-card-component
pyrello Oct 14, 2022
233edac
Merge branch '4.x' into finish-card-component
pyrello Oct 14, 2022
c5aaf69
possible fix for borderless padding combo conflict
joewhitsitt Oct 14, 2022
ee0a66d
Merge branch 'finish-card-component' of github.com:uiowa/uids into fi…
joewhitsitt Oct 14, 2022
858f747
Merge branch '4.x' into finish-card-component
pyrello Oct 14, 2022
73b6859
A bit of linting cleanup.
pyrello Oct 14, 2022
ea8a6fa
wire up meta and subtitle as slots
joewhitsitt Oct 14, 2022
f8ac44d
Merge branch 'finish-card-component' of github.com:uiowa/uids into fi…
joewhitsitt Oct 14, 2022
aabfdcb
remove medium and widescreen defaults
joewhitsitt Oct 14, 2022
0223528
change details to wrapper
joewhitsitt Oct 14, 2022
c2fde84
remove cover option, add class if media padded is false
joewhitsitt Oct 14, 2022
be58ac0
Added card__meta back in
bspeare Oct 17, 2022
8ec2db1
Added longer text snippet
bspeare Oct 17, 2022
e074eba
Fixing media spacing
bspeare Oct 17, 2022
8f487db
Added adjustments for card media padding for left and right alignment
bspeare Oct 17, 2022
5906a24
Added card button classes
bspeare Oct 17, 2022
6645e41
Added card media centered option
bspeare Oct 17, 2022
681b615
Added max-width for small media size
bspeare Oct 17, 2022
2a7c1d5
Fixed some deprecation warnings. Refactor of card and shared assets b…
pyrello Oct 17, 2022
7476070
Adjusted class name to inner
bspeare Oct 18, 2022
18b01b0
Added banner story. Made some updates to banner component based on ca…
pyrello Oct 18, 2022
24816ef
Updated naming of new media__inner class and did a corresponding sear…
pyrello Oct 18, 2022
05f6cde
Removed media stuff from banner. Added styles to media to handle resp…
pyrello Oct 18, 2022
6962d4f
Added case for the card where the image is the only linkable element.…
pyrello Oct 18, 2022
36c33b9
i think i have videos working
GaryRidgway Oct 18, 2022
d3b259e
Some more small tweaks to card story args.
pyrello Oct 19, 2022
34d2bfa
pushing some adjustments
GaryRidgway Oct 19, 2022
bb057c6
card and healdine title adjustments
GaryRidgway Oct 19, 2022
d8d36d5
font size scope adjustment
GaryRidgway Oct 19, 2022
671fa25
adjust card control labels and groups
GaryRidgway Oct 19, 2022
413eed7
cleaned up some unused styles
bspeare Oct 19, 2022
bf20cc4
Merge branch 'finish-card-component' of github.com:uiowa/uids into fi…
bspeare Oct 19, 2022
0f5dff3
Added container queries for card images and alignment
bspeare Oct 19, 2022
174ebf7
added custom viewports, I`m the best coder in the world
GaryRidgway Oct 19, 2022
18c2ba9
Merge branch 'finish-card-component' of github.com:uiowa/uids into fi…
bspeare Oct 19, 2022
374ce20
Added at support rule on container query for caution
bspeare Oct 19, 2022
d56e688
Added comments to clarify targeted containers
bspeare Oct 19, 2022
0ef21ea
Adjusted container queries and worked on getting media--cover working
bspeare Oct 20, 2022
d165373
Adjusted card media
bspeare Oct 20, 2022
dcec4d9
Hide the parameters argType from the table.
pyrello Oct 20, 2022
ac851fb
Removed media--cover
bspeare Oct 20, 2022
75736b7
Merge branch 'finish-card-component' of github.com:uiowa/uids into fi…
bspeare Oct 20, 2022
5baee16
Commented out container queries
bspeare Oct 20, 2022
a92f528
Undoing scss that was making media--cover work
bspeare Oct 20, 2022
ed71ce9
Adjusted mobile margins on media for left/right padded
bspeare Oct 20, 2022
27e4e7c
Added circle button as fallback for no text.
pyrello Oct 20, 2022
036bc74
Added square to aspect ratio iframe setting
bspeare Oct 20, 2022
043ec3c
Merge branch 'finish-card-component' of github.com:uiowa/uids into fi…
bspeare Oct 20, 2022
1562b62
added button circle prop
GaryRidgway Oct 20, 2022
7ac8615
Merge branch 'finish-card-component' of github.com:uiowa/uids into fi…
GaryRidgway Oct 20, 2022
2e22bbb
Updated default story to be more robust.
pyrello Oct 20, 2022
d84e1ed
Removed unused code
bspeare Oct 20, 2022
a4c611d
Removed more unused code and updated icon story
bspeare Oct 20, 2022
371acef
Updated icon link
bspeare Oct 20, 2022
62b994d
Removed more unused code
bspeare Oct 20, 2022
1e3c44f
Renamed and refactored stories based on changing the default.
pyrello Oct 20, 2022
0215743
Updated readme to reflect that we are using yarn now.
pyrello Oct 20, 2022
304e527
Reorganized some things in the sidebar. Set the actions panel to be h…
pyrello Oct 20, 2022
5b5c08a
Changed the way we are setting the default viewport for cards. Some a…
pyrello Oct 20, 2022
950fb38
Added breakpoint for button position
bspeare Oct 21, 2022
3925d7c
Added small cleanup and a todo link
bspeare Oct 21, 2022
bde611f
formatting adjustment
bspeare Oct 21, 2022
8dbb0ab
refactoring scss
GaryRidgway Oct 21, 2022
2fada4b
stylesheet consistency
GaryRidgway Oct 21, 2022
7bc97e2
One last pass for SCSS cleanup. Added new comment styles to try them …
pyrello Oct 21, 2022
bb4b3d9
Missed an important dot.
pyrello Oct 21, 2022
f4fadd1
hide FA story
joewhitsitt Oct 26, 2022
984d983
adjust footer button margin
joewhitsitt Oct 26, 2022
cceaf46
Moved footer outside of card__body
bspeare Oct 27, 2022
dc5e33c
Didn't mean to commit this
bspeare Oct 27, 2022
45547ff
Possible fix for button bottom issue
bspeare Oct 27, 2022
4a98272
added object fit to image to be platform agnostic
joewhitsitt Oct 27, 2022
58508af
move to display options group
joewhitsitt Oct 27, 2022
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dist-ssr
coverage
*.local
storybook-static
package-lock.json

/cypress/videos/
/cypress/screenshots/
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
14.15.1
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"singleAttributePerLine": true
}
7 changes: 6 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ module.exports = {
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
{
name: "@storybook/addon-essentials",
options: {
actions: false,
},
},
"@storybook/preset-scss",
"@whitespace/storybook-addon-html",
],
Expand Down
22 changes: 21 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ import '../src/assets/scss/headings.scss';
import '../src/assets/scss/paragraph.scss';
import '../src/assets/scss/lists.scss';

import { MINIMAL_VIEWPORTS } from '@storybook/addon-viewport';

const customViewports = {
// This is an example of a custom defined viewport.
// horizontalCard: {
// name: 'Horizontal card',
// styles: {
// width: '780px',
// height: '350px',
// },
// },
};

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
backgrounds: {
Expand Down Expand Up @@ -82,4 +95,11 @@ export const parameters = {
date: /Date$/,
},
},
}
// More on viewports https://storybook.js.org/docs/react/essentials/viewport.
viewport: {
viewports: {
...MINIMAL_VIEWPORTS,
...customViewports,
},
},
};
49 changes: 30 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,51 @@ The node-gyp package requires a C compiler. If you notice node-gyp errors after
### Install dependencies

```sh
npm ci
yarn install
```

### Start the local server
```sh
yarn install
```

### Start the local server OR start Storybook
Compile and hot-reload for development.

```sh
npm run dev
yarn dev
```

**OR**

```sh
yarn storybook
```

The command will output the server URL to visit in your browser, ex. http://localhost:3000.

### Type-Check, Compile and Minify for Production

```sh
npm run build
yarn build
```

### Run Unit Tests with [Vitest](https://vitest.dev/)

```sh
npm run test:unit
yarn test:unit
```

### Run End-to-End Tests with [Cypress](https://www.cypress.io/)

```sh
npm run build
npm run test:e2e # or `npm run test:e2e:ci` for headless testing
yarn build
yarn test:e2e # or `npm run test:e2e:ci` for headless testing
```

### Lint with [ESLint](https://eslint.org/)

```sh
npm run lint
yarn lint
```

## Contributing
Expand All @@ -62,24 +73,24 @@ While we have not done a perfect job of applying any of these standards, we reco
### Creating a PR
When your feature branch is ready for testing or after you have made any requested changes, you need to run the following command to make sure that the distribution files get updated:
```bash
npm run dist
yarn dist
```

### Creating a Release
The following is an example of the workflow and not meant to be copied and pasted verbatim. Please review the summary at https://semver.org/ to understand which type of release you should be creating. The version numbers you will use when you are actually going through this process will depend on the current version number and what type of release you are creating.

To see the full options for the command, run `npm version --help`.
1. `git checkout 3.x` - Make sure you are on the `3.x` branch.
1. `git checkout 4.x` - Make sure you are on the `4.x` branch.
2. `git pull` - Make sure you have the most recent updates.
4. `npm version patch -m "https://github.com/uiowa/uids/compare/v3.1.0...v3.1.1"`
5. `git push`
6. `git push --tags`
7. Go to https://github.com/uiowa/uids/releases/new.
8. Enter the "Tag version" using the version _with_ the `v` at the front (e.g. "v3.1.1").
9. Enter the "Release title" using the version _without_ the `v` at the front (e.g. "3.1.1").
10. Paste in the compare link into the description area: `https://github.com/uiowa/uids/compare/v3.1.0...v3.1.1`
11. Click the "Publish release" button.
12. Profit!
3. `npm version patch -m "https://github.com/uiowa/uids/compare/v3.1.0...v3.1.1"`
4. `git push`
5. `git push --tags`
6. Go to https://github.com/uiowa/uids/releases/new.
7. Enter the "Tag version" using the version _with_ the `v` at the front (e.g. "v3.1.1").
8. Enter the "Release title" using the version _without_ the `v` at the front (e.g. "3.1.1").
9. Paste in the compare link into the description area: `https://github.com/uiowa/uids/compare/v3.1.0...v3.1.1`
10. Click the "Publish release" button.
11. Profit!

### Components
Learn about Fractal components here: https://fractal.build/guide/components/#what-defines-a-component. Note that this project uses Twig (`.twig`) instead of Handlebars (`.hbs`).
Expand Down
Binary file added src/assets/images/viewbook/sections/herky2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions src/components/banner/Banner.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import UidsBanner from './Banner.vue'
import media_image from '../../assets/images/viewbook/sections/122.jpg'

export default {
title: 'Components/Banner',
component: UidsBanner,
argTypes: {
media: {
control: 'text',
},
},
}

const Template = (args) => ({
components: { UidsBanner },
setup() {
return { args }
},
template: `
<uids-banner
:title="args.title"
:image="args.image"
:url="args.url"
>
<template #media v-if="args.media"><span v-html="args.media" ></span></template>
<template #default><div v-html="args.default"></div></template>
</uids-banner>
`
})

export const Default = Template.bind({})

Default.args = {
media: '<img src="' + media_image + '" alt="Alt">',
title: 'Write Your Story',
url: 'https://uiowa.edu',
}
38 changes: 20 additions & 18 deletions src/components/banner/Banner.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<script setup lang="ts">
import UidsHeadline from '../headline/Headline.vue';
import UidsButton from '../button/Button.vue';
import { computed } from 'vue';
import Background from "../shared/background";
import { computed, useSlots } from 'vue'
import { className } from '../utlity'
import UidsHeadline from '../headline/Headline.vue'
import UidsButton from '../button/Button.vue'
import Background from '../shared/background'
import '../background/background.scss'

const name = 'uids-banner'

Expand All @@ -11,9 +13,6 @@ const props = defineProps({
image: { type: String },
url: { type: String },
text: { type: String },
headline_settings: {
type: Object,
},
button_text: {
type: String,
},
Expand All @@ -34,22 +33,25 @@ const props = defineProps({
// title_classes?: string
// button_link?: string
// button_text?: string
})
});

// Compose a string out of the classes passed to the component.
const classes = computed(() => {
let classes = ["banner"];
let classes = ['banner'];

['overlay_color', 'overlay_to', 'size', 'vertical_alignment', 'horizontal_alignment'].forEach((prop) => {
if (props[prop] === true) {
classes.push(`banner--${ className(prop) }`);
}
});

Background.addBackgroundClass(classes, props);

if (props.url) {
classes.push('click-container')
}
// @todo Add classes.
Array.prototype.forEach.call(['overlay_color', 'overlay_to', 'size', 'vertical_alignment', 'horizontal_alignment'], setting => {
// @todo Check if the setting is set and then add a class for it.
classes.push('banner--' + props[setting])
}
);
Background.addBackgroundClass(classes, props);
return classes.join(" ");

return classes;
})

const getHeadlineSettings = computed(() => {
Expand Down Expand Up @@ -83,7 +85,7 @@ const getHeadlineSettings = computed(() => {
<uids-headline
v-if="title"
:level="getHeadlineSettings.level"
:class="banner_title_classes"
:class="getHeadlineSettings.classes"
:href="url"
>{{ title }}</uids-headline>
</slot>
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/Button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Borderless from "../shared/borderless";

// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
export default {
title: 'Basic/Button',
title: 'Elements/Button',
component: UidsButton,
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
argTypes: {
Expand Down
1 change: 0 additions & 1 deletion src/components/button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ const classes = computed(() => {
classes.push(`bttn--${ className(props.size)}`);
}

console.log(slots.default);
if (!slots.default) {
classes.push(`bttn--no-text`);
}
Expand Down
28 changes: 28 additions & 0 deletions src/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,34 @@
}
}

.bttn--circle {
padding: .55rem .7em;
border-radius: 50%;
transform: none;
line-height: 1;

&:after {
left: 0;
top: 0;
height: 100%;
width: 100%;
border-radius: 50%;
background-color: transparent;
transition: border-color .3s ease-in-out;
transform: none;
position: absolute;
}

&:hover:after,
&:focus:after {
transform: none;
transition: none;
border: 3px solid;
border-color: inherit;
background-color: transparent;
}
}

.bttn--large {
padding: 1.5rem 2.5rem 1.5rem;
// @todo Change this to use css variables, calc the size.
Expand Down
Loading