@accelint/design-system 1.1.7 → 1.1.8

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 (67) 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/group/index.js +4 -4
  21. package/dist/components/group/index.js.map +1 -1
  22. package/dist/components/icon/index.js +2 -2
  23. package/dist/components/icon/index.js.map +1 -1
  24. package/dist/components/input/index.js +10 -10
  25. package/dist/components/input/index.js.map +1 -1
  26. package/dist/components/menu/index.js +9 -9
  27. package/dist/components/menu/index.js.map +1 -1
  28. package/dist/components/number-field/index.js +2 -2
  29. package/dist/components/number-field/index.js.map +1 -1
  30. package/dist/components/options/index.js +11 -17
  31. package/dist/components/options/index.js.map +1 -1
  32. package/dist/components/picker/index.js +6 -10
  33. package/dist/components/picker/index.js.map +1 -1
  34. package/dist/components/popover/index.js +2 -6
  35. package/dist/components/popover/index.js.map +1 -1
  36. package/dist/components/radio/index.js +4 -4
  37. package/dist/components/radio/index.js.map +1 -1
  38. package/dist/components/search-field/index.js +2 -2
  39. package/dist/components/search-field/index.js.map +1 -1
  40. package/dist/components/select/index.d.ts +1 -1
  41. package/dist/components/select/index.js +2 -2
  42. package/dist/components/select/index.js.map +1 -1
  43. package/dist/components/slider/index.js +10 -10
  44. package/dist/components/slider/index.js.map +1 -1
  45. package/dist/components/switch/index.js +2 -2
  46. package/dist/components/switch/index.js.map +1 -1
  47. package/dist/components/tabs/index.js +10 -18
  48. package/dist/components/tabs/index.js.map +1 -1
  49. package/dist/components/tabs/tabs.css.d.ts +2 -0
  50. package/dist/components/tabs/tabs.css.js +2 -2
  51. package/dist/components/tabs/tabs.css.js.map +1 -1
  52. package/dist/components/text-field/index.js +2 -2
  53. package/dist/components/text-field/index.js.map +1 -1
  54. package/dist/components/textarea/index.js +8 -8
  55. package/dist/components/textarea/index.js.map +1 -1
  56. package/dist/components/time-field/index.js +2 -2
  57. package/dist/components/time-field/index.js.map +1 -1
  58. package/dist/components/tooltip/index.js +5 -9
  59. package/dist/components/tooltip/index.js.map +1 -1
  60. package/dist/components/tree/index.js +2 -2
  61. package/dist/components/tree/index.js.map +1 -1
  62. package/dist/index.css +30 -30
  63. package/dist/ladle/actions.js.map +1 -1
  64. package/dist/styles/layers.css.d.ts +3 -3
  65. package/dist/test/setup.js +4 -4
  66. package/dist/test/setup.js.map +1 -1
  67. package/package.json +40 -40
