mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
feat(ui): ux improvements & redesign
This is a squash merge of a bajillion messy small commits created while iterating on the UI component library and redesign.
This commit is contained in:
committed by
Kent Keirsey
parent
a47d91f0e7
commit
f0b102d830
@@ -0,0 +1,21 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
|
||||
import type { InvCheckboxProps } from './types';
|
||||
import { InvCheckbox } from './wrapper';
|
||||
|
||||
const meta: Meta<typeof InvCheckbox> = {
|
||||
title: 'Primitives/InvCheckbox',
|
||||
tags: ['autodocs'],
|
||||
component: InvCheckbox,
|
||||
};
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof InvCheckbox>;
|
||||
|
||||
const Component = (props: InvCheckboxProps) => {
|
||||
return <InvCheckbox {...props} />;
|
||||
};
|
||||
|
||||
export const Default: Story = {
|
||||
render: Component,
|
||||
};
|
||||
@@ -0,0 +1,69 @@
|
||||
import { checkboxAnatomy as parts } from '@chakra-ui/anatomy';
|
||||
import {
|
||||
createMultiStyleConfigHelpers,
|
||||
defineStyle,
|
||||
} from '@chakra-ui/styled-system';
|
||||
|
||||
const { definePartsStyle, defineMultiStyleConfig } =
|
||||
createMultiStyleConfigHelpers(parts.keys);
|
||||
|
||||
const invokeAIControl = defineStyle((props) => {
|
||||
const { colorScheme: c } = props;
|
||||
|
||||
return {
|
||||
bg: 'base.700',
|
||||
borderColor: 'base.600',
|
||||
color: 'base.100',
|
||||
|
||||
_checked: {
|
||||
bg: `${c}.500`,
|
||||
borderColor: `${c}.500`,
|
||||
color: `${c}.100`,
|
||||
|
||||
_hover: {
|
||||
bg: `${c}.500`,
|
||||
borderColor: `${c}.500`,
|
||||
},
|
||||
|
||||
_disabled: {
|
||||
borderColor: 'transparent',
|
||||
bg: 'whiteAlpha.300',
|
||||
color: 'whiteAlpha.500',
|
||||
},
|
||||
},
|
||||
|
||||
_indeterminate: {
|
||||
bg: `${c}.600`,
|
||||
borderColor: `${c}.600`,
|
||||
color: `${c}.100`,
|
||||
},
|
||||
|
||||
_disabled: {
|
||||
bg: 'whiteAlpha.100',
|
||||
borderColor: 'transparent',
|
||||
},
|
||||
|
||||
_focusVisible: {
|
||||
boxShadow: 'none',
|
||||
outline: 'none',
|
||||
},
|
||||
|
||||
_invalid: {
|
||||
borderColor: 'error.300',
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
const invokeAI = definePartsStyle((props) => ({
|
||||
control: invokeAIControl(props),
|
||||
}));
|
||||
|
||||
export const checkboxTheme = defineMultiStyleConfig({
|
||||
variants: {
|
||||
invokeAI: invokeAI,
|
||||
},
|
||||
defaultProps: {
|
||||
variant: 'invokeAI',
|
||||
colorScheme: 'blue',
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
import type { CheckboxProps as ChakraCheckboxProps } from '@chakra-ui/react';
|
||||
|
||||
export interface InvCheckboxProps extends ChakraCheckboxProps {}
|
||||
@@ -0,0 +1 @@
|
||||
export { Checkbox as InvCheckbox } from '@chakra-ui/react';
|
||||
Reference in New Issue
Block a user