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

new component : Rating card #383

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
16 changes: 10 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This mono repository contains multiple packages under the folder `packages`
- `tailwind-preset` contains the [Tailwind Css](https://tailwindcss.com/) preset and is released under the name `@prestashopcorp/puik-tailwind-preset`
- `theme` contains all the CSS classes used in our components and is released under the name `@prestashopcorp/puik-theme`
- `utils` contains all the utility functions used across our packages, this package is bundled with the other packages when it's used and isn't released as a standalone
- `web-components` contains all the web components and is released under the name `@prestashopcorp/puik-web-components` ([see available web-components](https://github.com/PrestaShopCorp/puik/blob/main/RELEASE-NOTES-V2.md#available-components))

The `playground` folder contains a Vue 3 to help you develop your components

Expand Down Expand Up @@ -80,7 +81,7 @@ $ pnpm component

This command generates multiples files and injects code in these files

```
``` plaintext
puik/
└── packages/
β”œβ”€β”€ components/
Expand All @@ -100,11 +101,14 @@ puik/
β”œβ”€β”€ puik/
β”‚ β”œβ”€β”€ component.ts
β”‚ └── global.d.ts
└── theme/
└── src/
β”œβ”€β”€ my-component.scss
└── index.scss

β”œβ”€β”€ theme/
β”‚ └── src/
β”‚ β”œβ”€β”€ my-component.scss
β”‚ └── index.scss
└── web-components/
β”œβ”€β”€ components/
β”‚ └── component.ts
└── index.ts
```

### Style
Expand Down
2 changes: 2 additions & 0 deletions RELEASE-NOTES-V2.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Here is the list of available components in the Vue and Web-Components version o
| Progress-stepper | βœ… | βœ… | |
| Progress-stepper-step | βœ… | βœ… | |
| Radio | βœ… | βœ… | |
| Rating-card | βœ… | βœ… | |
| Select | βœ… | ❌ | |
| Sidebar | βœ… | βœ… | |
| Sidebar-group-item | βœ… | ❌ | |
Expand All @@ -52,6 +53,7 @@ Here is the list of available components in the Vue and Web-Components version o
| Skeleton-loader | βœ… | βœ… | |
| Skeleton-loader-group | βœ… | βœ… | |
| Snackbar | βœ… | ❌ | Previously implemented with Headless UI, now moved to Radix Vue (see Storybook documentation for more details)|
| Sortable-list | βœ… | ❌ | |
| Spinner-loader | βœ… | βœ… | |
| Switch | βœ… | βœ… | |
| Tab-navigation | βœ… | βœ… | |
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [2, 'always', 150]
'header-max-length': [2, 'always', 300]
}
};
2 changes: 1 addition & 1 deletion packages/components/accordion/stories/accordion.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default {
dataTest: {
control: 'text',
description:
'Set the data-test attribute for the accordion `button-${dataTest}` `title-${dataTest}` `icon-${dataTest}` `subTitle-${dataTest}`'
'Sets the data-test attribute for the accordion `button-${dataTest}` `title-${dataTest}` `icon-${dataTest}` `subTitle-${dataTest}`'
}
}
} as Meta;
Expand Down
12 changes: 6 additions & 6 deletions packages/components/alert/stories/alert.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ export default {
component: PuikAlert,
argTypes: {
title: {
description: 'Set the alert title'
description: 'Sets the alert title'
},
description: {
description: 'Set the alert description (also exists as a default slot)'
description: 'Sets the alert description (also exists as a default slot)'
},
variant: {
control: 'select',
description: 'Set the alert variant',
description: 'Sets the alert variant',
options: alertVariants,
table: {
defaultValue: {
Expand All @@ -45,7 +45,7 @@ export default {
description: 'Label of the button'
},
buttonWrapLabel: {
description: 'Set the carriage return of the button label',
description: 'Sets the carriage return of the button label',
table: {
defaultValue: {
summary: false
Expand All @@ -57,12 +57,12 @@ export default {
},
default: {
control: 'none',
description: 'Set the alert description'
description: 'Sets the alert description'
},
dataTest: {
control: 'text',
description:
'Set the data-test attribute for the alert components `title-${dataTest}` `description-${dataTest}` `button-${dataTest}` `close-${dataTest}` `link-${dataTest}`'
'Sets the data-test attribute for the alert components `title-${dataTest}` `description-${dataTest}` `button-${dataTest}` `close-${dataTest}` `link-${dataTest}`'
},
linkLabel: {
description: 'Label of the link'
Expand Down
4 changes: 2 additions & 2 deletions packages/components/avatar/stories/avatar.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default {
}
},
ariaLabel: {
description: 'Set the aria-label attribute for accessibility',
description: 'Sets the aria-label attribute for accessibility',
table: {
defaultValue: {
summary: 'undefined'
Expand Down Expand Up @@ -152,7 +152,7 @@ export default {
dataTest: {
control: 'text',
description:
'Set the data-test attribute for the avatar `image-${dataTest}` `icon-${dataTest}` `initials-${dataTest}`'
'Sets the data-test attribute for the avatar `image-${dataTest}` `icon-${dataTest}` `initials-${dataTest}`'
}
},
args: {
Expand Down
6 changes: 3 additions & 3 deletions packages/components/badge/stories/badge.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default {
},
variant: {
control: 'select',
description: 'Set the badge variant',
description: 'Sets the badge variant',
options: badgeVariants,
table: {
type: {
Expand All @@ -26,7 +26,7 @@ export default {
}
},
ariaLabel: {
description: 'Set the aria-label attribute for accessibility',
description: 'Sets the aria-label attribute for accessibility',
table: {
defaultValue: {
summary: 'undefined'
Expand All @@ -38,7 +38,7 @@ export default {
},
dataTest: {
control: 'text',
description: 'Set the data-test attribute on the badge'
description: 'Sets the data-test attribute on the badge'
}
},
args: {
Expand Down
18 changes: 9 additions & 9 deletions packages/components/button/stories/button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
argTypes: {
variant: {
control: 'select',
description: 'Set the button variant',
description: 'Sets the button variant',
options: buttonVariants,
table: {
defaultValue: {
Expand All @@ -25,7 +25,7 @@ export default {
},
size: {
control: 'select',
description: 'Set the button size',
description: 'Sets the button size',
options: buttonSizes,
table: {
defaultValue: {
Expand All @@ -37,34 +37,34 @@ export default {
}
},
fluid: {
description: 'Set the button as fluid',
description: 'Sets the button as fluid',
table: {
defaultValue: {
summary: false
}
}
},
wrapLabel: {
description: 'Set the carriage return of the button label',
description: 'Sets the carriage return of the button label',
table: {
defaultValue: {
summary: false
}
}
},
disabled: {
description: 'Set the button as disabled',
description: 'Sets the button as disabled',
table: {
defaultValue: {
summary: false
}
}
},
leftIcon: {
description: 'Set the button left icon'
description: 'Sets the button left icon'
},
rightIcon: {
description: 'Set the button right icon'
description: 'Sets the button right icon'
},
default: {
control: 'text',
Expand All @@ -85,7 +85,7 @@ export default {
'Set a data-test attribute to the button `${dataTest}` `left-icon-${dataTest}` `right-icon-${dataTest}`'
},
ariaLabel: {
description: 'Set the aria-label attribute for accessibility',
description: 'Sets the aria-label attribute for accessibility',
table: {
defaultValue: {
summary: 'undefined'
Expand All @@ -97,7 +97,7 @@ export default {
},
disabledReason: {
control: 'text',
description: 'Set the aria-describedby attribute for accessibility if disabled'
description: 'Sets the aria-describedby attribute for accessibility if disabled'
}
},
args: {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/card/stories/card.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
component: PuikCard,
argTypes: {
variant: {
description: 'Set the card variant',
description: 'Sets the card variant',
table: {
defaultValue: {
summary: 'default'
Expand All @@ -21,7 +21,7 @@ export default {
}
},
ariaLabel: {
description: 'Set the aria-label attribute for accessibility',
description: 'Sets the aria-label attribute for accessibility',
table: {
defaultValue: {
summary: 'undefined'
Expand Down
10 changes: 5 additions & 5 deletions packages/components/checkbox/stories/checkbox.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export default {
argTypes: {
default: {
control: 'text',
description: 'Set the label via default slot'
description: 'Sets the label via default slot'
},
label: {
control: 'text',
description: 'Set the checkbox label'
description: 'Sets the checkbox label'
},
ariaLabel: {
description: 'If you are planning to set the label via default slot instead of using label prop then in that case you should set the aria-label for better accessibility',
Expand All @@ -36,7 +36,7 @@ export default {
}
},
indeterminate: {
description: 'Set the indeterminate checkbox state',
description: 'Sets the indeterminate checkbox state',
table: {
defaultValue: {
summary: false
Expand All @@ -48,7 +48,7 @@ export default {
control: 'none'
},
disabled: {
description: 'Set the checkbox as disabled',
description: 'Sets the checkbox as disabled',
table: {
defaultValue: {
summary: false
Expand All @@ -57,7 +57,7 @@ export default {
},
dataTest: {
description:
'Set the data-test attribute for the label and the input `label-${dataTest}` `input-${dataTest}`}`',
'Sets the data-test attribute for the label and the input `label-${dataTest}` `input-${dataTest}`}`',
control: 'text'
}
},
Expand Down
1 change: 1 addition & 0 deletions packages/components/icon/src/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface IconProps {
nodeType?: string
fontSize?: string | number
color?: string
fill?: number
isDisabled?: boolean
dataTest?: string
ariaLabel?: string
Expand Down
6 changes: 4 additions & 2 deletions packages/components/icon/src/icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ defineOptions({
const props = withDefaults(defineProps<IconProps>(), {
nodeType: 'div',
fontSize: '1rem',
color: '#00000'
color: '#00000',
fill: 1
});

const fontSize = computed(() => {
Expand All @@ -37,7 +38,8 @@ const fontSize = computed(() => {
const style = computed(() => {
return {
fontSize: fontSize.value,
color: props.color
color: props.color,
'font-variation-settings': `'FILL' ${props.fill}`
};
});

Expand Down
12 changes: 6 additions & 6 deletions packages/components/icon/stories/icon.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export default {
component: PuikIcon,
argTypes: {
icon: {
description: 'Set the icon name'
description: 'Sets the icon name'
},
fontSize: {
description: 'Set the icon font size',
description: 'Sets the icon font size',
control: {
type: 'range',
min: 1,
Expand All @@ -18,21 +18,21 @@ export default {
}
},
color: {
description: 'Set the icon color',
description: 'Sets the icon color',
control: {
type: 'color'
}
},
nodeType: {
description: 'Set the HTML node type',
description: 'Sets the HTML node type',
default: 'div',
control: {
type: 'radio',
options: ['div', 'span']
}
},
dataTest: {
description: 'Set the data-test attribute'
description: 'Sets the data-test attribute'
},
isDisabled: {
description: 'If the icon is disable',
Expand All @@ -41,7 +41,7 @@ export default {
}
},
ariaLabel: {
description: 'Set the aria-label attribute for accessibility (if this prop is not present the default aria-label will be set to the icon name)',
description: 'Sets the aria-label attribute for accessibility (if this prop is not present the default aria-label will be set to the icon name)',
table: {
defaultValue: {
summary: 'undefined'
Expand Down
1 change: 1 addition & 0 deletions packages/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ export * from './avatar';
export * from './divider';
export * from './notification-bar';
export * from './sortable-list';
export * from './rating-card';
Loading
Loading