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

Suggested changes for text input pr #5444

Closed
wants to merge 27 commits into from

Conversation

pauloamorimbr
Copy link
Contributor

Draft PR to serve as a reference for changes

Akuukis and others added 26 commits December 11, 2024 17:48
to make it easier to migrate existing styles
### 📣 Summary
Adds theming and storybook entry for Mantine Menu component.

### 📖 Description
Adds basic theming for the Mantine Menu component, primarily aimed at
providing necessary style and functionality for use in the organization
members list. In this context, the Menu component will be replacing
KoboDropdown, but the latter is used, for example, as a building block
of KoboSelect, so not all uses of KoboDropdown are under consideration
here.

### 👀 Preview steps
Run storybook and compare "Dropdown" story to the Actions dropdown
(right side icon button) currently used in the organization Member
table.

---------

Co-authored-by: Paulo Amorim <[email protected]>
@pauloamorimbr pauloamorimbr changed the base branch from task-1378-textinput-component to task-1378-mantine-text-input January 23, 2025 18:51
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe we could use this file as a generic for all the text inputs.... or even create a single "Theme" file for all the text inputs to share the same default props and classes.

.label {
font-size: var(--mantine-font-size-sm);
color: var(--mantine-color-gray-1);
margin-bottom: 5px;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally for any layout definition we would use the style prop with the sizes from Mantine, e.g:
In the TextInput.extend... in the Theme file:
mb="xs"

But Maybe the sizes from Mantine won't serve us as we would expect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of styling the InputWrapper, we can do that with the TextInput, which exposes the .label directly.
IDK, it feels like we have more control by doing it individually... or maybe we could save on code and do it on the extended as it was done before. 🤔

const inputSizes: Array<TextInputProps['size']> = ['sm', 'md', 'lg'];

const Render = ({...args}: TextInputProps) => {
const [, updateArgs] = useArgs();
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 really important, but this way we can edit the value in the input and update the args.

Base automatically changed from task-1378-mantine-text-input to main January 29, 2025 11:38
@pauloamorimbr pauloamorimbr deleted the suggested-changes-for-text-input-pr branch January 29, 2025 14:14
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.

5 participants