@@ -7,16 +7,16 @@ declare const AriaFieldError: (props: react_aria_components.FieldErrorProps & Re
7
7
  declare const AriaFieldErrorContext: react.Context<ContextValue<react_aria_components.FieldErrorProps & RefAttributes<HTMLElement>, HTMLElement>>;
8
8
  declare const AriaGroup: (props: react_aria_components.GroupProps & RefAttributes<HTMLDivElement>) => react.ReactElement | null;
9
9
  declare const AriaGroupContext: react.Context<ContextValue<react_aria_components.GroupProps & RefAttributes<HTMLDivElement>, HTMLDivElement>>;
10
- declare const AriaHeader: (props: react.HTMLAttributes<HTMLElement> & RefAttributes<object> & RefAttributes<HTMLElement>) => react.ReactElement | null;
11
- declare const AriaHeaderContext: react.Context<ContextValue<react.HTMLAttributes<HTMLElement> & RefAttributes<object>, HTMLElement>>;
10
+ declare const AriaHeader: (props: react.HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>) => react.ReactElement | null;
11
+ declare const AriaHeaderContext: react.Context<ContextValue<react.HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>, HTMLElement>>;
12
12
  declare const AriaHeading: (props: react_aria_components.HeadingProps & RefAttributes<HTMLHeadingElement>) => react.ReactElement | null;
13
13
  declare const AriaHeadingContext: react.Context<ContextValue<react_aria_components.HeadingProps & RefAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
14
14
  declare const AriaKeyboard: (props: react.HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>) => react.ReactElement | null;
15
15
  declare const AriaKeyboardContext: react.Context<ContextValue<react.HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>, HTMLElement>>;
16
16
  declare const AriaLabel: (props: react_aria_components.LabelProps & RefAttributes<HTMLLabelElement>) => react.ReactElement | null;
17
17
  declare const AriaLabelContext: react.Context<ContextValue<react_aria_components.LabelProps & RefAttributes<HTMLLabelElement>, HTMLLabelElement>>;
18
- declare const AriaSeparator: (props: react_aria_components.SeparatorProps & RefAttributes<object> & RefAttributes<HTMLElement>) => react.ReactElement | null;
19
- declare const AriaSeparatorContext: react.Context<ContextValue<react_aria_components.SeparatorProps & RefAttributes<object>, HTMLElement>>;
18
+ declare const AriaSeparator: (props: react_aria_components.SeparatorProps & RefAttributes<HTMLElement>) => react.ReactElement | null;
19
+ declare const AriaSeparatorContext: react.Context<ContextValue<react_aria_components.SeparatorProps & RefAttributes<HTMLElement>, HTMLElement>>;
20
20
  /**
21
21
  * Due to the complexity of types and technical constraints of TS, it's not
22
22
  * possible for the above wrapping utility to support components that accept
@@ -33,7 +33,7 @@ var defaultMapping = {
33
33
  };
34
34
  function useButton(props, ref, context, key) {
35
35
  const [contextProps, contextRef] = useContextProps(props, ref, context);
36
- const defaultedProps = useDefaultProps(contextProps, key);
36
+ const finalProps = useDefaultProps(contextProps, key);
37
37
  const {
38
38
  children: childrenProp,
39
39
  classNames: classNamesProp,
@@ -42,7 +42,7 @@ function useButton(props, ref, context, key) {
42
42
  size = "md",
43
43
  variant = "solid",
44
44
  ...rest
45
- } = defaultedProps;
45
+ } = finalProps;
46
46
  const theme = useTheme();
47
47
  const mapping = useMemo(
48
48
  () => ({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/button/index.tsx"],"names":["Button","RACButton","LinkButton","ToggleButton","RACToggleButton"],"mappings":";;;;;;;;;;;;;;;;AAoDA,IAAM,eAAA,GAAkB;AAAA,EACtB,eAAA,EAAiB,KAAA;AAAA,EACjB,UAAA,EAAY,KAAA;AAAA,EACZ,WAAA,EAAa,IAAA;AAAA,EACb,MAAA,EAAQ;AACV,CAAA;AACA,IAAM,cAA6B,CAAC,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,MAAM,IAAI,CAAA;AAEhE,IAAM,cAAA,GAAgC;AAAA,EACpC,IAAA,EAAM,MAAA;AAAA,EACN,MAAM,WAAA,CAAY,MAAA;AAAA,IAChB,CAAC,KAAK,IAAA,KAAS;AACb,MAAA,GAAA,CAAI,IAAI,CAAA,GAAI,EAAE,IAAA,EAAK;AAEnB,MAAA,OAAO,GAAA;AAAA,IACT,CAAA;AAAA,IACA;AAAC;AAEL,CAAA;AAEA,SAAS,SAAA,CAIP,KAAA,EACA,GAAA,EACA,OAAA,EACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,YAAA,EAAc,UAAU,IAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,OAAO,CAAA;AAEtE,EAAA,MAAM,cAAA,GAAiB,eAAA,CAAgB,YAAA,EAAc,GAAG,CAAA;AAExD,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,YAAA;AAAA,IACV,UAAA,EAAY,cAAA;AAAA,IACZ,KAAA,GAAQ,SAAA;AAAA,IACR,OAAA,EAAS,WAAA;AAAA,IACT,IAAA,GAAO,IAAA;AAAA,IACP,OAAA,GAAU,OAAA;AAAA,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Ae,UAAA;AAAA,EAC1B,SAASC,aAAAA,CACP,KAAA,EACA,GAAA,EACA;AACA,IAAA,MAAM,WAAA,GAAc,SAAA;AAAA,MAClB,KAAA;AAAA,MACA,GAAA;AAAA,MACA,mBAAA;AAAA,MACA;AAAA,KACF;AAEA,IAAA,uBAAO,GAAA,CAACC,cAAA,EAAA,EAAiB,GAAG,WAAA,EAAa,CAAA;AAAA,EAC3C;AACF","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { noop } from '@accelint/core';\nimport { clsx } from 'clsx';\nimport {\n type Context,\n createContext,\n type ForwardedRef,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ButtonRenderProps,\n type ContextValue,\n Link,\n type LinkRenderProps,\n Provider,\n Button as RACButton,\n ToggleButton as RACToggleButton,\n type ToggleButtonRenderProps,\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 { surfaces } from '../../styles/surfaces.css';\nimport { bodies } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { IconContext } from '../icon';\nimport { buttonClassNames, buttonStateVars } from './button.css';\nimport type { AsType } from '../../types/generic';\nimport type { OmitProtectedProps } from '../../types/props';\nimport type { IconProps } from '../icon/types';\nimport type {\n ButtonMapping,\n ButtonProps,\n ButtonSizes,\n LinkButtonProps,\n ToggleButtonProps,\n} from './types';\n\nconst noopToggleState = {\n defaultSelected: false,\n isSelected: false,\n setSelected: noop,\n toggle: noop,\n};\nconst buttonSizes: ButtonSizes[] = ['xs', 'sm', 'md', 'lg', 'xl'];\n\nconst defaultMapping: ButtonMapping = {\n font: bodies,\n icon: buttonSizes.reduce(\n (acc, size) => {\n acc[size] = { size };\n\n return acc;\n },\n {} as Record<ButtonSizes, OmitProtectedProps<IconProps>>,\n ),\n};\n\nfunction useButton<\n P extends ButtonProps | LinkButtonProps | ToggleButtonProps,\n E extends HTMLElement,\n>(\n props: AsType<P>,\n ref: ForwardedRef<E>,\n context: Context<ContextValue<P, E>>,\n key: 'Button' | 'LinkButton' | 'ToggleButton',\n) {\n const [contextProps, contextRef] = useContextProps(props, ref, context);\n\n const defaultedProps = useDefaultProps(contextProps, key);\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n color = 'primary',\n mapping: mappingProp,\n size = 'md',\n variant = 'solid',\n ...rest\n } = defaultedProps;\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(buttonClassNames, theme.Button, classNamesProp, {\n button: clsx(\n mapping.font[size],\n variant === 'floating' && surfaces.default.proud,\n ),\n }),\n [theme.Button, classNamesProp, mapping.font, size, variant],\n );\n\n const style = useCallback(\n (\n renderProps:\n | ButtonRenderProps\n | LinkRenderProps\n | ToggleButtonRenderProps,\n ) =>\n inlineVars(buttonStateVars, {\n isCurrent: false,\n isSelected: false,\n ...renderProps,\n color,\n size,\n variant,\n }),\n [color, size, variant],\n );\n\n const values = useMemo<\n [[typeof IconContext, ContextValue<IconProps, HTMLDivElement>]]\n >(() => [[IconContext, mapping.icon[size]]], [mapping.icon, size]);\n\n const children = useCallback(\n (\n renderProps:\n | ButtonRenderProps\n | LinkRenderProps\n | ToggleButtonRenderProps,\n ) => (\n <Provider values={values}>\n <span className={classNames?.button}>\n {callRenderProps(childrenProp, {\n state: noopToggleState,\n isCurrent: false,\n isPending: false,\n isSelected: false,\n ...renderProps,\n })}\n </span>\n </Provider>\n ),\n [values, classNames?.button, childrenProp],\n );\n\n return useMemo(\n () => ({\n ...rest,\n ref: contextRef,\n children,\n className: classNames?.container,\n style,\n }),\n // TODO(ilk): This should be checked. \"rest changes on every re-render and should not be used as a hook dependency.\"\n // biome-ignore lint/correctness/useExhaustiveDependencies: This should be checked and verified.\n [rest, contextRef, children, classNames?.container, style],\n );\n}\n\nexport const ButtonContext: Context<ContextValue<\n ButtonProps,\n HTMLButtonElement\n> | null> = createContext<ContextValue<ButtonProps, HTMLButtonElement>>(null);\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n const buttonProps = useButton(props, ref, ButtonContext, 'Button');\n\n return <RACButton {...buttonProps} />;\n },\n) as React.ForwardRefExoticComponent<\n ButtonProps & React.RefAttributes<HTMLButtonElement>\n>;\n\nexport const LinkButtonContext: Context<ContextValue<\n LinkButtonProps,\n HTMLAnchorElement\n> | null> =\n createContext<ContextValue<LinkButtonProps, HTMLAnchorElement>>(null);\n\nexport const LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(\n function LinkButton(\n props: LinkButtonProps,\n ref: ForwardedRef<HTMLAnchorElement>,\n ) {\n const buttonProps = useButton(props, ref, LinkButtonContext, 'LinkButton');\n\n return <Link {...buttonProps} />;\n },\n) as React.ForwardRefExoticComponent<\n LinkButtonProps & React.RefAttributes<HTMLAnchorElement>\n>;\n\nexport const ToggleButtonContext: Context<ContextValue<\n ToggleButtonProps,\n HTMLButtonElement\n> | null> =\n createContext<ContextValue<ToggleButtonProps, HTMLButtonElement>>(null);\n\nexport const ToggleButton = forwardRef<HTMLButtonElement, ToggleButtonProps>(\n function ToggleButton(\n props: ToggleButtonProps,\n ref: ForwardedRef<HTMLButtonElement>,\n ) {\n const buttonProps = useButton(\n props,\n ref,\n ToggleButtonContext,\n 'ToggleButton',\n );\n\n return <RACToggleButton {...buttonProps} />;\n },\n) as React.ForwardRefExoticComponent<\n ToggleButtonProps & React.RefAttributes<HTMLButtonElement>\n>;\n"]}
1
+ {"version":3,"sources":["../../../src/components/button/index.tsx"],"names":["Button","RACButton","LinkButton","ToggleButton","RACToggleButton"],"mappings":";;;;;;;;;;;;;;;;AAoDA,IAAM,eAAA,GAAkB;AAAA,EACtB,eAAA,EAAiB,KAAA;AAAA,EACjB,UAAA,EAAY,KAAA;AAAA,EACZ,WAAA,EAAa,IAAA;AAAA,EACb,MAAA,EAAQ;AACV,CAAA;AACA,IAAM,cAA6B,CAAC,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,MAAM,IAAI,CAAA;AAEhE,IAAM,cAAA,GAAgC;AAAA,EACpC,IAAA,EAAM,MAAA;AAAA,EACN,MAAM,WAAA,CAAY,MAAA;AAAA,IAChB,CAAC,KAAK,IAAA,KAAS;AACb,MAAA,GAAA,CAAI,IAAI,CAAA,GAAI,EAAE,IAAA,EAAK;AAEnB,MAAA,OAAO,GAAA;AAAA,IACT,CAAA;AAAA,IACA;AAAC;AAEL,CAAA;AAEA,SAAS,SAAA,CAIP,KAAA,EACA,GAAA,EACA,OAAA,EACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,YAAA,EAAc,UAAU,IAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,OAAO,CAAA;AAEtE,EAAA,MAAM,UAAA,GAAa,eAAA,CAAgB,YAAA,EAAc,GAAG,CAAA;AAEpD,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,YAAA;AAAA,IACV,UAAA,EAAY,cAAA;AAAA,IACZ,KAAA,GAAQ,SAAA;AAAA,IACR,OAAA,EAAS,WAAA;AAAA,IACT,IAAA,GAAO,IAAA;AAAA,IACP,OAAA,GAAU,OAAA;AAAA,IACV,GAAG;AAAA,GACL,GAAI,UAAA;AAEJ,EAAA,MAAM,QAAQ,QAAA,EAAS;AAEvB,EAAA,MAAM,OAAA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;AAAA,MAClB,KAAA;AAAA,MACA,GAAA;AAAA,MACA,mBAAA;AAAA,MACA;AAAA,KACF;AAEA,IAAA,uBAAO,GAAA,CAACC,cAAA,EAAA,EAAiB,GAAG,WAAA,EAAa,CAAA;AAAA,EAC3C;AACF","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { noop } from '@accelint/core';\nimport { clsx } from 'clsx';\nimport {\n type Context,\n createContext,\n type ForwardedRef,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ButtonRenderProps,\n type ContextValue,\n Link,\n type LinkRenderProps,\n Provider,\n Button as RACButton,\n ToggleButton as RACToggleButton,\n type ToggleButtonRenderProps,\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 { surfaces } from '../../styles/surfaces.css';\nimport { bodies } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { IconContext } from '../icon';\nimport { buttonClassNames, buttonStateVars } from './button.css';\nimport type { AsType } from '../../types/generic';\nimport type { OmitProtectedProps } from '../../types/props';\nimport type { IconProps } from '../icon/types';\nimport type {\n ButtonMapping,\n ButtonProps,\n ButtonSizes,\n LinkButtonProps,\n ToggleButtonProps,\n} from './types';\n\nconst noopToggleState = {\n defaultSelected: false,\n isSelected: false,\n setSelected: noop,\n toggle: noop,\n};\nconst buttonSizes: ButtonSizes[] = ['xs', 'sm', 'md', 'lg', 'xl'];\n\nconst defaultMapping: ButtonMapping = {\n font: bodies,\n icon: buttonSizes.reduce(\n (acc, size) => {\n acc[size] = { size };\n\n return acc;\n },\n {} as Record<ButtonSizes, OmitProtectedProps<IconProps>>,\n ),\n};\n\nfunction useButton<\n P extends ButtonProps | LinkButtonProps | ToggleButtonProps,\n E extends HTMLElement,\n>(\n props: AsType<P>,\n ref: ForwardedRef<E>,\n context: Context<ContextValue<P, E>>,\n key: 'Button' | 'LinkButton' | 'ToggleButton',\n) {\n const [contextProps, contextRef] = useContextProps(props, ref, context);\n\n const finalProps = useDefaultProps(contextProps, key);\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n color = 'primary',\n mapping: mappingProp,\n size = 'md',\n variant = 'solid',\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(buttonClassNames, theme.Button, classNamesProp, {\n button: clsx(\n mapping.font[size],\n variant === 'floating' && surfaces.default.proud,\n ),\n }),\n [theme.Button, classNamesProp, mapping.font, size, variant],\n );\n\n const style = useCallback(\n (\n renderProps:\n | ButtonRenderProps\n | LinkRenderProps\n | ToggleButtonRenderProps,\n ) =>\n inlineVars(buttonStateVars, {\n isCurrent: false,\n isSelected: false,\n ...renderProps,\n color,\n size,\n variant,\n }),\n [color, size, variant],\n );\n\n const values = useMemo<\n [[typeof IconContext, ContextValue<IconProps, HTMLDivElement>]]\n >(() => [[IconContext, mapping.icon[size]]], [mapping.icon, size]);\n\n const children = useCallback(\n (\n renderProps:\n | ButtonRenderProps\n | LinkRenderProps\n | ToggleButtonRenderProps,\n ) => (\n <Provider values={values}>\n <span className={classNames?.button}>\n {callRenderProps(childrenProp, {\n state: noopToggleState,\n isCurrent: false,\n isPending: false,\n isSelected: false,\n ...renderProps,\n })}\n </span>\n </Provider>\n ),\n [values, classNames?.button, childrenProp],\n );\n\n return useMemo(\n () => ({\n ...rest,\n ref: contextRef,\n children,\n className: classNames?.container,\n style,\n }),\n // TODO(ilk): This should be checked. \"rest changes on every re-render and should not be used as a hook dependency.\"\n // biome-ignore lint/correctness/useExhaustiveDependencies: This should be checked and verified.\n [rest, contextRef, children, classNames?.container, style],\n );\n}\n\nexport const ButtonContext: Context<ContextValue<\n ButtonProps,\n HTMLButtonElement\n> | null> = createContext<ContextValue<ButtonProps, HTMLButtonElement>>(null);\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n const buttonProps = useButton(props, ref, ButtonContext, 'Button');\n\n return <RACButton {...buttonProps} />;\n },\n) as React.ForwardRefExoticComponent<\n ButtonProps & React.RefAttributes<HTMLButtonElement>\n>;\n\nexport const LinkButtonContext: Context<ContextValue<\n LinkButtonProps,\n HTMLAnchorElement\n> | null> =\n createContext<ContextValue<LinkButtonProps, HTMLAnchorElement>>(null);\n\nexport const LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(\n function LinkButton(\n props: LinkButtonProps,\n ref: ForwardedRef<HTMLAnchorElement>,\n ) {\n const buttonProps = useButton(props, ref, LinkButtonContext, 'LinkButton');\n\n return <Link {...buttonProps} />;\n },\n) as React.ForwardRefExoticComponent<\n LinkButtonProps & React.RefAttributes<HTMLAnchorElement>\n>;\n\nexport const ToggleButtonContext: Context<ContextValue<\n ToggleButtonProps,\n HTMLButtonElement\n> | null> =\n createContext<ContextValue<ToggleButtonProps, HTMLButtonElement>>(null);\n\nexport const ToggleButton = forwardRef<HTMLButtonElement, ToggleButtonProps>(\n function ToggleButton(\n props: ToggleButtonProps,\n ref: ForwardedRef<HTMLButtonElement>,\n ) {\n const buttonProps = useButton(\n props,\n ref,\n ToggleButtonContext,\n 'ToggleButton',\n );\n\n return <RACToggleButton {...buttonProps} />;\n },\n) as React.ForwardRefExoticComponent<\n ToggleButtonProps & React.RefAttributes<HTMLButtonElement>\n>;\n"]}
@@ -14,12 +14,8 @@ import { jsx, jsxs } from 'react/jsx-runtime';
14
14
 
15
15
  var CheckboxContext = createContext(null);
16
16
  var Checkbox = forwardRef(function Checkbox2(props, ref) {
17
- const [resolvedProps, resolvedRef] = useContextProps(
18
- props,
19
- ref,
20
- CheckboxContext
21
- );
22
- const finalProps = useDefaultProps(resolvedProps, "Checkbox");
17
+ const [contextProps, finalRef] = useContextProps(props, ref, CheckboxContext);
18
+ const finalProps = useDefaultProps(contextProps, "Checkbox");
23
19
  const {
24
20
  children: childrenProp,
25
21
  classNames: classNamesProp,
@@ -64,7 +60,7 @@ var Checkbox = forwardRef(function Checkbox2(props, ref) {
64
60
  Checkbox$1,
65
61
  {
66
62
  ...rest,
67
- ref: resolvedRef,
63
+ ref: finalRef,
68
64
  className: classNames?.checkbox?.container,
69
65
  style,
70
66
  children
@@ -73,19 +69,19 @@ var Checkbox = forwardRef(function Checkbox2(props, ref) {
73
69
  });
74
70
  var CheckboxGroupContext = createContext(null);
75
71
  var CheckboxGroup = forwardRef(function CheckboxGroup2(props, ref) {
76
- const [resolvedContextProps, resolvedRef] = useContextProps(
72
+ const [contextProps, finalRef] = useContextProps(
77
73
  props,
78
74
  ref,
79
75
  CheckboxGroupContext
80
76
  );
81
- const resolvedProps = useDefaultProps(resolvedContextProps, "CheckboxGroup");
77
+ const finalProps = useDefaultProps(contextProps, "CheckboxGroup");
82
78
  const {
83
79
  children: childrenProp,
84
80
  classNames: classNamesProp,
85
81
  alignInput = "end",
86
82
  orientation = "vertical",
87
83
  ...rest
88
- } = resolvedProps;
84
+ } = finalProps;
89
85
  const theme = useTheme();
90
86
  const classNames = useMemo(
91
87
  () => mergeClassNames(checkboxClassNames, theme.Checkbox, classNamesProp),
@@ -122,7 +118,7 @@ var CheckboxGroup = forwardRef(function CheckboxGroup2(props, ref) {
122
118
  CheckboxGroup$1,
123
119
  {
124
120
  ...rest,
125
- ref: resolvedRef,
121
+ ref: finalRef,
126
122
  className: classNames?.group?.container,
127
123
  style,
128
124
  children
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/checkbox/index.tsx"],"names":["Checkbox","RACCheckbox","CheckboxGroup","RACCheckboxGroup"],"mappings":";;;;;;;;;;;;;;AAiDO,IAAM,eAAA,GACX,cAA6D,IAAI;AAE5D,IAAM,QAAA,GAAW,UAAA,CAAW,SAASA,SAAAA,CAC1C,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,aAAA,EAAe,WAAW,CAAA,GAAI,eAAA;AAAA,IACnC,KAAA;AAAA,IACA,GAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,UAAA,GAAa,eAAA,CAAgB,aAAA,EAAe,UAAU,CAAA;AAE5D,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,YAAA;AAAA,IACV,UAAA,EAAY,cAAA;AAAA,IACZ,UAAA,GAAa,KAAA;AAAA,IACb,GAAG;AAAA,GACL,GAAI,UAAA;AAEJ,EAAA,MAAM,CAAC,OAAA,EAAS,OAAO,CAAA,GAAI,OAAA,EAAQ;AACnC,EAAA,MAAM,QAAQ,QAAA,EAAS;AAEvB,EAAA,MAAM,UAAA,GAAa,OAAA;AAAA,IACjB,MAAM,eAAA,CAAgB,kBAAA,EAAoB,KAAA,CAAM,UAAU,cAAc,CAAA;AAAA,IACxE,CAAC,KAAA,CAAM,QAAA,EAAU,cAAc;AAAA,GACjC;AAEA,EAAA,MAAM,KAAA,GAAQ,WAAA;AAAA,IACZ,CAAC,WAAA,KACC,UAAA,CAAW,iBAAA,EAAmB;AAAA,MAC5B,GAAG,WAAA;AAAA,MACH;AAAA,KACD,CAAA;AAAA,IACH,CAAC,UAAU;AAAA,GACb;AAEA,EAAA,MAAM,MAAA,GAAS,OAAA;AAAA,IAOb,MAAM;AAAA,MACJ,CAAC,eAAA,EAAiB,EAAE,WAAW,UAAA,EAAY,QAAA,EAAU,OAAO,CAAA;AAAA,MAC5D;AAAA,QACE,WAAA;AAAA,QACA;AAAA,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AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,WAAA;AAAA,MACL,SAAA,EAAW,YAAY,KAAA,EAAO,SAAA;AAAA,MAC9B,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 LabelProps,\n Provider,\n Checkbox as RACCheckbox,\n CheckboxGroup as RACCheckboxGroup,\n TextContext,\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 { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { AriaLabelContext, AriaTextContext } from '../aria';\nimport { IconContext } from '../icon';\nimport {\n checkboxClassNames,\n checkboxGroupStateVars,\n checkboxStateVars,\n} from './checkbox.css';\nimport type { IconProps } from '../icon/types';\nimport type {\n CheckboxGroupProps,\n CheckboxGroupRenderProps,\n CheckboxProps,\n CheckboxRenderProps,\n} from './types';\n\nexport const CheckboxContext =\n createContext<ContextValue<CheckboxProps, HTMLLabelElement>>(null);\n\nexport const Checkbox = forwardRef(function Checkbox(\n props: CheckboxProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n CheckboxContext,\n );\n\n const finalProps = useDefaultProps(resolvedProps, 'Checkbox');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n alignInput = 'end',\n ...rest\n } = finalProps;\n\n const [iconRef, hasIcon] = useSlot();\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(checkboxClassNames, theme.Checkbox, classNamesProp),\n [theme.Checkbox, classNamesProp],\n );\n\n const style = useCallback(\n (renderProps: CheckboxRenderProps) =>\n inlineVars(checkboxStateVars, {\n ...renderProps,\n alignInput,\n }),\n [alignInput],\n );\n\n const values = useMemo<\n [\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n [typeof TextContext, ContextValue<TextProps, HTMLElement>],\n ]\n >(\n () => [\n [AriaTextContext, { className: classNames?.checkbox?.label }],\n [\n IconContext,\n {\n ref: iconRef,\n classNames: classNames?.checkbox?.icon,\n },\n ],\n [TextContext, null],\n ],\n [classNames?.checkbox?.label, classNames?.checkbox?.icon, iconRef],\n );\n\n const children = useCallback(\n (renderProps: CheckboxRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.checkbox?.checkbox}>\n {!hasIcon && (\n <span className={classNames?.checkbox?.icon?.container} />\n )}\n {callRenderProps(childrenProp, renderProps)}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.checkbox, hasIcon, values],\n );\n\n return (\n <RACCheckbox\n {...rest}\n ref={resolvedRef}\n className={classNames?.checkbox?.container}\n style={style}\n >\n {children}\n </RACCheckbox>\n );\n});\n\nexport const CheckboxGroupContext =\n createContext<ContextValue<CheckboxGroupProps, HTMLDivElement>>(null);\n\nexport const CheckboxGroup = forwardRef(function CheckboxGroup(\n props: CheckboxGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedContextProps, resolvedRef] = useContextProps(\n props,\n ref,\n CheckboxGroupContext,\n );\n\n const resolvedProps = useDefaultProps(resolvedContextProps, 'CheckboxGroup');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n alignInput = 'end',\n orientation = 'vertical',\n ...rest\n } = resolvedProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(checkboxClassNames, theme.Checkbox, classNamesProp),\n [classNamesProp, theme.Checkbox],\n );\n\n const style = useCallback(\n (renderProps: CheckboxGroupRenderProps) =>\n inlineVars(checkboxGroupStateVars, {\n ...renderProps,\n orientation,\n }),\n [orientation],\n );\n\n const values = useMemo<\n [\n [typeof AriaLabelContext, ContextValue<LabelProps, HTMLLabelElement>],\n [typeof CheckboxContext, ContextValue<CheckboxProps, HTMLLabelElement>],\n ]\n >(\n () => [\n [AriaLabelContext, { className: classNames?.group?.label }],\n [\n CheckboxContext,\n {\n classNames,\n alignInput,\n },\n ],\n ],\n [alignInput, classNames],\n );\n\n const children = useCallback(\n (renderProps: CheckboxGroupRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.group?.group}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.group, values],\n );\n\n return (\n <RACCheckboxGroup\n {...rest}\n ref={resolvedRef}\n className={classNames?.group?.container}\n style={style}\n >\n {children}\n </RACCheckboxGroup>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/checkbox/index.tsx"],"names":["Checkbox","RACCheckbox","CheckboxGroup","RACCheckboxGroup"],"mappings":";;;;;;;;;;;;;;AAiDO,IAAM,eAAA,GACX,cAA6D,IAAI;AAE5D,IAAM,QAAA,GAAW,UAAA,CAAW,SAASA,SAAAA,CAC1C,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,YAAA,EAAc,QAAQ,IAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,eAAe,CAAA;AAE5E,EAAA,MAAM,UAAA,GAAa,eAAA,CAAgB,YAAA,EAAc,UAAU,CAAA;AAE3D,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,YAAA;AAAA,IACV,UA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AAA,GACd;AAEA,EAAA,MAAM,MAAA,GAAS,OAAA;AAAA,IAMb,MAAM;AAAA,MACJ,CAAC,gBAAA,EAAkB,EAAE,WAAW,UAAA,EAAY,KAAA,EAAO,OAAO,CAAA;AAAA,MAC1D;AAAA,QACE,eAAA;AAAA,QACA;AAAA,UACE,UAAA;AAAA,UACA;AAAA;AACF;AACF,KACF;AAAA,IACA,CAAC,YAAY,UAAU;AAAA,GACzB;AAEA,EAAA,MAAM,QAAA,GAAW,WAAA;AAAA,IACf,CAAC,WAAA,qBACC,GAAA,CAAC,QAAA,EAAA,EAAS,MAAA,EACR,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,KAAA,EAAO,KAAA,EAChC,QAAA,EAAA,eAAA,CAAgB,YAAA,EAAc;AAAA,MAC7B,GAAG,WAAA;AAAA,MACH,eAAA,EAAiB;AAAA,KAClB,GACH,CAAA,EACF,CAAA;AAAA,IAEF,CAAC,YAAA,EAAc,UAAA,EAAY,KAAA,EAAO,MAAM;AAAA,GAC1C;AAEA,EAAA,uBACE,GAAA;AAAA,IAACC,eAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,QAAA;AAAA,MACL,SAAA,EAAW,YAAY,KAAA,EAAO,SAAA;AAAA,MAC9B,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 LabelProps,\n Provider,\n Checkbox as RACCheckbox,\n CheckboxGroup as RACCheckboxGroup,\n TextContext,\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 { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { AriaLabelContext, AriaTextContext } from '../aria';\nimport { IconContext } from '../icon';\nimport {\n checkboxClassNames,\n checkboxGroupStateVars,\n checkboxStateVars,\n} from './checkbox.css';\nimport type { IconProps } from '../icon/types';\nimport type {\n CheckboxGroupProps,\n CheckboxGroupRenderProps,\n CheckboxProps,\n CheckboxRenderProps,\n} from './types';\n\nexport const CheckboxContext =\n createContext<ContextValue<CheckboxProps, HTMLLabelElement>>(null);\n\nexport const Checkbox = forwardRef(function Checkbox(\n props: CheckboxProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n const [contextProps, finalRef] = useContextProps(props, ref, CheckboxContext);\n\n const finalProps = useDefaultProps(contextProps, 'Checkbox');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n alignInput = 'end',\n ...rest\n } = finalProps;\n\n const [iconRef, hasIcon] = useSlot();\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(checkboxClassNames, theme.Checkbox, classNamesProp),\n [theme.Checkbox, classNamesProp],\n );\n\n const style = useCallback(\n (renderProps: CheckboxRenderProps) =>\n inlineVars(checkboxStateVars, {\n ...renderProps,\n alignInput,\n }),\n [alignInput],\n );\n\n const values = useMemo<\n [\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n [typeof TextContext, ContextValue<TextProps, HTMLElement>],\n ]\n >(\n () => [\n [AriaTextContext, { className: classNames?.checkbox?.label }],\n [\n IconContext,\n {\n ref: iconRef,\n classNames: classNames?.checkbox?.icon,\n },\n ],\n [TextContext, null],\n ],\n [classNames?.checkbox?.label, classNames?.checkbox?.icon, iconRef],\n );\n\n const children = useCallback(\n (renderProps: CheckboxRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.checkbox?.checkbox}>\n {!hasIcon && (\n <span className={classNames?.checkbox?.icon?.container} />\n )}\n {callRenderProps(childrenProp, renderProps)}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.checkbox, hasIcon, values],\n );\n\n return (\n <RACCheckbox\n {...rest}\n ref={finalRef}\n className={classNames?.checkbox?.container}\n style={style}\n >\n {children}\n </RACCheckbox>\n );\n});\n\nexport const CheckboxGroupContext =\n createContext<ContextValue<CheckboxGroupProps, HTMLDivElement>>(null);\n\nexport const CheckboxGroup = forwardRef(function CheckboxGroup(\n props: CheckboxGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, finalRef] = useContextProps(\n props,\n ref,\n CheckboxGroupContext,\n );\n\n const finalProps = useDefaultProps(contextProps, 'CheckboxGroup');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n alignInput = 'end',\n orientation = 'vertical',\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(checkboxClassNames, theme.Checkbox, classNamesProp),\n [classNamesProp, theme.Checkbox],\n );\n\n const style = useCallback(\n (renderProps: CheckboxGroupRenderProps) =>\n inlineVars(checkboxGroupStateVars, {\n ...renderProps,\n orientation,\n }),\n [orientation],\n );\n\n const values = useMemo<\n [\n [typeof AriaLabelContext, ContextValue<LabelProps, HTMLLabelElement>],\n [typeof CheckboxContext, ContextValue<CheckboxProps, HTMLLabelElement>],\n ]\n >(\n () => [\n [AriaLabelContext, { className: classNames?.group?.label }],\n [\n CheckboxContext,\n {\n classNames,\n alignInput,\n },\n ],\n ],\n [alignInput, classNames],\n );\n\n const children = useCallback(\n (renderProps: CheckboxGroupRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.group?.group}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.group, values],\n );\n\n return (\n <RACCheckboxGroup\n {...rest}\n ref={finalRef}\n className={classNames?.group?.container}\n style={style}\n >\n {children}\n </RACCheckboxGroup>\n );\n});\n"]}
@@ -154,7 +154,7 @@ function ChipList({
154
154
  }
155
155
  var ChipGroupContext = createContext(null);
156
156
  var ChipGroup = forwardRef(function ChipGroup2(props, ref) {
157
- const [contextProps, contextRef] = useContextProps(
157
+ const [contextProps, finalRef] = useContextProps(
158
158
  props,
159
159
  ref,
160
160
  ChipGroupContext
@@ -176,7 +176,7 @@ var ChipGroup = forwardRef(function ChipGroup2(props, ref) {
176
176
  () => [[ChipContext, { classNames, color, size }]],
177
177
  [classNames, color, size]
178
178
  );
179
- return /* @__PURE__ */ jsx(TagGroup, { ...rest, ref: contextRef, className: classNames?.group, children: /* @__PURE__ */ jsx(Provider, { values, children }) });
179
+ return /* @__PURE__ */ jsx(TagGroup, { ...rest, ref: finalRef, className: classNames?.group, children: /* @__PURE__ */ jsx(Provider, { values, children }) });
180
180
  });
