@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
package/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import balance from "./core/balance/balance.mjs";
2
- import center from "./core/center/center.mjs";
3
- import flow from "./core/flow/flow.mjs";
4
- import layer from "./core/layer/layer.mjs";
5
- import matrix from "./core/matrix/matrix.mjs";
6
- import pack from "./core/pack/pack.mjs";
7
- import pin from "./core/pin/pin.mjs";
8
- import stack from "./core/stack/stack.mjs";
9
- import tile from "./core/tile/tile.mjs";
1
+ import balance_default from "./balance/index.mjs";
2
+ import center_default from "./center/index.mjs";
3
+ import flow_default from "./flow/index.mjs";
4
+ import layer_default from "./layer/index.mjs";
5
+ import matrix_default from "./matrix/index.mjs";
6
+ import pack_default from "./pack/index.mjs";
7
+ import pin_default from "./pin/index.mjs";
8
+ import stack_default from "./stack/index.mjs";
9
+ import tile_default from "./tile/index.mjs";
10
10
 
11
- export { balance, center, flow, layer, matrix, pack, pin, stack, tile };
11
+ export { balance_default as balance, center_default as center, flow_default as flow, layer_default as layer, matrix_default as matrix, pack_default as pack, pin_default as pin, stack_default as stack, tile_default as tile };
package/layer/index.cjs CHANGED
@@ -1,4 +1,8 @@
1
- require('../core/layer/styles.css');
2
1
  const require_core_layer_layer = require('../core/layer/layer.cjs');
2
+ require('../core/layer/styles.css');
3
+
4
+ //#region src/layer/index.ts
5
+ var layer_default = require_core_layer_layer;
3
6
 
4
- module.exports = require_core_layer_layer;
7
+ //#endregion
8
+ module.exports = layer_default;
package/layer/index.mjs CHANGED
@@ -1,4 +1,8 @@
1
- import "../core/layer/styles.css";
2
1
  import layer from "../core/layer/layer.mjs";
2
+ import "../core/layer/styles.css";
3
+
4
+ //#region src/layer/index.ts
5
+ var layer_default = layer;
3
6
 
4
- export { layer as default };
7
+ //#endregion
8
+ export { layer_default as default };
package/matrix/index.cjs CHANGED
@@ -1,4 +1,8 @@
1
- require('../core/matrix/styles.css');
2
1
  const require_core_matrix_matrix = require('../core/matrix/matrix.cjs');
2
+ require('../core/matrix/styles.css');
3
+
4
+ //#region src/matrix/index.ts
5
+ var matrix_default = require_core_matrix_matrix;
3
6
 
4
- module.exports = require_core_matrix_matrix;
7
+ //#endregion
8
+ module.exports = matrix_default;
package/matrix/index.mjs CHANGED
@@ -1,4 +1,8 @@
1
- import "../core/matrix/styles.css";
2
1
  import matrix from "../core/matrix/matrix.mjs";
2
+ import "../core/matrix/styles.css";
3
+
4
+ //#region src/matrix/index.ts
5
+ var matrix_default = matrix;
3
6
 
4
- export { matrix as default };
7
+ //#endregion
8
+ export { matrix_default as default };
package/pack/index.cjs CHANGED
@@ -1,4 +1,8 @@
1
- require('../core/pack/styles.css');
2
1
  const require_core_pack_pack = require('../core/pack/pack.cjs');
2
+ require('../core/pack/styles.css');
3
+
4
+ //#region src/pack/index.ts
5
+ var pack_default = require_core_pack_pack;
3
6
 
4
- module.exports = require_core_pack_pack;
7
+ //#endregion
8
+ module.exports = pack_default;
package/pack/index.mjs CHANGED
@@ -1,4 +1,8 @@
1
- import "../core/pack/styles.css";
2
1
  import pack from "../core/pack/pack.mjs";
2
+ import "../core/pack/styles.css";
3
+
4
+ //#region src/pack/index.ts
5
+ var pack_default = pack;
3
6
 
4
- export { pack as default };
7
+ //#endregion
8
+ export { pack_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@niche-works/style-layouts",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "keywords": [
5
5
  "css",
6
6
  "style",
@@ -37,6 +37,10 @@
37
37
  "import": "./core/constants.mjs",
38
38
  "require": "./core/constants.cjs"
39
39
  },
40
+ "./helpers/*": {
41
+ "import": "./helpers/*.mjs",
42
+ "require": "./helpers/*.cjs"
43
+ },
40
44
  "./core/styles.css": "./core/styles.css",
41
45
  "./core/*.css": "./core/*/styles.css"
42
46
  },
@@ -44,8 +48,6 @@
44
48
  "module": "./index.mjs",
45
49
  "dependencies": {
46
50
  "@niche-works/types": "^0.3.1",
47
- "@niche-works/utils": "^0.4.0",
48
- "clsx": "^2.1.1",
49
- "csstype": "^3.2.3"
51
+ "@niche-works/utils": "^0.4.0"
50
52
  }
51
53
  }
package/pin/index.cjs CHANGED
@@ -1,4 +1,8 @@
1
- require('../core/pin/styles.css');
2
1
  const require_core_pin_pin = require('../core/pin/pin.cjs');
