@react-hive/honey-layout 17.7.0 → 17.8.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.
- package/dist/components/HoneyFlex/HoneyFlex.d.ts +21 -14
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +12 -7
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
|
@@ -7,28 +7,31 @@ export type HoneyFlexProps<Element extends ElementType = 'div'> = HoneyBoxProps<
|
|
|
7
7
|
* When enabled, this prop applies:
|
|
8
8
|
* - `display: inline-flex`
|
|
9
9
|
*
|
|
10
|
-
* When disabled
|
|
11
|
-
* -
|
|
10
|
+
* When disabled, the layout uses:
|
|
11
|
+
* - `$display`, when explicitly provided
|
|
12
|
+
* - otherwise `display: flex`
|
|
12
13
|
*
|
|
13
14
|
* This is a semantic convenience prop intended for inline alignment scenarios
|
|
14
15
|
* (e.g. buttons, badges, form controls).
|
|
15
16
|
*
|
|
16
|
-
*
|
|
17
|
+
* `inline` takes precedence over `$display`.
|
|
17
18
|
*
|
|
18
19
|
* @default false
|
|
19
20
|
*/
|
|
20
21
|
inline?: boolean;
|
|
21
22
|
/**
|
|
22
|
-
* Enables horizontal
|
|
23
|
+
* Enables horizontal row-based layout.
|
|
23
24
|
*
|
|
24
25
|
* When enabled, this prop applies:
|
|
25
26
|
* - `flex-direction: row`
|
|
26
27
|
*
|
|
27
|
-
* When disabled
|
|
28
|
-
* -
|
|
28
|
+
* When disabled, the layout uses:
|
|
29
|
+
* - `$flexDirection`, when explicitly provided
|
|
30
|
+
* - otherwise `flex-direction: column`
|
|
29
31
|
*
|
|
30
|
-
* This is a semantic convenience prop.
|
|
31
|
-
*
|
|
32
|
+
* This is a semantic convenience prop.
|
|
33
|
+
*
|
|
34
|
+
* `$flexDirection` takes precedence over `row`.
|
|
32
35
|
*
|
|
33
36
|
* @default false
|
|
34
37
|
*/
|
|
@@ -52,8 +55,8 @@ export type HoneyFlexProps<Element extends ElementType = 'div'> = HoneyBoxProps<
|
|
|
52
55
|
/**
|
|
53
56
|
* Centers children along the horizontal axis.
|
|
54
57
|
*
|
|
55
|
-
* - In column layouts: maps to `align-items: center`
|
|
56
|
-
* - In row layouts: maps to `justify-content: center`
|
|
58
|
+
* - In column and column-reverse layouts: maps to `align-items: center`
|
|
59
|
+
* - In row and row-reverse layouts: maps to `justify-content: center`
|
|
57
60
|
*
|
|
58
61
|
* Ignored if `center` is enabled or if the corresponding explicit style prop is provided.
|
|
59
62
|
*
|
|
@@ -63,8 +66,8 @@ export type HoneyFlexProps<Element extends ElementType = 'div'> = HoneyBoxProps<
|
|
|
63
66
|
/**
|
|
64
67
|
* Centers children along the vertical axis.
|
|
65
68
|
*
|
|
66
|
-
* - In column layouts: maps to `justify-content: center`
|
|
67
|
-
* - In row layouts: maps to `align-items: center`
|
|
69
|
+
* - In column and column-reverse layouts: maps to `justify-content: center`
|
|
70
|
+
* - In row and row-reverse layouts: maps to `align-items: center`
|
|
68
71
|
*
|
|
69
72
|
* Ignored if `center` is enabled or if the corresponding explicit style prop is provided.
|
|
70
73
|
*
|
|
@@ -94,7 +97,11 @@ export type HoneyFlexProps<Element extends ElementType = 'div'> = HoneyBoxProps<
|
|
|
94
97
|
* - `centerX`, `centerY` → axis-aware centering helpers
|
|
95
98
|
*
|
|
96
99
|
* Semantic helpers exist purely for convenience and readability.
|
|
97
|
-
*
|
|
100
|
+
*
|
|
101
|
+
* Precedence rules:
|
|
102
|
+
* - `inline` takes precedence over `$display`
|
|
103
|
+
* - `$flexDirection` takes precedence over `row`
|
|
104
|
+
* - `$alignItems` and `$justifyContent` take precedence over centering helpers
|
|
98
105
|
*
|
|
99
106
|
* ---
|
|
100
107
|
*
|
|
@@ -115,7 +122,7 @@ export type HoneyFlexProps<Element extends ElementType = 'div'> = HoneyBoxProps<
|
|
|
115
122
|
*
|
|
116
123
|
* @example Horizontal layout
|
|
117
124
|
* ```tsx
|
|
118
|
-
* <HoneyFlex $gap={2} row/>
|
|
125
|
+
* <HoneyFlex $gap={2} row />
|
|
119
126
|
* ```
|
|
120
127
|
*
|
|
121
128
|
* @example Column layout
|
package/dist/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
${e.HONEY_BREAKPOINTS.map(p)};
|
|
15
15
|
`}
|
|
16
|
-
`,m=new Set,h=(e,t)=>{m.has(e)||(m.add(e),console.warn(t))},y=(0,e.styled)(v,({inline:e=!1,row:n=!1,center:r=!1,centerX:o=!1,centerY:i=!1,$display:u,$flexDirection:c,$alignItems:s,$justifyContent:l,...a})=>{const f=e?"inline-flex":u??"flex",d=c??(n?"row":"column"),p="row"===d,v=r||(p?i
|
|
16
|
+
`,m=new Set,h=(e,t)=>{m.has(e)||(m.add(e),console.warn(t))},y=(0,e.styled)(v,({inline:e=!1,row:n=!1,center:r=!1,centerX:o=!1,centerY:i=!1,$display:u,$flexDirection:c,$alignItems:s,$justifyContent:l,...a})=>{const f=e?"inline-flex":u??"flex",d=c??(n?"row":"column"),p="row"===d||"row-reverse"===d,v="column"===d||"column-reverse"===d,m=r||(p?i:!!v&&o),y=r||(p?o:!!v&&i),g=s??(m?"center":void 0),b=l??(y?"center":void 0);if(t){const e=m&&void 0!==s,t=y&&void 0!==l;(e||t)&&h(`HoneyFlex:${e}:${t}`,["[@react-hive/honey-layout]: HoneyFlex.","Semantic centering props conflict with explicit flex alignment styles:",e&&" - align-items is controlled by both semantics and $alignItems",t&&" - justify-content is controlled by both semantics and $justifyContent","Explicit styles always win. Remove one side to silence this warning."].filter(Boolean).join("\n"))}return{$display:f,$flexDirection:d,$alignItems:g,$justifyContent:b,"data-testid":a["data-testid"]??"honey-flex"}})``;var g=n(684),b=n(953),x=n.t(b,2);const w=(0,b.createContext)(void 0),E=(0,e.styled)(y)`
|
|
17
17
|
${({columns:t,takeColumns:n=1,spacing:r=0,applyMaxWidth:o,applyBasis:i=!0,theme:u})=>{let c=null;return i&&(c=`calc(${n*(100/t)}% - ${(0,e.resolveSpacing)(r,null)({theme:u})/t*(t-n)}px)`),e.css`
|
|
18
18
|
flex-basis: ${c};
|
|
19
19
|
|