server-time-timer-yolabs-ui 1.0.15 → 1.0.16
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.
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
/**
|
|
5
|
-
* Mapping for layout-specific spacing.
|
|
6
|
-
* Using rem values consistent with the eth-type-engine scale.
|
|
7
|
-
*/
|
|
8
4
|
const gapMap = {
|
|
9
|
-
horizontal: '0.
|
|
10
|
-
vertical: '0.
|
|
5
|
+
horizontal: '0.75rem',
|
|
6
|
+
vertical: '0.5rem',
|
|
11
7
|
compact: '0.25rem',
|
|
12
8
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
sm: 'eth-text-body-sm',
|
|
18
|
-
md: 'eth-text-body-md',
|
|
19
|
-
lg: 'eth-text-body-lg',
|
|
20
|
-
};
|
|
21
|
-
const TimerContainer = ({ children, size = 'md', className = '', background = '#ffffff', color = '#323130', layout = 'horizontal', }) => {
|
|
22
|
-
// Define layout styles without manual casting by typing the Record
|
|
9
|
+
const TimerContainer = ({ children, size = 'md', className = '', background = '#ffffff', // SharePoint White
|
|
10
|
+
color = '#323130', // SharePoint Neutral Primary
|
|
11
|
+
layout = 'horizontal', }) => {
|
|
12
|
+
// Flex layout logic
|
|
23
13
|
const flexLayouts = {
|
|
24
14
|
horizontal: { flexDirection: 'row', flexWrap: 'nowrap' },
|
|
25
15
|
vertical: { flexDirection: 'column', flexWrap: 'nowrap' },
|
|
26
16
|
compact: { flexDirection: 'row', flexWrap: 'wrap' },
|
|
27
17
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Directly applying your eth-type-engine settings based on size
|
|
20
|
+
* sm: 11px/12px, md: 13px/14px, lg: 15px/16px
|
|
21
|
+
*/
|
|
22
|
+
const getTypographyStyles = () => {
|
|
23
|
+
if (size === 'sm')
|
|
24
|
+
return { fontSize: '11px', fontWeight: 400, lineHeight: 1.4 };
|
|
25
|
+
if (size === 'lg')
|
|
26
|
+
return { fontSize: '15px', fontWeight: 400, lineHeight: 1.5 };
|
|
27
|
+
return { fontSize: '13px', fontWeight: 400, lineHeight: 1.5 }; // Default md
|
|
28
|
+
};
|
|
29
|
+
const containerStyles = Object.assign(Object.assign(Object.assign(Object.assign({
|
|
30
|
+
// Layout
|
|
31
|
+
display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%', boxSizing: 'border-box', gap: gapMap[layout] }, flexLayouts[layout]), {
|
|
32
|
+
// SharePoint Visual Identity
|
|
33
|
+
backgroundColor: background, color: color, border: '1px solid #edebe9', borderRadius: '2px', padding: size === 'sm' ? '8px' : size === 'md' ? '12px' : '16px' }), getTypographyStyles()), { fontFamily: '"Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif',
|
|
34
|
+
// Polish
|
|
35
|
+
transition: 'all 0.2s ease-in-out', overflow: 'hidden' });
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `timer-container ${className}`.trim(), style: containerStyles, role: "timer", "aria-label": "timer container", children: children }));
|
|
36
37
|
};
|
|
37
38
|
exports.default = TimerContainer;
|
|
@@ -1,45 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
4
|
+
const TimerUnit = ({ label, value, size = 'md', background = '#f3f2f1', // SharePoint NeutralLighter
|
|
5
|
+
color = '#323130', // SharePoint NeutralPrimary
|
|
6
|
+
numberSize = 'md', }) => {
|
|
7
|
+
/**
|
|
8
|
+
* Label Typography - Based on your Engine Body Options
|
|
9
|
+
* sm: 11px, md: 13px, lg: 15px
|
|
10
|
+
*/
|
|
11
|
+
const getLabelStyles = () => {
|
|
12
|
+
if (size === 'sm')
|
|
13
|
+
return { fontSize: '11px', lineHeight: 1.4, fontWeight: 400 };
|
|
14
|
+
if (size === 'lg')
|
|
15
|
+
return { fontSize: '15px', lineHeight: 1.5, fontWeight: 400 };
|
|
16
|
+
return { fontSize: '13px', lineHeight: 1.5, fontWeight: 400 }; // Default md
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Number Typography - Based on your Engine Title/Heading Options
|
|
20
|
+
* sm (Heading): 18px, md (Title): 24px, lg (Hero): 32px
|
|
21
|
+
*/
|
|
22
|
+
const getNumberStyles = () => {
|
|
23
|
+
if (numberSize === 'sm')
|
|
24
|
+
return { fontSize: '18px', fontWeight: 600, lineHeight: 1.4 };
|
|
25
|
+
if (numberSize === 'lg')
|
|
26
|
+
return { fontSize: '32px', fontWeight: 700, lineHeight: 1.2 };
|
|
27
|
+
return { fontSize: '24px', fontWeight: 600, lineHeight: 1.3 }; // Default md (Title)
|
|
28
|
+
};
|
|
29
|
+
const containerStyles = {
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flexDirection: 'column',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
backgroundColor: background,
|
|
35
|
+
color: color,
|
|
36
|
+
// SharePoint Style: Subtle rounding and very light border
|
|
37
|
+
borderRadius: '2px',
|
|
38
|
+
border: '1px solid #edebe9',
|
|
39
|
+
// Spacing
|
|
40
|
+
padding: size === 'sm' ? '4px 8px' : size === 'md' ? '8px 12px' : '12px 16px',
|
|
41
|
+
minWidth: size === 'sm' ? '48px' : size === 'md' ? '64px' : '80px',
|
|
42
|
+
// Visuals
|
|
43
|
+
boxShadow: '0 1.6px 3.6px 0 rgba(0,0,0,0.132), 0 0.3px 0.9px 0 rgba(0,0,0,0.108)', // Fluent Depth
|
|
44
|
+
transition: 'transform 0.1s ease, box-shadow 0.1s ease',
|
|
45
|
+
boxSizing: 'border-box',
|
|
46
|
+
fontFamily: '"Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, sans-serif',
|
|
47
|
+
};
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: containerStyles, className: "timer-unit", children: [(0, jsx_runtime_1.jsx)("span", { style: Object.assign(Object.assign({}, getNumberStyles()), { display: 'block' }), children: value.toString().padStart(2, '0') }), (0, jsx_runtime_1.jsx)("span", { style: Object.assign(Object.assign({}, getLabelStyles()), { marginTop: '2px', textTransform: 'lowercase', opacity: 0.8, whiteSpace: 'nowrap' }), children: label })] }));
|
|
44
49
|
};
|
|
45
50
|
exports.default = TimerUnit;
|
package/package.json
CHANGED