@heliosgraphics/ui 2.0.0-alpha.93 → 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.
Files changed (76) hide show
  1. package/components/Breadcrumb/Breadcrumb.tsx +25 -23
  2. package/components/Button/Button.tsx +177 -179
  3. package/components/Checkbox/Checkbox.tsx +54 -60
  4. package/components/Confirm/Confirm.tsx +1 -1
  5. package/components/Dialog/Dialog.meta.ts +4 -0
  6. package/components/Dialog/Dialog.module.css +47 -37
  7. package/components/Dialog/Dialog.tsx +12 -47
  8. package/components/Dialog/Dialog.types.ts +1 -0
  9. package/components/Donut/Donut.tsx +4 -6
  10. package/components/Dropdown/Dropdown.module.css +20 -10
  11. package/components/Dropdown/Dropdown.tsx +7 -4
  12. package/components/Flex/Flex.meta.ts +2 -0
  13. package/components/Flex/Flex.tsx +3 -3
  14. package/components/Flex/Flex.types.ts +3 -1
  15. package/components/Flex/Flex.utils.ts +36 -1
  16. package/components/Flex/index.ts +0 -2
  17. package/components/Heading/Heading.tsx +3 -3
  18. package/components/Heading/components/H1/H1.tsx +2 -1
  19. package/components/Heading/components/H2/H2.tsx +2 -1
  20. package/components/Heading/components/H3/H3.tsx +2 -1
  21. package/components/Heading/components/H4/H4.tsx +2 -1
  22. package/components/Heading/components/H5/H5.tsx +2 -1
  23. package/components/Heading/components/H6/H6.tsx +2 -1
  24. package/components/Icon/Icon.tsx +3 -3
  25. package/components/Input/Input.tsx +5 -2
  26. package/components/Layout/components/LayoutAside/components/LayoutAsideContent/LayoutAsideContent.tsx +0 -2
  27. package/components/Layout/components/LayoutAside/components/LayoutAsideFooter/LayoutAsideFooter.tsx +0 -2
  28. package/components/Loading/Loading.tsx +8 -4
  29. package/components/Masonry/Masonry.meta.ts +1 -5
  30. package/components/Masonry/Masonry.tsx +27 -14
  31. package/components/Masonry/Masonry.types.ts +4 -4
  32. package/components/Menu/components/MenuFilter/MenuFilter.tsx +0 -2
  33. package/components/Overlay/Overlay.module.css +42 -18
  34. package/components/Overlay/Overlay.tsx +8 -3
  35. package/components/Pie/Pie.tsx +1 -0
  36. package/components/Pill/Pill.tsx +2 -2
  37. package/components/Progress/Progress.meta.ts +4 -0
  38. package/components/Progress/Progress.tsx +8 -2
  39. package/components/Progress/Progress.types.ts +1 -0
  40. package/components/Radio/Radio.tsx +57 -63
  41. package/components/Range/Range.meta.ts +26 -0
  42. package/components/Range/Range.module.css +68 -0
  43. package/components/Range/Range.tsx +47 -0
  44. package/components/Range/Range.types.ts +13 -0
  45. package/components/Range/index.ts +1 -0
  46. package/components/Segments/components/SegmentButton/SegmentButton.tsx +2 -1
  47. package/components/Select/Select.meta.ts +4 -0
  48. package/components/Select/Select.tsx +2 -0
  49. package/components/Select/Select.types.ts +1 -0
  50. package/components/Separator/Separator.tsx +25 -20
  51. package/components/Separator/components/VerticalSeparator/VerticalSeparator.tsx +1 -1
  52. package/components/Setup/Setup.tsx +0 -13
  53. package/components/Setup/css/feat.responsive.css +402 -0
  54. package/components/Slider/Slider.meta.ts +4 -0
  55. package/components/Slider/Slider.tsx +2 -2
  56. package/components/Slider/Slider.types.ts +1 -0
  57. package/components/Spacer/Spacer.tsx +3 -3
  58. package/components/Tabs/Tabs.tsx +19 -5
  59. package/components/Text/Text.tsx +3 -3
  60. package/components/Text/components/Div/Div.tsx +2 -1
  61. package/components/Text/components/Micro/Micro.tsx +2 -1
  62. package/components/Text/components/P/P.tsx +2 -1
  63. package/components/Text/components/Small/Small.tsx +2 -1
  64. package/components/Text/components/Tiny/Tiny.tsx +2 -1
  65. package/components/Tile/Tile.tsx +10 -1
  66. package/components/Tooltip/Tooltip.module.css +13 -0
  67. package/components/Tooltip/Tooltip.tsx +5 -3
  68. package/components/Tooltip/Tooltip.types.ts +1 -0
  69. package/components/Tooltip/components/TooltipContent/TooltipContent.tsx +11 -2
  70. package/components/Tooltip/components/TooltipTrigger/TooltipTrigger.tsx +4 -2
  71. package/components/shared/ResultList/ResultList.tsx +2 -2
  72. package/constants/components.ts +4 -2
  73. package/constants/meta.ts +9 -9
  74. package/globals.d.ts +12 -0
  75. package/index.ts +1 -0
  76. package/package.json +9 -8
