@niche-works/style-layouts 0.3.0 → 0.4.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 (143) hide show
  1. package/README.ja.md +8 -8
  2. package/README.md +8 -8
  3. package/balance/index.cjs +6 -2
  4. package/balance/index.mjs +6 -2
  5. package/center/index.cjs +6 -2
  6. package/center/index.mjs +6 -2
  7. package/constants.cjs +1 -50
  8. package/constants.d.cts +2 -2
  9. package/constants.d.mts +2 -2
  10. package/constants.mjs +2 -2
  11. package/core/_constants.cjs +287 -34
  12. package/core/_constants.d.cts +206 -1
  13. package/core/_constants.d.mts +206 -1
  14. package/core/_constants.mjs +206 -3
  15. package/core/_internal/applyChildCount.cjs +6 -8
  16. package/core/_internal/applyChildCount.mjs +6 -6
  17. package/core/_internal/applyChildRatio.cjs +4 -6
  18. package/core/_internal/applyChildRatio.mjs +3 -3
  19. package/core/_internal/applyChildSize.cjs +6 -8
  20. package/core/_internal/applyChildSize.mjs +4 -4
  21. package/core/_internal/applyGap.cjs +6 -8
  22. package/core/_internal/applyGap.mjs +4 -4
  23. package/core/_internal/mergeClassName.cjs +11 -0
  24. package/core/_internal/mergeClassName.d.cts +3 -0
  25. package/core/_internal/mergeClassName.d.mts +4 -0
  26. package/core/_internal/mergeClassName.mjs +10 -0
  27. package/core/_internal/mergeLayoutResults.cjs +2 -4
  28. package/core/_internal/mergeLayoutResults.mjs +2 -2
  29. package/core/_types.d.cts +1 -9
  30. package/core/_types.d.mts +1 -9
  31. package/core/balance/balance.cjs +4 -4
  32. package/core/balance/balance.d.cts +2 -0
  33. package/core/balance/balance.d.mts +2 -0
  34. package/core/balance/balance.mjs +5 -4
  35. package/core/balance/styles.css +38 -6
  36. package/core/center/center.cjs +3 -4
  37. package/core/center/center.d.cts +1 -0
  38. package/core/center/center.d.mts +1 -0
  39. package/core/center/center.mjs +4 -4
  40. package/core/center/styles.css +4 -26
  41. package/core/constants.cjs +4 -255
  42. package/core/constants.d.cts +4 -206
  43. package/core/constants.d.mts +4 -206
  44. package/core/constants.mjs +4 -206
  45. package/core/flow/flow.cjs +5 -7
  46. package/core/flow/flow.mjs +6 -7
  47. package/core/index.d.cts +2 -2
  48. package/core/index.d.mts +2 -2
  49. package/core/layer/layer.cjs +2 -4
  50. package/core/layer/layer.mjs +3 -4
  51. package/core/layer/styles.css +0 -4
  52. package/core/matrix/matrix.cjs +3 -4
  53. package/core/matrix/matrix.d.cts +1 -0
  54. package/core/matrix/matrix.d.mts +1 -0
  55. package/core/matrix/matrix.mjs +4 -4
  56. package/core/matrix/styles.css +0 -6
  57. package/core/pack/pack.cjs +2 -4
  58. package/core/pack/pack.mjs +3 -4
  59. package/core/pin/pin.cjs +2 -2
  60. package/core/pin/pin.mjs +1 -1
  61. package/core/stack/stack.cjs +12 -14
  62. package/core/stack/stack.d.cts +1 -1
  63. package/core/stack/stack.d.mts +1 -1
  64. package/core/stack/stack.mjs +13 -14
  65. package/core/stack/styles.css +0 -2
  66. package/core/styles.css +42 -44
  67. package/core/tile/tile.cjs +2 -4
  68. package/core/tile/tile.mjs +3 -4
  69. package/core/types.d.cts +7 -2
  70. package/core/types.d.mts +7 -2
  71. package/flow/index.cjs +6 -2
  72. package/flow/index.mjs +6 -2
  73. package/helpers/_internal/constants.cjs +25 -0
  74. package/helpers/_internal/constants.d.cts +13 -0
  75. package/helpers/_internal/constants.d.mts +13 -0
  76. package/helpers/_internal/constants.mjs +16 -0
  77. package/helpers/_internal/createExtractLayoutOptions.cjs +25 -0
  78. package/helpers/_internal/createExtractLayoutOptions.d.cts +8 -0
  79. package/helpers/_internal/createExtractLayoutOptions.d.mts +9 -0
  80. package/helpers/_internal/createExtractLayoutOptions.mjs +24 -0
  81. package/helpers/extractBalanceOptions.cjs +15 -0
  82. package/helpers/extractBalanceOptions.d.cts +5 -0
  83. package/helpers/extractBalanceOptions.d.mts +6 -0
  84. package/helpers/extractBalanceOptions.mjs +15 -0
  85. package/helpers/extractCenterOptions.cjs +14 -0
  86. package/helpers/extractCenterOptions.d.cts +6 -0
  87. package/helpers/extractCenterOptions.d.mts +7 -0
  88. package/helpers/extractCenterOptions.mjs +14 -0
  89. package/helpers/extractFlowOptions.cjs +15 -0
  90. package/helpers/extractFlowOptions.d.cts +6 -0
  91. package/helpers/extractFlowOptions.d.mts +7 -0
  92. package/helpers/extractFlowOptions.mjs +15 -0
  93. package/helpers/extractLayerOptions.cjs +13 -0
  94. package/helpers/extractLayerOptions.d.cts +6 -0
  95. package/helpers/extractLayerOptions.d.mts +7 -0
  96. package/helpers/extractLayerOptions.mjs +13 -0
  97. package/helpers/extractMatrixOptions.cjs +17 -0
  98. package/helpers/extractMatrixOptions.d.cts +5 -0
  99. package/helpers/extractMatrixOptions.d.mts +6 -0
  100. package/helpers/extractMatrixOptions.mjs +17 -0
  101. package/helpers/extractPackOptions.cjs +8 -0
  102. package/helpers/extractPackOptions.d.cts +6 -0
  103. package/helpers/extractPackOptions.d.mts +7 -0
  104. package/helpers/extractPackOptions.mjs +8 -0
  105. package/helpers/extractPinOptions.cjs +8 -0
  106. package/helpers/extractPinOptions.d.cts +6 -0
  107. package/helpers/extractPinOptions.d.mts +7 -0
  108. package/helpers/extractPinOptions.mjs +8 -0
  109. package/helpers/extractStackOptions.cjs +15 -0
  110. package/helpers/extractStackOptions.d.cts +6 -0
  111. package/helpers/extractStackOptions.d.mts +7 -0
  112. package/helpers/extractStackOptions.mjs +15 -0
  113. package/helpers/extractTileOptions.cjs +15 -0
  114. package/helpers/extractTileOptions.d.cts +6 -0
  115. package/helpers/extractTileOptions.d.mts +7 -0
  116. package/helpers/extractTileOptions.mjs +15 -0
  117. package/helpers/index.cjs +20 -0
  118. package/helpers/index.d.cts +10 -0
  119. package/helpers/index.d.mts +10 -0
  120. package/helpers/index.mjs +11 -0
  121. package/index.cjs +18 -18
  122. package/index.d.cts +2 -2
  123. package/index.d.mts +2 -2
  124. package/index.mjs +10 -10
  125. package/layer/index.cjs +6 -2
  126. package/layer/index.mjs +6 -2
  127. package/matrix/index.cjs +6 -2
  128. package/matrix/index.mjs +6 -2
  129. package/pack/index.cjs +6 -2
  130. package/pack/index.mjs +6 -2
  131. package/package.json +6 -4
  132. package/pin/index.cjs +6 -2
  133. package/pin/index.mjs +6 -2
  134. package/stack/index.cjs +6 -2
  135. package/stack/index.mjs +6 -2
  136. package/tile/index.cjs +6 -2
  137. package/tile/index.mjs +6 -2
  138. package/types.d.cts +2 -2
  139. package/types.d.mts +2 -2
  140. package/core/_internal/warnIfUnsupported.cjs +0 -15
  141. package/core/_internal/warnIfUnsupported.d.cts +0 -3
  142. package/core/_internal/warnIfUnsupported.d.mts +0 -4
  143. package/core/_internal/warnIfUnsupported.mjs +0 -14
