@heliosgraphics/ui 2.0.0-alpha.95 → 2.0.0-alpha.97

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.
Files changed (110) hide show
  1. package/components/Alert/Alert.tsx +2 -0
  2. package/components/Breadcrumb/Breadcrumb.tsx +17 -1
  3. package/components/Browser/Browser.tsx +2 -0
  4. package/components/Button/Button.tsx +7 -3
  5. package/components/ButtonGroup/ButtonGroup.tsx +2 -0
  6. package/components/Checkbox/Checkbox.tsx +66 -55
  7. package/components/Clock/Clock.tsx +23 -19
  8. package/components/Column/Column.tsx +2 -0
  9. package/components/Confirm/Confirm.tsx +2 -0
  10. package/components/DatePicker/DatePicker.meta.ts +12 -5
  11. package/components/DatePicker/DatePicker.module.css +70 -1
  12. package/components/DatePicker/DatePicker.tsx +116 -4
  13. package/components/DatePicker/DatePicker.types.ts +6 -1
  14. package/components/DatePicker/DatePicker.utils.ts +53 -0
  15. package/components/Debug/Debug.tsx +2 -0
  16. package/components/Details/Details.tsx +2 -0
  17. package/components/Dialog/Dialog.module.css +4 -6
  18. package/components/Dialog/Dialog.tsx +33 -24
  19. package/components/Donut/Donut.tsx +2 -0
  20. package/components/Dot/Dot.tsx +2 -0
  21. package/components/Dropdown/Dropdown.module.css +5 -0
  22. package/components/Dropdown/Dropdown.tsx +21 -26
  23. package/components/Fieldset/Fieldset.tsx +2 -0
  24. package/components/Flex/Flex.meta.ts +1 -0
  25. package/components/Flex/Flex.tsx +22 -2
  26. package/components/Flex/Flex.types.ts +1 -0
  27. package/components/Flex/Flex.utils.spec.ts +4 -1
  28. package/components/Flex/Flex.utils.ts +4 -1
  29. package/components/Grid/Grid.tsx +2 -0
  30. package/components/Heading/Heading.meta.ts +5 -0
  31. package/components/Heading/Heading.tsx +15 -9
  32. package/components/Heading/Heading.types.ts +1 -0
  33. package/components/Heading/components/H0/H0.tsx +2 -0
  34. package/components/Heading/components/H1/H1.tsx +2 -0
  35. package/components/Heading/components/H2/H2.tsx +2 -0
  36. package/components/Heading/components/H3/H3.tsx +2 -0
  37. package/components/Heading/components/H4/H4.tsx +2 -0
  38. package/components/Heading/components/H5/H5.tsx +2 -0
  39. package/components/Heading/components/H6/H6.tsx +2 -0
  40. package/components/Icon/Icon.tsx +2 -0
  41. package/components/Input/Input.tsx +103 -95
  42. package/components/Layout/Layout.tsx +2 -0
  43. package/components/Layout/components/LayoutAside/LayoutAside.tsx +2 -0
  44. package/components/Layout/components/LayoutAside/components/LayoutAsideContent/LayoutAsideContent.tsx +2 -0
  45. package/components/Layout/components/LayoutAside/components/LayoutAsideFooter/LayoutAsideFooter.tsx +2 -0
  46. package/components/Layout/components/LayoutAside/components/LayoutAsideToggle/LayoutAsideToggle.tsx +2 -0
  47. package/components/Layout/components/LayoutMain/LayoutMain.tsx +2 -0
  48. package/components/Layout/components/LayoutMain/components/LayoutMainContent/LayoutMainContent.tsx +2 -0
  49. package/components/Layout/components/LayoutNavigation/LayoutNavigation.tsx +2 -0
  50. package/components/Layout/components/LayoutSubNavigation/LayoutSubNavigation.tsx +2 -0
  51. package/components/Loading/Loading.tsx +2 -0
  52. package/components/Markdown/Markdown.tsx +2 -0
  53. package/components/Masonry/Masonry.tsx +5 -1
  54. package/components/Menu/Menu.tsx +2 -0
  55. package/components/Menu/components/MenuCategory/MenuCategory.tsx +2 -0
  56. package/components/Menu/components/MenuFilter/MenuFilter.tsx +2 -0
  57. package/components/Menu/components/MenuItem/MenuItem.tsx +2 -0
  58. package/components/Overlay/Overlay.tsx +18 -2
  59. package/components/Pie/Pie.tsx +2 -0
  60. package/components/Pill/Pill.meta.ts +9 -1
  61. package/components/Pill/Pill.module.css +11 -0
  62. package/components/Pill/Pill.tsx +28 -3
  63. package/components/Pill/Pill.types.ts +2 -0
  64. package/components/Placeholder/Placeholder.tsx +2 -0
  65. package/components/Progress/Progress.tsx +2 -0
  66. package/components/Radio/Radio.tsx +2 -0
  67. package/components/Range/Range.tsx +2 -0
  68. package/components/Segments/Segments.context.ts +19 -0
  69. package/components/Segments/Segments.meta.ts +4 -0
  70. package/components/Segments/Segments.tsx +34 -42
  71. package/components/Segments/Segments.types.ts +1 -0
  72. package/components/Segments/components/SegmentButton/SegmentButton.meta.ts +0 -4
  73. package/components/Segments/components/SegmentButton/SegmentButton.tsx +28 -3
  74. package/components/Segments/components/SegmentButton/SegmentButton.types.ts +0 -2
  75. package/components/Select/Select.tsx +40 -43
  76. package/components/Separator/Separator.tsx +2 -0
  77. package/components/Separator/components/HRMarkup/HRMarkup.tsx +2 -0
  78. package/components/Separator/components/HorizontalSeparator/HorizontalSeparator.tsx +2 -0
  79. package/components/Separator/components/VerticalSeparator/VerticalSeparator.tsx +2 -0
  80. package/components/Setup/Setup.tsx +3 -0
  81. package/components/Shimmer/Shimmer.tsx +2 -0
  82. package/components/Slider/Slider.tsx +2 -0
  83. package/components/Spacer/Spacer.tsx +2 -0
  84. package/components/Table/Table.tsx +2 -0
  85. package/components/Tabs/Tabs.meta.ts +12 -12
  86. package/components/Tabs/Tabs.module.css +25 -9
  87. package/components/Tabs/Tabs.tsx +49 -53
  88. package/components/Tabs/Tabs.types.ts +10 -3
  89. package/components/Text/Text.tsx +2 -0
  90. package/components/Text/components/Div/Div.tsx +2 -0
  91. package/components/Text/components/Micro/Micro.tsx +2 -0
  92. package/components/Text/components/P/P.tsx +2 -0
  93. package/components/Text/components/Small/Small.tsx +2 -0
  94. package/components/Text/components/Tiny/Tiny.tsx +2 -0
  95. package/components/Textarea/Textarea.tsx +14 -13
  96. package/components/Tile/Tile.tsx +2 -0
  97. package/components/Timestamp/Timestamp.tsx +2 -0
  98. package/components/Toggle/Toggle.tsx +2 -0
  99. package/components/Tooltip/Tooltip.tsx +17 -9
  100. package/components/Tooltip/Tooltip.types.ts +0 -1
  101. package/components/Tooltip/components/TooltipContent/TooltipContent.tsx +2 -0
  102. package/components/Tooltip/components/TooltipTrigger/TooltipTrigger.tsx +4 -2
  103. package/components/shared/InputLabel/InputLabel.tsx +2 -0
  104. package/components/shared/ResultList/ResultList.tsx +6 -4
  105. package/contexts/LayoutContext/LayoutContext.tsx +15 -34
  106. package/contexts/LayoutContext/LayoutContext.types.ts +0 -1
  107. package/hooks/useLayoutContext.tsx +0 -1
  108. package/hooks/useResizeObserver.tsx +2 -2
  109. package/index.ts +5 -0
  110. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
 
