Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1f2ff3d
refactor(checkbox): use native input events
comfrt1k Oct 21, 2026
ae2e476
feat(checkbox): indeterminate state
comfrt1k Oct 21, 2026
116baad
feat(checkbox): shapes
comfrt1k Oct 22, 2026
7d5701b
refactor(checkbox): appearances
comfrt1k Oct 22, 2026
196077a
refactor(checkbox): appearances
comfrt1k Oct 23, 2026
2bca472
refactor(checkbox): nested appearances
comfrt1k Oct 23, 2026
74b7cb7
feat(checkbox): icons
comfrt1k Oct 23, 2026
eac9ba2
refactor(checkbox): styles topology
comfrt1k Oct 23, 2026
8d7c733
refactor(checkbox): label position
comfrt1k Oct 23, 2026
e17e154
chore(common): update lock
comfrt1k Oct 23, 2026
98b3b3d
feat(checkbox): update stories
comfrt1k Oct 23, 2026
1c092f2
fix(checkbox): declare dynamic styles peer dependency
comfrt1k Oct 23, 2026
1529731
fix(checkbox): preserve container inline styles
comfrt1k Oct 23, 2026
d8fd56d
fix(checkbox): sync uncontrolled state after form reset
comfrt1k Oct 23, 2026
540ad40
fix(checkbox): keep story args consistently controlled
comfrt1k Oct 23, 2026
682902b
chore(checkbox): merge updated v2 branch
comfrt1k Oct 23, 2026
1bf345b
refactor(checkbox): extract logic from component
comfrt1k Oct 23, 2026
63b6174
chore(hyperion): update raijin to 2.1.1
comfrt1k Oct 23, 2026
7456d58
fix(checkbox): reset hidden input margin
comfrt1k Oct 23, 2026
222013d
chore(common): format
comfrt1k Oct 23, 2026
8dd9b5b
fix(checkbox): handle reset after form reassociation
comfrt1k Oct 23, 2026
60313f7
chore(common): raijin version
comfrt1k Oct 26, 2026
228aa81
refactor(checkbox): check shapes
comfrt1k Oct 26, 2026
24b1e26
refactor(checkbox): rename files
comfrt1k Oct 26, 2026
3974a58
fix(checkbox): hide area for check div
comfrt1k Oct 26, 2026
6a19d47
fix(checkbox): uncontrolled checkboxes in stories
comfrt1k Oct 26, 2026
c678c27
fix(checkbox): indeterminate state sync
comfrt1k Oct 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
533 changes: 251 additions & 282 deletions .pnp.cjs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion ui-parts/checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
"postpack": "rm -rf dist"
},
"dependencies": {
"@atls-ui-parts/icons": "workspace:*",
"@atls-ui-parts/theme": "workspace:*",
"@atls-ui/theme": "workspace:*",
"clsx": "2.1.1"
},
"devDependencies": {
"@atls-ui-generators/appearance": "workspace:*",
"@atls-ui-parts/layout": "workspace:*",
"@storybook/react": "10.4.6",
"@types/react": "19.1.2",
Expand All @@ -30,6 +31,7 @@
},
"peerDependencies": {
"@vanilla-extract/css": "*",
"@vanilla-extract/dynamic": "*",
"react": "*",
"react-dom": "*"
},
Expand Down
5 changes: 0 additions & 5 deletions ui-parts/checkbox/src/box/box.interfaces.ts

This file was deleted.

4 changes: 2 additions & 2 deletions ui-parts/checkbox/src/box/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export type * from './box.interfaces.js'
export * from './styles/index.js'
export * from './styles/index.js'
export type { BoxShape } from './styles/shape/interfaces.js'
20 changes: 0 additions & 20 deletions ui-parts/checkbox/src/box/styles/appearance.css.ts

This file was deleted.

5 changes: 5 additions & 0 deletions ui-parts/checkbox/src/box/styles/appearance/interfaces.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface BoxAppearance {
backgroundColor: string
borderColor: string
shadow: string
}
50 changes: 50 additions & 0 deletions ui-parts/checkbox/src/box/styles/appearance/styles.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { createThemeContract } from '@vanilla-extract/css'
import { style } from '@vanilla-extract/css'

import { hiddenInputStyles } from '../../../hidden-input/index.js'

export const boxAppearanceVariables = createThemeContract({
default: {
backgroundColor: null,
borderColor: null,
shadow: null,
},
hover: {
backgroundColor: null,
borderColor: null,
shadow: null,
},
disabled: {
backgroundColor: null,
borderColor: null,
shadow: null,
},
focused: {
backgroundColor: null,
borderColor: null,
shadow: null,
},
})

export const boxAppearanceStyles = style({
backgroundColor: boxAppearanceVariables.default.backgroundColor,
borderColor: boxAppearanceVariables.default.borderColor,
boxShadow: boxAppearanceVariables.default.shadow,
selectors: {
[`${hiddenInputStyles}:hover:not(:disabled) + &`]: {
backgroundColor: boxAppearanceVariables.hover.backgroundColor,
borderColor: boxAppearanceVariables.hover.borderColor,
boxShadow: boxAppearanceVariables.hover.shadow,
},
[`${hiddenInputStyles}:focus-visible:not(:disabled) + &`]: {
backgroundColor: boxAppearanceVariables.focused.backgroundColor,
borderColor: boxAppearanceVariables.focused.borderColor,
boxShadow: boxAppearanceVariables.focused.shadow,
},
[`${hiddenInputStyles}:disabled + &`]: {
backgroundColor: boxAppearanceVariables.disabled.backgroundColor,
borderColor: boxAppearanceVariables.disabled.borderColor,
boxShadow: boxAppearanceVariables.disabled.shadow,
},
},
})
7 changes: 4 additions & 3 deletions ui-parts/checkbox/src/box/styles/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './appearance.css.js'
export * from './base.css.js'
export * from './shape.css.js'
export * from './appearance/styles.css.js'
export type * from './appearance/interfaces.js'
export * from './base.css.js'
export * from './shape/variants.css.js'
27 changes: 0 additions & 27 deletions ui-parts/checkbox/src/box/styles/shape.css.ts

This file was deleted.

7 changes: 7 additions & 0 deletions ui-parts/checkbox/src/box/styles/shape/interfaces.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { CSSProperties } from 'react'

export interface BoxShape {
className: string
elevationSize: 'md' | 'sm' | 'xs'
padding?: CSSProperties['padding']
}
40 changes: 40 additions & 0 deletions ui-parts/checkbox/src/box/styles/shape/variants.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import type { BoxShape } from './interfaces.js'

import { style } from '@vanilla-extract/css'

import { spacing } from '@atls-ui/theme'
import { borderWidths } from '@atls-ui/theme/tokens'
import { radii } from '@atls-ui/theme/tokens'

export const boxShapeStyles: Record<'lg' | 'md' | 'sm', BoxShape> = {
sm: {
className: style({
width: '18px',
height: '18px',
borderRadius: radii.xs2,
borderWidth: borderWidths.sm,
}),
elevationSize: 'xs',
padding: spacing.component.none,
},
md: {
className: style({
width: '24px',
height: '24px',
borderRadius: radii.xs2,
borderWidth: borderWidths.sm,
}),
elevationSize: 'sm',
padding: spacing.component.none,
},
lg: {
className: style({
width: '28px',
height: '28px',
borderRadius: radii.xs2,
borderWidth: borderWidths.sm,
}),
elevationSize: 'md',
padding: spacing.component.none,
},
}
20 changes: 0 additions & 20 deletions ui-parts/checkbox/src/check/appearance.css.ts

This file was deleted.

3 changes: 3 additions & 0 deletions ui-parts/checkbox/src/check/appearance/interfaces.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface CheckAppearance {
color: string
}
35 changes: 35 additions & 0 deletions ui-parts/checkbox/src/check/appearance/styles.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { createThemeContract } from '@vanilla-extract/css'
import { style } from '@vanilla-extract/css'

import { boxBaseStyles } from '../../box/styles/base.css.js'
import { hiddenInputStyles } from '../../hidden-input/index.js'