@@ -1,21 +1,19 @@
1
1
  const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
- const require_core_constants = require('../constants.cjs');
3
2
  const require_core__constants = require('../_constants.cjs');
4
3
  const require_core__internal_hasValue = require('../_internal/hasValue.cjs');
4
+ const require_core__internal_mergeClassName = require('../_internal/mergeClassName.cjs');
5
5
  const require_core__internal_applyChildRatio = require('../_internal/applyChildRatio.cjs');
6
6
  const require_core__internal_unit = require('../_internal/unit.cjs');
7
7
  const require_core__internal_applyGap = require('../_internal/applyGap.cjs');
8
8
  const require_core__internal_mergeLayoutResults = require('../_internal/mergeLayoutResults.cjs');
9
9
  let _niche_works_utils_object_maybeDefault = require("@niche-works/utils/object/maybeDefault");
10
10
  _niche_works_utils_object_maybeDefault = require_runtime.__toESM(_niche_works_utils_object_maybeDefault, 1);
11
- let clsx = require("clsx");
12
- clsx = require_runtime.__toESM(clsx, 1);
13
11
 
14
12
  //#region src/core/stack/stack.ts
15
13
  /**
16
14
  * stackレイアウト
17
15
  *
18
- * - 子要素を並べて配置する
16
+ * - 子要素を一列に並べて配置する
19
17
  */