3
- import { useId, type FC } from "react"
3
+ import { useId, forwardRef } from "react"
4
4
  import { getClasses } from "@heliosgraphics/utils"
5
5
  import { Button } from "../Button"
6
6
  import { ButtonGroup } from "../ButtonGroup"
@@ -13,104 +13,112 @@ import styles from "./Input.module.css"
13
13
  import type { InputProps } from "./Input.types"
14
14
  import type { ResultItem } from "../shared/ResultList"
15
15
 
16
- export const Input: FC<InputProps> = ({
17
- className,
18
- helperText,
19
- id,
20
- isDisabled,
21
- autoComplete,
22
- autoFocus,
23
- isLabelHidden,
24
- isLoading,
25
- isRequired,
26
- label,
27
- maxLength,
28
- name,
29
- onBlur,
30
- onChange,
31
- onClear,
32
- onFocus,
33
- onKeyDown,
34
- onKeyUp,
35
- placeholder,
36
- results,
37
- showResults,
38
- type = "text",
39
- value,
40
- }) => {
41
- const generatedId: string = useId()
42
- const htmlFor: string = id || generatedId
43
- const helperId: string = `${htmlFor}-helper`
16
+ export const Input = forwardRef<HTMLInputElement, InputProps>(
17
+ (
18
+ {
19
+ className,
20
+ helperText,
21
+ id,
22
+ isDisabled,
23
+ autoComplete,
24
+ autoFocus,
25
+ isLabelHidden,
26
+ isLoading,
27
+ isRequired,
28
+ label,
29
+ maxLength,
30
+ name,
31
+ onBlur,
32
+ onChange,
33
+ onClear,
34
+ onFocus,
35
+ onKeyDown,
36
+ onKeyUp,
37
+ placeholder,
38
+ results,
39
+ showResults,
40
+ type = "text",
41
+ value,
42
+ },
43
+ ref,
44
+ ) => {
45
+ const generatedId: string = useId()
46
+ const htmlFor: string = id || generatedId
47
+ const helperId: string = `${htmlFor}-helper`
44
48
 
45
- const filteredItems: Array<ResultItem> =
46
- results
47
- ?.filter((item) => {
48
- const lowerCaseItem: string = item.name.toLowerCase()
49
- const lowerCaseFilter: string | undefined = value?.toLowerCase()
49
+ const filteredItems: Array<ResultItem> =
50
+ results
51
+ ?.filter((item) => {
52
+ const lowerCaseItem: string = item.name.toLowerCase()
53
+ const lowerCaseFilter: string | undefined = value?.toLowerCase()
50
54
 
51
- return lowerCaseFilter && lowerCaseItem.includes(lowerCaseFilter)
52
- })
53
- .filter(Boolean) || []
55
+ return lowerCaseFilter && lowerCaseItem.includes(lowerCaseFilter)
56
+ })
57
+ .filter(Boolean) || []
54
58
 
55
- const showingResults: boolean = Boolean(!!filteredItems?.length && showResults)
59
+ const showingResults: boolean = Boolean(!!filteredItems?.length && showResults)
56
60
 
57
- const inputClasses: string = getClasses(styles.input, "relative flex flex-column", className, {
58
- [styles.inputDisabled]: isDisabled,
59
- [styles.inputShowingResults]: showingResults,
60
- })
61
+ const inputClasses: string = getClasses(styles.input, "relative flex flex-column", className, {
62
+ [styles.inputDisabled]: isDisabled,
63
+ [styles.inputShowingResults]: showingResults,
64
+ })
61
65
 
62
- return (
63
- <div className={inputClasses} data-ui-component="Input">
64
- <InputLabel id={htmlFor} label={label} isDisabled={!!isDisabled} isHidden={!!isLabelHidden} />
65
- <Flex className="grow-1">
66
- {onClear && !!value && (
67
- <ButtonGroup className={styles.input__clear}>
68
- <Button
69
- value="Clear"
70
- size="tiny"
71
- intent="neutral"
72
- icon="x"
73
- onClick={onClear}
74
- isIconOnly={true}
75
- isRounded={true}
76
- />
77
- </ButtonGroup>
78
- )}
79
- <input
80
- className={styles.input__input}
81
- disabled={isDisabled}
82
- autoComplete={autoComplete}
83
- autoFocus={autoFocus}
84
- id={htmlFor}
85
- maxLength={maxLength}
86
- name={name}
87
- onBlur={onBlur}
88
- type={type}
89
- onChange={onChange}
90
- onFocus={onFocus}
91
- onKeyDown={onKeyDown}
92
- onKeyUp={onKeyUp}
93
- placeholder={placeholder}
94
- required={isRequired}
95
- value={value}
96
- aria-describedby={helperText ? helperId : undefined}
97
- />
98
- {isLoading && (
99
- <div className={styles.input__loading}>
100
- <Loading size={20} />
66
+ return (
67
+ <div className={inputClasses} data-ui-component="Input">
68
+ <InputLabel id={htmlFor} label={label} isDisabled={!!isDisabled} isHidden={!!isLabelHidden} />
69
+ <Flex className="grow-1">
70
+ {onClear && !!value && (
71
+ <ButtonGroup className={styles.input__clear}>
72
+ <Button
73
+ value="Clear"
74
+ size="tiny"
75
+ intent="neutral"
76
+ icon="x"
77
+ onClick={onClear}
78
+ isIconOnly={true}
79
+ isRounded={true}
80
+ />
81
+ </ButtonGroup>
82
+ )}
83
+ <input
84
+ ref={ref}
85
+ className={styles.input__input}
86
+ disabled={isDisabled}
87
+ autoComplete={autoComplete}
88
+ autoFocus={autoFocus}
89
+ id={htmlFor}
90
+ maxLength={maxLength}
91
+ name={name}
92
+ onBlur={onBlur}
93
+ type={type}
94
+ onChange={onChange}
95
+ onFocus={onFocus}
96
+ onKeyDown={onKeyDown}
97
+ onKeyUp={onKeyUp}
98
+ placeholder={placeholder}
99
+ required={isRequired}
100
+ value={value}
101
+ aria-describedby={helperText ? helperId : undefined}
102
+ />
103
+ {isLoading && (
104
+ <div className={styles.input__loading}>
105
+ <Loading size={20} />
106
+ </div>
107
+ )}
108
+ </Flex>
109
+ {showingResults && (
110
+ <div className={styles.input__results}>
111
+ <ResultList items={filteredItems} />
101
112
  </div>
102
113
  )}
103
- </Flex>
104
- {showingResults && (
105
- <div className={styles.input__results}>
106
- <ResultList items={filteredItems} />
107
- </div>
108
- )}
109
- {!!helperText && (
110
- <Text type="tiny" emphasis="tertiary" className={styles.input__helper} id={helperId}>
111
- {helperText}
112
- </Text>
113
- )}
114
- </div>
115
- )
116
- }
114
+ {!!helperText && (
115
+ <Text type="tiny" emphasis="tertiary" className={styles.input__helper} id={helperId}>
116
+ {helperText}
117
+ </Text>
118
+ )}
119
+ </div>
120
+ )
121
+ },
122
+ )
123
+
124
+ Input.displayName = "Input"
@@ -29,3 +29,5 @@ export const Layout: FC<LayoutProps> = (props) => {
29
29
  </LayoutProvider>
30
30
  )
31
31
  }
32
+
33
+ Layout.displayName = "Layout"
@@ -23,3 +23,5 @@ export const LayoutAside: FC<LayoutAsideProps> = ({ children }) => {
23
23
  </aside>
24
24
  )
25
25
  }
