@accelint/design-system 1.1.3 → 1.1.4

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 (79) hide show
  1. package/dist/components/aria/index.js.map +1 -1
  2. package/dist/components/button/index.js.map +1 -1
  3. package/dist/components/checkbox/index.js.map +1 -1
  4. package/dist/components/chip/index.js.map +1 -1
  5. package/dist/components/collection/index.d.ts +1 -1
  6. package/dist/components/collection/index.js.map +1 -1
  7. package/dist/components/combo-box/index.js +9 -5
  8. package/dist/components/combo-box/index.js.map +1 -1
  9. package/dist/components/date-field/index.js +8 -4
  10. package/dist/components/date-field/index.js.map +1 -1
  11. package/dist/components/date-input/index.js +15 -7
  12. package/dist/components/date-input/index.js.map +1 -1
  13. package/dist/components/dialog/index.js +7 -5
  14. package/dist/components/dialog/index.js.map +1 -1
  15. package/dist/components/drawer/index.js +21 -8
  16. package/dist/components/drawer/index.js.map +1 -1
  17. package/dist/components/element/index.d.ts +1 -1
  18. package/dist/components/element/index.js +7 -3
  19. package/dist/components/element/index.js.map +1 -1
  20. package/dist/components/element/types.d.ts +2 -0
  21. package/dist/components/group/index.js +6 -6
  22. package/dist/components/group/index.js.map +1 -1
  23. package/dist/components/icon/index.js +4 -4
  24. package/dist/components/icon/index.js.map +1 -1
  25. package/dist/components/index.d.ts +34 -34
  26. package/dist/components/input/index.js +17 -8
  27. package/dist/components/input/index.js.map +1 -1
  28. package/dist/components/menu/index.js.map +1 -1
  29. package/dist/components/merge-provider/index.js.map +1 -1
  30. package/dist/components/merge-provider/types.d.ts +2 -0
  31. package/dist/components/number-field/index.js +8 -4
  32. package/dist/components/number-field/index.js.map +1 -1
  33. package/dist/components/options/index.js.map +1 -1
  34. package/dist/components/picker/index.js.map +1 -1
  35. package/dist/components/popover/index.js +8 -4
  36. package/dist/components/popover/index.js.map +1 -1
  37. package/dist/components/query-builder/action-element.js.map +1 -1
  38. package/dist/components/query-builder/dataset-sample.js.map +1 -1
  39. package/dist/components/query-builder/group.js.map +1 -1
  40. package/dist/components/query-builder/index.js.map +1 -1
  41. package/dist/components/query-builder/value-editor.js.map +1 -1
  42. package/dist/components/query-builder/value-selector.js.map +1 -1
  43. package/dist/components/radio/index.js +12 -8
  44. package/dist/components/radio/index.js.map +1 -1
  45. package/dist/components/search-field/index.js +9 -5
  46. package/dist/components/search-field/index.js.map +1 -1
  47. package/dist/components/select/index.js +5 -5
  48. package/dist/components/select/index.js.map +1 -1
  49. package/dist/components/slider/index.js +48 -20
  50. package/dist/components/slider/index.js.map +1 -1
  51. package/dist/components/switch/index.js +4 -4
  52. package/dist/components/switch/index.js.map +1 -1
  53. package/dist/components/tabs/index.js +32 -20
  54. package/dist/components/tabs/index.js.map +1 -1
  55. package/dist/components/text-field/index.js +8 -4
  56. package/dist/components/text-field/index.js.map +1 -1
  57. package/dist/components/textarea/index.js +16 -7
  58. package/dist/components/textarea/index.js.map +1 -1
  59. package/dist/components/time-field/index.js +8 -4
  60. package/dist/components/time-field/index.js.map +1 -1
  61. package/dist/components/tooltip/index.js +17 -9
  62. package/dist/components/tooltip/index.js.map +1 -1
  63. package/dist/components/tree/index.js.map +1 -1
  64. package/dist/components/tree/utils.js +3 -1
  65. package/dist/components/tree/utils.js.map +1 -1
  66. package/dist/hooks/index.d.ts +4 -4
  67. package/dist/hooks/use-theme/index.d.ts +1 -1
  68. package/dist/hooks/use-theme/index.js.map +1 -1
  69. package/dist/hooks/use-tree/index.js.map +1 -1
  70. package/dist/hooks/use-update-effect/index.js.map +1 -1
  71. package/dist/index.d.ts +34 -34
  72. package/dist/ladle/actions.js.map +1 -1
  73. package/dist/test/setup.js +10 -10
  74. package/dist/test/setup.js.map +1 -1
  75. package/dist/utils/css/index.js.map +1 -1
  76. package/dist/utils/props/index.js +1 -2
  77. package/dist/utils/props/index.js.map +1 -1
  78. package/dist/vanilla.d.ts +29 -29
  79. package/package.json +11 -10
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/input/index.tsx"],"names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A,MACA,KAAA;AAAA,MACA,QAAA,EAAU,YAAA;AAAA,MACV,cAAA,EAAc;AAAA;AAAA,KAElB,CAAA,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 ChangeEvent,\n type ForwardedRef,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n InputContext as RACInputContext,\n type InputProps as RACInputProps,\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 { inputClassNames, inputStateVars } from './input.css';\nimport type { InputMapping, InputProps } from './types';\n\nconst defaultMapping: InputMapping = {\n sizer: {\n sm: inputs.sm,\n lg: inputs.lg,\n },\n input: {\n sm: inputs.sm,\n lg: inputs.lg,\n },\n};\n\nexport const InputContext =\n createContext<ContextValue<InputProps, HTMLInputElement>>(null);\n\n/**\n * Only intended for generic text-like inputs, see types in props for list\n * Other more specific inputs should be handled by other components\n */\nexport const Input = forwardRef(function Input(\n props: InputProps,\n ref: ForwardedRef<HTMLInputElement>,\n) {\n [props, ref] = useContextProps(props, ref, RACInputContext);\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 RACInputProps).className = undefined;\n (props as RACInputProps).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, InputContext);\n\n props = useDefaultProps(props, 'Input');\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 size = 'lg',\n type = 'text',\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 length = (`${value ?? ''}`.length || placeholder?.length) ?? 0;\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(inputClassNames, theme.Input, classNamesProp, {\n sizer: mapping.sizer[size],\n input: mapping.input[size],\n }),\n [theme.Input, classNamesProp, mapping, 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(inputStateVars, {\n length,\n size,\n type,\n isDisabled,\n isEmpty,\n isFocused,\n isFocusVisible,\n isHovered,\n isInvalid,\n isPlaceholder,\n isReadOnly,\n isRequired,\n }),\n [\n length,\n size,\n type,\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: ChangeEvent<HTMLInputElement>) => {\n onChange?.(event);\n\n if (!event.defaultPrevented) {\n setValue(event.target.value);\n }\n },\n [onChange, setValue],\n );\n\n return (\n <div className={classNames?.container} style={style}>\n <div className={classNames?.sizer}>\n <input\n {...mergedProps}\n ref={ref}\n className={classNames?.input}\n disabled={isDisabled}\n placeholder={placeholder}\n readOnly={isReadOnly}\n required={isRequired}\n type={type}\n value={value}\n onChange={handleChange}\n aria-invalid={ariaInvalid}\n />\n </div>\n </div>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/input/index.tsx"],"names":["Input","RACInputContext"],"mappings":";;;;;;;;;;;;;;;AAqCA,IAAM,cAAA,GAA+B;AAAA,EACnC,KAAA,EAAO;AAAA,IACL,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;AAEf,CAAA;AAEO,IAAM,YAAA,GACX,cAA0D,IAAI;AAMzD,IAAM,KAAA,GAAQ,UAAA,CAAW,SAASA,MAAAA,CACvC,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,aAAA,EAAe,WAAW,CAAA,GAAI,eAAA;AAAA,IACnC,KAAA;AAAA,IACA,GAAA;AAAA,IACAC;AAAA,GACF;AAIA,EAAC,cAAgC,SAAA,GAAY,MAAA;AAC7C,EAAC,cAAgC,KAAA,GAAQ,MAAA;AAIzC,EAAA,MAAM,CAAC,aAAA,EAAe,WAAW,CAAA,GAAI,eAAA;AAAA,IACnC,aAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,YAAA,GAAe,eAAA,CAAgB,aAAA,EAAe,OAAO,CAAA;AAE3D,EAAA,MAAM;AAAA,IACJ,UAAA,EAAY,cAAA;AAAA,IACZ,YAAA,GAAe,EAAA;AAAA,IACf,UAAU,UAAA,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AC,UAAU,QAAQ;AAAA,GACrB;AAEA,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,SAAA,EAAW,OACrC,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,KAAA,EAC1B,QAAA,kBAAA,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACE,GAAG,WAAA;AAAA,MACJ,GAAA,EAAK,WAAA;AAAA,MACL,WAAW,UAAA,EAAY,KAAA;AAAA,MACvB,QAAA,EAAU,UAAA;AAAA,MACV,WAAA;AAAA,MACA,QAAA,EAAU,UAAA;AAAA,MACV,QAAA,EAAU,UAAA;AAAA,MACV,IAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA,EAAU,YAAA;AAAA,MACV,cAAA,EAAc;AAAA;AAAA,KAElB,CAAA,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 ChangeEvent,\n createContext,\n type ForwardedRef,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n InputContext as RACInputContext,\n type InputProps as RACInputProps,\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 { inputClassNames, inputStateVars } from './input.css';\nimport type { InputMapping, InputProps } from './types';\n\nconst defaultMapping: InputMapping = {\n sizer: {\n sm: inputs.sm,\n lg: inputs.lg,\n },\n input: {\n sm: inputs.sm,\n lg: inputs.lg,\n },\n};\n\nexport const InputContext =\n createContext<ContextValue<InputProps, HTMLInputElement>>(null);\n\n/**\n * Only intended for generic text-like inputs, see types in props for list\n * Other more specific inputs should be handled by other components\n */\nexport const Input = forwardRef(function Input(\n props: InputProps,\n ref: ForwardedRef<HTMLInputElement>,\n) {\n const [contextProps1, contextRef1] = useContextProps(\n props,\n ref,\n RACInputContext,\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 RACInputProps).className = undefined;\n (contextProps1 as RACInputProps).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 InputContext,\n );\n\n const defaultProps = useDefaultProps(contextProps2, 'Input');\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 size = 'lg',\n type = 'text',\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 length = (`${value ?? ''}`.length || placeholder?.length) ?? 0;\n const isInvalid = !!ariaInvalid && ariaInvalid !== 'false';\n const isPlaceholder = !!placeholder && !value;\n const isEmpty = !value;\n\n const { isFocused, isFocusVisible, focusProps } = useFocusRing({\n autoFocus: defaultProps.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(inputClassNames, theme.Input, classNamesProp, {\n sizer: mapping.sizer[size],\n input: mapping.input[size],\n }),\n [theme.Input, classNamesProp, mapping, 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(inputStateVars, {\n length,\n size,\n type,\n isDisabled,\n isEmpty,\n isFocused,\n isFocusVisible,\n isHovered,\n isInvalid,\n isPlaceholder,\n isReadOnly,\n isRequired,\n }),\n [\n length,\n size,\n type,\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: ChangeEvent<HTMLInputElement>) => {\n onChange?.(event);\n\n if (!event.defaultPrevented) {\n setValue(event.target.value);\n }\n },\n [onChange, setValue],\n );\n\n return (\n <div className={classNames?.container} style={style}>\n <div className={classNames?.sizer}>\n <input\n {...mergedProps}\n ref={contextRef2}\n className={classNames?.input}\n disabled={isDisabled}\n placeholder={placeholder}\n readOnly={isReadOnly}\n required={isRequired}\n type={type}\n value={value}\n onChange={handleChange}\n aria-invalid={ariaInvalid}\n />\n </div>\n </div>\n );\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/menu/index.tsx"],"names":["Menu","MenuList","RACMenu","MenuItem","RACMenuItem"],"mappings":";;;;;;;;;;;;;;;;AAiEA,IAAM,cAAA,GAA8B;AAAA,EAClC,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAI,QAAA,CAAS,EAA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A,EAAS,IAAA,EAAK,SAAS,QAAA,EAAA,OAAA,EAAQ,CAAA,GAEhC,SAEJ,CAAA,EACF,CAAA;AAAA,IAEJ,CAAA;AAAA,IACA,CAAC,YAAA,EAAc,UAAA,EAAY,IAAA,EAAM,IAAA,EAAM,MAAM,MAAM;AAAA,GACrD;AAEA,EAAA,uBACE,GAAA;AAAA,IAACC,UAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,IAAI,EAAA,IAAM,SAAA;AAAA,MACV,GAAA,EAAK,SAAA;AAAA,MACL,SAAA,EAAW,YAAY,IAAA,EAAM,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA;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 type ForwardedRef,\n type HTMLAttributes,\n type Ref,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n Collection,\n type CollectionRenderer,\n CollectionRendererContext,\n type ContextValue,\n DEFAULT_SLOT,\n type MenuSectionProps,\n MenuStateContext,\n Popover,\n type PopoverRenderProps,\n Provider,\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n type MenuItemRenderProps as RACMenuItemRenderProps,\n type SeparatorProps,\n type TextProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useSlot } from '../../hooks/use-slot';\nimport { useTheme } from '../../hooks/use-theme';\nimport { bodies, headings } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n AriaHeaderContext,\n AriaKeyboardContext,\n AriaMenuSection,\n AriaMenuSectionContext,\n AriaSeparatorContext,\n AriaText,\n AriaTextContext,\n} from '../aria';\nimport { createCollectionRenderer } from '../collection';\nimport { IconContext } from '../icon';\nimport type { IconProps } from '../icon/types';\nimport { menuClassNames, menuItemStateVars, menuStateVars } from './menu.css';\nimport type {\n MenuItemProps,\n MenuListProps,\n MenuMapping,\n MenuProps,\n} from './types';\n\nconst defaultMapping: MenuMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n header: {\n sm: headings.v4,\n lg: headings.v5,\n },\n label: {\n sm: bodies.sm,\n lg: bodies.sm,\n },\n shortcut: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const MenuContext =\n createContext<ContextValue<MenuProps, HTMLElement>>(null);\n\n/**\n * Menu component that supports display and selection of menu items via a trigger (right-click or click)\n * Customization of React Aria's Menu and Menu Item components https://react-spectrum.adobe.com/react-aria/Menu.html\n */\nexport const Menu = forwardRef(function Menu(\n props: MenuProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, MenuContext);\n const finalProps = useDefaultProps(mergedProps, 'Menu');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () =>\n mergeClassNames(menuClassNames, classNamesProp, theme.Menu, {\n menu: { container: theme.className }, // required to consume global theme within Popover\n }),\n [classNamesProp, theme.Menu, theme.className],\n );\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const style = useCallback(\n (renderProps: PopoverRenderProps) => ({\n ...theme.style, // required to consume global styles within Popover\n ...inlineVars(menuStateVars, {\n ...renderProps,\n size,\n }),\n }),\n [theme.style, size],\n );\n\n const values = useMemo<\n [\n [\n typeof MenuListContext,\n ContextValue<MenuListProps<unknown>, HTMLDivElement>,\n ],\n ]\n >(\n () => [[MenuListContext, { classNames, mapping, size }]],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: PopoverRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.menu?.menu}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.menu?.menu, size, values],\n );\n\n return (\n <Popover\n {...rest}\n ref={mergedRef}\n className={classNames?.menu?.container}\n style={style}\n >\n {children}\n </Popover>\n );\n});\n\nexport const MenuListContext =\n createContext<ContextValue<MenuListProps<unknown>, HTMLDivElement>>(null);\n\ntype MenuListContexts = [\n [\n typeof MenuItemContext,\n ContextValue<MenuItemProps<unknown>, HTMLDivElement>,\n ],\n [\n typeof AriaMenuSectionContext,\n ContextValue<MenuSectionProps<object>, HTMLElement>,\n ],\n [\n typeof AriaHeaderContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n [typeof AriaSeparatorContext, ContextValue<SeparatorProps, HTMLElement>],\n];\n\nexport const MenuList = forwardRef(function MenuList<T extends object>(\n props: MenuListProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, MenuListContext);\n const finalProps = useDefaultProps(mergedProps, 'Menu');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n items,\n mapping: mappingProp,\n selectionMode = 'single',\n size = defaultSize,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\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(menuClassNames, theme.Menu, classNamesProp, {\n list: { header: mapping.header[size] },\n }),\n [theme.Menu, classNamesProp, mapping.header, size],\n );\n\n const values = useMemo<MenuListContexts>(\n () => [\n [MenuItemContext, { classNames, mapping, size }],\n [AriaMenuSectionContext, { className: classNames?.list?.section }],\n [AriaHeaderContext, { className: classNames?.list?.header }],\n [AriaSeparatorContext, { className: classNames?.list?.separator }],\n ],\n [classNames, mapping, size],\n );\n\n const children = useMemo(() => {\n if (!(childrenProp || items)) {\n return null;\n }\n\n return (\n <AriaMenuSection className={classNames?.list?.list}>\n {typeof childrenProp === 'function' ? (\n <Collection items={items}>{childrenProp}</Collection>\n ) : (\n childrenProp\n )}\n </AriaMenuSection>\n );\n }, [childrenProp, classNames?.list?.list, items]);\n\n const renderer = useMemo<CollectionRenderer>(\n // @ts-expect-error ts unnecessarily guarding against null state\n () => createCollectionRenderer(MenuStateContext, values),\n [values],\n );\n\n return (\n <CollectionRendererContext.Provider value={renderer}>\n <Provider values={values}>\n <RACMenu<T>\n {...rest}\n ref={mergedRef}\n className={classNames?.list?.container}\n items={items}\n selectionMode={selectionMode}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </RACMenu>\n </Provider>\n </CollectionRendererContext.Provider>\n );\n});\n\nexport const MenuItemContext =\n createContext<ContextValue<MenuItemProps<unknown>, HTMLDivElement>>(null);\n\nexport const MenuItem = forwardRef(function MenuItem<T extends object>(\n props: MenuItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, MenuItemContext);\n const finalProps = useDefaultProps(mergedProps, 'MenuItem');\n\n const {\n id,\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n textValue = typeof childrenProp === 'string' ? childrenProp : undefined,\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(menuClassNames, classNamesProp, theme.Menu, {\n item: {\n description: mapping.description[size],\n label: mapping.label[size],\n shortcut: mapping.shortcut[size],\n },\n }),\n [theme.Menu, classNamesProp, mapping, size],\n );\n\n const [descriptionRef, hasDescription] = useSlot();\n\n const style = useCallback(\n (renderProps: RACMenuItemRenderProps) =>\n inlineVars(menuItemStateVars, { ...renderProps, size, hasDescription }),\n [hasDescription, size],\n );\n\n const values = useMemo<\n [\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n [\n typeof AriaKeyboardContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n ]\n >(\n () => [\n [\n AriaTextContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n label: { className: classNames?.item?.label },\n description: {\n ref: descriptionRef,\n className: classNames?.item?.description,\n },\n },\n },\n ],\n [\n IconContext,\n {\n slots: {\n [DEFAULT_SLOT]: { classNames: classNames?.item?.icon },\n more: { classNames: classNames?.item?.more },\n },\n },\n ],\n [AriaKeyboardContext, { className: classNames?.item?.shortcut }],\n ],\n [\n classNames?.item?.label,\n descriptionRef,\n classNames?.item?.description,\n classNames?.item?.icon,\n classNames?.item?.more,\n classNames?.item?.shortcut,\n ],\n );\n\n const children = useCallback(\n (renderProps: RACMenuItemRenderProps) => {\n const content = callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n });\n\n return (\n <Provider values={values}>\n <div className={classNames?.item?.item}>\n {typeof content === 'string' ? (\n <AriaText slot='label'>{content}</AriaText>\n ) : (\n content\n )}\n </div>\n </Provider>\n );\n },\n [childrenProp, classNames?.item?.item, size, values],\n );\n\n return (\n <RACMenuItem<T>\n {...rest}\n id={id ?? textValue}\n ref={mergedRef as unknown as Ref<T>}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </RACMenuItem>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/menu/index.tsx"],"names":["Menu","MenuList","R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5C,GAAG,WAAA;AAAA,QACH,IAAA;AAAA,QACA,eAAA,EAAiB;AAAA,OAClB,CAAA;AAED,MAAA,2BACG,QAAA,EAAA,EAAS,MAAA,EACR,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,YAAY,IAAA,EAAM,IAAA,EAC/B,iBAAO,OAAA,KAAY,QAAA,uBACjB,QAAA,EAAA,EAAS,IAAA,EAAK,SAAS,QAAA,EAAA,OAAA,EAAQ,CAAA,GAEhC,SAEJ,CAAA,EACF,CAAA;AAAA,IAEJ,CAAA;AAAA,IACA,CAAC,YAAA,EAAc,UAAA,EAAY,IAAA,EAAM,IAAA,EAAM,MAAM,MAAM;AAAA,GACrD;AAEA,EAAA,uBACE,GAAA;AAAA,IAACC,UAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,IAAI,EAAA,IAAM,SAAA;AAAA,MACV,GAAA,EAAK,SAAA;AAAA,MACL,SAAA,EAAW,YAAY,IAAA,EAAM,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA;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 type HTMLAttributes,\n type Ref,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n Collection,\n type CollectionRenderer,\n CollectionRendererContext,\n type ContextValue,\n DEFAULT_SLOT,\n type MenuSectionProps,\n MenuStateContext,\n Popover,\n type PopoverRenderProps,\n Provider,\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n type MenuItemRenderProps as RACMenuItemRenderProps,\n type SeparatorProps,\n type TextProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useSlot } from '../../hooks/use-slot';\nimport { useTheme } from '../../hooks/use-theme';\nimport { bodies, headings } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n AriaHeaderContext,\n AriaKeyboardContext,\n AriaMenuSection,\n AriaMenuSectionContext,\n AriaSeparatorContext,\n AriaText,\n AriaTextContext,\n} from '../aria';\nimport { createCollectionRenderer } from '../collection';\nimport { IconContext } from '../icon';\nimport { menuClassNames, menuItemStateVars, menuStateVars } from './menu.css';\nimport type { IconProps } from '../icon/types';\nimport type {\n MenuItemProps,\n MenuListProps,\n MenuMapping,\n MenuProps,\n} from './types';\n\nconst defaultMapping: MenuMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n header: {\n sm: headings.v4,\n lg: headings.v5,\n },\n label: {\n sm: bodies.sm,\n lg: bodies.sm,\n },\n shortcut: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const MenuContext =\n createContext<ContextValue<MenuProps, HTMLElement>>(null);\n\n/**\n * Menu component that supports display and selection of menu items via a trigger (right-click or click)\n * Customization of React Aria's Menu and Menu Item components https://react-spectrum.adobe.com/react-aria/Menu.html\n */\nexport const Menu = forwardRef(function Menu(\n props: MenuProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, MenuContext);\n const finalProps = useDefaultProps(mergedProps, 'Menu');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () =>\n mergeClassNames(menuClassNames, classNamesProp, theme.Menu, {\n menu: { container: theme.className }, // required to consume global theme within Popover\n }),\n [classNamesProp, theme.Menu, theme.className],\n );\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const style = useCallback(\n (renderProps: PopoverRenderProps) => ({\n ...theme.style, // required to consume global styles within Popover\n ...inlineVars(menuStateVars, {\n ...renderProps,\n size,\n }),\n }),\n [theme.style, size],\n );\n\n const values = useMemo<\n [\n [\n typeof MenuListContext,\n ContextValue<MenuListProps<unknown>, HTMLDivElement>,\n ],\n ]\n >(\n () => [[MenuListContext, { classNames, mapping, size }]],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: PopoverRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.menu?.menu}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.menu?.menu, size, values],\n );\n\n return (\n <Popover\n {...rest}\n ref={mergedRef}\n className={classNames?.menu?.container}\n style={style}\n >\n {children}\n </Popover>\n );\n});\n\nexport const MenuListContext =\n createContext<ContextValue<MenuListProps<unknown>, HTMLDivElement>>(null);\n\ntype MenuListContexts = [\n [\n typeof MenuItemContext,\n ContextValue<MenuItemProps<unknown>, HTMLDivElement>,\n ],\n [\n typeof AriaMenuSectionContext,\n ContextValue<MenuSectionProps<object>, HTMLElement>,\n ],\n [\n typeof AriaHeaderContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n [typeof AriaSeparatorContext, ContextValue<SeparatorProps, HTMLElement>],\n];\n\nexport const MenuList = forwardRef(function MenuList<T extends object>(\n props: MenuListProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, MenuListContext);\n const finalProps = useDefaultProps(mergedProps, 'Menu');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n items,\n mapping: mappingProp,\n selectionMode = 'single',\n size = defaultSize,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\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(menuClassNames, theme.Menu, classNamesProp, {\n list: { header: mapping.header[size] },\n }),\n [theme.Menu, classNamesProp, mapping.header, size],\n );\n\n const values = useMemo<MenuListContexts>(\n () => [\n [MenuItemContext, { classNames, mapping, size }],\n [AriaMenuSectionContext, { className: classNames?.list?.section }],\n [AriaHeaderContext, { className: classNames?.list?.header }],\n [AriaSeparatorContext, { className: classNames?.list?.separator }],\n ],\n [classNames, mapping, size],\n );\n\n const children = useMemo(() => {\n if (!(childrenProp || items)) {\n return null;\n }\n\n return (\n <AriaMenuSection className={classNames?.list?.list}>\n {typeof childrenProp === 'function' ? (\n <Collection items={items}>{childrenProp}</Collection>\n ) : (\n childrenProp\n )}\n </AriaMenuSection>\n );\n }, [childrenProp, classNames?.list?.list, items]);\n\n const renderer = useMemo<CollectionRenderer>(\n // @ts-expect-error ts unnecessarily guarding against null state\n () => createCollectionRenderer(MenuStateContext, values),\n [values],\n );\n\n return (\n <CollectionRendererContext.Provider value={renderer}>\n <Provider values={values}>\n <RACMenu<T>\n {...rest}\n ref={mergedRef}\n className={classNames?.list?.container}\n items={items}\n selectionMode={selectionMode}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </RACMenu>\n </Provider>\n </CollectionRendererContext.Provider>\n );\n});\n\nexport const MenuItemContext =\n createContext<ContextValue<MenuItemProps<unknown>, HTMLDivElement>>(null);\n\nexport const MenuItem = forwardRef(function MenuItem<T extends object>(\n props: MenuItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, MenuItemContext);\n const finalProps = useDefaultProps(mergedProps, 'MenuItem');\n\n const {\n id,\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n textValue = typeof childrenProp === 'string' ? childrenProp : undefined,\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(menuClassNames, classNamesProp, theme.Menu, {\n item: {\n description: mapping.description[size],\n label: mapping.label[size],\n shortcut: mapping.shortcut[size],\n },\n }),\n [theme.Menu, classNamesProp, mapping, size],\n );\n\n const [descriptionRef, hasDescription] = useSlot();\n\n const style = useCallback(\n (renderProps: RACMenuItemRenderProps) =>\n inlineVars(menuItemStateVars, { ...renderProps, size, hasDescription }),\n [hasDescription, size],\n );\n\n const values = useMemo<\n [\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n [\n typeof AriaKeyboardContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n ]\n >(\n () => [\n [\n AriaTextContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n label: { className: classNames?.item?.label },\n description: {\n ref: descriptionRef,\n className: classNames?.item?.description,\n },\n },\n },\n ],\n [\n IconContext,\n {\n slots: {\n [DEFAULT_SLOT]: { classNames: classNames?.item?.icon },\n more: { classNames: classNames?.item?.more },\n },\n },\n ],\n [AriaKeyboardContext, { className: classNames?.item?.shortcut }],\n ],\n [\n classNames?.item?.label,\n descriptionRef,\n classNames?.item?.description,\n classNames?.item?.icon,\n classNames?.item?.more,\n classNames?.item?.shortcut,\n ],\n );\n\n const children = useCallback(\n (renderProps: RACMenuItemRenderProps) => {\n const content = callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n });\n\n return (\n <Provider values={values}>\n <div className={classNames?.item?.item}>\n {typeof content === 'string' ? (\n <AriaText slot='label'>{content}</AriaText>\n ) : (\n content\n )}\n </div>\n </Provider>\n );\n },\n [childrenProp, classNames?.item?.item, size, values],\n );\n\n return (\n <RACMenuItem<T>\n {...rest}\n id={id ?? textValue}\n ref={mergedRef as unknown as Ref<T>}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </RACMenuItem>\n );\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/merge-provider/index.tsx"],"names":[],"mappings":";;;;AAgBA,SAAS,KAAA,CAAS,OAAA,EAAqB,IAAA,EAAS,QAAA,EAAqB;AACnE,EAAA,OAAO,SAAS,SAAS,IAAA,EAAS;AAChC,IAAA,IAAI,MAAA,GAAS,IAAA;AAEb,IAAA,IACE,IAAA,IAAQ,QACR,IAAA,IAAQ,IAAA,IACR,OAAO,IAAA,KAAS,QAAA,IAChB,OAAO,IAAA,KAAS,QAAA,EAChB;AACA,MAAA,MAAM,SAAA,GACJ,OAAA,IAAW,IAAA,IAAS,IAAA,CAAK,KAAA;AAE3B,MAAA,MAAM,SAAA,GACJ,OAAA,IAAW,IAAA,IAAS,IAAA,CAAK,KAAA;AAE3B,MAAA,IAAI,aAAa,SAAA,EAAW;AAC1B,QAAA,MAAA,GAAS;AAAA,UACP,GAAG,IAAA;AAAA,UACH,GAAG,IAAA;AAAA,UACH,KAAA,EAAO;AAAA,YACL,GAAG,SAAA;AAAA,YACH,GAAG,SAAA;AAAA,YACH,GAAG,QAAQ,OAAA,CAAQ,SAAS,EAAE,MAAA,CAE5B,CAAC,KAAK,GAAA,KAAQ;AACd,cAAA,MAAM,KAAA,GAAQ,UAAU,GAAG,CAAA;AAE3B,cAAA,IAAI,MAAA,CAAO,MAAA,CAAO,SAAA,EAAW,GAAG,CAAA,EAAG;AACjC,gBAAA,GAAA,CAAI,GAAG,CAAA,GAAI,UAAA,CAAW,SAAA,CAAU,GAAG,GAAG,KAAK,CAAA;AAAA,cAC7C;AAEA,cAAA,OAAO,GAAA;AAAA,YACT,CAAA,EAAG,EAAE;AAAA;AACP,SACF;AAAA,MACF,CAAA,MAAA,IAAW,EAAE,SAAA,IAAa,SAAA,CAAA,EAAY;AACpC,QAAA,MAAA,GAAS,UAAA,CAAW,MAAgB,IAAc,CAAA;AAAA,MACpD;AAAA,IACF;AAEA,IAAA,2BAAQ,OAAA,CAAQ,QAAA,EAAR,EAAiB,KAAA,EAAO,QAAS,QAAA,EAAS,CAAA;AAAA,EACpD,CAAA;AACF;AAcO,SAAS,aAAA,CAA+C;AAAA,EAC7D,MAAA;AAAA,EACA;AACF,CAAA,EAAwD;AACtD,EAAA,KAAA,MAAW,CAAC,OAAA,EAAS,IAAI,CAAA,IAAK,MAAA,EAAQ;AACpC,IAAA,QAAA,mBACE,GAAA,CAAC,QAAQ,QAAA,EAAR,EACE,gBAAM,OAAA,EAAiC,IAAA,EAAM,QAAQ,CAAA,EACxD,CAAA;AAAA,EAEJ;AAEA,EAAA,uCAAU,QAAA,EAAS,CAAA;AACrB","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 { Context, ReactNode } from 'react';\nimport { mergeProps } from '../../utils/props';\nimport type { MergeProviderProps } from './types';\n\nfunction merge<T>(context: Context<T>, next: T, children: ReactNode) {\n return function Consumer(prev: T) {\n let merged = next;\n\n if (\n prev != null &&\n next != null &&\n typeof prev === 'object' &&\n typeof next === 'object'\n ) {\n const prevSlots =\n 'slots' in prev && (prev.slots as Record<string | symbol, object>);\n\n const nextSlots =\n 'slots' in next && (next.slots as Record<string | symbol, object>);\n\n if (prevSlots && nextSlots) {\n merged = {\n ...prev,\n ...next,\n slots: {\n ...prevSlots,\n ...nextSlots,\n ...Reflect.ownKeys(nextSlots).reduce<\n Record<string | symbol, object>\n >((acc, key) => {\n const value = nextSlots[key];\n\n if (Object.hasOwn(prevSlots, key)) {\n acc[key] = mergeProps(prevSlots[key], value);\n }\n\n return acc;\n }, {}),\n },\n } as T;\n } else if (!(prevSlots || nextSlots)) {\n merged = mergeProps(prev as object, next as object) as T;\n }\n }\n\n return <context.Provider value={merged}>{children}</context.Provider>;\n };\n}\n\n/**\n * Merges provided contexts with parent contexts, if available and of the same structure\n * If parent context doesn't exist or differs in structure (slotted vs non-slotted) from\n * the context being provided, the provided context will override the parent context\n *\n * This is typically used in conjunction with React Aria Component's contexts, where a\n * RAC may provide a slotted context (ex: ButtonContext, with a slot of \"remove\") where\n * that slot has a number of attributes and event listeners, but we want to merge in our\n * own to supplement things for stylistic or additional functionality purposes\n *\n * See tests for examples\n */\nexport function MergeProvider<A, B, C, D, E, F, G, H, I, J, K>({\n values,\n children,\n}: MergeProviderProps<A, B, C, D, E, F, G, H, I, J, K>) {\n for (const [context, next] of values) {\n children = (\n <context.Consumer>\n {merge(context as Context<typeof next>, next, children)}\n </context.Consumer>\n );\n }\n\n return <>{children}</>;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/merge-provider/index.tsx"],"names":[],"mappings":";;;;AAgBA,SAAS,KAAA,CAAS,OAAA,EAAqB,IAAA,EAAS,QAAA,EAAqB;AACnE,EAAA,OAAO,SAAS,SAAS,IAAA,EAAS;AAChC,IAAA,IAAI,MAAA,GAAS,IAAA;AAEb,IAAA,IACE,IAAA,IAAQ,QACR,IAAA,IAAQ,IAAA,IACR,OAAO,IAAA,KAAS,QAAA,IAChB,OAAO,IAAA,KAAS,QAAA,EAChB;AACA,MAAA,MAAM,SAAA,GACJ,OAAA,IAAW,IAAA,IAAS,IAAA,CAAK,KAAA;AAE3B,MAAA,MAAM,SAAA,GACJ,OAAA,IAAW,IAAA,IAAS,IAAA,CAAK,KAAA;AAE3B,MAAA,IAAI,aAAa,SAAA,EAAW;AAC1B,QAAA,MAAA,GAAS;AAAA,UACP,GAAG,IAAA;AAAA,UACH,GAAG,IAAA;AAAA,UACH,KAAA,EAAO;AAAA,YACL,GAAG,SAAA;AAAA,YACH,GAAG,SAAA;AAAA,YACH,GAAG,QAAQ,OAAA,CAAQ,SAAS,EAAE,MAAA,CAE5B,CAAC,KAAK,GAAA,KAAQ;AACd,cAAA,MAAM,KAAA,GAAQ,UAAU,GAAG,CAAA;AAE3B,cAAA,IAAI,MAAA,CAAO,MAAA,CAAO,SAAA,EAAW,GAAG,CAAA,EAAG;AACjC,gBAAA,GAAA,CAAI,GAAG,CAAA,GAAI,UAAA,CAAW,SAAA,CAAU,GAAG,GAAG,KAAK,CAAA;AAAA,cAC7C;AAEA,cAAA,OAAO,GAAA;AAAA,YACT,CAAA,EAAG,EAAE;AAAA;AACP,SACF;AAAA,MACF,CAAA,MAAA,IAAW,EAAE,SAAA,IAAa,SAAA,CAAA,EAAY;AACpC,QAAA,MAAA,GAAS,UAAA,CAAW,MAAgB,IAAc,CAAA;AAAA,MACpD;AAAA,IACF;AAEA,IAAA,2BAAQ,OAAA,CAAQ,QAAA,EAAR,EAAiB,KAAA,EAAO,QAAS,QAAA,EAAS,CAAA;AAAA,EACpD,CAAA;AACF;AAcO,SAAS,aAAA,CAA+C;AAAA,EAC7D,MAAA;AAAA,EACA;AACF,CAAA,EAAwD;AACtD,EAAA,KAAA,MAAW,CAAC,OAAA,EAAS,IAAI,CAAA,IAAK,MAAA,EAAQ;AACpC,IAAA,QAAA,mBACE,GAAA,CAAC,QAAQ,QAAA,EAAR,EACE,gBAAM,OAAA,EAAiC,IAAA,EAAM,QAAQ,CAAA,EACxD,CAAA;AAAA,EAEJ;AAEA,EAAA,uCAAU,QAAA,EAAS,CAAA;AACrB","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 { mergeProps } from '../../utils/props';\nimport type { Context, ReactNode } from 'react';\nimport type { MergeProviderProps } from './types';\n\nfunction merge<T>(context: Context<T>, next: T, children: ReactNode) {\n return function Consumer(prev: T) {\n let merged = next;\n\n if (\n prev != null &&\n next != null &&\n typeof prev === 'object' &&\n typeof next === 'object'\n ) {\n const prevSlots =\n 'slots' in prev && (prev.slots as Record<string | symbol, object>);\n\n const nextSlots =\n 'slots' in next && (next.slots as Record<string | symbol, object>);\n\n if (prevSlots && nextSlots) {\n merged = {\n ...prev,\n ...next,\n slots: {\n ...prevSlots,\n ...nextSlots,\n ...Reflect.ownKeys(nextSlots).reduce<\n Record<string | symbol, object>\n >((acc, key) => {\n const value = nextSlots[key];\n\n if (Object.hasOwn(prevSlots, key)) {\n acc[key] = mergeProps(prevSlots[key], value);\n }\n\n return acc;\n }, {}),\n },\n } as T;\n } else if (!(prevSlots || nextSlots)) {\n merged = mergeProps(prev as object, next as object) as T;\n }\n }\n\n return <context.Provider value={merged}>{children}</context.Provider>;\n };\n}\n\n/**\n * Merges provided contexts with parent contexts, if available and of the same structure\n * If parent context doesn't exist or differs in structure (slotted vs non-slotted) from\n * the context being provided, the provided context will override the parent context\n *\n * This is typically used in conjunction with React Aria Component's contexts, where a\n * RAC may provide a slotted context (ex: ButtonContext, with a slot of \"remove\") where\n * that slot has a number of attributes and event listeners, but we want to merge in our\n * own to supplement things for stylistic or additional functionality purposes\n *\n * See tests for examples\n */\nexport function MergeProvider<A, B, C, D, E, F, G, H, I, J, K>({\n values,\n children,\n}: MergeProviderProps<A, B, C, D, E, F, G, H, I, J, K>) {\n for (const [context, next] of values) {\n children = (\n <context.Consumer>\n {merge(context as Context<typeof next>, next, children)}\n </context.Consumer>\n );\n }\n\n return <>{children}</>;\n}\n"]}
@@ -1,6 +1,8 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { ProviderValues } from '../../types/react-aria.js';
3
3
 
4
+ /** biome-ignore-all lint/suspicious/noExplicitAny: MergeProviderProps is a special case */
5
+
4
6
  type MergeProviderProps<A = any, B = any, C = any, D = any, E = any, F = any, G = any, H = any, I = any, J = any, K = any> = PropsWithChildren<{
5
7
  values: ProviderValues<A, B, C, D, E, F, G, H, I, J, K>;
6
8
  }>;
@@ -33,15 +33,19 @@ var defaultMapping = {
33
33
  };
34
34
  var NumberFieldContext = createContext(null);
35
35
  var NumberField = forwardRef(function NumberField2(props, ref) {
36
- [props, ref] = useContextProps(props, ref, NumberFieldContext);
37
- props = useDefaultProps(props, "NumberField");
36
+ const [contextProps, contextRef] = useContextProps(
37
+ props,
38
+ ref,
39
+ NumberFieldContext
40
+ );
41
+ const finalProps = useDefaultProps(contextProps, "NumberField");
38
42
  const {
39
43
  children: childrenProp,
40
44
  classNames: classNamesProp,
41
45
  mapping: mappingProp,
42
46
  size = "lg",
43
47
  ...rest
44
- } = props;
48
+ } = finalProps;
45
49
  const theme = useTheme();
46
50
  const mapping = useMemo(
47
51
  () => ({
@@ -117,7 +121,7 @@ var NumberField = forwardRef(function NumberField2(props, ref) {
117
121
  NumberField$1,
118
122
  {
119
123
  ...rest,
120
- ref,
124
+ ref: contextRef,
121
125
  className: classNames?.container,
122
126
  style,
123
127
  children
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/number-field/index.tsx"],"names":["NumberField","RACNumberField"],"mappings":";;;;;;;;;;;;;;;AAoDA,IAAM,cAAA,GAAqC;AAAA,EACzC,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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AA,qBACC,GAAA,CAAC,QAAA,EAAA,EAAS,MAAA,EACR,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,WAAA,EACzB,QAAA,EAAA,eAAA,CAAgB,YAAA,EAAc;AAAA,MAC7B,GAAG,WAAA;AAAA,MACH,eAAA,EAAiB;AAAA,KAClB,GACH,CAAA,EACF,CAAA;AAAA,IAEF,CAAC,YAAA,EAAc,UAAA,EAAY,WAAA,EAAa,MAAM;AAAA,GAChD;AACA,EAAA,uBACE,GAAA;AAAA,IAACC,aAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA;AAAA,MACA,WAAW,UAAA,EAAY,SAAA;AAAA,MACvB,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 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 type NumberFieldRenderProps,\n Provider,\n type GroupProps as RACGroupProps,\n NumberField as RACNumberField,\n type TextProps,\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 AriaFieldErrorContext,\n AriaGroupContext,\n type AriaLabelContext,\n AriaTextContext,\n} from '../aria';\nimport { ButtonContext } from '../button';\nimport type { ButtonProps } from '../button/types';\nimport { InputContext } from '../input';\nimport type { InputProps } from '../input/types';\nimport {\n numberFieldClassNames,\n numberFieldStateVars,\n} from './number-field.css';\nimport type { NumberFieldMapping, NumberFieldProps } from './types';\n\nconst defaultMapping: NumberFieldMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n error: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n increment: {\n sm: { size: 'xs', variant: 'bare' },\n lg: { size: 'sm', variant: 'bare' },\n },\n decrement: {\n sm: { size: 'xs', variant: 'bare' },\n lg: { size: 'sm', variant: 'bare' },\n },\n};\n\nexport const NumberFieldContext =\n createContext<ContextValue<NumberFieldProps, HTMLDivElement>>(null);\n\nexport const NumberField = forwardRef(function NumberField(\n props: NumberFieldProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n [props, ref] = useContextProps(props, ref, NumberFieldContext);\n\n props = useDefaultProps(props, 'NumberField');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = 'lg',\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(\n numberFieldClassNames,\n theme.NumberField,\n classNamesProp,\n {\n description: mapping.description[size],\n error: mapping.error[size],\n },\n ),\n [theme.NumberField, classNamesProp, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: NumberFieldRenderProps) =>\n inlineVars(numberFieldStateVars, {\n ...renderProps,\n size,\n }),\n [size],\n );\n const values = useMemo<\n [\n [typeof AriaLabelContext, ContextValue<LabelProps, HTMLLabelElement>],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [\n typeof AriaFieldErrorContext,\n ContextValue<FieldErrorProps, HTMLElement>,\n ],\n [typeof AriaGroupContext, ContextValue<RACGroupProps, HTMLDivElement>],\n [typeof ButtonContext, ContextValue<ButtonProps, HTMLButtonElement>],\n [typeof InputContext, ContextValue<InputProps, HTMLInputElement>],\n ]\n >(\n () => [\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 [\n AriaGroupContext,\n {\n className: classNames?.group,\n },\n ],\n [\n ButtonContext,\n {\n slots: {\n increment: {\n ...mapping.increment[size],\n classNames: classNames?.increment,\n },\n decrement: {\n ...mapping.decrement[size],\n classNames: classNames?.decrement,\n },\n },\n },\n ],\n [InputContext, { classNames: classNames?.input, size }],\n ],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: NumberFieldRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.numberField}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.numberField, values],\n );\n return (\n <RACNumberField\n {...rest}\n ref={ref}\n className={classNames?.container}\n style={style}\n >\n {children}\n </RACNumberField>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/number-field/index.tsx"],"names":["NumberField","RACNumberField"],"mappings":";;;;;;;;;;;;;;;AAoDA,IAAM,cAAA,GAAqC;AAAA,EACzC,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,SAAA,EAAW;AAAA,IACT,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,SAAA,EAAW;AAAA,IACT,EAA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H,eAAA,EAAiB;AAAA,KAClB,GACH,CAAA,EACF,CAAA;AAAA,IAEF,CAAC,YAAA,EAAc,UAAA,EAAY,WAAA,EAAa,MAAM;AAAA,GAChD;AACA,EAAA,uBACE,GAAA;AAAA,IAACC,aAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,UAAA;AAAA,MACL,WAAW,UAAA,EAAY,SAAA;AAAA,MACvB,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 type NumberFieldRenderProps,\n Provider,\n type GroupProps as RACGroupProps,\n NumberField as RACNumberField,\n type TextProps,\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 AriaFieldErrorContext,\n AriaGroupContext,\n type AriaLabelContext,\n AriaTextContext,\n} from '../aria';\nimport { ButtonContext } from '../button';\nimport { InputContext } from '../input';\nimport {\n numberFieldClassNames,\n numberFieldStateVars,\n} from './number-field.css';\nimport type { ButtonProps } from '../button/types';\nimport type { InputProps } from '../input/types';\nimport type { NumberFieldMapping, NumberFieldProps } from './types';\n\nconst defaultMapping: NumberFieldMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n error: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n increment: {\n sm: { size: 'xs', variant: 'bare' },\n lg: { size: 'sm', variant: 'bare' },\n },\n decrement: {\n sm: { size: 'xs', variant: 'bare' },\n lg: { size: 'sm', variant: 'bare' },\n },\n};\n\nexport const NumberFieldContext =\n createContext<ContextValue<NumberFieldProps, HTMLDivElement>>(null);\n\nexport const NumberField = forwardRef(function NumberField(\n props: NumberFieldProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(\n props,\n ref,\n NumberFieldContext,\n );\n\n const finalProps = useDefaultProps(contextProps, 'NumberField');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = 'lg',\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(\n numberFieldClassNames,\n theme.NumberField,\n classNamesProp,\n {\n description: mapping.description[size],\n error: mapping.error[size],\n },\n ),\n [theme.NumberField, classNamesProp, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: NumberFieldRenderProps) =>\n inlineVars(numberFieldStateVars, {\n ...renderProps,\n size,\n }),\n [size],\n );\n const values = useMemo<\n [\n [typeof AriaLabelContext, ContextValue<LabelProps, HTMLLabelElement>],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [\n typeof AriaFieldErrorContext,\n ContextValue<FieldErrorProps, HTMLElement>,\n ],\n [typeof AriaGroupContext, ContextValue<RACGroupProps, HTMLDivElement>],\n [typeof ButtonContext, ContextValue<ButtonProps, HTMLButtonElement>],\n [typeof InputContext, ContextValue<InputProps, HTMLInputElement>],\n ]\n >(\n () => [\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 [\n AriaGroupContext,\n {\n className: classNames?.group,\n },\n ],\n [\n ButtonContext,\n {\n slots: {\n increment: {\n ...mapping.increment[size],\n classNames: classNames?.increment,\n },\n decrement: {\n ...mapping.decrement[size],\n classNames: classNames?.decrement,\n },\n },\n },\n ],\n [InputContext, { classNames: classNames?.input, size }],\n ],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: NumberFieldRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.numberField}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.numberField, values],\n );\n return (\n <RACNumberField\n {...rest}\n ref={contextRef}\n className={classNames?.container}\n style={style}\n >\n {children}\n </RACNumberField>\n );\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/options/index.tsx"],"names":["Options"],"mappings":";;;;;;;;;;;;;;;;AAqEA,IAAM,cAAA,GAAiC;AAAA,EACrC,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAI,QAAA,CAAS,EAAA;AAAA,IACb,IAAI,QAAA,CAAS;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA;AAEf,CAAA;AAEA,IAAM,WAAA,GAAc,IAAA;AAEb,IAAM,cAAA,GACX,cAAuD,IAAI;AAEtD,IAAM,OAAA,GAAU,UAAA,CAAW,SAASA,QAAAA,CACzC,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,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AAW,YAAY,IAAA,EAAM,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA;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 type ForwardedRef,\n type HTMLAttributes,\n type Ref,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n Collection,\n type CollectionRenderer,\n CollectionRendererContext,\n type ContextValue,\n ListBox,\n ListBoxItem,\n type ListBoxItemRenderProps,\n type ListBoxRenderProps,\n ListStateContext,\n Popover,\n type PopoverRenderProps,\n Provider,\n type SectionProps,\n type SeparatorProps,\n type TextProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useSlot } from '../../hooks/use-slot';\nimport { useTheme } from '../../hooks/use-theme';\nimport { bodies, headings } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n AriaHeaderContext,\n AriaKeyboardContext,\n AriaListBoxSection,\n AriaListBoxSectionContext,\n AriaSeparatorContext,\n AriaText,\n AriaTextContext,\n} from '../aria';\nimport { createCollectionRenderer } from '../collection';\nimport { IconContext } from '../icon';\nimport type { IconProps } from '../icon/types';\nimport {\n optionsClassNames,\n optionsItemStateVars,\n optionsStateVars,\n} from './options.css';\nimport type {\n OptionsItemProps,\n OptionsListProps,\n OptionsMapping,\n OptionsProps,\n} from './types';\n\nconst defaultMapping: OptionsMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n header: {\n sm: headings.v4,\n lg: headings.v5,\n },\n label: {\n sm: bodies.sm,\n lg: bodies.sm,\n },\n shortcut: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const OptionsContext =\n createContext<ContextValue<OptionsProps, HTMLElement>>(null);\n\nexport const Options = forwardRef(function Options(\n props: OptionsProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n OptionsContext,\n );\n const finalProps = useDefaultProps(resolvedProps, 'Options');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () =>\n mergeClassNames(optionsClassNames, theme.Options, classNamesProp, {\n options: {\n container: theme.className, // required to consume global theme within Popover\n },\n }),\n [theme.className, theme.Options, classNamesProp],\n );\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const style = useCallback(\n ({ ...renderProps }: PopoverRenderProps) => ({\n ...theme.style, // required to consume global styles within Popover\n ...inlineVars(optionsStateVars, {\n ...renderProps,\n size,\n }),\n }),\n [theme.style, size],\n );\n\n const values = useMemo<\n [\n [\n typeof OptionsListContext,\n ContextValue<OptionsListProps<object>, HTMLDivElement>,\n ],\n ]\n >(\n () => [[OptionsListContext, { classNames, mapping, size }]],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: PopoverRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.options?.options}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.options?.options, size, values],\n );\n\n return (\n <Popover\n {...rest}\n ref={resolvedRef}\n className={classNames?.options?.container}\n style={style}\n >\n {children}\n </Popover>\n );\n});\n\nexport const OptionsListContext =\n createContext<ContextValue<OptionsListProps<object>, HTMLDivElement>>(null);\n\ntype OptionsListContexts = [\n [\n typeof OptionsItemContext,\n ContextValue<OptionsItemProps<object>, HTMLDivElement>,\n ],\n [\n typeof AriaListBoxSectionContext,\n ContextValue<SectionProps<object>, HTMLElement>,\n ],\n [\n typeof AriaHeaderContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n [typeof AriaSeparatorContext, ContextValue<SeparatorProps, HTMLElement>],\n];\n\nexport const OptionsList = forwardRef(function OptionList<T extends object>(\n props: OptionsListProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n OptionsListContext,\n );\n const finalProps = useDefaultProps(resolvedProps, 'OptionsList');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n items,\n mapping: mappingProp,\n selectionMode = 'single',\n size = defaultSize,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\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(optionsClassNames, theme.Options, classNamesProp, {\n list: { header: mapping.header[size] },\n }),\n [theme.Options, classNamesProp, mapping, size],\n );\n\n const values = useMemo<OptionsListContexts>(\n () => [\n [OptionsItemContext, { classNames, size, mapping }],\n [AriaListBoxSectionContext, { className: classNames?.list?.section }],\n [AriaHeaderContext, { className: classNames?.list?.header }],\n [AriaSeparatorContext, { className: classNames?.list?.separator }],\n ],\n [classNames, size, mapping],\n );\n\n const style = useCallback(\n (renderProps: ListBoxRenderProps) =>\n inlineVars(optionsItemStateVars, { ...renderProps, size }),\n [size],\n );\n\n const children = useMemo(() => {\n if (!(childrenProp || items)) {\n return null;\n }\n\n return (\n <AriaListBoxSection className={classNames?.list?.list}>\n {typeof childrenProp === 'function' ? (\n <Collection items={items}>{childrenProp}</Collection>\n ) : (\n childrenProp\n )}\n </AriaListBoxSection>\n );\n }, [classNames?.list?.list, childrenProp, items]);\n\n const renderer = useMemo<CollectionRenderer>(\n // @ts-expect-error ts unnecessarily guarding against null state\n () => createCollectionRenderer(ListStateContext, values),\n [values],\n );\n\n return (\n <CollectionRendererContext.Provider value={renderer}>\n <Provider values={values}>\n <ListBox<T>\n {...rest}\n ref={resolvedRef}\n className={classNames?.list?.container}\n items={items}\n selectionMode={selectionMode}\n style={style}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </ListBox>\n </Provider>\n </CollectionRendererContext.Provider>\n );\n});\n\nexport const OptionsItemContext =\n createContext<ContextValue<OptionsItemProps<object>, HTMLDivElement>>(null);\n\nexport const OptionsItem = forwardRef(function OptionItem<T extends object>(\n props: OptionsItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n OptionsItemContext,\n );\n const finalProps = useDefaultProps(resolvedProps, 'OptionsItem');\n\n const {\n id,\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n textValue = typeof childrenProp === 'string' ? childrenProp : undefined,\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(optionsClassNames, classNamesProp, theme.Options, {\n item: {\n description: mapping.description[size],\n label: mapping.label[size],\n shortcut: mapping.shortcut[size],\n },\n }),\n [theme.Options, classNamesProp, mapping, size],\n );\n\n const [descriptionRef, hasDescription] = useSlot();\n\n const style = useCallback(\n (renderProps: ListBoxItemRenderProps) =>\n inlineVars(optionsItemStateVars, {\n ...renderProps,\n size,\n hasDescription,\n }),\n [hasDescription, size],\n );\n\n const values = useMemo<\n [\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n [\n typeof AriaKeyboardContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n ]\n >(\n () => [\n [\n AriaTextContext,\n {\n slots: {\n label: { className: classNames?.item?.label },\n description: {\n ref: descriptionRef,\n className: classNames?.item?.description,\n },\n },\n },\n ],\n [IconContext, { classNames: classNames?.item?.icon }],\n [AriaKeyboardContext, { className: classNames?.item?.shortcut }],\n ],\n [\n classNames?.item?.label,\n descriptionRef,\n classNames?.item?.description,\n classNames?.item?.icon,\n classNames?.item?.shortcut,\n ],\n );\n\n const children = useCallback(\n (renderProps: ListBoxItemRenderProps) => {\n const content = callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n });\n\n return (\n <Provider values={values}>\n <div className={classNames?.item?.item}>\n {typeof content === 'string' ? (\n <AriaText slot='label'>{content}</AriaText>\n ) : (\n content\n )}\n </div>\n </Provider>\n );\n },\n [childrenProp, classNames?.item?.item, size, values],\n );\n\n return (\n <ListBoxItem<T>\n {...rest}\n id={id ?? textValue}\n ref={resolvedRef as unknown as Ref<T>}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </ListBoxItem>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/options/index.tsx"],"names":["Options"],"mappings":";;;;;;;;;;;;;;;;AAqEA,IAAM,cAAA,GAAiC;AAAA,EACrC,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAI,QAAA,CAAS,EAAA;AAAA,IACb,IAAI,QAAA,CAAS;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,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,IAAA,EAAM,MAAM,MAAM;AAAA,GACrD;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,IAAI,EAAA,IAAM,SAAA;AAAA,MACV,GAAA,EAAK,WAAA;AAAA,MACL,SAAA,EAAW,YAAY,IAAA,EAAM,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA;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 type HTMLAttributes,\n type Ref,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n Collection,\n type CollectionRenderer,\n CollectionRendererContext,\n type ContextValue,\n ListBox,\n ListBoxItem,\n type ListBoxItemRenderProps,\n type ListBoxRenderProps,\n ListStateContext,\n Popover,\n type PopoverRenderProps,\n Provider,\n type SectionProps,\n type SeparatorProps,\n type TextProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useSlot } from '../../hooks/use-slot';\nimport { useTheme } from '../../hooks/use-theme';\nimport { bodies, headings } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n AriaHeaderContext,\n AriaKeyboardContext,\n AriaListBoxSection,\n AriaListBoxSectionContext,\n AriaSeparatorContext,\n AriaText,\n AriaTextContext,\n} from '../aria';\nimport { createCollectionRenderer } from '../collection';\nimport { IconContext } from '../icon';\nimport {\n optionsClassNames,\n optionsItemStateVars,\n optionsStateVars,\n} from './options.css';\nimport type { IconProps } from '../icon/types';\nimport type {\n OptionsItemProps,\n OptionsListProps,\n OptionsMapping,\n OptionsProps,\n} from './types';\n\nconst defaultMapping: OptionsMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n header: {\n sm: headings.v4,\n lg: headings.v5,\n },\n label: {\n sm: bodies.sm,\n lg: bodies.sm,\n },\n shortcut: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const OptionsContext =\n createContext<ContextValue<OptionsProps, HTMLElement>>(null);\n\nexport const Options = forwardRef(function Options(\n props: OptionsProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n OptionsContext,\n );\n const finalProps = useDefaultProps(resolvedProps, 'Options');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () =>\n mergeClassNames(optionsClassNames, theme.Options, classNamesProp, {\n options: {\n container: theme.className, // required to consume global theme within Popover\n },\n }),\n [theme.className, theme.Options, classNamesProp],\n );\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const style = useCallback(\n ({ ...renderProps }: PopoverRenderProps) => ({\n ...theme.style, // required to consume global styles within Popover\n ...inlineVars(optionsStateVars, {\n ...renderProps,\n size,\n }),\n }),\n [theme.style, size],\n );\n\n const values = useMemo<\n [\n [\n typeof OptionsListContext,\n ContextValue<OptionsListProps<object>, HTMLDivElement>,\n ],\n ]\n >(\n () => [[OptionsListContext, { classNames, mapping, size }]],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: PopoverRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.options?.options}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.options?.options, size, values],\n );\n\n return (\n <Popover\n {...rest}\n ref={resolvedRef}\n className={classNames?.options?.container}\n style={style}\n >\n {children}\n </Popover>\n );\n});\n\nexport const OptionsListContext =\n createContext<ContextValue<OptionsListProps<object>, HTMLDivElement>>(null);\n\ntype OptionsListContexts = [\n [\n typeof OptionsItemContext,\n ContextValue<OptionsItemProps<object>, HTMLDivElement>,\n ],\n [\n typeof AriaListBoxSectionContext,\n ContextValue<SectionProps<object>, HTMLElement>,\n ],\n [\n typeof AriaHeaderContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n [typeof AriaSeparatorContext, ContextValue<SeparatorProps, HTMLElement>],\n];\n\nexport const OptionsList = forwardRef(function OptionList<T extends object>(\n props: OptionsListProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n OptionsListContext,\n );\n const finalProps = useDefaultProps(resolvedProps, 'OptionsList');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n items,\n mapping: mappingProp,\n selectionMode = 'single',\n size = defaultSize,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\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(optionsClassNames, theme.Options, classNamesProp, {\n list: { header: mapping.header[size] },\n }),\n [theme.Options, classNamesProp, mapping, size],\n );\n\n const values = useMemo<OptionsListContexts>(\n () => [\n [OptionsItemContext, { classNames, size, mapping }],\n [AriaListBoxSectionContext, { className: classNames?.list?.section }],\n [AriaHeaderContext, { className: classNames?.list?.header }],\n [AriaSeparatorContext, { className: classNames?.list?.separator }],\n ],\n [classNames, size, mapping],\n );\n\n const style = useCallback(\n (renderProps: ListBoxRenderProps) =>\n inlineVars(optionsItemStateVars, { ...renderProps, size }),\n [size],\n );\n\n const children = useMemo(() => {\n if (!(childrenProp || items)) {\n return null;\n }\n\n return (\n <AriaListBoxSection className={classNames?.list?.list}>\n {typeof childrenProp === 'function' ? (\n <Collection items={items}>{childrenProp}</Collection>\n ) : (\n childrenProp\n )}\n </AriaListBoxSection>\n );\n }, [classNames?.list?.list, childrenProp, items]);\n\n const renderer = useMemo<CollectionRenderer>(\n // @ts-expect-error ts unnecessarily guarding against null state\n () => createCollectionRenderer(ListStateContext, values),\n [values],\n );\n\n return (\n <CollectionRendererContext.Provider value={renderer}>\n <Provider values={values}>\n <ListBox<T>\n {...rest}\n ref={resolvedRef}\n className={classNames?.list?.container}\n items={items}\n selectionMode={selectionMode}\n style={style}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </ListBox>\n </Provider>\n </CollectionRendererContext.Provider>\n );\n});\n\nexport const OptionsItemContext =\n createContext<ContextValue<OptionsItemProps<object>, HTMLDivElement>>(null);\n\nexport const OptionsItem = forwardRef(function OptionItem<T extends object>(\n props: OptionsItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n OptionsItemContext,\n );\n const finalProps = useDefaultProps(resolvedProps, 'OptionsItem');\n\n const {\n id,\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n textValue = typeof childrenProp === 'string' ? childrenProp : undefined,\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(optionsClassNames, classNamesProp, theme.Options, {\n item: {\n description: mapping.description[size],\n label: mapping.label[size],\n shortcut: mapping.shortcut[size],\n },\n }),\n [theme.Options, classNamesProp, mapping, size],\n );\n\n const [descriptionRef, hasDescription] = useSlot();\n\n const style = useCallback(\n (renderProps: ListBoxItemRenderProps) =>\n inlineVars(optionsItemStateVars, {\n ...renderProps,\n size,\n hasDescription,\n }),\n [hasDescription, size],\n );\n\n const values = useMemo<\n [\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n [\n typeof AriaKeyboardContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n ]\n >(\n () => [\n [\n AriaTextContext,\n {\n slots: {\n label: { className: classNames?.item?.label },\n description: {\n ref: descriptionRef,\n className: classNames?.item?.description,\n },\n },\n },\n ],\n [IconContext, { classNames: classNames?.item?.icon }],\n [AriaKeyboardContext, { className: classNames?.item?.shortcut }],\n ],\n [\n classNames?.item?.label,\n descriptionRef,\n classNames?.item?.description,\n classNames?.item?.icon,\n classNames?.item?.shortcut,\n ],\n );\n\n const children = useCallback(\n (renderProps: ListBoxItemRenderProps) => {\n const content = callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n });\n\n return (\n <Provider values={values}>\n <div className={classNames?.item?.item}>\n {typeof content === 'string' ? (\n <AriaText slot='label'>{content}</AriaText>\n ) : (\n content\n )}\n </div>\n </Provider>\n );\n },\n [childrenProp, classNames?.item?.item, size, values],\n );\n\n return (\n <ListBoxItem<T>\n {...rest}\n id={id ?? textValue}\n ref={resolvedRef as unknown as Ref<T>}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </ListBoxItem>\n );\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/picker/index.tsx"],"names":["Picker","PickerItem"],"mappings":";;;;;;;;;;;AA0CO,IAAM,aAAA,GACX,cAAkE,IAAI;AAEjE,IAAM,iBAAA,GACX,cAAsE,IAAI;AAQrE,IAAM,MAAA,GAAS,UAAA,CAAW,SAASA,OAAAA,CACxC,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,aAAA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GAAa,OAAA;AAAA,IACjB,MAAM,eAAA,CAAgB,gBAAA,EAAkB,KAAA,CAAM,QAAQ,cAAc,CAAA;AAAA,IACpE,CAAC,KAAA,CAAM,MAAA,EAAQ,cAAc;AAAA,GAC/B;AAEA,EAAA,MAAM,KAAA,GAAQ,WAAA;AAAA,IACZ,CAAC,WAAA,KACC,UAAA,CAAW,mBAAA,EAAqB,WAAW,CAAA;AAAA,IAC7C;AAAC,GACH;AAEA,EAAA,MAAM,QAAA,GAAW,WAAA;AAAA,IACf,CAAC,gCACC,GAAA,CAAC,KAAA,EAAA,EAAI,WAAW,UAAA,EAAY,IAAA,EAAM,IAAA,EAC/B,QAAA,EAAA,eAAA,CAAgB,YAAA,EAAc;AAAA,MAC7B,GAAG,WAAA;AAAA,MACH,eAAA,EAAiB;AAAA,KAClB,CAAA,EACH,CAAA;AAAA,IAEF,CAAC,YAAA,EAAc,UAAA,EAAY,IAAA,EAAM,IAAI;AAAA,GACvC;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,WAAA;AAAA,MACL,IAAI,EAAA,IAAM,SAAA;AAAA,MACV,SAAA,EAAW,YAAY,IAAA,EAAM,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA;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 type ForwardedRef,\n type Ref,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n Collection,\n type ContextValue,\n ListBox,\n ListBoxItem,\n type ListBoxItemRenderProps,\n type ListBoxRenderProps,\n ListBoxSection,\n Provider,\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 { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n pickerClassNames,\n pickerItemStateVars,\n pickerStateVars,\n} from './picker.css';\nimport type { PickerItemProps, PickerProps } from './types';\n\nexport const PickerContext =\n createContext<ContextValue<PickerProps<unknown>, HTMLDivElement>>(null);\n\nexport const PickerItemContext =\n createContext<ContextValue<PickerItemProps<unknown>, HTMLDivElement>>(null);\n\n/**\n * Generic stylable picker that supports the functionality (sans drag and drop) of\n * React Aria's ListBox: https://react-spectrum.adobe.com/react-aria/ListBox.html\n *\n * NOTE: The picker items does not support sections or separators\n */\nexport const Picker = forwardRef(function Picker<T extends object>(\n props: PickerProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n PickerContext,\n );\n\n const finalProps = useDefaultProps(resolvedProps, 'Picker');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n columns,\n items,\n layout = 'stack',\n orientation = 'horizontal',\n selectionMode = 'single',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(pickerClassNames, theme.Picker, classNamesProp),\n [theme.Picker, classNamesProp],\n );\n\n const values = useMemo<\n [\n [\n typeof PickerItemContext,\n ContextValue<PickerItemProps<unknown>, HTMLDivElement>,\n ],\n ]\n >(() => [[PickerItemContext, { classNames }]], [classNames]);\n\n const style = useCallback(\n ({ state, ...renderProps }: ListBoxRenderProps) =>\n inlineVars(pickerStateVars, {\n ...renderProps,\n columns,\n layout,\n orientation,\n }),\n [columns, layout, orientation],\n );\n\n const children = useMemo(() => {\n if (!(childrenProp || items)) {\n return null;\n }\n\n return (\n <ListBoxSection\n className={classNames?.list?.list}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {typeof childrenProp === 'function' ? (\n <Collection items={items}>{childrenProp}</Collection>\n ) : (\n childrenProp\n )}\n </ListBoxSection>\n );\n }, [childrenProp, items, classNames?.list?.list, ariaLabel, ariaLabelledBy]);\n\n return (\n <Provider values={values}>\n <ListBox<T>\n {...rest}\n ref={resolvedRef}\n className={classNames?.list?.container}\n items={items}\n layout={layout}\n orientation={orientation}\n selectionMode={selectionMode}\n style={style}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </ListBox>\n </Provider>\n );\n});\n\nexport const PickerItem = forwardRef(function PickerItem<T extends object>(\n props: PickerItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n PickerItemContext,\n );\n\n const {\n children: childrenProp,\n id,\n classNames: classNamesProp,\n textValue = typeof childrenProp === 'string' ? childrenProp : undefined,\n ...rest\n } = resolvedProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(pickerClassNames, theme.Picker, classNamesProp),\n [theme.Picker, classNamesProp],\n );\n\n const style = useCallback(\n (renderProps: ListBoxItemRenderProps) =>\n inlineVars(pickerItemStateVars, renderProps),\n [],\n );\n\n const children = useCallback(\n (renderProps: ListBoxItemRenderProps) => (\n <div className={classNames?.item?.item}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </div>\n ),\n [childrenProp, classNames?.item?.item],\n );\n\n return (\n <ListBoxItem<T>\n {...rest}\n ref={resolvedRef as unknown as Ref<T>}\n id={id ?? textValue}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </ListBoxItem>\n );\n});\n"]}
1
+ {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,QAAA,EAAU,YAAA;AAAA,IACV,EAAA;AAAA,IACA,UAAA,EAAY,cAAA;AAAA,IACZ,SAAA,GAAY,OAAO,YAAA,KAAiB,QAAA,GAAW,YAAA,GAAe,MAAA;AAAA,IAC9D,GAAG;AAAA,GACL,GAAI,aAAA;AAEJ,EAAA,MAAM,QAAQ,QAAA,EAAS;AAEvB,EAAA,MAAM,UAAA,GAAa,OAAA;AAAA,IACjB,MAAM,eAAA,CAAgB,gBAAA,EAAkB,KAAA,CAAM,QAAQ,cAAc,CAAA;AAAA,IACpE,CAAC,KAAA,CAAM,MAAA,EAAQ,cAAc;AAAA,GAC/B;AAEA,EAAA,MAAM,KAAA,GAAQ,WAAA;AAAA,IACZ,CAAC,WAAA,KACC,UAAA,CAAW,mBAAA,EAAqB,WAAW,CAAA;AAAA,IAC7C;AAAC,GACH;AAEA,EAAA,MAAM,QAAA,GAAW,WAAA;AAAA,IACf,CAAC,gCACC,GAAA,CAAC,KAAA,EAAA,EAAI,WAAW,UAAA,EAAY,IAAA,EAAM,IAAA,EAC/B,QAAA,EAAA,eAAA,CAAgB,YAAA,EAAc;AAAA,MAC7B,GAAG,WAAA;AAAA,MACH,eAAA,EAAiB;AAAA,KAClB,CAAA,EACH,CAAA;AAAA,IAEF,CAAC,YAAA,EAAc,UAAA,EAAY,IAAA,EAAM,IAAI;AAAA,GACvC;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,WAAA;AAAA,MACL,IAAI,EAAA,IAAM,SAAA;AAAA,MACV,SAAA,EAAW,YAAY,IAAA,EAAM,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA;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 type Ref,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n Collection,\n type ContextValue,\n ListBox,\n ListBoxItem,\n type ListBoxItemRenderProps,\n type ListBoxRenderProps,\n ListBoxSection,\n Provider,\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 { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n pickerClassNames,\n pickerItemStateVars,\n pickerStateVars,\n} from './picker.css';\nimport type { PickerItemProps, PickerProps } from './types';\n\nexport const PickerContext =\n createContext<ContextValue<PickerProps<unknown>, HTMLDivElement>>(null);\n\nexport const PickerItemContext =\n createContext<ContextValue<PickerItemProps<unknown>, HTMLDivElement>>(null);\n\n/**\n * Generic stylable picker that supports the functionality (sans drag and drop) of\n * React Aria's ListBox: https://react-spectrum.adobe.com/react-aria/ListBox.html\n *\n * NOTE: The picker items does not support sections or separators\n */\nexport const Picker = forwardRef(function Picker<T extends object>(\n props: PickerProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n PickerContext,\n );\n\n const finalProps = useDefaultProps(resolvedProps, 'Picker');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n columns,\n items,\n layout = 'stack',\n orientation = 'horizontal',\n selectionMode = 'single',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(pickerClassNames, theme.Picker, classNamesProp),\n [theme.Picker, classNamesProp],\n );\n\n const values = useMemo<\n [\n [\n typeof PickerItemContext,\n ContextValue<PickerItemProps<unknown>, HTMLDivElement>,\n ],\n ]\n >(() => [[PickerItemContext, { classNames }]], [classNames]);\n\n const style = useCallback(\n ({ state, ...renderProps }: ListBoxRenderProps) =>\n inlineVars(pickerStateVars, {\n ...renderProps,\n columns,\n layout,\n orientation,\n }),\n [columns, layout, orientation],\n );\n\n const children = useMemo(() => {\n if (!(childrenProp || items)) {\n return null;\n }\n\n return (\n <ListBoxSection\n className={classNames?.list?.list}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {typeof childrenProp === 'function' ? (\n <Collection items={items}>{childrenProp}</Collection>\n ) : (\n childrenProp\n )}\n </ListBoxSection>\n );\n }, [childrenProp, items, classNames?.list?.list, ariaLabel, ariaLabelledBy]);\n\n return (\n <Provider values={values}>\n <ListBox<T>\n {...rest}\n ref={resolvedRef}\n className={classNames?.list?.container}\n items={items}\n layout={layout}\n orientation={orientation}\n selectionMode={selectionMode}\n style={style}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </ListBox>\n </Provider>\n );\n});\n\nexport const PickerItem = forwardRef(function PickerItem<T extends object>(\n props: PickerItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n PickerItemContext,\n );\n\n const {\n children: childrenProp,\n id,\n classNames: classNamesProp,\n textValue = typeof childrenProp === 'string' ? childrenProp : undefined,\n ...rest\n } = resolvedProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(pickerClassNames, theme.Picker, classNamesProp),\n [theme.Picker, classNamesProp],\n );\n\n const style = useCallback(\n (renderProps: ListBoxItemRenderProps) =>\n inlineVars(pickerItemStateVars, renderProps),\n [],\n );\n\n const children = useCallback(\n (renderProps: ListBoxItemRenderProps) => (\n <div className={classNames?.item?.item}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </div>\n ),\n [childrenProp, classNames?.item?.item],\n );\n\n return (\n <ListBoxItem<T>\n {...rest}\n ref={resolvedRef as unknown as Ref<T>}\n id={id ?? textValue}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </ListBoxItem>\n );\n});\n"]}
@@ -29,14 +29,18 @@ var defaultMapping = {
29
29
  };
30
30
  var PopoverContext = createContext(null);
31
31
  var Popover = forwardRef(function Popover2(props, ref) {
32
- [props, ref] = useContextProps(props, ref, PopoverContext);
33
- props = useDefaultProps(props, "Popover");
32
+ const [contextProps, contextRef] = useContextProps(
33
+ props,
34
+ ref,
35
+ PopoverContext
36
+ );
37
+ const finalProps = useDefaultProps(contextProps, "Popover");
34
38
  const {
35
39
  children: childrenProp,
36
40
  classNames: classNamesProp,
37
41
  mapping: mappingProp,
38
42
  ...rest
39
- } = props;
43
+ } = finalProps;
40
44
  const theme = useTheme();
41
45
  const mapping = useMemo(
42
46
  () => ({ ...defaultMapping, ...mappingProp }),
@@ -130,7 +134,7 @@ var Popover = forwardRef(function Popover2(props, ref) {
130
134
  Popover$1,
131
135
  {
132
136
  ...rest,
133
- ref,
137
+ ref: contextRef,
134
138
  className: classNames?.popover?.container,
135
139
  style,
136
140
  children
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/popover/index.tsx"],"names":["Popover","RACDialog","RACPopover"],"mappings":";;;;;;;;;;;;;;;;;AA6CA,IAAM,cAAA,GAAiC;AAAA,EACrC,SAAS,QAAA,CAAS,EAAA;AAAA,EAClB,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,aAAA;AAAA,IACT,WAAA,EAAa,YAAA;AAAA,IACb,OAAA,EAAS;AAAA,GACX;AAAA,EACA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM;AAAA,GACR;AAAA,EACA,KAAA,EAAO,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA;AAChC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A,CAAC,QAAA,EAAA,EAAS,MAAA,EACR,8BAACC,MAAA,EAAA,EAAU,SAAA,EAAW,UAAA,EAAY,OAAA,EAAS,SACxC,QAAA,EAAA,CAAC,EAAE,KAAA,EAAM,KACR,gBAAgB,YAAA,EAAc;AAAA,MAC5B,GAAG,WAAA;AAAA,MACH,KAAA;AAAA,MACA,eAAA,EAAiB;AAAA,KAClB,GAEL,CAAA,EACF,CAAA;AAAA,IAEF,CAAC,YAAA,EAAc,UAAA,EAAY,OAAA,EAAS,SAAS,MAAM;AAAA,GACrD;AAEA,EAAA,uBACE,GAAA;AAAA,IAACC,SAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA;AAAA,MACA,SAAA,EAAW,YAAY,OAAA,EAAS,SAAA;AAAA,MAChC,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 type ForwardedRef,\n type HTMLAttributes,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n DEFAULT_SLOT,\n Provider,\n Dialog as RACDialog,\n Popover as RACPopover,\n type PopoverRenderProps as RACPopoverRenderProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useSlot } from '../../hooks/use-slot';\nimport { useTheme } from '../../hooks/use-theme';\nimport { headings } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { AriaHeadingContext } from '../aria';\nimport { ButtonContext } from '../button';\nimport type { ButtonProps } from '../button/types';\nimport { ElementContext } from '../element';\nimport type { ElementProps } from '../element/types';\nimport { GroupContext } from '../group';\nimport type { GroupProps } from '../group/types';\nimport { popoverClassNames, popoverStateVars } from './popover.css';\nimport type { PopoverMapping, PopoverProps } from './types';\n\nconst defaultMapping: PopoverMapping = {\n heading: headings.v4,\n actions: {\n context: ButtonContext,\n orientation: 'horizontal',\n reverse: true,\n },\n primary: {\n size: 'sm',\n },\n close: { size: 'sm', variant: 'bare' },\n};\n\nexport const PopoverContext =\n createContext<ContextValue<PopoverProps, HTMLElement>>(null);\n\nexport const Popover = forwardRef(function Popover(\n props: PopoverProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n [props, ref] = useContextProps(props, ref, PopoverContext);\n props = useDefaultProps(props, 'Popover');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n ...rest\n } = props;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({ ...defaultMapping, ...mappingProp }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(popoverClassNames, theme.Popover, classNamesProp, {\n popover: {\n container: theme.className, // required to consume global theme within Popover\n },\n }),\n [theme.className, theme.Popover, classNamesProp],\n );\n\n const [headerRef, hasHeader] = useSlot();\n\n const style = useCallback(\n (renderProps: RACPopoverRenderProps) =>\n inlineVars(popoverStateVars, {\n ...theme.style, // required to consume global styles within Popover\n ...renderProps,\n hasHeader,\n }),\n [theme.style, hasHeader],\n );\n\n const values = useMemo<\n [\n [\n typeof ElementContext,\n ContextValue<\n ElementProps<\n ContextValue<HTMLAttributes<HTMLElement>, HTMLHeadingElement>,\n ContextValue<\n GroupProps<ButtonProps, HTMLButtonElement>,\n HTMLDivElement\n >\n >,\n HTMLElement\n >,\n ],\n ]\n >(\n () => [\n [\n ElementContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n header: {\n as: 'header',\n className: classNames?.header,\n ref: headerRef,\n values: [\n [\n AriaHeadingContext,\n {\n className: mapping.heading,\n slot: 'title',\n },\n ],\n [GroupContext, null],\n ],\n },\n content: { className: classNames?.content },\n footer: {\n as: 'footer',\n className: classNames?.footer,\n values: [\n [AriaHeadingContext, null],\n [\n GroupContext,\n {\n values: {\n slots: {\n [DEFAULT_SLOT]: mapping.primary ?? {},\n close: mapping.close ?? {},\n },\n },\n ...mapping.actions,\n },\n ],\n ],\n },\n },\n },\n ],\n ],\n [\n classNames?.header,\n classNames?.content,\n classNames?.footer,\n headerRef,\n mapping.actions,\n mapping.heading,\n mapping.primary,\n mapping.close,\n ],\n );\n\n const children = useCallback(\n (renderProps: RACPopoverRenderProps) => (\n <Provider values={values}>\n <RACDialog className={classNames?.popover?.popover}>\n {({ close }) =>\n callRenderProps(childrenProp, {\n ...renderProps,\n close,\n defaultChildren: null,\n })\n }\n </RACDialog>\n </Provider>\n ),\n [childrenProp, classNames?.popover?.popover, values],\n );\n\n return (\n <RACPopover\n {...rest}\n ref={ref}\n className={classNames?.popover?.container}\n style={style}\n >\n {children}\n </RACPopover>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/popover/index.tsx"],"names":["Popover","RACDialog","RACPopover"],"mappings":";;;;;;;;;;;;;;;;;AA6CA,IAAM,cAAA,GAAiC;AAAA,EACrC,SAAS,QAAA,CAAS,EAAA;AAAA,EAClB,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,aAAA;AAAA,IACT,WAAA,EAAa,YAAA;AAAA,IACb,OAAA,EAAS;AAAA,GACX;AAAA,EACA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM;AAAA,GACR;AAAA,EACA,KAAA,EAAO,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA;AAChC,CAAA;AAEO,IAAM,cAAA,GACX,cAAuD,IAAI;AAEtD,IAAM,OAAA,GAAU,UAAA,CAAW,SAASA,QAAAA,CACzC,OACA,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SAAA,EAAW,UAAA,EAAY,OAAA,EAAS,SACxC,QAAA,EAAA,CAAC,EAAE,KAAA,EAAM,KACR,gBAAgB,YAAA,EAAc;AAAA,MAC5B,GAAG,WAAA;AAAA,MACH,KAAA;AAAA,MACA,eAAA,EAAiB;AAAA,KAClB,GAEL,CAAA,EACF,CAAA;AAAA,IAEF,CAAC,YAAA,EAAc,UAAA,EAAY,OAAA,EAAS,SAAS,MAAM;AAAA,GACrD;AAEA,EAAA,uBACE,GAAA;AAAA,IAACC,SAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,UAAA;AAAA,MACL,SAAA,EAAW,YAAY,OAAA,EAAS,SAAA;AAAA,MAChC,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 type HTMLAttributes,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n DEFAULT_SLOT,\n Provider,\n Dialog as RACDialog,\n Popover as RACPopover,\n type PopoverRenderProps as RACPopoverRenderProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useSlot } from '../../hooks/use-slot';\nimport { useTheme } from '../../hooks/use-theme';\nimport { headings } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { AriaHeadingContext } from '../aria';\nimport { ButtonContext } from '../button';\nimport { ElementContext } from '../element';\nimport { GroupContext } from '../group';\nimport { popoverClassNames, popoverStateVars } from './popover.css';\nimport type { ButtonProps } from '../button/types';\nimport type { ElementProps } from '../element/types';\nimport type { GroupProps } from '../group/types';\nimport type { PopoverMapping, PopoverProps } from './types';\n\nconst defaultMapping: PopoverMapping = {\n heading: headings.v4,\n actions: {\n context: ButtonContext,\n orientation: 'horizontal',\n reverse: true,\n },\n primary: {\n size: 'sm',\n },\n close: { size: 'sm', variant: 'bare' },\n};\n\nexport const PopoverContext =\n createContext<ContextValue<PopoverProps, HTMLElement>>(null);\n\nexport const Popover = forwardRef(function Popover(\n props: PopoverProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [contextProps, contextRef] = useContextProps(\n props,\n ref,\n PopoverContext,\n );\n const finalProps = useDefaultProps(contextProps, 'Popover');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({ ...defaultMapping, ...mappingProp }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(popoverClassNames, theme.Popover, classNamesProp, {\n popover: {\n container: theme.className, // required to consume global theme within Popover\n },\n }),\n [theme.className, theme.Popover, classNamesProp],\n );\n\n const [headerRef, hasHeader] = useSlot();\n\n const style = useCallback(\n (renderProps: RACPopoverRenderProps) =>\n inlineVars(popoverStateVars, {\n ...theme.style, // required to consume global styles within Popover\n ...renderProps,\n hasHeader,\n }),\n [theme.style, hasHeader],\n );\n\n const values = useMemo<\n [\n [\n typeof ElementContext,\n ContextValue<\n ElementProps<\n ContextValue<HTMLAttributes<HTMLElement>, HTMLHeadingElement>,\n ContextValue<\n GroupProps<ButtonProps, HTMLButtonElement>,\n HTMLDivElement\n >\n >,\n HTMLElement\n >,\n ],\n ]\n >(\n () => [\n [\n ElementContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n header: {\n as: 'header',\n className: classNames?.header,\n ref: headerRef,\n values: [\n [\n AriaHeadingContext,\n {\n className: mapping.heading,\n slot: 'title',\n },\n ],\n [GroupContext, null],\n ],\n },\n content: { className: classNames?.content },\n footer: {\n as: 'footer',\n className: classNames?.footer,\n values: [\n [AriaHeadingContext, null],\n [\n GroupContext,\n {\n values: {\n slots: {\n [DEFAULT_SLOT]: mapping.primary ?? {},\n close: mapping.close ?? {},\n },\n },\n ...mapping.actions,\n },\n ],\n ],\n },\n },\n },\n ],\n ],\n [\n classNames?.header,\n classNames?.content,\n classNames?.footer,\n headerRef,\n mapping.actions,\n mapping.heading,\n mapping.primary,\n mapping.close,\n ],\n );\n\n const children = useCallback(\n (renderProps: RACPopoverRenderProps) => (\n <Provider values={values}>\n <RACDialog className={classNames?.popover?.popover}>\n {({ close }) =>\n callRenderProps(childrenProp, {\n ...renderProps,\n close,\n defaultChildren: null,\n })\n }\n </RACDialog>\n </Provider>\n ),\n [childrenProp, classNames?.popover?.popover, values],\n );\n\n return (\n <RACPopover\n {...rest}\n ref={contextRef}\n className={classNames?.popover?.container}\n style={style}\n >\n {children}\n </RACPopover>\n );\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/query-builder/action-element.tsx"],"names":[],"mappings":";;;;;;AAMO,SAAS,aAAA,CAAc;AAAA,EAC5B,QAAA;AAAA,EACA,mBAAA;AAAA,EACA,KAAA,EAAO,SAAA;AAAA,EACP;AACF,CAAA,EAAgB;AACd,EAAA,MAAM,WAAA,GAAc,WAAA;AAAA,IAClB,CAAC,KAAA,KAAsB,aAAA,CAAc,iBAAA,CAAkB,KAAK,CAAC,CAAA;AAAA,IAC7D,CAAC,aAAa;AAAA,GAChB;AAEA,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,MACE,mBAAA,EAAqB,KAAA,IAAS,QAAA,GAC1B,oBAAoB,KAAA,GACpB,SAAA;AAAA,IACN,CAAC,mBAAA,EAAqB,KAAA,EAAO,QAAA,EAAU,SAAS;AAAA,GAClD;AAEA,EAAA,uBACE,GAAA,CAAC,UAAO,UAAA,EAAY,QAAA,IAAY,CAAC,mBAAA,EAAqB,OAAA,EAAS,aAC5D,QAAA,EAAA,KAAA,EACH,CAAA;AAEJ","file":"action-element.js","sourcesContent":["import type { PressEvent } from '@react-types/shared';\nimport { useCallback, useMemo } from 'react';\nimport { Button } from '../button';\nimport type { ActionProps } from './types';\nimport { pressToMouseEvent } from './utils';\n\nexport function ActionElement({\n disabled,\n disabledTranslation,\n title: titleProp,\n handleOnClick,\n}: ActionProps) {\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n const title = useMemo(\n () =>\n disabledTranslation?.title && disabled\n ? disabledTranslation.title\n : titleProp,\n [disabledTranslation?.title, disabled, titleProp],\n );\n\n return (\n <Button isDisabled={disabled && !disabledTranslation} onPress={handlePress}>\n {title}\n </Button>\n );\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/query-builder/action-element.tsx"],"names":[],"mappings":";;;;;;AAMO,SAAS,aAAA,CAAc;AAAA,EAC5B,QAAA;AAAA,EACA,mBAAA;AAAA,EACA,KAAA,EAAO,SAAA;AAAA,EACP;AACF,CAAA,EAAgB;AACd,EAAA,MAAM,WAAA,GAAc,WAAA;AAAA,IAClB,CAAC,KAAA,KAAsB,aAAA,CAAc,iBAAA,CAAkB,KAAK,CAAC,CAAA;AAAA,IAC7D,CAAC,aAAa;AAAA,GAChB;AAEA,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,MACE,mBAAA,EAAqB,KAAA,IAAS,QAAA,GAC1B,oBAAoB,KAAA,GACpB,SAAA;AAAA,IACN,CAAC,mBAAA,EAAqB,KAAA,EAAO,QAAA,EAAU,SAAS;AAAA,GAClD;AAEA,EAAA,uBACE,GAAA,CAAC,UAAO,UAAA,EAAY,QAAA,IAAY,CAAC,mBAAA,EAAqB,OAAA,EAAS,aAC5D,QAAA,EAAA,KAAA,EACH,CAAA;AAEJ","file":"action-element.js","sourcesContent":["import { useCallback, useMemo } from 'react';\nimport { Button } from '../button';\nimport { pressToMouseEvent } from './utils';\nimport type { PressEvent } from '@react-types/shared';\nimport type { ActionProps } from './types';\n\nexport function ActionElement({\n disabled,\n disabledTranslation,\n title: titleProp,\n handleOnClick,\n}: ActionProps) {\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n const title = useMemo(\n () =>\n disabledTranslation?.title && disabled\n ? disabledTranslation.title\n : titleProp,\n [disabledTranslation?.title, disabled, titleProp],\n );\n\n return (\n <Button isDisabled={disabled && !disabledTranslation} onPress={handlePress}>\n {title}\n </Button>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/query-builder/dataset-sample.ts"],"names":[],"mappings":";;;AAuBO,IAAM,kBAAA,GAAoC;AAAA,EAC/C;AAAA,IACE,KAAA,EAAO,QAAA;AAAA,IACP,OAAA,EAAS;AAAA,MACP,EAAE,IAAA,EAAM,WAAA,EAAa,KAAA,EAAO,WAAA,EAAa,OAAO,WAAA,EAAY;AAAA,MAC5D,EAAE,IAAA,EAAM,QAAA,EAAU,KAAA,EAAO,QAAA,EAAU,OAAO,QAAA,EAAS;AAAA,MACnD;AAAA,QACE,IAAA,EAAM,WAAA;AAAA,QACN,KAAA,EAAO,WAAA;AAAA,QACP,KAAA,EAAO;AAAA,OACT;AAAA,MACA,EAAE,IAAA,EAAM,OAAA,EAAS,KAAA,EAAO,OAAA,EAAS,OAAO,OAAA;AAAQ;AAClD,GACF;AAAA,EACA;AAAA,IACE,KAAA,EAAO,SAAA;AAAA,IACP,OAAA,EAAS;AAAA,MACP,EAAE,IAAA,EAAM,YAAA,EAAc,KAAA,EAAO,YAAA,EAAc,OAAO,YAAA,EAAa;AAAA,MAC/D,EAAE,IAAA,EAAM,YAAA,EAAc,KAAA,EAAO,YAAA,EAAc,OAAO,YAAA,EAAa;AAAA,MA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A;AAAA,IACJ,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO,gBAAA;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,eAAA,EAAiB;AAAA,GACnB;AAAA,EACA;AAAA,IACE,EAAA,EAAI,UAAA;AAAA,IACJ,IAAA,EAAM,UAAA;AAAA,IACN,KAAA,EAAO,kBAAA;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,GAAG,OAAA,CAAQ;AAAA,GACb;AAAA,EACA;AAAA,IACE,EAAA,EAAI,aAAA;AAAA,IACJ,IAAA,EAAM,aAAA;AAAA,IACN,KAAA,EAAO,aAAA;AAAA,IACP,IAAA,EAAM,MAAA;AAAA,IACN,GAAG,OAAA,CAAQ;AAAA,GACb;AAAA,EACA;AAAA,IACE,EAAA,EAAI,aAAA;AAAA,IACJ,IAAA,EAAM,aAAA;AAAA,IACN,KAAA,EAAO,aAAA;AAAA,IACP,IAAA,EAAM,UAAA;AAAA,IACN,GAAG,OAAA,CAAQ;AAAA,GACb;AAAA,EACA;AAAA,IACE,EAAA,EAAI,cAAA;AAAA,IACJ,IAAA,EAAM,cAAA;AAAA,IACN,KAAA,EAAO,cAAA;AAAA,IACP,IAAA,EAAM,MAAA;AAAA,IACN,GAAG,OAAA,CAAQ;AAAA;AAEf","file":"dataset-sample.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 {\n Field,\n Option,\n OptionGroup,\n RuleType,\n ValidationResult,\n ValueEditorType,\n} from 'react-querybuilder';\nimport { z } from 'zod';\n\n// Example of an options with grouping\nexport const serviceCityOptions: OptionGroup[] = [\n {\n label: 'Alaska',\n options: [\n { name: 'Anchorage', label: 'Anchorage', value: 'Anchorage' },\n { name: 'Juneau', label: 'Juneau', value: 'Juneau' },\n {\n name: 'Fairbanks',\n label: 'Fairbanks',\n value: 'Fairbanks',\n },\n { name: 'Sitka', label: 'Sitka', value: 'Sitka' },\n ],\n },\n {\n label: 'Alabama',\n options: [\n { name: 'Montgomery', label: 'Montgomery', value: 'Montgomery' },\n { name: 'Birmingham', label: 'Birmingham', value: 'Birmingham' },\n {\n name: 'Huntsville',\n label: 'Huntsville',\n value: 'Huntsville',\n },\n { name: 'Mobile', label: 'Mobile', value: 'Mobile' },\n ],\n },\n];\n\n// Example of options\nexport const airportUseOptions: Option[] = [\n { name: 'Private', label: 'Private', value: 'Private' },\n { name: 'Public', label: 'Public', value: 'Public' },\n { name: 'Mixed', label: 'Mixed', value: 'Mixed' },\n { name: 'Unknown', label: 'Unknown', value: 'Unknown' },\n];\n\n// Example of radio options\nexport const airportTypeOptions: Option[] = [\n { name: 'Heliport', label: 'Heliport', value: 'Heliport' },\n { name: 'Aerodrome', label: 'Aerodrome', value: 'Aerodrome' },\n { name: 'Unknown', label: 'Unknown', value: 'Unknown' },\n];\n\ntype FieldTypes = 'bool' | 'i32' | 'str' | 'f64' | 'date' | 'datetime' | 'time';\ntype FieldConfig = Partial<{\n inputType: 'text' | 'number' | 'date' | 'datetime-local' | 'time';\n operators: Option[];\n validator: (rule: RuleType) => ValidationResult;\n valueEditorType: ValueEditorType;\n}>;\n\nconst typeMap: Record<FieldTypes, FieldConfig> = {\n i32: {\n inputType: 'number', // as in HTML input type <input type=\"number\">\n operators: [\n { name: '=', value: '=', label: 'is' } as const,\n { name: '<', value: '<', label: 'less than' } as const,\n { name: '>', value: '>', label: 'greater than' } as const,\n { name: '<=', value: '<=', label: 'less than equal' } as const,\n { name: '>=', value: '>=', label: 'greater than equal' } as const,\n { name: 'between', value: 'between', label: 'between' } as const,\n { name: 'in', value: 'in', label: 'in' } as const,\n ],\n validator: (rule) => ({\n valid: z\n .union([\n z.coerce.number().int().gte(-2_147_483_648).lte(2_147_483_647),\n z.tuple([\n z.coerce.number().int().gte(-2_147_483_648).lte(2_147_483_647),\n z.coerce.number().int().gte(-2_147_483_648).lte(2_147_483_647),\n ]),\n ])\n .safeParse(rule.value).success,\n reasons: ['Number must be in range.'],\n }),\n },\n f64: {\n inputType: 'number',\n operators: [\n { name: '=', value: '=', label: 'is' } as const,\n { name: '<', value: '<', label: 'less than' } as const,\n { name: '>', value: '>', label: 'greater than' } as const,\n { name: '<=', value: '<=', label: 'less than equal' } as const,\n { name: '>=', value: '>=', label: 'greater than equal' } as const,\n { name: 'between', value: 'BETWEEN', label: 'between' } as const,\n { name: 'in', value: 'IN', label: 'in' } as const,\n ],\n validator: (rule) => ({\n valid: z.coerce\n .number()\n .int()\n .gte(-9_007_199_254_740_991)\n .lte(9_007_199_254_740_991)\n .safeParse(rule.value).success,\n reasons: ['Number must be in range.'],\n }),\n },\n bool: {\n operators: [{ name: '=', value: '=', label: 'is' } as const],\n validator: (rule) => ({\n valid: z.coerce.boolean().safeParse(rule.value).success,\n reasons: ['Value is required'],\n }),\n valueEditorType: 'checkbox',\n },\n str: {\n operators: [\n { name: '=', value: '=', label: 'is' } as const,\n { name: 'like', value: 'like', label: 'like' } as const,\n { name: 'in', value: 'in', label: 'in' } as const,\n ],\n inputType: 'text',\n validator: (rule) => ({\n valid: z.string().min(1).safeParse(rule.value).success,\n reasons: ['At least one character is required.'],\n }),\n },\n date: {\n operators: [\n { name: 'equals', value: 'tequals', label: 'is' } as const,\n { name: 'during', value: 'during', label: 'occurs between' } as const,\n { name: 'before', value: 'before', label: 'ends before' } as const,\n { name: 'after', value: 'after', label: 'starts after' } as const,\n {\n name: 'overlapped',\n value: 'overlappedby',\n label: 'starts during',\n } as const,\n { name: 'overlaps', value: 'toverlaps', label: 'ends during' } as const,\n ],\n inputType: 'date',\n validator: (rule) => ({\n valid: z\n .union([\n z.string().min(1),\n z.tuple([z.string().min(1), z.string().min(1)]),\n ])\n .safeParse(rule.value).success,\n reasons: ['At least one character is required.'],\n }),\n },\n datetime: {\n operators: [\n { name: 'equals', value: 'tequals', label: 'is' } as const,\n { name: 'during', value: 'during', label: 'occurs between' } as const,\n { name: 'before', value: 'before', label: 'ends before' } as const,\n { name: 'after', value: 'after', label: 'starts after' } as const,\n {\n name: 'overlapped',\n value: 'overlappedby',\n label: 'starts during',\n } as const,\n { name: 'overlaps', value: 'toverlaps', label: 'ends during' } as const,\n ],\n inputType: 'datetime-local', // mm/dd/yyyy hh:mm a\n validator: (rule) => ({\n valid: z\n .union([\n z.string().min(1),\n z.tuple([z.string().min(1), z.string().min(1)]),\n ])\n .safeParse(rule.value).success,\n reasons: ['At least one character is required.'],\n }),\n },\n time: {\n operators: [\n { name: 'equals', value: 'tequals', label: 'is' } as const,\n { name: 'during', value: 'during', label: 'occurs between' } as const,\n { name: 'before', value: 'before', label: 'ends before' } as const,\n { name: 'after', value: 'after', label: 'starts after' } as const,\n {\n name: 'overlapped',\n value: 'overlappedby',\n label: 'starts during',\n } as const,\n { name: 'overlaps', value: 'toverlaps', label: 'ends during' } as const,\n ],\n inputType: 'time', // hh:mm a\n validator: (rule) => ({\n valid: z\n .union([\n z.string().min(1),\n z.tuple([z.string().min(1), z.string().min(1)]),\n ])\n .safeParse(rule.value).success,\n reasons: ['At least one character is required.'],\n }),\n },\n};\n\nexport const fields = [\n {\n id: 'AK_HIGH',\n name: 'AK_HIGH',\n label: 'AK High',\n type: 'i32',\n ...typeMap.i32,\n },\n {\n id: 'AK_LOW',\n name: 'AK_LOW',\n label: 'AK Low',\n type: 'i32',\n ...typeMap.i32,\n },\n {\n id: 'COUNTRY',\n name: 'COUNTRY',\n label: 'Country',\n type: 'str',\n ...typeMap.str,\n },\n {\n id: 'ELEVATION',\n name: 'ELEVATION',\n label: 'Elevation',\n type: 'f64',\n },\n {\n id: 'OPERSTATUS',\n name: 'OPERSTATUS',\n label: 'Is Operational',\n type: 'str',\n defaultValue: false,\n operators: [{ name: '=', value: '=', label: 'is' } as const],\n ...typeMap.bool,\n },\n {\n id: 'PRIVATEUSE',\n name: 'PRIVATEUSE',\n label: 'Private Use',\n type: 'str',\n valueEditorType: 'multiselect',\n values: airportUseOptions,\n operators: [{ name: 'in', value: 'in', label: 'in' } as const],\n },\n {\n id: 'DONUTS',\n name: 'DONUTS',\n label: 'Has Donuts',\n type: 'bool',\n operators: [{ name: '=', value: '=', label: 'is' } as const],\n valueEditorType: 'switch',\n },\n {\n id: 'SERVCITY',\n name: 'SERVCITY',\n valueEditorType: 'select',\n values: serviceCityOptions,\n label: 'Service City',\n type: 'str',\n operators: [\n { name: '=', value: '=', label: 'is' } as const,\n { name: 'like', value: 'like', label: 'like' } as const,\n { name: 'in', value: 'in', label: 'in' } as const,\n { name: 'between', value: 'between', label: 'between' } as const,\n ],\n },\n {\n id: 'TYPE_CODE',\n name: 'TYPE_CODE',\n label: 'Type Code',\n type: 'str',\n valueEditorType: 'radio',\n values: airportTypeOptions,\n defaultValue: 'Aerodrome',\n },\n {\n id: 'NOTES',\n name: 'NOTES',\n label: 'Operator Notes',\n type: 'str',\n valueEditorType: 'textarea',\n },\n {\n id: 'NICKNAME',\n name: 'NICKNAME',\n label: 'Airport Nickname',\n type: 'str',\n ...typeMap.str,\n },\n {\n id: 'ESTABLISHED',\n name: 'ESTABLISHED',\n label: 'Established',\n type: 'date',\n ...typeMap.date,\n },\n {\n id: 'MAINTENANCE',\n name: 'MAINTENANCE',\n label: 'Maintenance',\n type: 'datetime',\n ...typeMap.datetime,\n },\n {\n id: 'PEAK_TRAFFIC',\n name: 'PEAK_TRAFFIC',\n label: 'Peak Traffic',\n type: 'time',\n ...typeMap.time,\n },\n] satisfies Field[];\n"]}
1
+ {"version":3,"sources":["../../../src/components/query-builder/dataset-sample.ts"],"names":[],"mappings":";;;AAuBO,IAAM,kBAAA,GAAoC;AAAA,EAC/C;AAAA,IACE,K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,UAAA;AAAA,IACN,GAAG,OAAA,CAAQ;AAAA,GACb;AAAA,EACA;AAAA,IACE,EAAA,EAAI,cAAA;AAAA,IACJ,IAAA,EAAM,cAAA;AAAA,IACN,KAAA,EAAO,cAAA;AAAA,IACP,IAAA,EAAM,MAAA;AAAA,IACN,GAAG,OAAA,CAAQ;AAAA;AAEf","file":"dataset-sample.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 { z } from 'zod';\nimport type {\n Field,\n Option,\n OptionGroup,\n RuleType,\n ValidationResult,\n ValueEditorType,\n} from 'react-querybuilder';\n\n// Example of an options with grouping\nexport const serviceCityOptions: OptionGroup[] = [\n {\n label: 'Alaska',\n options: [\n { name: 'Anchorage', label: 'Anchorage', value: 'Anchorage' },\n { name: 'Juneau', label: 'Juneau', value: 'Juneau' },\n {\n name: 'Fairbanks',\n label: 'Fairbanks',\n value: 'Fairbanks',\n },\n { name: 'Sitka', label: 'Sitka', value: 'Sitka' },\n ],\n },\n {\n label: 'Alabama',\n options: [\n { name: 'Montgomery', label: 'Montgomery', value: 'Montgomery' },\n { name: 'Birmingham', label: 'Birmingham', value: 'Birmingham' },\n {\n name: 'Huntsville',\n label: 'Huntsville',\n value: 'Huntsville',\n },\n { name: 'Mobile', label: 'Mobile', value: 'Mobile' },\n ],\n },\n];\n\n// Example of options\nexport const airportUseOptions: Option[] = [\n { name: 'Private', label: 'Private', value: 'Private' },\n { name: 'Public', label: 'Public', value: 'Public' },\n { name: 'Mixed', label: 'Mixed', value: 'Mixed' },\n { name: 'Unknown', label: 'Unknown', value: 'Unknown' },\n];\n\n// Example of radio options\nexport const airportTypeOptions: Option[] = [\n { name: 'Heliport', label: 'Heliport', value: 'Heliport' },\n { name: 'Aerodrome', label: 'Aerodrome', value: 'Aerodrome' },\n { name: 'Unknown', label: 'Unknown', value: 'Unknown' },\n];\n\ntype FieldTypes = 'bool' | 'i32' | 'str' | 'f64' | 'date' | 'datetime' | 'time';\ntype FieldConfig = Partial<{\n inputType: 'text' | 'number' | 'date' | 'datetime-local' | 'time';\n operators: Option[];\n validator: (rule: RuleType) => ValidationResult;\n valueEditorType: ValueEditorType;\n}>;\n\nconst typeMap: Record<FieldTypes, FieldConfig> = {\n i32: {\n inputType: 'number', // as in HTML input type <input type=\"number\">\n operators: [\n { name: '=', value: '=', label: 'is' } as const,\n { name: '<', value: '<', label: 'less than' } as const,\n { name: '>', value: '>', label: 'greater than' } as const,\n { name: '<=', value: '<=', label: 'less than equal' } as const,\n { name: '>=', value: '>=', label: 'greater than equal' } as const,\n { name: 'between', value: 'between', label: 'between' } as const,\n { name: 'in', value: 'in', label: 'in' } as const,\n ],\n validator: (rule) => ({\n valid: z\n .union([\n z.coerce.number().int().gte(-2_147_483_648).lte(2_147_483_647),\n z.tuple([\n z.coerce.number().int().gte(-2_147_483_648).lte(2_147_483_647),\n z.coerce.number().int().gte(-2_147_483_648).lte(2_147_483_647),\n ]),\n ])\n .safeParse(rule.value).success,\n reasons: ['Number must be in range.'],\n }),\n },\n f64: {\n inputType: 'number',\n operators: [\n { name: '=', value: '=', label: 'is' } as const,\n { name: '<', value: '<', label: 'less than' } as const,\n { name: '>', value: '>', label: 'greater than' } as const,\n { name: '<=', value: '<=', label: 'less than equal' } as const,\n { name: '>=', value: '>=', label: 'greater than equal' } as const,\n { name: 'between', value: 'BETWEEN', label: 'between' } as const,\n { name: 'in', value: 'IN', label: 'in' } as const,\n ],\n validator: (rule) => ({\n valid: z.coerce\n .number()\n .int()\n .gte(-9_007_199_254_740_991)\n .lte(9_007_199_254_740_991)\n .safeParse(rule.value).success,\n reasons: ['Number must be in range.'],\n }),\n },\n bool: {\n operators: [{ name: '=', value: '=', label: 'is' } as const],\n validator: (rule) => ({\n valid: z.coerce.boolean().safeParse(rule.value).success,\n reasons: ['Value is required'],\n }),\n valueEditorType: 'checkbox',\n },\n str: {\n operators: [\n { name: '=', value: '=', label: 'is' } as const,\n { name: 'like', value: 'like', label: 'like' } as const,\n { name: 'in', value: 'in', label: 'in' } as const,\n ],\n inputType: 'text',\n validator: (rule) => ({\n valid: z.string().min(1).safeParse(rule.value).success,\n reasons: ['At least one character is required.'],\n }),\n },\n date: {\n operators: [\n { name: 'equals', value: 'tequals', label: 'is' } as const,\n { name: 'during', value: 'during', label: 'occurs between' } as const,\n { name: 'before', value: 'before', label: 'ends before' } as const,\n { name: 'after', value: 'after', label: 'starts after' } as const,\n {\n name: 'overlapped',\n value: 'overlappedby',\n label: 'starts during',\n } as const,\n { name: 'overlaps', value: 'toverlaps', label: 'ends during' } as const,\n ],\n inputType: 'date',\n validator: (rule) => ({\n valid: z\n .union([\n z.string().min(1),\n z.tuple([z.string().min(1), z.string().min(1)]),\n ])\n .safeParse(rule.value).success,\n reasons: ['At least one character is required.'],\n }),\n },\n datetime: {\n operators: [\n { name: 'equals', value: 'tequals', label: 'is' } as const,\n { name: 'during', value: 'during', label: 'occurs between' } as const,\n { name: 'before', value: 'before', label: 'ends before' } as const,\n { name: 'after', value: 'after', label: 'starts after' } as const,\n {\n name: 'overlapped',\n value: 'overlappedby',\n label: 'starts during',\n } as const,\n { name: 'overlaps', value: 'toverlaps', label: 'ends during' } as const,\n ],\n inputType: 'datetime-local', // mm/dd/yyyy hh:mm a\n validator: (rule) => ({\n valid: z\n .union([\n z.string().min(1),\n z.tuple([z.string().min(1), z.string().min(1)]),\n ])\n .safeParse(rule.value).success,\n reasons: ['At least one character is required.'],\n }),\n },\n time: {\n operators: [\n { name: 'equals', value: 'tequals', label: 'is' } as const,\n { name: 'during', value: 'during', label: 'occurs between' } as const,\n { name: 'before', value: 'before', label: 'ends before' } as const,\n { name: 'after', value: 'after', label: 'starts after' } as const,\n {\n name: 'overlapped',\n value: 'overlappedby',\n label: 'starts during',\n } as const,\n { name: 'overlaps', value: 'toverlaps', label: 'ends during' } as const,\n ],\n inputType: 'time', // hh:mm a\n validator: (rule) => ({\n valid: z\n .union([\n z.string().min(1),\n z.tuple([z.string().min(1), z.string().min(1)]),\n ])\n .safeParse(rule.value).success,\n reasons: ['At least one character is required.'],\n }),\n },\n};\n\nexport const fields = [\n {\n id: 'AK_HIGH',\n name: 'AK_HIGH',\n label: 'AK High',\n type: 'i32',\n ...typeMap.i32,\n },\n {\n id: 'AK_LOW',\n name: 'AK_LOW',\n label: 'AK Low',\n type: 'i32',\n ...typeMap.i32,\n },\n {\n id: 'COUNTRY',\n name: 'COUNTRY',\n label: 'Country',\n type: 'str',\n ...typeMap.str,\n },\n {\n id: 'ELEVATION',\n name: 'ELEVATION',\n label: 'Elevation',\n type: 'f64',\n },\n {\n id: 'OPERSTATUS',\n name: 'OPERSTATUS',\n label: 'Is Operational',\n type: 'str',\n defaultValue: false,\n operators: [{ name: '=', value: '=', label: 'is' } as const],\n ...typeMap.bool,\n },\n {\n id: 'PRIVATEUSE',\n name: 'PRIVATEUSE',\n label: 'Private Use',\n type: 'str',\n valueEditorType: 'multiselect',\n values: airportUseOptions,\n operators: [{ name: 'in', value: 'in', label: 'in' } as const],\n },\n {\n id: 'DONUTS',\n name: 'DONUTS',\n label: 'Has Donuts',\n type: 'bool',\n operators: [{ name: '=', value: '=', label: 'is' } as const],\n valueEditorType: 'switch',\n },\n {\n id: 'SERVCITY',\n name: 'SERVCITY',\n valueEditorType: 'select',\n values: serviceCityOptions,\n label: 'Service City',\n type: 'str',\n operators: [\n { name: '=', value: '=', label: 'is' } as const,\n { name: 'like', value: 'like', label: 'like' } as const,\n { name: 'in', value: 'in', label: 'in' } as const,\n { name: 'between', value: 'between', label: 'between' } as const,\n ],\n },\n {\n id: 'TYPE_CODE',\n name: 'TYPE_CODE',\n label: 'Type Code',\n type: 'str',\n valueEditorType: 'radio',\n values: airportTypeOptions,\n defaultValue: 'Aerodrome',\n },\n {\n id: 'NOTES',\n name: 'NOTES',\n label: 'Operator Notes',\n type: 'str',\n valueEditorType: 'textarea',\n },\n {\n id: 'NICKNAME',\n name: 'NICKNAME',\n label: 'Airport Nickname',\n type: 'str',\n ...typeMap.str,\n },\n {\n id: 'ESTABLISHED',\n name: 'ESTABLISHED',\n label: 'Established',\n type: 'date',\n ...typeMap.date,\n },\n {\n id: 'MAINTENANCE',\n name: 'MAINTENANCE',\n label: 'Maintenance',\n type: 'datetime',\n ...typeMap.datetime,\n },\n {\n id: 'PEAK_TRAFFIC',\n name: 'PEAK_TRAFFIC',\n label: 'Peak Traffic',\n type: 'time',\n ...typeMap.time,\n },\n] satisfies Field[];\n"]}