20
18
  const stack = (options = {}) => {
21
19
  const { direction, alignX, alignY, adjustX, adjustY, gap, gapX = gap, gapY = gap, childSizeX, childSizeY, childRatioX, childRatioY } = (0, _niche_works_utils_object_maybeDefault.default)(options, {
@@ -24,7 +22,7 @@ const stack = (options = {}) => {
24
22
  alignY: "top"
25
23
  }, { overwriteNull: true });
26
24
  const result = {
27
- className: (0, clsx.default)(require_core_constants.clsLayoutStack, require_core__constants.clsLayout.direction[direction], require_core__constants.clsLayout.align.x[alignX], require_core__constants.clsLayout.align.y[alignY]),
25
+ className: require_core__internal_mergeClassName(require_core__constants.clsLayoutStack, require_core__constants.clsLayout.direction[direction], require_core__constants.clsLayout.align.x[alignX], require_core__constants.clsLayout.align.y[alignY]),
28
26
  style: {}
29
27
  };
30
28
  require_core__internal_applyGap(result, gap, gapX, gapY);
@@ -48,9 +46,9 @@ const stack = (options = {}) => {
48
46
  * @returns スタイル
49
47
  */
50
48
  function _getStackMainAxisStyle(axis, align, adjust, childSize) {
51
- const result = { className: (0, clsx.default)(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.adjust[axis][adjust]) };
49
+ const result = { className: require_core__internal_mergeClassName(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.adjust[axis][adjust]) };
52
50
  if (require_core__internal_hasValue(childSize)) {
53
- result.className = (0, clsx.default)(result.className, require_core__constants.clsLayout.childSize[axis]);
51
+ result.className = require_core__internal_mergeClassName(result.className, require_core__constants.clsLayout.childSize[axis]);
54
52
  result.style = { [require_core__constants.varLayout.childSize[axis]]: require_core__internal_unit(childSize) };
55
53
  }
56
54
  return result;
@@ -65,34 +63,34 @@ function _getStackMainAxisStyle(axis, align, adjust, childSize) {
65
63
  */
66
64
  function _getStackClossAxisStyle(axis, align, adjust, childSize) {
67
65
  if (adjust === "fit") return {
68
- className: (0, clsx.default)(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.adjust[axis][adjust]),
66
+ className: require_core__internal_mergeClassName(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.adjust[axis][adjust]),
69
67
  style: { [require_core__constants.varLayout.childSize[axis]]: `min(0, 100%)` }
70
68
  };
71
69
  else if (adjust === "grow") {
72
70
  const result = {
73
- className: (0, clsx.default)(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.adjust[axis][adjust]),
71
+ className: require_core__internal_mergeClassName(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.adjust[axis][adjust]),
74
72
  style: {}
75
73
  };
76
74
  if (require_core__internal_hasValue(childSize)) {
77
- result.className = (0, clsx.default)(result.className, require_core__constants.clsLayout.childSize[axis]);
75
+ result.className = require_core__internal_mergeClassName(result.className, require_core__constants.clsLayout.childSize[axis]);
78
76
  result.style[require_core__constants.varLayout.childSize[axis]] = require_core__internal_unit(childSize);
79
77
  }
80
78
  return result;
81
79
  } else if (adjust === "shrink") {
82
80
  const result = {
83
- className: (0, clsx.default)(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.adjust[axis][adjust]),
81
+ className: require_core__internal_mergeClassName(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.adjust[axis][adjust]),
84
82
  style: {}
85
83
  };
86
84
  if (require_core__internal_hasValue(childSize)) {
87
- result.className = (0, clsx.default)(result.className, require_core__constants.clsLayout.childSize[axis]);
85
+ result.className = require_core__internal_mergeClassName(result.className, require_core__constants.clsLayout.childSize[axis]);
88
86
  result.style = { [require_core__constants.varLayout.childSize[axis]]: `min(${require_core__internal_unit(childSize)}, 100%)` };
89
87
  }
90
88
  return result;
91
89
  } else if (require_core__internal_hasValue(childSize)) return {
92
- className: (0, clsx.default)(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.childSize[axis]),
90
+ className: require_core__internal_mergeClassName(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.childSize[axis]),
93
91
  style: { [require_core__constants.varLayout.childSize[axis]]: require_core__internal_unit(childSize) }
94
92
  };
95
- else return { className: (0, clsx.default)(require_core__constants.clsLayout.align[axis][align]) };
93
+ else return { className: require_core__internal_mergeClassName(require_core__constants.clsLayout.align[axis][align]) };
96
94
  }
97
95
 
98
96
  //#endregion
@@ -5,7 +5,7 @@ import { StackLayoutOptions } from "./types.cjs";
5
5
  /**
6
6
  * stackレイアウト
7
7
  *
8
- * - 子要素を並べて配置する
8
+ * - 子要素を一列に並べて配置する
9
9
  */
10
10
  declare const stack: StyleLayout<StackLayoutOptions>;
11
11
  export = stack;
@@ -5,7 +5,7 @@ import { StackLayoutOptions } from "./types.mjs";
5
5
  /**
6
6
  * stackレイアウト
7
7
  *
8
- * - 子要素を並べて配置する
8
+ * - 子要素を一列に並べて配置する
9
9
  */
10
10
  declare const stack: StyleLayout<StackLayoutOptions>;
11
11
  //#endregion
@@ -1,18 +1,17 @@
1
- import { clsLayoutStack } from "../constants.mjs";
2
- import { clsLayout, varLayout } from "../_constants.mjs";
1
+ import { clsLayout, clsLayoutStack, varLayout } from "../_constants.mjs";
3
2
  import hasValue from "../_internal/hasValue.mjs";
3
+ import mergeClassName from "../_internal/mergeClassName.mjs";
4
4
  import applyChildRatio from "../_internal/applyChildRatio.mjs";
5
5
  import unit from "../_internal/unit.mjs";
6
6
  import applyGap from "../_internal/applyGap.mjs";
7
7
  import mergeLayoutResults from "../_internal/mergeLayoutResults.mjs";
8
8
  import maybeDefault from "@niche-works/utils/object/maybeDefault";
9
- import clsx from "clsx";
10
9
 
11
10
  //#region src/core/stack/stack.ts
12
11
  /**
13
12
  * stackレイアウト
14
13
  *
15
- * - 子要素を並べて配置する
14
+ * - 子要素を一列に並べて配置する
16
15
  */
17
16
  const stack = (options = {}) => {
18
17
  const { direction, alignX, alignY, adjustX, adjustY, gap, gapX = gap, gapY = gap, childSizeX, childSizeY, childRatioX, childRatioY } = maybeDefault(options, {
@@ -21,7 +20,7 @@ const stack = (options = {}) => {
21
20
  alignY: "top"
22
21
  }, { overwriteNull: true });
23
22
  const result = {
24
- className: clsx(clsLayoutStack, clsLayout.direction[direction], clsLayout.align.x[alignX], clsLayout.align.y[alignY]),
23
+ className: mergeClassName(clsLayoutStack, clsLayout.direction[direction], clsLayout.align.x[alignX], clsLayout.align.y[alignY]),
25
24
  style: {}
26
25
  };
27
26
  applyGap(result, gap, gapX, gapY);
@@ -45,9 +44,9 @@ const stack = (options = {}) => {
45
44
  * @returns スタイル
46
45
  */
47
46
  function _getStackMainAxisStyle(axis, align, adjust, childSize) {
48
- const result = { className: clsx(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]) };
47
+ const result = { className: mergeClassName(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]) };
49
48
  if (hasValue(childSize)) {
50
- result.className = clsx(result.className, clsLayout.childSize[axis]);
49
+ result.className = mergeClassName(result.className, clsLayout.childSize[axis]);
51
50
  result.style = { [varLayout.childSize[axis]]: unit(childSize) };
52
51
  }
53
52
  return result;
@@ -62,34 +61,34 @@ function _getStackMainAxisStyle(axis, align, adjust, childSize) {
62
61
  */
63
62
  function _getStackClossAxisStyle(axis, align, adjust, childSize) {
64
63
  if (adjust === "fit") return {
65
- className: clsx(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]),
64
+ className: mergeClassName(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]),
66
65
  style: { [varLayout.childSize[axis]]: `min(0, 100%)` }
67
66
  };
68
67
  else if (adjust === "grow") {
69
68
  const result = {
70
- className: clsx(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]),
69
+ className: mergeClassName(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]),
71
70
  style: {}
72
71
  };
73
72
  if (hasValue(childSize)) {
74
- result.className = clsx(result.className, clsLayout.childSize[axis]);
73
+ result.className = mergeClassName(result.className, clsLayout.childSize[axis]);
75
74
  result.style[varLayout.childSize[axis]] = unit(childSize);
76
75
  }
77
76
  return result;
78
77
  } else if (adjust === "shrink") {
79
78
  const result = {
80
- className: clsx(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]),
79
+ className: mergeClassName(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]),
81
80
  style: {}
82
81
  };
83
82
  if (hasValue(childSize)) {
84
- result.className = clsx(result.className, clsLayout.childSize[axis]);
83
+ result.className = mergeClassName(result.className, clsLayout.childSize[axis]);
85
84
  result.style = { [varLayout.childSize[axis]]: `min(${unit(childSize)}, 100%)` };
86
85
  }
87
86
  return result;
88
87
  } else if (hasValue(childSize)) return {
89
- className: clsx(clsLayout.align[axis][align], clsLayout.childSize[axis]),
88
+ className: mergeClassName(clsLayout.align[axis][align], clsLayout.childSize[axis]),
90
89
  style: { [varLayout.childSize[axis]]: unit(childSize) }
91
90
  };
92
- else return { className: clsx(clsLayout.align[axis][align]) };
91
+ else return { className: mergeClassName(clsLayout.align[axis][align]) };
93
92
  }
94
93
 
95
94
  //#endregion
@@ -79,7 +79,6 @@
79
79
  min-height: 100%;
80
80
  }
81
81
  .nws-layout-stack.nws-layout-direction-x.nws-layout-adjustY-shrink > * {
82
- min-height: 0;
83
82
  max-height: 100%;
84
83
  }
85
84
  .nws-layout-stack.nws-layout-direction-y {
@@ -135,7 +134,6 @@
135
134
  min-width: 100%;
136
135
  }
137
136
  .nws-layout-stack.nws-layout-direction-y.nws-layout-adjustX-shrink > * {
138
- min-width: 0;
139
137
  max-width: 100%;
140
138
  }
141
139
  .nws-layout-stack.nws-layout-direction-y.nws-layout-childSizeY > * {
package/core/styles.css CHANGED
@@ -79,7 +79,6 @@
79
79
  min-height: 100%;
80
80
  }
81
81
  .nws-layout-stack.nws-layout-direction-x.nws-layout-adjustY-shrink > * {
82
- min-height: 0;
83
82
  max-height: 100%;
84
83
  }
85
84
  .nws-layout-stack.nws-layout-direction-y {
@@ -135,7 +134,6 @@
135
134
  min-width: 100%;
136
135
  }
137
136
  .nws-layout-stack.nws-layout-direction-y.nws-layout-adjustX-shrink > * {
138
- min-width: 0;
139
137
  max-width: 100%;
140
138
  }
141
139
  .nws-layout-stack.nws-layout-direction-y.nws-layout-childSizeY > * {
@@ -624,9 +622,6 @@
624
622
  .nws-layout-matrix.nws-layout-adjustX-grow.nws-layout-childCountX {
625
623
  grid-template-columns: repeat(var(--nws-layout-childCountX), 1fr);
626
624
  }
627
- .nws-layout-matrix.nws-layout-adjustX-shrink {
628
- grid-template-columns: repeat(auto-fit, auto);
629
- }
630
625
  .nws-layout-matrix.nws-layout-adjustX-shrink.nws-layout-childSizeX {
631
626
  grid-template-columns: repeat(auto-fit, minmax(0, var(--nws-layout-childSizeX)));
632
627
  }
@@ -675,9 +670,6 @@
675
670
  .nws-layout-matrix.nws-layout-adjustY-grow.nws-layout-childCountY {
676
671
  grid-template-rows: repeat(var(--nws-layout-childCountY), 1fr);
677
672
  }
678
- .nws-layout-matrix.nws-layout-adjustY-shrink {
679
- grid-template-rows: repeat(auto-fit, auto);
680
- }
681
673
  .nws-layout-matrix.nws-layout-adjustY-shrink.nws-layout-childSizeY {
682
674
  grid-template-rows: repeat(auto-fit, minmax(0, var(--nws-layout-childSizeY)));
683
675
  }
@@ -720,6 +712,7 @@
720
712
  }
721
713
  .nws-layout-center.nws-layout-direction-x > * {
722
714
  max-width: none;
715
+ max-height: none;
723
716
  flex-grow: 0;
724
717
  flex-shrink: 0;
725
718
  margin-top: auto;
@@ -735,9 +728,6 @@
735
728
  width: var(--nws-layout-childSizeX);
736
729
  flex-basis: var(--nws-layout-childSizeX);
737
730
  }
738
- .nws-layout-center.nws-layout-direction-x.nws-layout-adjustX-fit {
739
- justify-content: stretch;
740
- }
741
731
  .nws-layout-center.nws-layout-direction-x.nws-layout-adjustX-fit > * {
742
732
  width: 100%;
743
733
  max-width: none;
@@ -745,29 +735,19 @@
745
735
  flex-shrink: 1;
746
736
  flex-basis: 0%;
747
737
  }
748
- .nws-layout-center.nws-layout-direction-x.nws-layout-adjustX-grow {
749
- justify-content: stretch;
750
- }
751
738
  .nws-layout-center.nws-layout-direction-x.nws-layout-adjustX-grow > * {
752
739
  width: 100%;
753
740
  min-width: var(--nws-layout-childSizeX);
754
741
  max-width: none;
755
742
  flex-grow: 1;
756
- flex-shrink: 0;
757
743
  flex-basis: var(--nws-layout-childSizeX);
758
744
  }
759
745
  .nws-layout-center.nws-layout-direction-x.nws-layout-adjustX-shrink > * {
760
746
  width: var(--nws-layout-childSizeX);
761
747
  max-width: 100%;
762
- flex-grow: 0;
763
748
  flex-shrink: 1;
764
749
  flex-basis: var(--nws-layout-childSizeX);
765
750
  }
766
- .nws-layout-center.nws-layout-direction-x > * {
767
- max-height: none;
768
- margin-top: auto;
769
- margin-bottom: auto;
770
- }
771
751
  .nws-layout-center.nws-layout-direction-x.nws-layout-childSizeY > * {
772
752
  height: var(--nws-layout-childSizeY);
773
753
  }
@@ -811,6 +791,9 @@
811
791
  }
