From e8c29c70dab84d5bb81f734918ceaa6bb73cf311 Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Tue, 23 Sep 2025 04:01:32 +0000 Subject: [PATCH 1/4] feat(ui/select): add contentProps to override Popover content alignment; add story with play test Co-authored-by: Jake Ruesink --- .changeset/select-content-props-align-end.md | 7 ++ apps/docs/src/ui/select-alignment.stories.tsx | 78 +++++++++++++++++++ packages/components/src/ui/select.tsx | 16 +++- 3 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 .changeset/select-content-props-align-end.md create mode 100644 apps/docs/src/ui/select-alignment.stories.tsx diff --git a/.changeset/select-content-props-align-end.md b/.changeset/select-content-props-align-end.md new file mode 100644 index 00000000..24ee823a --- /dev/null +++ b/.changeset/select-content-props-align-end.md @@ -0,0 +1,7 @@ +--- +"@lambdacurry/forms": patch +--- + +Add contentProps to UI Select to pass through PopoverPrimitive.Content positioning props (align/side/sideOffset). +Defaults preserved (align='start', sideOffset=4). New Storybook example and play test demonstrate overriding align to 'end' for right-aligned triggers. + diff --git a/apps/docs/src/ui/select-alignment.stories.tsx b/apps/docs/src/ui/select-alignment.stories.tsx new file mode 100644 index 00000000..5c17f793 --- /dev/null +++ b/apps/docs/src/ui/select-alignment.stories.tsx @@ -0,0 +1,78 @@ +import type { Meta, StoryObj } from '@storybook/react-vite'; +import { expect, userEvent, within } from '@storybook/test'; +import * as React from 'react'; +import { Select, type SelectOption } from '@lambdacurry/forms/ui/select'; + +const meta: Meta = { + title: 'UI/Select/Alignment', + component: Select, + parameters: { layout: 'centered' }, + tags: ['autodocs'], +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +const OPTIONS: SelectOption[] = [ + { label: 'Alabama', value: 'AL' }, + { label: 'Alaska', value: 'AK' }, + { label: 'Arizona', value: 'AZ' }, + { label: 'Arkansas', value: 'AR' }, + { label: 'California', value: 'CA' }, +]; + +export const RightAlignedWithEndContent: Story = { + name: 'Right-aligned trigger with content align="end"', + args: {}, + render: () => { + return ( +
+
+
+ + +