Commit graph

982 commits

Author SHA1 Message Date
Eric Liu
44a6cc0dfc
fix(pagination): on:change dispatches with correct value (#2194) 2025-09-05 09:00:51 -07:00
Eric Liu
14edf41e57
fix(overflow-menu): avoid dynamic style injection for performance (#2198)
Fixes #2197
2025-09-05 08:09:07 -07:00
Eric Liu
2fc884caca
fix(combo-box): address accessibility issues (#2186)
Supports #2172
2025-08-19 10:35:18 -07:00
Sergei Burtsev
0df727b704
fix(toggle): avoid dispatching toggle event on state change (#2184) 2025-08-16 11:34:21 -07:00
brunnerh
c7ad1ebdd3
fix(checkbox): prevent infinite effect loop when binding to same object (#2178)
Fixes #2177
2025-08-05 06:45:54 -07:00
Nick Wing
aecc4e8eec
fix(multi-select): forward on:input for filterable variant (#2170) 2025-06-10 15:31:28 -07:00
Eric Liu
632320ae3b
fix(combo-box): "Escape" key clears input value (#2169)
Fixes #2167
2025-06-07 12:45:32 -07:00
Eric Liu
95c06a83b3
fix(combo-box): clear button supports "Space" key (#2168)
Fixes #2166
2025-06-07 12:33:59 -07:00
Eric Liu
cdf5659fa0
fix(pagination): use toLocaleString for default text formatting (#2161) 2025-04-26 13:39:26 -07:00
Eric Liu
ed3928bb01
fix(pagination): window totalItems for performance (#2160)
Fixes #2156
2025-04-26 13:25:52 -07:00
Eric Liu
024d77493c
fix(composed-modal): ignore a11y warning in Svelte 5 (#2159) 2025-04-25 08:46:16 -07:00
Eric Liu
96d37cc490
fix(to-hierarchy): revert to previous implementation 2025-04-25 08:40:09 -07:00
Eric Liu
f09c2e2c31
fix(toolbar-search): re-filter rows if DataTable rows change (#2154)
Fixes #2143

Make `ToolbarSearch` filtering reactive to `DataTable` rows.

Previously, `ToolbarSearch` did not update when `DataTable` rows
changed. Now it subscribes to the context rows and re-runs
`filterRows` in `afterUpdate` to prevent infinite loops.
2025-04-19 13:33:07 -07:00
Nick Wing
61ea8dd82c
fix(select): falsy item text should fallback to value (#2152) 2025-04-18 10:34:12 -07:00
Nick Wing
436dea47e8
feat(combo-box): add hideLabel prop (#2153) 2025-04-18 10:27:14 -07:00
Eric Liu
dd41c977ed perf(to-hierarchy): optimize to use single-pass approach 2025-04-12 15:59:16 -07:00
Eric Liu
1a5f2d8e67
fix(list-box): correct button/description translations based on selection count (#2139)
The `ListBoxSelection` component now properly handles
translations for the clear button based on the selected items:

- Fix `buttonLabel` and `description` to use the same translation logic
- Add tests for custom translations in both `ComboBox` and `MultiSelect`
2025-03-23 11:28:06 -07:00
Eric Liu
9b61af0306
fix(list-box): set aria-disabled if disabled (#2125) (#2138)
Re-apply #2125 (reverted in #2130) to preserve `disabled` attribute.

Carbon styles depend on the `[disabled]` attribute. However, the `disabled`
attribute is not valid markup when applied to `div role="option"`. This PR
preserves the existing `disabled` attribute while also setting `aria-disabled`
to maintain accessibility.
2025-03-23 10:46:25 -07:00
Eric Liu
43511e09ec fix(text-area): allow visually hidden label (#2137)
This fixes an accessibility issue with `TextArea`.

Currently, if `hideLabel` is `true`, the label is not rendered at all.
The expected behavior is that it should be visually hidden while
still being available to screen readers.
2025-03-23 10:42:47 -07:00
Eric Liu
ca9beebaea
fix(radio-tile): allow standalone RadioTile usage (#2136)
Although `RadioTile` is meant to be used inside a `TileGroup`, it feels  
unpolished for standalone usage to crash due to a missing parent context.

This fixes `RadioTile` to fail open by providing a no-op `add: () => {}`  
when `TileGroup` context is not found.
2025-03-22 13:03:20 -07:00
Eric Liu
1462e300d6
fix(radio-button): forward focus, blur events (#2135)
As identified in #2131, `focus` and `blur` events should be
forwarded to the underlying `RadioButton` element.
2025-03-22 13:02:28 -07:00
Eric Liu
dd1338ffc4
fix(list-box-selection): fix aria-label for clear button (#2134)
`ListBoxSelection`, used by `MultiSelect` and `ComboBox`, currently  
applies the wrong `aria-label` for the clear selection button. It uses
the `translateId` (e.g., `"clearAll"`) instead of the user-friendly copy.
2025-03-22 12:59:16 -07:00
Eric Liu
199bb0eb8e
Revert "fix(list-box): use aria-disabled instead of invalid disabled attribute" (#2130)
This reverts commit e1b3ef22c9.
2025-03-19 13:05:28 -07:00
Eric Liu
e7939ff0e2
fix(multi-select): fix keyboard navigation for disabled items (#2129)
Fixes #2128
2025-03-19 12:43:46 -07:00
Eric Liu
5987b61a55
fix(theme): remove invalid themes prop from markup (#2127) 2025-03-19 12:43:33 -07:00
Eric Liu
e85d7efc5e
fix(notification): remove invalid kind prop from markup (#2126) 2025-03-19 12:43:23 -07:00
Eric Liu
e1b3ef22c9
fix(list-box): use aria-disabled instead of invalid disabled attribute (#2125) 2025-03-19 12:43:05 -07:00
Brian West
9e3d83031e
fix(combo-box): fix typing when refocusing input
Fixes a bug where the input `value` is immediately reset
when re-focusing the input. The `value` resetting is necessary
to support programmatically clearing the value, but it should
only execute if the input is not currently focused.
2025-03-19 10:29:13 -07:00
Eric Liu
7ff93ad2da
fix(ui-shell): HeaderAction uses dark color scheme (#2119) 2025-03-11 17:17:13 -07:00
Eric Liu
663b79ad05
fix(select): falsy item text should not override value (#2118)
Fixes #2117
2025-03-11 10:09:28 -07:00
Eric Liu
24b9cbc9c3
feat(ui-shell): HeaderAction supports tooltip (#2111)
Closes #2110
2025-03-09 13:47:34 -07:00
Eric Liu
7481b9a995
feat(data-table): allow custom inputName for radio/checkbox (#2087)
Closes #2085
2025-03-09 13:47:08 -07:00
Eric Liu
9b4bfa6f86
fix(select): avoid infinite update loop in Svelte 5 (#2108)
Fixes #2107
2025-03-06 18:36:22 -08:00
Eric Liu
b7297d452a
fix(overflow-menu): add aria-controls to trigger button (#2100) 2025-02-17 13:40:42 -08:00
Eric Liu
6e65ef39e7
fix(tag): allow on:close to work with Svelte 5 (#2097)
Fixes #2096
2025-02-04 14:28:58 -08:00
Eric Liu
6bf72d4602
fix(types): loosen icon prop type to any (#2095)
Fixes https://github.com/carbon-design-system/carbon-icons-svelte/issues/207

`carbon-icons-svelte@13` and `carbon-pictograms-svelte@13` now  
only support TypeScript for Svelte 4/5.

The new `Component` type is incompatible with the `icon` prop in  
`carbon-components-svelte`, causing a type error with Svelte 5, as  
`typeof SvelteComponent` doesn't match the new `Component` type.

Since `Component` isn't available in Svelte 3/4, this PR changes  
the `icon` prop type to `any` for compatibility across Svelte 3, 4, and 5.
2025-02-02 19:49:53 -08:00
Eric Liu
88f4304d5a fix(overflow-menu): support Svelte 5
Fixes #2092
2025-01-30 08:56:52 -08:00
bartosjiri ⚡
76eec84c54
fix(text-area): counter supports null value (#2089) 2025-01-22 11:16:18 -08:00
Eric Liu
fb6719b1ae fix(multi-select): avoid manual field blur
Fixes #2083
2025-01-19 17:38:25 -08:00
Eric Liu
c194c80e29 fix(dropdown): avoid manual field blur
Fixes #2083
2025-01-19 17:38:25 -08:00
Eric Liu
e874ac19d7 fix(data-table): improve expandable accessibility (#2086) 2025-01-19 17:38:25 -08:00
Eric Liu
dd6cbac3ee fix(data-table): prefix internal ID for radio button, checkbox (#2082)
Fixes #2081
2025-01-19 17:38:25 -08:00
Eric Liu
48afd18e5e
feat: add toHierarchy utility for TreeView, RecursiveList (#2072)
Co-authored-by: Bram <bramhavers@gmail.com>
2024-12-09 12:22:36 -08:00
Eric Liu
18c964e579
fix(tooltip-icon): button should have explicit type (#2071) 2024-12-08 11:00:30 -08:00
Paweł Malinowski
c3a390f3fe fix(multi-select): fix sorting behavior
- Menu items are sorted when the component renders.
- With selectionFeedback: top, selected items are immediately pinned to
  the top.
- With selectionFeedback: top-after-reopen, selected items are pinned to the top only
  after the dropdown is closed.
- With selectionFeedback: fixed, selected items are never pinned to the
  top.

Fixes #2066
2024-11-30 10:38:33 -08:00
Eric Liu
2a68b2947c chore(tree-view): remove inline comment breaking formatting 2024-11-23 15:26:39 -08:00
Eric Liu
e488c88371
fix(tree-view): do not flatten original nodes (#2056)
`$: nodes = traverse(nodes);` is unexpectedly mutating the original `nodes` reference used to render `TreeView`.

As a result, a tail leaf node is appended to the top-level list.

Flattening is necessary to obtain a reference to all node IDs (to programmatically show/hide nodes). This fix creates a new reference `flattenedNodes` instead of overriding the original `nodes`.
2024-11-22 13:24:43 -08:00
Eric Liu
8e996dc683 chore: format files with Prettier 3 2024-11-11 21:35:48 -08:00
Eric Liu
dd43224119
feat(data-table): support generics (#1954)
Co-authored-by: K.Kiyokawa <koichi20110068@gmail.com>
Co-authored-by: brunnerh <brunnerh@users.noreply.github.com>
2024-11-11 21:10:45 -08:00
Eric Liu
7e173943ac
fix(toolbar-menu): remove redundant menu offset for Svelte 5 compatibility (#2047)
Fixes #2040
2024-11-10 11:50:54 -08:00