2
+ require('../core/pin/styles.css');
3
+
4
+ //#region src/pin/index.ts
5
+ var pin_default = require_core_pin_pin;
3
6
 
4
- module.exports = require_core_pin_pin;
7
+ //#endregion
8
+ module.exports = pin_default;
package/pin/index.mjs CHANGED
@@ -1,4 +1,8 @@
1
- import "../core/pin/styles.css";
2
1
  import pin from "../core/pin/pin.mjs";
2
+ import "../core/pin/styles.css";
3
+
4
+ //#region src/pin/index.ts
5
+ var pin_default = pin;
3
6
 
4
- export { pin as default };
7
+ //#endregion
8
+ export { pin_default as default };
package/stack/index.cjs CHANGED
@@ -1,4 +1,8 @@
1
- require('../core/stack/styles.css');
2
1
  const require_core_stack_stack = require('../core/stack/stack.cjs');
2
+ require('../core/stack/styles.css');
3
+
4
+ //#region src/stack/index.ts
5
+ var stack_default = require_core_stack_stack;
3
6
 
4
- module.exports = require_core_stack_stack;
7
+ //#endregion
8
+ module.exports = stack_default;
package/stack/index.mjs CHANGED
@@ -1,4 +1,8 @@
1
- import "../core/stack/styles.css";
2
1
  import stack from "../core/stack/stack.mjs";
2
+ import "../core/stack/styles.css";
3
+
4
+ //#region src/stack/index.ts
5
+ var stack_default = stack;
3
6
 
4
- export { stack as default };
7
+ //#endregion
8
+ export { stack_default as default };
package/tile/index.cjs CHANGED
@@ -1,4 +1,8 @@
1
- require('../core/tile/styles.css');
2
1
  const require_core_tile_tile = require('../core/tile/tile.cjs');
2
+ require('../core/tile/styles.css');
3
+
4
+ //#region src/tile/index.ts
5
+ var tile_default = require_core_tile_tile;
3
6
 
4
- module.exports = require_core_tile_tile;
7
+ //#endregion
8
+ module.exports = tile_default;
package/tile/index.mjs CHANGED
@@ -1,4 +1,8 @@
1
- import "../core/tile/styles.css";
2
1
  import tile from "../core/tile/tile.mjs";
2
+ import "../core/tile/styles.css";
3
+
4
+ //#region src/tile/index.ts
5
+ var tile_default = tile;
3
6
 
4
- export { tile as default };
7
+ //#endregion
8
+ export { tile_default as default };
package/types.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { StyleLayout, StyleLayoutResult } from "./core/types.cjs";
2
- export { StyleLayout, StyleLayoutResult };
1
+ import { CSSCustomProperties, StyleLayout, StyleLayoutResult } from "./core/types.cjs";
2
+ export { CSSCustomProperties, StyleLayout, StyleLayoutResult };
package/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { StyleLayout, StyleLayoutResult } from "./core/types.mjs";
2
- export { StyleLayout, StyleLayoutResult };
1
+ import { CSSCustomProperties, StyleLayout, StyleLayoutResult } from "./core/types.mjs";
2
+ export { CSSCustomProperties, StyleLayout, StyleLayoutResult };
@@ -1,15 +0,0 @@
1
-
2
- //#region src/core/_internal/warnIfUnsupported.ts
3
- const _checkCSSSupport = (property, value) => {
4
- if (typeof CSS === "undefined" || !CSS.supports) return true;
5
- return CSS.supports(property, value);
6
- };
7
- function warnIfUnsupported(layout, checks) {
8
- if (process.env.NODE_ENV === "production") return;
9
- checks.forEach(([property, value]) => {
10
- if (!_checkCSSSupport(property, value)) console.warn(`[@niche-works/style-layouts] "${property}: ${value}" is not supported in this browser. The "${layout}" layout may not work as expected.`);
11
- });
12
- }
13
-
14
- //#endregion
15
- module.exports = warnIfUnsupported;
@@ -1,3 +0,0 @@
1
- //#region src/core/_internal/warnIfUnsupported.d.ts
2
- declare function warnIfUnsupported(layout: string, checks: [string, string][]): void;
3
- export = warnIfUnsupported;
@@ -1,4 +0,0 @@
1
- //#region src/core/_internal/warnIfUnsupported.d.ts
2
- declare function warnIfUnsupported(layout: string, checks: [string, string][]): void;
3
- //#endregion
4
- export { warnIfUnsupported as default };
@@ -1,14 +0,0 @@
1
- //#region src/core/_internal/warnIfUnsupported.ts
2
- const _checkCSSSupport = (property, value) => {
3
- if (typeof CSS === "undefined" || !CSS.supports) return true;
4
- return CSS.supports(property, value);
5
- };
6
- function warnIfUnsupported(layout, checks) {
7
- if (process.env.NODE_ENV === "production") return;
8
- checks.forEach(([property, value]) => {
9
- if (!_checkCSSSupport(property, value)) console.warn(`[@niche-works/style-layouts] "${property}: ${value}" is not supported in this browser. The "${layout}" layout may not work as expected.`);
10
- });
11
- }
12
-
13
- //#endregion
14
- export { warnIfUnsupported as default };