812
792
  .nws-layout-center.nws-layout-direction-y > * {
813
793
  max-width: none;
794
+ max-height: none;
795
+ flex-grow: 0;
796
+ flex-shrink: 0;
814
797
  margin-left: auto;
815
798
  margin-right: auto;
816
799
  }
@@ -844,18 +827,10 @@
844
827
  margin-left: auto;
845
828
  margin-right: auto;
846
829
  }
847
- .nws-layout-center.nws-layout-direction-y > * {
848
- max-height: none;
849
- flex-grow: 0;
850
- flex-shrink: 0;
851
- }
852
830
  .nws-layout-center.nws-layout-direction-y.nws-layout-childSizeY > * {
853
831
  height: var(--nws-layout-childSizeY);
854
832
  flex-basis: var(--nws-layout-childSizeY);
855
833
  }
856
- .nws-layout-center.nws-layout-direction-y.nws-layout-adjustY-fit {
857
- justify-content: stretch;
858
- }
859
834
  .nws-layout-center.nws-layout-direction-y.nws-layout-adjustY-fit > * {
860
835
  height: 100%;
861
836
  max-height: none;
@@ -863,21 +838,16 @@
863
838
  flex-shrink: 1;
864
839
  flex-basis: 0%;
865
840
  }
866
- .nws-layout-center.nws-layout-direction-y.nws-layout-adjustY-grow {
867
- justify-content: stretch;
868
- }
869
841
  .nws-layout-center.nws-layout-direction-y.nws-layout-adjustY-grow > * {
870
842
  height: 100%;
871
843
  min-height: var(--nws-layout-childSizeY);
872
844
  max-height: none;
873
845
  flex-grow: 1;
874
- flex-shrink: 0;
875
846
  flex-basis: var(--nws-layout-childSizeY);
876
847
  }
