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

feat(#134): update civitheme_library to @civictheme/uikit #135

Merged
merged 4 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions cypress/support/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Cypress.Commands.add('standardComponentTest', (component, context) => {
const { axeRules, imageMatchOptions, mountOptions, options } = context

// Add CSS assets.
require('civictheme/dist/civictheme.css')
require('civictheme/dist/civictheme.variables.css')
require('@civictheme/uikit/dist/civictheme.css')
require('@civictheme/uikit/dist/civictheme.variables.css')

// see: https://test-utils.vuejs.org/guide/
cy.mount(component, mountOptions)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"*.{css,scss,vue}": "stylelint"
},
"dependencies": {
"civictheme": "git+https://github.com/Realityloop/civictheme_library.git"
"@civictheme/uikit": "git+https://github.com/Realityloop/civictheme_library.git"
},
"devDependencies": {
"@babel/core": "7.20.2",
Expand All @@ -74,7 +74,7 @@
"siroc": "0.16.0",
"stylelint": "^14.16.1",
"vue-jest": "3.0.7",
"vue-template-compiler": "2.7.14"
"vue-template-compiler": "2.7.16"
},
"peerDependencies": {
"@nuxtjs/svg": "^0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion src/components/BackToTop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {

created() {
try {
if (process.client) require('civictheme/components/00-base/scrollspy/scrollspy')
if (process.client) require('@civictheme/uikit/components/00-base/scrollspy/scrollspy')
}
catch(e) {
// eslint-disable-next-line
Expand Down
6 changes: 3 additions & 3 deletions src/components/Collapsible.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export default {
// If the component has been mounted and $el is available
if (this.$el) {
// Delete the cached module for collapsible
delete require.cache[require.resolve('civictheme/components/00-base/collapsible/collapsible')]
delete require.cache[require.resolve('@civictheme/uikit/components/00-base/collapsible/collapsible')]

// Require the collapsible module again
require('civictheme/components/00-base/collapsible/collapsible')
require('@civictheme/uikit/components/00-base/collapsible/collapsible')
}
}
catch(e) {
Expand All @@ -47,7 +47,7 @@ export default {

// Delete require cache for collapsible component
beforeDestroy() {
delete require.cache[require.resolve('civictheme/components/00-base/collapsible/collapsible')]
delete require.cache[require.resolve('@civictheme/uikit/components/00-base/collapsible/collapsible')]
},

methods: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Flyout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</template>

<script>
import CivicThemeFlyout from 'civictheme/components/00-base/flyout/flyout'
import CivicThemeFlyout from '@civictheme/uikit/components/00-base/flyout/flyout'

export default {
props: {
Expand Down
3 changes: 1 addition & 2 deletions src/components/GroupFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="container" data-ct-group-filter-element="">
<div class="row">
<div class="col-xxs-12">
<div class="row row--no-wrap">
<div class="row row--no-wrap ct-group-filter__row">
<div class="col col--no-grow">
<div class="ct-align-middle">
<CTLabel class="ct-group-filter__title" :theme="theme">
Expand All @@ -21,7 +21,6 @@
class="ct-group-filter__filters"
data-ct-group-filter-filters=""
:items="filters"
size="large"
:theme="theme"
type="horizontal"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default {
},

computed: {
svg: ({ symbol }) => () => import(`civictheme/assets/icons/${symbol}.svg?inline`)
svg: ({ symbol }) => () => import(`@civictheme/uikit/assets/icons/${symbol}.svg?inline`)
},
}
</script>
2 changes: 1 addition & 1 deletion src/components/Menu.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CTMenu from './Menu.vue'
import 'civictheme/components/00-base/collapsible/collapsible'
import '@civictheme/uikit/components/00-base/collapsible/collapsible'

export default {
title: 'CivicTheme/Menu',
Expand Down
12 changes: 6 additions & 6 deletions src/components/MenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ export default {
// Attach client side only javascript.
if (!process.client) return
if (this.isCollapsible) {
delete require.cache[require.resolve('civictheme/components/00-base/collapsible/collapsible')]
require('civictheme/components/00-base/collapsible/collapsible')
delete require.cache[require.resolve('@civictheme/uikit/components/00-base/collapsible/collapsible')]
require('@civictheme/uikit/components/00-base/collapsible/collapsible')
}

if (this.isFlyout) {
delete require.cache[require.resolve('civictheme/components/00-base/flyout/flyout')]
require('civictheme/components/00-base/flyout/flyout')
delete require.cache[require.resolve('@civictheme/uikit/components/00-base/flyout/flyout')]
require('@civictheme/uikit/components/00-base/flyout/flyout')
}
}
catch(e) {
Expand All @@ -129,8 +129,8 @@ export default {
},

beforeDestroy() {
if (this.isCollapsible) delete require.cache[require.resolve('civictheme/components/00-base/collapsible/collapsible')]
if (this.isFlyout) delete require.cache[require.resolve('civictheme/components/00-base/flyout/flyout')]
if (this.isCollapsible) delete require.cache[require.resolve('@civictheme/uikit/components/00-base/collapsible/collapsible')]
if (this.isFlyout) delete require.cache[require.resolve('@civictheme/uikit/components/00-base/flyout/flyout')]
Decipher marked this conversation as resolved.
Show resolved Hide resolved
}
}
</script>
2 changes: 1 addition & 1 deletion src/components/MobileNavigation.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CTMboileNavigation from './MobileNavigation.vue'
import 'civictheme/components/00-base/flyout/flyout'
import '@civictheme/uikit/components/00-base/flyout/flyout'

export default {
title: 'CivicTheme/Organisms/Mobile Navigation',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navigation.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CTNavigation from './Navigation.vue'
import 'civictheme/components/00-base/collapsible/collapsible'
import '@civictheme/uikit/components/00-base/collapsible/collapsible'

export default {
title: 'CivicTheme/Organisms/Navigation',
Expand Down
6 changes: 3 additions & 3 deletions src/components/Popover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default {
mounted() {
try {
if (this.$el) {
delete require.cache[require.resolve('civictheme/components/00-base/collapsible/collapsible')]
require('civictheme/components/00-base/collapsible/collapsible')
delete require.cache[require.resolve('@civictheme/uikit/components/00-base/collapsible/collapsible')]
require('@civictheme/uikit/components/00-base/collapsible/collapsible')
}
}
catch(e) {
Expand All @@ -57,7 +57,7 @@ export default {
},

beforeDestroy() {
delete require.cache[require.resolve('civictheme/components/00-base/collapsible/collapsible')]
delete require.cache[require.resolve('@civictheme/uikit/components/00-base/collapsible/collapsible')]
}
}
</script>
4 changes: 2 additions & 2 deletions src/nuxt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { join } from 'path'
export default function () {
// Add CivicTheme CSS.
this.nuxt.options.css = this.nuxt.options.css || []
this.nuxt.options.css.push('civictheme/dist/civictheme.css')
this.nuxt.options.css.push('civictheme/dist/civictheme.variables.css')
this.nuxt.options.css.push('@civictheme/uikit/dist/civictheme.css')
this.nuxt.options.css.push('@civictheme/uikit/dist/civictheme.variables.css')

// Add plugin.
this.addPlugin(join(__dirname, 'plugin.client.mjs'))
Expand Down
2 changes: 1 addition & 1 deletion src/nuxt/plugin.client.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import 'civictheme/dist/civictheme.js'
import '@civictheme/uikit/dist/civictheme.js'
2 changes: 1 addition & 1 deletion test/components/Menu.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import CTMenu from '../../src/components/Menu.vue'
import CTMenuItem from '../../src/components/MenuItem.vue'
CTMenuItem.components = { CTLink }

import 'civictheme/components/00-base/collapsible/collapsible'
import '@civictheme/uikit/components/00-base/collapsible/collapsible'

const propsData = {
items: [
Expand Down
2 changes: 1 addition & 1 deletion test/components/Navigation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import CTNavigation from '../../src/components/Navigation.vue'
CTMenu.components = { CTMenuItem }
CTMenuItem.components = { CTLink }

import 'civictheme/components/00-base/collapsible/collapsible'
import '@civictheme/uikit/components/00-base/collapsible/collapsible'

const propsData = {
items: [
Expand Down
Loading
Loading