@accelint/design-system 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/components/aria/index.js.map +1 -1
  2. package/dist/components/button/button.css.d.ts +25 -24
  3. package/dist/components/button/index.d.ts +9 -40
  4. package/dist/components/button/index.js +23 -17
  5. package/dist/components/button/index.js.map +1 -1
  6. package/dist/components/button/types.d.ts +3 -2
  7. package/dist/components/checkbox/checkbox.css.d.ts +23 -23
  8. package/dist/components/checkbox/index.js.map +1 -1
  9. package/dist/components/chip/chip.css.d.ts +18 -18
  10. package/dist/components/chip/index.js.map +1 -1
  11. package/dist/components/collection/index.d.ts +3 -3
  12. package/dist/components/collection/index.js.map +1 -1
  13. package/dist/components/combo-box/combo-box.css.d.ts +9 -9
  14. package/dist/components/combo-box/index.js +9 -5
  15. package/dist/components/combo-box/index.js.map +1 -1
  16. package/dist/components/date-field/date-field.css.d.ts +17 -17
  17. package/dist/components/date-field/index.js +8 -4
  18. package/dist/components/date-field/index.js.map +1 -1
  19. package/dist/components/date-input/date-input.css.d.ts +25 -25
  20. package/dist/components/date-input/index.js +19 -8
  21. package/dist/components/date-input/index.js.map +1 -1
  22. package/dist/components/dialog/dialog.css.d.ts +16 -15
  23. package/dist/components/dialog/index.d.ts +1 -0
  24. package/dist/components/dialog/index.js +7 -5
  25. package/dist/components/dialog/index.js.map +1 -1
  26. package/dist/components/dialog/types.d.ts +1 -0
  27. package/dist/components/drawer/drawer.css.d.ts +17 -17
  28. package/dist/components/drawer/index.d.ts +1 -1
  29. package/dist/components/drawer/index.js +21 -8
  30. package/dist/components/drawer/index.js.map +1 -1
  31. package/dist/components/drawer/types.d.ts +1 -1
  32. package/dist/components/element/index.d.ts +1 -1
  33. package/dist/components/element/index.js +7 -3
  34. package/dist/components/element/index.js.map +1 -1
  35. package/dist/components/element/types.d.ts +2 -0
  36. package/dist/components/group/group.css.d.ts +7 -7
  37. package/dist/components/group/index.js +6 -6
  38. package/dist/components/group/index.js.map +1 -1
  39. package/dist/components/icon/icon.css.d.ts +9 -9
  40. package/dist/components/icon/index.js +4 -4
  41. package/dist/components/icon/index.js.map +1 -1
  42. package/dist/components/index.d.ts +35 -35
  43. package/dist/components/input/index.js +17 -8
  44. package/dist/components/input/index.js.map +1 -1
  45. package/dist/components/input/input.css.d.ts +20 -20
  46. package/dist/components/menu/index.d.ts +2 -2
  47. package/dist/components/menu/index.js +1 -1
  48. package/dist/components/menu/index.js.map +1 -1
  49. package/dist/components/menu/menu.css.d.ts +42 -42
  50. package/dist/components/merge-provider/index.js +15 -7
  51. package/dist/components/merge-provider/index.js.map +1 -1
  52. package/dist/components/merge-provider/types.d.ts +2 -0
  53. package/dist/components/number-field/index.d.ts +1 -1
  54. package/dist/components/number-field/index.js +8 -4
  55. package/dist/components/number-field/index.js.map +1 -1
  56. package/dist/components/number-field/number-field.css.d.ts +12 -12
  57. package/dist/components/number-field/types.d.ts +1 -1
  58. package/dist/components/options/index.js +1 -1
  59. package/dist/components/options/index.js.map +1 -1
  60. package/dist/components/options/options.css.d.ts +44 -44
  61. package/dist/components/picker/index.js.map +1 -1
  62. package/dist/components/picker/picker.css.d.ts +18 -18
  63. package/dist/components/popover/index.js +8 -4
  64. package/dist/components/popover/index.js.map +1 -1
  65. package/dist/components/popover/popover.css.d.ts +12 -12
  66. package/dist/components/query-builder/action-element.js.map +1 -1
  67. package/dist/components/query-builder/dataset-sample.js.map +1 -1
  68. package/dist/components/query-builder/group.js.map +1 -1
  69. package/dist/components/query-builder/index.js.map +1 -1
  70. package/dist/components/query-builder/query-builder.css.d.ts +53 -53
  71. package/dist/components/query-builder/value-editor.js.map +1 -1
  72. package/dist/components/query-builder/value-selector.js.map +1 -1
  73. package/dist/components/radio/index.js +12 -8
  74. package/dist/components/radio/index.js.map +1 -1
  75. package/dist/components/radio/radio.css.d.ts +22 -22
  76. package/dist/components/search-field/index.js +9 -5
  77. package/dist/components/search-field/index.js.map +1 -1
  78. package/dist/components/search-field/search-field.css.d.ts +9 -9
  79. package/dist/components/select/index.js +5 -5
  80. package/dist/components/select/index.js.map +1 -1
  81. package/dist/components/select/select.css.d.ts +12 -12
  82. package/dist/components/slider/index.js +48 -20
  83. package/dist/components/slider/index.js.map +1 -1
  84. package/dist/components/slider/slider.css.d.ts +27 -27
  85. package/dist/components/switch/index.js +4 -4
  86. package/dist/components/switch/index.js.map +1 -1
  87. package/dist/components/switch/switch.css.d.ts +16 -16
  88. package/dist/components/tabs/index.js +32 -20
  89. package/dist/components/tabs/index.js.map +1 -1
  90. package/dist/components/tabs/tabs.css.d.ts +25 -25
  91. package/dist/components/text-field/index.d.ts +3 -128
  92. package/dist/components/text-field/index.js +11 -7
  93. package/dist/components/text-field/index.js.map +1 -1
  94. package/dist/components/text-field/text-field.css.d.ts +8 -8
  95. package/dist/components/textarea/index.js +16 -7
  96. package/dist/components/textarea/index.js.map +1 -1
  97. package/dist/components/textarea/textarea.css.d.ts +22 -22
  98. package/dist/components/time-field/index.js +8 -4
  99. package/dist/components/time-field/index.js.map +1 -1
  100. package/dist/components/time-field/time-field.css.d.ts +17 -17
  101. package/dist/components/tooltip/index.js +17 -9
  102. package/dist/components/tooltip/index.js.map +1 -1
  103. package/dist/components/tooltip/tooltip.css.d.ts +11 -11
  104. package/dist/components/tree/index.js +5 -2
  105. package/dist/components/tree/index.js.map +1 -1
  106. package/dist/components/tree/tree.css.d.ts +45 -45
  107. package/dist/hooks/index.d.ts +13 -13
  108. package/dist/hooks/use-collection-render/index.d.ts +1 -1
  109. package/dist/hooks/use-collection-render/index.js +2 -3
  110. package/dist/hooks/use-collection-render/index.js.map +1 -1
  111. package/dist/hooks/use-context-props/index.js.map +1 -1
  112. package/dist/hooks/use-defaults/index.d.ts +32 -80
  113. package/dist/hooks/use-defaults/index.js +1 -4
  114. package/dist/hooks/use-defaults/index.js.map +1 -1
  115. package/dist/hooks/use-defaults/types.d.ts +1 -1
  116. package/dist/hooks/use-theme/index.d.ts +2 -2
  117. package/dist/hooks/use-theme/index.js.map +1 -1
  118. package/dist/hooks/use-theme/types.d.ts +1 -1
  119. package/dist/hooks/use-tree/index.js +3 -2
  120. package/dist/hooks/use-tree/index.js.map +1 -1
  121. package/dist/hooks/use-tree/utils.js +6 -9
  122. package/dist/hooks/use-tree/utils.js.map +1 -1
  123. package/dist/hooks/use-update-effect/index.js.map +1 -1
  124. package/dist/index.css +32 -32
  125. package/dist/index.d.ts +39 -39
  126. package/dist/ladle/actions.js.map +1 -1
  127. package/dist/styles/theme.css.d.ts +200 -200
  128. package/dist/test/setup.js +778 -1276
  129. package/dist/test/setup.js.map +1 -1
  130. package/dist/utils/css/index.d.ts +1 -1
  131. package/dist/utils/css/index.js.map +1 -1
  132. package/dist/utils/props/index.d.ts +1 -2
  133. package/dist/utils/props/index.js +1 -2
  134. package/dist/utils/props/index.js.map +1 -1
  135. package/dist/vanilla.d.ts +29 -29
  136. package/package.json +49 -48
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/aria/index.tsx"],"names":["AriaMenuSection","AriaListBoxSection","AriaSection","AriaSelectValue","AriaText"],"mappings":";;;;;AA+CA,SAAS,KACP,SAAA,EACA;AACA,EAAA,MAAM,OAAA,GAAU,cAAkC,IAAI,CAAA;AAEtD,EAAA,OAAO;AAAA,IACL,SAAA,EAAW,UAAA,CAAiB,SAAS,gBAAA,CAAiB,OAAO,GAAA,EAAK;AAChE,MAAA,MAAM,CAAC,WAAA,EAAa,SAAS,IAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,OAAO,CAAA;AAEpE,MAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,WAAA,EAAa,KAAK,SAAA,EAAW,CAAA;AAAA,IACrD,CAAC,CAAA;AAAA,IACD;AAAA,GACF;AACF;AAEO,IAAM,EAAE,SAAA,EAAW,cAAA,EAAgB,SAAS,qBAAA,EAAsB,GACvE,KAAK,UAAU;AAEV,IAAM,EAAE,SAAA,EAA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C7C,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,WAAA,EAAa,SAAS,CAAA,GAAI,eAAA;AAAA,IAC/B,KAAA;AAAA,IACA,GAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,uBAAO,GAAA,CAAC,OAAA,EAAA,EAAS,GAAG,WAAA,EAAa,KAAK,SAAA,EAAW,CAAA;AACnD,CAAC;AAEM,IAAM,sBAAA,GACX,cAAuE,IAAI;AAEtE,IAAM,eAAA,GAAkB,UAAA,CAAW,SAASC,gBAAAA,CAEjD,OAA4B,GAAA,EAAoC;AAChE,EAAA,MAAM,CAAC,WAAA,EAAa,SAAS,CAAA,GAAI,eAAA;AAAA,IAC/B,KAAA;AAAA,IACA,GAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,uBAAO,GAAA,CAAC,WAAA,EAAA,EAAa,GAAG,WAAA,EAAa,KAAK,SAAA,EAAW,CAAA;AACvD,CAAC;AAEM,IAAM,eAAA,GACX,cAAoD,IAAI;AAEnD,IAAM,QAAA,GAAW,UAAA,CAAW,SAASC,SAAAA,CAC1C,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,WAAA,EAAa,SAAS,IAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,eAAe,CAAA;AAE5E,EAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAM,GAAG,WAAA,EAAa,KAAK,SAAA,EAAW,CAAA;AAChD,CAAC","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n type ForwardedRef,\n type ReactNode,\n type RefAttributes,\n createContext,\n forwardRef,\n} from 'react';\nimport {\n type ContextValue,\n FieldError,\n Group,\n Header,\n Heading,\n Keyboard,\n Label,\n ListBoxSection,\n type ListBoxSectionProps,\n MenuSection,\n type MenuSectionProps,\n Section,\n type SectionProps,\n SelectValue,\n type SelectValueProps,\n Separator,\n Text,\n type TextProps,\n useContextProps,\n} from 'react-aria-components';\n\n/**\n * To better align with the guidance from RAC about establishing a unique\n * context for components to avoid conflict of props being provided by RAC\n * and design system components, this wrapping utility accepts an RAC and returns\n * a wrapped version along with the new context for the design system to use\n */\nfunction wrap<P extends object, E extends HTMLElement>(\n Component: (props: P & RefAttributes<E>) => ReactNode,\n) {\n const Context = createContext<ContextValue<P, E>>(null);\n\n return {\n Component: forwardRef<E, P>(function WrappedComponent(props, ref) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, Context);\n\n return <Component {...mergedProps} ref={mergedRef} />;\n }),\n Context,\n };\n}\n\nexport const { Component: AriaFieldError, Context: AriaFieldErrorContext } =\n wrap(FieldError);\n\nexport const { Component: AriaGroup, Context: AriaGroupContext } = wrap(Group);\n\nexport const { Component: AriaHeader, Context: AriaHeaderContext } =\n wrap(Header);\n\nexport const { Component: AriaHeading, Context: AriaHeadingContext } =\n wrap(Heading);\n\nexport const { Component: AriaKeyboard, Context: AriaKeyboardContext } =\n wrap(Keyboard);\n\nexport const { Component: AriaLabel, Context: AriaLabelContext } = wrap(Label);\n\nexport const { Component: AriaSeparator, Context: AriaSeparatorContext } =\n wrap(Separator);\n\n/**\n * Due to the complexity of types and technical constraints of TS, it's not\n * possible for the above wrapping utility to support components that accept\n * generic parameters. This means that these components must be manually wrapped\n */\n\nexport const AriaMenuSectionContext =\n createContext<ContextValue<MenuSectionProps<object>, HTMLElement>>(null);\n\nexport const AriaMenuSection = forwardRef(function AriaMenuSection<\n T extends object,\n>(props: MenuSectionProps<T>, ref: ForwardedRef<HTMLElement>) {\n const [mergedProps, mergedRef] = useContextProps(\n props,\n ref,\n AriaMenuSectionContext,\n );\n\n return <MenuSection {...mergedProps} ref={mergedRef} />;\n});\n\nexport const AriaListBoxSectionContext =\n createContext<ContextValue<ListBoxSectionProps<object>, HTMLElement>>(null);\n\nexport const AriaListBoxSection = forwardRef(function AriaListBoxSection<\n T extends object,\n>(props: ListBoxSectionProps<T>, ref: ForwardedRef<HTMLElement>) {\n const [mergedProps, mergedRef] = useContextProps(\n props,\n ref,\n AriaListBoxSectionContext,\n );\n\n return <ListBoxSection {...mergedProps} ref={mergedRef} />;\n});\n\nexport const AriaSectionContext =\n createContext<ContextValue<SectionProps<object>, HTMLElement>>(null);\n\nexport const AriaSection = forwardRef(function AriaSection<T extends object>(\n props: SectionProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(\n props,\n ref,\n AriaSectionContext,\n );\n\n return <Section {...mergedProps} ref={mergedRef} />;\n});\n\nexport const AriaSelectValueContext =\n createContext<ContextValue<SelectValueProps<object>, HTMLSpanElement>>(null);\n\nexport const AriaSelectValue = forwardRef(function AriaSelectValue<\n T extends object,\n>(props: SelectValueProps<T>, ref: ForwardedRef<HTMLSpanElement>) {\n const [mergedProps, mergedRef] = useContextProps(\n props,\n ref,\n AriaSelectValueContext,\n );\n\n return <SelectValue {...mergedProps} ref={mergedRef} />;\n});\n\nexport const AriaTextContext =\n createContext<ContextValue<TextProps, HTMLElement>>(null);\n\nexport const AriaText = forwardRef(function AriaText(\n props: TextProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, AriaTextContext);\n\n return <Text {...mergedProps} ref={mergedRef} />;\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/aria/index.tsx"],"names":["AriaMenuSection","AriaListBoxSection","AriaSection","AriaSelectValue","AriaText"],"mappings":";;;;;AA+CA,SAAS,KACP,SAAA,EACA;AACA,EAAA,MAAM,OAAA,GAAU,cAAkC,IAAI,CAAA;AAEtD,EAAA,OAAO;AAAA,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AAA,EAAM,GAAG,WAAA,EAAa,KAAK,SAAA,EAAW,CAAA;AAChD,CAAC","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n type ForwardedRef,\n forwardRef,\n type ReactNode,\n type RefAttributes,\n} from 'react';\nimport {\n type ContextValue,\n FieldError,\n Group,\n Header,\n Heading,\n Keyboard,\n Label,\n ListBoxSection,\n type ListBoxSectionProps,\n MenuSection,\n type MenuSectionProps,\n Section,\n type SectionProps,\n SelectValue,\n type SelectValueProps,\n Separator,\n Text,\n type TextProps,\n useContextProps,\n} from 'react-aria-components';\n\n/**\n * To better align with the guidance from RAC about establishing a unique\n * context for components to avoid conflict of props being provided by RAC\n * and design system components, this wrapping utility accepts an RAC and returns\n * a wrapped version along with the new context for the design system to use\n */\nfunction wrap<P extends object, E extends HTMLElement>(\n Component: (props: P & RefAttributes<E>) => ReactNode,\n) {\n const Context = createContext<ContextValue<P, E>>(null);\n\n return {\n Component: forwardRef<E, P>(function WrappedComponent(props, ref) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, Context);\n\n return <Component {...mergedProps} ref={mergedRef} />;\n }),\n Context,\n };\n}\n\nexport const { Component: AriaFieldError, Context: AriaFieldErrorContext } =\n wrap(FieldError);\n\nexport const { Component: AriaGroup, Context: AriaGroupContext } = wrap(Group);\n\nexport const { Component: AriaHeader, Context: AriaHeaderContext } =\n wrap(Header);\n\nexport const { Component: AriaHeading, Context: AriaHeadingContext } =\n wrap(Heading);\n\nexport const { Component: AriaKeyboard, Context: AriaKeyboardContext } =\n wrap(Keyboard);\n\nexport const { Component: AriaLabel, Context: AriaLabelContext } = wrap(Label);\n\nexport const { Component: AriaSeparator, Context: AriaSeparatorContext } =\n wrap(Separator);\n\n/**\n * Due to the complexity of types and technical constraints of TS, it's not\n * possible for the above wrapping utility to support components that accept\n * generic parameters. This means that these components must be manually wrapped\n */\n\nexport const AriaMenuSectionContext =\n createContext<ContextValue<MenuSectionProps<object>, HTMLElement>>(null);\n\nexport const AriaMenuSection = forwardRef(function AriaMenuSection<\n T extends object,\n>(props: MenuSectionProps<T>, ref: ForwardedRef<HTMLElement>) {\n const [mergedProps, mergedRef] = useContextProps(\n props,\n ref,\n AriaMenuSectionContext,\n );\n\n return <MenuSection {...mergedProps} ref={mergedRef} />;\n});\n\nexport const AriaListBoxSectionContext =\n createContext<ContextValue<ListBoxSectionProps<object>, HTMLElement>>(null);\n\nexport const AriaListBoxSection = forwardRef(function AriaListBoxSection<\n T extends object,\n>(props: ListBoxSectionProps<T>, ref: ForwardedRef<HTMLElement>) {\n const [mergedProps, mergedRef] = useContextProps(\n props,\n ref,\n AriaListBoxSectionContext,\n );\n\n return <ListBoxSection {...mergedProps} ref={mergedRef} />;\n});\n\nexport const AriaSectionContext =\n createContext<ContextValue<SectionProps<object>, HTMLElement>>(null);\n\nexport const AriaSection = forwardRef(function AriaSection<T extends object>(\n props: SectionProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(\n props,\n ref,\n AriaSectionContext,\n );\n\n return <Section {...mergedProps} ref={mergedRef} />;\n});\n\nexport const AriaSelectValueContext =\n createContext<ContextValue<SelectValueProps<object>, HTMLSpanElement>>(null);\n\nexport const AriaSelectValue = forwardRef(function AriaSelectValue<\n T extends object,\n>(props: SelectValueProps<T>, ref: ForwardedRef<HTMLSpanElement>) {\n const [mergedProps, mergedRef] = useContextProps(\n props,\n ref,\n AriaSelectValueContext,\n );\n\n return <SelectValue {...mergedProps} ref={mergedRef} />;\n});\n\nexport const AriaTextContext =\n createContext<ContextValue<TextProps, HTMLElement>>(null);\n\nexport const AriaText = forwardRef(function AriaText(\n props: TextProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, AriaTextContext);\n\n return <Text {...mergedProps} ref={mergedRef} />;\n});\n"]}
@@ -1,5 +1,6 @@
1
1
  import { ButtonClassNames } from './types.js';