877
848
  .nws-layout-center.nws-layout-direction-y.nws-layout-adjustY-shrink > * {
878
849
  height: var(--nws-layout-childSizeY);
879
850
  max-height: 100%;
880
- flex-grow: 0;
881
851
  flex-shrink: 1;
882
852
  flex-basis: var(--nws-layout-childSizeY);
883
853
  }
@@ -955,9 +925,29 @@
955
925
  }
956
926
  .nws-layout-balance.nws-layout-direction-x {
957
927
  grid-auto-flow: column;
928
+ grid-auto-columns: max-content;
929
+ }
930
+ .nws-layout-balance.nws-layout-direction-x.nws-layout-adjustX-grow, .nws-layout-balance.nws-layout-direction-x.nws-layout-adjustX-fit {
931
+ grid-auto-columns: auto;
932
+ }
933
+ .nws-layout-balance.nws-layout-direction-x.nws-layout-adjustX-shrink {
934
+ grid-auto-columns: minmax(0, max-content);
935
+ }
936
+ .nws-layout-balance.nws-layout-direction-x.nws-layout-childSizeX {
937
+ grid-auto-columns: auto;
958
938
  }
959
939
  .nws-layout-balance.nws-layout-direction-y {
960
940
  grid-auto-flow: row;
941
+ grid-auto-rows: max-content;
942
+ }
943
+ .nws-layout-balance.nws-layout-direction-y.nws-layout-adjustY-grow, .nws-layout-balance.nws-layout-direction-y.nws-layout-adjustY-fit {
944
+ grid-auto-rows: auto;
945
+ }
946
+ .nws-layout-balance.nws-layout-direction-y.nws-layout-adjustY-shrink {
947
+ grid-auto-rows: minmax(0, max-content);
948
+ }
949
+ .nws-layout-balance.nws-layout-direction-y.nws-layout-childSizeY {
950
+ grid-auto-rows: auto;
961
951
  }
962
952
  .nws-layout-balance.nws-layout-alignX-left {
963
953
  justify-items: flex-start;
@@ -969,13 +959,13 @@
969
959
  justify-items: flex-end;
970
960
  }
971
961
  .nws-layout-balance.nws-layout-alignX-spaceBetween {
972
- justify-items: space-between;
962
+ justify-content: space-between;
973
963
  }
974
964
  .nws-layout-balance.nws-layout-alignX-spaceAround {
975
- justify-items: space-around;
965
+ justify-content: space-around;
976
966
  }
