Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

chore(dify-ui): upgrade Base UI to 1.9.0 (#43756)

yyh0d8a14ada56e
diff --git a/packages/dify-ui/src/autocomplete/index.tsx b/packages/dify-ui/src/autocomplete/index.tsx
index 393f9a35928..dcddbf47527 100644
--- a/packages/dify-ui/src/autocomplete/index.tsx
+++ b/packages/dify-ui/src/autocomplete/index.tsx
@@ -20,6 +20,7 @@ type AutocompleteActions = BaseAutocomplete.Root.Actions
type AutocompleteProps<ItemValue> = BaseAutocomplete.Root.Props<ItemValue>
type AutocompleteChangeEventDetails = BaseAutocomplete.Root.ChangeEventDetails
+type AutocompleteOpenChangeEventDetails = BaseAutocomplete.Root.OpenChangeEventDetails
type AutocompleteGroupedProps<Items extends readonly { items: readonly unknown[] }[]> = Omit<
AutocompleteProps<Items[number]['items'][number]>,
'items'
@@ -439,6 +440,7 @@ export type {
AutocompleteItemProps,
AutocompleteItemTextProps,
AutocompleteListProps,
+ AutocompleteOpenChangeEventDetails,
AutocompletePopupProps,
AutocompletePortalProps,
AutocompletePositionerProps,
diff --git a/packages/dify-ui/src/checkbox/index.stories.tsx b/packages/dify-ui/src/checkbox/index.stories.tsx
index f1d5e10c28a..3d9e7db080f 100644
--- a/packages/dify-ui/src/checkbox/index.stories.tsx
+++ b/packages/dify-ui/src/checkbox/index.stories.tsx
@@ -10,7 +10,7 @@ const meta = {
docs: {
description: {
component:
- 'Checkbox primitive built on Base UI. It preserves Base UI checked, indeterminate, disabled, and hidden input semantics while applying the Dify 16px checkbox design from Figma. Import from `@langgenius/dify-ui/checkbox`.',
+ 'Checkbox primitive built on Base UI. It preserves Base UI checked, indeterminate, disabled, and hidden input semantics while applying the Dify 16px checkbox design from Figma. Import from `@langgenius/dify-ui/checkbox`. Label it with a visible `FieldLabel` or `<label>`; use `aria-label` only when there is no visible label, because a non-blank `aria-label` takes precedence over any associated label.',
},
},
},
diff --git a/packages/dify-ui/src/collapsible/index.stories.tsx b/packages/dify-ui/src/collapsible/index.stories.tsx
index afe469ff3f6..93d689236ad 100644
--- a/packages/dify-ui/src/collapsible/index.stories.tsx
+++ b/packages/dify-ui/src/collapsible/index.stories.tsx
@@ -190,7 +190,7 @@ export const Disabled: Story = {
),
play: async ({ canvas, userEvent }) => {
const trigger = canvas.getByRole('button', { name: 'Unavailable options' })
- await expect(trigger).toHaveAttribute('aria-disabled', 'true')
+ await expect(trigger).toBeDisabled()
await userEvent.click(trigger)
await expect(trigger).toHaveAttribute('aria-expanded', 'false')
await expect(canvas.queryByText('These options are not available.')).not.toBeInTheDocument()
diff --git a/packages/dify-ui/src/combobox/index.tsx b/packages/dify-ui/src/combobox/index.tsx
index f3d31062f63..319e905ef88 100644
--- a/packages/dify-ui/src/combobox/index.tsx
+++ b/packages/dify-ui/src/combobox/index.tsx
@@ -26,6 +26,7 @@ type ComboboxProps<
> = BaseCombobox.Root.Props<Value, Multiple, Item> &
([Multiple] extends [true] ? { multiple: true } : unknown)
type ComboboxChangeEventDetails = BaseCombobox.Root.ChangeEventDetails
+type ComboboxOpenChangeEventDetails = BaseCombobox.Root.OpenChangeEventDetails
function Combobox<Value, Multiple extends boolean | undefined = false, Item = Value>(
props: ComboboxProps<Value, Multiple, Item>,
@@ -39,7 +40,7 @@ const useComboboxFilter = BaseCombobox.useFilter
const useComboboxFilteredItems = BaseCombobox.useFilteredItems
type ComboboxSelectedValue<Value, Multiple extends boolean | undefined = false> =
- | (Multiple extends true ? Value[] : Value)
+ | (Multiple extends true ? readonly Value[] : Value)
| null
type ComboboxValueProps<Value = unknown, Multiple extends boolean | undefined = false> = Omit<
@@ -533,6 +534,7 @@ export type {
ComboboxItemTextProps,
ComboboxLabelProps,
ComboboxListProps,
+ ComboboxOpenChangeEventDetails,
ComboboxPopupProps,
ComboboxPortalProps,
ComboboxPositionerProps,
diff --git a/packages/dify-ui/src/file-tree/__tests__/index.spec.tsx b/packages/dify-ui/src/file-tree/__tests__/index.spec.tsx
index 85a4eddc5ef..a9043ad0640 100644
--- a/packages/dify-ui/src/file-tree/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/file-tree/__tests__/index.spec.tsx
@@ -118,7 +118,7 @@ describe('FileTree', () => {
)
const trigger = screen.getByRole('button', { name: 'locked' })
- await expect.element(trigger).toHaveAttribute('aria-disabled', 'true')
+ await expect.element(trigger).toBeDisabled()
await expect.element(trigger).toHaveAttribute('aria-expanded', 'true')
})
})
diff --git a/packages/dify-ui/src/file-tree/index.tsx b/packages/dify-ui/src/file-tree/index.tsx
index fa2404a4eab..eb0e15531db 100644
--- a/packages/dify-ui/src/file-tree/index.tsx
+++ b/packages/dify-ui/src/file-tree/index.tsx
@@ -29,7 +29,6 @@ function fileTreeRowClassName({ className }: { className?: string }) {
'hover:bg-state-base-hover focus-visible:inset-ring-2 focus-visible:inset-ring-state-accent-solid',
'data-selected:bg-state-base-active',
'data-disabled:cursor-not-allowed data-disabled:opacity-50 data-disabled:hover:bg-transparent',
- 'aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-transparent',
className,
)
}
diff --git a/packages/dify-ui/src/radio-group/index.stories.tsx b/packages/dify-ui/src/radio-group/index.stories.tsx
index 3dc99c6ff67..4bd68caa688 100644
--- a/packages/dify-ui/src/radio-group/index.stories.tsx
+++ b/packages/dify-ui/src/radio-group/index.stories.tsx
@@ -12,7 +12,7 @@ const meta = {
docs: {
description: {
component:
- '`@langgenius/dify-ui/radio-group` exports the complete radio family. Every radio belongs to a `RadioGroup`, which owns single-selection state and group interaction. `Radio` is the default Dify control for plain form rows, `RadioItem` makes custom UI the radio item, and `RadioControl` renders the standard visual dot inside custom items.',
+ '`@langgenius/dify-ui/radio-group` exports the complete radio family. Every radio belongs to a `RadioGroup`, which owns single-selection state and group interaction. `Radio` is the default Dify control for plain form rows, `RadioItem` makes custom UI the radio item, and `RadioControl` renders the standard visual dot inside custom items. Label it with a visible `FieldLabel` or `<label>`; use `aria-label` only when there is no visible label, because a non-blank `aria-label` takes precedence over any associated label.',
},
},
},
diff --git a/packages/dify-ui/src/select/index.tsx b/packages/dify-ui/src/select/index.tsx
index 2516d04a071..cb0c4eb8fb0 100644
--- a/packages/dify-ui/src/select/index.tsx
+++ b/packages/dify-ui/src/select/index.tsx
@@ -18,6 +18,8 @@ import {
import { parsePlacement } from '../placement'
type SelectActions = BaseSelect.Root.Actions
+type SelectChangeEventDetails = BaseSelect.Root.ChangeEventDetails
+type SelectOpenChangeEventDetails = BaseSelect.Root.OpenChangeEventDetails
type SelectProps<Value, Multiple extends boolean | undefined = false> = BaseSelect.Root.Props<
Value,
@@ -290,6 +292,7 @@ export {
export type {
SelectActions,
+ SelectChangeEventDetails,
SelectContentProps,
SelectGroupLabelProps,
SelectGroupProps,
@@ -298,6 +301,7 @@ export type {
SelectItemTextProps,
SelectLabelProps,
SelectListProps,
+ SelectOpenChangeEventDetails,
SelectPopupProps,
SelectPortalProps,
SelectPositionerProps,
diff --git a/packages/dify-ui/src/switch/index.stories.tsx b/packages/dify-ui/src/switch/index.stories.tsx
index f84263db04f..70da2c8f249 100644
--- a/packages/dify-ui/src/switch/index.stories.tsx
+++ b/packages/dify-ui/src/switch/index.stories.tsx
@@ -12,7 +12,7 @@ const meta = {
docs: {
description: {
component:
- 'Toggle switch primitive with controlled and uncontrolled state support, loading state, and skeleton placeholder.',
+ 'Toggle switch primitive with controlled and uncontrolled state support, loading state, and skeleton placeholder. Label it with a visible `FieldLabel` or `<label>`; use `aria-label` only when there is no visible label, because a non-blank `aria-label` takes precedence over any associated label.',
},
},
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 58acc179b75..bd8cf072e40 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -174,11 +174,11 @@ catalogs:
specifier: 4.13.0
version: 4.13.0
'@base-ui/react':
- specifier: 1.8.0
- version: 1.8.0
+ specifier: 1.9.0
+ version: 1.9.0
'@base-ui/utils':
- specifier: 0.4.0
- version: 0.4.0
+ specifier: 0.5.0
+ version: 0.5.0
'@chromatic-com/storybook':
specifier: 5.4.0
version: 5.4.0
@@ -1107,7 +1107,7 @@ importers:
dependencies:
'@base-ui/utils':
specifier: 'catalog:'
'@date-fns/tz':
specifier: 'catalog:'
version: 1.5.0
@@ -1123,7 +1123,7 @@ importers:
devDependencies:
'@base-ui/react':
specifier: 'catalog:'
'@chromatic-com/storybook':
specifier: 'catalog:'
@@ -1403,7 +1403,7 @@ importers:
version: 1.36.1(@amplitude/[email protected])
'@base-ui/react':
specifier: 'catalog:'
'@daypicker/react':
specifier: 'catalog:'
version: 10.0.2(@types/[email protected])([email protected])
@@ -1700,10 +1700,10 @@ importers:
version: 4.6.5
zundo:
specifier: 'catalog:'
zustand:
specifier: 'catalog:'
devDependencies:
'@chromatic-com/storybook':
specifier: 'catalog:'
@@ -2039,8 +2039,8 @@ packages:
resolution: {integrity: sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==}
engines: {node: '>=6.9.0'}
- '@base-ui/[email protected]':
- resolution: {integrity: sha512-P0/1sxo6SBVZOklKMIedvTWqw2s2IQzi9x5bIVsXu980cuSOD4NeuRSs+/L7LZQfDkZP/uRZyGPyfFl/B1oH+Q==}
+ '@base-ui/[email protected]':
+ resolution: {integrity: sha512-S8CSYosASBKtpL8SWUfS78rFElfLijiCgA7oHOK22jCJ95FULsYyKwBNFOgudt0RA+/7yNc7F81bOvQnRgbBiQ==}
engines: {node: '>=14.0.0'}
peerDependencies:
'@date-fns/tz': ^1.2.0
@@ -2056,8 +2056,8 @@ packages:
date-fns:
optional: true
- '@base-ui/[email protected]':
- resolution: {integrity: sha512-bO9fz25kKtPf+aZVyfQrC0PDmJdmVni31W2hCS5/Owb+inwdIL3XU26pCPRPlt4LSxZrBgLwubXQXQlKaFEZzw==}
+ '@base-ui/[email protected]':
+ resolution: {integrity: sha512-dYGGcEttjkYiMoa5nHm8vLaJ2UcuTWxo3BFAwOYXeRg/q7UVVvA6cacEIXEs3FgBfK1CGtW1ptElqs7wsx+t9A==}
peerDependencies:
'@types/react': ^17 || ^18 || ^19
react: ^17 || ^18 || ^19
@@ -8658,8 +8658,8 @@ packages:
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
engines: {node: '>=0.10.0'}
- resolution: {integrity: sha512-AgZ3UOZm3YndfrJ4OYjgrT7bmCm/1iqkjvEfH/oYjzh6PD2qw4QuT3jjnXIrpdt4MTpMXclMT3lXbmRY+XRakw==}
+ resolution: {integrity: sha512-XGoLeRAVzUTcJ1qkxPQhDJyIZ5d6zzZD9nT7AEZOaaU9UbWclhycElmhO+VD5bFeLuzhPBaOV2oXC8uG35ZSpg==}
resolution: {integrity: sha512-yE7KUfFvaBFzGPs5H3Ops1RevfUEsDc5Iz65rOwWg4lE8HJSYtle77uul3+573457oHvBKuHYDl/xqUkKpEEdw==}
@@ -9285,8 +9285,8 @@ packages:
'@types/react':
optional: true
- resolution: {integrity: sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==}
+ resolution: {integrity: sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==}
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
@@ -9911,28 +9911,28 @@ snapshots:
'@babel/helper-string-parser': 7.29.7
'@babel/helper-validator-identifier': 7.29.7
dependencies:
'@babel/runtime': 7.29.7
'@floating-ui/react-dom': 2.1.9([email protected]([email protected]))([email protected])
'@floating-ui/utils': 0.2.12
react: 19.3.0
react-dom: 19.3.0([email protected])
- use-sync-external-store: 1.6.0([email protected])
+ use-sync-external-store: 1.7.0([email protected])
optionalDependencies:
'@date-fns/tz': 1.5.0
'@types/react': 19.3.0
date-fns: 4.4.0
dependencies:
'@babel/runtime': 7.29.7
'@floating-ui/utils': 0.2.12
react: 19.3.0
react-dom: 19.3.0([email protected])
- reselect: 5.2.0
- use-sync-external-store: 1.6.0([email protected])
+ reselect: 5.3.0
+ use-sync-external-store: 1.7.0([email protected])
optionalDependencies:
'@types/react': 19.3.0
@@ -12160,7 +12160,7 @@ snapshots:
'@tanstack/store': 0.11.2
react: 19.3.0
react-dom: 19.3.0([email protected])
- use-sync-external-store: 1.6.0([email protected])
+ use-sync-external-store: 1.7.0([email protected])
dependencies:
@@ -16356,7 +16356,7 @@ snapshots:
html-parse-stringify: 4.0.1
i18next: 26.4.2(@typescript/[email protected])
react: 19.3.0
- use-sync-external-store: 1.6.0([email protected])
+ use-sync-external-store: 1.7.0([email protected])
optionalDependencies:
react-dom: 19.3.0([email protected])
typescript: '@typescript/[email protected]'
@@ -16582,7 +16582,7 @@ snapshots:
@@ -16818,7 +16818,7 @@ snapshots:
oxc-resolver: 11.21.2
recast: 0.23.12
semver: 7.8.5
- use-sync-external-store: 1.6.0([email protected])
+ use-sync-external-store: 1.7.0([email protected])
ws: 8.21.3
optionalDependencies:
'@types/react': 19.3.0
@@ -17238,7 +17238,7 @@ snapshots:
optionalDependencies:
'@types/react': 19.3.0
dependencies:
react: 19.3.0
@@ -17695,24 +17695,24 @@ snapshots:
dependencies:
tslib: 2.3.0
dependencies:
dependencies:
- use-sync-external-store: 1.6.0([email protected])
+ use-sync-external-store: 1.7.0([email protected])
optionalDependencies:
'@types/react': 19.3.0
immer: 11.1.21
react: 19.3.0
optionalDependencies:
'@types/react': 19.3.0
immer: 11.1.21
react: 19.3.0
- use-sync-external-store: 1.6.0([email protected])
+ use-sync-external-store: 1.7.0([email protected])
@@ -17720,8 +17720,8 @@ time:
'@amplitude/[email protected]': '2026-10-08T19:42:36.353Z'
'@amplitude/[email protected]': '2026-10-08T19:20:30.256Z'
'@axe-core/[email protected]': '2026-08-11T17:07:40.763Z'
- '@base-ui/[email protected]': '2026-09-04T08:52:51.986Z'
- '@base-ui/[email protected]': '2026-09-04T08:49:31.070Z'
+ '@base-ui/[email protected]': '2026-10-09T08:52:43.788Z'
+ '@base-ui/[email protected]': '2026-10-09T08:50:42.770Z'
'@chromatic-com/[email protected]': '2026-10-01T07:25:19.651Z'
'@cucumber/[email protected]': '2026-10-05T08:15:24.936Z'
'@date-fns/[email protected]': '2026-05-21T10:39:51.805Z'
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 9b5031d145e..76713520d30 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -69,8 +69,8 @@ catalog:
'@amplitude/analytics-browser': 2.47.4
'@amplitude/plugin-session-replay-browser': 1.36.1
'@axe-core/playwright': 4.13.0
- '@base-ui/react': 1.8.0
- '@base-ui/utils': 0.4.0
+ '@base-ui/react': 1.9.0
+ '@base-ui/utils': 0.5.0
'@chromatic-com/storybook': 5.4.0
'@cucumber/cucumber': 13.3.0
'@date-fns/tz': 1.5.0
diff --git a/web/app/components/main-nav/components/__tests__/workspace-card.spec.tsx b/web/app/components/main-nav/components/__tests__/workspace-card.spec.tsx
index a6f9f57b0eb..6eb85255dfd 100644
--- a/web/app/components/main-nav/components/__tests__/workspace-card.spec.tsx
+++ b/web/app/components/main-nav/components/__tests__/workspace-card.spec.tsx
@@ -319,10 +319,7 @@ describe('WorkspaceCard', () => {
expect(
within(panel).getByRole('button', { name: 'navigation.mainNav.workspace.sort.openMenu' }),
).toBeDisabled()
- expect(within(panel).getByRole('button', { name: 'common.operation.search' })).toHaveAttribute(
- 'aria-disabled',
- 'true',
- )
+ expect(within(panel).getByRole('button', { name: 'common.operation.search' })).toBeDisabled()
expect(panel.querySelector('[aria-busy="true"]')).toBeInTheDocument()
expect(within(panel).getByRole('status', { name: 'common.loading' })).toBeInTheDocument()
expect(within(panel).queryByRole('button', { name: 'Evan Workspace' })).not.toBeInTheDocument()
diff --git a/web/app/components/workflow/nodes/agent-v2/components/__tests__/agent-output-routes.spec.tsx b/web/app/components/workflow/nodes/agent-v2/components/__tests__/agent-output-routes.spec.tsx
index f9a4cf018e1..adf5d4852af 100644
--- a/web/app/components/workflow/nodes/agent-v2/components/__tests__/agent-output-routes.spec.tsx
+++ b/web/app/components/workflow/nodes/agent-v2/components/__tests__/agent-output-routes.spec.tsx
@@ -186,12 +186,12 @@ it('collapses routes independently of their enabled state and keeps one title',
await user.click(disclosure)
expect(screen.getAllByRole('textbox', { name: 'Condition' })[0]).toHaveValue('Accept')
await user.click(toggle)
- expect(disclosure).toHaveAttribute('aria-disabled', 'true')
+ expect(disclosure).toBeDisabled()
await user.click(disclosure)
expect(screen.queryByRole('textbox', { name: 'Condition' })).not.toBeInTheDocument()
expect(screen.queryByText('workflowAgent.nodes.agent.outputRoutes.add')).not.toBeInTheDocument()
await user.click(toggle)
- expect(disclosure).not.toHaveAttribute('aria-disabled', 'true')
+ expect(disclosure).toBeEnabled()
expect(disclosure).toHaveAttribute('aria-expanded', 'true')
expect(screen.getAllByRole('textbox', { name: 'Condition' })).toHaveLength(2)
})