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: '
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: `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: `@@ -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: `- {{ basketDonationTagline }} -
-
- {{ donationDetailsLink }}
-
- Welcome to Kiva's new filter page! Take it for a spin below, or
-
- Each Kiva loan helps people build a better future for themselves and their families. -
-
@@ -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;"
>
-
+
@@ -48,14 +48,8 @@
- Heads up! You have {{ balance | numeral('$0') }} available to lend.
+ Heads up! You have {{ $filters.numeral(balance, '$0') }} available to lend.
-
+
@@ -101,7 +98,7 @@
-
+
@@ -145,7 +145,7 @@