@websolutespa/bom-mixer-ui 0.4.2 → 0.4.3
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/CHANGELOG.md +6 -0
- package/dist/cjs/index.js +41 -19
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/text/text.js +12 -20
- package/dist/esm/components/text/text.js.map +1 -1
- package/dist/esm/components/utils.js +29 -1
- package/dist/esm/components/utils.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/types/components/text/text.d.ts +5 -4
- package/dist/types/components/text/text.d.ts.map +1 -1
- package/dist/types/components/types.d.ts +7 -0
- package/dist/types/components/types.d.ts.map +1 -1
- package/dist/types/components/utils.d.ts +4 -1
- package/dist/types/components/utils.d.ts.map +1 -1
- package/dist/types/theme/types.d.ts +5 -2
- package/dist/types/theme/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/text/text.tsx +14 -23
- package/src/components/types.ts +8 -0
- package/src/components/utils.ts +32 -2
- package/src/theme/types.ts +6 -2
package/CHANGELOG.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -730,6 +730,34 @@ function getCssResponsive(props, defaultValue) {
|
|
|
730
730
|
}
|
|
731
731
|
return rules;
|
|
732
732
|
}
|
|
733
|
+
function getVariantResponsive(props, callback) {
|
|
734
|
+
const keys = ['variant', 'variantSm', 'variantMd', 'variantLg', 'variantXl'];
|
|
735
|
+
const theme = props.theme;
|
|
736
|
+
const mediaQuery = theme.mediaQuery;
|
|
737
|
+
return keys.map(key => {
|
|
738
|
+
const value = props[key];
|
|
739
|
+
if (value) {
|
|
740
|
+
const rule = callback(value, theme);
|
|
741
|
+
if (key !== 'variant') {
|
|
742
|
+
const size = key.replace('variant', '').toLowerCase();
|
|
743
|
+
// console.log('size', size, 'rule', rule);
|
|
744
|
+
return styled.css`@media(min-width: ${mediaQuery[size]}) {
|
|
745
|
+
${rule}
|
|
746
|
+
}`;
|
|
747
|
+
} else {
|
|
748
|
+
return rule;
|
|
749
|
+
}
|
|
750
|
+
} else {
|
|
751
|
+
return undefined;
|
|
752
|
+
}
|
|
753
|
+
}).filter(Boolean);
|
|
754
|
+
}
|
|
755
|
+
function getFontVariantResponsive(props, callback) {
|
|
756
|
+
return getVariantResponsive(props, (key, theme) => {
|
|
757
|
+
const font = theme.font[key];
|
|
758
|
+
return font ? callback(key, font) : '';
|
|
759
|
+
});
|
|
760
|
+
}
|
|
733
761
|
function getAspectResponsive(props, defaultValue) {
|
|
734
762
|
if (defaultValue === void 0) {
|
|
735
763
|
defaultValue = {};
|
|
@@ -4514,25 +4542,17 @@ const CssUl = styled.css`
|
|
|
4514
4542
|
}
|
|
4515
4543
|
`;
|
|
4516
4544
|
const StyledText = styled__default.default.div`
|
|
4517
|
-
${props =>
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
` : ''}
|
|
4529
|
-
${props.gradient ? styled.css`
|
|
4530
|
-
background: -webkit-linear-gradient(0deg, var(--color-secondary-500), var(--color-primary-500));
|
|
4531
|
-
-webkit-background-clip: text;
|
|
4532
|
-
-webkit-text-fill-color: transparent;
|
|
4533
|
-
` : ''}
|
|
4534
|
-
`;
|
|
4535
|
-
}}
|
|
4545
|
+
${props => getFontVariantResponsive(props, (variant, font) => styled.css`
|
|
4546
|
+
${font.family ? styled.css`font-family: var(--font-${variant}-family, var(--base-font-family));` : ''}
|
|
4547
|
+
${font.size ? styled.css`font-size: var(--font-${variant}-size, 1rem);` : ''}
|
|
4548
|
+
${font.lineHeight ? styled.css`line-height: var(--font-${variant}-line-height, 1);` : ''}
|
|
4549
|
+
${font.fontWeight ? styled.css`font-weight: var(--font-${variant}-font-weight, inherit);` : ''}
|
|
4550
|
+
`)};
|
|
4551
|
+
${props => props.gradient ? styled.css`
|
|
4552
|
+
background: -webkit-linear-gradient(0deg, var(--color-secondary-500), var(--color-primary-500));
|
|
4553
|
+
-webkit-background-clip: text;
|
|
4554
|
+
-webkit-text-fill-color: transparent;
|
|
4555
|
+
` : ''}
|
|
4536
4556
|
${CssH}
|
|
4537
4557
|
${CssA}
|
|
4538
4558
|
${CssP}
|
|
@@ -20708,9 +20728,11 @@ exports.getAspectResponsive = getAspectResponsive;
|
|
|
20708
20728
|
exports.getChildsByType = getChildsByType;
|
|
20709
20729
|
exports.getContainer = getContainer;
|
|
20710
20730
|
exports.getCssResponsive = getCssResponsive;
|
|
20731
|
+
exports.getFontVariantResponsive = getFontVariantResponsive;
|
|
20711
20732
|
exports.getGrid = getGrid;
|
|
20712
20733
|
exports.getShortName = getShortName;
|
|
20713
20734
|
exports.getVariant = getVariant;
|
|
20735
|
+
exports.getVariantResponsive = getVariantResponsive;
|
|
20714
20736
|
exports.hasChildOfType = hasChildOfType;
|
|
20715
20737
|
exports.hypenize = hypenize;
|
|
20716
20738
|
exports.isChildElement = isChildElement;
|