@flodesk/grain 11.61.3 → 11.62.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/es/components/text/index.js +6 -3
- package/es/styles/utilities.js +2 -1
- package/es/types/shared.d.ts +2 -0
- package/es/types.js +3 -1
- package/es/utilities/style-config.js +10 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["children", "size", "weight", "color", "tag", "display", "hasEllipsis", "ellipsisLines", "align", "letterSpacing", "textTransform", "variant", "trimTop", "trimBottom", "className", "style"];
|
|
1
|
+
const _excluded = ["children", "size", "weight", "color", "tag", "display", "hasEllipsis", "ellipsisLines", "align", "letterSpacing", "textTransform", "variant", "trimTop", "trimBottom", "wrap", "className", "style"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -39,6 +39,7 @@ export const Text = /*#__PURE__*/forwardRef(function Text(_ref, ref) {
|
|
|
39
39
|
variant,
|
|
40
40
|
trimTop,
|
|
41
41
|
trimBottom,
|
|
42
|
+
wrap: textWrap,
|
|
42
43
|
className,
|
|
43
44
|
style
|
|
44
45
|
} = _ref,
|
|
@@ -69,7 +70,8 @@ export const Text = /*#__PURE__*/forwardRef(function Text(_ref, ref) {
|
|
|
69
70
|
color,
|
|
70
71
|
weight,
|
|
71
72
|
display: !ellipsisLines ? display : undefined,
|
|
72
|
-
textTransform
|
|
73
|
+
textTransform,
|
|
74
|
+
textWrap
|
|
73
75
|
},
|
|
74
76
|
breakpoints
|
|
75
77
|
});
|
|
@@ -98,5 +100,6 @@ Text.propTypes = {
|
|
|
98
100
|
variant: PropTypes.oneOf(['caps']),
|
|
99
101
|
trimTop: PropTypes.bool,
|
|
100
102
|
trimBottom: PropTypes.bool,
|
|
101
|
-
display: types.textDisplay
|
|
103
|
+
display: types.textDisplay,
|
|
104
|
+
wrap: types.textWrap
|
|
102
105
|
};
|
package/es/styles/utilities.js
CHANGED
|
@@ -71,6 +71,7 @@ const {
|
|
|
71
71
|
zIndexProps,
|
|
72
72
|
letterSpacingProps,
|
|
73
73
|
textTransformProps,
|
|
74
|
+
textWrapProps,
|
|
74
75
|
autoFlowProps,
|
|
75
76
|
gridTemplateProps,
|
|
76
77
|
itemAlignmentProps,
|
|
@@ -79,7 +80,7 @@ const {
|
|
|
79
80
|
flexWrapProps
|
|
80
81
|
} = styleConfig;
|
|
81
82
|
const classAndStyleDeclarationProps = [spaceProps, colorProps, shadowProps, radiusProps, transitionProps, sizeProps, borderColorProps, alignProps, flexWrapProps, autoFlowProps, itemAlignmentProps, contentPositionProps, flexDirectionProps, alignSelfProps];
|
|
82
|
-
const classDeclarationProps = [...classAndStyleDeclarationProps, positionProps, overflowProps, cursorProps, borderWidthProps, weightProps, textDisplayProps, borderSideProps, textTransformProps];
|
|
83
|
+
const classDeclarationProps = [...classAndStyleDeclarationProps, positionProps, overflowProps, cursorProps, borderWidthProps, weightProps, textDisplayProps, borderSideProps, textTransformProps, textWrapProps];
|
|
83
84
|
const styleDeclarationProps = [...classAndStyleDeclarationProps, dimensionProps, aspectRatioProps, orderProps, flexProps, opacityProps, zIndexProps, letterSpacingProps, gridTemplateProps];
|
|
84
85
|
const defaultBorder = "\n [class*=\"bd\"] {\n border-color: var(--grn-color-border);\n border-width: 1px;\n }\n";
|
|
85
86
|
export const generateUtilitiesCss = _ref2 => {
|
package/es/types/shared.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
sides,
|
|
19
19
|
borderWidths,
|
|
20
20
|
textTransforms,
|
|
21
|
+
textWraps,
|
|
21
22
|
textDisplays,
|
|
22
23
|
textAlignments,
|
|
23
24
|
} from '../types';
|
|
@@ -41,6 +42,7 @@ export type CursorType = (typeof cursors)[number];
|
|
|
41
42
|
export type SideType = (typeof sides)[number];
|
|
42
43
|
export type BorderWidthType = (typeof borderWidths)[number];
|
|
43
44
|
export type TextTransformType = (typeof textTransforms)[number];
|
|
45
|
+
export type TextWrapType = (typeof textWraps)[number];
|
|
44
46
|
export type TextDisplayType = (typeof textDisplays)[number];
|
|
45
47
|
export type TextAlignType = (typeof textAlignments)[number];
|
|
46
48
|
export type IconSizePropType = number | string | keyof IconTokens;
|
package/es/types.js
CHANGED
|
@@ -25,6 +25,7 @@ export const borderWidths = ['1px', '2px', '3px', '4px'];
|
|
|
25
25
|
export const textTransforms = ['capitalize', 'uppercase', 'lowercase'];
|
|
26
26
|
export const textDisplays = ['block', 'inline-block', 'inline'];
|
|
27
27
|
export const textAlignments = ['left', 'center', 'right'];
|
|
28
|
+
export const textWraps = ['nowrap', 'balance', 'pretty'];
|
|
28
29
|
export const spaces = Object.keys(vars.spaces);
|
|
29
30
|
export const types = {
|
|
30
31
|
space: PropTypes.oneOfType([PropTypes.oneOf(spaces), PropTypes.number, PropTypes.string]),
|
|
@@ -68,7 +69,8 @@ export const types = {
|
|
|
68
69
|
hint: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
69
70
|
transition: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.transitions)), PropTypes.string]),
|
|
70
71
|
cursor: PropTypes.oneOf(cursors),
|
|
71
|
-
borderWidth: PropTypes.oneOf(borderWidths)
|
|
72
|
+
borderWidth: PropTypes.oneOf(borderWidths),
|
|
73
|
+
textWrap: PropTypes.oneOf(textWraps)
|
|
72
74
|
};
|
|
73
75
|
export const defaultProps = {
|
|
74
76
|
menuMaxHeight: '468px',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { alignSelfs, autoFlows, axisAlignments, borderWidths, contentPositions, cursors, flexDirections, flexWraps, overflows, positions, sides, textAlignments, textDisplays, textTransforms } from '../types';
|
|
1
|
+
import { alignSelfs, autoFlows, axisAlignments, borderWidths, contentPositions, cursors, flexDirections, flexWraps, overflows, positions, sides, textAlignments, textDisplays, textTransforms, textWraps } from '../types';
|
|
2
2
|
import { vars } from '../variables';
|
|
3
3
|
import { getDimension, getSpace, getTextSize, isSpaceVar } from './responsive';
|
|
4
4
|
import { getColor, getRadius, getShadow, getTransition, getWeight, isColorVar, isRadiusVar, isShadowVar, isTrasitionVar } from './styles';
|
|
@@ -281,6 +281,15 @@ export const styleConfig = {
|
|
|
281
281
|
valueTransformer: getTextSize,
|
|
282
282
|
variableChecker: value => sizes.includes(value)
|
|
283
283
|
},
|
|
284
|
+
textWrapProps: {
|
|
285
|
+
props: [{
|
|
286
|
+
propName: 'textWrap',
|
|
287
|
+
property: 'text-wrap',
|
|
288
|
+
short: 'txtw'
|
|
289
|
+
}],
|
|
290
|
+
variables: textWraps,
|
|
291
|
+
variableChecker: value => textWraps.includes(value)
|
|
292
|
+
},
|
|
284
293
|
opacityProps: {
|
|
285
294
|
props: [{
|
|
286
295
|
propName: 'opacity',
|