-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat: add toggle to show/hide LTS releases #8263
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
Merged
bmuenzenmeyer
merged 23 commits into
nodejs:main
from
efekrskl:feat/eol-table-lts-toggle
Nov 23, 2025
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b37d970
feat: add switch in eol table
efekrskl 680b0ca
feat: translation keys
efekrskl 6f7ab98
refactor: client renaming
efekrskl bdf5ce9
fix: dont create arrow fn onCheckedChange
efekrskl aebe830
chore: use tilde for version
efekrskl 4502c6c
refactor: rename prop
efekrskl f530878
fixes test, but does it?
bmuenzenmeyer 39eb665
fix: add use client directive
efekrskl fee09ef
fix: apply motion safe
efekrskl a0ae7e0
refactor: use size instead of w&h
efekrskl 8cbd84a
fix: use motion safe
efekrskl d73475e
refactor: use import type for types
efekrskl ce14ae6
fix: adjust focus visible ring offset
efekrskl a90d6ce
Merge remote-tracking branch 'upstream/main' into feat/eol-table-lts-…
efekrskl 52fd77b
chore: update pnpm lock
efekrskl e2ce7e4
revert: releaseData.mjs changes
efekrskl 416f069
revert: tablebody
efekrskl 070fe96
feat: implement the switch in html/css only
efekrskl 4cd0fa0
revert: @radix-ui/react-switch install
efekrskl 5a74ff7
revert: pnpm.lock
efekrskl b272f4f
revert: tests
efekrskl 0f63691
feat: new stories
efekrskl 52423d8
ci: don't mind me triggering the ci
efekrskl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| @reference "../../../styles/index.css"; | ||
|
|
||
| .eolTableWrapper { | ||
| @apply contents; | ||
| } | ||
|
|
||
| .eolTableWrapper:has(input[type='checkbox']:checked) tr[data-lts='false'] { | ||
| @apply hidden; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| @reference "../../styles/index.css"; | ||
|
|
||
| .switch { | ||
| @apply inline-flex | ||
| justify-end | ||
| gap-3; | ||
|
|
||
| .label { | ||
| @apply cursor-pointer | ||
| select-none | ||
| text-sm | ||
| font-medium | ||
| text-neutral-800 | ||
| dark:text-neutral-200; | ||
| } | ||
|
|
||
| .input { | ||
| @apply sr-only; | ||
| } | ||
|
|
||
| .root { | ||
| @apply w-10.5 | ||
| relative | ||
| inline-flex | ||
| h-6 | ||
| cursor-pointer | ||
| items-center | ||
| rounded-full | ||
| bg-black | ||
| motion-safe:transition-colors | ||
| motion-safe:duration-100 | ||
| motion-safe:ease-out | ||
| dark:bg-neutral-700; | ||
| } | ||
|
|
||
| .input:focus-visible + .root { | ||
| @apply ring-2 | ||
| ring-green-500 | ||
| ring-offset-2 | ||
| ring-offset-neutral-100 | ||
| dark:ring-green-400 | ||
| dark:ring-offset-neutral-900; | ||
| } | ||
|
|
||
| .input:checked + .root { | ||
| @apply bg-green-600; | ||
| } | ||
|
|
||
| .thumb { | ||
| @apply pointer-events-none | ||
| block | ||
| size-5 | ||
| translate-x-0.5 | ||
| rounded-full | ||
| bg-white | ||
| ring-0 | ||
| motion-safe:transition-transform | ||
| motion-safe:duration-100 | ||
| motion-safe:ease-out; | ||
| } | ||
|
|
||
| .input:checked + .root .thumb { | ||
| @apply translate-x-5; | ||
| } | ||
| } |
21 changes: 21 additions & 0 deletions
21
packages/ui-components/src/Common/Switch/index.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import type { Meta as MetaObj, StoryObj } from '@storybook/react'; | ||
|
|
||
| import Switch from '#ui/Common/Switch'; | ||
|
|
||
| type Story = StoryObj<typeof Switch>; | ||
| type Meta = MetaObj<typeof Switch>; | ||
|
|
||
| export const WithLabel: Story = { | ||
| args: { | ||
| label: 'Enable Feature', | ||
| }, | ||
| }; | ||
|
|
||
| export const WithoutLabel: Story = {}; | ||
|
|
||
| export default { | ||
| component: Switch, | ||
| parameters: { | ||
| layout: 'centered', | ||
| }, | ||
| } as Meta; |
bmuenzenmeyer marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import classNames from 'classnames'; | ||
| import type { FC, PropsWithChildren, InputHTMLAttributes } from 'react'; | ||
|
|
||
| import styles from './index.module.css'; | ||
|
|
||
| type SwitchProps = InputHTMLAttributes<HTMLInputElement> & { | ||
| id: string; | ||
| label?: string; | ||
| thumbClassName?: string; | ||
| }; | ||
|
|
||
| const Switch: FC<PropsWithChildren<SwitchProps>> = ({ | ||
| label, | ||
| className, | ||
| thumbClassName, | ||
| id, | ||
| ...props | ||
| }) => { | ||
| return ( | ||
| <label className={styles.switch}> | ||
| {label && <span className={styles.label}>{label}</span>} | ||
| <input id={id} type="checkbox" className={styles.input} {...props} /> | ||
| <div className={classNames(styles.root, className)}> | ||
| <div className={classNames(styles.thumb, thumbClassName)} /> | ||
| </div> | ||
| </label> | ||
| ); | ||
| }; | ||
|
|
||
| export default Switch; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smart!