26
+
27
+ LayoutAside.displayName = "LayoutAside"
@@ -15,3 +15,5 @@ export const LayoutAsideContent: FC<LayoutAsideContentProps> = (props) => {
15
15
  </section>
16
16
  )
17
17
  }
18
+
19
+ LayoutAsideContent.displayName = "LayoutAsideContent"
@@ -15,3 +15,5 @@ export const LayoutAsideFooter: FC<LayoutAsideFooterProps> = (props) => {
15
15
  </footer>
16
16
  )
17
17
  }
18
+
19
+ LayoutAsideFooter.displayName = "LayoutAsideFooter"
@@ -25,3 +25,5 @@ export const LayoutAsideToggle: FC<LayoutAsideToggleProps> = () => {
25
25
  </ButtonGroup>
26
26
  )
27
27
  }
28
+
29
+ LayoutAsideToggle.displayName = "LayoutAsideToggle"
@@ -19,3 +19,5 @@ export const LayoutMain: FC<LayoutMainProps> = (props) => {
19
19
  </main>
20
20
  )
21
21
  }
22
+
23
+ LayoutMain.displayName = "LayoutMain"
@@ -39,3 +39,5 @@ export const LayoutMainContent: FC<LayoutMainContentProps> = (props) => {
39
39
  </section>
40
40
  )
