@trafilea/afrodita-components 5.0.0-beta.4 → 5.0.0-beta.5
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/build/index.d.ts +4 -4
- package/build/index.esm.js +8 -8
- package/build/index.js +8 -8
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -491,16 +491,16 @@ interface SizeSelectorProps {
|
|
|
491
491
|
selectedValue: SizeOption;
|
|
492
492
|
onChange: (size: SizeOption) => void;
|
|
493
493
|
inline?: boolean;
|
|
494
|
+
width?: string;
|
|
494
495
|
}
|
|
495
|
-
declare const SizeSelector: ({ label, sizes, selectedValue, onChange, inline, }: SizeSelectorProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
496
|
+
declare const SizeSelector: ({ label, sizes, selectedValue, onChange, inline, width, }: SizeSelectorProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
496
497
|
|
|
497
498
|
interface SizeFitGuideProps {
|
|
498
499
|
title: string;
|
|
499
|
-
|
|
500
|
-
fitPercentage: number;
|
|
500
|
+
fitPercentage?: number;
|
|
501
501
|
onClick: () => void;
|
|
502
502
|
}
|
|
503
|
-
declare const SizeFitGuide: ({ title,
|
|
503
|
+
declare const SizeFitGuide: ({ title, fitPercentage, onClick }: SizeFitGuideProps) => JSX.Element;
|
|
504
504
|
|
|
505
505
|
interface BaseButtonProps {
|
|
506
506
|
children: React.ReactNode;
|
package/build/index.esm.js
CHANGED
|
@@ -4008,13 +4008,13 @@ var getStylesBySize$8 = function (size, theme) {
|
|
|
4008
4008
|
}
|
|
4009
4009
|
};
|
|
4010
4010
|
var SimpleSelector = function (_a) {
|
|
4011
|
-
var text = _a.text, className = _a.className, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? ComponentSize.Medium : _c, _d = _a.active, active = _d === void 0 ? false : _d, _e = _a.testId, testId = _e === void 0 ? 'base-button' : _e, onClick = _a.onClick;
|
|
4011
|
+
var text = _a.text, className = _a.className, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? ComponentSize.Medium : _c, _d = _a.active, active = _d === void 0 ? false : _d, _e = _a.testId, testId = _e === void 0 ? 'base-button' : _e, _f = _a.width, width = _f === void 0 ? '' : _f, onClick = _a.onClick;
|
|
4012
4012
|
var theme = useTheme();
|
|
4013
4013
|
var stylesBySize = getStylesBySize$8(size, theme);
|
|
4014
4014
|
var activeStyles = active
|
|
4015
4015
|
? { fontWeight: theme.component.selector.hover.fontWeight }
|
|
4016
4016
|
: { fontWeight: theme.component.selector.default.fontWeight };
|
|
4017
|
-
return (jsx(BaseButton, __assign$1({ onClick: onClick, disabled: disabled, className: className, type: "button", testId: testId, css: __assign$1(__assign$1(__assign$1({}, stylesBySize), activeStyles), { boxSizing: 'border-box', fontSize: theme.component.selector.fontSize, '&:hover': {
|
|
4017
|
+
return (jsx(BaseButton, __assign$1({ onClick: onClick, disabled: disabled, className: className, type: "button", testId: testId, css: __assign$1(__assign$1(__assign$1({}, stylesBySize), activeStyles), { width: width, boxSizing: 'border-box', fontSize: theme.component.selector.fontSize, '&:hover': {
|
|
4018
4018
|
fontWeight: theme.component.selector.hover.fontWeight,
|
|
4019
4019
|
}, '&:disabled': {
|
|
4020
4020
|
color: theme.colors.shades['250'].color,
|
|
@@ -4023,7 +4023,7 @@ var SimpleSelector = function (_a) {
|
|
|
4023
4023
|
};
|
|
4024
4024
|
|
|
4025
4025
|
var SelectorSecondary = function (_a) {
|
|
4026
|
-
var text = _a.text, size = _a.size, disabled = _a.disabled, active = _a.active, className = _a.className, testId = _a.testId, onClick = _a.onClick;
|
|
4026
|
+
var text = _a.text, size = _a.size, disabled = _a.disabled, active = _a.active, className = _a.className, testId = _a.testId, width = _a.width, onClick = _a.onClick;
|
|
4027
4027
|
var theme = useTheme();
|
|
4028
4028
|
var stylesByActive = active
|
|
4029
4029
|
? {
|
|
@@ -4038,7 +4038,7 @@ var SelectorSecondary = function (_a) {
|
|
|
4038
4038
|
border: theme.component.selector.default.border,
|
|
4039
4039
|
fontWeight: theme.component.selector.default.fontWeight,
|
|
4040
4040
|
};
|
|
4041
|
-
return (jsx(SimpleSelector, { text: text, size: size, onClick: onClick, className: className, disabled: disabled, testId: testId, css: __assign$1(__assign$1({}, stylesByActive), { whiteSpace: 'nowrap', '&:hover': {
|
|
4041
|
+
return (jsx(SimpleSelector, { text: text, size: size, onClick: onClick, className: className, disabled: disabled, testId: testId, width: width, css: __assign$1(__assign$1({}, stylesByActive), { whiteSpace: 'nowrap', '&:hover': {
|
|
4042
4042
|
background: theme.component.selector.hover.background,
|
|
4043
4043
|
color: theme.component.selector.hover.color,
|
|
4044
4044
|
}, '&:disabled': {
|
|
@@ -4181,7 +4181,7 @@ var ButtonsContainer = newStyled.div(templateObject_1$10 || (templateObject_1$10
|
|
|
4181
4181
|
return (inline ? '0 0 0 10px' : '8px 0 0 0');
|
|
4182
4182
|
});
|
|
4183
4183
|
var SizeSelector = function (_a) {
|
|
4184
|
-
var label = _a.label, sizes = _a.sizes, selectedValue = _a.selectedValue, onChange = _a.onChange, _b = _a.inline, inline = _b === void 0 ? false : _b;
|
|
4184
|
+
var label = _a.label, sizes = _a.sizes, selectedValue = _a.selectedValue, onChange = _a.onChange, _b = _a.inline, inline = _b === void 0 ? false : _b, width = _a.width;
|
|
4185
4185
|
return (jsxs("div", __assign$1({ css: {
|
|
4186
4186
|
display: 'flex',
|
|
4187
4187
|
flexDirection: inline ? 'row' : 'column',
|
|
@@ -4191,7 +4191,7 @@ var SizeSelector = function (_a) {
|
|
|
4191
4191
|
return (jsx(SelectorSecondary, { css: {
|
|
4192
4192
|
padding: '0.75rem 1rem 0.625rem',
|
|
4193
4193
|
margin: '0 0.5rem 0.625rem 0',
|
|
4194
|
-
}, size: ComponentSize.Medium, text: size.label, active: active, disabled: size.disabled, onClick: function () { return onChange(size); }, testId: "size-variant-".concat(size.label.split('/')[0]) }, size.label));
|
|
4194
|
+
}, size: ComponentSize.Medium, text: size.label, active: active, disabled: size.disabled, onClick: function () { return onChange(size); }, testId: "size-variant-".concat(size.label.split('/')[0]), width: width }, size.label));
|
|
4195
4195
|
}) }), void 0)] }), void 0));
|
|
4196
4196
|
};
|
|
4197
4197
|
var templateObject_1$10;
|
|
@@ -4245,8 +4245,8 @@ var Container$E = newStyled.div(templateObject_1$_ || (templateObject_1$_ = __ma
|
|
|
4245
4245
|
var P$3 = newStyled.p(templateObject_2$D || (templateObject_2$D = __makeTemplateObject(["\n margin: 0;\n"], ["\n margin: 0;\n"])));
|
|
4246
4246
|
var PercentageSpan = newStyled.span(templateObject_3$o || (templateObject_3$o = __makeTemplateObject(["\n font-weight: 700;\n text-decoration-line: underline;\n"], ["\n font-weight: 700;\n text-decoration-line: underline;\n"])));
|
|
4247
4247
|
var SizeFitGuide = function (_a) {
|
|
4248
|
-
var title = _a.title,
|
|
4249
|
-
return (jsxs$1(Container$E, { children: [jsx$1(TextButton, { LeadingIcon: Icon.PDP.Rule, size: ComponentSize.Small, text: title, onClick: onClick }, void 0), jsxs$1(P$3, { children: [
|
|
4248
|
+
var title = _a.title, fitPercentage = _a.fitPercentage, onClick = _a.onClick;
|
|
4249
|
+
return (jsxs$1(Container$E, { children: [jsx$1(TextButton, { LeadingIcon: Icon.PDP.Rule, size: ComponentSize.Small, text: title, onClick: onClick }, void 0), !!fitPercentage && (jsxs$1(P$3, { children: ["Fit As Expected: ", jsxs$1(PercentageSpan, { children: [fitPercentage, "%"] }, void 0)] }, void 0))] }, void 0));
|
|
4250
4250
|
};
|
|
4251
4251
|
var templateObject_1$_, templateObject_2$D, templateObject_3$o;
|
|
4252
4252
|
|
package/build/index.js
CHANGED
|
@@ -4034,13 +4034,13 @@ var getStylesBySize$8 = function (size, theme) {
|
|
|
4034
4034
|
}
|
|
4035
4035
|
};
|
|
4036
4036
|
var SimpleSelector = function (_a) {
|
|
4037
|
-
var text = _a.text, className = _a.className, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? exports.ComponentSize.Medium : _c, _d = _a.active, active = _d === void 0 ? false : _d, _e = _a.testId, testId = _e === void 0 ? 'base-button' : _e, onClick = _a.onClick;
|
|
4037
|
+
var text = _a.text, className = _a.className, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? exports.ComponentSize.Medium : _c, _d = _a.active, active = _d === void 0 ? false : _d, _e = _a.testId, testId = _e === void 0 ? 'base-button' : _e, _f = _a.width, width = _f === void 0 ? '' : _f, onClick = _a.onClick;
|
|
4038
4038
|
var theme = useTheme();
|
|
4039
4039
|
var stylesBySize = getStylesBySize$8(size, theme);
|
|
4040
4040
|
var activeStyles = active
|
|
4041
4041
|
? { fontWeight: theme.component.selector.hover.fontWeight }
|
|
4042
4042
|
: { fontWeight: theme.component.selector.default.fontWeight };
|
|
4043
|
-
return (jsx(BaseButton, __assign$1({ onClick: onClick, disabled: disabled, className: className, type: "button", testId: testId, css: __assign$1(__assign$1(__assign$1({}, stylesBySize), activeStyles), { boxSizing: 'border-box', fontSize: theme.component.selector.fontSize, '&:hover': {
|
|
4043
|
+
return (jsx(BaseButton, __assign$1({ onClick: onClick, disabled: disabled, className: className, type: "button", testId: testId, css: __assign$1(__assign$1(__assign$1({}, stylesBySize), activeStyles), { width: width, boxSizing: 'border-box', fontSize: theme.component.selector.fontSize, '&:hover': {
|
|
4044
4044
|
fontWeight: theme.component.selector.hover.fontWeight,
|
|
4045
4045
|
}, '&:disabled': {
|
|
4046
4046
|
color: theme.colors.shades['250'].color,
|
|
@@ -4049,7 +4049,7 @@ var SimpleSelector = function (_a) {
|
|
|
4049
4049
|
};
|
|
4050
4050
|
|
|
4051
4051
|
var SelectorSecondary = function (_a) {
|
|
4052
|
-
var text = _a.text, size = _a.size, disabled = _a.disabled, active = _a.active, className = _a.className, testId = _a.testId, onClick = _a.onClick;
|
|
4052
|
+
var text = _a.text, size = _a.size, disabled = _a.disabled, active = _a.active, className = _a.className, testId = _a.testId, width = _a.width, onClick = _a.onClick;
|
|
4053
4053
|
var theme = useTheme();
|
|
4054
4054
|
var stylesByActive = active
|
|
4055
4055
|
? {
|
|
@@ -4064,7 +4064,7 @@ var SelectorSecondary = function (_a) {
|
|
|
4064
4064
|
border: theme.component.selector.default.border,
|
|
4065
4065
|
fontWeight: theme.component.selector.default.fontWeight,
|
|
4066
4066
|
};
|
|
4067
|
-
return (jsx(SimpleSelector, { text: text, size: size, onClick: onClick, className: className, disabled: disabled, testId: testId, css: __assign$1(__assign$1({}, stylesByActive), { whiteSpace: 'nowrap', '&:hover': {
|
|
4067
|
+
return (jsx(SimpleSelector, { text: text, size: size, onClick: onClick, className: className, disabled: disabled, testId: testId, width: width, css: __assign$1(__assign$1({}, stylesByActive), { whiteSpace: 'nowrap', '&:hover': {
|
|
4068
4068
|
background: theme.component.selector.hover.background,
|
|
4069
4069
|
color: theme.component.selector.hover.color,
|
|
4070
4070
|
}, '&:disabled': {
|
|
@@ -4207,7 +4207,7 @@ var ButtonsContainer = newStyled.div(templateObject_1$10 || (templateObject_1$10
|
|
|
4207
4207
|
return (inline ? '0 0 0 10px' : '8px 0 0 0');
|
|
4208
4208
|
});
|
|
4209
4209
|
var SizeSelector = function (_a) {
|
|
4210
|
-
var label = _a.label, sizes = _a.sizes, selectedValue = _a.selectedValue, onChange = _a.onChange, _b = _a.inline, inline = _b === void 0 ? false : _b;
|
|
4210
|
+
var label = _a.label, sizes = _a.sizes, selectedValue = _a.selectedValue, onChange = _a.onChange, _b = _a.inline, inline = _b === void 0 ? false : _b, width = _a.width;
|
|
4211
4211
|
return (jsxs("div", __assign$1({ css: {
|
|
4212
4212
|
display: 'flex',
|
|
4213
4213
|
flexDirection: inline ? 'row' : 'column',
|
|
@@ -4217,7 +4217,7 @@ var SizeSelector = function (_a) {
|
|
|
4217
4217
|
return (jsx(SelectorSecondary, { css: {
|
|
4218
4218
|
padding: '0.75rem 1rem 0.625rem',
|
|
4219
4219
|
margin: '0 0.5rem 0.625rem 0',
|
|
4220
|
-
}, size: exports.ComponentSize.Medium, text: size.label, active: active, disabled: size.disabled, onClick: function () { return onChange(size); }, testId: "size-variant-".concat(size.label.split('/')[0]) }, size.label));
|
|
4220
|
+
}, size: exports.ComponentSize.Medium, text: size.label, active: active, disabled: size.disabled, onClick: function () { return onChange(size); }, testId: "size-variant-".concat(size.label.split('/')[0]), width: width }, size.label));
|
|
4221
4221
|
}) }), void 0)] }), void 0));
|
|
4222
4222
|
};
|
|
4223
4223
|
var templateObject_1$10;
|
|
@@ -4271,8 +4271,8 @@ var Container$E = newStyled.div(templateObject_1$_ || (templateObject_1$_ = __ma
|
|
|
4271
4271
|
var P$3 = newStyled.p(templateObject_2$D || (templateObject_2$D = __makeTemplateObject(["\n margin: 0;\n"], ["\n margin: 0;\n"])));
|
|
4272
4272
|
var PercentageSpan = newStyled.span(templateObject_3$o || (templateObject_3$o = __makeTemplateObject(["\n font-weight: 700;\n text-decoration-line: underline;\n"], ["\n font-weight: 700;\n text-decoration-line: underline;\n"])));
|
|
4273
4273
|
var SizeFitGuide = function (_a) {
|
|
4274
|
-
var title = _a.title,
|
|
4275
|
-
return (jsxRuntime.jsxs(Container$E, { children: [jsxRuntime.jsx(TextButton, { LeadingIcon: Icon.PDP.Rule, size: exports.ComponentSize.Small, text: title, onClick: onClick }, void 0), jsxRuntime.jsxs(P$3, { children: [
|
|
4274
|
+
var title = _a.title, fitPercentage = _a.fitPercentage, onClick = _a.onClick;
|
|
4275
|
+
return (jsxRuntime.jsxs(Container$E, { children: [jsxRuntime.jsx(TextButton, { LeadingIcon: Icon.PDP.Rule, size: exports.ComponentSize.Small, text: title, onClick: onClick }, void 0), !!fitPercentage && (jsxRuntime.jsxs(P$3, { children: ["Fit As Expected: ", jsxRuntime.jsxs(PercentageSpan, { children: [fitPercentage, "%"] }, void 0)] }, void 0))] }, void 0));
|
|
4276
4276
|
};
|
|
4277
4277
|
var templateObject_1$_, templateObject_2$D, templateObject_3$o;
|
|
4278
4278
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Trafilea's Design System",
|
|
4
4
|
"author": "Trafilea",
|
|
5
5
|
"repository": "https://github.com/trafilea/afrodita-components",
|
|
6
|
-
"version": "5.0.0-beta.
|
|
6
|
+
"version": "5.0.0-beta.5",
|
|
7
7
|
"private": false,
|
|
8
8
|
"main": "build/index.js",
|
|
9
9
|
"style": "build/index.css",
|