Skip to content

Commit 26757d4

Browse files
authored
Merge pull request #86 from helpwave/version-0.1.27
version-0.1.27
2 parents 1ad439d + d64ad13 commit 26757d4

41 files changed

Lines changed: 911 additions & 491 deletions

Some content is hidden

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

.storybook/preview.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import type { Preview } from '@storybook/nextjs'
22
import '../src/style/globals.css'
33
import './storybookStyleOverrides.css'
4-
import { useEffect } from 'react'
5-
import { ThemeProvider, useTheme } from '../src/theming/useTheme'
4+
import { ThemeProvider } from '../src/theming/useTheme'
65
import { LanguageProvider } from '../src/localization/LanguageProvider'
76

87
const preview: Preview = {
@@ -33,15 +32,6 @@ const preview: Preview = {
3332
(Story, context) => {
3433
const App = Story
3534
const theme = context.globals.backgrounds?.value
36-
const { setTheme } = useTheme()
37-
38-
useEffect(() => {
39-
if(!theme) {
40-
return
41-
}
42-
setTheme(theme)
43-
}, [theme]) // eslint-disable-line react-hooks/exhaustive-deps
44-
4535
const language = context.globals.language
4636

4737
return (

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,20 @@ 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.1.26] - 2025-07-23
8+
## [0.1.27] - 2025-09-29
9+
10+
### Added
11+
- Add a theme preference listener to `useTheme` hook
12+
- Add icons to the Theme dialog
13+
- Add a config attribute to the `SelectRoot` component
14+
- Add `Navigation` and `NavigationList` components for reusable Navigation menus
15+
- Add accessibility for carousel
16+
17+
### Changed
18+
- move `isMultiSelect` attribute of `SelectRoot` into the config `SelectConfiguration`
19+
- split `layout-and-navigation` into `layout` and `navigation` (same for stories)
20+
21+
## [0.1.26] - 2025-09-24
922

1023
### Added
1124
- Add `FloatingContainer` and `useFloatingElement` for aligning a floating element

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.1.26",
10+
"version": "0.1.27",
1111
"files": [
1212
"dist"
1313
],

src/components/date/YearMonthPicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Scrollbars } from 'react-custom-scrollbars-2'
33
import { noop } from '@/src/utils/noop'
44
import { equalSizeGroups, range } from '@/src/utils/array'
55
import clsx from 'clsx'
6-
import { ExpandableUncontrolled } from '../layout-and-navigation/Expandable'
6+
import { ExpandableUncontrolled } from '@/src/components/layout/Expandable'
77
import { addDuration, monthsList, subtractDuration } from '@/src/utils/date'
88
import { useLocale } from '../../localization/LanguageProvider'
99
import { SolidButton } from '../user-action/Button'

src/components/dialog/Dialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { X } from 'lucide-react'
55
import { useTranslation } from '@/src/localization/useTranslation'
66
import { formTranslation } from '@/src/localization/defaults/form'
77
import { IconButton } from '@/src/components/user-action/Button'
8-
import type { FloatingContainerProps } from '@/src/components/layout-and-navigation/FloatingContainer'
9-
import { FloatingContainer } from '@/src/components/layout-and-navigation/FloatingContainer'
8+
import type { FloatingContainerProps } from '@/src/components/layout/FloatingContainer'
9+
import { FloatingContainer } from '@/src/components/layout/FloatingContainer'
1010
import { useFocusTrap } from '@/src/hooks/focus/useFocusTrap'
1111
import { useLogOnce } from '@/src/hooks/useLogOnce'
1212

src/components/dialog/ThemeDialog.tsx

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,28 @@ import type { FormTranslationType } from '../../localization/defaults/form'
99
import { formTranslation } from '../../localization/defaults/form'
1010
import type { DialogProps } from '@/src/components/dialog/Dialog'
1111
import { Dialog } from '@/src/components/dialog/Dialog'
12+
import { MonitorCog, MoonIcon, SunIcon } from 'lucide-react'
13+
import clsx from 'clsx'
14+
15+
type ThemeIconProps = {
16+
theme: ThemeType,
17+
className?: string,
18+
}
19+
const ThemeIcon = ({ theme, className }: ThemeIconProps) => {
20+
if (theme === 'dark') {
21+
return (
22+
<MoonIcon className={clsx('w-4 h-4', className)}/>
23+
)
24+
} else if (theme === 'light') {
25+
return (
26+
<SunIcon className={clsx('w-4 h-4', className)}/>
27+
)
28+
} else {
29+
return (
30+
<MonitorCog className={clsx('w-4 h-4', className)}/>
31+
)
32+
}
33+
}
1234

1335
type ThemeDialogTranslationAddon = {
1436
chooseTheme: string,
@@ -18,10 +40,10 @@ type ThemeDialogTranslation = ThemeDialogTranslationAddon & ThemeTypeTranslation
1840

1941
const defaultConfirmDialogTranslation: Translation<ThemeDialogTranslationAddon> = {
2042
en: {
21-
chooseTheme: 'Choose your preferred theme',
43+
chooseTheme: 'Choose your preferred color theme.',
2244
},
2345
de: {
24-
chooseTheme: 'Wähle dein bevorzugtes Farbschema',
46+
chooseTheme: 'Wähle dein bevorzugtes Farbschema.',
2547
}
2648
}
2749

@@ -56,15 +78,28 @@ export const ThemeDialog = ({
5678
<Select
5779
value={theme}
5880
onValueChanged={(theme) => setTheme(theme as ThemeType)}
81+
iconAppearance="right"
5982
contentPanelProps={{
6083
className: 'z-100'
6184
}}
6285
buttonProps={{
63-
selectedDisplay: (value) => translation(value as ThemeType)
86+
selectedDisplay: (value) => (
87+
<div className="flex-row-2 items-center">
88+
<ThemeIcon theme={theme}/>
89+
{translation(value as ThemeType)}
90+
</div>
91+
),
92+
className: 'min-w-32',
6493
}}
6594
>
66-
{ThemeUtil.themes.map((theme) =>
67-
<SelectOption key={theme} value={theme}>{translation(theme)}</SelectOption>)}
95+
{ThemeUtil.themes.map((theme) => (
96+
<SelectOption key={theme} value={theme} className="gap-x-6 justify-between">
97+
<div className="flex-row-2 items-center">
98+
<ThemeIcon theme={theme}/>
99+
{translation(theme as ThemeType)}
100+
</div>
101+
</SelectOption>
102+
))}
68103
</Select>
69104
<div className="flex-row-4 mt-3 justify-end">
70105
<SolidButton autoFocus color="positive" onClick={onClose}>

0 commit comments

Comments
 (0)