2
2
  import 'react-aria-components';
3
+ import '../../types/generic.js';
3
4
  import '../../types/props.js';
4
5
  import '../../types/react-aria.js';
5
6
  import 'react';
@@ -7,34 +8,34 @@ import '../icon/types.js';
7
8
 
8
9
  declare const buttonContainer: string;
9
10
  declare const buttonColorVars: {
10
- nonSolidColor: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
11
- bareBackground: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
12
- hollowBorder: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
13
- solidBackground: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
14
- solidColor: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
15
- background: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16
- border: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
17
- color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
11
+ nonSolidColor: `var(--${string})`;
12
+ bareBackground: `var(--${string})`;
13
+ hollowBorder: `var(--${string})`;
14
+ solidBackground: `var(--${string})`;
15
+ solidColor: `var(--${string})`;
16
+ background: `var(--${string})`;
17
+ border: `var(--${string})`;
18
+ color: `var(--${string})`;
18
19
  };
19
20
  declare const buttonSpaceVars: {
20
- gap: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
21
- minWidth: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
22
- width: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
23
- x: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
24
- y: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
21
+ gap: `var(--${string})`;
22
+ minWidth: `var(--${string})`;
23
+ width: `var(--${string})`;
24
+ x: `var(--${string})`;
25
+ y: `var(--${string})`;
25
26
  };
