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