@fringeworks/style-layouts 0.0.0-stage → 0.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.
Files changed (267) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja.md +331 -0
  3. package/README.md +331 -3
  4. package/_constants.cjs +327 -0
  5. package/_constants.d.cts +237 -0
  6. package/_constants.d.mts +237 -0
  7. package/_constants.mjs +275 -0
  8. package/_internal/applyGap.cjs +30 -0
  9. package/_internal/applyGap.d.cts +12 -0
  10. package/_internal/applyGap.d.mts +13 -0
  11. package/_internal/applyGap.mjs +30 -0
  12. package/_internal/applyItemCount.cjs +20 -0
  13. package/_internal/applyItemCount.d.cts +5 -0
  14. package/_internal/applyItemCount.d.mts +6 -0
  15. package/_internal/applyItemCount.mjs +20 -0
  16. package/_internal/applyItemRatio.cjs +21 -0
  17. package/_internal/applyItemRatio.d.cts +11 -0
  18. package/_internal/applyItemRatio.d.mts +12 -0
  19. package/_internal/applyItemRatio.mjs +21 -0
  20. package/_internal/applyItemSize.cjs +21 -0
  21. package/_internal/applyItemSize.d.cts +5 -0
  22. package/_internal/applyItemSize.d.mts +6 -0
  23. package/_internal/applyItemSize.mjs +21 -0
  24. package/_internal/hasValue.cjs +15 -0
  25. package/_internal/hasValue.d.cts +8 -0
  26. package/_internal/hasValue.d.mts +9 -0
  27. package/_internal/hasValue.mjs +14 -0
  28. package/_internal/mergeClassName.cjs +11 -0
  29. package/_internal/mergeClassName.d.cts +3 -0
  30. package/_internal/mergeClassName.d.mts +4 -0
  31. package/_internal/mergeClassName.mjs +10 -0
  32. package/_internal/mergeLayoutResults.cjs +16 -0
  33. package/_internal/mergeLayoutResults.d.cts +5 -0
  34. package/_internal/mergeLayoutResults.d.mts +6 -0
  35. package/_internal/mergeLayoutResults.mjs +16 -0
  36. package/_internal/unit.cjs +9 -0
  37. package/_internal/unit.d.cts +11 -0
  38. package/_internal/unit.d.mts +12 -0
  39. package/_internal/unit.mjs +8 -0
  40. package/_styles.scss.cjs +1 -0
  41. package/_styles.scss.d.cts +1 -0
  42. package/_styles.scss.d.mts +1 -0
  43. package/_styles.scss.mjs +3 -0
  44. package/_types.cjs +0 -0
  45. package/_types.d.cts +115 -0
  46. package/_types.d.mts +115 -0
  47. package/_types.mjs +1 -0
  48. package/_virtual/_rolldown/runtime.cjs +29 -0
  49. package/balance/balance.cjs +37 -0
  50. package/balance/balance.d.cts +13 -0
  51. package/balance/balance.d.mts +14 -0
  52. package/balance/balance.mjs +35 -0
  53. package/balance/index.cjs +3 -0
  54. package/balance/index.d.cts +3 -0
  55. package/balance/index.d.mts +3 -0
  56. package/balance/index.mjs +3 -0
  57. package/balance/styles.css +131 -0
  58. package/balance/types.cjs +0 -0
  59. package/balance/types.d.cts +21 -0
  60. package/balance/types.d.mts +21 -0
  61. package/balance/types.mjs +1 -0
  62. package/center/center.cjs +34 -0
  63. package/center/center.d.cts +12 -0
  64. package/center/center.d.mts +13 -0
  65. package/center/center.mjs +32 -0
  66. package/center/index.cjs +3 -0
  67. package/center/index.d.cts +3 -0
  68. package/center/index.d.mts +3 -0
  69. package/center/index.mjs +3 -0
  70. package/center/styles.css +157 -0
  71. package/center/types.cjs +0 -0
  72. package/center/types.d.cts +9 -0
  73. package/center/types.d.mts +9 -0
  74. package/center/types.mjs +1 -0
  75. package/constants.cjs +109 -0
  76. package/constants.d.cts +112 -0
  77. package/constants.d.mts +112 -0
  78. package/constants.mjs +101 -0
  79. package/flow/flow.cjs +71 -0
  80. package/flow/flow.d.cts +12 -0
  81. package/flow/flow.d.mts +13 -0
  82. package/flow/flow.mjs +69 -0
  83. package/flow/index.cjs +3 -0
  84. package/flow/index.d.cts +3 -0
  85. package/flow/index.d.mts +3 -0
  86. package/flow/index.mjs +3 -0
  87. package/flow/styles.css +160 -0
  88. package/flow/types.cjs +0 -0
  89. package/flow/types.d.cts +21 -0
  90. package/flow/types.d.mts +21 -0
  91. package/flow/types.mjs +1 -0
  92. package/helpers/_internal/constants.cjs +25 -0
  93. package/helpers/_internal/constants.d.cts +13 -0
  94. package/helpers/_internal/constants.d.mts +13 -0
  95. package/helpers/_internal/constants.mjs +16 -0
  96. package/helpers/_internal/createExtractLayoutOptions.cjs +25 -0
  97. package/helpers/_internal/createExtractLayoutOptions.d.cts +8 -0
  98. package/helpers/_internal/createExtractLayoutOptions.d.mts +9 -0
  99. package/helpers/_internal/createExtractLayoutOptions.mjs +24 -0
  100. package/helpers/extractBalanceOptions.cjs +15 -0
  101. package/helpers/extractBalanceOptions.d.cts +5 -0
  102. package/helpers/extractBalanceOptions.d.mts +6 -0
  103. package/helpers/extractBalanceOptions.mjs +15 -0
  104. package/helpers/extractCenterOptions.cjs +14 -0
  105. package/helpers/extractCenterOptions.d.cts +6 -0
  106. package/helpers/extractCenterOptions.d.mts +7 -0
  107. package/helpers/extractCenterOptions.mjs +14 -0
  108. package/helpers/extractFlowOptions.cjs +15 -0
  109. package/helpers/extractFlowOptions.d.cts +6 -0
  110. package/helpers/extractFlowOptions.d.mts +7 -0
  111. package/helpers/extractFlowOptions.mjs +15 -0
  112. package/helpers/extractLayerOptions.cjs +13 -0
  113. package/helpers/extractLayerOptions.d.cts +6 -0
  114. package/helpers/extractLayerOptions.d.mts +7 -0
  115. package/helpers/extractLayerOptions.mjs +13 -0
  116. package/helpers/extractMatrixOptions.cjs +17 -0
  117. package/helpers/extractMatrixOptions.d.cts +5 -0
  118. package/helpers/extractMatrixOptions.d.mts +6 -0
  119. package/helpers/extractMatrixOptions.mjs +17 -0
  120. package/helpers/extractPackOptions.cjs +8 -0
  121. package/helpers/extractPackOptions.d.cts +6 -0
  122. package/helpers/extractPackOptions.d.mts +7 -0
  123. package/helpers/extractPackOptions.mjs +8 -0
  124. package/helpers/extractPinOptions.cjs +8 -0
  125. package/helpers/extractPinOptions.d.cts +6 -0
  126. package/helpers/extractPinOptions.d.mts +7 -0
  127. package/helpers/extractPinOptions.mjs +8 -0
  128. package/helpers/extractStackOptions.cjs +15 -0
  129. package/helpers/extractStackOptions.d.cts +6 -0
  130. package/helpers/extractStackOptions.d.mts +7 -0
  131. package/helpers/extractStackOptions.mjs +15 -0
  132. package/helpers/extractTileOptions.cjs +15 -0
  133. package/helpers/extractTileOptions.d.cts +6 -0
  134. package/helpers/extractTileOptions.d.mts +7 -0
  135. package/helpers/extractTileOptions.mjs +15 -0
  136. package/helpers/index.cjs +20 -0
  137. package/helpers/index.d.cts +10 -0
  138. package/helpers/index.d.mts +10 -0
  139. package/helpers/index.mjs +11 -0
  140. package/index.cjs +20 -0
  141. package/index.d.cts +20 -0
  142. package/index.d.mts +20 -0
  143. package/index.mjs +11 -0
  144. package/layer/index.cjs +3 -0
  145. package/layer/index.d.cts +3 -0
  146. package/layer/index.d.mts +3 -0
  147. package/layer/index.mjs +3 -0
  148. package/layer/layer.cjs +34 -0
  149. package/layer/layer.d.cts +13 -0
  150. package/layer/layer.d.mts +14 -0
  151. package/layer/layer.mjs +32 -0
  152. package/layer/styles.css +56 -0
  153. package/layer/types.cjs +0 -0
  154. package/layer/types.d.cts +13 -0
  155. package/layer/types.d.mts +13 -0
  156. package/layer/types.mjs +1 -0
  157. package/matrix/index.cjs +3 -0
  158. package/matrix/index.d.cts +3 -0
  159. package/matrix/index.d.mts +3 -0
  160. package/matrix/index.mjs +3 -0
  161. package/matrix/matrix.cjs +110 -0
  162. package/matrix/matrix.d.cts +12 -0
  163. package/matrix/matrix.d.mts +13 -0
  164. package/matrix/matrix.mjs +108 -0
  165. package/matrix/styles.css +141 -0
  166. package/matrix/types.cjs +0 -0
  167. package/matrix/types.d.cts +46 -0
  168. package/matrix/types.d.mts +46 -0
  169. package/matrix/types.mjs +1 -0
  170. package/pack/index.cjs +3 -0
  171. package/pack/index.d.cts +3 -0
  172. package/pack/index.d.mts +3 -0
  173. package/pack/index.mjs +3 -0
  174. package/pack/pack.cjs +25 -0
  175. package/pack/pack.d.cts +11 -0
  176. package/pack/pack.d.mts +12 -0
  177. package/pack/pack.mjs +23 -0
  178. package/pack/styles.css +35 -0
  179. package/pack/types.cjs +0 -0
  180. package/pack/types.d.cts +6 -0
  181. package/pack/types.d.mts +6 -0
  182. package/pack/types.mjs +1 -0
  183. package/package.json +52 -4
  184. package/pin/index.cjs +3 -0
  185. package/pin/index.d.cts +3 -0
  186. package/pin/index.d.mts +3 -0
  187. package/pin/index.mjs +3 -0
  188. package/pin/pin.cjs +23 -0
  189. package/pin/pin.d.cts +11 -0
  190. package/pin/pin.d.mts +12 -0
  191. package/pin/pin.mjs +23 -0
  192. package/pin/styles.css +19 -0
  193. package/pin/types.cjs +0 -0
  194. package/pin/types.d.cts +6 -0
  195. package/pin/types.d.mts +6 -0
  196. package/pin/types.mjs +1 -0
  197. package/stack/index.cjs +3 -0
  198. package/stack/index.d.cts +3 -0
  199. package/stack/index.d.mts +3 -0
  200. package/stack/index.mjs +3 -0
  201. package/stack/stack.cjs +96 -0
  202. package/stack/stack.d.cts +11 -0
  203. package/stack/stack.d.mts +12 -0
  204. package/stack/stack.mjs +94 -0
  205. package/stack/styles.css +167 -0
  206. package/stack/types.cjs +0 -0
  207. package/stack/types.d.cts +21 -0
  208. package/stack/types.d.mts +21 -0
  209. package/stack/types.mjs +1 -0
  210. package/styles.css +1055 -0
  211. package/tile/index.cjs +3 -0
  212. package/tile/index.d.cts +3 -0
  213. package/tile/index.d.mts +3 -0
  214. package/tile/index.mjs +3 -0
  215. package/tile/styles.css +181 -0
  216. package/tile/tile.cjs +36 -0
  217. package/tile/tile.d.cts +12 -0
  218. package/tile/tile.d.mts +13 -0
  219. package/tile/tile.mjs +34 -0
  220. package/tile/types.cjs +0 -0
  221. package/tile/types.d.cts +9 -0
  222. package/tile/types.d.mts +9 -0
  223. package/tile/types.mjs +1 -0
  224. package/types.cjs +0 -0
  225. package/types.d.cts +14 -0
  226. package/types.d.mts +14 -0
  227. package/types.mjs +1 -0
  228. package/with-css/balance/index.cjs +8 -0
  229. package/with-css/balance/index.d.cts +3 -0
  230. package/with-css/balance/index.d.mts +3 -0
  231. package/with-css/balance/index.mjs +8 -0
  232. package/with-css/center/index.cjs +8 -0
  233. package/with-css/center/index.d.cts +3 -0
  234. package/with-css/center/index.d.mts +3 -0
  235. package/with-css/center/index.mjs +8 -0
  236. package/with-css/flow/index.cjs +8 -0
  237. package/with-css/flow/index.d.cts +3 -0
  238. package/with-css/flow/index.d.mts +3 -0
  239. package/with-css/flow/index.mjs +8 -0
  240. package/with-css/index.cjs +20 -0
  241. package/with-css/index.d.cts +20 -0
  242. package/with-css/index.d.mts +20 -0
  243. package/with-css/index.mjs +11 -0
  244. package/with-css/layer/index.cjs +8 -0
  245. package/with-css/layer/index.d.cts +3 -0
  246. package/with-css/layer/index.d.mts +3 -0
  247. package/with-css/layer/index.mjs +8 -0
  248. package/with-css/matrix/index.cjs +8 -0
  249. package/with-css/matrix/index.d.cts +3 -0
  250. package/with-css/matrix/index.d.mts +3 -0
  251. package/with-css/matrix/index.mjs +8 -0
  252. package/with-css/pack/index.cjs +8 -0
  253. package/with-css/pack/index.d.cts +3 -0
  254. package/with-css/pack/index.d.mts +3 -0
  255. package/with-css/pack/index.mjs +8 -0
  256. package/with-css/pin/index.cjs +8 -0
  257. package/with-css/pin/index.d.cts +3 -0
  258. package/with-css/pin/index.d.mts +3 -0
  259. package/with-css/pin/index.mjs +8 -0
  260. package/with-css/stack/index.cjs +8 -0
  261. package/with-css/stack/index.d.cts +3 -0
  262. package/with-css/stack/index.d.mts +3 -0
  263. package/with-css/stack/index.mjs +8 -0
  264. package/with-css/tile/index.cjs +8 -0
  265. package/with-css/tile/index.d.cts +3 -0
  266. package/with-css/tile/index.d.mts +3 -0
  267. package/with-css/tile/index.mjs +8 -0
