Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #308 [tooltip][breaking-change] - prop naming - replace title b… #309

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
99db4b3
feat: add disabled state to icon
Jan 16, 2024
b1b0a42
feat: articles variant added to link component
ClaraLpresta Jan 26, 2024
651f07d
feat: allow to use tailwindconf inside componenent
Jan 23, 2024
f2c5d6e
fix: #304 update storybook + refacto syntax of the table emits defini…
mattgoud Jan 29, 2024
fd2cfb5
build: update pnpm-lockfile
mattgoud Jan 29, 2024
120829e
fix: rollback syntax of table emit definitions
mattgoud Jan 29, 2024
1bdcedf
Merge pull request #294 from PrestaShopCorp/feat_add_disable_state_icon
mattgoud Jan 29, 2024
ac67bcd
Merge branch 'main' into 304-table-update-storybook
mattgoud Jan 29, 2024
3a81a89
Merge branch 'main' into feat/link-article
mattgoud Jan 29, 2024
5f5fbbf
fix: articles added to link component storybook
ClaraLpresta Jan 31, 2024
f466985
Merge pull request #302 from PrestaShopCorp/feat/link-article
mattgoud Jan 31, 2024
59c16ca
Merge branch 'main' into 304-table-update-storybook
mattgoud Jan 31, 2024
7015698
Merge pull request #305 from PrestaShopCorp/304-table-update-storybook
mattgoud Jan 31, 2024
46aefe4
fix: rollup-config
mattgoud Feb 1, 2024
63c2434
test: update icon test (check disabled class)
mattgoud Feb 1, 2024
f1ea72b
build: remove rollup-plugin-polyfill-node plugin
mattgoud Feb 1, 2024
8dd9a88
Merge pull request #306 from PrestaShopCorp/fix-rollup-config
mattgoud Feb 1, 2024
b47ed99
fix: #303 - change badge colors
mattgoud Feb 6, 2024
bb3e599
fix: #308 [tooltip][breaking-change] - prop naming - replace title b…
mattgoud Feb 6, 2024
65acfc9
Merge pull request #307 from PrestaShopCorp/style/status-tag-update-c…
mattgoud Feb 6, 2024
f048594
Merge branch 'main' into 308-bug-tooltip-naming-conflict-between-prop…
mattgoud Feb 6, 2024
68d4c04
Merge branch 'feat/2.0.0-beta' into 308-bug-tooltip-naming-conflict-b…
mattgoud Feb 8, 2024
6b5f245
Merge branch 'feat/2.0.0-beta' into 308-bug-tooltip-naming-conflict-b…
mattgoud Feb 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/icon/src/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface IconProps {
nodeType?: string
fontSize?: string | number
color?: string
isDisabled?: boolean
cnavarro-prestashop marked this conversation as resolved.
Show resolved Hide resolved
dataTest?: string
}

Expand Down
3 changes: 3 additions & 0 deletions packages/components/icon/src/icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
class="puik-icon"
:style="style"
:data-test="dataTest"
:class="{
'puik-icon--disabled': isDisabled,
}"
>
{{ icon }}
</component>
Expand Down
9 changes: 8 additions & 1 deletion packages/components/icon/stories/icon.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export default {
},
dataTest: {
description: 'Set the data-test attribute'
},
isDisabled: {
description: 'If the icon is disable',
control: {
type: 'boolean'
}
}
}
} as Meta;
Expand All @@ -55,7 +61,8 @@ export const Default = {
color: 'green',
fontSize: 24,
nodeType: 'span',
dataTest: ''
dataTest: '',
isDisabled: false
},

