Skip to content

feat(CC-batch-5): added batch 5 #11867

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mattnolting
Copy link
Contributor

Relates to: #11624

Included components:

  • Empty State
  • Expandable Section
  • File upload
  • Hint
  • Inline edit

Component tracker

Figma preview

Resources:

@patternfly-build
Copy link
Contributor

patternfly-build commented Jun 11, 2025

@mattnolting mattnolting marked this pull request as ready for review June 12, 2025 11:57
status={props.status.type}
titleText={props.title}
variant={props.variant}
headingLevel="h4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add a comment here indicating that this may need to be updated for accessibility
maybe link to https://www.w3.org/WAI/tutorials/page-structure/headings/

'Extra large': 'xl'
}),
// "custom" | "warning" | "success" | "danger" | "info"
status: figma.enum('Type', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont understand how this Type prop is affecting the example code. It doesn't look like it's being passed at all.

type: undefined
}
}),
isLoading: figma.enum('Type', { Loading: 'Spinner' })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't appear to be used in the example code below at all

example: (props) => (
// Documentation for ExpandableSection can be found at https://www.patternfly.org/components/expandable-section
<ExpandableSection
toggleTextCollapsed={props.toggleTextCollapsed}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not be combining toggleContent, toggleTextCollapsed, and toggleTextExpanded in the same ExpandableSection.

If toggleContent is provided, it overrides the other two.
I think these ExpandableSection implementations should choose one or the other. it can leave the other option commented out with an explanation...

And onToggle with isExpanded are only required if the user wants to be able to have other side effects when opening/closing the expandable section (such as fetching the data to load in the expanded section only if the user tries to expand).

So those two props can be commented out by default letting them know in a comment that they can override the default expand/collapse behavior by using those two props.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

example: (props) => (
// Documentation for ExpandableSection can be found at https://www.patternfly.org/components/expandable-section
<ExpandableSection
isExpanded={props.isExpanded}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be rewritten based on my comments in the ExpandableSectionTruncate file.

example: (props) => (
// Documentation for ExpandableSection can be found at https://www.patternfly.org/components/expandable-section
<ExpandableSection
isExpanded={props.isExpanded}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be rewritten based on my comments in the ExpandableSectionTruncate file.


state: figma.enum('State', {
Default: 'default',
'Drag over': 'drag-over',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this enum being used for? i don't see any references to these concepts in the example code below

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thought is that this is tracking different states for file uploading from a design perspective, but the implementation doesn't really change so this may not be necessary to map.


const actions = (
<Dropdown
isOpen={isOpen}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work as written since ReferenceError: isOpen is not defined

I think this dropdown should be updated to something like:

const actions = (
  <Dropdown
    isOpen={false} // should use an 'isOpen' state variable
    onSelect={()=>{}} // need to define an onSelect handler
    onOpenChange={(isOpen: boolean) => setIsOpen(isOpen)}
    toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
      <MenuToggle
        ref={toggleRef}
        aria-label="Without title example kebab toggle"
        variant="plain"
        onClick={()=>{}} // should toggle the value of 'isOpen' state variable
        isExpanded={false}
        icon={"..."} // should use an icon
      />
    )}
  >
    <DropdownList>
      <DropdownItem value={0} key="action">
        Action
      </DropdownItem>
      <DropdownItem
        value={1}
        key="link"
        to="#default-link2"
        // Prevent the default onClick functionality for example purposes
        onClick={(ev: any) => ev.preventDefault()}
      >
        Link
      </DropdownItem>
      <DropdownItem value={2} isDisabled key="disabled action">
        Disabled Action
      </DropdownItem>
      <DropdownItem value={3} isDisabled key="disabled link" to="#default-link4">
        Disabled Link
      </DropdownItem>
      <Divider component="li" key="separator" />
      <DropdownItem value={4} key="separated action">
        Separated Action
      </DropdownItem>
      <DropdownItem value={5} key="separated link" to="#default-link6" onClick={(ev) => ev.preventDefault()}>
        Separated Link
      </DropdownItem>
    </DropdownList>
  </Dropdown>
);

icon={props.status.icon}
>
<EmptyStateBody>{props.body}</EmptyStateBody>
{/* <EmptyStateFooter>{props.children}</EmptyStateFooter> */}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this meant to connect to Figma or is this just a comment showing EmptyStateFooter?

example: (props) => (
// Documentation for ExpandableSection can be found at https://www.patternfly.org/components/expandable-section
<ExpandableSection
toggleTextCollapsed={props.toggleTextCollapsed}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1


state: figma.enum('State', {
Default: 'default',
'Drag over': 'drag-over',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thought is that this is tracking different states for file uploading from a design perspective, but the implementation doesn't really change so this may not be necessary to map.

infoText="Accepted file types: JPEG, Doc, PDF, PNG"
/>

<MultipleFileUploadStatus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MultipleFileUploadStatus is conditionally shown in our examples after a file is uploaded. Unsure if that's too complex to stub out so maybe a comment would be helpful here.

titleIcon={'<UploadIcon />'}
titleText="Drag and drop files here"
titleTextSeparator="or"
infoText="Accepted file types: JPEG, Doc, PDF, PNG"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're stubbing out this infoText with defined accepted file types we may also want to add a stubbed dropzoneProps to MultipleFileUpload to match:

dropzoneProps={{ accept: { 'image/jpeg': ['.jpg', '.jpeg'], 'application/msword': ['.doc'], 'application/pdf': ['.pdf'], 'image/png': ['.png'] } }}

false: undefined
}),

actions: figma.instance('Swap button')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused?

@mattnolting mattnolting marked this pull request as draft June 17, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants