-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1120 from kadena-community/feat/form-focus-styles
Feat/form focus styles
- Loading branch information
Showing
20 changed files
with
120 additions
and
168 deletions.
There are no files selected for viewing
This file contains 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,5 @@ | ||
--- | ||
'@kadena/react-ui': patch | ||
--- | ||
|
||
Added focus state and improved visuals for inputs |
This file contains 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 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 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 |
---|---|---|
@@ -1,20 +1,54 @@ | ||
import { colorPalette } from '@theme/colors'; | ||
import { sprinkles } from '@theme/sprinkles.css'; | ||
import { darkThemeClass, vars } from '@theme/vars.css'; | ||
import { style } from '@vanilla-extract/css'; | ||
import { createVar, fallbackVar, style } from '@vanilla-extract/css'; | ||
|
||
export type FormFieldStatus = 'disabled' | 'positive' | 'warning' | 'negative'; | ||
export const statusColor = createVar(); | ||
export const statusOutlineColor = createVar(); | ||
|
||
export const baseOutlinedClass = style([ | ||
{ | ||
outline: `2px solid ${fallbackVar( | ||
statusOutlineColor, | ||
vars.colors.$gray30, | ||
)}`, | ||
selectors: { | ||
[`${darkThemeClass} &`]: { | ||
outline: `2px solid ${fallbackVar( | ||
statusOutlineColor, | ||
vars.colors.$gray60, | ||
)}`, | ||
}, | ||
}, | ||
}, | ||
]); | ||
|
||
export const baseContainerClass = style([ | ||
sprinkles({ | ||
alignItems: 'stretch', | ||
borderRadius: '$sm', | ||
display: 'flex', | ||
color: '$foreground', | ||
overflow: 'hidden', | ||
lineHeight: '$lg', | ||
bg: { | ||
lightMode: '$white', | ||
darkMode: '$gray100', | ||
}, | ||
}), | ||
{ | ||
outline: `2px solid ${vars.colors.$gray30}`, | ||
outlineOffset: '1px', | ||
position: 'relative', | ||
boxShadow: `0px 1px 0 0 ${colorPalette.$gray30}`, | ||
outlineOffset: '2px', | ||
selectors: { | ||
[`${darkThemeClass} &`]: { | ||
outline: `2px solid ${vars.colors.$gray60}`, | ||
boxShadow: `0px 1px 0 0 ${colorPalette.$gray60}`, | ||
}, | ||
'&:focus-within': { | ||
outline: `2px solid ${fallbackVar(statusColor, vars.colors.$blue60)}`, | ||
outlineOffset: '2px', | ||
}, | ||
}, | ||
}, | ||
]); | ||
|
||
// base container class |
42 changes: 1 addition & 41 deletions
42
packages/libs/react-ui/src/components/Form/Input/Input.css.ts
This file contains 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 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 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
16 changes: 16 additions & 0 deletions
16
packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.context.ts
This file contains 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,16 @@ | ||
import type { vars } from '@theme/vars.css'; | ||
|
||
import { createContext } from 'react'; | ||
import type { FormFieldStatus } from '../Form.css'; | ||
|
||
export type OpenSections = string[]; | ||
|
||
interface IInputWrapperContext { | ||
status?: FormFieldStatus; | ||
leadingTextWidth?: keyof typeof vars.sizes; | ||
} | ||
|
||
export const InputWrapperContext = createContext<IInputWrapperContext>({ | ||
status: undefined, | ||
leadingTextWidth: undefined, | ||
}); |
This file contains 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 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
1 change: 0 additions & 1 deletion
1
packages/libs/react-ui/src/components/Form/InputWrapper/index.ts
This file contains 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 |
---|---|---|
@@ -1,2 +1 @@ | ||
export { InputWrapper, type IInputWrapperProps } from './InputWrapper'; | ||
export { type Status as InputWrapperStatus } from './InputWrapper.css'; |
27 changes: 3 additions & 24 deletions
27
packages/libs/react-ui/src/components/Form/Select/Select.css.ts
This file contains 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
Oops, something went wrong.
3febd50
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.
Successfully deployed to the following URLs:
tools – ./packages/apps/tools
kadena-js-transfer.vercel.app
tools-kadena-js.vercel.app
tools-git-main-kadena-js.vercel.app
tools.kadena.io
3febd50
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.
Successfully deployed to the following URLs:
react-ui – ./packages/libs/react-ui
react-ui-kadena-js.vercel.app
react-ui-git-main-kadena-js.vercel.app
react-ui-delta.vercel.app
react-ui.kadena.io