Conversation
Codecov Report
@@ Coverage Diff @@
## master #1979 +/- ##
==========================================
- Coverage 75.83% 75.68% -0.15%
==========================================
Files 160 163 +3
Lines 5569 5572 +3
Branches 1628 1620 -8
==========================================
- Hits 4223 4217 -6
- Misses 1332 1342 +10
+ Partials 14 13 -1
Continue to review full report at Codecov.
|
c446718 to
d04ea6a
Compare
docs/src/examples/components/Carousel/Types/CarouselExample.tsx
Outdated
Show resolved
Hide resolved
| navigation={{ | ||
| 'aria-label': 'people portraits', | ||
| items: carouselItems.map((item, index) => ({ | ||
| key: index, |
There was a problem hiding this comment.
| key: index, | |
| key: item.id, |
| key: index, | ||
| 'aria-label': imageAltTags[item.id], | ||
| 'aria-controls': item.id, | ||
| icon: { name: 'stardust-circle', size: 'smallest' as SizeValue }, |
There was a problem hiding this comment.
Why aren't these default props for this icon?
| * A Carousel can position its navigation to the bottom by default, | ||
| * to the top, to the left or to the right of the content. | ||
| */ | ||
| navigationPosition?: 'bottom' | 'top' | 'left' | 'right' |
There was a problem hiding this comment.
| navigationPosition?: 'bottom' | 'top' | 'left' | 'right' | |
| navigationPosition?: 'below' | 'above' | 'start' | 'end' |
CHANGELOG.md
Outdated
| - Add bounce animation to button clicks in Teams theme @notandrew ([#1724](https://github.com/stardust-ui/react/pull/1724)) | ||
| - Update Silver color scheme, adding `foregroundHover`, `foregroundPressed` and `background` definitions @pompomon ([#2078](https://github.com/microsoft/fluent-ui-react/pull/2078)) | ||
| - Expanding experimental accessibility schema to more components @mshoho ([#2052](https://github.com/stardust-ui/react/pull/2052)) | ||
| - `Carousel` component @silviuavram ([#1979](https://github.com/microsoft/fluent-ui-react/pull/1979)) |
There was a problem hiding this comment.
| - `Carousel` component @silviuavram ([#1979](https://github.com/microsoft/fluent-ui-react/pull/1979)) | |
| - Add base `Carousel` component @silviuavram ([#1979](https://github.com/microsoft/fluent-ui-react/pull/1979)) |
| import * as React from 'react' | ||
| import { Carousel, Image } from '@stardust-ui/react' | ||
|
|
||
| const imageAltTags = { |
| circular?: boolean | ||
|
|
||
| /** Initial activeIndex value. */ | ||
| defaultActiveIndex?: number | string |
There was a problem hiding this comment.
add onActiveIndexChange method
| navigationPosition?: 'bottom' | 'top' | 'left' | 'right' | ||
|
|
||
| /** A Carousel's paddles may fade away when mouse is not hovering the code. */ | ||
| paddlesFade?: boolean |
There was a problem hiding this comment.
Let's not add this prop just now.. If we see need in the future we can add it.
| * On slide transition, the Carousel may translate the slides' position, | ||
| * fade their appearance or just hide and show without any animation. | ||
| */ | ||
| slideTransition?: 'translate' | 'fade' | 'display' |
There was a problem hiding this comment.
Let's not add this at this moment, and implement in the styles whatever is necessary for the team. I don't think one application will have different slideTransition. If this turns out to be a case, we can add it later.
|
|
||
| static defaultProps = { | ||
| accessibility: carouselBehavior, | ||
| as: 'div', |
There was a problem hiding this comment.
this is by default, no need to add it here
| defaultProps: () => ({ | ||
| className: Carousel.slotClassNames.paddlePrevious, | ||
| iconOnly: true, | ||
| icon: 'stardust-chevron-left', |
There was a problem hiding this comment.
let's add these in the defaultProps, instead of the empty objects.
There was a problem hiding this comment.
If I do this, it will override all of them each time I add only one field. For instance in the pagination example I added aria-label as shortcuts and the default values were removed. I would consider leaving theme here.
| paddlePrevious, | ||
| ), | ||
| }), | ||
| overrideProps: (predefinedProps: ButtonProps) => ({ |
There was a problem hiding this comment.
Extract these to functions
| } | ||
|
|
||
| static slotClassNames: CarouselItemSlotClassNames = { | ||
| itemPositionContainer: `${CarouselItem.className}__itemPositionContainer`, |
| secondary?: boolean | ||
|
|
||
| /** Carousel navigation items can by highlighted using underline. */ | ||
| underlined?: boolean |
There was a problem hiding this comment.
Let's not add underlined for now
| } | ||
|
|
||
| handleBlur = (e: React.SyntheticEvent) => { | ||
| this.setState({ isFromKeyboard: false }) |
There was a problem hiding this comment.
Try replacing this with 'focus-visible'
| 'stardust-arrow-up': processedIcons['triangle-up'], | ||
| 'stardust-arrow-down': processedIcons['triangle-down'], | ||
| 'stardust-arrow-end': processedIcons['triangle-right'], | ||
| 'stardust-chevron-left': processedIcons['chevron-left'], |
|
|
||
| paddleNext.simulate('click') | ||
|
|
||
| expect(pagination.getDOMNode().textContent).toBe(`4 of ${items.length}`) |
There was a problem hiding this comment.
Please check this again, paddleNext should not be visible
| jest.runAllTimers() | ||
| }) | ||
|
|
||
| it('should not show pagination if prop is passed', () => { |
There was a problem hiding this comment.
| it('should not show pagination if prop is passed', () => { | |
| it('should not show pagination if navigation prop is passed', () => { |
There was a problem hiding this comment.
And add the opposite scenario test (navigation: false)
…-ui/react into feat/carousel-component
…-ui/react into feat/carousel-component
| 'canvas-add-page': canvasAddPage, | ||
| chat, | ||
| 'chevron-down': chevronDown, | ||
| 'chevron-start': chevronStart, |
There was a problem hiding this comment.
Not sure if we should export these icons. Can you please just export the stardust-* icons
Separate component for the navigation (based on the Menu implementation).
Features:
After API discussion: