@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,141 @@
1
+ .lx-layout-matrix {
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
+ --lx-layout-itemCountX: auto-fit;
8
+ --lx-layout-itemCountY: auto-fit;
9
+ --lx-layout-templateX: none;
10
+ --lx-layout-templateY: none;
11
+ display: grid;
12
+ }
13
+ .lx-layout-matrix.lx-layout-direction-x {
14
+ grid-auto-flow: row;
15
+ }
16
+ .lx-layout-matrix.lx-layout-direction-y {
17
+ grid-auto-flow: column;
18
+ }
19
+ .lx-layout-matrix.lx-layout-alignX-left {
20
+ justify-content: flex-start;
21
+ }
22
+ .lx-layout-matrix.lx-layout-alignX-center {
23
+ justify-content: center;
24
+ }
25
+ .lx-layout-matrix.lx-layout-alignX-right {
26
+ justify-content: flex-end;
27
+ }
28
+ .lx-layout-matrix.lx-layout-alignX-spaceBetween {
29
+ justify-content: space-between;
30
+ }
31
+ .lx-layout-matrix.lx-layout-alignX-spaceAround {
32
+ justify-content: space-around;
33
+ }
34
+ .lx-layout-matrix.lx-layout-alignX-spaceEvenly {
35
+ justify-content: space-evenly;
36
+ }
37
+ .lx-layout-matrix.lx-layout-alignY-top {
38
+ align-content: flex-start;
39
+ }
40
+ .lx-layout-matrix.lx-layout-alignY-middle {
41
+ align-content: center;
42
+ }
43
+ .lx-layout-matrix.lx-layout-alignY-bottom {
44
+ align-content: flex-end;
45
+ }
46
+ .lx-layout-matrix.lx-layout-alignY-spaceBetween {
47
+ align-content: space-between;
48
+ }
49
+ .lx-layout-matrix.lx-layout-alignY-spaceAround {
50
+ align-content: space-around;
51
+ }
52
+ .lx-layout-matrix.lx-layout-alignY-spaceEvenly {
53
+ align-content: space-evenly;
54
+ }
55
+ .lx-layout-matrix.lx-layout-itemSizeX {
56
+ grid-template-columns: repeat(auto-fit, var(--lx-layout-itemSizeX));
57
+ }
58
+ .lx-layout-matrix.lx-layout-itemSizeX.lx-layout-itemCountX {
59
+ grid-template-columns: repeat(var(--lx-layout-itemCountX), var(--lx-layout-itemSizeX));
60
+ }
61
+ .lx-layout-matrix.lx-layout-itemCountX {
62
+ grid-template-columns: repeat(var(--lx-layout-itemCountX), auto);
63
+ }
64
+ .lx-layout-matrix.lx-layout-templateX {
65
+ grid-template-columns: var(--lx-layout-templateX);
66
+ }
67
+ .lx-layout-matrix.lx-layout-adjustX-fit.lx-layout-itemSizeX {
68
+ grid-template-columns: repeat(auto-fit, minmax(clamp(0px, 100%, var(--lx-layout-itemSizeX)), 1fr));
69
+ }
70
+ .lx-layout-matrix.lx-layout-adjustX-fit.lx-layout-itemSizeX.lx-layout-itemCountX {
71
+ grid-template-columns: repeat(var(--lx-layout-itemCountX), minmax(clamp(0px, (100% - var(--lx-layout-gapX) * (var(--lx-layout-itemCountX) - 1)) / var(--lx-layout-itemCountX), var(--lx-layout-itemSizeX)), 1fr));
72
+ }
73
+ .lx-layout-matrix.lx-layout-adjustX-fit.lx-layout-itemCountX {
74
+ grid-template-columns: repeat(var(--lx-layout-itemCountX), 1fr);
75
+ }
76
+ .lx-layout-matrix.lx-layout-adjustX-grow.lx-layout-itemSizeX {
77
+ grid-template-columns: repeat(auto-fit, minmax(var(--lx-layout-itemSizeX), 1fr));
78
+ }
79
+ .lx-layout-matrix.lx-layout-adjustX-grow.lx-layout-itemSizeX.lx-layout-itemCountX {
80
+ grid-template-columns: repeat(var(--lx-layout-itemCountX), minmax(var(--lx-layout-itemSizeX), 1fr));
81
+ }
82
+ .lx-layout-matrix.lx-layout-adjustX-grow.lx-layout-itemCountX {
83
+ grid-template-columns: repeat(var(--lx-layout-itemCountX), 1fr);
84
+ }
85
+ .lx-layout-matrix.lx-layout-adjustX-shrink.lx-layout-itemSizeX {
86
+ grid-template-columns: repeat(auto-fit, minmax(0, var(--lx-layout-itemSizeX)));
87
+ }
88
+ .lx-layout-matrix.lx-layout-adjustX-shrink.lx-layout-itemSizeX.lx-layout-itemCountX {
89
+ grid-template-columns: repeat(var(--lx-layout-itemCountX), minmax(0, var(--lx-layout-itemSizeX)));
90
+ }
91
+ .lx-layout-matrix.lx-layout-adjustX-shrink.lx-layout-itemCountX {
92
+ grid-template-columns: repeat(var(--lx-layout-itemCountX), auto);
93
+ }
94
+ .lx-layout-matrix.lx-layout-itemSizeY {
95
+ grid-template-rows: repeat(auto-fit, var(--lx-layout-itemSizeY));
96
+ }
97
+ .lx-layout-matrix.lx-layout-itemSizeY.lx-layout-itemCountY {
98
+ grid-template-rows: repeat(var(--lx-layout-itemCountY), var(--lx-layout-itemSizeY));
99
+ }
100
+ .lx-layout-matrix.lx-layout-itemCountY {
101
+ grid-template-rows: repeat(var(--lx-layout-itemCountY), auto);
102
+ }
103
+ .lx-layout-matrix.lx-layout-templateY {
104
+ grid-template-rows: var(--lx-layout-templateY);
105
+ }
106
+ .lx-layout-matrix.lx-layout-adjustY-fit.lx-layout-itemSizeY {
107
+ grid-template-rows: repeat(auto-fit, minmax(clamp(0px, 100%, var(--lx-layout-itemSizeY)), 1fr));
108
+ }
109
+ .lx-layout-matrix.lx-layout-adjustY-fit.lx-layout-itemSizeY.lx-layout-itemCountY {
110
+ grid-template-rows: repeat(var(--lx-layout-itemCountY), minmax(clamp(0px, (100% - var(--lx-layout-gapY) * (var(--lx-layout-itemCountY) - 1)) / var(--lx-layout-itemCountY), var(--lx-layout-itemSizeY)), 1fr));
111
+ }
112
+ .lx-layout-matrix.lx-layout-adjustY-fit.lx-layout-itemCountY {
113
+ grid-template-rows: repeat(var(--lx-layout-itemCountY), 1fr);
114
+ }
115
+ .lx-layout-matrix.lx-layout-adjustY-grow.lx-layout-itemSizeY {
116
+ grid-template-rows: repeat(auto-fit, minmax(var(--lx-layout-itemSizeY), 1fr));
117
+ }
118
+ .lx-layout-matrix.lx-layout-adjustY-grow.lx-layout-itemSizeY.lx-layout-itemCountY {
119
+ grid-template-rows: repeat(var(--lx-layout-itemCountY), minmax(var(--lx-layout-itemSizeY), 1fr));
120
+ }
121
+ .lx-layout-matrix.lx-layout-adjustY-grow.lx-layout-itemCountY {
122
+ grid-template-rows: repeat(var(--lx-layout-itemCountY), 1fr);
123
+ }
124
+ .lx-layout-matrix.lx-layout-adjustY-shrink.lx-layout-itemSizeY {
125
+ grid-template-rows: repeat(auto-fit, minmax(0, var(--lx-layout-itemSizeY)));
126
+ }
127
+ .lx-layout-matrix.lx-layout-adjustY-shrink.lx-layout-itemSizeY.lx-layout-itemCountY {
128
+ grid-template-rows: repeat(var(--lx-layout-itemCountY), minmax(0, var(--lx-layout-itemSizeY)));
129
+ }
130
+ .lx-layout-matrix.lx-layout-adjustY-shrink.lx-layout-itemCountY {
131
+ grid-template-rows: repeat(var(--lx-layout-itemCountY), auto);
132
+ }
133
+ .lx-layout-matrix.lx-layout-itemRatio > * {
134
+ aspect-ratio: var(--lx-layout-itemRatio);
135
+ }
136
+ .lx-layout-matrix.lx-layout-gapX {
137
+ column-gap: var(--lx-layout-gapX);
138
+ }
139
+ .lx-layout-matrix.lx-layout-gapY {
140
+ row-gap: var(--lx-layout-gapY);
141
+ }
File without changes
@@ -0,0 +1,46 @@
1
+ import { AdjustOptions, AlignOptions, DirectionOptions, GapOptions, ItemCountOptions, ItemRatioOptions, ItemSizeOptions, TracksOptions } from "../_types.cjs";
2
+
3
+ //#region src/matrix/types.d.ts
4
+ type MatrixLayoutOptions = DirectionOptions & AlignOptions & AdjustOptions & ItemRatioOptions & GapOptions & MatrixAxisXOptions & MatrixAxisYOptions;
5
+ /**
6
+ * 横軸、要素数指定
7
+ */
8
+ type MatrixAxisXWithCountOptions = {
9
+ itemCountX: ItemCountOptions['itemCountX'];
10
+ itemSizeX?: ItemSizeOptions['itemSizeX'];
11
+ tracksX?: never;
12
+ };
13
+ /**
14
+ * 横軸、テンプレート指定
15
+ */
16
+ type MatrixAxisXWithTemplateOptions = {
17
+ itemCountX?: never;
18
+ itemSizeX?: never;
19
+ tracksX: TracksOptions['tracksX'];
20
+ };
21
+ /**
22
+ * 横軸用オプション
23
+ */
24
+ type MatrixAxisXOptions = MatrixAxisXWithCountOptions | MatrixAxisXWithTemplateOptions;
25
+ /**
26
+ * 縦軸、要素数指定
27
+ */
28
+ type MatrixAxisYWithCountOptions = {
29
+ itemCountY: ItemCountOptions['itemCountY'];
30
+ itemSizeY?: ItemSizeOptions['itemSizeY'];
31
+ tracksY?: never;
32
+ };
33
+ /**
34
+ * 縦軸、テンプレート指定
35
+ */
36
+ type MatrixAxisYWithTemplateOptions = {
37
+ itemCountY?: never;
38
+ itemSizeY?: never;
39
+ tracksY: TracksOptions['tracksY'];
40
+ };
41
+ /**
42
+ * 縦軸用オプション
43
+ */
44
+ type MatrixAxisYOptions = MatrixAxisYWithCountOptions | MatrixAxisYWithTemplateOptions;
45
+ //#endregion
46
+ export { MatrixLayoutOptions };
@@ -0,0 +1,46 @@
1
+ import { AdjustOptions, AlignOptions, DirectionOptions, GapOptions, ItemCountOptions, ItemRatioOptions, ItemSizeOptions, TracksOptions } from "../_types.mjs";
2
+
3
+ //#region src/matrix/types.d.ts
4
+ type MatrixLayoutOptions = DirectionOptions & AlignOptions & AdjustOptions & ItemRatioOptions & GapOptions & MatrixAxisXOptions & MatrixAxisYOptions;
5
+ /**
6
+ * 横軸、要素数指定
7
+ */
8
+ type MatrixAxisXWithCountOptions = {
9
+ itemCountX: ItemCountOptions['itemCountX'];
10
+ itemSizeX?: ItemSizeOptions['itemSizeX'];
11
+ tracksX?: never;
12
+ };
13
+ /**
14
+ * 横軸、テンプレート指定
15
+ */
16
+ type MatrixAxisXWithTemplateOptions = {
17
+ itemCountX?: never;
18
+ itemSizeX?: never;
19
+ tracksX: TracksOptions['tracksX'];
20
+ };
21
+ /**
22
+ * 横軸用オプション
23
+ */
24
+ type MatrixAxisXOptions = MatrixAxisXWithCountOptions | MatrixAxisXWithTemplateOptions;
25
+ /**
26
+ * 縦軸、要素数指定
27
+ */
28
+ type MatrixAxisYWithCountOptions = {
29
+ itemCountY: ItemCountOptions['itemCountY'];
30
+ itemSizeY?: ItemSizeOptions['itemSizeY'];
31
+ tracksY?: never;
32
+ };
33
+ /**
34
+ * 縦軸、テンプレート指定
35
+ */
36
+ type MatrixAxisYWithTemplateOptions = {
37
+ itemCountY?: never;
38
+ itemSizeY?: never;
39
+ tracksY: TracksOptions['tracksY'];
40
+ };
41
+ /**
42
+ * 縦軸用オプション
43
+ */
44
+ type MatrixAxisYOptions = MatrixAxisYWithCountOptions | MatrixAxisYWithTemplateOptions;
45
+ //#endregion
46
+ export { MatrixLayoutOptions };
@@ -0,0 +1 @@
1
+ export { };
package/pack/index.cjs ADDED
@@ -0,0 +1,3 @@
1
+ const require_pack_pack = require('./pack.cjs');
2
+
3
+ module.exports = require_pack_pack;
@@ -0,0 +1,3 @@
1
+ import { PackLayoutOptions } from "./types.cjs";
2
+ import pack from "./pack.cjs";
3
+ export { type PackLayoutOptions, pack as default };
@@ -0,0 +1,3 @@
1
+ import { PackLayoutOptions } from "./types.mjs";
2
+ import pack from "./pack.mjs";
3
+ export { type PackLayoutOptions, pack as default };
package/pack/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import pack from "./pack.mjs";
2
+
3
+ export { pack as default };
package/pack/pack.cjs ADDED
@@ -0,0 +1,25 @@
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ const require__constants = require('../_constants.cjs');
3
+ const require__internal_mergeClassName = require('../_internal/mergeClassName.cjs');
4
+ const require__internal_applyGap = require('../_internal/applyGap.cjs');
5
+ let _fringeworks_utils_object_maybeDefault = require("@fringeworks/utils/object/maybeDefault");
6
+ _fringeworks_utils_object_maybeDefault = require_runtime.__toESM(_fringeworks_utils_object_maybeDefault, 1);
7
+
8
+ //#region src/pack/pack.ts
9
+ /**
10
+ * packレイアウト
11
+ *
12
+ * - 子要素で親要素を満たす
13
+ */
14
+ const pack = (options = {}) => {
15
+ const { direction, gap, gapX, gapY } = (0, _fringeworks_utils_object_maybeDefault.default)(options, { direction: "x" }, { overwriteNull: true });
16
+ const result = {
17
+ className: require__internal_mergeClassName(require__constants.clsLayoutPack, require__constants.clsLayout.direction[direction]),
18
+ style: {}
19
+ };
20
+ require__internal_applyGap(result, gap, gapX, gapY);
21
+ return result;
22
+ };
23
+
24
+ //#endregion
25
+ module.exports = pack;
@@ -0,0 +1,11 @@
1
+ import { CreateLayoutStyle } from "../types.cjs";
2
+ import { PackLayoutOptions } from "./types.cjs";
3
+
4
+ //#region src/pack/pack.d.ts
5
+ /**
6
+ * packレイアウト
7
+ *
8
+ * - 子要素で親要素を満たす
9
+ */
10
+ declare const pack: CreateLayoutStyle<PackLayoutOptions>;
11
+ export = pack;
@@ -0,0 +1,12 @@
1
+ import { CreateLayoutStyle } from "../types.mjs";
2
+ import { PackLayoutOptions } from "./types.mjs";
3
+
4
+ //#region src/pack/pack.d.ts
5
+ /**
6
+ * packレイアウト
7
+ *
8
+ * - 子要素で親要素を満たす
9
+ */
10
+ declare const pack: CreateLayoutStyle<PackLayoutOptions>;
11
+ //#endregion
12
+ export { pack as default };
package/pack/pack.mjs ADDED
@@ -0,0 +1,23 @@
1
+ import { clsLayout, clsLayoutPack } from "../_constants.mjs";
2
+ import mergeClassName from "../_internal/mergeClassName.mjs";
3
+ import applyGap from "../_internal/applyGap.mjs";
4
+ import maybeDefault from "@fringeworks/utils/object/maybeDefault";
5
+
6
+ //#region src/pack/pack.ts
7
+ /**
8
+ * packレイアウト
9
+ *
10
+ * - 子要素で親要素を満たす
11
+ */
12
+ const pack = (options = {}) => {
13
+ const { direction, gap, gapX, gapY } = maybeDefault(options, { direction: "x" }, { overwriteNull: true });
14
+ const result = {
15
+ className: mergeClassName(clsLayoutPack, clsLayout.direction[direction]),
16
+ style: {}
17
+ };
18
+ applyGap(result, gap, gapX, gapY);
19
+ return result;
20
+ };
21
+
22
+ //#endregion
23
+ export { pack as default };
@@ -0,0 +1,35 @@
1
+ .lx-layout-pack {
2
+ --lx-layout-gapX: 0px;
3
+ --lx-layout-gapY: 0px;
4
+ --lx-layout-itemRatio: auto;
5
+ display: flex;
6
+ justify-content: flex-start;
7
+ align-items: stretch;
8
+ }
9
+ .lx-layout-pack > * {
10
+ flex-basis: 0;
11
+ flex-grow: 1;
12
+ flex-shrink: 1;
13
+ }
14
+ .lx-layout-pack.lx-layout-direction-x {
15
+ flex-direction: row;
16
+ }
17
+ .lx-layout-pack.lx-layout-direction-x > * {
18
+ min-width: 0;
19
+ min-height: 100%;
20
+ max-height: 100%;
21
+ }
22
+ .lx-layout-pack.lx-layout-direction-y {
23
+ flex-direction: column;
24
+ }
25
+ .lx-layout-pack.lx-layout-direction-y > * {
26
+ min-height: 0;
27
+ min-width: 100%;
28
+ max-width: 100%;
29
+ }
30
+ .lx-layout-pack.lx-layout-gapX {
31
+ column-gap: var(--lx-layout-gapX);
32
+ }
33
+ .lx-layout-pack.lx-layout-gapY {
34
+ row-gap: var(--lx-layout-gapY);
35
+ }
package/pack/types.cjs ADDED
File without changes
@@ -0,0 +1,6 @@
1
+ import { DirectionOptions, GapOptions } from "../_types.cjs";
2
+
3
+ //#region src/pack/types.d.ts
4
+ type PackLayoutOptions = DirectionOptions & GapOptions;
5
+ //#endregion
6
+ export { PackLayoutOptions };
@@ -0,0 +1,6 @@
1
+ import { DirectionOptions, GapOptions } from "../_types.mjs";
2
+
3
+ //#region src/pack/types.d.ts
4
+ type PackLayoutOptions = DirectionOptions & GapOptions;
5
+ //#endregion
6
+ export { PackLayoutOptions };
package/pack/types.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };
package/package.json CHANGED
@@ -1,6 +1,54 @@
1
1
  {
2
2
  "name": "@fringeworks/style-layouts",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.8.0",
4
+ "keywords": [
5
+ "css",
6
+ "style",
7
+ "layout"
8
+ ],
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/fringeworks-js/style-layouts.git"
12
+ },
13
+ "license": "MIT",
14
+ "author": "Mitsuhiro Seino",
15
+ "sideEffects": [
16
+ "**/*.css"
17
+ ],
18
+ "type": "module",
19
+ "exports": {
20
+ ".": {
21
+ "import": "./index.mjs",
22
+ "require": "./index.cjs"
23
+ },
24
+ "./constants": {
25
+ "import": "./constants.mjs",
26
+ "require": "./constants.cjs"
27
+ },
28
+ "./helpers/*": {
29
+ "import": "./helpers/*.mjs",
30
+ "require": "./helpers/*.cjs"
31
+ },
32
+ "./styles.css": "./styles.css",
33
+ "./*.css": "./*/styles.css",
34
+ "./with-css": {
35
+ "import": "./with-css/index.mjs",
36
+ "require": "./with-css/index.cjs"
37
+ },
38
+ "./with-css/*": {
39
+ "import": "./with-css/*/index.mjs",
40
+ "require": "./with-css/*/index.cjs"
41
+ },
42
+ "./*": {
43
+ "import": "./*/index.mjs",
44
+ "require": "./*/index.cjs"
45
+ }
46
+ },
47
+ "main": "./index.cjs",
48
+ "module": "./index.mjs",
49
+ "dependencies": {
50
+ "@fringeworks/style-utils": "^0.8.0",
51
+ "@fringeworks/types": "^0.8.0",
52
+ "@fringeworks/utils": "^0.8.0"
53
+ }
54
+ }
package/pin/index.cjs ADDED
@@ -0,0 +1,3 @@
1
+ const require_pin_pin = require('./pin.cjs');
2
+
3
+ module.exports = require_pin_pin;
@@ -0,0 +1,3 @@
1
+ import { PinLayoutOptions } from "./types.cjs";
2
+ import pin from "./pin.cjs";
3
+ export { type PinLayoutOptions, pin as default };
@@ -0,0 +1,3 @@
1
+ import { PinLayoutOptions } from "./types.mjs";
2
+ import pin from "./pin.mjs";
3
+ export { type PinLayoutOptions, pin as default };
package/pin/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import pin from "./pin.mjs";
2
+
3
+ export { pin as default };
package/pin/pin.cjs ADDED
@@ -0,0 +1,23 @@
1
+ const require__constants = require('../_constants.cjs');
2
+ const require__internal_applyItemRatio = require('../_internal/applyItemRatio.cjs');
3
+ const require__internal_applyItemSize = require('../_internal/applyItemSize.cjs');
4
+
5
+ //#region src/pin/pin.ts
6
+ /**
7
+ * pinレイアウト
8
+ *
9
+ * - 子要素のtop,left,bottom,rightに従い配置する
10
+ */
11
+ const pin = (options = {}) => {
12
+ const { itemSizeX, itemSizeY, itemRatioX, itemRatioY } = options;
13
+ const result = {
14
+ className: require__constants.clsLayoutPin,
15
+ style: {}
16
+ };
17
+ require__internal_applyItemSize(result, itemSizeX, itemSizeY);
18
+ require__internal_applyItemRatio(result, itemRatioX, itemRatioY);
19
+ return result;
20
+ };
21
+
22
+ //#endregion
23
+ module.exports = pin;
package/pin/pin.d.cts ADDED
@@ -0,0 +1,11 @@
1
+ import { CreateLayoutStyle } from "../types.cjs";
2
+ import { PinLayoutOptions } from "./types.cjs";
3
+
4
+ //#region src/pin/pin.d.ts
5
+ /**
6
+ * pinレイアウト
7
+ *
8
+ * - 子要素のtop,left,bottom,rightに従い配置する
9
+ */
10
+ declare const pin: CreateLayoutStyle<PinLayoutOptions>;
11
+ export = pin;
package/pin/pin.d.mts ADDED
@@ -0,0 +1,12 @@
1
+ import { CreateLayoutStyle } from "../types.mjs";
2
+ import { PinLayoutOptions } from "./types.mjs";
3
+
4
+ //#region src/pin/pin.d.ts
5
+ /**
6
+ * pinレイアウト
7
+ *
8
+ * - 子要素のtop,left,bottom,rightに従い配置する
9
+ */
10
+ declare const pin: CreateLayoutStyle<PinLayoutOptions>;
11
+ //#endregion
12
+ export { pin as default };
package/pin/pin.mjs ADDED
@@ -0,0 +1,23 @@
1
+ import { clsLayoutPin } from "../_constants.mjs";
2
+ import applyItemRatio from "../_internal/applyItemRatio.mjs";
3
+ import applyItemSize from "../_internal/applyItemSize.mjs";
4
+
5
+ //#region src/pin/pin.ts
6
+ /**
7
+ * pinレイアウト
8
+ *
9
+ * - 子要素のtop,left,bottom,rightに従い配置する
10
+ */
11
+ const pin = (options = {}) => {
12
+ const { itemSizeX, itemSizeY, itemRatioX, itemRatioY } = options;
13
+ const result = {
14
+ className: clsLayoutPin,
15
+ style: {}
16
+ };
17
+ applyItemSize(result, itemSizeX, itemSizeY);
18
+ applyItemRatio(result, itemRatioX, itemRatioY);
19
+ return result;
20
+ };
21
+
22
+ //#endregion
23
+ export { pin as default };
package/pin/styles.css ADDED
@@ -0,0 +1,19 @@
1
+ .lx-layout-pin {
2
+ --lx-layout-itemSizeX: auto;
3
+ --lx-layout-itemSizeY: auto;
4
+ --lx-layout-itemRatio: auto;
5
+ display: block;
6
+ position: relative;
7
+ }
8
+ .lx-layout-pin > * {
9
+ position: absolute;
10
+ }
11
+ .lx-layout-pin.lx-layout-itemSizeX > * {
12
+ width: var(--lx-layout-itemSizeX);
13
+ }
14
+ .lx-layout-pin.lx-layout-itemSizeY > * {
15
+ height: var(--lx-layout-itemSizeY);
16
+ }
17
+ .lx-layout-pin.lx-layout-itemRatio > * {
18
+ aspect-ratio: var(--lx-layout-itemRatio);
19
+ }
package/pin/types.cjs ADDED
File without changes
@@ -0,0 +1,6 @@
1
+ import { ItemRatioOptions, ItemSizeOptions } from "../_types.cjs";
2
+
3
+ //#region src/pin/types.d.ts
4
+ type PinLayoutOptions = ItemSizeOptions & ItemRatioOptions;
5
+ //#endregion
6
+ export { PinLayoutOptions };
@@ -0,0 +1,6 @@
1
+ import { ItemRatioOptions, ItemSizeOptions } from "../_types.mjs";
2
+
3
+ //#region src/pin/types.d.ts
4
+ type PinLayoutOptions = ItemSizeOptions & ItemRatioOptions;
5
+ //#endregion
6
+ export { PinLayoutOptions };
package/pin/types.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,3 @@
1
+ const require_stack_stack = require('./stack.cjs');
2
+
3
+ module.exports = require_stack_stack;
@@ -0,0 +1,3 @@
1
+ import { StackLayoutOptions } from "./types.cjs";
2
+ import stack from "./stack.cjs";
3
+ export { type StackLayoutOptions, stack as default };
@@ -0,0 +1,3 @@
1
+ import { StackLayoutOptions } from "./types.mjs";
2
+ import stack from "./stack.mjs";
3
+ export { type StackLayoutOptions, stack as default };
@@ -0,0 +1,3 @@
1
+ import stack from "./stack.mjs";
2
+
3
+ export { stack as default };