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

feat: ResourceListDetails doc block #3129

Merged
merged 18 commits into from
Oct 18, 2024

Commits on Oct 18, 2024

  1. chore: add componentGuidelinesName to package.json

    - components that have a valid page on the spectrum guidelines site have
    a componentGuidelinesName key now.
    - components that do not have a valid page on the spectrum guidelines
    site have a componentBetaName key that will point to the
    spectrum-contributions site.
    - for components that do not any guidelines, setting the
    componentGuidelinesName key to an empty string in the package.json will
    make sure the guidelines resource card doesn't render.
    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    ed9cbe2 View commit details
    Browse the repository at this point in the history
  2. feat: resource list component doc block

    The ResourceListDetails fetches data from each storybook component's
    package.json, specifically utilizing the package name and optional
    componentGuidelinesName. It then creates links to the spectrum
    guidelines, github, and npm sites. If a component doesn't have a
    spectrum guidelines page, it uses the optional componentBetaName and the
    spectrum-contributions site instead.
    
    - creates new `styled` components related to the resource section, any
    element wrappers and links
    - creates ResourceListDetails doc block
    - creates ResourceListContent component (which are the individual
    resource cards)
    - adds some helper functions to generate SVGs corresponding to the links,
    switch statements, mapping text, etc.
    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    0bf7ff9 View commit details
    Browse the repository at this point in the history
  3. refactor: add support for nested components

    this applies to form and meter. Form should no longer render a guidelines
    link card, and meter should navigate to its own guidelines page instead
    of progress bar's.
    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    6b8c1e0 View commit details
    Browse the repository at this point in the history
  4. chore: pr fixes

    - update spacing for if() statement
    - render ResourceListDetails in ComponentDetails
    - console.warn instead of throw an error
    - hard codes styles for cards
    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    6513461 View commit details
    Browse the repository at this point in the history
  5. refactor: svg usage

    - extracts SVG code to individual jsx files
    - imports those SVG jsx files to use a components
    - replaces/refactors svg functions to render new svg components
    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    d15330d View commit details
    Browse the repository at this point in the history
  6. chore: update package.json

    - creates a `spectrum` key in each component's package.json to use in
    ComponentDetails
    - `spectrum` array holds metadata for components and/or nested
    components, like the componentName, the guidelineLink, and rootClass
    - eventually we may be able to add designLink to add Figma links to this
    block
    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    732417b View commit details
    Browse the repository at this point in the history
  7. refactor: resource list component fixes

    - reorganizes file so ResourceLinkContent and ResourceListDetails are
    closer to CopmonentDetails, and all fetching/processing helper functions
    are together
    - addresses missing field label guidelines link
    - removes some hardcoded nestedComponent code in favor for a for loop
    - indentation fixes
    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    ac9c142 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    41cbfb9 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b387c79 View commit details
    Browse the repository at this point in the history
  10. docs: revert componentName in favor of docsPage: false

    - removed componentName from field label and progress bar package.jsons
    - created docsPage parameter for form in the storyMeta
    - refactored the nested component for loop to check if the guidelines
    are defined, and if docsPage is undefined. If both of those check out,
    render the guidelines link. Form is the only component that needed this,
    since it's the only nested component that doesn't have a guidelines page
    while its parent (field label) does.
    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    dad33fc View commit details
    Browse the repository at this point in the history
  11. chore: refactor to check for unique rootClass

    To better capture nested components, as well as components that may not
    have a guidelines page, this refactor double checks that the hasDocsPage
    prop is undefined, as well as that the spectrum.rootClass value includes
    a transformed component title. Adding the additional check of the
    rootClass helped ensure the proper guidelines link was rendering for
    nested components, as well as breaking when the condition was met.
    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    e7c8e70 View commit details
    Browse the repository at this point in the history
  12. chore: refactor to use meta.args.rootClass

    - instead of comparing a story's title (because meter didn't have a
    unique rootClass), compare the spectrum.rootClass to the
    meta.args.rootClass. This is possible now because we have updated the
    default args for meter to be spectrum-Meter.
    - removes usage or reformatTitle and hasDocsPage functions and props
    - adds more thorough JSDoc comments
    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    78fff5c View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    e661f2f View commit details
    Browse the repository at this point in the history
  14. chore: fixes after rebase

    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    d56e9ad View commit details
    Browse the repository at this point in the history
  15. docs: add quickaction guidelines link

    - white space removal
    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    8237a91 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    742845b View commit details
    Browse the repository at this point in the history
  17. chore: pr fixes

    - change status prop name to isDeprecated
    - remove unnecessary skipBorder prop
    marissahuysentruyt authored and pfulton committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    a65531d View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    5b8bbd5 View commit details
    Browse the repository at this point in the history