@@ -0,0 +1,112 @@
1
+ //#region src/constants.d.ts
2
+ /**
3
+ * 整列方向
4
+ *
5
+ * - x: 横方向
6
+ * - y: 縦方向
7
+ */
8
+ declare const Direction: {
9
+ readonly x: "x";
10
+ readonly y: "y";
11
+ };
12
+ type Direction = (typeof Direction)[keyof typeof Direction];
13
+ /**
14
+ * 横位置
15
+ *
16
+ * - left: 左寄せ
17
+ * - center: 中央寄せ
18
+ * - right: 右寄せ
19
+ */
20
+ declare const AlignXBase: {
21
+ readonly left: "left";
22
+ readonly center: "center";
23
+ readonly right: "right";
24
+ };
25
+ type AlignXBase = (typeof AlignXBase)[keyof typeof AlignXBase];
26
+ /**
27
+ * 横位置
28
+ *
29
+ * - left: 左寄せ
30
+ * - center: 中央寄せ
31
+ * - right: 右寄せ
32
+ * - space-between: 両端揃え
33
+ * - space-around: 両端余白あり均等
34
+ * - space-evenly: 完全均等
35
+ */
36
+ declare const AlignX: {
37
+ readonly 'space-between': "space-between";
38
+ readonly 'space-around': "space-around";
39
+ readonly 'space-evenly': "space-evenly";
40
+ readonly left: "left";
41
+ readonly center: "center";
42
+ readonly right: "right";
43
+ };
44
+ type AlignX = (typeof AlignX)[keyof typeof AlignX];
45
+ /**
46
+ * 縦位置
47
+ *
48
+ * - top: 上寄せ
49
+ * - middle: 中央寄せ
50
+ * - bottom: 下寄せ
51
+ */
52
+ declare const AlignYBase: {
53
+ readonly top: "top";
54
+ readonly middle: "middle";
55
+ readonly bottom: "bottom";
56
+ };
57
+ type AlignYBase = (typeof AlignYBase)[keyof typeof AlignYBase];
58
+ /**
59
+ * 縦位置
60
+ *
61
+ * - top: 上寄せ
62
+ * - middle: 中央寄せ
63
+ * - bottom: 下寄せ
64
+ * - space-between: 両端揃え
65
+ * - space-around: 両端余白あり均等
66
+ * - space-evenly: 完全均等
67
+ */
68
+ declare const AlignY: {
69
+ readonly 'space-between': "space-between";
70
+ readonly 'space-around': "space-around";
71
+ readonly 'space-evenly': "space-evenly";
72
+ readonly top: "top";
73
+ readonly middle: "middle";
74
+ readonly bottom: "bottom";
75
+ };
76
+ type AlignY = (typeof AlignY)[keyof typeof AlignY];
77
+ /**
78
+ * 親要素のサイズを基準にした子要素のサイズ調整
79
+ *
80
+ * - `none`
81
+ * - 親のサイズに足りないとき: そのまま
82
+ * - 親のサイズを超えるとき: そのまま
83
+ */
84
+ declare const AdjustBase: {
85
+ readonly none: "none";
86
+ };
87
+ type AdjustBase = (typeof AdjustBase)[keyof typeof AdjustBase];
88
+ /**
89
+ * 親要素のサイズを基準にした子要素のサイズ調整
90
+ *
91
+ * - `none`
92
+ * - 親のサイズに足りないとき: そのまま
93
+ * - 親のサイズを超えるとき: そのまま
94
+ * - `fit`
95
+ * - 親のサイズに足りないとき: 伸ばす
96
+ * - 親のサイズを超えるとき: 縮める
97
+ * - `grow`
98
+ * - 親のサイズに足りないとき: 伸ばす
99
+ * - 親のサイズを超えるとき: そのまま
100
+ * - `shrink`
101
+ * - 親のサイズに足りないとき: そのまま
102
+ * - 親のサイズを超えるとき: 縮める
103
+ */
104
+ declare const Adjust: {
105
+ readonly fit: "fit";
106
+ readonly grow: "grow";
107
+ readonly shrink: "shrink";
108
+ readonly none: "none";
109
+ };
110
+ type Adjust = (typeof Adjust)[keyof typeof Adjust];
111
+ //#endregion
112
+ export { Adjust, AdjustBase, AlignX, AlignXBase, AlignY, AlignYBase, Direction };
@@ -0,0 +1,112 @@
1
+ //#region src/constants.d.ts
2
+ /**
3
+ * 整列方向
4
+ *
5
+ * - x: 横方向
6
+ * - y: 縦方向
7
+ */
8
+ declare const Direction: {
9
+ readonly x: "x";
10
+ readonly y: "y";
11
+ };
12
+ type Direction = (typeof Direction)[keyof typeof Direction];
13
+ /**
14
+ * 横位置
15
+ *
16
+ * - left: 左寄せ
17
+ * - center: 中央寄せ
18
+ * - right: 右寄せ
19
+ */
20
+ declare const AlignXBase: {
21
+ readonly left: "left";
22
+ readonly center: "center";
23
+ readonly right: "right";
24
+ };
25
+ type AlignXBase = (typeof AlignXBase)[keyof typeof AlignXBase];
26
+ /**
27
+ * 横位置
28
+ *
29
+ * - left: 左寄せ
30
+ * - center: 中央寄せ
31
+ * - right: 右寄せ
32
+ * - space-between: 両端揃え
33
+ * - space-around: 両端余白あり均等
34
+ * - space-evenly: 完全均等
35
+ */
36
+ declare const AlignX: {
37
+ readonly 'space-between': "space-between";
38
+ readonly 'space-around': "space-around";
39
+ readonly 'space-evenly': "space-evenly";
40
+ readonly left: "left";
41
+ readonly center: "center";
42
+ readonly right: "right";
43
+ };
44
+ type AlignX = (typeof AlignX)[keyof typeof AlignX];
45
+ /**
46
+ * 縦位置
47
+ *
48
+ * - top: 上寄せ
49
+ * - middle: 中央寄せ
50
+ * - bottom: 下寄せ
51
+ */
52
+ declare const AlignYBase: {
53
+ readonly top: "top";
54
+ readonly middle: "middle";
55
+ readonly bottom: "bottom";
56
+ };
57
+ type AlignYBase = (typeof AlignYBase)[keyof typeof AlignYBase];
58
+ /**
59
+ * 縦位置
60
+ *
61
+ * - top: 上寄せ
62
+ * - middle: 中央寄せ
63
+ * - bottom: 下寄せ
64
+ * - space-between: 両端揃え
65
+ * - space-around: 両端余白あり均等
66
+ * - space-evenly: 完全均等
67
+ */
68
+ declare const AlignY: {
69
+ readonly 'space-between': "space-between";
70
+ readonly 'space-around': "space-around";
71
+ readonly 'space-evenly': "space-evenly";
72
+ readonly top: "top";
73
+ readonly middle: "middle";
74
+ readonly bottom: "bottom";
75
+ };
76
+ type AlignY = (typeof AlignY)[keyof typeof AlignY];
77
+ /**
78
+ * 親要素のサイズを基準にした子要素のサイズ調整
79
+ *
80
+ * - `none`
81
+ * - 親のサイズに足りないとき: そのまま
82
+ * - 親のサイズを超えるとき: そのまま
83
+ */
84
+ declare const AdjustBase: {
85
+ readonly none: "none";
86
+ };
87
+ type AdjustBase = (typeof AdjustBase)[keyof typeof AdjustBase];
88
+ /**
89
+ * 親要素のサイズを基準にした子要素のサイズ調整
90
+ *
91
+ * - `none`
92
+ * - 親のサイズに足りないとき: そのまま
93
+ * - 親のサイズを超えるとき: そのまま
94
+ * - `fit`
95
+ * - 親のサイズに足りないとき: 伸ばす
96
+ * - 親のサイズを超えるとき: 縮める
97
+ * - `grow`
98
+ * - 親のサイズに足りないとき: 伸ばす
99
+ * - 親のサイズを超えるとき: そのまま
100
+ * - `shrink`
101
+ * - 親のサイズに足りないとき: そのまま
102
+ * - 親のサイズを超えるとき: 縮める
103
+ */
104
+ declare const Adjust: {
105
+ readonly fit: "fit";
106
+ readonly grow: "grow";
107
+ readonly shrink: "shrink";
108
+ readonly none: "none";
109
+ };
110
+ type Adjust = (typeof Adjust)[keyof typeof Adjust];
111
+ //#endregion
112
+ export { Adjust, AdjustBase, AlignX, AlignXBase, AlignY, AlignYBase, Direction };
package/constants.mjs ADDED
@@ -0,0 +1,101 @@
1
+ //#region src/constants.ts
2
+ /**
3
+ * 整列方向
4
+ *
5
+ * - x: 横方向
6
+ * - y: 縦方向
7
+ */
8
+ const Direction = {
9
+ x: "x",
10
+ y: "y"
11
+ };
12
+ const AlignBetween = {
13
+ "space-between": "space-between",
14
+ "space-around": "space-around",
15
+ "space-evenly": "space-evenly"
16
+ };
17
+ /**
18
+ * 横位置
19
+ *
20
+ * - left: 左寄せ
21
+ * - center: 中央寄せ
22
+ * - right: 右寄せ
23
+ */
24
+ const AlignXBase = {
25
+ left: "left",
26
+ center: "center",
27
+ right: "right"
28
+ };
29
+ /**
30
+ * 横位置
31
+ *
32
+ * - left: 左寄せ
33
+ * - center: 中央寄せ
34
+ * - right: 右寄せ
35
+ * - space-between: 両端揃え
36
+ * - space-around: 両端余白あり均等
37
+ * - space-evenly: 完全均等
38
+ */
39
+ const AlignX = {
40
+ ...AlignXBase,
41
+ ...AlignBetween
42
+ };
43
+ /**
44
+ * 縦位置
45
+ *
46
+ * - top: 上寄せ
47
+ * - middle: 中央寄せ
48
+ * - bottom: 下寄せ
49
+ */
50
+ const AlignYBase = {
51
+ top: "top",
52
+ middle: "middle",
53
+ bottom: "bottom"
54
+ };
55
+ /**
56
+ * 縦位置
57
+ *
58
+ * - top: 上寄せ
59
+ * - middle: 中央寄せ
60
+ * - bottom: 下寄せ
61
+ * - space-between: 両端揃え
62
+ * - space-around: 両端余白あり均等
63
+ * - space-evenly: 完全均等
64
+ */
65
+ const AlignY = {
66
+ ...AlignYBase,
67
+ ...AlignBetween
68
+ };
69
+ /**
70
+ * 親要素のサイズを基準にした子要素のサイズ調整
71
+ *
72
+ * - `none`
73
+ * - 親のサイズに足りないとき: そのまま
74
+ * - 親のサイズを超えるとき: そのまま
75
+ */
76
+ const AdjustBase = { none: "none" };
77
+ /**
78
+ * 親要素のサイズを基準にした子要素のサイズ調整
79
+ *
80
+ * - `none`
81
+ * - 親のサイズに足りないとき: そのまま
82
+ * - 親のサイズを超えるとき: そのまま
83
+ * - `fit`
84
+ * - 親のサイズに足りないとき: 伸ばす
85
+ * - 親のサイズを超えるとき: 縮める
86
+ * - `grow`
87
+ * - 親のサイズに足りないとき: 伸ばす
88
+ * - 親のサイズを超えるとき: そのまま
89
+ * - `shrink`
90
+ * - 親のサイズに足りないとき: そのまま
91
+ * - 親のサイズを超えるとき: 縮める
92
+ */
93
+ const Adjust = {
94
+ ...AdjustBase,
95
+ fit: "fit",
96
+ grow: "grow",
97
+ shrink: "shrink"
98
+ };
99
+
100
+ //#endregion
101
+ export { Adjust, AdjustBase, AlignX, AlignXBase, AlignY, AlignYBase, Direction };
package/flow/flow.cjs ADDED
@@ -0,0 +1,71 @@
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ const require__constants = require('../_constants.cjs');
3
+ const require__internal_hasValue = require('../_internal/hasValue.cjs');
4
+ const require__internal_mergeClassName = require('../_internal/mergeClassName.cjs');
5
+ const require__internal_unit = require('../_internal/unit.cjs');
6
+ const require__internal_applyGap = require('../_internal/applyGap.cjs');
7
+ const require__internal_applyItemRatio = require('../_internal/applyItemRatio.cjs');
8
+ const require__internal_mergeLayoutResults = require('../_internal/mergeLayoutResults.cjs');
9
+ let _fringeworks_utils_object_maybeDefault = require("@fringeworks/utils/object/maybeDefault");
10
+ _fringeworks_utils_object_maybeDefault = require_runtime.__toESM(_fringeworks_utils_object_maybeDefault, 1);
11
+
12
+ //#region src/flow/flow.ts
13
+ /**
14
+ * flowレイアウト
15
+ *
16
+ * - 子要素を並べて配置し、親要素のサイズに達したら折り返す
17
+ * - stackとの違いは flex-wrap: wrap が常に有効な点
18
+ */
19
+ const flow = (options = {}) => {
20
+ const { direction, alignX, alignY, adjustX, adjustY, gap, gapX, gapY, itemSizeX, itemSizeY, itemRatioX, itemRatioY } = (0, _fringeworks_utils_object_maybeDefault.default)(options, {
21
+ direction: "x",
22
+ alignX: "left",
23
+ alignY: "top",
24
+ adjustX: "none",
25
+ adjustY: "none"
26
+ }, { overwriteNull: true });
27
+ const result = {
28
+ className: require__internal_mergeClassName(require__constants.clsLayoutFlow, require__constants.clsLayout.direction[direction], require__constants.clsLayout.align.x[alignX], require__constants.clsLayout.align.y[alignY]),
29
+ style: {}
30
+ };
31
+ require__internal_applyGap(result, gap, gapX, gapY);
32
+ require__internal_applyItemRatio(result, itemRatioX, itemRatioY);
33
+ const resultList = [result];
34
+ if (direction === "x") {
35
+ resultList.push(_getFlowMainAxisStyle("x", alignX, adjustX, itemSizeX));
36
+ resultList.push(_getFlowCrossAxisStyle("y", alignY, itemSizeY));
37
+ } else {
38
+ resultList.push(_getFlowCrossAxisStyle("x", alignX, itemSizeX));
39
+ resultList.push(_getFlowMainAxisStyle("y", alignY, adjustY, itemSizeY));
40
+ }
41
+ return require__internal_mergeLayoutResults(resultList);
42
+ };
43
+ /**
44
+ * 主軸方向のスタイル
45
+ *
46
+ * stackの _getStackMainAxisStyle に相当。flowでは主軸の挙動はstackと同じ。
47
+ */
48
+ function _getFlowMainAxisStyle(axis, align, adjust, itemSize) {
49
+ const result = { className: require__internal_mergeClassName(require__constants.clsLayout.align[axis][align], require__constants.clsLayout.adjust[axis][adjust]) };
50
+ if (require__internal_hasValue(itemSize)) {
51
+ result.className = require__internal_mergeClassName(result.className, require__constants.clsLayout.itemSize[axis]);
52
+ result.style = { [require__constants.varLayout.itemSize[axis]]: require__internal_unit(itemSize) };
53
+ }
54
+ return result;
55
+ }
56
+ /**
57
+ * 交差軸方向のスタイル
58
+ *
59
+ * stackの _getStackClossAxisStyle に相当。
60
+ * flowは交差軸方向のadjustはできないため、常にnoneのスタイルを返す
61
+ */
62
+ function _getFlowCrossAxisStyle(axis, align, itemSize) {
63
+ if (require__internal_hasValue(itemSize)) return {
64
+ className: require__internal_mergeClassName(require__constants.clsLayout.align[axis][align], require__constants.clsLayout.itemSize[axis]),
65
+ style: { [require__constants.varLayout.itemSize[axis]]: require__internal_unit(itemSize) }
66
+ };
67
+ else return { className: require__constants.clsLayout.align[axis][align] };
68
+ }
69
+
70
+ //#endregion
71
+ module.exports = flow;
@@ -0,0 +1,12 @@
1
+ import { CreateLayoutStyle } from "../types.cjs";
2
+ import { FlowLayoutOptions } from "./types.cjs";
3
+
4
+ //#region src/flow/flow.d.ts
5
+ /**
6
+ * flowレイアウト
7
+ *
8
+ * - 子要素を並べて配置し、親要素のサイズに達したら折り返す
9
+ * - stackとの違いは flex-wrap: wrap が常に有効な点
10
+ */
11
+ declare const flow: CreateLayoutStyle<FlowLayoutOptions>;
12
+ export = flow;
@@ -0,0 +1,13 @@
1
+ import { CreateLayoutStyle } from "../types.mjs";
2
+ import { FlowLayoutOptions } from "./types.mjs";
3
+
4
+ //#region src/flow/flow.d.ts
5
+ /**
6
+ * flowレイアウト
7
+ *
8
+ * - 子要素を並べて配置し、親要素のサイズに達したら折り返す
9
+ * - stackとの違いは flex-wrap: wrap が常に有効な点
10
+ */
11
+ declare const flow: CreateLayoutStyle<FlowLayoutOptions>;
12
+ //#endregion
13
+ export { flow as default };
package/flow/flow.mjs ADDED
@@ -0,0 +1,69 @@
1
+ import { clsLayout, clsLayoutFlow, varLayout } from "../_constants.mjs";
2
+ import hasValue from "../_internal/hasValue.mjs";
3
+ import mergeClassName from "../_internal/mergeClassName.mjs";
4
+ import unit from "../_internal/unit.mjs";
5
+ import applyGap from "../_internal/applyGap.mjs";
6
+ import applyItemRatio from "../_internal/applyItemRatio.mjs";
7
+ import mergeLayoutResults from "../_internal/mergeLayoutResults.mjs";
8
+ import maybeDefault from "@fringeworks/utils/object/maybeDefault";
9
+
10
+ //#region src/flow/flow.ts
11
+ /**
12
+ * flowレイアウト
13
+ *
14
+ * - 子要素を並べて配置し、親要素のサイズに達したら折り返す
15
+ * - stackとの違いは flex-wrap: wrap が常に有効な点
16
+ */
17
+ const flow = (options = {}) => {
18
+ const { direction, alignX, alignY, adjustX, adjustY, gap, gapX, gapY, itemSizeX, itemSizeY, itemRatioX, itemRatioY } = maybeDefault(options, {
19
+ direction: "x",
20
+ alignX: "left",
21
+ alignY: "top",
22
+ adjustX: "none",
23
+ adjustY: "none"
24
+ }, { overwriteNull: true });
25
+ const result = {
26
+ className: mergeClassName(clsLayoutFlow, clsLayout.direction[direction], clsLayout.align.x[alignX], clsLayout.align.y[alignY]),
27
+ style: {}
28
+ };
29
+ applyGap(result, gap, gapX, gapY);
30
+ applyItemRatio(result, itemRatioX, itemRatioY);
31
+ const resultList = [result];
32
+ if (direction === "x") {
33
+ resultList.push(_getFlowMainAxisStyle("x", alignX, adjustX, itemSizeX));
34
+ resultList.push(_getFlowCrossAxisStyle("y", alignY, itemSizeY));
35
+ } else {
36
+ resultList.push(_getFlowCrossAxisStyle("x", alignX, itemSizeX));
37
+ resultList.push(_getFlowMainAxisStyle("y", alignY, adjustY, itemSizeY));
38
+ }
39
+ return mergeLayoutResults(resultList);
40
+ };
41
+ /**
42
+ * 主軸方向のスタイル
43
+ *
44
+ * stackの _getStackMainAxisStyle に相当。flowでは主軸の挙動はstackと同じ。
45
+ */
46
+ function _getFlowMainAxisStyle(axis, align, adjust, itemSize) {
47
+ const result = { className: mergeClassName(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]) };
48
+ if (hasValue(itemSize)) {
49
+ result.className = mergeClassName(result.className, clsLayout.itemSize[axis]);
50
+ result.style = { [varLayout.itemSize[axis]]: unit(itemSize) };
51
+ }
52
+ return result;
53
+ }
54
+ /**
55
+ * 交差軸方向のスタイル
56
+ *
57
+ * stackの _getStackClossAxisStyle に相当。
58
+ * flowは交差軸方向のadjustはできないため、常にnoneのスタイルを返す
59
+ */
60
+ function _getFlowCrossAxisStyle(axis, align, itemSize) {
61
+ if (hasValue(itemSize)) return {
62
+ className: mergeClassName(clsLayout.align[axis][align], clsLayout.itemSize[axis]),
63
+ style: { [varLayout.itemSize[axis]]: unit(itemSize) }
64
+ };
65
+ else return { className: clsLayout.align[axis][align] };
66
+ }
67
+
68
+ //#endregion
69
+ export { flow as default };
package/flow/index.cjs ADDED
@@ -0,0 +1,3 @@
1
+ const require_flow_flow = require('./flow.cjs');
2
+
3
+ module.exports = require_flow_flow;
@@ -0,0 +1,3 @@
1
+ import { FlowLayoutOptions } from "./types.cjs";
2
+ import flow from "./flow.cjs";
3
+ export { type FlowLayoutOptions, flow as default };
@@ -0,0 +1,3 @@
1
+ import { FlowLayoutOptions } from "./types.mjs";
2
+ import flow from "./flow.mjs";
3
+ export { type FlowLayoutOptions, flow as default };
package/flow/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import flow from "./flow.mjs";
2
+
3
+ export { flow as default };
@@ -0,0 +1,160 @@
1
+ .lx-layout-flow {
2
+ --lx-layout-gapX: 0px;
3
+ --lx-layout-gapY: 0px;
4
+ --lx-layout-itemSizeX: auto;
5
+ --lx-layout-itemSizeY: auto;
6
+ --lx-layout-itemRatio: auto;
7
+ display: flex;
8
+ flex-wrap: wrap;
9
+ }
10
+ .lx-layout-flow.lx-layout-direction-x {
11
+ flex-direction: row;
12
+ }
13
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-alignX-left {
14
+ justify-content: flex-start;
15
+ }
16
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-alignX-center {
17
+ justify-content: center;
18
+ }
19
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-alignX-right {
20
+ justify-content: flex-end;
21
+ }
22
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-alignX-spaceBetween {
23
+ justify-content: space-between;
24
+ }
25
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-alignX-spaceAround {
26
+ justify-content: space-around;
27
+ }
28
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-alignX-spaceEvenly {
29
+ justify-content: space-evenly;
30
+ }
31
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-alignY-top {
32
+ align-items: flex-start;
33
+ align-content: flex-start;
34
+ }
35
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-alignY-middle {
36
+ align-items: center;
37
+ align-content: center;
38
+ }
39
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-alignY-bottom {
40
+ align-items: flex-end;
41
+ align-content: flex-end;
42
+ }
43
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-alignY-spaceBetween {
44
+ align-content: space-between;
45
+ }
46
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-alignY-spaceAround {
47
+ align-content: space-around;
48
+ }
49
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-alignY-spaceEvenly {
50
+ align-content: space-evenly;
51
+ }
52
+ .lx-layout-flow.lx-layout-direction-x > * {
53
+ flex-grow: 0;
54
+ flex-shrink: 0;
55
+ min-width: 0;
56
+ min-height: 0;
57
+ }
58
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-itemSizeX > * {
59
+ flex-basis: var(--lx-layout-itemSizeX);
60
+ }
61
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-adjustX-fit {
62
+ justify-content: flex-start;
63
+ }
64
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-adjustX-fit > * {
65
+ flex-grow: 1;
66
+ flex-shrink: 1;
67
+ flex-basis: auto;
68
+ }
69
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-adjustX-fit.lx-layout-itemSizeX > * {
70
+ flex-basis: var(--lx-layout-itemSizeX);
71
+ }
72
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-adjustX-grow > * {
73
+ flex-grow: 1;
74
+ }
75
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-adjustX-shrink > * {
76
+ flex-shrink: 1;
77
+ }
78
+ .lx-layout-flow.lx-layout-direction-x.lx-layout-itemSizeY > * {
79
+ height: var(--lx-layout-itemSizeY);
80
+ }
81
+ .lx-layout-flow.lx-layout-direction-y {
82
+ flex-direction: column;
83
+ }
84
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-alignX-left {
85
+ align-items: flex-start;
86
+ align-content: flex-start;
87
+ }
88
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-alignX-center {
89
+ align-items: center;
90
+ align-content: center;
91
+ }
92
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-alignX-right {
93
+ align-items: flex-end;
94
+ align-content: flex-end;
95
+ }
96
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-alignX-spaceBetween {
97
+ align-content: space-between;
98
+ }
99
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-alignX-spaceAround {
100
+ align-content: space-around;
101
+ }
102
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-alignX-spaceEvenly {
103
+ align-content: space-evenly;
104
+ }
105
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-alignY-top {
106
+ justify-content: flex-start;
107
+ }
108
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-alignY-middle {
109
+ justify-content: center;
110
+ }
111
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-alignY-bottom {
112
+ justify-content: flex-end;
113
+ }
114
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-alignY-spaceBetween {
115
+ justify-content: space-between;
116
+ }
117
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-alignY-spaceAround {
118
+ justify-content: space-around;
119
+ }
120
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-alignY-spaceEvenly {
121
+ justify-content: space-evenly;
122
+ }
123
+ .lx-layout-flow.lx-layout-direction-y > * {
124
+ flex-grow: 0;
125
+ flex-shrink: 0;
126
+ min-width: 0;
127
+ min-height: 0;
128
+ }
129
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-itemSizeX > * {
130
+ width: var(--lx-layout-itemSizeX);
131
+ }
132
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-itemSizeY > * {
133
+ flex-basis: var(--lx-layout-itemSizeY);
134
+ }
135
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-adjustY-fit {
136
+ justify-content: flex-start;
137
+ }
138
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-adjustY-fit > * {
139
+ flex-grow: 1;
140
+ flex-shrink: 1;
141
+ flex-basis: auto;
142
+ }
143
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-adjustY-fit.lx-layout-itemSizeY > * {
144
+ flex-basis: var(--lx-layout-itemSizeY);
145
+ }
146
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-adjustY-grow > * {
147
+ flex-grow: 1;
148
+ }
149
+ .lx-layout-flow.lx-layout-direction-y.lx-layout-adjustY-shrink > * {
150
+ flex-shrink: 1;
151
+ }
152
+ .lx-layout-flow.lx-layout-itemRatio > * {
153
+ aspect-ratio: var(--lx-layout-itemRatio);
154
+ }
155
+ .lx-layout-flow.lx-layout-gapX {
156
+ column-gap: var(--lx-layout-gapX);
157
+ }
158
+ .lx-layout-flow.lx-layout-gapY {
159
+ row-gap: var(--lx-layout-gapY);
160
+ }
package/flow/types.cjs ADDED
File without changes
@@ -0,0 +1,21 @@
1
+ import { AdjustBase } from "../constants.cjs";
2
+ import { AdjustOptions, AlignOptions, DirectionOptions, GapOptions, ItemRatioOptions, ItemSizeOptions } from "../_types.cjs";
3
+
4
+ //#region src/flow/types.d.ts
5
+ /**
6
+ * flowのオプション
7
+ *
8
+ * - `direction='x'` 時: `adjustY` に `fit`,`grow`,`shrink` 指定不可
9
+ * - `direction='y'` 時: `adjustX` に `fit`,`grow`,`shrink` 指定不可
10
+ */
11
+ type FlowLayoutOptions = AlignOptions & GapOptions & ItemSizeOptions & ItemRatioOptions & FlowDirectionWithAdjustOptions;
12
+ /**
13
+ * direction & adjustのオプション
14
+ */
15
+ type FlowDirectionWithAdjustOptions = (DirectionOptions<'x'> & Omit<AdjustOptions, 'adjustY'> & {
16
+ adjustY?: AdjustBase;
17
+ }) | (DirectionOptions<'y'> & Omit<AdjustOptions, 'adjustX'> & {
18
+ adjustX?: AdjustBase;
19
+ });
20
+ //#endregion
21
+ export { FlowLayoutOptions };