41
41
  }
42
+
43
+ LayoutMainContent.displayName = "LayoutMainContent"
@@ -20,3 +20,5 @@ export const LayoutNavigation: FC<LayoutNavigationProps> = (props) => {
20
20
  </nav>
21
21
  )
22
22
  }
23
+
24
+ LayoutNavigation.displayName = "LayoutNavigation"
@@ -20,3 +20,5 @@ export const LayoutSubNavigation: FC<LayoutSubNavigationProps> = (props) => {
20
20
  </nav>
21
21
  )
22
22
  }
23
+
24
+ LayoutSubNavigation.displayName = "LayoutSubNavigation"
@@ -53,3 +53,5 @@ export const Loading: FC<LoadingProps> = ({ className, size, emphasis }) => {
53
53
  </svg>
54
54
  )
55
55
  }
56
+
57
+ Loading.displayName = "Loading"
@@ -23,3 +23,5 @@ export const Markdown: FC<MarkdownProps> = ({ text, children, isNonSelectable })
23
23
  </div>
24
24
  )
25
25
  }
26
+
27
+ Markdown.displayName = "Markdown"
@@ -31,7 +31,11 @@ export const Masonry: FC<MasonryProps> = ({
31
31
  return (
32
32
  <>
33
33
  <style dangerouslySetInnerHTML={{ __html: mediaStyles }} />
34
- <div className={id}>{children}</div>
34
+ <div className={id} data-ui-component="Masonry">
35
+ {children}
36
+ </div>
35
37
  </>
36
38
  )
37
39
  }
40
+
41
+ Masonry.displayName = "Masonry"
@@ -14,3 +14,5 @@ export const Menu: FC<MenuProps> = (props) => {
14
14
  </nav>
15
15
  )
16
16
  }
