Skip to content

Commit

Permalink
Merge branch 'main' into APPS-3045_mobile_datefilter
Browse files Browse the repository at this point in the history
  • Loading branch information
farosFreed authored Nov 21, 2024
2 parents 556f1e6 + ad36261 commit 93388f5
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 32 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [3.35.0](https://github.com/UCLALibrary/ucla-library-website-components/compare/v3.34.0...v3.35.0) (2024-11-21)


### Features

* APPS-3067 add ishighlighted prop to BlockTag.vue ([#656](https://github.com/UCLALibrary/ucla-library-website-components/issues/656)) ([7b2c3a7](https://github.com/UCLALibrary/ucla-library-website-components/commit/7b2c3a736b3c2551dc3fbb61566241878a889838))

# [3.34.0](https://github.com/UCLALibrary/ucla-library-website-components/compare/v3.33.0...v3.34.0) (2024-11-21)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ucla-library-website-components",
"type": "module",
"private": false,
"version": "3.34.0",
"version": "3.35.0",
"main": "./dist/ucla-library-website-components.umd.cjs",
"module": "./dist/ucla-library-website-components.js",
"style": "./dist/style.css",
Expand Down
13 changes: 6 additions & 7 deletions src/lib-components/BlockTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { computed, defineAsyncComponent } from 'vue'
import { useTheme } from '@/composables/useTheme'
// PROPS & DATA
const { label, iconName, isSecondary } = defineProps({
const { label, iconName, isSecondary, isHighlighted } = defineProps({
label: {
type: String,
default: '' // Text displayed on the tag or pill.
Expand All @@ -19,11 +19,10 @@ const { label, iconName, isSecondary } = defineProps({
type: Boolean,
default: false
},
// TODO ADD PROP TO HANDLE isSelected prop
// isSelected: {
// type: Boolean,
// default: false
// },
isHighlighted: {
type: Boolean,
default: false
},
})
// THEME
Expand Down Expand Up @@ -63,7 +62,7 @@ const BlockTagIcons: any = {
}
const classes = computed(() => {
return ['block-tag', theme?.value || '', isSecondary ? '' : 'primary']
return ['block-tag', theme?.value || '', isSecondary ? '' : 'primary', isHighlighted ? 'highlighted' : '']
})
</script>
Expand Down
76 changes: 54 additions & 22 deletions src/stories/BlockTag.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
import { computed } from 'vue'
import BlockTag from '@/lib-components/BlockTag'

/**
* A component to display a non-interactive tag with a label and an optional icon. <br>
* <sub>(For an interactive tag that can be clicked to remove it from a list, try BlockRemoveSearchFilter). </sub>
*
* Props:
* - <b>label</b>: A string representing the text to display in the tag
* - <b>iconName</b>: A string representing the name of the icon to display in the tag. <br>
* <sub>Valid names: <i>SvgIconGuest, SvgIconFilm, SvgIconTV, SvgIconFilmreel, SvgIconDigital, SvgIconOnline, SvgIconFamilyFriendly</i></sub>
* - <b>isSecondary</b>: A boolean value to determine if the tag is styled with primary or secondary styles
*
* Props added 2024-11-19:
*
* - <b>isHighlighted</b>: A boolean value to determine if the tag is styled with highlight styles
*/
export default {
title: 'BLOCK / Tag',
component: BlockTag
Expand Down Expand Up @@ -38,6 +52,24 @@ export function Default() {
}
}

// note: currently highlighted styles for default are placeholder styles / not yet implemented
export function DefaultHighlighted() {
return {
data() {
return {
...defaultmock,
}
},
components: { BlockTag },
template: `
<block-tag
:label="label"
:isHighlighted="true"
/>
`,
}
}

export function PrimaryFTVA() {
return {
data() {
Expand Down Expand Up @@ -104,25 +136,25 @@ export function SecondaryFTVANoIcon() {
}
}

// TODO
// export function SecondaryFTVASelected() {
// return {
// data() {
// return {
// ...ftvamockwLinkLabel
// }
// },
// provide() {
// return {
// theme: computed(() => 'ftva'),
// }
// },
// components: { BlockTag },
// template: `
// <block-tag
// :label="label"
// isSecondary="true"
// />
// `,
// }
// }
export function SecondaryFTVAHighlighted() {
return {
data() {
return {
...ftvamock
}
},
provide() {
return {
theme: computed(() => 'ftva'),
}
},
components: { BlockTag },
template: `
<block-tag
:label="label"
isSecondary="true"
isHighlighted="true"
/>
`,
}
}
11 changes: 11 additions & 0 deletions src/styles/default/_block-tag.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,15 @@
.label {
color: #{$primary-blue-05};
}

// primary colors & styles
&.highlighted {
color: #{$white};
background-color: var(--color-default-cyan-03);
border: none;

.label {
color: #{$white};
}
}
}
9 changes: 7 additions & 2 deletions src/styles/ftva/_block-tag.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.ftva.block-tag {
@include ftva-tags;
// secondary colors and styles
background-color: transparent;
border: 1.5px solid $subtitle-grey;
border-radius: 16px;
color: $subtitle-grey;
padding: 8px 16px;
height: 32px;
// secondary colors and styles
// focused and disabled,styled in blockRemoveSearchFilter

.label {
Expand Down Expand Up @@ -35,7 +35,12 @@
}
}

&.is-selected {
&.highlighted {
background-color: $page-blue;
color: $subtitle-grey;
border: 1.5px solid $subtitle-grey;
.label {
color: $subtitle-grey;
}
}
}

0 comments on commit 93388f5

Please sign in to comment.