@octaviaflow/layout 1.0.0 → 1.0.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@octaviaflow/layout",
3
3
  "description": "Layout helpers for digital and software products using the Carbon Design System",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -31,10 +31,10 @@
31
31
  "devDependencies": {
32
32
  "@babel/core": "^7.28.6",
33
33
  "@babel/preset-env": "^7.28.6",
34
- "@octaviaflow/cli": "^1.0.0",
35
- "@octaviaflow/cli-reporter": "^1.0.0",
34
+ "@octaviaflow/cli": "^1.5.2",
35
+ "@octaviaflow/cli-reporter": "^1.0.1",
36
36
  "@octaviaflow/scss-generator": "^1.0.0",
37
- "@octaviaflow/telemetry": "^1.0.0",
37
+ "@octaviaflow/telemetry": "^1.1.2",
38
38
  "@octaviaflow/test-utils": "^1.0.0",
39
39
  "core-js": "^3.16.0",
40
40
  "fs-extra": "^11.3.3",
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright OctaviaFlow. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @jest-environment node
8
+ */
9
+
10
+ import { unstable_tokens as tokens } from '../tokens';
11
+ import * as Layout from '../';
12
+
13
+ describe('@octaviaflow/layout tokens', () => {
14
+ test.each(tokens)('%s should be exported', (token) => {
15
+ expect(Layout[token]).toBeDefined();
16
+ });
17
+ });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright OctaviaFlow. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @jest-environment node
8
+ */
9
+
10
+ import { unstable_tokens as tokens } from '../tokens';
11
+ import * as Layout from '../';
12
+
13
+ describe('@octaviaflow/layout tokens', () => {
14
+ test.each(tokens)('%s should be exported', (token) => {
15
+ expect(Layout[token]).toBeDefined();
16
+ });
17
+ });
package/lib/index.js DELETED
@@ -1,226 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- /**
6
- * Copyright OctaviaFlow
7
- * Author: Vishal Kumar
8
- * Created: 11/November/2025
9
- *
10
- * This source code is licensed under the Apache-2.0 license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- */
13
-
14
- var unstable_tokens = [
15
- // Spacing
16
- 'spacing01', 'spacing02', 'spacing03', 'spacing04', 'spacing05', 'spacing06', 'spacing07', 'spacing08', 'spacing09', 'spacing10', 'spacing11', 'spacing12', 'spacing13',
17
- // Fluid spacing
18
- 'fluidSpacing01', 'fluidSpacing02', 'fluidSpacing03', 'fluidSpacing04',
19
- // Containers
20
- 'container01', 'container02', 'container03', 'container04', 'container05', 'sizeXSmall', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'sizeXLarge', 'size2XLarge',
21
- // Icon sizes
22
- 'iconSize01', 'iconSize02',
23
- // Layout
24
- // Deprecated
25
- 'layout01', 'layout02', 'layout03', 'layout04', 'layout05', 'layout06', 'layout07'];
26
-
27
- /**
28
- * Copyright OctaviaFlow
29
- * Author: Vishal Kumar
30
- * Created: 11/November/2025
31
- *
32
- * This source code is licensed under the Apache-2.0 license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */
35
-
36
- // Convert
37
- // Default, Use with em() and rem() functions
38
- var baseFontSize = 16;
39
-
40
- /**
41
- * Convert a given px unit to a rem unit
42
- * @param {number} px
43
- * @returns {string}
44
- */
45
- function rem(px) {
46
- return "".concat(px / baseFontSize, "rem");
47
- }
48
-
49
- /**
50
- * Convert a given px unit to a em unit
51
- * @param {number} px
52
- * @returns {string}
53
- */
54
- function em(px) {
55
- return "".concat(px / baseFontSize, "em");
56
- }
57
-
58
- /**
59
- * Convert a given px unit to its string representation
60
- * @param {number} value - number of pixels
61
- * @returns {string}
62
- */
63
- function px(value) {
64
- return "".concat(value, "px");
65
- }
66
-
67
- // Breakpoint
68
- // Initial map of our breakpoints and their values
69
- var breakpoints = {
70
- sm: {
71
- width: rem(320),
72
- columns: 4,
73
- margin: '0'
74
- },
75
- md: {
76
- width: rem(672),
77
- columns: 8,
78
- margin: rem(16)
79
- },
80
- lg: {
81
- width: rem(1056),
82
- columns: 16,
83
- margin: rem(16)
84
- },
85
- xlg: {
86
- width: rem(1312),
87
- columns: 16,
88
- margin: rem(16)
89
- },
90
- max: {
91
- width: rem(1584),
92
- columns: 16,
93
- margin: rem(24)
94
- }
95
- };
96
- function breakpointUp(name) {
97
- return "@media (min-width: ".concat(breakpoints[name].width, ")");
98
- }
99
- function breakpointDown(name) {
100
- return "@media (max-width: ".concat(breakpoints[name].width, ")");
101
- }
102
- function breakpoint() {
103
- return breakpointUp.apply(void 0, arguments);
104
- }
105
-
106
- // Mini-unit
107
- var miniUnit = 8;
108
- function miniUnits(count) {
109
- return rem(miniUnit * count);
110
- }
111
-
112
- // Spacing
113
- var spacing01 = miniUnits(0.25);
114
- var spacing02 = miniUnits(0.5);
115
- var spacing03 = miniUnits(1);
116
- var spacing04 = miniUnits(1.5);
117
- var spacing05 = miniUnits(2);
118
- var spacing06 = miniUnits(3);
119
- var spacing07 = miniUnits(4);
120
- var spacing08 = miniUnits(5);
121
- var spacing09 = miniUnits(6);
122
- var spacing10 = miniUnits(8);
123
- var spacing11 = miniUnits(10);
124
- var spacing12 = miniUnits(12);
125
- var spacing13 = miniUnits(20);
126
- var spacing = [spacing01, spacing02, spacing03, spacing04, spacing05, spacing06, spacing07, spacing08, spacing09, spacing10, spacing11, spacing12, spacing13];
127
-
128
- // Fluid spacing
129
- var fluidSpacing01 = 0;
130
- var fluidSpacing02 = '2vw';
131
- var fluidSpacing03 = '5vw';
132
- var fluidSpacing04 = '10vw';
133
- var fluidSpacing = [fluidSpacing01, fluidSpacing02, fluidSpacing03, fluidSpacing04];
134
-
135
- // Layout
136
- // Deprecated
137
- var layout01 = miniUnits(2);
138
- var layout02 = miniUnits(3);
139
- var layout03 = miniUnits(4);
140
- var layout04 = miniUnits(6);
141
- var layout05 = miniUnits(8);
142
- var layout06 = miniUnits(12);
143
- var layout07 = miniUnits(20);
144
- var layout = [layout01, layout02, layout03, layout04, layout05, layout06, layout07];
145
-
146
- // Container
147
- var container01 = miniUnits(3);
148
- var container02 = miniUnits(4);
149
- var container03 = miniUnits(5);
150
- var container04 = miniUnits(6);
151
- var container05 = miniUnits(8);
152
- var container = [container01, container02, container03, container04, container05];
153
- var sizeXSmall = rem(24);
154
- var sizeSmall = rem(32);
155
- var sizeMedium = rem(40);
156
- var sizeLarge = rem(48);
157
- var sizeXLarge = rem(64);
158
- var size2XLarge = rem(80);
159
- var sizes = {
160
- XSmall: sizeXSmall,
161
- Small: sizeSmall,
162
- Medium: sizeMedium,
163
- Large: sizeLarge,
164
- XLarge: sizeXLarge,
165
- '2XLarge': size2XLarge
166
- };
167
-
168
- // Icon
169
- var iconSize01 = '1rem';
170
- var iconSize02 = '1.25rem';
171
- var iconSize = [iconSize01, iconSize02];
172
-
173
- exports.baseFontSize = baseFontSize;
174
- exports.breakpoint = breakpoint;
175
- exports.breakpointDown = breakpointDown;
176
- exports.breakpointUp = breakpointUp;
177
- exports.breakpoints = breakpoints;
178
- exports.container = container;
179
- exports.container01 = container01;
180
- exports.container02 = container02;
181
- exports.container03 = container03;
182
- exports.container04 = container04;
183
- exports.container05 = container05;
184
- exports.em = em;
185
- exports.fluidSpacing = fluidSpacing;
186
- exports.fluidSpacing01 = fluidSpacing01;
187
- exports.fluidSpacing02 = fluidSpacing02;
188
- exports.fluidSpacing03 = fluidSpacing03;
189
- exports.fluidSpacing04 = fluidSpacing04;
190
- exports.iconSize = iconSize;
191
- exports.iconSize01 = iconSize01;
192
- exports.iconSize02 = iconSize02;
193
- exports.layout = layout;
194
- exports.layout01 = layout01;
195
- exports.layout02 = layout02;
196
- exports.layout03 = layout03;
197
- exports.layout04 = layout04;
198
- exports.layout05 = layout05;
199
- exports.layout06 = layout06;
200
- exports.layout07 = layout07;
201
- exports.miniUnit = miniUnit;
202
- exports.miniUnits = miniUnits;
203
- exports.px = px;
204
- exports.rem = rem;
205
- exports.size2XLarge = size2XLarge;
206
- exports.sizeLarge = sizeLarge;
207
- exports.sizeMedium = sizeMedium;
208
- exports.sizeSmall = sizeSmall;
209
- exports.sizeXLarge = sizeXLarge;
210
- exports.sizeXSmall = sizeXSmall;
211
- exports.sizes = sizes;
212
- exports.spacing = spacing;
213
- exports.spacing01 = spacing01;
214
- exports.spacing02 = spacing02;
215
- exports.spacing03 = spacing03;
216
- exports.spacing04 = spacing04;
217
- exports.spacing05 = spacing05;
218
- exports.spacing06 = spacing06;
219
- exports.spacing07 = spacing07;
220
- exports.spacing08 = spacing08;
221
- exports.spacing09 = spacing09;
222
- exports.spacing10 = spacing10;
223
- exports.spacing11 = spacing11;
224
- exports.spacing12 = spacing12;
225
- exports.spacing13 = spacing13;
226
- exports.unstable_tokens = unstable_tokens;