@niche-works/style-layouts 0.2.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 (227) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja.md +320 -0
  3. package/README.md +320 -0
  4. package/_virtual/_rolldown/runtime.cjs +29 -0
  5. package/balance/index.cjs +4 -0
  6. package/balance/index.d.cts +3 -0
  7. package/balance/index.d.mts +3 -0
  8. package/balance/index.mjs +4 -0
  9. package/center/index.cjs +4 -0
  10. package/center/index.d.cts +3 -0
  11. package/center/index.d.mts +3 -0
  12. package/center/index.mjs +4 -0
  13. package/constants.cjs +59 -0
  14. package/constants.d.cts +2 -0
  15. package/constants.d.mts +2 -0
  16. package/constants.mjs +3 -0
  17. package/core/_constants.cjs +94 -0
  18. package/core/_constants.d.cts +83 -0
  19. package/core/_constants.d.mts +83 -0
  20. package/core/_constants.mjs +86 -0
  21. package/core/_internal/applyChildCount.cjs +26 -0
  22. package/core/_internal/applyChildCount.d.cts +11 -0
  23. package/core/_internal/applyChildCount.d.mts +12 -0
  24. package/core/_internal/applyChildCount.mjs +24 -0
  25. package/core/_internal/applyChildRatio.cjs +22 -0
  26. package/core/_internal/applyChildRatio.d.cts +11 -0
  27. package/core/_internal/applyChildRatio.d.mts +12 -0
  28. package/core/_internal/applyChildRatio.mjs +20 -0
  29. package/core/_internal/applyChildSize.cjs +27 -0
  30. package/core/_internal/applyChildSize.d.cts +11 -0
  31. package/core/_internal/applyChildSize.d.mts +12 -0
  32. package/core/_internal/applyChildSize.mjs +25 -0
  33. package/core/_internal/applyGap.cjs +30 -0
  34. package/core/_internal/applyGap.d.cts +12 -0
  35. package/core/_internal/applyGap.d.mts +13 -0
  36. package/core/_internal/applyGap.mjs +28 -0
  37. package/core/_internal/hasValue.cjs +15 -0
  38. package/core/_internal/hasValue.d.cts +8 -0
  39. package/core/_internal/hasValue.d.mts +9 -0
  40. package/core/_internal/hasValue.mjs +14 -0
  41. package/core/_internal/mergeLayoutResults.cjs +18 -0
  42. package/core/_internal/mergeLayoutResults.d.cts +5 -0
  43. package/core/_internal/mergeLayoutResults.d.mts +6 -0
  44. package/core/_internal/mergeLayoutResults.mjs +16 -0
  45. package/core/_internal/unit.cjs +16 -0
  46. package/core/_internal/unit.d.cts +10 -0
  47. package/core/_internal/unit.d.mts +11 -0
  48. package/core/_internal/unit.mjs +15 -0
  49. package/core/_internal/warnIfUnsupported.cjs +15 -0
  50. package/core/_internal/warnIfUnsupported.d.cts +3 -0
  51. package/core/_internal/warnIfUnsupported.d.mts +4 -0
  52. package/core/_internal/warnIfUnsupported.mjs +14 -0
  53. package/core/_styles.scss.cjs +1 -0
  54. package/core/_styles.scss.d.cts +1 -0
  55. package/core/_styles.scss.d.mts +1 -0
  56. package/core/_styles.scss.mjs +3 -0
  57. package/core/_types.cjs +0 -0
  58. package/core/_types.d.cts +123 -0
  59. package/core/_types.d.mts +123 -0
  60. package/core/_types.mjs +1 -0
  61. package/core/balance/balance.cjs +35 -0
  62. package/core/balance/balance.d.cts +11 -0
  63. package/core/balance/balance.d.mts +12 -0
  64. package/core/balance/balance.mjs +32 -0
  65. package/core/balance/index.cjs +3 -0
  66. package/core/balance/index.d.cts +3 -0
  67. package/core/balance/index.d.mts +3 -0
  68. package/core/balance/index.mjs +3 -0
  69. package/core/balance/styles.css +113 -0
  70. package/core/balance/types.cjs +0 -0
  71. package/core/balance/types.d.cts +21 -0
  72. package/core/balance/types.d.mts +21 -0
  73. package/core/balance/types.mjs +1 -0
  74. package/core/center/center.cjs +31 -0
  75. package/core/center/center.d.cts +11 -0
  76. package/core/center/center.d.mts +12 -0
  77. package/core/center/center.mjs +28 -0
  78. package/core/center/index.cjs +3 -0
  79. package/core/center/index.d.cts +3 -0
  80. package/core/center/index.d.mts +3 -0
  81. package/core/center/index.mjs +3 -0
  82. package/core/center/styles.css +166 -0
  83. package/core/center/types.cjs +0 -0
  84. package/core/center/types.d.cts +9 -0
  85. package/core/center/types.d.mts +9 -0
  86. package/core/center/types.mjs +1 -0
  87. package/core/constants.cjs +362 -0
  88. package/core/constants.d.cts +316 -0
  89. package/core/constants.d.mts +316 -0
  90. package/core/constants.mjs +305 -0
  91. package/core/flow/flow.cjs +71 -0
  92. package/core/flow/flow.d.cts +12 -0
  93. package/core/flow/flow.d.mts +13 -0
  94. package/core/flow/flow.mjs +68 -0
  95. package/core/flow/index.cjs +3 -0
  96. package/core/flow/index.d.cts +3 -0
  97. package/core/flow/index.d.mts +3 -0
  98. package/core/flow/index.mjs +3 -0
  99. package/core/flow/styles.css +166 -0
  100. package/core/flow/types.cjs +0 -0
  101. package/core/flow/types.d.cts +21 -0
  102. package/core/flow/types.d.mts +21 -0
  103. package/core/flow/types.mjs +1 -0
  104. package/core/index.cjs +20 -0
  105. package/core/index.d.cts +20 -0
  106. package/core/index.d.mts +20 -0
  107. package/core/index.mjs +11 -0
  108. package/core/layer/index.cjs +3 -0
  109. package/core/layer/index.d.cts +3 -0
  110. package/core/layer/index.d.mts +3 -0
  111. package/core/layer/index.mjs +3 -0
  112. package/core/layer/layer.cjs +34 -0
  113. package/core/layer/layer.d.cts +13 -0
  114. package/core/layer/layer.d.mts +14 -0
  115. package/core/layer/layer.mjs +31 -0
  116. package/core/layer/styles.css +64 -0
  117. package/core/layer/types.cjs +0 -0
  118. package/core/layer/types.d.cts +13 -0
  119. package/core/layer/types.d.mts +13 -0
  120. package/core/layer/types.mjs +1 -0
  121. package/core/matrix/index.cjs +3 -0
  122. package/core/matrix/index.d.cts +3 -0
  123. package/core/matrix/index.d.mts +3 -0
  124. package/core/matrix/index.mjs +3 -0
  125. package/core/matrix/matrix.cjs +110 -0
  126. package/core/matrix/matrix.d.cts +11 -0
  127. package/core/matrix/matrix.d.mts +12 -0
  128. package/core/matrix/matrix.mjs +107 -0
  129. package/core/matrix/styles.css +63 -0
  130. package/core/matrix/types.cjs +0 -0
  131. package/core/matrix/types.d.cts +46 -0
  132. package/core/matrix/types.d.mts +46 -0
  133. package/core/matrix/types.mjs +1 -0
  134. package/core/pack/index.cjs +3 -0
  135. package/core/pack/index.d.cts +3 -0
  136. package/core/pack/index.d.mts +3 -0
  137. package/core/pack/index.mjs +3 -0
  138. package/core/pack/pack.cjs +27 -0
  139. package/core/pack/pack.d.cts +11 -0
  140. package/core/pack/pack.d.mts +12 -0
  141. package/core/pack/pack.mjs +24 -0
  142. package/core/pack/styles.css +36 -0
  143. package/core/pack/types.cjs +0 -0
  144. package/core/pack/types.d.cts +6 -0
  145. package/core/pack/types.d.mts +6 -0
  146. package/core/pack/types.mjs +1 -0
  147. package/core/pin/index.cjs +3 -0
  148. package/core/pin/index.d.cts +3 -0
  149. package/core/pin/index.d.mts +3 -0
  150. package/core/pin/index.mjs +3 -0
  151. package/core/pin/pin.cjs +23 -0
  152. package/core/pin/pin.d.cts +11 -0
  153. package/core/pin/pin.d.mts +12 -0
  154. package/core/pin/pin.mjs +23 -0
  155. package/core/pin/styles.css +18 -0
  156. package/core/pin/types.cjs +0 -0
  157. package/core/pin/types.d.cts +6 -0
  158. package/core/pin/types.d.mts +6 -0
  159. package/core/pin/types.mjs +1 -0
  160. package/core/stack/index.cjs +3 -0
  161. package/core/stack/index.d.cts +3 -0
  162. package/core/stack/index.d.mts +3 -0
  163. package/core/stack/index.mjs +3 -0
  164. package/core/stack/stack.cjs +99 -0
  165. package/core/stack/stack.d.cts +11 -0
  166. package/core/stack/stack.d.mts +12 -0
  167. package/core/stack/stack.mjs +96 -0
  168. package/core/stack/styles.css +175 -0
  169. package/core/stack/types.cjs +0 -0
  170. package/core/stack/types.d.cts +21 -0
  171. package/core/stack/types.d.mts +21 -0
  172. package/core/stack/types.mjs +1 -0
  173. package/core/styles.css +917 -0
  174. package/core/tile/index.cjs +3 -0
  175. package/core/tile/index.d.cts +3 -0
  176. package/core/tile/index.d.mts +3 -0
  177. package/core/tile/index.mjs +3 -0
  178. package/core/tile/styles.css +108 -0
  179. package/core/tile/tile.cjs +86 -0
  180. package/core/tile/tile.d.cts +12 -0
  181. package/core/tile/tile.d.mts +13 -0
  182. package/core/tile/tile.mjs +83 -0
  183. package/core/tile/types.cjs +0 -0
  184. package/core/tile/types.d.cts +9 -0
  185. package/core/tile/types.d.mts +9 -0
  186. package/core/tile/types.mjs +1 -0
  187. package/core/types.cjs +0 -0
  188. package/core/types.d.cts +23 -0
  189. package/core/types.d.mts +23 -0
  190. package/core/types.mjs +1 -0
  191. package/flow/index.cjs +4 -0
  192. package/flow/index.d.cts +3 -0
  193. package/flow/index.d.mts +3 -0
  194. package/flow/index.mjs +4 -0
  195. package/index.cjs +20 -0
  196. package/index.d.cts +20 -0
  197. package/index.d.mts +20 -0
  198. package/index.mjs +11 -0
  199. package/layer/index.cjs +4 -0
  200. package/layer/index.d.cts +3 -0
  201. package/layer/index.d.mts +3 -0
  202. package/layer/index.mjs +4 -0
  203. package/matrix/index.cjs +4 -0
  204. package/matrix/index.d.cts +3 -0
  205. package/matrix/index.d.mts +3 -0
  206. package/matrix/index.mjs +4 -0
  207. package/pack/index.cjs +4 -0
  208. package/pack/index.d.cts +3 -0
  209. package/pack/index.d.mts +3 -0
  210. package/pack/index.mjs +4 -0
  211. package/package.json +51 -0
  212. package/pin/index.cjs +4 -0
  213. package/pin/index.d.cts +3 -0
  214. package/pin/index.d.mts +3 -0
  215. package/pin/index.mjs +4 -0
  216. package/stack/index.cjs +4 -0
  217. package/stack/index.d.cts +3 -0
  218. package/stack/index.d.mts +3 -0
  219. package/stack/index.mjs +4 -0
  220. package/tile/index.cjs +4 -0
  221. package/tile/index.d.cts +3 -0
  222. package/tile/index.d.mts +3 -0
  223. package/tile/index.mjs +4 -0
  224. package/types.cjs +0 -0
  225. package/types.d.cts +2 -0
  226. package/types.d.mts +2 -0
  227. package/types.mjs +1 -0
