@hyphen/hyphen-components 6.6.0 → 6.8.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.
@@ -1,5 +1,5 @@
1
1
  import { BorderRadiusSize, Breakpoint, BreakpointSizeWithBase } from '../types';
2
- export declare const ICON_NAMES: ("add" | "alarm-disable" | "alarm" | "analytics" | "app-window" | "archive" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "arrows-maximize" | "at" | "ban" | "block" | "blocks" | "book-open" | "c-add" | "c-check" | "c-delete" | "c-in-progress" | "c-info" | "c-question" | "c-remove" | "c-user" | "c-warning" | "calendar-create" | "calendar" | "camera" | "caret-down" | "caret-left" | "caret-right" | "caret-sm-down" | "caret-sm-left" | "caret-sm-right" | "caret-sm-up" | "caret-up-down" | "caret-up" | "chart-bar" | "chart-line" | "chat" | "check" | "checkbox-btn-checked" | "checkbox-btn-indeterminate" | "checkbox-btn" | "circle-filled" | "circle" | "clipboard" | "cloud" | "code" | "command-line" | "computer" | "contact" | "copy-document" | "cpu" | "dashboard" | "database" | "dock-left" | "document" | "dots" | "download" | "electricity-bolt" | "exclamation-mark" | "eye-slash" | "eye" | "filter" | "flag" | "folder" | "gear" | "git-branch" | "git-commit" | "git-merge" | "git-pull-request" | "grab" | "hash-mark" | "heart-o" | "heart" | "home" | "infinity" | "info" | "integrations" | "key" | "launch-app" | "lightbulb" | "link" | "list" | "lock" | "logo-code" | "logo-deploy" | "logo-env" | "logo-github" | "logo-link" | "logo-netinfo" | "logo-toggle" | "logout" | "mail" | "memory" | "menu" | "microphone" | "minus" | "moon" | "paperclip" | "path-intersect" | "pause" | "pc" | "pencil" | "phone" | "photo" | "play" | "qr-code" | "radio-btn-checked" | "radio-btn-unchecked" | "refresh" | "remove" | "rewind" | "search" | "send" | "settings" | "skip" | "ssd" | "stack" | "star-o" | "star" | "stopwatch" | "subtract" | "sun" | "t-warning" | "tag" | "terminal" | "time-alarm" | "time-clock" | "trash" | "unlocked" | "upload" | "user-create" | "user" | "users" | "wifi-off" | "wifi" | "zoom-in" | "zoom-out")[];
2
+ export declare const ICON_NAMES: ("add" | "alarm-disable" | "alarm" | "analytics" | "app-window" | "archive" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "arrows-maximize" | "at" | "ban" | "block" | "blocks" | "book-open" | "c-add" | "c-check" | "c-delete" | "c-in-progress" | "c-info" | "c-question" | "c-remove" | "c-user" | "c-warning" | "calendar-create" | "calendar" | "camera" | "caret-down" | "caret-left" | "caret-right" | "caret-sm-down" | "caret-sm-left" | "caret-sm-right" | "caret-sm-up" | "caret-up-down" | "caret-up" | "chart-bar" | "chart-line" | "chat" | "check" | "checkbox-btn-checked" | "checkbox-btn-indeterminate" | "checkbox-btn" | "circle-filled" | "circle" | "clipboard" | "cloud" | "code" | "command-line" | "computer" | "contact" | "copy-document" | "cpu" | "dashboard" | "database" | "dock-left" | "document" | "dots" | "download" | "electricity-bolt" | "exclamation-mark" | "eye-slash" | "eye" | "filter" | "flag" | "folder" | "gear" | "git-branch" | "git-commit" | "git-merge" | "git-pull-request" | "grab" | "hash-mark" | "heart-o" | "heart" | "home" | "inbox" | "infinity" | "info" | "integrations" | "key" | "launch-app" | "lightbulb" | "link" | "list" | "lock" | "logo-code" | "logo-deploy" | "logo-env" | "logo-github" | "logo-link" | "logo-netinfo" | "logo-toggle" | "logout" | "mail" | "memory" | "menu" | "microphone" | "minus" | "moon" | "paperclip" | "path-intersect" | "pause" | "pc" | "pencil" | "phone" | "photo" | "play" | "qr-code" | "radio-btn-checked" | "radio-btn-unchecked" | "refresh" | "remove" | "rewind" | "search" | "send" | "settings" | "skip" | "ssd" | "stack" | "star-o" | "star" | "stopwatch" | "subtract" | "sun" | "t-warning" | "tag" | "terminal" | "time-alarm" | "time-clock" | "trash" | "unlocked" | "upload" | "user-create" | "user" | "users" | "wifi-off" | "wifi" | "zoom-in" | "zoom-out")[];
3
3
  export declare const BORDER_RADIUS_OPTIONS: BorderRadiusSize[];
4
4
  export declare const BORDER_SIZE_OPTIONS: ("0" | "sm" | "md" | "lg")[];
5
5
  export declare const BREAKPOINT_OPTIONS: BreakpointSizeWithBase[];
@@ -1,6 +1,6 @@
1
1
  import { Key, KeyboardEvent, MouseEvent, ReactNode } from 'react';
