@heliosgraphics/ui 2.0.0-alpha.94 → 2.0.0-alpha.95
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/components/Button/Button.tsx +4 -4
- package/components/Dialog/Dialog.module.css +47 -37
- package/components/Dialog/Dialog.tsx +1 -45
- package/components/Donut/Donut.tsx +3 -6
- package/components/Dropdown/Dropdown.module.css +20 -10
- package/components/Dropdown/Dropdown.tsx +1 -3
- package/components/Flex/Flex.tsx +2 -1
- package/components/Heading/components/H1/H1.tsx +2 -1
- package/components/Heading/components/H2/H2.tsx +2 -1
- package/components/Heading/components/H3/H3.tsx +2 -1
- package/components/Heading/components/H4/H4.tsx +2 -1
- package/components/Heading/components/H5/H5.tsx +2 -1
- package/components/Heading/components/H6/H6.tsx +2 -1
- package/components/Menu/components/MenuFilter/MenuFilter.tsx +0 -2
- package/components/Overlay/Overlay.module.css +42 -18
- package/components/Overlay/Overlay.tsx +8 -3
- package/components/Pill/Pill.tsx +2 -2
- package/components/Segments/components/SegmentButton/SegmentButton.tsx +2 -1
- package/components/Tabs/Tabs.tsx +5 -2
- package/components/Text/components/Div/Div.tsx +2 -1
- package/components/Text/components/Micro/Micro.tsx +2 -1
- package/components/Text/components/P/P.tsx +2 -1
- package/components/Text/components/Small/Small.tsx +2 -1
- package/components/Text/components/Tiny/Tiny.tsx +2 -1
- package/components/Tooltip/Tooltip.module.css +13 -0
- package/components/Tooltip/Tooltip.tsx +2 -2
- package/components/Tooltip/components/TooltipContent/TooltipContent.tsx +2 -0
- package/components/Tooltip/components/TooltipTrigger/TooltipTrigger.tsx +2 -0
- package/components/shared/ResultList/ResultList.tsx +2 -2
- package/constants/components.ts +2 -2
- package/constants/meta.ts +9 -9
- package/package.json +4 -4
|
@@ -13,17 +13,17 @@ import type { HeliosIconType } from "../../types/icons"
|
|
|
13
13
|
import type { HeliosColorType, HeliosAppearanceType } from "../../types/colors"
|
|
14
14
|
import type { ButtonProps } from "./Button.types"
|
|
15
15
|
|
|
16
|
-
const BUTTON_ICON_SIZE
|
|
16
|
+
const BUTTON_ICON_SIZE = {
|
|
17
17
|
tiny: 14,
|
|
18
18
|
small: 18,
|
|
19
19
|
normal: 24,
|
|
20
|
-
}
|
|
20
|
+
} as const satisfies Record<string, number>
|
|
21
21
|
|
|
22
|
-
const BUTTON_ICON_LABEL_SIZE
|
|
22
|
+
const BUTTON_ICON_LABEL_SIZE = {
|
|
23
23
|
tiny: 12,
|
|
24
24
|
small: 14,
|
|
25
25
|
normal: 16,
|
|
26
|
-
}
|
|
26
|
+
} as const satisfies Record<string, number>
|
|
27
27
|
|
|
28
28
|
export const Button: FC<ButtonProps> = ({
|
|
29
29
|
accept,
|
|
@@ -12,23 +12,49 @@
|
|
|
12
12
|
border-radius: var(--radius-lg) 0 0 var(--radius-lg);
|
|
13
13
|
touch-action: pan-y;
|
|
14
14
|
transform: translateX(-50%);
|
|
15
|
+
|
|
16
|
+
opacity: 0;
|
|
17
|
+
transition:
|
|
18
|
+
opacity var(--speed-lg) ease-in-out,
|
|
19
|
+
transform var(--speed-lg) ease-in-out,
|
|
20
|
+
overlay var(--speed-lg) ease-in-out allow-discrete,
|
|
21
|
+
display var(--speed-lg) ease-in-out allow-discrete;
|
|
15
22
|
}
|
|
16
23
|
|
|
17
|
-
.
|
|
18
|
-
|
|
24
|
+
.dialog[open] {
|
|
25
|
+
opacity: 1;
|
|
26
|
+
transform: translateX(-50%);
|
|
19
27
|
}
|
|
20
28
|
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
@starting-style {
|
|
30
|
+
.dialog[open] {
|
|
31
|
+
opacity: 0;
|
|
32
|
+
transform: translateX(-50%) translateY(6px);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.dialogNarrow {
|
|
37
|
+
width: 420px;
|
|
23
38
|
}
|
|
24
39
|
|
|
25
40
|
.dialogCentered {
|
|
26
41
|
top: 50%;
|
|
27
42
|
|
|
28
|
-
animation: dialogCenterFadeIn var(--speed-lg) ease-in-out;
|
|
29
43
|
transform: translateX(-50%) translateY(-50%);
|
|
30
44
|
}
|
|
31
45
|
|
|
46
|
+
.dialogCentered[open] {
|
|
47
|
+
opacity: 1;
|
|
48
|
+
transform: translateX(-50%) translateY(-50%);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@starting-style {
|
|
52
|
+
.dialogCentered[open] {
|
|
53
|
+
opacity: 0;
|
|
54
|
+
transform: translateX(-50%) translateY(calc(-50% + 6px));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
32
58
|
.dialog__content {
|
|
33
59
|
position: relative;
|
|
34
60
|
z-index: var(--z-index-1);
|
|
@@ -48,9 +74,24 @@
|
|
|
48
74
|
.dialog::backdrop {
|
|
49
75
|
--ui-bg-backdrop: rgba(80, 80, 80, 0.5);
|
|
50
76
|
|
|
51
|
-
animation: backdropFadeIn var(--speed-sm) ease-in-out;
|
|
52
77
|
background-color: var(--ui-bg-backdrop);
|
|
53
78
|
backdrop-filter: blur(2px);
|
|
79
|
+
|
|
80
|
+
opacity: 0;
|
|
81
|
+
transition:
|
|
82
|
+
opacity var(--speed-sm) ease-in-out,
|
|
83
|
+
overlay var(--speed-sm) ease-in-out allow-discrete,
|
|
84
|
+
display var(--speed-sm) ease-in-out allow-discrete;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.dialog[open]::backdrop {
|
|
88
|
+
opacity: 1;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@starting-style {
|
|
92
|
+
.dialog[open]::backdrop {
|
|
93
|
+
opacity: 0;
|
|
94
|
+
}
|
|
54
95
|
}
|
|
55
96
|
|
|
56
97
|
@media (max-width: 576px) {
|
|
@@ -68,34 +109,3 @@
|
|
|
68
109
|
width: calc(100% - 16px);
|
|
69
110
|
}
|
|
70
111
|
}
|
|
71
|
-
|
|
72
|
-
@keyframes dialogFadeIn {
|
|
73
|
-
0% {
|
|
74
|
-
opacity: 0;
|
|
75
|
-
transform: translateX(-50%) translateY(6px);
|
|
76
|
-
}
|
|
77
|
-
100% {
|
|
78
|
-
opacity: 1;
|
|
79
|
-
transform: translateX(-50%) translateY(0);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@keyframes dialogCenterFadeIn {
|
|
84
|
-
0% {
|
|
85
|
-
opacity: 0;
|
|
86
|
-
transform: translateX(-50%) translateY(calc(-50% + 6px));
|
|
87
|
-
}
|
|
88
|
-
100% {
|
|
89
|
-
opacity: 1;
|
|
90
|
-
transform: translateX(-50%) translateY(-50%);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
@keyframes backdropFadeIn {
|
|
95
|
-
0% {
|
|
96
|
-
opacity: 0;
|
|
97
|
-
}
|
|
98
|
-
100% {
|
|
99
|
-
opacity: 1;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -9,9 +9,6 @@ import { Flex } from "../Flex"
|
|
|
9
9
|
import { getClasses } from "@heliosgraphics/utils"
|
|
10
10
|
import type { DialogProps } from "./Dialog.types"
|
|
11
11
|
|
|
12
|
-
const ATTRIBUTE_SCROLL = "data-scroll" as const
|
|
13
|
-
const POSITION_FIXED_CLASS = "fixed" as const
|
|
14
|
-
|
|
15
12
|
export const Dialog: FC<DialogProps> = ({
|
|
16
13
|
title,
|
|
17
14
|
children,
|
|
@@ -25,46 +22,12 @@ export const Dialog: FC<DialogProps> = ({
|
|
|
25
22
|
const dialogRef = useRef<HTMLDialogElement | null>(null)
|
|
26
23
|
const triggerRef = useRef<Element | null>(null)
|
|
27
24
|
|
|
28
|
-
const resetScroll = (): void => {
|
|
29
|
-
globalThis?.requestAnimationFrame(() => {
|
|
30
|
-
document.body.setAttribute(ATTRIBUTE_SCROLL, "")
|
|
31
|
-
dialogRef?.current?.scrollTo?.(0, 0)
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const resetDocumentStyle = (scrollPosition: number): void => {
|
|
36
|
-
globalThis?.requestAnimationFrame(() => {
|
|
37
|
-
document.body.style.position = ""
|
|
38
|
-
document.body.style.height = ""
|
|
39
|
-
document.body.style.top = ""
|
|
40
|
-
document.body.classList.remove(POSITION_FIXED_CLASS)
|
|
41
|
-
|
|
42
|
-
return globalThis?.scrollTo?.(0, scrollPosition)
|
|
43
|
-
})
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
return (): void => {
|
|
48
|
-
const localPos: string = document?.body?.getAttribute(ATTRIBUTE_SCROLL) ?? "0"
|
|
49
|
-
const scrollPosition: number = parseInt(localPos) ?? 0
|
|
50
|
-
|
|
51
|
-
resetDocumentStyle(scrollPosition)
|
|
52
|
-
resetScroll()
|
|
53
|
-
}
|
|
54
|
-
}, [title, isOpen])
|
|
55
|
-
|
|
56
25
|
useEffect(() => {
|
|
57
26
|
dialogRef?.current?.scrollTo?.(0, 0)
|
|
58
27
|
|
|
59
28
|
if (isOpen) {
|
|
60
29
|
triggerRef.current = document.activeElement
|
|
61
30
|
|
|
62
|
-
const localPosition: number = document?.documentElement?.scrollTop ?? 0
|
|
63
|
-
|
|
64
|
-
document.body.classList.add(POSITION_FIXED_CLASS)
|
|
65
|
-
document.body.style.top = `-${localPosition}px`
|
|
66
|
-
document.body.setAttribute(ATTRIBUTE_SCROLL, localPosition.toString())
|
|
67
|
-
|
|
68
31
|
dialogRef?.current?.showModal?.()
|
|
69
32
|
|
|
70
33
|
const dialog = dialogRef.current
|
|
@@ -85,14 +48,7 @@ export const Dialog: FC<DialogProps> = ({
|
|
|
85
48
|
}
|
|
86
49
|
triggerRef.current = null
|
|
87
50
|
}
|
|
88
|
-
} else
|
|
89
|
-
const localPos: string = document?.body?.getAttribute(ATTRIBUTE_SCROLL) ?? "0"
|
|
90
|
-
const scrollPosition: number = parseInt(localPos) ?? 0
|
|
91
|
-
|
|
92
|
-
document.body.classList.remove(POSITION_FIXED_CLASS)
|
|
93
|
-
|
|
94
|
-
resetDocumentStyle(scrollPosition)
|
|
95
|
-
|
|
51
|
+
} else {
|
|
96
52
|
dialogRef?.current?.close?.()
|
|
97
53
|
}
|
|
98
54
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
1
2
|
import { getDonutBorderSize } from "./Donut.utils"
|
|
2
3
|
import { Flex } from "../Flex"
|
|
3
4
|
import styles from "./Donut.module.css"
|
|
@@ -12,18 +13,14 @@ export const Donut: FC<DonutProps> = ({ children, size, percentage = 0, color })
|
|
|
12
13
|
const dashSize = 100 - percentage
|
|
13
14
|
const donutColor: string = `hsl(var(--${color}-hue), var(--${color}-saturation), 50%)`
|
|
14
15
|
|
|
16
|
+
const donutClasses: string = getClasses(styles.donut, "relative")
|
|
15
17
|
const donutContainerStyle: object = {
|
|
16
18
|
height: size + "px",
|
|
17
19
|
width: size + "px",
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
return (
|
|
21
|
-
<Flex
|
|
22
|
-
style={donutContainerStyle}
|
|
23
|
-
className={`${styles.donut} relative`}
|
|
24
|
-
isCentered={true}
|
|
25
|
-
data-ui-component="Donut"
|
|
26
|
-
>
|
|
23
|
+
<Flex style={donutContainerStyle} className={donutClasses} isCentered={true} data-ui-component="Donut">
|
|
27
24
|
<Flex className="absolute top-0 left-0 z-50" style={donutContainerStyle} isCentered={true}>
|
|
28
25
|
{children}
|
|
29
26
|
</Flex>
|
|
@@ -48,30 +48,40 @@
|
|
|
48
48
|
position: absolute;
|
|
49
49
|
z-index: var(--z-index-8);
|
|
50
50
|
|
|
51
|
+
display: none;
|
|
51
52
|
min-width: 240px;
|
|
52
53
|
opacity: 0;
|
|
53
54
|
|
|
54
55
|
transition:
|
|
56
|
+
display 96ms ease-in-out allow-discrete,
|
|
55
57
|
transform 96ms ease-in-out,
|
|
56
58
|
opacity 96ms ease-in-out;
|
|
57
59
|
pointer-events: none;
|
|
58
60
|
}
|
|
59
61
|
|
|
60
|
-
.
|
|
61
|
-
|
|
62
|
+
.dropdown__navActive {
|
|
63
|
+
display: block;
|
|
64
|
+
opacity: 1;
|
|
62
65
|
|
|
63
|
-
transform: translateY(0)
|
|
66
|
+
transform: translateY(0);
|
|
64
67
|
|
|
65
68
|
pointer-events: all;
|
|
66
|
-
}
|
|
67
69
|
|
|
68
|
-
@
|
|
69
|
-
0% {
|
|
70
|
+
@starting-style {
|
|
70
71
|
opacity: 0;
|
|
71
|
-
/* transform: translateY(-8px); */
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.dropdownBottomLeft .dropdown__navActive,
|
|
76
|
+
.dropdownBottomRight .dropdown__navActive {
|
|
77
|
+
@starting-style {
|
|
78
|
+
transform: translateY(-6px);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.dropdownTopLeft .dropdown__navActive,
|
|
83
|
+
.dropdownTopRight .dropdown__navActive {
|
|
84
|
+
@starting-style {
|
|
85
|
+
transform: translateY(6px);
|
|
76
86
|
}
|
|
77
87
|
}
|
|
@@ -86,9 +86,7 @@ export const Dropdown: FC<DropdownProps> = ({ children, items, isDisabled, posit
|
|
|
86
86
|
|
|
87
87
|
const onSetVisible = (): void => setVisible(!isVisible)
|
|
88
88
|
|
|
89
|
-
const navClasses: string = getClasses(styles.dropdown__nav,
|
|
90
|
-
[styles.dropdown__navActive]: isVisible,
|
|
91
|
-
})
|
|
89
|
+
const navClasses: string = getClasses(styles.dropdown__nav, isVisible && styles.dropdown__navActive)
|
|
92
90
|
|
|
93
91
|
const itemsWithClose = useMemo(
|
|
94
92
|
() =>
|
package/components/Flex/Flex.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getFlexUtility, getSafeFlexProps } from "../Flex/Flex.utils"
|
|
2
2
|
import type { FlexProps } from "./Flex.types"
|
|
3
|
+
import type { FC } from "react"
|
|
3
4
|
|
|
4
|
-
export const Flex = (props
|
|
5
|
+
export const Flex: FC<FlexProps> = (props) => {
|
|
5
6
|
const { ref, ...restProps } = props
|
|
6
7
|
const flexClasses: string = getFlexUtility(restProps)
|
|
7
8
|
const safeProps = getSafeFlexProps(restProps)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
1
2
|
import type { FC } from "react"
|
|
2
3
|
import type { H1Props } from "./H1.types"
|
|
3
4
|
|
|
4
5
|
export const H1: FC<H1Props> = (props) => {
|
|
5
|
-
return <h1 {...props} className={
|
|
6
|
+
return <h1 {...props} className={getClasses("h1", props.className)} data-ui-component="Heading.H1" />
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
1
2
|
import type { FC } from "react"
|
|
2
3
|
import type { H2Props } from "./H2.types"
|
|
3
4
|
|
|
4
5
|
export const H2: FC<H2Props> = (props) => {
|
|
5
|
-
return <h2 {...props} className={
|
|
6
|
+
return <h2 {...props} className={getClasses("h2", props.className)} data-ui-component="Heading.H2" />
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
1
2
|
import type { FC } from "react"
|
|
2
3
|
import type { H3Props } from "./H3.types"
|
|
3
4
|
|
|
4
5
|
export const H3: FC<H3Props> = (props) => {
|
|
5
|
-
return <h3 {...props} className={
|
|
6
|
+
return <h3 {...props} className={getClasses("h3", props.className)} data-ui-component="Heading.H3" />
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
1
2
|
import type { FC } from "react"
|
|
2
3
|
import type { H4Props } from "./H4.types"
|
|
3
4
|
|
|
4
5
|
export const H4: FC<H4Props> = (props) => {
|
|
5
|
-
return <h4 {...props} className={
|
|
6
|
+
return <h4 {...props} className={getClasses("h4", props.className)} data-ui-component="Heading.H4" />
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
1
2
|
import type { FC } from "react"
|
|
2
3
|
import type { H5Props } from "./H5.types"
|
|
3
4
|
|
|
4
5
|
export const H5: FC<H5Props> = (props) => {
|
|
5
|
-
return <h5 {...props} className={
|
|
6
|
+
return <h5 {...props} className={getClasses("h5", props.className)} data-ui-component="Heading.H5" />
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
1
2
|
import type { FC } from "react"
|
|
2
3
|
import type { H6Props } from "./H6.types"
|
|
3
4
|
|
|
4
5
|
export const H6: FC<H6Props> = (props) => {
|
|
5
|
-
return <h6 {...props} className={
|
|
6
|
+
return <h6 {...props} className={getClasses("h6", props.className)} data-ui-component="Heading.H6" />
|
|
6
7
|
}
|
|
@@ -7,18 +7,50 @@
|
|
|
7
7
|
height: 100%;
|
|
8
8
|
overflow: auto;
|
|
9
9
|
width: 100%;
|
|
10
|
+
|
|
11
|
+
display: grid;
|
|
12
|
+
opacity: 1;
|
|
13
|
+
transition:
|
|
14
|
+
opacity var(--speed-md) ease-in-out,
|
|
15
|
+
display var(--speed-md) ease-in-out allow-discrete;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.overlay[data-open="false"] {
|
|
19
|
+
display: none;
|
|
20
|
+
opacity: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@starting-style {
|
|
24
|
+
.overlay[data-open="true"] {
|
|
25
|
+
opacity: 0;
|
|
26
|
+
}
|
|
10
27
|
}
|
|
11
28
|
|
|
12
29
|
.overlay__content {
|
|
13
30
|
height: 100%;
|
|
14
|
-
opacity:
|
|
31
|
+
opacity: 1;
|
|
32
|
+
transform: translateY(0);
|
|
15
33
|
|
|
16
|
-
|
|
17
|
-
|
|
34
|
+
transition:
|
|
35
|
+
opacity var(--speed-sm) ease-in-out,
|
|
36
|
+
transform var(--speed-sm) ease-in-out;
|
|
37
|
+
transition-delay: 120ms;
|
|
18
38
|
|
|
19
39
|
pointer-events: none;
|
|
20
40
|
}
|
|
21
41
|
|
|
42
|
+
.overlay[data-open="false"] .overlay__content {
|
|
43
|
+
opacity: 0;
|
|
44
|
+
transform: translateY(-24px);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@starting-style {
|
|
48
|
+
.overlay[data-open="true"] .overlay__content {
|
|
49
|
+
opacity: 0;
|
|
50
|
+
transform: translateY(-24px);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
22
54
|
.overlay__contentCentered {
|
|
23
55
|
align-content: center;
|
|
24
56
|
}
|
|
@@ -36,26 +68,18 @@
|
|
|
36
68
|
height: 100%;
|
|
37
69
|
width: 100%;
|
|
38
70
|
|
|
39
|
-
animation: animOverlayBackground var(--speed-md) ease-in-out forwards;
|
|
40
71
|
background-color: rgba(0, 0, 0, 0.85);
|
|
72
|
+
opacity: 1;
|
|
73
|
+
|
|
74
|
+
transition: opacity var(--speed-md) ease-in-out;
|
|
41
75
|
}
|
|
42
76
|
|
|
43
|
-
|
|
44
|
-
0
|
|
45
|
-
opacity: 0;
|
|
46
|
-
}
|
|
47
|
-
100% {
|
|
48
|
-
opacity: 1;
|
|
49
|
-
}
|
|
77
|
+
.overlay[data-open="false"] .overlay__layer {
|
|
78
|
+
opacity: 0;
|
|
50
79
|
}
|
|
51
80
|
|
|
52
|
-
@
|
|
53
|
-
|
|
81
|
+
@starting-style {
|
|
82
|
+
.overlay[data-open="true"] .overlay__layer {
|
|
54
83
|
opacity: 0;
|
|
55
|
-
transform: translateY(-24px);
|
|
56
|
-
}
|
|
57
|
-
100% {
|
|
58
|
-
opacity: 1;
|
|
59
|
-
transform: translateY(0);
|
|
60
84
|
}
|
|
61
85
|
}
|
|
@@ -4,8 +4,6 @@ import type { OverlayProps } from "./Overlay.types"
|
|
|
4
4
|
import { getClasses } from "@heliosgraphics/utils"
|
|
5
5
|
|
|
6
6
|
export const Overlay: FC<OverlayProps> = ({ onClose, isCentered, children, isOpen }) => {
|
|
7
|
-
if (!isOpen) return null
|
|
8
|
-
|
|
9
7
|
const hideFunction = (event: MouseEvent<HTMLDivElement>): void => {
|
|
10
8
|
event.preventDefault()
|
|
11
9
|
event.stopPropagation()
|
|
@@ -18,7 +16,14 @@ export const Overlay: FC<OverlayProps> = ({ onClose, isCentered, children, isOpe
|
|
|
18
16
|
})
|
|
19
17
|
|
|
20
18
|
return (
|
|
21
|
-
<section
|
|
19
|
+
<section
|
|
20
|
+
className={styles.overlay}
|
|
21
|
+
role="dialog"
|
|
22
|
+
aria-modal="true"
|
|
23
|
+
aria-hidden={!isOpen}
|
|
24
|
+
data-ui-component="Overlay"
|
|
25
|
+
data-open={isOpen}
|
|
26
|
+
>
|
|
22
27
|
<div className={contentClasses}>{children}</div>
|
|
23
28
|
<div className={styles.overlay__layer} onClick={hideFunction} />
|
|
24
29
|
</section>
|
package/components/Pill/Pill.tsx
CHANGED
|
@@ -7,11 +7,11 @@ import styles from "./Pill.module.css"
|
|
|
7
7
|
import { memo, type FC } from "react"
|
|
8
8
|
import type { PillProps } from "./Pill.types"
|
|
9
9
|
|
|
10
|
-
const PILL_ICON_SIZE
|
|
10
|
+
const PILL_ICON_SIZE = {
|
|
11
11
|
tiny: 12,
|
|
12
12
|
small: 16,
|
|
13
13
|
normal: 24,
|
|
14
|
-
}
|
|
14
|
+
} as const satisfies Record<string, number>
|
|
15
15
|
|
|
16
16
|
export const Pill: FC<PillProps> = memo(
|
|
17
17
|
({
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import styles from "./SegmentButton.module.css"
|
|
2
2
|
import { getClasses } from "@heliosgraphics/utils"
|
|
3
3
|
import { Icon } from "../../../Icon"
|
|
4
|
+
import type { FC } from "react"
|
|
4
5
|
import type { HeliosIconType } from "../../../../types/icons"
|
|
5
6
|
import type { SegmentButtonProps } from "./SegmentButton.types"
|
|
6
7
|
|
|
7
|
-
export const SegmentButton = ({ isActive, value, icon, iconLeft, iconRight, onClick, ref }
|
|
8
|
+
export const SegmentButton: FC<SegmentButtonProps> = ({ isActive, value, icon, iconLeft, iconRight, onClick, ref }) => {
|
|
8
9
|
const segmentButtonClasses: string = getClasses(styles.segmentButton, {
|
|
9
10
|
[styles.segmentButtonActive]: isActive,
|
|
10
11
|
})
|
package/components/Tabs/Tabs.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
3
4
|
import { useId, useRef, useState, type FC, type KeyboardEvent } from "react"
|
|
4
5
|
import type { TabsProps } from "./Tabs.types"
|
|
5
6
|
import styles from "./Tabs.module.css"
|
|
@@ -12,6 +13,8 @@ export const Tabs: FC<TabsProps> = ({ active: activeNumber, items, sections }) =
|
|
|
12
13
|
|
|
13
14
|
if (!items || !sections) return null
|
|
14
15
|
|
|
16
|
+
const tabListClasses: string = getClasses(styles.tabs__ol, "flex gap-2")
|
|
17
|
+
|
|
15
18
|
const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>, index: number): void => {
|
|
16
19
|
let nextIndex: number | null = null
|
|
17
20
|
|
|
@@ -31,7 +34,7 @@ export const Tabs: FC<TabsProps> = ({ active: activeNumber, items, sections }) =
|
|
|
31
34
|
|
|
32
35
|
return (
|
|
33
36
|
<div data-ui-component="Tabs">
|
|
34
|
-
<div role="tablist" className={
|
|
37
|
+
<div role="tablist" className={tabListClasses}>
|
|
35
38
|
{items.map((tab, index) => (
|
|
36
39
|
<div
|
|
37
40
|
key={tab}
|
|
@@ -45,7 +48,7 @@ export const Tabs: FC<TabsProps> = ({ active: activeNumber, items, sections }) =
|
|
|
45
48
|
id={`${tabsId}-tab-${index}`}
|
|
46
49
|
onClick={() => setActive(index)}
|
|
47
50
|
onKeyDown={(event) => handleKeyDown(event, index)}
|
|
48
|
-
className={
|
|
51
|
+
className={getClasses(styles.tabs__ol__item, { [styles.tabs__ol__itemActive]: active === index })}
|
|
49
52
|
>
|
|
50
53
|
<Text type="small" fontWeight="medium">
|
|
51
54
|
{tab}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
1
2
|
import type { DivProps } from "./Div.types"
|
|
2
3
|
import type { FC } from "react"
|
|
3
4
|
|
|
4
5
|
export const Div: FC<DivProps> = (props) => {
|
|
5
|
-
return <div {...props} className={
|
|
6
|
+
return <div {...props} className={getClasses("p", props.className)} data-ui-component="Text.Div" />
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
1
2
|
import type { FC } from "react"
|
|
2
3
|
import type { MicroProps } from "./Micro.types"
|
|
3
4
|
|
|
4
5
|
export const Micro: FC<MicroProps> = (props) => {
|
|
5
|
-
return <small {...props} className={
|
|
6
|
+
return <small {...props} className={getClasses("micro", props.className)} data-ui-component="Text.Micro" />
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
1
2
|
import type { FC } from "react"
|
|
2
3
|
import type { PProps } from "./P.types"
|
|
3
4
|
|
|
4
5
|
export const P: FC<PProps> = (props) => {
|
|
5
|
-
return <p {...props} className={
|
|
6
|
+
return <p {...props} className={getClasses("p", props.className)} data-ui-component="Text.P" />
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
1
2
|
import type { FC } from "react"
|
|
2
3
|
import type { SmallProps } from "./Small.types"
|
|
3
4
|
|
|
4
5
|
export const Small: FC<SmallProps> = (props) => {
|
|
5
|
-
return <small {...props} className={
|
|
6
|
+
return <small {...props} className={getClasses("small", props.className)} data-ui-component="Text.Small" />
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getClasses } from "@heliosgraphics/utils"
|
|
1
2
|
import type { FC } from "react"
|
|
2
3
|
import type { TinyProps } from "./Tiny.types"
|
|
3
4
|
|
|
4
5
|
export const Tiny: FC<TinyProps> = (props) => {
|
|
5
|
-
return <small {...props} className={
|
|
6
|
+
return <small {...props} className={getClasses("tiny", props.className)} data-ui-component="Text.Tiny" />
|
|
6
7
|
}
|
|
@@ -19,6 +19,19 @@
|
|
|
19
19
|
border-radius: var(--radius-sm);
|
|
20
20
|
|
|
21
21
|
position-area: bottom center;
|
|
22
|
+
|
|
23
|
+
opacity: 1;
|
|
24
|
+
transition:
|
|
25
|
+
opacity 150ms ease-out,
|
|
26
|
+
display 150ms ease-out allow-discrete;
|
|
27
|
+
|
|
28
|
+
@starting-style {
|
|
29
|
+
opacity: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:not(:popover-open) {
|
|
33
|
+
opacity: 0;
|
|
34
|
+
}
|
|
22
35
|
}
|
|
23
36
|
|
|
24
37
|
.tooltipBottomLeft {
|
|
@@ -8,7 +8,7 @@ import { TooltipTrigger } from "./components/TooltipTrigger"
|
|
|
8
8
|
import { TooltipContent } from "./components/TooltipContent"
|
|
9
9
|
import { TooltipContext } from "./Tooltip.utils"
|
|
10
10
|
|
|
11
|
-
const POSITION_CLASS_MAP
|
|
11
|
+
const POSITION_CLASS_MAP = {
|
|
12
12
|
"bottom-center": undefined,
|
|
13
13
|
"bottom-left": styles.tooltipBottomLeft,
|
|
14
14
|
"bottom-right": styles.tooltipBottomRight,
|
|
@@ -17,7 +17,7 @@ const POSITION_CLASS_MAP: Record<NonNullable<TooltipProps["position"]>, string |
|
|
|
17
17
|
"top-right": styles.tooltipTopRight,
|
|
18
18
|
"left-center": styles.tooltipLeftCenter,
|
|
19
19
|
"right-center": styles.tooltipRightCenter,
|
|
20
|
-
}
|
|
20
|
+
} as const satisfies Record<NonNullable<TooltipProps["position"]>, string | undefined>
|
|
21
21
|
|
|
22
22
|
const TooltipComponent: FC<TooltipProps> = ({ children = null, position = "bottom-center", isVisible = false }) => {
|
|
23
23
|
const [isOpen, setIsOpen] = useState<boolean>(isVisible)
|
|
@@ -4,10 +4,10 @@ import { Flex } from "../../Flex"
|
|
|
4
4
|
import { Icon } from "../../Icon"
|
|
5
5
|
import { Text } from "../../Text"
|
|
6
6
|
import styles from "./ResultList.module.css"
|
|
7
|
-
import type { ChangeEvent } from "react"
|
|
7
|
+
import type { ChangeEvent, FC } from "react"
|
|
8
8
|
import type { ResultListProps } from "./ResultList.types"
|
|
9
9
|
|
|
10
|
-
export const ResultList = ({ items, isHidden, ref }
|
|
10
|
+
export const ResultList: FC<ResultListProps> = ({ items, isHidden, ref }) => {
|
|
11
11
|
if (!items?.length || isHidden) return null
|
|
12
12
|
|
|
13
13
|
const resultListClasses: string = getClasses(styles.resultList, "elevation-lg")
|
package/constants/components.ts
CHANGED
|
@@ -49,7 +49,7 @@ import { meta as metaTimestamp } from "../components/Timestamp/Timestamp.meta"
|
|
|
49
49
|
import { meta as metaToggle } from "../components/Toggle/Toggle.meta"
|
|
50
50
|
import { meta as metaTooltip } from "../components/Tooltip/Tooltip.meta"
|
|
51
51
|
|
|
52
|
-
export const COMPONENTS
|
|
52
|
+
export const COMPONENTS = {
|
|
53
53
|
Alert: metaAlert,
|
|
54
54
|
Breadcrumb: metaBreadcrumb,
|
|
55
55
|
Browser: metaBrowser,
|
|
@@ -98,4 +98,4 @@ export const COMPONENTS: Record<string, HeliosAttributeMeta<unknown>> = {
|
|
|
98
98
|
Timestamp: metaTimestamp,
|
|
99
99
|
Toggle: metaToggle,
|
|
100
100
|
Tooltip: metaTooltip,
|
|
101
|
-
}
|
|
101
|
+
} as const satisfies Record<string, HeliosAttributeMeta<unknown>>
|
package/constants/meta.ts
CHANGED
|
@@ -3,34 +3,34 @@ import type { HeliosComponentStatusType, HeliosComponentCategoryType } from "../
|
|
|
3
3
|
import type { HeliosColorType } from "../types/colors"
|
|
4
4
|
import type { HeliosIconType } from "../types/icons"
|
|
5
5
|
|
|
6
|
-
export const STATUS_COLORS
|
|
6
|
+
export const STATUS_COLORS = {
|
|
7
7
|
experimental: "pink",
|
|
8
8
|
nominal: "gray",
|
|
9
9
|
stable: "green",
|
|
10
10
|
internal: "gray",
|
|
11
|
-
}
|
|
11
|
+
} as const satisfies Record<HeliosComponentStatusType, HeliosColorType>
|
|
12
12
|
|
|
13
|
-
export const STATUS_ICONS
|
|
13
|
+
export const STATUS_ICONS = {
|
|
14
14
|
experimental: "bolt",
|
|
15
15
|
nominal: "bolt",
|
|
16
16
|
stable: "check",
|
|
17
17
|
internal: "bullseye",
|
|
18
|
-
}
|
|
18
|
+
} as const satisfies Record<HeliosComponentStatusType, HeliosIconType>
|
|
19
19
|
|
|
20
|
-
export const STATUS_NAMES
|
|
20
|
+
export const STATUS_NAMES = {
|
|
21
21
|
experimental: "Experimental",
|
|
22
22
|
nominal: "Might Change",
|
|
23
23
|
stable: "Stable",
|
|
24
24
|
internal: "Internal",
|
|
25
|
-
}
|
|
25
|
+
} as const satisfies Record<HeliosComponentStatusType, string>
|
|
26
26
|
|
|
27
|
-
export const TYPE_NAMES
|
|
27
|
+
export const TYPE_NAMES = {
|
|
28
28
|
content: "Content",
|
|
29
29
|
pattern: "Pattern",
|
|
30
30
|
core: "Core",
|
|
31
31
|
layout: "Layout",
|
|
32
32
|
meta: "Meta",
|
|
33
|
-
}
|
|
33
|
+
} as const satisfies Record<HeliosComponentCategoryType, string>
|
|
34
34
|
|
|
35
35
|
interface StatusReturnType {
|
|
36
36
|
color: HeliosColorType
|
|
@@ -40,7 +40,7 @@ interface StatusReturnType {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export const getStatus = (component: string = "Example"): StatusReturnType => {
|
|
43
|
-
const componentMeta = COMPONENTS[component]
|
|
43
|
+
const componentMeta = COMPONENTS[component as keyof typeof COMPONENTS]
|
|
44
44
|
|
|
45
45
|
if (!componentMeta || !componentMeta._status) {
|
|
46
46
|
throw new Error(`Component "${component}" not found or missing _status`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heliosgraphics/ui",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.95",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@heliosgraphics/css": "^1.0.0-alpha.5",
|
|
46
46
|
"@heliosgraphics/icons": "^1.0.0-alpha.11",
|
|
47
47
|
"@heliosgraphics/utils": "^6.0.0-alpha.9",
|
|
48
|
-
"marked": "^17.0.
|
|
48
|
+
"marked": "^17.0.3",
|
|
49
49
|
"marked-linkify-it": "^3.1.14",
|
|
50
50
|
"marked-xhtml": "^1.0.14"
|
|
51
51
|
},
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"@vitest/coverage-v8": "^4.0.18",
|
|
57
57
|
"esbuild": "^0.27.3",
|
|
58
58
|
"esbuild-css-modules-plugin": "^3.1.5",
|
|
59
|
-
"glob": "^13.0.
|
|
60
|
-
"jsdom": "^28.
|
|
59
|
+
"glob": "^13.0.6",
|
|
60
|
+
"jsdom": "^28.1.0",
|
|
61
61
|
"next": "^16.1.6",
|
|
62
62
|
"prettier": "^3.8.1",
|
|
63
63
|
"typescript": "^5.9.3",
|