Skip to content

Commit 0829358

Browse files
authored
Version 0.7.0 (#195)
* feat: change useStorage hook * fix: fix table updates * fix: fix resizing issues when hiding columns * feat: make Tooltip decomposable * fix: fix tool display setting its id to undefined * feat: add IconButton * chore: change naming of tag table filters * fix: fix build error
1 parent e5fc295 commit 0829358

53 files changed

Lines changed: 1544 additions & 800 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66
and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.7.0] - 2026-01-27
9+
10+
### Added
11+
- `ColumnSizingWithTargetFeature` and `AutoColumnOrderFeature` to Table for column size fixing and column ordering
12+
- `Tooltip` to `TableColumnSwitcher`
13+
- `forceMount` attribute to `Drawer`
14+
- `TooltipRoot`, `TooltipTrigger`, and `TooltipDisplay` to make it decomposable
15+
- `useResizeObserver` and `useScrollObserver` to react to resize and scroll events on HTMLElements
16+
- added these to the `AnchoredFloatingContainer` as options
17+
- `IconButton` to better capture the different accessibility requirements of both button types
18+
- use `IconButton` instead of buttons with `layout="icon"`
19+
20+
### Changed
21+
- `useLocalStorage` to be called `useStorage` and allow for listing to storage changes
22+
- `ThemeDialog` is now split into `ThemeSelect` and `ThemeIcon`
23+
- `useTransitionState` uses the window to get animations if no valid ref is provided, and it warns if a ref is provided and its value is null
24+
- names for Tablefilters
25+
- `tags` is now `multiTags`
26+
- `tagsSingle` is now `singleTag`
27+
28+
### Fixed
29+
- Table column sizing when toggling visibility and changing order
30+
831
## [0.6.16] - 2026-01-26
932

1033
### Fixed

‎locales/de-DE.arb‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
},
204204
"goodToSeeYou": "Schön dich zu sehen",
205205
"welcome": "Willkommen",
206-
"rSortingOrderAfter": "Angewendet {otherSortings, plural, =0{als primäre Sortierung} =1{nach # anderen Sortierung} other{nach # anderen Sortierungen}}",
206+
"rSortingOrderAfter": "Angewendet {otherSortings, plural, =0{als primäre Sortierung} =1{nach einer anderen Sortierung} other{nach # anderen Sortierungen}}",
207207
"@rSortingOrderAfter": {
208208
"placeholders": {
209209
"otherSortings": { "type": "number" }
@@ -220,6 +220,13 @@
220220
"unpin": "Loslösen",
221221
"pinLeft": "Links anheften",
222222
"pinRight": "Rechts anheften",
223+
"changeVisibility": "Sichtbarkeit ändern",
224+
"changePinning": "Anheften ändern",
225+
"changeSelection": "Auswahl ändern",
226+
"pinToRight": "Rechts anheften",
227+
"pinToLeft": "Links anheften",
228+
"increaseSortingPriority": "Sortierpriorität erhöhen",
229+
"decreaseSortingPriority": "Sortierpriorität verringern",
223230
"changeColumnDisplay": "Spaltenanzeige ändern",
224231
"caseSensitive": "Groß-/Klein beachten",
225232
"sorting": "Sortierung",

‎locales/en-US.arb‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,13 @@
221221
"unpin": "Unpin",
222222
"pinLeft": "Pin to left",
223223
"pinRight": "Pin to right",
224+
"changeVisibility": "Change visibility",
225+
"changePinning": "Change pinning",
226+
"changeSelection": "Change selection",
227+
"pinToRight": "Pin to right",
228+
"pinToLeft": "Pin to left",
229+
"increaseSortingPriority": "Increase sorting priority",
230+
"decreaseSortingPriority": "Decrease sorting priority",
224231
"caseSensitive": "Case Sensitive",
225232
"sorting": "Sorting",
226233
"sSortingState": "{sortDirection, select, asc{Sorting (Currently Ascending)} desc{Sorting (Currently Descending)} other{Sorting (Currently None)}}",

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "git+https://github.com/helpwave/hightide.git"
88
},
99
"license": "MPL-2.0",
10-
"version": "0.6.16",
10+
"version": "0.7.0",
1111
"files": [
1212
"dist"
1313
],

‎src/components/layout/AnchoredFloatingContainer.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ export type BackgroundOverlayProps = HTMLAttributes<HTMLDivElement>
88
export interface AnchoredFloatingContainerProps extends HTMLAttributes<HTMLDivElement> {
99
anchor?: RefObject<HTMLElement>,
1010
options?: UseAnchoredPositionOptions,
11+
active?: boolean,
1112
}
1213

1314
export const AnchoredFloatingContainer = forwardRef<HTMLDivElement, AnchoredFloatingContainerProps>(function FloatingContainer({
1415
children,
1516
anchor,
1617
options = {},
18+
active = true,
1719
...props
1820
}, forwardRef) {
1921
const innerRef = useRef<HTMLDivElement>(null)
@@ -23,6 +25,7 @@ export const AnchoredFloatingContainer = forwardRef<HTMLDivElement, AnchoredFloa
2325
...options,
2426
container: innerRef,
2527
anchor: anchor,
28+
active,
2629
})
2730

2831
return (

‎src/components/layout/Carousel.tsx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import React, {
1313
import clsx from 'clsx'
1414
import { ChevronLeft, ChevronRight } from 'lucide-react'
1515
import { createLoopingListWithIndex, range } from '@/src/utils/array'
16-
import { Button } from '../user-interaction/Button'
1716
import { useHightideTranslation } from '@/src/i18n/useHightideTranslation'
17+
import { IconButton } from '../user-interaction/IconButton'
1818

1919
//
2020
// CarouselContext
@@ -411,24 +411,24 @@ export const Carousel = ({
411411
)}
412412
{arrows && (
413413
<>
414-
<Button
415-
layout="icon"
414+
<IconButton
415+
tooltip={translation('previous')}
416416
color="neutral"
417417
className={clsx('absolute z-10 left-2 top-1/2 -translate-y-1/2 shadow-md', { hidden: !canGoLeft() })}
418418
disabled={!canGoLeft()}
419419
onClick={() => left()}
420420
>
421421
<ChevronLeft size={24}/>
422-
</Button>
423-
<Button
424-
layout="icon"
422+
</IconButton>
423+
<IconButton
424+
tooltip={translation('next')}
425425
color="neutral"
426426
className={clsx('absolute z-10 right-2 top-1/2 -translate-y-1/2 shadow-md', { hidden: !canGoRight() })}
427427
disabled={!canGoRight()}
428428
onClick={() => right()}
429429
>
430430
<ChevronRight size={24}/>
431-
</Button>
431+
</IconButton>
432432
</>
433433
)}
434434
</div>

‎src/components/layout/Drawer.tsx‎

Lines changed: 61 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { useOverlayRegistry } from '@/src/hooks/useOverlayRegistry'
33
import { useHightideTranslation } from '@/src/i18n/useHightideTranslation'
44
import type { ReactNode } from 'react'
55
import { forwardRef, useId, useImperativeHandle, useMemo, useRef, type HTMLAttributes } from 'react'
6-
import { createPortal } from 'react-dom'
76
import { Visibility } from './Visibility'
8-
import { Button } from '../user-interaction/Button'
97
import { X } from 'lucide-react'
108
import { useTransitionState } from '@/src/hooks/useTransitionState'
119
import { PropsUtil } from '@/src/utils/propsUtil'
10+
import { Portal } from '../utils/Portal'
11+
import { IconButton } from '../user-interaction/IconButton'
1212

1313
export type DrawerAligment = 'left' | 'right' | 'bottom' | 'top'
1414

@@ -21,6 +21,7 @@ export type DrawerProps = HTMLAttributes<HTMLDivElement> & {
2121
containerClassName?: string,
2222
backgroundClassName?: string,
2323
onClose: () => void,
24+
forceMount?: boolean,
2425
}
2526

2627
export const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer({
@@ -32,6 +33,7 @@ export const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer({
3233
containerClassName,
3334
backgroundClassName,
3435
onClose,
36+
forceMount = false,
3537
...props
3638
}, forwardedRef) {
3739
const translation = useHightideTranslation()
@@ -59,74 +61,76 @@ export const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer({
5961
})
6062
const depth = tagPositions && tagItemCounts ? ((tagItemCounts['drawer'] ?? 0) - (tagPositions['drawer'] ?? 0)) : 0
6163

62-
if (!isVisible) return
64+
if (!isVisible && !forceMount) return
6365

64-
return createPortal(
65-
<div
66-
id={ids.container}
67-
68-
data-name="drawer-container"
69-
data-open={PropsUtil.dataAttributes.bool(isOpen)}
70-
71-
className={containerClassName}
72-
style={{ zIndex, '--drawer-depth': depth.toString() } as React.CSSProperties}
73-
>
66+
return (
67+
<Portal>
7468
<div
75-
id={ids.background}
69+
id={ids.container}
7670

77-
onClick={onClose}
71+
data-name="drawer-container"
72+
data-open={PropsUtil.dataAttributes.bool(isOpen)}
7873

79-
data-name="drawer-background"
80-
data-state={transitionState}
81-
data-depth={depth}
82-
data-alignment={alignment}
74+
hidden={!isVisible && forceMount}
8375

84-
aria-hidden={true}
76+
className={containerClassName}
77+
style={{ zIndex, '--drawer-depth': depth.toString() } as React.CSSProperties}
78+
>
79+
<div
80+
id={ids.background}
8581

86-
className={backgroundClassName}
87-
/>
88-
<div
89-
{...props}
90-
id={ids.content}
91-
ref={ref}
82+
onClick={onClose}
9283

93-
onKeyDown={PropsUtil.aria.close(close)}
84+
data-name="drawer-background"
85+
data-state={transitionState}
86+
data-depth={depth}
87+
data-alignment={alignment}
9488

95-
data-name={PropsUtil.dataAttributes.name('drawer-content', props)}
96-
data-state={transitionState}
97-
data-depth={depth}
98-
data-alignment={alignment}
89+
aria-hidden={true}
9990

100-
className={props.className}
101-
>
102-
<div className="typography-title-lg mr-8">
103-
{titleElement}
104-
</div>
105-
<Visibility isVisible={!!description}>
106-
<div className="text-description">
107-
{description}
108-
</div>
109-
</Visibility>
91+
className={backgroundClassName}
92+
/>
11093
<div
111-
className="absolute top-0 right-0"
112-
style={{
113-
paddingTop: 'inherit',
114-
paddingRight: 'inherit'
115-
}}
94+
{...props}
95+
id={ids.content}
96+
ref={ref}
97+
98+
onKeyDown={PropsUtil.aria.close(close)}
99+
100+
data-name={PropsUtil.dataAttributes.name('drawer-content', props)}
101+
data-state={transitionState}
102+
data-depth={depth}
103+
data-alignment={alignment}
104+
105+
className={props.className}
116106
>
117-
<Button
118-
layout="icon"
119-
color="neutral"
120-
size="xs"
121-
aria-label={translation('close')}
122-
onClick={onClose}
107+
<div className="typography-title-lg mr-8">
108+
{titleElement}
109+
</div>
110+
<Visibility isVisible={!!description}>
111+
<div className="text-description">
112+
{description}
113+
</div>
114+
</Visibility>
115+
<div
116+
className="absolute top-0 right-0"
117+
style={{
118+
paddingTop: 'inherit',
119+
paddingRight: 'inherit'
120+
}}
123121
>
124-
<X />
125-
</Button>
122+
<IconButton
123+
tooltip={translation('close')}
124+
coloringStyle="text"
125+
color="neutral"
126+
onClick={onClose}
127+
>
128+
<X size={24}/>
129+
</IconButton>
130+
</div>
131+
{children}
126132
</div>
127-
{children}
128133
</div>
129-
</div>
130-
, document.body
134+
</Portal>
131135
)
132136
})

‎src/components/layout/dialog/Dialog.tsx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { HTMLAttributes, ReactNode } from 'react'
44
import { forwardRef, useContext, useId, useImperativeHandle, useMemo, useRef } from 'react'
55
import { X } from 'lucide-react'
66
import { useHightideTranslation } from '@/src/i18n/useHightideTranslation'
7-
import { Button } from '@/src/components/user-interaction/Button'
87
import { useFocusTrap } from '@/src/hooks/focus/useFocusTrap'
98
import { useLogOnce } from '@/src/hooks/useLogOnce'
109
import { useOverlayRegistry } from '@/src/hooks/useOverlayRegistry'
@@ -16,6 +15,7 @@ import clsx from 'clsx'
1615
import { FocusTrap } from '../../utils/FocusTrap'
1716
import { usePresenceRef } from '@/src/hooks/usePresenceRef'
1817
import { DialogContext } from './DialogContext'
18+
import { IconButton } from '../../user-interaction/IconButton'
1919

2020
export type DialogPosition = 'top' | 'center' | 'none'
2121

@@ -151,15 +151,15 @@ export const Dialog = forwardRef<HTMLDivElement, DialogProps>(function Dialog({
151151
paddingRight: 'inherit'
152152
}}
153153
>
154-
<Button
155-
layout="icon"
156-
color="neutral"
154+
<IconButton
155+
tooltip={translation('closeDialog')}
157156
size="xs"
158-
aria-label={translation('closeDialog')}
157+
color="neutral"
158+
coloringStyle="text"
159159
onClick={onCloseWrapper}
160160
>
161-
<X />
162-
</Button>
161+
<X size={24}/>
162+
</IconButton>
163163
</div>
164164
</Visibility>
165165
{children}

0 commit comments

Comments
 (0)