@react-hive/honey-layout 1.0.0-beta → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,16 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { DefaultTheme } from 'styled-components';
3
+ import { HoneyScreenState } from '../types';
4
+ import { UseHoneyMediaQueryOptions } from '../hooks';
5
+ type HoneyLayoutContextValue = {
6
+ screenState: HoneyScreenState;
7
+ };
8
+ type HoneyLayoutProviderContentProps = {
9
+ mediaQueryOptions?: UseHoneyMediaQueryOptions;
10
+ };
11
+ type HoneyLayoutProviderProps = HoneyLayoutProviderContentProps & {
12
+ theme: DefaultTheme;
13
+ };
14
+ export declare const HoneyLayoutProvider: ({ theme, ...props }: PropsWithChildren<HoneyLayoutProviderProps>) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const useHoneyLayout: () => HoneyLayoutContextValue;
16
+ export {};
@@ -0,0 +1,15 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { DefaultTheme } from 'styled-components';
3
+ type HoneyLayoutThemeOverrideProps = {
4
+ theme: DefaultTheme;
5
+ };
6
+ /**
7
+ * Provides a theme override context to its children.
8
+ * Merges the provided theme with the existing theme from the `ThemeContext`.
9
+ *
10
+ * @param {PropsWithChildren<HoneyLayoutThemeOverrideProps>} props - The props for `HoneyLayoutThemeOverride`.
11
+ *
12
+ * @returns The ThemeProvider with the merged theme applied to its children.
13
+ */
14
+ export declare const HoneyLayoutThemeOverride: ({ theme, ...props }: PropsWithChildren<HoneyLayoutThemeOverrideProps>) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -1 +1,2 @@
1
- export * from './HoneyThemeProvider';
1
+ export * from './HoneyLayoutProvider';
2
+ export * from './HoneyLayoutThemeOverride';
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ComponentType, ReactNode } from 'react';
2
- import { Interpolation } from 'styled-components';
2
+ import { DefaultTheme, Interpolation } from 'styled-components';
3
3
  import { DataType } from 'csstype';
4
4
  import * as CSS from 'csstype';
5
5
  export type TimeoutId = ReturnType<typeof setTimeout>;
@@ -74,7 +74,7 @@ export type HoneyCSSMediaRule = {
74
74
  update?: 'none' | 'slow' | 'fast';
75
75
  };
76
76
  /**
77
- * Represents the breakpoints configuration for a responsive layout.
77
+ * Represents the breakpoints configuration in pixes for a responsive layout.
78
78
  *
79
79
  * Notes:
80
80
  * - `xs`: Extra small devices
@@ -97,7 +97,7 @@ export type HoneyBreakpointName = keyof HoneyBreakpoints;
97
97
  * @template CSSProperty - The CSS property this function will generate a value for.
98
98
  */
99
99
  type HoneyCSSPropertyValueFn<CSSProperty extends keyof CSS.Properties> = (props: {
100
- theme: HoneyTheme;
100
+ theme: DefaultTheme;
101
101
  }) => CSS.Properties[CSSProperty];
102
102
  /**
103
103
  * Type representing numeric values for CSS dimension properties.
@@ -238,7 +238,7 @@ export interface BaseHoneyColors {
238
238
  * ```typescript
239
239
  * declare module '@react-hive/honey-layout' {
240
240
  * interface HoneyColors {
241
- * neutral: Record<'charcoalDark' | 'charcoalGray' | 'crimsonRed', HoneyColor>;
241
+ * neutral: Record<'charcoalDark' | 'charcoalGray' | 'crimsonRed', HoneyCSSColor>;
242
242
  * }
243
243
  * }
244
244
  * ```
@@ -256,8 +256,8 @@ export interface HoneyColors extends BaseHoneyColors {
256
256
  * Given the `HoneyColors` interface:
257
257
  * ```typescript
258
258
  * interface HoneyColors {
259
- * primary: Record<'blue' | 'green', HoneyColor>;
260
- * neutral: Record<'charcoalDark' | 'charcoalGray' | 'crimsonRed', HoneyColor>;
259
+ * primary: Record<'blue' | 'green', HoneyCSSColor>;
260
+ * neutral: Record<'charcoalDark' | 'charcoalGray' | 'crimsonRed', HoneyCSSColor>;
261
261
  * }
262
262
  * ```
263
263
  *
@@ -342,7 +342,7 @@ export type ComponentWithAs<T, P = object> = {
342
342
  as?: string | ComponentType<P>;
343
343
  } & T;
344
344
  export type HoneyModifierResultFn = () => Interpolation<{
345
- theme: HoneyTheme;
345
+ theme: DefaultTheme;
346
346
  }>;
347
347
  export type HoneyModifier<Config = unknown> = (config?: Config) => HoneyModifierResultFn;
348
348
  /**
package/dist/utils.d.ts CHANGED
@@ -90,7 +90,7 @@ export declare const getTransformationValues: (element: HTMLElement) => {
90
90
  *
91
91
  * @returns A flat array of items, excluding the nested list key and including `depthLevel`, `parentId`, and `totalNestedItems` properties.
92
92
  */