@@ -0,0 +1,316 @@
1
+ //#region src/core/constants.d.ts
2
+ /**
3
+ * 整列方向
4
+ */
5
+ declare const Direction: {
6
+ readonly x: "x";
7
+ readonly y: "y";
8
+ };
9
+ type Direction = (typeof Direction)[keyof typeof Direction];
10
+ /**
11
+ * 横位置
12
+ *
13
+ * - left: 左寄せ
14
+ * - center: 中央寄せ
15
+ * - right: 右寄せ
16
+ */
17
+ declare const AlignXBase: {
18
+ readonly left: "left";
19
+ readonly center: "center";
20
+ readonly right: "right";
21
+ };
22
+ type AlignXBase = (typeof AlignXBase)[keyof typeof AlignXBase];
23
+ /**
24
+ * 横位置
25
+ *
26
+ * - left: 左寄せ
27
+ * - center: 中央寄せ
28
+ * - right: 右寄せ
29
+ * - space-between: 両端揃え
30
+ * - space-around: 両端余白あり均等
31
+ * - space-evenly: 完全均等
32
+ */
33
+ declare const AlignX: {
34
+ readonly 'space-between': "space-between";
35
+ readonly 'space-around': "space-around";
36
+ readonly 'space-evenly': "space-evenly";
37
+ readonly left: "left";
38
+ readonly center: "center";
39
+ readonly right: "right";
40
+ };
41
+ type AlignX = (typeof AlignX)[keyof typeof AlignX];
42
+ /**
43
+ * 縦位置
44
+ *
45
+ * - top: 上寄せ
46
+ * - middle: 中央寄せ
47
+ * - bottom: 下寄せ
48
+ */
49
+ declare const AlignYBase: {
50
+ readonly top: "top";
51
+ readonly middle: "middle";
52
+ readonly bottom: "bottom";
53
+ };
54
+ type AlignYBase = (typeof AlignYBase)[keyof typeof AlignYBase];
55
+ /**
56
+ * 縦位置
57
+ *
58
+ * - top: 上寄せ
59
+ * - middle: 中央寄せ
60
+ * - bottom: 下寄せ
61
+ * - space-between: 両端揃え
62
+ * - space-around: 両端余白あり均等
63
+ * - space-evenly: 完全均等
64
+ */
65
+ declare const AlignY: {
66
+ readonly 'space-between': "space-between";
67
+ readonly 'space-around': "space-around";
68
+ readonly 'space-evenly': "space-evenly";
69
+ readonly top: "top";
70
+ readonly middle: "middle";
71
+ readonly bottom: "bottom";
72
+ };
73
+ type AlignY = (typeof AlignY)[keyof typeof AlignY];
74
+ /**
75
+ * 親要素のサイズを基準にした子要素のサイズ調整
76
+ *
77
+ * - `none`
78
+ * - 親のサイズに足りないとき: そのまま
79
+ * - 親のサイズを超えるとき: そのまま
80
+ */
81
+ declare const AdjustBase: {
82
+ readonly none: "none";
83
+ };
84
+ type AdjustBase = (typeof AdjustBase)[keyof typeof AdjustBase];
85
+ /**
86
+ * 親要素のサイズを基準にした子要素のサイズ調整
87
+ *
88
+ * - `none`
89
+ * - 親のサイズに足りないとき: そのまま
90
+ * - 親のサイズを超えるとき: そのまま
91
+ * - `fit`
92
+ * - 親のサイズに足りないとき: 伸ばす
93
+ * - 親のサイズを超えるとき: 縮める
94
+ * - `grow`
95
+ * - 親のサイズに足りないとき: 伸ばす
96
+ * - 親のサイズを超えるとき: そのまま
97
+ * - `shrink`
98
+ * - 親のサイズに足りないとき: そのまま
99
+ * - 親のサイズを超えるとき: 縮める
100
+ */
101
+ declare const Adjust: {
102
+ readonly fit: "fit";
103
+ readonly grow: "grow";
104
+ readonly shrink: "shrink";
105
+ readonly none: "none";
106
+ };
107
+ type Adjust = (typeof Adjust)[keyof typeof Adjust];
108
+ /**
109
+ * レイアウト種別: stack
110
+ */
111
+ declare const clsLayoutStack = "nws-layout-stack";
112
+ /**
113
+ * レイアウト種別: flow
114
+ */
115
+ declare const clsLayoutFlow = "nws-layout-flow";
116
+ /**
117
+ * レイアウト種別: tile
118
+ */
119
+ declare const clsLayoutTile = "nws-layout-tile";
120
+ /**
121
+ * レイアウト種別: matrix
122
+ */
123
+ declare const clsLayoutMatrix = "nws-layout-matrix";
124
+ /**
125
+ * レイアウト種別: center
126
+ */
127
+ declare const clsLayoutCenter = "nws-layout-center";
128
+ /**
129
+ * レイアウト種別: pack
130
+ */
131
+ declare const clsLayoutPack = "nws-layout-pack";
132
+ /**
133
+ * レイアウト種別: balance
134
+ */
135
+ declare const clsLayoutBalance = "nws-layout-balance";
136
+ /**
137
+ * レイアウト種別: layer
138
+ */
139
+ declare const clsLayoutLayer = "nws-layout-layer";
140
+ /**
141
+ * レイアウト種別: pin
142
+ */
143
+ declare const clsLayoutPin = "nws-layout-pin";
144
+ /**
145
+ * 整列: 横方向
146
+ */
147
+ declare const clsLayoutDirectionX = "nws-layout-direction-x";
148
+ /**
149
+ * 整列: 縦方向
150
+ */
151
+ declare const clsLayoutDirectionY = "nws-layout-direction-y";
152
+ /**
153
+ * 横位置: 左
154
+ */
155
+ declare const clsLayoutAlignXLeft = "nws-layout-alignX-left";
156
+ /**
157
+ * 横位置: 中央
158
+ */
159
+ declare const clsLayoutAlignXCenter = "nws-layout-alignX-center";
160
+ /**
161
+ * 横位置: 右
162
+ */
163
+ declare const clsLayoutAlignXRight = "nws-layout-alignX-right";
164
+ /**
165
+ * 横位置: 両端揃え
166
+ */
167
+ declare const clsLayoutAlignXSpaceBetween = "nws-layout-alignX-spaceBetween";
168
+ /**
169
+ * 横位置: 両端余白あり均等
170
+ */
171
+ declare const clsLayoutAlignXSpaceAround = "nws-layout-alignX-spaceAround";
172
+ /**
173
+ * 横位置: 完全均等
174
+ */
175
+ declare const clsLayoutAlignXSpaceEvenly = "nws-layout-alignX-spaceEvenly";
176
+ /**
177
+ * 縦位置: 上
178
+ */
179
+ declare const clsLayoutAlignYTop = "nws-layout-alignY-top";
180
+ /**
181
+ * 縦位置: 中央
182
+ */
183
+ declare const clsLayoutAlignYMiddle = "nws-layout-alignY-middle";
184
+ /**
185
+ * 縦位置: 下
186
+ */
187
+ declare const clsLayoutAlignYBottom = "nws-layout-alignY-bottom";
188
+ /**
189
+ * 縦位置: 両端揃え
190
+ */
191
+ declare const clsLayoutAlignYSpaceBetween = "nws-layout-alignY-spaceBetween";
192
+ /**
193
+ * 縦位置: 両端余白あり均等
194
+ */
195
+ declare const clsLayoutAlignYSpaceAround = "nws-layout-alignY-spaceAround";
196
+ /**
197
+ * 縦位置: 完全均等
198
+ */
199
+ declare const clsLayoutAlignYSpaceEvenly = "nws-layout-alignY-spaceEvenly";
200
+ /**
201
+ * 子要素の幅調整: なし
202
+ */
203
+ declare const clsLayoutAdjustXNone = "nws-layout-adjustX-none";
204
+ /**
205
+ * 子要素の幅調整: 伸ばす & 縮める
206
+ */
207
+ declare const clsLayoutAdjustXFit = "nws-layout-adjustX-fit";
208
+ /**
209
+ * 子要素の幅調整: 伸ばす
210
+ */
211
+ declare const clsLayoutAdjustXExpand = "nws-layout-adjustX-grow";
212
+ /**
213
+ * 子要素の幅調整: 縮める
214
+ */
215
+ declare const clsLayoutAdjustXShrink = "nws-layout-adjustX-shrink";
216
+ /**
217
+ * 子要素の高さ調整: なし
218
+ */
219
+ declare const clsLayoutAdjustYNone = "nws-layout-adjustY-none";
220
+ /**
221
+ * 子要素の高さ調整: 伸ばす & 縮める
222
+ */
223
+ declare const clsLayoutAdjustYFit = "nws-layout-adjustY-fit";
224
+ /**
225
+ * 子要素の高さ調整: 伸ばす
226
+ */
227
+ declare const clsLayoutAdjustYExpand = "nws-layout-adjustY-grow";
228
+ /**
229
+ * 子要素の高さ調整: 縮める
230
+ */
231
+ declare const clsLayoutAdjustYShrink = "nws-layout-adjustY-shrink";
232
+ /**
233
+ * 間隔: 横方向
234
+ */
235
+ declare const clsLayoutGapX = "nws-layout-gapX";
236
+ /**
237
+ * 間隔: 縦方向
238
+ */
239
+ declare const clsLayoutGapY = "nws-layout-gapY";
240
+ /**
241
+ * 子要素の幅
242
+ */
243
+ declare const clsLayoutChildSizeX = "nws-layout-childSizeX";
244
+ /**
245
+ * 子要素の高さ
246
+ */
247
+ declare const clsLayoutChildSizeY = "nws-layout-childSizeY";
248
+ /**
249
+ * 子要素の縦横比
250
+ */
251
+ declare const clsLayoutChildRatio = "nws-layout-childRatio";
252
+ /**
253
+ * 子要素の横方向の数
254
+ */
255
+ declare const clsLayoutChildCountX = "nws-layout-childCountX";
256
+ /**
257
+ * 子要素の縦方向の数
258
+ */
259
+ declare const clsLayoutChildCountY = "nws-layout-childCountY";
260
+ /**
261
+ * 変数\
262
+ * 間隔: 横方向
263
+ */
264
+ declare const varLayoutGapX = "--nws-layout-gapX";
265
+ /**
266
+ * 変数\
267
+ * 間隔: 縦方向
268
+ */
269
+ declare const varLayoutGapY = "--nws-layout-gapY";
270
+ /**
271
+ * 変数\
272
+ * 子要素の横方向の数
273
+ */
274
+ declare const varLayoutChildCountX = "--nws-layout-childCountX";
275
+ /**
276
+ * 変数\
277
+ * 子要素の縦方向の数
278
+ */
279
+ declare const varLayoutChildCountY = "--nws-layout-childCountY";
280
+ /**
281
+ * 変数\
282
+ * 子要素の幅
283
+ */
284
+ declare const varLayoutChildSizeX = "--nws-layout-childSizeX";
285
+ /**
286
+ * 変数\
287
+ * 子要素の高さ
288
+ */
289
+ declare const varLayoutChildSizeY = "--nws-layout-childSizeY";
290
+ /**
291
+ * 変数\
292
+ * 子要素の縦横比
293
+ */
294
+ declare const varLayoutChildRatio = "--nws-layout-childRatio";
295
+ /**
296
+ * 変数\
297
+ * 横方向のテンプレート
298
+ */
299
+ declare const varLayoutTemplateX = "--nws-layout-templateX";
300
+ /**
301
+ * 変数\
302
+ * 縦方向のテンプレート
303
+ */
304
+ declare const varLayoutTemplateY = "--nws-layout-templateY";
305
+ /**
306
+ * 変数\
307
+ * 横方向のオートトラック
308
+ */
309
+ declare const varLayoutAutoTracX = "--nws-layout-autoTracX";
310
+ /**
311
+ * 変数\
312
+ * 縦方向のオートトラック
313
+ */
314
+ declare const varLayoutAutoTracY = "--nws-layout-autoTracY";
315
+ //#endregion
316
+ export { Adjust, AdjustBase, AlignX, AlignXBase, AlignY, AlignYBase, Direction, clsLayoutAdjustXExpand, clsLayoutAdjustXFit, clsLayoutAdjustXNone, clsLayoutAdjustXShrink, clsLayoutAdjustYExpand, clsLayoutAdjustYFit, clsLayoutAdjustYNone, clsLayoutAdjustYShrink, clsLayoutAlignXCenter, clsLayoutAlignXLeft, clsLayoutAlignXRight, clsLayoutAlignXSpaceAround, clsLayoutAlignXSpaceBetween, clsLayoutAlignXSpaceEvenly, clsLayoutAlignYBottom, clsLayoutAlignYMiddle, clsLayoutAlignYSpaceAround, clsLayoutAlignYSpaceBetween, clsLayoutAlignYSpaceEvenly, clsLayoutAlignYTop, clsLayoutBalance, clsLayoutCenter, clsLayoutChildCountX, clsLayoutChildCountY, clsLayoutChildRatio, clsLayoutChildSizeX, clsLayoutChildSizeY, clsLayoutDirectionX, clsLayoutDirectionY, clsLayoutFlow, clsLayoutGapX, clsLayoutGapY, clsLayoutLayer, clsLayoutMatrix, clsLayoutPack, clsLayoutPin, clsLayoutStack, clsLayoutTile, varLayoutAutoTracX, varLayoutAutoTracY, varLayoutChildCountX, varLayoutChildCountY, varLayoutChildRatio, varLayoutChildSizeX, varLayoutChildSizeY, varLayoutGapX, varLayoutGapY, varLayoutTemplateX, varLayoutTemplateY };
@@ -0,0 +1,305 @@
1
+ //#region src/core/constants.ts
2
+ /**
3
+ * 整列方向
4
+ */
5
+ const Direction = {
6
+ x: "x",
7
+ y: "y"
8
+ };
9
+ const AlignBetween = {
10
+ "space-between": "space-between",
11
+ "space-around": "space-around",
12
+ "space-evenly": "space-evenly"
13
+ };
14
+ /**
15
+ * 横位置
16
+ *
17
+ * - left: 左寄せ
18
+ * - center: 中央寄せ
19
+ * - right: 右寄せ
20
+ */
21
+ const AlignXBase = {
22
+ left: "left",
23
+ center: "center",
24
+ right: "right"
25
+ };
26
+ /**
27
+ * 横位置
28
+ *
29
+ * - left: 左寄せ
30
+ * - center: 中央寄せ
31
+ * - right: 右寄せ
32
+ * - space-between: 両端揃え
33
+ * - space-around: 両端余白あり均等
34
+ * - space-evenly: 完全均等
35
+ */
36
+ const AlignX = {
37
+ ...AlignXBase,
38
+ ...AlignBetween
39
+ };
40
+ /**
41
+ * 縦位置
42
+ *
43
+ * - top: 上寄せ
44
+ * - middle: 中央寄せ
45
+ * - bottom: 下寄せ
46
+ */
47
+ const AlignYBase = {
48
+ top: "top",
49
+ middle: "middle",
50
+ bottom: "bottom"
51
+ };
52
+ /**
53
+ * 縦位置
54
+ *
55
+ * - top: 上寄せ
56
+ * - middle: 中央寄せ
57
+ * - bottom: 下寄せ
58
+ * - space-between: 両端揃え
59
+ * - space-around: 両端余白あり均等
60
+ * - space-evenly: 完全均等
61
+ */
62
+ const AlignY = {
63
+ ...AlignYBase,
64
+ ...AlignBetween
65
+ };
66
+ /**
67
+ * 親要素のサイズを基準にした子要素のサイズ調整
68
+ *
69
+ * - `none`
70
+ * - 親のサイズに足りないとき: そのまま
71
+ * - 親のサイズを超えるとき: そのまま
72
+ */
73
+ const AdjustBase = { none: "none" };
74
+ /**
75
+ * 親要素のサイズを基準にした子要素のサイズ調整
76
+ *
77
+ * - `none`
78
+ * - 親のサイズに足りないとき: そのまま
79
+ * - 親のサイズを超えるとき: そのまま
80
+ * - `fit`
81
+ * - 親のサイズに足りないとき: 伸ばす
82
+ * - 親のサイズを超えるとき: 縮める
83
+ * - `grow`
84
+ * - 親のサイズに足りないとき: 伸ばす
85
+ * - 親のサイズを超えるとき: そのまま
86
+ * - `shrink`
87
+ * - 親のサイズに足りないとき: そのまま
88
+ * - 親のサイズを超えるとき: 縮める
89
+ */
90
+ const Adjust = {
91
+ ...AdjustBase,
92
+ fit: "fit",
93
+ grow: "grow",
94
+ shrink: "shrink"
95
+ };
96
+ /**
97
+ * レイアウト種別: stack
98
+ */
99
+ const clsLayoutStack = "nws-layout-stack";
100
+ /**
101
+ * レイアウト種別: flow
102
+ */
103
+ const clsLayoutFlow = "nws-layout-flow";
104
+ /**
105
+ * レイアウト種別: tile
106
+ */
107
+ const clsLayoutTile = "nws-layout-tile";
108
+ /**
109
+ * レイアウト種別: matrix
110
+ */
111
+ const clsLayoutMatrix = "nws-layout-matrix";
112
+ /**
113
+ * レイアウト種別: center
114
+ */
115
+ const clsLayoutCenter = "nws-layout-center";
116
+ /**
117
+ * レイアウト種別: pack
118
+ */
119
+ const clsLayoutPack = "nws-layout-pack";
120
+ /**
121
+ * レイアウト種別: balance
122
+ */
123
+ const clsLayoutBalance = "nws-layout-balance";
124
+ /**
125
+ * レイアウト種別: layer
126
+ */
127
+ const clsLayoutLayer = "nws-layout-layer";
128
+ /**
129
+ * レイアウト種別: pin
130
+ */
131
+ const clsLayoutPin = "nws-layout-pin";
132
+ /**
133
+ * 整列: 横方向
134
+ */
135
+ const clsLayoutDirectionX = "nws-layout-direction-x";
136
+ /**
137
+ * 整列: 縦方向
138
+ */
139
+ const clsLayoutDirectionY = "nws-layout-direction-y";
140
+ /**
141
+ * 横位置: 左
142
+ */
143
+ const clsLayoutAlignXLeft = "nws-layout-alignX-left";
144
+ /**
145
+ * 横位置: 中央
146
+ */
147
+ const clsLayoutAlignXCenter = "nws-layout-alignX-center";
148
+ /**
149
+ * 横位置: 右
150
+ */
151
+ const clsLayoutAlignXRight = "nws-layout-alignX-right";
152
+ /**
153
+ * 横位置: 両端揃え
154
+ */
155
+ const clsLayoutAlignXSpaceBetween = "nws-layout-alignX-spaceBetween";
156
+ /**
157
+ * 横位置: 両端余白あり均等
158
+ */
159
+ const clsLayoutAlignXSpaceAround = "nws-layout-alignX-spaceAround";
160
+ /**
161
+ * 横位置: 完全均等
162
+ */
163
+ const clsLayoutAlignXSpaceEvenly = "nws-layout-alignX-spaceEvenly";
164
+ /**
165
+ * 縦位置: 上
166
+ */
167
+ const clsLayoutAlignYTop = "nws-layout-alignY-top";
168
+ /**
169
+ * 縦位置: 中央
170
+ */
171
+ const clsLayoutAlignYMiddle = "nws-layout-alignY-middle";
172
+ /**
173
+ * 縦位置: 下
174
+ */
175
+ const clsLayoutAlignYBottom = "nws-layout-alignY-bottom";
176
+ /**
177
+ * 縦位置: 両端揃え
178
+ */
179
+ const clsLayoutAlignYSpaceBetween = "nws-layout-alignY-spaceBetween";
180
+ /**
181
+ * 縦位置: 両端余白あり均等
182
+ */
183
+ const clsLayoutAlignYSpaceAround = "nws-layout-alignY-spaceAround";
184
+ /**
185
+ * 縦位置: 完全均等
186
+ */
187
+ const clsLayoutAlignYSpaceEvenly = "nws-layout-alignY-spaceEvenly";
188
+ /**
189
+ * 子要素の幅調整: なし
190
+ */
191
+ const clsLayoutAdjustXNone = "nws-layout-adjustX-none";
192
+ /**
193
+ * 子要素の幅調整: 伸ばす & 縮める
194
+ */
195
+ const clsLayoutAdjustXFit = "nws-layout-adjustX-fit";
196
+ /**
197
+ * 子要素の幅調整: 伸ばす
198
+ */
199
+ const clsLayoutAdjustXExpand = "nws-layout-adjustX-grow";
200
+ /**
201
+ * 子要素の幅調整: 縮める
202
+ */
203
+ const clsLayoutAdjustXShrink = "nws-layout-adjustX-shrink";
204
+ /**
205
+ * 子要素の高さ調整: なし
206
+ */
207
+ const clsLayoutAdjustYNone = "nws-layout-adjustY-none";
208
+ /**
209
+ * 子要素の高さ調整: 伸ばす & 縮める
210
+ */
211
+ const clsLayoutAdjustYFit = "nws-layout-adjustY-fit";
212
+ /**
213
+ * 子要素の高さ調整: 伸ばす
214
+ */
215
+ const clsLayoutAdjustYExpand = "nws-layout-adjustY-grow";
216
+ /**
217
+ * 子要素の高さ調整: 縮める
218
+ */
219
+ const clsLayoutAdjustYShrink = "nws-layout-adjustY-shrink";
220
+ /**
221
+ * 間隔: 横方向
222
+ */
223
+ const clsLayoutGapX = "nws-layout-gapX";
224
+ /**
225
+ * 間隔: 縦方向
226
+ */
227
+ const clsLayoutGapY = "nws-layout-gapY";
228
+ /**
229
+ * 子要素の幅
230
+ */
231
+ const clsLayoutChildSizeX = "nws-layout-childSizeX";
232
+ /**
233
+ * 子要素の高さ
234
+ */
235
+ const clsLayoutChildSizeY = "nws-layout-childSizeY";
236
+ /**
237
+ * 子要素の縦横比
238
+ */
239
+ const clsLayoutChildRatio = "nws-layout-childRatio";
240
+ /**
241
+ * 子要素の横方向の数
242
+ */
243
+ const clsLayoutChildCountX = "nws-layout-childCountX";
244
+ /**
245
+ * 子要素の縦方向の数
246
+ */
247
+ const clsLayoutChildCountY = "nws-layout-childCountY";
248
+ /**
249
+ * 変数\
250
+ * 間隔: 横方向
251
+ */
252
+ const varLayoutGapX = "--nws-layout-gapX";
253
+ /**
254
+ * 変数\
255
+ * 間隔: 縦方向
256
+ */
257
+ const varLayoutGapY = "--nws-layout-gapY";
258
+ /**
259
+ * 変数\
260
+ * 子要素の横方向の数
261
+ */
262
+ const varLayoutChildCountX = "--nws-layout-childCountX";
263
+ /**
264
+ * 変数\
265
+ * 子要素の縦方向の数
266
+ */
267
+ const varLayoutChildCountY = "--nws-layout-childCountY";
268
+ /**
269
+ * 変数\
270
+ * 子要素の幅
271
+ */
272
+ const varLayoutChildSizeX = "--nws-layout-childSizeX";
273
+ /**
274
+ * 変数\
275
+ * 子要素の高さ
276
+ */
277
+ const varLayoutChildSizeY = "--nws-layout-childSizeY";
278
+ /**
279
+ * 変数\
280
+ * 子要素の縦横比
281
+ */
282
+ const varLayoutChildRatio = "--nws-layout-childRatio";
283
+ /**
284
+ * 変数\
285
+ * 横方向のテンプレート
286
+ */
287
+ const varLayoutTemplateX = "--nws-layout-templateX";
288
+ /**
289
+ * 変数\
290
+ * 縦方向のテンプレート
291
+ */
292
+ const varLayoutTemplateY = "--nws-layout-templateY";
293
+ /**
294
+ * 変数\
295
+ * 横方向のオートトラック
296
+ */
297
+ const varLayoutAutoTracX = "--nws-layout-autoTracX";
298
+ /**
299
+ * 変数\
300
+ * 縦方向のオートトラック
301
+ */
302
+ const varLayoutAutoTracY = "--nws-layout-autoTracY";
303
+
304
+ //#endregion
305
+ export { Adjust, AdjustBase, AlignX, AlignXBase, AlignY, AlignYBase, Direction, clsLayoutAdjustXExpand, clsLayoutAdjustXFit, clsLayoutAdjustXNone, clsLayoutAdjustXShrink, clsLayoutAdjustYExpand, clsLayoutAdjustYFit, clsLayoutAdjustYNone, clsLayoutAdjustYShrink, clsLayoutAlignXCenter, clsLayoutAlignXLeft, clsLayoutAlignXRight, clsLayoutAlignXSpaceAround, clsLayoutAlignXSpaceBetween, clsLayoutAlignXSpaceEvenly, clsLayoutAlignYBottom, clsLayoutAlignYMiddle, clsLayoutAlignYSpaceAround, clsLayoutAlignYSpaceBetween, clsLayoutAlignYSpaceEvenly, clsLayoutAlignYTop, clsLayoutBalance, clsLayoutCenter, clsLayoutChildCountX, clsLayoutChildCountY, clsLayoutChildRatio, clsLayoutChildSizeX, clsLayoutChildSizeY, clsLayoutDirectionX, clsLayoutDirectionY, clsLayoutFlow, clsLayoutGapX, clsLayoutGapY, clsLayoutLayer, clsLayoutMatrix, clsLayoutPack, clsLayoutPin, clsLayoutStack, clsLayoutTile, varLayoutAutoTracX, varLayoutAutoTracY, varLayoutChildCountX, varLayoutChildCountY, varLayoutChildRatio, varLayoutChildSizeX, varLayoutChildSizeY, varLayoutGapX, varLayoutGapY, varLayoutTemplateX, varLayoutTemplateY };
@@ -0,0 +1,71 @@
1
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
+ const require_core_constants = require('../constants.cjs');
3
+ const require_core__constants = require('../_constants.cjs');
4
+ const require_core__internal_hasValue = require('../_internal/hasValue.cjs');
5
+ const require_core__internal_applyChildRatio = require('../_internal/applyChildRatio.cjs');
6
+ const require_core__internal_unit = require('../_internal/unit.cjs');
7
+ const require_core__internal_applyGap = require('../_internal/applyGap.cjs');
8
+ const require_core__internal_mergeLayoutResults = require('../_internal/mergeLayoutResults.cjs');
9
+ let _niche_works_utils_object_maybeDefault = require("@niche-works/utils/object/maybeDefault");
10
+ _niche_works_utils_object_maybeDefault = require_runtime.__toESM(_niche_works_utils_object_maybeDefault, 1);
11
+ let clsx = require("clsx");
12
+ clsx = require_runtime.__toESM(clsx, 1);
13
+
14
+ //#region src/core/flow/flow.ts
15
+ /**
16
+ * flowレイアウト
17
+ *
18
+ * - 子要素を並べて配置し、親要素のサイズに達したら折り返す
19
+ * - stackとの違いは flex-wrap: wrap が常に有効な点
20
+ */
21
+ const flow = (options = {}) => {
22
+ const { direction, alignX, alignY, adjustX, adjustY, gap, gapX = gap, gapY = gap, childSizeX, childSizeY, childRatioX, childRatioY } = (0, _niche_works_utils_object_maybeDefault.default)(options, {
23
+ direction: "x",
24
+ alignX: "left",
25
+ alignY: "top"
26
+ }, { overwriteNull: true });
27
+ const result = {
28
+ className: (0, clsx.default)(require_core_constants.clsLayoutFlow, require_core__constants.clsLayoutDirection[direction], require_core__constants.clsLayoutAlign.x[alignX], require_core__constants.clsLayoutAlign.y[alignY]),
29
+ style: {}
30
+ };
31
+ require_core__internal_applyGap(result, gap, gapX, gapY);
32
+ require_core__internal_applyChildRatio(result, childRatioX, childRatioY);
33
+ const resultList = [result];
34
+ if (direction === "x") {
35
+ resultList.push(_getFlowMainAxisStyle("x", alignX, adjustX, childSizeX));
36
+ resultList.push(_getFlowCrossAxisStyle("y", alignY, childSizeY));
37
+ } else {
38
+ resultList.push(_getFlowCrossAxisStyle("x", alignX, childSizeX));
39
+ resultList.push(_getFlowMainAxisStyle("y", alignY, adjustY, childSizeY));
40
+ }
41
+ return require_core__internal_mergeLayoutResults(resultList);
42
+ };
43
+ /**
44
+ * 主軸方向のスタイル
45
+ *
46
+ * stackの _getStackMainAxisStyle に相当。flowでは主軸の挙動はstackと同じ。
47
+ */
48
+ function _getFlowMainAxisStyle(axis, align, adjust, childSize) {
49
+ const result = { className: (0, clsx.default)(require_core__constants.clsLayoutAlign[axis][align], require_core__constants.clsLayoutAdjust[axis][adjust]) };
50
+ if (require_core__internal_hasValue(childSize)) {
51
+ result.className = (0, clsx.default)(result.className, require_core__constants.clsLayoutChildSize[axis]);
52
+ result.style = { [require_core__constants.varLayoutChildSize[axis]]: require_core__internal_unit(childSize) };
53
+ }
54
+ return result;
55
+ }
56
+ /**
57
+ * 交差軸方向のスタイル
58
+ *
59
+ * stackの _getStackClossAxisStyle に相当。
60
+ * flowは交差軸方向のadjustはできないため、常にnoneのスタイルを返す
61
+ */
62
+ function _getFlowCrossAxisStyle(axis, align, childSize) {
63
+ if (require_core__internal_hasValue(childSize)) return {
64
+ className: (0, clsx.default)(require_core__constants.clsLayoutAlign[axis][align], require_core__constants.clsLayoutChildSize[axis]),
65
+ style: { [require_core__constants.varLayoutChildSize[axis]]: require_core__internal_unit(childSize) }
66
+ };
67
+ else return { className: require_core__constants.clsLayoutAlign[axis][align] };
68
+ }
69
+
70
+ //#endregion
71
+ module.exports = flow;
@@ -0,0 +1,12 @@
1
+ import { StyleLayout } from "../types.cjs";
2
+ import { FlowLayoutOptions } from "./types.cjs";
3
+
4
+ //#region src/core/flow/flow.d.ts
5
+ /**
6
+ * flowレイアウト
7
+ *
8
+ * - 子要素を並べて配置し、親要素のサイズに達したら折り返す
9
+ * - stackとの違いは flex-wrap: wrap が常に有効な点
10
+ */
11
+ declare const flow: StyleLayout<FlowLayoutOptions>;
12
+ export = flow;