977
967
  .nws-layout-balance.nws-layout-alignX-spaceEvenly {
978
- justify-items: space-evenly;
968
+ justify-content: space-evenly;
979
969
  }
980
970
  .nws-layout-balance.nws-layout-alignY-top {
981
971
  align-items: flex-start;
@@ -987,13 +977,13 @@
987
977
  align-items: flex-end;
988
978
  }
989
979
  .nws-layout-balance.nws-layout-alignY-spaceBetween {
990
- align-items: space-between;
980
+ align-content: space-between;
991
981
  }
992
982
  .nws-layout-balance.nws-layout-alignY-spaceAround {
993
- align-items: space-around;
983
+ align-content: space-around;
994
984
  }
995
985
  .nws-layout-balance.nws-layout-alignY-spaceEvenly {
996
- align-items: space-evenly;
986
+ align-content: space-evenly;
997
987
  }
998
988
  .nws-layout-balance > * {
999
989
  min-width: 0;
@@ -1011,9 +1001,15 @@
1011
1001
  .nws-layout-balance.nws-layout-adjustX-grow > *, .nws-layout-balance.nws-layout-adjustX-shrink > * {
1012
1002
  width: 100%;
1013
1003
  }
1004
+ .nws-layout-balance.nws-layout-adjustX-grow > * {
1005
+ min-width: max-content;
1006
+ }
1014
1007
  .nws-layout-balance.nws-layout-adjustX-grow.nws-layout-childSizeX > * {
1015
1008
  min-width: var(--nws-layout-childSizeX);
1016
1009
  }
1010
+ .nws-layout-balance.nws-layout-adjustX-shrink > * {
1011
+ max-width: max-content;
1012
+ }
1017
1013
  .nws-layout-balance.nws-layout-adjustX-shrink.nws-layout-childSizeX > * {
1018
1014
  max-width: var(--nws-layout-childSizeX);
1019
1015
  }
@@ -1029,9 +1025,15 @@
1029
1025
  .nws-layout-balance.nws-layout-adjustY-grow > *, .nws-layout-balance.nws-layout-adjustY-shrink > * {
1030
1026
  height: 100%;
1031
1027
  }
1028
+ .nws-layout-balance.nws-layout-adjustY-grow:not(.nws-layout-childSizeY) > * {
1029
+ min-height: max-content;
1030
+ }
1032
1031
  .nws-layout-balance.nws-layout-adjustY-grow.nws-layout-childSizeY > * {
1033
1032
  min-height: var(--nws-layout-childSizeY);
1034
1033
  }
1034
+ .nws-layout-balance.nws-layout-adjustY-shrink:not(.nws-layout-childSizeY) > * {
1035
+ max-height: max-content;
1036
+ }
1035
1037
  .nws-layout-balance.nws-layout-adjustY-shrink.nws-layout-childSizeY > * {
1036
1038
  max-height: var(--nws-layout-childSizeY);
1037
1039
  }
@@ -1087,8 +1089,6 @@
1087
1089
  }
1088
1090
  .nws-layout-layer.nws-layout-adjustX-shrink > * {
1089
1091
  width: clamp(0px, 100%, var(--nws-layout-childSizeX));
1090
- min-width: 0;
1091
- max-width: 100%;
1092
1092
  }
1093
1093
  .nws-layout-layer.nws-layout-adjustY-fit > *, .nws-layout-layer.nws-layout-adjustY-grow > * {
1094
1094
  align-self: stretch;
@@ -1099,8 +1099,6 @@
1099
1099
  }
1100
1100
  .nws-layout-layer.nws-layout-adjustY-shrink > * {
1101
1101
  height: clamp(0px, 100%, var(--nws-layout-childSizeY));
1102
- min-height: 0;
1103
- max-height: 100%;
1104
1102
  }
1105
1103
  .nws-layout-layer.nws-layout-childRatio > * {
1106
1104
  aspect-ratio: var(--nws-layout-childRatio);
@@ -1,13 +1,11 @@
1
1
  const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
- const require_core_constants = require('../constants.cjs');
3
2
  const require_core__constants = require('../_constants.cjs');
3
+ const require_core__internal_mergeClassName = require('../_internal/mergeClassName.cjs');
4
4
  const require_core__internal_applyChildRatio = require('../_internal/applyChildRatio.cjs');
5
5
  const require_core__internal_applyChildSize = require('../_internal/applyChildSize.cjs');
6
6
  const require_core__internal_applyGap = require('../_internal/applyGap.cjs');
7
7
  let _niche_works_utils_object_maybeDefault = require("@niche-works/utils/object/maybeDefault");
8
8
  _niche_works_utils_object_maybeDefault = require_runtime.__toESM(_niche_works_utils_object_maybeDefault, 1);
9
- let clsx = require("clsx");
10
- clsx = require_runtime.__toESM(clsx, 1);
11
9
 
12
10
  //#region src/core/tile/tile.ts
13
11
  /**
@@ -23,7 +21,7 @@ const tile = (options = {}) => {
23
21
  alignY: "top"
24
22
  }, { overwriteNull: true });
25
23
  const result = {
26
- className: (0, clsx.default)(require_core_constants.clsLayoutTile, require_core__constants.clsLayout.direction[direction], require_core__constants.clsLayout.align.x[alignX], require_core__constants.clsLayout.align.y[alignY], require_core__constants.clsLayout.adjust.x[adjustX], require_core__constants.clsLayout.adjust.y[adjustY]),
24
+ className: require_core__internal_mergeClassName(require_core__constants.clsLayoutTile, require_core__constants.clsLayout.direction[direction], require_core__constants.clsLayout.align.x[alignX], require_core__constants.clsLayout.align.y[alignY], require_core__constants.clsLayout.adjust.x[adjustX], require_core__constants.clsLayout.adjust.y[adjustY]),
27
25
  style: {}
28
26
  };
29
27
  require_core__internal_applyGap(result, gap, gapX, gapY);
@@ -1,10 +1,9 @@
1
- import { clsLayoutTile } from "../constants.mjs";
2
- import { clsLayout } from "../_constants.mjs";
1
+ import { clsLayout, clsLayoutTile } from "../_constants.mjs";
2
+ import mergeClassName from "../_internal/mergeClassName.mjs";
3
3
  import applyChildRatio from "../_internal/applyChildRatio.mjs";
4
4
  import applyChildSize from "../_internal/applyChildSize.mjs";
5
5
  import applyGap from "../_internal/applyGap.mjs";
6
6
  import maybeDefault from "@niche-works/utils/object/maybeDefault";
7
- import clsx from "clsx";
8
7
 
9
8
  //#region src/core/tile/tile.ts
10
9
  /**
@@ -20,7 +19,7 @@ const tile = (options = {}) => {
20
19
  alignY: "top"
21
20
  }, { overwriteNull: true });
22
21
  const result = {
23
- className: clsx(clsLayoutTile, clsLayout.direction[direction], clsLayout.align.x[alignX], clsLayout.align.y[alignY], clsLayout.adjust.x[adjustX], clsLayout.adjust.y[adjustY]),
22
+ className: mergeClassName(clsLayoutTile, clsLayout.direction[direction], clsLayout.align.x[alignX], clsLayout.align.y[alignY], clsLayout.adjust.x[adjustX], clsLayout.adjust.y[adjustY]),
24
23
  style: {}
25
24
  };
26
25
  applyGap(result, gap, gapX, gapY);
package/core/types.d.cts CHANGED
@@ -1,4 +1,3 @@
1
- import { CSSCustomProperties } from "./_types.cjs";
2
1
  import { LooseDictionary } from "@niche-works/types";
3
2
 
4
3
  //#region src/core/types.d.ts
@@ -19,5 +18,11 @@ type StyleLayoutResult = {
19
18
  */
20
19
  style?: CSSCustomProperties;
21
20
  };