93
- export declare const flattenNestedList: <OriginItem extends object>(items: OriginItem[] | undefined, itemIdKey: KeysWithNonArrayValues<OriginItem>, nestedItemsKey: KeysWithArrayValues<OriginItem>, result?: HoneyFlattenedItem<OriginItem, KeysWithArrayValues<OriginItem>>[], parentId?: OriginItem[KeysWithNonArrayValues<OriginItem>] | undefined, depthLevel?: number) => HoneyFlattenedItem<OriginItem, KeysWithArrayValues<OriginItem>>[];
93
+ export declare const flattenNestedList: <OriginItem extends object>(items: OriginItem[] | undefined, itemIdKey: KeysWithNonArrayValues<OriginItem>, nestedItemsKey: KeysWithArrayValues<OriginItem>, result?: HoneyFlattenedItem<OriginItem, typeof nestedItemsKey>[], parentId?: OriginItem[KeysWithNonArrayValues<OriginItem>] | undefined, depthLevel?: number) => HoneyFlattenedItem<OriginItem, typeof nestedItemsKey>[];
94
94
  /**
95
95
  * Filters flattened items based on the specified parent ID and an optional predicate.
96
96
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-hive/honey-layout",
3
- "version": "1.0.0-beta",
3
+ "version": "1.0.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "react",
@@ -33,7 +33,7 @@
33
33
  "@mdx-js/react": "3.0.1",
34
34
  "react": "18.2.0",
35
35
  "react-dom": "18.2.0",
36
- "react-router-dom": "6.24.1",
36
+ "react-router-dom": "6.26.1",
37
37
  "styled-components": "5.3.9",
38
38
  "highlight.js": "11.10.0"
39
39
  },
@@ -45,9 +45,9 @@
45
45
  "devDependencies": {
46
46
  "@testing-library/react": "16.0.0",
47
47
  "@types/jest": "29.5.12",
48
- "@typescript-eslint/eslint-plugin": "7.16.0",
49
- "@typescript-eslint/parser": "7.16.0",
50
- "@types/react": "18.2.78",
48
+ "@typescript-eslint/eslint-plugin": "7.18.0",
49
+ "@typescript-eslint/parser": "7.18.0",
50
+ "@types/react": "18.2.79",
51
51
  "@types/react-dom": "18.2.25",
52
52
  "@types/styled-components": "5.1.34",
53
53
  "@types/mdx": "2.0.13",
@@ -64,10 +64,10 @@
64
64
  "jest": "29.7.0",
65
65
  "jest-environment-jsdom": "29.7.0",
66
66
  "prettier": "3.3.3",
67
- "ts-jest": "29.2.4",
68
- "typescript": "5.4.5",
69
- "vite": "5.4.0",
70
- "vite-plugin-dts": "4.0.2",
67
+ "ts-jest": "29.2.5",
68
+ "typescript": "5.5.4",
69
+ "vite": "5.4.2",
70
+ "vite-plugin-dts": "4.1.0",
71
71
  "vite-plugin-checker": "0.7.2"
72
72
  },
73
73
  "jest": {
@@ -1,14 +0,0 @@
1
- import { PropsWithChildren, JSX } from 'react';
2
- import { DefaultTheme } from 'styled-components';
3
- type HoneyThemeProviderProps = {
4
- theme: DefaultTheme;
5
- };
6
- /**
7
- * Component for providing a merged theme to its children.
8
- * Merges the provided theme with the current theme from the context.
9
- *
10
- * @param {PropsWithChildren<HoneyThemeProviderProps>} props - Props containing the theme object.
11
- * @returns {JSX.Element} - The wrapped children with the merged theme.
12
- */
13
- export declare const HoneyThemeProvider: ({ children, theme, }: PropsWithChildren<HoneyThemeProviderProps>) => JSX.Element;
14
- export {};