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(SideNav): Composition できるように修正 #5157

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Merge branch 'master' into Improve-sidenav-story
masa0527 committed Jan 15, 2025
commit b8cabfac574afd6493da9c2d7de86cd91ecbd1cf
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ export const TenantSelector: FC<Props> = ({ tenants, currentTenantId, onTenantSe

return (
<Dropdown>
{/* eslint-disable-next-line smarthr/a11y-trigger-has-button */}
{}
<DropdownTrigger>
<button type="button" className={tenantDropdownTriggerButton()}>
{tenantName}
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ import { Stack } from '../../../Layout'
import { Text } from '../../../Text'
import { MultiComboBox } from '../MultiComboBox'

// eslint-disable-next-line storybook/prefer-pascal-case
export const defaultItems = {
'option 1': {
label: 'option 1',
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ export const FormDialogContentInner: FC<FormDialogContentInnerProps> = ({
const { form, wrapper, actionArea, buttonArea, message } = formDialogContentInner()

return (
// eslint-disable-next-line smarthr/best-practice-for-layouts, smarthr/a11y-heading-in-sectioning-content
// eslint-disable-next-line smarthr/best-practice-for-layouts
<Stack gap={0} as={Section} className={wrapper()}>
<DialogHeader title={title} subtitle={subtitle} titleTag={titleTag} titleId={titleId} />
<form onSubmit={handleSubmitAction} className={form()}>
Original file line number Diff line number Diff line change
@@ -59,14 +59,18 @@ export const SideNavItemButton: FC<Props & ElementProps> = ({
id,
title,
prefix,
isSelected = false,
size = 'default',
isSelected,
size,
onClick,
children,
}) => {
const handleClick = onClick
? (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => onClick(e, id)
: undefined
const handleClick = useMemo(
() =>
onClick
? (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => onClick(e, e.currentTarget.value)
: undefined,
[onClick],
)

const { wrapperStyle, buttonStyle, buttonInnerStyle } = useMemo(() => {
const { wrapper, button, buttonInner } = sideNavItem()
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable smarthr/a11y-input-has-name-attribute */
/* eslint-disable smarthr/a11y-prohibit-input-placeholder */
/* eslint-disable smarthr/a11y-input-in-form-control */
import { userEvent, within } from '@storybook/test'
import dayjs from 'dayjs'
import React from 'react'
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable smarthr/a11y-input-in-form-control */
import { userEvent, within } from '@storybook/test'
import dayjs from 'dayjs'
import React from 'react'
You are viewing a condensed version of this merge commit. You can view the full changes here.