@accelint/design-system 1.2.2 → 1.2.3

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 (136) hide show
  1. package/dist/components/aria/index.js.map +1 -1
  2. package/dist/components/button/button.css.d.ts +25 -24
  3. package/dist/components/button/index.d.ts +9 -40
  4. package/dist/components/button/index.js +23 -17
  5. package/dist/components/button/index.js.map +1 -1
  6. package/dist/components/button/types.d.ts +3 -2
  7. package/dist/components/checkbox/checkbox.css.d.ts +23 -23
  8. package/dist/components/checkbox/index.js.map +1 -1
  9. package/dist/components/chip/chip.css.d.ts +18 -18
  10. package/dist/components/chip/index.js.map +1 -1
  11. package/dist/components/collection/index.d.ts +3 -3
  12. package/dist/components/collection/index.js.map +1 -1
  13. package/dist/components/combo-box/combo-box.css.d.ts +9 -9
  14. package/dist/components/combo-box/index.js +9 -5
  15. package/dist/components/combo-box/index.js.map +1 -1
  16. package/dist/components/date-field/date-field.css.d.ts +17 -17
  17. package/dist/components/date-field/index.js +8 -4
  18. package/dist/components/date-field/index.js.map +1 -1
  19. package/dist/components/date-input/date-input.css.d.ts +25 -25
  20. package/dist/components/date-input/index.js +19 -8
  21. package/dist/components/date-input/index.js.map +1 -1
  22. package/dist/components/dialog/dialog.css.d.ts +16 -15
  23. package/dist/components/dialog/index.d.ts +1 -0
  24. package/dist/components/dialog/index.js +7 -5
  25. package/dist/components/dialog/index.js.map +1 -1
  26. package/dist/components/dialog/types.d.ts +1 -0
  27. package/dist/components/drawer/drawer.css.d.ts +17 -17
  28. package/dist/components/drawer/index.d.ts +1 -1
  29. package/dist/components/drawer/index.js +21 -8
  30. package/dist/components/drawer/index.js.map +1 -1
  31. package/dist/components/drawer/types.d.ts +1 -1
  32. package/dist/components/element/index.d.ts +1 -1
  33. package/dist/components/element/index.js +7 -3
  34. package/dist/components/element/index.js.map +1 -1
  35. package/dist/components/element/types.d.ts +2 -0
  36. package/dist/components/group/group.css.d.ts +7 -7
  37. package/dist/components/group/index.js +6 -6
  38. package/dist/components/group/index.js.map +1 -1
  39. package/dist/components/icon/icon.css.d.ts +9 -9
  40. package/dist/components/icon/index.js +4 -4
  41. package/dist/components/icon/index.js.map +1 -1
  42. package/dist/components/index.d.ts +35 -35
  43. package/dist/components/input/index.js +17 -8
  44. package/dist/components/input/index.js.map +1 -1
  45. package/dist/components/input/input.css.d.ts +20 -20
  46. package/dist/components/menu/index.d.ts +2 -2
  47. package/dist/components/menu/index.js +1 -1
  48. package/dist/components/menu/index.js.map +1 -1
  49. package/dist/components/menu/menu.css.d.ts +42 -42
  50. package/dist/components/merge-provider/index.js +15 -7
  51. package/dist/components/merge-provider/index.js.map +1 -1
  52. package/dist/components/merge-provider/types.d.ts +2 -0
  53. package/dist/components/number-field/index.d.ts +1 -1
  54. package/dist/components/number-field/index.js +8 -4
  55. package/dist/components/number-field/index.js.map +1 -1
  56. package/dist/components/number-field/number-field.css.d.ts +12 -12
  57. package/dist/components/number-field/types.d.ts +1 -1
  58. package/dist/components/options/index.js +1 -1
  59. package/dist/components/options/index.js.map +1 -1
  60. package/dist/components/options/options.css.d.ts +44 -44
  61. package/dist/components/picker/index.js.map +1 -1
  62. package/dist/components/picker/picker.css.d.ts +18 -18
  63. package/dist/components/popover/index.js +8 -4
  64. package/dist/components/popover/index.js.map +1 -1
  65. package/dist/components/popover/popover.css.d.ts +12 -12
  66. package/dist/components/query-builder/action-element.js.map +1 -1
  67. package/dist/components/query-builder/dataset-sample.js.map +1 -1
  68. package/dist/components/query-builder/group.js.map +1 -1
  69. package/dist/components/query-builder/index.js.map +1 -1
  70. package/dist/components/query-builder/query-builder.css.d.ts +53 -53
  71. package/dist/components/query-builder/value-editor.js.map +1 -1
  72. package/dist/components/query-builder/value-selector.js.map +1 -1
  73. package/dist/components/radio/index.js +12 -8
  74. package/dist/components/radio/index.js.map +1 -1
  75. package/dist/components/radio/radio.css.d.ts +22 -22
  76. package/dist/components/search-field/index.js +9 -5
  77. package/dist/components/search-field/index.js.map +1 -1
  78. package/dist/components/search-field/search-field.css.d.ts +9 -9
  79. package/dist/components/select/index.js +5 -5
  80. package/dist/components/select/index.js.map +1 -1
  81. package/dist/components/select/select.css.d.ts +12 -12
  82. package/dist/components/slider/index.js +48 -20
  83. package/dist/components/slider/index.js.map +1 -1
  84. package/dist/components/slider/slider.css.d.ts +27 -27
  85. package/dist/components/switch/index.js +4 -4
  86. package/dist/components/switch/index.js.map +1 -1
  87. package/dist/components/switch/switch.css.d.ts +16 -16
  88. package/dist/components/tabs/index.js +32 -20
  89. package/dist/components/tabs/index.js.map +1 -1
  90. package/dist/components/tabs/tabs.css.d.ts +25 -25
  91. package/dist/components/text-field/index.d.ts +3 -128
  92. package/dist/components/text-field/index.js +11 -7
  93. package/dist/components/text-field/index.js.map +1 -1
  94. package/dist/components/text-field/text-field.css.d.ts +8 -8
  95. package/dist/components/textarea/index.js +16 -7
  96. package/dist/components/textarea/index.js.map +1 -1
  97. package/dist/components/textarea/textarea.css.d.ts +22 -22
  98. package/dist/components/time-field/index.js +8 -4
  99. package/dist/components/time-field/index.js.map +1 -1
  100. package/dist/components/time-field/time-field.css.d.ts +17 -17
  101. package/dist/components/tooltip/index.js +17 -9
  102. package/dist/components/tooltip/index.js.map +1 -1
  103. package/dist/components/tooltip/tooltip.css.d.ts +11 -11
  104. package/dist/components/tree/index.js +5 -2
  105. package/dist/components/tree/index.js.map +1 -1
  106. package/dist/components/tree/tree.css.d.ts +45 -45
  107. package/dist/hooks/index.d.ts +13 -13
  108. package/dist/hooks/use-collection-render/index.d.ts +1 -1
  109. package/dist/hooks/use-collection-render/index.js +2 -3
  110. package/dist/hooks/use-collection-render/index.js.map +1 -1
  111. package/dist/hooks/use-context-props/index.js.map +1 -1
  112. package/dist/hooks/use-defaults/index.d.ts +32 -80
  113. package/dist/hooks/use-defaults/index.js +1 -4
  114. package/dist/hooks/use-defaults/index.js.map +1 -1
  115. package/dist/hooks/use-defaults/types.d.ts +1 -1
  116. package/dist/hooks/use-theme/index.d.ts +2 -2
  117. package/dist/hooks/use-theme/index.js.map +1 -1
  118. package/dist/hooks/use-theme/types.d.ts +1 -1
  119. package/dist/hooks/use-tree/index.js +3 -2
  120. package/dist/hooks/use-tree/index.js.map +1 -1
  121. package/dist/hooks/use-tree/utils.js +6 -9
  122. package/dist/hooks/use-tree/utils.js.map +1 -1
  123. package/dist/hooks/use-update-effect/index.js.map +1 -1
  124. package/dist/index.css +32 -32
  125. package/dist/index.d.ts +39 -39
  126. package/dist/ladle/actions.js.map +1 -1
  127. package/dist/styles/theme.css.d.ts +200 -200
  128. package/dist/test/setup.js +778 -1276
  129. package/dist/test/setup.js.map +1 -1
  130. package/dist/utils/css/index.d.ts +1 -1
  131. package/dist/utils/css/index.js.map +1 -1
  132. package/dist/utils/props/index.d.ts +1 -2
  133. package/dist/utils/props/index.js +1 -2
  134. package/dist/utils/props/index.js.map +1 -1
  135. package/dist/vanilla.d.ts +29 -29
  136. package/package.json +49 -48
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/textarea/index.tsx"],"names":["TextArea","RACTextAreaContext"],"mappings":";;;;;;;;;;;;;;;AAsCA,IAAM,cAAA,GAAkC;AAAA,EACtC,IAAA,EAAM;AACR,CAAA;AAEO,IAAM,eAAA,GACX,cAAgE,IAAI;AAY/D,IAAM,QAAA,GAAW,UAAA,CAAW,SAASA,SAAAA,CAC1C,OACA,GAAA,EACA;AACA,EAAA,CAAC,OAAO,GAAG,CAAA,GAAI,eAAA,CAAgB,KAAA,EAAO,KAAKC,iBAAkB,CAAA;AAI7D,EAAC,MAA2B,SAAA,GAAY,MAAA;AACxC,EAAC,MAA2B,KAAA,GAAQ,MAAA;AAIpC,EAAA,CAAC,OAAO,GAAG,CAAA,GAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,eAAe,CAAA;AAC1D,EAAA,KAAA,GAAQ,eAAA,CAAgB,OAAO,UAAU,CAAA;AAEzC,EAAA,MAAM;AAAA,IACJ,UAAA,EAAY,cAAA;A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AAS;AAC7C,MAAA,GAAA,CAAI,OAAA,CAAQ,WAAA,GAAc,CAAA,EAAG,KAAA,IAAS,EAAE,CAAA,CAAA;AAAA,IAC1C;AAAA,EACF,CAAA,EAAG,CAAC,GAAA,EAAK,KAAK,CAAC,CAAA;AAEf,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,WAAW,KAAA,EAErC,QAAA,kBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACE,GAAG,WAAA;AAAA,MACH,GAAG,UAAA;AAAA,MACJ,GAAA;AAAA,MACA,WAAW,UAAA,EAAY,QAAA;AAAA,MACvB,eAAA,EAAiB,EAAE,UAAA,IAAc,UAAA,CAAA;AAAA,MACjC,IAAA,EAAK,SAAA;AAAA,MACL,8BAAA,EAA8B,IAAA;AAAA,MAC9B,OAAA,EAAS,YAAA;AAAA,MACT,cAAA,EAAc,WAAA;AAAA,MACd,kBAAA,EAAkB;AAAA;AAAA,GACpB,EACF,CAAA;AAEJ,CAAC","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useFocusRing } from '@react-aria/focus';\nimport { useHover } from '@react-aria/interactions';\nimport { useControlledState } from '@react-stately/utils';\nimport {\n type FormEvent,\n type ForwardedRef,\n createContext,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n TextAreaContext as RACTextAreaContext,\n type TextAreaProps as RACTextAreaProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useTheme } from '../../hooks/use-theme';\nimport { inputs } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { mergeClassNames, mergeProps } from '../../utils/props';\nimport { textAreaClassNames, textAreaStateVars } from './textarea.css';\nimport type { TextAreaMapping, TextAreaProps } from './types';\n\nconst defaultMapping: TextAreaMapping = {\n font: inputs,\n};\n\nexport const TextAreaContext =\n createContext<ContextValue<TextAreaProps, HTMLTextAreaElement>>(null);\n\n/**\n * We implement a textarea as a content editable span to provide\n * improved UX, where the input area automatically grows with input\n * content length. This can be overriden by applying max-height\n * and overflow CSS, if desired.\n *\n * This also has the side effect of changing the target element in\n * the ref and event handlers. The normal `event.target.value` is not\n * available, and must be substituted with `event.currentTarget.textContent`\n */\nexport const TextArea = forwardRef(function TextArea(\n props: TextAreaProps,\n ref: ForwardedRef<HTMLTextAreaElement>,\n) {\n [props, ref] = useContextProps(props, ref, RACTextAreaContext);\n\n // Disallow props possibly provided by React Aria context\n // could be render props functions we don't want to support\n (props as RACTextAreaProps).className = undefined;\n (props as RACTextAreaProps).style = undefined;\n\n // Duplicate context prop merging to support React Aria's context\n // and our own which establishes a superset type for the props\n [props, ref] = useContextProps(props, ref, TextAreaContext);\n props = useDefaultProps(props, 'TextArea');\n\n const {\n classNames: classNamesProp,\n defaultValue = '',\n disabled: isDisabled = false,\n mapping: mappingProp,\n placeholder,\n readOnly: isReadOnly = false,\n required: isRequired = false,\n resize = 'none',\n size = 'lg',\n value: valueProp,\n onChange,\n onHoverStart,\n onHoverChange,\n onHoverEnd,\n 'aria-invalid': ariaInvalid,\n ...rest\n } = props;\n\n const [value, setValue] = useControlledState(valueProp, defaultValue);\n const isInvalid = !!ariaInvalid && ariaInvalid !== 'false';\n const isPlaceholder = !!placeholder && !value;\n const isEmpty = !value;\n\n const { isFocused, isFocusVisible, focusProps } = useFocusRing({\n autoFocus: props.autoFocus,\n isTextInput: true,\n });\n\n const { hoverProps, isHovered } = useHover({\n isDisabled,\n onHoverStart,\n onHoverChange,\n onHoverEnd,\n });\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(textAreaClassNames, theme.TextArea, classNamesProp, {\n textarea: mapping.font[size],\n }),\n [theme.TextArea, classNamesProp, mapping.font, size],\n );\n\n const mergedProps = useMemo(\n () => mergeProps(rest, focusProps, hoverProps),\n [focusProps, hoverProps, rest],\n );\n\n const style = useMemo(\n () =>\n inlineVars(textAreaStateVars, {\n resize,\n size,\n isDisabled,\n isEmpty,\n isFocused,\n isFocusVisible,\n isHovered,\n isInvalid,\n isPlaceholder,\n isReadOnly,\n isRequired,\n }),\n [\n resize,\n size,\n isDisabled,\n isEmpty,\n isFocused,\n isFocusVisible,\n isHovered,\n isInvalid,\n isPlaceholder,\n isReadOnly,\n isRequired,\n ],\n );\n\n const handleChange = useCallback(\n (event: FormEvent<HTMLSpanElement>) => {\n onChange?.(event);\n\n if (!event.defaultPrevented) {\n setValue(event.currentTarget.textContent ?? '');\n }\n },\n [onChange, setValue],\n );\n\n /**\n * In order to provide the UX of an \"input\" that auto grows in height\n * thats driven by content, we implement a content-editable span instead\n * of a textarea. However, this has the side effect that it must be\n * updated as an \"uncontrolled\" element, otherwise the cursor resets\n * to the beginning of the input area after every keystroke if the value\n * is passed in as \"children\"\n */\n useEffect(() => {\n if (typeof ref !== 'function' && ref?.current) {\n ref.current.textContent = `${value ?? ''}`;\n }\n }, [ref, value]);\n\n return (\n <div className={classNames?.container} style={style}>\n {/* biome-ignore lint/a11y/useFocusableInteractive: TODO: refactor */}\n <span\n {...mergedProps}\n {...hoverProps}\n ref={ref}\n className={classNames?.textarea}\n contentEditable={!(isDisabled || isReadOnly)}\n role='textbox'\n suppressContentEditableWarning\n onInput={handleChange}\n aria-invalid={ariaInvalid}\n data-placeholder={placeholder}\n />\n </div>\n );\n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IAAA;AAAA,MAC9B,OAAA,EAAS,YAAA;AAAA,MACT,cAAA,EAAc,WAAA;AAAA,MACd,kBAAA,EAAkB;AAAA;AAAA,GACpB,EACF,CAAA;AAEJ,CAAC","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useFocusRing } from '@react-aria/focus';\nimport { useHover } from '@react-aria/interactions';\nimport { useControlledState } from '@react-stately/utils';\nimport {\n createContext,\n type FormEvent,\n type ForwardedRef,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n TextAreaContext as RACTextAreaContext,\n type TextAreaProps as RACTextAreaProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useTheme } from '../../hooks/use-theme';\nimport { inputs } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { mergeClassNames, mergeProps } from '../../utils/props';\nimport { textAreaClassNames, textAreaStateVars } from './textarea.css';\nimport type { TextAreaMapping, TextAreaProps } from './types';\n\nconst defaultMapping: TextAreaMapping = {\n font: inputs,\n};\n\nexport const TextAreaContext =\n createContext<ContextValue<TextAreaProps, HTMLTextAreaElement>>(null);\n\n/**\n * We implement a textarea as a content editable span to provide\n * improved UX, where the input area automatically grows with input\n * content length. This can be overriden by applying max-height\n * and overflow CSS, if desired.\n *\n * This also has the side effect of changing the target element in\n * the ref and event handlers. The normal `event.target.value` is not\n * available, and must be substituted with `event.currentTarget.textContent`\n */\nexport const TextArea = forwardRef(function TextArea(\n props: TextAreaProps,\n ref: ForwardedRef<HTMLTextAreaElement>,\n) {\n const [contextProps1, contextRef1] = useContextProps(\n props,\n ref,\n RACTextAreaContext,\n );\n\n // Disallow props possibly provided by React Aria context\n // could be render props functions we don't want to support\n (contextProps1 as RACTextAreaProps).className = undefined;\n (contextProps1 as RACTextAreaProps).style = undefined;\n\n // Duplicate context prop merging to support React Aria's context\n // and our own which establishes a superset type for the props\n const [contextProps2, contextRef2] = useContextProps(\n contextProps1,\n contextRef1,\n TextAreaContext,\n );\n const defaultProps = useDefaultProps(contextProps2, 'TextArea');\n\n const {\n classNames: classNamesProp,\n defaultValue = '',\n disabled: isDisabled = false,\n mapping: mappingProp,\n placeholder,\n readOnly: isReadOnly = false,\n required: isRequired = false,\n resize = 'none',\n size = 'lg',\n value: valueProp,\n onChange,\n onHoverStart,\n onHoverChange,\n onHoverEnd,\n 'aria-invalid': ariaInvalid,\n ...rest\n } = defaultProps;\n\n const [value, setValue] = useControlledState(valueProp, defaultValue);\n const isInvalid = !!ariaInvalid && ariaInvalid !== 'false';\n const isPlaceholder = !!placeholder && !value;\n const isEmpty = !value;\n\n const { isFocused, isFocusVisible, focusProps } = useFocusRing({\n autoFocus: props.autoFocus,\n isTextInput: true,\n });\n\n const { hoverProps, isHovered } = useHover({\n isDisabled,\n onHoverStart,\n onHoverChange,\n onHoverEnd,\n });\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(textAreaClassNames, theme.TextArea, classNamesProp, {\n textarea: mapping.font[size],\n }),\n [theme.TextArea, classNamesProp, mapping.font, size],\n );\n\n const mergedProps = useMemo(\n () => mergeProps(rest, focusProps, hoverProps),\n // biome-ignore lint/correctness/useExhaustiveDependencies: TODO: Verify this dependency array is correct.\n [focusProps, hoverProps, rest],\n );\n\n const style = useMemo(\n () =>\n inlineVars(textAreaStateVars, {\n resize,\n size,\n isDisabled,\n isEmpty,\n isFocused,\n isFocusVisible,\n isHovered,\n isInvalid,\n isPlaceholder,\n isReadOnly,\n isRequired,\n }),\n [\n resize,\n size,\n isDisabled,\n isEmpty,\n isFocused,\n isFocusVisible,\n isHovered,\n isInvalid,\n isPlaceholder,\n isReadOnly,\n isRequired,\n ],\n );\n\n const handleChange = useCallback(\n (event: FormEvent<HTMLSpanElement>) => {\n onChange?.(event);\n\n if (!event.defaultPrevented) {\n setValue(event.currentTarget.textContent ?? '');\n }\n },\n [onChange, setValue],\n );\n\n /**\n * In order to provide the UX of an \"input\" that auto grows in height\n * thats driven by content, we implement a content-editable span instead\n * of a textarea. However, this has the side effect that it must be\n * updated as an \"uncontrolled\" element, otherwise the cursor resets\n * to the beginning of the input area after every keystroke if the value\n * is passed in as \"children\"\n */\n useEffect(() => {\n if (typeof ref !== 'function' && ref?.current) {\n ref.current.textContent = `${value ?? ''}`;\n }\n }, [ref, value]);\n\n return (\n <div className={classNames?.container} style={style}>\n {/* biome-ignore lint/a11y/useFocusableInteractive: TODO: refactor */}\n {/** biome-ignore lint/a11y/useSemanticElements: Legacy */}\n <span\n {...mergedProps}\n {...hoverProps}\n ref={contextRef2}\n className={classNames?.textarea}\n contentEditable={!(isDisabled || isReadOnly)}\n role='textbox'\n suppressContentEditableWarning\n onInput={handleChange}\n aria-invalid={ariaInvalid}\n data-placeholder={placeholder}\n />\n </div>\n );\n});\n"]}
@@ -5,32 +5,32 @@ import '../../types/generic.js';
5
5
 
6
6
  declare const textAreaContainer: string;
7
7
  declare const textAreaColorVars: {
8
- background: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
9
- border: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
10
- color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
8
+ background: `var(--${string})`;
9
+ border: `var(--${string})`;
10
+ color: `var(--${string})`;
11
11
  };
12
12
  declare const textAreaSpaceVars: {
13
- minWidth: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
14
- width: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
15
- maxWidth: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16
- minHeight: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
17
- height: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
18
- maxHeight: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
19
- x: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
20
- y: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
13
+ minWidth: `var(--${string})`;
14
+ width: `var(--${string})`;
15
+ maxWidth: `var(--${string})`;
16
+ minHeight: `var(--${string})`;
17
+ height: `var(--${string})`;
18
+ maxHeight: `var(--${string})`;
19
+ x: `var(--${string})`;
20
+ y: `var(--${string})`;
21
21
  };
22
22
  declare const textAreaStateVars: {
23
- resize: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
24
- size: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
25
- isDisabled: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
26
- isEmpty: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
27
- isFocused: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
28
- isFocusVisible: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
29
- isHovered: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
30
- isInvalid: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
31
- isPlaceholder: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
32
- isReadOnly: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
33
- isRequired: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
23
+ resize: `var(--${string})`;
24
+ size: `var(--${string})`;
25
+ isDisabled: `var(--${string})`;
26
+ isEmpty: `var(--${string})`;
27
+ isFocused: `var(--${string})`;
28
+ isFocusVisible: `var(--${string})`;
29
+ isHovered: `var(--${string})`;
30
+ isInvalid: `var(--${string})`;
31
+ isPlaceholder: `var(--${string})`;
32
+ isReadOnly: `var(--${string})`;
33
+ isRequired: `var(--${string})`;
34
34
  };
35
35
  declare const textAreaClassNames: TextAreaClassNames;
36
36
 
@@ -27,9 +27,13 @@ var defaultMapping = {
27
27
  var defaultSize = "lg";
28
28
  var TimeFieldContext = createContext(null);
29
29
  var TimeField = forwardRef(function TimeField2(props, ref) {
30
- [props, ref] = useContextProps(props, ref, TimeFieldContext);
31
- props = useDefaultProps(
30
+ const [contextProps, contextRef] = useContextProps(
32
31
  props,
32
+ ref,
33
+ TimeFieldContext
34
+ );
35
+ const finalProps = useDefaultProps(
36
+ contextProps,
33
37
  "TimeField"
34
38
  );
35
39
  const {
@@ -39,7 +43,7 @@ var TimeField = forwardRef(function TimeField2(props, ref) {
39
43
  size = defaultSize,
40
44
  value,
41
45
  ...rest
42
- } = props;
46
+ } = finalProps;
43
47
  const theme = useTheme();
44
48
  const mapping = useMemo(
45
49
  () => ({
@@ -92,7 +96,7 @@ var TimeField = forwardRef(function TimeField2(props, ref) {
92
96
  TimeField$1,
93
97
  {
94
98
  ...rest,
95
- ref,
99
+ ref: contextRef,
96
100
  className: classNames?.container,
97
101
  style,
98
102
  value,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/time-field/index.tsx"],"names":["TimeField","RACTimeField"],"mappings":";;;;;;;;;;;;AAiDA,IAAM,cAAA,GAAmC;AAAA,EACvC,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI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EAAY,SAAA;AAAA,MACvB,KAAA;AAAA,MACA,KAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAC","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { TimeValue } from '@react-aria/datepicker';\nimport {\n type ForwardedRef,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n type FieldErrorProps,\n LabelContext,\n type LabelProps,\n Provider,\n TimeField as RACTimeField,\n type TextProps,\n} from 'react-aria-components';\nimport { useContextProps, useDefaultProps, useTheme } from '../../hooks';\nimport { bodies } from '../../styles';\nimport { callRenderProps, inlineVars, mergeClassNames } from '../../utils';\nimport {\n AriaFieldErrorContext,\n type AriaLabelContext,\n AriaTextContext,\n} from '../aria';\nimport type { DateFieldRenderProps } from '../date-field/types';\nimport { DateInputContext } from '../date-input';\nimport type { DateInputProps } from '../date-input/types';\nimport { IconContext } from '../icon';\nimport type { IconProps } from '../icon/types';\nimport { timeFieldClassNames, timeFieldStateVars } from './time-field.css';\nimport type {\n TimeFieldMapping,\n TimeFieldProps,\n TimeFieldRenderProps,\n} from './types';\n\nconst defaultMapping: TimeFieldMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n error: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n icon: {\n sm: { size: 'xs' },\n lg: { size: 'md' },\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const TimeFieldContext =\n createContext<ContextValue<TimeFieldProps<TimeValue>, HTMLDivElement>>(null);\n\nexport const TimeField = forwardRef(function TimeField<T extends TimeValue>(\n props: TimeFieldProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n [props, ref] = useContextProps(props, ref, TimeFieldContext);\n props = useDefaultProps(\n props as TimeFieldProps<TimeValue>,\n 'TimeField',\n ) as TimeFieldProps<T>;\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n value,\n ...rest\n } = props;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(timeFieldClassNames, theme.TimeField, classNamesProp, {\n description: mapping.description[size],\n error: mapping.error[size],\n }),\n [theme.TimeField, classNamesProp, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: DateFieldRenderProps) =>\n inlineVars(timeFieldStateVars, {\n ...renderProps,\n size,\n }),\n [size],\n );\n\n const values = useMemo<\n [\n [typeof DateInputContext, ContextValue<DateInputProps, HTMLDivElement>],\n [typeof AriaLabelContext, ContextValue<LabelProps, HTMLLabelElement>],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [\n typeof AriaFieldErrorContext,\n ContextValue<FieldErrorProps, HTMLElement>,\n ],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n ]\n >(\n () => [\n [DateInputContext, { classNames: classNames?.input, size }],\n [LabelContext, { className: classNames?.label }],\n [\n AriaTextContext,\n {\n slots: {\n description: { className: classNames?.description },\n },\n },\n ],\n [AriaFieldErrorContext, { className: classNames?.error }],\n [IconContext, { ...mapping.icon[size], classNames: classNames?.icon }],\n ],\n [classNames, size, mapping],\n );\n\n const children = useCallback(\n (renderProps: TimeFieldRenderProps) => {\n return (\n <Provider values={values}>\n <div className={classNames?.timeField}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n );\n },\n [childrenProp, values, classNames],\n );\n\n return (\n <RACTimeField\n {...rest}\n ref={ref}\n className={classNames?.container}\n style={style}\n value={value}\n >\n {children}\n </RACTimeField>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/time-field/index.tsx"],"names":["TimeField","RACTimeField"],"mappings":";;;;;;;;;;;;AAiDA,IAAM,cAAA,GAAmC;AAAA,EACvC,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAK;AAAA,IACjB,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA;AAAK;AAErB,CAAA;AAEA,IAAM,WAAA,GAAc,IAAA;AAEb,IAAM,gBAAA,GACX,cAAuE,IAAI;AAEtE,IAAM,SAAA,GAAY,UAAA,CAAW,SAASA,UAAAA,CAC3C,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,YAAA,EAAc,UAAU,CAAA,GAAI,eAAA;AAAA,IACjC,KAAA;AAAA,IACA,GAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,UAAA,GAAa,eAAA;AAAA,IACjB,YAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,YAAA;AAAA,IACV,UAAA,EAAY,cAAA;AAAA,IACZ,OAAA,EAAS,WAAA;AAAA,IACT,IAAA,GAAO,WAAA;AAAA,IACP,KAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,UAAA;AAEJ,EAAA,MAAM,QAAQ,QAAA,EAAS;AAEvB,EAAA,MAAM,OAAA,GAAU,OAAA;AAAA,IACd,OAAO;AAAA,MACL,GAAG,cAAA;AAAA,MACH,GAAG;AAAA,KACL,CAAA;AAAA,IACA,CAAC,WAAW;AAAA,GACd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A,EACR,QAAA,kBAAA,GAAA,CAAC,SAAI,SAAA,EAAW,UAAA,EAAY,SAAA,EACzB,QAAA,EAAA,eAAA,CAAgB,YAAA,EAAc;AAAA,QAC7B,GAAG,WAAA;AAAA,QACH,eAAA,EAAiB;AAAA,OAClB,GACH,CAAA,EACF,CAAA;AAAA,IAEJ,CAAA;AAAA,IACA,CAAC,YAAA,EAAc,MAAA,EAAQ,UAAU;AAAA,GACnC;AAEA,EAAA,uBACE,GAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,UAAA;AAAA,MACL,WAAW,UAAA,EAAY,SAAA;AAAA,MACvB,KAAA;AAAA,MACA,KAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAC","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n type ForwardedRef,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n type FieldErrorProps,\n LabelContext,\n type LabelProps,\n Provider,\n TimeField as RACTimeField,\n type TextProps,\n} from 'react-aria-components';\nimport { useContextProps, useDefaultProps, useTheme } from '../../hooks';\nimport { bodies } from '../../styles';\nimport { callRenderProps, inlineVars, mergeClassNames } from '../../utils';\nimport {\n AriaFieldErrorContext,\n type AriaLabelContext,\n AriaTextContext,\n} from '../aria';\nimport { DateInputContext } from '../date-input';\nimport { IconContext } from '../icon';\nimport { timeFieldClassNames, timeFieldStateVars } from './time-field.css';\nimport type { TimeValue } from '@react-aria/datepicker';\nimport type { DateFieldRenderProps } from '../date-field/types';\nimport type { DateInputProps } from '../date-input/types';\nimport type { IconProps } from '../icon/types';\nimport type {\n TimeFieldMapping,\n TimeFieldProps,\n TimeFieldRenderProps,\n} from './types';\n\nconst defaultMapping: TimeFieldMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n error: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n icon: {\n sm: { size: 'xs' },\n lg: { size: 'md' },\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const TimeFieldContext =\n createContext<ContextValue<TimeFieldProps<TimeValue>, HTMLDivElement>>(null);\n\nexport const TimeField = forwardRef(function TimeField<T extends TimeValue>(\n props: TimeFieldProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(\n props,\n ref,\n TimeFieldContext,\n );\n const finalProps = useDefaultProps(\n contextProps as TimeFieldProps<TimeValue>,\n 'TimeField',\n ) as TimeFieldProps<T>;\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n value,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(timeFieldClassNames, theme.TimeField, classNamesProp, {\n description: mapping.description[size],\n error: mapping.error[size],\n }),\n [theme.TimeField, classNamesProp, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: DateFieldRenderProps) =>\n inlineVars(timeFieldStateVars, {\n ...renderProps,\n size,\n }),\n [size],\n );\n\n const values = useMemo<\n [\n [typeof DateInputContext, ContextValue<DateInputProps, HTMLDivElement>],\n [typeof AriaLabelContext, ContextValue<LabelProps, HTMLLabelElement>],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [\n typeof AriaFieldErrorContext,\n ContextValue<FieldErrorProps, HTMLElement>,\n ],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n ]\n >(\n () => [\n [DateInputContext, { classNames: classNames?.input, size }],\n [LabelContext, { className: classNames?.label }],\n [\n AriaTextContext,\n {\n slots: {\n description: { className: classNames?.description },\n },\n },\n ],\n [AriaFieldErrorContext, { className: classNames?.error }],\n [IconContext, { ...mapping.icon[size], classNames: classNames?.icon }],\n ],\n [classNames, size, mapping],\n );\n\n const children = useCallback(\n (renderProps: TimeFieldRenderProps) => {\n return (\n <Provider values={values}>\n <div className={classNames?.timeField}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n );\n },\n [childrenProp, values, classNames],\n );\n\n return (\n <RACTimeField\n {...rest}\n ref={contextRef}\n className={classNames?.container}\n style={style}\n value={value}\n >\n {children}\n </RACTimeField>\n );\n});\n"]}
@@ -11,33 +11,33 @@ import '../icon/types.js';
11
11
 
12
12
  declare const timeFieldContainer: string;
13
13
  declare const timeFieldSpaceVars: {
14
- x: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
15
- y: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16
- gap: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
17
- minWidth: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
18
- width: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
19
- maxWidth: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
14
+ x: `var(--${string})`;
15
+ y: `var(--${string})`;
16
+ gap: `var(--${string})`;
17
+ minWidth: `var(--${string})`;
18
+ width: `var(--${string})`;
19
+ maxWidth: `var(--${string})`;
20
20
  };
21
21
  declare const timeFieldColorVars: {
22
- border: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
22
+ border: `var(--${string})`;
23
23
  description: {
24
- color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
24
+ color: `var(--${string})`;
25
25
  };
26
26
  error: {
27
- color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
27
+ color: `var(--${string})`;
28
28
  };
29
29
  label: {
30
- color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
30
+ color: `var(--${string})`;
31
31
  };
32
32
  };
33
33
  declare const timeFieldStateVars: {
34
- size: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
35
- isDisabled: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
36
- isFocused: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
37
- isHovered: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
38
- isInvalid: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
39
- isReadOnly: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
40
- isRequired: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
34
+ size: `var(--${string})`;
35
+ isDisabled: `var(--${string})`;
36
+ isFocused: `var(--${string})`;
37
+ isHovered: `var(--${string})`;
38
+ isInvalid: `var(--${string})`;
39
+ isReadOnly: `var(--${string})`;
40
+ isRequired: `var(--${string})`;
41
41
  };
42
42
  declare const timeFieldClassNames: TimeFieldClassNames;
43
43
 
@@ -16,8 +16,12 @@ var defaultMapping = {
16
16
  };
17
17
  var TooltipContext = createContext(null);
18
18
  var Tooltip = forwardRef(function Tooltip2(props, ref) {
19
- [props, ref] = useContextProps(props, ref, TooltipContext);
20
- props = useDefaultProps(props, "Tooltip");
19
+ const [contextProps, contextRef] = useContextProps(
20
+ props,
21
+ ref,
22
+ TooltipContext
23
+ );
24
+ const finalProps = useDefaultProps(contextProps, "Tooltip");
21
25
  const {
22
26
  children: childrenProp,
23
27
  classNames: classNamesProp,
@@ -26,7 +30,7 @@ var Tooltip = forwardRef(function Tooltip2(props, ref) {
26
30
  mapping: mappingProp,
27
31
  offset,
28
32
  ...rest
29
- } = props;
33
+ } = finalProps;
30
34
  const theme = useTheme();
31
35
  const mapping = useMemo(
32
36
  () => ({
@@ -68,7 +72,7 @@ var Tooltip = forwardRef(function Tooltip2(props, ref) {
68
72
  Tooltip$1,
69
73
  {
70
74
  ...rest,
71
- ref,
75
+ ref: contextRef,
72
76
  className: classNames?.tooltip?.container,
73
77
  style,
74
78
  children
@@ -77,15 +81,19 @@ var Tooltip = forwardRef(function Tooltip2(props, ref) {
77
81
  });
78
82
  var TooltipTargetContext = createContext(null);
79
83
  var TooltipTarget = forwardRef(function TooltipTarget2(props, ref) {
80
- [props, ref] = useContextProps(props, ref, TooltipTargetContext);
81
- props = useDefaultProps(props, "TooltipTarget");
84
+ const [contextProps, contextRef] = useContextProps(
85
+ props,
86
+ ref,
87
+ TooltipTargetContext
88
+ );
89
+ const finalProps = useDefaultProps(contextProps, "TooltipTarget");
82
90
  const {
83
91
  children,
84
92
  classNames: classNamesProp,
85
93
  focusable = true,
86
94
  relative = "self"
87
- } = props;
88
- const { focusableProps } = useFocusable({}, ref);
95
+ } = finalProps;
96
+ const { focusableProps } = useFocusable({}, contextRef);
89
97
  const theme = useTheme();
90
98
  const classNames = useMemo(
91
99
  () => mergeClassNames(tooltipClassNames, theme.Tooltip, classNamesProp),
@@ -102,7 +110,7 @@ var TooltipTarget = forwardRef(function TooltipTarget2(props, ref) {
102
110
  "div",
103
111
  {
104
112
  ...focusableProps,
105
- ref,
113
+ ref: contextRef,
106
114
  className: classNames?.target?.target,
107
115
  tabIndex: focusable ? 0 : void 0,
108
116
  children
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/tooltip/index.tsx"],"names":["Tooltip","RACTooltip","TooltipTarget"],"mappings":";;;;;;;;;;;;;AAsCA,IAAM,cAAA,GAAiC;AAAA,EACrC,MAAM,MAAA,CAAO;AACf,CAAA;AAEO,IAAM,cAAA,GACX,cAA0D,IAAI;AAEzD,IAAM,OAAA,GAAU,UAAA,CAAW,SAASA,QAAA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GAChC;AAEA,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,MACE,WAAW,sBAAA,EAAwB;AAAA,MACjC,SAAA;AAAA,MACA;AAAA,KACD,CAAA;AAAA,IACH,CAAC,WAAW,QAAQ;AAAA,GACtB;AAEA,EAAA,2BACG,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,MAAA,EAAQ,WAAW,KAAA,EAC7C,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,cAAA;AAAA,MACJ,GAAA;AAAA,MACA,SAAA,EAAW,YAAY,MAAA,EAAQ,MAAA;AAAA,MAE/B,QAAA,EAAU,YAAY,CAAA,GAAI,MAAA;AAAA,MAEzB;AAAA;AAAA,GACH,EACF,CAAA;AAEJ,CAAC","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useFocusable } from '@react-aria/focus';\nimport {\n type ForwardedRef,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n Tooltip as RACTooltip,\n type TooltipRenderProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useTheme } from '../../hooks/use-theme';\nimport { bodies } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n tooltipClassNames,\n tooltipStateVars,\n tooltipTargetStateVars,\n} from './tooltip.css';\nimport type { TooltipMapping, TooltipProps, TooltipTargetProps } from './types';\n\nconst defaultMapping: TooltipMapping = {\n font: bodies.xs,\n};\n\nexport const TooltipContext =\n createContext<ContextValue<TooltipProps, HTMLDivElement>>(null);\n\nexport const Tooltip = forwardRef(function Tooltip(\n props: TooltipProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n [props, ref] = useContextProps(props, ref, TooltipContext);\n\n props = useDefaultProps(props, 'Tooltip');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n containerPadding,\n crossOffset,\n mapping: mappingProp,\n offset,\n ...rest\n } = props;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(tooltipClassNames, theme.Tooltip, classNamesProp, {\n tooltip: {\n container: theme.className,\n tooltip: mapping.font,\n },\n }),\n [theme.Tooltip, classNamesProp, theme.className, mapping],\n );\n\n const style = useCallback(\n ({ state, ...renderProps }: TooltipRenderProps) => ({\n ...theme.style,\n ...inlineVars(tooltipStateVars, {\n containerPadding,\n crossOffset,\n offset,\n ...renderProps,\n isOpen: state.isOpen,\n }),\n }),\n [theme.style, containerPadding, crossOffset, offset],\n );\n\n const children = useCallback(\n (renderProps: TooltipRenderProps) => (\n <div className={classNames?.tooltip?.tooltip}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n isOpen: renderProps.state.isOpen,\n })}\n </div>\n ),\n [classNames?.tooltip?.tooltip, childrenProp],\n );\n\n return (\n <RACTooltip\n {...rest}\n ref={ref}\n className={classNames?.tooltip?.container}\n style={style}\n >\n {children}\n </RACTooltip>\n );\n});\n\nexport const TooltipTargetContext =\n createContext<ContextValue<TooltipTargetProps, HTMLDivElement>>(null);\n\n/**\n * This target component is only needed if attempting to add a Tooltip\n * to a non-focusable element/component\n */\nexport const TooltipTarget = forwardRef(function TooltipTarget(\n props: TooltipTargetProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n [props, ref] = useContextProps(props, ref, TooltipTargetContext);\n\n props = useDefaultProps(props, 'TooltipTarget');\n\n const {\n children,\n classNames: classNamesProp,\n focusable = true,\n relative = 'self',\n } = props;\n\n const { focusableProps } = useFocusable({}, ref);\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(tooltipClassNames, theme.Tooltip, classNamesProp),\n [theme.Tooltip, classNamesProp],\n );\n\n const style = useMemo(\n () =>\n inlineVars(tooltipTargetStateVars, {\n focusable,\n relative,\n }),\n [focusable, relative],\n );\n\n return (\n <div className={classNames?.target?.container} style={style}>\n <div\n {...focusableProps}\n ref={ref}\n className={classNames?.target?.target}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={focusable ? 0 : undefined}\n >\n {children}\n </div>\n </div>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/tooltip/index.tsx"],"names":["Tooltip","RACTooltip","TooltipTarget"],"mappings":";;;;;;;;;;;;;AAsCA,IAAM,cAAA,GAAiC;AAAA,EACrC,MAAM,MAAA,CAAO;AACf,CAAA;AAEO,IAAM,cAAA,GACX,cAA0D,IAAI;AAEzD,IAAM,OAAA,GAAU,UAAA,CAAW,SAASA,QAAAA,CACzC,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,YAAA,EAAc,UAAU,CAAA,GAAI,eAAA;AAAA,IACjC,KAAA;AAAA,IACA,GAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,UAAA,GAAa,eAAA,CAAgB,YAAA,EAAc,SAAS,CAAA;AAE1D,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,YAAA;AAAA,IACV,UAAA,EAAY,cAAA;AAAA,IACZ,gBAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA,EAAS,WAAA;AAAA,IACT,MAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,UAAA;AAEJ,EAAA,MAAM,QAAQ,QAAA,EAAS;AAEvB,EAAA,MAAM,OAAA,GAAU,OAAA;AAAA,I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EAAQ,MAAA;AAAA,MAE/B,QAAA,EAAU,YAAY,CAAA,GAAI,MAAA;AAAA,MAEzB;AAAA;AAAA,GACH,EACF,CAAA;AAEJ,CAAC","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useFocusable } from '@react-aria/focus';\nimport {\n createContext,\n type ForwardedRef,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n Tooltip as RACTooltip,\n type TooltipRenderProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useTheme } from '../../hooks/use-theme';\nimport { bodies } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n tooltipClassNames,\n tooltipStateVars,\n tooltipTargetStateVars,\n} from './tooltip.css';\nimport type { TooltipMapping, TooltipProps, TooltipTargetProps } from './types';\n\nconst defaultMapping: TooltipMapping = {\n font: bodies.xs,\n};\n\nexport const TooltipContext =\n createContext<ContextValue<TooltipProps, HTMLDivElement>>(null);\n\nexport const Tooltip = forwardRef(function Tooltip(\n props: TooltipProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(\n props,\n ref,\n TooltipContext,\n );\n\n const finalProps = useDefaultProps(contextProps, 'Tooltip');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n containerPadding,\n crossOffset,\n mapping: mappingProp,\n offset,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(tooltipClassNames, theme.Tooltip, classNamesProp, {\n tooltip: {\n container: theme.className,\n tooltip: mapping.font,\n },\n }),\n [theme.Tooltip, classNamesProp, theme.className, mapping],\n );\n\n const style = useCallback(\n ({ state, ...renderProps }: TooltipRenderProps) => ({\n ...theme.style,\n ...inlineVars(tooltipStateVars, {\n containerPadding,\n crossOffset,\n offset,\n ...renderProps,\n isOpen: state.isOpen,\n }),\n }),\n [theme.style, containerPadding, crossOffset, offset],\n );\n\n const children = useCallback(\n (renderProps: TooltipRenderProps) => (\n <div className={classNames?.tooltip?.tooltip}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n isOpen: renderProps.state.isOpen,\n })}\n </div>\n ),\n [classNames?.tooltip?.tooltip, childrenProp],\n );\n\n return (\n <RACTooltip\n {...rest}\n ref={contextRef}\n className={classNames?.tooltip?.container}\n style={style}\n >\n {children}\n </RACTooltip>\n );\n});\n\nexport const TooltipTargetContext =\n createContext<ContextValue<TooltipTargetProps, HTMLDivElement>>(null);\n\n/**\n * This target component is only needed if attempting to add a Tooltip\n * to a non-focusable element/component\n */\nexport const TooltipTarget = forwardRef(function TooltipTarget(\n props: TooltipTargetProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(\n props,\n ref,\n TooltipTargetContext,\n );\n\n const finalProps = useDefaultProps(contextProps, 'TooltipTarget');\n\n const {\n children,\n classNames: classNamesProp,\n focusable = true,\n relative = 'self',\n } = finalProps;\n\n const { focusableProps } = useFocusable({}, contextRef);\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(tooltipClassNames, theme.Tooltip, classNamesProp),\n [theme.Tooltip, classNamesProp],\n );\n\n const style = useMemo(\n () =>\n inlineVars(tooltipTargetStateVars, {\n focusable,\n relative,\n }),\n [focusable, relative],\n );\n\n return (\n <div className={classNames?.target?.container} style={style}>\n <div\n {...focusableProps}\n ref={contextRef}\n className={classNames?.target?.target}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={focusable ? 0 : undefined}\n >\n {children}\n </div>\n </div>\n );\n});\n"]}
@@ -9,21 +9,21 @@ declare const tooltipContainers: {
9
9
  target: string;
10
10
  };
11
11
  declare const tooltipSpaceVars: {
12
- x: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
13
- y: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
12
+ x: `var(--${string})`;
13
+ y: `var(--${string})`;
14
14
  };
15
15
  declare const tooltipStateVars: {
16
- containerPadding: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
17
- crossOffset: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
18
- offset: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
19
- placement: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
20
- isEntering: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
21
- isExiting: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
22
- isOpen: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16
+ containerPadding: `var(--${string})`;
17
+ crossOffset: `var(--${string})`;
18
+ offset: `var(--${string})`;
19
+ placement: `var(--${string})`;
20
+ isEntering: `var(--${string})`;
21
+ isExiting: `var(--${string})`;
22
+ isOpen: `var(--${string})`;
23
23
  };
24
24
  declare const tooltipTargetStateVars: {
25
- focusable: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
26
- relative: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
25
+ focusable: `var(--${string})`;
26
+ relative: `var(--${string})`;
27
27
  };
28
28
  declare const tooltipClassNames: TooltipClassNames;
29
29
 
@@ -82,7 +82,10 @@ function defaultRenderEmptyState({ isDropTarget }) {
82
82
  return isDropTarget ? "Add to this group" : "Nothing to see here";
83
83
  }
84
84
  function Tree(props) {
85
- props = useDefaultProps(props, "Tree");
85
+ const defaultedProps = useDefaultProps(
86
+ props,
87
+ "Tree"
88
+ );
86
89
  const {
87
90
  children: childrenProp,
88
91
  allowsDragging = false,
@@ -105,7 +108,7 @@ function Tree(props) {
105
108
  onSelectionChange,
106
109
  onUpdate,
107
110
  ...rest
108
- } = props;
111
+ } = defaultedProps;
109
112
  const state = useTree({
110
113
  allowsExpansion,
111
114
  allowsVisibility,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/tree/index.tsx"],"names":["RACButtonContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+DA,IAAM,SAAA,GAAY;AAAA,EAChB,GAAA,EAAK,EAAA;AAAA,EACL,SAAA,EAAW,EAAA;AAAA,EACX,UAAU,EAAC;AAAA,EACX,KAAA,EAAO,EAAE,EAAA,EAAI,EAAA,EAAI,OAAO,EAAA;AAC1B,CAAA;AAEA,IAAM,cAAA,GAA8B;AAAA,EAClC,OAAA,EAAS;AAAA,IACP,IAAI,EAAC;AAAA,IACL,IAAI;AAAC,GACP;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA,EAAO;AAAA,IAClC,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA;AAAO,GACpC;AAAA,EACA,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,IAAI,EAAC;AAAA,IACL,IAAI;AAAC,GACP;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAI,EAAC;AAAA,IACL,IAAI;AAAC,GACP;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAI,EAAC;AAAA,IACL,IAAI;AAAC;AA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ACA,YAAY,IAAA,EAAM,IAAA;AAAA,MAClB,YAAY,IAAA,EAAM,GAAA;AAAA,MAClB,IAAA;AAAA,MACA,YAAA;AAAA,MACA;AAAA;AACF,GACF;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,UAAA,EAAY,CAAC,CAAC,IAAA,CAAK,KAAA,CAAM,UAAA;AAAA,MACzB,SAAA,EAAW,YAAY,IAAA,EAAM,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA,EAAW,KAAK,KAAA,CAAM,KAAA;AAAA,MAErB;AAAA;AAAA,GACH;AAEJ","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { noop } from '@accelint/core';\nimport { usePress } from '@react-aria/interactions';\nimport type { Key } from '@react-types/shared';\nimport { createContext, useCallback, useContext, useMemo } from 'react';\nimport {\n type ContextValue,\n DEFAULT_SLOT,\n DropIndicator,\n type DropTarget,\n GridList,\n GridListItem,\n type GridListItemRenderProps,\n type GridListRenderProps,\n Provider,\n ButtonContext as RACButtonContext,\n type ButtonProps as RACButtonProps,\n type TextProps,\n useDragAndDrop,\n} from 'react-aria-components';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useTheme } from '../../hooks/use-theme';\nimport { useTree } from '../../hooks/use-tree';\nimport { bodies } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { AriaTextContext } from '../aria';\nimport { Button, ButtonContext, ToggleButtonContext } from '../button';\nimport type { ButtonProps, ToggleButtonProps } from '../button/types';\nimport { CheckboxContext } from '../checkbox';\nimport type { CheckboxProps } from '../checkbox/types';\nimport { GroupContext } from '../group';\nimport type { GroupProps } from '../group/types';\nimport { Icon } from '../icon';\nimport { MergeProvider } from '../merge-provider';\nimport {\n treeClassNames,\n treeGroupStateVars,\n treeIndicatorStateVars,\n treeItemStateVars,\n treeStateVars,\n} from './tree.css';\nimport type {\n TreeGroupProps,\n TreeIndicatorRenderProps,\n TreeItemProps,\n TreeMapping,\n TreeProps,\n TreeStateContextValue,\n} from './types';\nimport { createDragAndDropHandlers } from './utils';\n\nconst emptyTree = {\n key: '',\n parentKey: '',\n children: [],\n value: { id: '', label: '' },\n};\n\nconst defaultMapping: TreeMapping = {\n actions: {\n sm: {},\n lg: {},\n },\n button: {\n sm: { size: 'sm', variant: 'icon' },\n lg: { size: 'md', variant: 'icon' },\n },\n description: {\n sm: bodies.sm,\n lg: bodies.md,\n },\n drag: {\n sm: {},\n lg: {},\n },\n expansion: {\n sm: {},\n lg: {},\n },\n visibility: {\n sm: {},\n lg: {},\n },\n};\n\nconst defaultSize = 'lg';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const TreeStateContext = createContext<TreeStateContextValue<any>>({\n allowsDragging: true,\n allowsExpansion: true,\n allowsVisibility: false,\n lookup: {},\n selectedKeys: new Set(),\n selectionMode: 'none',\n tree: emptyTree,\n actions: {\n append: noop,\n getItem: () => emptyTree,\n insert: noop,\n insertAfter: noop,\n insertBefore: noop,\n move: noop,\n prepend: noop,\n remove: noop,\n removeSelectedItems: noop,\n revertIsExpanded: noop,\n setSelectedKeys: noop,\n toggleIsExpanded: noop,\n toggleIsSelected: noop,\n toggleIsViewable: noop,\n update: noop,\n },\n});\n\nfunction defaultRenderEmptyState({ isDropTarget }: GridListRenderProps) {\n return isDropTarget ? 'Add to this group' : 'Nothing to see here';\n}\n\n/**\n * By default Tree only works as an uncontrolled input. However, if you need to use the Tree\n * as a controlled input (passing state changes to the \"nodes\" props), you will need to add a\n * \"key\" prop that is a hash of the \"nodes\" prop to trigger a rerender of the component and\n * abandon it's previous state. Unfortunately, the underlying hooks don't provide a good way\n * to update the internal state of the Tree onces it's been initialized.\n */\nexport function Tree<T>(props: TreeProps<T>) {\n props = useDefaultProps(props as TreeProps<unknown>, 'Tree') as TreeProps<T>;\n\n const {\n children: childrenProp,\n allowsDragging = false,\n allowsExpansion = true,\n allowsVisibility = false,\n classNames: classNamesProps,\n disabledBehavior = 'all',\n keyboardNavigationBehavior = 'arrow',\n mapping: mappingProp,\n nodes,\n provider,\n renderDragPreview,\n renderEmptyState: renderEmptyStateProp = defaultRenderEmptyState,\n selectionBehavior = 'replace',\n selectionMode = 'none',\n showTreeLines = true,\n size = defaultSize,\n onAction,\n onScroll,\n onSelectionChange,\n onUpdate,\n ...rest\n } = props;\n\n const state = useTree({\n allowsExpansion,\n allowsVisibility,\n nodes,\n selectionMode,\n onSelectionChange,\n onUpdate,\n });\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(treeClassNames, theme.Tree, classNamesProps, {\n item: {\n description: mapping.description[size],\n },\n }) ?? {},\n [theme.Tree, classNamesProps, mapping, size],\n );\n\n const renderEmptyState = useCallback(\n (renderProps: GridListRenderProps) => (\n <div className={classNames?.empty}>\n {renderEmptyStateProp(renderProps)}\n </div>\n ),\n [classNames?.empty, renderEmptyStateProp],\n );\n\n const context = useMemo<\n [[typeof TreeStateContext, TreeStateContextValue<T>]]\n >(\n () => [\n [\n TreeStateContext,\n {\n ...state,\n allowsDragging,\n classNames,\n disabledBehavior,\n keyboardNavigationBehavior,\n renderDragPreview,\n renderEmptyState,\n selectionBehavior,\n selectionMode,\n showTreeLines,\n size,\n onAction,\n onScroll,\n },\n ],\n ],\n [\n state,\n allowsDragging,\n classNames,\n disabledBehavior,\n keyboardNavigationBehavior,\n renderDragPreview,\n renderEmptyState,\n selectionBehavior,\n selectionMode,\n showTreeLines,\n size,\n onAction,\n onScroll,\n ],\n );\n\n const style = useMemo(\n () =>\n inlineVars(treeStateVars, {\n allowsDragging,\n allowsExpansion: state.allowsExpansion,\n allowsVisibility: state.allowsVisibility,\n showTreeLines,\n size,\n }),\n [\n allowsDragging,\n state.allowsExpansion,\n state.allowsVisibility,\n showTreeLines,\n size,\n ],\n );\n\n const children = useMemo(() => {\n const treeGroupProps = {\n ...rest,\n id: state.tree.key,\n nodes: state.tree.children,\n };\n\n return provider ? (\n callRenderProps(childrenProp, { ...state, treeGroupProps })\n ) : (\n <TreeGroup {...treeGroupProps}>{childrenProp}</TreeGroup>\n );\n }, [rest, provider, childrenProp, state]);\n\n return (\n <Provider values={context}>\n <div className={classNames?.tree?.container} style={style}>\n <div className={classNames?.tree?.tree}>{children}</div>\n </div>\n </Provider>\n );\n}\n\nexport function TreeGroup<T>({\n id,\n children,\n nodes,\n types = ['all'],\n ...rest\n}: TreeGroupProps<T>) {\n const {\n actions,\n allowsDragging,\n classNames,\n disabledBehavior,\n keyboardNavigationBehavior,\n lookup,\n renderDragPreview,\n renderEmptyState,\n selectedKeys,\n selectionBehavior,\n selectionMode,\n onAction,\n onScroll,\n } = useContext(TreeStateContext);\n\n const acceptedDragTypes = useMemo(\n () => types.map((type) => `tree-${type}`),\n [types],\n );\n\n // This function cannot be treated as a component and will throw errors if implemented as one (with hooks)\n const renderDropIndicator = useCallback(\n (target: DropTarget) => (\n <DropIndicator\n className={classNames?.indicator?.container}\n // eslint-disable-next-line react-perf/jsx-no-new-function-as-prop, react/jsx-no-bind\n style={(renderProps: TreeIndicatorRenderProps) =>\n inlineVars(treeIndicatorStateVars, {\n ...renderProps,\n dropPosition:\n 'dropPosition' in target ? target.dropPosition : 'root',\n })\n }\n target={target}\n >\n <div className={classNames?.indicator?.indicator} />\n </DropIndicator>\n ),\n [classNames?.indicator?.container, classNames?.indicator?.indicator],\n );\n\n const { dragAndDropHooks } = useDragAndDrop({\n isDisabled: !allowsDragging,\n renderDragPreview,\n renderDropIndicator,\n ...createDragAndDropHandlers(id, acceptedDragTypes, lookup, actions),\n });\n\n const style = useCallback(\n (renderProps: GridListRenderProps) =>\n inlineVars(treeGroupStateVars, { ...renderProps, count: nodes.length }),\n [nodes.length],\n );\n\n const indices = useMemo(\n () =>\n nodes.reduce<Record<Key, number>>((acc, node, index) => {\n acc[node.key] = index;\n\n return acc;\n }, {}),\n [nodes],\n );\n\n return (\n <GridList\n {...rest}\n className={classNames?.group}\n disabledBehavior={disabledBehavior}\n dragAndDropHooks={dragAndDropHooks}\n items={nodes}\n keyboardNavigationBehavior={keyboardNavigationBehavior}\n renderEmptyState={renderEmptyState}\n selectedKeys={selectedKeys}\n selectionBehavior={selectionBehavior}\n selectionMode={selectionMode}\n style={style}\n onAction={onAction}\n onScroll={onScroll}\n >\n {(item) => (\n <TreeItem\n index={indices[item.key] ?? -1}\n node={item}\n isFirstChild={indices[item.key] === 0}\n isLastChild={indices[item.key] === nodes.length - 1}\n >\n {children}\n </TreeItem>\n )}\n </GridList>\n );\n}\n\ntype TreeItemContexts = [\n [\n typeof ToggleButtonContext,\n ContextValue<ToggleButtonProps, HTMLButtonElement>,\n ],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLSpanElement>],\n [\n typeof GroupContext,\n ContextValue<GroupProps<ButtonProps, HTMLButtonElement>, HTMLDivElement>,\n ],\n [typeof CheckboxContext, ContextValue<CheckboxProps, HTMLLabelElement>],\n [typeof ButtonContext, ContextValue<ButtonProps, HTMLButtonElement>],\n [typeof RACButtonContext, ContextValue<RACButtonProps, HTMLButtonElement>],\n];\n\nconst contextBlocker: TreeItemContexts = [\n [ToggleButtonContext, null],\n [AriaTextContext, null],\n [GroupContext, null],\n [CheckboxContext, null],\n [ButtonContext, null],\n [RACButtonContext, null],\n];\n\nexport function TreeItem<T>({\n children: childrenProp,\n index,\n mapping: mappingProp,\n node,\n isFirstChild,\n isLastChild,\n ...rest\n}: TreeItemProps<T>) {\n const {\n actions,\n allowsExpansion,\n classNames,\n size: sizeProp,\n } = useContext(TreeStateContext);\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const selection = useMemo(() => new Set([node.key]), [node.key]);\n\n const handleToggleExpansion = useCallback(\n () => actions.toggleIsExpanded(selection),\n [actions, selection],\n );\n\n const handleToggleSelection = useCallback(\n () => actions.toggleIsSelected(selection),\n [actions, selection],\n );\n\n const handleToggleVisibility = useCallback(\n () => actions.toggleIsViewable(selection),\n [actions, selection],\n );\n\n const { pressProps } = usePress({\n onPress: handleToggleExpansion,\n });\n\n const style = useCallback(\n (renderProps: GridListItemRenderProps) =>\n inlineVars(treeItemStateVars, {\n ...renderProps,\n count: node.children.length,\n index,\n isExpanded: 'nodes' in node.value ? !!node.value.isExpanded : false,\n isFirstChild,\n isGroup: 'nodes' in node.value,\n isLastChild,\n isViewable: !!node.value.isViewable,\n isVisible: !!node.value.isVisible,\n isReadOnly: !!node.value.isReadOnly,\n }),\n [node.children.length, node.value, index, isFirstChild, isLastChild],\n );\n\n const context = useMemo<TreeItemContexts>(() => {\n const size = sizeProp ?? defaultSize;\n const buttonProps = mapping.button[size] ?? {};\n\n return [\n [\n ToggleButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: buttonProps,\n expansion: {\n ...buttonProps,\n ...mapping.expansion[size],\n classNames: classNames?.item?.expansion,\n isSelected:\n 'nodes' in node.value ? !!node.value.isExpanded : undefined,\n onPress: handleToggleExpansion,\n },\n visibility: {\n ...buttonProps,\n ...mapping.visibility[size],\n classNames: classNames?.item?.visibility,\n isSelected: !!node.value.isViewable,\n isDisabled: !!node.value.isReadOnly,\n onPress: handleToggleVisibility,\n },\n },\n },\n ],\n [\n AriaTextContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n description: {\n ...('nodes' in node.value ? pressProps : {}),\n className: classNames?.item?.description,\n children: node.value.label,\n },\n },\n },\n ],\n [\n GroupContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n actions: {\n classNames: classNames?.item?.actions,\n context: ButtonContext,\n values: buttonProps,\n },\n },\n },\n ],\n [\n CheckboxContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n selection: {\n classNames: classNames?.item?.selection,\n onChange: handleToggleSelection,\n },\n },\n },\n ],\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: buttonProps,\n drag: {\n ...buttonProps,\n ...mapping.drag[size],\n classNames: classNames?.item?.drag,\n },\n // We use a non-interactive Button for the lines to try and simplify the\n // consistent use of space when rendered in alignment with other Buttons\n lines: {\n ...buttonProps,\n classNames: classNames?.item?.lines,\n isDisabled: true,\n },\n },\n },\n ],\n // Need to expand the RAC ButtonContext to allow for additional slots\n [RACButtonContext, { slots: { [DEFAULT_SLOT]: {}, lines: {} } }],\n ] as TreeItemContexts;\n }, [\n classNames?.item?.lines,\n classNames?.item?.expansion,\n classNames?.item?.visibility,\n classNames?.item?.description,\n classNames?.item?.actions,\n classNames?.item?.selection,\n classNames?.item?.drag,\n mapping,\n node,\n pressProps,\n sizeProp,\n handleToggleExpansion,\n handleToggleSelection,\n handleToggleVisibility,\n ]);\n\n /**\n * We need to block the above contexts from being passed into the TreeGroup\n * so that each TreeItem has a distinct context. We only use MergeProvider\n * for the above contexts because the GridListItem provides contexts that\n * we need to merge with\n */\n const children = useCallback(\n (renderProps: GridListItemRenderProps) => (\n <MergeProvider values={context}>\n <div className={classNames?.item?.item}>\n {node.parentKey && (\n <Button slot='lines'>\n <Icon />\n </Button>\n )}\n <div className={classNames?.item?.bar}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n node,\n })}\n </div>\n {'nodes' in node.value &&\n (!allowsExpansion || node.value.isExpanded) && (\n <Provider values={contextBlocker}>\n <TreeGroup\n id={node.key}\n nodes={node.children}\n types={node.value.types}\n aria-label={node.value.label}\n >\n {childrenProp}\n </TreeGroup>\n </Provider>\n )}\n </div>\n </MergeProvider>\n ),\n [\n context,\n classNames?.item?.item,\n classNames?.item?.bar,\n node,\n childrenProp,\n allowsExpansion,\n ],\n );\n\n return (\n <GridListItem\n {...rest}\n isDisabled={!!node.value.isReadOnly}\n className={classNames?.item?.container}\n style={style}\n textValue={node.value.label}\n >\n {children}\n </GridListItem>\n );\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/tree/index.tsx"],"names":["RACButtonContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+DA,IAAM,SAAA,GAAY;AAAA,EAChB,GAAA,EAAK,EAAA;AAAA,EACL,SAAA,EAAW,EAAA;AAAA,EACX,UAAU,EAAC;AAAA,EACX,KAAA,EAAO,EAAE,EAAA,EAAI,EAAA,EAAI,OAAO,EAAA;AAC1B,CAAA;AAEA,IAAM,cAAA,GAA8B;AAAA,EAClC,OAAA,EAAS;AAAA,IACP,IAAI,EAAC;AAAA,IACL,IAAI;AAAC,GACP;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA,EAAO;AAAA,IAClC,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA;AAAO,GACpC;AAAA,EACA,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,IAAI,EAAC;AAAA,IACL,IAAI;AAAC,GACP;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAI,EAAC;AAAA,IACL,IAAI;AAAC,GACP;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAI,EAAC;AAAA,IACL,IAAI;AAAC;AAET,CAAA;AAEA,IAAM,WAAA,GAAc,IAAA;AAGb,IAAM,mBAAmB,aAAA,CAA0C;AAAA,EACxE,cAAA,EAAgB,IAAA;AAAA,EAChB,eAAA,EAAiB,IAAA;A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F,GACF;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,UAAA,EAAY,CAAC,CAAC,IAAA,CAAK,KAAA,CAAM,UAAA;AAAA,MACzB,SAAA,EAAW,YAAY,IAAA,EAAM,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA,EAAW,KAAK,KAAA,CAAM,KAAA;AAAA,MAErB;AAAA;AAAA,GACH;AAEJ","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { noop } from '@accelint/core';\nimport { usePress } from '@react-aria/interactions';\nimport { createContext, useCallback, useContext, useMemo } from 'react';\nimport {\n type ContextValue,\n DEFAULT_SLOT,\n DropIndicator,\n type DropTarget,\n GridList,\n GridListItem,\n type GridListItemRenderProps,\n type GridListRenderProps,\n Provider,\n ButtonContext as RACButtonContext,\n type ButtonProps as RACButtonProps,\n type TextProps,\n useDragAndDrop,\n} from 'react-aria-components';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useTheme } from '../../hooks/use-theme';\nimport { useTree } from '../../hooks/use-tree';\nimport { bodies } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { AriaTextContext } from '../aria';\nimport { Button, ButtonContext, ToggleButtonContext } from '../button';\nimport { CheckboxContext } from '../checkbox';\nimport { GroupContext } from '../group';\nimport { Icon } from '../icon';\nimport { MergeProvider } from '../merge-provider';\nimport {\n treeClassNames,\n treeGroupStateVars,\n treeIndicatorStateVars,\n treeItemStateVars,\n treeStateVars,\n} from './tree.css';\nimport { createDragAndDropHandlers } from './utils';\nimport type { Key } from '@react-types/shared';\nimport type { ButtonProps, ToggleButtonProps } from '../button/types';\nimport type { CheckboxProps } from '../checkbox/types';\nimport type { GroupProps } from '../group/types';\nimport type {\n TreeGroupProps,\n TreeIndicatorRenderProps,\n TreeItemProps,\n TreeMapping,\n TreeProps,\n TreeStateContextValue,\n} from './types';\n\nconst emptyTree = {\n key: '',\n parentKey: '',\n children: [],\n value: { id: '', label: '' },\n};\n\nconst defaultMapping: TreeMapping = {\n actions: {\n sm: {},\n lg: {},\n },\n button: {\n sm: { size: 'sm', variant: 'icon' },\n lg: { size: 'md', variant: 'icon' },\n },\n description: {\n sm: bodies.sm,\n lg: bodies.md,\n },\n drag: {\n sm: {},\n lg: {},\n },\n expansion: {\n sm: {},\n lg: {},\n },\n visibility: {\n sm: {},\n lg: {},\n },\n};\n\nconst defaultSize = 'lg';\n\n// biome-ignore lint/suspicious/noExplicitAny: default TreeStateContext uses a generic item type\nexport const TreeStateContext = createContext<TreeStateContextValue<any>>({\n allowsDragging: true,\n allowsExpansion: true,\n allowsVisibility: false,\n lookup: {},\n selectedKeys: new Set(),\n selectionMode: 'none',\n tree: emptyTree,\n actions: {\n append: noop,\n getItem: () => emptyTree,\n insert: noop,\n insertAfter: noop,\n insertBefore: noop,\n move: noop,\n prepend: noop,\n remove: noop,\n removeSelectedItems: noop,\n revertIsExpanded: noop,\n setSelectedKeys: noop,\n toggleIsExpanded: noop,\n toggleIsSelected: noop,\n toggleIsViewable: noop,\n update: noop,\n },\n});\n\nfunction defaultRenderEmptyState({ isDropTarget }: GridListRenderProps) {\n return isDropTarget ? 'Add to this group' : 'Nothing to see here';\n}\n\n/**\n * By default Tree only works as an uncontrolled input. However, if you need to use the Tree\n * as a controlled input (passing state changes to the \"nodes\" props), you will need to add a\n * \"key\" prop that is a hash of the \"nodes\" prop to trigger a rerender of the component and\n * abandon it's previous state. Unfortunately, the underlying hooks don't provide a good way\n * to update the internal state of the Tree onces it's been initialized.\n */\nexport function Tree<T>(props: TreeProps<T>) {\n const defaultedProps = useDefaultProps(\n props as TreeProps<unknown>,\n 'Tree',\n ) as TreeProps<T>;\n\n const {\n children: childrenProp,\n allowsDragging = false,\n allowsExpansion = true,\n allowsVisibility = false,\n classNames: classNamesProps,\n disabledBehavior = 'all',\n keyboardNavigationBehavior = 'arrow',\n mapping: mappingProp,\n nodes,\n provider,\n renderDragPreview,\n renderEmptyState: renderEmptyStateProp = defaultRenderEmptyState,\n selectionBehavior = 'replace',\n selectionMode = 'none',\n showTreeLines = true,\n size = defaultSize,\n onAction,\n onScroll,\n onSelectionChange,\n onUpdate,\n ...rest\n } = defaultedProps;\n\n const state = useTree({\n allowsExpansion,\n allowsVisibility,\n nodes,\n selectionMode,\n onSelectionChange,\n onUpdate,\n });\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(treeClassNames, theme.Tree, classNamesProps, {\n item: {\n description: mapping.description[size],\n },\n }) ?? {},\n [theme.Tree, classNamesProps, mapping, size],\n );\n\n const renderEmptyState = useCallback(\n (renderProps: GridListRenderProps) => (\n <div className={classNames?.empty}>\n {renderEmptyStateProp(renderProps)}\n </div>\n ),\n [classNames?.empty, renderEmptyStateProp],\n );\n\n const context = useMemo<\n [[typeof TreeStateContext, TreeStateContextValue<T>]]\n >(\n () => [\n [\n TreeStateContext,\n {\n ...state,\n allowsDragging,\n classNames,\n disabledBehavior,\n keyboardNavigationBehavior,\n renderDragPreview,\n renderEmptyState,\n selectionBehavior,\n selectionMode,\n showTreeLines,\n size,\n onAction,\n onScroll,\n },\n ],\n ],\n [\n state,\n allowsDragging,\n classNames,\n disabledBehavior,\n keyboardNavigationBehavior,\n renderDragPreview,\n renderEmptyState,\n selectionBehavior,\n selectionMode,\n showTreeLines,\n size,\n onAction,\n onScroll,\n ],\n );\n\n const style = useMemo(\n () =>\n inlineVars(treeStateVars, {\n allowsDragging,\n allowsExpansion: state.allowsExpansion,\n allowsVisibility: state.allowsVisibility,\n showTreeLines,\n size,\n }),\n [\n allowsDragging,\n state.allowsExpansion,\n state.allowsVisibility,\n showTreeLines,\n size,\n ],\n );\n\n const children = useMemo(() => {\n const treeGroupProps = {\n ...rest,\n id: state.tree.key,\n nodes: state.tree.children,\n };\n\n return provider ? (\n callRenderProps(childrenProp, { ...state, treeGroupProps })\n ) : (\n <TreeGroup {...treeGroupProps}>{childrenProp}</TreeGroup>\n );\n // biome-ignore lint/correctness/useExhaustiveDependencies: `state` is intentionally included as a whole because it is spread into render props; listing all state fields would be brittle.\n }, [rest, provider, childrenProp, state]);\n\n return (\n <Provider values={context}>\n <div className={classNames?.tree?.container} style={style}>\n <div className={classNames?.tree?.tree}>{children}</div>\n </div>\n </Provider>\n );\n}\n\nexport function TreeGroup<T>({\n id,\n children,\n nodes,\n types = ['all'],\n ...rest\n}: TreeGroupProps<T>) {\n const {\n actions,\n allowsDragging,\n classNames,\n disabledBehavior,\n keyboardNavigationBehavior,\n lookup,\n renderDragPreview,\n renderEmptyState,\n selectedKeys,\n selectionBehavior,\n selectionMode,\n onAction,\n onScroll,\n } = useContext(TreeStateContext);\n\n const acceptedDragTypes = useMemo(\n () => types.map((type) => `tree-${type}`),\n [types],\n );\n\n // This function cannot be treated as a component and will throw errors if implemented as one (with hooks)\n const renderDropIndicator = useCallback(\n (target: DropTarget) => (\n <DropIndicator\n className={classNames?.indicator?.container}\n // eslint-disable-next-line react-perf/jsx-no-new-function-as-prop, react/jsx-no-bind\n style={(renderProps: TreeIndicatorRenderProps) =>\n inlineVars(treeIndicatorStateVars, {\n ...renderProps,\n dropPosition:\n 'dropPosition' in target ? target.dropPosition : 'root',\n })\n }\n target={target}\n >\n <div className={classNames?.indicator?.indicator} />\n </DropIndicator>\n ),\n [classNames?.indicator?.container, classNames?.indicator?.indicator],\n );\n\n const { dragAndDropHooks } = useDragAndDrop({\n isDisabled: !allowsDragging,\n renderDragPreview,\n renderDropIndicator,\n ...createDragAndDropHandlers(id, acceptedDragTypes, lookup, actions),\n });\n\n const style = useCallback(\n (renderProps: GridListRenderProps) =>\n inlineVars(treeGroupStateVars, { ...renderProps, count: nodes.length }),\n [nodes.length],\n );\n\n const indices = useMemo(\n () =>\n nodes.reduce<Record<Key, number>>((acc, node, index) => {\n acc[node.key] = index;\n\n return acc;\n }, {}),\n [nodes],\n );\n\n return (\n <GridList\n {...rest}\n className={classNames?.group}\n disabledBehavior={disabledBehavior}\n dragAndDropHooks={dragAndDropHooks}\n items={nodes}\n keyboardNavigationBehavior={keyboardNavigationBehavior}\n renderEmptyState={renderEmptyState}\n selectedKeys={selectedKeys}\n selectionBehavior={selectionBehavior}\n selectionMode={selectionMode}\n style={style}\n onAction={onAction}\n onScroll={onScroll}\n >\n {(item) => (\n <TreeItem\n index={indices[item.key] ?? -1}\n node={item}\n isFirstChild={indices[item.key] === 0}\n isLastChild={indices[item.key] === nodes.length - 1}\n >\n {children}\n </TreeItem>\n )}\n </GridList>\n );\n}\n\ntype TreeItemContexts = [\n [\n typeof ToggleButtonContext,\n ContextValue<ToggleButtonProps, HTMLButtonElement>,\n ],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLSpanElement>],\n [\n typeof GroupContext,\n ContextValue<GroupProps<ButtonProps, HTMLButtonElement>, HTMLDivElement>,\n ],\n [typeof CheckboxContext, ContextValue<CheckboxProps, HTMLLabelElement>],\n [typeof ButtonContext, ContextValue<ButtonProps, HTMLButtonElement>],\n [typeof RACButtonContext, ContextValue<RACButtonProps, HTMLButtonElement>],\n];\n\nconst contextBlocker: TreeItemContexts = [\n [ToggleButtonContext, null],\n [AriaTextContext, null],\n [GroupContext, null],\n [CheckboxContext, null],\n [ButtonContext, null],\n [RACButtonContext, null],\n];\n\nexport function TreeItem<T>({\n children: childrenProp,\n index,\n mapping: mappingProp,\n node,\n isFirstChild,\n isLastChild,\n ...rest\n}: TreeItemProps<T>) {\n const {\n actions,\n allowsExpansion,\n classNames,\n size: sizeProp,\n } = useContext(TreeStateContext);\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const selection = useMemo(() => new Set([node.key]), [node.key]);\n\n const handleToggleExpansion = useCallback(\n () => actions.toggleIsExpanded(selection),\n [actions, selection],\n );\n\n const handleToggleSelection = useCallback(\n () => actions.toggleIsSelected(selection),\n [actions, selection],\n );\n\n const handleToggleVisibility = useCallback(\n () => actions.toggleIsViewable(selection),\n [actions, selection],\n );\n\n const { pressProps } = usePress({\n onPress: handleToggleExpansion,\n });\n\n const style = useCallback(\n (renderProps: GridListItemRenderProps) =>\n inlineVars(treeItemStateVars, {\n ...renderProps,\n count: node.children.length,\n index,\n isExpanded: 'nodes' in node.value ? !!node.value.isExpanded : false,\n isFirstChild,\n isGroup: 'nodes' in node.value,\n isLastChild,\n isViewable: !!node.value.isViewable,\n isVisible: !!node.value.isVisible,\n isReadOnly: !!node.value.isReadOnly,\n }),\n [node.children.length, node.value, index, isFirstChild, isLastChild],\n );\n\n const context = useMemo<TreeItemContexts>(() => {\n const size = sizeProp ?? defaultSize;\n const buttonProps = mapping.button[size] ?? {};\n\n return [\n [\n ToggleButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: buttonProps,\n expansion: {\n ...buttonProps,\n ...mapping.expansion[size],\n classNames: classNames?.item?.expansion,\n isSelected:\n 'nodes' in node.value ? !!node.value.isExpanded : undefined,\n onPress: handleToggleExpansion,\n },\n visibility: {\n ...buttonProps,\n ...mapping.visibility[size],\n classNames: classNames?.item?.visibility,\n isSelected: !!node.value.isViewable,\n isDisabled: !!node.value.isReadOnly,\n onPress: handleToggleVisibility,\n },\n },\n },\n ],\n [\n AriaTextContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n description: {\n ...('nodes' in node.value ? pressProps : {}),\n className: classNames?.item?.description,\n children: node.value.label,\n },\n },\n },\n ],\n [\n GroupContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n actions: {\n classNames: classNames?.item?.actions,\n context: ButtonContext,\n values: buttonProps,\n },\n },\n },\n ],\n [\n CheckboxContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n selection: {\n classNames: classNames?.item?.selection,\n onChange: handleToggleSelection,\n },\n },\n },\n ],\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: buttonProps,\n drag: {\n ...buttonProps,\n ...mapping.drag[size],\n classNames: classNames?.item?.drag,\n },\n // We use a non-interactive Button for the lines to try and simplify the\n // consistent use of space when rendered in alignment with other Buttons\n lines: {\n ...buttonProps,\n classNames: classNames?.item?.lines,\n isDisabled: true,\n },\n },\n },\n ],\n // Need to expand the RAC ButtonContext to allow for additional slots\n [RACButtonContext, { slots: { [DEFAULT_SLOT]: {}, lines: {} } }],\n ] as TreeItemContexts;\n }, [\n classNames?.item?.lines,\n classNames?.item?.expansion,\n classNames?.item?.visibility,\n classNames?.item?.description,\n classNames?.item?.actions,\n classNames?.item?.selection,\n classNames?.item?.drag,\n mapping,\n node,\n pressProps,\n sizeProp,\n handleToggleExpansion,\n handleToggleSelection,\n handleToggleVisibility,\n ]);\n\n /**\n * We need to block the above contexts from being passed into the TreeGroup\n * so that each TreeItem has a distinct context. We only use MergeProvider\n * for the above contexts because the GridListItem provides contexts that\n * we need to merge with\n */\n const children = useCallback(\n (renderProps: GridListItemRenderProps) => (\n <MergeProvider values={context}>\n <div className={classNames?.item?.item}>\n {node.parentKey && (\n <Button slot='lines'>\n <Icon />\n </Button>\n )}\n <div className={classNames?.item?.bar}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n node,\n })}\n </div>\n {'nodes' in node.value &&\n (!allowsExpansion || node.value.isExpanded) && (\n <Provider values={contextBlocker}>\n <TreeGroup\n id={node.key}\n nodes={node.children}\n types={node.value.types}\n aria-label={node.value.label}\n >\n {childrenProp}\n </TreeGroup>\n </Provider>\n )}\n </div>\n </MergeProvider>\n ),\n [\n context,\n classNames?.item?.item,\n classNames?.item?.bar,\n node,\n childrenProp,\n allowsExpansion,\n ],\n );\n\n return (\n <GridListItem\n {...rest}\n isDisabled={!!node.value.isReadOnly}\n className={classNames?.item?.container}\n style={style}\n textValue={node.value.label}\n >\n {children}\n </GridListItem>\n );\n}\n"]}