26
27
  declare const buttonStateVars: {
27
- color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
28
- size: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
29
- variant: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
30
- isCurrent: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
31
- isDisabled: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
32
- isFocused: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
33
- isFocusVisible: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
34
- isHovered: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
35
- isPending: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
36
- isPressed: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
37
- isSelected: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
28
+ color: `var(--${string})`;
29
+ size: `var(--${string})`;
30
+ variant: `var(--${string})`;
31
+ isCurrent: `var(--${string})`;
32
+ isDisabled: `var(--${string})`;
33
+ isFocused: `var(--${string})`;
34
+ isFocusVisible: `var(--${string})`;
35
+ isHovered: `var(--${string})`;
36
+ isPending: `var(--${string})`;
37
+ isPressed: `var(--${string})`;
38
+ isSelected: `var(--${string})`;
38
39
  };
39
40
  declare const buttonClassNames: ButtonClassNames;
40
41
 
@@ -1,47 +1,16 @@
1
- import * as react from 'react';
2
1
  import { Context } from 'react';
3
- import * as react_aria_components from 'react-aria-components';
4
2
  import { ContextValue } from 'react-aria-components';
5
- import { ButtonRenderProps, ButtonColors, ButtonMapping, ButtonSizes, ButtonVariants, ButtonProps, LinkButtonProps, ToggleButtonProps } from './types.js';
6
- import { RenderPropsChildren } from '../../types/react-aria.js';
3
+ import { ButtonProps, LinkButtonProps, ToggleButtonProps } from './types.js';
4
+ import '../../types/generic.js';
7
5
  import '../../types/props.js';
