@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
@@ -0,0 +1,18 @@
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ let clsx = require("clsx");
3
+ clsx = require_runtime.__toESM(clsx, 1);
4
+
5
+ //#region src/_helpers/mergeLayoutResults.ts
6
+ function mergeLayoutResults(results) {
7
+ return results.reduce((layoutResult, result) => {
8
+ if (result.className) layoutResult.className = (0, clsx.default)(layoutResult.className, result.className);
9
+ if (result.style) layoutResult.style = {
10
+ ...layoutResult.style,
11
+ ...result.style
12
+ };
13
+ return layoutResult;
14
+ }, {});
15
+ }
16
+
17
+ //#endregion
18
+ module.exports = mergeLayoutResults;
@@ -0,0 +1,5 @@
1
+ import { LayoutResult } from "../types.cjs";
2
+
3
+ //#region src/_helpers/mergeLayoutResults.d.ts
4
+ declare function mergeLayoutResults(results: LayoutResult[]): LayoutResult;
5
+ export = mergeLayoutResults;
@@ -0,0 +1,6 @@
1
+ import { LayoutResult } from "../types.mjs";
2
+
3
+ //#region src/_helpers/mergeLayoutResults.d.ts
4
+ declare function mergeLayoutResults(results: LayoutResult[]): LayoutResult;
5
+ //#endregion
6
+ export { mergeLayoutResults as default };
@@ -0,0 +1,16 @@
1
+ import clsx from "clsx";
2
+
3
+ //#region src/_helpers/mergeLayoutResults.ts
4
+ function mergeLayoutResults(results) {
5
+ return results.reduce((layoutResult, result) => {
6
+ if (result.className) layoutResult.className = clsx(layoutResult.className, result.className);
7
+ if (result.style) layoutResult.style = {
8
+ ...layoutResult.style,
9
+ ...result.style
10
+ };
11
+ return layoutResult;
12
+ }, {});
13
+ }
14
+
15
+ //#endregion
16
+ export { mergeLayoutResults as default };
@@ -0,0 +1,16 @@
1
+
2
+ //#region src/_helpers/unit.ts
3
+ /**
4
+ * valueが数値の場合、単位を付与して文字列に変換する
5
+ * それ以外はそのまま返す
6
+ * @param value
7
+ * @param unit
8
+ * @returns
9
+ */
10
+ function unit(value, unit = "px") {
11
+ if (typeof value === "number") return `${value}${unit}`;
12
+ else return value;
13
+ }
14
+
15
+ //#endregion
16
+ module.exports = unit;
@@ -0,0 +1,10 @@
1
+ //#region src/_helpers/unit.d.ts
2
+ /**
3
+ * valueが数値の場合、単位を付与して文字列に変換する
4
+ * それ以外はそのまま返す
5
+ * @param value
6
+ * @param unit
7
+ * @returns
8
+ */
9
+ declare function unit(value: string | number | null | undefined, unit?: string): string;
10
+ export = unit;
@@ -0,0 +1,11 @@
1
+ //#region src/_helpers/unit.d.ts
2
+ /**
3
+ * valueが数値の場合、単位を付与して文字列に変換する
4
+ * それ以外はそのまま返す
5
+ * @param value
6
+ * @param unit
7
+ * @returns
8
+ */
9
+ declare function unit(value: string | number | null | undefined, unit?: string): string;
10
+ //#endregion
11
+ export { unit as default };
@@ -0,0 +1,15 @@
1
+ //#region src/_helpers/unit.ts
2
+ /**
3
+ * valueが数値の場合、単位を付与して文字列に変換する
4
+ * それ以外はそのまま返す
5
+ * @param value
6
+ * @param unit
7
+ * @returns
8
+ */
9
+ function unit(value, unit = "px") {
10
+ if (typeof value === "number") return `${value}${unit}`;
11
+ else return value;
12
+ }
13
+
14
+ //#endregion
15
+ export { unit as default };
package/_types.cjs ADDED
File without changes
package/_types.d.cts ADDED
@@ -0,0 +1,118 @@
1
+ import { Adjust, AlignX, AlignY, Direction } from "./constants.cjs";
2
+ import CSS from "csstype";
3
+
4
+ //#region src/_types.d.ts
5
+ /**
6
+ * CSS変数を許容するCSSProperties
7
+ */
8
+ type CSSPropertiesWithVars = CSSProperties & {
9
+ [key: `--${string}`]: string | number | undefined;
10
+ };
11
+ type CSSProperties = CSS.Properties<string | number>;
12
+ /**
13
+ * 子要素を並べる方向
14
+ */
15
+ type DirectionOptions<D extends Direction = Direction> = {
16
+ /**
17
+ * 並べる方向
18
+ */
19
+ direction?: D;
20
+ };
21
+ /**
22
+ * 子要素の位置
23
+ */
24
+ type AlignOptions = {
25
+ /**
26
+ * 子要素の横位置
27
+ */
28
+ alignX?: AlignX;
29
+ /**
30
+ * 子要素の縦位置
31
+ */
32
+ alignY?: AlignY;
33
+ };
34
+ /**
35
+ * 子要素のサイズ調整
36
+ */
37
+ type AdjustOptions = {
38
+ /**
39
+ * 子要素の幅の調整
40
+ * childSizeXを指定した場合に有効
41
+ * デフォルトは`none`
42
+ */
43
+ adjustX?: Adjust;
44
+ /**
45
+ * 子要素の高さの調整
46
+ * childSizeYを指定した場合に有効
47
+ * デフォルトは`none`
48
+ */
49
+ adjustY?: Adjust;
50
+ };
51
+ /**
52
+ * 要素間の余白
53
+ */
54
+ type SpacingOptions = {
55
+ /**
56
+ * 余白
57
+ */
58
+ spacing?: ChildSpacing;
59
+ /**
60
+ * 横方向の余白
61
+ */
62
+ spacingX?: ChildSpacing;
63
+ /**
64
+ * 縦方向の余白
65
+ */
66
+ spacingY?: ChildSpacing;
67
+ };
68
+ /**
69
+ * 子要素のサイズ
70
+ */
71
+ type ChildSizeOptions = {
72
+ /**
73
+ * 子要素の幅
74
+ */
75
+ childSizeX?: ChildSize;
76
+ /**
77
+ * 子要素の高さ
78
+ */
79
+ childSizeY?: ChildSize;
80
+ };
81
+ /**
82
+ * 子要素の数
83
+ */
84
+ type ChildCountOptions = {
85
+ /**
86
+ * 横方向の要素数
87
+ */
88
+ childCountX?: number;
89
+ /**
90
+ * 縦方向の要素数
91
+ */
92
+ childCountY?: number;
93
+ };
94
+ /**
95
+ * childのテンプレート
96
+ */
97
+ type ChildOptions = {
98
+ /**
99
+ * 横方向の設定
100
+ * このプロパティが設定されている場合、childCountX,childSizeXは無効
101
+ */
102
+ childX?: (string | number)[];
103
+ /**
104
+ * 縦方向の設定
105
+ * このプロパティが設定されている場合、childCountY,childSizeYは無効
106
+ */
107
+ childY?: (string | number)[];
108
+ };
109
+ /**
110
+ * 子要素の高さ or 幅
111
+ */
112
+ type ChildSize = CSSProperties['flexBasis'];
113
+ /**
114
+ * 余白
115
+ */
116
+ type ChildSpacing = CSSProperties['gap'];
117
+ //#endregion
118
+ export { AdjustOptions, AlignOptions, CSSProperties, CSSPropertiesWithVars, ChildCountOptions, ChildOptions, ChildSize, ChildSizeOptions, ChildSpacing, DirectionOptions, SpacingOptions };
package/_types.d.mts ADDED
@@ -0,0 +1,118 @@
1
+ import { Adjust, AlignX, AlignY, Direction } from "./constants.mjs";
2
+ import CSS from "csstype";
3
+
4
+ //#region src/_types.d.ts
5
+ /**
6
+ * CSS変数を許容するCSSProperties
7
+ */
8
+ type CSSPropertiesWithVars = CSSProperties & {
9
+ [key: `--${string}`]: string | number | undefined;
10
+ };
11
+ type CSSProperties = CSS.Properties<string | number>;
12
+ /**
13
+ * 子要素を並べる方向
14
+ */
15
+ type DirectionOptions<D extends Direction = Direction> = {
16
+ /**
17
+ * 並べる方向
18
+ */
19
+ direction?: D;
20
+ };
21
+ /**
22
+ * 子要素の位置
23
+ */
24
+ type AlignOptions = {
25
+ /**
26
+ * 子要素の横位置
27
+ */
28
+ alignX?: AlignX;
29
+ /**
30
+ * 子要素の縦位置
31
+ */
32
+ alignY?: AlignY;
33
+ };
34
+ /**
35
+ * 子要素のサイズ調整
36
+ */
37
+ type AdjustOptions = {
38
+ /**
39
+ * 子要素の幅の調整
40
+ * childSizeXを指定した場合に有効
41
+ * デフォルトは`none`
42
+ */
43
+ adjustX?: Adjust;
44
+ /**
45
+ * 子要素の高さの調整
46
+ * childSizeYを指定した場合に有効
47
+ * デフォルトは`none`
48
+ */
49
+ adjustY?: Adjust;
50
+ };
51
+ /**
52
+ * 要素間の余白
53
+ */
54
+ type SpacingOptions = {
55
+ /**
56
+ * 余白
57
+ */
58
+ spacing?: ChildSpacing;
59
+ /**
60
+ * 横方向の余白
61
+ */
62
+ spacingX?: ChildSpacing;
63
+ /**
64
+ * 縦方向の余白
65
+ */
66
+ spacingY?: ChildSpacing;
67
+ };
68
+ /**
69
+ * 子要素のサイズ
70
+ */
71
+ type ChildSizeOptions = {
72
+ /**
73
+ * 子要素の幅
74
+ */
75
+ childSizeX?: ChildSize;
76
+ /**
77
+ * 子要素の高さ
78
+ */
79
+ childSizeY?: ChildSize;
80
+ };
81
+ /**
82
+ * 子要素の数
83
+ */
84
+ type ChildCountOptions = {
85
+ /**
86
+ * 横方向の要素数
87
+ */
88
+ childCountX?: number;
89
+ /**
90
+ * 縦方向の要素数
91
+ */
92
+ childCountY?: number;
93
+ };
94
+ /**
95
+ * childのテンプレート
96
+ */
97
+ type ChildOptions = {
98
+ /**
99
+ * 横方向の設定
100
+ * このプロパティが設定されている場合、childCountX,childSizeXは無効
101
+ */
102
+ childX?: (string | number)[];
103
+ /**
104
+ * 縦方向の設定
105
+ * このプロパティが設定されている場合、childCountY,childSizeYは無効
106
+ */
107
+ childY?: (string | number)[];
108
+ };
109
+ /**
110
+ * 子要素の高さ or 幅
111
+ */
112
+ type ChildSize = CSSProperties['flexBasis'];
113
+ /**
114
+ * 余白
115
+ */
116
+ type ChildSpacing = CSSProperties['gap'];
117
+ //#endregion
118
+ export { AdjustOptions, AlignOptions, CSSProperties, CSSPropertiesWithVars, ChildCountOptions, ChildOptions, ChildSize, ChildSizeOptions, ChildSpacing, DirectionOptions, SpacingOptions };
package/_types.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,29 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
@@ -0,0 +1,34 @@
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ const require_constants = require('../constants.cjs');
3
+ const require__constants = require('../_constants.cjs');
4
+ const require__helpers_applyChildSize = require('../_helpers/applyChildSize.cjs');
5
+ const require__helpers_applySpacing = require('../_helpers/applySpacing.cjs');
6
+ require('./styles.cjs');
7
+ let _niche_works_utils_object_maybeDefault = require("@niche-works/utils/object/maybeDefault");
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
+
12
+ //#region src/balance/balance.ts
13
+ /**
14
+ * balanceレイアウト
15
+ *
16
+ * - 子要素を均等に配置する
17
+ */
18
+ const balance = (options = {}) => {
19
+ const { direction, alignX, alignY, adjustX, adjustY, spacing, spacingX, spacingY, childSizeX, childSizeY } = (0, _niche_works_utils_object_maybeDefault.default)(options, {
20
+ direction: "x",
21
+ alignX: "left",
22
+ alignY: "top"
23
+ }, { overwriteNull: true });
24
+ const result = {
25
+ className: (0, clsx.default)(require_constants.clsLayoutBalance, require__constants.clsLayoutDirection[direction], require__constants.clsLayoutAlign.x[alignX], require__constants.clsLayoutAlign.y[alignY], require__constants.clsLayoutAdjust.x[adjustX], require__constants.clsLayoutAdjust.y[adjustY]),
26
+ style: {}
27
+ };
28
+ require__helpers_applySpacing(result, spacing, spacingX, spacingY);
29
+ require__helpers_applyChildSize(result, childSizeX, childSizeY);
30
+ return result;
31
+ };
32
+
33
+ //#endregion
34
+ module.exports = balance;
@@ -0,0 +1,11 @@
1
+ import { CreateLayout } from "../types.cjs";
2
+ import { BalanceLayoutOptions } from "./types.cjs";
3
+
4
+ //#region src/balance/balance.d.ts
5
+ /**
6
+ * balanceレイアウト
7
+ *
8
+ * - 子要素を均等に配置する
9
+ */
10
+ declare const balance: CreateLayout<BalanceLayoutOptions>;
11
+ export = balance;
@@ -0,0 +1,12 @@
1
+ import { CreateLayout } from "../types.mjs";
2
+ import { BalanceLayoutOptions } from "./types.mjs";
3
+
4
+ //#region src/balance/balance.d.ts
5
+ /**
6
+ * balanceレイアウト
7
+ *
8
+ * - 子要素を均等に配置する
9
+ */
10
+ declare const balance: CreateLayout<BalanceLayoutOptions>;
11
+ //#endregion
12
+ export { balance as default };
@@ -0,0 +1,31 @@
1
+ import { clsLayoutBalance } from "../constants.mjs";
2
+ import { clsLayoutAdjust, clsLayoutAlign, clsLayoutDirection } from "../_constants.mjs";
3
+ import applyChildSize from "../_helpers/applyChildSize.mjs";
4
+ import applySpacing from "../_helpers/applySpacing.mjs";
5
+ import "./styles.css";
6
+ import maybeDefault from "@niche-works/utils/object/maybeDefault";
7
+ import clsx from "clsx";
8
+
9
+ //#region src/balance/balance.ts
10
+ /**
11
+ * balanceレイアウト
12
+ *
13
+ * - 子要素を均等に配置する
14
+ */
15
+ const balance = (options = {}) => {
16
+ const { direction, alignX, alignY, adjustX, adjustY, spacing, spacingX, spacingY, childSizeX, childSizeY } = maybeDefault(options, {
17
+ direction: "x",
18
+ alignX: "left",
19
+ alignY: "top"
20
+ }, { overwriteNull: true });
21
+ const result = {
22
+ className: clsx(clsLayoutBalance, clsLayoutDirection[direction], clsLayoutAlign.x[alignX], clsLayoutAlign.y[alignY], clsLayoutAdjust.x[adjustX], clsLayoutAdjust.y[adjustY]),
23
+ style: {}
24
+ };
25
+ applySpacing(result, spacing, spacingX, spacingY);
26
+ applyChildSize(result, childSizeX, childSizeY);
27
+ return result;
28
+ };
29
+
30
+ //#endregion
31
+ export { balance as default };
@@ -0,0 +1,3 @@
1
+ const require_balance_balance = require('./balance.cjs');
2
+
3
+ module.exports = require_balance_balance;
@@ -0,0 +1,3 @@
1
+ import { BalanceLayoutOptions } from "./types.cjs";
2
+ import balance from "./balance.cjs";
3
+ export { BalanceLayoutOptions, balance as default };
@@ -0,0 +1,3 @@
1
+ import { BalanceLayoutOptions } from "./types.mjs";
2
+ import balance from "./balance.mjs";
3
+ export { BalanceLayoutOptions, balance as default };
@@ -0,0 +1,3 @@
1
+ import balance from "./balance.mjs";
2
+
3
+ export { balance as default };
@@ -0,0 +1,109 @@
1
+ .nws-layout-balance {
2
+ --nws-layout-spacingX: 0px;
3
+ --nws-layout-spacingY: 0px;
4
+ --nws-layout-childSizeX: auto;
5
+ --nws-layout-childSizeY: auto;
6
+ display: grid;
7
+ }
8
+ .nws-layout-balance.nws-layout-spacingX {
9
+ column-gap: var(--nws-layout-spacingX);
10
+ }
11
+ .nws-layout-balance.nws-layout-spacingY {
12
+ row-gap: var(--nws-layout-spacingY);
13
+ }
14
+ .nws-layout-balance.nws-layout-direction-x {
15
+ grid-auto-flow: column;
16
+ }
17
+ .nws-layout-balance.nws-layout-direction-y {
18
+ grid-auto-flow: row;
19
+ }
20
+ .nws-layout-balance.nws-layout-alignX-left {
21
+ justify-items: flex-start;
22
+ }
23
+ .nws-layout-balance.nws-layout-alignX-center {
24
+ justify-items: center;
25
+ }
26
+ .nws-layout-balance.nws-layout-alignX-right {
27
+ justify-items: flex-end;
28
+ }
29
+ .nws-layout-balance.nws-layout-alignX-spaceBetween {
30
+ justify-items: space-between;
31
+ }
32
+ .nws-layout-balance.nws-layout-alignX-spaceAround {
33
+ justify-items: space-around;
34
+ }
35
+ .nws-layout-balance.nws-layout-alignX-spaceEvenly {
36
+ justify-items: space-evenly;
37
+ }
38
+ .nws-layout-balance.nws-layout-alignY-top {
39
+ align-items: flex-start;
40
+ }
41
+ .nws-layout-balance.nws-layout-alignY-middle {
42
+ align-items: center;
43
+ }
44
+ .nws-layout-balance.nws-layout-alignY-bottom {
45
+ align-items: flex-end;
46
+ }
47
+ .nws-layout-balance.nws-layout-alignY-spaceBetween {
48
+ align-items: space-between;
49
+ }
50
+ .nws-layout-balance.nws-layout-alignY-spaceAround {
51
+ align-items: space-around;
52
+ }
53
+ .nws-layout-balance.nws-layout-alignY-spaceEvenly {
54
+ align-items: space-evenly;
55
+ }
56
+ .nws-layout-balance > * {
57
+ min-width: 0;
58
+ }
59
+ .nws-layout-balance.nws-layout-childSizeX > * {
60
+ width: var(--nws-layout-childSizeX);
61
+ }
62
+ .nws-layout-balance.nws-layout-adjustX-fit {
63
+ justify-items: stretch;
64
+ }
65
+ .nws-layout-balance.nws-layout-adjustX-fit > * {
66
+ width: auto;
67
+ }
68
+ .nws-layout-balance.nws-layout-adjustX-fit.nws-layout-childSizeX > * {
69
+ width: auto;
70
+ }
71
+ .nws-layout-balance.nws-layout-adjustX-grow > * {
72
+ width: 100%;
73
+ }
74
+ .nws-layout-balance.nws-layout-adjustX-grow.nws-layout-childSizeX > * {
75
+ min-width: var(--nws-layout-childSizeX);
76
+ }
77
+ .nws-layout-balance.nws-layout-adjustX-shrink > * {
78
+ width: 100%;
79
+ }
80
+ .nws-layout-balance.nws-layout-adjustX-shrink.nws-layout-childSizeX > * {
81
+ max-width: var(--nws-layout-childSizeX);
82
+ }
83
+ .nws-layout-balance > * {
84
+ min-height: 0;
85
+ }
86
+ .nws-layout-balance.nws-layout-childSizeY > * {
87
+ height: var(--nws-layout-childSizeY);
88
+ }
89
+ .nws-layout-balance.nws-layout-adjustY-fit {
90
+ align-items: stretch;
91
+ }
92
+ .nws-layout-balance.nws-layout-adjustY-fit > * {
93
+ height: auto;
94
+ }
95
+ .nws-layout-balance.nws-layout-adjustY-fit.nws-layout-childSizeY > * {
96
+ height: auto;
97
+ }
98
+ .nws-layout-balance.nws-layout-adjustY-grow > * {
99
+ height: 100%;
100
+ }
101
+ .nws-layout-balance.nws-layout-adjustY-grow.nws-layout-childSizeY > * {
102
+ min-height: var(--nws-layout-childSizeY);
103
+ }
104
+ .nws-layout-balance.nws-layout-adjustY-shrink > * {
105
+ height: 100%;
106
+ }
107
+ .nws-layout-balance.nws-layout-adjustY-shrink.nws-layout-childSizeY > * {
108
+ max-height: var(--nws-layout-childSizeY);
109
+ }
File without changes
@@ -0,0 +1,6 @@
1
+ import { AdjustOptions, AlignOptions, ChildSizeOptions, DirectionOptions, SpacingOptions } from "../_types.cjs";
2
+
3
+ //#region src/balance/types.d.ts
4
+ type BalanceLayoutOptions = AdjustOptions & AlignOptions & ChildSizeOptions & DirectionOptions & SpacingOptions;
5
+ //#endregion
6
+ export { BalanceLayoutOptions };
@@ -0,0 +1,6 @@
1
+ import { AdjustOptions, AlignOptions, ChildSizeOptions, DirectionOptions, SpacingOptions } from "../_types.mjs";
2
+
3
+ //#region src/balance/types.d.ts
4
+ type BalanceLayoutOptions = AdjustOptions & AlignOptions & ChildSizeOptions & DirectionOptions & SpacingOptions;
5
+ //#endregion
6
+ export { BalanceLayoutOptions };
@@ -0,0 +1 @@
1
+ export { };