@accelint/design-system 1.1.7 → 1.1.9

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 (68) hide show
  1. package/dist/components/aria/index.d.ts +4 -4
  2. package/dist/components/button/index.js +2 -2
  3. package/dist/components/button/index.js.map +1 -1
  4. package/dist/components/checkbox/index.js +7 -11
  5. package/dist/components/checkbox/index.js.map +1 -1
  6. package/dist/components/chip/index.js +2 -2
  7. package/dist/components/chip/index.js.map +1 -1
  8. package/dist/components/combo-box/index.js +2 -6
  9. package/dist/components/combo-box/index.js.map +1 -1
  10. package/dist/components/date-field/index.js +2 -2
  11. package/dist/components/date-field/index.js.map +1 -1
  12. package/dist/components/date-input/index.js +4 -4
  13. package/dist/components/date-input/index.js.map +1 -1
  14. package/dist/components/dialog/index.js +2 -2
  15. package/dist/components/dialog/index.js.map +1 -1
  16. package/dist/components/drawer/index.js +4 -4
  17. package/dist/components/drawer/index.js.map +1 -1
  18. package/dist/components/element/index.js +3 -7
  19. package/dist/components/element/index.js.map +1 -1
  20. package/dist/components/element/types.d.ts +4 -2
  21. package/dist/components/group/index.js +4 -4
  22. package/dist/components/group/index.js.map +1 -1
  23. package/dist/components/icon/index.js +2 -2
  24. package/dist/components/icon/index.js.map +1 -1
  25. package/dist/components/input/index.js +10 -10
  26. package/dist/components/input/index.js.map +1 -1
  27. package/dist/components/menu/index.js +9 -9
  28. package/dist/components/menu/index.js.map +1 -1
  29. package/dist/components/number-field/index.js +2 -2
  30. package/dist/components/number-field/index.js.map +1 -1
  31. package/dist/components/options/index.js +11 -17
  32. package/dist/components/options/index.js.map +1 -1
  33. package/dist/components/picker/index.js +6 -10
  34. package/dist/components/picker/index.js.map +1 -1
  35. package/dist/components/popover/index.js +2 -6
  36. package/dist/components/popover/index.js.map +1 -1
  37. package/dist/components/radio/index.js +4 -4
  38. package/dist/components/radio/index.js.map +1 -1
  39. package/dist/components/search-field/index.js +2 -2
  40. package/dist/components/search-field/index.js.map +1 -1
  41. package/dist/components/select/index.d.ts +1 -1
  42. package/dist/components/select/index.js +2 -2
  43. package/dist/components/select/index.js.map +1 -1
  44. package/dist/components/slider/index.js +10 -10
  45. package/dist/components/slider/index.js.map +1 -1
  46. package/dist/components/switch/index.js +2 -2
  47. package/dist/components/switch/index.js.map +1 -1
  48. package/dist/components/tabs/index.js +10 -18
  49. package/dist/components/tabs/index.js.map +1 -1
  50. package/dist/components/tabs/tabs.css.d.ts +2 -0
  51. package/dist/components/tabs/tabs.css.js +2 -2
  52. package/dist/components/tabs/tabs.css.js.map +1 -1
  53. package/dist/components/text-field/index.js +2 -2
  54. package/dist/components/text-field/index.js.map +1 -1
  55. package/dist/components/textarea/index.js +8 -8
  56. package/dist/components/textarea/index.js.map +1 -1
  57. package/dist/components/time-field/index.js +2 -2
  58. package/dist/components/time-field/index.js.map +1 -1
  59. package/dist/components/tooltip/index.js +5 -9
  60. package/dist/components/tooltip/index.js.map +1 -1
  61. package/dist/components/tree/index.js +2 -2
  62. package/dist/components/tree/index.js.map +1 -1
  63. package/dist/index.css +30 -30
  64. package/dist/ladle/actions.js.map +1 -1
  65. package/dist/styles/layers.css.d.ts +3 -3
  66. package/dist/test/setup.js +4 -4
  67. package/dist/test/setup.js.map +1 -1
  68. package/package.json +43 -43
@@ -32,7 +32,7 @@ var DrawerContext = createContext({
32
32
  toggle: noop
33
33
  });