6
+ import '../../types/react-aria.js';
8
7
  import '../icon/types.js';
9
8
 
10
- declare const ButtonContext: Context<ContextValue<ButtonProps, HTMLButtonElement>>;
11
- declare const Button: (props: Omit<react_aria_components.ButtonProps, "children" | "className" | "style"> & {
12
- children?: RenderPropsChildren<ButtonRenderProps>;
13
- classNames?: Partial<{
14
- container: string;
15
- button: string;
16
- }>;
17
- color?: ButtonColors;
18
- mapping?: Partial<ButtonMapping>;
19
- size?: ButtonSizes;
20
- variant?: ButtonVariants;
21
- } & react.RefAttributes<HTMLButtonElement>) => react.ReactElement | null;
22
- declare const LinkButtonContext: Context<ContextValue<LinkButtonProps, HTMLAnchorElement>>;
23
- declare const LinkButton: (props: Omit<react_aria_components.LinkProps, "children" | "className" | "style"> & {
24
- children?: RenderPropsChildren<ButtonRenderProps>;
25
- classNames?: Partial<{
26
- container: string;
27
- button: string;
28
- }>;
29
- color?: ButtonColors;
30
- mapping?: Partial<ButtonMapping>;
31
- size?: ButtonSizes;
32
- variant?: ButtonVariants;
33
- } & react.RefAttributes<HTMLAnchorElement>) => react.ReactElement | null;
34
- declare const ToggleButtonContext: Context<ContextValue<ToggleButtonProps, HTMLButtonElement>>;
35
- declare const ToggleButton: (props: Omit<react_aria_components.ToggleButtonProps, "children" | "className" | "style"> & {
36
- children?: RenderPropsChildren<ButtonRenderProps>;
37
- classNames?: Partial<{
38
- container: string;
39
- button: string;
40
- }>;
41
- color?: ButtonColors;
42
- mapping?: Partial<ButtonMapping>;
43
- size?: ButtonSizes;
44
- variant?: ButtonVariants;
45
- } & react.RefAttributes<HTMLButtonElement>) => react.ReactElement | null;
9
+ declare const ButtonContext: Context<ContextValue<ButtonProps, HTMLButtonElement> | null>;
10
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
+ declare const LinkButtonContext: Context<ContextValue<LinkButtonProps, HTMLAnchorElement> | null>;
12
+ declare const LinkButton: React.ForwardRefExoticComponent<LinkButtonProps & React.RefAttributes<HTMLAnchorElement>>;
13
+ declare const ToggleButtonContext: Context<ContextValue<ToggleButtonProps, HTMLButtonElement> | null>;
14
+ declare const ToggleButton: React.ForwardRefExoticComponent<ToggleButtonProps & React.RefAttributes<HTMLButtonElement>>;
46
15
 