17
+
18
+ Menu.displayName = "Menu"
@@ -84,3 +84,5 @@ export const MenuCategory: FC<MenuCategoryProps> = ({
84
84
  </Flex>
85
85
  )
86
86
  }
87
+
88
+ MenuCategory.displayName = "MenuCategory"
@@ -21,3 +21,5 @@ export const MenuFilter: FC<MenuFilterProps> = ({ value, onClear, onChange }) =>
21
21
  </div>
22
22
  )
23
23
  }
24
+
25
+ MenuFilter.displayName = "MenuFilter"
@@ -69,3 +69,5 @@ export const MenuItem: FC<MenuItemProps> = ({
69
69
  </Flex>
70
70
  )
71
71
  }
72
+
73
+ MenuItem.displayName = "MenuItem"
@@ -1,5 +1,5 @@
1
1
  import styles from "./Overlay.module.css"
2
- import type { FC, MouseEvent } from "react"
2
+ import type { FC, MouseEvent, KeyboardEvent } from "react"
3
3
  import type { OverlayProps } from "./Overlay.types"
4
4
  import { getClasses } from "@heliosgraphics/utils"
5
5
 
@@ -11,6 +11,13 @@ export const Overlay: FC<OverlayProps> = ({ onClose, isCentered, children, isOpe
11
11
  return onClose?.()
12
12
  }
13
13
 
14
+ const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {
15
+ if (event.key === "Enter" || event.key === " ") {
16
+ event.preventDefault()
17
+ onClose?.()
18
+ }
19
+ }
20
+
14
21
  const contentClasses: string = getClasses(styles.overlay__content, {
15
22
  [styles.overlay__contentCentered]: isCentered,
16
23
  })
@@ -25,7 +32,16 @@ export const Overlay: FC<OverlayProps> = ({ onClose, isCentered, children, isOpe
25
32
  data-open={isOpen}
26
33
  >
27
34
  <div className={contentClasses}>{children}</div>
28
- <div className={styles.overlay__layer} onClick={hideFunction} />
35
+ <div
36
+ className={styles.overlay__layer}
37
+ onClick={hideFunction}
38
+ onKeyDown={handleKeyDown}
39
+ role="button"
40
+ tabIndex={0}
41
+ aria-label="Close overlay"
42
+ />
29
43
  </section>
30
44
  )
31
45
  }
46
+
47
+ Overlay.displayName = "Overlay"
@@ -43,3 +43,5 @@ export const Pie: FC<PieProps> = ({ color, size, data }) => {
43
43
  </svg>
44
44
  )
45
45
  }