2
2
  import { BorderRadiusSize as BorderRadius, SpacingSize, BreakpointSize, HeightSize, WidthSize } from '@hyphen/hyphen-design-tokens/build/types';
3
- export type { IconName, BackgroundColor, BaseColor, BorderColor, BorderSize, BoxShadowSize, BreakpointSize, ColorName, FontColor, FontFamily, FontSize, FontWeight, HeadingSize, HeightSize, LineHeightSize, SpacingSize, WidthSize, ZIndexSize, } from '@hyphen/hyphen-design-tokens/build/types';
3
+ export type { IconName, BackgroundColor, BaseColor, BorderColor, BorderSize, BoxShadowSize, BreakpointSize, ColorName, FontColor, FontFamily, FontSize, FontWeight, HeadingSize, HeightSize, LineHeightSize, SpacingSize, TextDecorationLine, TextDecorationStyle, TextTransform, TextWrap, WidthSize, WhiteSpace, WordBreak, ZIndexSize, } from '@hyphen/hyphen-design-tokens/build/types';
4
4
  export type BreakpointSizeWithBase = BreakpointSize | 'base';
5
5
  export type Breakpoint = {
6
6
  name: BreakpointSizeWithBase;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyphen/hyphen-components",
3
- "version": "6.6.0",
3
+ "version": "6.8.0",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "@hyphen"
@@ -62,7 +62,7 @@
62
62
  ],