parameters: {
Expand Down
10 changes: 10 additions & 0 deletions packages/components/icon/test/icon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ describe('Icon tests', () => {
expect(findIcon().text()).toBe('check');
});

it('should set the icon disabled', async () => {
factory({
icon: 'check',
color: 'red',
isDisabled: true
});

expect(findIcon().classes()).toContain('puik-icon--disabled');
});

it('should set the color', async () => {
factory({
icon: 'check',
Expand Down
1 change: 1 addition & 0 deletions packages/components/link/src/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface LinkProps {
target?: `${PuikLinkTargetVariants}`
title?: string
highContrast?: boolean
articles?: boolean
dataTest?: string
}

Expand Down
1 change: 1 addition & 0 deletions packages/components/link/src/link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'puik-link',
`puik-link--${size}`,
{ 'puik-link--high-contrast': highContrast },
{ 'puik-link--articles': articles },
]"
:data-test="dataTest"
>
Expand Down
12 changes: 11 additions & 1 deletion packages/components/link/stories/link.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ export default {
},
highContrast: {
description:
'Sets the link in high contrast mode by disabling the purple color for the visited stated',
'Sets the link in high contrast mode by changing the gray underline color',
table: {
defaultValue: {
summary: false
}
}
},
articles: {
description:
'Sets the link in articles mode, adding the purple color for the visited stated',
table: {
defaultValue: {
summary: false
Expand All @@ -72,6 +81,7 @@ export default {
to: undefined,
target: '_self',
highContrast: false,
articles: false,
default: "I'm a cool link",
title: "I'm a tooltip for your link",
size: 'md',
Expand Down
5 changes: 5 additions & 0 deletions packages/components/link/test/link.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ describe('Link tests', () => {
factory({ highContrast: true });
expect(findLink().classes()).toContain('puik-link--high-contrast');
});

it('should set the link in articles mode', () => {
factory({ articles: true });
expect(findLink().classes()).toContain('puik-link--articles');
});
});
31 changes: 21 additions & 10 deletions packages/components/table/stories/table.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,21 @@ export default {
import type { PuikTableHeader } from '@prestashopcorp/puik/es/components/table/src/table'

interface PuikTableHeader {
text: string | undefined
value: string
size: 'sm' | 'md' | 'lg' | undefined
width: string | undefined
align: 'left' | 'center' | 'right' | undefined
sortable: boolean | undefined
searchable: boolean | undefined
preventExpand: boolean | undefined
text?: string
size?: 'sm' | 'md' | 'lg'
align?: 'left' | 'center' | 'right'
width?: string
sortable?: boolean
preventExpand?: boolean
searchable?: boolean
searchSubmit?: boolean
searchType?: {$PuikTableSearchInputTypes}
}

enum PuikTableSearchInputTypes {
Text = 'text',
Range = 'range',
}
`
}
Expand Down Expand Up @@ -201,8 +208,10 @@ export default {
description: 'Event emitted when sorting a column',
table: {
type: {
summary: 'sortOption',
summary: 'event => sortOption',
detail: `
// Payload type = sortOption

import type { sortOption } from '@prestashopcorp/puik/es/components/table/src/table'

type sortOption = {
Expand All @@ -218,9 +227,11 @@ type sortOption = {
control: 'none',
table: {
type: {
summary: 'event',
summary: 'event => SearchOption[]',
detail: `
Payload type = Array<SearchOption>
// Payload type = Array<SearchOption>

import type { searchOption } from '@prestashopcorp/puik/es/components/table/src/table'

type searchOption = {
searchBy: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/tooltip/src/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export enum PuikTooltipPositions {
}

export interface TooltipProps {
title?: string
heading?: string
description?: string
position?: `${PuikTooltipPositions}`
isDisabled?: boolean
Expand Down
9 changes: 5 additions & 4 deletions packages/components/tooltip/src/tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
>
<div class="puik-tooltip__tip__content">
<span
v-if="$slots.title || title"
class="puik-tooltip__tip__content__title"
:data-test="dataTest != undefined ? `title-${dataTest}` : undefined"
><slot name="title">{{ title }}</slot></span>
v-if="$slots.heading || heading"
class="puik-tooltip__tip__content__heading"
:data-test="dataTest != undefined ? `heading-${dataTest}` : undefined"
>
<slot name="heading">{{ heading }}</slot></span>
<span
v-if="$slots.description || description"
class="puik-tooltip__tip__content__description"
Expand Down
Loading
Loading