@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,237 @@
1
+ import { Adjust, AlignX, AlignY, Direction } from "./constants.mjs";
2
+
3
+ //#region src/_constants.d.ts
4
+ /**
5
+ * レイアウト種別: stack
6
+ */
7
+ declare const clsLayoutStack = "lx-layout-stack";
8
+ /**
9
+ * レイアウト種別: flow
10
+ */
11
+ declare const clsLayoutFlow = "lx-layout-flow";
12
+ /**
13
+ * レイアウト種別: tile
14
+ */
15
+ declare const clsLayoutTile = "lx-layout-tile";
16
+ /**
17
+ * レイアウト種別: matrix
18
+ */
19
+ declare const clsLayoutMatrix = "lx-layout-matrix";
20
+ /**
21
+ * レイアウト種別: center
22
+ */
23
+ declare const clsLayoutCenter = "lx-layout-center";
24
+ /**
25
+ * レイアウト種別: pack
26
+ */
27
+ declare const clsLayoutPack = "lx-layout-pack";
28
+ /**
29
+ * レイアウト種別: balance
30
+ */
31
+ declare const clsLayoutBalance = "lx-layout-balance";
32
+ /**
33
+ * レイアウト種別: layer
34
+ */
35
+ declare const clsLayoutLayer = "lx-layout-layer";
36
+ /**
37
+ * レイアウト種別: pin
38
+ */
39
+ declare const clsLayoutPin = "lx-layout-pin";
40
+ /**
41
+ * 整列: 横方向
42
+ */
43
+ declare const clsLayoutDirectionX = "lx-layout-direction-x";
44
+ /**
45
+ * 整列: 縦方向
46
+ */
47
+ declare const clsLayoutDirectionY = "lx-layout-direction-y";
48
+ /**
49
+ * 横位置: 左
50
+ */
51
+ declare const clsLayoutAlignXLeft = "lx-layout-alignX-left";
52
+ /**
53
+ * 横位置: 中央
54
+ */
55
+ declare const clsLayoutAlignXCenter = "lx-layout-alignX-center";
56
+ /**
57
+ * 横位置: 右
58
+ */
59
+ declare const clsLayoutAlignXRight = "lx-layout-alignX-right";
60
+ /**
61
+ * 横位置: 両端揃え
62
+ */
63
+ declare const clsLayoutAlignXSpaceBetween = "lx-layout-alignX-spaceBetween";
64
+ /**
65
+ * 横位置: 両端余白あり均等
66
+ */
67
+ declare const clsLayoutAlignXSpaceAround = "lx-layout-alignX-spaceAround";
68
+ /**
69
+ * 横位置: 完全均等
70
+ */
71
+ declare const clsLayoutAlignXSpaceEvenly = "lx-layout-alignX-spaceEvenly";
72
+ /**
73
+ * 縦位置: 上
74
+ */
75
+ declare const clsLayoutAlignYTop = "lx-layout-alignY-top";
76
+ /**
77
+ * 縦位置: 中央
78
+ */
79
+ declare const clsLayoutAlignYMiddle = "lx-layout-alignY-middle";
80
+ /**
81
+ * 縦位置: 下
82
+ */
83
+ declare const clsLayoutAlignYBottom = "lx-layout-alignY-bottom";
84
+ /**
85
+ * 縦位置: 両端揃え
86
+ */
87
+ declare const clsLayoutAlignYSpaceBetween = "lx-layout-alignY-spaceBetween";
88
+ /**
89
+ * 縦位置: 両端余白あり均等
90
+ */
91
+ declare const clsLayoutAlignYSpaceAround = "lx-layout-alignY-spaceAround";
92
+ /**
93
+ * 縦位置: 完全均等
94
+ */
95
+ declare const clsLayoutAlignYSpaceEvenly = "lx-layout-alignY-spaceEvenly";
96
+ /**
97
+ * 子要素の幅調整: なし
98
+ */
99
+ declare const clsLayoutAdjustXNone = "lx-layout-adjustX-none";
100
+ /**
101
+ * 子要素の幅調整: 伸ばす & 縮める
102
+ */
103
+ declare const clsLayoutAdjustXFit = "lx-layout-adjustX-fit";
104
+ /**
105
+ * 子要素の幅調整: 伸ばす
106
+ */
107
+ declare const clsLayoutAdjustXExpand = "lx-layout-adjustX-grow";
108
+ /**
109
+ * 子要素の幅調整: 縮める
110
+ */
111
+ declare const clsLayoutAdjustXShrink = "lx-layout-adjustX-shrink";
112
+ /**
113
+ * 子要素の高さ調整: なし
114
+ */
115
+ declare const clsLayoutAdjustYNone = "lx-layout-adjustY-none";
116
+ /**
117
+ * 子要素の高さ調整: 伸ばす & 縮める
118
+ */
119
+ declare const clsLayoutAdjustYFit = "lx-layout-adjustY-fit";
120
+ /**
121
+ * 子要素の高さ調整: 伸ばす
122
+ */
123
+ declare const clsLayoutAdjustYExpand = "lx-layout-adjustY-grow";
124
+ /**
125
+ * 子要素の高さ調整: 縮める
126
+ */
127
+ declare const clsLayoutAdjustYShrink = "lx-layout-adjustY-shrink";
128
+ /**
129
+ * 間隔: 横方向
130
+ */
131
+ declare const clsLayoutGapX = "lx-layout-gapX";
132
+ /**
133
+ * 間隔: 縦方向
134
+ */
135
+ declare const clsLayoutGapY = "lx-layout-gapY";
136
+ /**
137
+ * 子要素の幅
138
+ */
139
+ declare const clsLayoutItemSizeX = "lx-layout-itemSizeX";
140
+ /**
141
+ * 子要素の高さ
142
+ */
143
+ declare const clsLayoutItemSizeY = "lx-layout-itemSizeY";
144
+ /**
145
+ * 子要素の縦横比
146
+ */
147
+ declare const clsLayoutItemRatio = "lx-layout-itemRatio";
148
+ /**
149
+ * 子要素の横方向の数
150
+ */
151
+ declare const clsLayoutItemCountX = "lx-layout-itemCountX";
152
+ /**
153
+ * 子要素の縦方向の数
154
+ */
155
+ declare const clsLayoutItemCountY = "lx-layout-itemCountY";
156
+ /**
157
+ * 横方向のテンプレート
158
+ */
159
+ declare const clsLayoutTemplateX = "lx-layout-templateX";
160
+ /**
161
+ * 縦方向のテンプレート
162
+ */
163
+ declare const clsLayoutTemplateY = "lx-layout-templateY";
164
+ /**
165
+ * 変数\
166
+ * 間隔: 横方向
167
+ */
168
+ declare const varLayoutGapX = "--lx-layout-gapX";
169
+ /**
170
+ * 変数\
171
+ * 間隔: 縦方向
172
+ */
173
+ declare const varLayoutGapY = "--lx-layout-gapY";
174
+ /**
175
+ * 変数\
176
+ * 子要素の幅
177
+ */
178
+ declare const varLayoutItemSizeX = "--lx-layout-itemSizeX";
179
+ /**
180
+ * 変数\
181
+ * 子要素の高さ
182
+ */
183
+ declare const varLayoutItemSizeY = "--lx-layout-itemSizeY";
184
+ /**
185
+ * 変数\
186
+ * 子要素の縦横比
187
+ */
188
+ declare const varLayoutItemRatio = "--lx-layout-itemRatio";
189
+ /**
190
+ * 変数\
191
+ * 子要素の横方向の数
192
+ */
193
+ declare const varLayoutItemCountX = "--lx-layout-itemCountX";
194
+ /**
195
+ * 変数\
196
+ * 子要素の縦方向の数
197
+ */
198
+ declare const varLayoutItemCountY = "--lx-layout-itemCountY";
199
+ /**
200
+ * 変数\
201
+ * 横方向のテンプレート
202
+ */
203
+ declare const varLayoutTemplateX = "--lx-layout-templateX";
204
+ /**
205
+ * 変数\
206
+ * 縦方向のテンプレート
207
+ */
208
+ declare const varLayoutTemplateY = "--lx-layout-templateY";
209
+ /**
210
+ * axis毎のクラス
211
+ */
212
+ declare const clsLayout: {
213
+ direction: Record<Direction, string>;
214
+ align: Record<Direction, Partial<Record<AlignX | AlignY, string>>>;
215
+ adjust: Record<Direction, Record<Adjust, string>>;
216
+ itemSize: Record<Direction, string>;
217
+ template: Record<Direction, string>;
218
+ };
219
+ /**
220
+ * axis毎の変数
221
+ */
222
+ declare const varLayout: {
223
+ readonly itemSize: {
224
+ readonly x: "--lx-layout-itemSizeX";
225
+ readonly y: "--lx-layout-itemSizeY";
226
+ };
227
+ readonly template: {
228
+ readonly x: "--lx-layout-templateX";
229
+ readonly y: "--lx-layout-templateY";
230
+ };
231
+ readonly gap: {
232
+ readonly x: "--lx-layout-gapX";
233
+ readonly y: "--lx-layout-gapY";
234
+ };
235
+ };
236
+ //#endregion
237
+ export { clsLayout, clsLayoutAdjustXExpand, clsLayoutAdjustXFit, clsLayoutAdjustXNone, clsLayoutAdjustXShrink, clsLayoutAdjustYExpand, clsLayoutAdjustYFit, clsLayoutAdjustYNone, clsLayoutAdjustYShrink, clsLayoutAlignXCenter, clsLayoutAlignXLeft, clsLayoutAlignXRight, clsLayoutAlignXSpaceAround, clsLayoutAlignXSpaceBetween, clsLayoutAlignXSpaceEvenly, clsLayoutAlignYBottom, clsLayoutAlignYMiddle, clsLayoutAlignYSpaceAround, clsLayoutAlignYSpaceBetween, clsLayoutAlignYSpaceEvenly, clsLayoutAlignYTop, clsLayoutBalance, clsLayoutCenter, clsLayoutDirectionX, clsLayoutDirectionY, clsLayoutFlow, clsLayoutGapX, clsLayoutGapY, clsLayoutItemCountX, clsLayoutItemCountY, clsLayoutItemRatio, clsLayoutItemSizeX, clsLayoutItemSizeY, clsLayoutLayer, clsLayoutMatrix, clsLayoutPack, clsLayoutPin, clsLayoutStack, clsLayoutTemplateX, clsLayoutTemplateY, clsLayoutTile, varLayout, varLayoutGapX, varLayoutGapY, varLayoutItemCountX, varLayoutItemCountY, varLayoutItemRatio, varLayoutItemSizeX, varLayoutItemSizeY, varLayoutTemplateX, varLayoutTemplateY };
package/_constants.mjs ADDED
@@ -0,0 +1,275 @@
1
+ //#region src/_constants.ts
2
+ /**
3
+ * レイアウト種別: stack
4
+ */
5
+ const clsLayoutStack = "lx-layout-stack";
6
+ /**
7
+ * レイアウト種別: flow
8
+ */
9
+ const clsLayoutFlow = "lx-layout-flow";
10
+ /**
11
+ * レイアウト種別: tile
12
+ */
13
+ const clsLayoutTile = "lx-layout-tile";
14
+ /**
15
+ * レイアウト種別: matrix
16
+ */
17
+ const clsLayoutMatrix = "lx-layout-matrix";
18
+ /**
19
+ * レイアウト種別: center
20
+ */
21
+ const clsLayoutCenter = "lx-layout-center";
22
+ /**
23
+ * レイアウト種別: pack
24
+ */
25
+ const clsLayoutPack = "lx-layout-pack";
26
+ /**
27
+ * レイアウト種別: balance
28
+ */
29
+ const clsLayoutBalance = "lx-layout-balance";
30
+ /**
31
+ * レイアウト種別: layer
32
+ */
33
+ const clsLayoutLayer = "lx-layout-layer";
34
+ /**
35
+ * レイアウト種別: pin
36
+ */
37
+ const clsLayoutPin = "lx-layout-pin";
38
+ /**
39
+ * 整列: 横方向
40
+ */
41
+ const clsLayoutDirectionX = "lx-layout-direction-x";
42
+ /**
43
+ * 整列: 縦方向
44
+ */
45
+ const clsLayoutDirectionY = "lx-layout-direction-y";
46
+ /**
47
+ * 横位置: 左
48
+ */
49
+ const clsLayoutAlignXLeft = "lx-layout-alignX-left";
50
+ /**
51
+ * 横位置: 中央
52
+ */
53
+ const clsLayoutAlignXCenter = "lx-layout-alignX-center";
54
+ /**
55
+ * 横位置: 右
56
+ */
57
+ const clsLayoutAlignXRight = "lx-layout-alignX-right";
58
+ /**
59
+ * 横位置: 両端揃え
60
+ */
61
+ const clsLayoutAlignXSpaceBetween = "lx-layout-alignX-spaceBetween";
62
+ /**
63
+ * 横位置: 両端余白あり均等
64
+ */
65
+ const clsLayoutAlignXSpaceAround = "lx-layout-alignX-spaceAround";
66
+ /**
67
+ * 横位置: 完全均等
68
+ */
69
+ const clsLayoutAlignXSpaceEvenly = "lx-layout-alignX-spaceEvenly";
70
+ /**
71
+ * 縦位置: 上
72
+ */
73
+ const clsLayoutAlignYTop = "lx-layout-alignY-top";
74
+ /**
75
+ * 縦位置: 中央
76
+ */
77
+ const clsLayoutAlignYMiddle = "lx-layout-alignY-middle";
78
+ /**
79
+ * 縦位置: 下
80
+ */
81
+ const clsLayoutAlignYBottom = "lx-layout-alignY-bottom";
82
+ /**
83
+ * 縦位置: 両端揃え
84
+ */
85
+ const clsLayoutAlignYSpaceBetween = "lx-layout-alignY-spaceBetween";
86
+ /**
87
+ * 縦位置: 両端余白あり均等
88
+ */
89
+ const clsLayoutAlignYSpaceAround = "lx-layout-alignY-spaceAround";
90
+ /**
91
+ * 縦位置: 完全均等
92
+ */
93
+ const clsLayoutAlignYSpaceEvenly = "lx-layout-alignY-spaceEvenly";
94
+ /**
95
+ * 子要素の幅調整: なし
96
+ */
97
+ const clsLayoutAdjustXNone = "lx-layout-adjustX-none";
98
+ /**
99
+ * 子要素の幅調整: 伸ばす & 縮める
100
+ */
101
+ const clsLayoutAdjustXFit = "lx-layout-adjustX-fit";
102
+ /**
103
+ * 子要素の幅調整: 伸ばす
104
+ */
105
+ const clsLayoutAdjustXExpand = "lx-layout-adjustX-grow";
106
+ /**
107
+ * 子要素の幅調整: 縮める
108
+ */
109
+ const clsLayoutAdjustXShrink = "lx-layout-adjustX-shrink";
110
+ /**
111
+ * 子要素の高さ調整: なし
112
+ */
113
+ const clsLayoutAdjustYNone = "lx-layout-adjustY-none";
114
+ /**
115
+ * 子要素の高さ調整: 伸ばす & 縮める
116
+ */
117
+ const clsLayoutAdjustYFit = "lx-layout-adjustY-fit";
118
+ /**
119
+ * 子要素の高さ調整: 伸ばす
120
+ */
121
+ const clsLayoutAdjustYExpand = "lx-layout-adjustY-grow";
122
+ /**
123
+ * 子要素の高さ調整: 縮める
124
+ */
125
+ const clsLayoutAdjustYShrink = "lx-layout-adjustY-shrink";
126
+ /**
127
+ * 間隔: 横方向
128
+ */
129
+ const clsLayoutGapX = "lx-layout-gapX";
130
+ /**
131
+ * 間隔: 縦方向
132
+ */
133
+ const clsLayoutGapY = "lx-layout-gapY";
134
+ /**
135
+ * 子要素の幅
136
+ */
137
+ const clsLayoutItemSizeX = "lx-layout-itemSizeX";
138
+ /**
139
+ * 子要素の高さ
140
+ */
141
+ const clsLayoutItemSizeY = "lx-layout-itemSizeY";
142
+ /**
143
+ * 子要素の縦横比
144
+ */
145
+ const clsLayoutItemRatio = "lx-layout-itemRatio";
146
+ /**
147
+ * 子要素の横方向の数
148
+ */
149
+ const clsLayoutItemCountX = "lx-layout-itemCountX";
150
+ /**
151
+ * 子要素の縦方向の数
152
+ */
153
+ const clsLayoutItemCountY = "lx-layout-itemCountY";
154
+ /**
155
+ * 横方向のテンプレート
156
+ */
157
+ const clsLayoutTemplateX = "lx-layout-templateX";
158
+ /**
159
+ * 縦方向のテンプレート
160
+ */
161
+ const clsLayoutTemplateY = "lx-layout-templateY";
162
+ /**
163
+ * 変数\
164
+ * 間隔: 横方向
165
+ */
166
+ const varLayoutGapX = "--lx-layout-gapX";
167
+ /**
168
+ * 変数\
169
+ * 間隔: 縦方向
170
+ */
171
+ const varLayoutGapY = "--lx-layout-gapY";
172
+ /**
173
+ * 変数\
174
+ * 子要素の幅
175
+ */
176
+ const varLayoutItemSizeX = "--lx-layout-itemSizeX";
177
+ /**
178
+ * 変数\
179
+ * 子要素の高さ
180
+ */
181
+ const varLayoutItemSizeY = "--lx-layout-itemSizeY";
182
+ /**
183
+ * 変数\
184
+ * 子要素の縦横比
185
+ */
186
+ const varLayoutItemRatio = "--lx-layout-itemRatio";
187
+ /**
188
+ * 変数\
189
+ * 子要素の横方向の数
190
+ */
191
+ const varLayoutItemCountX = "--lx-layout-itemCountX";
192
+ /**
193
+ * 変数\
194
+ * 子要素の縦方向の数
195
+ */
196
+ const varLayoutItemCountY = "--lx-layout-itemCountY";
197
+ /**
198
+ * 変数\
199
+ * 横方向のテンプレート
200
+ */
201
+ const varLayoutTemplateX = "--lx-layout-templateX";
202
+ /**
203
+ * 変数\
204
+ * 縦方向のテンプレート
205
+ */
206
+ const varLayoutTemplateY = "--lx-layout-templateY";
207
+ /**
208
+ * axis毎のクラス
209
+ */
210
+ const clsLayout = {
211
+ direction: {
212
+ x: clsLayoutDirectionX,
213
+ y: clsLayoutDirectionY
214
+ },
215
+ align: {
216
+ x: {
217
+ left: clsLayoutAlignXLeft,
218
+ center: clsLayoutAlignXCenter,
219
+ right: clsLayoutAlignXRight,
220
+ "space-between": clsLayoutAlignXSpaceBetween,
221
+ "space-around": clsLayoutAlignXSpaceAround,
222
+ "space-evenly": clsLayoutAlignXSpaceEvenly
223
+ },
224
+ y: {
225
+ top: clsLayoutAlignYTop,
226
+ middle: clsLayoutAlignYMiddle,
227
+ bottom: clsLayoutAlignYBottom,
228
+ "space-between": clsLayoutAlignYSpaceBetween,
229
+ "space-around": clsLayoutAlignYSpaceAround,
230
+ "space-evenly": clsLayoutAlignYSpaceEvenly
231
+ }
232
+ },
233
+ adjust: {
234
+ x: {
235
+ none: clsLayoutAdjustXNone,
236
+ fit: clsLayoutAdjustXFit,
237
+ grow: clsLayoutAdjustXExpand,
238
+ shrink: clsLayoutAdjustXShrink
239
+ },
240
+ y: {
241
+ none: clsLayoutAdjustYNone,
242
+ fit: clsLayoutAdjustYFit,
243
+ grow: clsLayoutAdjustYExpand,
244
+ shrink: clsLayoutAdjustYShrink
245
+ }
246
+ },
247
+ itemSize: {
248
+ x: clsLayoutItemSizeX,
249
+ y: clsLayoutItemSizeY
250
+ },
251
+ template: {
252
+ x: clsLayoutTemplateX,
253
+ y: clsLayoutTemplateY
254
+ }
255
+ };
256
+ /**
257
+ * axis毎の変数
258
+ */
259
+ const varLayout = {
260
+ itemSize: {
261
+ x: varLayoutItemSizeX,
262
+ y: varLayoutItemSizeY
263
+ },
264
+ template: {
265
+ x: varLayoutTemplateX,
266
+ y: varLayoutTemplateY
267
+ },
268
+ gap: {
269
+ x: varLayoutGapX,
270
+ y: varLayoutGapY
271
+ }
272
+ };
273
+
274
+ //#endregion
275
+ export { clsLayout, clsLayoutAdjustXExpand, clsLayoutAdjustXFit, clsLayoutAdjustXNone, clsLayoutAdjustXShrink, clsLayoutAdjustYExpand, clsLayoutAdjustYFit, clsLayoutAdjustYNone, clsLayoutAdjustYShrink, clsLayoutAlignXCenter, clsLayoutAlignXLeft, clsLayoutAlignXRight, clsLayoutAlignXSpaceAround, clsLayoutAlignXSpaceBetween, clsLayoutAlignXSpaceEvenly, clsLayoutAlignYBottom, clsLayoutAlignYMiddle, clsLayoutAlignYSpaceAround, clsLayoutAlignYSpaceBetween, clsLayoutAlignYSpaceEvenly, clsLayoutAlignYTop, clsLayoutBalance, clsLayoutCenter, clsLayoutDirectionX, clsLayoutDirectionY, clsLayoutFlow, clsLayoutGapX, clsLayoutGapY, clsLayoutItemCountX, clsLayoutItemCountY, clsLayoutItemRatio, clsLayoutItemSizeX, clsLayoutItemSizeY, clsLayoutLayer, clsLayoutMatrix, clsLayoutPack, clsLayoutPin, clsLayoutStack, clsLayoutTemplateX, clsLayoutTemplateY, clsLayoutTile, varLayout, varLayoutGapX, varLayoutGapY, varLayoutItemCountX, varLayoutItemCountY, varLayoutItemRatio, varLayoutItemSizeX, varLayoutItemSizeY, varLayoutTemplateX, varLayoutTemplateY };
@@ -0,0 +1,30 @@
1
+ const require__constants = require('../_constants.cjs');
2
+ const require__internal_hasValue = require('./hasValue.cjs');
3
+ const require__internal_mergeClassName = require('./mergeClassName.cjs');
4
+ const require__internal_unit = require('./unit.cjs');
5
+
6
+ //#region src/_internal/applyGap.ts
7
+ /**
8
+ * スペーシングに関する設定の適用
9
+ * @param result
10
+ * @param gap
11
+ * @param gapX
12
+ * @param gapY
13
+ */
14
+ function applyGap(result, gap, gapX, gapY) {
15
+ gapX = gapX ?? gap;
16
+ if (require__internal_hasValue(gapX)) {
17
+ result.className = require__internal_mergeClassName(result.className, require__constants.clsLayoutGapX);
18
+ result.style ??= {};
19
+ result.style[require__constants.varLayoutGapX] = require__internal_unit(gapX);
20
+ }
21
+ gapY = gapY ?? gap;
22
+ if (require__internal_hasValue(gapY)) {
23
+ result.className = require__internal_mergeClassName(result.className, require__constants.clsLayoutGapY);
24
+ result.style ??= {};
25
+ result.style[require__constants.varLayoutGapY] = require__internal_unit(gapY);
26
+ }
27
+ }
28
+
29
+ //#endregion
30
+ module.exports = applyGap;
@@ -0,0 +1,12 @@
1
+ import { LayoutStyle } from "../types.cjs";
2
+
3
+ //#region src/_internal/applyGap.d.ts
4
+ /**
5
+ * スペーシングに関する設定の適用
6
+ * @param result
7
+ * @param gap
8
+ * @param gapX
9
+ * @param gapY
10
+ */
11
+ declare function applyGap(result: LayoutStyle, gap: number | null | undefined, gapX: number | null | undefined, gapY: number | null | undefined): void;
12
+ export = applyGap;
@@ -0,0 +1,13 @@
1
+ import { LayoutStyle } from "../types.mjs";
2
+
3
+ //#region src/_internal/applyGap.d.ts
4
+ /**
5
+ * スペーシングに関する設定の適用
6
+ * @param result
7
+ * @param gap
8
+ * @param gapX
9
+ * @param gapY
10
+ */
11
+ declare function applyGap(result: LayoutStyle, gap: number | null | undefined, gapX: number | null | undefined, gapY: number | null | undefined): void;
12
+ //#endregion
13
+ export { applyGap as default };
@@ -0,0 +1,30 @@
1
+ import { clsLayoutGapX, clsLayoutGapY, varLayoutGapX, varLayoutGapY } from "../_constants.mjs";
2
+ import hasValue from "./hasValue.mjs";
3
+ import mergeClassName from "./mergeClassName.mjs";
4
+ import unit from "./unit.mjs";
5
+
6
+ //#region src/_internal/applyGap.ts
7
+ /**
8
+ * スペーシングに関する設定の適用
9
+ * @param result
10
+ * @param gap
11
+ * @param gapX
12
+ * @param gapY
13
+ */
14
+ function applyGap(result, gap, gapX, gapY) {
15
+ gapX = gapX ?? gap;
16
+ if (hasValue(gapX)) {
17
+ result.className = mergeClassName(result.className, clsLayoutGapX);
18
+ result.style ??= {};
19
+ result.style[varLayoutGapX] = unit(gapX);
20
+ }
21
+ gapY = gapY ?? gap;
22
+ if (hasValue(gapY)) {
23
+ result.className = mergeClassName(result.className, clsLayoutGapY);
24
+ result.style ??= {};
25
+ result.style[varLayoutGapY] = unit(gapY);
26
+ }
27
+ }
28
+
29
+ //#endregion
30
+ export { applyGap as default };
@@ -0,0 +1,20 @@
1
+ const require__constants = require('../_constants.cjs');
2
+ const require__internal_hasValue = require('./hasValue.cjs');
3
+ const require__internal_mergeClassName = require('./mergeClassName.cjs');
4
+
5
+ //#region src/_internal/applyItemCount.ts
6
+ function applyItemCount(result, itemCountX, itemCountY) {
7
+ if (require__internal_hasValue(itemCountX)) {
8
+ result.className = require__internal_mergeClassName(result.className, require__constants.clsLayoutItemCountX);
9
+ result.style ??= {};
10
+ result.style[require__constants.varLayoutItemCountX] = `${itemCountX}`;
11
+ }
12
+ if (require__internal_hasValue(itemCountY)) {
13
+ result.className = require__internal_mergeClassName(result.className, require__constants.clsLayoutItemCountY);
14
+ result.style ??= {};
15
+ result.style[require__constants.varLayoutItemCountY] = `${itemCountY}`;
16
+ }
17
+ }
18
+
19
+ //#endregion
20
+ module.exports = applyItemCount;
@@ -0,0 +1,5 @@
1
+ import { LayoutStyle } from "../types.cjs";
2
+
3
+ //#region src/_internal/applyItemCount.d.ts
4
+ declare function applyItemCount(result: LayoutStyle, itemCountX: number | null | undefined, itemCountY: number | null | undefined): void;
5
+ export = applyItemCount;
@@ -0,0 +1,6 @@
1
+ import { LayoutStyle } from "../types.mjs";
2
+
3
+ //#region src/_internal/applyItemCount.d.ts
4
+ declare function applyItemCount(result: LayoutStyle, itemCountX: number | null | undefined, itemCountY: number | null | undefined): void;
5
+ //#endregion
6
+ export { applyItemCount as default };
@@ -0,0 +1,20 @@
1
+ import { clsLayoutItemCountX, clsLayoutItemCountY, varLayoutItemCountX, varLayoutItemCountY } from "../_constants.mjs";
2
+ import hasValue from "./hasValue.mjs";
3
+ import mergeClassName from "./mergeClassName.mjs";
4
+
5
+ //#region src/_internal/applyItemCount.ts
6
+ function applyItemCount(result, itemCountX, itemCountY) {
7
+ if (hasValue(itemCountX)) {
8
+ result.className = mergeClassName(result.className, clsLayoutItemCountX);
9
+ result.style ??= {};
10
+ result.style[varLayoutItemCountX] = `${itemCountX}`;
11
+ }
12
+ if (hasValue(itemCountY)) {
13
+ result.className = mergeClassName(result.className, clsLayoutItemCountY);
14
+ result.style ??= {};
15
+ result.style[varLayoutItemCountY] = `${itemCountY}`;
16
+ }
17
+ }
18
+
19
+ //#endregion
20
+ export { applyItemCount as default };
@@ -0,0 +1,21 @@
1
+ const require__constants = require('../_constants.cjs');
2
+ const require__internal_hasValue = require('./hasValue.cjs');
3
+ const require__internal_mergeClassName = require('./mergeClassName.cjs');
4
+
5
+ //#region src/_internal/applyItemRatio.ts
6
+ /**
7
+ * 子要素の縦横比に関する設定の適用
8
+ * @param result
9
+ * @param itemRatioX
10
+ * @param itemRatioY
11
+ */
12
+ function applyItemRatio(result, itemRatioX, itemRatioY) {
13
+ if (require__internal_hasValue(itemRatioX) || require__internal_hasValue(itemRatioY)) {
14
+ result.className = require__internal_mergeClassName(result.className, require__constants.clsLayoutItemRatio);
15
+ result.style ??= {};
16
+ result.style[require__constants.varLayoutItemRatio] = `${itemRatioX ?? 1} / ${itemRatioY ?? 1}`;
17
+ }
18
+ }
19
+
20
+ //#endregion
21
+ module.exports = applyItemRatio;
@@ -0,0 +1,11 @@
1
+ import { LayoutStyle } from "../types.cjs";
2
+
3
+ //#region src/_internal/applyItemRatio.d.ts
4
+ /**
5
+ * 子要素の縦横比に関する設定の適用
6
+ * @param result
7
+ * @param itemRatioX
8
+ * @param itemRatioY
9
+ */
10
+ declare function applyItemRatio(result: LayoutStyle, itemRatioX: number | null | undefined, itemRatioY: number | null | undefined): void;
11
+ export = applyItemRatio;