diff --git a/.eslintignore b/.eslintignore index c50c1e227f..fdc2532e08 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1 @@ -build/*.js -config/*.js -config/env/*.js -server/index.template.html -test/unit/karma.conf.js src/lib/**/*.js diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 76% rename from .eslintrc.js rename to .eslintrc.cjs index 04da38b10d..2060f260c4 100644 --- a/.eslintrc.js +++ b/.eslintrc.cjs @@ -4,11 +4,14 @@ const fs = require('fs'); const isProd = process.env.NODE_ENV === 'production'; +// resolve path +const resolve = dir => path.resolve(__dirname, dir); + let schema; // Use build/schema.graphql as the schema definition. That file only exists after running node build/fetch-schema.js try { - schema = fs.readFileSync(path.join(__dirname, 'build/schema.graphql')).toString(); + schema = fs.readFileSync(resolve('build/schema.graphql')).toString(); } catch (e) { console.warn(e); schema = 'type Query { hello: String }'; @@ -21,12 +24,15 @@ const graphqlOptions = { module.exports = { root: true, + reportUnusedDisableDirectives: true, parserOptions: { - parser: '@babel/eslint-parser', - sourceType: 'module' + ecmaVersion: 2022, + sourceType: 'module', }, env: { + node: true, browser: true, + es2022: true, }, extends: ['plugin:vue/strongly-recommended', 'airbnb-base', 'plugin:storybook/recommended'], // required to lint *.vue files @@ -38,12 +44,15 @@ module.exports = { // check if imports actually resolve settings: { 'import/resolver': { - webpack: { - config: './build/webpack.base.conf.js' - }, node: { extensions: ['.js', '.mjs'] - } + }, + alias: { + map: [ + ['#src', resolve('src')], + ], + extensions: ['.js', '.mjs', '.vue'], + }, } }, // add your custom rules here @@ -64,6 +73,10 @@ module.exports = { 'import/no-extraneous-dependencies': ['error', { optionalDependencies: ['test/unit/index.js'] }], + // allow unresolved imports for svg files with a ?url suffix + 'import/no-unresolved': ['error', { ignore: ['\\.svg\\?url$'] }], + // allow files with only one named export + 'import/prefer-default-export': 'off', // allow debugger during development 'no-debugger': isProd ? 'error' : 'off', // allow console during development @@ -93,13 +106,17 @@ module.exports = { 'graphql/required-fields': ['error', { ...graphqlOptions, requiredFields: ['id', 'key'] }], // require component names that match the file name - "vue/require-name-property": "error", - "vue/match-component-file-name": [ - "error", + 'vue/require-name-property': 'error', + 'vue/match-component-file-name': [ + 'error', { - extensions: ["vue"], + extensions: ['vue'], shouldMatchCase: true, }, ], + + // require v-for keys on template root + 'vue/no-v-for-template-key': 'off', + 'vue/no-v-for-template-key-on-child': 'error', } }; diff --git a/.gitignore b/.gitignore index c05a491218..e27077dd23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ .DS_Store node_modules/ + +# Temporary files dist/ -npm-debug.log* coverage/ test/e2e/screenshots test/e2e/results @@ -10,6 +11,11 @@ build/schema.graphql .nyc_output/ .lighthouseci/ lhci/ +vite.config.js.* + +# Logs +npm-debug.log* +*storybook.log # Editor directories and files .idea diff --git a/.nvmrc b/.nvmrc index 7fd023741b..9de2256827 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16.15.0 +lts/iron diff --git a/.storybook/main.js b/.storybook/main.js index c812937de8..2b8fd156ba 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -1,39 +1,18 @@ -const path = require('path'); - -module.exports = { - stories: [ - './stories/**/*.stories.@(js|mdx)' - ], - addons: [ - '@storybook/addon-essentials', - '@storybook/addon-links', - '@storybook/addon-a11y', - '@storybook/addon-postcss', - '@storybook/addon-storysource' - ], - webpackFinal: async (config) => { - config.module.rules.push({ - test: /\,css&/, - exclude: [/\.module\.css$/, /@storybook/], - use: [ - "style-loader", - { - loader: "css-loader", - options: { importLoaders: 1, sourceMap: false }, - }, - { - loader: 'postcss-loader', - options: { - ident: 'postcss', - plugins: [ - require('tailwindcss'), - require('autoprefixer') - ] - } - } - ], - include: path.resolve(__dirname, '../'), - }) - return config - } -} +/** @type { import('@storybook/vue3-vite').StorybookConfig } */ +const config = { + stories: ["./stories/**/*.stories.@(js|jsx|mjs|ts|tsx)"], + addons: [ + "@storybook/addon-links", + "@storybook/addon-essentials", + "@chromatic-com/storybook", + "@storybook/addon-interactions", + ], + framework: { + name: "@storybook/vue3-vite", + options: {}, + }, + docs: { + autodocs: "tag", + }, +}; +export default config; diff --git a/.storybook/manager.js b/.storybook/manager.js index 9d95268ff6..1aecaed23c 100644 --- a/.storybook/manager.js +++ b/.storybook/manager.js @@ -1,4 +1,4 @@ -import { addons } from '@storybook/addons'; +import { addons } from '@storybook/manager-api'; import { create } from '@storybook/theming/create'; const theme = create({ diff --git a/.storybook/mixins/kv-auth0-story-mixin.js b/.storybook/mixins/kv-auth0-story-mixin.js index e45bf32f98..3de450b2b6 100644 --- a/.storybook/mixins/kv-auth0-story-mixin.js +++ b/.storybook/mixins/kv-auth0-story-mixin.js @@ -1,4 +1,4 @@ -import { MockKvAuth0 } from '@/util/KvAuth0'; +import { MockKvAuth0 } from '#src/util/KvAuth0'; export default { provide: { diff --git a/.storybook/mock-data/loan-data-mock.js b/.storybook/mock-data/loan-data-mock.js index a5badf387c..e7c32658bb 100644 --- a/.storybook/mock-data/loan-data-mock.js +++ b/.storybook/mock-data/loan-data-mock.js @@ -2,194 +2,206 @@ * Array of 3 distinct loans */ export default [ - { - "id": 1975833, - "status": "fundraising", - "name": "Alan", - "borrowerCount": 1, - "geocode": { - "city": "Kochkor district, Naryn region", - "state": "Naryn Region", - "country": { + { + "id": 1975833, + "status": "fundraising", + "name": "Alan", + "borrowerCount": 1, + "geocode": { + "city": "Kochkor district, Naryn region", + "state": "Naryn Region", + "country": { "isoCode": "KG", "name": "Kyrgyzstan", "region": "Asia", "__typename": "Country" - }, - "__typename": "Geocode" }, - "use": "to purchase heifers to increase headcount of cattle and sales of organic milk.", - "activity": { - "id": 61, - "name": "Dairy", - "__typename": "Activity" - }, - "sector": { - "id": 1, - "name": "Agriculture", - "__typename": "Sector" - }, - "whySpecial": "It supports organic farming and includes a lower interest rate.", - "lenderRepaymentTerm": 26, - "loanAmount": "600.00", - "unreservedAmount": "75.00", - "loanFundraisingInfo": { - "fundedAmount": '525.00', - "reservedAmount": '0.00', - "isExpiringSoon": false, - "__typename": "LoanFundraisingInfo" - }, - "plannedExpirationDate": "2020-08-12T22:10:06Z", - "matchingText": "", - "userProperties": { - "favorited": false, - "lentTo": false, - "__typename": "LoanUserProperties" - }, - "lenders": { - "totalCount": 34, - "__typename": "LenderCollection" - }, - "partnerName": "Bai Tushum Bank", - "__typename": "LoanPartner", - "image": { - "id": 3838911, - "default": "https://www-dev-kiva-org.freetls.fastly.net/img/w480h300/9673d0722a7675b9b8d11f90849d9b44.jpg", - "retina": "https://www-dev-kiva-org.freetls.fastly.net/img/w960h600/9673d0722a7675b9b8d11f90849d9b44.jpg", - "hash": "9673d0722a7675b9b8d11f90849d9b44", - "__typename": "Image" - }, - "anonymizationLevel": "none", - "fullLoanUse": "A loan of $600 helps to purchase heifers to increase headcount of cattle and sales of organic milk.", - "fundraisingTimeLeft": "0 days", - "fundraisingPercent": .875, - "fundraisingTimeLeftMilliseconds": 123456789, - "tags": [ - "user_favorite" - ], - }, - { - "id": 1976581, - "status": "fundraising", - "name": "Alan", - "borrowerCount": 1, - "geocode": { - "city": "Lyantonde", - "state": "Central Region", - "country": { + "__typename": "Geocode" + }, + "use": "to purchase heifers to increase headcount of cattle and sales of organic milk.", + "activity": { + "id": 61, + "name": "Dairy", + "__typename": "Activity" + }, + "sector": { + "id": 1, + "name": "Agriculture", + "__typename": "Sector" + }, + "whySpecial": "It supports organic farming and includes a lower interest rate.", + "lenderRepaymentTerm": 26, + "loanAmount": "600.00", + "unreservedAmount": "75.00", + "loanFundraisingInfo": { + "fundedAmount": '525.00', + "reservedAmount": '0.00', + "isExpiringSoon": false, + "__typename": "LoanFundraisingInfo" + }, + "plannedExpirationDate": "2020-08-12T22:10:06Z", + "matchingText": "", + "userProperties": { + "favorited": false, + "lentTo": false, + "__typename": "LoanUserProperties" + }, + "lenders": { + "totalCount": 34, + "__typename": "LenderCollection" + }, + "partnerName": "Bai Tushum Bank", + "__typename": "LoanPartner", + "image": { + "id": 3838911, + "default": "https://www-dev-kiva-org.freetls.fastly.net/img/w480h300/9673d0722a7675b9b8d11f90849d9b44.jpg", + "url": "https://www-dev-kiva-org.freetls.fastly.net/img/w150h138/9673d0722a7675b9b8d11f90849d9b44.jpg", + "retinaUrl": "https://www-dev-kiva-org.freetls.fastly.net/img/w300h276/9673d0722a7675b9b8d11f90849d9b44.jpg", + "lgUrl": "https://www-dev-kiva-org.freetls.fastly.net/img/w244h185/9673d0722a7675b9b8d11f90849d9b44.jpg", + "lgRetinaUrl": "https://www-dev-kiva-org.freetls.fastly.net/img/w488h370/9673d0722a7675b9b8d11f90849d9b44.jpg", + "retina": "https://www-dev-kiva-org.freetls.fastly.net/img/w960h600/9673d0722a7675b9b8d11f90849d9b44.jpg", + "hash": "9673d0722a7675b9b8d11f90849d9b44", + "__typename": "Image" + }, + "anonymizationLevel": "none", + "fullLoanUse": "A loan of $600 helps to purchase heifers to increase headcount of cattle and sales of organic milk.", + "fundraisingTimeLeft": "0 days", + "fundraisingPercent": .875, + "fundraisingTimeLeftMilliseconds": 123456789, + "tags": [ + "user_favorite" + ], + }, + { + "id": 1976581, + "status": "fundraising", + "name": "Alan", + "borrowerCount": 1, + "geocode": { + "city": "Lyantonde", + "state": "Central Region", + "country": { "isoCode": "UG", "name": "Uganda", "region": "Africa", "__typename": "Country" - }, - "__typename": "Geocode" - }, - "use": "to buy cattle for fattening to increase sales and generate income.", - "activity": { - "id": 56, - "name": "Cattle", - "__typename": "Activity" - }, - "sector": { - "id": 1, - "name": "Agriculture", - "__typename": "Sector" }, - "whySpecial": "It helps rural farmers to increase productivity and their income.", - "lenderRepaymentTerm": 14, - "loanAmount": "1350.00", - "loanFundraisingInfo": { - "fundedAmount": "1125.00", - "reservedAmount": "0.00", - "isExpiringSoon": false, - "__typename": "LoanFundraisingInfo" - }, - "plannedExpirationDate": "2020-08-11T12:40:10Z", - "matchingText": "", - "userProperties": { - "favorited": false, - "lentTo": false, - "__typename": "LoanUserProperties" - }, - "lenders": { - "totalCount": 45, - "__typename": "LenderCollection" - }, - "partnerName": "UGAFODE Microfinance", - "__typename": "LoanPartner", - "image": { - "id": 3833986, - "default": "https://www-dev-kiva-org.freetls.fastly.net/img/w480h300/6638894152e5ea6f0e65423b7b6cd9bb.jpg", - "retina": "https://www-dev-kiva-org.freetls.fastly.net/img/w960h600/6638894152e5ea6f0e65423b7b6cd9bb.jpg", - "hash": "6638894152e5ea6f0e65423b7b6cd9bb", - "__typename": "Image" - }, - "anonymizationLevel": "none", - "fullLoanUse": "A loan of $1,350 helps to buy cattle for fattening to increase sales and generate income.", - "fundraisingTimeLeft": "0 days", - "fundraisingPercent": 40, - "fundraisingTimeLeftMilliseconds": 123456789, - }, - { - "id": 1977174, - "status": "fundraising", - "name": "Alan", - "borrowerCount": 1, - "geocode": { - "city": "Elbasan", - "state": "Elbasan County", - "country": { + "__typename": "Geocode" + }, + "use": "to buy cattle for fattening to increase sales and generate income.", + "activity": { + "id": 56, + "name": "Cattle", + "__typename": "Activity" + }, + "sector": { + "id": 1, + "name": "Agriculture", + "__typename": "Sector" + }, + "whySpecial": "It helps rural farmers to increase productivity and their income.", + "lenderRepaymentTerm": 14, + "loanAmount": "1350.00", + "loanFundraisingInfo": { + "fundedAmount": "1125.00", + "reservedAmount": "0.00", + "isExpiringSoon": false, + "__typename": "LoanFundraisingInfo" + }, + "plannedExpirationDate": "2020-08-11T12:40:10Z", + "matchingText": "", + "userProperties": { + "favorited": false, + "lentTo": false, + "__typename": "LoanUserProperties" + }, + "lenders": { + "totalCount": 45, + "__typename": "LenderCollection" + }, + "partnerName": "UGAFODE Microfinance", + "__typename": "LoanPartner", + "image": { + "id": 3838911, + "default": "https://www-dev-kiva-org.freetls.fastly.net/img/w480h300/9673d0722a7675b9b8d11f90849d9b44.jpg", + "url": "https://www-dev-kiva-org.freetls.fastly.net/img/w150h138/9673d0722a7675b9b8d11f90849d9b44.jpg", + "retinaUrl": "https://www-dev-kiva-org.freetls.fastly.net/img/w300h276/9673d0722a7675b9b8d11f90849d9b44.jpg", + "lgUrl": "https://www-dev-kiva-org.freetls.fastly.net/img/w244h185/9673d0722a7675b9b8d11f90849d9b44.jpg", + "lgRetinaUrl": "https://www-dev-kiva-org.freetls.fastly.net/img/w488h370/9673d0722a7675b9b8d11f90849d9b44.jpg", + "retina": "https://www-dev-kiva-org.freetls.fastly.net/img/w960h600/9673d0722a7675b9b8d11f90849d9b44.jpg", + "hash": "9673d0722a7675b9b8d11f90849d9b44", + "__typename": "Image" + }, + "anonymizationLevel": "none", + "fullLoanUse": "A loan of $1,350 helps to buy cattle for fattening to increase sales and generate income.", + "fundraisingTimeLeft": "0 days", + "fundraisingPercent": 40, + "fundraisingTimeLeftMilliseconds": 123456789, + }, + { + "id": 1977174, + "status": "fundraising", + "name": "Alan", + "borrowerCount": 1, + "geocode": { + "city": "Elbasan", + "state": "Elbasan County", + "country": { "isoCode": "AL", "name": "Albania", "region": "Eastern Europe", "__typename": "Country" - }, - "__typename": "Geocode" - }, - "use": "to add another cow to her two existing ones and to repair the livestock's stable so they will be secure.", - "activity": { - "id": 31, - "name": "Farming", - "__typename": "Activity" - }, - "sector": { - "id": 1, - "name": "Agriculture", - "__typename": "Sector" - }, - "whySpecial": "It supports women in a country where financing options are scarce.", - "lenderRepaymentTerm": 38, - "loanAmount": "2725.00", - "loanFundraisingInfo": { - "fundedAmount": "575.00", - "reservedAmount": "0.00", - "isExpiringSoon": false, - "__typename": "LoanFundraisingInfo" - }, - "plannedExpirationDate": "2020-08-13T02:50:06Z", - "matchingText": "", - "userProperties": { - "favorited": false, - "lentTo": false, - "__typename": "LoanUserProperties" }, - "lenders": { - "totalCount": 23, - "__typename": "LenderCollection" - }, - "partnerName": "Agro & Social Fund", - "__typename": "LoanPartner", - "image": { - "id": 3844433, - "default": "https://www-dev-kiva-org.freetls.fastly.net/img/w480h300/131e7cc9d0de32daad20d90b3a39c8a8.jpg", - "retina": "https://www-dev-kiva-org.freetls.fastly.net/img/w960h600/131e7cc9d0de32daad20d90b3a39c8a8.jpg", - "hash": "131e7cc9d0de32daad20d90b3a39c8a8", - "__typename": "Image" - }, - "anonymizationLevel": "none", - "fullLoanUse": "A loan of $2,725 helps to add another cow to her two existing ones and to repair the livestock's stable so they will be secure.", - "fundraisingTimeLeft": "0 days", - "fundraisingPercent": 40, - "fundraisingTimeLeftMilliseconds": 123456789, - } + "__typename": "Geocode" + }, + "use": "to add another cow to her two existing ones and to repair the livestock's stable so they will be secure.", + "activity": { + "id": 31, + "name": "Farming", + "__typename": "Activity" + }, + "sector": { + "id": 1, + "name": "Agriculture", + "__typename": "Sector" + }, + "whySpecial": "It supports women in a country where financing options are scarce.", + "lenderRepaymentTerm": 38, + "loanAmount": "2725.00", + "loanFundraisingInfo": { + "fundedAmount": "575.00", + "reservedAmount": "0.00", + "isExpiringSoon": false, + "__typename": "LoanFundraisingInfo" + }, + "plannedExpirationDate": "2020-08-13T02:50:06Z", + "matchingText": "", + "userProperties": { + "favorited": false, + "lentTo": false, + "__typename": "LoanUserProperties" + }, + "lenders": { + "totalCount": 23, + "__typename": "LenderCollection" + }, + "partnerName": "Agro & Social Fund", + "__typename": "LoanPartner", + "image": { + "id": 3838911, + "default": "https://www-dev-kiva-org.freetls.fastly.net/img/w480h300/9673d0722a7675b9b8d11f90849d9b44.jpg", + "url": "https://www-dev-kiva-org.freetls.fastly.net/img/w150h138/9673d0722a7675b9b8d11f90849d9b44.jpg", + "retinaUrl": "https://www-dev-kiva-org.freetls.fastly.net/img/w300h276/9673d0722a7675b9b8d11f90849d9b44.jpg", + "lgUrl": "https://www-dev-kiva-org.freetls.fastly.net/img/w244h185/9673d0722a7675b9b8d11f90849d9b44.jpg", + "lgRetinaUrl": "https://www-dev-kiva-org.freetls.fastly.net/img/w488h370/9673d0722a7675b9b8d11f90849d9b44.jpg", + "retina": "https://www-dev-kiva-org.freetls.fastly.net/img/w960h600/9673d0722a7675b9b8d11f90849d9b44.jpg", + "hash": "9673d0722a7675b9b8d11f90849d9b44", + "__typename": "Image" + }, + "anonymizationLevel": "none", + "fullLoanUse": "A loan of $2,725 helps to add another cow to her two existing ones and to repair the livestock's stable so they will be secure.", + "fundraisingTimeLeft": "0 days", + "fundraisingPercent": 40, + "fundraisingTimeLeftMilliseconds": 123456789, + } ] diff --git a/.storybook/preview.js b/.storybook/preview.js index eb676bef30..3c0b8e3567 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -1,13 +1,11 @@ -import { addParameters } from '@storybook/vue'; -import { MINIMAL_VIEWPORTS} from '@storybook/addon-viewport'; -import Vue from 'vue'; -import Meta from 'vue-meta'; -import VueRouter from 'vue-router' -import KvThemeProvider from '~/@kiva/kv-components/vue/KvThemeProvider'; -import { defaultTheme } from '@kiva/kv-tokens/configs/kivaColors'; - -//load all the svg icon sprites -import '@/assets/iconLoader'; +import { setup } from '@storybook/vue3'; +import { MINIMAL_VIEWPORTS } from '@storybook/addon-viewport'; +import { VueHeadMixin, createHead } from '@unhead/vue'; +import { createRouter, createWebHistory } from 'vue-router'; +import KvThemeProvider from '@kiva/kv-components/vue/KvThemeProvider.vue'; +import { defaultTheme } from '@kiva/kv-tokens/configs/kivaColors.cjs'; +import changeCaseFilter from '../src/plugins/change-case-filter'; +import numeralFilter from '../src/plugins/numeral-filter'; // same styles that are in App.vue import '../src/assets/scss/app.scss'; @@ -22,19 +20,44 @@ import './storybookStyles.scss'; // import config file for storybook environment import config from '../config/local'; -// initialize vue-meta -Vue.use(Meta); +setup((app) => { + // Create a new router instance + const router = createRouter({ + history: createWebHistory(), + routes: [], + }); + app.use(router); + + // Mock the analytics Vue plugin + app.directive('kv-track-event', () => { }); + app.config.globalProperties.$kvTrackEvent = () => { }; -// Mock the analytics Vue plugin -Vue.use({ install: Vue => { - Vue.directive('kv-track-event', () => {}); - Vue.prototype.$kvTrackEvent = () => {}; -}}); + // provide global application config + app.config.globalProperties.$appConfig = config.app; -Vue.use(VueRouter) + // Provide $filters + app.config.globalProperties.$filters = { + changeCase: changeCaseFilter, + numeral: numeralFilter, + }; -// provide global application config -Vue.prototype.$appConfig = config.app; + // initialize unhead + const head = createHead(); + // head for composition api + app.use(head); + // head for options api + app.mixin(VueHeadMixin); + + // install dovetail font + head.push({ + link: [ + { + rel: 'stylesheet', + href: 'https://use.typekit.net/pmj7shs.css', + }, + ], + }); +}); // add custom viewports const customViewports = { @@ -62,10 +85,10 @@ const customViewports = { }; -addParameters({ +export const parameters = { options: { storySort: (a, b) => { // sort the categories alphabetically. - return a[1].kind === b[1].kind ? 0 : a[1].id.localeCompare(b[1].id, undefined, { numeric: true }); + return a.id === b.id ? 0 : a.id.localeCompare(b.id, undefined, { numeric: true }); }, showRoots: true, enableShortcuts: false, @@ -91,18 +114,18 @@ addParameters({ ], }, viewport: { - viewports: { + viewports: { ...MINIMAL_VIEWPORTS, ...customViewports, - }, - }, -}); + }, + }, +}; // Wrap all stories with the kv-theme-provider component export const decorators = [(story) => ({ components: { story, KvThemeProvider }, template: '', data() { return { theme: defaultTheme } }, - router: new VueRouter(), + // router: new VueRouter(), })]; diff --git a/.storybook/stories/15years.stories.js b/.storybook/stories/15years.stories.js index 5e265c48a3..0666a73f93 100644 --- a/.storybook/stories/15years.stories.js +++ b/.storybook/stories/15years.stories.js @@ -1,21 +1,15 @@ -import Vue from 'vue'; - -// import plugins -import kivaPlugins from '@/plugins'; -Vue.use(kivaPlugins); - -import AppealBanner15 from '@/components/WwwFrame/PromotionalBanner/Banners/AppealBanner/AppealBanner15'; -import FifteenYears from '@/pages/15Years/15Years'; -import FifteenYearsHeader from '@/components/15Years/15YearsHeader'; -import FifteenYearsHowKivaWorks from '@/components/15Years/15YearsHowKivaWorks'; -import FifteenYearsIndividuals from '@/components/15Years/15YearsIndividuals'; -import FifteenYearsPartners from '@/components/15Years/15YearsPartners'; -import FifteenYearsStyles from '@/components/15Years/15YearsStyles'; -import FifteenYearsTimeline from '@/components/15Years/15YearsTimeline'; +import AppealBanner15 from '#src/components/WwwFrame/PromotionalBanner/Banners/AppealBanner/AppealBanner15'; +import FifteenYears from '#src/pages/15Years/15Years'; +import FifteenYearsHeader from '#src/components/15Years/15YearsHeader'; +import FifteenYearsHowKivaWorks from '#src/components/15Years/15YearsHowKivaWorks'; +import FifteenYearsIndividuals from '#src/components/15Years/15YearsIndividuals'; +import FifteenYearsPartners from '#src/components/15Years/15YearsPartners'; +import FifteenYearsStyles from '#src/components/15Years/15YearsStyles'; +import FifteenYearsTimeline from '#src/components/15Years/15YearsTimeline'; import apolloStoryMixin from '../mixins/apollo-story-mixin'; import kvAuth0StoryMixin from '../mixins/kv-auth0-story-mixin'; -import {appealBanner} from '../mock-data/contentful-data-mock'; +import { appealBanner } from '../mock-data/contentful-data-mock'; import countryFacetsDataMock from '../mock-data/country-facets-data-mock'; import cookieStoreStoryMixin from '../mixins/cookie-store-story-mixin'; @@ -87,7 +81,8 @@ export const Combined = (args, { argTypes }) => ({ FifteenYears, }, layout: 'fullscreen', - mixins: [apolloStoryMixin({ queryResult: countryFacetsDataMock}), cookieStoreStoryMixin(), kvAuth0StoryMixin], + mixins: [apolloStoryMixin({ queryResult: countryFacetsDataMock }), cookieStoreStoryMixin(), kvAuth0StoryMixin], + setup() { return args; }, template: `
`, @@ -99,7 +94,8 @@ export const AppealBanner = (args, { argTypes }) => ({ }, props: Object.keys(argTypes), decorators: [FifteenYearsDecorator], - mixins: [apolloStoryMixin({ queryResult: recentFundedLoans}), cookieStoreStoryMixin(), kvAuth0StoryMixin], + mixins: [apolloStoryMixin({ queryResult: recentFundedLoans }), cookieStoreStoryMixin(), kvAuth0StoryMixin], + setup() { return args; }, template: ` `, @@ -111,7 +107,8 @@ export const Header = (args, { argTypes }) => ({ }, props: Object.keys(argTypes), decorators: [FifteenYearsDecorator], - mixins: [apolloStoryMixin({ queryResult: countryFacetsDataMock}), cookieStoreStoryMixin(), kvAuth0StoryMixin], + mixins: [apolloStoryMixin({ queryResult: countryFacetsDataMock }), cookieStoreStoryMixin(), kvAuth0StoryMixin], + setup() { return args; }, template: ` `, @@ -124,6 +121,7 @@ export const Timeline = (args, { argTypes }) => ({ props: Object.keys(argTypes), decorators: [FifteenYearsDecorator], mixins: [apolloStoryMixin(), kvAuth0StoryMixin], + setup() { return args; }, template: ` `, @@ -136,6 +134,7 @@ export const Individuals = (args, { argTypes }) => ({ props: Object.keys(argTypes), mixins: [apolloStoryMixin(), kvAuth0StoryMixin], decorators: [FifteenYearsDecorator], + setup() { return args; }, template: ` `, @@ -148,6 +147,7 @@ export const Partners = (args, { argTypes }) => ({ props: Object.keys(argTypes), mixins: [apolloStoryMixin(), kvAuth0StoryMixin], decorators: [FifteenYearsDecorator], + setup() { return args; }, template: ` `, @@ -160,6 +160,7 @@ export const HowKivaWorks = (args, { argTypes }) => ({ props: Object.keys(argTypes), mixins: [apolloStoryMixin(), kvAuth0StoryMixin], decorators: [FifteenYearsDecorator], + setup() { return args; }, template: ` `, diff --git a/.storybook/stories/AnimatedSparkles.stories.js b/.storybook/stories/AnimatedSparkles.stories.js index 3d817cb3cd..4402e452a0 100644 --- a/.storybook/stories/AnimatedSparkles.stories.js +++ b/.storybook/stories/AnimatedSparkles.stories.js @@ -1,19 +1,19 @@ -import AnimatedSparkles from '@/components/Thanks/AnimatedSparkles.vue'; +import AnimatedSparkles from '#src/components/Thanks/AnimatedSparkles.vue'; export default { - title: 'Components/AnimatedSparkles', - component: AnimatedSparkles, + title: 'Components/AnimatedSparkles', + component: AnimatedSparkles, }; const Template = (args, { argTypes }) => ({ - props: Object.keys(argTypes), - components: { AnimatedSparkles }, - template: '
', + props: Object.keys(argTypes), + components: { AnimatedSparkles }, + template: '
', }); export const Default = Template.bind({}); Default.args = { - // Define your default args here. For example: - // color: 'blue', - // size: 'large', + // Define your default args here. For example: + // color: 'blue', + // size: 'large', }; diff --git a/.storybook/stories/AnimatedStars.stories.js b/.storybook/stories/AnimatedStars.stories.js index 9f8f2de508..15b22f30f8 100644 --- a/.storybook/stories/AnimatedStars.stories.js +++ b/.storybook/stories/AnimatedStars.stories.js @@ -1,14 +1,14 @@ -import AnimatedStars from '@/components/Thanks/AnimatedStars.vue'; +import AnimatedStars from '#src/components/Thanks/AnimatedStars.vue'; export default { - title: 'Components/AnimatedStars', - component: AnimatedStars, + title: 'Components/AnimatedStars', + component: AnimatedStars, }; const Template = (args, { argTypes }) => ({ - props: Object.keys(argTypes), - components: { AnimatedStars }, - template: '
', + props: Object.keys(argTypes), + components: { AnimatedStars }, + template: '
', }); export const Default = Template.bind({}); diff --git a/.storybook/stories/AppealBannerCircular.stories.js b/.storybook/stories/AppealBannerCircular.stories.js index 0d85a06aa6..ad16702e4e 100644 --- a/.storybook/stories/AppealBannerCircular.stories.js +++ b/.storybook/stories/AppealBannerCircular.stories.js @@ -1,30 +1,28 @@ -import Vue from 'vue' -import AppealBannerCircular from '@/components/WwwFrame/PromotionalBanner/Banners/AppealBanner/AppealBannerCircular.vue'; +import AppealBannerCircular from '#src/components/WwwFrame/PromotionalBanner/Banners/AppealBanner/AppealBannerCircular.vue'; -// import plugins -import kivaPlugins from '@/plugins'; -Vue.use(kivaPlugins) +const args = { + targetAmount: 450000, + amountRaised: 300000, + buttonAmounts: [20, 35, 50], + headline: 'Donate $50, get $25 to lend.', + body: '

Your support has been essential this year. Donate today to keep Kiva possible.

', + isOpen: true, + imageUrl: '//images.ctfassets.net/j0p9a6ql0rn7/6ymAUx6RA4sVnBgQ2lkJ7H/1fcebdc57efc014ab1726c572ea04530/Frame__export_this__.svg', +}; export default { title: 'WwwFrame/Banners/AppealBannerCircular', component: AppealBannerCircular, - args: { - targetAmount: 450000, - amountRaised: 300000, - buttonAmounts: [20, 35, 50], - headline: 'Donate $50, get $25 to lend.', - body: '

Your support has been essential this year. Donate today to keep Kiva possible.

', - isOpen: true, - imageUrl: '//images.ctfassets.net/j0p9a6ql0rn7/6ymAUx6RA4sVnBgQ2lkJ7H/1fcebdc57efc014ab1726c572ea04530/Frame__export_this__.svg', - }, + args, }; -const story = (args = {}) => { +const story = (storyArgs = {}) => { const template = (_args, { argTypes }) => ({ props: Object.keys(argTypes), components: { AppealBannerCircular, }, + setup() { return { ...args, ...storyArgs }; }, template: `
({ }); export const Funded = () => ({ - components: { FundedBorrowerProfile }, + components: { FundedBorrowerProfile }, parameters: { layout: 'fullscreen', }, @@ -64,7 +58,7 @@ export const Funded = () => ({ }); export const PrivateFundraisingPeriod = () => ({ - components: { BorrowerProfile}, + components: { BorrowerProfile }, parameters: { layout: 'fullscreen', }, diff --git a/.storybook/stories/ChallengeCallout.stories.js b/.storybook/stories/ChallengeCallout.stories.js index 7d6e8a4614..9d9e61f484 100644 --- a/.storybook/stories/ChallengeCallout.stories.js +++ b/.storybook/stories/ChallengeCallout.stories.js @@ -1,4 +1,4 @@ -import ChallengeCallout from '@/components/Lend/LoanSearch/ChallengeCallout'; +import ChallengeCallout from '#src/components/Lend/LoanSearch/ChallengeCallout'; import apolloStoryMixin from "../mixins/apollo-story-mixin"; export default { @@ -32,8 +32,8 @@ const publicLendProfile = { }; -export const Default = story({ teamName: 'A+' }); -export const Lender = story({ shareLender: publicLendProfile, teamName: 'A+' }); +export const Default = story({ teamName: 'A+', showAddedToCartMessage: true }); +export const Lender = story({ shareLender: publicLendProfile, teamName: 'A+', showAddedToCartMessage: true }); export const AddToCard = story({ currentLender: { lender: publicLendProfile }, teamName: 'A+', diff --git a/.storybook/stories/ChallengeHeader.stories.js b/.storybook/stories/ChallengeHeader.stories.js index 1ad3a0ef86..1c38526d4f 100644 --- a/.storybook/stories/ChallengeHeader.stories.js +++ b/.storybook/stories/ChallengeHeader.stories.js @@ -1,4 +1,4 @@ -import ChallengeHeader from '@/components/Thanks/ChallengeHeader'; +import ChallengeHeader from '#src/components/Thanks/ChallengeHeader'; import apolloStoryMixin from "../mixins/apollo-story-mixin"; export default { @@ -11,6 +11,7 @@ const story = (args = {}) => { props: Object.keys(argTypes), components: { ChallengeHeader }, mixins: [apolloStoryMixin()], + setup() { return args; }, template: '', }); template.args = args; diff --git a/.storybook/stories/CheckoutReceipt.stories.js b/.storybook/stories/CheckoutReceipt.stories.js index 24b9a1f594..685f4fd4ad 100644 --- a/.storybook/stories/CheckoutReceipt.stories.js +++ b/.storybook/stories/CheckoutReceipt.stories.js @@ -1,4 +1,4 @@ -import CheckoutReceipt from '@/components/Checkout/CheckoutReceipt'; +import CheckoutReceipt from '#src/components/Checkout/CheckoutReceipt'; import mockedReceiptData from '../mock-data/receipt-data-mock'; // https://api-vm.kiva.org/graphqlgraphql?user_id=1003394&app_id=org.kiva.www&query=query%20checkoutReceipt%20%7B%20%0A%09shop%20%7B%0A%09%09receipt(checkoutId%3A%2038663432)%20%7B%0A%09%09%09credits%20%7B%0A%09%09%09%09values%20%7B%0A%09%09%09%09%09creditType%0A%09%09%09%09%09amount%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09totals%20%7B%0A%20%20%20%20%20%20%20%20bonusAppliedTotal%0A%09%09%09%09itemTotal%0A%09%09%09%09donationTotal%0A%09%09%09%09kivaCardTotal%0A%09%09%09%09depositTotals%20%7B%0A%09%09%09%09%09depositTotal%0A%09%09%09%09%09kivaCreditAdded%0A%09%09%09%09%09kivaCreditUsed%0A%09%09%09%09%7D%0A%20%20%20%20%20%20%20%20freeTrialAppliedTotal%0A%09%09%09%09kivaCreditAppliedTotal%0A%20%20%20%20%20%20%20%20redemptionCodeAppliedTotal%0A%20%20%20%20%20%20%20%20universalCodeAppliedTotal%0A%09%09%09%7D%0A%09%09%09hasFreeCredits%0A%09%09%09items%20%7B%0A%09%09%09%09totalCount%0A%09%09%09%09values%20%7B%0A%09%09%09%09%09id%0A%09%09%09%09%09price%0A%09%09%09%09%09basketItemType%0A%09%09%09%09%09...%20on%20KivaCard%20%7B%0A%09%09%09%09%09%09individualPrice%0A%09%09%09%09%09%09basketItemType%0A%09%09%09%09%09%09kivaCardObject%20%7B%0A%09%09%09%09%09%09%09deliveryType%0A%09%09%09%09%09%09%09mailingInfo%20%7B%0A%09%09%09%09%09%09%09%09firstName%0A%09%09%09%09%09%09%09%09lastName%0A%09%09%09%09%09%09%09%09address%0A%09%09%09%09%09%09%09%09address2%0A%09%09%09%09%09%09%09%09city%0A%09%09%09%09%09%09%09%09state%0A%09%09%09%09%09%09%09%09zip%0A%09%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09%09recipient%20%7B%0A%09%09%09%09%09%09%09%09name%0A%09%09%09%09%09%09%09%09email%0A%09%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%09...%20on%20LoanReservation%20%7B%0A%09%09%09%09%09%09loan%20%7B%0A%09%09%09%09%09%09%09name%0A%09%09%09%09%09%09%09id%0A%09%09%09%09%09%09%09image%20%7B%0A%09%09%09%09%09%09%09%09url%0A%09%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09%09use%0A%09%09%09%09%09%09%09geocode%20%7B%0A%09%09%09%09%09%09%09%09city%0A%09%09%09%09%09%09%09%09country%20%7B%0A%09%09%09%09%09%09%09%09%09name%0A%09%09%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09my%20%7B%0A%09%09userAccount%20%7B%0A%09%09%09firstName%0A%09%09%09lastName%0A%09%09%09email%0A%09%09%7D%0A%09%7D%0A%7D%0A&operationName=checkoutReceipt diff --git a/.storybook/stories/CorporateCampaign.stories.js b/.storybook/stories/CorporateCampaign.stories.js index 1876b650ff..9b98abf965 100644 --- a/.storybook/stories/CorporateCampaign.stories.js +++ b/.storybook/stories/CorporateCampaign.stories.js @@ -1,13 +1,7 @@ -import Vue from 'vue'; - -// import plugins -import kivaPlugins from '@/plugins'; -Vue.use(kivaPlugins); - import apolloStoryMixin from '../mixins/apollo-story-mixin'; -import CorporateCampaignLanding from '@/pages/LandingPages/CorporateCampaign/CCLandingPage'; -import CampaignHero from '@/components/CorporateCampaign/CampaignHero'; -import CampaignStatus from '@/components/CorporateCampaign/CampaignStatus'; +import CorporateCampaignLanding from '#src/pages/LandingPages/CorporateCampaign/CCLandingPage'; +import CampaignHero from '#src/components/CorporateCampaign/CampaignHero'; +import CampaignStatus from '#src/components/CorporateCampaign/CampaignStatus'; import cookieStoreStoryMixin from '../mixins/cookie-store-story-mixin'; export default { @@ -15,7 +9,7 @@ export default { component: CorporateCampaignLanding, args: { heroAreaContent: { - "key":"promo-campaign-test-cg","name":"Promo Campaign Test Content Groups","contents":[{"key":"header-area","name":"Test Campaign Title GCB","bodyCopy":{"nodeType":"document","data":{},"content":[{"nodeType":"paragraph","content":[{"nodeType":"text","value":"The Kate Spade New York Foundation is giving you a $25 credit to lend to an entrepreneur who inspires you.\n\n","marks":[],"data":{}}],"data":{}}]},"headline":"Welcome to Kiva!","subHeadline":"__vue_devtool_undefined__","primaryCtaLink":"__vue_devtool_undefined__","primaryCtaKvTrackEvent":"__vue_devtool_undefined__","primaryCtaText":"__vue_devtool_undefined__"},{"name":"COVID fund Homepage Promo Images","description":"Lend a hand from afar and join the global COVID-19 response. Take action","images":[{"title":"hp-mg lg std","description":"Lend a hand from afar and join the global COVID-19 response. Take action","file":{"url":"//images.ctfassets.net/j0p9a6ql0rn7/2F0fMUNds6qhAj6CyQ0kn4/360430aae71f90f2164625fbe5ce9d1e/Final_Homepage_lg_std.jpg","details":{"size":87066,"image":{"width":1025,"height":545}},"fileName":"Final_Homepage_lg_std.jpg","contentType":"image/jpeg"}},{"title":"hp-mg med std","description":"Lend a hand from afar and join the global COVID-19 response. Take action","file":{"url":"//images.ctfassets.net/j0p9a6ql0rn7/4CZue28n9f0crCW7KdtmC3/62e687fdb3089ae04710b88db25b6da9/hp-mg_med_std.jpg","details":{"size":73397,"image":{"width":680,"height":675}},"fileName":"hp-mg_med_std.jpg","contentType":"image/jpeg"}},{"title":"hp-mg med retina","description":"Lend a hand from afar and join the global COVID-19 response. Take action","file":{"url":"//images.ctfassets.net/j0p9a6ql0rn7/7xdmdw4GgKlUDRUSmvO5Iu/4ed7de5a67d27e2fbddb7f778dcb1317/hp-mg_med_retina.jpg","details":{"size":122452,"image":{"width":1360,"height":1350}},"fileName":"hp-mg_med_retina.jpg","contentType":"image/jpeg"}},{"title":"hp-mg lg retina","description":"Lend a hand from afar and join the global COVID-19 response. Take action","file":{"url":"//images.ctfassets.net/j0p9a6ql0rn7/5H7wikO7DzKOEqnBBqric1/5ae2476c691165a4c400780b0857cb48/Final_Homepage_lg_retina.jpg","details":{"size":167314,"image":{"width":2048,"height":1090}},"fileName":"Final_Homepage_lg_retina.jpg","contentType":"image/jpeg"}},{"title":"hp-mg xl retina","description":"Lend a hand from afar and join the global COVID-19 response. Take action","file":{"url":"//images.ctfassets.net/j0p9a6ql0rn7/5YzqkUttXksSAgaHuw9Cuv/23b7a0460c3616bf4f9e349631a5ab0a/hp-mg_xl_retina.jpg","details":{"size":270653,"image":{"width":2880,"height":1535}},"fileName":"hp-mg_xl_retina.jpg","contentType":"image/jpeg"}},{"title":"hp-mg xxl std","description":"Lend a hand from afar and join the global COVID-19 response. Take action","file":{"url":"//images.ctfassets.net/j0p9a6ql0rn7/6zlivQBwWaw0XtJeYn8diS/c880e3eb4d5884ddc587742e6c010827/hp-mg_xxl_std.jpg","details":{"size":148815,"image":{"width":1921,"height":821}},"fileName":"hp-mg_xxl_std.jpg","contentType":"image/jpeg"}},{"title":"hp-mg xxl retina","description":"Lend a hand from afar and join the global COVID-19 response. Take action","file":{"url":"//images.ctfassets.net/j0p9a6ql0rn7/1afYQ0d3JJDNbpet9oIr6J/2c21bba64857e54a1a936aa3d4783cbf/hp-mg_xxl_retina.jpg","details":{"size":271004,"image":{"width":3840,"height":1640}},"fileName":"hp-mg_xxl_retina.jpg","contentType":"image/jpeg"}},{"title":"hp-mg xl std","description":"Lend a hand from afar and join the global COVID-19 response. Take action","file":{"url":"//images.ctfassets.net/j0p9a6ql0rn7/5tuiyeQcopJaHcUy3rDaTN/450b1136acedd6f218a2424ec4cfc5f9/hp-mp_xl_std.jpg","details":{"size":137038,"image":{"width":1441,"height":768}},"fileName":"hp-mp_xl_std.jpg","contentType":"image/jpeg"}},{"title":"hp-mg sm std","description":"Lend a hand from afar and join the global COVID-19 response. Take action","file":{"url":"//images.ctfassets.net/j0p9a6ql0rn7/7alHPYp7xv7BUT5WLEieTz/e905db49ecfaa6ea102fe94f33c2555c/hp-mg_sm_std.jpg","details":{"size":50791,"image":{"width":480,"height":600}},"fileName":"hp-mg_sm_std.jpg","contentType":"image/jpeg"}},{"title":"hp-mg sm retina","description":"Lend a hand from afar and join the global COVID-19 response. Take action","file":{"url":"//images.ctfassets.net/j0p9a6ql0rn7/1ykOTxkXIdoDTe8gZ6lRZ2/78faa1f3944065eb6780d20c32235c79/hp-mg_sm_retina.jpg","details":{"size":96212,"image":{"width":960,"height":1200}},"fileName":"hp-mg_sm_retina.jpg","contentType":"image/jpeg"}}]}],"media":[{"title":"Kate Spade New York Foundation","description":"Test Campaign Logo","file":{"url":"//images.ctfassets.net/j0p9a6ql0rn7/32l10iSqfimSCylspmRCoy/0a59fa708139543539abd90b24406be9/Screen_Shot_2020-09-22_at_11.13.26_AM.png","details":{"size":91993,"image":{"width":854,"height":264}},"fileName":"Screen Shot 2020-09-22 at 11.13.26 AM.png","contentType":"image/png"}}] + "key": "promo-campaign-test-cg", "name": "Promo Campaign Test Content Groups", "contents": [{ "key": "header-area", "name": "Test Campaign Title GCB", "bodyCopy": { "nodeType": "document", "data": {}, "content": [{ "nodeType": "paragraph", "content": [{ "nodeType": "text", "value": "The Kate Spade New York Foundation is giving you a $25 credit to lend to an entrepreneur who inspires you.\n\n", "marks": [], "data": {} }], "data": {} }] }, "headline": "Welcome to Kiva!", "subHeadline": "__vue_devtool_undefined__", "primaryCtaLink": "__vue_devtool_undefined__", "primaryCtaKvTrackEvent": "__vue_devtool_undefined__", "primaryCtaText": "__vue_devtool_undefined__" }, { "name": "COVID fund Homepage Promo Images", "description": "Lend a hand from afar and join the global COVID-19 response. Take action", "images": [{ "title": "hp-mg lg std", "description": "Lend a hand from afar and join the global COVID-19 response. Take action", "file": { "url": "//images.ctfassets.net/j0p9a6ql0rn7/2F0fMUNds6qhAj6CyQ0kn4/360430aae71f90f2164625fbe5ce9d1e/Final_Homepage_lg_std.jpg", "details": { "size": 87066, "image": { "width": 1025, "height": 545 } }, "fileName": "Final_Homepage_lg_std.jpg", "contentType": "image/jpeg" } }, { "title": "hp-mg med std", "description": "Lend a hand from afar and join the global COVID-19 response. Take action", "file": { "url": "//images.ctfassets.net/j0p9a6ql0rn7/4CZue28n9f0crCW7KdtmC3/62e687fdb3089ae04710b88db25b6da9/hp-mg_med_std.jpg", "details": { "size": 73397, "image": { "width": 680, "height": 675 } }, "fileName": "hp-mg_med_std.jpg", "contentType": "image/jpeg" } }, { "title": "hp-mg med retina", "description": "Lend a hand from afar and join the global COVID-19 response. Take action", "file": { "url": "//images.ctfassets.net/j0p9a6ql0rn7/7xdmdw4GgKlUDRUSmvO5Iu/4ed7de5a67d27e2fbddb7f778dcb1317/hp-mg_med_retina.jpg", "details": { "size": 122452, "image": { "width": 1360, "height": 1350 } }, "fileName": "hp-mg_med_retina.jpg", "contentType": "image/jpeg" } }, { "title": "hp-mg lg retina", "description": "Lend a hand from afar and join the global COVID-19 response. Take action", "file": { "url": "//images.ctfassets.net/j0p9a6ql0rn7/5H7wikO7DzKOEqnBBqric1/5ae2476c691165a4c400780b0857cb48/Final_Homepage_lg_retina.jpg", "details": { "size": 167314, "image": { "width": 2048, "height": 1090 } }, "fileName": "Final_Homepage_lg_retina.jpg", "contentType": "image/jpeg" } }, { "title": "hp-mg xl retina", "description": "Lend a hand from afar and join the global COVID-19 response. Take action", "file": { "url": "//images.ctfassets.net/j0p9a6ql0rn7/5YzqkUttXksSAgaHuw9Cuv/23b7a0460c3616bf4f9e349631a5ab0a/hp-mg_xl_retina.jpg", "details": { "size": 270653, "image": { "width": 2880, "height": 1535 } }, "fileName": "hp-mg_xl_retina.jpg", "contentType": "image/jpeg" } }, { "title": "hp-mg xxl std", "description": "Lend a hand from afar and join the global COVID-19 response. Take action", "file": { "url": "//images.ctfassets.net/j0p9a6ql0rn7/6zlivQBwWaw0XtJeYn8diS/c880e3eb4d5884ddc587742e6c010827/hp-mg_xxl_std.jpg", "details": { "size": 148815, "image": { "width": 1921, "height": 821 } }, "fileName": "hp-mg_xxl_std.jpg", "contentType": "image/jpeg" } }, { "title": "hp-mg xxl retina", "description": "Lend a hand from afar and join the global COVID-19 response. Take action", "file": { "url": "//images.ctfassets.net/j0p9a6ql0rn7/1afYQ0d3JJDNbpet9oIr6J/2c21bba64857e54a1a936aa3d4783cbf/hp-mg_xxl_retina.jpg", "details": { "size": 271004, "image": { "width": 3840, "height": 1640 } }, "fileName": "hp-mg_xxl_retina.jpg", "contentType": "image/jpeg" } }, { "title": "hp-mg xl std", "description": "Lend a hand from afar and join the global COVID-19 response. Take action", "file": { "url": "//images.ctfassets.net/j0p9a6ql0rn7/5tuiyeQcopJaHcUy3rDaTN/450b1136acedd6f218a2424ec4cfc5f9/hp-mp_xl_std.jpg", "details": { "size": 137038, "image": { "width": 1441, "height": 768 } }, "fileName": "hp-mp_xl_std.jpg", "contentType": "image/jpeg" } }, { "title": "hp-mg sm std", "description": "Lend a hand from afar and join the global COVID-19 response. Take action", "file": { "url": "//images.ctfassets.net/j0p9a6ql0rn7/7alHPYp7xv7BUT5WLEieTz/e905db49ecfaa6ea102fe94f33c2555c/hp-mg_sm_std.jpg", "details": { "size": 50791, "image": { "width": 480, "height": 600 } }, "fileName": "hp-mg_sm_std.jpg", "contentType": "image/jpeg" } }, { "title": "hp-mg sm retina", "description": "Lend a hand from afar and join the global COVID-19 response. Take action", "file": { "url": "//images.ctfassets.net/j0p9a6ql0rn7/1ykOTxkXIdoDTe8gZ6lRZ2/78faa1f3944065eb6780d20c32235c79/hp-mg_sm_retina.jpg", "details": { "size": 96212, "image": { "width": 960, "height": 1200 } }, "fileName": "hp-mg_sm_retina.jpg", "contentType": "image/jpeg" } }] }], "media": [{ "title": "Kate Spade New York Foundation", "description": "Test Campaign Logo", "file": { "url": "//images.ctfassets.net/j0p9a6ql0rn7/32l10iSqfimSCylspmRCoy/0a59fa708139543539abd90b24406be9/Screen_Shot_2020-09-22_at_11.13.26_AM.png", "details": { "size": 91993, "image": { "width": 854, "height": 264 } }, "fileName": "Screen Shot 2020-09-22 at 11.13.26 AM.png", "contentType": "image/png" } }] }, activeCreditType: 'Active Credit Type', inContext: false, @@ -35,7 +29,7 @@ export const Combined = (args, { argTypes }) => ({ components: { CorporateCampaignLanding, }, - mixins: [ apolloStoryMixin(), cookieStoreStoryMixin()], + mixins: [apolloStoryMixin(), cookieStoreStoryMixin()], template: `
`, diff --git a/.storybook/stories/DepositIncentiveBanner.stories.js b/.storybook/stories/DepositIncentiveBanner.stories.js index fea7dbe95a..b517204685 100644 --- a/.storybook/stories/DepositIncentiveBanner.stories.js +++ b/.storybook/stories/DepositIncentiveBanner.stories.js @@ -1,11 +1,6 @@ -import Vue from 'vue' -import DepositIncentiveBanner from '@/components/WwwFrame/PromotionalBanner/Banners/DepositIncentiveBanner.vue'; +import DepositIncentiveBanner from '#src/components/WwwFrame/PromotionalBanner/Banners/DepositIncentiveBanner.vue'; import cookieStoreStoryMixin from '../mixins/cookie-store-story-mixin'; -// import plugins -import kivaPlugins from '@/plugins'; -Vue.use(kivaPlugins); - export default { title: 'WwwFrame/Banners/DepositIncentiveBanner', component: DepositIncentiveBanner, @@ -28,11 +23,11 @@ const provideMockedApollo = (mockedResult) => { }; const userInfo = { - my: { + my: { id: 1017469, depositIncentiveAmountToLend: 25, - }, - shop: { + }, + shop: { id: 1, basket: { id: 1, @@ -46,11 +41,11 @@ const userInfo = { export const Default = (args, { argTypes }) => ({ props: Object.keys(argTypes), - mixins: [cookieStoreStoryMixin()], + mixins: [cookieStoreStoryMixin()], components: { DepositIncentiveBanner }, - provide: { + provide: { apollo: provideMockedApollo({}), }, template: ` @@ -60,11 +55,11 @@ export const Default = (args, { argTypes }) => ({ export const WithBalance = (args, { argTypes }) => ({ props: Object.keys(argTypes), - mixins: [cookieStoreStoryMixin()], + mixins: [cookieStoreStoryMixin()], components: { DepositIncentiveBanner }, - provide: { + provide: { apollo: provideMockedApollo(userInfo), }, template: ` diff --git a/.storybook/stories/DepositIncentiveUpsell.stories.js b/.storybook/stories/DepositIncentiveUpsell.stories.js index 77d6af3fe6..5f59378592 100644 --- a/.storybook/stories/DepositIncentiveUpsell.stories.js +++ b/.storybook/stories/DepositIncentiveUpsell.stories.js @@ -1,14 +1,9 @@ -import DepositIncentiveUpsell from '@/components/Checkout/DepositIncentiveUpsell.vue'; +import DepositIncentiveUpsell from '#src/components/Checkout/DepositIncentiveUpsell.vue'; import apolloStoryMixin from '../mixins/apollo-story-mixin'; import { mockLoansArray } from '../utils'; const mockLoans = mockLoansArray(4); -mockLoans[0].image.url = 'https://www-dev-kiva-org.freetls.fastly.net/img/w150h138/9673d0722a7675b9b8d11f90849d9b44.jpg'; -mockLoans[0].image.retinaUrl = 'https://www-dev-kiva-org.freetls.fastly.net/img/w300h276/9673d0722a7675b9b8d11f90849d9b44.jpg'; -mockLoans[0].image.lgUrl = 'https://www-dev-kiva-org.freetls.fastly.net/img/w244h185/9673d0722a7675b9b8d11f90849d9b44.jpg'; -mockLoans[0].image.lgRetinaUrl = 'https://www-dev-kiva-org.freetls.fastly.net/img/w488h370/9673d0722a7675b9b8d11f90849d9b44.jpg'; - const queryResult = { data: { fundraisingLoans: { @@ -17,18 +12,21 @@ const queryResult = { }, }; +const args = { + goal: 50, + progress: 25, +}; + export default { title: 'Components/Checkout/DepositIncentiveUpsell', component: DepositIncentiveUpsell, - args: { - goal: 50, - progress: 25, - }, + args, }; export const Default = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { DepositIncentiveUpsell }, mixins: [apolloStoryMixin({ queryResult })], + setup() { return args; }, template: '', }); diff --git a/.storybook/stories/DonationBanner.stories.js b/.storybook/stories/DonationBanner.stories.js index 5a454bedde..b75627b259 100644 --- a/.storybook/stories/DonationBanner.stories.js +++ b/.storybook/stories/DonationBanner.stories.js @@ -1,28 +1,26 @@ -import Vue from "vue"; -import DonationBanner from "@/components/WwwFrame/PromotionalBanner/Banners/Donation/DonationBanner.vue"; +import DonationBanner from "#src/components/WwwFrame/PromotionalBanner/Banners/Donation/DonationBanner.vue"; -// import plugins -import kivaPlugins from "@/plugins"; -Vue.use(kivaPlugins); +const args = { + isOpen: true, + buttonAmounts: [20, 35, 50], + headline: "Donate $50, get $25 to lend.", + frequency: "monthly", + bannerImageUrl: + "//images.ctfassets.net/j0p9a6ql0rn7/46U7dagWY4pn1vaUPLYaYx/707ada55d0152f6d4b72aa74d894a22c/icon-heart.png", +}; export default { title: "WwwFrame/Banners/DonationBanner", component: DonationBanner, - args: { - isOpen: true, - buttonAmounts: [20, 35, 50], - headline: "Donate $50, get $25 to lend.", - frequency: "monthly", - bannerImageUrl: - "//images.ctfassets.net/j0p9a6ql0rn7/46U7dagWY4pn1vaUPLYaYx/707ada55d0152f6d4b72aa74d894a22c/icon-heart.png", - }, + args, }; -export const Default = (args, { argTypes }) => ({ +export const Default = (_, { argTypes }) => ({ props: Object.keys(argTypes), components: { DonationBanner, }, + setup() { return args; }, template: `
({ props: Object.keys(argTypes), components: { DonationNudgeLightbox }, mixins: [cookieStoreStoryMixin(), apolloStoryMixin()], + setup() { return args; }, template: ` Make a loan, change a life.", + "contentType": "genericContentBlock" + }, + { + "label": "Find a borrower", + "style": "primary", + "webLink": "/lend-by-category", + "analyticsClickEvent": [ + "homepage", + "click-standard-hero-cta", + "Find a borrower" + ], + "contentType": "button" + }, + { + "label": "Learn more", + "style": "secondary", + "webLink": "/lend-by-category", + "analyticsClickEvent": [ + "homepage", + "click-standard-hero-cta", + "Find a borrower" + ], + "contentType": "button" + } + ], + "media": [ + { + "title": "StaticLoanCard", + "description": "Asunta | A loan of $1,950 helps to increase production by hiring more artisans for her workshop.", + "file": { + "url": "//images.ctfassets.net/j0p9a6ql0rn7/3mOH6ZpXwkg8QjHud1tNMZ/cbfa3eaec8bcb730c09d8fb6aeee0080/MGCampaignLoanCardStatic.jpg", + "details": { + "size": 336770, + "image": { + "width": 762, + "height": 906 + } + }, + "fileName": "MGCampaignLoanCardStatic.jpg", + "contentType": "image/jpeg" + } + } + ] + } +}; + export default { title: 'kv/KvDynamicHeroClassic', component: DynamicHeroClassic, - args: { - content: { - "key": "hp-classic-standard-hero", - "name": "hp-classic-standard-hero", - "type": "dynamicHeroClassic", - "title": null, - "contents": [ - { - "key": "hp-classic-standard-hero-gcb", - "name": "hp-classic-standard-hero-gcb", - "bodyCopy": { - "nodeType": "document", - "data": {}, - "content": [ - { - "nodeType": "paragraph", - "data": {}, - "content": [ - { - "nodeType": "text", - "value": "1. Laura and her husband, Walcenibier, need a $1000 loan to grow their empanada business", - "marks": [], - "data": {} - } - ] - }, - { - "nodeType": "paragraph", - "data": {}, - "content": [ - { - "nodeType": "text", - "value": "2. Laura and her husband, Walcenibier, need a $1000 loan to grow their empanada business", - "marks": [], - "data": {} - }, - { - nodeType: 'text', - value: ' Lorem ipsum', - data: { - class: 'tw-text-brand' - }, - marks: [{ type: 'bold'}], - } - ] - }, - { - "nodeType": "paragraph", - "data": {}, - "content": [ - { - "nodeType": "text", - "value": "3. 37 people lend money through Kiva to help them fund their loan", - "marks": [], - "data": {} - }, - { - nodeType: 'text', - value: ' Lorem ipsum', - data: {}, - marks: [{ type: 'underline'}], - } - ] - }, - { - "nodeType": "paragraph", - "data": {}, - "content": [ - { - "nodeType": "text", - "value": "4. 37 people lend money through Kiva to help them fund their loan", - "marks": [], - "data": {} - }, - { - nodeType: 'text', - value: ' Lorem ipsum', - data: {}, - marks: [{ type: 'italic'}], - } - ] - } - ] - }, - "headline": "Make a loan, change a life.", - "contentType": "genericContentBlock" - }, - { - "label": "Find a borrower", - "style": "primary", - "webLink": "/lend-by-category", - "analyticsClickEvent": [ - "homepage", - "click-standard-hero-cta", - "Find a borrower" - ], - "contentType": "button" - }, - { - "label": "Learn more", - "style": "secondary", - "webLink": "/lend-by-category", - "analyticsClickEvent": [ - "homepage", - "click-standard-hero-cta", - "Find a borrower" - ], - "contentType": "button" - } - ], - "media": [ - { - "title": "StaticLoanCard", - "description": "Asunta | A loan of $1,950 helps to increase production by hiring more artisans for her workshop.", - "file": { - "url": "//images.ctfassets.net/j0p9a6ql0rn7/3mOH6ZpXwkg8QjHud1tNMZ/cbfa3eaec8bcb730c09d8fb6aeee0080/MGCampaignLoanCardStatic.jpg", - "details": { - "size": 336770, - "image": { - "width": 762, - "height": 906 - } - }, - "fileName": "MGCampaignLoanCardStatic.jpg", - "contentType": "image/jpeg" - } - } - ] - } - }, + args, } export const Default = (args, { argTypes }) => ({ @@ -142,6 +144,7 @@ export const Default = (args, { argTypes }) => ({ }, props: Object.keys(argTypes), mixins: [apolloStoryMixin()], + setup() { return args; }, template: ` `, diff --git a/.storybook/stories/EcoChallengeLightbox.stories.js b/.storybook/stories/EcoChallengeLightbox.stories.js index 5bd33e4454..37c5c50df0 100644 --- a/.storybook/stories/EcoChallengeLightbox.stories.js +++ b/.storybook/stories/EcoChallengeLightbox.stories.js @@ -1,4 +1,4 @@ -import EcoChallengeLightbox from '@/components/Lightboxes/EcoChallengeLightbox.vue'; +import EcoChallengeLightbox from '#src/components/Lightboxes/EcoChallengeLightbox.vue'; import cookieStoreStoryMixin from '../mixins/cookie-store-story-mixin'; import apolloStoryMixin from '../mixins/apollo-story-mixin'; @@ -68,6 +68,12 @@ export const EcoChallengeLightboxCombo0 = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { EcoChallengeLightbox }, mixins: [cookieStoreStoryMixin(), apolloStoryMixin()], + setup() { + return { + progresses: allMilestoneCombinations[0], + visible: true + }; + }, template: ` ({ `, }); -EcoChallengeLightboxCombo0.args = { - progresses: allMilestoneCombinations[0], -}; - export const EcoChallengeLightboxCombo1 = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { EcoChallengeLightbox }, mixins: [cookieStoreStoryMixin(), apolloStoryMixin()], + setup() { + return { + progresses: allMilestoneCombinations[1], + visible: true + }; + }, template: ` ({ `, }); -EcoChallengeLightboxCombo1.args = { - progresses: allMilestoneCombinations[1], -}; - export const EcoChallengeLightboxCombo2 = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { EcoChallengeLightbox }, mixins: [cookieStoreStoryMixin(), apolloStoryMixin()], + setup() { + return { + progresses: allMilestoneCombinations[2], + visible: true + }; + }, template: ` ({ `, }); -EcoChallengeLightboxCombo2.args = { - progresses: allMilestoneCombinations[2], -}; - export const EcoChallengeLightboxCombo3 = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { EcoChallengeLightbox }, mixins: [cookieStoreStoryMixin(), apolloStoryMixin()], + setup() { + return { + progresses: allMilestoneCombinations[3], + visible: true + }; + }, template: ` ({ `, }); -EcoChallengeLightboxCombo3.args = { - progresses: allMilestoneCombinations[3], -}; - - export const EcoChallengeLightboxCombo4 = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { EcoChallengeLightbox }, mixins: [cookieStoreStoryMixin(), apolloStoryMixin()], + setup() { + return { + progresses: allMilestoneCombinations[4], + visible: true + }; + }, template: ` ({ `, }); -EcoChallengeLightboxCombo4.args = { - progresses: allMilestoneCombinations[4], -}; - export const EcoChallengeLightboxCombo5 = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { EcoChallengeLightbox }, mixins: [cookieStoreStoryMixin(), apolloStoryMixin()], + setup() { + return { + progresses: allMilestoneCombinations[5], + visible: true + }; + }, template: ` ({ `, }); -EcoChallengeLightboxCombo5.args = { - progresses: allMilestoneCombinations[5], -}; - export const EcoChallengeLightboxCombo6 = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { EcoChallengeLightbox }, mixins: [cookieStoreStoryMixin(), apolloStoryMixin()], + setup() { + return { + progresses: allMilestoneCombinations[6], + visible: true + }; + }, template: ` ({ `, }); -EcoChallengeLightboxCombo6.args = { - progresses: allMilestoneCombinations[6], -}; - export const EcoChallengeLightboxCombo7 = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { EcoChallengeLightbox }, mixins: [cookieStoreStoryMixin(), apolloStoryMixin()], + setup() { + return { + progresses: allMilestoneCombinations[7], + visible: true + }; + }, template: ` ({ /> `, }); - -EcoChallengeLightboxCombo7.args = { - progresses: allMilestoneCombinations[7], -}; - - - - diff --git a/.storybook/stories/GenericPromoBanner.stories.js b/.storybook/stories/GenericPromoBanner.stories.js index 6b0e8f3984..8c01aaa833 100644 --- a/.storybook/stories/GenericPromoBanner.stories.js +++ b/.storybook/stories/GenericPromoBanner.stories.js @@ -1,26 +1,24 @@ -import Vue from 'vue' -import GenericPromoBanner from '@/components/WwwFrame/PromotionalBanner/Banners/GenericPromoBanner'; +import GenericPromoBanner from '#src/components/WwwFrame/PromotionalBanner/Banners/GenericPromoBanner'; -// import plugins -import kivaPlugins from '@/plugins'; -Vue.use(kivaPlugins) -const decodeHTML = function(html) { +const decodeHTML = function (html) { var txt = document.createElement('textarea'); txt.innerHTML = html; return txt.value; } +const args = { + iconKey: 'present', + promoBannerContent: { + kvTrackEvent: [], + link: 'http://kiva.org', + richText: decodeHTML('Amazing! Thanks to you, we funded ALL U.S. loans today! Click here to support others who need your help.'), + } +}; + export default { title: 'WwwFrame/Banners/GenericPromoBanner', component: GenericPromoBanner, - args: { - iconKey: 'present', - promoBannerContent: { - kvTrackEvent: [], - link: 'http://kiva.org', - richText: decodeHTML('Amazing! Thanks to you, we funded ALL U.S. loans today! Click here to support others who need your help.'), - } - }, + args, }; export const Default = (args, { argTypes }) => ({ @@ -28,6 +26,7 @@ export const Default = (args, { argTypes }) => ({ components: { GenericPromoBanner, }, + setup() { return args; }, template: `
({ `, }); -export const AllIcons = (args, { argTypes }) => ({ +export const AllIcons = (_, { argTypes }) => ({ props: Object.keys(argTypes), components: { GenericPromoBanner, @@ -58,6 +57,7 @@ export const AllIcons = (args, { argTypes }) => ({ ] } }, + setup() { return args; }, template: `
({ +export const Default = (_, { argTypes }) => ({ props: Object.keys(argTypes), mixins: [apolloStoryMixin()], components: { GridLoanCard, }, + setup() { return args; }, template: ` ({ `, }); -export const Tags = (args, { argTypes }) => ({ +export const Tags = (_, { argTypes }) => ({ props: Object.keys(argTypes), mixins: [apolloStoryMixin()], components: { GridLoanCard, }, + setup() { return args; }, template: ` { const template = (_args, { argTypes }) => ({ props: Object.keys(argTypes), components: { ActivityAvatar }, + setup() { return args; }, template: `
{ const template = (_args, { argTypes }) => ({ props: Object.keys(argTypes), components: { ActivityCard }, + setup() { return args; }, template: `
({ +export const Default = (_, { argTypes }) => ({ props: Object.keys(argTypes), mixins: [apolloStoryMixin({ queryResult }), cookieStoreStoryMixin()], - components: { KivaClassicSingleCategoryCarousel, KvGrid, KvPageContainer }, + components: { KivaClassicSingleCategoryCarousel, KvGrid, KvPageContainer }, + setup() { return args; }, template: ` diff --git a/.storybook/stories/KivaMultiCategoryGrid.stories.js b/.storybook/stories/KivaMultiCategoryGrid.stories.js index 9d919a3edc..44303da1f4 100644 --- a/.storybook/stories/KivaMultiCategoryGrid.stories.js +++ b/.storybook/stories/KivaMultiCategoryGrid.stories.js @@ -1,60 +1,63 @@ -import KivaLoanCardCategory from '@/components/LoanCollections/HomeExp/KivaLoanCardCategory'; +import KivaLoanCardCategory from '#src/components/LoanCollections/HomeExp/KivaLoanCardCategory'; import apolloStoryMixin from '../mixins/apollo-story-mixin'; import cookieStoreStoryMixin from '../mixins/cookie-store-story-mixin'; -import LoanCategorySelectorHomeExp from '@/components/LoanCollections/HomeExp/LoanCategorySelectorHomeExp'; -import KvGrid from '~/@kiva/kv-components/vue/KvGrid'; +import LoanCategorySelectorHomeExp from '#src/components/LoanCollections/HomeExp/LoanCategorySelectorHomeExp'; +import KvGrid from '@kiva/kv-components/vue/KvGrid'; + +const args = { + showAllButton: true, + combinedLoanChannelData: [{ + "id": 32, + "name": "Refugees and IDPs", + "url": "https://www.dev.kiva.org/lend/refugees-and-i-d-ps", + "shortName": "Refugees and IDPs", + "__typename": "LoanChannel" + }, + { + "id": 5, + "name": "Women", + "url": "https://www.dev.kiva.org/lend/women", + "shortName": "Women", + "__typename": "LoanChannel" + }, + { + "id": 6, + "name": "Health", + "url": "https://www.dev.kiva.org/lend/women", + "shortName": "Health", + "__typename": "LoanChannel" + }], + selectedChannel: { + id: 5, + url: 'women' + }, + showCarousel: true, + showViewMoreCard: false, + selectedChannelLoanIds: [ + 2414972, 2411407, 2428657, 2422009, 2421968, 2422012 + ], + newHomeExp: true, + loanLimit: 6, +}; export default { title: 'New Home Page/Kiva Multi Category Grid', - components: {LoanCategorySelectorHomeExp, KivaLoanCardCategory, KvGrid}, - args: { - showAllButton: true, - combinedLoanChannelData: [{ - "id":32, - "name":"Refugees and IDPs", - "url":"https://www.dev.kiva.org/lend/refugees-and-i-d-ps", - "shortName": "Refugees and IDPs", - "__typename":"LoanChannel" - }, - { - "id":5, - "name":"Women", - "url":"https://www.dev.kiva.org/lend/women", - "shortName": "Women", - "__typename":"LoanChannel" - }, - { - "id":6, - "name":"Health", - "url":"https://www.dev.kiva.org/lend/women", - "shortName": "Health", - "__typename":"LoanChannel" - }], - selectedChannel: { - id: 5, - url: 'women' - }, - showCarousel: true, - showViewMoreCard: false, - selectedChannelLoanIds: [ - 2414972, 2411407, 2428657, 2422009, 2421968, 2422012 - ], - newHomeExp: true, - loanLimit: 6, - } + components: { LoanCategorySelectorHomeExp, KivaLoanCardCategory, KvGrid }, + args, }; -export const DefaultGrid = (args, { argTypes }) => ({ +export const DefaultGrid = (_, { argTypes }) => ({ props: Object.keys(argTypes), components: { LoanCategorySelectorHomeExp, KivaLoanCardCategory, KvGrid }, mixins: [apolloStoryMixin(), cookieStoreStoryMixin()], methods: { - handleCategoryClick (payload) { + handleCategoryClick(payload) { this.selectedChannel = this.combinedLoanChannelData.find( loanChannel => loanChannel.id === payload.categoryId ); } }, + setup() { return args; }, template: `
diff --git a/.storybook/stories/KvAccordionItem.stories.js b/.storybook/stories/KvAccordionItem.stories.js index 5fcf96cda0..3a28f4b96f 100644 --- a/.storybook/stories/KvAccordionItem.stories.js +++ b/.storybook/stories/KvAccordionItem.stories.js @@ -1,4 +1,4 @@ -import KvAccordionItem from '@/components/Kv/KvAccordionItem'; +import KvAccordionItem from '#src/components/Kv/KvAccordionItem'; export default { title: 'Kv/KvAccordionItem', diff --git a/.storybook/stories/KvActivityRow.stories.js b/.storybook/stories/KvActivityRow.stories.js index a3d72b1f18..992653b6ab 100644 --- a/.storybook/stories/KvActivityRow.stories.js +++ b/.storybook/stories/KvActivityRow.stories.js @@ -1,20 +1,21 @@ -import KvActivityRow from '@/components/Kv/KvActivityRow.vue'; +import KvActivityRow from '#src/components/Kv/KvActivityRow.vue'; export default { - title: 'Kv/KvActivityRow', - component: KvActivityRow, + title: 'Kv/KvActivityRow', + component: KvActivityRow, }; const activity = { - lenderName: 'Stephanie', - lenderImage: 'https://www.development.kiva.org/img/s100/26e15431f51b540f31cd9f011cc54f31.jpg', - text: 'Stephanie lent $25', + lenderName: 'Stephanie', + lenderImage: 'https://www.development.kiva.org/img/s100/26e15431f51b540f31cd9f011cc54f31.jpg', + text: 'Stephanie lent $25', }; const story = (args) => { const template = (_args, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvActivityRow }, + setup() { return args; }, template: ``, }) @@ -22,4 +23,4 @@ const story = (args) => { return template; }; -export const Default = story({ activity }); \ No newline at end of file +export const Default = story({ activity }); diff --git a/.storybook/stories/KvAlert.stories.js b/.storybook/stories/KvAlert.stories.js index 88c629e020..2d1ad7989d 100644 --- a/.storybook/stories/KvAlert.stories.js +++ b/.storybook/stories/KvAlert.stories.js @@ -1,4 +1,4 @@ -import KvAlert from '@/components/Kv/KvAlert'; +import KvAlert from '#src/components/Kv/KvAlert'; export default { title: 'Kv/KvAlert', @@ -11,8 +11,8 @@ export default { variant: { control: { type: 'select', - options: [ 'success', 'caution', 'danger'], - } + }, + options: ['success', 'caution', 'danger'], }, }, }; @@ -22,6 +22,7 @@ export const Default = (args, { argTypes }) => ({ components: { KvAlert }, + setup() { return args; }, template: ` ({ data() { return { ...commonData, + value: '', }; }, template: ` @@ -31,6 +32,7 @@ export const Default = () => ({ type="text" name="baseInput" :validation="{}" + v-model="value" > Base input @@ -38,6 +40,7 @@ export const Default = () => ({ type="text" name="baseInputError" :validation="vuelidateObject" + v-model="value" > Base input with error diff --git a/.storybook/stories/KvButton.stories.js b/.storybook/stories/KvButton.stories.js index 755525a5be..0102de4f7f 100644 --- a/.storybook/stories/KvButton.stories.js +++ b/.storybook/stories/KvButton.stories.js @@ -1,4 +1,4 @@ -import KvButton from '@/components/Kv/KvButton'; +import KvButton from '#src/components/Kv/KvButton'; export default { title: 'KV/KvButton', diff --git a/.storybook/stories/KvCarousel.stories.js b/.storybook/stories/KvCarousel.stories.js index 92106003e1..36e6331a98 100644 --- a/.storybook/stories/KvCarousel.stories.js +++ b/.storybook/stories/KvCarousel.stories.js @@ -1,8 +1,9 @@ -import KvCarousel from '@/components/Kv/KvCarousel'; -import KvCarouselSlide from '@/components/Kv/KvCarouselSlide'; -import KvCauseSelector from '@/components/Kv/KvCauseSelector'; -import KvLoadingSpinner from '@/components/Kv/KvLoadingSpinner'; -import KvResponsiveImage from '@/components/Kv/KvResponsiveImage'; +import KvCarousel from '#src/components/Kv/KvCarousel'; +import KvCarouselSlide from '#src/components/Kv/KvCarouselSlide'; +import KvCauseSelector from '#src/components/Kv/KvCauseSelector'; +import KvLoadingSpinner from '#src/components/Kv/KvLoadingSpinner'; +import KvResponsiveImage from '#src/components/Kv/KvResponsiveImage'; +import { metaGlobReader } from '#src/util/importHelpers'; import causeList from '../mock-data/cause-selector-data-mock'; @@ -26,7 +27,7 @@ const defaultCarouselSlides = ` export default { title: 'Kv/KvCarousel', component: KvCarousel, - }; +}; export const Default = () => ({ components: { @@ -316,7 +317,9 @@ export const loanCardExample = () => ({ } }); -const slidesImageRequire = require.context('@/assets/images/possibilities-banners/kivan-slider', true); +const slidesImageGlob = import.meta.glob('/src/assets/images/possibilities-banners/kivan-slider/*.*', { eager: true }); +const slidesImageRequire = metaGlobReader(slidesImageGlob, '/src/assets/images/possibilities-banners/kivan-slider/'); + export const KivanSlider = () => ({ components: { KvCarousel, @@ -330,32 +333,32 @@ export const KivanSlider = () => ({ return [ { left: [ - ['small', slidesImageRequire('./kivan-1a-std.jpg')], - ['small retina', slidesImageRequire('./kivan-1a-retina.jpg')] + ['small', slidesImageRequire('kivan-1a-std.jpg')], + ['small retina', slidesImageRequire('kivan-1a-retina.jpg')] ], right: [ - ['small', slidesImageRequire('./kivan-1b-std.jpg')], - ['small retina', slidesImageRequire('./kivan-1b-retina.jpg')], + ['small', slidesImageRequire('kivan-1b-std.jpg')], + ['small retina', slidesImageRequire('kivan-1b-retina.jpg')], ] }, { left: [ - ['small', slidesImageRequire('./kivan-2a-std.jpg')], + ['small', slidesImageRequire('kivan-2a-std.jpg')], ['small retina', slidesImageRequire('./kivan-2a-retina.jpg')], ], right: [ - ['small', slidesImageRequire('./kivan-2b-std.jpg')], - ['small retina', slidesImageRequire('./kivan-2b-retina.jpg')], + ['small', slidesImageRequire('kivan-2b-std.jpg')], + ['small retina', slidesImageRequire('kivan-2b-retina.jpg')], ] }, { left: [ - ['small', slidesImageRequire('./kivan-3a-std.jpg')], - ['small retina', slidesImageRequire('./kivan-3a-retina.jpg')], + ['small', slidesImageRequire('kivan-3a-std.jpg')], + ['small retina', slidesImageRequire('kivan-3a-retina.jpg')], ], right: [ - ['small', slidesImageRequire('./kivan-3b-std.jpg')], - ['small retina', slidesImageRequire('./kivan-3b-retina.jpg')] + ['small', slidesImageRequire('kivan-3b-std.jpg')], + ['small retina', slidesImageRequire('kivan-3b-retina.jpg')] ] } ] @@ -386,7 +389,9 @@ export const KivanSlider = () => ({ `, }); -const imageRequire = require.context('@/assets/images/hero-slideshow/', true); +const imageGlob = import.meta.glob('/src/assets/images/hero-slideshow/*.*', { eager: true }); +const imageRequire = metaGlobReader(imageGlob, '/src/assets/images/hero-slideshow/'); + export const ImagesOnlyLazyLoadLikeHomepage = () => ({ components: { KvCarousel, @@ -408,16 +413,16 @@ export const ImagesOnlyLazyLoadLikeHomepage = () => ({ }, heroImages(number) { return [ - ['small', imageRequire(`./hero-${number}-sm-std.jpg`)], - ['small retina', imageRequire(`./hero-${number}-sm-retina.jpg`)], - ['medium', imageRequire(`./hero-${number}-med-std.jpg`)], - ['medium retina', imageRequire(`./hero-${number}-med-retina.jpg`)], - ['large', imageRequire(`./hero-${number}-lg-std.jpg`)], - ['large retina', imageRequire(`./hero-${number}-lg-retina.jpg`)], - ['xga', imageRequire(`./hero-${number}-xga-std.jpg`)], - ['xga retina', imageRequire(`./hero-${number}-xga-retina.jpg`)], - ['wxga', imageRequire(`./hero-${number}-wxga-std.jpg`)], - ['wxga retina', imageRequire(`./hero-${number}-wxga-retina.jpg`)], + ['small', imageRequire(`hero-${number}-sm-std.jpg`)], + ['small retina', imageRequire(`hero-${number}-sm-retina.jpg`)], + ['medium', imageRequire(`hero-${number}-med-std.jpg`)], + ['medium retina', imageRequire(`hero-${number}-med-retina.jpg`)], + ['large', imageRequire(`hero-${number}-lg-std.jpg`)], + ['large retina', imageRequire(`hero-${number}-lg-retina.jpg`)], + ['xga', imageRequire(`hero-${number}-xga-std.jpg`)], + ['xga retina', imageRequire(`hero-${number}-xga-retina.jpg`)], + ['wxga', imageRequire(`hero-${number}-wxga-std.jpg`)], + ['wxga retina', imageRequire(`hero-${number}-wxga-retina.jpg`)], ]; }, }, diff --git a/.storybook/stories/KvCauseSelector.stories.js b/.storybook/stories/KvCauseSelector.stories.js index 7201174d7d..c8a34f0328 100644 --- a/.storybook/stories/KvCauseSelector.stories.js +++ b/.storybook/stories/KvCauseSelector.stories.js @@ -1,4 +1,4 @@ -import KvCauseSelector from '@/components/Kv/KvCauseSelector'; +import KvCauseSelector from '#src/components/Kv/KvCauseSelector'; import causeList from '../mock-data/cause-selector-data-mock'; @@ -16,8 +16,8 @@ export default { cause: { control: { type: 'select', - options: causeList, - } + }, + options: causeList, }, }, }; @@ -32,6 +32,7 @@ export const Default = (args, { argTypes }) => ({ console.log(`Changed to ${val}`); } }, + setup() { return args; }, template: `
({ components: { @@ -22,7 +22,7 @@ export const Default = () => ({ Option 1 @@ -30,14 +30,14 @@ export const Default = () => ({ Option 2 Option 3 @@ -60,14 +60,14 @@ export const Checked = () => ({ True by default False by default diff --git a/.storybook/stories/KvCheckboxList.stories.js b/.storybook/stories/KvCheckboxList.stories.js index db616138d6..e35f6b1ebb 100644 --- a/.storybook/stories/KvCheckboxList.stories.js +++ b/.storybook/stories/KvCheckboxList.stories.js @@ -1,29 +1,16 @@ -import KvCheckboxList from '@/components/Kv/KvCheckboxList'; +import KvCheckboxList from '#src/components/Kv/KvCheckboxList'; export default { title: 'Kv/Form Elements/KvCheckboxList', component: KvCheckboxList, }; -const story = (args) => { - const template = (_args, { argTypes }) => ({ - props: Object.keys(argTypes), - components: { KvCheckboxList }, - template: ``, - }) - template.args = args; - return template; -}; - const items = [...Array(4)].map((_, i) => ({ value: `${i}`, title: `Option ${i}` })); -export const Default = story({ items }); +export const Default = { args: { items } }; -export const ShowSelectAll = story({ items, showSelectAll: true }); +export const ShowSelectAll = { args: { items, showSelectAll: true } }; -export const SelectedValues = story({ items, selectedValues: items.slice(0, 2).map(i => i.value) }); +export const SelectedValues = { args: { items, selectedValues: items.slice(0, 2).map(i => i.value) } }; -export const Disabled = story({ items: items.map(i => ({ ...i, disabled: true })) }); +export const Disabled = { args: { items: items.map(i => ({ ...i, disabled: true })) } }; diff --git a/.storybook/stories/KvChip.stories.js b/.storybook/stories/KvChip.stories.js index 8ff0121bcc..6f1e7cea85 100644 --- a/.storybook/stories/KvChip.stories.js +++ b/.storybook/stories/KvChip.stories.js @@ -1,11 +1,13 @@ -import KvChip from '@/components/Kv/KvChip'; +import KvChip from '#src/components/Kv/KvChip'; + +const args = { + title: 'Chip Title', +}; export default { title: 'Kv/KvChip', component: KvChip, - args: { - title: 'Chip Title', - }, + args, }; export const Default = (args, { argTypes }) => ({ @@ -18,6 +20,7 @@ export const Default = (args, { argTypes }) => ({ console.log('click chip'); } }, + setup() { return args; }, template: ` ({ @@ -20,6 +22,40 @@ export const ImageSet = (args, { argTypes }) => ({ components: { KvContentfulImg }, + setup() { + return { + ...args, + crop: '&fit=fill&f=face', + sourceSizes: [ + { + width: 1920, + height: 650, + media: 'min-width: 1441px', + }, + { + width: 1440, + height: 620, + media: 'min-width: 1025px', + }, + { + width: 1024, + height: 441, + media: 'min-width: 1024px', + }, + { + width: 680, + height: 372, + media: 'min-width: 734px', + }, + { + width: 480, + height: 540, + media: 'min-width: 0px', + }, + ], + contentfulSrc: 'https://images.ctfassets.net/j0p9a6ql0rn7/7mY5ZujL9UfbluRkVkHgkX/5ec83a74e7c1dc387f3fa35af34f5243/mg-hppromo-1-wxga-retina.jpg' + }; + }, template: ` ({ /> `, }); -ImageSet.args = { - crop: '&fit=fill&f=face', - sourceSizes: [ - { - width: 1920, - height: 650, - media: 'min-width: 1441px', - }, - { - width: 1440, - height: 620, - media: 'min-width: 1025px', - }, - { - width: 1024, - height: 441, - media: 'min-width: 1024px', - }, - { - width: 680, - height: 372, - media: 'min-width: 734px', - }, - { - width: 480, - height: 540, - media: 'min-width: 0px', - }, - ], - contentfulSrc: 'https://images.ctfassets.net/j0p9a6ql0rn7/7mY5ZujL9UfbluRkVkHgkX/5ec83a74e7c1dc387f3fa35af34f5243/mg-hppromo-1-wxga-retina.jpg' -}; export const Default = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvContentfulImg }, + setup() { return args; }, template: ` ({ }); export const WithValidation = () => ({ - mixins: [validationMixin], - validations: { + validations() { + return { amount: { required, minValue: minValue(5), maxValue: maxValue(10000) - }, - }, - components: { - KvCurrencyInput - }, - data() { - return { - amount: 25, } - }, - template: ` -
- - -
    -
  • Field is required
  • -
  • - Enter an amount of $5-$10,000 -
  • -
-
- ` - }); + } + }, + components: { + KvCurrencyInput + }, + data() { + return { + amount: 25, + } + }, + setup() { return { v$: useVuelidate() }; }, + template: ` +
+ + +
    +
  • Field is required
  • +
  • + Enter an amount of $5-$10,000 +
  • +
+
+ ` +}); diff --git a/.storybook/stories/KvExpandableQuestion.stories.js b/.storybook/stories/KvExpandableQuestion.stories.js index d64cea3b24..9201651f8b 100644 --- a/.storybook/stories/KvExpandableQuestion.stories.js +++ b/.storybook/stories/KvExpandableQuestion.stories.js @@ -1,17 +1,14 @@ -import Vue from 'vue' -import KvExpandableQuestion from '@/components/Kv/KvExpandableQuestion'; +import KvExpandableQuestion from '#src/components/Kv/KvExpandableQuestion'; -// import plugins -import kivaPlugins from '@/plugins'; -Vue.use(kivaPlugins) +const args = { + title: 'Can I cancel anytime?', + content: '

Yes. Auto deposits can be canceled or edited at any time. To do so, go to your subscription settings.

' +}; export default { title: 'Kv/KvExpandableQuestion', component: KvExpandableQuestion, - args: { - title: 'Can I cancel anytime?', - content: '

Yes. Auto deposits can be canceled or edited at any time. To do so, go to your subscription settings.

' - }, + args, }; export const Default = (args, { argTypes }) => ({ @@ -19,12 +16,13 @@ export const Default = (args, { argTypes }) => ({ components: { KvExpandableQuestion }, + setup() { return args; }, template: `
diff --git a/.storybook/stories/KvFlag.stories.js b/.storybook/stories/KvFlag.stories.js index 80de3b291d..f668b13d14 100644 --- a/.storybook/stories/KvFlag.stories.js +++ b/.storybook/stories/KvFlag.stories.js @@ -1,4 +1,4 @@ -import KvFlag from '@/components/Kv/KvFlag'; +import KvFlag from '#src/components/Kv/KvFlag'; import { getCountryList } from 'flag-icon-css'; @@ -14,14 +14,14 @@ export default { country: { control: { type: 'select', - options: getCountryList().map(country => country.code) - } + }, + options: getCountryList().map(country => country.code), }, aspectRatio: { control: { type: 'radio', - options: ['4x3', '1x1'], }, + options: ['4x3', '1x1'], } }, }; @@ -31,70 +31,30 @@ export const Default = (args, { argTypes }) => ({ components: { KvFlag }, + setup() { return args; }, template: `

`, }); -export const InlineSvg = Default.bind({}); -InlineSvg.args = { - inlineSvg: true, -}; - export const Square = Default.bind({}); Square.args = { - aspectRatio: '1x1' -}; - -export const Circular = (args, { argTypes }) => ({ - props: Object.keys(argTypes), - components: { - KvFlag - }, - template: ` -
- - .circular { - border-radius: 50%; - overflow: hidden; - border: 1px solid #ccc; - box-sizing: content-box; - } - - -
- `, -}); -Circular.args = { - aspectRatio: '1x1' + isSquare: true, }; -export const CircularInlineSvg = Circular.bind({}); -CircularInlineSvg.args = { - ...Circular.args, - inlineSvg: true -} - export const AllCountries = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { @@ -114,8 +74,6 @@ export const AllCountries = (args, { argTypes }) => ({
{{ country.code }} - {{ country.name }}
@@ -125,14 +83,4 @@ export const AllCountries = (args, { argTypes }) => ({ AllCountries.argTypes = { country: { control: { disable: true } }, - inlineSvg: { control: { disable: true } } -} - -export const AllCountriesInlineSvg = AllCountries.bind({}); -AllCountriesInlineSvg.args = { - ...AllCountries.args, - inlineSvg: true -} -AllCountriesInlineSvg.argTypes = { - ...AllCountries.argTypes, } diff --git a/.storybook/stories/KvFormKitchenSink.stories.js b/.storybook/stories/KvFormKitchenSink.stories.js index 7c5c661ec7..a0a738a7cc 100644 --- a/.storybook/stories/KvFormKitchenSink.stories.js +++ b/.storybook/stories/KvFormKitchenSink.stories.js @@ -1,13 +1,13 @@ -import KvBaseInput from '@/components/Kv/KvBaseInput'; -import KvCheckbox from '@/components/Kv/KvCheckbox'; -import KvCurrencyInput from '@/components/Kv/KvCurrencyInput'; -import KvSelect from '@/components/Kv/KvSelect'; -import KvPhoneInput from '@/components/Kv/KvPhoneInput'; -import KvPillToggle from '@/components/Kv/KvPillToggle'; -import KvRadio from '@/components/Kv/KvRadio'; -import KvRangeSlider from '@/components/Kv/KvRangeSlider'; -import KvToggle from '@/components/Kv/KvToggle'; -import KvVerificationCodeInput from '@/components/Kv/KvVerificationCodeInput'; +import KvBaseInput from '#src/components/Kv/KvBaseInput'; +import KvCheckbox from '#src/components/Kv/KvCheckbox'; +import KvCurrencyInput from '#src/components/Kv/KvCurrencyInput'; +import KvSelect from '#src/components/Kv/KvSelect'; +import KvPhoneInput from '#src/components/Kv/KvPhoneInput'; +import KvPillToggle from '#src/components/Kv/KvPillToggle'; +import KvRadio from '#src/components/Kv/KvRadio'; +import KvRangeSlider from '#src/components/Kv/KvRangeSlider'; +import KvToggle from '#src/components/Kv/KvToggle'; +import KvVerificationCodeInput from '#src/components/Kv/KvVerificationCodeInput'; export default { title: 'Kv/Form Elements', @@ -82,7 +82,8 @@ export const KitchenSink = () => ({ kvToggle1: true, kvToggle2: false, kvToggle3: true, - KvVerificationCodeInput: 123456 + KvVerificationCodeInput: 123456, + kvBaseInputValue: '', } }, template: ` @@ -285,6 +286,7 @@ export const KitchenSink = () => ({ type="text" name="baseInput" :validation="{}" + v-model="kvBaseInputValue" > Base input @@ -292,6 +294,7 @@ export const KitchenSink = () => ({ type="text" name="baseInputError" :validation="kvBaseInputError" + v-model="kvBaseInputValue" > Base input with error diff --git a/.storybook/stories/KvFrequentlyAskedQuestions.stories.js b/.storybook/stories/KvFrequentlyAskedQuestions.stories.js index 7e3b8c696e..9e2555ce2c 100644 --- a/.storybook/stories/KvFrequentlyAskedQuestions.stories.js +++ b/.storybook/stories/KvFrequentlyAskedQuestions.stories.js @@ -1,52 +1,54 @@ -import SectionWithBackgroundClassic from '@/components/Contentful/SectionWithBackgroundClassic'; -import KvFrequentlyAskedQuestions from '@/components/Kv/KvFrequentlyAskedQuestions'; -import KvPageContainer from '~/@kiva/kv-components/vue/KvPageContainer'; +import SectionWithBackgroundClassic from '#src/components/Contentful/SectionWithBackgroundClassic'; +import KvFrequentlyAskedQuestions from '#src/components/Kv/KvFrequentlyAskedQuestions'; +import KvPageContainer from '@kiva/kv-components/vue/KvPageContainer'; -export default { - title: 'Kv/KvFrequentlyAskedQuestions', - component: KvFrequentlyAskedQuestions, - args: { - frequentlyAskedQuestionsHeadline: 'Questions', - frequentlyAskedQuestions: [{ - name: 'First Question', - richText: { - "nodeType": "paragraph", // Can be paragraphs, images, lists, embedded entries +const args = { + frequentlyAskedQuestionsHeadline: 'Questions', + frequentlyAskedQuestions: [{ + name: 'First Question', + richText: { + "nodeType": "paragraph", // Can be paragraphs, images, lists, embedded entries + "data": {}, + "content": [{ + "nodeType": "text", + "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Mollis nunc sed id semper risus in hendrerit. Pharetra diam sit amet nisl suscipit adipiscing bibendum. Interdum varius sit amet mattis vulputate enim. Maecenas pharetra convallis posuere morbi leo urna molestie. Duis ut diam quam nulla porttitor. Elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at augue. Elit pellentesque habitant morbi tristique senectus et netus. Fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate. Non quam lacus suspendisse faucibus interdum posuere lorem. Magnis dis parturient montes nascetur ridiculus. Et tortor consequat id porta nibh venenatis cras sed felis. Dui ut ornare lectus sit amet est placerat. Eu non diam phasellus vestibulum lorem. Dignissim convallis aenean et tortor at.", "data": {}, - "content": [{ - "nodeType": "text", - "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Mollis nunc sed id semper risus in hendrerit. Pharetra diam sit amet nisl suscipit adipiscing bibendum. Interdum varius sit amet mattis vulputate enim. Maecenas pharetra convallis posuere morbi leo urna molestie. Duis ut diam quam nulla porttitor. Elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at augue. Elit pellentesque habitant morbi tristique senectus et netus. Fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate. Non quam lacus suspendisse faucibus interdum posuere lorem. Magnis dis parturient montes nascetur ridiculus. Et tortor consequat id porta nibh venenatis cras sed felis. Dui ut ornare lectus sit amet est placerat. Eu non diam phasellus vestibulum lorem. Dignissim convallis aenean et tortor at.", - "data": {}, - "marks": [] - }] - } - },{ - name: 'Second Question', - richText: { - "nodeType": "paragraph", // Can be paragraphs, images, lists, embedded entries + "marks": [] + }] + } + }, { + name: 'Second Question', + richText: { + "nodeType": "paragraph", // Can be paragraphs, images, lists, embedded entries + "data": {}, + "content": [{ + "nodeType": "text", + "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Mollis nunc sed id semper risus in hendrerit. Pharetra diam sit amet nisl suscipit adipiscing bibendum. Interdum varius sit amet mattis vulputate enim. Maecenas pharetra convallis posuere morbi leo urna molestie. Duis ut diam quam nulla porttitor. Elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at augue. Elit pellentesque habitant morbi tristique senectus et netus. Fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate. Non quam lacus suspendisse faucibus interdum posuere lorem. Magnis dis parturient montes nascetur ridiculus. Et tortor consequat id porta nibh venenatis cras sed felis. Dui ut ornare lectus sit amet est placerat. Eu non diam phasellus vestibulum lorem. Dignissim convallis aenean et tortor at.", "data": {}, - "content": [{ - "nodeType": "text", - "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Mollis nunc sed id semper risus in hendrerit. Pharetra diam sit amet nisl suscipit adipiscing bibendum. Interdum varius sit amet mattis vulputate enim. Maecenas pharetra convallis posuere morbi leo urna molestie. Duis ut diam quam nulla porttitor. Elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at augue. Elit pellentesque habitant morbi tristique senectus et netus. Fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate. Non quam lacus suspendisse faucibus interdum posuere lorem. Magnis dis parturient montes nascetur ridiculus. Et tortor consequat id porta nibh venenatis cras sed felis. Dui ut ornare lectus sit amet est placerat. Eu non diam phasellus vestibulum lorem. Dignissim convallis aenean et tortor at.", - "data": {}, - "marks": [] - }] - } - },{ - name: 'Third Question', - richText: { - "nodeType": "paragraph", // Can be paragraphs, images, lists, embedded entries + "marks": [] + }] + } + }, { + name: 'Third Question', + richText: { + "nodeType": "paragraph", // Can be paragraphs, images, lists, embedded entries + "data": {}, + "content": [{ + "nodeType": "text", + "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Mollis nunc sed id semper risus in hendrerit. Pharetra diam sit amet nisl suscipit adipiscing bibendum. Interdum varius sit amet mattis vulputate enim. Maecenas pharetra convallis posuere morbi leo urna molestie. Duis ut diam quam nulla porttitor. Elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at augue. Elit pellentesque habitant morbi tristique senectus et netus. Fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate. Non quam lacus suspendisse faucibus interdum posuere lorem. Magnis dis parturient montes nascetur ridiculus. Et tortor consequat id porta nibh venenatis cras sed felis. Dui ut ornare lectus sit amet est placerat. Eu non diam phasellus vestibulum lorem. Dignissim convallis aenean et tortor at.", "data": {}, - "content": [{ - "nodeType": "text", - "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Mollis nunc sed id semper risus in hendrerit. Pharetra diam sit amet nisl suscipit adipiscing bibendum. Interdum varius sit amet mattis vulputate enim. Maecenas pharetra convallis posuere morbi leo urna molestie. Duis ut diam quam nulla porttitor. Elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at augue. Elit pellentesque habitant morbi tristique senectus et netus. Fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate. Non quam lacus suspendisse faucibus interdum posuere lorem. Magnis dis parturient montes nascetur ridiculus. Et tortor consequat id porta nibh venenatis cras sed felis. Dui ut ornare lectus sit amet est placerat. Eu non diam phasellus vestibulum lorem. Dignissim convallis aenean et tortor at.", - "data": {}, - "marks": [] - }] - } - }], - verticalPadding: {}, - background: {} - }, + "marks": [] + }] + } + }], + verticalPadding: {}, + background: {} +}; + +export default { + title: 'Kv/KvFrequentlyAskedQuestions', + component: KvFrequentlyAskedQuestions, + args, }; export const Default = (args, { argTypes }) => ({ @@ -54,6 +56,7 @@ export const Default = (args, { argTypes }) => ({ components: { SectionWithBackgroundClassic, KvFrequentlyAskedQuestions, KvPageContainer }, + setup() { return args; }, template: ` { + return Object.keys(r).map((filename) => { let str = filename; - str = str.substring(2); // remove ./ + str = str.substring(str.lastIndexOf('/') + 1); // remove leading path str = str.substring(0, str.length - 4); // remove .svg return str; }); @@ -12,7 +12,7 @@ function getFilenames(r) { export default { title: 'Kv/KvIcon', component: KvIcon, - }; +}; export const Default = () => ({ components: { @@ -25,13 +25,15 @@ export const Default = () => ({ `, }); +const iconGlob = import.meta.glob('/src/assets/icons/inline/*.*', { eager: true }); + export const inlined = () => ({ components: { KvIcon }, data() { return { - iconNames: getFilenames(require.context('@/assets/icons/inline/', true, /\.svg$/)) + iconNames: getFilenames(iconGlob) } }, template: ` @@ -59,13 +61,15 @@ export const inlined = () => ({ `, }); +const spriteGlob = import.meta.glob('/src/assets/icons/sprite/*.*', { eager: true }); + export const fromSprite = () => ({ components: { KvIcon }, data() { return { - iconNames: getFilenames(require.context('@/assets/icons/sprite/', true, /\.svg$/)) + iconNames: getFilenames(spriteGlob) } }, template: ` diff --git a/.storybook/stories/KvIconButton.stories.js b/.storybook/stories/KvIconButton.stories.js index 6c2106bf86..19639b5095 100644 --- a/.storybook/stories/KvIconButton.stories.js +++ b/.storybook/stories/KvIconButton.stories.js @@ -1,5 +1,5 @@ -import KvIcon from '@/components/Kv/KvIcon'; -import KvIconButton from '@/components/Kv/KvIconButton'; +import KvIcon from '#src/components/Kv/KvIcon'; +import KvIconButton from '#src/components/Kv/KvIconButton'; export default { title: 'KV/KvIconButton', diff --git a/.storybook/stories/KvLightbox.stories.js b/.storybook/stories/KvLightbox.stories.js index edbf6a4de4..dd5cb61660 100644 --- a/.storybook/stories/KvLightbox.stories.js +++ b/.storybook/stories/KvLightbox.stories.js @@ -1,5 +1,5 @@ -import KvLightbox from '@/components/Kv/KvLightbox'; -import KvButton from '@/components/Kv/KvButton'; +import KvLightbox from '#src/components/Kv/KvLightbox'; +import KvButton from '#src/components/Kv/KvButton'; const loremIpsum = `

@@ -16,18 +16,20 @@ const loremIpsum = `

`; +const args = { + visible: true, + preventClose: false, + title: 'Test Title', + inverted: false, + noPaddingTop: false, + noPaddingBottom: false, + noPaddingSides: false, +}; + export default { title: 'Kv/KvLightbox', component: KvLightbox, - args: { - visible: true, - preventClose: false, - title: 'Test Title', - inverted: false, - noPaddingTop: false, - noPaddingBottom: false, - noPaddingSides: false, - }, + args, }; export const Default = (args, { argTypes }) => ({ @@ -44,6 +46,7 @@ export const Default = (args, { argTypes }) => ({ this.lightboxVisible = false; } }, + setup() { return args; }, template: `
({ export const Inverted = Default.bind({}); Inverted.args = { + ...args, inverted: true, }; export const PreventClose = Default.bind({}); PreventClose.args = { + ...args, preventClose: true, }; export const Padding = Default.bind({}); Padding.args = { + ...args, noPaddingTop: true, noPaddingBottom: true, noPaddingSides: true, }; -export const SmallContent = (args, { argTypes }) => ({ +export const SmallContent = (_, { argTypes }) => ({ components: { KvLightbox, KvButton }, props: Object.keys(argTypes), + setup() { return args; }, template: `
({ `, }); -export const WithControls = (args, { argTypes }) => ({ +export const WithControls = (_, { argTypes }) => ({ components: { KvLightbox, KvButton }, props: Object.keys(argTypes), + setup() { return args; }, template: `
({ `, }); -export const WithFoundationGrid = (args, { argTypes }) => ({ +export const WithFoundationGrid = (_, { argTypes }) => ({ components: { KvLightbox, KvButton }, props: Object.keys(argTypes), + setup() { return args; }, template: `
({ `, }); -export const CustomTitleColor = (args, { argTypes }) => ({ +export const CustomTitleColor = (_, { argTypes }) => ({ components: { KvLightbox }, props: Object.keys(argTypes), + setup() { return args; }, template: `
({ components: { KvLoadingParagraph }, props: Object.keys(argTypes), + setup() { return args; }, template: '' }); diff --git a/.storybook/stories/KvLoadingSpinner.stories.js b/.storybook/stories/KvLoadingSpinner.stories.js index 1c08d9b8b1..e978890f82 100644 --- a/.storybook/stories/KvLoadingSpinner.stories.js +++ b/.storybook/stories/KvLoadingSpinner.stories.js @@ -1,4 +1,4 @@ -import KvLoadingSpinner from '@/components/Kv/KvLoadingSpinner'; +import KvLoadingSpinner from '#src/components/Kv/KvLoadingSpinner'; export default { title: 'Kv/KvLoadingSpinner', diff --git a/.storybook/stories/KvLoanActivities.stories.js b/.storybook/stories/KvLoanActivities.stories.js index b0c24d1bd2..e9a068dee5 100644 --- a/.storybook/stories/KvLoanActivities.stories.js +++ b/.storybook/stories/KvLoanActivities.stories.js @@ -1,10 +1,10 @@ -import KvLoanActivities from '@/components/Kv/KvLoanActivities.vue'; +import KvLoanActivities from '#src/components/Kv/KvLoanActivities.vue'; import cookieStoreStoryMixin from '../mixins/cookie-store-story-mixin'; import activities from '../mock-data/activity-feed-data-mock'; export default { - title: 'Kv/KvLoanActivities', - component: KvLoanActivities, + title: 'Kv/KvLoanActivities', + component: KvLoanActivities, }; const loan = { @@ -52,12 +52,13 @@ const story = (args) => { mixins: [cookieStoreStoryMixin()], props: Object.keys(argTypes), components: { KvLoanActivities }, + setup() { return args; }, template: ` -
- -
`, +
+ +
`, }) template.args = args; return template; diff --git a/.storybook/stories/KvLoanCards.stories.js b/.storybook/stories/KvLoanCards.stories.js index dbeb7977f1..fc0a75f30c 100644 --- a/.storybook/stories/KvLoanCards.stories.js +++ b/.storybook/stories/KvLoanCards.stories.js @@ -1,4 +1,4 @@ -import NewHomePageLoanCard from '@/components/LoanCards/NewHomePageLoanCard'; +import NewHomePageLoanCard from '#src/components/LoanCards/NewHomePageLoanCard'; import apolloStoryMixin from '../mixins/apollo-story-mixin'; import cookieStoreStoryMixin from '../mixins/cookie-store-story-mixin'; diff --git a/.storybook/stories/KvMap.stories.js b/.storybook/stories/KvMap.stories.js index 6d5f81cb04..380cfa6220 100644 --- a/.storybook/stories/KvMap.stories.js +++ b/.storybook/stories/KvMap.stories.js @@ -1,4 +1,4 @@ -import KvMap from '@/components/Kv/KvMap'; +import KvMap from '#src/components/Kv/KvMap'; export default { title: 'Kv/KvMap', @@ -19,6 +19,7 @@ export default { const Template = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvMap }, + setup() { return args; }, template: ` { const template = (_args, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvPagination }, + setup() { return args; }, template: ` ({ `, }); -export const UsingEventsAndValue = (args, { argTypes }) => ({ +export const UsingEvents = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvPhoneInput }, + data() { + return { + myCoolPhoneNumber: '828-479-5482' + } + }, template: `
@@ -139,12 +144,13 @@ export const CheckingValidity = (args, { argTypes }) => ({ - +
+ +
`, methods: { diff --git a/.storybook/stories/KvPillToggle.stories.js b/.storybook/stories/KvPillToggle.stories.js index 86d69d89e4..c7d7a6e64d 100644 --- a/.storybook/stories/KvPillToggle.stories.js +++ b/.storybook/stories/KvPillToggle.stories.js @@ -1,4 +1,4 @@ -import KvPillToggle from '@/components/Kv/KvPillToggle'; +import KvPillToggle from '#src/components/Kv/KvPillToggle'; export default { title: 'Kv/Form Elements/KvPillToggle', diff --git a/.storybook/stories/KvProgressBar.stories.js b/.storybook/stories/KvProgressBar.stories.js index b1cd8e0b2a..5c8c3d3279 100644 --- a/.storybook/stories/KvProgressBar.stories.js +++ b/.storybook/stories/KvProgressBar.stories.js @@ -1,29 +1,22 @@ -import KvProgressBar from '@/components/Kv/KvProgressBar'; +import KvProgressBar from '#src/components/Kv/KvProgressBar'; + +const args = { + value: '20', + max: '100', +}; export default { title: 'Kv/KvProgressBar', component: KvProgressBar, - args: { - value: '20', - max: '100', - }, - argTypes: { - value: { - control: 'range', - options: { - min: 0, - max: 100, - step: 1, - } - } - } + args, }; -export const Default = (args, { argTypes }) => ({ +export const Default = (_, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvProgressBar }, + setup() { return args; }, template: ` ({ `, }); -export const Styled = (args, { argTypes }) => ({ +export const Styled = (_, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvProgressBar }, + setup() { return args; }, template: ` { const template = (_args, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvProgressCampaign }, + setup() { return args; }, template: `
{ }; export const Default = story({ - daysLeft: 29, totalAmount: 4000, fundedAmount: 462, + daysLeft: '29', totalAmount: 4000, fundedAmount: 462, }); export const MinimalStats = story({ - daysLeft: 29, totalAmount: 4000, fundedAmount: 462, minimalStats: true + daysLeft: '29', totalAmount: 4000, fundedAmount: 462, minimalStats: true }); diff --git a/.storybook/stories/KvProgressCircle.stories.js b/.storybook/stories/KvProgressCircle.stories.js index 4987bf81b5..08485ed122 100644 --- a/.storybook/stories/KvProgressCircle.stories.js +++ b/.storybook/stories/KvProgressCircle.stories.js @@ -1,15 +1,17 @@ -import KvProgressCircle from '@/components/Kv/KvProgressCircle'; +import KvProgressCircle from '#src/components/Kv/KvProgressCircle'; + +const args = { + value: 10, + strokeWidth: 8, + showNumber: false, + arcScale: 1, + rotate: 0, +}; export default { title: 'Kv/KvProgressCircle', component: KvProgressCircle, - args: { - value: 10, - strokeWidth: 8, - showNumber: false, - arcScale: 1, - rotate: 0, - }, + args, argTypes: { value: { control: 'range', @@ -22,11 +24,12 @@ export default { } }; -export const Default = (args, { argTypes }) => ({ +export const Default = (otherArgs, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvProgressCircle }, + setup() { return { ...args, ...otherArgs }; }, template: ` ({ `, }); -export const Styled = (args, { argTypes }) => ({ +export const Styled = (_, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvProgressCircle }, + setup() { return args; }, template: ` ({ export const CShape = Default.bind({}); -CShape.args = { +CShape.otherArgs = { arcScale: .8, rotate: 36, } diff --git a/.storybook/stories/KvRadio.stories.js b/.storybook/stories/KvRadio.stories.js index fad03a6087..0ad7e18e82 100644 --- a/.storybook/stories/KvRadio.stories.js +++ b/.storybook/stories/KvRadio.stories.js @@ -1,4 +1,4 @@ -import KvRadio from '@/components/Kv/KvRadio'; +import KvRadio from '#src/components/Kv/KvRadio'; export default { title: 'Kv/Form Elements/KvRadio', diff --git a/.storybook/stories/KvRangeMinMaxSlider.stories.js b/.storybook/stories/KvRangeMinMaxSlider.stories.js index 85773b2023..60f52b231e 100644 --- a/.storybook/stories/KvRangeMinMaxSlider.stories.js +++ b/.storybook/stories/KvRangeMinMaxSlider.stories.js @@ -1,4 +1,4 @@ -import KvRangeMinMaxSlider from '@/components/Kv/KvRangeMinMaxSlider'; +import KvRangeMinMaxSlider from '#src/components/Kv/KvRangeMinMaxSlider'; export default { title: 'Kv/Form Elements/KvRangeMinMaxSlider', @@ -9,6 +9,7 @@ const story = (args) => { const template = (_args, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvRangeMinMaxSlider }, + setup() { return args; }, template: ` { const template = (_args, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvResultsPerPage }, + setup() { return args; }, template: ``, }) - template.args = args; return template; }; diff --git a/.storybook/stories/KvSectionModalLoader.stories.js b/.storybook/stories/KvSectionModalLoader.stories.js index 33916b7adf..edba001663 100644 --- a/.storybook/stories/KvSectionModalLoader.stories.js +++ b/.storybook/stories/KvSectionModalLoader.stories.js @@ -1,4 +1,4 @@ -import KvSectionModalLoader from '@/components/Kv/KvSectionModalLoader'; +import KvSectionModalLoader from '#src/components/Kv/KvSectionModalLoader'; export default { title: 'Kv/KvSectionModalLoader', @@ -9,6 +9,7 @@ const story = (args) => { const template = (_args, { argTypes }) => ({ props: Object.keys(argTypes), components: { KvSectionModalLoader }, + setup() { return args; }, template: `
{
`, }) - template.args = args; return template; }; diff --git a/.storybook/stories/KvSelect.stories.js b/.storybook/stories/KvSelect.stories.js index f8f4a40494..847c445500 100644 --- a/.storybook/stories/KvSelect.stories.js +++ b/.storybook/stories/KvSelect.stories.js @@ -1,4 +1,4 @@ -import KvSelect from '@/components/Kv/KvSelect'; +import KvSelect from '#src/components/Kv/KvSelect'; export default { title: 'Kv/Form Elements/KvSelect', diff --git a/.storybook/stories/KvSelectBox.stories.js b/.storybook/stories/KvSelectBox.stories.js index 0207764359..2ad737028c 100644 --- a/.storybook/stories/KvSelectBox.stories.js +++ b/.storybook/stories/KvSelectBox.stories.js @@ -1,4 +1,4 @@ -import KvSelectBox from '@/components/Kv/KvSelectBox'; +import KvSelectBox from '#src/components/Kv/KvSelectBox'; export default { title: 'Kv/Form Elements/KvSelectBox', @@ -14,6 +14,7 @@ const story = (args) => { data: () => ({ myCoolModel: '', }), + setup() { return args; }, template: ` diff --git a/.storybook/stories/KvSettingsCard.stories.js b/.storybook/stories/KvSettingsCard.stories.js index 77e74c9863..2c40946c77 100644 --- a/.storybook/stories/KvSettingsCard.stories.js +++ b/.storybook/stories/KvSettingsCard.stories.js @@ -1,4 +1,11 @@ -import KvSettingsCard from '@/components/Kv/KvSettingsCard'; +import KvSettingsCard from '#src/components/Kv/KvSettingsCard'; + + +const args = { + disabled: false, + title: 'Settings Card Title', + cardContent: 'This is the content of the settings card. Insert anything here. The card can accommodate very tall or short content. The card should be used on a page that does not have a white background.', +}; export default { title: 'Kv/KvSettingsCard', @@ -8,18 +15,15 @@ export default { default: 'kiva-bg-lightgray', }, }, - args: { - disabled: false, - title: 'Settings Card Title', - cardContent: 'This is the content of the settings card. Insert anything here. The card can accommodate very tall or short content. The card should be used on a page that does not have a white background.', - } + args, }; -export const Default = (args, { argTypes }) => ({ +export const Default = (_, { argTypes }) => ({ components: { KvSettingsCard, }, props: Object.keys(argTypes), + setup() { return args; }, template: ` diff --git a/src/components/Checkout/BasketItem.vue b/src/components/Checkout/BasketItem.vue index da3c6e0a83..2768032660 100644 --- a/src/components/Checkout/BasketItem.vue +++ b/src/components/Checkout/BasketItem.vue @@ -116,15 +116,15 @@ diff --git a/src/components/Checkout/DonateRepaymentsToggle.vue b/src/components/Checkout/DonateRepaymentsToggle.vue index d86792662a..68aa1c5a28 100644 --- a/src/components/Checkout/DonateRepaymentsToggle.vue +++ b/src/components/Checkout/DonateRepaymentsToggle.vue @@ -62,10 +62,10 @@ import _get from 'lodash/get'; import _filter from 'lodash/filter'; import _forEach from 'lodash/forEach'; import numeral from 'numeral'; -import initializeCheckout from '@/graphql/query/checkout/initializeCheckout.graphql'; -import updateLoanReservationDonateRepayments from '@/graphql/mutation/updateLoanReservationDonateRepayments.graphql'; -import KvLightbox from '~/@kiva/kv-components/vue/KvLightbox'; -import KvCheckbox from '~/@kiva/kv-components/vue/KvCheckbox'; +import initializeCheckout from '#src/graphql/query/checkout/initializeCheckout.graphql'; +import updateLoanReservationDonateRepayments from '#src/graphql/mutation/updateLoanReservationDonateRepayments.graphql'; +import KvLightbox from '@kiva/kv-components/vue/KvLightbox'; +import KvCheckbox from '@kiva/kv-components/vue/KvCheckbox'; export default { name: 'DonateRepaymentsToggle', @@ -188,7 +188,7 @@ export default { diff --git a/src/components/Checkout/DonationItem.vue b/src/components/Checkout/DonationItem.vue index d17b23817b..493d477f64 100644 --- a/src/components/Checkout/DonationItem.vue +++ b/src/components/Checkout/DonationItem.vue @@ -1,119 +1,118 @@ diff --git a/src/components/CorporateCampaign/LoanSearch/AttributeFilter.vue b/src/components/CorporateCampaign/LoanSearch/AttributeFilter.vue index 7305d3fb0a..00a94f5aaf 100644 --- a/src/components/CorporateCampaign/LoanSearch/AttributeFilter.vue +++ b/src/components/CorporateCampaign/LoanSearch/AttributeFilter.vue @@ -6,7 +6,7 @@ key="attributes" :items="attributesWithSelected" :use-columns="true" - @change="onChange" + @update="onChange" />
@@ -14,8 +14,8 @@ diff --git a/src/components/CorporateCampaign/LoanSearch/GenderFilter.vue b/src/components/CorporateCampaign/LoanSearch/GenderFilter.vue index 08bcd509de..4fea4b5371 100644 --- a/src/components/CorporateCampaign/LoanSearch/GenderFilter.vue +++ b/src/components/CorporateCampaign/LoanSearch/GenderFilter.vue @@ -18,7 +18,7 @@ diff --git a/src/components/CorporateCampaign/LoanSearch/SortOrder.vue b/src/components/CorporateCampaign/LoanSearch/SortOrder.vue index b9b6856997..e1610ce729 100644 --- a/src/components/CorporateCampaign/LoanSearch/SortOrder.vue +++ b/src/components/CorporateCampaign/LoanSearch/SortOrder.vue @@ -20,7 +20,7 @@ diff --git a/src/components/Forms/GuestAccountCreation.vue b/src/components/Forms/GuestAccountCreation.vue index 77e8561475..8e806d3270 100644 --- a/src/components/Forms/GuestAccountCreation.vue +++ b/src/components/Forms/GuestAccountCreation.vue @@ -8,7 +8,7 @@ class="data-hj-suppress tw-mb-2" type="text" v-model.trim="firstName" - :validation="$v.firstName" + :validation="v$.firstName" > First name diff --git a/src/components/Kv/KvFrequentlyAskedQuestions.vue b/src/components/Kv/KvFrequentlyAskedQuestions.vue index 7998050a80..b93e345352 100644 --- a/src/components/Kv/KvFrequentlyAskedQuestions.vue +++ b/src/components/Kv/KvFrequentlyAskedQuestions.vue @@ -11,7 +11,7 @@ :key="index" :title="question.name" :content="convertFromRichTextToHtml(question.richText)" - :id="question.name | changeCase('paramCase')" + :id="$filters.changeCase(question.name, 'paramCase')" :active="isActive(question.name)" @toggle="setActiveAccordion" /> @@ -20,9 +20,9 @@ diff --git a/src/components/Kv/KvMap.vue b/src/components/Kv/KvMap.vue index bc19a014bc..ad0a9eee75 100644 --- a/src/components/Kv/KvMap.vue +++ b/src/components/Kv/KvMap.vue @@ -1,7 +1,7 @@ diff --git a/src/components/LenderProfile/LenderMap.vue b/src/components/LenderProfile/LenderMap.vue index 10f51f8c0e..124f9f2057 100644 --- a/src/components/LenderProfile/LenderMap.vue +++ b/src/components/LenderProfile/LenderMap.vue @@ -84,10 +84,10 @@ diff --git a/src/components/LoanCards/PromoGridLoanCardExp.vue b/src/components/LoanCards/PromoGridLoanCardExp.vue index 584f4769a6..2ecda11828 100644 --- a/src/components/LoanCards/PromoGridLoanCardExp.vue +++ b/src/components/LoanCards/PromoGridLoanCardExp.vue @@ -32,10 +32,12 @@ diff --git a/src/components/LoanFinding/QuickFiltersSection.vue b/src/components/LoanFinding/QuickFiltersSection.vue index 924aad7ff7..0ff9fef1c1 100644 --- a/src/components/LoanFinding/QuickFiltersSection.vue +++ b/src/components/LoanFinding/QuickFiltersSection.vue @@ -72,14 +72,14 @@ diff --git a/src/components/LoansByCategory/ViewToggle.vue b/src/components/LoansByCategory/ViewToggle.vue index 047c64dbf8..0dbb50d8af 100644 --- a/src/components/LoansByCategory/ViewToggle.vue +++ b/src/components/LoansByCategory/ViewToggle.vue @@ -30,9 +30,9 @@ diff --git a/src/components/WwwFrame/PromotionalBanner/Banners/Donation/DonationBannerContainer.vue b/src/components/WwwFrame/PromotionalBanner/Banners/Donation/DonationBannerContainer.vue index 42db000966..f4d4d4ef05 100644 --- a/src/components/WwwFrame/PromotionalBanner/Banners/Donation/DonationBannerContainer.vue +++ b/src/components/WwwFrame/PromotionalBanner/Banners/Donation/DonationBannerContainer.vue @@ -15,7 +15,7 @@ diff --git a/src/components/WwwFrame/PromotionalBanner/Banners/GiftBanner.vue b/src/components/WwwFrame/PromotionalBanner/Banners/GiftBanner.vue index 290ebb344f..375e1eb575 100644 --- a/src/components/WwwFrame/PromotionalBanner/Banners/GiftBanner.vue +++ b/src/components/WwwFrame/PromotionalBanner/Banners/GiftBanner.vue @@ -14,7 +14,7 @@ diff --git a/src/pages/Autolending/AutolendingWho.vue b/src/pages/Autolending/AutolendingWho.vue index 3ad0763815..cda0c4676b 100644 --- a/src/pages/Autolending/AutolendingWho.vue +++ b/src/pages/Autolending/AutolendingWho.vue @@ -15,7 +15,7 @@
@@ -75,7 +75,7 @@
@@ -85,7 +85,7 @@
@@ -103,7 +103,7 @@
-
+
@@ -128,12 +128,12 @@ diff --git a/src/pages/Checkout/PostPurchase.vue b/src/pages/Checkout/PostPurchase.vue index 9b298a73a9..99762ee7a6 100644 --- a/src/pages/Checkout/PostPurchase.vue +++ b/src/pages/Checkout/PostPurchase.vue @@ -1,8 +1,8 @@ diff --git a/src/pages/Lend/AlgoliaPaginationHitsPerPage.vue b/src/pages/Lend/AlgoliaPaginationHitsPerPage.vue deleted file mode 100644 index 8509039cf8..0000000000 --- a/src/pages/Lend/AlgoliaPaginationHitsPerPage.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - - - diff --git a/src/pages/Lend/AlgoliaPaginationStats.vue b/src/pages/Lend/AlgoliaPaginationStats.vue deleted file mode 100644 index 587834c868..0000000000 --- a/src/pages/Lend/AlgoliaPaginationStats.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - - - diff --git a/src/pages/Lend/AlgoliaPaginationWrapper.vue b/src/pages/Lend/AlgoliaPaginationWrapper.vue deleted file mode 100644 index 123f1dc271..0000000000 --- a/src/pages/Lend/AlgoliaPaginationWrapper.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - diff --git a/src/pages/Lend/AlgoliaSearchBox.vue b/src/pages/Lend/AlgoliaSearchBox.vue deleted file mode 100644 index b444c7179a..0000000000 --- a/src/pages/Lend/AlgoliaSearchBox.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - - - diff --git a/src/pages/Lend/Filter/FilterComponents/AlgoliaState.vue b/src/pages/Lend/Filter/FilterComponents/AlgoliaState.vue deleted file mode 100644 index 023c825dc9..0000000000 --- a/src/pages/Lend/Filter/FilterComponents/AlgoliaState.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterComponents/AlgoliaTrackState.vue b/src/pages/Lend/Filter/FilterComponents/AlgoliaTrackState.vue deleted file mode 100644 index 6b37a2fd4d..0000000000 --- a/src/pages/Lend/Filter/FilterComponents/AlgoliaTrackState.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterComponents/ClearAllRefinements.vue b/src/pages/Lend/Filter/FilterComponents/ClearAllRefinements.vue deleted file mode 100644 index dc4e499328..0000000000 --- a/src/pages/Lend/Filter/FilterComponents/ClearAllRefinements.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterComponents/FilterMenuSection.vue b/src/pages/Lend/Filter/FilterComponents/FilterMenuSection.vue deleted file mode 100644 index ea6e190ac2..0000000000 --- a/src/pages/Lend/Filter/FilterComponents/FilterMenuSection.vue +++ /dev/null @@ -1,126 +0,0 @@ - - - - - diff --git a/src/pages/Lend/Filter/FilterComponents/FilterRangeSlider.vue b/src/pages/Lend/Filter/FilterComponents/FilterRangeSlider.vue deleted file mode 100644 index 9f3c9664c5..0000000000 --- a/src/pages/Lend/Filter/FilterComponents/FilterRangeSlider.vue +++ /dev/null @@ -1,160 +0,0 @@ - - - - - diff --git a/src/pages/Lend/Filter/FilterComponents/HierarchicalMenuList.vue b/src/pages/Lend/Filter/FilterComponents/HierarchicalMenuList.vue deleted file mode 100644 index 6badb0bd3e..0000000000 --- a/src/pages/Lend/Filter/FilterComponents/HierarchicalMenuList.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - diff --git a/src/pages/Lend/Filter/FilterComponents/LendFilterMenu.vue b/src/pages/Lend/Filter/FilterComponents/LendFilterMenu.vue deleted file mode 100644 index daa6fb481c..0000000000 --- a/src/pages/Lend/Filter/FilterComponents/LendFilterMenu.vue +++ /dev/null @@ -1,412 +0,0 @@ - - - - - diff --git a/src/pages/Lend/Filter/FilterComponents/SelectedRefinements.vue b/src/pages/Lend/Filter/FilterComponents/SelectedRefinements.vue deleted file mode 100644 index 8a5c192cd6..0000000000 --- a/src/pages/Lend/Filter/FilterComponents/SelectedRefinements.vue +++ /dev/null @@ -1,279 +0,0 @@ - - - - - diff --git a/src/pages/Lend/Filter/FilterSections/FilterSectionAttributes.vue b/src/pages/Lend/Filter/FilterSections/FilterSectionAttributes.vue deleted file mode 100644 index bf2ffb3689..0000000000 --- a/src/pages/Lend/Filter/FilterSections/FilterSectionAttributes.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterSections/FilterSectionCategories.vue b/src/pages/Lend/Filter/FilterSections/FilterSectionCategories.vue deleted file mode 100644 index 2916634277..0000000000 --- a/src/pages/Lend/Filter/FilterSections/FilterSectionCategories.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterSections/FilterSectionLocation.vue b/src/pages/Lend/Filter/FilterSections/FilterSectionLocation.vue deleted file mode 100644 index ecf61de386..0000000000 --- a/src/pages/Lend/Filter/FilterSections/FilterSectionLocation.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterSections/FilterSectionSectors.vue b/src/pages/Lend/Filter/FilterSections/FilterSectionSectors.vue deleted file mode 100644 index 6724a867ad..0000000000 --- a/src/pages/Lend/Filter/FilterSections/FilterSectionSectors.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterSections/FilterSectionSort.vue b/src/pages/Lend/Filter/FilterSections/FilterSectionSort.vue deleted file mode 100644 index c7babe16cf..0000000000 --- a/src/pages/Lend/Filter/FilterSections/FilterSectionSort.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterSections/FilterSectionTags.vue b/src/pages/Lend/Filter/FilterSections/FilterSectionTags.vue deleted file mode 100644 index 7453e7e534..0000000000 --- a/src/pages/Lend/Filter/FilterSections/FilterSectionTags.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterSections/Gender/FilterSectionGender.vue b/src/pages/Lend/Filter/FilterSections/Gender/FilterSectionGender.vue deleted file mode 100644 index 27bf87e856..0000000000 --- a/src/pages/Lend/Filter/FilterSections/Gender/FilterSectionGender.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterSections/Gender/PillToggleWrapper.vue b/src/pages/Lend/Filter/FilterSections/Gender/PillToggleWrapper.vue deleted file mode 100644 index b64bea1008..0000000000 --- a/src/pages/Lend/Filter/FilterSections/Gender/PillToggleWrapper.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterSections/LoanDetails/FilterSectionLoanDetails.vue b/src/pages/Lend/Filter/FilterSections/LoanDetails/FilterSectionLoanDetails.vue deleted file mode 100644 index 103a05f32d..0000000000 --- a/src/pages/Lend/Filter/FilterSections/LoanDetails/FilterSectionLoanDetails.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterSections/LoanDetails/RangeSliderWrapper.vue b/src/pages/Lend/Filter/FilterSections/LoanDetails/RangeSliderWrapper.vue deleted file mode 100644 index 96990c54ea..0000000000 --- a/src/pages/Lend/Filter/FilterSections/LoanDetails/RangeSliderWrapper.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterSections/LocationMulti/FilterSectionLocationMulti.vue b/src/pages/Lend/Filter/FilterSections/LocationMulti/FilterSectionLocationMulti.vue deleted file mode 100644 index cd6abf6854..0000000000 --- a/src/pages/Lend/Filter/FilterSections/LocationMulti/FilterSectionLocationMulti.vue +++ /dev/null @@ -1,134 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterSections/LocationMulti/FindNewCountry.vue b/src/pages/Lend/Filter/FilterSections/LocationMulti/FindNewCountry.vue deleted file mode 100644 index 37c438dab0..0000000000 --- a/src/pages/Lend/Filter/FilterSections/LocationMulti/FindNewCountry.vue +++ /dev/null @@ -1,151 +0,0 @@ - - - diff --git a/src/pages/Lend/Filter/FilterSections/LocationMulti/LocationMultiRefinements.vue b/src/pages/Lend/Filter/FilterSections/LocationMulti/LocationMultiRefinements.vue deleted file mode 100644 index 18f59b9d63..0000000000 --- a/src/pages/Lend/Filter/FilterSections/LocationMulti/LocationMultiRefinements.vue +++ /dev/null @@ -1,234 +0,0 @@ - - - - - diff --git a/src/pages/Lend/Filter/LendFilterPage.vue b/src/pages/Lend/Filter/LendFilterPage.vue deleted file mode 100644 index 1ff65ab139..0000000000 --- a/src/pages/Lend/Filter/LendFilterPage.vue +++ /dev/null @@ -1,446 +0,0 @@ - - - - - diff --git a/src/pages/Lend/LendHeader.vue b/src/pages/Lend/LendHeader.vue deleted file mode 100644 index a37c0dde8c..0000000000 --- a/src/pages/Lend/LendHeader.vue +++ /dev/null @@ -1,117 +0,0 @@ - - - - - diff --git a/src/pages/Lend/LendPage.vue b/src/pages/Lend/LendPage.vue index 0da1103038..6ad93dff89 100644 --- a/src/pages/Lend/LendPage.vue +++ b/src/pages/Lend/LendPage.vue @@ -43,11 +43,11 @@ import _map from 'lodash/map'; import _mapValues from 'lodash/mapValues'; import _merge from 'lodash/merge'; import numeral from 'numeral'; -import loanCardQuery from '@/graphql/query/loanCardData.graphql'; -import WwwPage from '@/components/WwwFrame/WwwPage'; -import LoanCardController from '@/components/LoanCards/LoanCardController'; -import KvPagination from '@/components/Kv/KvPagination'; -import KvLoadingOverlay from '@/components/Kv/KvLoadingOverlay'; +import loanCardQuery from '#src/graphql/query/loanCardData.graphql'; +import WwwPage from '#src/components/WwwFrame/WwwPage'; +import LoanCardController from '#src/components/LoanCards/LoanCardController'; +import KvPagination from '#src/components/Kv/KvPagination'; +import KvLoadingOverlay from '#src/components/Kv/KvLoadingOverlay'; const loansPerPage = 12; @@ -86,7 +86,7 @@ export default { KvLoadingOverlay, }, inject: ['apollo', 'cookieStore'], - metaInfo: { + head: { title: 'Fundraising loans' }, data() { @@ -112,7 +112,8 @@ export default { query: loanCardQuery, preFetch: true, preFetchVariables({ route }) { - return _merge({ limit: loansPerPage }, fromUrlParams(route.query)); + const currentRoute = route?.value ?? route; + return _merge({ limit: loansPerPage }, fromUrlParams(currentRoute?.query)); }, variables() { return { diff --git a/src/pages/Lend/LoanChannelCategoryControl.vue b/src/pages/Lend/LoanChannelCategoryControl.vue index 115b4bf9e6..e7b96c1b7a 100644 --- a/src/pages/Lend/LoanChannelCategoryControl.vue +++ b/src/pages/Lend/LoanChannelCategoryControl.vue @@ -12,7 +12,7 @@ class="tw-text-action tw-flex tw-items-center tw-float-right" @click.native="trackAdvancedFilters" > - + Advanced filters

@@ -60,7 +60,7 @@ class="tw-relative tw-mx-auto tw-px-2.5 md:tw-px-4 lg:tw-px-8" style="max-width: 1200px;" > - + 1 ? String(page) : undefined }; + return { ...(page > 1 && { page: String(page) }) }; }, lastLoanPage() { return Math.ceil(this.totalCount / this.limit); @@ -465,7 +467,7 @@ export default { } }; const { route } = args; - const { query, params, path } = route; + const { query, params, path } = (route?.value ?? route ?? {}); // Filter routes on route.param.category to get current path const targetedLoanChannelURL = params.category; @@ -858,7 +860,7 @@ export default { diff --git a/src/pages/Lend/LoanSearchPage.vue b/src/pages/Lend/LoanSearchPage.vue index f34a7db3c3..ee8f27fd6c 100644 --- a/src/pages/Lend/LoanSearchPage.vue +++ b/src/pages/Lend/LoanSearchPage.vue @@ -77,29 +77,29 @@ diff --git a/src/pages/LendingTeams/TeamListing.vue b/src/pages/LendingTeams/TeamListing.vue index e0860fb2e3..e55e0cb57e 100644 --- a/src/pages/LendingTeams/TeamListing.vue +++ b/src/pages/LendingTeams/TeamListing.vue @@ -250,14 +250,14 @@ import { format } from 'date-fns'; import numeral from 'numeral'; import _mapValues from 'lodash/mapValues'; -import teamNoImage from '@/assets/images/team_s135.png'; -import { gql } from '@apollo/client'; -import KvPagination from '~/@kiva/kv-components/vue/KvPagination'; -import KvSelect from '~/@kiva/kv-components/vue/KvSelect'; +import teamNoImage from '#src/assets/images/team_s135.png'; +import { gql } from 'graphql-tag'; +import KvPagination from '@kiva/kv-components/vue/KvPagination'; +import KvSelect from '@kiva/kv-components/vue/KvSelect'; +import KvButton from '@kiva/kv-components/vue/KvButton'; +import KvLoadingPlaceholder from '@kiva/kv-components/vue/KvLoadingPlaceholder'; import { fetchTeams, teamCategories, teamCategoryFriendlyName } from '../../util/teamsUtil'; import TeamSearchBar from './TeamSearchBar'; -import KvButton from '~/@kiva/kv-components/vue/KvButton'; -import KvLoadingPlaceholder from '~/@kiva/kv-components/vue/KvLoadingPlaceholder'; const teamsPerPage = 10; @@ -435,8 +435,15 @@ export default { teamSort, teamCategory, teamOption, queryString, offset }) { this.loading = true; - await fetchTeams(this.apollo, teamSort, teamCategory, teamOption, - queryString, offset, this.limit).then(teams => { + await fetchTeams( + this.apollo, + teamSort, + teamCategory, + teamOption, + queryString, + offset, + this.limit + ).then(teams => { this.teams = teams.values; this.totalCount = teams.totalCount; if (this.teams.length === 0 && this.totalCount > 0) { diff --git a/src/pages/LendingTeams/TeamSearchBar.vue b/src/pages/LendingTeams/TeamSearchBar.vue index c6424d2943..43930da088 100644 --- a/src/pages/LendingTeams/TeamSearchBar.vue +++ b/src/pages/LendingTeams/TeamSearchBar.vue @@ -23,8 +23,8 @@ diff --git a/src/pages/MonthlyGood/EmailPreview.vue b/src/pages/MonthlyGood/EmailPreview.vue index 9efa64377c..6da0c8d886 100644 --- a/src/pages/MonthlyGood/EmailPreview.vue +++ b/src/pages/MonthlyGood/EmailPreview.vue @@ -23,9 +23,11 @@ diff --git a/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue b/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue index b2c0d03dd3..7da66b8baf 100644 --- a/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue +++ b/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue @@ -7,7 +7,7 @@ >

- Heads up! You have {{ balance | numeral('$0') }} available to lend. + Heads up! You have {{ $filters.numeral(balance, '$0') }} available to lend.

@@ -48,14 +48,8 @@

- Each month on the - + + Each month on the - {{ dayOfMonth | numeral('Oo') }} + {{ $filters.numeral(dayOfMonth, 'Oo') }} -
    -
  • +
      +
    • Field is required
    • -
    • +
    • Enter day of month - 1 to 31
    @@ -101,7 +98,7 @@
    -
      -
    • +
        +
      • Field is required
      • -
      • +
      • Enter an amount of $5-$10,000
      @@ -145,7 +145,7 @@