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

Consistent prop name for text labels across components #183

Open
indirectlylit opened this issue Feb 27, 2021 · 2 comments
Open

Consistent prop name for text labels across components #183

indirectlylit opened this issue Feb 27, 2021 · 2 comments
Assignees
Labels
category: library Shared code library TODO: needs decisions Further discussion and planning necessary type: task Something that needs to be done

Comments

@indirectlylit
Copy link
Contributor

indirectlylit commented Feb 27, 2021

Desired behavior

We use a consistent prop name – probably text – for anywhere a component has a String-type prop for some sort of label text. If the component has multiple string props, they should be variations: for example the KRadioButton might have both text and descriptionText.

Current behavior

We currently have a wide range of inconsistent prop names across the library, e.g.

The Value Add

This will help engineers learn the KDS API more easily be permitting knowledge transfer between components

Possible Tradeoffs

API breakage will require a major version bump and changes to Kolibri and Studio

@indirectlylit indirectlylit added category: library Shared code library type: proposal New feature or request labels Feb 27, 2021
@marcellamaki marcellamaki added type: task Something that needs to be done and removed type: proposal New feature or request labels May 6, 2021
@nucleogenesis nucleogenesis added the TODO: needs decisions Further discussion and planning necessary label Aug 6, 2024
@nucleogenesis nucleogenesis self-assigned this Aug 6, 2024
@nucleogenesis
Copy link
Member

@nucleogenesis will look into the API and compare/contrast them to clarify the issue a bit

@marcellamaki marcellamaki added this to the KDS Priority Triage milestone Aug 27, 2024
@nucleogenesis
Copy link
Member

nucleogenesis commented Jan 14, 2025

I hacked at this a bit today and these are the relevant props and the components that have them. I used the docs/jsdoc.js file which is the result of our utils/extractApi.js script to get an object w/ all props that are String type and list the components that use them:

Note, there are many props not shown here, but these are the ones relevant to this issue IMO (full list gist here):

{
    "text": [
        "KButton",
        "KExternalLink",
        "KRouterLink",
        "KOptionalText",
        "KTextTruncator",
        "KTooltip"
    ],
    "label": [
        "KCheckbox",
        "KLabeledIcon",
        "KRadioButton",
        "KSwitch",
        "KSelect",
        "KTextbox"
    ],
    "name": [
        "KSwitch"
    ],
    "title": [
        "KCard",
        "KModal",
        "UiToolbar",
        "KDateRange"
    ],
    "ariaLabel": [
        "KIconButton",
        "KTabs",
        "KTabsList"
    ],
    "ariaLabelledBy": [
        "KSwitch",
        "KTabs",
        "KTabsList"
    ],
    "tooltip": [
        "KIconButton"
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: library Shared code library TODO: needs decisions Further discussion and planning necessary type: task Something that needs to be done
Projects
None yet
Development

No branches or pull requests

3 participants