47
16
  export { Button, ButtonContext, LinkButton, LinkButtonContext, ToggleButton, ToggleButtonContext };
@@ -96,25 +96,31 @@ function useButton(props, ref, context, key) {
96
96
  );
97
97
  }
98
98
  var ButtonContext = createContext(null);
99
- var Button = forwardRef(function Button2(props, ref) {
100
- const buttonProps = useButton(props, ref, ButtonContext, "Button");
101
- return /* @__PURE__ */ jsx(Button$1, { ...buttonProps });
102
- });
99
+ var Button = forwardRef(
100
+ function Button2(props, ref) {
101
+ const buttonProps = useButton(props, ref, ButtonContext, "Button");
102
+ return /* @__PURE__ */ jsx(Button$1, { ...buttonProps });
103
+ }
104
+ );
103
105
  var LinkButtonContext = createContext(null);
104
- var LinkButton = forwardRef(function LinkButton2(props, ref) {
105
- const buttonProps = useButton(props, ref, LinkButtonContext, "LinkButton");
106
- return /* @__PURE__ */ jsx(Link, { ...buttonProps });
107
- });
106
+ var LinkButton = forwardRef(
107
+ function LinkButton2(props, ref) {
108
+ const buttonProps = useButton(props, ref, LinkButtonContext, "LinkButton");
109
+ return /* @__PURE__ */ jsx(Link, { ...buttonProps });
110
+ }
111
+ );
108
112
  var ToggleButtonContext = createContext(null);
109
- var ToggleButton = forwardRef(function ToggleButton2(props, ref) {
110
- const buttonProps = useButton(
111
- props,
112
- ref,
113
- ToggleButtonContext,
114
- "ToggleButton"
115
- );
116
- return /* @__PURE__ */ jsx(ToggleButton$1, { ...buttonProps });
117
- });
113
+ var ToggleButton = forwardRef(
114
+ function ToggleButton2(props, ref) {
115
+ const buttonProps = useButton(
116
+ props,
117
+ ref,
118
+ ToggleButtonContext,
119
+ "ToggleButton"
120
+ );
121
+ return /* @__PURE__ */ jsx(ToggleButton$1, { ...buttonProps });
122
+ }
123
+ );
118
124
 
119
125
  export { Button, ButtonContext, LinkButton, LinkButtonContext, ToggleButton, ToggleButtonContext };
