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

Add TooltipPrimitive and DialogPrimitive components via radix-ui #2049

Merged
merged 17 commits into from
Mar 19, 2024

Conversation

sungik-choi
Copy link
Contributor

@sungik-choi sungik-choi commented Mar 4, 2024

Self Checklist

  • I wrote a PR title in English and added an appropriate label to the PR.
  • I wrote the commit message in English and to follow the Conventional Commits specification.
  • I added the changeset about the changes that needed to be released. (or didn't have to)
  • I wrote or updated documentation related to the changes. (or didn't have to)
  • I wrote or updated tests related to the changes. (or didn't have to)
  • I tested the changes in various browsers. (or didn't have to)
    • Windows: Chrome, Edge, (Optional) Firefox
    • macOS: Chrome, Edge, Safari, (Optional) Firefox

Related Issue

Summary

  • radix-ui의 Tooltip, Dialog 래퍼 컴포넌트인 TooltipPrimitive, DialogPrimitive 컴포넌트를 추가합니다. 사용처에서 Tooltip, Dialog의 동작만 필요한 경우 스타일 오버라이드 없이 radix-ui의 동작을 그대로 가져다가 사용하기 위해 추가했습니다. 사용처에서 radix-ui를 설치하여 사용할 수 있지만, bezier-react 컴포넌트들간 동일한 버전의 radix-ui 패키지를 사용하여, 미래에 버전이 달라서 발생할 수 있는 문제를 사전에 막고자 했습니다.
  • /alpha 디렉토리에서 실험적인 알파 버전 컴포넌트에 접근하여 사용할 수 있도록 빌드 설정을 변경했습니다. 추후에도 Alpha prefix를 붙이는 대신 해당 디렉토리에 컴포넌트를 추가하는 방식으로 변경하고자 합니다. (TODO: 문서 수정)
  • 이후 LegacyTooltip 을 제거하고 애플리케이션의 사용처를 TooltipPrimitive 로 대체할 수 있을 거 같습니다.

Details

고민했던 점들

  • 왜 모든 radix-ui primitive 컴포넌트들을 export하지 않았는가 : 채널 애플리케이션에서 필요한 경우 추가해도 무방하다고 생각했습니다. 사용할지 안할지도 모르는 컴포넌트를 추가해버리면 불필요한 Breaking change만 발생합니다.
  • 왜 Tooltip/DialogPrimitive에 z-index를 추가해서 export하지 않았는가 : z-index token을 적용한 채로 export하는 것을 고민했으나, 헤드리스 컴포넌트라는 점을 고려했을 때 토큰과의 의존성을 제거하는 게 컴포넌트의 역할에 더 적절하다고 생각했습니다. 필요하다면 추후에 추가하려고 합니다.
  • 단위 테스트와 스토리북?: 단위 테스트를 추가한다면 동작을 어디까지 테스트해야하는지 고민입니다. primitive의 일부 기능만 사용한 컴포넌트라면 해당 기능만 테스트하면 될텐데, radix-ui를 그대로 export한 컴포넌트라면 어디까지 동작을 보장해야하는지(어떤 방식으로 사용될 지 모르므로) 의문입니다. 스토리북은 radix-ui의 문서를 참고하는 게 더 유용할 거라 생각했습니다.

Breaking change? (Yes/No)

No

References

@sungik-choi sungik-choi self-assigned this Mar 4, 2024
Copy link

changeset-bot bot commented Mar 4, 2024

🦋 Changeset detected

Latest commit: 8165eb0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@channel.io/bezier-react Minor
bezier-figma-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Mar 4, 2024

Chromatic Report

🚀 Congratulations! Your build was successful!

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 97.22222% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 87.50%. Comparing base (63c2353) to head (217272f).

❗ Current head 217272f differs from pull request most recent head 8165eb0. Consider uploading reports for the commit 8165eb0 to get more accurate results

Files Patch % Lines
...act/src/alpha-components/TooltipPrimitive/index.ts 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #2049      +/-   ##
==========================================
+ Coverage   87.38%   87.50%   +0.11%     
==========================================
  Files         122      126       +4     
  Lines        2512     2544      +32     
  Branches      785      784       -1     
==========================================
+ Hits         2195     2226      +31     
- Misses        287      288       +1     
  Partials       30       30              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +29 to +35
"typesVersions": {
"*": {
"alpha": [
"./dist/types/alpha-components/index.d.ts"
]
}
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

사용처의 tsconfig moduleResolutionnodenext 혹은 node16 이 아니라면 submodule의 타입 선언이 제대로 적용되지 않는 문제가 있습니다. typesVersions 필드로 리다이렉션하여 moduleResolution 속성값에 상관없이 타입 선언이 잘 적용되도록 합니다.

@sungik-choi sungik-choi added the feat:component Issue or PR related to a new component label Mar 18, 2024
@sungik-choi sungik-choi changed the title [WIP, PoC] Add CheckboxPrimitive and DialogPrimitive via radix-ui Add TooltipPrimitive and DialogPrimitive via radix-ui Mar 18, 2024
@sungik-choi sungik-choi changed the title Add TooltipPrimitive and DialogPrimitive via radix-ui Add TooltipPrimitive and DialogPrimitive components via radix-ui Mar 18, 2024
@sungik-choi sungik-choi marked this pull request as ready for review March 18, 2024 10:27
@sungik-choi
Copy link
Contributor Author

Tooltip의 경우, 성능을 위해 TooltipProvider를 내부에 포함하는 형태로 추상화하여 제공하는 것도 옵션 (#1974)

@yangwooseong
Copy link
Collaborator

Tooltip의 경우, 성능을 위해 TooltipProvider를 내부에 포함하는 형태로 추상화하여 제공하는 것도 옵션 (#1974)

일관성을 위해서 지금처럼 있는 그대로 export 하는 것도 방법일 것 같아요. 어떤 것은 wrapping 을 하고 어떤 것은 안하면 사용자입장에서는 예측하기 어려울 것 같다는 생각이 들어서요.

@sungik-choi sungik-choi merged commit 9802f9c into channel-io:alpha Mar 19, 2024
9 checks passed
@sungik-choi sungik-choi deleted the feat/primitives branch March 19, 2024 07:08
sungik-choi pushed a commit that referenced this pull request Mar 19, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to alpha, this PR
will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`alpha` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `alpha`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## @channel.io/bezier-react@2.0.0-alpha.20

### Major Changes

- **Breaking Changes: `AlphaSmoothCornersBox` component is now
`SmoothCornersBox` component.**
([#2079](#2079)) by
@sungik-choi

### Minor Changes

- Add the `TooltipPrimitive` component, which is the same as the
[`Tooltip` component in
radix-ui](https://www.radix-ui.com/primitives/docs/components/tooltip).
You can use it by importing it from the `/alpha` path.
([#2049](#2049)) by
@sungik-choi

    ```tsx
    import {
      TooltipPrimitive,
      TooltipPrimitiveArrow,
      TooltipPrimitiveContent,
      TooltipPrimitivePortal,
      TooltipPrimitiveProvider,
      TooltipPrimitiveTrigger,
    } from "@channel.io/bezier-react/alpha";
    ```

- Add the `DialogPrimitive` component, which is the same as the
[`Dialog` component in
radix-ui](https://www.radix-ui.com/primitives/docs/components/dialog).
You can use it by importing it from the `/alpha` path.
([#2049](#2049)) by
@sungik-choi

    ```tsx
    import {
      DialogPrimitive,
      DialogPrimitiveClose,
      DialogPrimitiveContent,
      DialogPrimitiveDescription,
      DialogPrimitiveOverlay,
      DialogPrimitivePortal,
      DialogPrimitiveTitle,
      DialogPrimitiveTrigger,
    } from "@channel.io/bezier-react/alpha";
    ```

## bezier-figma-plugin@0.5.0-alpha.8

### Patch Changes

- Enhance icon extract logic by catching error
([#2073](#2073)) by
@yangwooseong

-   Updated dependencies
    -   @channel.io/bezier-react@2.0.0-alpha.20

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
sungik-choi pushed a commit that referenced this pull request Mar 26, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @channel.io/bezier-react@2.0.0

### Major Changes

- **Breaking Changes: Property updates in `Avatar` component**
([#1871](#1871)) by
@yangwooseong

No longer support `interpolation` property. Replace any usage of
`interpolation` property with appropriate `style` or `className`
implementations.

- **Breaking changes: Remove TagBadge-related types**
([#2114](#2114)) by
@sungik-choi

    -   Remove `color` prop of `TagProps` and `TagBadgeBgColorPreset`.
- Remove `TagBadgeSize`. Please change it to `TagSize` and `BadgeSize`.
- Remove `TagBadgeVariant`. Please change it to `TagVariant` and
`BadgeVariant`.

- **Breaking Changes: Property updates in `SegmentedControl` component**
([#1866](#1866)) by
@sungik-choi

No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.

- **Breaking Changes: Property updates in `ListItem` component**
([#1925](#1925)) by
@sungik-choi

- No longer support `interpolation` property. Replace any usage of
`interpolation` property with appropriate `style` or `className`
implementations.
- No longer support `iconStyle`, `iconClassName`, `iconInterpolation`,
`contentStyle`, `contentClassName` and `contentInterpolation`. This
decision was made to reduce excessive flexibility in the interface.
- No longer support `leftIcon` property. Removed for consistency with
other component interfaces. Replace it to `leftContent`.
- No longer support `name` property. The second argument (name) of
`onClick` is also removed. If you need an identifier, combine functions
outside of the component.
- No longer support `hide`, `nested`, `optionKey` and
`disableIconActive` property. Removed because it is a legacy property.
Replace `hide` property with conditional rendering.
- The size changes according to the `ListItemSize`. This is a change to
unify the design. Please change it like below.
        -   `ListItemSize.S` -> `ListItemSize.XS`
        -   `ListItemSize.M` -> `ListItemSize.S`
        -   `ListItemSize.L` -> `ListItemSize.M`
        -   `ListItemSize.XL` -> `ListItemSize.L`

    **Minor Changes:**

    -   Fix incorrect text size for `XL`(now `L`) size.

- **Breaking Changes: Property updates in `Overlay` component**
([#1949](#1949)) by
@sungik-choi

- No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.
- No longer support `containerInterpolation` property. Replace any usage
of `containerInterpolation` property with appropriate `containerStyle`
or `containerClassName` implementations.
    -   No longer support `wrapperTestId` property.

- **Breaking Changes: Remove `TooltipProvider` and Property updates in
`Tooltip` component**
([#1974](#1974)) by
@sungik-choi

- No longer support `TooltipProvider` and `TooltipProviderProps`.
`Tooltip` component was implemented via radix-ui's Tooltip, which
required the use of a `TooltipProvider`, which caused all subcomponents
to be re-rendered and caused a performance hit. We decided that the
ability to share hover delay time between `Tooltip` components via
`TooltipProvider` was not a feature we needed, even with the performance
penalty. Also, by providing `TooltipProvider` built-in to `AppProvider`,
we were unnecessarily importing modules from our library usage that
didn't require `Tooltip`.
    -   `Tooltip` component now contains a `TooltipProvider` inside it.

    **Minor Changes:**

    -   Change the default value of `delayShow` prop from `300` to `0`.

- **Breaking Changes: Property updates in `Tag` and `Badge` component**
([#1872](#1872)) by
@yangwooseong

No longer support `interpolation` property. Replace any usage of
`interpolation` property with appropriate `style` or `className`
implementations.

- **Breaking Changes: Property updates in `CheckableAvatar` component**
([#1921](#1921)) by
@sungik-choi

No longer support `interpolation` property. Replace any usage of
`interpolation` property with appropriate `style` or `className`
implementations.

- **Breaking Changes: `AlphaSmoothCornersBox` component is now
`SmoothCornersBox` component.**
([#2079](#2079)) by
@sungik-choi

- **Breaking Changes: Property updates in `LegacyTooltip` component**
([#1945](#1945)) by
@sungik-choi

- No longer support `interpolation` property. Replace any usage of
`interpolation` property with appropriate `style` or `className`
implementations.
- No longer support `contentInterpolation` property. Replace any usage
of `contentInterpolation` property with appropriate `contentStyle` or
`contentClassName` implementations.
- No longer support `contentWrapperInterpolation` property. Replace any
usage of `contentWrapperInterpolation` property with appropriate
`contentWrapperStyle` or `contentWrapperClassName` implementations.

- **Breaking Changes: `AlphaCenter` component is now `Center` component.
Property updates in `Center` component**
([#1854](#1854)) by
@sungik-choi

- No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.
    -   Now supports margin props, layout props and `display` prop.

- **Breaking Changes: Property updates in `FormLabel`, `FormHelperText`,
and `FormErrorMessage` component**
([#1893](#1893)) by
@yangwooseong

No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.

- **Breaking Changes: Property updates in `NavGroup` and `NavItem`
component**
([#1931](#1931)) by
@sungik-choi

`leftIcon` renamed to `leftContent`. Changed to improve consistency of
interface property names across libraries.

- **Breaking Changes: The enum type that the component receives as props
is changed to a string (or number) literal type**
([#2059](#2059)) by
@yangwooseong

    The properties that change are:

    -   `AvatarGroupEllipsisType`
    -   `IconSize`
    -   `LegacyTooltipPosition`
    -   `ModalTitleSize`
    -   `OverlayPosition`
    -   `ProgressBarSize`, `ProgressBarVariant`
    -   `SpinnerSize`
    -   `SwitchSize`
    -   `TagBadgeSize`, `TagBadgeVariant`
    -   `TextAreaHeight`
    -   `TextFieldSize`, `TextFieldVariant`
    -   `ToastPlacement`, `ToastAppearance`, `ToastPreset`
    -   `TooltipPosition`

Also, `SpinnerThickness` props of `Spinner` is not supported any more.

When changed to string literal type, it is changed to the kebab-cased
value of enum. e.g. `TooltipPosition.TopCenter` -> `top-center`. Among
the above enums, `TextAreaHeight` is converted to number literal type.
e.g. `TextAreaHeight.Row16` -> `16`, and `IconSize.normal` is converted
to `m` for consistency

- **Breaking Changes: Property updates in `FormControl`, `Select`, and
`TextField` component**
([#1948](#1948)) by
@yangwooseong

- `FormControl` component no longer supports `leftLabelWrapperHeight`
props.
- `FormControl` component now supports `size` props, which is passed as
context to the child component such as `TextField` and `Select` and
specified as the size property.
- The size property of `Select` and `TextField` component changes from
enum to string literal union type. Also, `SelectSize` and
`TextFieldSize` enum are deprecated.

- **Breaking changes: Remove `testId` and related properties**
([#1971](#1971)) by
@sungik-choi

No longer supports `testId` and related properties(e.g.
`wrapperTestId`). `testId` is a property used internally by the library
for testing with testing-library (`getByTestId`). We don't see a need to
expose this as a public API, so we remove it.

If you were using it, please replace it with the `data-testid` property.
See <https://testing-library.com/docs/queries/bytestid/>.

- **Breaking Changes: Property updates in `FormControl` component**
([#1935](#1935)) by
@yangwooseong

No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.

- **Breaking Changes: Property updates in `Select` component**
([#1913](#1913)) by
@sungik-choi

- No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.
- No longer support `dropdownInterpolation` property. Replace any usage
of `dropdownInterpolation` property with appropriate `dropdownStyle` or
`dropdownClassName` implementations.
- The type of `zIndex` property is changed to a z-index token. (e.g.
`"modal"`)

- **Breaking Changes: Reorganizing `SectionLabel` component**
([#1936](#1936)) by
@sungik-choi

`SectionLabel` is a complex component that can be used both in the form
of an accordion and as a simple heading. To better meet the needs of
both, we've changed the internal implementation of the component.

We've also made changes to make styling overrides as predictable as they
are for other components. The style override property, which was
unnecessarily open, is now removed.

- Remove the internal div wrapper. `style`, `className` properties are
now injected into the component instead of the old `wrapperStyle`,
`wrapperClassName`.
- No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.
- No longer support additional style properties of `wrapper`,
`contentWrapper`, `leftWrapper` and `rightWrapper`.
- No longer support `divider` property. Replace it by adding `Divider`
component to the component's before.
- The side content property is changed. It is no longer possible to
override `iconColor`.
- When injecting `onClick` handler, the root element now behaves as a
`button` element. This change is to better support keyboard focus
control.

- **Breaking Changes: Property updates in `Emoji` component**
([#1881](#1881)) by
@yangwooseong

No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.

- **Breaking Changes: Property updates in `Radio` component**
([#1923](#1923)) by
@sungik-choi

No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.

- **Breaking Changes: Deprecated modules for internal use**
([#1963](#1963)) by
@sungik-choi

    -   No longer provides `useEventHandler` and `useMergeRefs` hook.
- No longer provides `useId` hook. Use `useId` hook of `react` instead.
- No longer provides `getRootElement` hook. Use `useWindow` hook
instead.
    -   No longer provides `StyleUtils` and `StringUtils` utils.

- **Breaking Changes: Property updates in `ProgressBar` component**
([#1947](#1947)) by
@sungik-choi

- No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.
- No longer support `activeStyle`, `activeClassName` and
`activeInterpolation` property.
    -   No longer support `activeTestId` property.

- **Breaking Changes: Property updates in `Tabs`-related components**
([#1960](#1960)) by
@sungik-choi

No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.

- **Breaking Changes: Property updates in `Text` component**
([#1820](#1820)) by
@sungik-choi

`typo` prop in the `Text` component has been changed to accept only
string literals in order to simplify the API and improve the
predictability of text styling, particularly in the context of the
removal of `styled-components` from `bezier-react`, which has led to the
unavailability of CSS Interpolation.

    **Migration Instructions:**

Use
[`v2-text-component-interface`](https://github.com/channel-io/bezier-react/tree/alpha/packages/bezier-codemod#change-interface-of-text)
transformer from `bezier-codemod` for automated migration.

- **Breaking Changes: Reorganizing `KeyValueListItem` component**
([#1941](#1941)) by
@sungik-choi

    -   **Renamed to `KeyValueItem`.**
- - No longer support `interpolation` property. Replace any usage of
`interpolation` property with appropriate `style` or `className`
implementations.
- No longer support `valueWrapperStyle`, `valueWrapperClassName`,
`valueWrapperInterpolation`, `keyWrapperStyle`, `keyWrapperClassName`
and `keyWrapperInterpolation`. This decision was made to reduce
excessive flexibility in the interface.
- No longer support `AdditionalColorProps` and `show` property of
ItemAction.
- The icon inside ItemAction is now implemented through `Button`
component.
- The Value Container will now always have 100% of the parent's width.

- Add new margin properties to `Icon` component
([#1863](#1863)) by
@yangwooseong

    -   `margin`
    -   `marginHorizontal`
    -   `marginVertical`

- **Breaking Changes: Property updates in `NavItem` and `NavGroup`
component**
([#1905](#1905)) by
@yangwooseong

No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.

- **Breaking Changes: The enum type that the component receives as props
is changed to a string literal type**
([#2059](#2059)) by
@yangwooseong

    The properties that change are:

    -   `AvatarSize`
    -   `BannerVariant`
    -   `ButtonColorVariant`, `ButtonStyleVariant`, `ButtonSize`
    -   `EmojiSize`
    -   `SegmentedControlSize`
    -   `TabSize`
    -   `ListItemVariant`, `ListItemSize`
    -   `StatusType`, `StatusSize`

When changed to string literal type, it is changed to the kebab-cased
value of enum. e.g. `ButtonStyleVariant.MonoChromeDark` ->
`monochrome-dark`, `StatusType.OnlineCrescent` -> `online-crescent`

- **Breaking Changes: Property updates in `Modal`-related components**
([#1903](#1903)) by
@sungik-choi

    -   No longer supports `as` and `interpolation` props.
- The type of `zIndex` property is changed to a z-index token. (e.g.
`"modal"`)

- **Breaking Change: Removal of `LegacySegmentedControl` Component**
([#1786](#1786)) by
@sungik-choi

We have removed the `LegacySegmentedControl` component from our library.
This change follows its deprecation in `next-v1.204`.

    **Reasons for Removal:**

    -   To enhance web accessibility and improve keyboard navigation.
- To align with our goals of design modernization and consistent user
experience.

    **Impact:**

`LegacySegmentedControl` component is no longer available and cannot be
used in your projects. Replace all instances of `LegacySegmentedControl`
with `SegmentedControl` component.

- **Breaking Changes: Property updates in `LegacyStack` components**
([#1944](#1944)) by
@sungik-choi

- No longer support `interpolation` property. Replace any usage of
`interpolation` property with appropriate `style` or `className`
implementations.
    -   No longer export `AxisAlignment` type.

- **Breaking Changes: Property updates in `TextField` component**
([#1904](#1904)) by
@sungik-choi

- No longer support `interpolation`-related properties. Replace any
usage of `interpolation` -related properties with appropriate `***style`
or `***className` implementations.
- No longer support `inputStyle` and `inputClassName` properties.
Replace any usage of `inputStyle` and `inputClassName` with appropriate
`style` or `className` implementations.
    -   Change the value of `TextFieldVariant` enum value to string.

- **Breaking Changes: Remove the default offset(`GNB_WIDTH`) in
`Toast`**
([#2117](#2117)) by
@sungik-choi

Remove the style because it was dependent on a specific application. Use
`{ left: 68 }` instead.

- **Breaking Changes: Property updates in `Banner` component**
([#1891](#1891)) by
@sungik-choi

No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.

    **Other changes in `Banner` component**

    -   now supports HTML attributes.
    -   now supports style props.

- **Breaking Change: Removal of `LegacyRadio` Component**
([#1943](#1943)) by
@sungik-choi

- `LegacyRadio` component has been removed from the library. Please use
`RadioGroup` and `Radio` component instead.
- Now if `Radio` has no label, its size is reduced by an indicator.

- **Breaking Changes: Property updates in `Checkbox` component**
([#1918](#1918)) by
@sungik-choi

No longer support `interpolation` property. Replace any usage of
`interpolation` property with appropriate `style` or `className`
implementations.

- **Breaking Changes: Property updates in `Switch` component**
([#1885](#1885)) by
@yangwooseong

No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.

- Export the css style sheet for the new design system.
([#1492](#1492)) by
@sungik-choi

- **Breaking Changes: Reorganizing `OutlineItem` component**
([#1930](#1930)) by
@sungik-choi

`OutlineItem` component was originally designed as a component to draw a
tree-like view, _but it was not used as intended in production_. We
simplified the component's responsibilities by removing unused
properties while retaining the component's ability to apply indentation
to subcomponents.

- No longer support `paddingLeft` property. **By default, 6px of left
padding has been added.** If you need to make changes, override the
style.
- No longer support `interpolation` property. Replace any usage of
`interpolation` property with appropriate `style` or `className`
implementations.
- No longer support `iconStyle`, `iconClassName`, `iconInterpolation`,
`contentStyle`, `contentClassName` and `contentInterpolation`. This
decision was made to reduce excessive flexibility in the interface.
- No longer support `leftIcon` property. Removed for consistency with
other component interfaces. Replace it to `leftContent`.
    -   No longer support `leftIconColor` and `leftIconTestId` property.
- No longer support `name` property. The second argument (name) of
`onClick` is also removed. If you need an identifier, combine functions
outside of the component.
- No longer support `hide`, `optionKey` and `disableIconActive`
property. Replace `hide` property with conditional rendering.
- No longer support `onOpen`, `onClickArrow`, `selectedOutlineItemIndex`
and `onChangeOption` property.

- **Breaking Changes: Property updates in `Slider` component**
([#1883](#1883)) by
@yangwooseong

- No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.
- `dir` type is narrowed from `string | undefined` to `ltr | rtl |
undefined`

- **Breaking Changes: Property updates in `Button` component**
([#1882](#1882)) by
@sungik-choi

- No longer support `interpolation` property. Replace any usage of
`interpolation` property with appropriate `style` or `className`
implementations.
- `ButtonSize` and `ButtonColorVariant` enums have been updated to use
kebab case.

- **Breaking Change: No longer supports `smoothCorners` mixin. Use
`AlphaSmoothCornersBox` components instead.**
([#1892](#1892)) by
@sungik-choi

    ```tsx
    // Before
    const Box = styled.div`
      ${smoothCorners({
        borderRadius: 10,
        shadow: '0 5px 15px 0 var(--shdw-large)',
        shadowBlur: 15,
        backgroundColor: 'var(--bgtxt-absolute-white-dark)',
        hasBackgroundImage: true,
      })}
    `

    <Box>...</Box>

    // After
    <AlphaSmoothCornersBox
      borderRadius={10}
      shadow={{
        offsetX: 0,
        offsetY: 5,
        blurRadius: 15,
        spreadRadius: 0,
        color: 'shdw-large',
      }}
      backgroundColor="bgtxt-absolute-white-dark"
      backgroundImage="..."
    >...</AlphaSmoothCornersBox>
    ```

- **Breaking Changes: `Toast`-related modules**
([#1950](#1950)) by
@sungik-choi

- No longer support `actionContent` and `onClick` properties in
`ToastOptions`.
- Value type of `zIndex` property in `ToastOptions` is changed from
`number` to `ZIndex` token.
    -   No longer export `ToastIconColor` enum.

- **Breaking Changes: Property updates in `TextArea` component**
([#1914](#1914)) by
@sungik-choi

- No longer support `as` and `interpolation` property. Replace any usage
of `interpolation` property with appropriate `style` or `className`
implementations.
- No longer support `wrapperStyle`, `wrapperClassName` and
`wrapperInterpolation` property. It was never properly implemented
before, and the Wrapper element inside was also removed.

- **Breaking Changes: Deprecate support for `styled-components` related
modules**
([#1962](#1962)) by
@sungik-choi

- No longer support legacy foundation modules. Use the `useToken` hook
and components to replace it
        -   `LightFoundation` and `DarkFoundation`
        -   `Spacing`
        -   `ev1`, `ev2`, `ev3`, `ev4`, `ev5` and `ev6`
- `createThemes`, `Theme`, `SemanticNames`, `LightTheme` and `DarkTheme`
        -   `TransitionDuration` and `Transition`
        -   `Border`
- `Typography`, `TypoAbsoluteNumber`, `LineHeightAbsoluteNumber` and
`TypographyType`
- `absoluteCenter`, `disableAutoMinimum`, `hideScrollbars` and
`ellipsis`
        -   `ThemeVarsAdditionalType` and `ThemeVars`
        -   `GlobalStyle`
        -   `Foundation`
        -   `GlobalStyleProp`
- `createGlobalStyle`, `styled`, `css`, `FoundationProvider`,
`useFoundation`, `keyframes`, `StyleSheetManager` and `ServerStyleSheet`
- No longer support `BezierProvider`. Use the `AppProvider` instead
- No longer support `gap` and `touchableHover` mixins. Please implement
and use your own

    ```tsx
    function gap(spacing: number): InjectedInterpolation {
      return css`
        gap: ${spacing}px;

        @supports not (gap: ${spacing}px) {
          margin-top: ${-spacing}px;
          margin-left: ${-spacing}px;

          > * {
            margin-top: ${spacing}px;
            margin-left: ${spacing}px;
          }
        }
      `;
    }

    function touchableHover(
      interpolation: InjectedInterpolation,
    ): InjectedInterpolation {
      return css`
        @media (hover: hover) {
          &:hover {
            ${interpolation}
          }
        }

        @media (hover: none) {
          &:active {
            ${interpolation}
          }
        }
      `;
    }
    ```

- No longer support `inputTextStyle`, `inputPlaceholderStyle`,
`inputWrapperStyle`, `focusedInputWrapperStyle` and
`erroredInputWrapperStyle`. Please migrate using
`@channel.io/bezier-codemod`'s `v2-interpolation-to-css-variable`
transformer.

- **Breaking Changes: `AlphaStack` component has been changed to a
`Stack` component, and `Stack` component has been changed to
`LegacyStack` component.**
([#1837](#1837)) by
@sungik-choi

Changes to remove the dependency of `Stack` and `StackItem` to allow
stack layouts to be configured without additional DOM elements. And
improved the existing `AlphaStack` to support more Flex layout related
properties like reverse, wrap, and more align options, etc. See
StackProps for more information.

We also added new `HStack` and `VStack` components, which are shorthand
components that fix the direction prop of `AlphaStack`. As mentioned
above, the existing components become `LegacyHStack`, `LegacyVStack`.

The layout implemented by `StackItem` can be partially replaced by the
Layout component's `grow`, `shrink` common properties and margin common
properties. Note that the `align`, `justify` (align-self, justify-self
in CSS flex) properties provided by `StackItem` are not provided by the
Layout component.

    ```jsx
    /* AS-IS */
    return (
      <Stack
        direction="horizontal"
        spacing={8}
        style={{ width: 300, height: 50 }}
      >
        <StackItem grow shrink weight={1} />
        <StackItem weight={0} size={10} marginBefore={20}>
          <Stack direction="vertical" />
        </StackItem>
      </Stack>
    );

    /* TO-BE */
    return (
      <Stack direction="horizontal" spacing={8} width={300} height={50}>
        <Box grow={1} shrink={1} />
        <Stack direction="vertical" shrink={0} width={10} ml={12} />
      </Stack>
    );
    ```

The changes also apply to other components that use `Stack` internally,
and there are a few breaking changes.

- `RadioGroup`, `ButtonGroup`, `FormGroup` no longer support `as` prop.

- **Breaking Change: Removal of `ListMenuTitle` Component**
([#1900](#1900)) by
@yangwooseong

    -   It was no longer being managed or utilized by our designers.
- If you are currently using `ListMenuTitle` in your application, please
replace it with the `SectionLabel` component for similar functionality.

### Minor Changes

- Implement multi theme feature based on data attributes
([#1756](#1756)) by
@sungik-choi

- Move `@channel.io/bezier-tokens` from dev depdency to dependency
([#1985](#1985)) by
@sungik-choi

- Add the `TooltipPrimitive` component, which is the same as the
[`Tooltip` component in
radix-ui](https://www.radix-ui.com/primitives/docs/components/tooltip).
You can use it by importing it from the `/alpha` path.
([#2049](#2049)) by
@sungik-choi

    ```tsx
    import {
      TooltipPrimitive,
      TooltipPrimitiveArrow,
      TooltipPrimitiveContent,
      TooltipPrimitivePortal,
      TooltipPrimitiveProvider,
      TooltipPrimitiveTrigger,
    } from "@channel.io/bezier-react/alpha";
    ```

- When you pass a value of number type to the dimension-related
properties of margin prop and layout prop, they implicitly add px units
as a suffix. See:
<https://react.dev/reference/react-dom/components/common#common>
([#1823](#1823)) by
@sungik-choi

- Add `Box` component. `Box` component is responsible for the primitive
layout and provides easy access to the design tokens in the design
system ([#1785](#1785))
by @sungik-choi

    ```tsx
<Box width="100px" height="100px" p="6px" m="6px"
bgColor="bg-black-light" />
    ```

- Fixes style inheritance issues by explicitly giving CSS custom
properties an initial value
([#1846](#1846)) by
@sungik-choi

- Apply bezier-tokens to bezier-react's style sheet and fix some invalid
css selector
([#1495](#1495)) by
@sungik-choi

- Add the `DialogPrimitive` component, which is the same as the
[`Dialog` component in
radix-ui](https://www.radix-ui.com/primitives/docs/components/dialog).
You can use it by importing it from the `/alpha` path.
([#2049](#2049)) by
@sungik-choi

    ```tsx
    import {
      DialogPrimitive,
      DialogPrimitiveClose,
      DialogPrimitiveContent,
      DialogPrimitiveDescription,
      DialogPrimitiveOverlay,
      DialogPrimitivePortal,
      DialogPrimitiveTitle,
      DialogPrimitiveTrigger,
    } from "@channel.io/bezier-react/alpha";
    ```

- `ButtonGroup` now supports HTML attributes
([#1890](#1890)) by
@sungik-choi

- `Banner` will now render content even if the `content` prop is not a
string. The same applies to link-related props.
([#1972](#1972)) by
@sungik-choi

- Rename `AlphaAppProvider` to `AppProvider`
([#1834](#1834)) by
@sungik-choi

- Rename the `style.css` file to `styles.css`
([#1791](#1791)) by
@sungik-choi

- Add `align` prop to `Text` component. This prop is used to set
horizontal alignment of text
([#1820](#1820)) by
@sungik-choi

    ```tsx
    <Text align="left" />
    <Text align="center" />
    <Text align="right" />
    ```

- Remove `borderStyle` prop from Layout props
([#1848](#1848)) by
@sungik-choi

- Add `useRootElement` hook. It is only available to `WindowProvider`
children, and provides easy access to the root element of window context
value. ([#1981](#1981))
by @sungik-choi

    ```tsx
    const { window, document, rootElement } = useWindow();
    // Same as useWindow().rootElement
    const rootElement = useRootElement();
    ```

### Patch Changes

- Fixes an issue with color inheritance across components.
([#2009](#2009)) by
@sungik-choi

- Add missing default margin styles of `LegacyStackItem`
([#2004](#2004)) by
@sungik-choi

- Fixes issue with `ModalBody`, `ModalFooter` not applying styling
correctly when wrapped in other elements.
([#2017](#2017)) by
@sungik-choi

- Add `overflow: hidden` to `ListItem` component
([#2013](#2013)) by
@yangwooseong

- Fix invalid `aria-modal` value in Modal Content.
([#2052](#2052)) by
@sungik-choi

- Fix `TabAction` typography style for size M.
([#2035](#2035)) by
@sungik-choi

- Minify the CSS output
([#1791](#1791)) by
@sungik-choi

- Update background color of `TextField`'s secondary variant.
([#2016](#2016)) by
@sungik-choi

- Mute the error of `smoothCornerScript` when called twice.
([#2010](#2010)) by
@chaejunlee

- Now exports the `tokens` object from `@channel.io/bezier-tokens`.
([#1992](#1992)) by
@sungik-choi

- Adds icon and typo size for avatar size `"72"`, which were missing
from `AvatarGroup`.
([#2071](#2071)) by
@sungik-choi

- Add missing `overflow: hidden` style to item wrapper of `KeyValueItem`
component.
([#2036](#2036)) by
@sungik-choi

- Fixes `Overlay` not closing in other windows.
([#2037](#2037)) by
@sungik-choi

- Fixes a bug where onHide is called when clicking inside the overlay,
causing the overlay to close.
([#1977](#1977)) by
@yangwooseong

- Fix invalid style migrations of `Tabs` component.
([#2014](#2014)) by
@sungik-choi

- Add missing spreading props to `ThemeProvider` and related components.
([#1986](#1986)) by
@sungik-choi

- Fix `ListItem`'s left icon color specificity issue.
([#2018](#2018)) by
@sungik-choi

- Fix `Badge` component style issue
([#2068](#2068)) by
@yangwooseong

- Fixes an issue where multi line truncated in `Text` was not being
applied. ([#1994](#1994))
by @sungik-choi

-   Updated dependencies
    -   @channel.io/bezier-tokens@0.1.0

## @channel.io/bezier-codemod@0.5.0

### Minor Changes

- Changes in `v2-text-component-interface` codemod
([#1932](#1932)) by
@yangwooseong
Previously, both the component name and the name of the property were
checked, but now only the name of the component property is checked.

- Add codemod for Stack component
([#1836](#1836)) by
@yangwooseong

- Add more various cases to `v2-enum-member-to-string-literal`
([#2059](#2059)) by
@yangwooseong

- Fix typo in `v2-z-index-interpolation-to-css-variable` codemod. It now
transforms `${ZIndex.Float}` enum to `var(--z-index-floating)`, not
`var(--z-index-float)`.
([#1924](#1924)) by
@yangwooseong

- Add codemod to transform interface of `Text` component
([#1849](#1849)) by
@yangwooseong

- Enhancement in `v2-foundation-to-css-variable-transition` codemod
([#1917](#1917)) by
@yangwooseong

- It will properly remove import statement if it converts code where
`TransitionDuration` is used.

- Changes in `v2-remove-alpha-from-alpha-stack` transform
([#1894](#1894)) by
@yangwooseong

    -   It is renamed as `v2-remove-alpha-from-alpha-components`.
    -   It covers `AlphaCenter` as well.

- Add `v2-foundation-to-css-variable-spacing` codemod to convert the
foundation's spacing variable to pixels
([#1907](#1907)) by
@yangwooseong

    This transforms

    ```tsx
    import { styled } from "@channel.io/bezier-react";

    export const Wrapper = styled.div`
      padding: ${({ foundation }) => foundation?.spacing.s5};
    `;
    ```

    into

    ```tsx
    import { styled } from "@channel.io/bezier-react";

    export const Wrapper = styled.div`
      padding: 12px;
    `;
    ```

- Changes in `v2-**-interpolation-to-css-variable` transform.
([#1928](#1928)) by
@yangwooseong

- it is renamed to `v2-interpolation-to-css-variable-**`. e.g.
`v2-interpolation-to-css-varable-input`,
`v2-interpolation-to-css-variable-typography`, and so on
- it provides integrated transform named
`v2-interpolation-to-css-variable` that handles all interpolation
transform

- Enhance `import-styled-from-styled-component` codemod to cover other
APIs from `styled-components`
([#1852](#1852)) by
@yangwooseong

- Add `Typography` transform logic to interpolation codemod
([#1841](#1841)) by
@yangwooseong

- Add v2 prefix to codemods related to major version 2
([#1844](#1844)) by
@yangwooseong

- Add codemod for z-index interpolation and enum
([#1845](#1845)) by
@yangwooseong

- Add more various cases to `v2-enum-member-to-string-literal`. Now it
covers following enums.
([#2059](#2059)) by
@yangwooseong

    -   `AvatarGroupEllipsisType`
    -   `IconSize`
    -   `LegacyTooltipPosition`
    -   `ModalTitleSize`
    -   `OverlayPosition`
    -   `ProgressBarSize`, `ProgressBarVariant`
    -   `SpinnerSize`
    -   `SwitchSize`
    -   `TagBadgeSize`, `TagBadgeVariant`
    -   `TextAreaHeight`
    -   `TextFieldSize`, `TextFieldVariant`
    -   `ToastPlacement`, `ToastAppearance`, `ToastPreset`
    -   `TooltipPosition`

- Add `inputPlaceholderStyle` migration logic to
`v2-input-interpolation-to-css-variable` codemod
([#1926](#1926)) by
@yangwooseong

- Add transform functions to help to migrate foundation to css variable
generated by `@channel.io/bezier-tokens` package. They cover theme,
transition, elevation, rounding, and border of foundation
([#1781](#1781)) by
@yangwooseong

- Added a codemod to switch the library for importing 'styled' object
from @channel.io/bezier-react to styled-components
([#1789](#1789)) by
@yangwooseong

- Add codemod for mixin interpolation
([#1787](#1787)) by
@yangwooseong

### Patch Changes

- Fix bug in `v2-import-from-bezier-to-styled-components` codemod when
there are only named imports as following:
([#1987](#1987)) by
@yangwooseong

    ```tsx
    // As-is
    import { css } from "@channel.io/bezier-react";

    // To-be
    import { css } from "styled-components";
    ```

- Fix `hasNamedImportInImportDeclaration` util to check all named
imports ([#2060](#2060))
by @yangwooseong

## @channel.io/bezier-tokens@0.1.0

### Minor Changes

- Apply deep freeze to the `tokens` object.
([#1992](#1992)) by
@sungik-choi

- Add the missing `bg-header-float` semantic color token
([#1842](#1842)) by
@sungik-choi

- Add composition tokens, such as box-shadow
([#1769](#1769)) by
@sungik-choi

- Now serving one combined styles.css file. This is a breaking change
for anyone who was importing the individual CSS files. You will need to
update your import to `@channel.io/bezier-tokens/css/styles.css`.
([#1769](#1769)) by
@sungik-choi

- Add z-index and opacity tokens
([#1766](#1766)) by
@sungik-choi

- Remove invalid radius tokens
([#1934](#1934)) by
@sungik-choi

    -   `radius-10`
    -   `radius-14`
    -   `radius-100-p`

- Fix invalid letter spacing token values
([#1821](#1821)) by
@sungik-choi

- First release
([#1685](#1685)) by
@sungik-choi

- Add categories by token to the JavaScript build file
([#1766](#1766)) by
@sungik-choi

- Remove unused tokens and add missing unit to radius tokens
([#1752](#1752)) by
@sungik-choi

### Patch Changes

- Remove duplicate styles in styles.css
([#1779](#1779)) by
@sungik-choi

## bezier-figma-plugin@0.5.0

### Minor Changes

- Upgrade to use @channel.io/bezier-react@2.0.0
([#2001](#2001)) by
@sungik-choi

### Patch Changes

- Enhance icon extract logic by catching error
([#2073](#2073)) by
@yangwooseong

-   Updated dependencies
    -   @channel.io/bezier-react@2.0.0

## @channel.io/bezier-vscode@0.1.0

### Minor Changes

- Create a package to support autocomplete for Bezier Design Tokens
([#2091](#2091)) by
@yangwooseong

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
sungik-choi added a commit that referenced this pull request Apr 8, 2024
…ponents (#2140)

<!--
  How to write a good PR title:
- Follow [the Conventional Commits
specification](https://www.conventionalcommits.org/en/v1.0.0/).
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

## Self Checklist

- [x] I wrote a PR title in **English** and added an appropriate
**label** to the PR.
- [x] I wrote the commit message in **English** and to follow [**the
Conventional Commits
specification**](https://www.conventionalcommits.org/en/v1.0.0/).
- [x] I [added the
**changeset**](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)
about the changes that needed to be released. (or didn't have to)
- [x] I wrote or updated **documentation** related to the changes. (or
didn't have to)
- [x] I wrote or updated **tests** related to the changes. (or didn't
have to)
- [x] I tested the changes in various browsers. (or didn't have to)
  - Windows: Chrome, Edge, (Optional) Firefox
  - macOS: Chrome, Edge, Safari, (Optional) Firefox

## Related Issue

<!-- Please link to issue if one exists -->

- #2076 
- Reverts #2049 

## Summary

<!-- Please brief explanation of the changes made -->

Remove the `/alpha` directory and add the `Alpha` prefix to alpha
components

## Details

<!-- Please elaborate description of the changes -->

`/alpha` 디렉토리(bezier-react의 `alpha-components/` 디렉토리)를 제거하고, 내부 컴포넌트에
`Alpha` prefix를 추가합니다.

> alpha 컴포넌트는 @channel.io/bezier-react/alpha(미정)의 다른 path로 접근해서 import할
수 있도록 하자. 마찬가지로, 컴포넌트에 Alpha prefix 없이 구현하면 네이밍 변경에 필요한 비용을 줄일 수 있겠다

#2076 에서 위와 같은 의도를 가지고, #2049 에서 `alpha-components` 디렉토리를 만들고 2개의 엔트리
포인트로 빌드하도록 변경하여 해당 기능을 구현했습니다. 하지만 작업하다보니 컴포넌트 외에도 스타일, 훅 파일을 관리하기가
애매해지는 문제가 있었습니다.

`alpha-components` 디렉토리를 `alpha` 디렉토리로 변경하고 더 nested한 구조를 가져가는 방법도 있으나,
최대한 플랫한 구조를 가져가는 게 관리하기 용이하다고 판단하여 변경사항을 롤백합니다. 대신, 이전과 다르게 bezier-react
내부에서 네이밍 변경을 최대한 덜 하기 위하여 named export 하는 부분에서만 이름을 변경하여 export 하도록
했습니다. 스토리북 파일의 이름이 스토리 디렉토리의 이름이 되기 때문에 이 부분은 Alpha prefix를 유지했습니다.

### Breaking change? (Yes/No)

<!-- If Yes, please describe the impact and migration path for users -->

No. alpha-components/ 아래 컴포넌트 이름이 변경되나, 개발중인 컴포넌트이므로 Breaking change는 아님
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat:component Issue or PR related to a new component
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants