Skip to content

Commit 599b8b5

Browse files
Development (#267)
* Feature/throttle updates and responsive bug (#241) * Fixing throttle updates and resposnive issue * Updating package and changelog with locales * Small refactor * Updating changelog * 248 reported delays with card updates (#249) * Updates with timecard issues * Fixed bug where ticking function wouldn't update the clock if no entity or other props are provided * Optimsations with tooltip * updating log * Updating changelog * Reverting time card story changes * Typo * Locales, prettier & bumping version * Optional breakpoints (#263) * WIP on 253-add-useruser-hook * Cleanup * Adding case where the window context from match media is null * Add useUser hook (#260) * Adding useUser hook and documentation * adding temp alias * Upgrading storybook * Removing framer motion (#265) * Removing framer motion * Moving AutoHeight to shared directory * Removing redundant state variable * Small performance optimisation * Updating locales * Ready for release
1 parent 4b8e354 commit 599b8b5

File tree

129 files changed

+92515
-88312
lines changed

Some content is hidden

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

129 files changed

+92515
-88312
lines changed

.storybook/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export default ({
5454
"@hooks": ["packages/core/src/hooks"],
5555
"@utils/*": ["packages/core/src/utils/*"],
5656
"@typings": ["packages/core/src/types"],
57+
'@stories/*': ['stories/*'],
5758
}
5859
},
5960
}

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
# 5.1.0
2+
3+
### @hakit/components
4+
- NEW - Modal position - Now positioned centered within the screen vertically
5+
- BREAKING - `framer-motion` has been removed entirely as a core dependency, this was previously used to animate the modals and other components, most of the main animations are still supported visually, the main ones that will change are the expand/collapse scale animation from the card to the modal, Custom logic for the Group component to maintain the "expand" / "collapse" animations, Added custom scale functionality to mimic what framer-motion does with whileTap - solves [issue](https://github.com/shannonhochkins/ha-component-kit/issues/209)
6+
- BREAKING - `breakpoints`, `setBreakpoints` have been moved to the themeStore and out of @hakit/core, nothing in @hakit/core consumes or uses these values, so it makes sense to move to the components package and set via the ThemeProvider
7+
- NEW - Breakpoints can now be disabled or edited with a smaller pool of breakpoints, or no breakpoints at all, this is useful if you're using a custom theme and want to disable the breakpoints entirely, or if you want to use a smaller set of breakpoints without having to configure all of them. This has all been documented in storybook - solves [issue](https://github.com/shannonhochkins/ha-component-kit/issues/244)
8+
9+
### @hakit/core
10+
- IMPROVEMENT - Error handling on setBreakpoints if the user provided invalid breakpoint values as values should be provided in a linear format
11+
- PERFORMANCE - optimisation to useBreakpoint, now state will only update when any of the matches change
12+
- BUGFIX - If switching window context dynamically, the window match logic will not work and will have to shift midway, this has been addressed
13+
- NEW - introduced onDisconnect callback for HassConnect options
14+
- NEW - Added retry connection functionality when the connection is lost for long running dashboards
15+
- NEW - Locale functionality moved to it's own component to fetch these before render
16+
- NEW - useUser - a new hook to return the current user of the dashboard logged in at the time - [issue](https://github.com/shannonhochkins/ha-component-kit/issues/253)
17+
- NEW - Updated locales to match latest home assistant release
18+
19+
20+
### General
21+
22+
- CHORE - Updated storybook to latest
23+
- DOCS - Added documentation to related hooks and methods to retrieve a user, useUser hook exposed, and getUser method still available from useHass
24+
- DOCS - Simplified other related docs
25+
- DOCS - Documented custom breakpoints
26+
27+
128
# 5.0.9
229

330
### @hakit/components

hass-connect-fake/index.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ import { mockCallApi } from './mocks/fake-call-api';
3434
import reolinkSnapshot from './assets/reolink-snapshot.jpg';
3535
import { logs } from './mocks/mockLogs';
3636
import {dailyForecast, hourlyForecast} from './mocks/mockWeather';
37-
import { DEFAULT_BREAKPOINTS } from '../packages/core/src/HassConnect/HassContext'
38-
3937
interface HassProviderProps {
4038
children: (ready: boolean) => ReactNode;
4139
hassUrl: string;
@@ -289,6 +287,13 @@ const useStore = create<Store>((set) => ({
289287
auth: fakeAuth,
290288
setAuth: (auth) => set({ auth }),
291289
config: fakeConfig,
290+
user: {
291+
id: '',
292+
is_admin: false,
293+
is_owner: false,
294+
name: 'Joe Bloggs',
295+
},
296+
setUser: (user) => set({ user }),
292297
setConfig: (config) => {
293298
set((state) => {
294299
if (state.connection && 'mockEvent' in state.connection && config) {
@@ -311,13 +316,6 @@ const useStore = create<Store>((set) => ({
311316
callApi: async (): Promise<unknown> => {
312317
return {};
313318
},
314-
/** getter for breakpoints, if using @hakit/components, the breakpoints are stored here to retrieve in different locations */
315-
breakpoints: DEFAULT_BREAKPOINTS,
316-
/** setter for breakpoints, if using @hakit/components, the breakpoints are stored here to retrieve in different locations */
317-
setBreakpoints: (breakpoints) => set({ breakpoints: {
318-
...breakpoints,
319-
xlg: breakpoints.lg + 1,
320-
} }),
321319
globalComponentStyles: {},
322320
setGlobalComponentStyles: (globalComponentStyles) => set({ globalComponentStyles }),
323321
}))

0 commit comments

Comments
 (0)