181
181
 
182
182
  export { Chip, ChipContext, ChipGroup, ChipGroupContext, ChipItem, ChipList };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/chip/index.tsx"],"names":["ChipItem","RACTextContext","ChipGroup"],"mappings":";;;;;;;;;;;;;;AA+CA,IAAM,QAAA,GAAwD;AAAA,EAC5D,KAAA,EAAO,MAAA;AAAA,EACP,IAAA,EAAM;AACR,CAAA;AAEA,IAAM,cAAA,GAA8B;AAAA,EAClC,IAAA,EAAM;AAAA,IACJ,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA,EAAO;AAAA,IAClC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A,MAAM,MAAA,GAAS,OAAA;AAAA,IAGb,MAAM,CAAC,CAAC,WAAA,EAAa,EAAE,UAAA,EAAY,KAAA,EAAO,IAAA,EAAM,CAAC,CAAA;AAAA,IACjD,CAAC,UAAA,EAAY,KAAA,EAAO,IAAI;AAAA,GAC1B;AAEA,EAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAU,GAAG,IAAA,EAAM,GAAA,EAAK,UAAA,EAAY,SAAA,EAAW,UAAA,EAAY,KAAA,EAC1D,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,MAAA,EAAiB,UAAS,CAAA,EACtC,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 {\n createContext,\n type ForwardedRef,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n Provider,\n TextContext as RACTextContext,\n Tag,\n TagGroup,\n TagList,\n type TagRenderProps,\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 { AriaTextContext } from '../aria';\nimport { ButtonContext } from '../button';\nimport { chipClassNames, chipStateVars } from './chip.css';\nimport type { ButtonProps } from '../button/types';\nimport type {\n ChipGroupProps,\n ChipItemProps,\n ChipListProps,\n ChipMapping,\n ChipProps,\n} from './types';\n\nconst defaults: Required<Pick<ChipProps, 'color' | 'size'>> = {\n color: 'info',\n size: 'sm',\n};\n\nconst defaultMapping: ChipMapping = {\n font: {\n sm: bodies.sm,\n lg: bodies.sm,\n },\n remove: {\n sm: { size: 'sm', variant: 'icon' },\n lg: { size: 'sm', variant: 'icon' },\n },\n};\n\nexport function Chip(props: ChipProps) {\n const chipProps = useDefaultProps(props, 'Chip');\n\n const {\n children,\n classNames: classNamesProp,\n color = defaults.color,\n mapping: mappingProp,\n size = defaults.size,\n } = chipProps;\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(chipClassNames, theme.Chip, classNamesProp, {\n chip: mapping.font[size],\n }),\n [theme.Chip, classNamesProp, mapping, size],\n );\n\n const values = useMemo<\n [[typeof AriaTextContext, ContextValue<TextProps, HTMLElement>]]\n >(\n () => [[AriaTextContext, { className: classNames?.label }]],\n [classNames?.label],\n );\n\n const style = useMemo(\n () =>\n inlineVars(chipStateVars, {\n allowsRemoving: false,\n color,\n selectionBehavior: 'toggle',\n selectionMode: 'none',\n size,\n isDisabled: false,\n isFocused: false,\n isFocusVisible: false,\n isHovered: false,\n isPressed: false,\n isSelected: false,\n }),\n [color, size],\n );\n\n return (\n <Provider values={values}>\n <div className={classNames?.container} style={style}>\n <div className={classNames?.chip}>{children}</div>\n </div>\n </Provider>\n );\n}\n\nexport const ChipContext =\n createContext<ContextValue<ChipItemProps, HTMLDivElement>>(null);\n\n/**\n * Must be used in conjunction with ChipList & ChipGroup and\n * cannot be used outside of ChipList, else will throw error\n *\n * Color & Size props can be passed in from ChipGroup and overriden\n * on each instance of this components\n *\n * Order of precedence (from lowest to highest):\n * Design System Defaults of Chip\n * Global Defaults of ChipGroup\n * Instance of ChipGroup\n * Global Defaults of ChipItem\n * Instance of ChipItem\n */\nexport const ChipItem = forwardRef(function ChipItem(\n props: ChipItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(props, ref, ChipContext);\n const finalProps = useDefaultProps(contextProps, 'Chip');\n\n const {\n children: childrenProp,\n id,\n classNames: classNamesProp,\n color = defaults.color,\n size = defaults.size,\n textValue,\n mapping: mappingProp,\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(chipClassNames, theme.Chip, classNamesProp, {\n chip: mapping.font[size],\n }),\n [theme.Chip, classNamesProp, mapping, size],\n );\n\n const values = useMemo<\n [\n [typeof RACTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof ButtonContext, ContextValue<ButtonProps, HTMLButtonElement>],\n ]\n >(\n () => [\n // Because ChipGroup (TagGroup) implements a TextContext, we need to block it inside of the Chip\n // so that there isn't a conflict of with our AriaTextContext. Otherwise there are slot errors\n [RACTextContext, null],\n [AriaTextContext, { className: classNames?.label }],\n [\n ButtonContext,\n {\n ...mapping.remove[size],\n classNames: { button: classNames?.remove },\n slot: 'remove',\n },\n ],\n ],\n [classNames?.label, classNames?.remove, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: TagRenderProps) =>\n inlineVars(chipStateVars, {\n ...renderProps,\n color,\n size,\n }),\n [color, size],\n );\n\n const children = useCallback(\n (renderProps: TagRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.chip}>\n {callRenderProps(childrenProp, renderProps)}\n </div>\n </Provider>\n ),\n [values, classNames?.chip, childrenProp],\n );\n\n return (\n <Tag\n {...rest}\n ref={contextRef}\n id={id ?? textValue}\n className={classNames?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </Tag>\n );\n});\n\n/**\n * Must be used in conjunction with ChipItem & ChipGroup and\n * cannot be used outside of ChipGroup, else will throw error\n */\nexport function ChipList<T extends object>({\n classNames: classNamesProp,\n ...rest\n}: ChipListProps<T>) {\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(chipClassNames, theme.Chip, classNamesProp),\n [theme.Chip, classNamesProp],\n );\n\n return <TagList<T> {...rest} className={classNames?.list} />;\n}\n\nexport const ChipGroupContext =\n createContext<ContextValue<ChipGroupProps, HTMLDivElement>>(null);\n\n/**\n * Color & Size props are passed down to ChipItem but can be overridden\n * on each component if desired\n */\nexport const ChipGroup = forwardRef(function ChipGroup(\n props: ChipGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(\n props,\n ref,\n ChipGroupContext,\n );\n const finalProps = useDefaultProps(contextProps, 'ChipGroup');\n\n const {\n children,\n classNames: classNamesProp,\n color,\n size,\n ...rest\n } = finalProps;\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(chipClassNames, theme.Chip, classNamesProp),\n [theme.Chip, classNamesProp],\n );\n\n const values = useMemo<\n [[typeof ChipContext, ContextValue<ChipItemProps, HTMLDivElement>]]\n >(\n () => [[ChipContext, { classNames, color, size }]],\n [classNames, color, size],\n );\n\n return (\n <TagGroup {...rest} ref={contextRef} className={classNames?.group}>\n <Provider values={values}>{children}</Provider>\n </TagGroup>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/chip/index.tsx"],"names":["ChipItem","RACTextContext","ChipGroup"],"mappings":";;;;;;;;;;;;;;AA+CA,IAAM,QAAA,GAAwD;AAAA,EAC5D,KAAA,EAAO,MAAA;AAAA,EACP,IAAA,EAAM;AACR,CAAA;AAEA,IAAM,cAAA,GAA8B;AAAA,EAClC,IAAA,EAAM;AAAA,IACJ,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA,EAAO;AAAA,IAClC,EAAA,EAAI,EAAE,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AS,OAAA;AAAA,IAGb,MAAM,CAAC,CAAC,WAAA,EAAa,EAAE,UAAA,EAAY,KAAA,EAAO,IAAA,EAAM,CAAC,CAAA;AAAA,IACjD,CAAC,UAAA,EAAY,KAAA,EAAO,IAAI;AAAA,GAC1B;AAEA,EAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAU,GAAG,IAAA,EAAM,GAAA,EAAK,QAAA,EAAU,SAAA,EAAW,UAAA,EAAY,KAAA,EACxD,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,MAAA,EAAiB,UAAS,CAAA,EACtC,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 {\n createContext,\n type ForwardedRef,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n Provider,\n TextContext as RACTextContext,\n Tag,\n TagGroup,\n TagList,\n type TagRenderProps,\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 { AriaTextContext } from '../aria';\nimport { ButtonContext } from '../button';\nimport { chipClassNames, chipStateVars } from './chip.css';\nimport type { ButtonProps } from '../button/types';\nimport type {\n ChipGroupProps,\n ChipItemProps,\n ChipListProps,\n ChipMapping,\n ChipProps,\n} from './types';\n\nconst defaults: Required<Pick<ChipProps, 'color' | 'size'>> = {\n color: 'info',\n size: 'sm',\n};\n\nconst defaultMapping: ChipMapping = {\n font: {\n sm: bodies.sm,\n lg: bodies.sm,\n },\n remove: {\n sm: { size: 'sm', variant: 'icon' },\n lg: { size: 'sm', variant: 'icon' },\n },\n};\n\nexport function Chip(props: ChipProps) {\n const chipProps = useDefaultProps(props, 'Chip');\n\n const {\n children,\n classNames: classNamesProp,\n color = defaults.color,\n mapping: mappingProp,\n size = defaults.size,\n } = chipProps;\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(chipClassNames, theme.Chip, classNamesProp, {\n chip: mapping.font[size],\n }),\n [theme.Chip, classNamesProp, mapping, size],\n );\n\n const values = useMemo<\n [[typeof AriaTextContext, ContextValue<TextProps, HTMLElement>]]\n >(\n () => [[AriaTextContext, { className: classNames?.label }]],\n [classNames?.label],\n );\n\n const style = useMemo(\n () =>\n inlineVars(chipStateVars, {\n allowsRemoving: false,\n color,\n selectionBehavior: 'toggle',\n selectionMode: 'none',\n size,\n isDisabled: false,\n isFocused: false,\n isFocusVisible: false,\n isHovered: false,\n isPressed: false,\n isSelected: false,\n }),\n [color, size],\n );\n\n return (\n <Provider values={values}>\n <div className={classNames?.container} style={style}>\n <div className={classNames?.chip}>{children}</div>\n </div>\n </Provider>\n );\n}\n\nexport const ChipContext =\n createContext<ContextValue<ChipItemProps, HTMLDivElement>>(null);\n\n/**\n * Must be used in conjunction with ChipList & ChipGroup and\n * cannot be used outside of ChipList, else will throw error\n *\n * Color & Size props can be passed in from ChipGroup and overriden\n * on each instance of this components\n *\n * Order of precedence (from lowest to highest):\n * Design System Defaults of Chip\n * Global Defaults of ChipGroup\n * Instance of ChipGroup\n * Global Defaults of ChipItem\n * Instance of ChipItem\n */\nexport const ChipItem = forwardRef(function ChipItem(\n props: ChipItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(props, ref, ChipContext);\n const finalProps = useDefaultProps(contextProps, 'Chip');\n\n const {\n children: childrenProp,\n id,\n classNames: classNamesProp,\n color = defaults.color,\n size = defaults.size,\n textValue,\n mapping: mappingProp,\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(chipClassNames, theme.Chip, classNamesProp, {\n chip: mapping.font[size],\n }),\n [theme.Chip, classNamesProp, mapping, size],\n );\n\n const values = useMemo<\n [\n [typeof RACTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof ButtonContext, ContextValue<ButtonProps, HTMLButtonElement>],\n ]\n >(\n () => [\n // Because ChipGroup (TagGroup) implements a TextContext, we need to block it inside of the Chip\n // so that there isn't a conflict of with our AriaTextContext. Otherwise there are slot errors\n [RACTextContext, null],\n [AriaTextContext, { className: classNames?.label }],\n [\n ButtonContext,\n {\n ...mapping.remove[size],\n classNames: { button: classNames?.remove },\n slot: 'remove',\n },\n ],\n ],\n [classNames?.label, classNames?.remove, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: TagRenderProps) =>\n inlineVars(chipStateVars, {\n ...renderProps,\n color,\n size,\n }),\n [color, size],\n );\n\n const children = useCallback(\n (renderProps: TagRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.chip}>\n {callRenderProps(childrenProp, renderProps)}\n </div>\n </Provider>\n ),\n [values, classNames?.chip, childrenProp],\n );\n\n return (\n <Tag\n {...rest}\n ref={contextRef}\n id={id ?? textValue}\n className={classNames?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </Tag>\n );\n});\n\n/**\n * Must be used in conjunction with ChipItem & ChipGroup and\n * cannot be used outside of ChipGroup, else will throw error\n */\nexport function ChipList<T extends object>({\n classNames: classNamesProp,\n ...rest\n}: ChipListProps<T>) {\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(chipClassNames, theme.Chip, classNamesProp),\n [theme.Chip, classNamesProp],\n );\n\n return <TagList<T> {...rest} className={classNames?.list} />;\n}\n\nexport const ChipGroupContext =\n createContext<ContextValue<ChipGroupProps, HTMLDivElement>>(null);\n\n/**\n * Color & Size props are passed down to ChipItem but can be overridden\n * on each component if desired\n */\nexport const ChipGroup = forwardRef(function ChipGroup(\n props: ChipGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, finalRef] = useContextProps(\n props,\n ref,\n ChipGroupContext,\n );\n const finalProps = useDefaultProps(contextProps, 'ChipGroup');\n\n const {\n children,\n classNames: classNamesProp,\n color,\n size,\n ...rest\n } = finalProps;\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(chipClassNames, theme.Chip, classNamesProp),\n [theme.Chip, classNamesProp],\n );\n\n const values = useMemo<\n [[typeof ChipContext, ContextValue<ChipItemProps, HTMLDivElement>]]\n >(\n () => [[ChipContext, { classNames, color, size }]],\n [classNames, color, size],\n );\n\n return (\n <TagGroup {...rest} ref={finalRef} className={classNames?.group}>\n <Provider values={values}>{children}</Provider>\n </TagGroup>\n );\n});\n"]}
@@ -30,11 +30,7 @@ var defaultMapping = {
30
30
  };
31
31
  var ComboBoxContext = createContext(null);
32
32
  var ComboBox = forwardRef(function ComboBox2(props, ref) {
33
- const [contextProps, contextRef] = useContextProps(
34
- props,
35
- ref,
36
- ComboBoxContext
37
- );
33
+ const [contextProps, finalRef] = useContextProps(props, ref, ComboBoxContext);
38
34
  const finalProps = useDefaultProps(contextProps, "ComboBox");
39
35
  const {
40
36
  children: childrenProp,
@@ -110,7 +106,7 @@ var ComboBox = forwardRef(function ComboBox2(props, ref) {
110
106
  ComboBox$1,
111
107
  {
112
108
  ...finalProps,
113
- ref: contextRef,
109
+ ref: finalRef,
114
110
  className: classNames?.container,
115
111
  style,
116
112
  children
@@ -1 +1 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AAA;AAAA,IACf,CAAC,WAAA,qBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,QAAA,EAC1B,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,MAAA,EACP,QAAA,EAAA,eAAA,CAAgB,YAAA,EAAc;AAAA,MAC7B,GAAG,WAAA;AAAA,MACH,eAAA,EAAiB;AAAA,KAClB,GACH,CAAA,EACF,CAAA;AAAA,IAEF,CAAC,UAAA,EAAY,QAAA,EAAU,MAAA,EAAQ,YAAY;AAAA,GAC7C;AAEA,EAAA,uBACE,GAAA;AAAA,IAACC,UAAA;AAAA,IAAA;AAAA,MACE,GAAG,UAAA;AAAA,MACJ,GAAA,EAAK,UAAA;AAAA,MACL,WAAW,UAAA,EAAY,SAAA;AAAA,MACvB,KAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAC","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n type ForwardedRef,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ComboBoxRenderProps,\n type ContextValue,\n type FieldErrorProps,\n type LabelProps,\n Provider,\n ComboBox as RACComboBox,\n type GroupProps as RACGroupProps,\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 AriaLabelContext,\n AriaTextContext,\n} from '../aria';\nimport { ButtonContext } from '../button';\nimport { InputContext } from '../input';\nimport { OptionsContext } from '../options';\nimport { comboBoxClassNames, comboBoxStateVars } from './combo-box.css';\nimport type { ButtonProps } from '../button/types';\nimport type { InputProps } from '../input/types';\nimport type { OptionsProps } from '../options/types';\nimport type { ComboBoxMapping, ComboBoxProps } from './types';\n\nconst defaultMapping: ComboBoxMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n error: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n toggle: {\n sm: { size: 'sm', variant: 'icon' },\n lg: { size: 'md', variant: 'icon' },\n },\n};\n\nexport const ComboBoxContext =\n createContext<ContextValue<ComboBoxProps<object>, HTMLDivElement>>(null);\n\nexport const ComboBox = forwardRef(function ComboBox<T extends object>(\n props: ComboBoxProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(\n props,\n ref,\n ComboBoxContext,\n );\n const finalProps = useDefaultProps(contextProps, 'ComboBox');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = 'lg',\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(comboBoxClassNames, theme.ComboBox, classNamesProp, {\n description: mapping.description[size],\n error: mapping.error[size],\n }),\n [theme.ComboBox, classNamesProp, mapping, size],\n );\n\n const values = useMemo<\n [\n [typeof AriaLabelContext, ContextValue<LabelProps, HTMLLabelElement>],\n [typeof AriaGroupContext, ContextValue<RACGroupProps, HTMLDivElement>],\n [typeof InputContext, ContextValue<InputProps, HTMLInputElement>],\n [typeof ButtonContext, ContextValue<ButtonProps, HTMLButtonElement>],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [\n typeof AriaFieldErrorContext,\n ContextValue<FieldErrorProps, HTMLElement>,\n ],\n [typeof OptionsContext, ContextValue<OptionsProps, HTMLElement>],\n ]\n >(\n () => [\n [\n AriaLabelContext,\n {\n className: classNames?.label,\n },\n ],\n [\n AriaGroupContext,\n {\n className: classNames?.group,\n },\n ],\n [InputContext, { classNames: classNames?.input, size }],\n [\n ButtonContext,\n {\n ...mapping.toggle[size],\n classNames: classNames?.toggle,\n },\n ],\n [\n AriaTextContext,\n {\n slots: {\n description: { className: classNames?.description },\n },\n },\n ],\n [AriaFieldErrorContext, { className: classNames?.error }],\n [OptionsContext, { classNames: classNames?.options, size }],\n ],\n [classNames, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: ComboBoxRenderProps) =>\n inlineVars(comboBoxStateVars, {\n ...renderProps,\n size,\n }),\n [size],\n );\n\n const children = useCallback(\n (renderProps: ComboBoxRenderProps) => (\n <div className={classNames?.comboBox}>\n <Provider values={values}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </Provider>\n </div>\n ),\n [classNames?.comboBox, values, childrenProp],\n );\n\n return (\n <RACComboBox\n {...finalProps}\n ref={contextRef}\n className={classNames?.container}\n style={style}\n >\n {children}\n </RACComboBox>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/combo-box/index.tsx"],"names":["ComboBox","RACComboBox"],"mappings":";;;;;;;;;;;;;;;;AAkDA,IAAM,cAAA,GAAkC;AAAA,EACtC,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,MAAA,EAAQ;AAAA,IACN,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA,EAAO;AAAA,IAClC,EAAA,EAAI,EAAE,IAAA,EAAM,IA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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 ComboBoxRenderProps,\n type ContextValue,\n type FieldErrorProps,\n type LabelProps,\n Provider,\n ComboBox as RACComboBox,\n type GroupProps as RACGroupProps,\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 AriaLabelContext,\n AriaTextContext,\n} from '../aria';\nimport { ButtonContext } from '../button';\nimport { InputContext } from '../input';\nimport { OptionsContext } from '../options';\nimport { comboBoxClassNames, comboBoxStateVars } from './combo-box.css';\nimport type { ButtonProps } from '../button/types';\nimport type { InputProps } from '../input/types';\nimport type { OptionsProps } from '../options/types';\nimport type { ComboBoxMapping, ComboBoxProps } from './types';\n\nconst defaultMapping: ComboBoxMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n error: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n toggle: {\n sm: { size: 'sm', variant: 'icon' },\n lg: { size: 'md', variant: 'icon' },\n },\n};\n\nexport const ComboBoxContext =\n createContext<ContextValue<ComboBoxProps<object>, HTMLDivElement>>(null);\n\nexport const ComboBox = forwardRef(function ComboBox<T extends object>(\n props: ComboBoxProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, finalRef] = useContextProps(props, ref, ComboBoxContext);\n const finalProps = useDefaultProps(contextProps, 'ComboBox');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = 'lg',\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(comboBoxClassNames, theme.ComboBox, classNamesProp, {\n description: mapping.description[size],\n error: mapping.error[size],\n }),\n [theme.ComboBox, classNamesProp, mapping, size],\n );\n\n const values = useMemo<\n [\n [typeof AriaLabelContext, ContextValue<LabelProps, HTMLLabelElement>],\n [typeof AriaGroupContext, ContextValue<RACGroupProps, HTMLDivElement>],\n [typeof InputContext, ContextValue<InputProps, HTMLInputElement>],\n [typeof ButtonContext, ContextValue<ButtonProps, HTMLButtonElement>],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [\n typeof AriaFieldErrorContext,\n ContextValue<FieldErrorProps, HTMLElement>,\n ],\n [typeof OptionsContext, ContextValue<OptionsProps, HTMLElement>],\n ]\n >(\n () => [\n [\n AriaLabelContext,\n {\n className: classNames?.label,\n },\n ],\n [\n AriaGroupContext,\n {\n className: classNames?.group,\n },\n ],\n [InputContext, { classNames: classNames?.input, size }],\n [\n ButtonContext,\n {\n ...mapping.toggle[size],\n classNames: classNames?.toggle,\n },\n ],\n [\n AriaTextContext,\n {\n slots: {\n description: { className: classNames?.description },\n },\n },\n ],\n [AriaFieldErrorContext, { className: classNames?.error }],\n [OptionsContext, { classNames: classNames?.options, size }],\n ],\n [classNames, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: ComboBoxRenderProps) =>\n inlineVars(comboBoxStateVars, {\n ...renderProps,\n size,\n }),\n [size],\n );\n\n const children = useCallback(\n (renderProps: ComboBoxRenderProps) => (\n <div className={classNames?.comboBox}>\n <Provider values={values}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </Provider>\n </div>\n ),\n [classNames?.comboBox, values, childrenProp],\n );\n\n return (\n <RACComboBox\n {...finalProps}\n ref={finalRef}\n className={classNames?.container}\n style={style}\n >\n {children}\n </RACComboBox>\n );\n});\n"]}
@@ -30,7 +30,7 @@ var defaultMapping = {
30
30
  var defaultSize = "lg";
31
31
  var DateFieldContext = createContext(null);
32
32
  var DateField = forwardRef(function DateField2(props, ref) {
33
- const [contextProps, contextRef] = useContextProps(
33
+ const [contextProps, finalRef] = useContextProps(
34
34
  props,
35
35
  ref,
36
36
  DateFieldContext
@@ -99,7 +99,7 @@ var DateField = forwardRef(function DateField2(props, ref) {
99
99
  DateField$1,
100
100
  {
101
101
  ...rest,
102
- ref: contextRef,
102
+ ref: finalRef,
103
103
  className: classNames?.container,
104
104
  style,
105
105
  value,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/date-field/index.tsx"],"names":["DateField","RACDateField"],"mappings":";;;;;;;;;;;;;;;AAmDA,IAAM,cAAA,GAAmC;AAAA,EACvC,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAK;AAAA,IACjB,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA;AAAK;AAErB,CAAA;AAEA,IAAM,WAAA,GAAc,IAAA;AAEb,IAAM,gBAAA,GACX,cAAuE,IAAI;AAEtE,IAAM,SAAA,GAAY,UAAA,CAAW,SAASA,UAAAA,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AA,MAC1D,CAAC,YAAA,EAAc,EAAE,SAAA,EAAW,UAAA,EAAY,OAAO,CAAA;AAAA,MAC/C;AAAA,QACE,eAAA;AAAA,QACA;AAAA,UACE,KAAA,EAAO;AAAA,YACL,WAAA,EAAa,EAAE,SAAA,EAAW,UAAA,EAAY,WAAA;AAAY;AACpD;AACF,OACF;AAAA,MACA,CAAC,qBAAA,EAAuB,EAAE,SAAA,EAAW,UAAA,EAAY,OAAO,CAAA;AAAA,MACxD,CAAC,WAAA,EAAa,EAAE,GAAG,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAA,EAAG,UAAA,EAAY,UAAA,EAAY,IAAA,EAAM;AAAA,KACvE;AAAA,IACA,CAAC,UAAA,EAAY,OAAA,EAAS,IAAI;AAAA,GAC5B;AAEA,EAAA,MAAM,QAAA,GAAW,WAAA;AAAA,IACf,CAAC,WAAA,KAAsC;AACrC,MAAA,uBACE,GAAA,CAAC,YAAS,MAAA,EACR,QAAA,kBAAA,GAAA,CAAC,SAAI,SAAA,EAAW,UAAA,EAAY,SAAA,EACzB,QAAA,EAAA,eAAA,CAAgB,YAAA,EAAc;AAAA,QAC7B,GAAG,WAAA;AAAA,QACH,eAAA,EAAiB;AAAA,OAClB,GACH,CAAA,EACF,CAAA;AAAA,IAEJ,CAAA;AAAA,IACA,CAAC,YAAA,EAAc,MAAA,EAAQ,UAAA,EAAY,SAAS;AAAA,GAC9C;AAEA,EAAA,uBACE,GAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,UAAA;AAAA,MACL,WAAW,UAAA,EAAY,SAAA;AAAA,MACvB,KAAA;AAAA,MACA,KAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAC","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n type ForwardedRef,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n type DateValue,\n type FieldErrorProps,\n LabelContext,\n type LabelProps,\n Provider,\n DateField as RACDateField,\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 type AriaLabelContext,\n AriaTextContext,\n} from '../aria';\nimport { DateInputContext } from '../date-input';\nimport { IconContext } from '../icon';\nimport { dateFieldClassNames, dateFieldStateVars } from './date-field.css';\nimport type { DateInputProps } from '../date-input/types';\nimport type { IconProps } from '../icon/types';\nimport type {\n DateFieldMapping,\n DateFieldProps,\n DateFieldRenderProps,\n} from './types';\n\nconst defaultMapping: DateFieldMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n error: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n icon: {\n sm: { size: 'xs' },\n lg: { size: 'md' },\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const DateFieldContext =\n createContext<ContextValue<DateFieldProps<DateValue>, HTMLDivElement>>(null);\n\nexport const DateField = forwardRef(function DateField<T extends DateValue>(\n props: DateFieldProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(\n props,\n ref,\n DateFieldContext,\n );\n\n const finalProps = useDefaultProps(\n contextProps as DateFieldProps<DateValue>,\n 'DateField',\n ) as DateFieldProps<T>;\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n value,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(dateFieldClassNames, theme.DateField, classNamesProp, {\n description: mapping.description[size],\n error: mapping.error[size],\n }),\n [theme.DateField, classNamesProp, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: DateFieldRenderProps) =>\n inlineVars(dateFieldStateVars, {\n ...renderProps,\n size,\n }),\n [size],\n );\n\n const values = useMemo<\n [\n [typeof DateInputContext, ContextValue<DateInputProps, HTMLDivElement>],\n [typeof AriaLabelContext, ContextValue<LabelProps, HTMLLabelElement>],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [\n typeof AriaFieldErrorContext,\n ContextValue<FieldErrorProps, HTMLElement>,\n ],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n ]\n >(\n () => [\n [DateInputContext, { classNames: classNames?.input, size }],\n [LabelContext, { className: classNames?.label }],\n [\n AriaTextContext,\n {\n slots: {\n description: { className: classNames?.description },\n },\n },\n ],\n [AriaFieldErrorContext, { className: classNames?.error }],\n [IconContext, { ...mapping.icon[size], classNames: classNames?.icon }],\n ],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: DateFieldRenderProps) => {\n return (\n <Provider values={values}>\n <div className={classNames?.dateField}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n );\n },\n [childrenProp, values, classNames?.dateField],\n );\n\n return (\n <RACDateField\n {...rest}\n ref={contextRef}\n className={classNames?.container}\n style={style}\n value={value}\n >\n {children}\n </RACDateField>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/date-field/index.tsx"],"names":["DateField","RACDateField"],"mappings":";;;;;;;;;;;;;;;AAmDA,IAAM,cAAA,GAAmC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,EACF,CAAA;AAAA,IAEJ,CAAA;AAAA,IACA,CAAC,YAAA,EAAc,MAAA,EAAQ,UAAA,EAAY,SAAS;AAAA,GAC9C;AAEA,EAAA,uBACE,GAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,QAAA;AAAA,MACL,WAAW,UAAA,EAAY,SAAA;AAAA,MACvB,KAAA;AAAA,MACA,KAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAC","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n type ForwardedRef,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n type DateValue,\n type FieldErrorProps,\n LabelContext,\n type LabelProps,\n Provider,\n DateField as RACDateField,\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 type AriaLabelContext,\n AriaTextContext,\n} from '../aria';\nimport { DateInputContext } from '../date-input';\nimport { IconContext } from '../icon';\nimport { dateFieldClassNames, dateFieldStateVars } from './date-field.css';\nimport type { DateInputProps } from '../date-input/types';\nimport type { IconProps } from '../icon/types';\nimport type {\n DateFieldMapping,\n DateFieldProps,\n DateFieldRenderProps,\n} from './types';\n\nconst defaultMapping: DateFieldMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n error: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n icon: {\n sm: { size: 'xs' },\n lg: { size: 'md' },\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const DateFieldContext =\n createContext<ContextValue<DateFieldProps<DateValue>, HTMLDivElement>>(null);\n\nexport const DateField = forwardRef(function DateField<T extends DateValue>(\n props: DateFieldProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, finalRef] = useContextProps(\n props,\n ref,\n DateFieldContext,\n );\n\n const finalProps = useDefaultProps(\n contextProps as DateFieldProps<DateValue>,\n 'DateField',\n ) as DateFieldProps<T>;\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n value,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(dateFieldClassNames, theme.DateField, classNamesProp, {\n description: mapping.description[size],\n error: mapping.error[size],\n }),\n [theme.DateField, classNamesProp, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: DateFieldRenderProps) =>\n inlineVars(dateFieldStateVars, {\n ...renderProps,\n size,\n }),\n [size],\n );\n\n const values = useMemo<\n [\n [typeof DateInputContext, ContextValue<DateInputProps, HTMLDivElement>],\n [typeof AriaLabelContext, ContextValue<LabelProps, HTMLLabelElement>],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [\n typeof AriaFieldErrorContext,\n ContextValue<FieldErrorProps, HTMLElement>,\n ],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n ]\n >(\n () => [\n [DateInputContext, { classNames: classNames?.input, size }],\n [LabelContext, { className: classNames?.label }],\n [\n AriaTextContext,\n {\n slots: {\n description: { className: classNames?.description },\n },\n },\n ],\n [AriaFieldErrorContext, { className: classNames?.error }],\n [IconContext, { ...mapping.icon[size], classNames: classNames?.icon }],\n ],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: DateFieldRenderProps) => {\n return (\n <Provider values={values}>\n <div className={classNames?.dateField}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n );\n },\n [childrenProp, values, classNames?.dateField],\n );\n\n return (\n <RACDateField\n {...rest}\n ref={finalRef}\n className={classNames?.container}\n style={style}\n value={value}\n >\n {children}\n </RACDateField>\n );\n});\n"]}
@@ -24,7 +24,7 @@ var defaultMapping = {
24
24
  var defaultSize = "lg";
25
25
  var DateInputContext = createContext(null);
26
26
  var DateInput = forwardRef(function DateInput2(props, ref) {
27
- const [contextProps, contextRef] = useContextProps(
27
+ const [contextProps, finalRef] = useContextProps(
28
28
  props,
29
29
  ref,
30
30
  DateInputContext
@@ -75,7 +75,7 @@ var DateInput = forwardRef(function DateInput2(props, ref) {
75
75
  /* @__PURE__ */ jsx(
76
76
  Group,
77
77
  {
78
- ref: contextRef,
78
+ ref: finalRef,
79
79
  ...rest,
80
80
  className: classNames?.input?.container,
81
81
  style,
@@ -107,7 +107,7 @@ var DateSegments = forwardRef(
107
107
  var DateSegmentContext = createContext(null);
108
108
  var DateSegment = forwardRef(
109
109
  function DateSegment2(props, ref) {
110
- const [contextProps, contextRef] = useContextProps(
110
+ const [contextProps, finalRef] = useContextProps(
111
111
  props,
112
112
  ref,
113
113
  DateSegmentContext
@@ -143,7 +143,7 @@ var DateSegment = forwardRef(
143
143
  return /* @__PURE__ */ jsx(
144
144
  DateSegment$1,
145
145
  {
146
- ref: contextRef,
146
+ ref: finalRef,
147
147
  ...rest,
148
148
  style,
149
149
  className: classNames?.segment?.container,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/date-input/index.tsx"],"names":["DateInput","Fragment","DateSegment","RACDateSegment"],"mappings":";;;;;;;;;;;;;AAkDA,IAAM,cAAA,GAAiB;A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iant 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 FC,\n type ForwardedRef,\n Fragment,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n DateFieldStateContext,\n Group,\n DateSegment as RACDateSegment,\n type SlotProps,\n TimeFieldStateContext,\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 { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { Input } from '../input';\nimport {\n dateInputClassNames,\n dateInputStateVars,\n dateSegmentStateVars,\n} from './date-input.css';\nimport type {\n DateInputProps,\n DateInputRenderProps,\n DateSegmentProps,\n DateSegmentRenderProps,\n DateSegmentsProps,\n} from './types';\n\nconst defaultMapping = {\n icon: {\n sm: { size: 'xs' },\n lg: { size: 'md' },\n },\n input: {\n sm: inputs.sm,\n lg: inputs.lg,\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const DateInputContext =\n createContext<ContextValue<DateInputProps, HTMLDivElement>>(null);\n\nexport const DateInput = forwardRef(function DateInput(\n props: DateInputProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(\n props,\n ref,\n DateInputContext,\n );\n const finalProps = useDefaultProps(contextProps, 'DateInput');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n provider,\n ...rest\n } = finalProps;\n\n const dateFieldState = useContext(DateFieldStateContext);\n const timeFieldState = useContext(TimeFieldStateContext);\n const state = dateFieldState ?? timeFieldState ?? null;\n\n if (!state) {\n throw new Error(\n 'Date Input component must be used as a child of either DateField or TimeField.',\n );\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(dateInputClassNames, theme.DateInput, classNamesProp, {\n input: { input: mapping.input[size] },\n }),\n [theme.DateInput, classNamesProp, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: DateInputRenderProps) =>\n inlineVars(dateInputStateVars, { ...renderProps, size }),\n [size],\n );\n\n const children = useCallback(\n (renderProps: DateInputRenderProps) => (\n <div className={classNames?.input?.input}>\n {childrenProp &&\n (provider ? (\n callRenderProps(childrenProp, { ...renderProps, ...state })\n ) : (\n // biome-ignore lint/complexity/noUselessFragments: children group needs to be wrapped\n <>\n {state.segments.map((segment, idx) => (\n <Fragment key={`${segment.type}_${idx}`}>\n {childrenProp(segment)}\n </Fragment>\n ))}\n </>\n ))}\n </div>\n ),\n [childrenProp, state, provider, classNames?.input],\n );\n\n return (\n <>\n <Group\n ref={contextRef}\n {...rest}\n className={classNames?.input?.container}\n style={style}\n >\n {children}\n </Group>\n <Input />\n </>\n );\n});\n\nexport const DateSegments = forwardRef(\n (props: DateSegmentsProps, ref: ForwardedRef<HTMLDivElement>) => {\n const { children, classNames: classNamesProp } = props;\n\n const dateFieldState = useContext(DateFieldStateContext);\n const timeFieldState = useContext(TimeFieldStateContext);\n const state = dateFieldState ?? timeFieldState ?? null;\n\n if (!state) {\n throw new Error(\n 'Date Segments component must be used as a child of either DateField or TimeField.',\n );\n }\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () =>\n mergeClassNames(dateInputClassNames, theme.DateInput, classNamesProp),\n [theme.DateInput, classNamesProp],\n );\n\n return (\n <div className={classNames?.input?.segments} ref={ref}>\n {state.segments.map((segment, idx) => (\n <Fragment key={`${segment.type}_${idx}`}>\n {children(segment)}\n </Fragment>\n ))}\n </div>\n );\n },\n);\n\nexport const DateSegmentContext =\n createContext<ContextValue<SlotProps, HTMLDivElement>>(null);\n\nexport const DateSegment: FC<DateSegmentProps> = forwardRef(\n function DateSegment(\n props: DateSegmentProps,\n ref: ForwardedRef<HTMLDivElement>,\n ) {\n const [contextProps, contextRef] = useContextProps(\n props,\n ref,\n DateSegmentContext,\n );\n\n const {\n classNames: classNamesProp,\n children: childrenProp,\n ...rest\n } = contextProps;\n\n const classNames = useMemo(\n () => mergeClassNames(dateInputClassNames, classNamesProp),\n [classNamesProp],\n );\n\n const style = useCallback(\n (renderProps: DateSegmentRenderProps) =>\n inlineVars(dateSegmentStateVars, {\n ...renderProps,\n }),\n [],\n );\n\n const children = useCallback(\n (renderProps: DateSegmentRenderProps) => {\n const { isPlaceholder, placeholder, text, value } = renderProps;\n if (typeof childrenProp === 'function') {\n return childrenProp({ ...renderProps, defaultChildren: null });\n }\n\n if (isPlaceholder) {\n return placeholder;\n }\n\n return (\n <div className={classNames?.segment?.segment}>{value ?? text}</div>\n );\n },\n [childrenProp, classNames],\n );\n\n return (\n <RACDateSegment\n ref={contextRef}\n {...rest}\n style={style}\n className={classNames?.segment?.container}\n >\n {children}\n </RACDateSegment>\n );\n },\n);\n"]}
1
+ {"version":3,"sources":["../../../src/components/date-input/index.tsx"],"names":["DateInput","Fragment","DateSegment","RACDateSegment"],"mappings":";;;;;;;;;;;;;AAkDA,IAAM,cAAA,GAAiB;AAAA,EACrB,IAAA,EAAM;AAAA,IACJ,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAK;AAAA,IACjB,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA;AAAK,GACnB;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA;AAEf,CAAA;AAEA,IAAM,WAAA,GAAc,IAAA;AAEb,I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CAAA;AAAA,MACzD,CAAC,cAAc;AAAA,KACjB;AAEA,IAAA,MAAM,KAAA,GAAQ,WAAA;AAAA,MACZ,CAAC,WAAA,KACC,UAAA,CAAW,oBAAA,EAAsB;AAAA,QAC/B,GAAG;AAAA,OACJ,CAAA;AAAA,MACH;AAAC,KACH;AAEA,IAAA,MAAM,QAAA,GAAW,WAAA;AAAA,MACf,CAAC,WAAA,KAAwC;AACvC,QAAA,MAAM,EAAE,aAAA,EAAe,WAAA,EAAa,IAAA,EAAM,OAAM,GAAI,WAAA;AACpD,QAAA,IAAI,OAAO,iBAAiB,UAAA,EAAY;AACtC,UAAA,OAAO,aAAa,EAAE,GAAG,WAAA,EAAa,eAAA,EAAiB,MAAM,CAAA;AAAA,QAC/D;AAEA,QAAA,IAAI,aAAA,EAAe;AACjB,UAAA,OAAO,WAAA;AAAA,QACT;AAEA,QAAA,2BACG,KAAA,EAAA,EAAI,SAAA,EAAW,YAAY,OAAA,EAAS,OAAA,EAAU,mBAAS,IAAA,EAAK,CAAA;AAAA,MAEjE,CAAA;AAAA,MACA,CAAC,cAAc,UAAU;AAAA,KAC3B;AAEA,IAAA,uBACE,GAAA;AAAA,MAACC,aAAA;AAAA,MAAA;AAAA,QACC,GAAA,EAAK,QAAA;AAAA,QACJ,GAAG,IAAA;AAAA,QACJ,KAAA;AAAA,QACA,SAAA,EAAW,YAAY,OAAA,EAAS,SAAA;AAAA,QAE/B;AAAA;AAAA,KACH;AAAA,EAEJ;AACF","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 FC,\n type ForwardedRef,\n Fragment,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n DateFieldStateContext,\n Group,\n DateSegment as RACDateSegment,\n type SlotProps,\n TimeFieldStateContext,\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 { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { Input } from '../input';\nimport {\n dateInputClassNames,\n dateInputStateVars,\n dateSegmentStateVars,\n} from './date-input.css';\nimport type {\n DateInputProps,\n DateInputRenderProps,\n DateSegmentProps,\n DateSegmentRenderProps,\n DateSegmentsProps,\n} from './types';\n\nconst defaultMapping = {\n icon: {\n sm: { size: 'xs' },\n lg: { size: 'md' },\n },\n input: {\n sm: inputs.sm,\n lg: inputs.lg,\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const DateInputContext =\n createContext<ContextValue<DateInputProps, HTMLDivElement>>(null);\n\nexport const DateInput = forwardRef(function DateInput(\n props: DateInputProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, finalRef] = useContextProps(\n props,\n ref,\n DateInputContext,\n );\n const finalProps = useDefaultProps(contextProps, 'DateInput');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n provider,\n ...rest\n } = finalProps;\n\n const dateFieldState = useContext(DateFieldStateContext);\n const timeFieldState = useContext(TimeFieldStateContext);\n const state = dateFieldState ?? timeFieldState ?? null;\n\n if (!state) {\n throw new Error(\n 'Date Input component must be used as a child of either DateField or TimeField.',\n );\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(dateInputClassNames, theme.DateInput, classNamesProp, {\n input: { input: mapping.input[size] },\n }),\n [theme.DateInput, classNamesProp, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: DateInputRenderProps) =>\n inlineVars(dateInputStateVars, { ...renderProps, size }),\n [size],\n );\n\n const children = useCallback(\n (renderProps: DateInputRenderProps) => (\n <div className={classNames?.input?.input}>\n {childrenProp &&\n (provider ? (\n callRenderProps(childrenProp, { ...renderProps, ...state })\n ) : (\n // biome-ignore lint/complexity/noUselessFragments: children group needs to be wrapped\n <>\n {state.segments.map((segment, idx) => (\n <Fragment key={`${segment.type}_${idx}`}>\n {childrenProp(segment)}\n </Fragment>\n ))}\n </>\n ))}\n </div>\n ),\n [childrenProp, state, provider, classNames?.input],\n );\n\n return (\n <>\n <Group\n ref={finalRef}\n {...rest}\n className={classNames?.input?.container}\n style={style}\n >\n {children}\n </Group>\n <Input />\n </>\n );\n});\n\nexport const DateSegments = forwardRef(\n (props: DateSegmentsProps, ref: ForwardedRef<HTMLDivElement>) => {\n const { children, classNames: classNamesProp } = props;\n\n const dateFieldState = useContext(DateFieldStateContext);\n const timeFieldState = useContext(TimeFieldStateContext);\n const state = dateFieldState ?? timeFieldState ?? null;\n\n if (!state) {\n throw new Error(\n 'Date Segments component must be used as a child of either DateField or TimeField.',\n );\n }\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () =>\n mergeClassNames(dateInputClassNames, theme.DateInput, classNamesProp),\n [theme.DateInput, classNamesProp],\n );\n\n return (\n <div className={classNames?.input?.segments} ref={ref}>\n {state.segments.map((segment, idx) => (\n <Fragment key={`${segment.type}_${idx}`}>\n {children(segment)}\n </Fragment>\n ))}\n </div>\n );\n },\n);\n\nexport const DateSegmentContext =\n createContext<ContextValue<SlotProps, HTMLDivElement>>(null);\n\nexport const DateSegment: FC<DateSegmentProps> = forwardRef(\n function DateSegment(\n props: DateSegmentProps,\n ref: ForwardedRef<HTMLDivElement>,\n ) {\n const [contextProps, finalRef] = useContextProps(\n props,\n ref,\n DateSegmentContext,\n );\n\n const {\n classNames: classNamesProp,\n children: childrenProp,\n ...rest\n } = contextProps;\n\n const classNames = useMemo(\n () => mergeClassNames(dateInputClassNames, classNamesProp),\n [classNamesProp],\n );\n\n const style = useCallback(\n (renderProps: DateSegmentRenderProps) =>\n inlineVars(dateSegmentStateVars, {\n ...renderProps,\n }),\n [],\n );\n\n const children = useCallback(\n (renderProps: DateSegmentRenderProps) => {\n const { isPlaceholder, placeholder, text, value } = renderProps;\n if (typeof childrenProp === 'function') {\n return childrenProp({ ...renderProps, defaultChildren: null });\n }\n\n if (isPlaceholder) {\n return placeholder;\n }\n\n return (\n <div className={classNames?.segment?.segment}>{value ?? text}</div>\n );\n },\n [childrenProp, classNames],\n );\n\n return (\n <RACDateSegment\n ref={finalRef}\n {...rest}\n style={style}\n className={classNames?.segment?.container}\n >\n {children}\n </RACDateSegment>\n );\n },\n);\n"]}
@@ -44,7 +44,7 @@ var defaultMapping = {
44
44
  };
45
45
  var DialogContext = createContext(null);
46
46
  var Dialog = forwardRef(function Dialog2(props, ref) {
47
- const [contextProps, contextRef] = useContextProps(props, ref, DialogContext);
47
+ const [contextProps, finalRef] = useContextProps(props, ref, DialogContext);
48
48
  const finalProps = useDefaultProps(contextProps, "Dialog");
49
49
  const {
50
50
  children: childrenProp,
@@ -178,7 +178,7 @@ var Dialog = forwardRef(function Dialog2(props, ref) {
178
178
  ModalOverlay,
179
179
  {
180
180
  ...rest,
181
- ref: contextRef,
181
+ ref: finalRef,
182
182
  className: classNames?.container,
183
183
  style,
184
184
  UNSTABLE_portalContainer: portal,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/dialog/index.tsx"],"names":["Dialog","RACDialog"],"mappings":";;;;;;;;;;;;;;;;;;AAkDA,IAAM,WAAA,GAA6B,CAAC,IAAA,EAAM,IAAI,CAAA;AAE9C,IAAM,cAAA,GAAgC;AAAA,EACpC,OAAA,EAAS;AAAA,IACP,EAAA,EAAI,EAAE,SAAA,EAAW,QAAA,CA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,KAAA;AAAA,MACA,wBAAA,EAA0B,MAAA;AAAA,MAEzB;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 { useIsSSR } from '@react-aria/ssr';\nimport {\n createContext,\n type ForwardedRef,\n forwardRef,\n type HTMLAttributes,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport {\n type ContextValue,\n DEFAULT_SLOT,\n Modal,\n ModalOverlay,\n type ModalRenderProps,\n Provider,\n Dialog as RACDialog,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useSlot } from '../../hooks/use-slot';\nimport { useTheme } from '../../hooks/use-theme';\nimport { headings } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { AriaHeadingContext } from '../aria';\nimport { ButtonContext } from '../button';\nimport { ElementContext } from '../element';\nimport { GroupContext } from '../group';\nimport { dialogClassNames, dialogStateVars } from './dialog.css';\nimport type { OmitProtectedProps } from '../../types/props';\nimport type { ButtonProps } from '../button/types';\nimport type { ElementProps } from '../element/types';\nimport type { GroupProps } from '../group/types';\nimport type { DialogMapping, DialogProps, DialogSizes } from './types';\n\nconst dialogSizes: DialogSizes[] = ['sm', 'lg'];\n\nconst defaultMapping: DialogMapping = {\n heading: {\n sm: { className: headings.v4 },\n lg: { className: headings.v2 },\n },\n actions: {\n context: ButtonContext,\n orientation: 'horizontal',\n reverse: true,\n },\n primary: dialogSizes.reduce(\n (acc, size) => {\n acc[size] = { size };\n\n return acc;\n },\n {} as Record<DialogSizes, OmitProtectedProps<ButtonProps>>,\n ),\n close: dialogSizes.reduce(\n (acc, size) => {\n acc[size] = { size, variant: 'bare' };\n\n return acc;\n },\n {} as Record<DialogSizes, OmitProtectedProps<ButtonProps>>,\n ),\n};\n\nexport const DialogContext =\n createContext<ContextValue<DialogProps, HTMLDivElement>>(null);\n\nexport const Dialog = forwardRef(function Dialog(\n props: DialogProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, contextRef] = useContextProps(props, ref, DialogContext);\n const finalProps = useDefaultProps(contextProps, 'Dialog');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n parentRef,\n role,\n size = 'lg',\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n const isSSR = useIsSSR();\n const [portal, setPortal] = useState(isSSR ? null : document.body);\n\n const isGlobal = useMemo(\n () => !isSSR && portal === document.body,\n [isSSR, portal],\n );\n\n const mapping = useMemo(\n () => ({ ...defaultMapping, ...mappingProp }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(dialogClassNames, theme.Dialog, classNamesProp, {\n container: isGlobal ? theme.className : undefined,\n }),\n [theme.Dialog, classNamesProp, isGlobal, theme.className],\n );\n\n const [headerRef, hasHeader] = useSlot();\n\n const style = useCallback(\n ({ state, ...renderProps }: ModalRenderProps) => ({\n ...(isGlobal ? theme.style : {}),\n ...inlineVars(dialogStateVars, {\n hasHeader,\n size,\n ...renderProps,\n isGlobal,\n }),\n }),\n [size, theme.style, isGlobal, hasHeader],\n );\n\n const values = useMemo<\n [\n [\n typeof ElementContext,\n ContextValue<\n ElementProps<\n ContextValue<HTMLAttributes<HTMLElement>, HTMLHeadingElement>,\n ContextValue<\n GroupProps<ButtonProps, HTMLButtonElement>,\n HTMLDivElement\n >\n >,\n HTMLElement\n >,\n ],\n ]\n >(\n () => [\n [\n ElementContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n header: {\n as: 'header',\n className: classNames?.header,\n ref: headerRef,\n values: [\n [\n AriaHeadingContext,\n {\n ...mapping.heading[size],\n slot: 'title',\n },\n ],\n [GroupContext, null],\n ],\n },\n content: { className: classNames?.content },\n footer: {\n as: 'footer',\n className: classNames?.footer,\n values: [\n [AriaHeadingContext, null],\n [\n GroupContext,\n {\n values: {\n slots: {\n [DEFAULT_SLOT]: mapping.primary[size] ?? {},\n close: mapping.close[size] ?? {},\n },\n },\n ...mapping.actions,\n },\n ],\n ],\n },\n },\n },\n ],\n ],\n [\n classNames?.header,\n classNames?.content,\n classNames?.footer,\n headerRef,\n mapping.actions,\n mapping.heading,\n mapping.primary,\n mapping.close,\n size,\n ],\n );\n\n const children = useCallback(\n (renderProps: ModalRenderProps) => (\n <Provider values={values}>\n <Modal className={classNames?.modal}>\n <RACDialog className={classNames?.dialog} role={role}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n isGlobal,\n isOpen: renderProps.state.isOpen,\n })}\n </RACDialog>\n </Modal>\n </Provider>\n ),\n [\n values,\n classNames?.modal,\n classNames?.dialog,\n role,\n childrenProp,\n isGlobal,\n ],\n );\n\n useEffect(() => {\n const node = parentRef?.current;\n const port = isSSR ? null : document.createElement('div');\n\n if (node && port) {\n port.classList.add(classNames?.portal ?? '');\n\n node.appendChild(port);\n\n setPortal(port);\n }\n\n return () => {\n port?.remove();\n\n setPortal(isSSR ? null : document.body);\n };\n }, [isSSR, parentRef, classNames?.portal]);\n\n if (!portal) {\n return null;\n }\n\n return (\n <ModalOverlay\n {...rest}\n ref={contextRef}\n className={classNames?.container}\n style={style}\n UNSTABLE_portalContainer={portal}\n >\n {children}\n </ModalOverlay>\n );\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/dialog/index.tsx"],"names":["Dialog","RACDialog"],"mappings":";;;;;;;;;;;;;;;;;;AAkDA,IAAM,WAAA,GAA6B,CAAC,IAAA,EAAM,IAAI,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A,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,QAAA;AAAA,MACL,WAAW,UAAA,EAAY,SAAA;AAAA,MACvB,KAAA;AAAA,MACA,wBAAA,EAA0B,MAAA;AAAA,MAEzB;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 { useIsSSR } from '@react-aria/ssr';\nimport {\n createContext,\n type ForwardedRef,\n forwardRef,\n type HTMLAttributes,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport {\n type ContextValue,\n DEFAULT_SLOT,\n Modal,\n ModalOverlay,\n type ModalRenderProps,\n Provider,\n Dialog as RACDialog,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useSlot } from '../../hooks/use-slot';\nimport { useTheme } from '../../hooks/use-theme';\nimport { headings } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { AriaHeadingContext } from '../aria';\nimport { ButtonContext } from '../button';\nimport { ElementContext } from '../element';\nimport { GroupContext } from '../group';\nimport { dialogClassNames, dialogStateVars } from './dialog.css';\nimport type { OmitProtectedProps } from '../../types/props';\nimport type { ButtonProps } from '../button/types';\nimport type { ElementProps } from '../element/types';\nimport type { GroupProps } from '../group/types';\nimport type { DialogMapping, DialogProps, DialogSizes } from './types';\n\nconst dialogSizes: DialogSizes[] = ['sm', 'lg'];\n\nconst defaultMapping: DialogMapping = {\n heading: {\n sm: { className: headings.v4 },\n lg: { className: headings.v2 },\n },\n actions: {\n context: ButtonContext,\n orientation: 'horizontal',\n reverse: true,\n },\n primary: dialogSizes.reduce(\n (acc, size) => {\n acc[size] = { size };\n\n return acc;\n },\n {} as Record<DialogSizes, OmitProtectedProps<ButtonProps>>,\n ),\n close: dialogSizes.reduce(\n (acc, size) => {\n acc[size] = { size, variant: 'bare' };\n\n return acc;\n },\n {} as Record<DialogSizes, OmitProtectedProps<ButtonProps>>,\n ),\n};\n\nexport const DialogContext =\n createContext<ContextValue<DialogProps, HTMLDivElement>>(null);\n\nexport const Dialog = forwardRef(function Dialog(\n props: DialogProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [contextProps, finalRef] = useContextProps(props, ref, DialogContext);\n const finalProps = useDefaultProps(contextProps, 'Dialog');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n parentRef,\n role,\n size = 'lg',\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n const isSSR = useIsSSR();\n const [portal, setPortal] = useState(isSSR ? null : document.body);\n\n const isGlobal = useMemo(\n () => !isSSR && portal === document.body,\n [isSSR, portal],\n );\n\n const mapping = useMemo(\n () => ({ ...defaultMapping, ...mappingProp }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(dialogClassNames, theme.Dialog, classNamesProp, {\n container: isGlobal ? theme.className : undefined,\n }),\n [theme.Dialog, classNamesProp, isGlobal, theme.className],\n );\n\n const [headerRef, hasHeader] = useSlot();\n\n const style = useCallback(\n ({ state, ...renderProps }: ModalRenderProps) => ({\n ...(isGlobal ? theme.style : {}),\n ...inlineVars(dialogStateVars, {\n hasHeader,\n size,\n ...renderProps,\n isGlobal,\n }),\n }),\n [size, theme.style, isGlobal, hasHeader],\n );\n\n const values = useMemo<\n [\n [\n typeof ElementContext,\n ContextValue<\n ElementProps<\n ContextValue<HTMLAttributes<HTMLElement>, HTMLHeadingElement>,\n ContextValue<\n GroupProps<ButtonProps, HTMLButtonElement>,\n HTMLDivElement\n >\n >,\n HTMLElement\n >,\n ],\n ]\n >(\n () => [\n [\n ElementContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n header: {\n as: 'header',\n className: classNames?.header,\n ref: headerRef,\n values: [\n [\n AriaHeadingContext,\n {\n ...mapping.heading[size],\n slot: 'title',\n },\n ],\n [GroupContext, null],\n ],\n },\n content: { className: classNames?.content },\n footer: {\n as: 'footer',\n className: classNames?.footer,\n values: [\n [AriaHeadingContext, null],\n [\n GroupContext,\n {\n values: {\n slots: {\n [DEFAULT_SLOT]: mapping.primary[size] ?? {},\n close: mapping.close[size] ?? {},\n },\n },\n ...mapping.actions,\n },\n ],\n ],\n },\n },\n },\n ],\n ],\n [\n classNames?.header,\n classNames?.content,\n classNames?.footer,\n headerRef,\n mapping.actions,\n mapping.heading,\n mapping.primary,\n mapping.close,\n size,\n ],\n );\n\n const children = useCallback(\n (renderProps: ModalRenderProps) => (\n <Provider values={values}>\n <Modal className={classNames?.modal}>\n <RACDialog className={classNames?.dialog} role={role}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n isGlobal,\n isOpen: renderProps.state.isOpen,\n })}\n </RACDialog>\n </Modal>\n </Provider>\n ),\n [\n values,\n classNames?.modal,\n classNames?.dialog,\n role,\n childrenProp,\n isGlobal,\n ],\n );\n\n useEffect(() => {\n const node = parentRef?.current;\n const port = isSSR ? null : document.createElement('div');\n\n if (node && port) {\n port.classList.add(classNames?.portal ?? '');\n\n node.appendChild(port);\n\n setPortal(port);\n }\n\n return () => {\n port?.remove();\n\n setPortal(isSSR ? null : document.body);\n };\n }, [isSSR, parentRef, classNames?.portal]);\n\n if (!portal) {\n return null;\n }\n\n return (\n <ModalOverlay\n {...rest}\n ref={finalRef}\n className={classNames?.container}\n style={style}\n UNSTABLE_portalContainer={portal}\n >\n {children}\n </ModalOverlay>\n );\n});\n"]}