Skip to content

stickerコンポーネントを追加#93

Open
nio-nio-nio wants to merge 21 commits into
mainfrom
add/inhouse-sticker
Open

stickerコンポーネントを追加#93
nio-nio-nio wants to merge 21 commits into
mainfrom
add/inhouse-sticker

Conversation

@nio-nio-nio
Copy link
Copy Markdown
Contributor

@nio-nio-nio nio-nio-nio commented Mar 31, 2026

Stickerコンポーネントの新規追加

概要

Stickerコンポーネントを新規追加します。

変更内容

  • @pepabo-inhouse/sticker パッケージを新規作成
  • @pepabo-inhouse/components-web に統合

対応しているバリエーション

修飾子
カラー neutral, informative, positive, negative, notice, attention .-color-{value}
サイズ xs, s, m, l, xl .-size-{value}

その他

  • スケルトン表示(.in-skeleton-chips)に対応
  • chipと区別するため、区別のため矩形よりの角丸としています
  • 汎用的に利用できるよう、「Fill Only」「Fill Only + Outlined」「Outlined」「Text Only」の4つのappearanceとleading iconを追加しています

Storybook

http://localhost:52171/?path=/story/components-sticker--index&args=color:informative;size:m

@nio-nio-nio nio-nio-nio changed the title Add/inhouse sticker stickerコンポーネントを追加 Mar 31, 2026
@nio-nio-nio nio-nio-nio marked this pull request as ready for review March 31, 2026 06:09
@nio-nio-nio nio-nio-nio requested a review from a team as a code owner March 31, 2026 06:09
@nio-nio-nio nio-nio-nio self-assigned this May 1, 2026
Comment thread packages/sticker/_mixins.scss Outdated
);
padding-block: calc(adapter.get-spacing-size($level: xs) / 2);
padding-inline: adapter.get-spacing-size($level: s);
border-radius: 4px;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

border-radiusもremにしてブラウザ設定の文字サイズに追従するようにしませんか?(文字とかはそうなっているのでborder-radiusだけ変わらなくなってしまう)

あとハードコーディングになってるのはtoken使うようになっている方がInhouseの設計に率直にできてよいですね、そしてsizeに応じて可変じゃなくていいんでしょうか、、(ここはちょっとなんとも言えないのでまず指針から示されると良いですね)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ハードコーディングをtokenを使うように修正をしました。
border-radius�をsizeによって可変にすると、サイズによって見た目が変わるため同じコンポーネントに感じづらいと思い、mサイズで固定をしました。
またそれに伴い、borderも1pxで固定した実装を削除し、デフォルトの0.625rem(1px)が当たるように修正しました。

@mixin -color-style($color, $appearance) {
@if $appearance == fill-only {
color: #fff;
background-color: adapter.get-semantic-color($color, 700);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

多分ここでborderがないのでfill-onlyのappearanceだけ大きさが上下1pxずつの2px小さいんですね

Image

Comment thread packages/sticker/_variables.scss Outdated
Comment on lines +8 to +11
fill-only,
fill-with-outlined,
outlined,
text-only,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

appearanceの名称はなるべく他のButtonなどの要素と近い感じで揃っていた方が良いです!(このコンポーネントだけ違う命名ルール、とかを覚えるのはおそらく煩雑になるので。その辺は生成AIがやるから〜というのもあるけど、こういうprimitiveな要素を組み合わせて試行錯誤する段階では手動でやりたいニーズは普通に考えられるし、そういう段階で命名ルールをいちいちコンポーネントごとに違うのを調べて…とかはまあ煩雑ですよね。)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

名称をflat``tinted``outlined``transparentに変更しました。
fill-with-outlined(薄塗り+ボーダー)は Button に該当する名前がなかったため、MaterialDesign 3で使用されていた1単語で意味が伝わるtintedを採用しました。

{...props}
appearance='fill-only'
body='label'
leading={<Icon className='_icon' icon='heart' />}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

スタイルではなくStorybookについてなのですが、ハートアイコンだとお気に入りボタンみたいな用途として捉えられて使われてしまう(そういうのはchipで)懸念をしたのですがどうでしょう、、
(いやハートアイコンでもお気に入り数を出すだけみたいな用途は考えられるのですが、例えば人のアイコンにしてユーザー数出してる感じ、みたいな方がよりstickerのインタラクション対象ではなく表示だけな性質に近いんじゃないかと)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

人(Person)のアイコンに変更しました。指摘の通りですが、ユーザー数のような典型ユースケースも想像しやすいので、良さそうと思いました。

kunio-terada and others added 4 commits May 11, 2026 16:45
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fill-only → flat, fill-with-outlined → tinted, text-only → transparent

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nio-nio-nio nio-nio-nio requested a review from itoh4126 May 11, 2026 09:56
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.

2 participants