Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
feat(webv2): add 2xs segment group size
joshistoast780b35a42633
diff --git a/invokeai/frontend/webv2/src/platform/ui/theme/SegmentGroupSizing.browser.test.tsx b/invokeai/frontend/webv2/src/platform/ui/theme/SegmentGroupSizing.browser.test.tsxindex f8e3779a4b..5318c9b687 100644--- a/invokeai/frontend/webv2/src/platform/ui/theme/SegmentGroupSizing.browser.test.tsx+++ b/invokeai/frontend/webv2/src/platform/ui/theme/SegmentGroupSizing.browser.test.tsx@@ -15,7 +15,9 @@ afterEach(async () => {root = null;});-const renderPair = async (size: 'xs' | 'sm' | 'md'): Promise<{ button: HTMLElement; segmentRoot: HTMLElement }> => {+const renderPair = async (+ size: '2xs' | 'xs' | 'sm' | 'md'+): Promise<{ button: HTMLElement; segmentRoot: HTMLElement }> => {host = document.createElement('div');document.body.append(host);root = createRoot(host);@@ -26,7 +28,8 @@ const renderPair = async (size: 'xs' | 'sm' | 'md'): Promise<{ button: HTMLEleme<Button data-testid="button" size={size}>Reference</Button>- <SegmentGroup.Root data-testid="segments" size={size} value="a">+ {/* `2xs` is a repo recipe extension the generated Chakra types don't know. */}+ <SegmentGroup.Root data-testid="segments" size={size as 'xs'} value="a"><SegmentGroup.Indicator />{['a', 'b'].map((value) => (<SegmentGroup.Item key={value} value={value}>@@ -48,7 +51,7 @@ const renderPair = async (size: 'xs' | 'sm' | 'md'): Promise<{ button: HTMLElemedescribe('segmentGroup slot recipe sizing', () => {// Segment groups sit beside buttons in toolbars; a size name must mean the// same outer height on both (Chakra's defaults run one size-name small).- (['xs', 'sm', 'md'] as const).forEach((size) => {+ (['2xs', 'xs', 'sm', 'md'] as const).forEach((size) => {it(`matches the ${size} button height`, async () => {const { button, segmentRoot } = await renderPair(size);diff --git a/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts b/invokeai/frontend/webv2/src/platform/ui/theme/recipes.tsindex 369c91e25d..a71b42f5fd 100644--- a/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts+++ b/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts@@ -201,6 +201,16 @@ export const segmentGroupSlotRecipe = defineSlotRecipe({// button recipe's `xs` cap.size: {...chakraSlotRecipes.segmentGroup.variants?.size,+ // Repo extension (like the button's own `2xs`): Chakra ships no+ // segment-group `2xs`, so this borrows the `xs` item styles as its base.+ '2xs': {+ item: {+ ...chakraSlotRecipes.segmentGroup.variants?.size?.xs?.item,+ height: 'calc({sizes.6} - 2px)',+ px: '2',+ textStyle: 'xs',+ },+ },xs: {item: {...chakraSlotRecipes.segmentGroup.variants?.size?.xs?.item,