21
+ /**
22
+ * CSSカスタムプロパティ(変数)
23
+ */
24
+ type CSSCustomProperties = {
25
+ [key: `--${string}`]: string | undefined;
26
+ };
22
27
  //#endregion
23
- export { StyleLayout, StyleLayoutResult };
28
+ export { CSSCustomProperties, StyleLayout, StyleLayoutResult };
package/core/types.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- import { CSSCustomProperties } from "./_types.mjs";
2
1
  import { LooseDictionary } from "@niche-works/types";
3
2
 
4
3
  //#region src/core/types.d.ts
@@ -19,5 +18,11 @@ type StyleLayoutResult = {
19
18
  */
20
19
  style?: CSSCustomProperties;
21
20
  };
21
+ /**
22
+ * CSSカスタムプロパティ(変数)
23
+ */
24
+ type CSSCustomProperties = {
25
+ [key: `--${string}`]: string | undefined;
26
+ };
22
27
  //#endregion
23
- export { StyleLayout, StyleLayoutResult };
28
+ export { CSSCustomProperties, StyleLayout, StyleLayoutResult };
package/flow/index.cjs CHANGED
@@ -1,4 +1,8 @@
1
- require('../core/flow/styles.css');
2
1
  const require_core_flow_flow = require('../core/flow/flow.cjs');
2
+ require('../core/flow/styles.css');
3
+
4
+ //#region src/flow/index.ts
5
+ var flow_default = require_core_flow_flow;
3
6
 
4
- module.exports = require_core_flow_flow;
7
+ //#endregion
8
+ module.exports = flow_default;
package/flow/index.mjs CHANGED
@@ -1,4 +1,8 @@
1
- import "../core/flow/styles.css";
2
1
  import flow from "../core/flow/flow.mjs";
2
+ import "../core/flow/styles.css";
3
+
4
+ //#region src/flow/index.ts
5
+ var flow_default = flow;
3
6
 
