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

chore: Refactor Select and Combobox to use new styling utilities and tokens #2570

Merged
merged 59 commits into from
Mar 4, 2024

Conversation

mannycarrera4
Copy link
Contributor

@mannycarrera4 mannycarrera4 commented Feb 12, 2024

Summary

Fixes: #2399

Release Category

Components


@mannycarrera4 mannycarrera4 self-assigned this Feb 12, 2024
@mannycarrera4 mannycarrera4 marked this pull request as ready for review February 14, 2024 16:21
Copy link

cypress bot commented Feb 14, 2024

Passing run #7017 ↗︎

0 908 3 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge c9e0e19 into 34d1e76...
Project: canvas-kit Commit: 61b83a40f8 ℹ️
Status: Passed Duration: 15:33 💡
Started: Mar 4, 2024 11:16 PM Ended: Mar 4, 2024 11:31 PM

Review all test suite changes for PR #2570 ↗︎

@mannycarrera4 mannycarrera4 added the ready for review Code is ready for review label Feb 14, 2024
mannycarrera4 and others added 5 commits February 15, 2024 12:25
Co-authored-by: Josh <44883293+josh-bagwell@users.noreply.github.com>
Co-authored-by: Josh <44883293+josh-bagwell@users.noreply.github.com>
Co-authored-by: Raisa Primerova <48605821+RayRedGoose@users.noreply.github.com>
Co-authored-by: Josh <44883293+josh-bagwell@users.noreply.github.com>
Co-authored-by: Josh <44883293+josh-bagwell@users.noreply.github.com>
<Box
ref={model.state.containerRef}
{...handleCsProp(
{},
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 just empty since no elemProps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, the consumer will never pass elemProps here, it's passed to the other element below

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need Box here at all. there is no elemProps passed, It can be regular div with mergeProps or stencil

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe it's good to consider possibility of full transformation of this component? I don't think this will change a functionality of visual at all

export const ComboboxMenuItemIcon = createSubcomponent('span')({
modelHook: useComboboxModel,
subComponents: {
Icon: styled(SystemIcon)({alignSelf: 'start'}),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be using styled here? Or are we trying to step away from this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this

{inputStartIcon && model.state.selectedIds.length > 0 && (
<InputGroup.InnerStart pointerEvents="none">
<InputGroup.InnerStart {...selectIconsStencil()}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need mergeStyles? Or are we good with spreading this here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not here because the consumer will never have access to this element. I call mergeStyles where the consumer can pass elemProps too.

modules/react/collection/lib/ListBox.tsx Outdated Show resolved Hide resolved
modules/react/combobox/lib/ComboboxMenuItem.tsx Outdated Show resolved Hide resolved
modules/react/combobox/lib/ComboboxMenuItem.tsx Outdated Show resolved Hide resolved
modules/react/combobox/lib/ComboboxMenuItem.tsx Outdated Show resolved Hide resolved
modules/react/combobox/lib/ComboboxMenuItem.tsx Outdated Show resolved Hide resolved
modules/react/menu/lib/MenuCard.tsx Outdated Show resolved Hide resolved
modules/react/menu/lib/MenuCard.tsx Outdated Show resolved Hide resolved
modules/react/menu/lib/MenuCard.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@RayRedGoose RayRedGoose left a comment

Choose a reason for hiding this comment

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

Just check imports, but otherwise PR looks good! Thanks, Manny 👍

modules/react/collection/lib/ListBox.tsx Outdated Show resolved Hide resolved
modules/react/collection/lib/ListBox.tsx Outdated Show resolved Hide resolved
} as const;
});

const comoboxMenuListStencil = createStencil({
base: {},
extends: menuListStencil,
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

woohoooo

modules/react/menu/lib/MenuCard.tsx Outdated Show resolved Hide resolved
modules/react/menu/lib/MenuList.tsx Outdated Show resolved Hide resolved
@mannycarrera4 mannycarrera4 added automerge and removed ready for review Code is ready for review labels Mar 4, 2024
@alanbsmith alanbsmith merged commit 2281ef0 into Workday:prerelease/major Mar 4, 2024
19 checks passed
@alanbsmith alanbsmith mentioned this pull request May 14, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Select Styles Refactor
4 participants