export const checkAppearanceVariables = createThemeContract({
default: {
color: null,
},
hover: {
color: null,
},
disabled: {
color: null,
},
focused: {
color: null,
},
})

export const checkAppearanceStyles = style({
color: checkAppearanceVariables.default.color,
selectors: {
[`${hiddenInputStyles}:hover:not(:disabled) + ${boxBaseStyles} &`]: {
color: checkAppearanceVariables.hover.color,
},
[`${hiddenInputStyles}:focus-visible:not(:disabled) + ${boxBaseStyles} &`]: {
color: checkAppearanceVariables.focused.color,
},
[`${hiddenInputStyles}:disabled + ${boxBaseStyles} &`]: {
color: checkAppearanceVariables.disabled.color,
},
},
})
15 changes: 15 additions & 0 deletions ui-parts/checkbox/src/check/base.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { style } from '@vanilla-extract/css'

export const checkBaseStyles = style({
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
visibility: 'hidden',
width: '100%',
height: '100%',
lineHeight: 1,
})

export const checkVisibleStyles = style({
visibility: 'visible',
})
19 changes: 0 additions & 19 deletions ui-parts/checkbox/src/check/check.css.ts

This file was deleted.

45 changes: 45 additions & 0 deletions ui-parts/checkbox/src/check/component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import type { ReactNode } from 'react'

import type { CheckProps } from './interfaces.js'

import { assignInlineVars } from '@vanilla-extract/dynamic'
import { clsx } from 'clsx'

import { CheckIcon } from '@atls-ui-parts/icons'
import { MinusIcon } from '@atls-ui-parts/icons'

import { checkAppearanceStyles } from './appearance/styles.css.js'
import { checkAppearanceVariables } from './appearance/styles.css.js'
import { checkBaseStyles } from './base.css.js'
import { checkVisibleStyles } from './base.css.js'

export const Check = ({
appearance,
checked,
checkedIcon,
className,
indeterminate,
indeterminateIcon,
shape,
}: CheckProps): ReactNode => {
let icon = checkedIcon ?? <CheckIcon />

if (indeterminate) {
icon = indeterminateIcon ?? <MinusIcon />
}

return (
<div
style={assignInlineVars(checkAppearanceVariables, appearance)}
className={clsx(
checkBaseStyles,
checkAppearanceStyles,
shape,
(checked || indeterminate) && checkVisibleStyles,
className
)}
>
{icon}
Comment thread
TorinAsakura marked this conversation as resolved.
Resolved
</div>
)
}
6 changes: 4 additions & 2 deletions ui-parts/checkbox/src/check/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export * from './appearance.css.js'
export * from './check.css.js'
export * from './base.css.js'
export * from './shape.css.js'
export * from './appearance/styles.css.js'
export type * from './appearance/interfaces.js'
13 changes: 13 additions & 0 deletions ui-parts/checkbox/src/check/interfaces.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { ReactNode } from 'react'

import type { CheckboxAppearanceStates } from '../styles/appearance/interfaces.js'

export interface CheckProps {
appearance: CheckboxAppearanceStates['check']
checked: boolean
checkedIcon?: ReactNode
className?: string
indeterminate?: boolean
indeterminateIcon?: ReactNode
shape: string
}
35 changes: 35 additions & 0 deletions ui-parts/checkbox/src/check/shape.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { globalStyle } from '@vanilla-extract/css'
import { style } from '@vanilla-extract/css'

const checkSmallShapeStyles = style({
fontSize: '12px',
})

const checkMediumShapeStyles = style({
fontSize: '14px',
})

const checkLargeShapeStyles = style({
fontSize: '18px',
})

globalStyle(`${checkSmallShapeStyles} > svg`, {
width: '12px',
height: '12px',
})

globalStyle(`${checkMediumShapeStyles} > svg`, {
width: '14px',
height: '14px',
})

globalStyle(`${checkLargeShapeStyles} > svg`, {
width: '18px',
height: '18px',
})

export const checkShapeStyles = {
sm: checkSmallShapeStyles,
md: checkMediumShapeStyles,
lg: checkLargeShapeStyles,
}
Loading
Loading