120
126
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/button/index.tsx"],"names":["Button","RACButton","LinkButton","ToggleButton","RACToggleButton"],"mappings":";;;;;;;;;;;;;;;;AAmDA,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,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,CAAA;AAChC,CAAC;AAEM,IAAM,mBAAA,GACX,cAAkE,IAAI;AAEjE,IAAM,YAAA,GAAe,UAAA,CAAW,SAASC,aAAAA,CAC9C,OACA,GAAA,EACA;AACA,EAAA,MAAM,WAAA,GAAc,SAAA;AAAA,IAClB,KAAA;AAAA,IACA,GAAA;AAAA,IACA,mBAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,uBAAO,GAAA,CAACC,cAAA,EAAA,EAAiB,GAAG,WAAA,EAAa,CAAA;AAC3C,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 { noop } from '@accelint/core';\nimport { clsx } from 'clsx';\nimport {\n type Context,\n type ForwardedRef,\n createContext,\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 type { OmitProtectedProps } from '../../types/props';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { IconContext } from '../icon';\nimport type { IconProps } from '../icon/types';\nimport { buttonClassNames, buttonStateVars } from './button.css';\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: 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 =\n createContext<ContextValue<ButtonProps, HTMLButtonElement>>(null);\n\nexport const Button = forwardRef(function Button(\n props: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n const buttonProps = useButton(props, ref, ButtonContext, 'Button');\n\n return <RACButton {...buttonProps} />;\n});\n\nexport const LinkButtonContext =\n createContext<ContextValue<LinkButtonProps, HTMLAnchorElement>>(null);\n\nexport const LinkButton = forwardRef(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\nexport const ToggleButtonContext =\n createContext<ContextValue<ToggleButtonProps, HTMLButtonElement>>(null);\n\nexport const ToggleButton = forwardRef(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"]}
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,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;AAAA;AAAA;AAAA,IAGA,CAAC,IAAA,EAAM,UAAA,EAAY,QAAA,EAAU,UAAA,EAAY,WAAW,KAAK;AAAA,GAC3D;AACF;AAEO,IAAM,aAAA,GAGD,cAA4D,IAAI;AAErE,IAAM,MAAA,GAAS,UAAA;AAAA,EACpB,SAASA,OAAAA,CAAO,KAAA,EAAoB,GAAA,EAAsC;AACxE,IAAA,MAAM,WAAA,GAAc,SAAA,CAAU,KAAA,EAAO,GAAA,EAAK,eAAe,QAAQ,CAAA;AAEjE,IAAA,uBAAO,GAAA,CAACC,QAAA,EAAA,EAAW,GAAG,WAAA,EAAa,CAAA;AAAA,EACrC;AACF;AAIO,IAAM,iBAAA,GAIX,cAAgE,IAAI;AAE/D,IAAM,UAAA,GAAa,UAAA;AAAA,EACxB,SAASC,WAAAA,CACP,KAAA,EACA,GAAA,EACA;AACA,IAAA,MAAM,WAAA,GAAc,SAAA,CAAU,KAAA,EAAO,GAAA,EAAK,mBAAmB,YAAY,CAAA;AAEzE,IAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAM,GAAG,WAAA,EAAa,CAAA;AAAA,EAChC;AACF;AAIO,IAAM,mBAAA,GAIX,cAAkE,IAAI;AAEjE,IAAM,YAAA,GAAe,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,4 +1,5 @@
1
- import { ButtonRenderProps as ButtonRenderProps$1, LinkRenderProps, ToggleButtonRenderProps, ButtonProps as ButtonProps$1, LinkProps, ToggleButtonProps as ToggleButtonProps$1 } from 'react-aria-components';
1
+ import { ButtonProps as ButtonProps$1, ButtonRenderProps as ButtonRenderProps$1, LinkRenderProps, ToggleButtonRenderProps, LinkProps, ToggleButtonProps as ToggleButtonProps$1 } from 'react-aria-components';
2
+ import { AsType } from '../../types/generic.js';
2
3
  import { OmitProtectedProps } from '../../types/props.js';
3
4
  import { RenderPropsChildren } from '../../types/react-aria.js';
4
5
  import { IconProps } from '../icon/types.js';
@@ -25,7 +26,7 @@ type BaseButtonProps = {
25
26
  variant?: ButtonVariants;
26
27
  };
27
28
  type ButtonState = Omit<ButtonRenderProps, 'state'> & Required<Pick<BaseButtonProps, 'color' | 'size' | 'variant'>>;
28
- type ButtonProps = Omit<ButtonProps$1, 'children' | 'className' | 'style'> & BaseButtonProps;
29
+ type ButtonProps = AsType<Omit<ButtonProps$1, 'children' | 'className' | 'style'> & BaseButtonProps>;
29
30
  type ToggleButtonProps = Omit<ToggleButtonProps$1, 'children' | 'className' | 'style'> & BaseButtonProps;
30
31
  type LinkButtonProps = Omit<LinkProps, 'children' | 'className' | 'style'> & BaseButtonProps;
31
32
 
@@ -9,35 +9,35 @@ import '../icon/types.js';
9
9
  declare const checkboxContainer: string;
10
10
  declare const checkboxGroupContainer: string;
11
11
  declare const checkboxColorVars: {
12
- border: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
13
- background: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
14
- color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
15
- indicator: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
12
+ border: `var(--${string})`;
13
+ background: `var(--${string})`;
14
+ color: `var(--${string})`;
15
+ indicator: `var(--${string})`;
16
16
  };
17
17
  declare const checkboxSpaceVars: {
18
- dimension: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
19
- gap: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
20
- elementGap: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
18
+ dimension: `var(--${string})`;
19
+ gap: `var(--${string})`;
20
+ elementGap: `var(--${string})`;
21
21
  };
22
22
  declare const checkboxStateVars: {
23
- alignInput: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
24
- isDisabled: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
25
- isFocused: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
26
- isFocusVisible: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
27
- isHovered: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
28
- isIndeterminate: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
29
- isInvalid: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
30
- isPressed: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
31
- isReadOnly: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
32
- isRequired: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
33
- isSelected: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
23
+ alignInput: `var(--${string})`;
24
+ isDisabled: `var(--${string})`;
25
+ isFocused: `var(--${string})`;
26
+ isFocusVisible: `var(--${string})`;
27
+ isHovered: `var(--${string})`;
28
+ isIndeterminate: `var(--${string})`;
29
+ isInvalid: `var(--${string})`;
30
+ isPressed: `var(--${string})`;
31
+ isReadOnly: `var(--${string})`;
32
+ isRequired: `var(--${string})`;
33
+ isSelected: `var(--${string})`;
34
34
  };
35
35
  declare const checkboxGroupStateVars: {
36
- orientation: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
37
- isDisabled: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
38
- isReadOnly: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
39
- isRequired: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
40
- isInvalid: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
36
+ orientation: `var(--${string})`;
37
+ isDisabled: `var(--${string})`;
38
+ isReadOnly: `var(--${string})`;
39
+ isRequired: `var(--${string})`;
40
+ isInvalid: `var(--${string})`;
41
41
  };
42
42
  declare const checkboxClassNames: CheckboxClassNames;
43
43
 
@@ -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,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AACC,eAAA;AAAA,IAAA;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 type ForwardedRef,\n createContext,\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 type { IconProps } from '../icon/types';\nimport {\n checkboxClassNames,\n checkboxGroupStateVars,\n checkboxStateVars,\n} from './checkbox.css';\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,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,MAA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AAA,MACH;AAAA,KACD,CAAA;AAAA,IACH,CAAC,WAAW;AAAA,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,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"]}
@@ -9,32 +9,32 @@ import '../icon/types.js';
9
9
 
10
10
  declare const chipContainer: string;
11
11
  declare const chipColorVars: {
12
- background: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
13
- border: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
14
- color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
12
+ background: `var(--${string})`;
13
+ border: `var(--${string})`;
14
+ color: `var(--${string})`;
15
15
  };
16
16
  declare const chipSpaceVars: {
17
17
  list: {
18
- gap: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
18
+ gap: `var(--${string})`;
19
19
  };
20
20
  chip: {
21
- gap: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
22
- x: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
23
- y: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
21
+ gap: `var(--${string})`;
22
+ x: `var(--${string})`;
23
+ y: `var(--${string})`;
24
24
  };
25
25
  };
26
26
  declare const chipStateVars: {
27
- color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
28
- size: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
29
- allowsRemoving: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
30
- selectionBehavior: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
31
- selectionMode: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
32
- isDisabled: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
33
- isFocused: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
34
- isFocusVisible: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
35
- isHovered: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
36
- isPressed: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
37
- isSelected: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
27
+ color: `var(--${string})`;
28
+ size: `var(--${string})`;
29
+ allowsRemoving: `var(--${string})`;
30
+ selectionBehavior: `var(--${string})`;
31
+ selectionMode: `var(--${string})`;
32
+ isDisabled: `var(--${string})`;
33
+ isFocused: `var(--${string})`;
34
+ isFocusVisible: `var(--${string})`;
35
+ isHovered: `var(--${string})`;
36
+ isPressed: `var(--${string})`;
37
+ isSelected: `var(--${string})`;
38
38
  };
39
39
  declare const chipClassNames: ChipClassNames;
40
40
 
@@ -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,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA;AAAO;AAEtC,CAAA;AAEO,SAAS,KAAK,KAAA,EAAkB;AACrC,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AAC,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 type ForwardedRef,\n createContext,\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 type { ButtonProps } from '../button/types';\nimport { chipClassNames, chipStateVars } from './chip.css';\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,IAAA,EAAM,IAAA,EAAM,SAAS,MAAA;AAAO;AAEtC,CAAA;AAEO,SAAS,KAAK,KAAA,EAAkB;AACrC,EAAA,MAAM,SAAA,G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jD,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,5 +1,5 @@
1
- import { Collection, Node } from '@react-types/shared';
2
1
  import { Context } from 'react';
2
+ import { Collection, Node } from '@react-types/shared';
3
3
  import { CollectionRenderer } from 'react-aria-components';
4
4
  import { MergeProviderProps } from '../merge-provider/types.js';
5
5
  import '../../types/react-aria.js';
@@ -10,8 +10,8 @@ import '../../types/react-aria.js';
10
10
  * Section as wrapper of list items at the top level as a styleable
11
11
  * element within the RAC container
12
12
  */
13
- declare function createCollectionRenderer<C extends {
14
- readonly collection: Collection<Node<unknown>>;
13
+ declare function createCollectionRenderer<T extends Collection<Node<object>>, C extends {
14
+ readonly collection: T;
15
15
  }, V extends MergeProviderProps['values']>(context: Context<C>, values: V): CollectionRenderer;
16
16
 
17
17
  export { createCollectionRenderer };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/collection/index.tsx"],"names":[],"mappings":";;;;;;AAyBO,SAAS,wBAAA,CAGd,SAAqB,MAAA,EAA+B;AACpD,EAAA,OAAO;AAAA,IACL,gBAAgB,CAAC,EAAE,qBAAoB,qBACrC,GAAA,CAAC,iBAAc,MAAA,EACZ,QAAA,EAAA,mBAAA;AAAA,MACC,UAAA,CAAW,OAAO,CAAA,EAAG,UAAA;AAAA,MACrB,IAAA;AAAA,MACA;AAAA,KACF,EACF,CAAA;AAAA,IAEF,gBAAA,EAAkB,CAAC,EAAE,UAAA,EAAY,QAAQ,mBAAA,EAAoB,qBAC3D,GAAA,CAAC,aAAA,EAAA,EAAc,MAAA,EACZ,QAAA,EAAA,mBAAA,CAAoB,UAAA,EAAY,MAAA,EAAQ,mBAAmB,CAAA,EAC9D;AAAA,GAEJ;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 type { Collection, Node } from '@react-types/shared';\nimport { type Context, useContext } from 'react';\nimport type { CollectionRenderer } from 'react-aria-components';\nimport { useCollectionRender } from '../../hooks/use-collection-render';\nimport { MergeProvider } from '../merge-provider';\nimport type { MergeProviderProps } from '../merge-provider/types';\n\n/**\n * Replace the default collection renderer to allow for injection of\n * context props for multiple composed components. Also enables use of\n * Section as wrapper of list items at the top level as a styleable\n * element within the RAC container\n */\nexport function createCollectionRenderer<\n C extends { readonly collection: Collection<Node<unknown>> },\n V extends MergeProviderProps['values'],\n>(context: Context<C>, values: V): CollectionRenderer {\n return {\n CollectionRoot: ({ renderDropIndicator }) => (\n <MergeProvider values={values}>\n {useCollectionRender(\n useContext(context)?.collection,\n null,\n renderDropIndicator,\n )}\n </MergeProvider>\n ),\n CollectionBranch: ({ collection, parent, renderDropIndicator }) => (\n <MergeProvider values={values}>\n {useCollectionRender(collection, parent, renderDropIndicator)}\n </MergeProvider>\n ),\n };\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/collection/index.tsx"],"names":[],"mappings":";;;;;;AAyBO,SAAS,wBAAA,CAId,SAAqB,MAAA,EAA+B;AACpD,EAAA,OAAO;AAAA,IACL,gBAAgB,CAAC,EAAE,qBAAoB,qBACrC,GAAA,CAAC,iBAAc,MAAA,EACZ,QAAA,EAAA,mBAAA;AAAA,MACC,UAAA,CAAW,OAAO,CAAA,EAAG,UAAA;AAAA,MACrB,IAAA;AAAA,MACA;AAAA,KACF,EACF,CAAA;AAAA,IAEF,gBAAA,EAAkB,CAAC,EAAE,UAAA,EAAY,QAAQ,mBAAA,EAAoB,qBAC3D,GAAA,CAAC,aAAA,EAAA,EAAc,MAAA,EACZ,QAAA,EAAA,mBAAA,CAAoB,UAAA,EAAY,MAAA,EAAQ,mBAAmB,CAAA,EAC9D;AAAA,GAEJ;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 { type Context, useContext } from 'react';\nimport { useCollectionRender } from '../../hooks/use-collection-render';\nimport { MergeProvider } from '../merge-provider';\nimport type { Collection, Node } from '@react-types/shared';\nimport type { CollectionRenderer } from 'react-aria-components';\nimport type { MergeProviderProps } from '../merge-provider/types';\n\n/**\n * Replace the default collection renderer to allow for injection of\n * context props for multiple composed components. Also enables use of\n * Section as wrapper of list items at the top level as a styleable\n * element within the RAC container\n */\nexport function createCollectionRenderer<\n T extends Collection<Node<object>>,\n C extends { readonly collection: T },\n V extends MergeProviderProps['values'],\n>(context: Context<C>, values: V): CollectionRenderer {\n return {\n CollectionRoot: ({ renderDropIndicator }) => (\n <MergeProvider values={values}>\n {useCollectionRender(\n useContext(context)?.collection,\n null,\n renderDropIndicator,\n )}\n </MergeProvider>\n ),\n CollectionBranch: ({ collection, parent, renderDropIndicator }) => (\n <MergeProvider values={values}>\n {useCollectionRender(collection, parent, renderDropIndicator)}\n </MergeProvider>\n ),\n };\n}\n"]}
@@ -13,22 +13,22 @@ import '../options/types.js';
13
13
  declare const comboBoxContainer: string;
14
14
  declare const comboBoxColorVars: {
15
15
  description: {
16
- color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16
+ color: `var(--${string})`;
17
17
  };
18
18
  error: {
19
- color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
19
+ color: `var(--${string})`;
20
20
  };
21
21
  };
22
22
  declare const comboBoxSpaceVars: {
23
- x: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
24
- y: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
23
+ x: `var(--${string})`;
24
+ y: `var(--${string})`;
25
25
  };
26
26
  declare const comboBoxStateVars: {
27
- size: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
28
- isDisabled: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
29
- isInvalid: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
30
- isOpen: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
31
- isRequired: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
27
+ size: `var(--${string})`;
28
+ isDisabled: `var(--${string})`;
29
+ isInvalid: `var(--${string})`;
30
+ isOpen: `var(--${string})`;
31
+ isRequired: `var(--${string})`;
32
32
  };
33
33
  declare const comboBoxClassNames: ComboBoxClassNames;
34
34
 
@@ -30,14 +30,18 @@ var defaultMapping = {
30
30
  };
31
31
  var ComboBoxContext = createContext(null);
32
32
  var ComboBox = forwardRef(function ComboBox2(props, ref) {
33
- [props, ref] = useContextProps(props, ref, ComboBoxContext);
34
- props = useDefaultProps(props, "ComboBox");
33
+ const [contextProps, contextRef] = useContextProps(
34
+ props,
35
+ ref,
36
+ ComboBoxContext
37
+ );
38
+ const finalProps = useDefaultProps(contextProps, "ComboBox");
35
39
  const {
36
40
  children: childrenProp,
37
41
  classNames: classNamesProp,
38
42
  mapping: mappingProp,
39
43
  size = "lg"
40
- } = props;
44
+ } = finalProps;
41
45
  const theme = useTheme();
42
46
  const mapping = useMemo(
43
47
  () => ({
@@ -105,8 +109,8 @@ var ComboBox = forwardRef(function ComboBox2(props, ref) {
105
109
  return /* @__PURE__ */ jsx(
106
110
  ComboBox$1,
107
111
  {
108
- ...props,
109
- ref,
112
+ ...finalProps,
113
+ ref: contextRef,
110
114
  className: classNames?.container,
111
115
  style,
112
116
  children