4
- export { flow as default };
7
+ //#endregion
8
+ export { flow_default as default };
@@ -0,0 +1,25 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/helpers/_internal/constants.ts
4
+ const DIRECTION_OPTIONS_KEYS = ["direction"];
5
+ const ALIGN_OPTIONS_KEYS = ["alignX", "alignY"];
6
+ const ADJUST_OPTIONS_KEYS = ["adjustX", "adjustY"];
7
+ const GAP_OPTIONS_KEYS = [
8
+ "gap",
9
+ "gapX",
10
+ "gapY"
11
+ ];
12
+ const CHILD_SIZE_OPTIONS_KEYS = ["childSizeX", "childSizeY"];
13
+ const CHILD_RATIO_OPTIONS_KEYS = ["childRatioX", "childRatioY"];
14
+ const CHILD_COUNT_OPTIONS_KEYS = ["childCountX", "childCountY"];
15
+ const TRACKS_OPTIONS_KEYS = ["tracksX", "tracksY"];
16
+
17
+ //#endregion
18
+ exports.ADJUST_OPTIONS_KEYS = ADJUST_OPTIONS_KEYS;
19
+ exports.ALIGN_OPTIONS_KEYS = ALIGN_OPTIONS_KEYS;
20
+ exports.CHILD_COUNT_OPTIONS_KEYS = CHILD_COUNT_OPTIONS_KEYS;
21
+ exports.CHILD_RATIO_OPTIONS_KEYS = CHILD_RATIO_OPTIONS_KEYS;
22
+ exports.CHILD_SIZE_OPTIONS_KEYS = CHILD_SIZE_OPTIONS_KEYS;
23
+ exports.DIRECTION_OPTIONS_KEYS = DIRECTION_OPTIONS_KEYS;
24
+ exports.GAP_OPTIONS_KEYS = GAP_OPTIONS_KEYS;
25
+ exports.TRACKS_OPTIONS_KEYS = TRACKS_OPTIONS_KEYS;
@@ -0,0 +1,13 @@
1
+ import { AdjustOptions, AlignOptions, ChildCountOptions, ChildRatioOptions, ChildSizeOptions, DirectionOptions, GapOptions, TracksOptions } from "../../core/_types.cjs";
2
+
3
+ //#region src/helpers/_internal/constants.d.ts
4
+ declare const DIRECTION_OPTIONS_KEYS: (keyof DirectionOptions)[];
5
+ declare const ALIGN_OPTIONS_KEYS: (keyof AlignOptions)[];
6
+ declare const ADJUST_OPTIONS_KEYS: (keyof AdjustOptions)[];
7
+ declare const GAP_OPTIONS_KEYS: (keyof GapOptions)[];
8
+ declare const CHILD_SIZE_OPTIONS_KEYS: (keyof ChildSizeOptions)[];
9
+ declare const CHILD_RATIO_OPTIONS_KEYS: (keyof ChildRatioOptions)[];
10
+ declare const CHILD_COUNT_OPTIONS_KEYS: (keyof ChildCountOptions)[];
11
+ declare const TRACKS_OPTIONS_KEYS: (keyof TracksOptions)[];
12
+ //#endregion
13
+ export { ADJUST_OPTIONS_KEYS, ALIGN_OPTIONS_KEYS, CHILD_COUNT_OPTIONS_KEYS, CHILD_RATIO_OPTIONS_KEYS, CHILD_SIZE_OPTIONS_KEYS, DIRECTION_OPTIONS_KEYS, GAP_OPTIONS_KEYS, TRACKS_OPTIONS_KEYS };
@@ -0,0 +1,13 @@
1
+ import { AdjustOptions, AlignOptions, ChildCountOptions, ChildRatioOptions, ChildSizeOptions, DirectionOptions, GapOptions, TracksOptions } from "../../core/_types.mjs";
2
+
3
+ //#region src/helpers/_internal/constants.d.ts
4
+ declare const DIRECTION_OPTIONS_KEYS: (keyof DirectionOptions)[];
5
+ declare const ALIGN_OPTIONS_KEYS: (keyof AlignOptions)[];
6
+ declare const ADJUST_OPTIONS_KEYS: (keyof AdjustOptions)[];
7
+ declare const GAP_OPTIONS_KEYS: (keyof GapOptions)[];
8
+ declare const CHILD_SIZE_OPTIONS_KEYS: (keyof ChildSizeOptions)[];
9
+ declare const CHILD_RATIO_OPTIONS_KEYS: (keyof ChildRatioOptions)[];
10
+ declare const CHILD_COUNT_OPTIONS_KEYS: (keyof ChildCountOptions)[];
11
+ declare const TRACKS_OPTIONS_KEYS: (keyof TracksOptions)[];
12
+ //#endregion
13
+ export { ADJUST_OPTIONS_KEYS, ALIGN_OPTIONS_KEYS, CHILD_COUNT_OPTIONS_KEYS, CHILD_RATIO_OPTIONS_KEYS, CHILD_SIZE_OPTIONS_KEYS, DIRECTION_OPTIONS_KEYS, GAP_OPTIONS_KEYS, TRACKS_OPTIONS_KEYS };
@@ -0,0 +1,16 @@
1
+ //#region src/helpers/_internal/constants.ts
2
+ const DIRECTION_OPTIONS_KEYS = ["direction"];
3
+ const ALIGN_OPTIONS_KEYS = ["alignX", "alignY"];
4
+ const ADJUST_OPTIONS_KEYS = ["adjustX", "adjustY"];
5
+ const GAP_OPTIONS_KEYS = [
6
+ "gap",
7
+ "gapX",
8
+ "gapY"
9
+ ];
10
+ const CHILD_SIZE_OPTIONS_KEYS = ["childSizeX", "childSizeY"];
11
+ const CHILD_RATIO_OPTIONS_KEYS = ["childRatioX", "childRatioY"];
12
+ const CHILD_COUNT_OPTIONS_KEYS = ["childCountX", "childCountY"];
13
+ const TRACKS_OPTIONS_KEYS = ["tracksX", "tracksY"];
14
+
15
+ //#endregion
16
+ export { ADJUST_OPTIONS_KEYS, ALIGN_OPTIONS_KEYS, CHILD_COUNT_OPTIONS_KEYS, CHILD_RATIO_OPTIONS_KEYS, CHILD_SIZE_OPTIONS_KEYS, DIRECTION_OPTIONS_KEYS, GAP_OPTIONS_KEYS, TRACKS_OPTIONS_KEYS };
@@ -0,0 +1,25 @@
1
+
2
+ //#region src/helpers/_internal/createExtractLayoutOptions.ts
3
+ /**
4
+ * レコードからレイアウトオプションとそれ以外のプロパティを分離する関数を作成する
5
+ *
6
+ * @param optionsKeys レイアウトオプションのキー
7
+ */
8
+ function createExtractLayoutOptions(optionKeys) {
9
+ const keySet = new Set(optionKeys);
10
+ /**
11
+ * レコードからレイアウトオプションとそれ以外のプロパティを分離する
12
+ *
13
+ * @param record レイアウトオプションとその他のプロパティを含むレコード
14
+ * @returns `[layoutOptions, rest]` のタプル。`layoutOptions` はレイアウトに対応するプロパティ、`rest` はそれ以外のプロパティ
15
+ */
16
+ return (record) => {
17
+ const options = {};
18
+ const rest = {};
19
+ if (record) for (const [k, v] of Object.entries(record)) (keySet.has(k) ? options : rest)[k] = v;
20
+ return [options, rest];
21
+ };
22
+ }
23
+
24
+ //#endregion
25
+ module.exports = createExtractLayoutOptions;