34
34
  function Drawer(props) {
35
- const defaultedProps = useDefaultProps(props, "Drawer");
35
+ const finalProps = useDefaultProps(props, "Drawer");
36
36
  const {
37
37
  children: childrenProp,
38
38
  classNames: classNamesProp,
@@ -45,7 +45,7 @@ function Drawer(props) {
45
45
  isOpen: isOpenProp,
46
46
  onOpenChange,
47
47
  ...rest
48
- } = defaultedProps;
48
+ } = finalProps;
49
49
  const theme = useTheme();
50
50
  const isSSR = useIsSSR();
51
51
  const classNames = useMemo(
@@ -202,7 +202,7 @@ var defaultMapping = {
202
202
  };
203
203
  var DrawerDialogContext = createContext(null);
204
204
  var DrawerDialog = forwardRef(function DrawerDialog2(props, ref) {
205
- const [contextProps, contextRef] = useContextProps(
205
+ const [contextProps, finalRef] = useContextProps(
206
206
  props,
207
207
  ref,
208
208
  DrawerDialogContext
@@ -307,7 +307,7 @@ var DrawerDialog = forwardRef(function DrawerDialog2(props, ref) {
307
307
  "div",
308
308
  {
309
309
  ...rest,
310
- ref: contextRef,
310
+ ref: finalRef,
311
311
  className: classNames?.dialog?.container,
312
312
  style,
313
313
  "aria-label": ariaLabel,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/drawer/index.tsx"],"names":["isOpen","DrawerDialog"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoEA,IAAM,gBAAgB,aAAA,CAAkC;AAAA,EACtD,MAAA,EAAQ,OAAA;AAAA,EACR,WAAA,EAAa,KAAA;AAAA,EACb,MAAA,EAAQ,KAAA;AAAA,EACR,KAAA,EAAO,IAAA;AAAA,EACP,IAAA,EAAM,IAAA;AAAA,EACN,OAAA,EAAS,IAAA;AAAA,EACT,MAAA,EAAQ;AACV,CAAC,CAAA;AAEM,SAAS,OAAO,KAAA,EAAoB;AACzC,EAAA,MAAM,cAAA,GAAiB,eAAA,CAAgB,KAAA,EAAO,QAAQ,CAAA;AAEtD,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,YAAA;AAAA,IACV,UAAA,EAAY,cAAA;AAAA,IACZ,MAAA,GAAS,OAAA;AAAA,IACT,WAAA,GAAc,KAAA;AAAA,IACd,WAAA,GAAc,KAAA;AAAA,IACd,iBAAA,GAAoB,KAAA;AAAA,IACpB,aAAA,GAAgB,IAAA;AAAA,IAChB,yBAAA,GAA4B,KAAA;AAAA,IAC5B,MAAA,EAAQ,UAAA;AAAA,IACR,YAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,cAAA;AAEJ,EAAA,MAAM,QAAQ,QAAA,EAAS;AACvB,EAAA,MAAM,QAAQ,QAAA,EAAS;AAEvB,EAAA,MAAM,UAAA,G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AAA,EAAU;AAC9C,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN;AAAA,KACF;AAAA,EACF;AAEA,EAAA,uBACE,GAAA,CAAC,YAAS,MAAA,EAER,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,UAAA;AAAA,MACL,SAAA,EAAW,YAAY,MAAA,EAAQ,SAAA;AAAA,MAC/B,KAAA;AAAA,MACA,YAAA,EAAY,SAAA;AAAA,MACZ,iBAAA,EAAiB,cAAA;AAAA,MAEjB,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,MAAA,EAAQ,QAAS,QAAA,EAAS;AAAA;AAAA,GACxD,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 { toBoolean } from '@accelint/converters';\nimport { noop } from '@accelint/core';\nimport { useFocusWithin } from '@react-aria/interactions';\nimport { useOverlay } from '@react-aria/overlays';\nimport { useIsSSR } from '@react-aria/ssr';\nimport { useOverlayTriggerState } from '@react-stately/overlays';\nimport {\n createContext,\n type ForwardedRef,\n forwardRef,\n type HTMLAttributes,\n useCallback,\n useContext,\n useMemo,\n useRef,\n} from 'react';\nimport {\n type ContextValue,\n DEFAULT_SLOT,\n Provider,\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 {\n callRenderProps,\n mergeClassNames,\n mergeProps,\n} from '../../utils/props';\nimport { AriaHeadingContext } from '../aria';\nimport { ButtonContext } from '../button';\nimport { ElementContext } from '../element';\nimport { Tab, TabList, Tabs } from '../tabs';\nimport { TooltipContext, TooltipTargetContext } from '../tooltip';\nimport {\n drawerClassNames,\n drawerDialogStateVars,\n drawerStateVars,\n} from './drawer.css';\nimport type { PressEvent } from '@react-types/shared';\nimport type { ButtonProps } from '../button/types';\nimport type { ElementProps } from '../element/types.ts';\nimport type { TabRenderProps } from '../tabs/types';\nimport type { TooltipProps, TooltipTargetProps } from '../tooltip/types';\nimport type {\n DrawerContextValue,\n DrawerDialogProps,\n DrawerMapping,\n DrawerProps,\n DrawerTabListProps,\n DrawerTabProps,\n} from './types';\n\nconst DrawerContext = createContext<DrawerContextValue>({\n anchor: 'right',\n layoutShift: false,\n isOpen: false,\n close: noop,\n open: noop,\n setOpen: noop,\n toggle: noop,\n});\n\nexport function Drawer(props: DrawerProps) {\n const defaultedProps = useDefaultProps(props, 'Drawer');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n anchor = 'right',\n defaultOpen = false,\n layoutShift = false,\n shouldCloseOnBlur = false,\n isDismissable = true,\n isKeyboardDismissDisabled = false,\n isOpen: isOpenProp,\n onOpenChange,\n ...rest\n } = defaultedProps;\n\n const theme = useTheme();\n const isSSR = useIsSSR();\n\n const classNames = useMemo(\n () => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp),\n [theme.Drawer, classNamesProp],\n );\n\n // Remove focus when Drawer closes\n const handleOpenChange = useCallback(\n (isOpen: boolean) => {\n if (!isOpen) {\n const focused = isSSR ? null : document.activeElement;\n\n if (\n focused &&\n 'blur' in focused &&\n typeof focused.blur === 'function'\n ) {\n focused.blur();\n }\n }\n\n onOpenChange?.(isOpen);\n },\n [isSSR, onOpenChange],\n );\n\n const state = useOverlayTriggerState({\n defaultOpen,\n isOpen: isOpenProp,\n onOpenChange: handleOpenChange,\n });\n\n const { isOpen, close, open } = state;\n const ref = useRef<HTMLDivElement>(null);\n\n const { overlayProps } = useOverlay(\n {\n isOpen,\n shouldCloseOnBlur,\n isDismissable,\n isKeyboardDismissDisabled,\n onClose: close,\n },\n ref,\n );\n\n // TODO: it may be desirable to disallow focus within the closed Drawer instead\n // If focus forces the Drawer open\n const { focusWithinProps } = useFocusWithin({\n onFocusWithin: open,\n });\n\n const context = useMemo(\n () => ({ ...state, anchor, layoutShift }),\n [state, anchor, layoutShift],\n );\n\n const values = useMemo<\n [\n [typeof DrawerContext, DrawerContextValue],\n [\n typeof DrawerDialogContext,\n ContextValue<DrawerDialogProps, HTMLDivElement>,\n ],\n ]\n >(\n () => [\n [DrawerContext, context],\n [DrawerDialogContext, { classNames }],\n ],\n [context, classNames],\n );\n\n const style = useMemo(\n () =>\n inlineVars(drawerStateVars, {\n anchor,\n layoutShift,\n isOpen,\n }),\n [anchor, layoutShift, isOpen],\n );\n\n const children = useMemo(\n () => callRenderProps(childrenProp, state),\n [childrenProp, state],\n );\n\n return (\n <Provider values={values}>\n <div\n {...mergeProps(overlayProps, focusWithinProps)}\n ref={ref}\n className={classNames?.container}\n style={style}\n >\n <Tabs classNames={classNames?.tabs} {...rest}>\n {children}\n </Tabs>\n </div>\n </Provider>\n );\n}\n\nexport function DrawerTabList<T extends object>(props: DrawerTabListProps<T>) {\n const defaultProps = useDefaultProps(props, 'DrawerTabList');\n\n const {\n children,\n classNames: classNamesProp,\n variant = 'fill',\n } = defaultProps;\n const { anchor } = useContext(DrawerContext);\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp),\n [theme.Drawer, classNamesProp],\n );\n\n const values = useMemo<\n [\n [typeof TooltipContext, ContextValue<TooltipProps, HTMLDivElement>],\n [\n typeof TooltipTargetContext,\n ContextValue<TooltipTargetProps, HTMLDivElement>,\n ],\n ]\n >(\n () => [\n [TooltipContext, { placement: anchor === 'left' ? 'right' : 'left' }],\n [TooltipTargetContext, { focusable: false, relative: 'parent' }],\n ],\n [anchor],\n );\n\n return (\n <Provider values={values}>\n <TabList<T>\n classNames={classNames?.tabs}\n align='center'\n anchor={anchor === 'left' ? 'start' : 'end'}\n orientation='vertical'\n variant={variant}\n >\n {children}\n </TabList>\n </Provider>\n );\n}\n\nexport function DrawerTab(props: DrawerTabProps) {\n const defaultProps = useDefaultProps(props, 'DrawerTab');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n ...rest\n } = defaultProps;\n\n const { isOpen, open, toggle } = useContext(DrawerContext);\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp),\n [theme.Drawer, classNamesProp],\n );\n\n // Must bind to press start (instead of later press events) due to Tab changing selected state on start\n const handlePressStart = useCallback(\n (event: PressEvent) => {\n const { selected } = event.target.parentElement?.dataset ?? {};\n\n if (toBoolean(selected)) {\n toggle();\n } else {\n open();\n }\n },\n [open, toggle],\n );\n\n const children = useCallback(\n (renderProps: TabRenderProps) =>\n callRenderProps(childrenProp, { ...renderProps, isOpen }),\n [childrenProp, isOpen],\n );\n\n return (\n <Tab\n {...rest}\n classNames={classNames?.tabs}\n onPressStart={handlePressStart}\n >\n {children}\n </Tab>\n );\n}\n\nconst defaultMapping: DrawerMapping = {\n heading: {\n child: headings.v4,\n parent: headings.v3,\n },\n back: {\n variant: 'icon',\n },\n close: {\n variant: 'icon',\n },\n};\n\nexport const DrawerDialogContext =\n createContext<ContextValue<DrawerDialogProps, HTMLDivElement>>(null);\n\nexport const DrawerDialog = forwardRef(function DrawerDialog(\n props: DrawerDialogProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(\n props,\n ref,\n DrawerDialogContext,\n );\n\n const {\n children,\n classNames: classNamesProp,\n mapping: mappingProp,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n } = contextProps;\n\n const { close } = useContext(DrawerContext);\n const [backRef, hasBack] = useSlot();\n const [titleRef, hasTitle] = useSlot();\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({ ...defaultMapping, ...mappingProp }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp, {\n header: {\n title: hasBack ? mapping.heading.child : mapping.heading.parent,\n },\n }),\n [theme.Drawer, classNamesProp, hasBack, mapping],\n );\n\n const style = useMemo(\n () =>\n inlineVars(drawerDialogStateVars, {\n isChild: !!hasBack,\n }),\n [hasBack],\n );\n\n const values = useMemo<\n [\n [\n typeof ElementContext,\n ContextValue<\n ElementProps<\n ContextValue<ButtonProps, HTMLButtonElement>,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLHeadingElement>\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?.header,\n values: [\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n back: {\n ...mapping.back,\n ref: backRef,\n classNames: classNames?.header?.back,\n },\n close: {\n ...mapping.close,\n classNames: classNames?.header?.close,\n onPress: close,\n },\n },\n },\n ],\n [\n AriaHeadingContext,\n {\n slots: {\n title: {\n ref: titleRef,\n className: classNames?.header?.title,\n },\n },\n },\n ],\n ],\n },\n content: { className: classNames?.content },\n footer: { as: 'footer', className: classNames?.footer },\n },\n },\n ],\n ],\n [\n classNames?.header?.header,\n classNames?.header?.back,\n classNames?.header?.close,\n classNames?.header?.title,\n classNames?.content,\n classNames?.footer,\n backRef,\n close,\n mapping,\n titleRef,\n ],\n );\n\n // biome-ignore lint/complexity/useSimplifiedLogicExpression: intentional\n if (!ariaLabel && !ariaLabelledBy && !hasTitle) {\n console.warn(\n 'If a Drawer does not contain a <Heading slot=\"title\">, it must have an aria-label or aria-labelledby attribute for accessibility.',\n );\n }\n\n return (\n <Provider values={values}>\n {/** biome-ignore lint/a11y/useAriaPropsSupportedByRole: Legacy */}\n <div\n {...rest}\n ref={contextRef}\n className={classNames?.dialog?.container}\n style={style}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n <div className={classNames?.dialog?.dialog}>{children}</div>\n </div>\n </Provider>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/drawer/index.tsx"],"names":["isOpen","DrawerDialog"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoEA,IAAM,gBAAgB,aAAA,CAAkC;AAAA,EACtD,MAAA,EAAQ,OAAA;AAAA,EACR,WAAA,EAAa,KAAA;AAAA,EACb,MAAA,EAAQ,KAAA;AAAA,EACR,KAAA,EAAO,IAAA;AAAA,EACP,IAAA,EAAM,IAAA;AAAA,EACN,OAAA,EAAS,IAAA;AAAA,EACT,MAAA,EAAQ;AACV,CAAC,CAAA;AAEM,SAAS,OAAO,KAAA,EAAoB;AACzC,EAAA,MAAM,UAAA,GAAa,eAAA,CAAgB,KAAA,EAAO,QAAQ,CAAA;AAElD,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,YAAA;AAAA,IACV,UAAA,EAAY,cAAA;AAAA,IACZ,MAAA,GAAS,OAAA;AAAA,IACT,WAAA,GAAc,KAAA;AAAA,IACd,WAAA,GAAc,KAAA;AAAA,IACd,iBAAA,GAAoB,KAAA;AAAA,IACpB,aAAA,GAAgB,IAAA;AAAA,IAChB,yBAAA,GAA4B,KAAA;AAAA,IAC5B,MAAA,EAAQ,UAAA;AAAA,IACR,YAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,UAAA;AAEJ,EAAA,MAAM,QAAQ,QAAA,EAAS;AACvB,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,CA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CAAC,YAAS,MAAA,EAER,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,QAAA;AAAA,MACL,SAAA,EAAW,YAAY,MAAA,EAAQ,SAAA;AAAA,MAC/B,KAAA;AAAA,MACA,YAAA,EAAY,SAAA;AAAA,MACZ,iBAAA,EAAiB,cAAA;AAAA,MAEjB,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,MAAA,EAAQ,QAAS,QAAA,EAAS;AAAA;AAAA,GACxD,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 { toBoolean } from '@accelint/converters';\nimport { noop } from '@accelint/core';\nimport { useFocusWithin } from '@react-aria/interactions';\nimport { useOverlay } from '@react-aria/overlays';\nimport { useIsSSR } from '@react-aria/ssr';\nimport { useOverlayTriggerState } from '@react-stately/overlays';\nimport {\n createContext,\n type ForwardedRef,\n forwardRef,\n type HTMLAttributes,\n useCallback,\n useContext,\n useMemo,\n useRef,\n} from 'react';\nimport {\n type ContextValue,\n DEFAULT_SLOT,\n Provider,\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 {\n callRenderProps,\n mergeClassNames,\n mergeProps,\n} from '../../utils/props';\nimport { AriaHeadingContext } from '../aria';\nimport { ButtonContext } from '../button';\nimport { ElementContext } from '../element';\nimport { Tab, TabList, Tabs } from '../tabs';\nimport { TooltipContext, TooltipTargetContext } from '../tooltip';\nimport {\n drawerClassNames,\n drawerDialogStateVars,\n drawerStateVars,\n} from './drawer.css';\nimport type { PressEvent } from '@react-types/shared';\nimport type { ButtonProps } from '../button/types';\nimport type { ElementProps } from '../element/types.ts';\nimport type { TabRenderProps } from '../tabs/types';\nimport type { TooltipProps, TooltipTargetProps } from '../tooltip/types';\nimport type {\n DrawerContextValue,\n DrawerDialogProps,\n DrawerMapping,\n DrawerProps,\n DrawerTabListProps,\n DrawerTabProps,\n} from './types';\n\nconst DrawerContext = createContext<DrawerContextValue>({\n anchor: 'right',\n layoutShift: false,\n isOpen: false,\n close: noop,\n open: noop,\n setOpen: noop,\n toggle: noop,\n});\n\nexport function Drawer(props: DrawerProps) {\n const finalProps = useDefaultProps(props, 'Drawer');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n anchor = 'right',\n defaultOpen = false,\n layoutShift = false,\n shouldCloseOnBlur = false,\n isDismissable = true,\n isKeyboardDismissDisabled = false,\n isOpen: isOpenProp,\n onOpenChange,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n const isSSR = useIsSSR();\n\n const classNames = useMemo(\n () => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp),\n [theme.Drawer, classNamesProp],\n );\n\n // Remove focus when Drawer closes\n const handleOpenChange = useCallback(\n (isOpen: boolean) => {\n if (!isOpen) {\n const focused = isSSR ? null : document.activeElement;\n\n if (\n focused &&\n 'blur' in focused &&\n typeof focused.blur === 'function'\n ) {\n focused.blur();\n }\n }\n\n onOpenChange?.(isOpen);\n },\n [isSSR, onOpenChange],\n );\n\n const state = useOverlayTriggerState({\n defaultOpen,\n isOpen: isOpenProp,\n onOpenChange: handleOpenChange,\n });\n\n const { isOpen, close, open } = state;\n const ref = useRef<HTMLDivElement>(null);\n\n const { overlayProps } = useOverlay(\n {\n isOpen,\n shouldCloseOnBlur,\n isDismissable,\n isKeyboardDismissDisabled,\n onClose: close,\n },\n ref,\n );\n\n // TODO: it may be desirable to disallow focus within the closed Drawer instead\n // If focus forces the Drawer open\n const { focusWithinProps } = useFocusWithin({\n onFocusWithin: open,\n });\n\n const context = useMemo(\n () => ({ ...state, anchor, layoutShift }),\n [state, anchor, layoutShift],\n );\n\n const values = useMemo<\n [\n [typeof DrawerContext, DrawerContextValue],\n [\n typeof DrawerDialogContext,\n ContextValue<DrawerDialogProps, HTMLDivElement>,\n ],\n ]\n >(\n () => [\n [DrawerContext, context],\n [DrawerDialogContext, { classNames }],\n ],\n [context, classNames],\n );\n\n const style = useMemo(\n () =>\n inlineVars(drawerStateVars, {\n anchor,\n layoutShift,\n isOpen,\n }),\n [anchor, layoutShift, isOpen],\n );\n\n const children = useMemo(\n () => callRenderProps(childrenProp, state),\n [childrenProp, state],\n );\n\n return (\n <Provider values={values}>\n <div\n {...mergeProps(overlayProps, focusWithinProps)}\n ref={ref}\n className={classNames?.container}\n style={style}\n >\n <Tabs classNames={classNames?.tabs} {...rest}>\n {children}\n </Tabs>\n </div>\n </Provider>\n );\n}\n\nexport function DrawerTabList<T extends object>(props: DrawerTabListProps<T>) {\n const defaultProps = useDefaultProps(props, 'DrawerTabList');\n\n const {\n children,\n classNames: classNamesProp,\n variant = 'fill',\n } = defaultProps;\n const { anchor } = useContext(DrawerContext);\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp),\n [theme.Drawer, classNamesProp],\n );\n\n const values = useMemo<\n [\n [typeof TooltipContext, ContextValue<TooltipProps, HTMLDivElement>],\n [\n typeof TooltipTargetContext,\n ContextValue<TooltipTargetProps, HTMLDivElement>,\n ],\n ]\n >(\n () => [\n [TooltipContext, { placement: anchor === 'left' ? 'right' : 'left' }],\n [TooltipTargetContext, { focusable: false, relative: 'parent' }],\n ],\n [anchor],\n );\n\n return (\n <Provider values={values}>\n <TabList<T>\n classNames={classNames?.tabs}\n align='center'\n anchor={anchor === 'left' ? 'start' : 'end'}\n orientation='vertical'\n variant={variant}\n >\n {children}\n </TabList>\n </Provider>\n );\n}\n\nexport function DrawerTab(props: DrawerTabProps) {\n const defaultProps = useDefaultProps(props, 'DrawerTab');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n ...rest\n } = defaultProps;\n\n const { isOpen, open, toggle } = useContext(DrawerContext);\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp),\n [theme.Drawer, classNamesProp],\n );\n\n // Must bind to press start (instead of later press events) due to Tab changing selected state on start\n const handlePressStart = useCallback(\n (event: PressEvent) => {\n const { selected } = event.target.parentElement?.dataset ?? {};\n\n if (toBoolean(selected)) {\n toggle();\n } else {\n open();\n }\n },\n [open, toggle],\n );\n\n const children = useCallback(\n (renderProps: TabRenderProps) =>\n callRenderProps(childrenProp, { ...renderProps, isOpen }),\n [childrenProp, isOpen],\n );\n\n return (\n <Tab\n {...rest}\n classNames={classNames?.tabs}\n onPressStart={handlePressStart}\n >\n {children}\n </Tab>\n );\n}\n\nconst defaultMapping: DrawerMapping = {\n heading: {\n child: headings.v4,\n parent: headings.v3,\n },\n back: {\n variant: 'icon',\n },\n close: {\n variant: 'icon',\n },\n};\n\nexport const DrawerDialogContext =\n createContext<ContextValue<DrawerDialogProps, HTMLDivElement>>(null);\n\nexport const DrawerDialog = forwardRef(function DrawerDialog(\n props: DrawerDialogProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, finalRef] = useContextProps(\n props,\n ref,\n DrawerDialogContext,\n );\n\n const {\n children,\n classNames: classNamesProp,\n mapping: mappingProp,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n } = contextProps;\n\n const { close } = useContext(DrawerContext);\n const [backRef, hasBack] = useSlot();\n const [titleRef, hasTitle] = useSlot();\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({ ...defaultMapping, ...mappingProp }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp, {\n header: {\n title: hasBack ? mapping.heading.child : mapping.heading.parent,\n },\n }),\n [theme.Drawer, classNamesProp, hasBack, mapping],\n );\n\n const style = useMemo(\n () =>\n inlineVars(drawerDialogStateVars, {\n isChild: !!hasBack,\n }),\n [hasBack],\n );\n\n const values = useMemo<\n [\n [\n typeof ElementContext,\n ContextValue<\n ElementProps<\n ContextValue<ButtonProps, HTMLButtonElement>,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLHeadingElement>\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?.header,\n values: [\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n back: {\n ...mapping.back,\n ref: backRef,\n classNames: classNames?.header?.back,\n },\n close: {\n ...mapping.close,\n classNames: classNames?.header?.close,\n onPress: close,\n },\n },\n },\n ],\n [\n AriaHeadingContext,\n {\n slots: {\n title: {\n ref: titleRef,\n className: classNames?.header?.title,\n },\n },\n },\n ],\n ],\n },\n content: { className: classNames?.content },\n footer: { as: 'footer', className: classNames?.footer },\n },\n },\n ],\n ],\n [\n classNames?.header?.header,\n classNames?.header?.back,\n classNames?.header?.close,\n classNames?.header?.title,\n classNames?.content,\n classNames?.footer,\n backRef,\n close,\n mapping,\n titleRef,\n ],\n );\n\n // biome-ignore lint/complexity/useSimplifiedLogicExpression: intentional\n if (!ariaLabel && !ariaLabelledBy && !hasTitle) {\n console.warn(\n 'If a Drawer does not contain a <Heading slot=\"title\">, it must have an aria-label or aria-labelledby attribute for accessibility.',\n );\n }\n\n return (\n <Provider values={values}>\n {/** biome-ignore lint/a11y/useAriaPropsSupportedByRole: Legacy */}\n <div\n {...rest}\n ref={finalRef}\n className={classNames?.dialog?.container}\n style={style}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n <div className={classNames?.dialog?.dialog}>{children}</div>\n </div>\n </Provider>\n );\n});\n"]}
@@ -7,13 +7,9 @@ import { jsx } from 'react/jsx-runtime';
7
7
 
8
8
  var ElementContext = createContext(null);
9
9
  var Element = forwardRef(function Element2(props, ref) {
10
- const [contextProps, contextRef] = useContextProps(
11
- props,
12
- ref,
13
- ElementContext
14
- );
15
- const { as: El = "div", values, mergeValues, ...rest } = contextProps;
16
- let children = /* @__PURE__ */ jsx(El, { ...rest, ref: contextRef });
10
+ const [finalProps, finalRef] = useContextProps(props, ref, ElementContext);
11
+ const { as: El = "div", values, mergeValues, ...rest } = finalProps;
12
+ let children = /* @__PURE__ */ jsx(El, { ...rest, ref: finalRef });
17
13
  if (mergeValues) {
18
14
  children = /* @__PURE__ */ jsx(MergeProvider, { values: mergeValues, children });
19
15
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/element/index.tsx"],"names":["Element"],"mappings":";;;;;;;AAmBO,IAAM,cAAA,GACX,cAKE,IAAI;AASD,IAAM,OAAA,GAAU,UAAA,CAAW,SAASA,QAAAA,CAazC,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,YAAA,EAAc,UAAU,CAAA,GAAI,eAAA;AAAA,IACjC,KAAA;AAAA,IACA,GAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,EAAE,IAAI,EAAA,GAAK,KAAA,EAAO,QAAQ,WAAA,EAAa,GAAG,MAAK,GAAI,YAAA;AAGzD,EAAA,IAAI,2BAAW,GAAA,CAAC,EAAA,EAAA,EAAI,GAAG,IAAA,EAAM,KAAK,UAAA,EAAY,CAAA;AAE9C,EAAA,IAAI,WAAA,EAAa;AACf,IAAA,QAAA,mBAAW,GAAA,CAAC,aAAA,EAAA,EAAc,MAAA,EAAQ,WAAA,EAAc,QAAA,EAAS,CAAA;AAAA,EAC3D;AAEA,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,QAAA,mBAAW,GAAA,CAAC,QAAA,EAAA,EAAS,MAAA,EAAiB,QAAA,EAAS,CAAA;AAAA,EACjD;AAEA,EAAA,OAAO,QAAA;AACT,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/** biome-ignore-all lint/suspicious/noExplicitAny: ElementProps is a unique case */\n\nimport { createContext, type ForwardedRef, forwardRef } from 'react';\nimport { type ContextValue, Provider } from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { MergeProvider } from '../merge-provider';\nimport type { ElementProps } from './types';\n\nexport const ElementContext =\n createContext<\n ContextValue<\n ElementProps<any, any, any, any, any, any, any, any, any, any, any>,\n HTMLElement\n >\n >(null);\n\n/**\n * This generic component serves as any easy way for more complex components\n * to establish stylable content areas within their layout with optional\n * targeted contexts for any subcomponents\n *\n * See Dialog & Drawer as examples\n */\nexport const Element = forwardRef(function Element<\n A,\n B,\n C,\n D,\n E,\n F,\n G,\n H,\n I,\n J,\n K,\n>(\n props: ElementProps<A, B, C, D, E, F, G, H, I, J, K>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [contextProps, contextRef] = useContextProps(\n props,\n ref,\n ElementContext,\n );\n\n const { as: El = 'div', values, mergeValues, ...rest } = contextProps;\n\n // @ts-expect-error Can't narrow props type to match element or ref, making this less dynamic runs into union complexity and performance issues\n let children = <El {...rest} ref={contextRef} />;\n\n if (mergeValues) {\n children = <MergeProvider values={mergeValues}>{children}</MergeProvider>;\n }\n\n if (values) {\n children = <Provider values={values}>{children}</Provider>;\n }\n\n return children;\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/element/index.tsx"],"names":["Element"],"mappings":";;;;;;;AAmBO,IAAM,cAAA,GACX,cAKE,IAAI;AASD,IAAM,OAAA,GAAU,UAAA,CAAW,SAASA,QAAAA,CAazC,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,UAAA,EAAY,QAAQ,IAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,cAAc,CAAA;AAEzE,EAAA,MAAM,EAAE,IAAI,EAAA,GAAK,KAAA,EAAO,QAAQ,WAAA,EAAa,GAAG,MAAK,GAAI,UAAA;AAGzD,EAAA,IAAI,2BAAW,GAAA,CAAC,EAAA,EAAA,EAAI,GAAG,IAAA,EAAM,KAAK,QAAA,EAAU,CAAA;AAE5C,EAAA,IAAI,WAAA,EAAa;AACf,IAAA,QAAA,mBAAW,GAAA,CAAC,aAAA,EAAA,EAAc,MAAA,EAAQ,WAAA,EAAc,QAAA,EAAS,CAAA;AAAA,EAC3D;AAEA,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,QAAA,mBAAW,GAAA,CAAC,QAAA,EAAA,EAAS,MAAA,EAAiB,QAAA,EAAS,CAAA;AAAA,EACjD;AAEA,EAAA,OAAO,QAAA;AACT,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/** biome-ignore-all lint/suspicious/noExplicitAny: ElementProps is a unique case */\n\nimport { createContext, type ForwardedRef, forwardRef } from 'react';\nimport { type ContextValue, Provider } from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { MergeProvider } from '../merge-provider';\nimport type { ElementProps } from './types';\n\nexport const ElementContext =\n createContext<\n ContextValue<\n ElementProps<any, any, any, any, any, any, any, any, any, any, any>,\n HTMLElement\n >\n >(null);\n\n/**\n * This generic component serves as any easy way for more complex components\n * to establish stylable content areas within their layout with optional\n * targeted contexts for any subcomponents\n *\n * See Dialog & Drawer as examples\n */\nexport const Element = forwardRef(function Element<\n A,\n B,\n C,\n D,\n E,\n F,\n G,\n H,\n I,\n J,\n K,\n>(\n props: ElementProps<A, B, C, D, E, F, G, H, I, J, K>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [finalProps, finalRef] = useContextProps(props, ref, ElementContext);\n\n const { as: El = 'div', values, mergeValues, ...rest } = finalProps;\n\n // @ts-expect-error Can't narrow props type to match element or ref, making this less dynamic runs into union complexity and performance issues\n let children = <El {...rest} ref={finalRef} />;\n\n if (mergeValues) {\n children = <MergeProvider values={mergeValues}>{children}</MergeProvider>;\n }\n\n if (values) {\n children = <Provider values={values}>{children}</Provider>;\n }\n\n return children;\n});\n"]}
@@ -4,11 +4,13 @@ import { ProviderValues } from '../../types/react-aria.js';
4
4
 
5
5
  /** biome-ignore-all lint/suspicious/noExplicitAny: ElementProps is a special case */
6
6
 
7
- type ElementProps<A = any, B = any, C = any, D = any, E = any, F = any, G = any, H = any, I = any, J = any, K = any> = /**
7
+ type ElementProps<A = any, B = any, C = any, D = any, E = any, F = any, G = any, H = any, I = any, J = any, K = any> =
8
+ /**
8
9
  * Initially tried to make these props generic and constrain props to element
9
10
  * passed into generic, but ran into major performance issues with enormous
10
11
  * type unions of all possible HTML elements props. It breaks all of TS
11
- */ JSX.IntrinsicElements[HTMLElementType] & SlotProps & {
12
+ */
13
+ JSX.IntrinsicElements[HTMLElementType] & SlotProps & {
12
14
  /**
13
15
  * The HTML element to be rendered
14
16
  */
@@ -14,7 +14,7 @@ var GroupContext = (
14
14
  createContext(null)
15
15
  );
16
16
  var Group = forwardRef(function Group2(props, ref) {
17
- const [contextProps, contextRef] = useContextProps(props, ref, GroupContext);
17
+ const [finalProps, finalRef] = useContextProps(props, ref, GroupContext);
18
18
  const {
19
19
  children: childrenProp,
20
20
  classNames: classNamesProp,
@@ -22,7 +22,7 @@ var Group = forwardRef(function Group2(props, ref) {
22
22
  orientation = "horizontal",
23
23
  reverse = false,
24
24
  values: valuesProp
25
- } = contextProps;
25
+ } = finalProps;
26
26
  const theme = useTheme();
27
27
  const classNames = useMemo(
28
28
  () => mergeClassNames(groupClassNames, theme.Group, classNamesProp),
@@ -52,8 +52,8 @@ var Group = forwardRef(function Group2(props, ref) {
52
52
  }, [childrenProp, orientation, reverse]);
53
53
  const values = useMemo(() => [[context, valuesProp]], [context, valuesProp]);
54
54
  const children = useMemo(
55
- () => /* @__PURE__ */ jsx("div", { ref: contextRef, className: classNames?.container, style, children: /* @__PURE__ */ jsx("div", { className: classNames?.group, children: childrenProp }) }),
56
- [contextRef, classNames?.container, classNames?.group, style, childrenProp]
55
+ () => /* @__PURE__ */ jsx("div", { ref: finalRef, className: classNames?.container, style, children: /* @__PURE__ */ jsx("div", { className: classNames?.group, children: childrenProp }) }),
56
+ [finalRef, classNames?.container, classNames?.group, style, childrenProp]
57
57
  );
58
58
  return context && valuesProp ? /* @__PURE__ */ jsx(MergeProvider, { values, children }) : children;
59
59
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/group/index.tsx"],"names":["Group","type"],"mappings":";;;;;;;;;;AA6BO,IAAM,YAAA;AAAA;AAAA;AAAA,EAGX,cAAsE,IAAI;AAAA;AAOrE,IAAM,KAAA,GAAQ,UAAA,CAAW,SAASA,MAAAA,CACvC,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,YAAA,EAAc,UAAU,IAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,YAAY,CAAA;AAE3E,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,YAAA;AAAA,IACV,UAAA,E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AA,MACA;AAAA,KACD,CAAA;AAAA,EACH,CAAA,EAAG,CAAC,YAAA,EAAc,WAAA,EAAa,OAAO,CAAC,CAAA;AAEvC,EAAA,MAAM,MAAA,GAAS,OAAA,CAGb,MAAM,CAAC,CAAC,OAAA,EAAU,UAAU,CAAC,CAAA,EAAG,CAAC,OAAA,EAAS,UAAU,CAAC,CAAA;AAEvD,EAAA,MAAM,QAAA,GAAW,OAAA;AAAA,IACf,sBACE,GAAA,CAAC,KAAA,EAAA,EAAI,GAAA,EAAK,YAAY,SAAA,EAAW,UAAA,EAAY,SAAA,EAAW,KAAA,EACtD,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,KAAA,EAAQ,wBAAa,CAAA,EACnD,CAAA;AAAA,IAEF,CAAC,UAAA,EAAY,UAAA,EAAY,WAAW,UAAA,EAAY,KAAA,EAAO,OAAO,YAAY;AAAA,GAC5E;AAEA,EAAA,OAAO,WAAW,UAAA,mBAChB,GAAA,CAAC,aAAA,EAAA,EAAc,MAAA,EAAiB,UAAS,CAAA,GAEzC,QAAA;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 Children,\n createContext,\n type ForwardedRef,\n forwardRef,\n type ReactElement,\n useMemo,\n} from 'react';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useTheme } from '../../hooks/use-theme';\nimport { inlineVars } from '../../utils/css';\nimport { mergeClassNames } from '../../utils/props';\nimport { MergeProvider } from '../merge-provider';\nimport { groupClassNames, groupStateVars } from './group.css';\nimport type { ContextValue } from 'react-aria-components';\nimport type { GroupProps } from './types';\n\nexport const GroupContext =\n // Unfortunately, using \"unknown\" or \"object\" here creates complex type issues with <Provider />\n // biome-ignore lint/suspicious/noExplicitAny: Legacy\n createContext<ContextValue<GroupProps<any, Element>, HTMLDivElement>>(null);\n\n/**\n * This generic component allows for collective prop distribution to a collection of components of the same type\n *\n * @example A list of <Button />s and you want to control their size instead of passing the same props to each\n */\nexport const Group = forwardRef(function Group<T, E extends Element>(\n props: GroupProps<T, E>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(props, ref, GroupContext);\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n context,\n orientation = 'horizontal',\n reverse = false,\n values: valuesProp,\n } = contextProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(groupClassNames, theme.Group, classNamesProp),\n [theme.Group, classNamesProp],\n );\n\n const style = useMemo(() => {\n const types = Children.toArray(childrenProp).reduce<Set<string>>(\n (acc, child) => {\n if (\n child &&\n typeof child !== 'boolean' &&\n typeof child !== 'number' &&\n typeof child !== 'string'\n ) {\n const type = (child as ReactElement).type;\n // @ts-expect-error TS doesn't know about \"render\" type\n const name = typeof type !== 'string' ? type.render?.name : type;\n\n if (name) {\n acc.add(name);\n }\n }\n\n return acc;\n },\n new Set<string>(),\n );\n\n const type = { 0: 'Empty', 1: [...types].at(0) }[types.size] ?? 'Mixed';\n\n return inlineVars(groupStateVars, {\n count: Children.count(childrenProp),\n orientation,\n reverse,\n type,\n });\n }, [childrenProp, orientation, reverse]);\n\n const values = useMemo<\n [[Exclude<typeof context, undefined>, ContextValue<T, E>]]\n // biome-ignore lint/style/noNonNullAssertion: intentional\n >(() => [[context!, valuesProp]], [context, valuesProp]);\n\n const children = useMemo(\n () => (\n <div ref={contextRef} className={classNames?.container} style={style}>\n <div className={classNames?.group}>{childrenProp}</div>\n </div>\n ),\n [contextRef, classNames?.container, classNames?.group, style, childrenProp],\n );\n\n return context && valuesProp ? (\n <MergeProvider values={values}>{children}</MergeProvider>\n ) : (\n children\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/group/index.tsx"],"names":["Group","type"],"mappings":";;;;;;;;;;AA6BO,IAAM,YAAA;AAAA;AAAA;AAAA,EAGX,cAAsE,IAAI;AAAA;AAOrE,IAAM,KAAA,GAAQ,UAAA,CAAW,SAASA,MAAAA,CACvC,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,UAAA,EAAY,QAAQ,IAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,YAAY,CAAA;AAEvE,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,YAAA;AAAA,IACV,UAAA,EAAY,cAAA;AAAA,IACZ,OAAA;AAAA,IACA,WAAA,GAAc,YAAA;AAAA,IACd,OAAA,GAAU,KAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV,GAAI,UAAA;AAEJ,EAAA,MAAM,QAAQ,QAAA,EAAS;AAEvB,EAAA,MAAM,UAAA,GAAa,OAAA;AAAA,IACjB,MAAM,eAAA,CAAgB,eAAA,EAAiB,KAAA,CAAM,OAAO,cAAc,CAAA;AAAA,IAClE,CAAC,KAAA,CAAM,KAAA,EAAO,cAAc;AAAA,GAC9B;AAEA,EAAA,MAAM,KAAA,GAAQ,QAAQ,MAAM;AAC1B,IAAA,MAAM,KAAA,GAAQ,QAAA,CAAS,OAAA,CAAQ,YAAY,CAAA,CAAE,MAAA;AAAA,MAC3C,CAAC,KAAK,KAAA,KAAU;AACd,QAAA,IACE,KAAA,IACA,OAAO,KAAA,KAAU,SAAA,IACjB,OAAO,KAAA,KAAU,QAAA,IACjB,OAAO,KAAA,KAAU,QAAA,EACjB;AACA,UAAA,MAAMC,QAAQ,KAAA,CAAuB,IAAA;AAErC,UAAA,MAAM,OAAO,OAAOA,KAAAA,KAAS,QAAA,GAAWA,KAAAA,CAAK,QAAQ,IAAA,GAAOA,KAAAA;AAE5D,UAAA,IAAI,IAAA,EAAM;AACR,YAAA,GAAA,CAAI,IAAI,IAAI,CAAA;AAAA,UACd;AAAA,QACF;AAEA,QAAA,OAAO,GAAA;AAAA,MACT,CAAA;AAAA,0BACI,GAAA;AAAY,KAClB;AAEA,IAAA,MAAM,IAAA,GAAO,EAAE,CAAA,EAAG,OAAA,EAAS,GAAG,CAAC,GAAG,KAAK,CAAA,CAAE,GAAG,CAAC,CAAA,EAAE,CAAE,KAAA,CAAM,IAAI,CAAA,IAAK,OAAA;AAEhE,IAAA,OAAO,WAAW,cAAA,EAAgB;AAAA,MAChC,KAAA,EAAO,QAAA,CAAS,KAAA,CAAM,YAAY,CAAA;AAAA,MAClC,WAAA;AAAA,MACA,OAAA;AAAA,MACA;AAAA,KACD,CAAA;AAAA,EACH,CAAA,EAAG,CAAC,YAAA,EAAc,WAAA,EAAa,OAAO,CAAC,CAAA;AAEvC,EAAA,MAAM,MAAA,GAAS,OAAA,CAGb,MAAM,CAAC,CAAC,OAAA,EAAU,UAAU,CAAC,CAAA,EAAG,CAAC,OAAA,EAAS,UAAU,CAAC,CAAA;AAEvD,EAAA,MAAM,QAAA,GAAW,OAAA;AAAA,IACf,sBACE,GAAA,CAAC,KAAA,EAAA,EAAI,GAAA,EAAK,UAAU,SAAA,EAAW,UAAA,EAAY,SAAA,EAAW,KAAA,EACpD,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,KAAA,EAAQ,wBAAa,CAAA,EACnD,CAAA;AAAA,IAEF,CAAC,QAAA,EAAU,UAAA,EAAY,WAAW,UAAA,EAAY,KAAA,EAAO,OAAO,YAAY;AAAA,GAC1E;AAEA,EAAA,OAAO,WAAW,UAAA,mBAChB,GAAA,CAAC,aAAA,EAAA,EAAc,MAAA,EAAiB,UAAS,CAAA,GAEzC,QAAA;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 Children,\n createContext,\n type ForwardedRef,\n forwardRef,\n type ReactElement,\n useMemo,\n} from 'react';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useTheme } from '../../hooks/use-theme';\nimport { inlineVars } from '../../utils/css';\nimport { mergeClassNames } from '../../utils/props';\nimport { MergeProvider } from '../merge-provider';\nimport { groupClassNames, groupStateVars } from './group.css';\nimport type { ContextValue } from 'react-aria-components';\nimport type { GroupProps } from './types';\n\nexport const GroupContext =\n // Unfortunately, using \"unknown\" or \"object\" here creates complex type issues with <Provider />\n // biome-ignore lint/suspicious/noExplicitAny: Legacy\n createContext<ContextValue<GroupProps<any, Element>, HTMLDivElement>>(null);\n\n/**\n * This generic component allows for collective prop distribution to a collection of components of the same type\n *\n * @example A list of <Button />s and you want to control their size instead of passing the same props to each\n */\nexport const Group = forwardRef(function Group<T, E extends Element>(\n props: GroupProps<T, E>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [finalProps, finalRef] = useContextProps(props, ref, GroupContext);\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n context,\n orientation = 'horizontal',\n reverse = false,\n values: valuesProp,\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(groupClassNames, theme.Group, classNamesProp),\n [theme.Group, classNamesProp],\n );\n\n const style = useMemo(() => {\n const types = Children.toArray(childrenProp).reduce<Set<string>>(\n (acc, child) => {\n if (\n child &&\n typeof child !== 'boolean' &&\n typeof child !== 'number' &&\n typeof child !== 'string'\n ) {\n const type = (child as ReactElement).type;\n // @ts-expect-error TS doesn't know about \"render\" type\n const name = typeof type !== 'string' ? type.render?.name : type;\n\n if (name) {\n acc.add(name);\n }\n }\n\n return acc;\n },\n new Set<string>(),\n );\n\n const type = { 0: 'Empty', 1: [...types].at(0) }[types.size] ?? 'Mixed';\n\n return inlineVars(groupStateVars, {\n count: Children.count(childrenProp),\n orientation,\n reverse,\n type,\n });\n }, [childrenProp, orientation, reverse]);\n\n const values = useMemo<\n [[Exclude<typeof context, undefined>, ContextValue<T, E>]]\n // biome-ignore lint/style/noNonNullAssertion: intentional\n >(() => [[context!, valuesProp]], [context, valuesProp]);\n\n const children = useMemo(\n () => (\n <div ref={finalRef} className={classNames?.container} style={style}>\n <div className={classNames?.group}>{childrenProp}</div>\n </div>\n ),\n [finalRef, classNames?.container, classNames?.group, style, childrenProp],\n );\n\n return context && valuesProp ? (\n <MergeProvider values={values}>{children}</MergeProvider>\n ) : (\n children\n );\n});\n"]}
@@ -10,7 +10,7 @@ import { jsx } from 'react/jsx-runtime';
10
10
 
11
11
  var IconContext = createContext(null);
12
12
  var Icon = forwardRef(function Icon2(props, ref) {
13
- const [contextProps, contextRef] = useContextProps(props, ref, IconContext);
13
+ const [contextProps, finalRef] = useContextProps(props, ref, IconContext);
14
14
  const finalProps = useDefaultProps(contextProps, "Icon");
15
15
  const {
16
16
  children,
@@ -34,7 +34,7 @@ var Icon = forwardRef(function Icon2(props, ref) {
34
34
  }),
35
35
  [color, fill, size, stroke]
36
36
  );
37
- return /* @__PURE__ */ jsx("div", { ref: contextRef, className: classNames?.container, style, children: /* @__PURE__ */ jsx("div", { className: classNames?.icon, children }) });
37
+ return /* @__PURE__ */ jsx("div", { ref: finalRef, className: classNames?.container, style, children: /* @__PURE__ */ jsx("div", { className: classNames?.icon, children }) });
38
38
  });
39
39
 
40
40
  export { Icon, IconContext };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/icon/index.tsx"],"names":["Icon"],"mappings":";;;;;;;;;;AAsBO,IAAM,WAAA,GACX,cAAuD,IAAI;AAEtD,IAAM,IAAA,GAAO,UAAA,CAAW,SAASA,KAAAA,CACtC,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,YAAA,EAAc,UAAU,IAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,WAAW,CAAA;AAE1E,EAAA,MAAM,UAAA,GAAa,eAAA,CAAgB,YAAA,EAAc,MAAM,CAAA;AAEvD,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,UAAA,EAAY,cAAA;AAAA,IACZ,KAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA,GAAO,UAAA;AAAA,IACP;AAAA,GACF,GAAI,UAAA;AAEJ,EAAA,MAAM,QAAQ,QAAA,EAAS;AAEvB,EAAA,MAAM,UAAA,GAAa,OAAA;AAAA,IACjB,MAAM,eAAA,CAAgB,cAAA,EAAgB,KAAA,CAAM,MAAM,cAAc,CAAA;AAAA,IAChE,CAAC,KAAA,CAAM,IAAA,EAAM,cAAc;AAAA,GAC7B;AAEA,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,MACE,WAAW,aAAA,EAAe;AAAA,MACxB,KAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MACA;AAAA,KACD,CAAA;AAAA,IACH,CAAC,KAAA,EAAO,IAAA,EAAM,IAAA,EAAM,MAAM;AAAA,GAC5B;AAEA,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,GAAA,EAAK,UAAA,EAAY,WAAW,UAAA,EAAY,SAAA,EAAW,KAAA,EACtD,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,IAAA,EAAO,UAAS,CAAA,EAC9C,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 { createContext, type ForwardedRef, forwardRef, useMemo } from 'react';\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 { mergeClassNames } from '../../utils/props';\nimport { iconClassNames, iconStateVars } from './icon.css';\nimport type { ContextValue } from 'react-aria-components';\nimport type { IconProps } from './types';\n\nexport const IconContext =\n createContext<ContextValue<IconProps, HTMLDivElement>>(null);\n\nexport const Icon = forwardRef(function Icon(\n props: IconProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(props, ref, IconContext);\n\n const finalProps = useDefaultProps(contextProps, 'Icon');\n\n const {\n children,\n classNames: classNamesProp,\n color,\n fill,\n size = 'relative',\n stroke,\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(iconClassNames, theme.Icon, classNamesProp),\n [theme.Icon, classNamesProp],\n );\n\n const style = useMemo(\n () =>\n inlineVars(iconStateVars, {\n color,\n fill,\n size,\n stroke,\n }),\n [color, fill, size, stroke],\n );\n\n return (\n <div ref={contextRef} className={classNames?.container} style={style}>\n <div className={classNames?.icon}>{children}</div>\n </div>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/icon/index.tsx"],"names":["Icon"],"mappings":";;;;;;;;;;AAsBO,IAAM,WAAA,GACX,cAAuD,IAAI;AAEtD,IAAM,IAAA,GAAO,UAAA,CAAW,SAASA,KAAAA,CACtC,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,YAAA,EAAc,QAAQ,IAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,WAAW,CAAA;AACxE,EAAA,MAAM,UAAA,GAAa,eAAA,CAAgB,YAAA,EAAc,MAAM,CAAA;AAEvD,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,UAAA,EAAY,cAAA;AAAA,IACZ,KAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA,GAAO,UAAA;AAAA,IACP;AAAA,GACF,GAAI,UAAA;AAEJ,EAAA,MAAM,QAAQ,QAAA,EAAS;AAEvB,EAAA,MAAM,UAAA,GAAa,OAAA;AAAA,IACjB,MAAM,eAAA,CAAgB,cAAA,EAAgB,KAAA,CAAM,MAAM,cAAc,CAAA;AAAA,IAChE,CAAC,KAAA,CAAM,IAAA,EAAM,cAAc;AAAA,GAC7B;AAEA,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,MACE,WAAW,aAAA,EAAe;AAAA,MACxB,KAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MACA;AAAA,KACD,CAAA;AAAA,IACH,CAAC,KAAA,EAAO,IAAA,EAAM,IAAA,EAAM,MAAM;AAAA,GAC5B;AAEA,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,GAAA,EAAK,QAAA,EAAU,WAAW,UAAA,EAAY,SAAA,EAAW,KAAA,EACpD,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,IAAA,EAAO,UAAS,CAAA,EAC9C,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 { createContext, type ForwardedRef, forwardRef, useMemo } from 'react';\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 { mergeClassNames } from '../../utils/props';\nimport { iconClassNames, iconStateVars } from './icon.css';\nimport type { ContextValue } from 'react-aria-components';\nimport type { IconProps } from './types';\n\nexport const IconContext =\n createContext<ContextValue<IconProps, HTMLDivElement>>(null);\n\nexport const Icon = forwardRef(function Icon(\n props: IconProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, finalRef] = useContextProps(props, ref, IconContext);\n const finalProps = useDefaultProps(contextProps, 'Icon');\n\n const {\n children,\n classNames: classNamesProp,\n color,\n fill,\n size = 'relative',\n stroke,\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(iconClassNames, theme.Icon, classNamesProp),\n [theme.Icon, classNamesProp],\n );\n\n const style = useMemo(\n () =>\n inlineVars(iconStateVars, {\n color,\n fill,\n size,\n stroke,\n }),\n [color, fill, size, stroke],\n );\n\n return (\n <div ref={finalRef} className={classNames?.container} style={style}>\n <div className={classNames?.icon}>{children}</div>\n </div>\n );\n});\n"]}
@@ -25,19 +25,19 @@ var defaultMapping = {
25
25
  };
26
26
  var InputContext = createContext(null);
27
27
  var Input = forwardRef(function Input2(props, ref) {
28
- const [contextProps1, contextRef1] = useContextProps(
28
+ const [duplicateContextProps, contextRef] = useContextProps(
29
29
  props,
30
30
  ref,
31
31
  InputContext$1
32
32
  );
33
- contextProps1.className = void 0;
34
- contextProps1.style = void 0;
35
- const [contextProps2, contextRef2] = useContextProps(
36
- contextProps1,
37
- contextRef1,
33
+ duplicateContextProps.className = void 0;
34
+ duplicateContextProps.style = void 0;
35
+ const [contextProps, finalRef] = useContextProps(
36
+ duplicateContextProps,
37
+ contextRef,
38
38
  InputContext
39
39
  );
40
- const defaultProps = useDefaultProps(contextProps2, "Input");
40
+ const finalProps = useDefaultProps(contextProps, "Input");
41
41
  const {
42
42
  classNames: classNamesProp,
43
43
  defaultValue = "",
@@ -55,14 +55,14 @@ var Input = forwardRef(function Input2(props, ref) {
55
55
  onHoverEnd,
56
56
  "aria-invalid": ariaInvalid,
57
57
  ...rest
58
- } = defaultProps;
58
+ } = finalProps;
59
59
  const [value, setValue] = useControlledState(valueProp, defaultValue);
60
60
  const length = (`${value ?? ""}`.length || placeholder?.length) ?? 0;
61
61
  const isInvalid = !!ariaInvalid && ariaInvalid !== "false";
62
62
  const isPlaceholder = !!placeholder && !value;
63
63
  const isEmpty = !value;
64
64
  const { isFocused, isFocusVisible, focusProps } = useFocusRing({
65
- autoFocus: defaultProps.autoFocus,
65
+ autoFocus: finalProps.autoFocus,
66
66
  isTextInput: true
67
67
  });
68
68
  const { hoverProps, isHovered } = useHover({
@@ -134,7 +134,7 @@ var Input = forwardRef(function Input2(props, ref) {
134
134
  "input",
135
135
  {
136
136
  ...mergedProps,
137
- ref: contextRef2,
137
+ ref: finalRef,
138
138
  className: classNames?.input,
139
139
  disabled: isDisabled,
140
140
  placeholder,
@@ -1 +1 @@
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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AA;AAAA,MACA,UAAA;AAAA,MACA;AAAA;AACF,GACF;AAEA,EAAA,MAAM,YAAA,GAAe,WAAA;AAAA,IACnB,CAAC,KAAA,KAAyC;AACxC,MAAA,QAAA,GAAW,KAAK,CAAA;AAEhB,MAAA,IAAI,CAAC,MAAM,gBAAA,EAAkB;AAC3B,QAAA,QAAA,CAAS,KAAA,CAAM,OAAO,KAAK,CAAA;AAAA,MAC7B;AAAA,IACF,CAAA;AAAA,IACA,CAAC,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
+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,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 [duplicateContextProps, contextRef] = 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 (duplicateContextProps as RACInputProps).className = undefined;\n (duplicateContextProps 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 [contextProps, finalRef] = useContextProps(\n duplicateContextProps,\n contextRef,\n InputContext,\n );\n\n const finalProps = useDefaultProps(contextProps, '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 } = finalProps;\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: finalProps.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={finalRef}\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"]}
@@ -35,8 +35,8 @@ var defaultMapping = {
35
35
  var defaultSize = "lg";
36
36
  var MenuContext = createContext(null);
37
37
  var Menu = forwardRef(function Menu2(props, ref) {
38
- const [mergedProps, mergedRef] = useContextProps(props, ref, MenuContext);
39
- const finalProps = useDefaultProps(mergedProps, "Menu");
38
+ const [contextProps, finalRef] = useContextProps(props, ref, MenuContext);
39
+ const finalProps = useDefaultProps(contextProps, "Menu");
40
40
  const {
41
41
  children: childrenProp,
42
42
  classNames: classNamesProp,
@@ -86,7 +86,7 @@ var Menu = forwardRef(function Menu2(props, ref) {
86
86
  Popover,
87
87
  {
88
88
  ...rest,
89
- ref: mergedRef,
89
+ ref: finalRef,
90
90
  className: classNames?.menu?.container,
91
91
  style,
92
92
  children
@@ -95,8 +95,8 @@ var Menu = forwardRef(function Menu2(props, ref) {
95
95
  });
96
96
  var MenuListContext = createContext(null);
97
97
  var MenuList = forwardRef(function MenuList2(props, ref) {
98
- const [mergedProps, mergedRef] = useContextProps(props, ref, MenuListContext);
99
- const finalProps = useDefaultProps(mergedProps, "Menu");
98
+ const [contextProps, finalRef] = useContextProps(props, ref, MenuListContext);
99
+ const finalProps = useDefaultProps(contextProps, "Menu");
100
100
  const {
101
101
  children: childrenProp,
102
102
  classNames: classNamesProp,
@@ -146,7 +146,7 @@ var MenuList = forwardRef(function MenuList2(props, ref) {
146
146
  Menu$1,
147
147
  {
148
148
  ...rest,
149
- ref: mergedRef,
149
+ ref: finalRef,
150
150
  className: classNames?.list?.container,
151
151
  items,
152
152
  selectionMode,
@@ -158,8 +158,8 @@ var MenuList = forwardRef(function MenuList2(props, ref) {
158
158
  });
159
159
  var MenuItemContext = createContext(null);
160
160
  var MenuItem = forwardRef(function MenuItem2(props, ref) {
161
- const [mergedProps, mergedRef] = useContextProps(props, ref, MenuItemContext);
162
- const finalProps = useDefaultProps(mergedProps, "MenuItem");
161
+ const [contextProps, finalRef] = useContextProps(props, ref, MenuItemContext);
162
+ const finalProps = useDefaultProps(contextProps, "MenuItem");
163
163
  const {
164
164
  id,
165
165
  children: childrenProp,
@@ -243,7 +243,7 @@ var MenuItem = forwardRef(function MenuItem2(props, ref) {
243
243
  {
244
244
  ...rest,
245
245
  id: id ?? textValue,
246
- ref: mergedRef,
246
+ ref: finalRef,
247
247
  className: classNames?.item?.container,
248
248
  style,
249
249
  textValue,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/menu/index.tsx"],"names":["Menu","MenuList","RACMenu","MenuItem","RACMenuItem"],"mappings":";;;;;;;;;;;;;;;;AAgEA,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,EAAA;AAAA,IACb,IAAI,QAAA,CAAS;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI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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 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<object>, 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<object>, HTMLDivElement>>(null);\n\ntype MenuListContexts = [\n [typeof MenuItemContext, ContextValue<MenuItemProps<object>, HTMLDivElement>],\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 Type '{ readonly collection: Collection<Node<object>>; }' is missing the following properties from type 'TreeState<any>': disabledKeys, expandedKeys, toggleKey, setExpandedKeys, selectionManager ts\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<object>, 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 React.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","RACMenu","MenuItem","RACMenuItem"],"mappings":";;;;;;;;;;;;;;;;AAgEA,IAAM,cAA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B,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,QAAA;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 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 [contextProps, finalRef] = useContextProps(props, ref, MenuContext);\n const finalProps = useDefaultProps(contextProps, '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<object>, 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={finalRef}\n className={classNames?.menu?.container}\n style={style}\n >\n {children}\n </Popover>\n );\n});\n\nexport const MenuListContext =\n createContext<ContextValue<MenuListProps<object>, HTMLDivElement>>(null);\n\ntype MenuListContexts = [\n [typeof MenuItemContext, ContextValue<MenuItemProps<object>, HTMLDivElement>],\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 [contextProps, finalRef] = useContextProps(props, ref, MenuListContext);\n const finalProps = useDefaultProps(contextProps, '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 Type '{ readonly collection: Collection<Node<object>>; }' is missing the following properties from type 'TreeState<any>': disabledKeys, expandedKeys, toggleKey, setExpandedKeys, selectionManager ts\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={finalRef}\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<object>, HTMLDivElement>>(null);\n\nexport const MenuItem = forwardRef(function MenuItem<T extends object>(\n props: MenuItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, finalRef] = useContextProps(props, ref, MenuItemContext);\n const finalProps = useDefaultProps(contextProps, '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={finalRef as React.Ref<HTMLDivElement>}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </RACMenuItem>\n );\n});\n"]}
@@ -33,7 +33,7 @@ var defaultMapping = {
33
33
  };
34
34
  var NumberFieldContext = createContext(null);
35
35
  var NumberField = forwardRef(function NumberField2(props, ref) {
36
- const [contextProps, contextRef] = useContextProps(
36
+ const [contextProps, finalRef] = useContextProps(
37
37
  props,
38
38
  ref,
39
39
  NumberFieldContext
@@ -121,7 +121,7 @@ var NumberField = forwardRef(function NumberField2(props, ref) {
121
121
  NumberField$1,
122
122
  {
123
123
  ...rest,
124
- ref: contextRef,
124
+ ref: finalRef,
125
125
  className: classNames?.container,
126
126
  style,
127
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,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,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA,EAAO;AAAA,IAClC,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA;AAAO;AAEtC,CAAA;AAEO,IAAM,kBAAA,GACX,cAA8D,IAAI;AAE7D,IAAM,WAAA,G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AA,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
+ {"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,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA,EAAO;AAAA,IAClC,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA;AAAO;AAEtC,CAAA;AAEO,IAAM,kBAAA,GACX,cAA8D,IAAI;AAE7D,IAAM,WAAA,GAAc,UAAA,CAAW,SAASA,YAAAA,CAC7C,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,YAAA,EAAc,QAAQ,CAAA,GAAI,eAAA;AAAA,IAC/B,KAAA;AAAA,IACA,GAAA;AAAA,I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025 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, finalRef] = 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={finalRef}\n className={classNames?.container}\n style={style}\n >\n {children}\n </RACNumberField>\n );\n});\n"]}