46
+
47
+ Pie.displayName = "Pie"
@@ -28,8 +28,16 @@ export const meta: HeliosAttributeMeta<PillProps> = {
28
28
  type: "HeliosIconType",
29
29
  isOptional: true,
30
30
  },
31
+ isEllipsis: {
32
+ type: "boolean",
33
+ isOptional: true,
34
+ },
31
35
  isLabelHidden: {
32
- type: "(event?: unknown) => void",
36
+ type: "boolean",
37
+ isOptional: true,
38
+ },
39
+ isLoading: {
40
+ type: "boolean",
33
41
  isOptional: true,
34
42
  },
35
43
  isMono: {
@@ -51,3 +51,14 @@
51
51
  .pillTiny.pillRounded:not(.pillIconOnly) {
52
52
  padding: 0 8px;
53
53
  }
54
+
55
+ .pillEllipsis {
56
+ overflow: hidden;
57
+ max-width: 100%;
58
+ }
59
+
60
+ .pillEllipsis :global(.text) {
61
+ overflow: hidden;
62
+ text-overflow: ellipsis;
63
+ white-space: nowrap;
64
+ }
@@ -3,8 +3,9 @@ import { getColorClasses } from "../../utils/colors"
3
3
  import { Flex } from "../Flex"
4
4
  import { Text } from "../Text"
5
5
  import { Icon } from "../Icon"
6
+ import { Loading } from "../Loading"
6
7
  import styles from "./Pill.module.css"
7
- import { memo, type FC } from "react"
8
+ import { memo, type FC, type KeyboardEvent } from "react"
8
9
  import type { PillProps } from "./Pill.types"
9
10
 
10
11
  const PILL_ICON_SIZE = {
@@ -13,13 +14,21 @@ const PILL_ICON_SIZE = {
13
14
  normal: 24,
14
15
  } as const satisfies Record<string, number>
15
16
 
17
+ const PILL_LOADING_SIZE = {
18
+ tiny: 10,
19
+ small: 10,
20
+ normal: 20,
21
+ } as const satisfies Record<string, 10 | 20 | 40>
22
+
16
23
  export const Pill: FC<PillProps> = memo(
17
24
  ({
18
25
  appearance = "light",
19
26
  color = "gray",
20
27
  className,
21
28
  icon,
29
+ isEllipsis,
22
30
  isLabelHidden,
31
+ isLoading,
23
32
  isMono,
24
33
  isRounded,
25
34
  label,
@@ -38,21 +47,35 @@ export const Pill: FC<PillProps> = memo(
38
47
  [styles.pillTiny]: size === "tiny",
39
48
 
40
49
  [styles.pillIconOnly]: !!icon && isLabelHidden,
50
+ [styles.pillEllipsis]: isEllipsis,
41
51
  })
42
52
 
43
53
  const isSmall: boolean = size !== "normal"
44
54
  const pillTextSize = isSmall ? "tiny" : "small"
45
55
 
56
+ const onKeyDown = onClick
57
+ ? (event: KeyboardEvent<HTMLDivElement>): void => {
58
+ if (event.key === "Enter" || event.key === " ") {
59
+ event.preventDefault()
60
+ onClick(event as unknown as React.MouseEvent<HTMLDivElement>)
61
+ }
62
+ }
63
+ : undefined
64
+
65
+ const isInteractive: boolean = !!onClick && !isLoading
66
+
46
67
  return (
47
68
  <Flex
48
- {...(onClick && { onClick })}
69
+ {...(isInteractive && { onClick, role: "button", tabIndex: 0 })}
70
+ {...(isInteractive && onKeyDown && { onKeyDown })}
49
71
  className={pillClasses}
50
72
  isCentered={true}
51
73
  gap={2}
52
74
  aria-label={isLabelHidden ? label : undefined}
53
75
  data-ui-component="Pill"
54
76
  >
55
- {icon && <Icon size={PILL_ICON_SIZE[size] || 16} icon={icon} />}
77
+ {isLoading && <Loading size={PILL_LOADING_SIZE[size] || 20} />}
78
+ {!isLoading && icon && <Icon size={PILL_ICON_SIZE[size] || 16} icon={icon} />}
56
79
  {!isLabelHidden && (
57
80
  <Text type={pillTextSize} whiteSpace="nowrap" {...(isMono && { fontFamily: "mono" })} fontWeight="medium">
58
81
  {label}
@@ -62,3 +85,5 @@ export const Pill: FC<PillProps> = memo(
62
85
  )
63
86
  },
64
87
  )
88
+
89
+ Pill.displayName = "Pill"
@@ -8,7 +8,9 @@ export interface PillProps {
8
8
  color: HeliosColorType
9
9
  className?: string
10
10
  icon?: HeliosIconType
11
+ isEllipsis?: boolean
11
12
  isLabelHidden?: boolean
13
+ isLoading?: boolean
12
14
  isMono?: boolean
13
15
  isRounded?: boolean
14
16
  label: string
@@ -20,3 +20,5 @@ export const Placeholder: FC<PlaceholderProps> = ({ children, height }) => {
20
20
  </Flex>
21
21
  )
22
22
  }
23
+
24
+ Placeholder.displayName = "Placeholder"
@@ -26,3 +26,5 @@ export const Progress: FC<ProgressProps> = ({
26
26
  />
27
27
  )
28
28
  }
29
+
30
+ Progress.displayName = "Progress"
@@ -69,3 +69,5 @@ export const Radio: FC<RadioProps> = ({
69
69
  </div>
70
70
  )
71
71
  }
72
+
73
+ Radio.displayName = "Radio"
@@ -45,3 +45,5 @@ export const Range: FC<RangeProps> = ({
45
45
  </div>
46
46
  )
47
47
  }
48
+
49
+ Range.displayName = "Range"
@@ -0,0 +1,19 @@
1
+ "use client"
2
+
3
+ import { createContext, useContext } from "react"
4
+
5
+ export interface SegmentsContextValue {
6
+ activeValue: string
7
+ onSelect: (value: string) => void
8
+ registerRef: (value: string, el: HTMLButtonElement | null) => void
9
+ }
10
+
11
+ export const SegmentsContext = createContext<SegmentsContextValue | null>(null)
12
+
13
+ export const useSegments = (): SegmentsContextValue => {
14
+ const context = useContext(SegmentsContext)
15
+
16
+ if (!context) throw new Error("SegmentButton must be used within Segments")
17
+
18
+ return context
19
+ }
@@ -12,6 +12,10 @@ export const meta: HeliosAttributeMeta<SegmentsBaseProps> = {
12
12
  ],
13
13
  _status: "nominal",
14
14
  _category: "core",
15
+ defaultValue: {
16
+ type: "string",
17
+ isOptional: true,
18
+ },
15
19
  isFullWidth: {
16
20
  type: "boolean",
17
21
  isOptional: true,