63
63
  "dependencies": {
64
64
  "@emotion/react": "^11.14.0",
65
- "@hyphen/hyphen-design-tokens": "^5.6.0",
65
+ "@hyphen/hyphen-design-tokens": "^5.10.0",
66
66
  "@radix-ui/react-aspect-ratio": "^1.1.7",
67
67
  "@radix-ui/react-collapsible": "^1.1.12",
68
68
  "@radix-ui/react-dropdown-menu": "^2.1.16",
@@ -1855,3 +1855,143 @@ export const Omit = () => (
1855
1855
  </p>
1856
1856
  </Box>
1857
1857
  );
1858
+
1859
+ export const TextWrap = () => {
1860
+ const sampleText =
1861
+ 'This is a long line of text that demonstrates different text wrapping behaviors. The quick brown fox jumps over the lazy dog. Built by developers, for developers, Hyphen automates access management.';
1862
+
1863
+ return (
1864
+ <Box gap="lg">
1865
+ <Box gap="sm">
1866
+ <Box fontWeight="bold">wrap (default)</Box>
1867
+ <Box
1868
+ textWrap="wrap"
1869
+ maxWidth="300px"
1870
+ padding="md"
1871
+ background="tertiary"
1872
+ borderWidth="sm"
1873
+ borderColor="default"
1874
+ >
1875
+ {sampleText}
1876
+ </Box>
1877
+ </Box>
1878
+
1879
+ <Box gap="sm">
1880
+ <Box fontWeight="bold">nowrap</Box>
1881
+ <Box
1882
+ textWrap="nowrap"
1883
+ maxWidth="300px"
1884
+ padding="md"
1885
+ background="tertiary"
1886
+ borderWidth="sm"
1887
+ borderColor="default"
1888
+ overflow="hidden"
1889
+ >
1890
+ {sampleText}
1891
+ </Box>
1892
+ </Box>
1893
+
1894
+ <Box gap="sm">
1895
+ <Box fontWeight="bold">balance</Box>
1896
+ <Box
1897
+ textWrap="balance"
1898
+ maxWidth="300px"
1899
+ padding="md"
1900
+ background="tertiary"
1901
+ borderWidth="sm"
1902
+ borderColor="default"
1903
+ >
1904
+ {sampleText}
1905
+ </Box>
1906
+ </Box>
1907
+
1908
+ <Box gap="sm">
1909
+ <Box fontWeight="bold">pretty</Box>
1910
+ <Box
1911
+ textWrap="pretty"
1912
+ maxWidth="300px"
1913
+ padding="md"
1914
+ background="tertiary"
1915
+ borderWidth="sm"
1916
+ borderColor="default"
1917
+ >
1918
+ {sampleText}
1919
+ </Box>
1920
+ </Box>
1921
+
1922
+ <Box gap="sm">
1923
+ <Box fontWeight="bold">stable</Box>
1924
+ <Box
1925
+ textWrap="stable"
1926
+ maxWidth="300px"
1927
+ padding="md"
1928
+ background="tertiary"
1929
+ borderWidth="sm"
1930
+ borderColor="default"
1931
+ >
1932
+ {sampleText}
1933
+ </Box>
1934
+ </Box>
1935
+ </Box>
1936
+ );
1937
+ };
1938
+
1939
+ export const TextTransform = () => {
1940
+ const sampleText = 'The Quick Brown Fox Jumps Over The Lazy Dog';
1941
+
1942
+ return (
1943
+ <Box gap="lg">
1944
+ <Box gap="sm">
1945
+ <Box fontWeight="bold">uppercase</Box>
1946
+ <Box
1947
+ textTransform="uppercase"
1948
+ padding="md"
1949
+ background="tertiary"
1950
+ borderWidth="sm"
1951
+ borderColor="default"
1952
+ >
1953
+ {sampleText}
1954
+ </Box>
1955
+ </Box>
1956
+
1957
+ <Box gap="sm">
1958
+ <Box fontWeight="bold">lowercase</Box>
1959
+ <Box
1960
+ textTransform="lowercase"
1961
+ padding="md"
1962
+ background="tertiary"
1963
+ borderWidth="sm"
1964
+ borderColor="default"
1965
+ >
1966
+ {sampleText}
1967
+ </Box>
1968
+ </Box>
1969
+
1970
+ <Box gap="sm">
1971
+ <Box fontWeight="bold">capitalize</Box>
1972
+ <Box
1973
+ textTransform="capitalize"
1974
+ padding="md"
1975
+ background="tertiary"
1976
+ borderWidth="sm"
1977
+ borderColor="default"
1978
+ >
1979
+ {sampleText}
1980
+ </Box>
1981
+ </Box>
1982
+
1983
+ <Box gap="sm">
1984
+ <Box fontWeight="bold">normal-case</Box>
1985
+ <Box
1986
+ textTransform="normal-case"
1987
+ padding="md"
1988
+ background="tertiary"
1989
+ borderWidth="sm"
1990
+ borderColor="default"
1991
+ >
1992
+ {sampleText}
1993
+ </Box>
1994
+ </Box>
1995
+ </Box>
1996
+ );
1997
+ };
@@ -27,6 +27,8 @@ import {
27
27
  BorderColor,
28
28
  CssWhiteSpaceValue,
29
29
  CssWordBreakValue,
30
+ TextWrap,
31
+ TextTransform,
30
32
  } from '../../types';
31
33
  import {
32
34
  CSSProperties,
@@ -251,10 +253,22 @@ export interface BoxProps {
251
253
  * the alignment of the text
252
254
  */
253
255
  textAlign?: CssTextAlignValue | ResponsiveProp<CssTextAlignValue>;
256
+ /**
257
+ * Control the text transformation of the Box
258
+ */
259
+ textTransform?: TextTransform | ResponsiveProp<TextTransform>;
260
+ /**
261
+ * Control the text wrapping behavior of the Box
262
+ */
263
+ textWrap?: TextWrap | ResponsiveProp<TextWrap>;
254
264
  /**
255
265
  * Control the whitespace behavior of the Box
256
266
  */
257
267
  whiteSpace?: CssWhiteSpaceValue | ResponsiveProp<CssWhiteSpaceValue>;
268
+ /**
269
+ * Control the word break behavior of the Box
270
+ */
271
+ wordBreak?: CssWordBreakValue | ResponsiveProp<CssWordBreakValue>;
258
272
  /**
259
273
  * By default, a Box's items will all try to fit onto one line.
260
274
  * Change that and allow the items to wrap as needed wrap
@@ -268,7 +282,6 @@ export interface BoxProps {
268
282
  /**
269
283
  * Control the word break behavior of the Box
270
284
  */
271
- wordBreak?: CssWordBreakValue | ResponsiveProp<CssWordBreakValue>;
272
285
  /**
273
286
  * ZIndex value for the element. Can be one of the predetermined token values.
274
287
  * Can be responsive.
@@ -324,6 +337,8 @@ export const Box: FC<BoxProps> = forwardRef(
324
337
  shadow = undefined,
325
338
  style = {},
326
339
  textAlign = undefined,
340
+ textTransform = undefined,
341
+ textWrap = undefined,
327
342
  wrap = undefined,
328
343
  whiteSpace = undefined,
329
344
  width = undefined,
@@ -424,6 +439,8 @@ export const Box: FC<BoxProps> = forwardRef(
424
439
  cssShorthandToClasses('bw', borderWidth),
425
440
  generateResponsiveClasses('font-weight', fontWeight),
426
441
  generateResponsiveClasses('text-align', textAlign),
442
+ generateResponsiveClasses('transform', textTransform),
443
+ generateResponsiveClasses('text-wrap', textWrap),
427
444
  generateResponsiveClasses('position', position),
428
445
  generateResponsiveClasses('z-index', zIndex),
429
446
  generateResponsiveClasses('whitespace', whiteSpace),
@@ -646,6 +663,8 @@ export const boxPropsKeys: (keyof Pick<BoxProps, KnownKeys<BoxProps>>)[] = [
646
663
  'shadow',
647
664
  'style',
648
665
  'textAlign',
666
+ 'textTransform',
667
+ 'textWrap',
649
668
  'wrap',
650
669
  'width',
651
670
  'zIndex',
@@ -25,7 +25,13 @@ export type {
25
25
  HeightSize,
26
26
  LineHeightSize,
27
27
  SpacingSize,
28
+ TextDecorationLine,
29
+ TextDecorationStyle,
30
+ TextTransform,
31
+ TextWrap,
28
32
  WidthSize,
33
+ WhiteSpace,
34
+ WordBreak,
29
35
  ZIndexSize,
30
36
  } from '@hyphen/hyphen-design-tokens/build/types';
31
37