diff --git a/src/plugins/components/card/card.component.ts b/src/plugins/components/card/card.component.ts index d6ca61d..8c465f8 100644 --- a/src/plugins/components/card/card.component.ts +++ b/src/plugins/components/card/card.component.ts @@ -8,9 +8,8 @@ import * as variants from './card.variants' * Primary UI component for user interaction */ export const Card = ({ - color = 'white', - elevated, - elevatedHover, + color = 'default', + shadow, rounded = 'sm', classes, children, @@ -22,8 +21,8 @@ export const Card = ({ 'nui-card', color && variants.color[color], rounded && variants.rounded[rounded], - elevated && 'nui-card-shadow', - elevatedHover && 'nui-card-shadow-hover', + shadow === 'flat' && 'nui-card-shadow', + shadow === 'hover' && 'nui-card-shadow-hover', classes?.wrapper, ] .filter(Boolean) diff --git a/src/plugins/components/card/card.config.ts b/src/plugins/components/card/card.config.ts index c1961a0..da66911 100644 --- a/src/plugins/components/card/card.config.ts +++ b/src/plugins/components/card/card.config.ts @@ -14,7 +14,7 @@ export const defaultConfig = { size: 'xl', }, color: { - white: { + default: { background: { light: 'white', dark: 'muted-800', @@ -24,7 +24,7 @@ export const defaultConfig = { dark: 'muted-700', }, }, - whiteContrast: { + defaultContrast: { background: { light: 'white', dark: 'muted-950', diff --git a/src/plugins/components/card/card.stories.ts b/src/plugins/components/card/card.stories.ts index af55a50..94e36c5 100644 --- a/src/plugins/components/card/card.stories.ts +++ b/src/plugins/components/card/card.stories.ts @@ -14,8 +14,8 @@ const meta = { color: { control: { type: 'select' }, options: [ - 'white', - 'white-contrast', + 'default', + 'default-contrast', 'muted', 'muted-contrast', 'dark', @@ -27,7 +27,7 @@ const meta = { 'danger', 'none', ], - defaultValue: 'white', + defaultValue: 'default', }, elevated: { name: 'Elevated', @@ -52,7 +52,7 @@ export const Main: Story = { name: 'Main example', args: { // set default values used for UI preview - color: 'white', + color: 'default', children: html`
@@ -403,7 +403,7 @@ export const Slot2: Story = { name: 'Slot: default', args: { // set default values used for UI preview - color: 'white', + color: 'default', elevatedHover: true, children: html`
@@ -434,7 +434,7 @@ export const Slot3: Story = { name: 'Slot: default', args: { // set default values used for UI preview - color: 'white', + color: 'default', elevatedHover: true, children: html`
diff --git a/src/plugins/components/card/card.types.ts b/src/plugins/components/card/card.types.ts index 517b369..bee06f0 100644 --- a/src/plugins/components/card/card.types.ts +++ b/src/plugins/components/card/card.types.ts @@ -2,11 +2,10 @@ import type { PropertyVariant } from '~/types/utils' export interface CardProps extends Record { rounded?: 'none' | 'sm' | 'md' | 'lg' - elevated?: boolean - elevatedHover?: boolean + shadow?: 'flat' | 'hover' color?: - | 'white' - | 'white-contrast' + | 'default' + | 'default-contrast' | 'muted' | 'muted-contrast' | 'dark' diff --git a/src/plugins/components/card/card.variants.ts b/src/plugins/components/card/card.variants.ts index 4a6bebf..6e3bf67 100644 --- a/src/plugins/components/card/card.variants.ts +++ b/src/plugins/components/card/card.variants.ts @@ -8,8 +8,8 @@ export const rounded = { } as const satisfies CardVariant<'rounded'> export const color = { - white: 'nui-card-white', - 'white-contrast': 'nui-card-white-contrast', + default: 'nui-card-default', + 'default-contrast': 'nui-card-default-contrast', muted: 'nui-card-muted', 'muted-contrast': 'nui-card-muted-contrast', dark: 'nui-card-dark', diff --git a/src/plugins/components/card/index.ts b/src/plugins/components/card/index.ts index 6f9fabf..e61789a 100644 --- a/src/plugins/components/card/index.ts +++ b/src/plugins/components/card/index.ts @@ -17,22 +17,22 @@ export default plugin(({ addComponents, theme }) => { //Base [`@apply relative w-${config.width} transition-${config.transition.property} duration-${config.transition.duration}`]: {}, - //Color:white - '&.nui-card-white': { + //Color:default + '&.nui-card-default': { //Border - [`@apply border border-${config.color.white.border.light} dark:border-${config.color.white.border.dark}`]: + [`@apply border border-${config.color.default.border.light} dark:border-${config.color.default.border.dark}`]: {}, //Background - [`@apply bg-${config.color.white.background.light} dark:bg-${config.color.white.background.dark}`]: + [`@apply bg-${config.color.default.background.light} dark:bg-${config.color.default.background.dark}`]: {}, }, - //Color:whiteContrast - '&.nui-card-white-contrast': { + //Color:defaultContrast + '&.nui-card-default-contrast': { //Border - [`@apply border border-${config.color.whiteContrast.border.light} dark:border-${config.color.whiteContrast.border.dark}`]: + [`@apply border border-${config.color.defaultContrast.border.light} dark:border-${config.color.defaultContrast.border.dark}`]: {}, //Background - [`@apply bg-${config.color.whiteContrast.background.light} dark:bg-${config.color.whiteContrast.background.dark}`]: + [`@apply bg-${config.color.defaultContrast.background.light} dark:bg-${config.color.defaultContrast.background.dark}`]: {}, }, //Color:muted