@@ -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: Record<NonNullable<TooltipProps["position"]>, string | undefined> = {
11
+ const POSITION_CLASS_MAP = {
12
12
  "bottom-center": undefined,
13
13
  "bottom-left": styles.tooltipBottomLeft,
14
14
  "bottom-right": styles.tooltipBottomRight,
@@ -17,13 +17,14 @@ 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)
24
24
  const triggerRef = useRef<HTMLDivElement | null>(null)
25
25
  const popoverRef = useRef<HTMLDivElement | null>(null)
26
26
  const id: string = useId()
27
+ const tooltipId: string = `tooltip-${id.replace(/:/g, "")}`
27
28
  const anchorName: string = `--tooltip-${id.replace(/:/g, "")}`
28
29
 
29
30
  const positionClass: string | undefined = POSITION_CLASS_MAP[position]
@@ -85,9 +86,10 @@ const TooltipComponent: FC<TooltipProps> = ({ children = null, position = "botto
85
86
  popoverRef,
86
87
  tooltipClasses,
87
88
  anchorName,
89
+ tooltipId,
88
90
  isOpen,
89
91
  }),
90
- [tooltipClasses, anchorName, isOpen],
92
+ [tooltipClasses, anchorName, tooltipId, isOpen],
91
93
  )
92
94
 
