@react-hive/honey-layout 9.11.0 → 9.12.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.
@@ -4,24 +4,28 @@ export type HoneyFlexProps<Element extends ElementType = 'div'> = HoneyBoxProps<
4
4
  /**
5
5
  * Enables horizontal (row) layout.
6
6
  *
7
- * When `true`, sets:
7
+ * When `true`, applies:
8
8
  * - `flex-direction: row`
9
9
  *
10
- * When `false` (default), uses:
10
+ * When `false` (default), applies:
11
11
  * - `flex-direction: column`
12
12
  *
13
+ * This prop is a semantic shortcut and can be overridden
14
+ * by explicitly providing `$flexDirection`.
15
+ *
13
16
  * @default false
14
17
  */
15
18
  row?: boolean;
16
19
  /**
17
- * Centers children both horizontally and vertically.
20
+ * Centers children along both axes.
18
21
  *
19
- * When enabled, sets:
22
+ * When enabled, applies:
20
23
  * - `align-items: center`
21
24
  * - `justify-content: center`
22
25
  *
23
- * This is a semantic shortcut and can be overridden
24
- * by explicitly providing `$alignItems` or `$justifyContent`.
26
+ * This is a semantic convenience prop intended for common
27
+ * centering scenarios. Explicit style props such as
28
+ * `$alignItems` or `$justifyContent` will always take precedence.
25
29
  *
26
30
  * @default false
27
31
  */
@@ -30,36 +34,38 @@ export type HoneyFlexProps<Element extends ElementType = 'div'> = HoneyBoxProps<
30
34
  /**
31
35
  * A flexbox-based layout primitive built on top of {@link HoneyBox}.
32
36
  *
33
- * `HoneyFlex` provides a minimal, opinionated default flex configuration
34
- * while remaining fully customizable through standard style props.
37
+ * `HoneyFlex` provides a minimal, opinionated flex container with sensible
38
+ * defaults, while remaining fully customizable via standard Honey style props.
35
39
  *
36
40
  * ### Default behavior
37
41
  * - `display: flex`
38
42
  * - `flex-direction: column`
39
43
  *
40
44
  * ### Semantic helpers
41
- * - `row` → switches layout to horizontal flow
45
+ * - `row` → switches layout to a horizontal flow
42
46
  * - `center` → centers content on both axes
43
47
  *
44
- * Explicit style props always take precedence over semantic helpers.
48
+ * Semantic helpers are designed for convenience and readability.
49
+ * Any explicitly provided style props always take precedence.
45
50
  *
46
51
  * @remarks
47
52
  * This component is intended to be the primary flex layout primitive
48
- * within the Honey design system.
53
+ * within the Honey design system and should be preferred over raw
54
+ * flexbox usage for consistency.
49
55
  *
50
56
  * @example Basic column layout
51
57
  * ```tsx
52
- * <HoneyFlex gap={2} />
58
+ * <HoneyFlex $gap={2} />
53
59
  * ```
54
60
  *
55
61
  * @example Horizontal layout
56
62
  * ```tsx
57
- * <HoneyFlex gap={3} row />
63
+ * <HoneyFlex row $gap={3} />
58
64
  * ```
59
65
  *
60
66
  * @example Fully centered content
61
67
  * ```tsx
62
- * <HoneyFlex minHeight="100vh" center>
68
+ * <HoneyFlex $minHeight="100vh" center>
63
69
  * <Spinner />
64
70
  * </HoneyFlex>
65
71
  * ```
package/dist/index.cjs CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  ${e.HONEY_BREAKPOINTS.map(h)};
15
15
  `}
16
- `,g=(0,e.styled)(y,({row:e=!1,center:t=!1,$display:n="flex",$flexDirection:r=(e?"row":"column"),$alignItems:o=(t?"center":void 0),$justifyContent:i=(t?"center":void 0),...u})=>({$display:n,$flexDirection:r,$alignItems:o,$justifyContent:i,"data-testid":u["data-testid"]??"honey-flex"}))``,b=g;var w=o(848),x=o(953),E=o.t(x,2);const R=(0,x.createContext)(void 0),O=(0,e.styled)(g)`
16
+ `,g=(0,e.styled)(y,({row:e=!1,center:t=!1,$display:n="flex",$flexDirection:r=(e?"row":"column"),$alignItems:o=(t?"center":void 0),$justifyContent:i=(!e&&t?"center":void 0),...u})=>({$display:n,$flexDirection:r,$alignItems:o,$justifyContent:i,"data-testid":u["data-testid"]??"honey-flex"}))``,b=g;var w=o(848),x=o(953),E=o.t(x,2);const R=(0,x.createContext)(void 0),O=(0,e.styled)(g)`
17
17
  ${({columns:t,takeColumns:n=1,spacing:r=0,applyMaxWidth:o,theme:i})=>{const u=`calc(${n*(100/t)}% - ${(0,e.resolveSpacing)(r,null)({theme:i})/t*(t-n)}px)`;return e.css`
18
18
  flex-basis: ${u};
19
19