@niche-works/css-layouts 0.1.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 (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/_constants.cjs +94 -0
  4. package/_constants.d.cts +83 -0
  5. package/_constants.d.mts +83 -0
  6. package/_constants.mjs +86 -0
  7. package/_helpers/applyChildCount.cjs +26 -0
  8. package/_helpers/applyChildCount.d.cts +12 -0
  9. package/_helpers/applyChildCount.d.mts +13 -0
  10. package/_helpers/applyChildCount.mjs +24 -0
  11. package/_helpers/applyChildSize.cjs +27 -0
  12. package/_helpers/applyChildSize.d.cts +12 -0
  13. package/_helpers/applyChildSize.d.mts +13 -0
  14. package/_helpers/applyChildSize.mjs +25 -0
  15. package/_helpers/applySpacing.cjs +30 -0
  16. package/_helpers/applySpacing.d.cts +13 -0
  17. package/_helpers/applySpacing.d.mts +14 -0
  18. package/_helpers/applySpacing.mjs +28 -0
  19. package/_helpers/hasValue.cjs +15 -0
  20. package/_helpers/hasValue.d.cts +8 -0
  21. package/_helpers/hasValue.d.mts +9 -0
  22. package/_helpers/hasValue.mjs +14 -0
  23. package/_helpers/mergeLayoutResults.cjs +18 -0
  24. package/_helpers/mergeLayoutResults.d.cts +5 -0
  25. package/_helpers/mergeLayoutResults.d.mts +6 -0
  26. package/_helpers/mergeLayoutResults.mjs +16 -0
  27. package/_helpers/unit.cjs +16 -0
  28. package/_helpers/unit.d.cts +10 -0
  29. package/_helpers/unit.d.mts +11 -0
  30. package/_helpers/unit.mjs +15 -0
  31. package/_types.cjs +0 -0
  32. package/_types.d.cts +118 -0
  33. package/_types.d.mts +118 -0
  34. package/_types.mjs +1 -0
  35. package/_virtual/_rolldown/runtime.cjs +29 -0
  36. package/balance/balance.cjs +34 -0
  37. package/balance/balance.d.cts +11 -0
  38. package/balance/balance.d.mts +12 -0
  39. package/balance/balance.mjs +31 -0
  40. package/balance/index.cjs +3 -0
  41. package/balance/index.d.cts +3 -0
  42. package/balance/index.d.mts +3 -0
  43. package/balance/index.mjs +3 -0
  44. package/balance/styles.css +109 -0
  45. package/balance/types.cjs +0 -0
  46. package/balance/types.d.cts +6 -0
  47. package/balance/types.d.mts +6 -0
  48. package/balance/types.mjs +1 -0
  49. package/constants.cjs +341 -0
  50. package/constants.d.cts +299 -0
  51. package/constants.d.mts +299 -0
  52. package/constants.mjs +288 -0
  53. package/flow/flow.cjs +70 -0
  54. package/flow/flow.d.cts +12 -0
  55. package/flow/flow.d.mts +13 -0
  56. package/flow/flow.mjs +67 -0
  57. package/flow/index.cjs +3 -0
  58. package/flow/index.d.cts +3 -0
  59. package/flow/index.d.mts +3 -0
  60. package/flow/index.mjs +3 -0
  61. package/flow/styles.css +162 -0
  62. package/flow/types.cjs +0 -0
  63. package/flow/types.d.cts +21 -0
  64. package/flow/types.d.mts +21 -0
  65. package/flow/types.mjs +1 -0
  66. package/index.cjs +23 -0
  67. package/index.d.cts +16 -0
  68. package/index.d.mts +16 -0
  69. package/index.mjs +16 -0
  70. package/matrix/index.cjs +3 -0
  71. package/matrix/index.d.cts +3 -0
  72. package/matrix/index.d.mts +3 -0
  73. package/matrix/index.mjs +3 -0
  74. package/matrix/matrix.cjs +109 -0
  75. package/matrix/matrix.d.cts +11 -0
  76. package/matrix/matrix.d.mts +12 -0
  77. package/matrix/matrix.mjs +106 -0
  78. package/matrix/styles.css +59 -0
  79. package/matrix/types.cjs +0 -0
  80. package/matrix/types.d.cts +46 -0
  81. package/matrix/types.d.mts +46 -0
  82. package/matrix/types.mjs +1 -0
  83. package/pack/index.cjs +3 -0
  84. package/pack/index.d.cts +3 -0
  85. package/pack/index.d.mts +3 -0
  86. package/pack/index.mjs +3 -0
  87. package/pack/pack.cjs +28 -0
  88. package/pack/pack.d.cts +11 -0
  89. package/pack/pack.d.mts +12 -0
  90. package/pack/pack.mjs +25 -0
  91. package/pack/styles.css +27 -0
  92. package/pack/types.cjs +0 -0
  93. package/pack/types.d.cts +6 -0
  94. package/pack/types.d.mts +6 -0
  95. package/pack/types.mjs +1 -0
  96. package/package.json +45 -0
  97. package/pin/index.cjs +3 -0
  98. package/pin/index.d.cts +3 -0
  99. package/pin/index.d.mts +3 -0
  100. package/pin/index.mjs +3 -0
  101. package/pin/pin.cjs +22 -0
  102. package/pin/pin.d.cts +11 -0
  103. package/pin/pin.d.mts +12 -0
  104. package/pin/pin.mjs +22 -0
  105. package/pin/styles.css +15 -0
  106. package/pin/types.cjs +0 -0
  107. package/pin/types.d.cts +6 -0
  108. package/pin/types.d.mts +6 -0
  109. package/pin/types.mjs +1 -0
  110. package/stack/index.cjs +3 -0
  111. package/stack/index.d.cts +3 -0
  112. package/stack/index.d.mts +3 -0
  113. package/stack/index.mjs +3 -0
  114. package/stack/stack.cjs +98 -0
  115. package/stack/stack.d.cts +11 -0
  116. package/stack/stack.d.mts +12 -0
  117. package/stack/stack.mjs +95 -0
  118. package/stack/styles.css +171 -0
  119. package/stack/types.cjs +0 -0
  120. package/stack/types.d.cts +21 -0
  121. package/stack/types.d.mts +21 -0
  122. package/stack/types.mjs +1 -0
  123. package/tile/index.cjs +3 -0
  124. package/tile/index.d.cts +3 -0
  125. package/tile/index.d.mts +3 -0
  126. package/tile/index.mjs +3 -0
  127. package/tile/styles.css +104 -0
  128. package/tile/tile.cjs +85 -0
  129. package/tile/tile.d.cts +12 -0
  130. package/tile/tile.d.mts +13 -0
  131. package/tile/tile.mjs +82 -0
  132. package/tile/types.cjs +0 -0
  133. package/tile/types.d.cts +9 -0
  134. package/tile/types.d.mts +9 -0
  135. package/tile/types.mjs +1 -0
  136. package/types.cjs +0 -0
  137. package/types.d.cts +23 -0
  138. package/types.d.mts +23 -0
  139. package/types.mjs +1 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mitsuhiro Seino
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @niche-works/css-layouts
2
+
3
+ A niche library for adding layout features using CSS.
package/_constants.cjs ADDED
@@ -0,0 +1,94 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_constants = require('./constants.cjs');
3
+
4
+ //#region src/_constants.ts
5
+ /**
6
+ * 整列
7
+ */
8
+ const clsLayoutDirection = {
9
+ x: require_constants.clsLayoutDirectionX,
10
+ y: require_constants.clsLayoutDirectionY
11
+ };
12
+ /**
13
+ * 横位置・縦位置
14
+ */
15
+ const clsLayoutAlign = {
16
+ x: {
17
+ left: require_constants.clsLayoutAlignXLeft,
18
+ center: require_constants.clsLayoutAlignXCenter,
19
+ right: require_constants.clsLayoutAlignXRight,
20
+ "space-between": require_constants.clsLayoutAlignXSpaceBetween,
21
+ "space-around": require_constants.clsLayoutAlignXSpaceAround,
22
+ "space-evenly": require_constants.clsLayoutAlignXSpaceEvenly
23
+ },
24
+ y: {
25
+ top: require_constants.clsLayoutAlignYTop,
26
+ middle: require_constants.clsLayoutAlignYMiddle,
27
+ bottom: require_constants.clsLayoutAlignYBottom,
28
+ "space-between": require_constants.clsLayoutAlignYSpaceBetween,
29
+ "space-around": require_constants.clsLayoutAlignYSpaceAround,
30
+ "space-evenly": require_constants.clsLayoutAlignYSpaceEvenly
31
+ }
32
+ };
33
+ /**
34
+ * 子要素の幅・高さ調整
35
+ */
36
+ const clsLayoutAdjust = {
37
+ x: {
38
+ none: require_constants.clsLayoutAdjustXNone,
39
+ fit: require_constants.clsLayoutAdjustXFit,
40
+ grow: require_constants.clsLayoutAdjustXExpand,
41
+ shrink: require_constants.clsLayoutAdjustXShrink
42
+ },
43
+ y: {
44
+ none: require_constants.clsLayoutAdjustYNone,
45
+ fit: require_constants.clsLayoutAdjustYFit,
46
+ grow: require_constants.clsLayoutAdjustYExpand,
47
+ shrink: require_constants.clsLayoutAdjustYShrink
48
+ }
49
+ };
50
+ /**
51
+ * 子要素の幅・高さ
52
+ */
53
+ const clsLayoutChildSize = {
54
+ x: require_constants.clsLayoutChildSizeX,
55
+ y: require_constants.clsLayoutChildSizeY
56
+ };
57
+ /**
58
+ * 子要素の幅・高さ
59
+ */
60
+ const varLayoutChildSize = {
61
+ x: require_constants.varLayoutChildSizeX,
62
+ y: require_constants.varLayoutChildSizeY
63
+ };
64
+ /**
65
+ * 子要素のテンプレート
66
+ */
67
+ const varLayoutTemplate = {
68
+ x: require_constants.varLayoutTemplateX,
69
+ y: require_constants.varLayoutTemplateY
70
+ };
71
+ /**
72
+ * 間隔
73
+ */
74
+ const varLayoutSpacing = {
75
+ x: require_constants.varLayoutSpacingX,
76
+ y: require_constants.varLayoutSpacingY
77
+ };
78
+ /**
79
+ * 軸に対するサイズプロパティ
80
+ */
81
+ const cssLayoutAxisSizeProp = {
82
+ x: "width",
83
+ y: "height"
84
+ };
85
+
86
+ //#endregion
87
+ exports.clsLayoutAdjust = clsLayoutAdjust;
88
+ exports.clsLayoutAlign = clsLayoutAlign;
89
+ exports.clsLayoutChildSize = clsLayoutChildSize;
90
+ exports.clsLayoutDirection = clsLayoutDirection;
91
+ exports.cssLayoutAxisSizeProp = cssLayoutAxisSizeProp;
92
+ exports.varLayoutChildSize = varLayoutChildSize;
93
+ exports.varLayoutSpacing = varLayoutSpacing;
94
+ exports.varLayoutTemplate = varLayoutTemplate;
@@ -0,0 +1,83 @@
1
+ //#region src/_constants.d.ts
2
+ /**
3
+ * 整列
4
+ */
5
+ declare const clsLayoutDirection: {
6
+ readonly x: "nws-layout-direction-x";
7
+ readonly y: "nws-layout-direction-y";
8
+ };
9
+ /**
10
+ * 横位置・縦位置
11
+ */
12
+ declare const clsLayoutAlign: {
13
+ readonly x: {
14
+ readonly left: "nws-layout-alignX-left";
15
+ readonly center: "nws-layout-alignX-center";
16
+ readonly right: "nws-layout-alignX-right";
17
+ readonly 'space-between': "nws-layout-alignX-spaceBetween";
18
+ readonly 'space-around': "nws-layout-alignX-spaceAround";
19
+ readonly 'space-evenly': "nws-layout-alignX-spaceEvenly";
20
+ };
21
+ readonly y: {
22
+ readonly top: "nws-layout-alignY-top";
23
+ readonly middle: "nws-layout-alignY-middle";
24
+ readonly bottom: "nws-layout-alignY-bottom";
25
+ readonly 'space-between': "nws-layout-alignY-spaceBetween";
26
+ readonly 'space-around': "nws-layout-alignY-spaceAround";
27
+ readonly 'space-evenly': "nws-layout-alignY-spaceEvenly";
28
+ };
29
+ };
30
+ /**
31
+ * 子要素の幅・高さ調整
32
+ */
33
+ declare const clsLayoutAdjust: {
34
+ readonly x: {
35
+ readonly none: "nws-layout-adjustX-none";
36
+ readonly fit: "nws-layout-adjustX-fit";
37
+ readonly grow: "nws-layout-adjustX-grow";
38
+ readonly shrink: "nws-layout-adjustX-shrink";
39
+ };
40
+ readonly y: {
41
+ readonly none: "nws-layout-adjustY-none";
42
+ readonly fit: "nws-layout-adjustY-fit";
43
+ readonly grow: "nws-layout-adjustY-grow";
44
+ readonly shrink: "nws-layout-adjustY-shrink";
45
+ };
46
+ };
47
+ /**
48
+ * 子要素の幅・高さ
49
+ */
50
+ declare const clsLayoutChildSize: {
51
+ readonly x: "nws-layout-childSizeX";
52
+ readonly y: "nws-layout-childSizeY";
53
+ };
54
+ /**
55
+ * 子要素の幅・高さ
56
+ */
57
+ declare const varLayoutChildSize: {
58
+ readonly x: "--nws-layout-childSizeX";
59
+ readonly y: "--nws-layout-childSizeY";
60
+ };
61
+ /**
62
+ * 子要素のテンプレート
63
+ */
64
+ declare const varLayoutTemplate: {
65
+ readonly x: "--nws-layout-childX";
66
+ readonly y: "--nws-layout-childY";
67
+ };
68
+ /**
69
+ * 間隔
70
+ */
71
+ declare const varLayoutSpacing: {
72
+ readonly x: "--nws-layout-spacingX";
73
+ readonly y: "--nws-layout-spacingY";
74
+ };
75
+ /**
76
+ * 軸に対するサイズプロパティ
77
+ */
78
+ declare const cssLayoutAxisSizeProp: {
79
+ readonly x: "width";
80
+ readonly y: "height";
81
+ };
82
+ //#endregion
83
+ export { clsLayoutAdjust, clsLayoutAlign, clsLayoutChildSize, clsLayoutDirection, cssLayoutAxisSizeProp, varLayoutChildSize, varLayoutSpacing, varLayoutTemplate };
@@ -0,0 +1,83 @@
1
+ //#region src/_constants.d.ts
2
+ /**
3
+ * 整列
4
+ */
5
+ declare const clsLayoutDirection: {
6
+ readonly x: "nws-layout-direction-x";
7
+ readonly y: "nws-layout-direction-y";
8
+ };
9
+ /**
10
+ * 横位置・縦位置
11
+ */
12
+ declare const clsLayoutAlign: {
13
+ readonly x: {
14
+ readonly left: "nws-layout-alignX-left";
15
+ readonly center: "nws-layout-alignX-center";
16
+ readonly right: "nws-layout-alignX-right";
17
+ readonly 'space-between': "nws-layout-alignX-spaceBetween";
18
+ readonly 'space-around': "nws-layout-alignX-spaceAround";
19
+ readonly 'space-evenly': "nws-layout-alignX-spaceEvenly";
20
+ };
21
+ readonly y: {
22
+ readonly top: "nws-layout-alignY-top";
23
+ readonly middle: "nws-layout-alignY-middle";
24
+ readonly bottom: "nws-layout-alignY-bottom";
25
+ readonly 'space-between': "nws-layout-alignY-spaceBetween";
26
+ readonly 'space-around': "nws-layout-alignY-spaceAround";
27
+ readonly 'space-evenly': "nws-layout-alignY-spaceEvenly";
28
+ };
29
+ };
30
+ /**
31
+ * 子要素の幅・高さ調整
32
+ */
33
+ declare const clsLayoutAdjust: {
34
+ readonly x: {
35
+ readonly none: "nws-layout-adjustX-none";
36
+ readonly fit: "nws-layout-adjustX-fit";
37
+ readonly grow: "nws-layout-adjustX-grow";
38
+ readonly shrink: "nws-layout-adjustX-shrink";
39
+ };
40
+ readonly y: {
41
+ readonly none: "nws-layout-adjustY-none";
42
+ readonly fit: "nws-layout-adjustY-fit";
43
+ readonly grow: "nws-layout-adjustY-grow";
44
+ readonly shrink: "nws-layout-adjustY-shrink";
45
+ };
46
+ };
47
+ /**
48
+ * 子要素の幅・高さ
49
+ */
50
+ declare const clsLayoutChildSize: {
51
+ readonly x: "nws-layout-childSizeX";
52
+ readonly y: "nws-layout-childSizeY";
53
+ };
54
+ /**
55
+ * 子要素の幅・高さ
56
+ */
57
+ declare const varLayoutChildSize: {
58
+ readonly x: "--nws-layout-childSizeX";
59
+ readonly y: "--nws-layout-childSizeY";
60
+ };
61
+ /**
62
+ * 子要素のテンプレート
63
+ */
64
+ declare const varLayoutTemplate: {
65
+ readonly x: "--nws-layout-childX";
66
+ readonly y: "--nws-layout-childY";
67
+ };
68
+ /**
69
+ * 間隔
70
+ */
71
+ declare const varLayoutSpacing: {
72
+ readonly x: "--nws-layout-spacingX";
73
+ readonly y: "--nws-layout-spacingY";
74
+ };
75
+ /**
76
+ * 軸に対するサイズプロパティ
77
+ */
78
+ declare const cssLayoutAxisSizeProp: {
79
+ readonly x: "width";
80
+ readonly y: "height";
81
+ };
82
+ //#endregion
83
+ export { clsLayoutAdjust, clsLayoutAlign, clsLayoutChildSize, clsLayoutDirection, cssLayoutAxisSizeProp, varLayoutChildSize, varLayoutSpacing, varLayoutTemplate };
package/_constants.mjs ADDED
@@ -0,0 +1,86 @@
1
+ import { clsLayoutAdjustXExpand, clsLayoutAdjustXFit, clsLayoutAdjustXNone, clsLayoutAdjustXShrink, clsLayoutAdjustYExpand, clsLayoutAdjustYFit, clsLayoutAdjustYNone, clsLayoutAdjustYShrink, clsLayoutAlignXCenter, clsLayoutAlignXLeft, clsLayoutAlignXRight, clsLayoutAlignXSpaceAround, clsLayoutAlignXSpaceBetween, clsLayoutAlignXSpaceEvenly, clsLayoutAlignYBottom, clsLayoutAlignYMiddle, clsLayoutAlignYSpaceAround, clsLayoutAlignYSpaceBetween, clsLayoutAlignYSpaceEvenly, clsLayoutAlignYTop, clsLayoutChildSizeX, clsLayoutChildSizeY, clsLayoutDirectionX, clsLayoutDirectionY, varLayoutChildSizeX, varLayoutChildSizeY, varLayoutSpacingX, varLayoutSpacingY, varLayoutTemplateX, varLayoutTemplateY } from "./constants.mjs";
2
+
3
+ //#region src/_constants.ts
4
+ /**
5
+ * 整列
6
+ */
7
+ const clsLayoutDirection = {
8
+ x: clsLayoutDirectionX,
9
+ y: clsLayoutDirectionY
10
+ };
11
+ /**
12
+ * 横位置・縦位置
13
+ */
14
+ const clsLayoutAlign = {
15
+ x: {
16
+ left: clsLayoutAlignXLeft,
17
+ center: clsLayoutAlignXCenter,
18
+ right: clsLayoutAlignXRight,
19
+ "space-between": clsLayoutAlignXSpaceBetween,
20
+ "space-around": clsLayoutAlignXSpaceAround,
21
+ "space-evenly": clsLayoutAlignXSpaceEvenly
22
+ },
23
+ y: {
24
+ top: clsLayoutAlignYTop,
25
+ middle: clsLayoutAlignYMiddle,
26
+ bottom: clsLayoutAlignYBottom,
27
+ "space-between": clsLayoutAlignYSpaceBetween,
28
+ "space-around": clsLayoutAlignYSpaceAround,
29
+ "space-evenly": clsLayoutAlignYSpaceEvenly
30
+ }
31
+ };
32
+ /**
33
+ * 子要素の幅・高さ調整
34
+ */
35
+ const clsLayoutAdjust = {
36
+ x: {
37
+ none: clsLayoutAdjustXNone,
38
+ fit: clsLayoutAdjustXFit,
39
+ grow: clsLayoutAdjustXExpand,
40
+ shrink: clsLayoutAdjustXShrink
41
+ },
42
+ y: {
43
+ none: clsLayoutAdjustYNone,
44
+ fit: clsLayoutAdjustYFit,
45
+ grow: clsLayoutAdjustYExpand,
46
+ shrink: clsLayoutAdjustYShrink
47
+ }
48
+ };
49
+ /**
50
+ * 子要素の幅・高さ
51
+ */
52
+ const clsLayoutChildSize = {
53
+ x: clsLayoutChildSizeX,
54
+ y: clsLayoutChildSizeY
55
+ };
56
+ /**
57
+ * 子要素の幅・高さ
58
+ */
59
+ const varLayoutChildSize = {
60
+ x: varLayoutChildSizeX,
61
+ y: varLayoutChildSizeY
62
+ };
63
+ /**
64
+ * 子要素のテンプレート
65
+ */
66
+ const varLayoutTemplate = {
67
+ x: varLayoutTemplateX,
68
+ y: varLayoutTemplateY
69
+ };
70
+ /**
71
+ * 間隔
72
+ */
73
+ const varLayoutSpacing = {
74
+ x: varLayoutSpacingX,
75
+ y: varLayoutSpacingY
76
+ };
77
+ /**
78
+ * 軸に対するサイズプロパティ
79
+ */
80
+ const cssLayoutAxisSizeProp = {
81
+ x: "width",
82
+ y: "height"
83
+ };
84
+
85
+ //#endregion
86
+ export { clsLayoutAdjust, clsLayoutAlign, clsLayoutChildSize, clsLayoutDirection, cssLayoutAxisSizeProp, varLayoutChildSize, varLayoutSpacing, varLayoutTemplate };
@@ -0,0 +1,26 @@
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ const require_constants = require('../constants.cjs');
3
+ const require__helpers_hasValue = require('./hasValue.cjs');
4
+ let clsx = require("clsx");
5
+ clsx = require_runtime.__toESM(clsx, 1);
6
+
7
+ //#region src/_helpers/applyChildCount.ts
8
+ /**
9
+ * 子要素の数に関する設定の適用
10
+ * @param result
11
+ * @param childCountX
12
+ * @param childCountY
13
+ */
14
+ function applyChildCount(result, childCountX, childCountY) {
15
+ if (require__helpers_hasValue(childCountX)) {
16
+ result.className = (0, clsx.default)(result.className, require_constants.clsLayoutChildCountX);
17
+ result.style[require_constants.varLayoutChildCountX] = childCountX;
18
+ }
19
+ if (require__helpers_hasValue(childCountY)) {
20
+ result.className = (0, clsx.default)(result.className, require_constants.clsLayoutChildCountY);
21
+ result.style[require_constants.varLayoutChildCountY] = childCountY;
22
+ }
23
+ }
24
+
25
+ //#endregion
26
+ module.exports = applyChildCount;
@@ -0,0 +1,12 @@
1
+ import { ChildSpacing } from "../_types.cjs";
2
+ import { LayoutResult } from "../types.cjs";
3
+
4
+ //#region src/_helpers/applyChildCount.d.ts
5
+ /**
6
+ * 子要素の数に関する設定の適用
7
+ * @param result
8
+ * @param childCountX
9
+ * @param childCountY
10
+ */
11
+ declare function applyChildCount(result: LayoutResult, childCountX: ChildSpacing, childCountY: ChildSpacing): void;
12
+ export = applyChildCount;
@@ -0,0 +1,13 @@
1
+ import { ChildSpacing } from "../_types.mjs";
2
+ import { LayoutResult } from "../types.mjs";
3
+
4
+ //#region src/_helpers/applyChildCount.d.ts
5
+ /**
6
+ * 子要素の数に関する設定の適用
7
+ * @param result
8
+ * @param childCountX
9
+ * @param childCountY
10
+ */
11
+ declare function applyChildCount(result: LayoutResult, childCountX: ChildSpacing, childCountY: ChildSpacing): void;
12
+ //#endregion
13
+ export { applyChildCount as default };
@@ -0,0 +1,24 @@
1
+ import { clsLayoutChildCountX, clsLayoutChildCountY, varLayoutChildCountX, varLayoutChildCountY } from "../constants.mjs";
2
+ import hasValue from "./hasValue.mjs";
3
+ import clsx from "clsx";
4
+
5
+ //#region src/_helpers/applyChildCount.ts
6
+ /**
7
+ * 子要素の数に関する設定の適用
8
+ * @param result
9
+ * @param childCountX
10
+ * @param childCountY
11
+ */
12
+ function applyChildCount(result, childCountX, childCountY) {
13
+ if (hasValue(childCountX)) {
14
+ result.className = clsx(result.className, clsLayoutChildCountX);
15
+ result.style[varLayoutChildCountX] = childCountX;
16
+ }
17
+ if (hasValue(childCountY)) {
18
+ result.className = clsx(result.className, clsLayoutChildCountY);
19
+ result.style[varLayoutChildCountY] = childCountY;
20
+ }
21
+ }
22
+
23
+ //#endregion
24
+ export { applyChildCount as default };
@@ -0,0 +1,27 @@
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ const require_constants = require('../constants.cjs');
3
+ const require__helpers_hasValue = require('./hasValue.cjs');
4
+ const require__helpers_unit = require('./unit.cjs');
5
+ let clsx = require("clsx");
6
+ clsx = require_runtime.__toESM(clsx, 1);
7
+
8
+ //#region src/_helpers/applyChildSize.ts
9
+ /**
10
+ * 子要素のサイズに関する設定の適用
11
+ * @param result
12
+ * @param childSizeX
13
+ * @param childSizeY
14
+ */
15
+ function applyChildSize(result, childSizeX, childSizeY) {
16
+ if (require__helpers_hasValue(childSizeX)) {
17
+ result.className = (0, clsx.default)(result.className, require_constants.clsLayoutChildSizeX);
18
+ result.style[require_constants.varLayoutChildSizeX] = require__helpers_unit(childSizeX);
19
+ }
20
+ if (require__helpers_hasValue(childSizeY)) {
21
+ result.className = (0, clsx.default)(result.className, require_constants.clsLayoutChildSizeY);
22
+ result.style[require_constants.varLayoutChildSizeY] = require__helpers_unit(childSizeY);
23
+ }
24
+ }
25
+
26
+ //#endregion
27
+ module.exports = applyChildSize;
@@ -0,0 +1,12 @@
1
+ import { ChildSpacing } from "../_types.cjs";
2
+ import { LayoutResult } from "../types.cjs";
3
+
4
+ //#region src/_helpers/applyChildSize.d.ts
5
+ /**
6
+ * 子要素のサイズに関する設定の適用
7
+ * @param result
8
+ * @param childSizeX
9
+ * @param childSizeY
10
+ */
11
+ declare function applyChildSize(result: LayoutResult, childSizeX: ChildSpacing, childSizeY: ChildSpacing): void;
12
+ export = applyChildSize;
@@ -0,0 +1,13 @@
1
+ import { ChildSpacing } from "../_types.mjs";
2
+ import { LayoutResult } from "../types.mjs";
3
+
4
+ //#region src/_helpers/applyChildSize.d.ts
5
+ /**
6
+ * 子要素のサイズに関する設定の適用
7
+ * @param result
8
+ * @param childSizeX
9
+ * @param childSizeY
10
+ */
11
+ declare function applyChildSize(result: LayoutResult, childSizeX: ChildSpacing, childSizeY: ChildSpacing): void;
12
+ //#endregion
13
+ export { applyChildSize as default };
@@ -0,0 +1,25 @@
1
+ import { clsLayoutChildSizeX, clsLayoutChildSizeY, varLayoutChildSizeX, varLayoutChildSizeY } from "../constants.mjs";
2
+ import hasValue from "./hasValue.mjs";
3
+ import unit from "./unit.mjs";
4
+ import clsx from "clsx";
5
+
6
+ //#region src/_helpers/applyChildSize.ts
7
+ /**
8
+ * 子要素のサイズに関する設定の適用
9
+ * @param result
10
+ * @param childSizeX
11
+ * @param childSizeY
12
+ */
13
+ function applyChildSize(result, childSizeX, childSizeY) {
14
+ if (hasValue(childSizeX)) {
15
+ result.className = clsx(result.className, clsLayoutChildSizeX);
16
+ result.style[varLayoutChildSizeX] = unit(childSizeX);
17
+ }
18
+ if (hasValue(childSizeY)) {
19
+ result.className = clsx(result.className, clsLayoutChildSizeY);
20
+ result.style[varLayoutChildSizeY] = unit(childSizeY);
21
+ }
22
+ }
23
+
24
+ //#endregion
25
+ export { applyChildSize as default };
@@ -0,0 +1,30 @@
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ const require_constants = require('../constants.cjs');
3
+ const require__helpers_hasValue = require('./hasValue.cjs');
4
+ const require__helpers_unit = require('./unit.cjs');
5
+ let clsx = require("clsx");
6
+ clsx = require_runtime.__toESM(clsx, 1);
7
+
8
+ //#region src/_helpers/applySpacing.ts
9
+ /**
10
+ * スペーシングに関する設定の適用
11
+ * @param result
12
+ * @param spacing
13
+ * @param spacingX
14
+ * @param spacingY
15
+ */
16
+ function applySpacing(result, spacing, spacingX, spacingY) {
17
+ spacingX = spacingX ?? spacing;
18
+ if (require__helpers_hasValue(spacingX)) {
19
+ result.className = (0, clsx.default)(result.className, require_constants.clsLayoutSpacingX);
20
+ result.style[require_constants.varLayoutSpacingX] = require__helpers_unit(spacingX);
21
+ }
22
+ spacingY = spacingY ?? spacing;
23
+ if (require__helpers_hasValue(spacingY)) {
24
+ result.className = (0, clsx.default)(result.className, require_constants.clsLayoutSpacingY);
25
+ result.style[require_constants.varLayoutSpacingY] = require__helpers_unit(spacingY);
26
+ }
27
+ }
28
+
29
+ //#endregion
30
+ module.exports = applySpacing;
@@ -0,0 +1,13 @@
1
+ import { ChildSpacing } from "../_types.cjs";
2
+ import { LayoutResult } from "../types.cjs";
3
+
4
+ //#region src/_helpers/applySpacing.d.ts
5
+ /**
6
+ * スペーシングに関する設定の適用
7
+ * @param result
8
+ * @param spacing
9
+ * @param spacingX
10
+ * @param spacingY
11
+ */
12
+ declare function applySpacing(result: LayoutResult, spacing: ChildSpacing, spacingX: ChildSpacing, spacingY: ChildSpacing): void;
13
+ export = applySpacing;
@@ -0,0 +1,14 @@
1
+ import { ChildSpacing } from "../_types.mjs";
2
+ import { LayoutResult } from "../types.mjs";
3
+
4
+ //#region src/_helpers/applySpacing.d.ts
5
+ /**
6
+ * スペーシングに関する設定の適用
7
+ * @param result
8
+ * @param spacing
9
+ * @param spacingX
10
+ * @param spacingY
11
+ */
12
+ declare function applySpacing(result: LayoutResult, spacing: ChildSpacing, spacingX: ChildSpacing, spacingY: ChildSpacing): void;
13
+ //#endregion
14
+ export { applySpacing as default };
@@ -0,0 +1,28 @@
1
+ import { clsLayoutSpacingX, clsLayoutSpacingY, varLayoutSpacingX, varLayoutSpacingY } from "../constants.mjs";
2
+ import hasValue from "./hasValue.mjs";
3
+ import unit from "./unit.mjs";
4
+ import clsx from "clsx";
5
+
6
+ //#region src/_helpers/applySpacing.ts
7
+ /**
8
+ * スペーシングに関する設定の適用
9
+ * @param result
10
+ * @param spacing
11
+ * @param spacingX
12
+ * @param spacingY
13
+ */
14
+ function applySpacing(result, spacing, spacingX, spacingY) {
15
+ spacingX = spacingX ?? spacing;
16
+ if (hasValue(spacingX)) {
17
+ result.className = clsx(result.className, clsLayoutSpacingX);
18
+ result.style[varLayoutSpacingX] = unit(spacingX);
19
+ }
20
+ spacingY = spacingY ?? spacing;
21
+ if (hasValue(spacingY)) {
22
+ result.className = clsx(result.className, clsLayoutSpacingY);
23
+ result.style[varLayoutSpacingY] = unit(spacingY);
24
+ }
25
+ }
26
+
27
+ //#endregion
28
+ export { applySpacing as default };
@@ -0,0 +1,15 @@
1
+
2
+ //#region src/_helpers/hasValue.ts
3
+ /**
4
+ * 有効な値か
5
+ * @param value
6
+ * @returns
7
+ */
8
+ function hasValue(value) {
9
+ if (typeof value === "number") return true;
10
+ else if (typeof value === "boolean") return true;
11
+ else return value !== null && value !== void 0 && value !== "";
12
+ }
13
+
14
+ //#endregion
15
+ module.exports = hasValue;
@@ -0,0 +1,8 @@
1
+ //#region src/_helpers/hasValue.d.ts
2
+ /**
3
+ * 有効な値か
4
+ * @param value
5
+ * @returns
6
+ */
7
+ declare function hasValue(value: string | number | boolean | null | undefined): value is string | number | boolean;
8
+ export = hasValue;
@@ -0,0 +1,9 @@
1
+ //#region src/_helpers/hasValue.d.ts
2
+ /**
3
+ * 有効な値か
4
+ * @param value
5
+ * @returns
6
+ */
7
+ declare function hasValue(value: string | number | boolean | null | undefined): value is string | number | boolean;
8
+ //#endregion
9
+ export { hasValue as default };
@@ -0,0 +1,14 @@
1
+ //#region src/_helpers/hasValue.ts
2
+ /**
3
+ * 有効な値か
4
+ * @param value
5
+ * @returns
6
+ */
7
+ function hasValue(value) {
8
+ if (typeof value === "number") return true;
9
+ else if (typeof value === "boolean") return true;
10
+ else return value !== null && value !== void 0 && value !== "";
11
+ }
12
+
13
+ //#endregion
14
+ export { hasValue as default };