93
95
  return (
@@ -22,6 +22,7 @@ export interface TooltipContextType {
22
22
  popoverRef: RefObject<HTMLDivElement | null>
23
23
  tooltipClasses: string
24
24
  anchorName: string
25
+ tooltipId: string
25
26
  isOpen: boolean
26
27
  }
27
28
 
@@ -1,15 +1,24 @@
1
+ "use client"
2
+
1
3
  import { Text } from "../../../Text"
2
4
  import { useTooltipContext } from "../../Tooltip.utils"
3
5
  import type { CSSProperties, FC } from "react"
4
6
  import type { TooltipContentProps } from "./TooltipContent.types"
5
7
 
6
8
  export const TooltipContent: FC<TooltipContentProps> = ({ children }) => {
7
- const { popoverRef, tooltipClasses, anchorName } = useTooltipContext()
9
+ const { popoverRef, tooltipClasses, anchorName, tooltipId } = useTooltipContext()
8
10
 
9
11
  const contentStyle: CSSProperties = { positionAnchor: anchorName } as CSSProperties
10
12
 
11
13
  return (
12
- <div className={tooltipClasses} ref={popoverRef} popover="manual" style={contentStyle}>
14
+ <div
15
+ id={tooltipId}
16
+ role="tooltip"
17
+ className={tooltipClasses}
18
+ ref={popoverRef}
19
+ popover="manual"
20
+ style={contentStyle}
21
+ >
13
22
  <Text type="small">{children}</Text>
14
23
  </div>
15
24
  )
@@ -1,14 +1,16 @@
1
+ "use client"
2
+
1
3
  import type { TooltipTriggerProps } from "./TooltipTrigger.types"
2
4
  import { useTooltipContext } from "../../Tooltip.utils"
3
5
  import type { CSSProperties, FC } from "react"
4
6
 
5
7
  export const TooltipTrigger: FC<TooltipTriggerProps> = ({ children }) => {
6
- const { triggerRef, anchorName } = useTooltipContext()
8
+ const { triggerRef, anchorName, tooltipId, isOpen } = useTooltipContext()
7
9
 
8
10
  const triggerStyle: CSSProperties = { anchorName } as CSSProperties
9
11
 
10
12
  return (
11
- <div ref={triggerRef} style={triggerStyle}>
13
+ <div ref={triggerRef} style={triggerStyle} aria-describedby={isOpen ? tooltipId : undefined}>
12
14
  {children}
13
15
  </div>
14
16
  )
@@ -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 }: ResultListProps) => {
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")
@@ -32,6 +32,7 @@ import { meta as metaPie } from "../components/Pie/Pie.meta"
32
32
  import { meta as metaPill } from "../components/Pill/Pill.meta"
33
33
  import { meta as metaProgress } from "../components/Progress/Progress.meta"
34
34
  import { meta as metaRadio } from "../components/Radio/Radio.meta"
35
+ import { meta as metaRange } from "../components/Range/Range.meta"
35
36
  import { meta as metaSegments } from "../components/Segments/Segments.meta"
36
37
  import { meta as metaSelect } from "../components/Select/Select.meta"
37
38
  import { meta as metaSeparator } from "../components/Separator/Separator.meta"
@@ -48,7 +49,7 @@ import { meta as metaTimestamp } from "../components/Timestamp/Timestamp.meta"
48
49
  import { meta as metaToggle } from "../components/Toggle/Toggle.meta"
49
50
  import { meta as metaTooltip } from "../components/Tooltip/Tooltip.meta"
50
51
 
51
- export const COMPONENTS: Record<string, HeliosAttributeMeta<unknown>> = {
52
+ export const COMPONENTS = {
52
53
  Alert: metaAlert,
53
54
  Breadcrumb: metaBreadcrumb,
54
55
  Browser: metaBrowser,
@@ -81,6 +82,7 @@ export const COMPONENTS: Record<string, HeliosAttributeMeta<unknown>> = {
81
82
  Pill: metaPill,
82
83
  Progress: metaProgress,
83
84
  Radio: metaRadio,
85
+ Range: metaRange,
84
86
  Segments: metaSegments,
85
87
  Select: metaSelect,
86
88
  Separator: metaSeparator,
@@ -96,4 +98,4 @@ export const COMPONENTS: Record<string, HeliosAttributeMeta<unknown>> = {
96
98
  Timestamp: metaTimestamp,
97
99
  Toggle: metaToggle,
98
100
  Tooltip: metaTooltip,
99
- }
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: Record<HeliosComponentStatusType, HeliosColorType> = {
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: Record<HeliosComponentStatusType, HeliosIconType> = {
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: Record<HeliosComponentStatusType, string> = {
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: Record<HeliosComponentCategoryType, string> = {
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/globals.d.ts CHANGED
@@ -1,2 +1,14 @@
1
1
  declare module "*.module.css"
2
2
  declare module "*.css"
3
+
4
+ type HeliosFixedThemeTypeRef = import("./types/themes").HeliosFixedThemeType
5
+
6
+ interface Window {
7
+ __theme: HeliosFixedThemeTypeRef
8
+ __onThemeChange: ((theme: HeliosFixedThemeTypeRef) => void) | undefined
9
+ __setPreferredTheme: (theme: HeliosFixedThemeTypeRef) => void
10
+ }
11
+
12
+ declare var __theme: HeliosFixedThemeTypeRef
13
+ declare var __onThemeChange: ((theme: HeliosFixedThemeTypeRef) => void) | undefined
14
+ declare var __setPreferredTheme: (theme: HeliosFixedThemeTypeRef) => void
package/index.ts CHANGED
@@ -34,6 +34,7 @@ export { Pill } from "./components/Pill"
34
34
  export { Placeholder } from "./components/Placeholder"
35
35
  export { Progress } from "./components/Progress"
36
36
  export { Radio } from "./components/Radio"
37
+ export { Range } from "./components/Range"
37
38
  export { Segments } from "./components/Segments"
38
39
  export { Select } from "./components/Select"
39
40
  export { Separator } from "./components/Separator"
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@heliosgraphics/ui",
3
- "version": "2.0.0-alpha.93",
3
+ "version": "2.0.0-alpha.95",
4
4
  "type": "module",
5
- "sideEffects": false,
5
+ "sideEffects": [
6
+ "*.css",
7
+ "*.module.css"
8
+ ],
6
9
  "author": "Chris Puska <chris@puska.org>",
7
10
  "private": false,
8
11
  "description": "Helios UI",
@@ -42,11 +45,9 @@
42
45
  "@heliosgraphics/css": "^1.0.0-alpha.5",
43
46
  "@heliosgraphics/icons": "^1.0.0-alpha.11",
44
47
  "@heliosgraphics/utils": "^6.0.0-alpha.9",
45
- "dayjs": "^1.11.19",
46
- "marked": "^17.0.2",
48
+ "marked": "^17.0.3",
47
49
  "marked-linkify-it": "^3.1.14",
48
- "marked-xhtml": "^1.0.14",
49
- "react-plock": "^3.6.1"
50
+ "marked-xhtml": "^1.0.14"
50
51
  },
51
52
  "devDependencies": {
52
53
  "@testing-library/react": "^16.3.2",
@@ -55,8 +56,8 @@
55
56
  "@vitest/coverage-v8": "^4.0.18",
56
57
  "esbuild": "^0.27.3",
57
58
  "esbuild-css-modules-plugin": "^3.1.5",
58
- "glob": "^13.0.3",
59
- "jsdom": "^28.0.0",
59
+ "glob": "^13.0.6",
60
+ "jsdom": "^28.1.0",
60
61
  "next": "^16.1.6",
61
62
  "prettier": "^3.8.1",
62
63
  "typescript": "^5.9.3",