From 6addadc9d1b6af178246a3e84667eda76f2730ea Mon Sep 17 00:00:00 2001 From: portikM Date: Tue, 31 Oct 2023 14:12:09 -0400 Subject: [PATCH 01/22] chore(sandbox): setup component sandbox [KHCP-8971] --- sandbox/components/SandboxNavComponent.vue | 87 +++++++++++++++++++++ sandbox/pages/SandboxCard.vue | 40 ++++++++++ sandbox/router.ts | 88 ++++++++++++++++++++++ 3 files changed, 215 insertions(+) create mode 100644 sandbox/components/SandboxNavComponent.vue create mode 100644 sandbox/pages/SandboxCard.vue create mode 100644 sandbox/router.ts diff --git a/sandbox/components/SandboxNavComponent.vue b/sandbox/components/SandboxNavComponent.vue new file mode 100644 index 0000000000..99d5d6b83d --- /dev/null +++ b/sandbox/components/SandboxNavComponent.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/sandbox/pages/SandboxCard.vue b/sandbox/pages/SandboxCard.vue new file mode 100644 index 0000000000..302b894d2b --- /dev/null +++ b/sandbox/pages/SandboxCard.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/sandbox/router.ts b/sandbox/router.ts new file mode 100644 index 0000000000..03bb629fa8 --- /dev/null +++ b/sandbox/router.ts @@ -0,0 +1,88 @@ +import { createRouter, createWebHashHistory } from 'vue-router' + +export default createRouter({ + history: createWebHashHistory(), + routes: [ + { + path: '/', + name: 'home', + alias: '/:pathMatch(.*)*', + meta: { title: 'Kongponents Sandbox' }, + component: () => import('./pages/HomePage.vue'), + children: [ + { + path: 'alert', + name: 'alert', + meta: { title: 'Alert Sandbox' }, + component: () => import('./pages/SandboxAlert.vue'), + }, + { + path: 'button', + name: 'button', + meta: { title: 'Button Sandbox' }, + component: () => import('./pages/SandboxButton.vue'), + }, + { + path: 'card', + name: 'card', + meta: { title: 'Card Sandbox' }, + component: () => import('./pages/SandboxCard.vue'), + }, + { + path: 'catalog', + name: 'catalog', + meta: { title: 'Catalog Sandbox' }, + component: () => import('./pages/SandboxCatalog.vue'), + }, + { + path: 'checkbox', + name: 'checkbox', + meta: { title: 'Checkbox Sandbox' }, + component: () => import('./pages/SandboxCheckbox.vue'), + }, + { + path: 'dropdown', + name: 'dropdown', + meta: { title: 'Dropdown Sandbox' }, + component: () => import('./pages/SandboxDropdown.vue'), + }, + { + path: 'input', + name: 'input', + meta: { title: 'Input Sandbox' }, + component: () => import('./pages/SandboxInput.vue'), + }, + { + path: 'label', + name: 'label', + meta: { title: 'Label Sandbox' }, + component: () => import('./pages/SandboxLabel.vue'), + }, + { + path: 'multiselect', + name: 'multiselect', + meta: { title: 'Multiselect Sandbox' }, + component: () => import('./pages/SandboxMultiselect.vue'), + }, + { + path: 'radio', + name: 'radio', + meta: { title: 'Radio Sandbox' }, + component: () => import('./pages/SandboxRadio.vue'), + }, + { + path: 'table', + name: 'table', + meta: { title: 'Table Sandbox' }, + component: () => import('./pages/SandboxTable.vue'), + }, + { + path: 'tabs', + name: 'tabs', + meta: { title: 'Tabs Sandbox' }, + component: () => import('./pages/SandboxTabs.vue'), + }, + ], + }, + ], +}) From 5369c37bbbfb18f263a3c203a57622839e0856e2 Mon Sep 17 00:00:00 2001 From: portikM Date: Tue, 31 Oct 2023 16:07:04 -0400 Subject: [PATCH 02/22] feat(kcard): reskin component [KHCP-8971] --- docs/guide/migrating-to-version-9.md | 35 ++++ sandbox/pages/SandboxCard.vue | 102 ++++++++++- src/components/KCard/KCard.vue | 253 ++++++--------------------- src/styles/_mixins.scss | 2 + src/styles/mixins/_cards.scss | 9 + src/styles/mixins/_typography.scss | 9 + src/types/card.ts | 5 - src/types/index.ts | 1 - 8 files changed, 199 insertions(+), 217 deletions(-) create mode 100644 src/styles/mixins/_cards.scss create mode 100644 src/styles/mixins/_typography.scss delete mode 100644 src/types/card.ts diff --git a/docs/guide/migrating-to-version-9.md b/docs/guide/migrating-to-version-9.md index d3d8293616..ffc6279481 100644 --- a/docs/guide/migrating-to-version-9.md +++ b/docs/guide/migrating-to-version-9.md @@ -69,6 +69,41 @@ Kongponents styles are no longer designed to be utilized standalone, separately ### KCard +#### Structure + +* `kong-card` class has been changed to `k-card` +* `hover` class has been removed +* `kcard-shadow` class has been removed +* `k-card-header` class has been changed to `card-header` +* `has-status` class has been removed +* `k-card-status-hat` class has been removed +* `k-card-title` class has been changed to `card-title` +* `k-card-actions` class has been changed to `card-actions` +* `k-card-content` class has been changed to `card-content` +* `k-card-body` class has been removed +* `k-card-notifications` class has been removed + +#### Constants, Types & Interfaces + +* `BorderVariantsArray` constant has been removed +* `BorderVariant` type has been removed + +#### Props + +* `testMode` prop has been removed +* `body` prop has been removed. Use `content` prop instead +* `borderVariant` prop has been removed. KCard has border by default +* `hasHover` prop has been removed +* `hasShadow` prop has been removed. KCard does not have shadow by default +* `status` prop has been removed + +#### Slots + +* `statusHat` slot has been removed +* `body` slot has been removed. Use `default` slot instead +* `notifications` slot has been removed + +#### Events ### KCatalog diff --git a/sandbox/pages/SandboxCard.vue b/sandbox/pages/SandboxCard.vue index 302b894d2b..c9b9a5c70d 100644 --- a/sandbox/pages/SandboxCard.vue +++ b/sandbox/pages/SandboxCard.vue @@ -15,10 +15,86 @@ is-subtitle title="Props" /> - - - Card csontent - + + + + + + + +
+ + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + + +
+
+ + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + + +
@@ -26,15 +102,27 @@ diff --git a/src/components/KCard/KCard.vue b/src/components/KCard/KCard.vue index 7312225f5e..fd62be5efd 100644 --- a/src/components/KCard/KCard.vue +++ b/src/components/KCard/KCard.vue @@ -1,247 +1,92 @@ - - - diff --git a/src/styles/_mixins.scss b/src/styles/_mixins.scss index 5976a9e59e..d865ef4732 100644 --- a/src/styles/_mixins.scss +++ b/src/styles/_mixins.scss @@ -1,6 +1,8 @@ @import "@/styles/mixins/inputs"; @import "@/styles/mixins/labels"; @import "@/styles/mixins/input-select"; +@import "@/styles/mixins/cards"; +@import "@/styles/mixins/typography"; @import "@/styles/tmp-variables"; diff --git a/src/styles/mixins/_cards.scss b/src/styles/mixins/_cards.scss new file mode 100644 index 0000000000..04afb4bc4c --- /dev/null +++ b/src/styles/mixins/_cards.scss @@ -0,0 +1,9 @@ +/* Cards mixins */ + +@mixin cardDefaults { + background-color: var(--kui-color-background, $kui-color-background); + border: var(--kui-border-width-10, $kui-border-width-10) solid var(--kui-color-border, $kui-color-border); + border-radius: var(--kui-border-radius-30, $kui-border-radius-30); + font-family: var(--kui-font-family-text, $kui-font-family-text); + padding: var(--kui-space-70, $kui-space-70); +} diff --git a/src/styles/mixins/_typography.scss b/src/styles/mixins/_typography.scss new file mode 100644 index 0000000000..deb42a3596 --- /dev/null +++ b/src/styles/mixins/_typography.scss @@ -0,0 +1,9 @@ +/* Common typography-related mixins */ + +@mixin bodyText { + color: var(--kui-color-text, $kui-color-text); + font-family: var(--kui-font-family-text, $kui-font-family-text); + font-size: var(--kui-font-size-30, $kui-font-size-30); + font-weight: var(--kui-font-weight-regular, $kui-font-weight-regular); + line-height: var(--kui-line-height-30, $kui-line-height-30); +} diff --git a/src/types/card.ts b/src/types/card.ts deleted file mode 100644 index 80718bbde7..0000000000 --- a/src/types/card.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AnyElementOf } from '@/types/utils' - -export const BorderVariantsArray = ['borderTop', 'noBorder', 'border'] as const - -export type BorderVariant = AnyElementOf diff --git a/src/types/index.ts b/src/types/index.ts index bd735db74b..edba0e1223 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -3,7 +3,6 @@ export * from './alert' export * from './badge' export * from './breadcrumbs' export * from './button' -export * from './card' export * from './catalog' export * from './code-block' export * from './collapse' From f11bfff761ac1c9036d2ebbad5f5fed72815357c Mon Sep 17 00:00:00 2001 From: portikM Date: Tue, 31 Oct 2023 16:20:20 -0400 Subject: [PATCH 03/22] test(kcard): update component tests [KHCP-8971] --- src/components/KCard/KCard.cy.ts | 97 ++++++++++---------------------- 1 file changed, 29 insertions(+), 68 deletions(-) diff --git a/src/components/KCard/KCard.cy.ts b/src/components/KCard/KCard.cy.ts index e46d8c6831..dd4f74ea4e 100644 --- a/src/components/KCard/KCard.cy.ts +++ b/src/components/KCard/KCard.cy.ts @@ -1,92 +1,53 @@ import { mount } from 'cypress/vue' import KCard from '@/components/KCard/KCard.vue' -import { h } from 'vue' -/** - * ALL TESTS MUST USE testMode: true - * We generate unique IDs for reference by aria properties. Test mode strips these out - * allowing for successful snapshot verification. - * props: { - * testMode: true - * } - */ describe('KCard', () => { - it('renders slots when passed', () => { - const cardStatusHat = 'Card Status Hat' - const cardTitle = 'Card Title' - const cardActions = 'Card Actions' - const cardBody = 'Card Body' - const cardNotifications = 'Card Notifications' + it('does not render any content when no props or slots are passed', () => { + mount(KCard) - mount(KCard, { - props: { - testMode: true, - }, - slots: { - statusHat: () => h('span', {}, cardStatusHat), - title: () => h('span', {}, cardTitle), - actions: () => h('span', {}, cardActions), - body: () => h('span', {}, cardBody), - notifications: () => h('span', {}, cardNotifications), - }, - }) - - cy.get('.k-card-status-hat').should('contain.text', cardStatusHat) - cy.get('.k-card-title').should('contain.text', cardTitle) - cy.get('.k-card-actions').should('contain.text', cardActions) - cy.get('.k-card-body').should('contain.text', cardBody) - cy.get('.k-card-notifications').should('contain.text', cardNotifications) + cy.get('.k-card').should('be.visible') + cy.get('.k-card').find('card-header').should('not.exist') + cy.get('.k-card').find('card-content').should('not.exist') + cy.get('.k-card').find('card-footer').should('not.exist') }) - it('renders proper content when using props', () => { - const cardStatus = 'Card Status' - const cardTitle = 'Card Title' - const cardBody = 'Card Body' + it('renders title and content slots when passed', () => { + const titleProp = 'Title prop' + const contentProp = 'Content prop' mount(KCard, { props: { - testMode: true, - status: cardStatus, - title: cardTitle, - body: cardBody, + title: titleProp, + content: contentProp, }, }) - cy.get('.k-card-status-hat').should('have.text', cardStatus) - cy.get('.k-card-title').should('have.text', cardTitle) - cy.get('.k-card-body').should('have.text', cardBody) + cy.get('.k-card').find('.card-title').should('contain', titleProp) + cy.get('.k-card').find('.card-content').should('contain', contentProp) }) - it('has border class when passed', () => { - mount(KCard, { - props: { - testMode: true, - hasBorder: true, - }, - }) - - cy.get('.kong-card').should('have.class', 'border') - }) + it('renders slots when passed', () => { + const titleProp = 'Test title' + const contentProp = 'Test content' + const titleText = 'I am the title' + const contentText = 'I am the content' - it('has hover class when passed', () => { mount(KCard, { props: { - testMode: true, - hasHover: true, + title: titleProp, + content: contentProp, }, - }) - - cy.get('.kong-card').should('have.class', 'hover') - }) - - it('has shadow class when passed', () => { - mount(KCard, { - props: { - testMode: true, - hasShadow: true, + slots: { + title: `${titleText}`, + actions: 'Card actions', + default: `${contentText}`, + footer: 'Card footer', }, }) - cy.get('.kong-card').should('have.class', 'kcard-shadow') + cy.get('.k-card').find('.card-title').get('[data-testid="card-title"]').should('contain', titleText) + cy.get('.k-card').get('[data-testid="card-actions"]').should('be.visible') + cy.get('.k-card').find('.card-content').get('[data-testid="card-content"]').should('contain', contentText) + cy.get('.k-card').get('[data-testid="card-footer"]').should('be.visible') }) }) From 92c59269b58f5a7f5f73bbf73b25d78ae8e9dcf6 Mon Sep 17 00:00:00 2001 From: portikM Date: Tue, 31 Oct 2023 17:09:00 -0400 Subject: [PATCH 04/22] fix(kcard): deprecate body slot instead of removing [KHCP-8971] --- docs/components/collapse.md | 8 ++++---- docs/guide/migrating-to-version-9.md | 2 +- sandbox/pages/SandboxCard.vue | 19 +++++++++++++++++++ src/components/KCard/KCard.vue | 20 ++++++++++++++++++-- src/components/KCatalog/KCatalogItem.vue | 14 +++++--------- src/components/KSlideout/KSlideout.vue | 6 ++---- 6 files changed, 49 insertions(+), 20 deletions(-) diff --git a/docs/components/collapse.md b/docs/components/collapse.md index d26d7fa182..1b8aaa52a8 100644 --- a/docs/components/collapse.md +++ b/docs/components/collapse.md @@ -166,9 +166,9 @@ To set the default state (collapsed or expanded) without binding to v-model you - + @@ -182,10 +182,10 @@ To set the default state (collapsed or expanded) without binding to v-model you - + ``` diff --git a/docs/guide/migrating-to-version-9.md b/docs/guide/migrating-to-version-9.md index ffc6279481..749775be21 100644 --- a/docs/guide/migrating-to-version-9.md +++ b/docs/guide/migrating-to-version-9.md @@ -100,7 +100,7 @@ Kongponents styles are no longer designed to be utilized standalone, separately #### Slots * `statusHat` slot has been removed -* `body` slot has been removed. Use `default` slot instead +* `body` slot has been deprecated in favor of `default` slot * `notifications` slot has been removed #### Events diff --git a/sandbox/pages/SandboxCard.vue b/sandbox/pages/SandboxCard.vue index c9b9a5c70d..d00bda22ed 100644 --- a/sandbox/pages/SandboxCard.vue +++ b/sandbox/pages/SandboxCard.vue @@ -96,6 +96,25 @@
+ + + + + + When both `default` and `body` slots are present, `default` slot will be used. + + + + + + diff --git a/src/components/KCard/KCard.vue b/src/components/KCard/KCard.vue index fd62be5efd..11d6516f51 100644 --- a/src/components/KCard/KCard.vue +++ b/src/components/KCard/KCard.vue @@ -22,10 +22,12 @@
-

{{ content }}

+ +

{{ content }}

+
-``` +Content of the card. If present, takes precedence over the `content` prop. For example refer to [`footer` slot](#footer). -## Slots +### footer -- `statusHat` - Small text directly above the title -- `title` -- `body` -- `actions` - Right side of the header section. Used for links, buttons, etc -- `notifications` - Right side of the body section. Used for badges, icons, etc +Bottom drawer of the card. Helpful for providing information of lesser importance. -  - @@ -182,10 +186,14 @@ To set the default state (collapsed or expanded) without binding to v-model you
- + + I am only visible when expanded + ``` diff --git a/docs/guide/migrating-to-version-9.md b/docs/guide/migrating-to-version-9.md index 3ce0a44514..698166055e 100644 --- a/docs/guide/migrating-to-version-9.md +++ b/docs/guide/migrating-to-version-9.md @@ -91,7 +91,7 @@ Kongponents styles are no longer designed to be utilized standalone, separately #### Props * `testMode` prop has been removed -* `body` prop has been deprecated in favor of `content` prop +* `body` prop has been deprecated. Use `default` slot instead * `borderVariant` prop has been removed. KCard has border by default * `hasHover` prop has been removed * `hasShadow` prop has been removed. KCard does not have shadow by default diff --git a/sandbox/pages/SandboxCard.vue b/sandbox/pages/SandboxCard.vue index 9bb15a4de2..94cf9faf0c 100644 --- a/sandbox/pages/SandboxCard.vue +++ b/sandbox/pages/SandboxCard.vue @@ -15,11 +15,10 @@ is-subtitle title="Props" /> - - + + + Card content slot + diff --git a/src/components/KCard/KCard.vue b/src/components/KCard/KCard.vue index 7720d2652b..8d7deae515 100644 --- a/src/components/KCard/KCard.vue +++ b/src/components/KCard/KCard.vue @@ -1,18 +1,16 @@ @@ -94,25 +97,16 @@ const contentSlotName = computed((): 'body' | 'default' => { // TODO: remove thi justify-content: space-between; .card-title { - h4 { - color: var(--kui-color-text, $kui-color-text); - font-size: var(--kui-font-size-50, $kui-font-size-50); - font-weight: var(--kui-font-weight-bold, $kui-font-weight-bold); - letter-spacing: var(--kui-letter-spacing-minus-30, $kui-letter-spacing-minus-30); - line-height: var(--kui-line-height-40, $kui-line-height-40); - margin: 0; // reset default browser margin - } + color: var(--kui-color-text, $kui-color-text); + font-size: var(--kui-font-size-50, $kui-font-size-50); + font-weight: var(--kui-font-weight-bold, $kui-font-weight-bold); + letter-spacing: var(--kui-letter-spacing-minus-30, $kui-letter-spacing-minus-30); + line-height: var(--kui-line-height-40, $kui-line-height-40); } } .card-content { @include bodyText; - - p { - @include bodyText; - - margin: 0; // reset default browser margin - } } .card-footer { From e5b901b6cba6fa42d6e1d96898a8f881d99ed68b Mon Sep 17 00:00:00 2001 From: Maksym Portianoi Date: Wed, 1 Nov 2023 10:37:03 -0400 Subject: [PATCH 09/22] fix(kcard): address PR feedback [KHCP-8971] Co-authored-by: Adam DeHaven <2229946+adamdehaven@users.noreply.github.com> --- docs/components/card.md | 2 +- docs/guide/migrating-to-version-9.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/components/card.md b/docs/components/card.md index d61ace9db0..4171ebf8f2 100644 --- a/docs/components/card.md +++ b/docs/components/card.md @@ -1,6 +1,6 @@ # Card -KCard is a styled container that organizes together related content and actions. +KCard is a styled container that organizes related content and actions. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip excommodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nupariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit aid est laborum. @@ -56,12 +54,10 @@ KCard is a styled container that organizes related content and actions. Lorem ipsum dolor sit amet ... ``` @@ -144,12 +140,10 @@ Bottom drawer of the card. Helpful for providing information of lesser importanc Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip excommodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nupariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit aid est laborum. @@ -176,23 +170,14 @@ Bottom drawer of the card. Helpful for providing information of lesser importanc Lorem ipsum dolor sit amet ... ``` - - \ No newline at end of file + \ No newline at end of file diff --git a/docs/guide/migrating-to-version-9.md b/docs/guide/migrating-to-version-9.md index 9b7e03382e..caa927baff 100644 --- a/docs/guide/migrating-to-version-9.md +++ b/docs/guide/migrating-to-version-9.md @@ -69,6 +69,21 @@ Kongponents styles are no longer designed to be utilized standalone, separately ### KCard +#### Props + +* `testMode` prop has been removed +* `body` prop has been deprecated. Use `default` slot instead +* `borderVariant` prop has been removed. KCard has a border by default +* `hasHover` prop has been removed +* `hasShadow` prop has been removed. KCard does not have a box-shadow by default +* `status` prop has been removed + +#### Slots + +* `statusHat` slot has been removed +* `body` slot has been deprecated in favor of `default` slot +* `notifications` slot has been removed + #### Structure * `kong-card` class has been changed to `k-card` @@ -88,23 +103,6 @@ Kongponents styles are no longer designed to be utilized standalone, separately * `BorderVariantsArray` constant has been removed * `BorderVariant` type has been removed -#### Props - -* `testMode` prop has been removed -* `body` prop has been deprecated. Use `default` slot instead -* `borderVariant` prop has been removed. KCard has a border by default -* `hasHover` prop has been removed -* `hasShadow` prop has been removed. KCard does not have a box-shadow by default -* `status` prop has been removed - -#### Slots - -* `statusHat` slot has been removed -* `body` slot has been deprecated in favor of `default` slot -* `notifications` slot has been removed - -#### Events - ### KCatalog diff --git a/sandbox/pages/SandboxCard.vue b/sandbox/pages/SandboxCard.vue index 94cf9faf0c..db89993b30 100644 --- a/sandbox/pages/SandboxCard.vue +++ b/sandbox/pages/SandboxCard.vue @@ -51,12 +51,10 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. @@ -84,13 +82,11 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. diff --git a/src/components/KCard/KCard.cy.ts b/src/components/KCard/KCard.cy.ts index e35206d6c9..63f05f9aef 100644 --- a/src/components/KCard/KCard.cy.ts +++ b/src/components/KCard/KCard.cy.ts @@ -2,7 +2,7 @@ import { mount } from 'cypress/vue' import KCard from '@/components/KCard/KCard.vue' describe('KCard', () => { - it('does not render any content when no props or slots are passed', () => { + it('renders empty card element when no props or slots are passed', () => { mount(KCard) cy.get('.k-card').should('be.visible') diff --git a/src/components/KCard/KCard.vue b/src/components/KCard/KCard.vue index 8d7deae515..d6d0ee1f60 100644 --- a/src/components/KCard/KCard.vue +++ b/src/components/KCard/KCard.vue @@ -23,7 +23,10 @@ v-if="showCardBody" class="card-content" > - + { letter-spacing: var(--kui-letter-spacing-minus-30, $kui-letter-spacing-minus-30); line-height: var(--kui-line-height-40, $kui-line-height-40); } + + .card-actions { + display: flex; + gap: var(--kui-space-30, $kui-space-30); + } } .card-content { @@ -111,6 +119,9 @@ onMounted(() => { .card-footer { @include bodyText; + + display: flex; + gap: var(--kui-space-30, $kui-space-30); } } From 60ef18bdb7fcd33c678ed459895ab7f4f042874a Mon Sep 17 00:00:00 2001 From: portikM Date: Mon, 6 Nov 2023 11:48:15 -0500 Subject: [PATCH 12/22] chore(sandbox): rebase [KHCP-8971] --- sandbox/index.ts | 1 + sandbox/pages/SandboxCard.vue | 221 ++++++++++++++++--------------- sandbox/router/sandbox-routes.ts | 6 + 3 files changed, 120 insertions(+), 108 deletions(-) diff --git a/sandbox/index.ts b/sandbox/index.ts index 12e1cbf022..990ca86b20 100644 --- a/sandbox/index.ts +++ b/sandbox/index.ts @@ -18,6 +18,7 @@ app.component('SandboxLayout', SandboxLayout) const sandboxAppLinks: SandboxNavigationItem[] = ([ { name: 'KAlert', to: { name: 'alert' } }, { name: 'KButton', to: { name: 'button' } }, + { name: 'KCard', to: { name: 'card' } }, { name: 'KCatalog', to: { name: 'catalog' } }, { name: 'KCheckbox', to: { name: 'checkbox' } }, { name: 'KDropdown', to: { name: 'dropdown' } }, diff --git a/sandbox/pages/SandboxCard.vue b/sandbox/pages/SandboxCard.vue index db89993b30..2245c1f19a 100644 --- a/sandbox/pages/SandboxCard.vue +++ b/sandbox/pages/SandboxCard.vue @@ -1,125 +1,130 @@