Skip to content

Commit

Permalink
Rename plain to simple for #6653
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Oct 28, 2024
1 parent 1578dc4 commit b263c1e
Show file tree
Hide file tree
Showing 11 changed files with 181 additions and 157 deletions.
32 changes: 16 additions & 16 deletions apps/showcase/doc/inputtext/FormsDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
</DocSectionText>
<div class="card flex justify-center">
<Form v-slot="$form" :resolver="resolver" :initialValues="initialValues" @submit="onFormSubmit" class="flex flex-col gap-4 w-full sm:w-56">
<div class="flex flex-col gap-2">
<div class="flex flex-col gap-1">
<InputText name="username" type="text" placeholder="Username" fluid />
<Message v-if="$form.username?.invalid" severity="error">{{ $form.username.error?.message }}</Message>
<Message v-if="$form.username?.invalid" severity="error" size="small" variant="simple">{{ $form.username.error?.message }}</Message>
</div>
<div class="flex flex-col gap-2">
<div class="flex flex-col gap-1">
<InputText name="email" type="text" placeholder="Email" fluid />
<Message v-if="$form.email?.invalid" severity="error">{{ $form.email.error?.message }}</Message>
<Message v-if="$form.email?.invalid" severity="error" size="small" variant="simple">{{ $form.email.error?.message }}</Message>
</div>
<Button type="submit" severity="secondary" label="Submit" />
</Form>
Expand Down Expand Up @@ -38,13 +38,13 @@ export default {
code: {
basic: `
<Form v-slot="$form" :resolver="resolver" :initialValues="initialValues" @submit="onFormSubmit" class="flex justify-center flex-col gap-4">
<div class="flex flex-col gap-2">
<div class="flex flex-col gap-1">
<InputText name="username" type="text" placeholder="Username" />
<Message v-if="$form.username?.invalid" severity="error">{{ $form.username.error?.message }}</Message>
<Message v-if="$form.username?.invalid" severity="error" size="small" variant="simple">{{ $form.username.error?.message }}</Message>
</div>
<div class="flex flex-col gap-2">
<div class="flex flex-col gap-1">
<InputText name="email" type="text" placeholder="Email" />
<Message v-if="$form.email?.invalid" severity="error">{{ $form.email.error?.message }}</Message>
<Message v-if="$form.email?.invalid" severity="error" size="small" variant="simple">{{ $form.email.error?.message }}</Message>
</div>
<Button type="submit" severity="secondary" label="Submit" />
</Form>
Expand All @@ -53,13 +53,13 @@ export default {
<template>
<div class="card flex justify-center">
<Form v-slot="$form" :resolver="resolver" :initialValues="initialValues" @submit="onFormSubmit" class="flex flex-col gap-4 w-full sm:w-56">
<div class="flex flex-col gap-2">
<div class="flex flex-col gap-1">
<InputText name="username" type="text" placeholder="Username" fluid />
<Message v-if="$form.username?.invalid" severity="error">{{ $form.username.error?.message }}</Message>
<Message v-if="$form.username?.invalid" severity="error" size="small" variant="simple">{{ $form.username.error?.message }}</Message>
</div>
<div class="flex flex-col gap-2">
<div class="flex flex-col gap-1">
<InputText name="email" type="text" placeholder="Email" fluid />
<Message v-if="$form.email?.invalid" severity="error">{{ $form.email.error?.message }}</Message>
<Message v-if="$form.email?.invalid" severity="error" size="small" variant="simple">{{ $form.email.error?.message }}</Message>
</div>
<Button type="submit" severity="secondary" label="Submit" />
</Form>
Expand Down Expand Up @@ -100,13 +100,13 @@ export default {
<template>
<div class="card flex justify-center">
<Form v-slot="$form" :resolver="resolver" :initialValues="initialValues" @submit="onFormSubmit" class="flex flex-col gap-4 w-full sm:w-56">
<div class="flex flex-col gap-2">
<div class="flex flex-col gap-1">
<InputText name="username" type="text" placeholder="Username" fluid />
<Message v-if="$form.username?.invalid" severity="error">{{ $form.username.error?.message }}</Message>
<Message v-if="$form.username?.invalid" severity="error" size="small" variant="simple">{{ $form.username.error?.message }}</Message>
</div>
<div class="flex flex-col gap-2">
<div class="flex flex-col gap-1">
<InputText name="email" type="text" placeholder="Email" fluid />
<Message v-if="$form.email?.invalid" severity="error">{{ $form.email.error?.message }}</Message>
<Message v-if="$form.email?.invalid" severity="error" size="small" variant="simple">{{ $form.email.error?.message }}</Message>
</div>
<Button type="submit" severity="secondary" label="Submit" />
</Form>
Expand Down
63 changes: 0 additions & 63 deletions apps/showcase/doc/message/PlainDoc.vue

This file was deleted.

63 changes: 63 additions & 0 deletions apps/showcase/doc/message/SimpleDoc.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<template>
<DocSectionText v-bind="$attrs">
<p>Configure the <i>variant</i> value as <i>simple</i> for messages without borders, backgrounds and paddings.</p>
</DocSectionText>
<div class="card flex flex-wrap gap-8 justify-center">
<Message severity="success" variant="simple">Success Message</Message>
<Message severity="info" variant="simple">Info Message</Message>
<Message severity="warn" variant="simple">Warn Message</Message>
<Message severity="error" variant="simple">Error Message</Message>
<Message severity="secondary" variant="simple">Secondary Message</Message>
<Message severity="contrast" variant="simple">Contrast Message</Message>
</div>
<DocSectionCode :code="code" />
</template>

<script>
export default {
data() {
return {
code: {
basic: `
<Message severity="success" variant="simple">Success Message</Message>
<Message severity="info" variant="simple">Info Message</Message>
<Message severity="warn" variant="simple">Warn Message</Message>
<Message severity="error" variant="simple">Error Message</Message>
<Message severity="secondary" variant="simple">Secondary Message</Message>
<Message severity="contrast" variant="simple">Contrast Message</Message>
`,
options: `
<template>
<div class="card flex flex-wrap gap-8 justify-center">
<Message severity="success" variant="simple">Success Message</Message>
<Message severity="info" variant="simple">Info Message</Message>
<Message severity="warn" variant="simple">Warn Message</Message>
<Message severity="error" variant="simple">Error Message</Message>
<Message severity="secondary" variant="simple">Secondary Message</Message>
<Message severity="contrast" variant="simple">Contrast Message</Message>
</div>
</template>
<script>
<\/script>
`,
composition: `
<template>
<div class="card flex flex-wrap gap-8 justify-center">
<Message severity="success" variant="simple">Success Message</Message>
<Message severity="info" variant="simple">Info Message</Message>
<Message severity="warn" variant="simple">Warn Message</Message>
<Message severity="error" variant="simple">Error Message</Message>
<Message severity="secondary" variant="simple">Secondary Message</Message>
<Message severity="contrast" variant="simple">Contrast Message</Message>
</div>
</template>
<script setup>
<\/script>
`
}
};
}
};
</script>
2 changes: 1 addition & 1 deletion apps/showcase/layouts/AppConfigurator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
},
{
name: 'soho',
palette: { 0: '#ffffff', 50: '#f4f4f4', 100: '#e8e9e9', 200: '#d2d2d4', 300: '#bbbcbe', 400: '#a5a5a9', 500: '#8e8f93', 600: '#77787d', 700: '#616268', 800: '#4a4b52', 900: '#34343d', 950: '#1d1e27' }
palette: { 0: '#ffffff', 50: '#ececec', 100: '#dedfdf', 200: '#c4c4c6', 300: '#adaeb0', 400: '#97979b', 500: '#7f8084', 600: '#6a6b70', 700: '#55565b', 800: '#3f4046', 900: '#2c2c34', 950: '#16161d' }
},
{
name: 'viva',
Expand Down
8 changes: 4 additions & 4 deletions apps/showcase/pages/message/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import IconDoc from '@/doc/message/IconDoc.vue';
import ImportDoc from '@/doc/message/ImportDoc.vue';
import LifeDoc from '@/doc/message/LifeDoc.vue';
import OutlinedDoc from '@/doc/message/OutlinedDoc.vue';
import PlainDoc from '@/doc/message/PlainDoc.vue';
import SimpleDoc from '@/doc/message/SimpleDoc.vue';
import PTComponent from '@/doc/message/pt/index.vue';
import SeverityDoc from '@/doc/message/SeverityDoc.vue';
import SizesDoc from '@/doc/message/SizesDoc.vue';
Expand Down Expand Up @@ -48,9 +48,9 @@ export default {
component: OutlinedDoc
},
{
id: 'plain',
label: 'Plain',
component: PlainDoc
id: 'simple',
label: 'Simple',
component: SimpleDoc
},
{
id: 'sizes',
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/src/message/Message.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export interface MessageProps {
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'text' | undefined;
variant?: 'outlined' | 'simple' | undefined;
}

/**
Expand Down
52 changes: 28 additions & 24 deletions packages/primevue/src/message/style/MessageStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ const theme = ({ dt }) => `
background: ${dt('message.info.close.button.hover.background')};
}
.p-message-info.p-message-variant-outlined {
.p-message-info.p-message-outlined {
color: ${dt('message.info.outlined.color')};
outline-color: ${dt('message.info.outlined.border.color')};
}
.p-message-info.p-message-variant-plain {
color: ${dt('message.info.plain.color')};
.p-message-info.p-message-simple {
color: ${dt('message.info.simple.color')};
}
.p-message-success {
Expand All @@ -93,13 +93,13 @@ const theme = ({ dt }) => `
background: ${dt('message.success.close.button.hover.background')};
}
.p-message-success.p-message-variant-outlined {
.p-message-success.p-message-outlined {
color: ${dt('message.success.outlined.color')};
outline-color: ${dt('message.success.outlined.border.color')};
}
.p-message-success.p-message-variant-plain {
color: ${dt('message.success.plain.color')};
.p-message-success.p-message-simple {
color: ${dt('message.success.simple.color')};
}
.p-message-warn {
Expand All @@ -118,13 +118,13 @@ const theme = ({ dt }) => `
background: ${dt('message.warn.close.button.hover.background')};
}
.p-message-warn.p-message-variant-outlined {
.p-message-warn.p-message-outlined {
color: ${dt('message.warn.outlined.color')};
outline-color: ${dt('message.warn.outlined.border.color')};
}
.p-message-warn.p-message-variant-plain {
color: ${dt('message.warn.plain.color')};
.p-message-warn.p-message-simple {
color: ${dt('message.warn.simple.color')};
}
.p-message-error {
Expand All @@ -143,13 +143,13 @@ const theme = ({ dt }) => `
background: ${dt('message.error.close.button.hover.background')};
}
.p-message-error.p-message-variant-outlined {
.p-message-error.p-message-outlined {
color: ${dt('message.error.outlined.color')};
outline-color: ${dt('message.error.outlined.border.color')};
}
.p-message-error.p-message-variant-plain {
color: ${dt('message.error.plain.color')};
.p-message-error.p-message-simple {
color: ${dt('message.error.simple.color')};
}
.p-message-secondary {
Expand All @@ -168,13 +168,13 @@ const theme = ({ dt }) => `
background: ${dt('message.secondary.close.button.hover.background')};
}
.p-message-secondary.p-message-variant-outlined {
.p-message-secondary.p-message-outlined {
color: ${dt('message.secondary.outlined.color')};
outline-color: ${dt('message.secondary.outlined.border.color')};
}
.p-message-secondary.p-message-variant-plain {
color: ${dt('message.secondary.plain.color')};
.p-message-secondary.p-message-simple {
color: ${dt('message.secondary.simple.color')};
}
.p-message-contrast {
Expand All @@ -193,13 +193,13 @@ const theme = ({ dt }) => `
background: ${dt('message.contrast.close.button.hover.background')};
}
.p-message-contrast.p-message-variant-outlined {
.p-message-contrast.p-message-outlined {
color: ${dt('message.contrast.outlined.color')};
outline-color: ${dt('message.contrast.outlined.border.color')};
}
.p-message-contrast.p-message-variant-plain {
color: ${dt('message.contrast.plain.color')};
.p-message-contrast.p-message-simple {
color: ${dt('message.contrast.simple.color')};
}
.p-message-text {
Expand Down Expand Up @@ -280,19 +280,23 @@ const theme = ({ dt }) => `
height: ${dt('message.close.icon.lg.size')};
}
.p-message-variant-outlined {
.p-message-outlined {
background: transparent;
outline-width: ${dt('message.outlined.border.width')};
}
.p-message-variant-plain {
.p-message-simple {
background: transparent;
outline-color: transparent;
box-shadow: none;
}
.p-message-simple .p-message-content {
padding: ${dt('message.simple.content.padding')};
}
.p-message-variant-outlined .p-message-close-button:hover,
.p-message-variant-plain .p-message-close-button:hover {
.p-message-outlined .p-message-close-button:hover,
.p-message-simple .p-message-close-button:hover {
background: transparent;
}
`;
Expand All @@ -301,8 +305,8 @@ const classes = {
root: ({ props }) => [
'p-message p-component p-message-' + props.severity,
{
'p-message-variant-outlined': props.variant === 'outlined',
'p-message-variant-plain': props.variant === 'plain',
'p-message-outlined': props.variant === 'outlined',
'p-message-simple': props.variant === 'simple',
'p-message-sm': props.size === 'small',
'p-message-lg': props.size === 'large'
}
Expand Down
Loading

0 comments on commit b263c1e

Please sign in to comment.