Skip to content

Commit a0ffd15

Browse files
committed
💄(frontend) add classname to components
To be easily customized, we added a classname to most of the components.
1 parent 8366fc7 commit a0ffd15

File tree

63 files changed

+136
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+136
-36
lines changed

src/frontend/apps/impress/src/components/BoxButton.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const BoxButton = forwardRef<HTMLDivElement, BoxButtonType>(
4444
${$css || ''}
4545
`}
4646
{...props}
47+
className={`--docs--box-button ${props.className || ''}`}
4748
onClick={(event: React.MouseEvent<HTMLDivElement>) => {
4849
if (props.disabled) {
4950
return;

src/frontend/apps/impress/src/components/Card.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const Card = ({
1414

1515
return (
1616
<Box
17+
className={`--docs--card ${props.className || ''}`}
1718
$background="white"
1819
$radius="4px"
1920
$css={css`

src/frontend/apps/impress/src/components/DropButton.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export const DropButton = ({
7171
onPress={() => onOpenChangeHandler(true)}
7272
aria-label={label}
7373
$css={buttonCss}
74+
className="--docs--drop-button"
7475
>
7576
{button}
7677
</StyledButton>
@@ -79,6 +80,7 @@ export const DropButton = ({
7980
triggerRef={triggerRef}
8081
isOpen={isLocalOpen}
8182
onOpenChange={onOpenChangeHandler}
83+
className="--docs--drop-button-popover"
8284
>
8385
{children}
8486
</StyledPopover>

src/frontend/apps/impress/src/components/Icon.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const IconBG = ({ iconName, ...textProps }: IconBGProps) => {
3636
$padding="4px"
3737
$margin="auto"
3838
{...textProps}
39+
className={`--docs--icon-bg ${textProps.className || ''}`}
3940
>
4041
{iconName}
4142
</Text>

src/frontend/apps/impress/src/components/InfiniteScroll.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ export const InfiniteScroll = ({
3030
};
3131

3232
return (
33-
<Box {...boxProps}>
33+
<Box
34+
{...boxProps}
35+
className={`--docs--infinite-scroll ${boxProps.className || ''}`}
36+
>
3437
{children}
3538
<InView onChange={loadMore}>
3639
{!isLoading && hasMore && (

src/frontend/apps/impress/src/components/LoadMoreText.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const LoadMoreText = ({
2020
$align="center"
2121
$gap="0.4rem"
2222
$padding={{ horizontal: '2xs', vertical: 'sm' }}
23+
className="--docs--load-more"
2324
>
2425
<Icon
2526
$theme="primary"

src/frontend/apps/impress/src/components/TextErrors.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ export const TextErrors = ({
2828
const { t } = useTranslation();
2929

3030
return (
31-
<AlertStyled canClose={canClose} type={VariantType.ERROR} icon={icon}>
31+
<AlertStyled
32+
canClose={canClose}
33+
type={VariantType.ERROR}
34+
icon={icon}
35+
className="--docs--text-errors"
36+
>
3237
<Box $direction="column" $gap="0.2rem">
3338
{causes &&
3439
causes.map((cause, i) => (

src/frontend/apps/impress/src/components/quick-search/QuickSearchStyle.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ export const QuickSearchStyle = createGlobalStyle`
119119
}
120120
}
121121
122-
123-
124122
.c__modal__scroller:has(.quick-search-container),
125123
.c__modal__scroller:has(.noPadding) {
126124
padding: 0 !important;
@@ -138,6 +136,4 @@ export const QuickSearchStyle = createGlobalStyle`
138136
margin-bottom: 0;
139137
}
140138
}
141-
142-
143139
`;

src/frontend/apps/impress/src/features/auth/components/ButtonLogin.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@ export const ButtonLogin = () => {
1818
onClick={() => gotoLogin()}
1919
color="primary-text"
2020
aria-label={t('Login')}
21+
className="--docs--button-login"
2122
>
2223
{t('Login')}
2324
</Button>
2425
);
2526
}
2627

2728
return (
28-
<Button onClick={gotoLogout} color="primary-text" aria-label={t('Logout')}>
29+
<Button
30+
onClick={gotoLogout}
31+
color="primary-text"
32+
aria-label={t('Logout')}
33+
className="--docs--button-logout"
34+
>
2935
{t('Logout')}
3036
</Button>
3137
);
@@ -45,6 +51,7 @@ export const ProConnectButton = () => {
4551
}
4652
`}
4753
$radius="4px"
54+
className="--docs--proconnect-button"
4855
>
4956
<ProConnectImg />
5057
</BoxButton>

src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export const BlockNoteEditor = ({ doc, provider }: BlockNoteEditorProps) => {
133133
$padding={{ top: 'md' }}
134134
$background="white"
135135
$css={cssEditor(readOnly)}
136+
className="--docs--editor-container"
136137
>
137138
{errorAttachment && (
138139
<Box $margin={{ bottom: 'big', top: 'none', horizontal: 'large' }}>
@@ -192,7 +193,7 @@ export const BlockNoteEditorVersion = ({
192193
}, [setEditor, editor]);
193194

194195
return (
195-
<Box $css={cssEditor(readOnly)}>
196+
<Box $css={cssEditor(readOnly)} className="--docs--editor-container">
196197
<BlockNoteView editor={editor} editable={!readOnly} theme="light" />
197198
</Box>
198199
);

src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/AIButton.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function AIGroupButton() {
104104
<Components.Generic.Menu.Root>
105105
<Components.Generic.Menu.Trigger>
106106
<Components.FormattingToolbar.Button
107-
className="bn-button bn-menu-item"
107+
className="bn-button bn-menu-item --docs--ai-actions-menu-trigger"
108108
data-test="ai-actions"
109109
label="AI"
110110
mainTooltip={t('AI Actions')}
@@ -116,7 +116,7 @@ export function AIGroupButton() {
116116
/>
117117
</Components.Generic.Menu.Trigger>
118118
<Components.Generic.Menu.Dropdown
119-
className="bn-menu-dropdown bn-drag-handle-menu"
119+
className="bn-menu-dropdown bn-drag-handle-menu --docs--ai-actions-menu"
120120
sub={true}
121121
>
122122
{canAITransform && (
@@ -193,7 +193,7 @@ export function AIGroupButton() {
193193
<Components.Generic.Menu.Root position="right" sub={true}>
194194
<Components.Generic.Menu.Trigger sub={false}>
195195
<Components.Generic.Menu.Item
196-
className="bn-menu-item"
196+
className="bn-menu-item --docs--ai-translate-menu-trigger"
197197
subTrigger={true}
198198
>
199199
<Box $direction="row" $gap="0.6rem">
@@ -206,7 +206,7 @@ export function AIGroupButton() {
206206
</Components.Generic.Menu.Trigger>
207207
<Components.Generic.Menu.Dropdown
208208
sub={true}
209-
className="bn-menu-dropdown"
209+
className="bn-menu-dropdown --docs--ai-translate-menu"
210210
>
211211
{languages.map((language) => (
212212
<AIMenuItemTranslate

src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/FileDownloadButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const FileDownloadButton = ({
9494
return (
9595
<>
9696
<Components.FormattingToolbar.Button
97-
className="bn-button"
97+
className="bn-button --docs--editor-file-download-button"
9898
label={
9999
dict.formatting_toolbar.file_download.tooltip[fileBlock.type] ||
100100
dict.formatting_toolbar.file_download.tooltip['file']

src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/MarkdownButton.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export function MarkdownButton() {
8282
<Components.FormattingToolbar.Button
8383
mainTooltip={t('Convert Markdown')}
8484
onClick={handleConvertMarkdown}
85+
className="--docs--editor-markdown-button"
8586
>
8687
M
8788
</Components.FormattingToolbar.Button>

src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/ModalConfirmDownloadUnsafe.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ export const ModalConfirmDownloadUnsafe = ({
5959
</Text>
6060
}
6161
>
62-
<Box aria-label={t('Modal confirmation to download the attachment')}>
62+
<Box
63+
aria-label={t('Modal confirmation to download the attachment')}
64+
className="--docs--modal-confirm-download-unsafe"
65+
>
6366
<Box>
6467
<Box $direction="column" $gap="0.35rem" $margin={{ top: 'sm' }}>
6568
<Text $variation="700">{t('This file is flagged as unsafe.')}</Text>

src/frontend/apps/impress/src/features/docs/doc-editor/components/DocEditor.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,16 @@ export const DocEditor = ({ doc, versionId }: DocEditorProps) => {
4949
<TableContent />
5050
</Box>
5151
)}
52-
<Box $maxWidth="868px" $width="100%" $height="100%">
53-
<Box $padding={{ horizontal: isDesktop ? '54px' : 'base' }}>
52+
<Box
53+
$maxWidth="868px"
54+
$width="100%"
55+
$height="100%"
56+
className="--docs--doc-editor"
57+
>
58+
<Box
59+
$padding={{ horizontal: isDesktop ? '54px' : 'base' }}
60+
className="--docs--doc-editor-header"
61+
>
5462
{isVersion ? (
5563
<DocVersionHeader title={doc.title} />
5664
) : (
@@ -64,6 +72,7 @@ export const DocEditor = ({ doc, versionId }: DocEditorProps) => {
6472
$width="100%"
6573
$css="overflow-x: clip; flex: 1;"
6674
$position="relative"
75+
className="--docs--doc-editor-content"
6776
>
6877
<Box $css="flex:1;" $position="relative" $width="100%">
6978
{isVersion ? (
@@ -115,7 +124,7 @@ export const DocVersionEditor = ({
115124
}
116125

117126
return (
118-
<Box $margin="large">
127+
<Box $margin="large" className="--docs--doc-version-editor-error">
119128
<TextErrors
120129
causes={error.cause}
121130
icon={

src/frontend/apps/impress/src/features/docs/doc-export/components/ModalExport.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export const ModalExport = ({ onClose, doc }: ModalExportProps) => {
155155
$margin={{ bottom: 'xl' }}
156156
aria-label={t('Content modal to export the document')}
157157
$gap="1rem"
158+
className="--docs--modal-export-content"
158159
>
159160
<Text $variation="600" $size="sm">
160161
{t('Download your document in a .docx or .pdf format.')}

src/frontend/apps/impress/src/features/docs/doc-header/components/DocHeader.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export const DocHeader = ({ doc }: DocHeaderProps) => {
3838
$padding={{ top: isDesktop ? '4xl' : 'md' }}
3939
$gap={spacings['base']}
4040
aria-label={t('It is the card information about the document.')}
41+
className="--docs--doc-header"
4142
>
4243
{(docIsPublic || docIsAuth) && (
4344
<Box

src/frontend/apps/impress/src/features/docs/doc-header/components/DocTitle.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ const DocTitleInput = ({ doc }: DocTitleProps) => {
107107
<Box
108108
as="span"
109109
role="textbox"
110+
className="--docs--doc-title-input"
110111
contentEditable
111112
defaultValue={titleDisplay || undefined}
112113
onKeyDownCapture={handleKeyDown}

src/frontend/apps/impress/src/features/docs/doc-header/components/DocToolBox.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export const DocToolBox = ({ doc }: DocToolBoxProps) => {
176176
$align="center"
177177
$gap="0.5rem 1.5rem"
178178
$wrap={isSmallMobile ? 'wrap' : 'nowrap'}
179+
className="--docs--doc-toolbox"
179180
>
180181
<Box
181182
$direction="row"

src/frontend/apps/impress/src/features/docs/doc-header/components/DocVersionHeader.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const DocVersionHeader = ({ title }: DocVersionHeaderProps) => {
2222
$padding={{ vertical: 'base' }}
2323
$gap={spacings['base']}
2424
aria-label={t('It is the document title')}
25+
className="--docs--doc-version-header"
2526
>
2627
<DocTitleText title={title} />
2728
<HorizontalSeparator />

src/frontend/apps/impress/src/features/docs/doc-management/components/ModalRemoveDoc.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ export const ModalRemoveDoc = ({ onClose, doc }: ModalRemoveDocProps) => {
8484
</Text>
8585
}
8686
>
87-
<Box aria-label={t('Content modal to delete document')}>
87+
<Box
88+
aria-label={t('Content modal to delete document')}
89+
className="--docs--modal-remove-doc"
90+
>
8891
{!isError && (
8992
<Text $size="sm" $variation="600">
9093
{t('Are you sure you want to delete this document ?')}

src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchItem.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ type DocSearchItemProps = {
1111
export const DocSearchItem = ({ doc }: DocSearchItemProps) => {
1212
const { isDesktop } = useResponsiveStore();
1313
return (
14-
<Box data-testid={`doc-search-item-${doc.id}`} $width="100%">
14+
<Box
15+
data-testid={`doc-search-item-${doc.id}`}
16+
$width="100%"
17+
className="--docs--doc-search-item"
18+
>
1519
<QuickSearchItemContent
1620
left={
1721
<Box $direction="row" $align="center" $gap="10px" $width="100%">

src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchModal.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export const DocSearchModal = ({ ...modalProps }: DocSearchModalProps) => {
6868
aria-label={t('Search modal')}
6969
$direction="column"
7070
$justify="space-between"
71+
className="--docs--doc-search-modal"
7172
>
7273
<QuickSearch
7374
placeholder={t('Type the name of a document')}

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareAddMemberList.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export const DocShareAddMemberList = ({
122122
$css={css`
123123
border: 1px solid ${color['greyscale-200']};
124124
`}
125+
className="--docs--doc-share-add-member-list"
125126
>
126127
<Box
127128
$direction="row"

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareAddMemberListItem.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const DocShareAddMemberListItem = ({ user, onRemoveUser }: Props) => {
3434
color: ${color['greyscale-1000']};
3535
font-size: ${fontSize['xs']};
3636
`}
37+
className="--docs--doc-share-add-member-list-item"
3738
>
3839
<Text $variation="1000" $size="xs">
3940
{user.full_name || user.email}

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareInvitationItem.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export const DocShareInvitationItem = ({ doc, invitation }: Props) => {
8484
<Box
8585
$width="100%"
8686
data-testid={`doc-share-invitation-row-${invitation.email}`}
87+
className="--docs--doc-share-invitation-item"
8788
>
8889
<SearchUserRow
8990
isInvitation={true}

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareMemberItem.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export const DocShareMemberItem = ({ doc, access }: Props) => {
7272
<Box
7373
$width="100%"
7474
data-testid={`doc-share-member-row-${access.user.email}`}
75+
className="--docs--doc-share-member-item"
7576
>
7677
<SearchUserRow
7778
alwaysShowRight={true}

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareModal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export const DocShareModal = ({ doc, onClose }: Props) => {
195195
aria-label={t('Share modal')}
196196
$height={canViewAccesses ? modalContentHeight : 'auto'}
197197
$overflow="hidden"
198-
className="noPadding"
198+
className="--docs--doc-share-modal noPadding "
199199
$justify="space-between"
200200
>
201201
<Box

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareModalFooter.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const DocShareModalFooter = ({ doc, onClose }: Props) => {
2020
$css={css`
2121
flex-shrink: 0;
2222
`}
23+
className="--docs--doc-share-modal-footer"
2324
>
2425
<HorizontalSeparator $withPadding={true} />
2526

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareModalInviteUserByEmail.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ type Props = {
1212
export const DocShareModalInviteUserRow = ({ user }: Props) => {
1313
const { t } = useTranslation();
1414
return (
15-
<Box $width="100%" data-testid={`search-user-row-${user.email}`}>
15+
<Box
16+
$width="100%"
17+
data-testid={`search-user-row-${user.email}`}
18+
className="--docs--doc-share-modal-invite-user-row"
19+
>
1620
<SearchUserRow
1721
user={user}
1822
right={

src/frontend/apps/impress/src/features/docs/doc-share/components/DocVisibility.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export const DocVisibility = ({ doc }: DocVisibilityProps) => {
9191
$padding={{ horizontal: 'base' }}
9292
aria-label={t('Doc visibility card')}
9393
$gap={spacing['base']}
94+
className="--docs--doc-visibility"
9495
>
9596
<Text $weight="700" $size="sm" $variation="700">
9697
{t('Link parameters')}

src/frontend/apps/impress/src/features/docs/doc-share/components/SearchUserRow.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ export const SearchUserRow = ({
3131
right={right}
3232
alwaysShowRight={alwaysShowRight}
3333
left={
34-
<Box $direction="row" $align="center" $gap={spacings['xs']}>
34+
<Box
35+
$direction="row"
36+
$align="center"
37+
$gap={spacings['xs']}
38+
className="--docs--search-user-row"
39+
>
3540
<UserAvatar
3641
user={user}
3742
background={isInvitation ? colors['greyscale-400'] : undefined}

0 commit comments

Comments
 (0)