@hyphen/hyphen-components 6.6.0 → 6.7.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/dist/components/Box/Box.d.ts +13 -2
- package/dist/components/Box/Box.stories.d.ts +2 -0
- package/dist/css/utilities.css +65 -1
- package/dist/css/variables.css +10 -2
- package/dist/hyphen-components.cjs.development.js +7 -3
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +1 -1
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +7 -3
- package/dist/hyphen-components.esm.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/Box/Box.stories.tsx +140 -0
- package/src/components/Box/Box.tsx +20 -1
- package/src/types/index.ts +6 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as CSS from 'csstype';
|
|
2
|
-
import { BaseSpacing, BorderRadiusSize, BorderSize, BoxShadowSize, CssAlignContentValue, CssAlignItemsValue, CssDisplayValue, CssFlexDirectionValue, CssFlexValue, CssJustifyContentValue, CssOverflowValue, CssTextAlignValue, DimensionSize, FontColor, FontFamily, FontSize, FontWeight, ResponsiveProp, SpacingSize, ZIndexSize, BackgroundColor, BorderColor, CssWhiteSpaceValue, CssWordBreakValue } from '../../types';
|
|
2
|
+
import { BaseSpacing, BorderRadiusSize, BorderSize, BoxShadowSize, CssAlignContentValue, CssAlignItemsValue, CssDisplayValue, CssFlexDirectionValue, CssFlexValue, CssJustifyContentValue, CssOverflowValue, CssTextAlignValue, DimensionSize, FontColor, FontFamily, FontSize, FontWeight, ResponsiveProp, SpacingSize, ZIndexSize, BackgroundColor, BorderColor, CssWhiteSpaceValue, CssWordBreakValue, TextWrap, TextTransform } from '../../types';
|
|
3
3
|
import { CSSProperties, FC, ReactNode } from 'react';
|
|
4
4
|
import { KnownKeys } from '../../types/lib.types';
|
|
5
5
|
export type HoverableBoxProperties = 'color' | 'borderColor' | 'shadow' | 'background';
|
|
@@ -200,10 +200,22 @@ export interface BoxProps {
|
|
|
200
200
|
* the alignment of the text
|
|
201
201
|
*/
|
|
202
202
|
textAlign?: CssTextAlignValue | ResponsiveProp<CssTextAlignValue>;
|
|
203
|
+
/**
|
|
204
|
+
* Control the text transformation of the Box
|
|
205
|
+
*/
|
|
206
|
+
textTransform?: TextTransform | ResponsiveProp<TextTransform>;
|
|
207
|
+
/**
|
|
208
|
+
* Control the text wrapping behavior of the Box
|
|
209
|
+
*/
|
|
210
|
+
textWrap?: TextWrap | ResponsiveProp<TextWrap>;
|
|
203
211
|
/**
|
|
204
212
|
* Control the whitespace behavior of the Box
|
|
205
213
|
*/
|
|
206
214
|
whiteSpace?: CssWhiteSpaceValue | ResponsiveProp<CssWhiteSpaceValue>;
|
|
215
|
+
/**
|
|
216
|
+
* Control the word break behavior of the Box
|
|
217
|
+
*/
|
|
218
|
+
wordBreak?: CssWordBreakValue | ResponsiveProp<CssWordBreakValue>;
|
|
207
219
|
/**
|
|
208
220
|
* By default, a Box's items will all try to fit onto one line.
|
|
209
221
|
* Change that and allow the items to wrap as needed wrap
|
|
@@ -217,7 +229,6 @@ export interface BoxProps {
|
|
|
217
229
|
/**
|
|
218
230
|
* Control the word break behavior of the Box
|
|
219
231
|
*/
|
|
220
|
-
wordBreak?: CssWordBreakValue | ResponsiveProp<CssWordBreakValue>;
|
|
221
232
|
/**
|
|
222
233
|
* ZIndex value for the element. Can be one of the predetermined token values.
|
|
223
234
|
* Can be responsive.
|
|
@@ -42,3 +42,5 @@ export declare const Hover: () => React.JSX.Element;
|
|
|
42
42
|
export declare const Focus: () => React.JSX.Element;
|
|
43
43
|
export declare const Responsive: () => React.JSX.Element;
|
|
44
44
|
export declare const Omit: () => React.JSX.Element;
|
|
45
|
+
export declare const TextWrap: () => React.JSX.Element;
|
|
46
|
+
export declare const TextTransform: () => React.JSX.Element;
|
package/dist/css/utilities.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
\***************************************************************************************************************************/
|
|
4
4
|
/**
|
|
5
5
|
* Do not edit directly
|
|
6
|
-
* Generated on
|
|
6
|
+
* Generated on Wed, 26 Nov 2025 19:31:43 GMT
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
.font-family-monospace { font-family: var(--assets-font-family-monospace); }
|
|
@@ -876,6 +876,22 @@
|
|
|
876
876
|
|
|
877
877
|
.transform-normal-case { text-transform: var(--font-text-transform-normal-case); }
|
|
878
878
|
|
|
879
|
+
.text-wrap-wrap { text-wrap: var(--font-text-wrap-wrap); }
|
|
880
|
+
|
|
881
|
+
.text-wrap-nowrap { text-wrap: var(--font-text-wrap-nowrap); }
|
|
882
|
+
|
|
883
|
+
.text-wrap-balance { text-wrap: var(--font-text-wrap-balance); }
|
|
884
|
+
|
|
885
|
+
.text-wrap-pretty { text-wrap: var(--font-text-wrap-pretty); }
|
|
886
|
+
|
|
887
|
+
.text-wrap-stable { text-wrap: var(--font-text-wrap-stable); }
|
|
888
|
+
|
|
889
|
+
.text-wrap-inherit { text-wrap: var(--font-text-wrap-inherit); }
|
|
890
|
+
|
|
891
|
+
.text-wrap-initial { text-wrap: var(--font-text-wrap-initial); }
|
|
892
|
+
|
|
893
|
+
.text-wrap-unset { text-wrap: var(--font-text-wrap-unset); }
|
|
894
|
+
|
|
879
895
|
.whitespace-normal { white-space: var(--font-white-space-normal); }
|
|
880
896
|
|
|
881
897
|
.whitespace-nowrap { white-space: var(--font-white-space-nowrap); }
|
|
@@ -2201,6 +2217,22 @@
|
|
|
2201
2217
|
.z-sticky { z-index: var(--size-z-index-sticky); }
|
|
2202
2218
|
|
|
2203
2219
|
@media (min-width: 680px) {
|
|
2220
|
+
.text-wrap-wrap-tablet { text-wrap: var(--font-text-wrap-wrap); }
|
|
2221
|
+
|
|
2222
|
+
.text-wrap-nowrap-tablet { text-wrap: var(--font-text-wrap-nowrap); }
|
|
2223
|
+
|
|
2224
|
+
.text-wrap-balance-tablet { text-wrap: var(--font-text-wrap-balance); }
|
|
2225
|
+
|
|
2226
|
+
.text-wrap-pretty-tablet { text-wrap: var(--font-text-wrap-pretty); }
|
|
2227
|
+
|
|
2228
|
+
.text-wrap-stable-tablet { text-wrap: var(--font-text-wrap-stable); }
|
|
2229
|
+
|
|
2230
|
+
.text-wrap-inherit-tablet { text-wrap: var(--font-text-wrap-inherit); }
|
|
2231
|
+
|
|
2232
|
+
.text-wrap-initial-tablet { text-wrap: var(--font-text-wrap-initial); }
|
|
2233
|
+
|
|
2234
|
+
.text-wrap-unset-tablet { text-wrap: var(--font-text-wrap-unset); }
|
|
2235
|
+
|
|
2204
2236
|
.whitespace-normal-tablet { white-space: var(--font-white-space-normal); }
|
|
2205
2237
|
|
|
2206
2238
|
.whitespace-nowrap-tablet { white-space: var(--font-white-space-nowrap); }
|
|
@@ -3506,6 +3538,22 @@
|
|
|
3506
3538
|
}
|
|
3507
3539
|
|
|
3508
3540
|
@media (min-width: 992px) {
|
|
3541
|
+
.text-wrap-wrap-desktop { text-wrap: var(--font-text-wrap-wrap); }
|
|
3542
|
+
|
|
3543
|
+
.text-wrap-nowrap-desktop { text-wrap: var(--font-text-wrap-nowrap); }
|
|
3544
|
+
|
|
3545
|
+
.text-wrap-balance-desktop { text-wrap: var(--font-text-wrap-balance); }
|
|
3546
|
+
|
|
3547
|
+
.text-wrap-pretty-desktop { text-wrap: var(--font-text-wrap-pretty); }
|
|
3548
|
+
|
|
3549
|
+
.text-wrap-stable-desktop { text-wrap: var(--font-text-wrap-stable); }
|
|
3550
|
+
|
|
3551
|
+
.text-wrap-inherit-desktop { text-wrap: var(--font-text-wrap-inherit); }
|
|
3552
|
+
|
|
3553
|
+
.text-wrap-initial-desktop { text-wrap: var(--font-text-wrap-initial); }
|
|
3554
|
+
|
|
3555
|
+
.text-wrap-unset-desktop { text-wrap: var(--font-text-wrap-unset); }
|
|
3556
|
+
|
|
3509
3557
|
.whitespace-normal-desktop { white-space: var(--font-white-space-normal); }
|
|
3510
3558
|
|
|
3511
3559
|
.whitespace-nowrap-desktop { white-space: var(--font-white-space-nowrap); }
|
|
@@ -4811,6 +4859,22 @@
|
|
|
4811
4859
|
}
|
|
4812
4860
|
|
|
4813
4861
|
@media (min-width: 1280px) {
|
|
4862
|
+
.text-wrap-wrap-hd { text-wrap: var(--font-text-wrap-wrap); }
|
|
4863
|
+
|
|
4864
|
+
.text-wrap-nowrap-hd { text-wrap: var(--font-text-wrap-nowrap); }
|
|
4865
|
+
|
|
4866
|
+
.text-wrap-balance-hd { text-wrap: var(--font-text-wrap-balance); }
|
|
4867
|
+
|
|
4868
|
+
.text-wrap-pretty-hd { text-wrap: var(--font-text-wrap-pretty); }
|
|
4869
|
+
|
|
4870
|
+
.text-wrap-stable-hd { text-wrap: var(--font-text-wrap-stable); }
|
|
4871
|
+
|
|
4872
|
+
.text-wrap-inherit-hd { text-wrap: var(--font-text-wrap-inherit); }
|
|
4873
|
+
|
|
4874
|
+
.text-wrap-initial-hd { text-wrap: var(--font-text-wrap-initial); }
|
|
4875
|
+
|
|
4876
|
+
.text-wrap-unset-hd { text-wrap: var(--font-text-wrap-unset); }
|
|
4877
|
+
|
|
4814
4878
|
.whitespace-normal-hd { white-space: var(--font-white-space-normal); }
|
|
4815
4879
|
|
|
4816
4880
|
.whitespace-nowrap-hd { white-space: var(--font-white-space-nowrap); }
|
package/dist/css/variables.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
\*********************************************************************************************************************/
|
|
4
4
|
/**
|
|
5
5
|
* Do not edit directly
|
|
6
|
-
* Generated on
|
|
6
|
+
* Generated on Wed, 26 Nov 2025 19:31:43 GMT
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
:root {
|
|
@@ -233,6 +233,14 @@
|
|
|
233
233
|
--font-text-transform-lowercase: lowercase;
|
|
234
234
|
--font-text-transform-capitalize: capitalize;
|
|
235
235
|
--font-text-transform-normal-case: normal-case;
|
|
236
|
+
--font-text-wrap-wrap: wrap;
|
|
237
|
+
--font-text-wrap-nowrap: nowrap;
|
|
238
|
+
--font-text-wrap-balance: balance;
|
|
239
|
+
--font-text-wrap-pretty: pretty;
|
|
240
|
+
--font-text-wrap-stable: stable;
|
|
241
|
+
--font-text-wrap-inherit: inherit;
|
|
242
|
+
--font-text-wrap-initial: initial;
|
|
243
|
+
--font-text-wrap-unset: unset;
|
|
236
244
|
--font-white-space-normal: normal;
|
|
237
245
|
--font-white-space-nowrap: nowrap;
|
|
238
246
|
--font-white-space-pre: pre;
|
|
@@ -368,7 +376,7 @@
|
|
|
368
376
|
\*******************************************************************************************************************************/
|
|
369
377
|
/**
|
|
370
378
|
* Do not edit directly
|
|
371
|
-
* Generated on
|
|
379
|
+
* Generated on Wed, 26 Nov 2025 19:31:43 GMT
|
|
372
380
|
*/
|
|
373
381
|
|
|
374
382
|
:root.dark {
|
|
@@ -284,7 +284,7 @@ Component, props, getDefault) {
|
|
|
284
284
|
|
|
285
285
|
var styles$A = {"box-transition":"Box-module_box-transition__eQx8C"};
|
|
286
286
|
|
|
287
|
-
var _excluded$Q = ["as", "alignItems", "alignContent", "alignSelf", "background", "borderColor", "borderWidth", "children", "childGap", "className", "color", "columnGap", "cursor", "display", "direction", "flex", "fontFamily", "fontSize", "focus", "fontWeight", "gap", "height", "hover", "justifyContent", "margin", "maxHeight", "minHeight", "maxWidth", "minWidth", "overflow", "padding", "position", "radius", "rowGap", "shadow", "style", "textAlign", "wrap", "whiteSpace", "width", "wordBreak", "zIndex"];
|
|
287
|
+
var _excluded$Q = ["as", "alignItems", "alignContent", "alignSelf", "background", "borderColor", "borderWidth", "children", "childGap", "className", "color", "columnGap", "cursor", "display", "direction", "flex", "fontFamily", "fontSize", "focus", "fontWeight", "gap", "height", "hover", "justifyContent", "margin", "maxHeight", "minHeight", "maxWidth", "minWidth", "overflow", "padding", "position", "radius", "rowGap", "shadow", "style", "textAlign", "textTransform", "textWrap", "wrap", "whiteSpace", "width", "wordBreak", "zIndex"];
|
|
288
288
|
/**
|
|
289
289
|
* A `<Box>` is a layout component to build UIs with consistent padding and spacing between
|
|
290
290
|
* elements.
|
|
@@ -365,6 +365,10 @@ var Box = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
365
365
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
366
366
|
_ref$textAlign = _ref.textAlign,
|
|
367
367
|
textAlign = _ref$textAlign === void 0 ? undefined : _ref$textAlign,
|
|
368
|
+
_ref$textTransform = _ref.textTransform,
|
|
369
|
+
textTransform = _ref$textTransform === void 0 ? undefined : _ref$textTransform,
|
|
370
|
+
_ref$textWrap = _ref.textWrap,
|
|
371
|
+
textWrap = _ref$textWrap === void 0 ? undefined : _ref$textWrap,
|
|
368
372
|
_ref$wrap = _ref.wrap,
|
|
369
373
|
wrap = _ref$wrap === void 0 ? undefined : _ref$wrap,
|
|
370
374
|
_ref$whiteSpace = _ref.whiteSpace,
|
|
@@ -421,7 +425,7 @@ var Box = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
421
425
|
};
|
|
422
426
|
var hoverClasses = getStatefulClasses('hover', hover);
|
|
423
427
|
var focusClasses = getStatefulClasses('focus', focus);
|
|
424
|
-
var boxClasses = classNames.apply(void 0, [className, cssShorthandToClasses('m', margin), cssShorthandToClasses('p', padding), cssShorthandToClasses('br', radius), cssShorthandToClasses('g', gap), cssShorthandToClasses('cg', columnGap), cssShorthandToClasses('rg', rowGap), heightCss.classes, maxHeightCss.classes, minHeightCss.classes, maxWidthCss.classes, minWidthCss.classes, widthCss.classes, flexDirectionClasses, generateResponsiveClasses('display', display), generateResponsiveClasses('justify-content', justifyContent), generateResponsiveClasses('align-items', alignItems), generateResponsiveClasses('align-content', alignContent), generateResponsiveClasses('align-self', alignSelf), generateResponsiveClasses('font-family', fontFamily), generateResponsiveClasses('font-size', fontSize), generateResponsiveClasses('overflow', overflow), generateResponsiveClasses('shadow', shadow), generateResponsiveClasses('flex', flex), cssShorthandToClasses('bw', borderWidth), generateResponsiveClasses('font-weight', fontWeight), generateResponsiveClasses('text-align', textAlign), generateResponsiveClasses('position', position), generateResponsiveClasses('z-index', zIndex), generateResponsiveClasses('whitespace', whiteSpace), generateResponsiveClasses('break', wordBreak)].concat(hoverClasses != null ? hoverClasses : [], focusClasses != null ? focusClasses : [], [(_ref3 = {
|
|
428
|
+
var boxClasses = classNames.apply(void 0, [className, cssShorthandToClasses('m', margin), cssShorthandToClasses('p', padding), cssShorthandToClasses('br', radius), cssShorthandToClasses('g', gap), cssShorthandToClasses('cg', columnGap), cssShorthandToClasses('rg', rowGap), heightCss.classes, maxHeightCss.classes, minHeightCss.classes, maxWidthCss.classes, minWidthCss.classes, widthCss.classes, flexDirectionClasses, generateResponsiveClasses('display', display), generateResponsiveClasses('justify-content', justifyContent), generateResponsiveClasses('align-items', alignItems), generateResponsiveClasses('align-content', alignContent), generateResponsiveClasses('align-self', alignSelf), generateResponsiveClasses('font-family', fontFamily), generateResponsiveClasses('font-size', fontSize), generateResponsiveClasses('overflow', overflow), generateResponsiveClasses('shadow', shadow), generateResponsiveClasses('flex', flex), cssShorthandToClasses('bw', borderWidth), generateResponsiveClasses('font-weight', fontWeight), generateResponsiveClasses('text-align', textAlign), generateResponsiveClasses('transform', textTransform), generateResponsiveClasses('text-wrap', textWrap), generateResponsiveClasses('position', position), generateResponsiveClasses('z-index', zIndex), generateResponsiveClasses('whitespace', whiteSpace), generateResponsiveClasses('break', wordBreak)].concat(hoverClasses != null ? hoverClasses : [], focusClasses != null ? focusClasses : [], [(_ref3 = {
|
|
425
429
|
'flex-wrap': isFlexBox && wrap,
|
|
426
430
|
'flex-nowrap': isFlexBox && wrap === false
|
|
427
431
|
}, _ref3["background-color-" + background] = background, _ref3["font-color-" + color] = color, _ref3["border-color-" + borderColor] = borderColor, _ref3["cursor-" + cursor] = cursor, _ref3[styles$A['box-transition']] = hover || focus, _ref3)]));
|
|
@@ -524,7 +528,7 @@ var Box = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
524
528
|
ref: ref
|
|
525
529
|
}, restProps), children !== null && children !== undefined ? decoratedChildren : null);
|
|
526
530
|
});
|
|
527
|
-
var boxPropsKeys = ['as', 'alignItems', 'alignContent', 'alignSelf', 'background', 'borderColor', 'borderWidth', 'className', 'childGap', 'children', 'color', 'columnGap', 'cursor', 'direction', 'display', 'flex', 'focus', 'fontFamily', 'fontSize', 'fontWeight', 'gap', 'height', 'hover', 'justifyContent', 'margin', 'maxHeight', 'minHeight', 'maxWidth', 'minWidth', 'overflow', 'padding', 'position', 'radius', 'rowGap', 'shadow', 'style', 'textAlign', 'wrap', 'width', 'zIndex'];
|
|
531
|
+
var boxPropsKeys = ['as', 'alignItems', 'alignContent', 'alignSelf', 'background', 'borderColor', 'borderWidth', 'className', 'childGap', 'children', 'color', 'columnGap', 'cursor', 'direction', 'display', 'flex', 'focus', 'fontFamily', 'fontSize', 'fontWeight', 'gap', 'height', 'hover', 'justifyContent', 'margin', 'maxHeight', 'minHeight', 'maxWidth', 'minWidth', 'overflow', 'padding', 'position', 'radius', 'rowGap', 'shadow', 'style', 'textAlign', 'textTransform', 'textWrap', 'wrap', 'width', 'zIndex'];
|
|
528
532
|
|
|
529
533
|
var _excluded$P = ["className", "name", "color", "size"];
|
|
530
534
|
var Icon = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|